38 #define _(a,b) if (t->next_index == MPLS_INPUT_NEXT_##a) next_name = b; 42 s =
format (s,
"MPLS: next %s[%d] label %d ttl %d",
64 u32 n_left_from, next_index, * from, * to_next;
86 while (n_left_from > 0)
91 to_next, n_left_to_next);
93 while (n_left_from > 0 && n_left_to_next > 0)
122 next0 = MPLS_INPUT_NEXT_DROP;
143 to_next, n_left_to_next,
150 MPLS_ERROR_PKTS_DECAP, from_frame->
n_vectors);
163 #define mpls_error(n,s) s, 170 .name =
"mpls-input",
172 .vector_size =
sizeof (
u32),
176 .n_errors = MPLS_N_ERROR,
181 #define _(s,n) [MPLS_INPUT_NEXT_##s] = n, vnet_config_main_t config_main
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
static void vlib_increment_simple_counter(vlib_simple_counter_main_t *cm, u32 cpu_index, u32 index, u32 increment)
Increment a simple counter.
VLIB_NODE_FUNCTION_MULTIARCH(ethernet_input_not_l2_node, ethernet_input_not_l2)
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
vnet_interface_main_t interface_main
u32 * config_index_by_sw_if_index
static uword mpls_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
struct _vlib_node_registration vlib_node_registration_t
static void mpls_setup_nodes(vlib_main_t *vm)
#define clib_error_report(e)
#define foreach_mpls_input_next
static clib_error_t * mpls_input_init(vlib_main_t *vm)
vnet_feature_config_main_t feature_config_mains[VNET_N_IP_FEAT]
static pg_node_t * pg_get_node(uword node_index)
vnet_main_t * vnet_get_main(void)
#define VLIB_INIT_FUNCTION(x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
format_function_t format_mpls_unicast_header_net_byte_order
static u32 vnet_mpls_uc_get_ttl(mpls_label_t label_exp_s_ttl)
A collection of simple counters.
#define vlib_call_init_function(vm, x)
static u8 * format_mpls_input_trace(u8 *s, va_list *args)
uword os_get_cpu_number(void)
static uword mpls_input_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
static void * vlib_node_get_runtime_data(vlib_main_t *vm, u32 node_index)
Get node runtime private data by node index.
static u32 vnet_mpls_uc_get_label(mpls_label_t label_exp_s_ttl)
vlib_simple_counter_main_t * sw_if_counters
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
void ethernet_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
unformat_function_t unformat_pg_mpls_header
unformat_function_t * unformat_edit
clib_error_t * mpls_feature_init(vlib_main_t *vm)
#define VLIB_BUFFER_IS_TRACED
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static clib_error_t * mpls_init(vlib_main_t *vm)
#define vec_elt(v, i)
Get vector value at index i.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define VLIB_REGISTER_NODE(x,...)
static char * mpls_error_strings[]
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_node_registration_t mpls_input_node
(constructor) VLIB_REGISTER_NODE (mpls_input_node)