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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 This file defines the stats API
21 option version = "1.0.2";
23 import "vnet/interface.api";
24 import "vnet/bier/bier.api";
28 returns want_stats_reply;
29 rpc want_interface_simple_stats
30 returns want_interface_simple_stats_reply
31 events vnet_interface_simple_counters;
32 rpc want_per_interface_simple_stats
33 returns want_per_interface_simple_stats_reply
34 events vnet_per_interface_simple_counters;
35 rpc want_interface_combined_stats
36 returns want_interface_combined_stats_reply
37 events vnet_interface_combined_counters;
38 rpc want_per_interface_combined_stats
39 returns want_per_interface_combined_stats_reply
40 events vnet_per_interface_combined_counters;
41 rpc want_ip4_fib_stats
42 returns want_ip4_fib_stats_reply
43 events vnet_ip4_fib_counters;
44 rpc want_ip6_fib_stats
45 returns want_ip6_fib_stats_reply
46 events vnet_ip6_fib_counters;
47 rpc want_ip4_mfib_stats
48 returns want_ip4_mfib_stats_reply
49 events vnet_ip4_mfib_counters;
50 rpc want_ip6_mfib_stats
51 returns want_ip6_mfib_stats_reply
52 events vnet_ip6_mfib_counters;
53 rpc want_ip4_nbr_stats
54 returns want_ip4_nbr_stats_reply
55 events vnet_ip4_nbr_counters;
56 rpc want_ip6_nbr_stats
57 returns want_ip6_nbr_stats_reply
58 events vnet_ip6_nbr_counters;
59 rpc want_udp_encap_stats
60 returns want_udp_encap_stats_reply
61 events vnet_udp_encap_counters;
62 rpc want_bier_neighbor_stats
63 returns want_bier_neighbor_stats_reply
64 events vnet_bier_neighbor_counters;
67 /** \brief Want Stats, enable/disable ALL stats updates
68 @param client_index - opaque cookie to identify the sender
69 @param context - sender context, to match reply w/ request
70 @param enable_disable - 1 = enable stats, 0 = disable
71 @param pid - pid of process requesting stats updates
73 autoreply define want_stats
81 /** \brief Want Interface Simple Stats, register for detailed interface stats
82 @param client_index - opaque cookie to identify the sender
83 @param context - sender context, to match reply w/ request
84 @param enable_disable - 1 = enable stats, 0 = disable
85 @param pid - pid of process requesting stats updates
87 Please consider using want_per_interface_simple_stats with sw_if_index=~0
89 autoreply define want_interface_simple_stats
97 /** \brief Want Per Interface simple Stats, register for continuous stats
98 @param client_index - opaque cookie to identify the sender
99 @param context - sender context, to match reply w/ request
100 @param enable_disable - 1 = enable stats, 0 = disable
101 @param pid - pid of process requesting stats updates
102 @param num - number of sw_if_indexes
103 @param sw_ifs - array of sw_if_index
105 autoreply define want_per_interface_simple_stats
116 /** \brief Want Interface Combined Stats, register for continuous stats
117 @param client_index - opaque cookie to identify the sender
118 @param context - sender context, to match reply w/ request
119 @param enable_disable - 1 = enable stats, 0 = disable
120 @param pid - pid of process requesting stats updates
122 Please consider using want_per_interface_combined_stats with sw_if_index=~0
125 autoreply define want_interface_combined_stats
133 /** \brief Want Per Interface Combined Stats, register for continuous stats
134 @param client_index - opaque cookie to identify the sender
135 @param context - sender context, to match reply w/ request
136 @param enable_disable - 1 = enable stats, 0 = disable
137 @param pid - pid of process requesting stats updates
138 @param num - number of sw_if_indexes
139 @param sw_ifs - array of sw_if_index
141 autoreply define want_per_interface_combined_stats
152 /** \brief Want IP4 FIB Stats, register for continuous stats
153 @param client_index - opaque cookie to identify the sender
154 @param context - sender context, to match reply w/ request
155 @param enable_disable - 1 = enable stats, 0 = disable
156 @param pid - pid of process requesting stats updates
158 autoreply define want_ip4_fib_stats
166 /** \brief Want IP6 FIB Stats, register for continuous stats
167 @param client_index - opaque cookie to identify the sender
168 @param context - sender context, to match reply w/ request
169 @param enable_disable - 1 = enable stats, 0 = disable
170 @param pid - pid of process requesting stats updates
172 autoreply define want_ip6_fib_stats
180 /** \brief Want IP4 muilticast FIB Stats, register for continuous stats
181 @param client_index - opaque cookie to identify the sender
182 @param context - sender context, to match reply w/ request
183 @param enable_disable - 1 = enable stats, 0 = disable
184 @param pid - pid of process requesting stats updates
186 autoreply define want_ip4_mfib_stats
194 /** \brief Want IP6 multicast FIB Stats, register for continuous stats
195 @param client_index - opaque cookie to identify the sender
196 @param context - sender context, to match reply w/ request
197 @param enable_disable - 1 = enable stats, 0 = disable
198 @param pid - pid of process requesting stats updates
200 autoreply define want_ip6_mfib_stats
208 /** \brief Want IP4 NBR Stats, register for continuous stats
209 @param client_index - opaque cookie to identify the sender
210 @param context - sender context, to match reply w/ request
211 @param enable_disable - 1 = enable stats, 0 = disable
212 @param pid - pid of process requesting stats updates
214 autoreply define want_ip4_nbr_stats
222 /** \brief Want IP6 NBR Stats, register for continuous stats
223 @param client_index - opaque cookie to identify the sender
224 @param context - sender context, to match reply w/ request
225 @param enable_disable - 1 = enable stats, 0 = disable
226 @param pid - pid of process requesting stats updates
228 autoreply define want_ip6_nbr_stats
236 typeonly manual_print manual_endian define ip4_fib_counter
244 manual_print manual_endian define vnet_ip4_fib_counters
248 vl_api_ip4_fib_counter_t c[count];
251 typeonly manual_print manual_endian define ip4_mfib_counter
260 manual_print manual_endian define vnet_ip4_mfib_counters
264 vl_api_ip4_mfib_counter_t c[count];
267 typeonly manual_print manual_endian define ip4_nbr_counter
276 * @brief Per-neighbour (i.e. per-adjacency) coutners
277 * @param count The size of the array of counters
278 * @param sw_if_index The interface the adjacency is on
279 * @param begin Flag to indicate this is the first set of stats for this
280 * interface. If this flag is not set the it is a continuation of
281 * stats for this interface
284 manual_print manual_endian define vnet_ip4_nbr_counters
289 vl_api_ip4_nbr_counter_t c[count];
292 typeonly manual_print manual_endian define ip6_fib_counter
300 manual_print manual_endian define vnet_ip6_fib_counters
304 vl_api_ip6_fib_counter_t c[count];
307 typeonly manual_print manual_endian define ip6_mfib_counter
316 manual_print manual_endian define vnet_ip6_mfib_counters
320 vl_api_ip6_mfib_counter_t c[count];
323 typeonly manual_print manual_endian define ip6_nbr_counter
331 manual_print manual_endian define vnet_ip6_nbr_counters
336 vl_api_ip6_nbr_counter_t c[count];
339 /** \brief Simple stats counters structure
340 @param vnet_counter_type- such as ip4, ip6, punts, etc
341 @param first_sw_if_index - first sw index in block of index, counts
342 @param count - number of counters, equal to the number of interfaces in
344 @param data - contiguous block of u64 counters
346 vnet_counter_type defined in enums - plural - in vnet/interface.h
348 manual_print manual_endian define vnet_interface_simple_counters
350 u8 vnet_counter_type;
351 u32 first_sw_if_index;
356 /** \brief Combined stats counters structure
357 @param vnet_counter_type- such as ip4, ip6, punts, etc
358 @param first_sw_if_index - first sw index in block of index, counts
359 @param count - number of counters, equal to the number of interfaces in
361 @param data - contiguous block of vlib_counter_t structures
363 vnet_counter_type defined in enums - plural - in vnet/interface.h
365 manual_print manual_endian define vnet_interface_combined_counters
367 u8 vnet_counter_type;
368 u32 first_sw_if_index;
370 vl_api_vlib_counter_t data[count];
373 /** \brief Simple per interface stats counters structure
374 @param count - number of elements in message
375 @param timestamp - u32 vlib timestamp for control plane
376 @param data[count] - vl_api_vnet_simple_counter_t
379 manual_print manual_endian define vnet_per_interface_simple_counters
383 vl_api_vnet_simple_counter_t data[count];
386 /** \brief Combined stats counters structure per interface
387 @param count - number of elements in message
388 @param timestamp - u32 vlib timestamp for control plane
389 @param data[count] - vl_api_vnet_combined_counter_t
391 manual_print manual_endian define vnet_per_interface_combined_counters
395 vl_api_vnet_combined_counter_t data[count];
398 /** \brief Request for a single block of summary stats
399 @param client_index - opaque cookie to identify the sender
400 @param context - sender context, to match reply w/ request
402 define vnet_get_summary_stats
408 /** \brief Reply for vnet_get_summary_stats request
409 @param context - sender context, to match reply w/ request
410 @param retval - return code for request
411 @param total_pkts - length of the array must match the length of
412 the combined counter part of the enum in interface.h
413 @param total_bytes - length of the array must match the length of
414 the combined counter part of the enum in interface.h
417 define vnet_get_summary_stats_reply
426 /** \brief Get delay between polling statistics
427 @param client_index - opaque cookie to identify the sender
428 @param context - sender context, to match reply w/ request
430 define stats_get_poller_delay
436 /** \brief Get delay between polling statistics reply
437 @param context - sender context, to match reply w/ request
438 @param retval - return code for request
439 @param delay - poller delay
441 define stats_get_poller_delay_reply
448 /** \brief Want UDP encap Stats, register for continuous stats
449 @param client_index - opaque cookie to identify the sender
450 @param context - sender context, to match reply w/ request
451 @param enable - 1 = enable stats, 0 = disable
452 @param pid - pid of process requesting stats updates
454 autoreply define want_udp_encap_stats
462 /** \brief Stat for one UDP encap object
463 @param id - The ID of the object, same as passed for the create
464 @param packets - number of packets sent
465 @param bytes - number of bytes sent
467 typeonly manual_print manual_endian define udp_encap_counter
474 manual_print manual_endian define vnet_udp_encap_counters
478 vl_api_udp_encap_counter_t c[count];
481 /** \brief Want BIER neighbor Stats, register for continuous stats
482 @param client_index - opaque cookie to identify the sender
483 @param context - sender context, to match reply w/ request
484 @param enable - 1 = enable stats, 0 = disable
485 @param pid - pid of process requesting stats updates
487 autoreply define want_bier_neighbor_stats
495 /** \brief Stat for one BIER neighbor object
496 @param tbl_id - The BIER Table ID the neighbour belongs to.
497 @param path - The path describing the negihbor (this is the data
498 given during a BIER route add)
499 @param packets - number of packets sent
500 @param bytes - number of bytes sent
502 typeonly manual_print manual_endian define bier_neighbor_counter
504 vl_api_bier_table_id_t tbl_id;
505 vl_api_fib_path_t path;
510 manual_print manual_endian define vnet_bier_neighbor_counters
514 vl_api_bier_neighbor_counter_t c[count];
519 * eval: (c-set-style "gnu")