65 s =
format (s,
"CACHE: flow_label %d, next index %d",
70 #define foreach_cache_error \ 71 _(RECORDED, "ip6 iOAM headers cached") 75 #define _(sym,str) CACHE_ERROR_##sym, 82 #define _(sym,string) string, 97 u32 n_left_from, *from, *to_next;
105 while (n_left_from > 0)
111 while (n_left_from > 0 && n_left_to_next > 0)
131 if (IP_PROTOCOL_TCP ==
145 (tcp0->dst_port), hbh0,
147 (tcp0->seq_number) + 1))
167 to_next, n_left_to_next,
175 CACHE_ERROR_RECORDED, recorded);
186 .name =
"ip6-ioam-cache",
187 .vector_size =
sizeof (
u32),
222 #define foreach_ip6_add_from_cache_hbh_error \ 223 _(PROCESSED, "Pkts w/ added ip6 hop-by-hop options") 227 #define _(sym,str) IP6_ADD_FROM_CACHE_HBH_ERROR_##sym, 234 #define _(sym,string) string, 239 #define foreach_ip6_ioam_cache_input_next \ 240 _(IP6_LOOKUP, "ip6-lookup") \ 241 _(DROP, "error-drop") 245 #define _(s,n) IP6_IOAM_CACHE_INPUT_NEXT_##s, 258 u32 n_left_from, *from, *to_next;
269 while (n_left_from > 0)
275 while (n_left_from > 0 && n_left_to_next > 0)
283 u64 *copy_src0, *copy_dst0;
289 next0 = IP6_IOAM_CACHE_INPUT_NEXT_IP6_LOOKUP;
301 if (IP_PROTOCOL_TCP !=
317 (tcp0->ack_number))))
320 rewrite_len =
vec_len (rewrite);
324 next0 = IP6_IOAM_CACHE_INPUT_NEXT_DROP;
333 copy_dst0 = (
u64 *) (((
u8 *) ip0) - (rewrite_len + sr_rewrite_len));
334 copy_src0 = (
u64 *) ip0;
336 copy_dst0[0] = copy_src0[0];
337 copy_dst0[1] = copy_src0[1];
338 copy_dst0[2] = copy_src0[2];
339 copy_dst0[3] = copy_src0[3];
340 copy_dst0[4] = copy_src0[4];
380 to_next, n_left_to_next,
388 IP6_ADD_FROM_CACHE_HBH_ERROR_PROCESSED,
396 .name =
"ip6-add-from-cache-hop-by-hop",
397 .vector_size =
sizeof (
u32),
406 #define _(s,n) [IP6_IOAM_CACHE_INPUT_NEXT_##s] = n,
ip_lookup_next_t
Common (IP4/IP6) next index stored in adjacency.
static ioam_cache_entry_t * ioam_cache_lookup(ip6_header_t *ip0, u16 src_port, u16 dst_port, u32 seq_no)
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
#define foreach_cache_error
static uword ip6_ioam_cache_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static u8 * format_ip6_add_from_cache_hbh_trace(u8 *s, va_list *args)
struct _tcp_header tcp_header_t
static int ioam_cache_add(vlib_buffer_t *b0, ip6_header_t *ip0, u16 src_port, u16 dst_port, ip6_hop_by_hop_header_t *hbh0, u32 seq_no)
#define foreach_ip6_add_from_cache_hbh_error
#define IPPROTO_IPV6_ROUTE
static char * cache_error_strings[]
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static uword ip6_add_from_cache_hbh_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void ioam_cache_entry_free(ioam_cache_entry_t *entry)
#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)
ip6_ioam_cache_input_next_t
ip6_add_from_cache_hbh_error_t
#define VLIB_BUFFER_IS_TRACED
#define foreach_ip6_ioam_cache_input_next
#define clib_memcpy(a, b, c)
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define VLIB_NODE_FLAG_TRACE
static int ip6_locate_header(vlib_buffer_t *p0, ip6_header_t *ip0, int find_hdr_type, u32 *offset)
vlib_node_registration_t ip6_add_from_cache_hbh_node
(constructor) VLIB_REGISTER_NODE (ip6_add_from_cache_hbh_node)
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static char * ip6_add_from_cache_hbh_error_strings[]
#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,...)
u16 flags
Copy of main node flags.
static u8 * format_cache_trace(u8 *s, va_list *args)
ioam_cache_main_t ioam_cache_main
vlib_node_registration_t ioam_cache_node
(constructor) VLIB_REGISTER_NODE (ioam_cache_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.