18 #include <sys/types.h> 21 #include <netinet/in.h> 50 fformat(stdout,
"%s\n", rv ? rv :
"UNSET");
106 for (i = 0; i < 11; i++) {
133 for (
i = 0;
i < nitems;
i++) {
140 value =
format (0,
"%s%c", add_value, 0);
144 fformat (stdout,
"Resulting installed_sw vector:\n");
149 fformat (stdout,
"%s\n", values[
i]);
170 opaque &= ~(0xF0000000);
173 signum, action, opaque);
183 memset (&sa, 0,
sizeof (sa));
185 sa.sa_flags = SA_SIGINFO;
186 if (sigaction (SIGUSR2, &sa, 0) < 0) {
191 memset (a, 0,
sizeof (*a));
197 a->
var = (
char *) vbl;
239 clib_warning (
"Grab region mutex and crash deliberately!");
254 int main (
int argc,
char **argv)
259 char *chroot_path = 0;
267 if (
unformat (&input,
"get-string %s", &vbl)) {
271 }
else if (
unformat (&input,
"set-string %s %s", &vbl, &value)) {
276 }
else if (
unformat(&input,
"unset-string %s", &vbl)) {
280 }
else if (
unformat(&input,
"dump-strings")) {
283 }
else if (
unformat(&input,
"unset-vec %s", &vbl)) {
287 }
else if (
unformat(&input,
"dump-vecs")) {
290 }
else if (
unformat (&input,
"test-vec %s", &vbl)) {
294 }
else if (
unformat (&input,
"vlib-vec-rate %f", &vr)) {
297 }
else if (
unformat (&input,
"test-reg %s", &vbl)) {
300 }
else if (
unformat (&input,
"crash-test")) {
302 }
else if (
unformat (&input,
"chroot %s", &chroot_path_u8)) {
303 chroot_path = (
char *) chroot_path_u8;
304 }
else if (
unformat (&input,
"fake-install %s", &value)) {
307 }
else if (
unformat (&input,
"size %d", &size)) {
318 fformat(stdout,
"%s: get-string <name> | set-string <name> <value>\n",
320 fformat(stdout,
" unset-string <name> | dump-strings\n");
321 fformat(stdout,
" test-vec <name> |\n");
322 fformat(stdout,
" unset-vec <name> | dump-vecs\n");
sll srl srl sll sra u16x4 i
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
void svmdb_local_dump_vecs(svmdb_client_t *client)
always_inline void serialize_likely_small_unsigned_integer(serialize_main_t *m, u64 x)
void svmdb_local_unset_vec_variable(svmdb_client_t *client, char *var)
svmdb_client_t * svmdb_map_chroot_size(char *root_path, uword size)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void svmdb_unmap(svmdb_client_t *client)
void svmdb_local_dump_strings(svmdb_client_t *client)
void unserialize_open_data(serialize_main_t *m, u8 *data, uword n_data_bytes)
#define clib_warning(format, args...)
char * svmdb_local_get_string_variable(svmdb_client_t *client, char *var)
void unserialize_cstring(serialize_main_t *m, char **s)
void serialize_open_vector(serialize_main_t *m, u8 *vector)
#define vec_free(V)
Free vector's memory (no header).
#define clib_unix_warning(format, args...)
void svmdb_local_set_vec_variable(svmdb_client_t *client, char *var, void *val_arg, u32 elsize)
int svmdb_local_add_del_notification(svmdb_client_t *client, svmdb_notification_args_t *a)
void serialize_cstring(serialize_main_t *m, char *s)
svmdb_client_t * svmdb_map_chroot(char *root_path)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void svmdb_local_unset_string_variable(svmdb_client_t *client, char *var)
void * svmdb_local_get_vec_variable(svmdb_client_t *client, char *var, u32 elsize)
void * serialize_close_vector(serialize_main_t *m)
void svmdb_local_set_string_variable(svmdb_client_t *client, char *var, char *val)
always_inline u64 unserialize_likely_small_unsigned_integer(serialize_main_t *m)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".