FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
nsh.h File Reference
+ Include dependency graph for nsh.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nsh_option_map_by_key_t
 
struct  nsh_option_map_t
 
struct  nsh_entry_t
 Note: rewrite and rewrite_size used to support varied nsh header. More...
 
struct  nsh_add_del_entry_args_t
 
struct  nsh_map_t
 
struct  nsh_add_del_map_args_t
 
struct  nsh_proxy_session_by_key_t
 
struct  nsh_proxy_session_t
 
struct  nsh_main_t
 
struct  nsh_input_trace_t
 

Macros

#define MAX_METADATA_LEN   62
 
#define MAX_MD2_OPTIONS   256
 
#define foreach_copy_nsh_base_hdr_field
 
#define foreach_nsh_node_error
 
#define foreach_nsh_node_next
 
#define VNET_SW_INTERFACE_FLAG_ADMIN_DOWN   0
 
#define NSH_MD2_IOAM_CLASS   0x9
 
#define NSH_MD2_IOAM_OPTION_TYPE_TRACE   0x3B
 
#define NSH_MD2_IOAM_OPTION_TYPE_PROOF_OF_TRANSIT   0x3C
 
#define NSH_MD2_IOAM_TRACE_DUMMY_LEN   0x8
 
#define MAX_NSH_HEADER_LEN   256
 
#define MAX_NSH_OPTION_LEN   128
 

Typedefs

typedef struct _nsh_main_dummy nsh_main_dummy_t
 

Enumerations

enum  nsh_input_error_t { NSH_NODE_N_ERROR }
 
enum  nsh_node_next_t { NSH_NODE_N_NEXT }
 
enum  nsh_action_type { NSH_ACTION_SWAP, NSH_ACTION_PUSH, NSH_ACTION_POP }
 
enum  nsh_entity_type { NSH_INPUT_TYPE, NSH_PROXY_TYPE, NSH_CLASSIFIER_TYPE, NSH_AWARE_VNF_PROXY_TYPE }
 

Functions

u8format_nsh_input_map_trace (u8 *s, va_list *args)
 
u8format_nsh_header_with_length (u8 *s, va_list *args)
 
int nsh_md2_register_option (u16 class, u8 type, u8 option_size, int add_options(u8 *opt, u8 *opt_size), int options(vlib_buffer_t *b, nsh_tlv_header_t *opt), int swap_options(vlib_buffer_t *b, nsh_tlv_header_t *old_opt, nsh_tlv_header_t *new_opt), int pop_options(vlib_buffer_t *b, nsh_tlv_header_t *opt), u8 *trace(u8 *s, nsh_tlv_header_t *opt))
 
int nsh_add_del_map (nsh_add_del_map_args_t *a, u32 *map_indexp)
 Action function to add or del an nsh map. More...
 
int nsh_add_del_proxy_session (nsh_add_del_map_args_t *a)
 Action function to add or del an nsh-proxy-session. More...
 
nsh_option_map_tnsh_md2_lookup_option (u16 class, u8 type)
 
int nsh_add_del_entry (nsh_add_del_entry_args_t *a, u32 *entry_indexp)
 Action function for adding an NSH entry nsh_add_del_entry_args_t *a: host order. More...
 
u8format_nsh_node_map_trace (u8 *s, va_list *args)
 
u8format_nsh_header (u8 *s, va_list *args)
 
clib_error_tnsh_api_init (vlib_main_t *vm, nsh_main_t *nm)
 

Variables

nsh_main_t nsh_main
 
vlib_node_registration_t nsh_aware_vnf_proxy_node
 (constructor) VLIB_REGISTER_NODE (nsh_aware_vnf_proxy_node) More...
 
vlib_node_registration_t nsh_eth_output_node
 (constructor) VLIB_REGISTER_NODE (nsh_eth_output_node) More...
 

Macro Definition Documentation

◆ foreach_copy_nsh_base_hdr_field

#define foreach_copy_nsh_base_hdr_field
Value:
_(ver_o_c) \
_(length) \
_(md_type) \
_(next_protocol) \
_(nsp_nsi)

Definition at line 183 of file nsh.h.

◆ foreach_nsh_node_error

#define foreach_nsh_node_error
Value:
_(MAPPED, "NSH header found and mapped") \
_(NO_MAPPING, "no mapping for nsh key") \
_(NO_ENTRY, "no entry for nsh key") \
_(NO_PROXY, "no proxy for transport key") \
_(INVALID_NEXT_PROTOCOL, "invalid next protocol") \
_(INVALID_OPTIONS, "invalid md2 options") \
_(INVALID_TTL, "ttl equals zero") \

Definition at line 191 of file nsh.h.

◆ foreach_nsh_node_next

#define foreach_nsh_node_next
Value:
_(DROP, "error-drop") \
_(ENCAP_GRE4, "gre4-input" ) \
_(ENCAP_GRE6, "gre6-input" ) \
_(ENCAP_VXLANGPE, "vxlan-gpe-encap" ) \
_(ENCAP_VXLAN4, "vxlan4-encap" ) \
_(ENCAP_VXLAN6, "vxlan6-encap" ) \
_(DECAP_ETH_INPUT, "ethernet-input" ) \
_(ENCAP_LISP_GPE, "interface-output" ) \
_(ENCAP_ETHERNET, "nsh-eth-output") \
/* _(DECAP_IP4_INPUT, "ip4-input") \ */
DROP
Definition: error.def:41

