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, 101 l2tpv3_header_t *l2tp;
113 em->
counters[node_counter_base_index + L2T_ENCAP_ERROR_NETWORK_TO_USER] +=
116 session_index =
vnet_buffer (b)->l2t.session_index;
140 l2tp->l2_specific_sublayer = 0;
149 b->
error = node->
errors[L2T_ENCAP_ERROR_ADMIN_DOWN];
155 clib_host_to_net_u32 (0x6 << 28);
159 payload_length -=
sizeof (*ip6);
191 return dispatch_pipeline (vm, node, frame);
198 .name =
"l2tp-encap",
199 .vector_size =
sizeof (
u32),
static void stage0(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
ip6_address_t client_address
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.
vnet_main_t * vnet_get_main(void)
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)
VLIB_NODE_FUNCTION_MULTIARCH(l2t_encap_node, l2t_encap_node_fn)
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 u32 session_index_to_counter_index(u32 session_index, u32 counter_id)
ip6_address_t client_address
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
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)
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
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 VLIB_REGISTER_NODE(x,...)
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
static_always_inline uword vlib_get_thread_index(void)
#define CLIB_PREFETCH(addr, size, type)
uword l2t_encap_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define foreach_l2t_encap_error
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
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)
struct _vlib_node_registration vlib_node_registration_t
static char * l2t_encap_error_strings[]
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.