FD.io VPP  v20.01-48-g3e0dafb74
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 REPLY_MSG_ID_BASE   nsm->msg_id_base
 

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_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

◆ REPLY_MSG_ID_BASE

#define REPLY_MSG_ID_BASE   nsm->msg_id_base

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 293 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 130 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 44 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 228 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 505 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 95 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 417 of file nsim.c.

+ Here is the call 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 580 of file nsim.c.

+ Here is the call 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 681 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 565 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 547 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 389 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 343 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 373 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:228

(constructor) VLIB_CLI_COMMAND (nsim_enable_disable_command)

Definition at line 331 of file nsim.c.

◆ nsim_main

nsim_main_t nsim_main

Definition at line 39 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:417

(constructor) VLIB_CLI_COMMAND (nsim_output_feature_enable_disable_command)

Definition at line 494 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:580

(constructor) VLIB_CLI_COMMAND (set_nsim_command)

Definition at line 670 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:681

(constructor) VLIB_CLI_COMMAND (show_nsim_command)

Definition at line 745 of file nsim.c.