FD.io VPP  v16.09
Vector Packet Processing
sample.c File Reference
+ Include dependency graph for sample.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_MACRO(t)
 
#define foreach_sample_plugin_api_msg   _(SAMPLE_MACSWAP_ENABLE_DISABLE, sample_macswap_enable_disable)
 

Functions

clib_error_tvlib_plugin_register (vlib_main_t *vm, vnet_plugin_handoff_t *h, int from_early_init)
 
int sample_macswap_enable_disable (sample_main_t *sm, u32 sw_if_index, int enable_disable)
 
static clib_error_tmacswap_enable_disable_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static void vl_api_sample_macswap_enable_disable_t_handler (vl_api_sample_macswap_enable_disable_t *mp)
 
static clib_error_tsample_plugin_api_hookup (vlib_main_t *vm)
 
static clib_error_tsample_init (vlib_main_t *vm)
 

Variables

static vlib_cli_command_t sr_content_command
 (constructor) VLIB_CLI_COMMAND (sr_content_command) More...
 

Macro Definition Documentation

#define foreach_sample_plugin_api_msg   _(SAMPLE_MACSWAP_ENABLE_DISABLE, sample_macswap_enable_disable)

Definition at line 79 of file sample.c.

#define REPLY_MACRO (   t)
Value:
do { \
if (!q) \
return; \
\
rmp = vl_msg_api_alloc (sizeof (*rmp)); \
rmp->_vl_msg_id = ntohs((t)+sm->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_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
void * vl_msg_api_alloc(int nbytes)
unsigned char u8
Definition: types.h:56
struct _unix_shared_memory_queue unix_shared_memory_queue_t

Definition at line 61 of file sample.c.

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

Definition at line 49 of file sample.c.

#define vl_endianfun

Definition at line 38 of file sample.c.

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

Definition at line 43 of file sample.c.

#define vl_printfun

Definition at line 44 of file sample.c.

#define vl_typedefs

Definition at line 33 of file sample.c.

Function Documentation

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

Definition at line 135 of file sample.c.

+ Here is the call graph for this function:

static clib_error_t* sample_init ( vlib_main_t vm)
static

Definition at line 220 of file sample.c.

+ Here is the call graph for this function:

int sample_macswap_enable_disable ( sample_main_t sm,
u32  sw_if_index,
int  enable_disable 
)

Definition at line 105 of file sample.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* sample_plugin_api_hookup ( vlib_main_t vm)
static

Definition at line 203 of file sample.c.

+ Here is the caller graph for this function:

static void vl_api_sample_macswap_enable_disable_t_handler ( vl_api_sample_macswap_enable_disable_t mp)
static

Definition at line 189 of file sample.c.

+ Here is the call graph for this function:

clib_error_t* vlib_plugin_register ( vlib_main_t vm,
vnet_plugin_handoff_t h,
int  from_early_init 
)

Definition at line 90 of file sample.c.

Variable Documentation

vlib_cli_command_t sr_content_command
static
Initial value:
= {
.path = "sample macswap",
.short_help =
"sample macswap <interface-name> [disable]",
}
static clib_error_t * macswap_enable_disable_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: sample.c:135

(constructor) VLIB_CLI_COMMAND (sr_content_command)

Definition at line 180 of file sample.c.