26 #define foreach_l2t_encap_error \ 27 _(NETWORK_TO_USER, "L2TP L2 network to user (ip6) pkts") \ 28 _(LOOKUP_FAIL_TO_L3, "L2TP L2 session lookup failed pkts") \ 29 _(ADMIN_DOWN, "L2TP tunnel is down") 32 #define _(sym,string) string, 39 #define _(sym,str) L2T_ENCAP_ERROR_##sym, 104 l2tpv3_header_t *l2tp;
116 em->
counters[node_counter_base_index + L2T_ENCAP_ERROR_NETWORK_TO_USER] +=
119 session_index =
vnet_buffer (b)->l2t.session_index;
143 l2tp->l2_specific_sublayer = 0;
152 b->
error = node->
errors[L2T_ENCAP_ERROR_ADMIN_DOWN];
158 clib_host_to_net_u32 (0x6 << 28);
162 payload_length -=
sizeof (*ip6);
194 return dispatch_pipeline (vm, node, frame);
201 .name =
"l2tp-encap",
202 .vector_size =
sizeof (
u32),
ip6_address_t client_address
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
ip6_address_t our_address
vlib_node_registration_t l2t_encap_node
(constructor) VLIB_REGISTER_NODE (l2t_encap_node)
struct _vlib_node_registration vlib_node_registration_t
VLIB_NODE_FUNCTION_MULTIARCH(l2t_encap_node, l2t_encap_node_fn)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static u32 session_index_to_counter_index(u32 session_index, u32 counter_id)
ip6_address_t client_address
vnet_main_t * vnet_get_main(void)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
static void stage0(vlib_main_t *vm, vlib_node_runtime_t *node, u32 buffer_index)
void l2tp_encap_init(vlib_main_t *vm)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_error_main_t error_main
u8 * format_l2t_trace(u8 *s, va_list *args)
uword os_get_cpu_number(void)
static void * vlib_node_get_runtime_data(vlib_main_t *vm, u32 node_index)
Get node runtime private data by node index.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
ip6_address_t our_address
#define CLIB_PREFETCH(addr, size, type)
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
uword l2t_encap_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void vlib_increment_combined_counter(vlib_combined_counter_main_t *cm, u32 cpu_index, u32 index, u32 packet_increment, u32 byte_increment)
Increment a combined counter.
#define foreach_l2t_encap_error
#define VLIB_BUFFER_IS_TRACED
vlib_combined_counter_main_t counter_main
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static char * l2t_encap_error_strings[]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
#define VLIB_REGISTER_NODE(x,...)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: 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.