20 #include <vnet/devices/pci/ixgev.h> 21 #include <vnet/devices/pci/ixge.h> 22 #include <vnet/devices/pci/ige.h> 34 #define foreach_l2t_l2_error \ 35 _(NETWORK_TO_USER, "L2 network to user (ip6) pkts") 38 #define _(sym,string) string, 45 #define _(sym,str) L2T_L2_ERROR_##sym, 83 uword vlan_and_sw_if_index_key;
102 p =
hash_get (lm->session_by_vlan_and_rx_sw_if_index,
103 vlan_and_sw_if_index_key);
113 session_index = p[0];
118 vnet_buffer (b)->l2t.session_index = session_index;
134 l2tpv3_header_t *l2t;
139 u16 payload_ethertype;
140 u8 dst_mac_address[6];
141 u8 src_mac_address[6];
151 em->
counters[node_counter_base_index + L2T_L2_ERROR_NETWORK_TO_USER] += 1;
166 #define _(i) dst_mac_address[i] = eh->dst_address[i]; 167 _(0) _(1) _(2) _(3) _(4) _(5);
169 #define _(i) src_mac_address[i] = eh->src_address[i]; 170 _(0) _(1) _(2) _(3) _(4) _(5);
173 payload_ethertype = vh->
type;
180 #define _(i) eh->dst_address[i] = dst_mac_address[i]; 181 _(0) _(1) _(2) _(3) _(4) _(5);
183 #define _(i) eh->src_address[i] = src_mac_address[i]; 184 _(0) _(1) _(2) _(3) _(4) _(5);
186 eh->
type = payload_ethertype;
189 backup =
sizeof (*l2t);
203 l2t->l2_specific_sublayer = 0;
211 clib_host_to_net_u32 (0x6 << 28);
215 payload_length -=
sizeof (*ip6);
234 return dispatch_pipeline (vm, node, frame);
240 .name =
"l2t-l2-input",
241 .vector_size =
sizeof (
u32),
static u32 last_stage(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
ip6_address_t our_address
struct _vlib_node_registration vlib_node_registration_t
static void stage1(vlib_main_t *vm, vlib_node_runtime_t *node, u32 bi)
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)
static char * l2t_l2_error_strings[]
ip6_address_t client_address
static void stage0(vlib_main_t *vm, vlib_node_runtime_t *node, u32 buffer_index)
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)
vlib_node_registration_t l2t_l2_node
(constructor) VLIB_REGISTER_NODE (l2t_l2_node)
#define foreach_l2t_l2_error
#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_reset(vlib_buffer_t *b)
Reset current header & length to state they were in when packet was received.
#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.
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.
vlib_combined_counter_main_t counter_main
static uword l2t_l2_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
VLIB_NODE_FUNCTION_MULTIARCH(l2t_l2_node, l2t_l2_node_fn)
#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.
#define CLIB_CACHE_LINE_BYTES
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.