FD.io VPP  v19.08.2-294-g37e99c22d
Vector Packet Processing
interface.api
Go to the documentation of this file.
1 /* 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 
17 option version = "3.1.1";
18 
19 import "vnet/interface_types.api";
20 
22  rpc want_interface_events returns want_interface_events_reply
23  events sw_interface_event;
24 };
25 
26 /** \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.
32 */
33 autoreply define sw_interface_set_flags
34 {
38  /* 1 = up, 0 = down */
40 };
41 
42 /** \brief Set interface physical MTU
43  @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 */
48 autoreply define hw_interface_set_mtu
49 {
54 };
55 
56 /** \brief Set interface L3 MTU */
57 autoreply define sw_interface_set_mtu
58 {
62  /* $$$$ Replace with enum */
63  u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
64 };
65 
66 /** \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 */
72 autoreply define sw_interface_set_ip_directed_broadcast
73 {
78 };
79 
80 /** \brief Interface Event generated by want_interface_events
81  @param client_index - opaque cookie to identify the sender
82  @param pid - client pid registered to receive notification
83  @param sw_if_index - index of the interface of the event
84  @param admin_up_down - The administrative state; 1 = up, 0 = down
85  @param link_up_down - The operational state; 1 = up, 0 = down
86  @param deleted - interface was deleted
87 */
88 define sw_interface_event
89 {
96 };
97 
98 /** \brief Register for interface events
99  @param client_index - opaque cookie to identify the sender
100  @param context - sender context, to match reply w/ request
101  @param enable_disable - 1 => register for events, 0 => cancel registration
102  @param pid - sender's pid
103 */
104 autoreply define want_interface_events
105 {
110 };
111 
112 /** \brief Interface details structure (fix this)
113  @param sw_if_index - index of the interface
114  @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index
115  @param l2_address_length - length of the interface's l2 address
116  @param l2_address - the interface's l2 address
117  @param interface_name - name of the interface
118  @param link_duplex - 1 if half duplex, 2 if full duplex
119  @param link_speed - value in kbps
120  @param link_MTU - max. transmission unit
121  @param sub_if_id - A number 0-N to uniquely identify this subif on super if
122  @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
123  @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
124  @param sub_number_of_tags - Number of tags (0 - 2)
125  @param sub_outer_vlan_id
126  @param sub_inner_vlan_id
127  @param sub_exact_match
128  @param sub_default
129  @param sub_outer_vlan_id_any
130  @param sub_inner_vlan_id_any
131  @param vtr_op - vlan tag rewrite operation
132  @param vtr_push_dot1q
133  @param vtr_tag1
134  @param vtr_tag2
135  @param pbb_outer_tag - translate pbb s-tag
136  @param pbb_b_dmac[6] - B-tag remote mac address
137  @param pbb_b_smac[6] - B-tag local mac address
138  @param pbb_b_vlanid - B-tag vlanid
139  @param pbb_i_sid - I-tag service id
140 */
141 define sw_interface_details
142 {
145 
146  /* index of sup interface (e.g. hw interface).
147  equal to sw_if_index for super hw interface. */
149 
150  /* Layer 2 address, if applicable */
152  u8 l2_address[8];
153 
154  /* 1 = up, 0 = down */
157 
158  /* 1 = half duplex, 2 = full duplex */
160 
161  /* link speed in kbps */
163 
164  /* MTU */
166 
167  /* Per protocol MTUs */
168  u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
169 
170  /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
172 
173  /* 0 = dot1q, 1=dot1ad */
175  /* 1 = dot1h, 1=otherwise */
177 
178  /* Number of tags 0-2 */
186 
187  /* vlan tag rewrite state */
189  u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
190  u32 vtr_tag1; // first pushed tag
191  u32 vtr_tag2; // second pushed tag
192 
193  /* pbb tag rewrite info */
195  u8 b_dmac[6];
196  u8 b_smac[6];
199 
200  /* Interface name */
201  string interface_name[64];
202  string tag[64];
203 };
204 
205 /** \brief Request all or filtered subset of sw_interface_details
206  @param client_index - opaque cookie to identify the sender
207  @param context - sender context, to match reply w/ request
208  @param sw_if_index - index of the interface to dump info on, 0 or ~0 if on all
209  TODO: Support selecting only index==0 when CSIT is ready.
210  @param name_filter_valid - 1 if requesting a filtered subset of records else 0
211  if name filter is set as valid, sw_if_index value is ignored and all interfaces are examined
212  @param name_filter - interface name substring filter. Eg. loop1 returns [loop1, loop10]
213 */
214 define sw_interface_dump
215 {
218  vl_api_interface_index_t sw_if_index;
220  string name_filter[];
221 };
222 
223 /** \brief Set or delete one or all ip addresses on a specified interface
224  @param client_index - opaque cookie to identify the sender
225  @param context - sender context, to match reply w/ request
226  @param sw_if_index - index of the interface to add/del addresses
227  @param is_add - add address if non-zero, else delete
228  @param is_ipv6 - if non-zero the address is ipv6, else ipv4
229  @param del_all - if non-zero delete all addresses on the interface
230  @param address_length - address length in bytes, 4 for ip4, 16 for ip6
231  @param address - array of address bytes
232 */
233 autoreply define sw_interface_add_del_address
234 {
242  u8 address[16];
243 };
244 
245 /** \brief Associate the specified interface with a fib table
246  @param client_index - opaque cookie to identify the sender
247  @param context - sender context, to match reply w/ request
248  @param sw_if_index - index of the interface
249  @param is_ipv6 - if non-zero ipv6, else ipv4
250  @param vrf_id - fib table/vrf id to associate the interface with
251 */
252 autoreply define sw_interface_set_table
253 {
259 };
260 
261 /** \brief Get VRF id assigned to interface
262  @param client_index - opaque cookie to identify the sender
263  @param context - sender context, to match reply w/ request
264  @param sw_if_index - index of the interface
265 */
266 define sw_interface_get_table
267 {
272 };
273 
274 /** \brief Reply to get_sw_interface_vrf
275  @param context - sender context which was passed in the request
276  @param vrf_id - VRF id assigned to the interface
277 */
278 define sw_interface_get_table_reply
279 {
283 };
284 
285 /** \brief Set unnumbered interface add / del request
286  @param client_index - opaque cookie to identify the sender
287  @param context - sender context, to match reply w/ request
288  @param sw_if_index - interface with an IP address
289  @param unnumbered_sw_if_index - interface which will use the address
290  @param is_add - if non-zero set the association, else unset it
291 */
292 autoreply define sw_interface_set_unnumbered
293 {
296  u32 sw_if_index; /* use this intfc address */
297  u32 unnumbered_sw_if_index; /* on this interface */
299 };
300 
301 /** \brief Clear interface statistics
302  @param client_index - opaque cookie to identify the sender
303  @param context - sender context, to match reply w/ request
304  @param sw_if_index - index of the interface to clear statistics
305 */
306 autoreply define sw_interface_clear_stats
307 {
311 };
312 
313 /** \brief Set / clear software interface tag
314  @param client_index - opaque cookie to identify the sender
315  @param context - sender context, to match reply w/ request
316  @param sw_if_index - the interface
317  @param add_del - 1 = add, 0 = delete
318  @param tag - an ascii tag
319 */
320 autoreply define sw_interface_tag_add_del
321 {
324  bool is_add;
325  vl_api_interface_index_t sw_if_index;
326  string tag[64];
327 };
328 
329 /** \brief Set an interface's MAC address
330  @param client_index - opaque cookie to identify the sender
331  @param context - sender context, to match reply w/ request
332  @param sw_if_index - the interface whose MAC will be set
333  @param mac_addr - the new MAC address
334 */
335 autoreply define sw_interface_set_mac_address
336 {
341 };
342 
343 /** \brief Get interface's MAC address
344  @param client_index - opaque cookie to identify the sender
345  @param context - sender context, to match reply w/ request
346  @param sw_if_index - the interface whose MAC will be returned
347 */
348 define sw_interface_get_mac_address
349 {
353 };
354 
355 /** \brief Reply for get interface's MAC address request
356  @param context - returned sender context, to match reply w/ request
357  @param retval - return code
358  @param mac_addr - returned interface's MAC address
359 */
360 define sw_interface_get_mac_address_reply
361 {
365 };
366 
367 /** \brief Set an interface's rx-mode
368  @param client_index - opaque cookie to identify the sender
369  @param context - sender context, to match reply w/ request
370  @param sw_if_index - the interface whose rx-mode will be set
371  @param queue_id_valid - 1 = the queue_id field is valid. 0 means all
372  queue_id's
373  @param queue_id - the queue number whose rx-mode will be set. Only valid
374  if queue_id_valid is 1
375  @param mode - polling=1, interrupt=2, adaptive=3
376 */
377 autoreply define sw_interface_set_rx_mode
378 {
385 };
386 
387 /** \brief Set an interface's rx-placement
388  Rx-Queue placement on specific thread is operational for only hardware
389  interface. It will not set queue - thread placement for sub-interfaces,
390  p2p and pipe interfaces.
391  @param client_index - opaque cookie to identify the sender
392  @param context - sender context, to match reply w/ request
393  @param sw_if_index - the interface whose rx-placement will be set
394  @param queue_id - the queue number whose rx-placement will be set.
395  @param worker_id - the worker number whom rx-placement will be at.
396  @param is_main - flag to set rx-placement to main thread
397 */
398 autoreply define sw_interface_set_rx_placement
399 {
406 };
407 
408 /** \brief dump the rx queue placement of interface(s)
409  @param sw_if_index - optional interface index for which queue placement to
410  be requested. sw_if_index = ~0 will dump placement information for all
411  interfaces. It will not dump information related to sub-interfaces, p2p
412  and pipe interfaces.
413 */
414 define sw_interface_rx_placement_dump
415 {
419 };
420 
421 /** \brief show the interface's queue - thread placement
422  This api is used to display the interface and queue worker
423  thread placement. One message per rx-queue per interface will
424  be sent to client.
425  Each message will contain information about rx-queue id of an
426  interface, interface index, thread on which this rx-queue is
427  placed and mode of rx-queue.
428  @param client_index - opaque cookie to identify the sender
429  @param context - sender context, to match reply w/ request
430  @param sw_if_index - the interface whose rx-placement will be dumped
431  @param queue_id - the queue id
432  @param worker_id - the worker id on which queue_id is placed,
433  worker_id = 0 means main thread.
434  @param mode - polling=1, interrupt=2, adaptive=3
435 */
436 define sw_interface_rx_placement_details
437 {
444 };
445 
446 /* Gross kludge, DGMS */
447 autoreply define interface_name_renumber
448 {
453 };
454 
455 define create_subif
456 {
461 
462  /* These fields map directly onto the subif template */
466  u8 dot1ad; // 0 = dot1q, 1=dot1ad
473 };
474 
475 define create_subif_reply
476 {
480 };
481 
482 /** \brief Create a new subinterface with the given vlan id
483  @param client_index - opaque cookie to identify the sender
484  @param context - sender context, to match reply w/ request
485  @param sw_if_index - software index of the new vlan's parent interface
486  @param vlan_id - vlan tag of the new interface
487 */
488 define create_vlan_subif
489 {
494 };
495 
496 /** \brief Reply for the vlan subinterface create request
497  @param context - returned sender context, to match reply w/ request
498  @param retval - return code
499  @param sw_if_index - software index allocated for the new subinterface
500 */
501 define create_vlan_subif_reply
502 {
506 };
507 
508 /** \brief Delete sub interface request
509  @param client_index - opaque cookie to identify the sender
510  @param context - sender context, to match reply w/ request
511  @param sw_if_index - sw index of the interface that was created by create_subif
512 */
513 autoreply define delete_subif {
517 };
518 
519 /** \brief Create loopback interface request
520  @param client_index - opaque cookie to identify the sender
521  @param context - sender context, to match reply w/ request
522  @param mac_address - mac addr to assign to the interface if none-zero
523 */
524 define create_loopback
525 {
529 };
530 
531 /** \brief Create loopback interface response
532  @param context - sender context, to match reply w/ request
533  @param sw_if_index - sw index of the interface that was created
534  @param retval - return code for the request
535 */
536 define create_loopback_reply
537 {
541 };
542 
543 /** \brief Create loopback interface instance request
544  @param client_index - opaque cookie to identify the sender
545  @param context - sender context, to match reply w/ request
546  @param mac_address - mac addr to assign to the interface if none-zero
547  @param is_specified - if non-0, a specific user_instance is being requested
548  @param user_instance - requested instance, ~0 => dynamically allocate
549 */
550 define create_loopback_instance
551 {
557 };
558 
559 /** \brief Create loopback interface instance response
560  @param context - sender context, to match reply w/ request
561  @param sw_if_index - sw index of the interface that was created
562  @param retval - return code for the request
563 */
564 define create_loopback_instance_reply
565 {
569 };
570 
571 /** \brief Delete loopback interface request
572  @param client_index - opaque cookie to identify the sender
573  @param context - sender context, to match reply w/ request
574  @param sw_if_index - sw index of the interface that was created
575 */
576 autoreply define delete_loopback
577 {
581 };
582 
583 /** \brief Enable or disable detailed interface stats
584  @param client_index - opaque cookie to identify the sender
585  @param context - sender context, to match reply w/ request
586  @param sw_if_index - The interface to collect detail stats on. ~0 implies
587  all interfaces.
588  @param enable_disable - set to 1 to enable, 0 to disable detailed stats
589 */
591 {
596 };
597 
598 /*
599  * Local Variables:
600  * eval: (c-set-style "gnu")
601  * End:
602  */
typedef address
Definition: ip_types.api:83
unsigned char u8
Definition: types.h:56
option version
Definition: interface.api:17
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
vl_api_interface_index_t sw_if_index
Definition: interface.api:218
service
Definition: interface.api:21
static int collect_detailed_interface_stats(void)
Definition: interface.h:796
signed int i32
Definition: types.h:77
u8 mac_address[6]
vl_api_interface_index_t sw_if_index
Definition: interface.api:325