Allow individual stats API and introduce stats.api
[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 autoreply define want_interface_simple_stats
43 {
44   u32 client_index;
45   u32 context;
46   u32 enable_disable;
47   u32 pid;
48 };
49
50 /** \brief Want Interface Combined Stats, register for continuous stats
51     @param client_index - opaque cookie to identify the sender
52     @param context - sender context, to match reply w/ request
53     @param enable_disable - 1 = enable stats, 0 = disable
54     @param pid - pid of process requesting stats updates
55 */
56 autoreply define want_interface_combined_stats
57 {
58   u32 client_index;
59   u32 context;
60   u32 enable_disable;
61   u32 pid;
62 };
63
64 /** \brief Want IP4 FIB Stats, register for continuous stats
65     @param client_index - opaque cookie to identify the sender
66     @param context - sender context, to match reply w/ request
67     @param enable_disable - 1 = enable stats, 0 = disable
68     @param pid - pid of process requesting stats updates
69 */
70 autoreply define want_ip4_fib_stats
71 {
72   u32 client_index;
73   u32 context;
74   u32 enable_disable;
75   u32 pid;
76 };
77
78 /** \brief Want IP6 FIB Stats, register for continuous stats
79     @param client_index - opaque cookie to identify the sender
80     @param context - sender context, to match reply w/ request
81     @param enable_disable - 1 = enable stats, 0 = disable
82     @param pid - pid of process requesting stats updates
83 */
84 autoreply define want_ip6_fib_stats
85 {
86   u32 client_index;
87   u32 context;
88   u32 enable_disable;
89   u32 pid;
90 };
91
92 /** \brief Want IP4 NBR Stats, register for continuous stats
93     @param client_index - opaque cookie to identify the sender
94     @param context - sender context, to match reply w/ request
95     @param enable_disable - 1 = enable stats, 0 = disable
96     @param pid - pid of process requesting stats updates
97 */
98 autoreply define want_ip4_nbr_stats
99 {
100   u32 client_index;
101   u32 context;
102   u32 enable_disable;
103   u32 pid;
104 };
105
106 /** \brief Want IP6 NBR Stats, register for continuous stats
107     @param client_index - opaque cookie to identify the sender
108     @param context - sender context, to match reply w/ request
109     @param enable_disable - 1 = enable stats, 0 = disable
110     @param pid - pid of process requesting stats updates
111 */
112 autoreply define want_ip6_nbr_stats
113 {
114   u32 client_index;
115   u32 context;
116   u32 enable_disable;
117   u32 pid;
118 };
119
120 typeonly manual_print manual_endian define ip4_fib_counter
121 {
122   u32 address;
123   u8 address_length;
124   u64 packets;
125   u64 bytes;
126 };
127
128 manual_print manual_endian define vnet_ip4_fib_counters
129 {
130   u32 vrf_id;
131   u32 count;
132   vl_api_ip4_fib_counter_t c[count];
133 };
134
135 typeonly manual_print manual_endian define ip4_nbr_counter
136 {
137   u32 address;
138   u8  link_type;
139   u64 packets;
140   u64 bytes;
141 };
142
143 /**
144  * @brief Per-neighbour (i.e. per-adjacency) coutners
145  * @param count The size of the array of counters
146  * @param sw_if_index The interface the adjacency is on
147  * @param begin Flag to indicate this is the first set of stats for this
148  *        interface. If this flag is not set the it is a continuation of
149  *        stats for this interface
150  * @param  c counters
151  */
152 manual_print manual_endian define vnet_ip4_nbr_counters
153 {
154   u32 count;
155   u32 sw_if_index;
156   u8 begin;
157   vl_api_ip4_nbr_counter_t c[count];
158 };
159
160 typeonly manual_print manual_endian define ip6_fib_counter
161 {
162   u64 address[2];
163   u8 address_length;
164   u64 packets;
165   u64 bytes;
166 };
167
168 manual_print manual_endian define vnet_ip6_fib_counters
169 {
170   u32 vrf_id;
171   u32 count;
172   vl_api_ip6_fib_counter_t c[count];
173 };
174
175 typeonly manual_print manual_endian define ip6_nbr_counter
176 {
177   u64 address[2];
178   u8  link_type;
179   u64 packets;
180   u64 bytes;
181 };
182
183 manual_print manual_endian define vnet_ip6_nbr_counters
184 {
185   u32 count;
186   u32 sw_if_index;
187   u8 begin;
188   vl_api_ip6_nbr_counter_t c[count];
189 };
190
191
192 /** \brief Request for a single block of summary stats
193     @param client_index - opaque cookie to identify the sender
194     @param context - sender context, to match reply w/ request
195 */
196 define vnet_get_summary_stats
197 {
198   u32 client_index;
199   u32 context;
200 };
201
202 /** \brief Reply for vnet_get_summary_stats request
203     @param context - sender context, to match reply w/ request
204     @param retval - return code for request
205     @param total_pkts -  
206     @param total_bytes -
207     @param vector_rate - 
208 */
209 define vnet_get_summary_stats_reply
210 {
211   u32 context;
212   i32 retval;
213   u64 total_pkts[2];
214   u64 total_bytes[2];
215   f64 vector_rate;
216 };
217
218 /*
219  * Local Variables:
220  * eval: (c-set-style "gnu")
221  * End:
222  */