From 3d81267945a732753b0dbd0a83a50ab0625b448a Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Tue, 15 Sep 2020 10:53:34 +0200 Subject: vat: add infrastructure to align vnet test code and plugin test code Split vat/api_format.c also for VNET features. Use auto-generated VAT test code and support dynamic message ID allocation as for plugins. The arp and geneve features as Guinea pigs. Type: improvement Signed-off-by: Ole Troan Change-Id: I461591496766bdf10c5f950fd30f1a0ae05909da Signed-off-by: Ole Troan --- src/vpp/api/api_main.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/vpp/api/api_main.c') diff --git a/src/vpp/api/api_main.c b/src/vpp/api/api_main.c index e2223a402b9..97dec9e1542 100644 --- a/src/vpp/api/api_main.c +++ b/src/vpp/api/api_main.c @@ -39,6 +39,26 @@ init_error_string_table (vat_main_t * vam) } #if VPP_API_TEST_BUILTIN > 0 +static void +load_features (void) +{ + vat_registered_features_t *f; + vat_main_t *vam = &vat_main; + clib_error_t *error; + + f = vam->feature_function_registrations; + + while (f) + { + error = f->function (vam); + if (error) + { + clib_warning ("INIT FAILED"); + } + f = f->next; + } +} + clib_error_t * vat_builtin_main_init (vlib_main_t * vm) { @@ -57,6 +77,8 @@ vat_builtin_main_init (vlib_main_t * vm) if (rv) clib_warning ("vat_plugin_init returned %d", rv); + load_features (); + return 0; } #endif -- cgit 1.2.3-korg