|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
27 #define foreach_ip6_hop_by_hop_ioam_pot_stats \
28 _(PROCESSED, "Pkts with ip6 hop-by-hop pot options") \
29 _(PROFILE_MISS, "Pkts with ip6 hop-by-hop pot options but no profile set") \
30 _(PASSED, "Pkts with POT in Policy") \
31 _(FAILED, "Pkts with POT out of Policy")
34 #define _(sym,string) string,
40 #define _(sym,str) IP6_IOAM_POT_##sym,
68 ioam_pot_option_t * pot0 = va_arg (*args, ioam_pot_option_t *);
69 u64 random, cumulative;
70 random = cumulative = 0;
73 random = clib_net_to_host_u64 (pot0->random);
74 cumulative = clib_net_to_host_u64 (pot0->cumulative);
77 s =
format (s,
"random = 0x%Lx, Cumulative = 0x%Lx, Index = 0x%x",
78 random, cumulative, pot0 ? pot0->reserved_profile_id : ~0);
85 ioam_pot_option_t *pot;
87 s =
format (s,
" POT opt present\n");
88 pot = (ioam_pot_option_t *) opt;
98 ioam_pot_option_t * pot0;
99 u64 random = 0, cumulative = 0;
101 u8 pot_profile_index;
105 pot0 = (ioam_pot_option_t *) opt0;
106 pot_encap = (pot0->random == 0);
116 pot0->reserved_profile_id =
129 new_profile->valid == 0))
136 pot_profile_index = pot0->reserved_profile_id;
145 if (pot0->random == 0)
148 pot0->cumulative = 0;
150 random = clib_net_to_host_u64(pot0->random);
151 cumulative = clib_net_to_host_u64(pot0->cumulative);
152 pot0->cumulative = clib_host_to_net_u64(
165 ioam_pot_option_t * pot0;
172 pot0 = (ioam_pot_option_t *) opt0;
173 random = clib_net_to_host_u64(pot0->random);
174 cumulative = clib_net_to_host_u64(pot0->cumulative);
192 ioam_pot_option_t * pot_option;
193 if (rewrite_string && *rewrite_size ==
sizeof(ioam_pot_option_t))
195 pot_option = (ioam_pot_option_t *)rewrite_string;
198 pot_option->hdr.length =
sizeof (ioam_pot_option_t) -
227 .path =
"show ioam pot",
228 .short_help =
"iOAM pot statistics",
244 return (
clib_error_create(
"registration of HBH_OPTION_TYPE_IOAM_PROOF_OF_TRANSIT failed"));
247 sizeof(ioam_pot_option_t),
249 return (
clib_error_create(
"registration of HBH_OPTION_TYPE_IOAM_PROOF_OF_TRANSIT for rewrite failed"));
253 return (
clib_error_create(
"registration of HBH_OPTION_TYPE_IOAM_PROOF_OF_TRANSIT POP failed"));
261 .runs_after =
VLIB_INITS(
"ip6_hop_by_hop_ioam_init"),
u64 pot_generate_random(pot_profile *profile)
static clib_error_t * ip6_hop_by_hop_ioam_pot_init(vlib_main_t *vm)
static void ip6_ioam_stats_increment_counter(u32 counter_index, u64 increment)
pot_profile * pot_profile_find(u8 id)
u8 pot_validate(pot_profile *profile, u64 cumulative, u64 random)
int ip6_hbh_ioam_proof_of_transit_pop_handler(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt0)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static u32 counter_index(vlib_main_t *vm, vlib_error_t e)
u8 * ip6_hbh_ioam_proof_of_transit_trace_handler(u8 *s, ip6_hop_by_hop_option_t *opt)
static void pot_profile_reset_usage_stats(pot_profile *pow)
static vlib_cli_command_t ip6_show_ioam_pot_cmd
(constructor) VLIB_CLI_COMMAND (ip6_show_ioam_pot_cmd)
static clib_error_t * ip6_show_ioam_pot_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void pot_profile_incr_usage_stats(pot_profile *pow)
int ip6_hbh_register_option(u8 option, int options(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt), u8 *trace(u8 *s, ip6_hop_by_hop_option_t *opt))
#define clib_error_create(args...)
vnet_main_t * vnet_get_main(void)
static u8 * format_ioam_pot(u8 *s, va_list *args)
sll srl srl sll sra u16x4 i
#define VLIB_CLI_COMMAND(x,...)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static char * ip6_hop_by_hop_ioam_pot_stats_strings[]
#define vec_free(V)
Free vector's memory (no header).
int ip6_hop_by_hop_ioam_pot_rewrite_handler(u8 *rewrite_string, u8 *rewrite_size)
#define HBH_OPTION_TYPE_IOAM_PROOF_OF_TRANSIT
description fragment has unexpected format
ip6_hop_by_hop_ioam_pot_main_t ip6_hop_by_hop_ioam_pot_main
#define VLIB_INIT_FUNCTION(x)
int ip6_hbh_pop_register_option(u8 option, int options(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt))
static pot_profile * pot_profile_get_active(void)
#define HBH_OPTION_TYPE_DATA_CHANGE_ENROUTE
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
int ip6_hbh_ioam_proof_of_transit_handler(vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt0)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
u64 counters[ARRAY_LEN(ip6_hop_by_hop_ioam_pot_stats_strings)]
#define foreach_ip6_hop_by_hop_ioam_pot_stats
static u8 pot_profile_get_active_id(void)
u64 pot_update_cumulative(pot_profile *profile, u64 cumulative, u64 random)
static int pot_profile_set_active(u8 id)
int ip6_hbh_add_register_option(u8 option, u8 size, int rewrite_options(u8 *rewrite_string, u8 *rewrite_size))
VLIB buffer representation.