/* * Copyright (c) 2019 AVM GmbH . * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef __OFFLOAD__PCE_BROKER_H__ #define __OFFLOAD__PCE_BROKER_H__ enum pce_idx_range { PCE_RANGE_LAN_SHARED = 0, PCE_RANGE_DYNAMIC, PCE_RANGE_FIXED }; #define PCE_IDX_ERR(idx) ((idx) < 0) int pce_idx_alloc(enum pce_idx_range range); bool pce_idx_request(int idx); void pce_idx_free(int idx); #define PCE_TABLE_SIZE 512 #define PCE_TABLE_LAN_SIZE 64 enum pce_rule_idx { PCE_RULE_IDX_LAN_SHARED = 0, /* ... Fixed and dynamic indices usable on both switches ... */ PCE_RULE_IDX_LAN_SHARED_LAST = PCE_TABLE_LAN_SIZE - 1, PCE_RULE_IDX_LAN_SHARED_CATCHALL = PCE_RULE_IDX_LAN_SHARED_LAST, PCE_RULE_IDX_DYNAMIC, /* ... Dynamic indices for GSWIP-R ... */ PCE_RULE_IDX_DYNAMIC_LAST = (PCE_TABLE_SIZE / 2) - 1, PCE_RULE_IDX_FIXED, /* ... Fixed rules for GSWIP-R ... */ PCE_RULE_IDX_LRO_EXCEPTION = PCE_RULE_IDX_FIXED, PCE_RULE_IDX_LRO_EXCEPTION_LAST = PCE_RULE_IDX_LRO_EXCEPTION + 15, PCE_RULE_IDX_ROUTEEXT_TCP, PCE_RULE_IDX_ROUTEEXT_UDP, /* add static rules above */ PCE_RULE_IDX_LAST = PCE_TABLE_SIZE - 1, PCE_RULE_IDX_FIXED_LAST = PCE_RULE_IDX_LAST }; /* #include "../ethernet/lantiq/switch-api/gsw_flow_core.h" */ enum { FLAG_NO = 0, FLAG_END, FLAG_CAPWAP, FLAG_GRE, FLAG_LEN, FLAG_GREK, FLAG_NN1, FLAG_NN2, FLAG_ITAG, FLAG_1VLAN, FLAG_2VLAN, /* 10 */ FLAG_3VLAN, FLAG_4VLAN, FLAG_SNAP, FLAG_PPPOES, FLAG_1IPV4, FLAG_1IPV6, FLAG_2IPV4, FLAG_2IPV6, FLAG_ROUTEXP, FLAG_TCP, /* 20 */ FLAG_1UDP, FLAG_IGMP, FLAG_IPV4OPT, FLAG_1IPV6EXT, FLAG_TCPACK, FLAG_IPFRAG, FLAG_EAPOL, FLAG_2IPV6EXT, FLAG_2UDP, FLAG_L2TPNEXP, /* 30 */ FLAG_LROEXP, FLAG_L2TP, FLAG_GRE_VLAN1, FLAG_GRE_VLAN2, FLAG_GRE_PPPOE, FLAG_NN13, FLAG_NN14, FLAG_NN15, FLAG_NN16, FLAG_NN17, /* 40 */ FLAG_NN18, FLAG_NN19, FLAG_NN20, FLAG_NN21, FLAG_NN22, FLAG_NN23, FLAG_NN24, FLAG_NN25, FLAG_NN26, FLAG_NN27, /* 50 */ FLAG_NN28, FLAG_NN29, FLAG_NN30, FLAG_NN31, FLAG_NN32, FLAG_NN33, FLAG_NN34, FLAG_NN35, FLAG_NN36, FLAG_NN37, /* 60 */ FLAG_NN38, FLAG_NN39, FLAG_NN40, }; #endif // __OFFLOAD__PCE_BROKER_H__