|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
22 #include <sys/types.h>
25 #include <netinet/in.h>
47 u8 * var,
u8 * val,
u32 elsize);
52 pthread_mutex_lock (&rp->
mutex);
66 pthread_mutex_unlock (&rp->
mutex);
101 client->
pid = getpid ();
112 (
"[%d] adding fake client (pid=0) so '%s' won't be unlinked",
132 client->
pid = getpid ();
157 u32 *dead_registrations = 0;
171 if (sigqueue (np->
pid, np->
signum, sv) == 0)
175 while (
rv == EAGAIN);
182 for (
i = 0;
i <
vec_len (dead_registrations);
i++)
185 clib_warning (
"dead reg pid %d sig %d action %d opaque %x",
200 u8 *placeholder_value = 0;
218 placeholder_value,
a->elsize);
230 if ((np->
pid == client->
pid)
234 if (
a->add_del == 0 )
242 (
"%s: ignore dup reg pid %d signum %d action %d opaque %x",
243 a->var, client->
pid,
a->signum,
a->action,
a->opaque);
284 _vec_len (oldvalue->
value) = 0;
304 u8 * var,
u8 * val,
u32 elsize)
328 newvalue->
elsize = elsize;
340 char *var,
char *val)
350 (
u8 *) var, (
u8 *) val, 1 );
371 return (oldvalue->
value);
402 return ((
char *)
rv);
438 u8 *sanitized_name = 0;
441 if (strstr (filename,
"..") ||
index (filename,
'/'))
448 sanitized_name =
format (0,
"/tmp/%s%c", filename, 0);
450 fd = creat ((
char *) sanitized_name, 0644);
484 if (fd > 0 && close (fd) < 0)
506 fd = open (filename, O_RDONLY);
521 for (
i = 0;
i < nelts;
i++)
536 if (fd > 0 && close (fd) < 0)
561 char *var,
void *val_arg,
u32 elsize)
563 u8 *val = (
u8 *) val_arg;
617 (void)
fformat(stdout,
"%s:\n %U (%.2f)\n",
key,
628 char *var,
u32 nbytes)
656 _vec_len (newvalue->
value) = nbytes;
svmdb_notify_t * notifications
void svmdb_local_set_vec_variable(svmdb_client_t *client, char *var, void *val_arg, u32 elsize)
void svm_region_exit(void)
static u8 * local_get_variable_nolock(svmdb_client_t *client, svmdb_namespace_t namespace, u8 *var)
#define clib_memcpy(d, s, n)
svm_region_t * svm_get_root_rp(void)
void svmdb_unmap(svmdb_client_t *client)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void region_unlock(svm_region_t *rp)
void svm_region_unmap(void *rp_arg)
int svmdb_local_serialize_strings(svmdb_client_t *client, char *filename)
#define clib_error_return(e, args...)
#define vec_alloc(V, N)
Allocate space for N more elements (no header, unspecified alignment)
uword * namespaces[SVMDB_N_NAMESPACES]
void svmdb_local_dump_strings(svmdb_client_t *client)
static void local_unset_variable_nolock(svmdb_client_t *client, svmdb_namespace_t namespace, char *var)
#define vec_delete(V, N, M)
Delete N elements starting at element M.
#define hash_create_string(elts, value_bytes)
void svmdb_local_unset_string_variable(svmdb_client_t *client, char *var)
#define clib_error_report(e)
void svm_region_init_chroot_uid_gid(const char *root_path, int uid, int gid)
void svmdb_local_dump_vecs(svmdb_client_t *client)
#define SVMDB_DEFAULT_SIZE
void * svmdb_local_get_variable_reference(svmdb_client_t *client, svmdb_namespace_t namespace, char *var)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void * svm_region_find_or_create(svm_map_region_args_t *a)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#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.
static void serialize_likely_small_unsigned_integer(serialize_main_t *m, u64 x)
void * svmdb_local_find_or_add_vec_variable(svmdb_client_t *client, char *var, u32 nbytes)
int svmdb_local_unserialize_strings(svmdb_client_t *client, char *filename)
static void svm_pop_heap(void *oldheap)
#define hash_set_mem(h, key, value)
Fixed length block allocator. Pools are built from clib vectors and bitmaps. Use pools when repeatedl...
static void region_lock(svm_region_t *rp, int tag)
sll srl srl sll sra u16x4 i
void svmdb_local_unset_vec_variable(svmdb_client_t *client, char *var)
#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)
__clib_export void serialize_close(serialize_main_t *m)
__clib_export void serialize_cstring(serialize_main_t *m, char *s)
static uword hash_elts(void *v)
__clib_export void unserialize_cstring(serialize_main_t *m, char **s)
#define vec_free(V)
Free vector's memory (no header).
#define hash_get_mem(h, key)
__clib_export void unserialize_open_clib_file_descriptor(serialize_main_t *m, int fd)
description fragment has unexpected format
svmdb_client_t * svmdb_map(svmdb_map_args_t *dba)
static void local_set_variable_nolock(svmdb_client_t *client, svmdb_namespace_t namespace, u8 *var, u8 *val, u32 elsize)
void * svmdb_local_get_vec_variable(svmdb_client_t *client, char *var, u32 elsize)
#define clib_error_return_unix(e, args...)
static void * svm_push_pvt_heap(svm_region_t *rp)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
char * svmdb_local_get_string_variable(svmdb_client_t *client, char *var)
__clib_export void serialize_open_clib_file_descriptor(serialize_main_t *m, int fd)
void svmdb_local_set_string_variable(svmdb_client_t *client, char *var, char *val)
#define hash_get_pair_mem(h, key)
#define clib_warning(format, args...)
static u64 unserialize_likely_small_unsigned_integer(serialize_main_t *m)
static void notify_value(svmdb_value_t *v, svmdb_action_t a)
int svmdb_local_add_del_notification(svmdb_client_t *client, svmdb_notification_args_t *a)
#define hash_foreach_mem(key_var, value_var, h, body)
static void * svm_push_data_heap(svm_region_t *rp)
#define SVMDB_SHM_VERSION