|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
56 return format (s,
"SRv6-AD-rewrite: cache is empty");
59 return format (s,
"SRv6-AD-rewrite: src %U dst %U",
72 #define foreach_srv6_ad_rewrite_counter \
73 _(PROCESSED, "srv6-ad rewritten packets") \
74 _(NO_RW, "(Error) No header for rewriting.")
78 #define _(sym,str) SRV6_AD_REWRITE_COUNTER_##sym,
85 #define _(sym,string) string,
121 ip6_address_t *new_dst0;
123 ip6_ext_header_t *next_ext_header;
146 next_ext_header = (ip6_ext_header_t *) (ip0 + 1);
152 next_hdr = next_ext_header->next_hdr;
158 next_hdr != IP_PROTOCOL_IP_IN_IP &&
173 ls0_mem->
rw_len = total_size;
192 *next0 = (next_hdr == IP_PROTOCOL_IPV6) ?
265 n_left_to_next, bi0, next0);
273 return frame->n_vectors;
279 .name =
"srv6-ad-localsid",
280 .vector_size =
sizeof (
u32),
348 b0->
error =
node->errors[SRV6_AD_REWRITE_COUNTER_NO_RW];
380 sizeof tr->
src.as_u8);
382 sizeof tr->
dst.as_u8);
396 n_left_to_next, bi0, next0);
406 SRV6_AD_REWRITE_COUNTER_PROCESSED,
409 return frame->n_vectors;
415 .name =
"srv6-ad2-rewrite",
416 .vector_size =
sizeof (
u32),
483 b0->
error =
node->errors[SRV6_AD_REWRITE_COUNTER_NO_RW];
499 checksum0 = ip0_encap->checksum + clib_host_to_net_u16 (0x0100);
500 checksum0 += checksum0 >= 0xffff;
501 ip0_encap->checksum = checksum0;
505 clib_net_to_host_u16 (ip0_encap->length);
523 sizeof tr->
src.as_u8);
525 sizeof tr->
dst.as_u8);
539 n_left_to_next, bi0, next0);
549 SRV6_AD_REWRITE_COUNTER_PROCESSED,
552 return frame->n_vectors;
558 .name =
"srv6-ad4-rewrite",
559 .vector_size =
sizeof (
u32),
625 b0->
error =
node->errors[SRV6_AD_REWRITE_COUNTER_NO_RW];
639 ip0_encap->hop_limit -= 1;
642 new_l0 = ls0_mem->
rw_len +
643 clib_net_to_host_u16 (ip0_encap->payload_length);
661 sizeof tr->
src.as_u8);
663 sizeof tr->
dst.as_u8);
677 n_left_to_next, bi0, next0);
687 SRV6_AD_REWRITE_COUNTER_PROCESSED,
690 return frame->n_vectors;
696 .name =
"srv6-ad6-rewrite",
697 .vector_size =
sizeof (
u32),
u32 * sw_iface_localsid4
Retrieve local SID from iface.
vlib_combined_counter_main_t sr_ls_valid_counters
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
@ SRV6_AD_REWRITE_NEXT_LOOKUP
static u8 * format_srv6_ad_rewrite_trace(u8 *s, va_list *args)
static u8 * format_srv6_ad_localsid_trace(u8 *s, va_list *args)
nat44_ei_hairpin_src_next_t next_index
@ SRV6_AD_LOCALSID_N_NEXT
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
@ VLIB_NODE_TYPE_INTERNAL
void * plugin_mem
Memory to be used by the plugin callback functions.
#define ip6_ext_header_len(p)
vlib_main_t vlib_node_runtime_t * node
u32 nh_adj
Adjacency index for out.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define IP_PROTOCOL_IP6_ETHERNET
static_always_inline void end_ad_processing(vlib_buffer_t *b0, ip6_header_t *ip0, ip6_sr_header_t *sr0, ip6_sr_localsid_t *ls0, u32 *next0)
Function doing SRH processing for AD behavior.
static uword srv6_ad6_rewrite_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Graph node for applying a SR policy into an IPv6 packet.
srv6_ad_main_t srv6_ad_main
vlib_combined_counter_main_t invalid_counters
Invalid rewrite counters.
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
#define foreach_srv6_ad_rewrite_counter
@ SRV6_AD_LOCALSID_NEXT_INTERFACE
i16 current_data
signed offset in data[], pre_data[] that we are currently processing.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
vlib_combined_counter_main_t sr_ls_invalid_counters
vlib_error_t error
Error code for buffers to be enqueued to error handler.
vlib_node_registration_t srv6_ad2_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_ad2_rewrite_node)
#define VLIB_NODE_FLAG_TRACE
@ SRV6_AD_LOCALSID_NEXT_REWRITE6
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define static_always_inline
static char * srv6_ad_rewrite_counter_strings[]
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
vlib_node_registration_t srv6_ad_localsid_node
(constructor) VLIB_REGISTER_NODE (srv6_ad_localsid_node)
@ SRV6_AD_REWRITE_N_COUNTERS
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
u8 * rewrite
Headers to be rewritten.
struct _vlib_node_registration vlib_node_registration_t
u16 current_length
Nbytes between current data and the end of this buffer.
vlib_combined_counter_main_t valid_counters
Valid rewrite counters.
@ SRV6_AD_LOCALSID_NEXT_REWRITE4
ip6_sr_localsid_t * localsids
vlib_node_registration_t srv6_ad4_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_ad4_rewrite_node)
Segment Routing main datastructure.
#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.
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
u32 * sw_iface_localsid6
Retrieve local SID from iface.
#define VLIB_BUFFER_PRE_DATA_SIZE
static u8 ip6_ext_hdr(u8 nexthdr)
static uword srv6_ad4_rewrite_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Graph node for applying a SR policy into an IPv6 packet.
#define ROUTING_HEADER_TYPE_SR
@ SRV6_AD_LOCALSID_NEXT_ERROR
@ SRV6_AD_REWRITE_NEXT_ERROR
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
vlib_node_registration_t srv6_ad6_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_ad6_rewrite_node)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static uword srv6_ad_localsid_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
SRv6 AD Localsid graph node.
static uword srv6_ad2_rewrite_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Graph node for applying a SR policy into an IPv6 packet.
static void * ip6_ext_next_header(ip6_ext_header_t *ext_hdr)
u32 * sw_iface_localsid2
Retrieve local SID from iface.
u32 rw_len
Number of bits to be rewritten.
vl_api_interface_index_t sw_if_index
#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).
vl_api_fib_path_type_t type
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
u32 sw_if_index_out
Outgoing iface to proxied dev.
#define VLIB_REGISTER_NODE(x,...)