46 #define PPPOE_VER_TYPE 0x11 47 #define PPPOE_PADS 0x65 75 #define foreach_pppoe_input_next \ 76 _(DROP, "error-drop") \ 77 _(IP4_INPUT, "ip4-input") \ 78 _(IP6_INPUT, "ip6-input" ) \ 79 _(CP_INPUT, "pppoe-cp-dispatch" ) \ 83 #define _(s,n) PPPOE_INPUT_NEXT_##s, 91 #define pppoe_error(n,s) PPPOE_ERROR_##n, 99 #define MTU_BUFFERS ((MTU + VLIB_BUFFER_DATA_SIZE - 1) / VLIB_BUFFER_DATA_SIZE) 100 #define NUM_BUFFERS_TO_ALLOC 32 105 #define PPPOE_NUM_BUCKETS (64 * 1024) 106 #define PPPOE_MEMORY_SIZE (8<<20) 157 BVT (clib_bihash) link_table;
160 BVT (clib_bihash) session_table;
163 u32 *free_pppoe_session_hw_if_indices;
166 u32 *session_index_by_sw_if_index;
216 #if CLIB_ARCH_IS_LITTLE_ENDIAN 221 temp = *((
u64 *) (mac_address)) << 16;
222 temp = (temp & ~0xffff) | (
u64) (session_id);
228 temp = *((
u64 *) (mac_address)) >> 16;
229 temp = temp | (((
u64) session_id) << 48);
253 else if (result0->
fields.sw_if_index == ~0)
256 result0->
fields.sw_if_index = sw_if_index0;
257 result0->
fields.session_index = ~0;
258 cached_key->
raw = ~0;
263 result0->
fields.sw_if_index = sw_if_index0;
267 BVT (clib_bihash_kv) kv;
269 kv.value = result0->
raw;
286 if (key0->
raw == cached_key->
raw)
289 result0->
raw = cached_result->
raw;
294 BVT (clib_bihash_kv) kv;
299 result0->
raw = kv.value;
302 cached_key->
raw = key0->
raw;
303 cached_result->
raw = result0->
raw;
319 BVT (clib_bihash_kv) kv;
321 kv.value = result0->
raw;
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
static_always_inline void pppoe_learn_process(BVT(clib_bihash)*table, u32 sw_if_index0, pppoe_entry_key_t *key0, pppoe_entry_key_t *cached_key, u32 *bucket0, pppoe_entry_result_t *result0)
Perform learning on one packet based on the mac table lookup result.
#define foreach_pppoe_input_next
static_always_inline void pppoe_lookup_1(BVT(clib_bihash)*table, pppoe_entry_key_t *cached_key, pppoe_entry_result_t *cached_result, u8 *mac0, u16 session_id0, pppoe_entry_key_t *key0, u32 *bucket0, pppoe_entry_result_t *result0)
#define static_always_inline
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
int clib_bihash_search_inline(clib_bihash *h, clib_bihash_kv *in_out_kv)
Search a bi-hash table.
vlib_node_registration_t pppoe_input_node
(constructor) VLIB_REGISTER_NODE (pppoe_input_node)
static u64 pppoe_make_key(u8 *mac_address, u16 session_id)
pppoe_session_t * sessions
static_always_inline void pppoe_update_1(BVT(clib_bihash)*table, u8 *mac0, u16 session_id0, pppoe_entry_key_t *key0, u32 *bucket0, pppoe_entry_result_t *result0)
vlib_node_registration_t pppoe_cp_dispatch_node
(constructor) VLIB_REGISTER_NODE (pppoe_cp_dispatch_node)
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
struct _vlib_node_registration vlib_node_registration_t
u32 decap_fib_index
FIB indices - inner IP packet lookup here.
int vnet_pppoe_add_del_session(vnet_pppoe_add_del_session_args_t *a, u32 *sw_if_indexp)
struct pppoe_entry_result_t::@492::@494 fields