FD.io VPP  v19.01.1-17-ge106252
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_enable_disable (nsim_main_t *nsm, u32 sw_if_index0, u32 sw_if_index1, 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_enable_disable_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static void vl_api_nsim_enable_disable_t_handler (vl_api_nsim_enable_disable_t *mp)
 
static void vl_api_nsim_configure_t_handler (vl_api_nsim_configure_t *mp)
 
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)
 
 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 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

#define foreach_nsim_plugin_api_msg
Value:
_(NSIM_ENABLE_DISABLE, nsim_enable_disable) \
_(NSIM_CONFIGURE, nsim_configure)
static int nsim_configure(nsim_main_t *nsm, f64 bandwidth, f64 delay, f64 packet_size, f64 drop_fraction)
Definition: nsim.c:121
int nsim_enable_disable(nsim_main_t *nsm, u32 sw_if_index0, u32 sw_if_index1, int enable_disable)
Definition: nsim.c:70

Definition at line 63 of file nsim.c.

#define REPLY_MSG_ID_BASE   nsm->msg_id_base

Definition at line 56 of file nsim.c.

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

Definition at line 52 of file nsim.c.

#define vl_endianfun

Definition at line 41 of file nsim.c.

#define vl_msg_name_crc_list

Definition at line 362 of file nsim.c.

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

Definition at line 46 of file nsim.c.

#define vl_printfun

Definition at line 47 of file nsim.c.

#define vl_typedefs

Definition at line 36 of file nsim.c.

Function Documentation

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

Definition at line 121 of file nsim.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 70 of file nsim.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 220 of file nsim.c.

+ Here is the call graph for this function:

static clib_error_t* nsim_init ( vlib_main_t vm)
static

Definition at line 375 of file nsim.c.

+ Here is the call graph for this function:

static clib_error_t* nsim_plugin_api_hookup ( vlib_main_t vm)
static

Definition at line 345 of file nsim.c.

+ Here is the caller graph for this function:

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 453 of file nsim.c.

+ Here is the call graph for this function:

static void setup_message_id_table ( nsim_main_t nsm,
api_main_t am 
)
static

Definition at line 367 of file nsim.c.

+ Here is the caller graph for this function:

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 551 of file nsim.c.

+ Here is the call graph for this function:

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

Definition at line 438 of file nsim.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 420 of file nsim.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void vl_api_nsim_configure_t_handler ( vl_api_nsim_configure_t mp)
static

Definition at line 319 of file nsim.c.

+ Here is the call graph for this function:

static void vl_api_nsim_enable_disable_t_handler ( vl_api_nsim_enable_disable_t mp)
static

Definition at line 304 of file nsim.c.

+ Here is the call graph for this function:

VLIB_PLUGIN_REGISTER ( )

+ Here is the caller graph for this function:

VNET_FEATURE_INIT ( nsim  ,
static   
)

+ Here is the caller graph for this function:

Variable Documentation

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

(constructor) VLIB_CLI_COMMAND (nsim_enable_disable_command)

Definition at line 293 of file nsim.c.

nsim_main_t nsim_main

Definition at line 59 of file nsim.c.

vlib_cli_command_t set_nsim_command
static
Initial value:
=
{
.path = "set nsim",
.short_help = "set nsim delay <time> bandwidth <bps> packet-size <nbytes>",
.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:453

(constructor) VLIB_CLI_COMMAND (set_nsim_command)

Definition at line 541 of file nsim.c.

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:551

(constructor) VLIB_CLI_COMMAND (show_nsim_command)

Definition at line 615 of file nsim.c.