27 #define foreach_l2t_decap_error \ 28 _(USER_TO_NETWORK, "L2TP user (ip6) to L2 network pkts") \ 29 _(SESSION_ID_MISMATCH, "l2tpv3 local session id mismatches") \ 30 _(COOKIE_MISMATCH, "l2tpv3 local cookie mismatches") \ 31 _(NO_SESSION, "l2tpv3 session not found") \ 32 _(ADMIN_DOWN, "l2tpv3 tunnel is down") 35 #define _(sym,string) string, 42 #define _(sym,str) L2T_DECAP_ERROR_##sym, 93 l2t = (l2tpv3_header_t *) (ip6 + 1);
107 session_index = p[0];
112 vnet_buffer (b)->l2t.session_index = session_index;
125 l2tpv3_header_t *l2tp;
139 em->
counters[node_counter_base_index + L2T_DECAP_ERROR_USER_TO_NETWORK] +=
142 session_index =
vnet_buffer (b)->l2t.session_index;
162 em->
counters[node_counter_base_index +
163 L2T_DECAP_ERROR_SESSION_ID_MISMATCH] += 1;
173 b->
error = node->
errors[L2T_DECAP_ERROR_COOKIE_MISMATCH];
183 b->
error = node->
errors[L2T_DECAP_ERROR_ADMIN_DOWN];
211 if (l2tp_decap_local)
213 b->
error = node->
errors[L2T_DECAP_ERROR_NO_SESSION];
243 return dispatch_pipeline (vm,
node,
frame);
254 .name =
"l2tp-decap",
255 .vector_size =
sizeof (
u32),
277 .name =
"l2tp-decap-local",
278 .vector_size =
sizeof (
u32),
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.
static void stage0(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
uword * session_by_session_id
vlib_node_registration_t l2t_decap_local_node
(constructor) VLIB_REGISTER_NODE (l2t_decap_local_node)
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
#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 vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
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.
#define foreach_l2t_decap_error
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.
u32 node_index
Node index.
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
ip6_to_l2_lookup_t lookup_type
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)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
vlib_main_t vlib_node_runtime_t * node
static char * l2t_decap_error_strings[]
uword() vlib_node_function_t(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)
vlib_node_registration_t l2t_decap_node
(constructor) VLIB_REGISTER_NODE (l2t_decap_node)
vlib_node_function_t l2t_decap_node_fn
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
uword * session_by_dst_address
vlib_combined_counter_main_t counter_main
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
VLIB buffer representation.
#define hash_get_mem(h, key)
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)
uword * session_by_src_address
#define CLIB_CACHE_LINE_BYTES