|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
14 vat_main_t *vam = va_arg (*args, vat_main_t *);
21 s =
format (s,
"%s", p[0]);
34 #define _(n,v,s) hash_set (vam->error_string_by_error_number, -v, s);
38 hash_set (vam->error_string_by_error_number, 99,
"Misc");
41 #if VPP_API_TEST_BUILTIN > 0
45 vat_registered_features_t *
f;
49 f = vam->feature_function_registrations;
70 vam->my_client_index = (
u32) ~ 0;
104 if (vam->my_client_index != ~0)
123 regp->
name =
format (0,
"%s",
"vpp-internal");
130 am->shmem_hdr->application_restarts);
132 vam->vl_input_queue =
am->shmem_hdr->vl_input_queue;
133 api_sw_interface_dump (vam);
143 u8 *cmdp, *argsp, *this_cmd;
147 int (*fp) (vat_main_t *);
152 _vec_len (vam->inbuf) = 0;
154 vam->input = &_input;
167 this_cmd = cmdp = vam->inbuf;
170 while (cmdp < (this_cmd +
vec_len (this_cmd)))
172 if (*cmdp ==
' ' || *cmdp ==
'\t' || *cmdp ==
'\n')
183 while (argsp < (this_cmd +
vec_len (this_cmd)))
185 if (*argsp !=
' ' && *argsp !=
'\t' && *argsp !=
'\n' && *argsp != 0)
196 if (argsp == (this_cmd +
vec_len (this_cmd) - 1))
199 while (argsp < (this_cmd +
vec_len (this_cmd)))
201 if (*argsp ==
' ' || *argsp ==
'\t' || *argsp ==
'\n')
219 arg_len = strlen ((
char *) argsp);
230 "%s error: %U\n", cmdp,
234 if (vam->regenerate_interface_table)
236 vam->regenerate_interface_table = 0;
237 api_sw_interface_dump (vam);
246 .path =
"binary-api",
247 .short_help =
"binary-api [help] <name> [<args>]",
297 void *vam_unused = va_arg (*args,
void *);
299 u32 *result = va_arg (*args,
u32 *);
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define hash_set(h, key, value)
uword unformat_sw_if_index(unformat_input_t *input, va_list *args)
vlib_cli_output_function_t * output_function
static u32 vl_msg_api_handle_from_index_and_epoch(u32 index, u32 epoch)
#define hash_create_string(elts, value_bytes)
#define clib_error_return(e, args...)
vl_registration_type_t registration_type
type
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
svm_queue_t * vl_input_queue
shared memory only: pointer to client input queue
clib_error_t * vat_builtin_main_init(vlib_main_t *vm)
void vat_suspend(vlib_main_t *vm, f64 interval)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void vat_plugin_hash_create(void)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
vnet_main_t * vnet_get_main(void)
static void init_error_string_table(vat_main_t *vam)
An API client registration, only in vpp/vlib.
static vlib_cli_command_t api_command
(constructor) VLIB_CLI_COMMAND (api_command)
static u8 * format_api_error(u8 *s, va_list *args)
int vat_plugin_init(vat_main_t *vam)
static api_main_t * vlibapi_get_main(void)
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
void api_cli_output(void *notused, const char *fmt,...)
static clib_error_t * api_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
API main structure, used by both vpp and binary API clients.
#define hash_get_mem(h, key)
#define vec_free(V)
Free vector's memory (no header).
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
static uword vlib_process_suspend(vlib_main_t *vm, f64 dt)
Suspend a vlib cooperative multi-tasking thread for a period of time.
Message range (belonging to a plugin)
void * vl_msg_push_heap(void)
static vlib_process_t * vlib_get_current_process(vlib_main_t *vm)
u16 first_msg_id
first assigned message ID
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u16 vl_client_get_first_plugin_msg_id(const char *plugin_name)
static void maybe_register_api_client(vat_main_t *vam)
#define clib_warning(format, args...)
uword output_function_arg
#define foreach_vnet_api_error
@ REGISTRATION_TYPE_SHMEM
Shared memory connection.
void vl_msg_pop_heap(void *oldheap)
vl_api_interface_index_t sw_if_index
#define hash_create(elts, value_bytes)
static void * clib_mem_alloc(uword size)
u32 vl_api_registration_pool_index
Index in VLIB's brain (not shared memory).