FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
nsim.c File Reference

Network Delay Simulator. More...

+ Include dependency graph for nsim.c:

Go to the source code of this file.

Macros

#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 REPLY_MSG_ID_BASE   nsm->msg_id_base
 
#define foreach_nsim_plugin_api_msg
 
#define vl_msg_name_crc_list
 

Functions

int nsim_cross_connect_enable_disable (nsim_main_t *nsm, u32 sw_if_index0, u32 sw_if_index1, int enable_disable)
 
int nsim_output_feature_enable_disable (nsim_main_t *nsm, u32 sw_if_index, int enable_disable)
 
static int nsim_configure (nsim_main_t *nsm, f64 bandwidth, f64 delay, f64 packet_size, f64 drop_fraction)
 
static clib_error_tnsim_cross_connect_enable_disable_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tnsim_config (vlib_main_t *vm, unformat_input_t *input)
 
static void vl_api_nsim_cross_connect_enable_disable_t_handler (vl_api_nsim_cross_connect_enable_disable_t *mp)
 
static void vl_api_nsim_output_feature_enable_disable_t_handler (vl_api_nsim_output_feature_enable_disable_t *mp)
 
static void vl_api_nsim_configure_t_handler (vl_api_nsim_configure_t *mp)
 
static clib_error_tnsim_output_feature_enable_disable_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tnsim_plugin_api_hookup (vlib_main_t *vm)
 
static void setup_message_id_table (nsim_main_t *nsm, api_main_t *am)
 
static clib_error_tnsim_init (vlib_main_t *vm)
 
 VNET_FEATURE_INIT (nsim, static)
 
 VNET_FEATURE_INIT (nsim_feature, static)
 
 VLIB_PLUGIN_REGISTER ()
 
static uword unformat_delay (unformat_input_t *input, va_list *args)
 
static uword unformat_bandwidth (unformat_input_t *input, va_list *args)
 
static clib_error_tset_nsim_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_nsim_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

nsim_main_t nsim_main
 
static vlib_cli_command_t nsim_enable_disable_command
 (constructor) VLIB_CLI_COMMAND (nsim_enable_disable_command) More...
 
static vlib_cli_command_t nsim_output_feature_enable_disable_command
 (constructor) VLIB_CLI_COMMAND (nsim_output_feature_enable_disable_command) More...
 
static vlib_cli_command_t set_nsim_command
 (constructor) VLIB_CLI_COMMAND (set_nsim_command) More...
 
static vlib_cli_command_t show_nsim_command
 (constructor) VLIB_CLI_COMMAND (show_nsim_command) More...
 

Detailed Description

Network Delay Simulator.

Definition in file nsim.c.

Macro Definition Documentation

◆ foreach_nsim_plugin_api_msg

#define foreach_nsim_plugin_api_msg
Value:
_(NSIM_CROSS_CONNECT_ENABLE_DISABLE, nsim_cross_connect_enable_disable) \
_(NSIM_OUTPUT_FEATURE_ENABLE_DISABLE, nsim_output_feature_enable_disable) \
_(NSIM_CONFIGURE, nsim_configure)
int nsim_cross_connect_enable_disable(nsim_main_t *nsm, u32 sw_if_index0, u32 sw_if_index1, int enable_disable)
Definition: nsim.c:71
static int nsim_configure(nsim_main_t *nsm, f64 bandwidth, f64 delay, f64 packet_size, f64 drop_fraction)
Definition: nsim.c:157
int nsim_output_feature_enable_disable(nsim_main_t *nsm, u32 sw_if_index, int enable_disable)
Definition: nsim.c:122

Definition at line 63 of file nsim.c.

◆ REPLY_MSG_ID_BASE

#define REPLY_MSG_ID_BASE   nsm->msg_id_base

Definition at line 56 of file nsim.c.

◆ vl_api_version

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

Definition at line 52 of file nsim.c.

◆ vl_endianfun

#define vl_endianfun

Definition at line 41 of file nsim.c.

◆ vl_msg_name_crc_list

#define vl_msg_name_crc_list

Definition at line 549 of file nsim.c.

◆ vl_print

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

Definition at line 46 of file nsim.c.

◆ vl_printfun

#define vl_printfun

Definition at line 47 of file nsim.c.

◆ vl_typedefs

#define vl_typedefs

Definition at line 36 of file nsim.c.

Function Documentation

◆ nsim_config()

static clib_error_t* nsim_config ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 320 of file nsim.c.

+ Here is the call graph for this function:

◆ nsim_configure()

static int nsim_configure ( nsim_main_t nsm,
f64  bandwidth,
f64  delay,
f64  packet_size,
f64  drop_fraction 
)
static

Definition at line 157 of file nsim.c.

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

◆ nsim_cross_connect_enable_disable()

