blob: a6fd5ad60d4e53008637ebff2cfcb9a447315159 [file] [log] [blame]
Dave Barach0d056e52017-09-28 15:11:16 -04001vl_api_version 1.0.0
2
Dave Barachaff70772016-10-31 11:59:07 -04003/** \brief Set flags on the interface
4 @param client_index - opaque cookie to identify the sender
5 @param context - sender context, to match reply w/ request
6 @param sw_if_index - index of the interface to set flags on
7 @param admin_up_down - set the admin state, 1 = up, 0 = down
8 @param link_up_down - Oper state sent on change event, not used in config.
Dave Barachaff70772016-10-31 11:59:07 -04009*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040010autoreply define sw_interface_set_flags
Dave Barachaff70772016-10-31 11:59:07 -040011{
12 u32 client_index;
13 u32 context;
14 u32 sw_if_index;
15 /* 1 = up, 0 = down */
16 u8 admin_up_down;
Dave Barachaff70772016-10-31 11:59:07 -040017};
18
Matus Fabiand162f3d2016-12-05 01:05:35 -080019/** \brief Set interface MTU
20 @param client_index - opaque cookie to identify the sender
21 @param context - sender context, to match reply w/ request
22 @param sw_if_index - index of the interface to set MTU on
23 @param mtu - MTU
24*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040025autoreply define sw_interface_set_mtu
Matus Fabiand162f3d2016-12-05 01:05:35 -080026{
27 u32 client_index;
28 u32 context;
29 u32 sw_if_index;
30 u16 mtu;
31};
32
Neale Rannsa07bd702017-08-07 07:53:49 -070033/** \brief Interface Event generated by want_interface_events
Neale Rannsd292ab12017-08-15 12:29:48 -070034 @param client_index - opaque cookie to identify the sender
35 @param pid - client pid registered to receive notification
Neale Rannsa07bd702017-08-07 07:53:49 -070036 @param sw_if_index - index of the interface of the event
37 @param admin_up_down - The administrative state; 1 = up, 0 = down
38 @param link_up_down - The operational state; 1 = up, 0 = down
39 @param deleted - interface was deleted
40*/
41define sw_interface_event
42{
Neale Rannsd292ab12017-08-15 12:29:48 -070043 u32 client_index;
44 u32 pid;
Neale Rannsa07bd702017-08-07 07:53:49 -070045 u32 sw_if_index;
46 u8 admin_up_down;
47 u8 link_up_down;
48 u8 deleted;
49};
50
Dave Barach6d963c22016-12-05 09:50:05 -050051/** \brief Register for interface events
52 @param client_index - opaque cookie to identify the sender
53 @param context - sender context, to match reply w/ request
54 @param enable_disable - 1 => register for events, 0 => cancel registration
55 @param pid - sender's pid
56*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040057autoreply define want_interface_events
Dave Barach6d963c22016-12-05 09:50:05 -050058{
59 u32 client_index;
60 u32 context;
61 u32 enable_disable;
62 u32 pid;
63};
64
Dave Barach6d963c22016-12-05 09:50:05 -050065/** \brief Interface details structure (fix this)
66 @param sw_if_index - index of the interface
67 @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index
68 @param l2_address_length - length of the interface's l2 address
69 @param pid - the interface's l2 address
70 @param interface_name - name of the interface
71 @param link_duplex - 1 if half duplex, 2 if full duplex
72 @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G
Pavel Kotucek65e84572017-01-16 17:01:56 +010073 @param link_MTU - max. transmittion unit
Dave Barach6d963c22016-12-05 09:50:05 -050074 @param sub_if_id - A number 0-N to uniquely identify this subif on super if
Pavel Kotucek65e84572017-01-16 17:01:56 +010075 @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
76 @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
Dave Barach6d963c22016-12-05 09:50:05 -050077 @param sub_number_of_tags - Number of tags (0 - 2)
78 @param sub_outer_vlan_id
79 @param sub_inner_vlan_id
80 @param sub_exact_match
81 @param sub_default
82 @param sub_outer_vlan_id_any
83 @param sub_inner_vlan_id_any
84 @param vtr_op - vlan tag rewrite operation
85 @param vtr_push_dot1q
86 @param vtr_tag1
87 @param vtr_tag2
Pavel Kotucek65e84572017-01-16 17:01:56 +010088 @param pbb_outer_tag - translate pbb s-tag
89 @param pbb_b_dmac[6] - B-tag remote mac address
90 @param pbb_b_smac[6] - B-tag local mac address
91 @param pbb_b_vlanid - B-tag vlanid
92 @param pbb_i_sid - I-tag service id
Dave Barach6d963c22016-12-05 09:50:05 -050093*/
94define sw_interface_details
95{
96 u32 context;
97 u32 sw_if_index;
98
99 /* index of sup interface (e.g. hw interface).
100 equal to sw_if_index for super hw interface. */
101 u32 sup_sw_if_index;
102
103 /* Layer 2 address, if applicable */
104 u32 l2_address_length;
105 u8 l2_address[8];
106
107 /* Interface name */
108 u8 interface_name[64];
109
110 /* 1 = up, 0 = down */
111 u8 admin_up_down;
112 u8 link_up_down;
113
114 /* 1 = half duplex, 2 = full duplex */
115 u8 link_duplex;
116
117 /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
118 u8 link_speed;
119
120 /* MTU */
121 u16 link_mtu;
122
123 /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
124 u32 sub_id;
125
126 /* 0 = dot1q, 1=dot1ad */
127 u8 sub_dot1ad;
Pavel Kotucek65e84572017-01-16 17:01:56 +0100128 /* 1 = dot1h, 1=otherwise */
129 u8 sub_dot1ah;
Dave Barach6d963c22016-12-05 09:50:05 -0500130
131 /* Number of tags 0-2 */
132 u8 sub_number_of_tags;
133 u16 sub_outer_vlan_id;
134 u16 sub_inner_vlan_id;
135 u8 sub_exact_match;
136 u8 sub_default;
137 u8 sub_outer_vlan_id_any;
138 u8 sub_inner_vlan_id_any;
139
140 /* vlan tag rewrite state */
141 u32 vtr_op;
142 u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
143 u32 vtr_tag1; // first pushed tag
144 u32 vtr_tag2; // second pushed tag
145 u8 tag[64];
Pavel Kotucek65e84572017-01-16 17:01:56 +0100146
147 /* pbb tag rewrite info */
148 u16 outer_tag;
149 u8 b_dmac[6];
150 u8 b_smac[6];
151 u16 b_vlanid;
152 u32 i_sid;
Dave Barach6d963c22016-12-05 09:50:05 -0500153};
154
155/* works */
156define sw_interface_dump
157{
158 u32 client_index;
159 u32 context;
160 u8 name_filter_valid;
161 u8 name_filter[49];
162};
163
164/** \brief Set or delete one or all ip addresses on a specified interface
165 @param client_index - opaque cookie to identify the sender
166 @param context - sender context, to match reply w/ request
167 @param sw_if_index - index of the interface to add/del addresses
168 @param is_add - add address if non-zero, else delete
169 @param is_ipv6 - if non-zero the address is ipv6, else ipv4
170 @param del_all - if non-zero delete all addresses on the interface
171 @param address_length - address length in bytes, 4 for ip4, 16 for ip6
172 @param address - array of address bytes
173*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400174autoreply define sw_interface_add_del_address
Dave Barach6d963c22016-12-05 09:50:05 -0500175{
176 u32 client_index;
177 u32 context;
178 u32 sw_if_index;
179 u8 is_add;
180 u8 is_ipv6;
181 u8 del_all;
182 u8 address_length;
183 u8 address[16];
184};
185
Dave Barach6d963c22016-12-05 09:50:05 -0500186/** \brief Associate the specified interface with a fib table
187 @param client_index - opaque cookie to identify the sender
188 @param context - sender context, to match reply w/ request
189 @param sw_if_index - index of the interface
190 @param is_ipv6 - if non-zero ipv6, else ipv4
191 @param vrf_id - fib table/vrd id to associate the interface with
192*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400193autoreply define sw_interface_set_table
Dave Barach6d963c22016-12-05 09:50:05 -0500194{
195 u32 client_index;
196 u32 context;
197 u32 sw_if_index;
198 u8 is_ipv6;
199 u32 vrf_id;
200};
201
Juraj Slobodadfc19232016-12-05 13:20:37 +0100202/** \brief Get VRF id assigned to interface
203 @param client_index - opaque cookie to identify the sender
204 @param context - sender context, to match reply w/ request
205 @param sw_if_index - index of the interface
206*/
207define sw_interface_get_table
208{
209 u32 client_index;
210 u32 context;
211 u32 sw_if_index;
212 u8 is_ipv6;
213};
214
215/** \brief Reply to get_sw_interface_vrf
216 @param context - sender context which was passed in the request
217 @param vrf_id - VRF id assigned to the interface
218*/
219define sw_interface_get_table_reply
220{
221 u32 context;
222 i32 retval;
223 u32 vrf_id;
224};
225
Aloys Augustinee551982017-02-17 14:55:29 +0100226typeonly manual_print manual_endian define vlib_counter
227{
228 u64 packets; /**< packet counter */
229 u64 bytes; /**< byte counter */
230};
231
Keith Burns (alagalah)831fb592017-09-12 15:12:17 -0700232/** \brief Combined interface counter data type for vnet_interface_combined_counters
233 @param sw_if_index - interface indexes for counters
234 @param rx_packets - received packet count
235 @param rx_bytes - received byte count
236 @param tx_packets - transmitted packet count
237 @param tx_bytes - transmitted byte count
238
239*/
240typeonly manual_print manual_endian define vnet_combined_counter
241{
242 u32 sw_if_index;
243 u64 rx_packets; /**< packet counter */
244 u64 rx_bytes; /**< byte counter */
245 u64 tx_packets; /**< packet counter */
246 u64 tx_bytes; /**< byte counter */
247};
248
249/** \brief Simple interface counter data type for vnet_interface_simple_counters
250 @param sw_if_index - interface indexes for counters
251 @param drop - RX or TX drops due to buffer starvation
252 @param punt - used with VNET "punt" disposition
253 @param rx_ip4 - received IP4 packets
254 @param rx_ip6 - received IP6 packets
255 @param rx_no_buffer - no RX buffers available
256 @param rx_miss - receive misses
257 @param rx_error - receive errors
258 @param tx_error - transmit errors
259 @param rx_mpls - received MPLS packet
260
261*/
262typeonly manual_print manual_endian define vnet_simple_counter
263{
264 u32 sw_if_index;
265 u64 drop;
266 u64 punt;
267 u64 rx_ip4;
268 u64 rx_ip6;
269 u64 rx_no_buffer;
270 u64 rx_miss;
271 u64 rx_error;
272 u64 tx_error;
273 u64 rx_mpls;
274};
275
Aloys Augustinee551982017-02-17 14:55:29 +0100276/** \brief Simple stats counters structure
Dave Barach6d963c22016-12-05 09:50:05 -0500277 @param vnet_counter_type- such as ip4, ip6, punts, etc
Dave Barach6d963c22016-12-05 09:50:05 -0500278 @param first_sw_if_index - first sw index in block of index, counts
Aloys Augustinee551982017-02-17 14:55:29 +0100279 @param count - number of counters, equal to the number of interfaces in
280 this stats block
281 @param data - contiguous block of u64 counters
Keith Burns (alagalah)831fb592017-09-12 15:12:17 -0700282
283 vnet_counter_type defined in enums - plural - in vnet/interface.h
Dave Barach6d963c22016-12-05 09:50:05 -0500284*/
Aloys Augustinee551982017-02-17 14:55:29 +0100285manual_print manual_endian define vnet_interface_simple_counters
Dave Barach6d963c22016-12-05 09:50:05 -0500286{
Dave Barach6d963c22016-12-05 09:50:05 -0500287 u8 vnet_counter_type;
Dave Barach6d963c22016-12-05 09:50:05 -0500288 u32 first_sw_if_index;
289 u32 count;
Aloys Augustinee551982017-02-17 14:55:29 +0100290 u64 data[count];
291};
292
293/** \brief Combined stats counters structure
294 @param vnet_counter_type- such as ip4, ip6, punts, etc
295 @param first_sw_if_index - first sw index in block of index, counts
296 @param count - number of counters, equal to the number of interfaces in
297 this stats block
298 @param data - contiguous block of vlib_counter_t structures
Keith Burns (alagalah)831fb592017-09-12 15:12:17 -0700299
300 vnet_counter_type defined in enums - plural - in vnet/interface.h
Aloys Augustinee551982017-02-17 14:55:29 +0100301*/
302manual_print manual_endian define vnet_interface_combined_counters
303{
Aloys Augustinee551982017-02-17 14:55:29 +0100304 u8 vnet_counter_type;
305 u32 first_sw_if_index;
306 u32 count;
307 vl_api_vlib_counter_t data[count];
Dave Barach6d963c22016-12-05 09:50:05 -0500308};
309
Keith Burns (alagalah)831fb592017-09-12 15:12:17 -0700310
311/** \brief Simple per interface stats counters structure
312 @param count - number of elements in message
313 @param timestamp - u32 vlib timestamp for control plane
314 @param data[count] - vl_api_vnet_simple_counter_t
315
316*/
317manual_print manual_endian define vnet_per_interface_simple_counters
318{
319 u32 count;
320 u32 timestamp;
321 vl_api_vnet_simple_counter_t data[count];
322};
323
324/** \brief Combined stats counters structure per interface
325 @param count - number of elements in message
326 @param timestamp - u32 vlib timestamp for control plane
327 @param data[count] - vl_api_vnet_combined_counter_t
328*/
329manual_print manual_endian define vnet_per_interface_combined_counters
330{
331 u32 count;
332 u32 timestamp;
333 vl_api_vnet_combined_counter_t data[count];
334};
335
Dave Barach6d963c22016-12-05 09:50:05 -0500336/** \brief Set unnumbered interface add / del request
337 @param client_index - opaque cookie to identify the sender
338 @param context - sender context, to match reply w/ request
339 @param sw_if_index - interface with an IP address
340 @param unnumbered_sw_if_index - interface which will use the address
341 @param is_add - if non-zero set the association, else unset it
342*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400343autoreply define sw_interface_set_unnumbered
Dave Barach6d963c22016-12-05 09:50:05 -0500344{
345 u32 client_index;
346 u32 context;
347 u32 sw_if_index; /* use this intfc address */
348 u32 unnumbered_sw_if_index; /* on this interface */
349 u8 is_add;
350};
351
Dave Barach6d963c22016-12-05 09:50:05 -0500352/** \brief Clear interface statistics
353 @param client_index - opaque cookie to identify the sender
354 @param context - sender context, to match reply w/ request
355 @param sw_if_index - index of the interface to clear statistics
356*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400357autoreply define sw_interface_clear_stats
Dave Barach6d963c22016-12-05 09:50:05 -0500358{
359 u32 client_index;
360 u32 context;
361 u32 sw_if_index;
362};
363
Dave Barach6d963c22016-12-05 09:50:05 -0500364/** \brief Set / clear software interface tag
365 @param client_index - opaque cookie to identify the sender
366 @param context - sender context, to match reply w/ request
367 @param sw_if_index - the interface
368 @param add_del - 1 = add, 0 = delete
369 @param tag - an ascii tag
370*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400371autoreply define sw_interface_tag_add_del
Dave Barach6d963c22016-12-05 09:50:05 -0500372{
373 u32 client_index;
374 u32 context;
375 u8 is_add;
376 u32 sw_if_index;
377 u8 tag[64];
378};
379
Jon Loeliger10c273b2017-03-30 08:39:33 -0500380/** \brief Set an interface's MAC address
381 @param client_index - opaque cookie to identify the sender
382 @param context - sender context, to match reply w/ request
383 @param sw_if_index - the interface whose MAC will be set
384 @param mac_addr - the new MAC address
385*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400386autoreply define sw_interface_set_mac_address
Jon Loeliger10c273b2017-03-30 08:39:33 -0500387{
388 u32 client_index;
389 u32 context;
390 u32 sw_if_index;
391 u8 mac_address[6];
392};
393
Stevenad8015b2017-10-29 22:10:46 -0700394/** \brief Set an interface's rx-mode
395 @param client_index - opaque cookie to identify the sender
396 @param context - sender context, to match reply w/ request
397 @param sw_if_index - the interface whose rx-mode will be set
398 @param queue_id_valid - 1 = the queue_id field is valid. 0 means all
399 queue_id's
400 @param queue_id - the queue number whose rx-mode will be set. Only valid
401 if queue_id_valid is 1
402 @param mode - polling=1, interrupt=2, adaptive=3
403*/
404autoreply define sw_interface_set_rx_mode
405{
406 u32 client_index;
407 u32 context;
408 u32 sw_if_index;
409 u8 queue_id_valid;
410 u32 queue_id;
411 u8 mode;
412};
413
Dave Barach6d963c22016-12-05 09:50:05 -0500414/*
415 * Local Variables:
416 * eval: (c-set-style "gnu")
417 * End:
418 */