FD.io VPP  v19.01.3-6-g70449b9b9
Vector Packet Processing
ip6_hop_by_hop.c File Reference

In-band OAM (iOAM). More...

+ Include dependency graph for ip6_hop_by_hop.c:

Go to the source code of this file.

Data Structures

struct  ip6_add_hop_by_hop_trace_t
 
struct  ip6_pop_hop_by_hop_trace_t
 

Macros

#define foreach_ip6_hbyh_ioam_input_next
 
#define foreach_ip6_add_hop_by_hop_error   _(PROCESSED, "Pkts w/ added ip6 hop-by-hop options")
 
#define foreach_ip6_pop_hop_by_hop_error
 

Enumerations

enum  ip6_hbyh_ioam_input_next_t { IP6_HBYH_IOAM_INPUT_N_NEXT }
 
enum  ip6_add_hop_by_hop_error_t { IP6_ADD_HOP_BY_HOP_N_ERROR }
 
enum  ip6_pop_hop_by_hop_error_t { IP6_POP_HOP_BY_HOP_N_ERROR }
 

Functions

static uword unformat_opaque_ioam (unformat_input_t *input, va_list *args)
 
u8get_flow_name_from_flow_ctx (u32 flow_ctx)
 
int ip6_hbh_add_register_option (u8 option, u8 size, int rewrite_options(u8 *rewrite_string, u8 *rewrite_size))
 
int ip6_hbh_add_unregister_option (u8 option)
 
int ip6_hbh_config_handler_register (u8 option, int config_handler(void *data, u8 disable))
 
int ip6_hbh_config_handler_unregister (u8 option)
 
int ip6_hbh_flow_handler_register (u8 option, u32 ioam_flow_handler(u32 flow_ctx, u8 add))
 
int ip6_hbh_flow_handler_unregister (u8 option)
 
static u8format_ip6_add_hop_by_hop_trace (u8 *s, va_list *args)
 
static uword ip6_add_hop_by_hop_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip6_add_hop_by_hop_node, ip6_add_hop_by_hop_node_fn)
 
static u8format_ip6_pop_hop_by_hop_trace (u8 *s, va_list *args)
 
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))
 
int ip6_hbh_pop_unregister_option (u8 option)
 
static void ioam_pop_hop_by_hop_processing (vlib_main_t *vm, ip6_header_t *ip0, ip6_hop_by_hop_header_t *hbh0, vlib_buffer_t *b)
 
static uword ip6_pop_hop_by_hop_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (ip6_pop_hop_by_hop_node, ip6_pop_hop_by_hop_node_fn)
 
static clib_error_tip6_hop_by_hop_ioam_init (vlib_main_t *vm)
 
int ip6_ioam_set_rewrite (u8 **rwp, int has_trace_option, int has_pot_option, int has_seqno_option)
 
clib_error_tclear_ioam_rewrite_fn (void)
 
clib_error_tclear_ioam_rewrite_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
clib_error_tip6_ioam_enable (int has_trace_option, int has_pot_option, int has_seqno_option, int has_analyse_option)
 
static clib_error_tip6_set_ioam_rewrite_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tip6_show_ioam_summary_cmd_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
void vnet_register_ioam_end_of_path_callback (void *cb)
 

Variables

ip6_hop_by_hop_ioam_main_t ip6_hop_by_hop_ioam_main
 
vlib_node_registration_t ip6_add_hop_by_hop_node
 (constructor) VLIB_REGISTER_NODE (ip6_add_hop_by_hop_node) More...
 
static char * ip6_add_hop_by_hop_error_strings []
 
vlib_node_registration_t ip6_pop_hop_by_hop_node
 (constructor) VLIB_REGISTER_NODE (ip6_pop_hop_by_hop_node) More...
 
static char * ip6_pop_hop_by_hop_error_strings []
 
static vlib_cli_command_t ip6_clear_ioam_rewrite_cmd
 (constructor) VLIB_CLI_COMMAND (ip6_clear_ioam_rewrite_cmd) More...
 
static vlib_cli_command_t ip6_set_ioam_rewrite_cmd
 (constructor) VLIB_CLI_COMMAND (ip6_set_ioam_rewrite_cmd) More...
 
static vlib_cli_command_t ip6_show_ioam_run_cmd
 (constructor) VLIB_CLI_COMMAND (ip6_show_ioam_run_cmd) More...
 

Detailed Description

In-band OAM (iOAM).

In-band OAM (iOAM) is an implementation study to record operational information in the packet while the packet traverses a path between two points in the network.

VPP can function as in-band OAM encapsulating, transit and decapsulating node. In this version of VPP in-band OAM data is transported as options in an IPv6 hop-by-hop extension header. Hence in-band OAM can be enabled for IPv6 traffic.

Definition in file ip6_hop_by_hop.c.

Macro Definition Documentation

◆ foreach_ip6_add_hop_by_hop_error

