46 #define PPPOE_VER_TYPE 0x11 47 #define PPPOE_PADS 0x65 72 #define foreach_pppoe_input_next \ 73 _(DROP, "error-drop") \ 74 _(IP4_INPUT, "ip4-input") \ 75 _(IP6_INPUT, "ip6-input" ) \ 76 _(CP_INPUT, "pppoe-cp-dispatch" ) \ 80 #define _(s,n) PPPOE_INPUT_NEXT_##s, 88 #define pppoe_error(n,s) PPPOE_ERROR_##n, 96 #define MTU_BUFFERS ((MTU + VLIB_BUFFER_DATA_SIZE - 1) / VLIB_BUFFER_DATA_SIZE) 97 #define NUM_BUFFERS_TO_ALLOC 32 102 #define PPPOE_NUM_BUCKETS (64 * 1024) 103 #define PPPOE_MEMORY_SIZE (8<<20) 154 BVT (clib_bihash) link_table;
157 BVT (clib_bihash) session_table;
160 u32 *free_pppoe_session_hw_if_indices;
163 u32 *session_index_by_sw_if_index;
213 #if CLIB_ARCH_IS_LITTLE_ENDIAN 218 temp = *((
u64 *) (mac_address)) << 16;
219 temp = (temp & ~0xffff) | (
u64) (session_id);
225 temp = *((
u64 *) (mac_address)) >> 16;
226 temp = temp | (((
u64) session_id) << 48);
250 else if (result0->
fields.sw_if_index == ~0)
253 result0->
fields.sw_if_index = sw_if_index0;
254 result0->
fields.session_index = ~0;
255 cached_key->
raw = ~0;
260 result0->
fields.sw_if_index = sw_if_index0;
264 BVT (clib_bihash_kv) kv;
266 kv.value = result0->
raw;
283 if (key0->
raw == cached_key->
raw)
286 result0->
raw = cached_result->
raw;
291 BVT (clib_bihash_kv) kv;
295 BV (clib_bihash_search_inline) (table, &kv);
296 result0->
raw = kv.value;
299 cached_key->
raw = key0->
raw;
300 cached_result->
raw = result0->
raw;
316 BVT (clib_bihash_kv) kv;
318 kv.value = result0->
raw;
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
struct pppoe_entry_result_t::@408::@410 fields
struct _vlib_node_registration vlib_node_registration_t
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.
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)
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)