summaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps/sapi/vpp_echo_common.h
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-03-13 04:44:51 +0000
committerFlorin Coras <florin.coras@gmail.com>2020-03-25 18:56:27 +0000
commit07063b8ea39b05d5d7bb00ad2a2363b11792c571 (patch)
tree2df1cd5b5df869c729f534f093dea664eb059f3a /src/plugins/hs_apps/sapi/vpp_echo_common.h
parent4e783b9c901cf90e58c3f921bb17170ab23e540a (diff)
session: api to add new transport types
Type: feature Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: If4dee6dba1ea942daa921d566b35cdecdda680ee
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo_common.h')
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo_common.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.h b/src/plugins/hs_apps/sapi/vpp_echo_common.h
index 0c85b499e9c..f01bb0390f6 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo_common.h
+++ b/src/plugins/hs_apps/sapi/vpp_echo_common.h
@@ -146,12 +146,13 @@ do { \
clib_warning (_fmt, ##_args); \
}
-#define ECHO_REGISTER_PROTO(proto, vft) \
- static void __clib_constructor \
- vpp_echo_init_##proto () \
- { \
- echo_main_t *em = &echo_main; \
- em->available_proto_cb_vft[proto] = &vft; \
+#define ECHO_REGISTER_PROTO(proto, vft) \
+ static void __clib_constructor \
+ vpp_echo_init_##proto () \
+ { \
+ echo_main_t *em = &echo_main; \
+ vec_validate (em->available_proto_cb_vft, proto); \
+ em->available_proto_cb_vft[proto] = &vft; \
}
typedef struct
@@ -356,7 +357,7 @@ typedef struct
/* VNET_API_ERROR_FOO -> "Foo" hash table */
uword *error_string_by_error_number;
- echo_proto_cb_vft_t *available_proto_cb_vft[TRANSPORT_N_PROTO];
+ echo_proto_cb_vft_t **available_proto_cb_vft;
echo_stats_t stats;
echo_stats_t last_stat_sampling; /* copy of stats at last sampling */