FD.io VPP  v18.10-34-gcce845e
Vector Packet Processing
nsh.c File Reference
+ Include dependency graph for nsh.c:

Go to the source code of this file.

Macros

#define vl_msg_id(n, h)   n,
 
#define vl_typedefs
 
#define vl_endianfun
 
#define vl_print(handle, ...)   vlib_cli_output (handle, __VA_ARGS__)
 
#define vl_printfun
 
#define vl_api_version(n, v)   static u32 api_version=(v);
 
#define vl_msg_name_crc_list
 
#define REPLY_MACRO(t)
 
#define REPLY_MACRO2(t, body)
 
#define FINISH
 
#define foreach_nsh_plugin_api_msg
 

Enumerations

enum  vl_msg_id_t {
  VL_ILLEGAL_MESSAGE_ID = 0, VL_ILLEGAL_MESSAGE_ID = 0, VL_MSG_FIRST_AVAILABLE, VL_ILLEGAL_MESSAGE_ID = 0,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE, VL_MSG_FIRST_AVAILABLE,
  VL_MSG_FIRST_AVAILABLE
}
 

Functions

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))
 
nsh_option_map_tnsh_md2_lookup_option (u16 class, u8 type)
 
int nsh_md2_unregister_option (u16 class, u8 type, int options(vlib_buffer_t *b, nsh_tlv_header_t *opt), u8 *trace(u8 *s, nsh_tlv_header_t *opt))
 
u8format_nsh_header (u8 *s, va_list *args)
 
static u8format_nsh_action (u8 *s, va_list *args)
 
u8format_nsh_map (u8 *s, va_list *args)
 
u8format_nsh_node_map_trace (u8 *s, va_list *args)
 
static u8format_nsh_name (u8 *s, va_list *args)
 Naming for NSH tunnel. More...
 
static clib_error_tnsh_interface_admin_up_down (vnet_main_t *vnm, u32 nsh_hw_if, u32 flags)
 CLI function for NSH admin up/down. More...
 
