blob: 1af323e0a44446b590514bd7dc5f25f0b8f8b76e [file] [log] [blame]
Ole Troan53fffa12018-11-13 12:36:56 +01001/* Hey Emacs use -*- mode: C -*- */
2/*
3 * Copyright (c) 2018 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Damjan Marion5100aa92018-11-08 15:30:16 +010017option version = "2.2.0";
Dave Barach0d056e52017-09-28 15:11:16 -040018
Ole Troan53fffa12018-11-13 12:36:56 +010019import "vnet/interface_types.api";
20
Marek Gradzki51e59682018-03-06 10:05:44 +010021service {
22 rpc want_interface_events returns want_interface_events_reply
23 events sw_interface_event;
24};
25
Dave Barachaff70772016-10-31 11:59:07 -040026/** \brief Set flags on the interface
27 @param client_index - opaque cookie to identify the sender
28 @param context - sender context, to match reply w/ request
29 @param sw_if_index - index of the interface to set flags on
30 @param admin_up_down - set the admin state, 1 = up, 0 = down
31 @param link_up_down - Oper state sent on change event, not used in config.
Dave Barachaff70772016-10-31 11:59:07 -040032*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040033autoreply define sw_interface_set_flags
Dave Barachaff70772016-10-31 11:59:07 -040034{
35 u32 client_index;
36 u32 context;
37 u32 sw_if_index;
38 /* 1 = up, 0 = down */
39 u8 admin_up_down;
Dave Barachaff70772016-10-31 11:59:07 -040040};
41
Ole Troand7231612018-06-07 10:17:57 +020042/** \brief Set interface physical MTU
Matus Fabiand162f3d2016-12-05 01:05:35 -080043 @param client_index - opaque cookie to identify the sender
44 @param context - sender context, to match reply w/ request
45 @param sw_if_index - index of the interface to set MTU on
46 @param mtu - MTU
47*/
Ole Troand7231612018-06-07 10:17:57 +020048autoreply define hw_interface_set_mtu
Matus Fabiand162f3d2016-12-05 01:05:35 -080049{
50 u32 client_index;
51 u32 context;
52 u32 sw_if_index;
53 u16 mtu;
54};
55
Ole Troand7231612018-06-07 10:17:57 +020056/** \brief Set interface L3 MTU */
57autoreply define sw_interface_set_mtu
58{
59 u32 client_index;
60 u32 context;
61 u32 sw_if_index;
62 /* $$$$ Replace with enum */
63 u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
64};
65
Neale Ranns1855b8e2018-07-11 10:31:26 -070066/** \brief Set IP4 directed broadcast
67 The directed broadcast enabled a packet sent to the interface's
68 subnet address will be broadcast on the interface
69 @param sw_if_index
70 @param enable
71*/
72autoreply define sw_interface_set_ip_directed_broadcast
73{
74 u32 client_index;
75 u32 context;
76 u32 sw_if_index;
77 u8 enable;
78};
79
Ole Troand7231612018-06-07 10:17:57 +020080
Neale Rannsa07bd702017-08-07 07:53:49 -070081/** \brief Interface Event generated by want_interface_events
Neale Rannsd292ab12017-08-15 12:29:48 -070082 @param client_index - opaque cookie to identify the sender
83 @param pid - client pid registered to receive notification
Neale Rannsa07bd702017-08-07 07:53:49 -070084 @param sw_if_index - index of the interface of the event
85 @param admin_up_down - The administrative state; 1 = up, 0 = down
86 @param link_up_down - The operational state; 1 = up, 0 = down
87 @param deleted - interface was deleted
88*/
89define sw_interface_event
90{
Neale Rannsd292ab12017-08-15 12:29:48 -070091 u32 client_index;
92 u32 pid;
Neale Rannsa07bd702017-08-07 07:53:49 -070093 u32 sw_if_index;
94 u8 admin_up_down;
95 u8 link_up_down;
96 u8 deleted;
97};
98
Dave Barach6d963c22016-12-05 09:50:05 -050099/** \brief Register for interface events
100 @param client_index - opaque cookie to identify the sender
101 @param context - sender context, to match reply w/ request
102 @param enable_disable - 1 => register for events, 0 => cancel registration
103 @param pid - sender's pid
104*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400105autoreply define want_interface_events
Dave Barach6d963c22016-12-05 09:50:05 -0500106{
107 u32 client_index;
108 u32 context;
109 u32 enable_disable;
110 u32 pid;
111};
112
Dave Barach6d963c22016-12-05 09:50:05 -0500113/** \brief Interface details structure (fix this)
114 @param sw_if_index - index of the interface
115 @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index
116 @param l2_address_length - length of the interface's l2 address
117 @param pid - the interface's l2 address
118 @param interface_name - name of the interface
119 @param link_duplex - 1 if half duplex, 2 if full duplex
Damjan Marion5100aa92018-11-08 15:30:16 +0100120 @param link_speed - value in kbps
Paul Vinciguerrabdc0e6b2018-09-22 05:32:50 -0700121 @param link_MTU - max. transmission unit
Dave Barach6d963c22016-12-05 09:50:05 -0500122 @param sub_if_id - A number 0-N to uniquely identify this subif on super if
Pavel Kotucek65e84572017-01-16 17:01:56 +0100123 @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
124 @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
Dave Barach6d963c22016-12-05 09:50:05 -0500125 @param sub_number_of_tags - Number of tags (0 - 2)
126 @param sub_outer_vlan_id
127 @param sub_inner_vlan_id
128 @param sub_exact_match
129 @param sub_default
130 @param sub_outer_vlan_id_any
131 @param sub_inner_vlan_id_any
132 @param vtr_op - vlan tag rewrite operation
133 @param vtr_push_dot1q
134 @param vtr_tag1
135 @param vtr_tag2
Pavel Kotucek65e84572017-01-16 17:01:56 +0100136 @param pbb_outer_tag - translate pbb s-tag
137 @param pbb_b_dmac[6] - B-tag remote mac address
138 @param pbb_b_smac[6] - B-tag local mac address
139 @param pbb_b_vlanid - B-tag vlanid
140 @param pbb_i_sid - I-tag service id
Dave Barach6d963c22016-12-05 09:50:05 -0500141*/
142define sw_interface_details
143{
144 u32 context;
145 u32 sw_if_index;
146
147 /* index of sup interface (e.g. hw interface).
148 equal to sw_if_index for super hw interface. */
149 u32 sup_sw_if_index;
150
151 /* Layer 2 address, if applicable */
152 u32 l2_address_length;
153 u8 l2_address[8];
154
155 /* Interface name */
156 u8 interface_name[64];
157
158 /* 1 = up, 0 = down */
159 u8 admin_up_down;
160 u8 link_up_down;
161
162 /* 1 = half duplex, 2 = full duplex */
163 u8 link_duplex;
164
Damjan Marion5100aa92018-11-08 15:30:16 +0100165 /* link speed in kbps */
166 u32 link_speed;
Dave Barach6d963c22016-12-05 09:50:05 -0500167
168 /* MTU */
Damjan Marionfe7d4a22018-04-13 19:43:39 +0200169 u16 link_mtu;
Dave Barach6d963c22016-12-05 09:50:05 -0500170
Ole Troand7231612018-06-07 10:17:57 +0200171 /* Per protocol MTUs */
172 u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
173
Dave Barach6d963c22016-12-05 09:50:05 -0500174 /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
175 u32 sub_id;
176
177 /* 0 = dot1q, 1=dot1ad */
178 u8 sub_dot1ad;
Pavel Kotucek65e84572017-01-16 17:01:56 +0100179 /* 1 = dot1h, 1=otherwise */
180 u8 sub_dot1ah;
Dave Barach6d963c22016-12-05 09:50:05 -0500181
182 /* Number of tags 0-2 */
183 u8 sub_number_of_tags;
184 u16 sub_outer_vlan_id;
185 u16 sub_inner_vlan_id;
186 u8 sub_exact_match;
187 u8 sub_default;
188 u8 sub_outer_vlan_id_any;
189 u8 sub_inner_vlan_id_any;
190
191 /* vlan tag rewrite state */
192 u32 vtr_op;
193 u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
194 u32 vtr_tag1; // first pushed tag
195 u32 vtr_tag2; // second pushed tag
196 u8 tag[64];
Pavel Kotucek65e84572017-01-16 17:01:56 +0100197
198 /* pbb tag rewrite info */
199 u16 outer_tag;
200 u8 b_dmac[6];
201 u8 b_smac[6];
202 u16 b_vlanid;
203 u32 i_sid;
Dave Barach6d963c22016-12-05 09:50:05 -0500204};
205
Paul Vinciguerrabb2c7b52019-03-14 09:47:29 -0700206/** \brief Request all or filtered subset of sw_interface_details
207 @param client_index - opaque cookie to identify the sender
208 @param context - sender context, to match reply w/ request
209 @param name_filter_valid - 1 if requesting a filtered subset of records else 0
210 @param name_filter - interface name substring filter. Eg. loop1 returns [loop1, loop10]
211*/
212
Dave Barach6d963c22016-12-05 09:50:05 -0500213define sw_interface_dump
214{
215 u32 client_index;
216 u32 context;
217 u8 name_filter_valid;
218 u8 name_filter[49];
219};
220
221/** \brief Set or delete one or all ip addresses on a specified interface
222 @param client_index - opaque cookie to identify the sender
223 @param context - sender context, to match reply w/ request
224 @param sw_if_index - index of the interface to add/del addresses
225 @param is_add - add address if non-zero, else delete
226 @param is_ipv6 - if non-zero the address is ipv6, else ipv4
227 @param del_all - if non-zero delete all addresses on the interface
228 @param address_length - address length in bytes, 4 for ip4, 16 for ip6
229 @param address - array of address bytes
230*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400231autoreply define sw_interface_add_del_address
Dave Barach6d963c22016-12-05 09:50:05 -0500232{
233 u32 client_index;
234 u32 context;
235 u32 sw_if_index;
236 u8 is_add;
237 u8 is_ipv6;
238 u8 del_all;
239 u8 address_length;
240 u8 address[16];
241};
242
Dave Barach6d963c22016-12-05 09:50:05 -0500243/** \brief Associate the specified interface with a fib table
244 @param client_index - opaque cookie to identify the sender
245 @param context - sender context, to match reply w/ request
246 @param sw_if_index - index of the interface
247 @param is_ipv6 - if non-zero ipv6, else ipv4
248 @param vrf_id - fib table/vrd id to associate the interface with
249*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400250autoreply define sw_interface_set_table
Dave Barach6d963c22016-12-05 09:50:05 -0500251{
252 u32 client_index;
253 u32 context;
254 u32 sw_if_index;
255 u8 is_ipv6;
256 u32 vrf_id;
257};
258
Juraj Slobodadfc19232016-12-05 13:20:37 +0100259/** \brief Get VRF id assigned to interface
260 @param client_index - opaque cookie to identify the sender
261 @param context - sender context, to match reply w/ request
262 @param sw_if_index - index of the interface
263*/
264define sw_interface_get_table
265{
266 u32 client_index;
267 u32 context;
268 u32 sw_if_index;
269 u8 is_ipv6;
270};
271
272/** \brief Reply to get_sw_interface_vrf
273 @param context - sender context which was passed in the request
274 @param vrf_id - VRF id assigned to the interface
275*/
276define sw_interface_get_table_reply
277{
278 u32 context;
279 i32 retval;
280 u32 vrf_id;
281};
282
Dave Barach6d963c22016-12-05 09:50:05 -0500283/** \brief Set unnumbered interface add / del request
284 @param client_index - opaque cookie to identify the sender
285 @param context - sender context, to match reply w/ request
286 @param sw_if_index - interface with an IP address
287 @param unnumbered_sw_if_index - interface which will use the address
288 @param is_add - if non-zero set the association, else unset it
289*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400290autoreply define sw_interface_set_unnumbered
Dave Barach6d963c22016-12-05 09:50:05 -0500291{
292 u32 client_index;
293 u32 context;
294 u32 sw_if_index; /* use this intfc address */
295 u32 unnumbered_sw_if_index; /* on this interface */
296 u8 is_add;
297};
298
Dave Barach6d963c22016-12-05 09:50:05 -0500299/** \brief Clear interface statistics
300 @param client_index - opaque cookie to identify the sender
301 @param context - sender context, to match reply w/ request
302 @param sw_if_index - index of the interface to clear statistics
303*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400304autoreply define sw_interface_clear_stats
Dave Barach6d963c22016-12-05 09:50:05 -0500305{
306 u32 client_index;
307 u32 context;
308 u32 sw_if_index;
309};
310
Dave Barach6d963c22016-12-05 09:50:05 -0500311/** \brief Set / clear software interface tag
312 @param client_index - opaque cookie to identify the sender
313 @param context - sender context, to match reply w/ request
314 @param sw_if_index - the interface
315 @param add_del - 1 = add, 0 = delete
316 @param tag - an ascii tag
317*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400318autoreply define sw_interface_tag_add_del
Dave Barach6d963c22016-12-05 09:50:05 -0500319{
320 u32 client_index;
321 u32 context;
322 u8 is_add;
323 u32 sw_if_index;
324 u8 tag[64];
325};
326
Jon Loeliger10c273b2017-03-30 08:39:33 -0500327/** \brief Set an interface's MAC address
328 @param client_index - opaque cookie to identify the sender
329 @param context - sender context, to match reply w/ request
330 @param sw_if_index - the interface whose MAC will be set
331 @param mac_addr - the new MAC address
332*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400333autoreply define sw_interface_set_mac_address
Jon Loeliger10c273b2017-03-30 08:39:33 -0500334{
335 u32 client_index;
336 u32 context;
337 u32 sw_if_index;
338 u8 mac_address[6];
339};
340
Juraj Slobodac0374232018-02-01 15:18:49 +0100341/** \brief Get interface's MAC address
342 @param client_index - opaque cookie to identify the sender
343 @param context - sender context, to match reply w/ request
344 @param sw_if_index - the interface whose MAC will be returned
345*/
346define sw_interface_get_mac_address
347{
348 u32 client_index;
349 u32 context;
350 u32 sw_if_index;
351};
352
353/** \brief Reply for get interface's MAC address request
354 @param context - returned sender context, to match reply w/ request
355 @param retval - return code
356 @param mac_addr - returned interface's MAC address
357*/
358define sw_interface_get_mac_address_reply
359{
360 u32 context;
361 i32 retval;
362 u8 mac_address[6];
363};
364
Stevenad8015b2017-10-29 22:10:46 -0700365/** \brief Set an interface's rx-mode
366 @param client_index - opaque cookie to identify the sender
367 @param context - sender context, to match reply w/ request
368 @param sw_if_index - the interface whose rx-mode will be set
369 @param queue_id_valid - 1 = the queue_id field is valid. 0 means all
370 queue_id's
371 @param queue_id - the queue number whose rx-mode will be set. Only valid
372 if queue_id_valid is 1
373 @param mode - polling=1, interrupt=2, adaptive=3
374*/
375autoreply define sw_interface_set_rx_mode
376{
377 u32 client_index;
378 u32 context;
379 u32 sw_if_index;
380 u8 queue_id_valid;
381 u32 queue_id;
382 u8 mode;
383};
384
Mohsin Kazmi54f7c512018-08-23 18:28:11 +0200385/** \brief Set an interface's rx-placement
Mohsin Kazmif0b42f42018-09-10 18:11:00 +0200386 Rx-Queue placement on specific thread is operational for only hardware
387 interface. It will not set queue - thread placement for sub-interfaces,
388 p2p and pipe interfaces.
Mohsin Kazmi54f7c512018-08-23 18:28:11 +0200389 @param client_index - opaque cookie to identify the sender
390 @param context - sender context, to match reply w/ request
391 @param sw_if_index - the interface whose rx-placement will be set
392 @param queue_id - the queue number whose rx-placement will be set.
393 @param worker_id - the worker number whom rx-placement will be at.
394 @param is_main - flag to set rx-placement to main thread
395*/
396autoreply define sw_interface_set_rx_placement
397{
398 u32 client_index;
399 u32 context;
400 u32 sw_if_index;
401 u32 queue_id;
402 u32 worker_id;
403 u8 is_main;
404};
405
Mohsin Kazmif0b42f42018-09-10 18:11:00 +0200406/** \brief dump the rx queue placement of interface(s)
407 @param sw_if_index - optional interface index for which queue placement to
408 be requested. sw_if_index = ~0 will dump placement information for all
409 interfaces. It will not dump information related to sub-interfaces, p2p
410 and pipe interfaces.
411*/
412define sw_interface_rx_placement_dump
413{
414 u32 client_index;
415 u32 context;
416 u32 sw_if_index;
417};
418
419/** \brief show the interface's queue - thread placement
420 This api is used to display the interface and queue worker
421 thread placement. One message per rx-queue per interface will
422 be sent to client.
423 Each message will contain information about rx-queue id of an
424 interface, interface index, thread on which this rx-queue is
425 placed and mode of rx-queue.
426 @param client_index - opaque cookie to identify the sender
427 @param context - sender context, to match reply w/ request
428 @param sw_if_index - the interface whose rx-placement will be dumped
429 @param queue_id - the queue id
430 @param worker_id - the worker id on which queue_id is placed,
431 worker_id = 0 means main thread.
432 @param mode - polling=1, interrupt=2, adaptive=3
433*/
434define sw_interface_rx_placement_details
435{
436 u32 client_index;
437 u32 context;
438 u32 sw_if_index;
439 u32 queue_id;
440 u32 worker_id;
441 u8 mode;
442};
443
Neale Rannsb8d44812017-11-10 06:53:54 -0800444/* Gross kludge, DGMS */
445autoreply define interface_name_renumber
446{
447 u32 client_index;
448 u32 context;
449 u32 sw_if_index;
450 u32 new_show_dev_instance;
451};
452
453define create_subif
454{
455 u32 client_index;
456 u32 context;
457 u32 sw_if_index;
458 u32 sub_id;
459
460 /* These fields map directly onto the subif template */
461 u8 no_tags;
462 u8 one_tag;
463 u8 two_tags;
464 u8 dot1ad; // 0 = dot1q, 1=dot1ad
465 u8 exact_match;
466 u8 default_sub;
467 u8 outer_vlan_id_any;
468 u8 inner_vlan_id_any;
469 u16 outer_vlan_id;
470 u16 inner_vlan_id;
471};
472
473define create_subif_reply
474{
475 u32 context;
476 i32 retval;
477 u32 sw_if_index;
478};
479
480/** \brief Create a new subinterface with the given vlan id
481 @param client_index - opaque cookie to identify the sender
482 @param context - sender context, to match reply w/ request
483 @param sw_if_index - software index of the new vlan's parent interface
484 @param vlan_id - vlan tag of the new interface
485*/
486define create_vlan_subif
487{
488 u32 client_index;
489 u32 context;
490 u32 sw_if_index;
491 u32 vlan_id;
492};
493
494/** \brief Reply for the vlan subinterface create request
495 @param context - returned sender context, to match reply w/ request
496 @param retval - return code
497 @param sw_if_index - software index allocated for the new subinterface
498*/
499define create_vlan_subif_reply
500{
501 u32 context;
502 i32 retval;
503 u32 sw_if_index;
504};
505
506/** \brief Delete sub interface request
507 @param client_index - opaque cookie to identify the sender
508 @param context - sender context, to match reply w/ request
509 @param sw_if_index - sw index of the interface that was created by create_subif
510*/
511autoreply define delete_subif {
512 u32 client_index;
513 u32 context;
514 u32 sw_if_index;
515};
516
517/** \brief Create loopback interface request
518 @param client_index - opaque cookie to identify the sender
519 @param context - sender context, to match reply w/ request
520 @param mac_address - mac addr to assign to the interface if none-zero
521*/
522define create_loopback
523{
524 u32 client_index;
525 u32 context;
526 u8 mac_address[6];
527};
528
529/** \brief Create loopback interface response
530 @param context - sender context, to match reply w/ request
531 @param sw_if_index - sw index of the interface that was created
532 @param retval - return code for the request
533*/
534define create_loopback_reply
535{
536 u32 context;
537 i32 retval;
538 u32 sw_if_index;
539};
540
541/** \brief Create loopback interface instance request
542 @param client_index - opaque cookie to identify the sender
543 @param context - sender context, to match reply w/ request
544 @param mac_address - mac addr to assign to the interface if none-zero
545 @param is_specified - if non-0, a specific user_instance is being requested
546 @param user_instance - requested instance, ~0 => dynamically allocate
547*/
548define create_loopback_instance
549{
550 u32 client_index;
551 u32 context;
552 u8 mac_address[6];
553 u8 is_specified;
554 u32 user_instance;
555};
556
557/** \brief Create loopback interface instance response
558 @param context - sender context, to match reply w/ request
559 @param sw_if_index - sw index of the interface that was created
560 @param retval - return code for the request
561*/
562define create_loopback_instance_reply
563{
564 u32 context;
565 i32 retval;
566 u32 sw_if_index;
567};
568
569/** \brief Delete loopback interface request
570 @param client_index - opaque cookie to identify the sender
571 @param context - sender context, to match reply w/ request
572 @param sw_if_index - sw index of the interface that was created
573*/
574autoreply define delete_loopback
575{
576 u32 client_index;
577 u32 context;
578 u32 sw_if_index;
579};
580
Neale Ranns6f4a6be2018-03-16 16:26:21 -0700581/** \brief Enable or disable detailed interface stats
582 @param client_index - opaque cookie to identify the sender
583 @param context - sender context, to match reply w/ request
Neale Ranns0cae3f72018-03-21 09:44:01 -0400584 @param sw_if_index - The interface to collect detail stats on. ~0 implies
585 all interfaces.
Neale Ranns6f4a6be2018-03-16 16:26:21 -0700586 @param enable_disable - set to 1 to enable, 0 to disable detailed stats
587*/
588autoreply define collect_detailed_interface_stats
589{
590 u32 client_index;
591 u32 context;
Neale Ranns0cae3f72018-03-21 09:44:01 -0400592 u32 sw_if_index;
593 u8 enable_disable;
Neale Ranns6f4a6be2018-03-16 16:26:21 -0700594};
595
Dave Barach6d963c22016-12-05 09:50:05 -0500596/*
597 * Local Variables:
598 * eval: (c-set-style "gnu")
599 * End:
600 */