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);
197 .name =
"l2tp-encap",
198 .vector_size =
sizeof (
u32),
216 #ifndef CLIB_MARCH_VARIANT
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
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)
static void stage0(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
ip6_address_t our_address
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
void l2tp_encap_init(vlib_main_t *vm)
#define VLIB_NODE_FN(node)
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)
#define foreach_l2t_encap_error
ip6_address_t client_address
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
vl_api_fib_path_type_t type
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#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 * 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.
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
ip6_address_t our_address
#define VLIB_REGISTER_NODE(x,...)
static_always_inline uword vlib_get_thread_index(void)
#define CLIB_PREFETCH(addr, size, type)
vlib_main_t vlib_node_runtime_t * node
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
vlib_node_registration_t l2t_encap_node
(constructor) VLIB_REGISTER_NODE (l2t_encap_node)
struct _vlib_node_registration vlib_node_registration_t
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define CLIB_CACHE_LINE_BYTES
vl_api_interface_index_t sw_if_index
static char * l2t_encap_error_strings[]