static uword dummy_interface_tx (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
 VNET_DEVICE_CLASS (nsh_device_class, static)
 
static u8format_nsh_tunnel_with_length (u8 *s, va_list *args)
 Formatting function for tracing VXLAN GPE with length. More...
 
 VNET_HW_INTERFACE_CLASS (nsh_hw_class)
 
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...
 
static uword unformat_nsh_action (unformat_input_t *input, va_list *args)
 CLI command for NSH map. More...
 
static adj_index_t nsh_get_adj_by_sw_if_index (u32 sw_if_index)
 
static clib_error_tnsh_add_del_map_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static void vl_api_nsh_add_del_map_t_handler (vl_api_nsh_add_del_map_t *mp)
 API message handler. More...
 
static clib_error_tshow_nsh_map_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI command for showing the mapping between NSH entries. More...
 
int nsh_header_rewrite (nsh_entry_t *nsh_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. More...
 
static clib_error_tnsh_add_del_entry_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 CLI command for adding NSH entry. More...
 
static void vl_api_nsh_add_del_entry_t_handler (vl_api_nsh_add_del_entry_t *mp)
 API message handler. More...
 
static void send_nsh_entry_details (nsh_entry_t *t, unix_shared_memory_queue_t *q, u32 context)
 
static void vl_api_nsh_entry_dump_t_handler (vl_api_nsh_entry_dump_t *mp)
 
static void send_nsh_map_details (nsh_map_t *t, unix_shared_memory_queue_t *q, u32 context)
 
static void vl_api_nsh_map_dump_t_handler (vl_api_nsh_map_dump_t *mp)
 
static clib_error_tshow_nsh_entry_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tnsh_plugin_api_hookup (vlib_main_t *vm)
 
static void setup_message_id_table (nsh_main_t *nm, api_main_t *am)
 
static void nsh_md2_encap (vlib_buffer_t *b, nsh_base_header_t *hdr, nsh_entry_t *nsh_entry)
 
static void nsh_md2_swap (vlib_buffer_t *b, nsh_base_header_t *hdr, u32 header_len, nsh_entry_t *nsh_entry, u32 *next, u32 drop_node_val)
 
static void nsh_md2_decap (vlib_buffer_t *b, nsh_base_header_t *hdr, u32 *header_len, u32 *next, u32 drop_node_val)
 
static uword nsh_input_map (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u32 node_type)
 
static uword nsh_input (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Graph processing dispatch function for NSH Input. More...
 
static uword nsh_proxy (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Graph processing dispatch function for NSH-Proxy. More...
 
static uword nsh_classifier (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Graph processing dispatch function for NSH Classifier. More...
 
static uword nsh_aware_vnf_proxy (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 Graph processing dispatch function for NSH-AWARE-VNF-PROXY. More...
 
 VLIB_NODE_FUNCTION_MULTIARCH (nsh_input_node, nsh_input)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nsh_proxy_node, nsh_proxy)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nsh_classifier_node, nsh_classifier)
 
 VLIB_NODE_FUNCTION_MULTIARCH (nsh_aware_vnf_proxy_node, nsh_aware_vnf_proxy)
 
void nsh_md2_set_next_ioam_export_override (uword next)
 
clib_error_tnsh_init (vlib_main_t *vm)
 
 VLIB_PLUGIN_REGISTER ()
 

Variables

const char dummy_dst_address [6] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 }
 
const char dummy_src_address [6] = { 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc }
 
static vlib_cli_command_t create_nsh_map_command
 (constructor) VLIB_CLI_COMMAND (create_nsh_map_command) More...
 
static vlib_cli_command_t show_nsh_map_command
 (constructor) VLIB_CLI_COMMAND (show_nsh_map_command) More...
 
static vlib_cli_command_t create_nsh_entry_command
 (constructor) VLIB_CLI_COMMAND (create_nsh_entry_command) More...
 
static vlib_cli_command_t show_nsh_entry_command
 (constructor) VLIB_CLI_COMMAND (show_nsh_entry_command) More...
 
static char * nsh_node_error_strings []
 
vlib_node_registration_t nsh_input_node
 (constructor) VLIB_REGISTER_NODE (nsh_input_node) More...
 
vlib_node_registration_t nsh_proxy_node
 (constructor) VLIB_REGISTER_NODE (nsh_proxy_node) More...
 
vlib_node_registration_t nsh_classifier_node
 (constructor) VLIB_REGISTER_NODE (nsh_classifier_node) More...
 
vlib_node_registration_t nsh_aware_vnf_proxy_node
 (constructor) VLIB_REGISTER_NODE (nsh_aware_vnf_proxy_node) More...
 

Macro Definition Documentation

#define FINISH
Value:
vec_add1 (s, 0); \
vl_print (handle, (char *)s); \
vec_free (s); \
return handle;
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:523
#define vl_print(handle,...)
Definition: nsh.c:52
#define vec_free(V)
Free vector's memory (no header).
Definition: vec.h:339

Definition at line 109 of file nsh.c.

#define foreach_nsh_plugin_api_msg
Value:
_(NSH_ADD_DEL_ENTRY, nsh_add_del_entry) \
_(NSH_ENTRY_DUMP, nsh_entry_dump) \
_(NSH_ADD_DEL_MAP, nsh_add_del_map) \
_(NSH_MAP_DUMP, nsh_map_dump)
int nsh_add_del_map(nsh_add_del_map_args_t *a, u32 *map_indexp)
Action function to add or del an nsh map.
Definition: nsh.c:505
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: nsh.c:1013

Definition at line 117 of file nsh.c.

#define REPLY_MACRO (   t)
Value:
do { \
if (!q) \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
rmp->_vl_msg_id = ntohs((t)+nm->msg_id_base); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
vl_msg_api_send_shmem (q, (u8 *)&rmp); \
} while(0);
void * vl_msg_api_alloc(int nbytes)
unsigned char u8
Definition: types.h:56
svm_queue_t unix_shared_memory_queue_t
Definition: queue.h:132
void vl_msg_api_send_shmem(svm_queue_t *q, u8 *elem)
svm_queue_t * vl_api_client_index_to_input_queue(u32 index)
Definition: memory_api.c:759

Definition at line 78 of file nsh.c.

#define REPLY_MACRO2 (   t,
  body 
)
Value:
do { \
rv = vl_msg_api_pd_handler (mp, rv); \
q = vl_api_client_index_to_input_queue (mp->client_index); \
if (!q) \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
rmp->_vl_msg_id = ntohs((t)+nm->msg_id_base); \
rmp->context = mp->context; \
rmp->retval = ntohl(rv); \
do {body;} while (0); \
vl_msg_api_send_shmem (q, (u8 *)&rmp); \
} while(0);
int vl_msg_api_pd_handler(void *mp, int rv)
Definition: api_shared.c:836
void * vl_msg_api_alloc(int nbytes)
unsigned char u8
Definition: types.h:56
svm_queue_t unix_shared_memory_queue_t
Definition: queue.h:132
void vl_msg_api_send_shmem(svm_queue_t *q, u8 *elem)
svm_queue_t * vl_api_client_index_to_input_queue(u32 index)
Definition: memory_api.c:759

Definition at line 93 of file nsh.c.

#define vl_api_version (   n,
  v 
)    static u32 api_version=(v);

Definition at line 58 of file nsh.c.

#define vl_endianfun

Definition at line 47 of file nsh.c.

#define vl_msg_id (   n,
  h 
)    n,