#define foreach_ip6_add_hop_by_hop_error   _(PROCESSED, "Pkts w/ added ip6 hop-by-hop options")

Definition at line 220 of file ip6_hop_by_hop.c.

◆ foreach_ip6_hbyh_ioam_input_next

#define foreach_ip6_hbyh_ioam_input_next
Value:
_(IP6_REWRITE, "ip6-rewrite") \
_(IP6_LOOKUP, "ip6-lookup") \
_(DROP, "ip6-drop")
DROP
Definition: error.def:41

Definition at line 46 of file ip6_hop_by_hop.c.

◆ foreach_ip6_pop_hop_by_hop_error

#define foreach_ip6_pop_hop_by_hop_error
Value:
_(PROCESSED, "Pkts w/ removed ip6 hop-by-hop options") \
_(NO_HOHO, "Pkts w/ no ip6 hop-by-hop options") \
_(OPTION_FAILED, "ip6 pop hop-by-hop failed to process")

Definition at line 515 of file ip6_hop_by_hop.c.

Enumeration Type Documentation

◆ ip6_add_hop_by_hop_error_t

Enumerator
IP6_ADD_HOP_BY_HOP_N_ERROR 

Definition at line 223 of file ip6_hop_by_hop.c.

◆ ip6_hbyh_ioam_input_next_t

Enumerator
IP6_HBYH_IOAM_INPUT_N_NEXT 

Definition at line 51 of file ip6_hop_by_hop.c.

◆ ip6_pop_hop_by_hop_error_t

Enumerator
IP6_POP_HOP_BY_HOP_N_ERROR 

Definition at line 520 of file ip6_hop_by_hop.c.

Function Documentation

◆ clear_ioam_rewrite_command_fn()

clib_error_t* clear_ioam_rewrite_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)

Definition at line 937 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:

◆ clear_ioam_rewrite_fn()

clib_error_t* clear_ioam_rewrite_fn ( void  )

Definition at line 910 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ format_ip6_add_hop_by_hop_trace()

static u8* format_ip6_add_hop_by_hop_trace ( u8 s,
va_list *  args 
)
static

Definition at line 207 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ip6_pop_hop_by_hop_trace()

static u8* format_ip6_pop_hop_by_hop_trace ( u8 s,
va_list *  args 
)
static

Definition at line 468 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_flow_name_from_flow_ctx()

u8* get_flow_name_from_flow_ctx ( u32  flow_ctx)

Definition at line 82 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ioam_pop_hop_by_hop_processing()

static void ioam_pop_hop_by_hop_processing ( vlib_main_t vm,
ip6_header_t ip0,
ip6_hop_by_hop_header_t hbh0,
vlib_buffer_t b 
)
inlinestatic

Definition at line 535 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip6_add_hop_by_hop_node_fn()

static uword ip6_add_hop_by_hop_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 238 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:

◆ ip6_hbh_add_register_option()

int ip6_hbh_add_register_option ( u8  option,
u8  size,
int   rewrite_optionsu8 *rewrite_string, u8 *rewrite_size 
)

Definition at line 99 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hbh_add_unregister_option()

int ip6_hbh_add_unregister_option ( u8  option)

Definition at line 119 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hbh_config_handler_register()

int ip6_hbh_config_handler_register ( u8  option,
int   config_handlervoid *data, u8 disable 
)

Definition at line 136 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hbh_config_handler_unregister()

int ip6_hbh_config_handler_unregister ( u8  option)

Definition at line 153 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hbh_flow_handler_register()

int ip6_hbh_flow_handler_register ( u8  option,
u32   ioam_flow_handleru32 flow_ctx, u8 add 
)

Definition at line 169 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hbh_flow_handler_unregister()

int ip6_hbh_flow_handler_unregister ( u8  option)

Definition at line 186 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hbh_pop_register_option()

int ip6_hbh_pop_register_option ( u8  option,
int   optionsvlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt 
)

Definition at line 480 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hbh_pop_unregister_option()

int ip6_hbh_pop_unregister_option ( u8  option)

Definition at line 499 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_hop_by_hop_ioam_init()

static clib_error_t* ip6_hop_by_hop_ioam_init ( vlib_main_t vm)
static

Definition at line 796 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip6_ioam_enable()

clib_error_t* ip6_ioam_enable ( int  has_trace_option,
int  has_pot_option,
int  has_seqno_option,
int  has_analyse_option 
)

Definition at line 962 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip6_ioam_set_rewrite()

int ip6_ioam_set_rewrite ( u8 **  rwp,
int  has_trace_option,
int  has_pot_option,
int  has_seqno_option 
)

Definition at line 824 of file ip6_hop_by_hop.c.

+ Here is the caller graph for this function:

◆ ip6_pop_hop_by_hop_node_fn()

static uword ip6_pop_hop_by_hop_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 581 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:

