24 #define foreach_pppoe_cp_next \ 25 _(DROP, "error-drop") \ 26 _(INTERFACE, "interface-output" ) \ 30 #define _(s,n) PPPOE_CP_NEXT_##s, 54 s =
format (s,
"PPPoE dispatch from sw_if_index %d next %d error %d \n" 55 " pppoe_code 0x%x ppp_proto 0x%x",
61 s =
format (s,
"PPPoE dispatch from cp_if_index %d next %d error %d \n" 62 " pppoe_code 0x%x ppp_proto 0x%x",
74 u32 n_left_from, next_index, * from, * to_next;
78 u32 pkts_decapsulated = 0;
80 u32 stats_sw_if_index, stats_n_packets, stats_n_bytes;
89 cached_result.
raw = ~0;
93 stats_n_packets = stats_n_bytes = 0;
95 while (n_left_from > 0)
100 to_next, n_left_to_next);
102 while (n_left_from > 0 && n_left_to_next > 0)
114 u32 rx_sw_if_index0=~0, tx_sw_if_index0=~0, len0;
132 error0 = PPPOE_ERROR_BAD_VER_TYPE;
133 next0 = PPPOE_INPUT_NEXT_DROP;
144 &key0, &bucket0, &result0);
145 tx_sw_if_index0 = result0.
fields.sw_if_index;
149 error0 = PPPOE_ERROR_NO_SUCH_SESSION;
150 next0 = PPPOE_INPUT_NEXT_DROP;
154 next0 = PPPOE_CP_NEXT_INTERFACE;
166 &key0, &bucket0, &result0);
167 tx_sw_if_index0 = result0.
fields.sw_if_index;
174 next0 = PPPOE_CP_NEXT_INTERFACE;
180 pkts_decapsulated ++;
181 stats_n_packets += 1;
182 stats_n_bytes += len0;
188 stats_n_packets -= 1;
189 stats_n_bytes -= len0;
193 thread_index, stats_sw_if_index,
194 stats_n_packets, stats_n_bytes);
196 stats_n_bytes = len0;
197 stats_sw_if_index = rx_sw_if_index0;
215 to_next, n_left_to_next,
223 PPPOE_ERROR_DECAPSULATED,
231 thread_index, stats_sw_if_index, stats_n_packets, stats_n_bytes);
240 .name =
"pppoe-cp-dispatch",
242 .vector_size =
sizeof (
u32),
246 #define _(s,n) [PPPOE_CP_NEXT_##s] = n,
static void vlib_buffer_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 thread_index, u32 index, u64 n_packets, u64 n_bytes)
Increment a combined counter.
u8 runtime_data[0]
Function dependent node-runtime data.
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.
vnet_interface_main_t interface_main
static uword pppoe_cp_dispatch(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
vlib_error_t * errors
Vector of errors for this node.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
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)
vlib_combined_counter_main_t * combined_sw_if_counters
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
vlib_node_registration_t pppoe_cp_dispatch_node
(constructor) VLIB_REGISTER_NODE (pppoe_cp_dispatch_node)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
vlib_node_registration_t pppoe_input_node
(constructor) VLIB_REGISTER_NODE (pppoe_input_node)
#define clib_memcpy(a, b, c)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
static u8 * format_pppoe_cp_trace(u8 *s, va_list *args)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
struct pppoe_entry_result_t::@504::@506 fields
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define foreach_pppoe_cp_next