diff options
Diffstat (limited to 'ctrl/libhicnctrl/includes')
-rw-r--r-- | ctrl/libhicnctrl/includes/CMakeLists.txt | 1 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/api.h | 48 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light.h | 27 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/object.h | 14 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/object_type.h | 1 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/objects.h | 6 | ||||
-rw-r--r-- | ctrl/libhicnctrl/includes/hicn/ctrl/objects/stats.h | 29 |
7 files changed, 61 insertions, 65 deletions
diff --git a/ctrl/libhicnctrl/includes/CMakeLists.txt b/ctrl/libhicnctrl/includes/CMakeLists.txt index 554021c48..63b8aa9a7 100644 --- a/ctrl/libhicnctrl/includes/CMakeLists.txt +++ b/ctrl/libhicnctrl/includes/CMakeLists.txt @@ -46,6 +46,7 @@ set(TO_INSTALL_HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/hicn/ctrl/objects/policy.h ${CMAKE_CURRENT_SOURCE_DIR}/hicn/ctrl/objects/punting.h ${CMAKE_CURRENT_SOURCE_DIR}/hicn/ctrl/objects/route.h + ${CMAKE_CURRENT_SOURCE_DIR}/hicn/ctrl/objects/stats.h ${CMAKE_CURRENT_SOURCE_DIR}/hicn/ctrl/objects/strategy.h ${CMAKE_CURRENT_SOURCE_DIR}/hicn/ctrl/objects/subscription.h ${CMAKE_CURRENT_SOURCE_DIR}/hicn/ctrl/parse.h diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h index 21a5e548f..ad3f8fcc3 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/api.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/api.h @@ -194,47 +194,17 @@ typedef struct hc_result_s hc_result_t; #define UNSUPPORTED_CMD_ERROR -3 /*----------------------------------------------------------------------------* - * Strategy - *----------------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------------* * WLDR *----------------------------------------------------------------------------*/ // per connection int hc_wldr_set(hc_sock_t *s /* XXX */); -/*----------------------------------------------------------------------------* - * MAP-Me - *----------------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------------* - * Policies - *----------------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------------* - * Subscription - *----------------------------------------------------------------------------*/ -// Topics - -#if 0 -/* Result */ - -hc_msg_t *hc_result_get_msg(hc_sock_t *s, hc_result_t *result); -int hc_result_get_cmd_id(hc_sock_t *s, hc_result_t *result); -bool hc_result_get_success(hc_sock_t *s, hc_result_t *result); -void hc_result_free(hc_result_t *result); -#endif - /* Object */ -// FIXME -#define MAXSZ_HC_SUBSCRIPTION 1 - #define MAXSZ_HC_OBJECT \ MAX8(MAXSZ_HC_CONNECTION, MAXSZ_HC_LISTENER, MAXSZ_HC_ROUTE, MAXSZ_HC_FACE, \ - MAXSZ_HC_PUNTING, MAXSZ_HC_STRATEGY, MAXSZ_HC_POLICY, \ - MAXSZ_HC_SUBSCRIPTION) + MAXSZ_HC_PUNTING, MAXSZ_HC_STRATEGY, MAXSZ_HC_POLICY, MAXSZ_HC_STATS) typedef struct { hc_action_t action; @@ -244,10 +214,6 @@ typedef struct { // NEW API CALLS -// XXX private ? -int _hc_execute(hc_sock_t *s, hc_action_t action, hc_object_type_t object_type, - hc_object_t *object, hc_result_callback_t callback, - void *callback_data, hc_data_t **pdata); int hc_execute(hc_sock_t *s, hc_action_t action, hc_object_type_t object_type, hc_object_t *object, hc_data_t **pdata); int hc_execute_async(hc_sock_t *s, hc_action_t action, @@ -289,11 +255,6 @@ int hc_connection_set_priority(hc_sock_t *s, const char *conn_id_or_name, int hc_connection_set_tags(hc_sock_t *s, const char *conn_id_or_name, policy_tags_t tags); -/* -int hc_connection_remove_by_id(hc_sock_t * s, char * name); -int hc_connection_remove_by_name(hc_sock_t * s, char * name); -*/ - int hc_connection_set_admin_state(hc_sock_t *s, const char *conn_id_or_name, face_state_t state); int hc_connection_set_priority(hc_sock_t *s, const char *conn_id_or_name, @@ -357,8 +318,9 @@ int hc_punting_list(hc_sock_t *s, hc_data_t **pdata); int hc_subscription_create(hc_sock_t *s, hc_subscription_t *subscription); int hc_subscription_delete(hc_sock_t *s, hc_subscription_t *subscription); -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); +int hc_stats_list(hc_sock_t *s, hc_data_t **pdata); +int hc_stats_snprintf(char *s, size_t size, const hc_stats_t *stats); +int hc_face_stats_list(hc_sock_t *s, hc_data_t **pdata); +int hc_face_stats_snprintf(char *s, size_t size, const hc_face_stats_t *stats); #endif /* HICNTRL_API */ diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light.h b/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light.h index 34667cc1b..426b82fa9 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/hicn-light.h @@ -91,8 +91,8 @@ typedef enum { _(active_interface_update, ACTIVE_INTERFACE_UPDATE) \ _(subscription_add, SUBSCRIPTION_ADD) \ _(subscription_remove, SUBSCRIPTION_REMOVE) \ - _(stats_get, STATS_GET) \ - _(stats_list, STATS_LIST) + _(stats_list, STATS_LIST) \ + _(face_stats_list, FACE_STATS_LIST) typedef enum { COMMAND_TYPE_UNDEFINED, @@ -339,12 +339,12 @@ typedef struct { // General stats typedef struct { void *_; -} cmd_stats_get_t; +} cmd_stats_list_t; // Per-face stats typedef struct { void *_; -} cmd_stats_list_t; +} cmd_face_stats_list_t; typedef void *cmd_active_interface_update_t; @@ -498,14 +498,9 @@ typedef struct { /* Statistics */ +// General stats typedef struct { - cmd_header_t header; - hicn_light_stats_t payload; -} msg_stats_get_reply_t; - -typedef struct { - uint32_t id; - connection_stats_t stats; + hc_stats_t stats; } cmd_stats_list_item_t; typedef struct { @@ -513,6 +508,16 @@ typedef struct { cmd_stats_list_item_t payload; } msg_stats_list_reply_t; +// Per-face stats +typedef struct { + hc_face_stats_t stats; +} cmd_face_stats_list_item_t; + +typedef struct { + cmd_header_t header; + cmd_face_stats_list_item_t payload; +} msg_face_stats_list_reply_t; + //===== size of commands ====== // REMINDER: when a new_command is added, the following switch has to be // updated. diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/object.h b/ctrl/libhicnctrl/includes/hicn/ctrl/object.h index c659d1824..74b88c515 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/object.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/object.h @@ -22,17 +22,7 @@ #define HICNCTRL_OBJECT_H #include <hicn/ctrl/object_type.h> - -#include <hicn/ctrl/objects/listener.h> -#include <hicn/ctrl/objects/connection.h> -#include <hicn/ctrl/objects/route.h> -#include <hicn/ctrl/objects/punting.h> -#include <hicn/ctrl/objects/strategy.h> -#include <hicn/ctrl/objects/policy.h> -#include <hicn/ctrl/objects/subscription.h> -#include <hicn/ctrl/objects/cache.h> -#include <hicn/ctrl/objects/mapme.h> -#include <hicn/ctrl/objects/active_interface.h> +#include <hicn/ctrl/objects.h> typedef union { hc_connection_t connection; @@ -41,6 +31,8 @@ typedef union { hc_face_t face; // hc_data_t *data; hc_punting_t punting; + hc_stats_t stats; + hc_face_stats_t face_stats; hc_strategy_t strategy; hc_policy_t policy; hc_subscription_t subscription; diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/object_type.h b/ctrl/libhicnctrl/includes/hicn/ctrl/object_type.h index 39a2d188e..4c5a8c425 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/object_type.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/object_type.h @@ -38,6 +38,7 @@ _(SUBSCRIPTION) \ _(ACTIVE_INTERFACE) \ _(STATS) \ + _(FACE_STATS) \ _(N) typedef enum { diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/objects.h b/ctrl/libhicnctrl/includes/hicn/ctrl/objects.h index 4f560a2f3..5509f99a8 100644 --- a/ctrl/libhicnctrl/includes/hicn/ctrl/objects.h +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/objects.h @@ -5,7 +5,13 @@ #include <hicn/ctrl/objects/face.h> #include <hicn/ctrl/objects/listener.h> #include <hicn/ctrl/objects/route.h> +#include <hicn/ctrl/objects/punting.h> +#include <hicn/ctrl/objects/stats.h> #include <hicn/ctrl/objects/strategy.h> +#include <hicn/ctrl/objects/policy.h> #include <hicn/ctrl/objects/subscription.h> +#include <hicn/ctrl/objects/cache.h> +#include <hicn/ctrl/objects/mapme.h> +#include <hicn/ctrl/objects/active_interface.h> #endif /* HICNCTRL_OBJECTS_H */ diff --git a/ctrl/libhicnctrl/includes/hicn/ctrl/objects/stats.h b/ctrl/libhicnctrl/includes/hicn/ctrl/objects/stats.h new file mode 100644 index 000000000..31c590dee --- /dev/null +++ b/ctrl/libhicnctrl/includes/hicn/ctrl/objects/stats.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021-2022 Cisco and/or its affiliates. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * \file objects/stats.h + * \brief Stats. + */ + +#ifndef HICNCTRL_OBJECTS_STATS_H +#define HICNCTRL_OBJECTS_STATS_H + +#define MAXSZ_HC_STATS 600 + +typedef hicn_light_stats_t hc_stats_t; +typedef connection_stats_t hc_face_stats_t; + +#endif /* HICNCTRL_OBJECTS_STATS_H */ |