FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
interface.api
Go to the documentation of this file.
1 option version = "1.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 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 sw_interface_set_mtu
31 {
36 };
37 
38 /** \brief Interface Event generated by want_interface_events
39  @param client_index - opaque cookie to identify the sender
40  @param pid - client pid registered to receive notification
41  @param sw_if_index - index of the interface of the event
42  @param admin_up_down - The administrative state; 1 = up, 0 = down
43  @param link_up_down - The operational state; 1 = up, 0 = down
44  @param deleted - interface was deleted
45 */
46 define sw_interface_event
47 {
54 };
55 
56 /** \brief Register for interface events
57  @param client_index - opaque cookie to identify the sender
58  @param context - sender context, to match reply w/ request
59  @param enable_disable - 1 => register for events, 0 => cancel registration
60  @param pid - sender's pid
61 */
62 autoreply define want_interface_events
63 {
68 };
69 
70 /** \brief Interface details structure (fix this)
71  @param sw_if_index - index of the interface
72  @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index
73  @param l2_address_length - length of the interface's l2 address
74  @param pid - the interface's l2 address
75  @param interface_name - name of the interface
76  @param link_duplex - 1 if half duplex, 2 if full duplex
77  @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G
78  @param link_MTU - max. transmittion unit
79  @param sub_if_id - A number 0-N to uniquely identify this subif on super if
80  @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
81  @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
82  @param sub_number_of_tags - Number of tags (0 - 2)
83  @param sub_outer_vlan_id
84  @param sub_inner_vlan_id
85  @param sub_exact_match
86  @param sub_default
87  @param sub_outer_vlan_id_any
88  @param sub_inner_vlan_id_any
89  @param vtr_op - vlan tag rewrite operation
90  @param vtr_push_dot1q
91  @param vtr_tag1
92  @param vtr_tag2
93  @param pbb_outer_tag - translate pbb s-tag
94  @param pbb_b_dmac[6] - B-tag remote mac address
95  @param pbb_b_smac[6] - B-tag local mac address
96  @param pbb_b_vlanid - B-tag vlanid
97  @param pbb_i_sid - I-tag service id
98 */
99 define sw_interface_details
100 {
103 
104  /* index of sup interface (e.g. hw interface).
105  equal to sw_if_index for super hw interface. */
107 
108  /* Layer 2 address, if applicable */
110  u8 l2_address[8];
111 
112  /* Interface name */
113  u8 interface_name[64];
114 
115  /* 1 = up, 0 = down */
118 
119  /* 1 = half duplex, 2 = full duplex */
121 
122  /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
124 
125  /* MTU */
127 
128  /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
130 
131  /* 0 = dot1q, 1=dot1ad */
133  /* 1 = dot1h, 1=otherwise */
135 
136  /* Number of tags 0-2 */
144 
145  /* vlan tag rewrite state */
147  u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
148  u32 vtr_tag1; // first pushed tag
149  u32 vtr_tag2; // second pushed tag
150  u8 tag[64];
151 
152  /* pbb tag rewrite info */
154  u8 b_dmac[6];
155  u8 b_smac[6];
158 };
159 
160 /* works */
161 define sw_interface_dump
162 {
166  u8 name_filter[49];
167 };
168 
169 /** \brief Set or delete one or all ip addresses on a specified interface
170  @param client_index - opaque cookie to identify the sender
171  @param context - sender context, to match reply w/ request
172  @param sw_if_index - index of the interface to add/del addresses
173  @param is_add - add address if non-zero, else delete
174  @param is_ipv6 - if non-zero the address is ipv6, else ipv4
175  @param del_all - if non-zero delete all addresses on the interface
176  @param address_length - address length in bytes, 4 for ip4, 16 for ip6
177  @param address - array of address bytes
178 */
179 autoreply define sw_interface_add_del_address
180 {
188  u8 address[16];
189 };
190 
191 /** \brief Associate the specified interface with a fib table
192  @param client_index - opaque cookie to identify the sender
193  @param context - sender context, to match reply w/ request
194  @param sw_if_index - index of the interface
195  @param is_ipv6 - if non-zero ipv6, else ipv4
196  @param vrf_id - fib table/vrd id to associate the interface with
197 */
198 autoreply define sw_interface_set_table
199 {
205 };
206 
207 /** \brief Get VRF id assigned to interface
208  @param client_index - opaque cookie to identify the sender
209  @param context - sender context, to match reply w/ request
210  @param sw_if_index - index of the interface
211 */
212 define sw_interface_get_table
213 {
218 };
219 
220 /** \brief Reply to get_sw_interface_vrf
221  @param context - sender context which was passed in the request
222  @param vrf_id - VRF id assigned to the interface
223 */
224 define sw_interface_get_table_reply
225 {
229 };
230 
231 typeonly manual_print manual_endian define vlib_counter
232 {
233  u64 packets; /**< packet counter */
234  u64 bytes; /**< byte counter */
235 };
236 
237 /** \brief Combined interface counter data type for vnet_interface_combined_counters
238  @param sw_if_index - interface indexes for counters
239  @param rx_packets - received packet count
240  @param rx_bytes - received byte count
241  @param rx_unicast_packets - received unicast packet count
242  @param rx_unicast_bytes - received unicast byte count
243  @param rx_multicast_packets - received multicast packet count
244  @param rx_multicast_bytes - received multicast byte count
245  @param rx_broadcast_packets - received broadcast packet count
246  @param rx_broadcast_bytes - received broadcast byte count
247  @param tx_packets - transmitted packet count
248  @param tx_bytes - transmitted byte count
249  @param tx_unicast_packets - transmitted unicast packet count
250  @param tx_unicast_bytes - transmitted unicast byte count
251  @param tx_multicast_packets - transmitted multicast packet count
252  @param tx_multicast_bytes - transmitted multicast byte count
253  @param tx_broadcast_packets - transmitted broadcast packet count
254  @param tx_broadcast_bytes - transmitted broadcast byte count
255 
256 */
257 typeonly manual_print manual_endian define vnet_combined_counter
258 {
260  u64 rx_packets; /**< packet counter */
261  u64 rx_bytes; /**< byte counter */
262  u64 rx_unicast_packets; /**< packet counter */
263  u64 rx_unicast_bytes; /**< byte counter */
264  u64 rx_multicast_packets; /**< packet counter */
265  u64 rx_multicast_bytes; /**< byte counter */
266  u64 rx_broadcast_packets; /**< packet counter */
267  u64 rx_broadcast_bytes; /**< byte counter */
268  u64 tx_packets; /**< packet counter */
269  u64 tx_bytes; /**< byte counter */
270  u64 tx_unicast_packets; /**< packet counter */
271  u64 tx_unicast_bytes; /**< byte counter */
272  u64 tx_multicast_packets; /**< packet counter */
273  u64 tx_multicast_bytes; /**< byte counter */
274  u64 tx_broadcast_packets; /**< packet counter */
275  u64 tx_broadcast_bytes; /**< byte counter */
276 };
277 
278 /** \brief Simple interface counter data type for vnet_interface_simple_counters
279  @param sw_if_index - interface indexes for counters
280  @param drop - RX or TX drops due to buffer starvation
281  @param punt - used with VNET "punt" disposition
282  @param rx_ip4 - received IP4 packets
283  @param rx_ip6 - received IP6 packets
284  @param rx_no_buffer - no RX buffers available
285  @param rx_miss - receive misses
286  @param rx_error - receive errors
287  @param tx_error - transmit errors
288  @param rx_mpls - received MPLS packet
289 
290 */
291 typeonly manual_print manual_endian define vnet_simple_counter
292 {
303 };
304 
305 /** \brief Set unnumbered interface add / del request
306  @param client_index - opaque cookie to identify the sender
307  @param context - sender context, to match reply w/ request
308  @param sw_if_index - interface with an IP address
309  @param unnumbered_sw_if_index - interface which will use the address
310  @param is_add - if non-zero set the association, else unset it
311 */
312 autoreply define sw_interface_set_unnumbered
313 {
316  u32 sw_if_index; /* use this intfc address */
317  u32 unnumbered_sw_if_index; /* on this interface */
319 };
320 
321 /** \brief Clear interface statistics
322  @param client_index - opaque cookie to identify the sender
323  @param context - sender context, to match reply w/ request
324  @param sw_if_index - index of the interface to clear statistics
325 */
326 autoreply define sw_interface_clear_stats
327 {
331 };
332 
333 /** \brief Set / clear software interface tag
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 - the interface
337  @param add_del - 1 = add, 0 = delete
338  @param tag - an ascii tag
339 */
340 autoreply define sw_interface_tag_add_del
341 {
346  u8 tag[64];
347 };
348 
349 /** \brief Set an interface's MAC address
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 - the interface whose MAC will be set
353  @param mac_addr - the new MAC address
354 */
355 autoreply define sw_interface_set_mac_address
356 {
360  u8 mac_address[6];
361 };
362 
363 /** \brief Get interface's MAC address
364  @param client_index - opaque cookie to identify the sender
365  @param context - sender context, to match reply w/ request
366  @param sw_if_index - the interface whose MAC will be returned
367 */
368 define sw_interface_get_mac_address
369 {
373 };
374 
375 /** \brief Reply for get interface's MAC address request
376  @param context - returned sender context, to match reply w/ request
377  @param retval - return code
378  @param mac_addr - returned interface's MAC address
379 */
380 define sw_interface_get_mac_address_reply
381 {
384  u8 mac_address[6];
385 };
386 
387 /** \brief Set an interface's rx-mode
388  @param client_index - opaque cookie to identify the sender
389  @param context - sender context, to match reply w/ request
390  @param sw_if_index - the interface whose rx-mode will be set
391  @param queue_id_valid - 1 = the queue_id field is valid. 0 means all
392  queue_id's
393  @param queue_id - the queue number whose rx-mode will be set. Only valid
394  if queue_id_valid is 1
395  @param mode - polling=1, interrupt=2, adaptive=3
396 */
397 autoreply define sw_interface_set_rx_mode
398 {
405 };
406 
407 /* Gross kludge, DGMS */
408 autoreply define interface_name_renumber
409 {
414 };
415 
416 define create_subif
417 {
422 
423  /* These fields map directly onto the subif template */
427  u8 dot1ad; // 0 = dot1q, 1=dot1ad
434 };
435 
436 define create_subif_reply
437 {
441 };
442 
443 /** \brief Create a new subinterface with the given vlan id
444  @param client_index - opaque cookie to identify the sender
445  @param context - sender context, to match reply w/ request
446  @param sw_if_index - software index of the new vlan's parent interface
447  @param vlan_id - vlan tag of the new interface
448 */
449 define create_vlan_subif
450 {
455 };
456 
457 /** \brief Reply for the vlan subinterface create request
458  @param context - returned sender context, to match reply w/ request
459  @param retval - return code
460  @param sw_if_index - software index allocated for the new subinterface
461 */
462 define create_vlan_subif_reply
463 {
467 };
468 
469 /** \brief Delete sub interface request
470  @param client_index - opaque cookie to identify the sender
471  @param context - sender context, to match reply w/ request
472  @param sw_if_index - sw index of the interface that was created by create_subif
473 */
474 autoreply define delete_subif {
478 };
479 
480 /** \brief Create loopback interface request
481  @param client_index - opaque cookie to identify the sender
482  @param context - sender context, to match reply w/ request
483  @param mac_address - mac addr to assign to the interface if none-zero
484 */
485 define create_loopback
486 {
489  u8 mac_address[6];
490 };
491 
492 /** \brief Create loopback interface response
493  @param context - sender context, to match reply w/ request
494  @param sw_if_index - sw index of the interface that was created
495  @param retval - return code for the request
496 */
497 define create_loopback_reply
498 {
502 };
503 
504 /** \brief Create loopback interface instance request
505  @param client_index - opaque cookie to identify the sender
506  @param context - sender context, to match reply w/ request
507  @param mac_address - mac addr to assign to the interface if none-zero
508  @param is_specified - if non-0, a specific user_instance is being requested
509  @param user_instance - requested instance, ~0 => dynamically allocate
510 */
511 define create_loopback_instance
512 {
515  u8 mac_address[6];
518 };
519 
520 /** \brief Create loopback interface instance response
521  @param context - sender context, to match reply w/ request
522  @param sw_if_index - sw index of the interface that was created
523  @param retval - return code for the request
524 */
525 define create_loopback_instance_reply
526 {
530 };
531 
532 /** \brief Delete loopback interface request
533  @param client_index - opaque cookie to identify the sender
534  @param context - sender context, to match reply w/ request
535  @param sw_if_index - sw index of the interface that was created
536 */
537 autoreply define delete_loopback
538 {
542 };
543 
544 /** \brief Enable or disable detailed interface stats
545  @param client_index - opaque cookie to identify the sender
546  @param context - sender context, to match reply w/ request
547  @param sw_if_index - The interface to collect detail stats on. ~0 implies
548  all interfaces.
549  @param enable_disable - set to 1 to enable, 0 to disable detailed stats
550 */
552 {
557 };
558 
559 /*
560  * Local Variables:
561  * eval: (c-set-style "gnu")
562  * End:
563  */
u64 rx_multicast_packets
packet counter
Definition: interface.api:264
u64 tx_unicast_bytes
byte counter
Definition: interface.api:271
u64 tx_unicast_packets
packet counter
Definition: interface.api:270
u64 tx_broadcast_bytes
byte counter
Definition: interface.api:275
u64 tx_broadcast_packets
packet counter
Definition: interface.api:274
u64 rx_unicast_packets
packet counter
Definition: interface.api:262
option version
Definition: interface.api:1
int i32
Definition: types.h:81
u64 bytes
byte counter
Definition: interface.api:234
unsigned long u64
Definition: types.h:89
u64 rx_unicast_bytes
byte counter
Definition: interface.api:263
u64 tx_packets
packet counter
Definition: interface.api:268
u64 packets
packet counter
Definition: interface.api:233
u64 tx_multicast_bytes
byte counter
Definition: interface.api:273
u64 rx_broadcast_packets
packet counter
Definition: interface.api:266
u64 rx_broadcast_bytes
byte counter
Definition: interface.api:267
service
Definition: interface.api:3
u64 rx_multicast_bytes
byte counter
Definition: interface.api:265
static int collect_detailed_interface_stats(void)
Definition: interface.h:677
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
u64 rx_packets
packet counter
Definition: interface.api:260
unsigned char u8
Definition: types.h:56
u64 tx_multicast_packets
packet counter
Definition: interface.api:272