FD.io VPP  v18.01.2-1-g9b554f3
Vector Packet Processing
interface.api
Go to the documentation of this file.
1 vl_api_version 1.0.0
2 
3 /** \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.
9 */
10 autoreply define sw_interface_set_flags
11 {
15  /* 1 = up, 0 = down */
17 };
18 
19 /** \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 */
25 autoreply define sw_interface_set_mtu
26 {
31 };
32 
33 /** \brief Interface Event generated by want_interface_events
34  @param client_index - opaque cookie to identify the sender
35  @param pid - client pid registered to receive notification
36  @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 */
41 define sw_interface_event
42 {
49 };
50 
51 /** \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 */
57 autoreply define want_interface_events
58 {
63 };
64 
65 /** \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
73  @param link_MTU - max. transmittion unit
74  @param sub_if_id - A number 0-N to uniquely identify this subif on super if
75  @param sub_dot1ad - 0 = dot1q, 1 = dot1ad
76  @param sub_dot1ah - 1 = dot1ah, 0 = otherwise
77  @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
88  @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
93 */
94 define sw_interface_details
95 {
98 
99  /* index of sup interface (e.g. hw interface).
100  equal to sw_if_index for super hw interface. */
102 
103  /* Layer 2 address, if applicable */
105  u8 l2_address[8];
106 
107  /* Interface name */
108  u8 interface_name[64];
109 
110  /* 1 = up, 0 = down */
113 
114  /* 1 = half duplex, 2 = full duplex */
116 
117  /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
119 
120  /* MTU */
122 
123  /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
125 
126  /* 0 = dot1q, 1=dot1ad */
128  /* 1 = dot1h, 1=otherwise */
130 
131  /* Number of tags 0-2 */
139 
140  /* vlan tag rewrite state */
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];
146 
147  /* pbb tag rewrite info */
149  u8 b_dmac[6];
150  u8 b_smac[6];
153 };
154 
155 /* works */
156 define sw_interface_dump
157 {
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 */
174 autoreply define sw_interface_add_del_address
175 {
183  u8 address[16];
184 };
185 
186 /** \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 */
193 autoreply define sw_interface_set_table
194 {
200 };
201 
202 /** \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 */
207 define sw_interface_get_table
208 {
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 */
219 define sw_interface_get_table_reply
220 {
224 };
225 
226 typeonly manual_print manual_endian define vlib_counter
227 {
228  u64 packets; /**< packet counter */
229  u64 bytes; /**< byte counter */
230 };
231 
232 /** \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 */
240 typeonly manual_print manual_endian define vnet_combined_counter
241 {
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 */
262 typeonly manual_print manual_endian define vnet_simple_counter
263 {
274 };
275 
276 /** \brief Simple stats counters structure
277  @param vnet_counter_type- such as ip4, ip6, punts, etc
278  @param first_sw_if_index - first sw index in block of index, counts
279  @param count - number of counters, equal to the number of interfaces in
280  this stats block
281  @param data - contiguous block of u64 counters
282 
283  vnet_counter_type defined in enums - plural - in vnet/interface.h
284 */
285 manual_print manual_endian define vnet_interface_simple_counters
286 {
290  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
299 
300  vnet_counter_type defined in enums - plural - in vnet/interface.h
301 */
302 manual_print manual_endian define vnet_interface_combined_counters
303 {
308 };
309 
310 
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 */
317 manual_print manual_endian define vnet_per_interface_simple_counters
318 {
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 */
329 manual_print manual_endian define vnet_per_interface_combined_counters
330 {
334 };
335 
336 /** \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 */
343 autoreply define sw_interface_set_unnumbered
344 {
347  u32 sw_if_index; /* use this intfc address */
348  u32 unnumbered_sw_if_index; /* on this interface */
350 };
351 
352 /** \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 */
357 autoreply define sw_interface_clear_stats
358 {
362 };
363 
364 /** \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 */
371 autoreply define sw_interface_tag_add_del
372 {
377  u8 tag[64];
378 };
379 
380 /** \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 */
386 autoreply define sw_interface_set_mac_address
387 {
391  u8 mac_address[6];
392 };
393 
394 /** \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 */
404 autoreply define sw_interface_set_rx_mode
405 {
412 };
413 
414 /* Gross kludge, DGMS */
415 autoreply define interface_name_renumber
416 {
421 };
422 
423 define create_subif
424 {
429 
430  /* These fields map directly onto the subif template */
434  u8 dot1ad; // 0 = dot1q, 1=dot1ad
441 };
442 
443 define create_subif_reply
444 {
448 };
449 
450 /** \brief Create a new subinterface with the given vlan id
451  @param client_index - opaque cookie to identify the sender
452  @param context - sender context, to match reply w/ request
453  @param sw_if_index - software index of the new vlan's parent interface
454  @param vlan_id - vlan tag of the new interface
455 */
456 define create_vlan_subif
457 {
462 };
463 
464 /** \brief Reply for the vlan subinterface create request
465  @param context - returned sender context, to match reply w/ request
466  @param retval - return code
467  @param sw_if_index - software index allocated for the new subinterface
468 */
469 define create_vlan_subif_reply
470 {
474 };
475 
476 /** \brief Delete sub interface request
477  @param client_index - opaque cookie to identify the sender
478  @param context - sender context, to match reply w/ request
479  @param sw_if_index - sw index of the interface that was created by create_subif
480 */
481 autoreply define delete_subif {
485 };
486 
487 /** \brief Create loopback interface request
488  @param client_index - opaque cookie to identify the sender
489  @param context - sender context, to match reply w/ request
490  @param mac_address - mac addr to assign to the interface if none-zero
491 */
492 define create_loopback
493 {
496  u8 mac_address[6];
497 };
498 
499 /** \brief Create loopback interface response
500  @param context - sender context, to match reply w/ request
501  @param sw_if_index - sw index of the interface that was created
502  @param retval - return code for the request
503 */
504 define create_loopback_reply
505 {
509 };
510 
511 /** \brief Create loopback interface instance request
512  @param client_index - opaque cookie to identify the sender
513  @param context - sender context, to match reply w/ request
514  @param mac_address - mac addr to assign to the interface if none-zero
515  @param is_specified - if non-0, a specific user_instance is being requested
516  @param user_instance - requested instance, ~0 => dynamically allocate
517 */
518 define create_loopback_instance
519 {
522  u8 mac_address[6];
525 };
526 
527 /** \brief Create loopback interface instance response
528  @param context - sender context, to match reply w/ request
529  @param sw_if_index - sw index of the interface that was created
530  @param retval - return code for the request
531 */
532 define create_loopback_instance_reply
533 {
537 };
538 
539 /** \brief Delete loopback interface request
540  @param client_index - opaque cookie to identify the sender
541  @param context - sender context, to match reply w/ request
542  @param sw_if_index - sw index of the interface that was created
543 */
544 autoreply define delete_loopback
545 {
549 };
550 
551 /*
552  * Local Variables:
553  * eval: (c-set-style "gnu")
554  * End:
555  */
#define vl_api_version(n, v)
Definition: jvpp_registry.c:18
int i32
Definition: types.h:81
u64 bytes
byte counter
Definition: interface.api:229
unsigned long u64
Definition: types.h:89
u64 tx_packets
packet counter
Definition: interface.api:245
u64 packets
packet counter
Definition: interface.api:228
unsigned int u32
Definition: types.h:88
Combined interface counter data type for vnet_interface_combined_counters.
Definition: interface.api:240
size_t count
Definition: vapi.c:42
unsigned short u16
Definition: types.h:57
u64 rx_packets
packet counter
Definition: interface.api:243
unsigned char u8
Definition: types.h:56
Simple interface counter data type for vnet_interface_simple_counters.
Definition: interface.api:262