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, 100 #define MTU_BUFFERS ((MTU + vlib_buffer_get_default_data_size(vm) - 1) / vlib_buffer_get_default_data_size(vm)) 101 #define NUM_BUFFERS_TO_ALLOC 32 106 #define PPPOE_NUM_BUCKETS (64 * 1024) 107 #define PPPOE_MEMORY_SIZE (8<<20) 158 BVT (clib_bihash) link_table;
161 BVT (clib_bihash) session_table;
217 #if CLIB_ARCH_IS_LITTLE_ENDIAN 222 temp = *((
u64 *) (mac_address)) << 16;
229 temp = *((
u64 *) (mac_address)) >> 16;
230 temp = temp | (((
u64) session_id) << 48);
254 else if (result0->
fields.sw_if_index == ~0)
257 result0->
fields.sw_if_index = sw_if_index0;
258 result0->
fields.session_index = ~0;
259 cached_key->
raw = ~0;
264 result0->
fields.sw_if_index = sw_if_index0;
268 BVT (clib_bihash_kv) kv;
270 kv.value = result0->
raw;
287 if (key0->
raw == cached_key->
raw)
290 result0->
raw = cached_result->
raw;
295 BVT (clib_bihash_kv) kv;
300 result0->
raw = kv.value;
303 cached_key->
raw = key0->
raw;
304 cached_result->
raw = result0->
raw;
320 BVT (clib_bihash_kv) kv;
322 kv.value = result0->
raw;
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
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)
#define foreach_pppoe_input_next
struct pppoe_entry_result_t::@680::@682 fields
#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.
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.
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
vlib_node_registration_t pppoe_cp_dispatch_node
(constructor) VLIB_REGISTER_NODE (pppoe_cp_dispatch_node)
u32 * session_index_by_sw_if_index
struct _vlib_node_registration vlib_node_registration_t
u32 decap_fib_index
FIB indices - inner IP packet lookup here.
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)
u32 * free_pppoe_session_hw_if_indices
int vnet_pppoe_add_del_session(vnet_pppoe_add_del_session_args_t *a, u32 *sw_if_indexp)
manual_print typedef u8 mac_address[6]
char * pppoe_error_strings[]