aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vapi
AgeCommit message (Expand)AuthorFilesLines
2023-09-16vapi: fix coverity warningsDave Wallace1-12/+13
2023-09-06vapi: fix verification for reply messageSylvain Cadilhac1-1/+1
2023-08-18vapi: improve vl_api_string_t handlingKlement Sekera4-34/+89
2023-08-18vapi: support servicesStanislav Zaikin8-53/+367
2023-08-16tests docs: update python3 venv packagesDave Wallace1-1/+0
2023-01-04vapi: add vapi_stop_rx_thread()Matthew Smith2-14/+37
2022-12-20vapi: use the correct my_context_id when disconnecting API clientsMauro Sardara1-5/+75
2022-12-14vapi: implement vapi_wait() for readsMatthew Smith3-15/+11
2022-11-28vapi: write enumflag types to vapi headersMatthew Smith2-0/+15
2022-05-10tests: replace pycodestyle with blackKlement Sekera3-550/+767
2022-05-02vapi: support api clients within vpp processOle Troan2-43/+428
2022-04-27vapi: Fix build when directory contains @Renato Botelho do Couto2-2/+3
2022-02-24vapi: Missing include file in vlib.api.vapi.hDave Wallace1-17/+17
2022-01-25api: vapi: honor non-blocking settingKlement Sekera2-12/+25
2021-11-16vapi: verify message size when receivedKlement Sekera3-18/+51
2021-11-02tests: change code to avoid gcc-11 warningKlement Sekera1-4/+10
2021-10-18interface: add api test fileFilip Tehlar4-2/+5
2021-10-14tests: fix coverity warningsKlement Sekera1-6/+2
2021-10-13docs: convert vpp doc md->rstNathan Skrzypczak2-155/+191
2021-10-13vapi: fix vapi test coverity warningFlorin Coras1-0/+1
2021-09-27tests: don't install vapi_c{,pp}_testDmitry Valter1-0/+2
2021-09-27misc: api move continuedFlorin Coras2-4/+5
2021-09-17build: use GNUInstallDirs install destinationsNick Brown1-1/+1
2021-05-27build: kindly ask python not to polute src/Damjan Marion1-2/+2
2021-05-26tests: move vapi C/C++ test files into src/Damjan Marion4-0/+1538
2021-03-05vppapigen: expose the values of per-message "options" in the api.json filesAndrew Yourtchenko1-1/+1
2020-06-10vapi: memset allocated messages to zeroKlement Sekera1-0/+4
2020-05-08build: various improvementsDamjan Marion1-1/+1
2020-05-04vapi: add support for defaults in typedefsPaul Vinciguerra2-3/+7
2020-05-01api: fix include_guard when path contains a plusRuslan Babayev1-1/+1
2020-04-24vapi: packed enum type generationNeale Ranns1-1/+14
2019-12-17build: export vapi generation in vpp-devOliver Giles1-48/+11
2019-12-10api: multiple connections per processDave Barach1-4/+4
2019-11-27misc: add address sanitizer heap instrumentationBenoît Ganne1-0/+5
2019-10-28vapi: switch to python3Ole Troan3-4/+4
2019-09-19api: split vl_api_prefix into twoOle Troan2-15/+19
2019-09-03api: enforce vla is last and fixed string typeOle Troan2-4/+13
2019-08-27api: revert use string type for strings in memclnt.apiOle Troan2-51/+73
2019-08-27api: use string type for strings in memclnt.apiOle Troan2-73/+51
2019-07-24vapi: add python scripts to vpp-dev packageVratko Polak1-7/+19
2019-06-07vppapigen: Fold up CRC from dependent types.Ole Troan1-3/+2
2019-04-29API: Add support for limits to language.Ole Troan1-3/+6
2019-04-24NAT: VPP-1531 api cleanup & updateFilip Varga1-1/+1
2019-04-23Revert "NAT: VPP-1531 api cleanup & update"Ole Trøan1-1/+1
2019-04-23NAT: VPP-1531 api cleanup & updateFilip Varga1-1/+1
2019-03-15Revert "API: Cleanup APIs interface.api"Ole Trøan1-1/+1
2019-03-15API: Cleanup APIs interface.apiJakub Grajciar1-1/+1
2018-12-18VAPI/VOM: Removing legacy stats tests, add string type.Ole Troan2-0/+2
2018-12-13vapi: code cleanupKlement Sekera1-5/+4
2018-12-06API: Change ip4_address and ip6_address to use type alias.Ole Troan1-7/+7
span class="cm">/* Look for a builtin, e.g. $my_hostname */ if (!(varvalue = builtin_eval (mm, varname, complain))) { /* Look in value table */ if (!varvalue) { i8 *tmp = clib_macro_get_value (mm, (char *) varname); if (tmp) varvalue = (i8 *) format (0, "%s%c", tmp, 0); } #ifdef CLIB_UNIX /* Look in environment. */ if (!varvalue) { char *tmp = getenv ((char *) varname); if (tmp) varvalue = (i8 *) format (0, "%s%c", tmp, 0); } #endif /* CLIB_UNIX */ } if (varvalue) { /* recursively evaluate */ ts = clib_macro_eval (mm, varvalue, complain, level + 1, max_level); vec_free (varvalue); /* add results to answer */ vec_append (rv, ts); /* Remove NULL termination or the results are sad */ vec_set_len (rv, vec_len (rv) - 1); vec_free (ts); } else { if (complain) clib_warning ("Undefined Variable Reference: %s\n", varname); vec_append (rv, format (0, "UNSET ")); vec_set_len (rv, vec_len (rv) - 1); } vec_free (varname); } } vec_add1 (rv, 0); return (rv); } /* * eval: takes a string, returns a vector. * looks up $foobar in the variable table. */ __clib_export i8 * clib_macro_eval_dollar (clib_macro_main_t *mm, i8 *s, i32 complain) { i8 *s2; i8 *rv; s2 = (i8 *) format (0, "$(%s)%c", s, 0); rv = clib_macro_eval (mm, s2, complain, 0 /* level */ , 8 /* max_level */ ); vec_free (s2); return (rv); } __clib_export void clib_macro_add_builtin (clib_macro_main_t * mm, char *name, void *eval_fn) { hash_set_mem (mm->the_builtin_eval_hash, name, (uword) eval_fn); } #ifdef CLIB_UNIX static i8 * eval_hostname (clib_macro_main_t * mm, i32 complain) { char tmp[128]; if (gethostname (tmp, sizeof (tmp))) return ((i8 *) format (0, "gethostname-error%c", 0)); return ((i8 *) format (0, "%s%c", tmp, 0)); } #endif __clib_export void clib_macro_init (clib_macro_main_t * mm) { if (mm->the_builtin_eval_hash != 0) { clib_warning ("mm %p already initialized", mm); return; } mm->the_builtin_eval_hash = hash_create_string (0, sizeof (uword)); mm->the_value_table_hash = hash_create_string (0, sizeof (uword)); #ifdef CLIB_UNIX hash_set_mem (mm->the_builtin_eval_hash, "hostname", (uword) eval_hostname); #endif } __clib_export void clib_macro_free (clib_macro_main_t * mm) { hash_pair_t *p; u8 **strings_to_free = 0; int i; hash_free (mm->the_builtin_eval_hash); /* *INDENT-OFF* */ hash_foreach_pair (p, mm->the_value_table_hash, ({ vec_add1 (strings_to_free, (u8 *) (p->key)); vec_add1 (strings_to_free, (u8 *) (p->value[0])); })); /* *INDENT-ON* */ for (i = 0; i < vec_len (strings_to_free); i++) vec_free (strings_to_free[i]); vec_free (strings_to_free); hash_free (mm->the_value_table_hash); } typedef struct { u8 *name; u8 *value; } name_sort_t; static int name_compare (void *a1, void *a2) { name_sort_t *ns1 = a1; name_sort_t *ns2 = a2; return strcmp ((char *) ns1->name, (char *) ns2->name); } __clib_export u8 * format_clib_macro_main (u8 * s, va_list * args) { clib_macro_main_t *mm = va_arg (*args, clib_macro_main_t *); int evaluate = va_arg (*args, int); hash_pair_t *p; name_sort_t *nses = 0, *ns; int i; /* *INDENT-OFF* */ hash_foreach_pair (p, mm->the_value_table_hash, ({ vec_add2 (nses, ns, 1); ns->name = (u8 *)(p->key); ns->value = (u8 *)(p->value[0]); })); /* *INDENT-ON* */ if (vec_len (nses) == 0) return s; vec_sort_with_function (nses, name_compare); for (i = 0; i < vec_len (nses); i++) { s = format (s, "%-20s", nses[i].name); if (evaluate == 0) s = format (s, "%s\n", nses[i].value); else { u8 *rv = (u8 *) clib_macro_eval_dollar (mm, (i8 *) nses[i].name, 0 /* no complain */ ); s = format (s, "%s\n", rv); vec_free (rv); } } return s; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */