|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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,
78 u32 session_index =
rt->cached_session_index;
83 session_index =
rt->cached_session_index =
hi->dev_instance;
101 l2tpv3_header_t *l2tp;
113 em->
counters[node_counter_base_index + L2T_ENCAP_ERROR_NETWORK_TO_USER] +=
140 l2tp->l2_specific_sublayer = 0;
149 b->
error =
node->errors[L2T_ENCAP_ERROR_ADMIN_DOWN];
154 ip6->ip_version_traffic_class_and_flow_label =
155 clib_host_to_net_u32 (0x6 << 28);
159 payload_length -=
sizeof (*ip6);
161 ip6->payload_length = clib_host_to_net_u16 (payload_length);
162 ip6->protocol = IP_PROTOCOL_L2TP;
163 ip6->hop_limit = 0xff;
197 .name =
"l2tp-encap",
198 .vector_size =
sizeof (
u32),
216 #ifndef CLIB_MARCH_VARIANT
224 rt->cached_sw_if_index = (
u32) ~ 0;
225 rt->cached_session_index = (
u32) ~ 0;
static void * vlib_node_get_runtime_data(vlib_main_t *vm, u32 node_index)
Get node runtime private data by node index.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
nat44_ei_hairpin_src_next_t next_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u8 * format_l2t_trace(u8 *s, va_list *args)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
vlib_error_main_t error_main
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
static void stage0(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
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 CLIB_PREFETCH(addr, size, type)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FN(node)
vnet_main_t * vnet_get_main(void)
static_always_inline uword vlib_get_thread_index(void)
ip6_address_t client_address
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static char * l2t_encap_error_strings[]
ip6_address_t client_address
#define CLIB_CACHE_LINE_BYTES
struct _vlib_node_registration vlib_node_registration_t
@ SESSION_COUNTER_NETWORK_TO_USER
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_buffer_t *b)
vlib_node_registration_t l2t_encap_node
(constructor) VLIB_REGISTER_NODE (l2t_encap_node)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
ip6_address_t our_address
@ L2T_ENCAP_NEXT_IP6_LOOKUP
#define foreach_l2t_encap_error
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
vnet_interface_output_runtime_t * rt
void l2tp_encap_init(vlib_main_t *vm)
vlib_combined_counter_main_t counter_main
vl_api_interface_index_t sw_if_index
vl_api_fib_path_type_t type
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
ip6_address_t our_address
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)