|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
18 #include <sys/types.h>
23 #include <netinet/in.h>
183 for (
i = 0;
i < 11;
i++)
215 for (
i = 0;
i < nitems;
i++)
227 fformat (stdout,
"Resulting installed_sw vector:\n");
233 fformat (stdout,
"%s\n", values[
i]);
255 opaque &= ~(0xF0000000);
273 sa.sa_flags = SA_SIGINFO;
274 if (sigaction (SIGUSR2, &sa, 0) < 0)
286 a->var = (
char *) vbl;
290 a->opaque = 0x0eadbeef;
342 clib_warning (
"Grab region mutex and crash deliberately!");
370 char *chroot_path = 0;
376 struct passwd _pw, *pw;
377 struct group _grp, *grp;
389 if (
unformat (&input,
"get-string %s", &vbl))
395 else if (
unformat (&input,
"set-string %s %s", &vbl, &
value))
402 else if (
unformat (&input,
"unset-string %s", &vbl))
408 else if (
unformat (&input,
"dump-strings"))
413 else if (
unformat (&input,
"unset-vec %s", &vbl))
419 else if (
unformat (&input,
"dump-vecs"))
424 else if (
unformat (&input,
"test-vec %s", &vbl))
430 else if (
unformat (&input,
"vlib-vec-rate %f", &vr))
435 else if (
unformat (&input,
"test-reg %s", &vbl))
440 else if (
unformat (&input,
"crash-test"))
444 else if (
unformat (&input,
"chroot %s", &chroot_path_u8))
446 chroot_path = (
char *) chroot_path_u8;
458 else if (
unformat (&input,
"uid %d", &uid))
460 else if (
unformat (&input,
"gid %d", &gid))
462 else if (
unformat (&input,
"uid %s", &s))
466 rv = getpwnam_r (s, &_pw,
buf,
sizeof (
buf), &pw);
469 fformat (stderr,
"cannot fetch username %s", s);
474 fformat (stderr,
"username %s does not exist", s);
480 else if (
unformat (&input,
"gid %s", &s))
484 rv = getgrnam_r (s, &_grp,
buf,
sizeof (
buf), &grp);
487 fformat (stderr,
"cannot fetch group %s", s);
492 fformat (stderr,
"group %s does not exist", s);
498 else if (
unformat (&input,
"serialize-strings %s", &filename))
504 else if (
unformat (&input,
"unserialize-strings %s", &filename))
520 fformat (stdout,
"%s: get-string <name> | set-string <name> <value>\n",
522 fformat (stdout,
" unset-string <name> | dump-strings\n");
523 fformat (stdout,
" test-vec <name> |\n");
524 fformat (stdout,
" unset-vec <name> | dump-vecs\n");
525 fformat (stdout,
" chroot <prefix> [uid <nnn-or-userid>]\n");
526 fformat (stdout,
" [gid <nnn-or-group-name>]\n");
void svmdb_local_set_vec_variable(svmdb_client_t *client, char *var, void *val_arg, u32 elsize)
void svmdb_unmap(svmdb_client_t *client)
int svmdb_local_serialize_strings(svmdb_client_t *client, char *filename)
void svmdb_local_dump_strings(svmdb_client_t *client)
void svmdb_local_unset_string_variable(svmdb_client_t *client, char *var)
__clib_export void serialize_open_vector(serialize_main_t *m, u8 *vector)
#define clib_unix_warning(format, args...)
void svmdb_local_dump_vecs(svmdb_client_t *client)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
static void serialize_likely_small_unsigned_integer(serialize_main_t *m, u64 x)
int svmdb_local_unserialize_strings(svmdb_client_t *client, char *filename)
svmdb_map_args_t map_args
Fixed length block allocator. Pools are built from clib vectors and bitmaps. Use pools when repeatedl...
void svmdb_local_unset_vec_variable(svmdb_client_t *client, char *var)
__clib_export void serialize_cstring(serialize_main_t *m, char *s)
__clib_export void unserialize_open_data(serialize_main_t *m, u8 *data, uword n_data_bytes)
void * clib_mem_init_thread_safe(void *memory, uword memory_size)
__clib_export void unserialize_cstring(serialize_main_t *m, char **s)
#define vec_free(V)
Free vector's memory (no header).
description fragment has unexpected format
__clib_export void * serialize_close_vector(serialize_main_t *m)
svmdb_client_t * svmdb_map(svmdb_map_args_t *dba)
void * svmdb_local_get_vec_variable(svmdb_client_t *client, char *var, u32 elsize)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
char * svmdb_local_get_string_variable(svmdb_client_t *client, char *var)
void svmdb_local_set_string_variable(svmdb_client_t *client, char *var, char *val)
#define clib_warning(format, args...)
static u64 unserialize_likely_small_unsigned_integer(serialize_main_t *m)
int svmdb_local_add_del_notification(svmdb_client_t *client, svmdb_notification_args_t *a)
vl_api_mac_event_action_t action