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-tap-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 (128 * 1024) 103 #define PPPOE_MEMORY_SIZE (16<<20) 154 BVT (clib_bihash) session_table;
157 u32 *free_pppoe_session_hw_if_indices;
160 u32 *session_index_by_sw_if_index;
210 #if CLIB_ARCH_IS_LITTLE_ENDIAN 215 temp = *((
u64 *) (mac_address)) << 16;
216 temp = (temp & ~0xffff) | (
u64) (session_id);
222 temp = *((
u64 *) (mac_address)) >> 16;
223 temp = temp | (((
u64) session_id) << 48);
242 if (key0->
raw == cached_key->
raw)
245 result0->
raw = cached_result->
raw;
250 BVT (clib_bihash_kv) kv;
254 BV (clib_bihash_search_inline) (session_table, &kv);
255 result0->
raw = kv.value;
258 cached_key->
raw = key0->
raw;
259 cached_result->
raw = result0->
raw;
275 BVT (clib_bihash_kv) kv;
277 kv.value = result0->
raw;
static_always_inline void pppoe_update_1(BVT(clib_bihash)*session_table, u8 *mac0, u16 session_id0, pppoe_entry_key_t *key0, u32 *bucket0, pppoe_entry_result_t *result0)
#define foreach_pppoe_input_next
struct _vlib_node_registration vlib_node_registration_t
static_always_inline void pppoe_lookup_1(BVT(clib_bihash)*session_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_tap_dispatch_node
(constructor) VLIB_REGISTER_NODE (pppoe_tap_dispatch_node)
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
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)