diff options
author | Luca Muscariello <lumuscar@cisco.com> | 2022-06-09 21:34:09 +0200 |
---|---|---|
committer | Luca Muscariello <muscariello@ieee.org> | 2022-06-30 10:47:50 +0200 |
commit | 6b94663b2455e212009a544ae23bb6a8c55407f8 (patch) | |
tree | 0af780ce5eeb1009fd24b8af8af08e8368eda3bd /ctrl/libhicnctrl/includes | |
parent | a1ac96f497719b897793ac14b287cb8d840651c1 (diff) |
refactor(lib, hicn-light, vpp, hiperf): HICN-723
- move infra data structure into the shared lib
- new packet cache using double hashing and lookup on prefix suffix
- testing updates
- authenticated requests using interest manifests
Co-authored-by: Mauro Sardara <msardara@cisco.com>
Co-authored-by: Jordan Augé <jordan.auge+fdio@cisco.com>
Co-authored-by: Michele Papalini <micpapal@cisco.com>
Co-authored-by: Olivier Roques <oroques+fdio@cisco.com>
Co-authored-by: Enrico Loparco <eloparco@cisco.com>
Change-Id: Iaddebfe6aa5279ea8553433b0f519578f6b9ccd9
Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Diffstat (limited to 'ctrl/libhicnctrl/includes')
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/api.h | 10 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light-ng.h | 35 |
2 files changed, 42 insertions, 3 deletions
diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h index 8a59cf4d8..c259fc10c 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h @@ -72,6 +72,7 @@ #include <hicn/util/ip_address.h> #include <hicn/face.h> #include <hicn/strategy.h> +#include <hicn/base.h> /* * This has to be common between hicn-light and hicn-plugin. We now we keep the * minimum of the two @@ -120,6 +121,7 @@ _(SERVE) \ _(STORE) \ _(CLEAR) \ + _(GET) \ _(N) typedef enum { @@ -150,6 +152,7 @@ hc_action_t action_from_str(const char *action_str); _(LOCAL_PREFIX) \ _(PROBE) \ _(SUBSCRIPTION) \ + _(STATS) \ _(N) typedef enum { @@ -930,6 +933,13 @@ typedef struct { flag_interface_type_t interface_type; } hc_event_interface_update_t; +/*----------------------------------------------------------------------------* + * Statistics + *----------------------------------------------------------------------------*/ +int hc_stats_get(hc_sock_t *s, hc_data_t **pdata); // General stats +int hc_stats_list(hc_sock_t *s, hc_data_t **pdata); // Per-face stats +int hc_stats_snprintf(char *s, size_t size, const hicn_light_stats_t *stats); + /* Result */ hc_msg_t *hc_result_get_msg(hc_sock_t *s, hc_result_t *result); diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light-ng.h b/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light-ng.h index 7d105a84b..783eab086 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light-ng.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light-ng.h @@ -90,7 +90,9 @@ typedef enum { _(policy_remove, POLICY_REMOVE) \ _(policy_list, POLICY_LIST) \ _(subscription_add, SUBSCRIPTION_ADD) \ - _(subscription_remove, SUBSCRIPTION_REMOVE) + _(subscription_remove, SUBSCRIPTION_REMOVE) \ + _(stats_get, STATS_GET) \ + _(stats_list, STATS_LIST) typedef enum { COMMAND_TYPE_UNDEFINED, @@ -282,6 +284,33 @@ typedef struct { cmd_cache_list_reply_t payload; } msg_cache_list_reply_t; +/* Statistics */ + +// General stats +typedef struct { + void *_; +} cmd_stats_get_t; + +typedef struct { + cmd_header_t header; + hicn_light_stats_t payload; +} msg_stats_get_reply_t; + +// Per-face stats +typedef struct { + void *_; +} cmd_stats_list_t; + +typedef struct { + uint32_t id; + connection_stats_t stats; +} cmd_stats_list_item_t; + +typedef struct { + cmd_header_t header; + cmd_stats_list_item_t payload; +} msg_stats_list_reply_t; + /* WLDR */ typedef struct { @@ -388,10 +417,10 @@ typedef struct { cmd_header_t header; \ cmd_##l##_t payload; \ } msg_##l##_t; -foreach_command_type +foreach_command_type; #undef _ - typedef struct { +typedef struct { cmd_header_t header; cmd_listener_list_item_t payload; } msg_listener_list_reply_t; |