|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
39 #define foreach_analyse_error \
40 _(ANALYSED, "Packets analysed for summarization") \
41 _(FAILED, "Packets analysis failed") \
45 #define _(sym,str) ANALYSE_ERROR_##sym,
52 #define _(sym,string) string,
74 s =
format (s,
"IP6-ioam-analyse: flow_id %d, next index %d",
100 if (
am->analyse_hbh_handler[type0])
103 ((*
am->analyse_hbh_handler[type0]) (flow_id, opt0,
106 error0 = ANALYSE_ERROR_FAILED;
147 u32 pkts_analysed = 0;
174 u16 num_ioam_records;
195 limit =
data + clib_net_to_host_u16 (ip40->
length);
201 while (num_ioam_records >= 4)
211 num_ioam_records -= 2;
216 u32 flow_id0, flow_id1;
234 ((hbh0->
length + 1) << 3));
237 ((hbh1->
length + 1) << 3));
270 else if (error0 == 0)
281 else if (error1 == 0)
296 while (num_ioam_records > 0)
314 ((hbh0->
length + 1) << 3));
339 n_left_to_next, bi0, next0);
352 return frame->n_vectors;
360 ioam_trace_option_t *
trace = (ioam_trace_option_t *) opt;
366 (
trace->hdr.length - 2)
377 ioam_pot_option_t *pot0;
386 pot0 = (ioam_pot_option_t *) opt0;
387 random = clib_net_to_host_u64 (pot0->random);
388 cumulative = clib_net_to_host_u64 (pot0->cumulative);
394 (0 == ret) ? (
data->pot_data.sfc_validated_count++) :
395 (
data->pot_data.sfc_invalidated_count++);
406 ioam_e2e_option_t *e2e;
409 e2e = (ioam_e2e_option_t *) opt;
425 if (
am->analyse_hbh_handler[option])
428 am->analyse_hbh_handler[option] =
options;
441 if (!
am->analyse_hbh_handler[option])
444 am->analyse_hbh_handler[option] = NULL;
476 .name =
"ip6-hbh-analyse-local",
477 .vector_size =
sizeof (
u32),
496 .name =
"ip6-hbh-analyse-remote",
497 .vector_size =
sizeof (
u32),
static ioam_analyser_data_t * ioam_analyse_get_data_from_flow_id(u32 flow_id)
static vlib_cli_command_t trace
(constructor) VLIB_CLI_COMMAND (trace)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static uword ip6_ioam_analyse_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
IPv6 InBandOAM Analyse node.
static int ip6_ioam_analyse_hbh_e2e(ioam_analyser_data_t *data, ioam_e2e_packet_t *e2e, u16 len)
int ip6_ioam_analyse_hbh_e2e_internal(u32 flow_id, ip6_hop_by_hop_option_t *opt, u16 len)
@ VLIB_NODE_TYPE_INTERNAL
vlib_main_t vlib_node_runtime_t * node
void ip6_ioam_analyse_unregister_handlers()
ip6_ioam_analyser_main_t ioam_analyser_main
u8 pot_validate(pot_profile *profile, u64 cumulative, u64 random)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
void ip6_ioam_analyse_register_handlers()
#define CLIB_PREFETCH(addr, size, type)
static u8 ioam_analyse_hbh(u32 flow_id, ip6_hop_by_hop_header_t *hbh0, ip6_hop_by_hop_option_t *opt0, ip6_hop_by_hop_option_t *limit0, u16 len)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
static char * analyse_error_strings[]
IP6-iOAM analyser main structure.
#define foreach_analyse_error
static u8 * format_analyse_trace(u8 *s, va_list *args)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
int ip6_ioam_analyse_register_hbh_handler(u8 option, int options(u32 flow_id, ip6_hop_by_hop_option_t *opt, u16 len))
#define DEFAULT_EXPORT_SIZE
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
vlib_node_registration_t analyse_node_remote
(constructor) VLIB_REGISTER_NODE (analyse_node_remote)
struct _vlib_node_registration vlib_node_registration_t
int ip6_ioam_analyse_hbh_pot(u32 flow_id, ip6_hop_by_hop_option_t *opt0, u16 len)
vlib_node_registration_t analyse_node_local
(constructor) VLIB_REGISTER_NODE (analyse_node_local)
#define HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE
u32 pkt_counter
Num of pkts matching this flow.
#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 HBH_OPTION_TYPE_IOAM_PROOF_OF_TRANSIT
description fragment has unexpected format
int ip6_ioam_analyse_unregister_hbh_handler(u8 option)
vlib_put_next_frame(vm, node, next_index, 0)
clib_spinlock_t writer_lock
Lock to since we use this to export the data in other thread.
static struct option options[]
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static pot_profile * pot_profile_get_active(void)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
int ip6_ioam_analyse_hbh_trace_internal(u32 flow_id, ip6_hop_by_hop_option_t *opt, u16 len)
u32 bytes_counter
Num of bytes matching this flow.
@ ANALYSE_NEXT_IP4_LOOKUP
#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
#define HBH_OPTION_TYPE_IOAM_TRACE_DATA_LIST
static int ip6_ioam_analyse_hbh_trace(ioam_analyser_data_t *data, ioam_trace_hdr_t *trace, u16 pak_len, u16 trace_len)
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)