|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
53 return format (s,
"SRv6-AS-rewrite: cache is empty");
56 return format (s,
"SRv6-AS-rewrite: src %U dst %U",
69 #define foreach_srv6_as_rewrite_counter \
70 _(PROCESSED, "srv6-as rewritten packets") \
71 _(NO_RW, "(Error) No header for rewriting.")
75 #define _(sym,str) SRV6_AS_REWRITE_COUNTER_##sym,
82 #define _(sym,string) string,
118 ip6_ext_header_t *ext_hdr;
123 ext_hdr = (ip6_ext_header_t *) (ip0 + 1);
129 hdr_type = ext_hdr->next_hdr;
135 hdr_type != IP_PROTOCOL_IP_IN_IP &&
158 *next0 = (hdr_type == IP_PROTOCOL_IPV6) ?
229 n_left_to_next, bi0, next0);
237 return frame->n_vectors;
243 .name =
"srv6-as-localsid",
244 .vector_size =
sizeof (
u32),
312 b0->
error =
node->errors[SRV6_AS_REWRITE_COUNTER_NO_RW];
344 sizeof tr->
src.as_u8);
346 sizeof tr->
dst.as_u8);
360 n_left_to_next, bi0, next0);
370 SRV6_AS_REWRITE_COUNTER_PROCESSED,
373 return frame->n_vectors;
379 .name =
"srv6-as2-rewrite",
380 .vector_size =
sizeof (
u32),
447 b0->
error =
node->errors[SRV6_AS_REWRITE_COUNTER_NO_RW];
464 checksum0 = ip0_encap->checksum + clib_host_to_net_u16 (0x0100);
465 checksum0 += checksum0 >= 0xffff;
466 ip0_encap->checksum = checksum0;
470 clib_net_to_host_u16 (ip0_encap->length);
488 sizeof tr->
src.as_u8);
490 sizeof tr->
dst.as_u8);
504 n_left_to_next, bi0, next0);
514 SRV6_AS_REWRITE_COUNTER_PROCESSED,
517 return frame->n_vectors;
523 .name =
"srv6-as4-rewrite",
524 .vector_size =
sizeof (
u32),
590 b0->
error =
node->errors[SRV6_AS_REWRITE_COUNTER_NO_RW];
605 ip0_encap->hop_limit -= 1;
609 clib_net_to_host_u16 (ip0_encap->payload_length);
627 sizeof tr->
src.as_u8);
629 sizeof tr->
dst.as_u8);
643 n_left_to_next, bi0, next0);
653 SRV6_AS_REWRITE_COUNTER_PROCESSED,
656 return frame->n_vectors;
662 .name =
"srv6-as6-rewrite",
663 .vector_size =
sizeof (
u32),
u32 * sw_iface_localsid6
Retrieve local SID from iface.
#define foreach_srv6_as_rewrite_counter
static uword srv6_as4_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.
vlib_combined_counter_main_t sr_ls_valid_counters
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static u8 * format_srv6_as_rewrite_trace(u8 *s, va_list *args)
nat44_ei_hairpin_src_next_t next_index
static_always_inline void end_as_processing(vlib_buffer_t *b0, ip6_header_t *ip0, srv6_as_localsid_t *ls0_mem, u32 *next0)
Function doing SRH processing for AS behavior.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vlib_combined_counter_main_t invalid_counters
Invalid rewrite counters.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
@ SRV6_AS_REWRITE_NEXT_ERROR
vlib_node_registration_t srv6_as6_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_as6_rewrite_node)
@ 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 * sw_iface_localsid4
Retrieve local SID from iface.
static u8 * format_srv6_as_localsid_trace(u8 *s, va_list *args)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define IP_PROTOCOL_IP6_ETHERNET
static char * srv6_as_rewrite_counter_strings[]
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)
u8 * rewrite
Headers to be rewritten.
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.
@ SRV6_AS_REWRITE_N_COUNTERS
vlib_combined_counter_main_t sr_ls_invalid_counters
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
vlib_combined_counter_main_t valid_counters
Valid rewrite counters.
#define static_always_inline
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
u32 sw_if_index_out
Outgoing iface to proxied dev.
struct _vlib_node_registration vlib_node_registration_t
u32 nh_adj
Adjacency index for out.
u16 current_length
Nbytes between current data and the end of this buffer.
@ SRV6_AS_REWRITE_NEXT_LOOKUP
ip6_sr_localsid_t * localsids
Segment Routing main datastructure.
static uword srv6_as6_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 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
srv6_as_main_t srv6_as_main
vlib_put_next_frame(vm, node, next_index, 0)
@ SRV6_AS_LOCALSID_NEXT_ERROR
#define VLIB_BUFFER_PRE_DATA_SIZE
static u8 ip6_ext_hdr(u8 nexthdr)
@ SRV6_AS_LOCALSID_NEXT_REWRITE6
vlib_node_registration_t srv6_as2_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_as2_rewrite_node)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
@ SRV6_AS_LOCALSID_NEXT_REWRITE4
static void * ip6_ext_next_header(ip6_ext_header_t *ext_hdr)
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).
static uword srv6_as_localsid_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
SRv6 AS Localsid graph node.
@ SRV6_AS_LOCALSID_NEXT_INTERFACE
vl_api_fib_path_type_t type
u32 * sw_iface_localsid2
Retrieve local SID from iface.
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
static uword srv6_as2_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.
vlib_node_registration_t srv6_as4_rewrite_node
(constructor) VLIB_REGISTER_NODE (srv6_as4_rewrite_node)
@ SRV6_AS_LOCALSID_N_NEXT
vlib_node_registration_t srv6_as_localsid_node
(constructor) VLIB_REGISTER_NODE (srv6_as_localsid_node)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)