Definition at line 32 of file nsh.c.

#define vl_msg_name_crc_list

Definition at line 62 of file nsh.c.

#define vl_print (   handle,
  ... 
)    vlib_cli_output (handle, __VA_ARGS__)

Definition at line 52 of file nsh.c.

#define vl_printfun

Definition at line 53 of file nsh.c.

#define vl_typedefs

Definition at line 42 of file nsh.c.

Enumeration Type Documentation

Enumerator
VL_ILLEGAL_MESSAGE_ID 
VL_ILLEGAL_MESSAGE_ID 
VL_MSG_FIRST_AVAILABLE 
VL_ILLEGAL_MESSAGE_ID 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 
VL_MSG_FIRST_AVAILABLE 

Definition at line 33 of file nsh.c.

Function Documentation

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

Definition at line 462 of file nsh.c.

+ Here is the call graph for this function:

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

Definition at line 330 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_nsh_header ( u8 s,
va_list *  args 
)

Definition at line 245 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_nsh_map ( u8 s,
va_list *  args 
)

Definition at line 349 of file nsh.c.

+ Here is the call graph for this function:

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

Naming for NSH tunnel.

Parameters
*sformatting string
*args
Returns
*s formatted string

Definition at line 433 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_nsh_node_map_trace ( u8 s,
va_list *  args 
)

Definition at line 412 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Formatting function for tracing VXLAN GPE with length.

Parameters
*s
*args
Returns
*s

Definition at line 485 of file nsh.c.

+ Here is the call graph for this function:

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 1013 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

CLI command for adding NSH entry.

Definition at line 1099 of file nsh.c.

+ Here is the call graph for this function:

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 505 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 708 of file nsh.c.

+ Here is the call graph for this function:

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 608 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword nsh_aware_vnf_proxy ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Graph processing dispatch function for NSH-AWARE-VNF-PROXY.

Node Identifier:
nsh_aware_vnf_proxy
Parameters
*vm
*node
*from_frame
Returns
from_frame->n_vectors

Definition at line 2361 of file nsh.c.

+ Here is the call graph for this function:

static uword nsh_classifier ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Graph processing dispatch function for NSH Classifier.

Node Identifier:
nsh_classifier
Parameters
*vm
*node
*from_frame
Returns
from_frame->n_vectors

Definition at line 2343 of file nsh.c.

+ Here is the call graph for this function:

static adj_index_t nsh_get_adj_by_sw_if_index ( u32  sw_if_index)
static

Definition at line 690 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int nsh_header_rewrite ( nsh_entry_t nsh_entry)

Definition at line 911 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* nsh_init ( vlib_main_t vm)

Definition at line 2451 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword nsh_input ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Graph processing dispatch function for NSH Input.

Node Identifier:
nsh_input
Parameters
*vm
*node
*from_frame
Returns
from_frame->n_vectors

Definition at line 2307 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword nsh_input_map ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
u32  node_type 
)
static

Definition at line 1681 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* nsh_interface_admin_up_down ( vnet_main_t vnm,
u32  nsh_hw_if,
u32  flags 
)
static

CLI function for NSH admin up/down.

Parameters
*vnm
nsh_hw_if
flag
Returns
*rc

Definition at line 450 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void nsh_md2_decap ( vlib_buffer_t b,
nsh_base_header_t *  hdr,
u32 header_len,
u32 next,
u32  drop_node_val 
)
inlinestatic

Definition at line 1635 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void nsh_md2_encap ( vlib_buffer_t b,
nsh_base_header_t *  hdr,
nsh_entry_t nsh_entry 
)
inlinestatic

Definition at line 1503 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

nsh_option_map_t* nsh_md2_lookup_option ( u16  class,
u8  type 
)

Definition at line 181 of file nsh.c.

+ Here is the caller graph for this function:

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 125 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void nsh_md2_set_next_ioam_export_override ( uword  next)

Definition at line 2442 of file nsh.c.

+ Here is the caller graph for this function:

static void nsh_md2_swap ( vlib_buffer_t b,
nsh_base_header_t *  hdr,
u32  header_len,
nsh_entry_t nsh_entry,
u32 next,
u32  drop_node_val 
)
inlinestatic

Definition at line 1568 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int nsh_md2_unregister_option ( u16  class,
u8  type,
int   optionsvlib_buffer_t *b,nsh_tlv_header_t *opt,
u8 traceu8 *s, nsh_tlv_header_t *opt 
)

Definition at line 204 of file nsh.c.

+ Here is the call graph for this function:

static clib_error_t* nsh_plugin_api_hookup ( vlib_main_t vm)
static

Definition at line 1476 of file nsh.c.

+ Here is the caller graph for this function:

static uword nsh_proxy ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Graph processing dispatch function for NSH-Proxy.

Node Identifier:
nsh_proxy
Parameters
*vm
*node
*from_frame
Returns
from_frame->n_vectors

Definition at line 2325 of file nsh.c.

+ Here is the call graph for this function:

static void send_nsh_entry_details ( nsh_entry_t t,
unix_shared_memory_queue_t q,
u32  context 
)
static

Definition at line 1315 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void send_nsh_map_details ( nsh_map_t t,
unix_shared_memory_queue_t q,
u32  context 
)
static

Definition at line 1388 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void setup_message_id_table ( nsh_main_t nm,
api_main_t am 
)
static

Definition at line 1494 of file nsh.c.

+ Here is the caller graph for this function:

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

Definition at line 1446 of file nsh.c.

+ Here is the call graph for this function:

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

CLI command for showing the mapping between NSH entries.

Definition at line 886 of file nsh.c.

+ Here is the call graph for this function:

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

CLI command for NSH map.

Definition at line 670 of file nsh.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_nsh_add_del_entry_t_handler ( vl_api_nsh_add_del_entry_t mp)
static

API message handler.

Definition at line 1269 of file nsh.c.

+ Here is the call graph for this function:

static void vl_api_nsh_add_del_map_t_handler ( vl_api_nsh_add_del_map_t mp)
static

API message handler.

Definition at line 850 of file nsh.c.

+ Here is the call graph for this function:

static void vl_api_nsh_entry_dump_t_handler ( vl_api_nsh_entry_dump_t mp)
static

Definition at line 1352 of file nsh.c.

+ Here is the call graph for this function:

static void vl_api_nsh_map_dump_t_handler ( vl_api_nsh_map_dump_t mp)
static

Definition at line 1410 of file nsh.c.

+ Here is the call graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( nsh_input_node  ,
nsh_input   
)
VLIB_NODE_FUNCTION_MULTIARCH ( nsh_proxy_node  ,
nsh_proxy   
)
VLIB_NODE_FUNCTION_MULTIARCH ( nsh_classifier_node  ,
nsh_classifier   
)
VLIB_NODE_FUNCTION_MULTIARCH ( nsh_aware_vnf_proxy_node  ,
nsh_aware_vnf_proxy   
)
VLIB_PLUGIN_REGISTER ( )

+ Here is the caller graph for this function:

VNET_DEVICE_CLASS ( nsh_device_class  ,
static   
)

+ Here is the caller graph for this function:

VNET_HW_INTERFACE_CLASS ( nsh_hw_class  )

+ Here is the caller graph for this function:

Variable Documentation

vlib_cli_command_t create_nsh_entry_command
static
Initial value:
=
{
.path = "create nsh entry",.short_help =
"create nsh entry {nsp <nn> nsi <nn>} [ttl <nn>] [md-type <nn>]"
" [c1 <nn> c2 <nn> c3 <nn> c4 <nn>] [tlv-ioam-trace] [del]\n",.function
static clib_error_t * nsh_add_del_entry_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command for adding NSH entry.
Definition: nsh.c:1099

(constructor) VLIB_CLI_COMMAND (create_nsh_entry_command)

Definition at line 1260 of file nsh.c.

vlib_cli_command_t create_nsh_map_command
static
Initial value:
=
{
.path = "create nsh map",.short_help =
"create nsh map nsp <nn> nsi <nn> [del] mapped-nsp <nn> mapped-nsi <nn> nsh_action [swap|push|pop] "
"[encap-gre4-intf <nn> | encap-gre4-intf <nn> | encap-vxlan-gpe-intf <nn> | encap-lisp-gpe-intf <nn> "
" encap-vxlan4-intf <nn> | encap-vxlan6-intf <nn>| encap-eth-intf <nn> | encap-none]\n",.function
static clib_error_t * nsh_add_del_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: nsh.c:708

(constructor) VLIB_CLI_COMMAND (create_nsh_map_command)

Definition at line 840 of file nsh.c.

const char dummy_dst_address[6] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 }

Definition at line 67 of file nsh.c.

const char dummy_src_address[6] = { 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc }

Definition at line 68 of file nsh.c.

vlib_node_registration_t nsh_aware_vnf_proxy_node
Initial value:
=
{
.function = nsh_aware_vnf_proxy,.name = "nsh-aware-vnf-proxy",.vector_size =
sizeof (u32),.format_trace = format_nsh_node_map_trace,.format_buffer =
ARRAY_LEN (nsh_node_error_strings),.error_strings =
nsh_node_error_strings,.n_next_nodes = NSH_NODE_N_NEXT,.next_nodes =
{
#define _(s,n)
}
,}
static char * nsh_node_error_strings[]
Definition: nsh.c:2367
#define foreach_nsh_node_next
Definition: nsh.h:205
u8 * format_nsh_node_map_trace(u8 *s, va_list *args)
Definition: nsh.c:412
unsigned int u32
Definition: types.h:88
static uword nsh_aware_vnf_proxy(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Graph processing dispatch function for NSH-AWARE-VNF-PROXY.
Definition: nsh.c:2361
#define ARRAY_LEN(x)
Definition: clib.h:61
u8 * format_nsh_header(u8 *s, va_list *args)
Definition: nsh.c:245

(constructor) VLIB_REGISTER_NODE (nsh_aware_vnf_proxy_node)

Definition at line 2425 of file nsh.c.

vlib_node_registration_t nsh_classifier_node
Initial value:
=
{
.function = nsh_classifier,.name = "nsh-classifier",.vector_size =
sizeof (u32),.format_trace = format_nsh_node_map_trace,.format_buffer =
ARRAY_LEN (nsh_node_error_strings),.error_strings =
nsh_node_error_strings,.n_next_nodes = NSH_NODE_N_NEXT,.next_nodes =
{
#define _(s,n)
}
,}
static char * nsh_node_error_strings[]
Definition: nsh.c:2367
#define foreach_nsh_node_next
Definition: nsh.h:205
u8 * format_nsh_node_map_trace(u8 *s, va_list *args)
Definition: nsh.c:412
unsigned int u32
Definition: types.h:88
static uword nsh_classifier(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Graph processing dispatch function for NSH Classifier.
Definition: nsh.c:2343
#define ARRAY_LEN(x)
Definition: clib.h:61
u8 * format_nsh_header(u8 *s, va_list *args)
Definition: nsh.c:245

(constructor) VLIB_REGISTER_NODE (nsh_classifier_node)

Definition at line 2408 of file nsh.c.

vlib_node_registration_t nsh_input_node
Initial value:
=
{
.function = nsh_input,.name = "nsh-input",.vector_size =
sizeof (u32),.format_trace = format_nsh_node_map_trace,.format_buffer =
ARRAY_LEN (nsh_node_error_strings),.error_strings =
nsh_node_error_strings,.n_next_nodes = NSH_NODE_N_NEXT,.next_nodes =
{
#define _(s,n)
}
,}
static char * nsh_node_error_strings[]
Definition: nsh.c:2367
#define foreach_nsh_node_next
Definition: nsh.h:205
u8 * format_nsh_node_map_trace(u8 *s, va_list *args)
Definition: nsh.c:412
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:61
static uword nsh_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Graph processing dispatch function for NSH Input.
Definition: nsh.c:2307
u8 * format_nsh_header(u8 *s, va_list *args)
Definition: nsh.c:245

(constructor) VLIB_REGISTER_NODE (nsh_input_node)

Definition at line 2374 of file nsh.c.

char* nsh_node_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_nsh_node_error
Definition: nsh.h:188

Definition at line 2367 of file nsh.c.

vlib_node_registration_t nsh_proxy_node
Initial value:
=
{
.function = nsh_proxy,.name = "nsh-proxy",.vector_size =
sizeof (u32),.format_trace = format_nsh_node_map_trace,.format_buffer =
ARRAY_LEN (nsh_node_error_strings),.error_strings =
nsh_node_error_strings,.n_next_nodes = NSH_NODE_N_NEXT,.next_nodes =
{
#define _(s,n)
}
,}
static char * nsh_node_error_strings[]
Definition: nsh.c:2367
#define foreach_nsh_node_next
Definition: nsh.h:205
u8 * format_nsh_node_map_trace(u8 *s, va_list *args)
Definition: nsh.c:412
unsigned int u32
Definition: types.h:88
static uword nsh_proxy(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Graph processing dispatch function for NSH-Proxy.
Definition: nsh.c:2325
#define ARRAY_LEN(x)
Definition: clib.h:61
u8 * format_nsh_header(u8 *s, va_list *args)
Definition: nsh.c:245

(constructor) VLIB_REGISTER_NODE (nsh_proxy_node)

Definition at line 2391 of file nsh.c.

vlib_cli_command_t show_nsh_entry_command
static
Initial value:
=
{
.path = "show nsh entry",.function = show_nsh_entry_command_fn,}
static clib_error_t * show_nsh_entry_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: nsh.c:1446

(constructor) VLIB_CLI_COMMAND (show_nsh_entry_command)

Definition at line 1469 of file nsh.c.

vlib_cli_command_t show_nsh_map_command
static
Initial value:
=
{
.path = "show nsh map",.function = show_nsh_map_command_fn,}
static clib_error_t * show_nsh_map_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI command for showing the mapping between NSH entries.
Definition: nsh.c:886

(constructor) VLIB_CLI_COMMAND (show_nsh_map_command)

Definition at line 906 of file nsh.c.