Definition at line 208 of file nsh.h.

◆ MAX_MD2_OPTIONS

#define MAX_MD2_OPTIONS   256

Definition at line 103 of file nsh.h.

◆ MAX_METADATA_LEN

#define MAX_METADATA_LEN   62

Definition at line 32 of file nsh.h.

◆ MAX_NSH_HEADER_LEN

#define MAX_NSH_HEADER_LEN   256

Definition at line 250 of file nsh.h.

◆ MAX_NSH_OPTION_LEN

#define MAX_NSH_OPTION_LEN   128

Definition at line 251 of file nsh.h.

◆ NSH_MD2_IOAM_CLASS

#define NSH_MD2_IOAM_CLASS   0x9

Definition at line 244 of file nsh.h.

◆ NSH_MD2_IOAM_OPTION_TYPE_PROOF_OF_TRANSIT

#define NSH_MD2_IOAM_OPTION_TYPE_PROOF_OF_TRANSIT   0x3C

Definition at line 246 of file nsh.h.

◆ NSH_MD2_IOAM_OPTION_TYPE_TRACE

#define NSH_MD2_IOAM_OPTION_TYPE_TRACE   0x3B

Definition at line 245 of file nsh.h.

◆ NSH_MD2_IOAM_TRACE_DUMMY_LEN

#define NSH_MD2_IOAM_TRACE_DUMMY_LEN   0x8

Definition at line 248 of file nsh.h.

◆ VNET_SW_INTERFACE_FLAG_ADMIN_DOWN

#define VNET_SW_INTERFACE_FLAG_ADMIN_DOWN   0

Definition at line 241 of file nsh.h.

Typedef Documentation

◆ nsh_main_dummy_t

typedef struct _nsh_main_dummy nsh_main_dummy_t

Enumeration Type Documentation

◆ nsh_action_type

Enumerator
NSH_ACTION_SWAP 
NSH_ACTION_PUSH 
NSH_ACTION_POP 

Definition at line 228 of file nsh.h.

◆ nsh_entity_type

Enumerator
NSH_INPUT_TYPE 
NSH_PROXY_TYPE 
NSH_CLASSIFIER_TYPE 
NSH_AWARE_VNF_PROXY_TYPE 

Definition at line 234 of file nsh.h.

◆ nsh_input_error_t

Enumerator
NSH_NODE_N_ERROR 

Definition at line 200 of file nsh.h.

◆ nsh_node_next_t

Enumerator
NSH_NODE_N_NEXT 

Definition at line 221 of file nsh.h.

Function Documentation

◆ format_nsh_header()

u8* format_nsh_header ( u8 s,
va_list *  args 
)

Definition at line 512 of file nsh_cli.c.

◆ format_nsh_header_with_length()

u8* format_nsh_header_with_length ( u8 s,
va_list *  args 
)

◆ format_nsh_input_map_trace()

u8* format_nsh_input_map_trace ( u8 s,
va_list *  args 
)

◆ format_nsh_node_map_trace()

u8* format_nsh_node_map_trace ( u8 s,
va_list *  args 
)

Definition at line 597 of file nsh_cli.c.

◆ nsh_add_del_entry()

int nsh_add_del_entry ( nsh_add_del_entry_args_t a,
u32 entry_indexp 
)

Action function for adding an NSH entry nsh_add_del_entry_args_t *a: host order.

Definition at line 511 of file nsh_api.c.

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

◆ nsh_add_del_map()

int nsh_add_del_map ( nsh_add_del_map_args_t a,
u32 map_indexp 
)

Action function to add or del an nsh map.

Shared by both CLI and binary API

Definition at line 347 of file nsh_api.c.

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

◆ nsh_add_del_proxy_session()

int nsh_add_del_proxy_session ( nsh_add_del_map_args_t a)

Action function to add or del an nsh-proxy-session.

Shared by both CLI and binary API

Definition at line 449 of file nsh_api.c.

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

◆ nsh_api_init()

clib_error_t* nsh_api_init ( vlib_main_t vm,
nsh_main_t nm 
)

Definition at line 702 of file nsh_api.c.

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

◆ nsh_md2_lookup_option()

nsh_option_map_t* nsh_md2_lookup_option ( u16  class,
u8  type 
)

Definition at line 88 of file nsh.c.

◆ nsh_md2_register_option()

int nsh_md2_register_option ( u16  class,
u8  type,
u8  option_size,
int   add_optionsu8 *opt, u8 *opt_size,
int   optionsvlib_buffer_t *b, nsh_tlv_header_t *opt,
int   swap_optionsvlib_buffer_t *b, nsh_tlv_header_t *old_opt, nsh_tlv_header_t *new_opt,
int   pop_optionsvlib_buffer_t *b, nsh_tlv_header_t *opt,
u8 traceu8 *s, nsh_tlv_header_t *opt 
)

Definition at line 32 of file nsh.c.

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

Variable Documentation

◆ nsh_aware_vnf_proxy_node

vlib_node_registration_t nsh_aware_vnf_proxy_node

(constructor) VLIB_REGISTER_NODE (nsh_aware_vnf_proxy_node)

Definition at line 959 of file nsh_node.c.

◆ nsh_eth_output_node

vlib_node_registration_t nsh_eth_output_node

(constructor) VLIB_REGISTER_NODE (nsh_eth_output_node)

Definition at line 331 of file nsh_output.c.

◆ nsh_main

nsh_main_t nsh_main

Definition at line 28 of file nsh.c.