int nsim_cross_connect_enable_disable ( nsim_main_t nsm,
u32  sw_if_index0,
u32  sw_if_index1,
int  enable_disable 
)

Definition at line 71 of file nsim.c.

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

◆ nsim_cross_connect_enable_disable_command_fn()

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

Definition at line 255 of file nsim.c.

+ Here is the call graph for this function:

◆ nsim_init()

static clib_error_t* nsim_init ( vlib_main_t vm)
static

Definition at line 562 of file nsim.c.

+ Here is the call graph for this function:

◆ nsim_output_feature_enable_disable()

int nsim_output_feature_enable_disable ( nsim_main_t nsm,
u32  sw_if_index,
int  enable_disable 
)

Definition at line 122 of file nsim.c.

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

◆ nsim_output_feature_enable_disable_command_fn()

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

Definition at line 444 of file nsim.c.

+ Here is the call graph for this function:

◆ nsim_plugin_api_hookup()

static clib_error_t* nsim_plugin_api_hookup ( vlib_main_t vm)
static

Definition at line 532 of file nsim.c.

+ Here is the caller graph for this function:

◆ set_nsim_command_fn()

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

Definition at line 649 of file nsim.c.

+ Here is the call graph for this function:

◆ setup_message_id_table()

static void setup_message_id_table ( nsim_main_t nsm,
api_main_t am 
)
static

Definition at line 554 of file nsim.c.

+ Here is the caller graph for this function:

◆ show_nsim_command_fn()

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

Definition at line 750 of file nsim.c.

+ Here is the call graph for this function:

◆ unformat_bandwidth()

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

Definition at line 634 of file nsim.c.

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

◆ unformat_delay()

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

Definition at line 616 of file nsim.c.

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

◆ vl_api_nsim_configure_t_handler()

static void vl_api_nsim_configure_t_handler ( vl_api_nsim_configure_t mp)
static

Definition at line 416 of file nsim.c.

+ Here is the call graph for this function:

◆ vl_api_nsim_cross_connect_enable_disable_t_handler()

static void vl_api_nsim_cross_connect_enable_disable_t_handler ( vl_api_nsim_cross_connect_enable_disable_t mp)
static

Definition at line 370 of file nsim.c.

+ Here is the call graph for this function:

◆ vl_api_nsim_output_feature_enable_disable_t_handler()

static void vl_api_nsim_output_feature_enable_disable_t_handler ( vl_api_nsim_output_feature_enable_disable_t mp)
static

Definition at line 400 of file nsim.c.

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

◆ VLIB_PLUGIN_REGISTER()

VLIB_PLUGIN_REGISTER ( )

◆ VNET_FEATURE_INIT() [1/2]

VNET_FEATURE_INIT ( nsim  ,
static   
)

◆ VNET_FEATURE_INIT() [2/2]

VNET_FEATURE_INIT ( nsim_feature  ,
static   
)

Variable Documentation

◆ nsim_enable_disable_command

vlib_cli_command_t nsim_enable_disable_command
static
Initial value:
=
{
.path = "nsim cross-connect enable-disable",
.short_help =
"nsim cross-connect enable-disable <interface-name-1> "
"<interface-name-2> [disable]",
}
static clib_error_t * nsim_cross_connect_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: nsim.c:255

(constructor) VLIB_CLI_COMMAND (nsim_enable_disable_command)

Definition at line 358 of file nsim.c.

◆ nsim_main

nsim_main_t nsim_main

Definition at line 59 of file nsim.c.

◆ nsim_output_feature_enable_disable_command

vlib_cli_command_t nsim_output_feature_enable_disable_command
static
Initial value:
=
{
.path = "nsim output-feature enable-disable",
.short_help =
"nsim output-feature enable-disable <interface-name> [disable]",
}
static clib_error_t * nsim_output_feature_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: nsim.c:444

(constructor) VLIB_CLI_COMMAND (nsim_output_feature_enable_disable_command)

Definition at line 521 of file nsim.c.

◆ set_nsim_command

vlib_cli_command_t set_nsim_command
static
Initial value:
=
{
.path = "set nsim",
.short_help = "set nsim delay <time> bandwidth <bps> packet-size <nbytes>\n"
" [packets-per-drop <nn>][drop-fraction <f64: 0.0 - 1.0>]",
.function = set_nsim_command_fn,
}
static clib_error_t * set_nsim_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: nsim.c:649

(constructor) VLIB_CLI_COMMAND (set_nsim_command)

Definition at line 739 of file nsim.c.

◆ show_nsim_command

vlib_cli_command_t show_nsim_command
static
Initial value:
=
{
.path = "show nsim",
.short_help = "Display network delay simulator configuration",
.function = show_nsim_command_fn,
}
static clib_error_t * show_nsim_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: nsim.c:750

(constructor) VLIB_CLI_COMMAND (show_nsim_command)

Definition at line 814 of file nsim.c.