VPPAPIGEN: vppapigen replacement in Python PLY.
[vpp.git] / src / vnet / interface.api
1 option 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 {
12   u32 client_index;
13   u32 context;
14   u32 sw_if_index;
15   /* 1 = up, 0 = down */
16   u8 admin_up_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 {
27   u32 client_index;
28   u32 context;
29   u32 sw_if_index;
30   u16 mtu;
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 {
43   u32 client_index;
44   u32 pid;
45   u32 sw_if_index;
46   u8 admin_up_down;
47   u8 link_up_down;
48   u8 deleted;
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 {
59   u32 client_index;
60   u32 context;
61   u32 enable_disable;
62   u32 pid;
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 {
96   u32 context;
97   u32 sw_if_index;
98
99   /* index of sup interface (e.g. hw interface).
100      equal to sw_if_index for super hw interface. */
101   u32 sup_sw_if_index;
102
103   /* Layer 2 address, if applicable */
104   u32 l2_address_length;
105   u8 l2_address[8];
106
107   /* Interface name */
108   u8 interface_name[64];
109
110   /* 1 = up, 0 = down */
111   u8 admin_up_down;
112   u8 link_up_down;
113
114   /* 1 = half duplex, 2 = full duplex */
115   u8 link_duplex;
116
117   /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
118   u8 link_speed;
119
120   /* MTU */
121   u16 link_mtu;
122
123   /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
124   u32 sub_id;
125
126   /* 0 = dot1q, 1=dot1ad */
127   u8 sub_dot1ad;
128   /* 1 = dot1h, 1=otherwise */
129   u8 sub_dot1ah;
130
131   /* Number of tags 0-2 */
132   u8 sub_number_of_tags;
133   u16 sub_outer_vlan_id;
134   u16 sub_inner_vlan_id;
135   u8 sub_exact_match;
136   u8 sub_default;
137   u8 sub_outer_vlan_id_any;
138   u8 sub_inner_vlan_id_any;
139
140   /* vlan tag rewrite state */
141   u32 vtr_op;
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 */
148   u16 outer_tag;
149   u8  b_dmac[6];
150   u8  b_smac[6];
151   u16 b_vlanid;
152   u32 i_sid;
153 };
154
155 /* works */
156 define sw_interface_dump
157 {
158   u32 client_index;
159   u32 context;
160   u8 name_filter_valid;
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 {
176   u32 client_index;
177   u32 context;
178   u32 sw_if_index;
179   u8 is_add;
180   u8 is_ipv6;
181   u8 del_all;
182   u8 address_length;
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 {
195   u32 client_index;
196   u32 context;
197   u32 sw_if_index;
198   u8 is_ipv6;
199   u32 vrf_id;
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 {
209   u32 client_index;
210   u32 context;
211   u32 sw_if_index;
212   u8 is_ipv6;
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 {
221   u32 context;
222   i32 retval;
223   u32 vrf_id;
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 {
242   u32 sw_if_index;
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 {
264   u32 sw_if_index;
265   u64 drop;
266   u64 punt;
267   u64 rx_ip4;
268   u64 rx_ip6;
269   u64 rx_no_buffer;
270   u64 rx_miss;
271   u64 rx_error;
272   u64 tx_error;
273   u64 rx_mpls;
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 {
287   u8 vnet_counter_type;
288   u32 first_sw_if_index;
289   u32 count;
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 {
304   u8 vnet_counter_type;
305   u32 first_sw_if_index;
306   u32 count;
307   vl_api_vlib_counter_t data[count];
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 {
319   u32 count;
320   u32 timestamp;
321   vl_api_vnet_simple_counter_t data[count];
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 {
331   u32 count;
332   u32 timestamp;
333   vl_api_vnet_combined_counter_t data[count];
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 {
345   u32 client_index;
346   u32 context;
347   u32 sw_if_index;              /* use this intfc address */
348   u32 unnumbered_sw_if_index;   /* on this interface */
349   u8 is_add;
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 {
359   u32 client_index;
360   u32 context;
361   u32 sw_if_index;
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 {
373     u32 client_index;
374     u32 context;
375     u8 is_add;
376     u32 sw_if_index;
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 {
388     u32 client_index;
389     u32 context;
390     u32 sw_if_index;
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 {
406     u32 client_index;
407     u32 context;
408     u32 sw_if_index;
409     u8 queue_id_valid;
410     u32 queue_id;
411     u8 mode;
412 };
413
414 /* Gross kludge, DGMS */
415 autoreply define interface_name_renumber
416 {
417   u32 client_index;
418   u32 context;
419   u32 sw_if_index;
420   u32 new_show_dev_instance;
421 };
422
423 define create_subif
424 {
425   u32 client_index;
426   u32 context;
427   u32 sw_if_index;
428   u32 sub_id;
429
430   /* These fields map directly onto the subif template */
431   u8 no_tags;
432   u8 one_tag;
433   u8 two_tags;
434   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
435   u8 exact_match;
436   u8 default_sub;
437   u8 outer_vlan_id_any;
438   u8 inner_vlan_id_any;
439   u16 outer_vlan_id;
440   u16 inner_vlan_id;
441 };
442
443 define create_subif_reply
444 {
445   u32 context;
446   i32 retval;
447   u32 sw_if_index;
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 {
458   u32 client_index;
459   u32 context;
460   u32 sw_if_index;
461   u32 vlan_id;
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 {
471   u32 context;
472   i32 retval;
473   u32 sw_if_index;
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 {
482   u32 client_index;
483   u32 context;
484   u32 sw_if_index;
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 {
494   u32 client_index;
495   u32 context;
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 {
506   u32 context;
507   i32 retval;
508   u32 sw_if_index;
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 {
520   u32 client_index;
521   u32 context;
522   u8 mac_address[6];
523   u8 is_specified;
524   u32 user_instance;
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 {
534   u32 context;
535   i32 retval;
536   u32 sw_if_index;
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 {
546   u32 client_index;
547   u32 context;
548   u32 sw_if_index;
549 };
550
551 /*
552  * Local Variables:
553  * eval: (c-set-style "gnu")
554  * End:
555  */