Stats refactor
[vpp.git] / src / vpp / stats / stats.api
1 /*
2  * Copyright (c) 2015-2016 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 /** \file
17
18     This file defines the stats API 
19 */
20
21
22 /** \brief Want Stats, enable/disable ALL stats updates
23     @param client_index - opaque cookie to identify the sender
24     @param context - sender context, to match reply w/ request
25     @param enable_disable - 1 = enable stats, 0 = disable
26     @param pid - pid of process requesting stats updates
27 */
28 autoreply define want_stats
29 {
30   u32 client_index;
31   u32 context;
32   u32 enable_disable;
33   u32 pid;
34 };
35
36 /** \brief Want Interface Simple Stats, register for detailed interface stats
37     @param client_index - opaque cookie to identify the sender
38     @param context - sender context, to match reply w/ request
39     @param enable_disable - 1 = enable stats, 0 = disable
40     @param pid - pid of process requesting stats updates
41
42     Please consider using want_per_interface_simple_stats with sw_if_index=~0
43 */
44 autoreply define want_interface_simple_stats
45 {
46   u32 client_index;
47   u32 context;
48   u32 enable_disable;
49   u32 pid;
50 };
51
52 /** \brief Want Per Interface simple Stats, register for continuous stats
53     @param client_index - opaque cookie to identify the sender
54     @param context - sender context, to match reply w/ request
55     @param enable_disable - 1 = enable stats, 0 = disable
56     @param pid - pid of process requesting stats updates
57     @param num - number of sw_if_indexes
58     @param sw_ifs - array of sw_if_index
59 */
60 autoreply define want_per_interface_simple_stats
61 {
62   u32 client_index;
63   u32 context;
64   u32 enable_disable;
65   u32 pid;
66   u32 num;
67   u32 sw_ifs[num];
68
69 };
70
71 /** \brief Want Interface Combined Stats, register for continuous stats
72     @param client_index - opaque cookie to identify the sender
73     @param context - sender context, to match reply w/ request
74     @param enable_disable - 1 = enable stats, 0 = disable
75     @param pid - pid of process requesting stats updates
76
77     Please consider using want_per_interface_combined_stats with sw_if_index=~0
78
79 */
80 autoreply define want_interface_combined_stats
81 {
82   u32 client_index;
83   u32 context;
84   u32 enable_disable;
85   u32 pid;
86 };
87
88 /** \brief Want Per Interface Combined Stats, register for continuous stats
89     @param client_index - opaque cookie to identify the sender
90     @param context - sender context, to match reply w/ request
91     @param enable_disable - 1 = enable stats, 0 = disable
92     @param pid - pid of process requesting stats updates
93     @param num - number of sw_if_indexes
94     @param sw_ifs - array of sw_if_index
95 */
96 autoreply define want_per_interface_combined_stats
97 {
98   u32 client_index;
99   u32 context;
100   u32 enable_disable;
101   u32 pid;
102   u32 num;
103   u32 sw_ifs[num];
104
105 };
106
107 /** \brief Want IP4 FIB Stats, register for continuous stats
108     @param client_index - opaque cookie to identify the sender
109     @param context - sender context, to match reply w/ request
110     @param enable_disable - 1 = enable stats, 0 = disable
111     @param pid - pid of process requesting stats updates
112 */
113 autoreply define want_ip4_fib_stats
114 {
115   u32 client_index;
116   u32 context;
117   u32 enable_disable;
118   u32 pid;
119 };
120
121 /** \brief Want IP6 FIB Stats, register for continuous stats
122     @param client_index - opaque cookie to identify the sender
123     @param context - sender context, to match reply w/ request
124     @param enable_disable - 1 = enable stats, 0 = disable
125     @param pid - pid of process requesting stats updates
126 */
127 autoreply define want_ip6_fib_stats
128 {
129   u32 client_index;
130   u32 context;
131   u32 enable_disable;
132   u32 pid;
133 };
134
135 /** \brief Want IP4 NBR Stats, register for continuous stats
136     @param client_index - opaque cookie to identify the sender
137     @param context - sender context, to match reply w/ request
138     @param enable_disable - 1 = enable stats, 0 = disable
139     @param pid - pid of process requesting stats updates
140 */
141 autoreply define want_ip4_nbr_stats
142 {
143   u32 client_index;
144   u32 context;
145   u32 enable_disable;
146   u32 pid;
147 };
148
149 /** \brief Want IP6 NBR Stats, register for continuous stats
150     @param client_index - opaque cookie to identify the sender
151     @param context - sender context, to match reply w/ request
152     @param enable_disable - 1 = enable stats, 0 = disable
153     @param pid - pid of process requesting stats updates
154 */
155 autoreply define want_ip6_nbr_stats
156 {
157   u32 client_index;
158   u32 context;
159   u32 enable_disable;
160   u32 pid;
161 };
162
163 typeonly manual_print manual_endian define ip4_fib_counter
164 {
165   u32 address;
166   u8 address_length;
167   u64 packets;
168   u64 bytes;
169 };
170
171 manual_print manual_endian define vnet_ip4_fib_counters
172 {
173   u32 vrf_id;
174   u32 count;
175   vl_api_ip4_fib_counter_t c[count];
176 };
177
178 typeonly manual_print manual_endian define ip4_nbr_counter
179 {
180   u32 address;
181   u8  link_type;
182   u64 packets;
183   u64 bytes;
184 };
185
186 /**
187  * @brief Per-neighbour (i.e. per-adjacency) coutners
188  * @param count The size of the array of counters
189  * @param sw_if_index The interface the adjacency is on
190  * @param begin Flag to indicate this is the first set of stats for this
191  *        interface. If this flag is not set the it is a continuation of
192  *        stats for this interface
193  * @param  c counters
194  */
195 manual_print manual_endian define vnet_ip4_nbr_counters
196 {
197   u32 count;
198   u32 sw_if_index;
199   u8 begin;
200   vl_api_ip4_nbr_counter_t c[count];
201 };
202
203 typeonly manual_print manual_endian define ip6_fib_counter
204 {
205   u64 address[2];
206   u8 address_length;
207   u64 packets;
208   u64 bytes;
209 };
210
211 manual_print manual_endian define vnet_ip6_fib_counters
212 {
213   u32 vrf_id;
214   u32 count;
215   vl_api_ip6_fib_counter_t c[count];
216 };
217
218 typeonly manual_print manual_endian define ip6_nbr_counter
219 {
220   u64 address[2];
221   u8  link_type;
222   u64 packets;
223   u64 bytes;
224 };
225
226 manual_print manual_endian define vnet_ip6_nbr_counters
227 {
228   u32 count;
229   u32 sw_if_index;
230   u8 begin;
231   vl_api_ip6_nbr_counter_t c[count];
232 };
233
234
235 /** \brief Request for a single block of summary stats
236     @param client_index - opaque cookie to identify the sender
237     @param context - sender context, to match reply w/ request
238 */
239 define vnet_get_summary_stats
240 {
241   u32 client_index;
242   u32 context;
243 };
244
245 /** \brief Reply for vnet_get_summary_stats request
246     @param context - sender context, to match reply w/ request
247     @param retval - return code for request
248     @param total_pkts -  
249     @param total_bytes -
250     @param vector_rate - 
251 */
252 define vnet_get_summary_stats_reply
253 {
254   u32 context;
255   i32 retval;
256   u64 total_pkts[2];
257   u64 total_bytes[2];
258   f64 vector_rate;
259 };
260
261 /*
262  * Local Variables:
263  * eval: (c-set-style "gnu")
264  * End:
265  */