FD.io VPP  v18.10-34-gcce845e
Vector Packet Processing
interface.api
Go to the documentation of this file.
1 option version = "2.1.0";
2 
4  rpc want_interface_events returns want_interface_events_reply
5  events sw_interface_event;
6 };
7 
8 /** \brief Set flags on the interface
9  @param client_index - opaque cookie to identify the sender
10  @param context - sender context, to match reply w/ request
11  @param sw_if_index - index of the interface to set flags on
12  @param admin_up_down - set the admin state, 1 = up, 0 = down
13  @param link_up_down - Oper state sent on change event, not used in config.
14 */
15 autoreply define sw_interface_set_flags
16 {
20  /* 1 = up, 0 = down */
22 };
23 
24 /** \brief Set interface physical MTU
25  @param client_index - opaque cookie to identify the sender
26  @param context - sender context, to match reply w/ request
27  @param sw_if_index - index of the interface to set MTU on
28  @param mtu - MTU
29 */
30 autoreply define hw_interface_set_mtu
31 {
36 };
37 
38 /** \brief Set interface L3 MTU */
39 autoreply define sw_interface_set_mtu
40 {
44  /* $$$$ Replace with enum */
45  u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
46 };
47 
48 /** \brief Set IP4 directed broadcast
49  The directed broadcast enabled a packet sent to the interface's
50  subnet address will be broadcast on the interface
51  @param sw_if_index
52  @param enable
53 */
54 autoreply define sw_interface_set_ip_directed_broadcast
55 {
60 };
61 
62 
63 /** \brief Interface Event generated by want_interface_events
64  @param client_index - opaque cookie to identify the sender
65  @param pid - client pid registered to receive notification
66  @param sw_if_index - index of the interface of the event
67  @param admin_up_down - The administrative state; 1 = up, 0 = down
68  @param link_up_down - The operational state; 1 = up, 0 = down
69  @param deleted - interface was deleted
70 */
71 define sw_interface_event
72 {
79 };
80 
81 /** \brief Register for interface events
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 => register for events, 0 => cancel registration
85  @param pid - sender's pid
86 */
87 autoreply define want_interface_events
88 {
93 };
94 
95 /** \brief Interface details structure (fix this)
96  @param sw_if_index - index of the interface
97  @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index
98  @param l2_address_length - length of the interface's l2 address
99  @param pid - the interface's l2 address
100  @param interface_name - name of the interface
101  @param link_duplex - 1 if half duplex, 2 if full duplex
102  @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G
103  @param link_MTU - max. transmission unit
104  @param sub_if_id - A number 0-N to uniquely identify this subif on super if
105  @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
106  @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
107  @param sub_number_of_tags - Number of tags (0 - 2)
108  @param sub_outer_vlan_id
109  @param sub_inner_vlan_id
110  @param sub_exact_match
111  @param sub_default
112  @param sub_outer_vlan_id_any
113  @param sub_inner_vlan_id_any
114  @param vtr_op - vlan tag rewrite operation
115  @param vtr_push_dot1q
116  @param vtr_tag1
117  @param vtr_tag2
118  @param pbb_outer_tag - translate pbb s-tag
119  @param pbb_b_dmac[6] - B-tag remote mac address
120  @param pbb_b_smac[6] - B-tag local mac address
121  @param pbb_b_vlanid - B-tag vlanid
122  @param pbb_i_sid - I-tag service id
123 */
124 define sw_interface_details
125 {
128 
129  /* index of sup interface (e.g. hw interface).
130  equal to sw_if_index for super hw interface. */
132 
133  /* Layer 2 address, if applicable */
135  u8 l2_address[8];
136 
137  /* Interface name */
138  u8 interface_name[64];
139 
140  /* 1 = up, 0 = down */
143 
144  /* 1 = half duplex, 2 = full duplex */
146 
147  /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
149 
150  /* MTU */
152 
153  /* Per protocol MTUs */
154  u32 mtu[4]; /* 0 - L3, 1 - IP4, 2 - IP6, 3 - MPLS */
155 
156  /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
158 
159  /* 0 = dot1q, 1=dot1ad */
161  /* 1 = dot1h, 1=otherwise */
163 
164  /* Number of tags 0-2 */
172 
173  /* vlan tag rewrite state */
175  u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
176  u32 vtr_tag1; // first pushed tag
177  u32 vtr_tag2; // second pushed tag
178  u8 tag[64];
179 
180  /* pbb tag rewrite info */
182  u8 b_dmac[6];
183  u8 b_smac[6];
186 };
187 
188 /* works */
189 define sw_interface_dump
190 {
194  u8 name_filter[49];
195 };
196 
197 /** \brief Set or delete one or all ip addresses on a specified interface
198  @param client_index - opaque cookie to identify the sender
199  @param context - sender context, to match reply w/ request
200  @param sw_if_index - index of the interface to add/del addresses
201  @param is_add - add address if non-zero, else delete
202  @param is_ipv6 - if non-zero the address is ipv6, else ipv4
203  @param del_all - if non-zero delete all addresses on the interface
204  @param address_length - address length in bytes, 4 for ip4, 16 for ip6
205  @param address - array of address bytes
206 */
207 autoreply define sw_interface_add_del_address
208 {
216  u8 address[16];
217 };
218 
219 /** \brief Associate the specified interface with a fib table
220  @param client_index - opaque cookie to identify the sender
221  @param context - sender context, to match reply w/ request
222  @param sw_if_index - index of the interface
223  @param is_ipv6 - if non-zero ipv6, else ipv4
224  @param vrf_id - fib table/vrd id to associate the interface with
225 */
226 autoreply define sw_interface_set_table
227 {
233 };
234 
235 /** \brief Get VRF id assigned to interface
236  @param client_index - opaque cookie to identify the sender
237  @param context - sender context, to match reply w/ request
238  @param sw_if_index - index of the interface
239 */
240 define sw_interface_get_table
241 {
246 };
247 
248 /** \brief Reply to get_sw_interface_vrf
249  @param context - sender context which was passed in the request
250  @param vrf_id - VRF id assigned to the interface
251 */
252 define sw_interface_get_table_reply
253 {
257 };
258 
259 typeonly manual_print manual_endian define vlib_counter
260 {
261  u64 packets; /**< packet counter */
262  u64 bytes; /**< byte counter */
263 };
264 
265 /** \brief Combined interface counter data type for vnet_interface_combined_counters
266  @param sw_if_index - interface indexes for counters
267  @param rx_packets - received packet count
268  @param rx_bytes - received byte count
269  @param rx_unicast_packets - received unicast packet count
270  @param rx_unicast_bytes - received unicast byte count
271  @param rx_multicast_packets - received multicast packet count
272  @param rx_multicast_bytes - received multicast byte count
273  @param rx_broadcast_packets - received broadcast packet count
274  @param rx_broadcast_bytes - received broadcast byte count
275  @param tx_packets - transmitted packet count
276  @param tx_bytes - transmitted byte count
277  @param tx_unicast_packets - transmitted unicast packet count
278  @param tx_unicast_bytes - transmitted unicast byte count
279  @param tx_multicast_packets - transmitted multicast packet count
280  @param tx_multicast_bytes - transmitted multicast byte count
281  @param tx_broadcast_packets - transmitted broadcast packet count
282  @param tx_broadcast_bytes - transmitted broadcast byte count
283 
284 */
285 typeonly manual_print manual_endian define vnet_combined_counter
286 {
288  u64 rx_packets; /**< packet counter */
289  u64 rx_bytes; /**< byte counter */
290  u64 rx_unicast_packets; /**< packet counter */
291  u64 rx_unicast_bytes; /**< byte counter */
292  u64 rx_multicast_packets; /**< packet counter */
293  u64 rx_multicast_bytes; /**< byte counter */
294  u64 rx_broadcast_packets; /**< packet counter */
295  u64 rx_broadcast_bytes; /**< byte counter */
296  u64 tx_packets; /**< packet counter */
297  u64 tx_bytes; /**< byte counter */
298  u64 tx_unicast_packets; /**< packet counter */
299  u64 tx_unicast_bytes; /**< byte counter */
300  u64 tx_multicast_packets; /**< packet counter */
301  u64 tx_multicast_bytes; /**< byte counter */
302  u64 tx_broadcast_packets; /**< packet counter */
303  u64 tx_broadcast_bytes; /**< byte counter */
304 };
305 
306 /** \brief Simple interface counter data type for vnet_interface_simple_counters
307  @param sw_if_index - interface indexes for counters
308  @param drop - RX or TX drops due to buffer starvation
309  @param punt - used with VNET "punt" disposition
310  @param rx_ip4 - received IP4 packets
311  @param rx_ip6 - received IP6 packets
312  @param rx_no_buffer - no RX buffers available
313  @param rx_miss - receive misses
314  @param rx_error - receive errors
315  @param tx_error - transmit errors
316  @param rx_mpls - received MPLS packet
317 
318 */
319 typeonly manual_print manual_endian define vnet_simple_counter
320 {
331 };
332 
333 /** \brief Set unnumbered interface add / del request
334  @param client_index - opaque cookie to identify the sender
335  @param context - sender context, to match reply w/ request
336  @param sw_if_index - interface with an IP address
337  @param unnumbered_sw_if_index - interface which will use the address
338  @param is_add - if non-zero set the association, else unset it
339 */
340 autoreply define sw_interface_set_unnumbered
341 {
344  u32 sw_if_index; /* use this intfc address */
345  u32 unnumbered_sw_if_index; /* on this interface */
347 };
348 
349 /** \brief Clear interface statistics
350  @param client_index - opaque cookie to identify the sender
351  @param context - sender context, to match reply w/ request
352  @param sw_if_index - index of the interface to clear statistics
353 */
354 autoreply define sw_interface_clear_stats
355 {
359 };
360 
361 /** \brief Set / clear software interface tag
362  @param client_index - opaque cookie to identify the sender
363  @param context - sender context, to match reply w/ request
364  @param sw_if_index - the interface
365  @param add_del - 1 = add, 0 = delete
366  @param tag - an ascii tag
367 */
368 autoreply define sw_interface_tag_add_del
369 {
374  u8 tag[64];
375 };
376 
377 /** \brief Set an interface's MAC address
378  @param client_index - opaque cookie to identify the sender
379  @param context - sender context, to match reply w/ request
380  @param sw_if_index - the interface whose MAC will be set
381  @param mac_addr - the new MAC address
382 */
383 autoreply define sw_interface_set_mac_address
384 {
389 };
390 
391 /** \brief Get interface's MAC address
392  @param client_index - opaque cookie to identify the sender
393  @param context - sender context, to match reply w/ request
394  @param sw_if_index - the interface whose MAC will be returned
395 */
396 define sw_interface_get_mac_address
397 {
401 };
402 
403 /** \brief Reply for get interface's MAC address request
404  @param context - returned sender context, to match reply w/ request
405  @param retval - return code
406  @param mac_addr - returned interface's MAC address
407 */
408 define sw_interface_get_mac_address_reply
409 {
413 };
414 
415 /** \brief Set an interface's rx-mode
416  @param client_index - opaque cookie to identify the sender
417  @param context - sender context, to match reply w/ request
418  @param sw_if_index - the interface whose rx-mode will be set
419  @param queue_id_valid - 1 = the queue_id field is valid. 0 means all
420  queue_id's
421  @param queue_id - the queue number whose rx-mode will be set. Only valid
422  if queue_id_valid is 1
423  @param mode - polling=1, interrupt=2, adaptive=3
424 */
425 autoreply define sw_interface_set_rx_mode
426 {
433 };
434 
435 /** \brief Set an interface's rx-placement
436  Rx-Queue placement on specific thread is operational for only hardware
437  interface. It will not set queue - thread placement for sub-interfaces,
438  p2p and pipe interfaces.
439  @param client_index - opaque cookie to identify the sender
440  @param context - sender context, to match reply w/ request
441  @param sw_if_index - the interface whose rx-placement will be set
442  @param queue_id - the queue number whose rx-placement will be set.
443  @param worker_id - the worker number whom rx-placement will be at.
444  @param is_main - flag to set rx-placement to main thread
445 */
446 autoreply define sw_interface_set_rx_placement
447 {
454 };
455 
456 /** \brief dump the rx queue placement of interface(s)
457  @param sw_if_index - optional interface index for which queue placement to
458  be requested. sw_if_index = ~0 will dump placement information for all
459  interfaces. It will not dump information related to sub-interfaces, p2p
460  and pipe interfaces.
461 */
462 define sw_interface_rx_placement_dump
463 {
467 };
468 
469 /** \brief show the interface's queue - thread placement
470  This api is used to display the interface and queue worker
471  thread placement. One message per rx-queue per interface will
472  be sent to client.
473  Each message will contain information about rx-queue id of an
474  interface, interface index, thread on which this rx-queue is
475  placed and mode of rx-queue.
476  @param client_index - opaque cookie to identify the sender
477  @param context - sender context, to match reply w/ request
478  @param sw_if_index - the interface whose rx-placement will be dumped
479  @param queue_id - the queue id
480  @param worker_id - the worker id on which queue_id is placed,
481  worker_id = 0 means main thread.
482  @param mode - polling=1, interrupt=2, adaptive=3
483 */
484 define sw_interface_rx_placement_details
485 {
492 };
493 
494 /* Gross kludge, DGMS */
495 autoreply define interface_name_renumber
496 {
501 };
502 
503 define create_subif
504 {
509 
510  /* These fields map directly onto the subif template */
514  u8 dot1ad; // 0 = dot1q, 1=dot1ad
521 };
522 
523 define create_subif_reply
524 {
528 };
529 
530 /** \brief Create a new subinterface with the given vlan id
531  @param client_index - opaque cookie to identify the sender
532  @param context - sender context, to match reply w/ request
533  @param sw_if_index - software index of the new vlan's parent interface
534  @param vlan_id - vlan tag of the new interface
535 */
536 define create_vlan_subif
537 {
542 };
543 
544 /** \brief Reply for the vlan subinterface create request
545  @param context - returned sender context, to match reply w/ request
546  @param retval - return code
547  @param sw_if_index - software index allocated for the new subinterface
548 */
549 define create_vlan_subif_reply
550 {
554 };
555 
556 /** \brief Delete sub interface request
557  @param client_index - opaque cookie to identify the sender
558  @param context - sender context, to match reply w/ request
559  @param sw_if_index - sw index of the interface that was created by create_subif
560 */
561 autoreply define delete_subif {
565 };
566 
567 /** \brief Create loopback interface request
568  @param client_index - opaque cookie to identify the sender
569  @param context - sender context, to match reply w/ request
570  @param mac_address - mac addr to assign to the interface if none-zero
571 */
572 define create_loopback
573 {
577 };
578 
579 /** \brief Create loopback interface response
580  @param context - sender context, to match reply w/ request
581  @param sw_if_index - sw index of the interface that was created
582  @param retval - return code for the request
583 */
584 define create_loopback_reply
585 {
589 };
590 
591 /** \brief Create loopback interface instance request
592  @param client_index - opaque cookie to identify the sender
593  @param context - sender context, to match reply w/ request
594  @param mac_address - mac addr to assign to the interface if none-zero
595  @param is_specified - if non-0, a specific user_instance is being requested
596  @param user_instance - requested instance, ~0 => dynamically allocate
597 */
598 define create_loopback_instance
599 {
605 };
606 
607 /** \brief Create loopback interface instance response
608  @param context - sender context, to match reply w/ request
609  @param sw_if_index - sw index of the interface that was created
610  @param retval - return code for the request
611 */
612 define create_loopback_instance_reply
613 {
617 };
618 
619 /** \brief Delete loopback interface request
620  @param client_index - opaque cookie to identify the sender
621  @param context - sender context, to match reply w/ request
622  @param sw_if_index - sw index of the interface that was created
623 */
624 autoreply define delete_loopback
625 {
629 };
630 
631 /** \brief Enable or disable detailed interface stats
632  @param client_index - opaque cookie to identify the sender
633  @param context - sender context, to match reply w/ request
634  @param sw_if_index - The interface to collect detail stats on. ~0 implies
635  all interfaces.
636  @param enable_disable - set to 1 to enable, 0 to disable detailed stats
637 */
639 {
644 };
645 
646 /*
647  * Local Variables:
648  * eval: (c-set-style "gnu")
649  * End:
650  */
u64 rx_multicast_packets
packet counter
Definition: interface.api:292
u64 tx_unicast_bytes
byte counter
Definition: interface.api:299
typedef address
Definition: ip_types.api:35
u64 tx_unicast_packets
packet counter
Definition: interface.api:298
unsigned long u64
Definition: types.h:89
u64 tx_broadcast_bytes
byte counter
Definition: interface.api:303
u64 tx_broadcast_packets
packet counter
Definition: interface.api:302
unsigned char u8
Definition: types.h:56
u64 rx_unicast_packets
packet counter
Definition: interface.api:290
option version
Definition: interface.api:1
u64 bytes
byte counter
Definition: interface.api:262
u64 rx_unicast_bytes
byte counter
Definition: interface.api:291
unsigned int u32
Definition: types.h:88
u64 tx_packets
packet counter
Definition: interface.api:296
u64 packets
packet counter
Definition: interface.api:261
u64 tx_multicast_bytes
byte counter
Definition: interface.api:301
u64 rx_broadcast_packets
packet counter
Definition: interface.api:294
unsigned short u16
Definition: types.h:57
u64 rx_broadcast_bytes
byte counter
Definition: interface.api:295
service
Definition: interface.api:3
u64 rx_multicast_bytes
byte counter
Definition: interface.api:293
typedef mac_address
static int collect_detailed_interface_stats(void)
Definition: interface.h:814
signed int i32
Definition: types.h:77
u64 rx_packets
packet counter
Definition: interface.api:288
u64 tx_multicast_packets
packet counter
Definition: interface.api:300