vppapigen: support per-file (major,minor,patch) version stamps
[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 vl_api_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 NBR 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_nbr_stats
143 {
144   u32 client_index;
145   u32 context;
146   u32 enable_disable;
147   u32 pid;
148 };
149
150 /** \brief Want IP6 NBR 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_nbr_stats
157 {
158   u32 client_index;
159   u32 context;
160   u32 enable_disable;
161   u32 pid;
162 };
163
164 typeonly manual_print manual_endian define ip4_fib_counter
165 {
166   u32 address;
167   u8 address_length;
168   u64 packets;
169   u64 bytes;
170 };
171
172 manual_print manual_endian define vnet_ip4_fib_counters
173 {
174   u32 vrf_id;
175   u32 count;
176   vl_api_ip4_fib_counter_t c[count];
177 };
178
179 typeonly manual_print manual_endian define ip4_nbr_counter
180 {
181   u32 address;
182   u8  link_type;
183   u64 packets;
184   u64 bytes;
185 };
186
187 /**
188  * @brief Per-neighbour (i.e. per-adjacency) coutners
189  * @param count The size of the array of counters
190  * @param sw_if_index The interface the adjacency is on
191  * @param begin Flag to indicate this is the first set of stats for this
192  *        interface. If this flag is not set the it is a continuation of
193  *        stats for this interface
194  * @param  c counters
195  */
196 manual_print manual_endian define vnet_ip4_nbr_counters
197 {
198   u32 count;
199   u32 sw_if_index;
200   u8 begin;
201   vl_api_ip4_nbr_counter_t c[count];
202 };
203
204 typeonly manual_print manual_endian define ip6_fib_counter
205 {
206   u64 address[2];
207   u8 address_length;
208   u64 packets;
209   u64 bytes;
210 };
211
212 manual_print manual_endian define vnet_ip6_fib_counters
213 {
214   u32 vrf_id;
215   u32 count;
216   vl_api_ip6_fib_counter_t c[count];
217 };
218
219 typeonly manual_print manual_endian define ip6_nbr_counter
220 {
221   u64 address[2];
222   u8  link_type;
223   u64 packets;
224   u64 bytes;
225 };
226
227 manual_print manual_endian define vnet_ip6_nbr_counters
228 {
229   u32 count;
230   u32 sw_if_index;
231   u8 begin;
232   vl_api_ip6_nbr_counter_t c[count];
233 };
234
235
236 /** \brief Request for a single block of summary stats
237     @param client_index - opaque cookie to identify the sender
238     @param context - sender context, to match reply w/ request
239 */
240 define vnet_get_summary_stats
241 {
242   u32 client_index;
243   u32 context;
244 };
245
246 /** \brief Reply for vnet_get_summary_stats request
247     @param context - sender context, to match reply w/ request
248     @param retval - return code for request
249     @param total_pkts -  
250     @param total_bytes -
251     @param vector_rate - 
252 */
253 define vnet_get_summary_stats_reply
254 {
255   u32 context;
256   i32 retval;
257   u64 total_pkts[2];
258   u64 total_bytes[2];
259   f64 vector_rate;
260 };
261
262 /*
263  * Local Variables:
264  * eval: (c-set-style "gnu")
265  * End:
266  */