33 s =
format (s,
"MPLS-POLICY-ENCAP: next-index %d encap-index %d",
41 #define foreach_mpls_policy_encap_next \ 45 #define _(s,n) MPLS_POLICY_ENCAP_NEXT_##s, 51 #define foreach_mpls_policy_error \ 52 _(PKTS_ENCAP, "mpls policy tunnel packets encapsulated") 55 #define _(n,s) MPLS_POLICY_ENCAP_ERROR_##n, 73 u32 n_left_from, next_index, * from, * to_next;
81 while (n_left_from > 0)
86 to_next, n_left_to_next);
88 while (n_left_from > 0 && n_left_to_next > 0)
106 encap_index0 =
vnet_buffer(b0)->l2_classify.opaque_index;
124 to_next, n_left_to_next,
130 MPLS_POLICY_ENCAP_ERROR_PKTS_ENCAP,
137 .name =
"mpls-policy-encap",
139 .vector_size =
sizeof (
u32),
141 .runtime_data_bytes = 0,
150 #define _(s,n) [MPLS_POLICY_ENCAP_NEXT_##s] = n, 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.
struct _vlib_node_registration vlib_node_registration_t
static clib_error_t * mpls_policy_encap_init(vlib_main_t *vm)
u8 * format_mpls_policy_encap_trace(u8 *s, va_list *args)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
vlib_node_registration_t ip4_classify_node
(constructor) VLIB_REGISTER_NODE (ip4_classify_node)
#define VLIB_INIT_FUNCTION(x)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
#define vlib_call_init_function(vm, x)
#define foreach_mpls_policy_encap_next
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
mpls_policy_encap_error_t
#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).
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define clib_memcpy(a, b, c)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
u32 ip4_classify_mpls_policy_encap_next_index
static uword mpls_policy_encap(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
u32 ip6_classify_mpls_policy_encap_next_index
#define VLIB_BUFFER_IS_TRACED
#define foreach_mpls_policy_error
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_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
static char * mpls_policy_encap_error_strings[]
vlib_node_registration_t ip6_classify_node
(constructor) VLIB_REGISTER_NODE (ip6_classify_node)
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_policy_encap_node
(constructor) VLIB_REGISTER_NODE (mpls_policy_encap_node)