diff options
author | mhemmatp <mhemmatp@cisco.com> | 2019-12-12 16:05:13 +0100 |
---|---|---|
committer | mhemmatp <mhemmatp@cisco.com> | 2019-12-12 17:09:06 +0100 |
commit | a0f325f0b6ca0129ed339ac4ac94d7159e926977 (patch) | |
tree | 81e6b447bc44d418c6625fdf66c03a42096476d2 /ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.h | |
parent | 02be1b9403b12c03fc4c03ef872fb71ec37b2c1c (diff) |
[HICN-440] Add comments to hicn sysrepo plugin code
Signed-off-by: mhemmatp <mhemmatp@cisco.com>
Change-Id: I0ed0c5b0b9cd7714b46867e4d4fe0324945cf418
Diffstat (limited to 'ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.h')
-rw-r--r-- | ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.h | 91 |
1 files changed, 65 insertions, 26 deletions
diff --git a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.h b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.h index 9c5d9df9a..62fb15340 100644 --- a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.h +++ b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.h @@ -13,38 +13,84 @@ * limitations under the License. */ +/** + * @file hicn_model.h + * @brief This file contains main calls for hICN events coresponding to the hICN yang models + */ + #ifndef __IETF_HICN_H__ #define __IETF_HICN_H__ #include "../hicn_vpp_comm.h" #include <vapi/hicn.api.vapi.h> +/** + * @brief Align memory to one page boundary + */ #define MEM_ALIGN 4096 + +/** + * @brief 32 bits = 4 bytes + */ #define B32 4 +/** + * @brief 64bits = 8 bytes + */ #define B64 8 +/** + * @brief 128 bits = 16 bytes + */ #define B128 16 -// Number of locks is equal to number of nodes in hicn-state -// It is a coarse grain approach later can be changed to fine grained -// better to initialize the lock by 0 +/** + * @brief set number of lock to 5 + */ #define NLOCKS 5 -#define LOCK_INIT 0 +/** + * @brief initialize all locks by 0, better to initialize by 0 :) + */ +#define LOCK_INIT 0 +/** + * @brief enumeration for the locks + */ enum locks_name {lstate, lstrategy, lstrategies, lroute, lfaces}; + +// It is a coarse grain approach later can be changed to fine grained + + +/** + * @brief This indicates the number of leaves for the hICN state + */ #define NSTATE_LEAVES 15 +/** + * @brief This indicates the number of leaves for strategy + */ #define NSTRATEGY_LEAVES 1 +/** + * @brief This indicates the number of leaves for strategies + */ #define NSTRATEGIES_LEAVES 2 +/** + * @brief This indicates the maximum faces which can be read as operational data + */ #define MAX_FACE_POOL 100 +/** + * @brief This indicates the maximum routes which can be read as operational data + */ #define MAX_ROUTE_POOL 100 - +/** + * @brief This indicates the number of leaves for faces + */ #define FACES_CHILDREN 9 /*this is the number of children of each leave in face except the key*/ +/** + * @brief This indicates the number of leaves for routes + */ #define ROUTES_CHILDREN 2 /*this is the number of children of each leave in face except the key*/ typedef struct __attribute__ ((__packed__)) { - - int32_t retval; uint64_t pkts_processed; uint64_t pkts_interest_count; @@ -61,14 +107,8 @@ typedef struct __attribute__ ((__packed__)) { uint64_t pit_entries_count; uint64_t cs_entries_count; uint64_t cs_entries_ntw_count; - } hicn_state_t; -typedef struct __attribute__ ((__packed__)) { - uint8_t description[200]; - int32_t retval; -} hicn_strategy_t; - typedef struct __attribute__ ((__packed__)) { @@ -77,18 +117,6 @@ typedef struct __attribute__ ((__packed__)) { int32_t retval; } hicn_strategies_t; -typedef struct __attribute__ ((__packed__)) { - uint32_t faceids[1000]; - uint32_t strategy_id; - int32_t retval; -} hicn_route_t; - -typedef struct __attribute__ ((__packed__)) { - uint64_t nh_addr[2]; - uint32_t swif; - uint32_t flags; - int32_t retval; -} hicn_face_ip_params_t; typedef struct __attribute__ ((__packed__)) { uint32_t faceid; @@ -103,6 +131,7 @@ typedef struct __attribute__ ((__packed__)) { uint64_t dtx_bytes; } hicn_face_inf_t; + typedef struct __attribute__ ((__packed__)) { u32 route_id; vapi_type_prefix prefix; @@ -111,17 +140,23 @@ typedef struct __attribute__ ((__packed__)) { u32 strategy_id; } hicn_route_inf_t; - +/** + * @brief This is the link list to maintain the statistics of the faces + */ struct hicn_faces_s{ hicn_face_inf_t face; struct hicn_faces_s * next; }; + typedef struct __attribute__ ((__packed__)) { uint32_t nface; struct hicn_faces_s * next; } hicn_faces_t; +/** + * @brief This is the link list to maintain the route informations + */ struct hicn_routes_s{ hicn_route_inf_t route; struct hicn_routes_s * next; @@ -133,6 +168,10 @@ typedef struct __attribute__ ((__packed__)) { struct hicn_routes_s * next; } hicn_routes_t; +/** + * @brief This function subscribes the hICN evens consisting of all RPCs + * as well as operational data + */ int hicn_subscribe_events(sr_session_ctx_t *session, sr_subscription_ctx_t **subscription); |