50 return format (s,
"SRv6-AM-rewrite: src %U dst %U",
62 #define foreach_srv6_am_rewrite_counter \ 63 _(PROCESSED, "srv6-am rewritten packets") \ 64 _(NO_SRH, "(Error) No SRH.") 68 #define _(sym,str) SRV6_AM_REWRITE_COUNTER_##sym, 75 #define _(sym,string) string, 144 u32 n_left_from, next_index, *from, *to_next;
153 while (n_left_from > 0)
161 while (n_left_from > 0 && n_left_to_next > 0)
205 n_left_to_next, bi0, next0);
219 .name =
"srv6-am-localsid",
220 .vector_size =
sizeof (
u32),
245 b0->
error = node->
errors[SRV6_AM_REWRITE_COUNTER_NO_SRH];
267 u32 n_left_from, next_index, *from, *to_next;
274 while (n_left_from > 0)
282 while (n_left_from > 0 && n_left_to_next > 0)
316 n_left_to_next, bi0, next0);
326 SRV6_AM_REWRITE_COUNTER_PROCESSED,
335 .name =
"srv6-am-rewrite",
336 .vector_size =
sizeof (
u32),
u32 nh_adj
Next_adj for xconnect usage only.
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.
vlib_node_registration_t srv6_am_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_am_rewrite_node)
#define ROUTING_HEADER_TYPE_SR
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.
vlib_combined_counter_main_t sr_ls_invalid_counters
vlib_combined_counter_main_t sr_ls_valid_counters
static u8 * format_srv6_am_localsid_trace(u8 *s, va_list *args)
#define static_always_inline
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static uword srv6_am_localsid_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Graph node for applying SRv6 masquerading.
#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)
ip6_sr_localsid_t * localsids
#define VLIB_REGISTER_NODE(x,...)
static_always_inline void end_am_processing(vlib_buffer_t *b0, ip6_header_t *ip0, ip6_sr_header_t *sr0, ip6_sr_localsid_t *ls0, u32 *next0)
SRv6 masquerading.
vlib_node_registration_t srv6_am_localsid_node
(constructor) VLIB_REGISTER_NODE (srv6_am_localsid_node)
static_always_inline void end_am_rewriting(vlib_node_runtime_t *node, vlib_buffer_t *b0, ip6_header_t *ip0, ip6_sr_header_t *sr0, u32 *next0)
SRv6 de-masquerading.
#define clib_memcpy(a, b, c)
#define foreach_srv6_am_rewrite_counter
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 char * srv6_am_rewrite_counter_strings[]
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
struct _vlib_node_registration vlib_node_registration_t
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Segment Routing main datastructure.
u16 flags
Copy of main node flags.
static uword srv6_am_rewrite_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Graph node for applying SRv6 de-masquerading.
#define VLIB_NODE_FLAG_TRACE
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, 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.
static u8 * format_srv6_am_rewrite_trace(u8 *s, va_list *args)