API refactoring : dhcp
[vpp.git] / src / vpp / api / vpe.api
1 /*
2  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 /** \file
17
18     This file defines vpe control-plane API messages which are generally
19     called through a shared memory interface. 
20 */
21
22 /* 
23  * Note: API placement cleanup in progress
24  * If you're looking for interface APIs, please
25  * see .../src/vnet/{interface.api,interface_api.c}
26  * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
27  * TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
28  * VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
29  * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
30  * NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}
31  * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
32  * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
33  * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
34  * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
35  * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
36  * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
37  * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
38  * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
39  * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
40  * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
41  * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
42  * SR APIs: see .../src/vnet/sr/{sr.api, sr_api.c}
43  * DPDK APIs: see ... /src/vnet/devices/dpdk/{dpdk.api, dpdk_api.c}
44  * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
45  * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
46  * DHCP APIs: see ... /src/vnet/dhcp/{dhcpk.api, dhcp_api.c}
47  */
48
49 /** \brief Create a new subinterface with the given vlan id
50     @param client_index - opaque cookie to identify the sender
51     @param context - sender context, to match reply w/ request
52     @param sw_if_index - software index of the new vlan's parent interface
53     @param vlan_id - vlan tag of the new interface
54 */
55 define create_vlan_subif
56 {
57   u32 client_index;
58   u32 context;
59   u32 sw_if_index;
60   u32 vlan_id;
61 };
62
63 /** \brief Reply for the vlan subinterface create request
64     @param context - returned sender context, to match reply w/ request
65     @param retval - return code
66     @param sw_if_index - software index allocated for the new subinterface
67 */
68 define create_vlan_subif_reply
69 {
70   u32 context;
71   i32 retval;
72   u32 sw_if_index;
73 };
74
75 /** \brief Enable or Disable MPLS on and interface
76     @param client_index - opaque cookie to identify the sender
77     @param context - sender context, to match reply w/ request
78     @param sw_if_index - index of the interface
79     @param enable - if non-zero enable, else disable
80 */
81 define sw_interface_set_mpls_enable
82 {
83   u32 client_index;
84   u32 context;
85   u32 sw_if_index;
86   u8 enable;
87 };
88
89 /** \brief Reply for MPLS state on an interface
90     @param context - returned sender context, to match reply w/ request
91     @param retval - return code
92 */
93 define sw_interface_set_mpls_enable_reply
94 {
95   u32 context;
96   i32 retval;
97 };
98
99 /** \brief Proxy ARP add / del request
100     @param client_index - opaque cookie to identify the sender
101     @param context - sender context, to match reply w/ request
102     @param vrf_id - VRF / Fib table ID
103     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
104     @param low_address[4] - Low address of the Proxy ARP range
105     @param hi_address[4] - High address of the Proxy ARP range
106 */
107 define proxy_arp_add_del
108 {
109   u32 client_index;
110   u32 context;
111   u32 vrf_id;
112   u8 is_add;
113   u8 low_address[4];
114   u8 hi_address[4];
115 };
116
117 /** \brief Reply for proxy arp add / del request
118     @param context - returned sender context, to match reply w/ request
119     @param retval - return code
120 */
121 define proxy_arp_add_del_reply
122 {
123   u32 context;
124   i32 retval;
125 };
126
127 /** \brief Proxy ARP add / del request
128     @param client_index - opaque cookie to identify the sender
129     @param context - sender context, to match reply w/ request
130     @param sw_if_index - Which interface to enable / disable Proxy Arp on
131     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
132 */
133 define proxy_arp_intfc_enable_disable
134 {
135   u32 client_index;
136   u32 context;
137   u32 sw_if_index;
138   /* 1 = on, 0 = off */
139   u8 enable_disable;
140 };
141
142 /** \brief Reply for Proxy ARP interface enable / disable request
143     @param context - returned sender context, to match reply w/ request
144     @param retval - return code
145 */
146 define proxy_arp_intfc_enable_disable_reply
147 {
148   u32 context;
149   i32 retval;
150 };
151
152 /** \brief Reset VRF (remove all routes etc) request
153     @param client_index - opaque cookie to identify the sender
154     @param context - sender context, to match reply w/ request
155     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
156     @param vrf_id - ID of th FIB table / VRF to reset
157 */
158 define reset_vrf
159 {
160   u32 client_index;
161   u32 context;
162   u8 is_ipv6;
163   u32 vrf_id;
164 };
165
166 /** \brief Reply for Reset VRF request
167     @param context - returned sender context, to match reply w/ request
168     @param retval - return code
169 */
170 define reset_vrf_reply
171 {
172   u32 context;
173   i32 retval;
174 };
175
176 /** \brief Is Address Reachable request - DISABLED
177     @param client_index - opaque cookie to identify the sender
178     @param context - sender context, to match reply w/ request
179     @param next_hop_sw_if_index - index of interface used to get to next hop
180     @param is_ipv6 - 1 for IPv6, 0 for IPv4
181     @param is_error - address not found or does not match intf
182     @param address[] - Address in question 
183 */
184 define is_address_reachable
185 {
186   u32 client_index;             /* (api_main_t *) am->my_client_index */
187   u32 context;
188   u32 next_hop_sw_if_index;
189   u8 is_known;                  /* on reply, this is the answer */
190   u8 is_ipv6;
191   u8 is_error;                  /* address not found or does not match intf */
192   u8 address[16];
193 };
194
195 /** \brief Want Stats, register for stats updates
196     @param client_index - opaque cookie to identify the sender
197     @param context - sender context, to match reply w/ request
198     @param enable_disable - 1 = enable stats, 0 = disable
199     @param pid - pid of process requesting stats updates
200 */
201 define want_stats
202 {
203   u32 client_index;
204   u32 context;
205   u32 enable_disable;
206   u32 pid;
207 };
208
209 /** \brief Reply for Want Stats request
210     @param context - returned sender context, to match reply w/ request
211     @param retval - return code
212 */
213 define want_stats_reply
214 {
215   u32 context;
216   i32 retval;
217 };
218
219 typeonly manual_print manual_endian define ip4_fib_counter
220 {
221   u32 address;
222   u8 address_length;
223   u64 packets;
224   u64 bytes;
225 };
226
227 manual_print manual_endian define vnet_ip4_fib_counters
228 {
229   u32 vrf_id;
230   u32 count;
231   vl_api_ip4_fib_counter_t c[count];
232 };
233
234 typeonly manual_print manual_endian define ip4_nbr_counter
235 {
236   u32 address;
237   u8  link_type;
238   u64 packets;
239   u64 bytes;
240 };
241
242 /**
243  * @brief Per-neighbour (i.e. per-adjacency) coutners
244  * @param count The size of the array of counters
245  * @param sw_if_index The interface the adjacency is on
246  * @param begin Flag to indicate this is the first set of stats for this
247  *        interface. If this flag is not set the it is a continuation of
248  *        stats for this interface
249  * @param  c counters
250  */
251 manual_print manual_endian define vnet_ip4_nbr_counters
252 {
253   u32 count;
254   u32 sw_if_index;
255   u8 begin;
256   vl_api_ip4_nbr_counter_t c[count];
257 };
258
259 typeonly manual_print manual_endian define ip6_fib_counter
260 {
261   u64 address[2];
262   u8 address_length;
263   u64 packets;
264   u64 bytes;
265 };
266
267 manual_print manual_endian define vnet_ip6_fib_counters
268 {
269   u32 vrf_id;
270   u32 count;
271   vl_api_ip6_fib_counter_t c[count];
272 };
273
274 typeonly manual_print manual_endian define ip6_nbr_counter
275 {
276   u64 address[2];
277   u8  link_type;
278   u64 packets;
279   u64 bytes;
280 };
281
282 manual_print manual_endian define vnet_ip6_nbr_counters
283 {
284   u32 count;
285   u32 sw_if_index;
286   u8 begin;
287   vl_api_ip6_nbr_counter_t c[count];
288 };
289
290 /** \brief Request for a single block of summary stats
291     @param client_index - opaque cookie to identify the sender
292     @param context - sender context, to match reply w/ request
293 */
294 define vnet_get_summary_stats
295 {
296   u32 client_index;
297   u32 context;
298 };
299
300 /** \brief Reply for vnet_get_summary_stats request
301     @param context - sender context, to match reply w/ request
302     @param retval - return code for request
303     @param total_pkts -  
304     @param total_bytes -
305     @param vector_rate - 
306 */
307 define vnet_summary_stats_reply
308 {
309   u32 context;
310   i32 retval;
311   u64 total_pkts[2];
312   u64 total_bytes[2];
313   f64 vector_rate;
314 };
315
316 /** \brief OAM event structure
317     @param dst_address[] - 
318     @param state
319 */
320 define oam_event
321 {
322   u8 dst_address[4];
323   u8 state;
324 };
325
326 /** \brief Want OAM events request
327     @param client_index - opaque cookie to identify the sender
328     @param context - sender context, to match reply w/ request
329     @param enable_disable- enable if non-zero, else disable
330     @param pid - pid of the requesting process
331 */
332 define want_oam_events
333 {
334   u32 client_index;
335   u32 context;
336   u32 enable_disable;
337   u32 pid;
338 };
339
340 /** \brief Want OAM events response
341     @param context - sender context, to match reply w/ request
342     @param retval - return code for the want oam stats request
343 */
344 define want_oam_events_reply
345 {
346   u32 context;
347   i32 retval;
348 };
349
350 /** \brief OAM add / del target request
351     @param client_index - opaque cookie to identify the sender
352     @param context - sender context, to match reply w/ request
353     @param vrf_id - vrf_id of the target
354     @param src_address[] - source address to use for the updates 
355     @param dst_address[] - destination address of the target
356     @param is_add - add target if non-zero, else delete
357 */
358 define oam_add_del
359 {
360   u32 client_index;
361   u32 context;
362   u32 vrf_id;
363   u8 src_address[4];
364   u8 dst_address[4];
365   u8 is_add;
366 };
367
368 /** \brief OAM add / del target response
369     @param context - sender context, to match reply w/ request
370     @param retval - return code of the request
371 */
372 define oam_add_del_reply
373 {
374   u32 context;
375   i32 retval;
376 };
377
378 /** \brief Reset fib table request
379     @param client_index - opaque cookie to identify the sender
380     @param context - sender context, to match reply w/ request
381     @param vrf_id - vrf/table id of the fib table to reset
382     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
383 */
384 define reset_fib
385 {
386   u32 client_index;
387   u32 context;
388   u32 vrf_id;
389   u8 is_ipv6;
390 };
391
392 /** \brief Reset fib response
393     @param context - sender context, to match reply w/ request
394     @param retval - return code for the reset bfib request
395 */
396 define reset_fib_reply
397 {
398   u32 context;
399   i32 retval;
400 };
401
402 /** \brief Create loopback interface request
403     @param client_index - opaque cookie to identify the sender
404     @param context - sender context, to match reply w/ request
405     @param mac_address - mac addr to assign to the interface if none-zero
406 */
407 define create_loopback
408 {
409   u32 client_index;
410   u32 context;
411   u8 mac_address[6];
412 };
413
414 /** \brief Create loopback interface response
415     @param context - sender context, to match reply w/ request
416     @param sw_if_index - sw index of the interface that was created
417     @param retval - return code for the request
418 */
419 define create_loopback_reply
420 {
421   u32 context;
422   i32 retval;
423   u32 sw_if_index;
424 };
425
426 /** \brief Delete loopback interface request
427     @param client_index - opaque cookie to identify the sender
428     @param context - sender context, to match reply w/ request
429     @param sw_if_index - sw index of the interface that was created
430 */
431 define delete_loopback
432 {
433   u32 client_index;
434   u32 context;
435   u32 sw_if_index;
436 };
437
438 /** \brief Delete loopback interface response
439     @param context - sender context, to match reply w/ request
440     @param retval - return code for the request
441 */
442 define delete_loopback_reply
443 {
444   u32 context;
445   i32 retval;
446 };
447
448 /** \brief Control ping from client to api server request
449     @param client_index - opaque cookie to identify the sender
450     @param context - sender context, to match reply w/ request
451 */
452 define control_ping
453 {
454   u32 client_index;
455   u32 context;
456 };
457
458 /** \brief Control ping from the client to the server response
459     @param client_index - opaque cookie to identify the sender
460     @param context - sender context, to match reply w/ request
461     @param retval - return code for the request
462     @param vpe_pid - the pid of the vpe, returned by the server
463 */
464 define control_ping_reply
465 {
466   u32 context;
467   i32 retval;
468   u32 client_index;
469   u32 vpe_pid;
470 };
471
472 /** \brief Process a vpe parser cli string request
473     @param client_index - opaque cookie to identify the sender
474     @param context - sender context, to match reply w/ request
475     @param cmd_in_shmem - pointer to cli command string
476 */
477 define cli_request
478 {
479   u32 client_index;
480   u32 context;
481   u64 cmd_in_shmem;
482 };
483 define cli_inband
484 {
485   u32 client_index;
486   u32 context;
487   u32 length;
488   u8 cmd[length];
489 };
490
491 /** \brief vpe parser cli string response
492     @param context - sender context, to match reply w/ request
493     @param retval - return code for request
494     @param reply_in_shmem - Reply string from cli processing if any
495 */
496 define cli_reply
497 {
498   u32 context;
499   i32 retval;
500   u64 reply_in_shmem;
501 };
502 define cli_inband_reply
503 {
504   u32 context;
505   i32 retval;
506   u32 length;
507   u8 reply[length];
508 };
509
510 /** \brief Set max allowed ARP or ip6 neighbor entries request
511     @param client_index - opaque cookie to identify the sender
512     @param context - sender context, to match reply w/ request
513     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
514     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
515 */
516 define set_arp_neighbor_limit
517 {
518   u32 client_index;
519   u32 context;
520   u8 is_ipv6;
521   u32 arp_neighbor_limit;
522 };
523
524 /** \brief Set max allowed ARP or ip6 neighbor entries response
525     @param context - sender context, to match reply w/ request
526     @param retval - return code for request
527 */
528 define set_arp_neighbor_limit_reply
529 {
530   u32 context;
531   i32 retval;
532 };
533
534 /** \brief L2 interface patch add / del request
535     @param client_index - opaque cookie to identify the sender
536     @param context - sender context, to match reply w/ request
537     @param rx_sw_if_index - receive side interface 
538     @param tx_sw_if_index - transmit side interface
539     @param is_add - if non-zero set up the interface patch, else remove it
540 */
541 define l2_patch_add_del
542 {
543   u32 client_index;
544   u32 context;
545   u32 rx_sw_if_index;
546   u32 tx_sw_if_index;
547   u8 is_add;
548 };
549
550 /** \brief L2 interface patch add / del response
551     @param context - sender context, to match reply w/ request
552     @param retval - return code for the request
553 */
554 define l2_patch_add_del_reply
555 {
556   u32 context;
557   i32 retval;
558 };
559
560 /** \brief Interface set vpath request
561     @param client_index - opaque cookie to identify the sender
562     @param context - sender context, to match reply w/ request
563     @param sw_if_index - interface used to reach neighbor
564     @param enable - if non-zero enable, else disable
565 */
566 define sw_interface_set_vpath
567 {
568   u32 client_index;
569   u32 context;
570   u32 sw_if_index;
571   u8 enable;
572 };
573
574 /** \brief Interface set vpath response
575     @param context - sender context, to match reply w/ request
576     @param retval - return code for the request
577 */
578 define sw_interface_set_vpath_reply
579 {
580   u32 context;
581   i32 retval;
582 };
583
584 /** \brief Set L2 XConnect between two interfaces request
585     @param client_index - opaque cookie to identify the sender
586     @param context - sender context, to match reply w/ request
587     @param rx_sw_if_index - Receive interface index
588     @param tx_sw_if_index - Transmit interface index
589     @param enable - enable xconnect if not 0, else set to L3 mode
590 */
591 define sw_interface_set_l2_xconnect
592 {
593   u32 client_index;
594   u32 context;
595   u32 rx_sw_if_index;
596   u32 tx_sw_if_index;
597   u8 enable;
598 };
599
600 /** \brief Set L2 XConnect response
601     @param context - sender context, to match reply w/ request
602     @param retval - L2 XConnect request return code
603 */
604 define sw_interface_set_l2_xconnect_reply
605 {
606   u32 context;
607   i32 retval;
608 };
609
610 /** \brief Interface bridge mode request
611     @param client_index - opaque cookie to identify the sender
612     @param context - sender context, to match reply w/ request
613     @param rx_sw_if_index - the interface
614     @param bd_id - bridge domain id
615     @param bvi - Setup interface as a bvi, bridge mode only
616     @param shg - Shared horizon group, for bridge mode only
617     @param enable - Enable beige mode if not 0, else set to L3 mode
618 */
619 define sw_interface_set_l2_bridge
620 {
621   u32 client_index;
622   u32 context;
623   u32 rx_sw_if_index;
624   u32 bd_id;
625   u8 shg;
626   u8 bvi;
627   u8 enable;
628 };
629
630 /** \brief Interface bridge mode response
631     @param context - sender context, to match reply w/ request
632     @param retval - Bridge mode request return code
633 */
634 define sw_interface_set_l2_bridge_reply
635 {
636   u32 context;
637   i32 retval;
638 };
639
640 /** \brief Set bridge domain ip to mac entry request
641     @param client_index - opaque cookie to identify the sender
642     @param context - sender context, to match reply w/ request
643     @param bd_id - the bridge domain to set the flags for
644     @param is_add - if non-zero, add the entry, else clear it
645     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
646     @param mac_address - MAC address
647     @param 
648 */
649 define bd_ip_mac_add_del
650 {
651   u32 client_index;
652   u32 context;
653   u32 bd_id;
654   u8 is_add;
655   u8 is_ipv6;
656   u8 ip_address[16];
657   u8 mac_address[6];
658 };
659
660 /** \brief Set bridge domain ip to mac entry response
661     @param context - sender context, to match reply w/ request
662     @param retval - return code for the set bridge flags request
663 */
664 define bd_ip_mac_add_del_reply
665 {
666   u32 context;
667   i32 retval;
668 };
669
670 /** \brief Set/unset the classification table for an interface request 
671     @param client_index - opaque cookie to identify the sender
672     @param context - sender context, to match reply w/ request
673     @param is_ipv6 - ipv6 if non-zero, else ipv4
674     @param sw_if_index - interface to associate with the table
675     @param table_index - index of the table, if ~0 unset the table
676 */
677 define classify_set_interface_ip_table
678 {
679   u32 client_index;
680   u32 context;
681   u8 is_ipv6;
682   u32 sw_if_index;
683   u32 table_index;              /* ~0 => off */
684 };
685
686 /** \brief Set/unset interface classification table response 
687     @param context - sender context, to match reply w/ request
688     @param retval - return code
689 */
690 define classify_set_interface_ip_table_reply
691 {
692   u32 context;
693   i32 retval;
694 };
695
696 /** \brief Set/unset l2 classification tables for an interface request
697     @param client_index - opaque cookie to identify the sender
698     @param context - sender context, to match reply w/ request
699     @param sw_if_index - interface to set/unset tables for
700     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
701     @param ip6_table_index - ip6 index
702     @param other_table_index - other index
703 */
704 define classify_set_interface_l2_tables
705 {
706   u32 client_index;
707   u32 context;
708   u32 sw_if_index;
709   /* 3 x ~0 => off */
710   u32 ip4_table_index;
711   u32 ip6_table_index;
712   u32 other_table_index;
713   u8 is_input;
714 };
715
716 /** \brief Set/unset l2 classification tables for an interface response
717     @param context - sender context, to match reply w/ request
718     @param retval - return code for the request
719 */
720 define classify_set_interface_l2_tables_reply
721 {
722   u32 context;
723   i32 retval;
724 };
725
726 /** \brief Get node index using name request
727     @param client_index - opaque cookie to identify the sender
728     @param context - sender context, to match reply w/ request
729     @param node_name[] - name of the node
730 */
731 define get_node_index
732 {
733   u32 client_index;
734   u32 context;
735   u8 node_name[64];
736 };
737
738 /** \brief Get node index using name request
739     @param context - sender context, to match reply w/ request
740     @param retval - return code for the request
741     @param node_index - index of the desired node if found, else ~0
742 */
743 define get_node_index_reply
744 {
745   u32 context;
746   i32 retval;
747   u32 node_index;
748 };
749
750 /** \brief Set the next node for a given node request
751     @param client_index - opaque cookie to identify the sender
752     @param context - sender context, to match reply w/ request
753     @param node_name[] - node to add the next node to
754     @param next_name[] - node to add as the next node
755 */
756 define add_node_next
757 {
758   u32 client_index;
759   u32 context;
760   u8 node_name[64];
761   u8 next_name[64];
762 };
763
764 /** \brief IP Set the next node for a given node response
765     @param context - sender context, to match reply w/ request
766     @param retval - return code for the add next node request
767     @param next_index - the index of the next node if success, else ~0
768 */
769 define add_node_next_reply
770 {
771   u32 context;
772   i32 retval;
773   u32 next_index;
774 };
775
776 /** \brief L2 interface ethernet flow point filtering enable/disable request
777     @param client_index - opaque cookie to identify the sender
778     @param context - sender context, to match reply w/ request
779     @param sw_if_index - interface to enable/disable filtering on
780     @param enable_disable - if non-zero enable filtering, else disable
781 */
782 define l2_interface_efp_filter
783 {
784   u32 client_index;
785   u32 context;
786   u32 sw_if_index;
787   u32 enable_disable;
788 };
789
790 /** \brief L2 interface ethernet flow point filtering response
791     @param context - sender context, to match reply w/ request
792     @param retval - return code for the request
793 */
794 define l2_interface_efp_filter_reply
795 {
796   u32 context;
797   i32 retval;
798 };
799
800 /** \brief L2 interface vlan tag rewrite configure request
801     @param client_index - opaque cookie to identify the sender
802     @param context - sender context, to match reply w/ request
803     @param sw_if_index - interface the operation is applied to
804     @param vtr_op - Choose from l2_vtr_op_t enum values
805     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
806     @param tag1 - Needed for any push or translate vtr op
807     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
808 */
809 define l2_interface_vlan_tag_rewrite
810 {
811   u32 client_index;
812   u32 context;
813   u32 sw_if_index;
814   u32 vtr_op;
815   u32 push_dot1q;               // ethertype of first pushed tag is dot1q/dot1ad
816   u32 tag1;                     // first pushed tag
817   u32 tag2;                     // second pushed tag
818 };
819
820 /** \brief L2 interface vlan tag rewrite response
821     @param context - sender context, to match reply w/ request
822     @param retval - return code for the request
823 */
824 define l2_interface_vlan_tag_rewrite_reply
825 {
826   u32 context;
827   i32 retval;
828 };
829
830 define create_subif
831 {
832   u32 client_index;
833   u32 context;
834   u32 sw_if_index;
835   u32 sub_id;
836
837   /* These fields map directly onto the subif template */
838   u8 no_tags;
839   u8 one_tag;
840   u8 two_tags;
841   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
842   u8 exact_match;
843   u8 default_sub;
844   u8 outer_vlan_id_any;
845   u8 inner_vlan_id_any;
846   u16 outer_vlan_id;
847   u16 inner_vlan_id;
848 };
849
850 define create_subif_reply
851 {
852   u32 context;
853   i32 retval;
854   u32 sw_if_index;
855 };
856
857 /** \brief show version
858     @param client_index - opaque cookie to identify the sender
859     @param context - sender context, to match reply w/ request
860 */
861 define show_version
862 {
863   u32 client_index;
864   u32 context;
865 };
866
867 /** \brief show version response
868     @param context - sender context, to match reply w/ request
869     @param retval - return code for the request
870     @param program - name of the program (vpe)
871     @param version  - version of the program
872     @param build_directory - root of the workspace where the program was built
873 */
874 define show_version_reply
875 {
876   u32 context;
877   i32 retval;
878   u8 program[32];
879   u8 version[32];
880   u8 build_date[32];
881   u8 build_directory[256];
882 };
883
884 /* Gross kludge, DGMS */
885 define interface_name_renumber
886 {
887   u32 client_index;
888   u32 context;
889   u32 sw_if_index;
890   u32 new_show_dev_instance;
891 };
892
893 define interface_name_renumber_reply
894 {
895   u32 context;
896   i32 retval;
897 };
898
899 /** \brief Register for ip4 arp resolution events
900     @param client_index - opaque cookie to identify the sender
901     @param context - sender context, to match reply w/ request
902     @param enable_disable - 1 => register for events, 0 => cancel registration
903     @param pid - sender's pid
904     @param address - the exact ip4 address of interest
905 */
906 define want_ip4_arp_events
907 {
908   u32 client_index;
909   u32 context;
910   u8 enable_disable;
911   u32 pid;
912   u32 address;
913 };
914
915 /** \brief Reply for interface events registration
916     @param context - returned sender context, to match reply w/ request
917     @param retval - return code
918 */
919 define want_ip4_arp_events_reply
920 {
921   u32 context;
922   i32 retval;
923 };
924
925 /** \brief Tell client about an ip4 arp resolution event
926     @param client_index - opaque cookie to identify the sender
927     @param context - sender context, to match reply w/ request
928     @param address - the exact ip4 address of interest
929     @param pid - client pid registered to receive notification
930     @param sw_if_index - interface which received ARP packet
931     @param new_mac - the new mac address 
932     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
933 */
934 define ip4_arp_event
935 {
936   u32 client_index;
937   u32 context;
938   u32 address;
939   u32 pid;
940   u32 sw_if_index;
941   u8 new_mac[6];
942   u8 mac_ip;
943 };
944
945 /** \brief Register for ip6 nd resolution events
946     @param client_index - opaque cookie to identify the sender
947     @param context - sender context, to match reply w/ request
948     @param enable_disable - 1 => register for events, 0 => cancel registration
949     @param pid - sender's pid
950     @param address - the exact ip6 address of interest
951 */
952 define want_ip6_nd_events
953 {
954   u32 client_index;
955   u32 context;
956   u8 enable_disable;
957   u32 pid;
958   u8 address[16];
959 };
960
961 /** \brief Reply for ip6 nd resolution events registration
962     @param context - returned sender context, to match reply w/ request
963     @param retval - return code
964 */
965 define want_ip6_nd_events_reply
966 {
967   u32 context;
968   i32 retval;
969 };
970
971 /** \brief Tell client about an ip6 nd resolution or mac/ip event
972     @param client_index - opaque cookie to identify the sender
973     @param context - sender context, to match reply w/ request
974     @param pid - client pid registered to receive notification
975     @param sw_if_index - interface which received ARP packet
976     @param address - the exact ip6 address of interest
977     @param new_mac - the new mac address 
978     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
979 */
980 define ip6_nd_event
981 {
982   u32 client_index;
983   u32 context;
984   u32 pid;
985   u32 sw_if_index;
986   u8 address[16];
987   u8 new_mac[6];
988   u8 mac_ip;
989 };
990     
991 /** \brief Set/unset input ACL interface
992     @param client_index - opaque cookie to identify the sender
993     @param context - sender context, to match reply w/ request
994     @param sw_if_index - interface to set/unset input ACL
995     @param ip4_table_index - ip4 classify table index (~0 for skip)
996     @param ip6_table_index - ip6 classify table index (~0 for skip)
997     @param l2_table_index  -  l2 classify table index (~0 for skip)
998     @param is_add - Set input ACL if non-zero, else unset
999     Note: User is recommeneded to use just one valid table_index per call.
1000           (ip4_table_index, ip6_table_index, or l2_table_index)
1001 */
1002 define input_acl_set_interface
1003 {
1004   u32 client_index;
1005   u32 context;
1006   u32 sw_if_index;
1007   u32 ip4_table_index;
1008   u32 ip6_table_index;
1009   u32 l2_table_index;
1010   u8 is_add;
1011 };
1012
1013 /** \brief Set/unset input ACL interface response
1014     @param context - sender context, to match reply w/ request
1015     @param retval - return code for the request
1016 */
1017 define input_acl_set_interface_reply
1018 {
1019   u32 context;
1020   i32 retval;
1021 };
1022
1023 /** \brief cop: enable/disable junk filtration features on an interface
1024     @param client_index - opaque cookie to identify the sender
1025     @param context - sender context, to match reply w/ request
1026     @param sw_if_inded - desired interface
1027     @param enable_disable - 1 => enable, 0 => disable
1028 */
1029
1030 define cop_interface_enable_disable
1031 {
1032   u32 client_index;
1033   u32 context;
1034   u32 sw_if_index;
1035   u8 enable_disable;
1036 };
1037
1038 /** \brief cop: interface enable/disable junk filtration reply
1039     @param context - returned sender context, to match reply w/ request
1040     @param retval - return code
1041 */
1042
1043 define cop_interface_enable_disable_reply
1044 {
1045   u32 context;
1046   i32 retval;
1047 };
1048
1049 /** \brief cop: enable/disable whitelist filtration features on an interface
1050     Note: the supplied fib_id must match in order to remove the feature!
1051     
1052     @param client_index - opaque cookie to identify the sender
1053     @param context - sender context, to match reply w/ request
1054     @param sw_if_index - interface handle, physical interfaces only
1055     @param fib_id - fib identifier for the whitelist / blacklist fib
1056     @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration
1057     @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration
1058     @param default_cop -  1 => enable non-ip4, non-ip6 filtration 0=> disable it
1059 */
1060
1061 define cop_whitelist_enable_disable
1062 {
1063   u32 client_index;
1064   u32 context;
1065   u32 sw_if_index;
1066   u32 fib_id;
1067   u8 ip4;
1068   u8 ip6;
1069   u8 default_cop;
1070 };
1071
1072 /** \brief cop: interface enable/disable junk filtration reply
1073     @param context - returned sender context, to match reply w/ request
1074     @param retval - return code
1075 */
1076
1077 define cop_whitelist_enable_disable_reply
1078 {
1079   u32 context;
1080   i32 retval;
1081 };
1082
1083 /** \brief get_node_graph - get a copy of the vpp node graph
1084     including the current set of graph arcs.
1085
1086     @param client_index - opaque cookie to identify the sender
1087     @param context - sender context, to match reply w/ request
1088 */
1089
1090 define get_node_graph
1091 {
1092   u32 client_index;
1093   u32 context;
1094 };
1095
1096 /** \brief get_node_graph_reply
1097     @param context - returned sender context, to match reply w/ request
1098     @param retval - return code
1099     @param reply_in_shmem - result from vlib_node_serialize, in shared
1100     memory. Process with vlib_node_unserialize, remember to switch
1101     heaps and free the result.
1102 */
1103
1104 define get_node_graph_reply
1105 {
1106   u32 context;
1107   i32 retval;
1108   u64 reply_in_shmem;
1109 };
1110
1111 /** \brief IOAM enable : Enable in-band OAM
1112     @param id - profile id
1113     @param seqno - To enable Seqno Processing
1114     @param analyse - Enabling analysis of iOAM at decap node 
1115     @param pow_enable - Proof of Work enabled or not flag
1116     @param trace_enable - iOAM Trace enabled or not flag
1117 */
1118 define ioam_enable
1119 {
1120   u32 client_index;
1121   u32 context;
1122   u16 id;
1123   u8 seqno;
1124   u8 analyse;
1125   u8 pot_enable;
1126   u8 trace_enable;
1127   u32 node_id;
1128 };
1129
1130 /** \brief iOAM Trace profile add / del response
1131     @param context - sender context, to match reply w/ request
1132     @param retval - return value for request
1133 */
1134 define ioam_enable_reply
1135 {
1136   u32 context;
1137   i32 retval;
1138 };
1139
1140 /** \brief iOAM disable
1141     @param client_index - opaque cookie to identify the sender
1142     @param context - sender context, to match reply w/ request
1143     @param index - MAP Domain index
1144 */
1145 define ioam_disable
1146 {
1147   u32 client_index;
1148   u32 context;
1149   u16 id;
1150 };
1151
1152 /** \brief iOAM disable response
1153     @param context - sender context, to match reply w/ request
1154     @param retval - return value for request
1155 */
1156 define ioam_disable_reply
1157 {
1158   u32 context;
1159   i32 retval;
1160 };
1161
1162 /** \brief Add/del policer
1163     @param client_index - opaque cookie to identify the sender
1164     @param context - sender context, to match reply w/ request
1165     @param is_add - add policer if non-zero, else delete
1166     @param name - policer name
1167     @param cir - CIR
1168     @param eir - EIR
1169     @param cb - Committed Burst
1170     @param eb - Excess or Peak Burst
1171     @param rate_type - rate type
1172     @param round_type - rounding type
1173     @param type - policer algorithm
1174     @param color_aware - 0=color-blind, 1=color-aware
1175     @param conform_action_type - conform action type
1176     @param conform_dscp - DSCP for conform mar-and-transmit action
1177     @param exceed_action_type - exceed action type
1178     @param exceed_dscp - DSCP for exceed mar-and-transmit action
1179     @param violate_action_type - violate action type
1180     @param violate_dscp - DSCP for violate mar-and-transmit action
1181 */
1182 define policer_add_del
1183 {
1184   u32 client_index;
1185   u32 context;
1186
1187   u8 is_add;
1188   u8 name[64];
1189   u32 cir;
1190   u32 eir;
1191   u64 cb;
1192   u64 eb;
1193   u8 rate_type;
1194   u8 round_type;
1195   u8 type;
1196   u8 color_aware;
1197   u8 conform_action_type;
1198   u8 conform_dscp;
1199   u8 exceed_action_type;
1200   u8 exceed_dscp;
1201   u8 violate_action_type;
1202   u8 violate_dscp;
1203 };
1204
1205 /** \brief Add/del policer response
1206     @param context - sender context, to match reply w/ request
1207     @param retval - return value for request
1208     @param policer_index - for add, returned index of the new policer
1209 */
1210 define policer_add_del_reply
1211 {
1212   u32 context;
1213   i32 retval;
1214   u32 policer_index;
1215 };
1216
1217 /** \brief Get list of policers
1218     @param client_index - opaque cookie to identify the sender
1219     @param context - sender context, to match reply w/ request
1220     @param match_name_valid - if 0 request all policers otherwise use match_name
1221     @param match_name - policer name
1222 */
1223 define policer_dump
1224 {
1225   u32 client_index;
1226   u32 context;
1227
1228   u8 match_name_valid;
1229   u8 match_name[64];
1230 };
1231
1232 /** \brief Policer operational state response.
1233     @param context - sender context, to match reply w/ request
1234     @param name - policer name
1235     @param cir - CIR
1236     @param eir - EIR
1237     @param cb - Committed Burst
1238     @param eb - Excess or Peak Burst
1239     @param rate_type - rate type
1240     @param round_type - rounding type
1241     @param type - policer algorithm
1242     @param conform_action_type - conform action type
1243     @param conform_dscp - DSCP for conform mar-and-transmit action
1244     @param exceed_action_type - exceed action type
1245     @param exceed_dscp - DSCP for exceed mar-and-transmit action
1246     @param violate_action_type - violate action type
1247     @param violate_dscp - DSCP for violate mar-and-transmit action
1248     @param single_rate - 1 = single rate policer, 0 = two rate policer
1249     @param color_aware - for hierarchical policing
1250     @param scale - power-of-2 shift amount for lower rates
1251     @param cir_tokens_per_period - number of tokens for each period
1252     @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
1253     @param current_limit - current limit
1254     @param current_bucket - current bucket
1255     @param extended_limit - extended limit
1256     @param extended_bucket - extended bucket
1257     @param last_update_time - last update time
1258 */
1259 define policer_details
1260 {
1261   u32 context;
1262
1263   u8 name[64];
1264   u32 cir;
1265   u32 eir;
1266   u64 cb;
1267   u64 eb;
1268   u8 rate_type;
1269   u8 round_type;
1270   u8 type;
1271   u8 conform_action_type;
1272   u8 conform_dscp;
1273   u8 exceed_action_type;
1274   u8 exceed_dscp;
1275   u8 violate_action_type;
1276   u8 violate_dscp;
1277   u8 single_rate;
1278   u8 color_aware;
1279   u32 scale;
1280   u32 cir_tokens_per_period;
1281   u32 pir_tokens_per_period;
1282   u32 current_limit;
1283   u32 current_bucket;
1284   u32 extended_limit;
1285   u32 extended_bucket;
1286   u64 last_update_time;
1287 };
1288
1289 /** \brief Query relative index via node names
1290     @param client_index - opaque cookie to identify the sender
1291     @param context - sender context, to match reply w/ request
1292     @param node_name - name of node to find relative index from
1293     @param next_name - next node from node_name to find relative index of
1294 */
1295 define get_next_index
1296 {
1297   u32 client_index;
1298   u32 context;
1299   u8 node_name[64];
1300   u8 next_name[64];
1301 };
1302
1303 /** \brief Reply for get next node index
1304     @param context - sender context which was passed in the request
1305     @param retval - return value
1306     @param next_index - index of the next_node
1307 */
1308 define get_next_index_reply
1309 {
1310   u32 context;
1311   i32 retval;
1312   u32 next_index;
1313 };
1314
1315 /** \brief PacketGenerator create interface request
1316     @param client_index - opaque cookie to identify the sender
1317     @param context - sender context, to match reply w/ request
1318     @param interface_id - interface index
1319 */
1320 define pg_create_interface
1321 {
1322   u32 client_index;
1323   u32 context;
1324   u32 interface_id;
1325 };
1326
1327 /** \brief PacketGenerator create interface response
1328     @param context - sender context, to match reply w/ request
1329     @param retval - return value for request
1330 */
1331 define pg_create_interface_reply
1332 {
1333   u32 context;
1334   i32 retval;
1335   u32 sw_if_index;
1336 };
1337
1338 /** \brief PacketGenerator capture packets on given interface request
1339     @param client_index - opaque cookie to identify the sender
1340     @param context - sender context, to match reply w/ request
1341     @param interface_id - pg interface index
1342     @param is_enabled - 1 if enabling streams, 0 if disabling
1343     @param count - number of packets to be captured
1344     @param pcap_file - pacp file name to store captured packets
1345 */
1346 define pg_capture
1347 {
1348   u32 client_index;
1349   u32 context;
1350   u32 interface_id;
1351   u8 is_enabled;
1352   u32 count;
1353   u32 pcap_name_length;
1354   u8 pcap_file_name[pcap_name_length];
1355 };
1356
1357 /** \brief PacketGenerator capture packets response
1358     @param context - sender context, to match reply w/ request
1359     @param retval - return value for request
1360 */
1361 define pg_capture_reply
1362 {
1363   u32 context;
1364   i32 retval;
1365 };
1366
1367 /** \brief Enable / disable packet generator request
1368     @param client_index - opaque cookie to identify the sender
1369     @param context - sender context, to match reply w/ request
1370     @param is_enabled - 1 if enabling streams, 0 if disabling
1371     @param stream - stream name to be enable/disabled, if not specified handle all streams
1372 */
1373 define pg_enable_disable
1374 {
1375   u32 client_index;
1376   u32 context;
1377   u8 is_enabled;
1378   u32 stream_name_length;
1379   u8 stream_name[stream_name_length];
1380 };
1381
1382 /** \brief Reply for enable / disable packet generator
1383     @param context - returned sender context, to match reply w/ request
1384     @param retval - return code
1385 */
1386 define pg_enable_disable_reply
1387 {
1388   u32 context;
1389   i32 retval;
1390 };
1391
1392 /** \brief Configure IP source and L4 port-range check
1393     @param client_index - opaque cookie to identify the sender
1394     @param context - sender context, to match reply w/ request
1395     @param is_ip6 - 1 if source address type is IPv6
1396     @param is_add - 1 if add, 0 if delete
1397     @param mask_length - mask length for address entry
1398     @param address - array of address bytes
1399     @param number_of_ranges - length of low_port and high_port arrays (must match)
1400     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
1401     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
1402     @param vrf_id - fib table/vrf id to associate the source and port-range check with
1403     @note To specify a single port set low_port and high_port entry the same
1404 */
1405 define ip_source_and_port_range_check_add_del
1406 {
1407   u32 client_index;
1408   u32 context;
1409   u8 is_ipv6;
1410   u8 is_add;
1411   u8 mask_length;
1412   u8 address[16];
1413   u8 number_of_ranges;
1414   u16 low_ports[32];
1415   u16 high_ports[32];
1416   u32 vrf_id;
1417 };
1418
1419 /** \brief Configure IP source and L4 port-range check reply
1420     @param context - returned sender context, to match reply w/ request
1421     @param retval - return code
1422 */
1423 define ip_source_and_port_range_check_add_del_reply
1424 {
1425   u32 context;
1426   i32 retval;
1427 };
1428
1429 /** \brief Set interface source and L4 port-range request
1430     @param client_index - opaque cookie to identify the sender
1431     @param context - sender context, to match reply w/ request
1432     @param interface_id - interface index
1433     @param tcp_vrf_id - VRF associated with source and TCP port-range check
1434     @param udp_vrf_id - VRF associated with source and TCP port-range check
1435 */
1436 define ip_source_and_port_range_check_interface_add_del
1437 {
1438   u32 client_index;
1439   u32 context;
1440   u8 is_add;
1441   u32 sw_if_index;
1442   u32 tcp_in_vrf_id;
1443   u32 tcp_out_vrf_id;
1444   u32 udp_in_vrf_id;
1445   u32 udp_out_vrf_id;
1446 };
1447
1448 /** \brief Set interface source and L4 port-range response
1449     @param context - sender context, to match reply w/ request
1450     @param retval - return value for request
1451 */
1452 define ip_source_and_port_range_check_interface_add_del_reply
1453 {
1454   u32 context;
1455   i32 retval;
1456 };
1457
1458 /** \brief Delete sub interface request
1459     @param client_index - opaque cookie to identify the sender
1460     @param context - sender context, to match reply w/ request
1461     @param sw_if_index - sw index of the interface that was created by create_subif
1462 */
1463 define delete_subif {
1464   u32 client_index;
1465   u32 context;
1466   u32 sw_if_index;
1467 };
1468
1469 /** \brief Delete sub interface response
1470     @param context - sender context, to match reply w/ request
1471     @param retval - return code for the request
1472 */
1473 define delete_subif_reply {
1474   u32 context;
1475   i32 retval;
1476 };
1477
1478 /** \brief L2 interface pbb tag rewrite configure request
1479     @param client_index - opaque cookie to identify the sender
1480     @param context - sender context, to match reply w/ request
1481     @param sw_if_index - interface the operation is applied to
1482     @param vtr_op - Choose from l2_vtr_op_t enum values
1483     @param inner_tag - needed for translate_qinq vtr op only
1484     @param outer_tag - needed for translate_qinq vtr op only 
1485     @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
1486     @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
1487     @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
1488     @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
1489 */
1490 define l2_interface_pbb_tag_rewrite
1491 {
1492   u32 client_index;
1493   u32 context;
1494   u32 sw_if_index;
1495   u32 vtr_op;
1496   u16 outer_tag;
1497   u8  b_dmac[6];
1498   u8  b_smac[6];
1499   u16 b_vlanid;
1500   u32 i_sid;
1501 };
1502
1503 /** \brief L2 interface pbb tag rewrite response
1504     @param context - sender context, to match reply w/ request
1505     @param retval - return code for the request
1506 */
1507 define l2_interface_pbb_tag_rewrite_reply
1508 {
1509   u32 context;
1510   i32 retval;
1511 };
1512
1513 /** \brief Punt traffic to the host
1514     @param client_index - opaque cookie to identify the sender
1515     @param context - sender context, to match reply w/ request
1516     @param is_add - add punt if non-zero, else delete
1517     @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
1518     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
1519     @param l4_port - TCP/UDP port to be punted
1520 */
1521 define punt {
1522     u32 client_index;
1523     u32 context;
1524     u8 is_add;
1525     u8 ipv;
1526     u8 l4_protocol;
1527     u16 l4_port;
1528 };
1529
1530 /** \brief Reply to the punt request
1531     @param context - sender context which was passed in the request
1532     @param retval - return code of punt request
1533 */
1534 define punt_reply
1535 {
1536     u32 context;
1537     i32 retval;
1538 };
1539
1540 /** \brief Feature path enable/disable request
1541     @param client_index - opaque cookie to identify the sender
1542     @param context - sender context, to match reply w/ request
1543     @param sw_if_index - the interface
1544     @param enable - 1 = on, 0 = off
1545 */
1546 define feature_enable_disable {
1547     u32 client_index;
1548     u32 context;
1549     u32 sw_if_index;
1550     u8 enable;
1551     u8 arc_name[64];
1552     u8 feature_name[64];
1553 };
1554
1555 /** \brief Reply to the eature path enable/disable request
1556     @param context - sender context which was passed in the request
1557     @param retval - return code for the request
1558 */
1559 define feature_enable_disable_reply
1560 {
1561     u32 context;
1562     i32 retval;
1563 };
1564
1565 /*
1566  * Local Variables:
1567  * eval: (c-set-style "gnu")
1568  * End:
1569  */