Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
mgmt.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __HICN_MGMT_H__
17 #define __HICN_MGMT_H__
18 
19 #include <vppinfra/error.h>
20 #include "faces/face.h"
21 #include "hicn_api.h"
22 
28 typedef struct icn_stats_s
29 {
30  u32 pkts_processed;
31  u32 pkts_interest_count;
32  u32 pkts_data_count;
33  u32 pkts_from_cache_count;
34  u32 pkts_no_pit_count;
35  u32 pit_expired_count;
36  u32 cs_expired_count;
37  u32 no_bufs_count;
38  u32 pkts_interest_agg;
39  u32 pkts_int_retrans;
40  u32 pit_int_count;
41  u32 pit_cs_count;
42 } icn_stats_t;
43 
44 typedef enum
45 {
46  HICN_MGMT_FACE_OP_NONE = 0,
47  HICN_MGMT_FACE_OP_CREATE,
48  HICN_MGMT_FACE_OP_DELETE,
49  HICN_MGMT_FACE_OP_ADMIN,
50  HICN_MGMT_FACE_OP_HELLO,
51 } hicn_mgmt_face_op_e;
52 
53 typedef enum
54 {
55  HICN_MGMT_MAPME_OP_NONE = 0,
56  HICN_MGMT_MAPME_OP_CREATE,
57  HICN_MGMT_MAPME_OP_DELETE,
58  HICN_MGMT_MAPME_OP_ENABLE,
59  HICN_MGMT_MAPME_OP_DISABLE
60 } hicn_mgmt_mapme_op_e;
61 
62 typedef enum
63 {
64  HICN_ADDRESS_TYPE_NONE,
65  HICN_ADDRESS_TYPE_V4,
66  HICN_ADDRESS_TYPE_V6
67 } hicn_address_type_e;
68 
69 /*
70  * Utility to update error counters in all hICN nodes
71  */
72 always_inline void
73 update_node_counter (vlib_main_t *vm, u32 node_idx, u32 counter_idx, u64 val)
74 {
75  vlib_node_t *node = vlib_get_node (vm, node_idx);
76  vlib_error_main_t *em = &(vm->error_main);
77  u32 base_idx = node->error_heap_index;
78 
79  em->counters[base_idx + counter_idx] = val;
80 }
81 
82 /*
83  * Stats for the forwarding node, which end up called "error" even though
84  * they aren't...
85  */
86 #define foreach_hicnfwd_error \
87  _ (PROCESSED, "hICN packets processed") \
88  _ (INTERESTS, "hICN interests forwarded") \
89  _ (DATAS, "hICN data msgs forwarded") \
90  _ (CACHED, "Cached data ") \
91  _ (NO_PIT, "hICN no PIT entry drops") \
92  _ (PIT_EXPIRED, "hICN expired PIT entries") \
93  _ (CS_EXPIRED, "hICN expired CS entries") \
94  _ (CS_LRU, "hICN LRU CS entries freed") \
95  _ (NO_BUFS, "No packet buffers") \
96  _ (INTEREST_AGG, "Interests aggregated") \
97  _ (INTEREST_AGG_ENTRY, "Interest aggregated per entry") \
98  _ (INT_RETRANS, "Interest retransmissions") \
99  _ (INT_COUNT, "Interests in PIT") \
100  _ (CS_COUNT, "CS total entries") \
101  _ (CS_NTW_COUNT, "CS ntw entries") \
102  _ (CS_APP_COUNT, "CS app entries") \
103  _ (HASH_COLL_HASHTB_COUNT, "Collisions in Hash table")
104 
105 typedef enum
106 {
107 #define _(sym, str) HICNFWD_ERROR_##sym,
108  foreach_hicnfwd_error
109 #undef _
110  HICNFWD_N_ERROR,
111 } hicnfwd_error_t;
112 
113 /*
114  * Declarations
115  */
116 clib_error_t *hicn_api_plugin_hookup (vlib_main_t *vm);
117 
118 int hicn_mgmt_node_stats_get (vl_api_hicn_api_node_stats_get_reply_t *rmp);
119 
120 #endif /* // __HICN_MGMT_H__ */
121 
122 /*
123  * fd.io coding-style-patch-verification: ON
124  *
125  * Local Variables: eval: (c-set-style "gnu") End:
126  */
icn_stats_s
Definition: mgmt.h:28
face.h
hicn_api.h