FD.io VPP  v21.06-3-gbb25fbf28
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 nsim_wheel_tnsim_wheel_alloc (nsim_main_t *nsm, u32 wheel_slots)
 
static int nsim_configure (nsim_main_t *nsm, f64 bandwidth, f64 delay, f64 packet_size, f64 drop_fraction, f64 reorder_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 void vl_api_nsim_configure2_t_handler (vl_api_nsim_configure2_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 u8format_nsim_config (u8 *s, 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

◆ format_nsim_config()

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

Definition at line 611 of file nsim.c.

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

◆ nsim_config()

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

Definition at line 299 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,
f64  reorder_fraction 
)
static

Definition at line 153 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 234 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 537 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 449 of file nsim.c.

+ Here is the call graph for this function:

◆ nsim_wheel_alloc()

static nsim_wheel_t* nsim_wheel_alloc ( nsim_main_t nsm,
u32  wheel_slots 
)
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:

◆ 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 666 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 771 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 596 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 578 of file nsim.c.

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

◆ vl_api_nsim_configure2_t_handler()

static void vl_api_nsim_configure2_t_handler ( vl_api_nsim_configure2_t mp)
static

Definition at line 418 of file nsim.c.

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

+ Here is the call 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]",
}

(constructor) VLIB_CLI_COMMAND (nsim_enable_disable_command)

Definition at line 337 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]",
}

(constructor) VLIB_CLI_COMMAND (nsim_output_feature_enable_disable_command)

Definition at line 526 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,
}

(constructor) VLIB_CLI_COMMAND (set_nsim_command)

Definition at line 760 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,
}

(constructor) VLIB_CLI_COMMAND (show_nsim_command)

Definition at line 805 of file nsim.c.

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:666
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)
Definition: nsim.c:449
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)
Definition: nsim.c:234
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:771