◆ ip6_set_ioam_rewrite_command_fn()

static clib_error_t* ip6_set_ioam_rewrite_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1011 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:

◆ ip6_show_ioam_summary_cmd_fn()

static clib_error_t* ip6_show_ioam_summary_cmd_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 1069 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:

◆ unformat_opaque_ioam()

static uword unformat_opaque_ioam ( unformat_input_t input,
va_list *  args 
)
static

Definition at line 60 of file ip6_hop_by_hop.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ VLIB_NODE_FUNCTION_MULTIARCH() [1/2]

VLIB_NODE_FUNCTION_MULTIARCH ( ip6_add_hop_by_hop_node  ,
ip6_add_hop_by_hop_node_fn   
)
+ Here is the caller graph for this function:

◆ VLIB_NODE_FUNCTION_MULTIARCH() [2/2]

VLIB_NODE_FUNCTION_MULTIARCH ( ip6_pop_hop_by_hop_node  ,
ip6_pop_hop_by_hop_node_fn   
)

◆ vnet_register_ioam_end_of_path_callback()

void vnet_register_ioam_end_of_path_callback ( void *  cb)

Definition at line 1153 of file ip6_hop_by_hop.c.

Variable Documentation

◆ ip6_add_hop_by_hop_error_strings

char* ip6_add_hop_by_hop_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_ip6_add_hop_by_hop_error

Definition at line 231 of file ip6_hop_by_hop.c.

◆ ip6_add_hop_by_hop_node

vlib_node_registration_t ip6_add_hop_by_hop_node
Initial value:
=
{
.function = ip6_add_hop_by_hop_node_fn,.name =
"ip6-add-hop-by-hop",.vector_size = sizeof (u32),.format_trace =
.n_next_nodes = IP6_HBYH_IOAM_INPUT_N_NEXT,.next_nodes =
{
#define _(s,n)
}
,}
static u8 * format_ip6_add_hop_by_hop_trace(u8 *s, va_list *args)
static uword ip6_add_hop_by_hop_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static char * ip6_add_hop_by_hop_error_strings[]
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:62
#define foreach_ip6_hbyh_ioam_input_next

(constructor) VLIB_REGISTER_NODE (ip6_add_hop_by_hop_node)

Definition at line 218 of file ip6_hop_by_hop.c.

◆ ip6_clear_ioam_rewrite_cmd

vlib_cli_command_t ip6_clear_ioam_rewrite_cmd
static
Initial value:
= {
.path = "clear ioam rewrite",
.short_help = "clear ioam rewrite",
}
clib_error_t * clear_ioam_rewrite_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (ip6_clear_ioam_rewrite_cmd)

Definition at line 954 of file ip6_hop_by_hop.c.

◆ ip6_hop_by_hop_ioam_main

ip6_hop_by_hop_ioam_main_t ip6_hop_by_hop_ioam_main

Definition at line 44 of file ip6_hop_by_hop.c.

◆ ip6_pop_hop_by_hop_error_strings

char* ip6_pop_hop_by_hop_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_ip6_pop_hop_by_hop_error

Definition at line 528 of file ip6_hop_by_hop.c.

◆ ip6_pop_hop_by_hop_node

vlib_node_registration_t ip6_pop_hop_by_hop_node
Initial value:
=
{
.function = ip6_pop_hop_by_hop_node_fn,.name =
"ip6-pop-hop-by-hop",.vector_size = sizeof (u32),.format_trace =
VLIB_NODE_TYPE_INTERNAL,.sibling_of = "ip6-lookup",.n_errors =
.n_next_nodes = 0,}
static uword ip6_pop_hop_by_hop_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
unsigned int u32
Definition: types.h:88
static u8 * format_ip6_pop_hop_by_hop_trace(u8 *s, va_list *args)
#define ARRAY_LEN(x)
Definition: clib.h:62
static char * ip6_pop_hop_by_hop_error_strings[]

(constructor) VLIB_REGISTER_NODE (ip6_pop_hop_by_hop_node)

Definition at line 513 of file ip6_hop_by_hop.c.

◆ ip6_set_ioam_rewrite_cmd

vlib_cli_command_t ip6_set_ioam_rewrite_cmd
static
Initial value:
= {
.path = "set ioam rewrite",
.short_help = "set ioam [trace] [pot] [seqno] [analyse]",
}
static clib_error_t * ip6_set_ioam_rewrite_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (ip6_set_ioam_rewrite_cmd)

Definition at line 1061 of file ip6_hop_by_hop.c.

◆ ip6_show_ioam_run_cmd

vlib_cli_command_t ip6_show_ioam_run_cmd
static
Initial value:
= {
.path = "show ioam summary",
.short_help = "show ioam summary",
}
static clib_error_t * ip6_show_ioam_summary_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (ip6_show_ioam_run_cmd)

Definition at line 1145 of file ip6_hop_by_hop.c.