Revert "API: Add service definitions for events and singleton messages."
[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 option version = "1.0.0";
22
23 /** \brief Want Stats, enable/disable ALL stats updates
24     @param client_index - opaque cookie to identify the sender
25     @param context - sender context, to match reply w/ request
26     @param enable_disable - 1 = enable stats, 0 = disable
27     @param pid - pid of process requesting stats updates
28 */
29 autoreply define want_stats
30 {
31   u32 client_index;
32   u32 context;
33   u32 enable_disable;
34   u32 pid;
35 };
36
37 /** \brief Want Interface Simple Stats, register for detailed interface stats
38     @param client_index - opaque cookie to identify the sender
39     @param context - sender context, to match reply w/ request
40     @param enable_disable - 1 = enable stats, 0 = disable
41     @param pid - pid of process requesting stats updates
42
43     Please consider using want_per_interface_simple_stats with sw_if_index=~0
44 */
45 autoreply define want_interface_simple_stats
46 {
47   u32 client_index;
48   u32 context;
49   u32 enable_disable;
50   u32 pid;
51 };
52
53 /** \brief Want Per Interface simple Stats, register for continuous stats
54     @param client_index - opaque cookie to identify the sender
55     @param context - sender context, to match reply w/ request
56     @param enable_disable - 1 = enable stats, 0 = disable
57     @param pid - pid of process requesting stats updates
58     @param num - number of sw_if_indexes
59     @param sw_ifs - array of sw_if_index
60 */
61 autoreply define want_per_interface_simple_stats
62 {
63   u32 client_index;
64   u32 context;
65   u32 enable_disable;
66   u32 pid;
67   u32 num;
68   u32 sw_ifs[num];
69
70 };
71
72 /** \brief Want Interface Combined Stats, register for continuous stats
73     @param client_index - opaque cookie to identify the sender
74     @param context - sender context, to match reply w/ request
75     @param enable_disable - 1 = enable stats, 0 = disable
76     @param pid - pid of process requesting stats updates
77
78     Please consider using want_per_interface_combined_stats with sw_if_index=~0
79
80 */
81 autoreply define want_interface_combined_stats
82 {
83   u32 client_index;
84   u32 context;
85   u32 enable_disable;
86   u32 pid;
87 };
88
89 /** \brief Want Per Interface Combined Stats, register for continuous stats
90     @param client_index - opaque cookie to identify the sender
91     @param context - sender context, to match reply w/ request
92     @param enable_disable - 1 = enable stats, 0 = disable
93     @param pid - pid of process requesting stats updates
94     @param num - number of sw_if_indexes
95     @param sw_ifs - array of sw_if_index
96 */
97 autoreply define want_per_interface_combined_stats
98 {
99   u32 client_index;
100   u32 context;
101   u32 enable_disable;
102   u32 pid;
103   u32 num;
104   u32 sw_ifs[num];
105
106 };
107
108 /** \brief Want IP4 FIB Stats, register for continuous stats
109     @param client_index - opaque cookie to identify the sender
110     @param context - sender context, to match reply w/ request
111     @param enable_disable - 1 = enable stats, 0 = disable
112     @param pid - pid of process requesting stats updates
113 */
114 autoreply define want_ip4_fib_stats
115 {
116   u32 client_index;
117   u32 context;
118   u32 enable_disable;
119   u32 pid;
120 };
121
122 /** \brief Want IP6 FIB Stats, register for continuous stats
123     @param client_index - opaque cookie to identify the sender
124     @param context - sender context, to match reply w/ request
125     @param enable_disable - 1 = enable stats, 0 = disable
126     @param pid - pid of process requesting stats updates
127 */
128 autoreply define want_ip6_fib_stats
129 {
130   u32 client_index;
131   u32 context;
132   u32 enable_disable;
133   u32 pid;
134 };
135
136 /** \brief Want IP4 muilticast FIB Stats, register for continuous stats
137     @param client_index - opaque cookie to identify the sender
138     @param context - sender context, to match reply w/ request
139     @param enable_disable - 1 = enable stats, 0 = disable
140     @param pid - pid of process requesting stats updates
141 */
142 autoreply define want_ip4_mfib_stats
143 {
144   u32 client_index;
145   u32 context;
146   u32 enable_disable;
147   u32 pid;
148 };
149
150 /** \brief Want IP6 multicast FIB Stats, register for continuous stats
151     @param client_index - opaque cookie to identify the sender
152     @param context - sender context, to match reply w/ request
153     @param enable_disable - 1 = enable stats, 0 = disable
154     @param pid - pid of process requesting stats updates
155 */
156 autoreply define want_ip6_mfib_stats
157 {
158   u32 client_index;
159   u32 context;
160   u32 enable_disable;
161   u32 pid;
162 };
163
164 /** \brief Want IP4 NBR Stats, register for continuous stats
165     @param client_index - opaque cookie to identify the sender
166     @param context - sender context, to match reply w/ request
167     @param enable_disable - 1 = enable stats, 0 = disable
168     @param pid - pid of process requesting stats updates
169 */
170 autoreply define want_ip4_nbr_stats
171 {
172   u32 client_index;
173   u32 context;
174   u32 enable_disable;
175   u32 pid;
176 };
177
178 /** \brief Want IP6 NBR Stats, register for continuous stats
179     @param client_index - opaque cookie to identify the sender
180     @param context - sender context, to match reply w/ request
181     @param enable_disable - 1 = enable stats, 0 = disable
182     @param pid - pid of process requesting stats updates
183 */
184 autoreply define want_ip6_nbr_stats
185 {
186   u32 client_index;
187   u32 context;
188   u32 enable_disable;
189   u32 pid;
190 };
191
192 typeonly manual_print manual_endian define ip4_fib_counter
193 {
194   u32 address;
195   u8 address_length;
196   u64 packets;
197   u64 bytes;
198 };
199
200 manual_print manual_endian define vnet_ip4_fib_counters
201 {
202   u32 vrf_id;
203   u32 count;
204   vl_api_ip4_fib_counter_t c[count];
205 };
206
207 typeonly manual_print manual_endian define ip4_mfib_counter
208 {
209   u8 source[4];
210   u8 group[4];
211   u8 group_length;
212   u64 packets;
213   u64 bytes;
214 };
215
216 manual_print manual_endian define vnet_ip4_mfib_counters
217 {
218   u32 vrf_id;
219   u32 count;
220   vl_api_ip4_mfib_counter_t c[count];
221 };
222
223 typeonly manual_print manual_endian define ip4_nbr_counter
224 {
225   u32 address;
226   u8  link_type;
227   u64 packets;
228   u64 bytes;
229 };
230
231 /**
232  * @brief Per-neighbour (i.e. per-adjacency) coutners
233  * @param count The size of the array of counters
234  * @param sw_if_index The interface the adjacency is on
235  * @param begin Flag to indicate this is the first set of stats for this
236  *        interface. If this flag is not set the it is a continuation of
237  *        stats for this interface
238  * @param  c counters
239  */
240 manual_print manual_endian define vnet_ip4_nbr_counters
241 {
242   u32 count;
243   u32 sw_if_index;
244   u8 begin;
245   vl_api_ip4_nbr_counter_t c[count];
246 };
247
248 typeonly manual_print manual_endian define ip6_fib_counter
249 {
250   u64 address[2];
251   u8 address_length;
252   u64 packets;
253   u64 bytes;
254 };
255
256 manual_print manual_endian define vnet_ip6_fib_counters
257 {
258   u32 vrf_id;
259   u32 count;
260   vl_api_ip6_fib_counter_t c[count];
261 };
262
263 typeonly manual_print manual_endian define ip6_mfib_counter
264 {
265   u8 source[16];
266   u8 group[16];
267   u8 group_length;
268   u64 packets;
269   u64 bytes;
270 };
271
272 manual_print manual_endian define vnet_ip6_mfib_counters
273 {
274   u32 vrf_id;
275   u32 count;
276   vl_api_ip6_mfib_counter_t c[count];
277 };
278
279 typeonly manual_print manual_endian define ip6_nbr_counter
280 {
281   u64 address[2];
282   u8  link_type;
283   u64 packets;
284   u64 bytes;
285 };
286
287 manual_print manual_endian define vnet_ip6_nbr_counters
288 {
289   u32 count;
290   u32 sw_if_index;
291   u8 begin;
292   vl_api_ip6_nbr_counter_t c[count];
293 };
294
295
296 /** \brief Request for a single block of summary stats
297     @param client_index - opaque cookie to identify the sender
298     @param context - sender context, to match reply w/ request
299 */
300 define vnet_get_summary_stats
301 {
302   u32 client_index;
303   u32 context;
304 };
305
306 /** \brief Reply for vnet_get_summary_stats request
307     @param context - sender context, to match reply w/ request
308     @param retval - return code for request
309     @param total_pkts -  
310     @param total_bytes -
311     @param vector_rate - 
312 */
313 define vnet_get_summary_stats_reply
314 {
315   u32 context;
316   i32 retval;
317   u64 total_pkts[2];
318   u64 total_bytes[2];
319   f64 vector_rate;
320 };
321
322 /*
323  * Local Variables:
324  * eval: (c-set-style "gnu")
325  * End:
326  */