Support IETF routing Yang models (VPP-503).
[vpp.git] / vpp / vpp-api / vpe.api
1 /* Hey Emacs use -*- mode: C -*- */
2 /*
3  * Copyright (c) 2015-2016 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /** \file
18
19     This file defines vpe control-plane API messages which are generally
20     called through a shared memory interface. 
21 */
22
23
24 /** \brief Register for interface events
25     @param client_index - opaque cookie to identify the sender
26     @param context - sender context, to match reply w/ request
27     @param enable_disable - 1 => register for events, 0 => cancel registration
28     @param pid - sender's pid
29 */
30 define want_interface_events
31 {
32   u32 client_index;
33   u32 context;
34   u32 enable_disable;
35   u32 pid;
36 };
37
38 /** \brief Reply for interface events registration
39     @param context - returned sender context, to match reply w/ request
40     @param retval - return code
41 */
42 define want_interface_events_reply
43 {
44   u32 context;
45   i32 retval;
46 };
47
48 /** \brief Interface details structure (fix this) 
49     @param sw_if_index - index of the interface
50     @param sup_sw_if_index - index of parent interface if any, else same as sw_if_index  
51     @param l2_address_length - length of the interface's l2 address
52     @param pid - the interface's l2 address
53     @param interface_name - name of the interface
54     @param link_duplex - 1 if half duplex, 2 if full duplex
55     @param link_speed - 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G
56     @param link_MTU - max. transmittion unit 
57     @param sub_if_id - A number 0-N to uniquely identify this subif on super if
58     @param sub_dot1ad -  0 = dot1q, 1=dot1ad
59     @param sub_number_of_tags - Number of tags (0 - 2)
60     @param sub_outer_vlan_id
61     @param sub_inner_vlan_id
62     @param sub_exact_match
63     @param sub_default
64     @param sub_outer_vlan_id_any
65     @param sub_inner_vlan_id_any
66     @param vtr_op - vlan tag rewrite operation
67     @param vtr_push_dot1q
68     @param vtr_tag1
69     @param vtr_tag2
70 */
71 define sw_interface_details
72 {
73   u32 context;
74   u32 sw_if_index;
75
76   /* index of sup interface (e.g. hw interface).
77      equal to sw_if_index for super hw interface. */
78   u32 sup_sw_if_index;
79
80   /* Layer 2 address, if applicable */
81   u32 l2_address_length;
82   u8 l2_address[8];
83
84   /* Interface name */
85   u8 interface_name[64];
86
87   /* 1 = up, 0 = down */
88   u8 admin_up_down;
89   u8 link_up_down;
90
91   /* 1 = half duplex, 2 = full duplex */
92   u8 link_duplex;
93
94   /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
95   u8 link_speed;
96
97   /* MTU */
98   u16 link_mtu;
99
100   /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface */
101   u32 sub_id;
102
103   /* 0 = dot1q, 1=dot1ad */
104   u8 sub_dot1ad;
105
106   /* Number of tags 0-2 */
107   u8 sub_number_of_tags;
108   u16 sub_outer_vlan_id;
109   u16 sub_inner_vlan_id;
110   u8 sub_exact_match;
111   u8 sub_default;
112   u8 sub_outer_vlan_id_any;
113   u8 sub_inner_vlan_id_any;
114
115   /* vlan tag rewrite state */
116   u32 vtr_op;
117   u32 vtr_push_dot1q;           // ethertype of first pushed tag is dot1q/dot1ad
118   u32 vtr_tag1;                 // first pushed tag
119   u32 vtr_tag2;                 // second pushed tag
120 };
121
122 /** \brief Set flags on the interface
123     @param client_index - opaque cookie to identify the sender
124     @param context - sender context, to match reply w/ request
125     @param sw_if_index - index of the interface to set flags on
126     @param admin_up_down - set the admin state, 1 = up, 0 = down
127     @param link_up_down - Oper state sent on change event, not used in config.
128     @param deleted - interface was deleted
129 */
130 define sw_interface_set_flags
131 {
132   u32 client_index;
133   u32 context;
134   u32 sw_if_index;
135   /* 1 = up, 0 = down */
136   u8 admin_up_down;
137   u8 link_up_down;
138   u8 deleted;
139 };
140
141 /** \brief Reply to sw_interface_set_flags 
142     @param context - sender context which was passed in the request
143     @param retval - return code of the set flags request
144 */
145 define sw_interface_set_flags_reply
146 {
147   u32 context;
148   i32 retval;
149 };
150
151 /* works */
152 define sw_interface_dump
153 {
154   u32 client_index;
155   u32 context;
156   u8 name_filter_valid;
157   u8 name_filter[49];
158 };
159
160 /** \brief Set or delete one or all ip addresses on a specified interface
161     @param client_index - opaque cookie to identify the sender
162     @param context - sender context, to match reply w/ request
163     @param sw_if_index - index of the interface to add/del addresses 
164     @param is_add - add address if non-zero, else delete
165     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
166     @param del_all - if non-zero delete all addresses on the interface
167     @param address_length - address length in bytes, 4 for ip4, 16 for ip6
168     @param address - array of address bytes
169 */
170 define sw_interface_add_del_address
171 {
172   u32 client_index;
173   u32 context;
174   u32 sw_if_index;
175   u8 is_add;
176   u8 is_ipv6;
177   u8 del_all;
178   u8 address_length;
179   u8 address[16];
180 };
181
182 /** \brief Reply for interface events registration
183     @param context - returned sender context, to match reply w/ request
184     @param retval - return code
185 */
186 define sw_interface_add_del_address_reply
187 {
188   u32 context;
189   i32 retval;
190 };
191
192 /** \brief Associate the specified interface with a fib table
193     @param client_index - opaque cookie to identify the sender
194     @param context - sender context, to match reply w/ request
195     @param sw_if_index - index of the interface
196     @param is_ipv6 - if non-zero ipv6, else ipv4
197     @param vrf_id - fib table/vrd id to associate the interface with
198 */
199 define sw_interface_set_table
200 {
201   u32 client_index;
202   u32 context;
203   u32 sw_if_index;
204   u8 is_ipv6;
205   u32 vrf_id;
206 };
207
208 /** \brief Reply for interface events registration
209     @param context - returned sender context, to match reply w/ request
210     @param retval - return code
211 */
212 define sw_interface_set_table_reply
213 {
214   u32 context;
215   i32 retval;
216 };
217
218 /** \brief Enable or Disable MPLS on and interface
219     @param client_index - opaque cookie to identify the sender
220     @param context - sender context, to match reply w/ request
221     @param sw_if_index - index of the interface
222     @param enable - if non-zero enable, else disable
223 */
224 define sw_interface_set_mpls_enable
225 {
226   u32 client_index;
227   u32 context;
228   u32 sw_if_index;
229   u8 enable;
230 };
231
232 /** \brief Reply for MPLS state on an interface
233     @param context - returned sender context, to match reply w/ request
234     @param retval - return code
235 */
236 define sw_interface_set_mpls_enable_reply
237 {
238   u32 context;
239   i32 retval;
240 };
241
242 /** \brief Initialize a new tap interface with the given paramters 
243     @param client_index - opaque cookie to identify the sender
244     @param context - sender context, to match reply w/ request
245     @param use_random_mac - let the system generate a unique mac address
246     @param tap_name - name to associate with the new interface
247     @param mac_address - mac addr to assign to the interface if use_radom not set
248 */
249 define tap_connect
250 {
251   u32 client_index;
252   u32 context;
253   u8 use_random_mac;
254   u8 tap_name[64];
255   u8 mac_address[6];
256   u8 renumber;
257   u32 custom_dev_instance;
258 };
259
260 /** \brief Reply for tap connect request
261     @param context - returned sender context, to match reply w/ request
262     @param retval - return code
263     @param sw_if_index - software index allocated for the new tap interface
264 */
265 define tap_connect_reply
266 {
267   u32 context;
268   i32 retval;
269   u32 sw_if_index;
270 };
271
272 /** \brief Modify a tap interface with the given paramters 
273     @param client_index - opaque cookie to identify the sender
274     @param context - sender context, to match reply w/ request
275     @param sw_if_index - interface index of existing tap interface
276     @param use_random_mac - let the system generate a unique mac address
277     @param tap_name - name to associate with the new interface
278     @param mac_address - mac addr to assign to the interface if use_radom not set
279 */
280 define tap_modify
281 {
282   u32 client_index;
283   u32 context;
284   u32 sw_if_index;
285   u8 use_random_mac;
286   u8 tap_name[64];
287   u8 mac_address[6];
288   u8 renumber;
289   u32 custom_dev_instance;
290 };
291
292 /** \brief Reply for tap modify request
293     @param context - returned sender context, to match reply w/ request
294     @param retval - return code
295     @param sw_if_index - software index if the modified tap interface
296 */
297 define tap_modify_reply
298 {
299   u32 context;
300   i32 retval;
301   u32 sw_if_index;
302 };
303
304 /** \brief Delete tap interface
305     @param client_index - opaque cookie to identify the sender
306     @param context - sender context, to match reply w/ request
307     @param sw_if_index - interface index of existing tap interface
308 */
309 define tap_delete
310 {
311   u32 client_index;
312   u32 context;
313   u32 sw_if_index;
314 };
315
316 /** \brief Reply for tap delete request
317     @param context - returned sender context, to match reply w/ request
318     @param retval - return code
319 */
320 define tap_delete_reply
321 {
322   u32 context;
323   i32 retval;
324 };
325
326 /** \brief Dump tap interfaces request */
327 define sw_interface_tap_dump
328 {
329   u32 client_index;
330   u32 context;
331 };
332
333 /** \brief Reply for tap dump request
334     @param sw_if_index - software index of tap interface
335     @param dev_name - Linux tap device name
336 */
337 define sw_interface_tap_details
338 {
339   u32 context;
340   u32 sw_if_index;
341   u8 dev_name[64];
342 };
343
344 /** \brief Create a new subinterface with the given vlan id
345     @param client_index - opaque cookie to identify the sender
346     @param context - sender context, to match reply w/ request
347     @param sw_if_index - software index of the new vlan's parent interface
348     @param vlan_id - vlan tag of the new interface
349 */
350 define create_vlan_subif
351 {
352   u32 client_index;
353   u32 context;
354   u32 sw_if_index;
355   u32 vlan_id;
356 };
357
358 /** \brief Reply for the vlan subinterface create request
359     @param context - returned sender context, to match reply w/ request
360     @param retval - return code
361     @param sw_if_index - software index allocated for the new subinterface
362 */
363 define create_vlan_subif_reply
364 {
365   u32 context;
366   i32 retval;
367   u32 sw_if_index;
368 };
369
370 /** \brief MPLS Route Add / del route
371     @param client_index - opaque cookie to identify the sender
372     @param context - sender context, to match reply w/ request
373     @param mr_label - The MPLS label value
374     @param mr_eos - The End of stack bit
375     @param mr_table_id - The MPLS table-id the route is added in
376     @param mr_classify_table_index - If this is a classify route, 
377                                      this is the classify table index
378     @param  mr_create_table_if_needed - If the MPLS or IP tables do not exist,
379                                         create them
380     @param mr_is_add - Is this a route add or delete
381     @param mr_is_classify - Is this route result a classify
382     @param mr_is_multipath - Is this route update a multipath - i.e. is this
383                              a path addition to an existing route
384     @param mr_is_resolve_host - Recurse resolution constraint via a host prefix
385     @param mr_is_resolve_attached - Recurse resolution constraint via attached prefix
386     @param mr_next_hop_proto_is_ip4 - The next-hop is IPV4
387     @param mr_next_hop_weight - The weight, for UCMP
388     @param mr_next_hop[16] - the nextop address
389     @param mr_next_hop_sw_if_index - the next-hop SW interface
390     @param mr_next_hop_table_id - the next-hop table-id (if appropriate)
391     @param mr_next_hop_out_label - the next-hop output label
392 */
393 define mpls_route_add_del
394 {
395   u32 client_index;
396   u32 context;
397   u32 mr_label;
398   u8 mr_eos;
399   u32 mr_table_id;
400   u32 mr_classify_table_index;
401   u8 mr_create_table_if_needed;
402   u8 mr_is_add;
403   u8 mr_is_classify;
404   u8 mr_is_multipath;
405   u8 mr_is_resolve_host;
406   u8 mr_is_resolve_attached;
407   u8 mr_next_hop_proto_is_ip4;
408   u8 mr_next_hop_weight;
409   u8 mr_next_hop[16];
410   u32 mr_next_hop_sw_if_index;
411   u32 mr_next_hop_table_id;
412   u32 mr_next_hop_out_label;
413 };
414
415 /** \brief Reply for MPLS route add / del request
416     @param context - returned sender context, to match reply w/ request
417     @param retval - return code
418 */
419 define mpls_route_add_del_reply
420 {
421   u32 context;
422   i32 retval;
423 };
424
425 /** \brief Dump MPLS fib table
426     @param client_index - opaque cookie to identify the sender
427 */
428 define mpls_fib_dump
429 {
430   u32 client_index;
431   u32 context;
432 };
433
434 /** \brief mpls FIB table response
435     @param table_id - MPLS fib table id
436     @param s_bit - End-of-stack bit
437     @param label - MPLS label value
438 */
439 define mpls_fib_details
440 {
441   u32 context;
442   u32 table_id;
443   u8  eos_bit;
444   u32 label;
445 };
446
447 /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create
448            a per-prefix label entry.
449     @param client_index - opaque cookie to identify the sender
450     @param context - sender context, to match reply w/ request
451     @param mb_mpls_table_id - The MPLS table-id the MPLS entry will be added in
452     @param mb_label - The MPLS label value to bind
453     @param mb_ip_table_id - The IP table-id of the IP prefix to bind to.
454     @param mb_create_table_if_needed - Create either/both tables if required.
455     @param mb_is_bind - Bind or unbind
456     @param mb_is_ip4 - The prefix to bind to is IPv4
457     @param mb_address_length - Length of IP prefix
458     @param mb_address[16] - IP prefix/
459 */
460 define mpls_ip_bind_unbind
461 {
462   u32 client_index;
463   u32 context;
464   u32 mb_mpls_table_id;
465   u32 mb_label;
466   u32 mb_ip_table_id;
467   u8 mb_create_table_if_needed;
468   u8 mb_is_bind;
469   u8 mb_is_ip4;
470   u8 mb_address_length;
471   u8 mb_address[16];
472 };
473
474 /** \brief Reply for MPLS IP bind/unbind request
475     @param context - returned sender context, to match reply w/ request
476     @param retval - return code
477 */
478 define mpls_ip_bind_unbind_reply
479 {
480   u32 context;
481   i32 retval;
482 };
483
484 /** \brief Add / del route request
485     @param client_index - opaque cookie to identify the sender
486     @param context - sender context, to match reply w/ request
487     @param sw_if_index - software index of the new vlan's parent interface
488     @param vrf_id - fib table /vrf associated with the route
489     @param lookup_in_vrf - 
490     @param resolve_attempts - 
491     @param classify_table_index - 
492     @param create_vrf_if_needed - 
493     @param resolve_if_needed - 
494     @param is_add - 1 if adding the route, 0 if deleting
495     @param is_drop - Drop the packet
496     @param is_unreach - Drop the packet and rate limit send ICMP unreachable
497     @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
498     @param is_ipv6 - 0 if an ip4 route, else ip6
499     @param is_local - 
500     @param is_classify - 
501     @param is_multipath - Set to 1 if this is a multipath route, else 0
502     @param not_last - Is last or not last msg in group of multiple add/del msgs
503     @param next_hop_weight - 
504     @param dst_address_length - 
505     @param dst_address[16] - 
506     @param next_hop_address[16] - 
507 */
508 define ip_add_del_route
509 {
510   u32 client_index;
511   u32 context;
512   u32 next_hop_sw_if_index;
513   u32 table_id;
514   u32 resolve_attempts;
515   u32 classify_table_index;
516   u32 next_hop_out_label;
517   u32 next_hop_table_id;
518   u8 create_vrf_if_needed;
519   u8 resolve_if_needed;
520   u8 is_add;
521   u8 is_drop;
522   u8 is_unreach;
523   u8 is_prohibit;
524   u8 is_ipv6;
525   u8 is_local;
526   u8 is_classify;
527   u8 is_multipath;
528   u8 is_resolve_host;
529   u8 is_resolve_attached;
530   /* Is last/not-last message in group of multiple add/del messages. */
531   u8 not_last;
532   u8 next_hop_weight;
533   u8 dst_address_length;
534   u8 dst_address[16];
535   u8 next_hop_address[16];
536 };
537
538 /** \brief Reply for add / del route request
539     @param context - returned sender context, to match reply w/ request
540     @param retval - return code
541 */
542 define ip_add_del_route_reply
543 {
544   u32 context;
545   i32 retval;
546 };
547
548 /** \brief Add / del MPLS encapsulation request
549     @param client_index - opaque cookie to identify the sender
550     @param context - sender context, to match reply w/ request
551     @param vrf_id - vrf id
552     @param dst_address[4] - 
553     @param is_add - 1 if adding the encap, 0 if deleting
554     @param nlabels - number of labels 
555     @param labels - array of labels
556 */
557 define mpls_add_del_encap
558 {
559   u32 client_index;
560   u32 context;
561   u32 vrf_id;
562   u8 dst_address[4];
563   /* 1 = add, 0 = delete */
564   u8 is_add;
565   u8 nlabels;
566   u32 labels[0];
567 };
568
569 /** \brief Reply for add / del encapsulation request
570     @param context - returned sender context, to match reply w/ request
571     @param retval - return code
572 */
573 define mpls_add_del_encap_reply
574 {
575   u32 context;
576   i32 retval;
577 };
578
579 /** \brief Proxy ARP add / del request
580     @param client_index - opaque cookie to identify the sender
581     @param context - sender context, to match reply w/ request
582     @param vrf_id - VRF / Fib table ID
583     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
584     @param low_address[4] - Low address of the Proxy ARP range
585     @param hi_address[4] - High address of the Proxy ARP range
586 */
587 define proxy_arp_add_del
588 {
589   u32 client_index;
590   u32 context;
591   u32 vrf_id;
592   u8 is_add;
593   u8 low_address[4];
594   u8 hi_address[4];
595 };
596
597 /** \brief Reply for proxy arp add / del request
598     @param context - returned sender context, to match reply w/ request
599     @param retval - return code
600 */
601 define proxy_arp_add_del_reply
602 {
603   u32 context;
604   i32 retval;
605 };
606
607 /** \brief Proxy ARP add / del request
608     @param client_index - opaque cookie to identify the sender
609     @param context - sender context, to match reply w/ request
610     @param sw_if_index - Which interface to enable / disable Proxy Arp on
611     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
612 */
613 define proxy_arp_intfc_enable_disable
614 {
615   u32 client_index;
616   u32 context;
617   u32 sw_if_index;
618   /* 1 = on, 0 = off */
619   u8 enable_disable;
620 };
621
622 /** \brief Reply for Proxy ARP interface enable / disable request
623     @param context - returned sender context, to match reply w/ request
624     @param retval - return code
625 */
626 define proxy_arp_intfc_enable_disable_reply
627 {
628   u32 context;
629   i32 retval;
630 };
631
632 /** \brief IP neighbor add / del request
633     @param client_index - opaque cookie to identify the sender
634     @param context - sender context, to match reply w/ request
635     @param vrf_id - vrf_id, only for IP4
636     @param sw_if_index - interface used to reach neighbor
637     @param is_add - 1 to add neighbor, 0 to delete
638     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
639     @param is_static - 
640     @param mac_address - l2 address of the neighbor
641     @param dst_address - ip4 or ip6 address of the neighbor
642 */
643 define ip_neighbor_add_del
644 {
645   u32 client_index;
646   u32 context;
647   u32 vrf_id;                   /* only makes sense for ip4 */
648   u32 sw_if_index;
649   /* 1 = add, 0 = delete */
650   u8 is_add;
651   u8 is_ipv6;
652   u8 is_static;
653   u8 mac_address[6];
654   u8 dst_address[16];
655 };
656
657 /** \brief Reply for IP Neighbor add / delete request
658     @param context - returned sender context, to match reply w/ request
659     @param retval - return code
660 */
661 define ip_neighbor_add_del_reply
662 {
663   u32 context;
664   i32 retval;
665 };
666
667 /** \brief Reset VRF (remove all routes etc) request
668     @param client_index - opaque cookie to identify the sender
669     @param context - sender context, to match reply w/ request
670     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
671     @param vrf_id - ID of th FIB table / VRF to reset
672 */
673 define reset_vrf
674 {
675   u32 client_index;
676   u32 context;
677   u8 is_ipv6;
678   u32 vrf_id;
679 };
680
681 /** \brief Reply for Reset VRF request
682     @param context - returned sender context, to match reply w/ request
683     @param retval - return code
684 */
685 define reset_vrf_reply
686 {
687   u32 context;
688   i32 retval;
689 };
690
691 /** \brief Is Address Reachable request - DISABLED
692     @param client_index - opaque cookie to identify the sender
693     @param context - sender context, to match reply w/ request
694     @param next_hop_sw_if_index - index of interface used to get to next hop
695     @param is_ipv6 - 1 for IPv6, 0 for IPv4
696     @param is_error - address not found or does not match intf
697     @param address[] - Address in question 
698 */
699 define is_address_reachable
700 {
701   u32 client_index;             /* (api_main_t *) am->my_client_index */
702   u32 context;
703   u32 next_hop_sw_if_index;
704   u8 is_known;                  /* on reply, this is the answer */
705   u8 is_ipv6;
706   u8 is_error;                  /* address not found or does not match intf */
707   u8 address[16];
708 };
709
710 /** \brief Want Stats, register for stats updates
711     @param client_index - opaque cookie to identify the sender
712     @param context - sender context, to match reply w/ request
713     @param enable_disable - 1 = enable stats, 0 = disable
714     @param pid - pid of process requesting stats updates
715 */
716 define want_stats
717 {
718   u32 client_index;
719   u32 context;
720   u32 enable_disable;
721   u32 pid;
722 };
723
724 /** \brief Reply for Want Stats request
725     @param context - returned sender context, to match reply w/ request
726     @param retval - return code
727 */
728 define want_stats_reply
729 {
730   u32 context;
731   i32 retval;
732 };
733
734 /** \brief Want stats counters structure 
735     @param vnet_counter_type- such as ip4, ip6, punts, etc
736     @param is_combined - rx & tx total (all types) counts   
737     @param first_sw_if_index - first sw index in block of index, counts
738     @param count - number of interfaces this stats block includes counters for
739     @param data - contiguous block of vlib_counter_t structures 
740 */
741 define vnet_interface_counters
742 {
743   /* enums - plural - in vnet/interface.h */
744   u8 vnet_counter_type;
745   u8 is_combined;
746   u32 first_sw_if_index;
747   u32 count;
748   u8 data[count];
749 };
750
751 typeonly manual_print manual_endian define ip4_fib_counter
752 {
753   u32 address;
754   u8 address_length;
755   u64 packets;
756   u64 bytes;
757 };
758
759 manual_print manual_endian define vnet_ip4_fib_counters
760 {
761   u32 vrf_id;
762   u32 count;
763   vl_api_ip4_fib_counter_t c[count];
764 };
765
766 typeonly manual_print manual_endian define ip6_fib_counter
767 {
768   u64 address[2];
769   u8 address_length;
770   u64 packets;
771   u64 bytes;
772 };
773
774 manual_print manual_endian define vnet_ip6_fib_counters
775 {
776   u32 vrf_id;
777   u32 count;
778   vl_api_ip6_fib_counter_t c[count];
779 };
780
781 /** \brief Request for a single block of summary stats
782     @param client_index - opaque cookie to identify the sender
783     @param context - sender context, to match reply w/ request
784 */
785 define vnet_get_summary_stats
786 {
787   u32 client_index;
788   u32 context;
789 };
790
791 /** \brief Reply for vnet_get_summary_stats request
792     @param context - sender context, to match reply w/ request
793     @param retval - return code for request
794     @param total_pkts -  
795     @param total_bytes -
796     @param vector_rate - 
797 */
798 define vnet_summary_stats_reply
799 {
800   u32 context;
801   i32 retval;
802   u64 total_pkts[2];
803   u64 total_bytes[2];
804   f64 vector_rate;
805 };
806
807 /** \brief OAM event structure
808     @param dst_address[] - 
809     @param state
810 */
811 define oam_event
812 {
813   u8 dst_address[4];
814   u8 state;
815 };
816
817 /** \brief Want OAM events request
818     @param client_index - opaque cookie to identify the sender
819     @param context - sender context, to match reply w/ request
820     @param enable_disable- enable if non-zero, else disable
821     @param pid - pid of the requesting process
822 */
823 define want_oam_events
824 {
825   u32 client_index;
826   u32 context;
827   u32 enable_disable;
828   u32 pid;
829 };
830
831 /** \brief Want OAM events response
832     @param context - sender context, to match reply w/ request
833     @param retval - return code for the want oam stats request
834 */
835 define want_oam_events_reply
836 {
837   u32 context;
838   i32 retval;
839 };
840
841 /** \brief OAM add / del target request
842     @param client_index - opaque cookie to identify the sender
843     @param context - sender context, to match reply w/ request
844     @param vrf_id - vrf_id of the target
845     @param src_address[] - source address to use for the updates 
846     @param dst_address[] - destination address of the target
847     @param is_add - add target if non-zero, else delete
848 */
849 define oam_add_del
850 {
851   u32 client_index;
852   u32 context;
853   u32 vrf_id;
854   u8 src_address[4];
855   u8 dst_address[4];
856   u8 is_add;
857 };
858
859 /** \brief OAM add / del target response
860     @param context - sender context, to match reply w/ request
861     @param retval - return code of the request
862 */
863 define oam_add_del_reply
864 {
865   u32 context;
866   i32 retval;
867 };
868
869 /** \brief Reset fib table request
870     @param client_index - opaque cookie to identify the sender
871     @param context - sender context, to match reply w/ request
872     @param vrf_id - vrf/table id of the fib table to reset
873     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
874 */
875 define reset_fib
876 {
877   u32 client_index;
878   u32 context;
879   u32 vrf_id;
880   u8 is_ipv6;
881 };
882
883 /** \brief Reset fib response
884     @param context - sender context, to match reply w/ request
885     @param retval - return code for the reset bfib request
886 */
887 define reset_fib_reply
888 {
889   u32 context;
890   i32 retval;
891 };
892
893 /** \brief DHCP Proxy config add / del request
894     @param client_index - opaque cookie to identify the sender
895     @param context - sender context, to match reply w/ request
896     @param vrf_id - vrf id
897     @param if_ipv6 - ipv6 if non-zero, else ipv4
898     @param is_add - add the config if non-zero, else delete
899     @param insert_circuit_id - option82 suboption 1 fib number
900     @param dhcp_server[] - server address
901     @param dhcp_src_address[] - <fix this, need details>
902 */
903 define dhcp_proxy_config
904 {
905   u32 client_index;
906   u32 context;
907   u32 vrf_id;
908   u8 is_ipv6;
909   u8 is_add;
910   u8 insert_circuit_id;
911   u8 dhcp_server[16];
912   u8 dhcp_src_address[16];
913 };
914
915 /** \brief DHCP Proxy config response
916     @param context - sender context, to match reply w/ request
917     @param retval - return code for the request
918 */
919 define dhcp_proxy_config_reply
920 {
921   u32 context;
922   i32 retval;
923 };
924
925 /** \brief DHCP Proxy set / unset vss request
926     @param client_index - opaque cookie to identify the sender
927     @param context - sender context, to match reply w/ request
928     @param tbl_id - table id
929     @param oui - first part of vpn id
930     @param fib_id - second part of vpn id
931     @param is_ipv6 - ip6 if non-zero, else ip4
932     @param is_add - set vss if non-zero, else delete
933 */
934 define dhcp_proxy_set_vss
935 {
936   u32 client_index;
937   u32 context;
938   u32 tbl_id;
939   u32 oui;
940   u32 fib_id;
941   u8 is_ipv6;
942   u8 is_add;
943 };
944
945 /** \brief DHCP proxy set / unset vss response
946     @param context - sender context, to match reply w/ request
947     @param retval - return code for the request
948 */
949 define dhcp_proxy_set_vss_reply
950 {
951   u32 context;
952   i32 retval;
953 };
954
955 /** \brief Set the ip flow hash config for a fib request
956     @param client_index - opaque cookie to identify the sender
957     @param context - sender context, to match reply w/ request
958     @param vrf_id - vrf/fib id
959     @param is_ipv6 - if non-zero the fib is ip6, else ip4
960     @param src - if non-zero include src in flow hash
961     @param dst - if non-zero include dst in flow hash
962     @param sport - if non-zero include sport in flow hash
963     @param dport - if non-zero include dport in flow hash
964     @param proto -if non-zero include proto in flow hash
965     @param reverse - if non-zero include reverse in flow hash
966 */
967 define set_ip_flow_hash
968 {
969   u32 client_index;
970   u32 context;
971   u32 vrf_id;
972   u8 is_ipv6;
973   u8 src;
974   u8 dst;
975   u8 sport;
976   u8 dport;
977   u8 proto;
978   u8 reverse;
979 };
980
981 /** \brief Set the ip flow hash config for a fib response
982     @param context - sender context, to match reply w/ request
983     @param retval - return code for the request
984 */
985 define set_ip_flow_hash_reply
986 {
987   u32 context;
988   i32 retval;
989 };
990
991 /** \brief IPv6 router advertisement config request
992     @param client_index - opaque cookie to identify the sender
993     @param context - sender context, to match reply w/ request
994     @param suppress -
995     @param managed -
996     @param other -
997     @param ll_option -
998     @param send_unicast -
999     @param cease -
1000     @param is_no -
1001     @param default_router -
1002     @param max_interval -
1003     @param min_interval -
1004     @param lifetime -
1005     @param initial_count -
1006     @param initial_interval -
1007 */
1008 define sw_interface_ip6nd_ra_config
1009 {
1010   u32 client_index;
1011   u32 context;
1012   u32 sw_if_index;
1013   u8 suppress;
1014   u8 managed;
1015   u8 other;
1016   u8 ll_option;
1017   u8 send_unicast;
1018   u8 cease;
1019   u8 is_no;
1020   u8 default_router;
1021   u32 max_interval;
1022   u32 min_interval;
1023   u32 lifetime;
1024   u32 initial_count;
1025   u32 initial_interval;
1026 };
1027
1028 /** \brief IPv6 router advertisement config response
1029     @param context - sender context, to match reply w/ request
1030     @param retval - return code for the request
1031 */
1032 define sw_interface_ip6nd_ra_config_reply
1033 {
1034   u32 context;
1035   i32 retval;
1036 };
1037
1038 /** \brief IPv6 router advertisement prefix config request
1039     @param client_index - opaque cookie to identify the sender
1040     @param context - sender context, to match reply w/ request
1041     @param sw_if_index - 
1042     @param address[] -
1043     @param address_length -
1044     @param use_default -
1045     @param no_advertise -
1046     @param off_link -
1047     @param no_autoconfig -
1048     @param no_onlink -
1049     @param is_no -
1050     @param val_lifetime -
1051     @param pref_lifetime -
1052 */
1053 define sw_interface_ip6nd_ra_prefix
1054 {
1055   u32 client_index;
1056   u32 context;
1057   u32 sw_if_index;
1058   u8 address[16];
1059   u8 address_length;
1060   u8 use_default;
1061   u8 no_advertise;
1062   u8 off_link;
1063   u8 no_autoconfig;
1064   u8 no_onlink;
1065   u8 is_no;
1066   u32 val_lifetime;
1067   u32 pref_lifetime;
1068 };
1069
1070 /** \brief IPv6 router advertisement prefix config response
1071     @param context - sender context, to match reply w/ request
1072     @param retval - return code for the request
1073 */
1074 define sw_interface_ip6nd_ra_prefix_reply
1075 {
1076   u32 context;
1077   i32 retval;
1078 };
1079
1080 /** \brief IPv6 interface enable / disable request
1081     @param client_index - opaque cookie to identify the sender
1082     @param context - sender context, to match reply w/ request
1083     @param sw_if_index - interface used to reach neighbor
1084     @param enable - if non-zero enable ip6 on interface, else disable
1085 */
1086 define sw_interface_ip6_enable_disable
1087 {
1088   u32 client_index;
1089   u32 context;
1090   u32 sw_if_index;
1091   u8 enable;                    /* set to true if enable */
1092 };
1093
1094 /** \brief IPv6 interface enable / disable response
1095     @param context - sender context, to match reply w/ request
1096     @param retval - return code for the request
1097 */
1098 define sw_interface_ip6_enable_disable_reply
1099 {
1100   u32 context;
1101   i32 retval;
1102 };
1103
1104 /** \brief IPv6 set link local address on interface request
1105     @param client_index - opaque cookie to identify the sender
1106     @param context - sender context, to match reply w/ request
1107     @param sw_if_index - interface to set link local on
1108     @param address[] - the new link local address
1109     @param address_length - link local address length
1110 */
1111 define sw_interface_ip6_set_link_local_address
1112 {
1113   u32 client_index;
1114   u32 context;
1115   u32 sw_if_index;
1116   u8 address[16];
1117   u8 address_length;
1118 };
1119
1120 /** \brief IPv6 set link local address on interface response
1121     @param context - sender context, to match reply w/ request
1122     @param retval - error code for the request
1123 */
1124 define sw_interface_ip6_set_link_local_address_reply
1125 {
1126   u32 context;
1127   i32 retval;
1128 };
1129
1130 /** \brief Set unnumbered interface add / del request
1131     @param client_index - opaque cookie to identify the sender
1132     @param context - sender context, to match reply w/ request
1133     @param sw_if_index - interface with an IP address
1134     @param unnumbered_sw_if_index - interface which will use the address
1135     @param is_add - if non-zero set the association, else unset it
1136 */
1137 define sw_interface_set_unnumbered
1138 {
1139   u32 client_index;
1140   u32 context;
1141   u32 sw_if_index;              /* use this intfc address */
1142   u32 unnumbered_sw_if_index;   /* on this interface */
1143   u8 is_add;
1144 };
1145
1146 /** \brief Set unnumbered interface add / del response
1147     @param context - sender context, to match reply w/ request
1148     @param retval - return code for the request
1149 */
1150 define sw_interface_set_unnumbered_reply
1151 {
1152   u32 context;
1153   i32 retval;
1154 };
1155
1156 /** \brief Create loopback interface request
1157     @param client_index - opaque cookie to identify the sender
1158     @param context - sender context, to match reply w/ request
1159     @param mac_address - mac addr to assign to the interface if none-zero
1160 */
1161 define create_loopback
1162 {
1163   u32 client_index;
1164   u32 context;
1165   u8 mac_address[6];
1166 };
1167
1168 /** \brief Create loopback interface response
1169     @param context - sender context, to match reply w/ request
1170     @param sw_if_index - sw index of the interface that was created
1171     @param retval - return code for the request
1172 */
1173 define create_loopback_reply
1174 {
1175   u32 context;
1176   i32 retval;
1177   u32 sw_if_index;
1178 };
1179
1180 /** \brief Delete loopback interface request
1181     @param client_index - opaque cookie to identify the sender
1182     @param context - sender context, to match reply w/ request
1183     @param sw_if_index - sw index of the interface that was created
1184 */
1185 define delete_loopback
1186 {
1187   u32 client_index;
1188   u32 context;
1189   u32 sw_if_index;
1190 };
1191
1192 /** \brief Delete loopback interface response
1193     @param context - sender context, to match reply w/ request
1194     @param retval - return code for the request
1195 */
1196 define delete_loopback_reply
1197 {
1198   u32 context;
1199   i32 retval;
1200 };
1201
1202 /** \brief Control ping from client to api server request
1203     @param client_index - opaque cookie to identify the sender
1204     @param context - sender context, to match reply w/ request
1205 */
1206 define control_ping
1207 {
1208   u32 client_index;
1209   u32 context;
1210 };
1211
1212 /** \brief Control ping from the client to the server response
1213     @param client_index - opaque cookie to identify the sender
1214     @param context - sender context, to match reply w/ request
1215     @param retval - return code for the request
1216     @param vpe_pid - the pid of the vpe, returned by the server
1217 */
1218 define control_ping_reply
1219 {
1220   u32 context;
1221   i32 retval;
1222   u32 client_index;
1223   u32 vpe_pid;
1224 };
1225
1226 /** \brief Process a vpe parser cli string request
1227     @param client_index - opaque cookie to identify the sender
1228     @param context - sender context, to match reply w/ request
1229     @param cmd_in_shmem - pointer to cli command string
1230 */
1231 define cli_request
1232 {
1233   u32 client_index;
1234   u32 context;
1235   u64 cmd_in_shmem;
1236 };
1237 define cli_inband
1238 {
1239   u32 client_index;
1240   u32 context;
1241   u32 length;
1242   u8 cmd[length];
1243 };
1244
1245 /** \brief vpe parser cli string response
1246     @param context - sender context, to match reply w/ request
1247     @param retval - return code for request
1248     @param reply_in_shmem - Reply string from cli processing if any
1249 */
1250 define cli_reply
1251 {
1252   u32 context;
1253   i32 retval;
1254   u64 reply_in_shmem;
1255 };
1256 define cli_inband_reply
1257 {
1258   u32 context;
1259   i32 retval;
1260   u32 length;
1261   u8 reply[length];
1262 };
1263
1264 /** \brief Set max allowed ARP or ip6 neighbor entries request
1265     @param client_index - opaque cookie to identify the sender
1266     @param context - sender context, to match reply w/ request
1267     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
1268     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
1269 */
1270 define set_arp_neighbor_limit
1271 {
1272   u32 client_index;
1273   u32 context;
1274   u8 is_ipv6;
1275   u32 arp_neighbor_limit;
1276 };
1277
1278 /** \brief Set max allowed ARP or ip6 neighbor entries response
1279     @param context - sender context, to match reply w/ request
1280     @param retval - return code for request
1281 */
1282 define set_arp_neighbor_limit_reply
1283 {
1284   u32 context;
1285   i32 retval;
1286 };
1287
1288 /** \brief L2 interface patch add / del request
1289     @param client_index - opaque cookie to identify the sender
1290     @param context - sender context, to match reply w/ request
1291     @param rx_sw_if_index - receive side interface 
1292     @param tx_sw_if_index - transmit side interface
1293     @param is_add - if non-zero set up the interface patch, else remove it
1294 */
1295 define l2_patch_add_del
1296 {
1297   u32 client_index;
1298   u32 context;
1299   u32 rx_sw_if_index;
1300   u32 tx_sw_if_index;
1301   u8 is_add;
1302 };
1303
1304 /** \brief L2 interface patch add / del response
1305     @param context - sender context, to match reply w/ request
1306     @param retval - return code for the request
1307 */
1308 define l2_patch_add_del_reply
1309 {
1310   u32 context;
1311   i32 retval;
1312 };
1313
1314 /** \brief IPv6 segment routing tunnel add / del request
1315     @param client_index - opaque cookie to identify the sender
1316     @param context - sender context, to match reply w/ request
1317     @param is_add - add the tunnel if non-zero, else delete it
1318     @param name[] - tunnel name (len. 64)
1319     @param src_address[] -
1320     @param dst_address[] -
1321     @param dst_mask_width -
1322     @param inner_vrf_id -
1323     @param outer_vrf_id -
1324     @param flags_net_byte_order -
1325     @param n_segments -
1326     @param n_tags -
1327     @param segs_and_tags[] -
1328     @param policy_name[] - name of policy to associate this tunnel to (len. 64)
1329 */
1330 define sr_tunnel_add_del
1331 {
1332   u32 client_index;
1333   u32 context;
1334   u8 is_add;
1335   u8 name[64];
1336   u8 src_address[16];
1337   u8 dst_address[16];
1338   u8 dst_mask_width;
1339   u32 inner_vrf_id;
1340   u32 outer_vrf_id;
1341   u16 flags_net_byte_order;
1342   u8 n_segments;
1343   u8 n_tags;
1344   u8 segs_and_tags[0];
1345   u8 policy_name[64];
1346 };
1347
1348 /** \brief IPv6 segment routing tunnel add / del response
1349     @param context - sender context, to match reply w/ request
1350     @param retval - return value for request
1351 */
1352 define sr_tunnel_add_del_reply
1353 {
1354   u32 context;
1355   i32 retval;
1356 };
1357
1358 /** \brief IPv6 segment routing policy add / del request
1359     @param client_index - opaque cookie to identify the sender
1360     @param context - sender context, to match reply w/ request
1361     @param is_add - add the tunnel if non-zero, else delete it
1362     @param name[] - policy name (len. 64)
1363     @param tunnel_names[] -
1364 */
1365 define sr_policy_add_del
1366 {
1367   u32 client_index;
1368   u32 context;
1369   u8 is_add;
1370   u8 name[64];
1371   u8 tunnel_names[0];
1372 };
1373
1374 /** \brief IPv6 segment routing policy add / del response
1375     @param context - sender context, to match reply w/ request
1376     @param retval - return value for request
1377 */
1378 define sr_policy_add_del_reply
1379 {
1380   u32 context;
1381   i32 retval;
1382 };
1383
1384 /** \brief IPv6 segment routing multicast map to policy add / del request
1385     @param client_index - opaque cookie to identify the sender
1386     @param context - sender context, to match reply w/ request
1387     @param is_add - add the tunnel if non-zero, else delete it
1388     @param multicast_address[] - IP6 multicast address
1389     @param policy_name[] = policy name (len.64)
1390 */
1391 define sr_multicast_map_add_del
1392 {
1393   u32 client_index;
1394   u32 context;
1395   u8 is_add;
1396   u8 multicast_address[16];
1397   u8 policy_name[64];
1398 };
1399
1400 /** \brief IPv6 segment routing multicast map to policy add / del response
1401     @param context - sender context, to match reply w/ request
1402     @param retval - return value for request
1403 */
1404 define sr_multicast_map_add_del_reply
1405 {
1406   u32 context;
1407   i32 retval;
1408 };
1409
1410 /** \brief Interface set vpath request
1411     @param client_index - opaque cookie to identify the sender
1412     @param context - sender context, to match reply w/ request
1413     @param sw_if_index - interface used to reach neighbor
1414     @param enable - if non-zero enable, else disable
1415 */
1416 define sw_interface_set_vpath
1417 {
1418   u32 client_index;
1419   u32 context;
1420   u32 sw_if_index;
1421   u8 enable;
1422 };
1423
1424 /** \brief Interface set vpath response
1425     @param context - sender context, to match reply w/ request
1426     @param retval - return code for the request
1427 */
1428 define sw_interface_set_vpath_reply
1429 {
1430   u32 context;
1431   i32 retval;
1432 };
1433
1434 /** \brief MPLS Ethernet add / del tunnel request
1435     @param client_index - opaque cookie to identify the sender
1436     @param context - sender context, to match reply w/ request
1437     @param vrf_id - vrf_id, only for IP4
1438     @param sw_if_index - interface used to reach neighbor
1439     @param is_add - add if set, tunnel delete if 0
1440     @param dst_mac_address - 
1441     @param adj_address - 
1442     @param adj_address_length -
1443 */
1444 define mpls_ethernet_add_del_tunnel
1445 {
1446   u32 client_index;
1447   u32 context;
1448   u32 vrf_id;
1449   u32 tx_sw_if_index;
1450   u8 is_add;
1451   u8 l2_only;
1452   u8 dst_mac_address[6];
1453   u8 adj_address[4];
1454   u8 adj_address_length;
1455 };
1456
1457 /** \brief Reply for MPLS Ethernet add / delete tunnel request
1458     @param context - sender context, to match reply w/ request
1459     @param retval - return code for the request
1460 */
1461 define mpls_ethernet_add_del_tunnel_reply
1462 {
1463   u32 context;
1464   i32 retval;
1465   u32 tunnel_sw_if_index;
1466 };
1467 /** \brief MPLS Ethernet add/ del tunnel 2
1468     @param client_index - opaque cookie to identify the sender
1469     @param context - sender context, to match reply w/ request
1470     @param inner_vrf_id - 
1471     @param outer_vrf_id - 
1472     @param resolve_attempts - 
1473     @param resolve_opaque - 
1474     @param resolve_if_needed -
1475     @param is_add -
1476     @param adj_address -
1477     @param adj_address_length -
1478     @param next_hop_ip4_address_in_outer_vrf -
1479 */
1480 define mpls_ethernet_add_del_tunnel_2
1481 {
1482   u32 client_index;
1483   u32 context;
1484   u32 inner_vrf_id;
1485   u32 outer_vrf_id;
1486   u32 resolve_attempts;
1487   u32 resolve_opaque;           /* no need to set this */
1488   u8 resolve_if_needed;
1489   u8 is_add;
1490   u8 l2_only;
1491   u8 adj_address[4];
1492   u8 adj_address_length;
1493   u8 next_hop_ip4_address_in_outer_vrf[4];
1494 };
1495
1496 /** \brief MPLS Ethernet add/ del tunnel 2
1497     @param context - sender context, to match reply w/ request
1498     @param retval - return code for add /del request
1499 */
1500 define mpls_ethernet_add_del_tunnel_2_reply
1501 {
1502   u32 context;
1503   i32 retval;
1504 };
1505
1506 /** \brief Set L2 XConnect between two interfaces request
1507     @param client_index - opaque cookie to identify the sender
1508     @param context - sender context, to match reply w/ request
1509     @param rx_sw_if_index - Receive interface index
1510     @param tx_sw_if_index - Transmit interface index
1511     @param enable - enable xconnect if not 0, else set to L3 mode
1512 */
1513 define sw_interface_set_l2_xconnect
1514 {
1515   u32 client_index;
1516   u32 context;
1517   u32 rx_sw_if_index;
1518   u32 tx_sw_if_index;
1519   u8 enable;
1520 };
1521
1522 /** \brief Set L2 XConnect response
1523     @param context - sender context, to match reply w/ request
1524     @param retval - L2 XConnect request return code
1525 */
1526 define sw_interface_set_l2_xconnect_reply
1527 {
1528   u32 context;
1529   i32 retval;
1530 };
1531
1532 /** \brief Interface bridge mode request
1533     @param client_index - opaque cookie to identify the sender
1534     @param context - sender context, to match reply w/ request
1535     @param rx_sw_if_index - the interface
1536     @param bd_id - bridge domain id
1537     @param bvi - Setup interface as a bvi, bridge mode only
1538     @param shg - Shared horizon group, for bridge mode only
1539     @param enable - Enable beige mode if not 0, else set to L3 mode
1540 */
1541 define sw_interface_set_l2_bridge
1542 {
1543   u32 client_index;
1544   u32 context;
1545   u32 rx_sw_if_index;
1546   u32 bd_id;
1547   u8 shg;
1548   u8 bvi;
1549   u8 enable;
1550 };
1551
1552 /** \brief Interface bridge mode response
1553     @param context - sender context, to match reply w/ request
1554     @param retval - Bridge mode request return code
1555 */
1556 define sw_interface_set_l2_bridge_reply
1557 {
1558   u32 context;
1559   i32 retval;
1560 };
1561
1562 /** \brief L2 FIB add entry request
1563     @param client_index - opaque cookie to identify the sender
1564     @param context - sender context, to match reply w/ request
1565     @param mac - the entry's mac address
1566     @param bd_id - the entry's bridge domain id
1567     @param sw_if_index - the interface
1568     @param is_add - If non zero add the entry, else delete it
1569     @param static_mac - 
1570     @param filter_mac -
1571 */
1572 define l2fib_add_del
1573 {
1574   u32 client_index;
1575   u32 context;
1576   u64 mac;
1577   u32 bd_id;
1578   u32 sw_if_index;
1579   u8 is_add;
1580   u8 static_mac;
1581   u8 filter_mac;
1582   u8 bvi_mac;
1583 };
1584
1585 /** \brief L2 FIB add entry response
1586     @param context - sender context, to match reply w/ request
1587     @param retval - return code for the add l2fib entry request
1588 */
1589 define l2fib_add_del_reply
1590 {
1591   u32 context;
1592   i32 retval;
1593 };
1594
1595 /** \brief Set L2 flags request !!! TODO - need more info, feature bits in l2_input.h
1596     @param client_index - opaque cookie to identify the sender
1597     @param context - sender context, to match reply w/ request
1598     @param sw_if_index - interface 
1599     @param is_set - if non-zero, set the bits, else clear them
1600     @param feature_bitmap - non-zero bits to set or clear
1601 */
1602 define l2_flags
1603 {
1604   u32 client_index;
1605   u32 context;
1606   u32 sw_if_index;
1607   u8 is_set;
1608   u32 feature_bitmap;
1609 };
1610
1611 /** \brief Set L2 bits response
1612     @param context - sender context, to match reply w/ request
1613     @param retval - return code for the set l2 bits request
1614 */
1615 define l2_flags_reply
1616 {
1617   u32 context;
1618   i32 retval;
1619   u32 resulting_feature_bitmap;
1620 };
1621
1622 /** \brief Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, 
1623     L2_UU_FLOOD, or L2_ARP_TERM) request
1624     @param client_index - opaque cookie to identify the sender
1625     @param context - sender context, to match reply w/ request
1626     @param bd_id - the bridge domain to set the flags for
1627     @param is_set - if non-zero, set the flags, else clear them
1628     @param feature_bitmap - bits that are non-zero to set or clear
1629 */
1630 define bridge_flags
1631 {
1632   u32 client_index;
1633   u32 context;
1634   u32 bd_id;
1635   u8 is_set;
1636   u32 feature_bitmap;
1637 };
1638
1639 /** \brief Set bridge flags response
1640     @param context - sender context, to match reply w/ request
1641     @param retval - return code for the set bridge flags request
1642     @param resulting_feature_bitmap - the feature bitmap value after the request is implemented
1643 */
1644 define bridge_flags_reply
1645 {
1646   u32 context;
1647   i32 retval;
1648   u32 resulting_feature_bitmap;
1649 };
1650
1651 /** \brief Set bridge domain ip to mac entry request
1652     @param client_index - opaque cookie to identify the sender
1653     @param context - sender context, to match reply w/ request
1654     @param bd_id - the bridge domain to set the flags for
1655     @param is_add - if non-zero, add the entry, else clear it
1656     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
1657     @param mac_address - MAC address
1658     @param 
1659 */
1660 define bd_ip_mac_add_del
1661 {
1662   u32 client_index;
1663   u32 context;
1664   u32 bd_id;
1665   u8 is_add;
1666   u8 is_ipv6;
1667   u8 ip_address[16];
1668   u8 mac_address[6];
1669 };
1670
1671 /** \brief Set bridge domain ip to mac entry response
1672     @param context - sender context, to match reply w/ request
1673     @param retval - return code for the set bridge flags request
1674 */
1675 define bd_ip_mac_add_del_reply
1676 {
1677   u32 context;
1678   i32 retval;
1679 };
1680
1681 /** \brief Add/Delete classification table request
1682     @param client_index - opaque cookie to identify the sender
1683     @param context - sender context, to match reply w/ request
1684     @param is_add- if non-zero add the table, else delete it
1685     @param table_index - if add, reuturns index of the created table, else specifies the table to delete  
1686     @param nbuckets - number of buckets when adding a table
1687     @param memory_size - memory size when adding a table
1688     @param match_n_vectors - number of match vectors
1689     @param next_table_index - index of next table
1690     @param miss_next_index - index of miss table
1691     @param mask[] - match mask
1692 */
1693 define classify_add_del_table
1694 {
1695   u32 client_index;
1696   u32 context;
1697   u8 is_add;
1698   u32 table_index;
1699   u32 nbuckets;
1700   u32 memory_size;
1701   u32 skip_n_vectors;
1702   u32 match_n_vectors;
1703   u32 next_table_index;
1704   u32 miss_next_index;
1705   u8 mask[0];
1706 };
1707
1708 /** \brief Add/Delete classification table response
1709     @param context - sender context, to match reply w/ request
1710     @param retval - return code for the table add/del requst
1711     @param new_table_index - for add, returned index of the new table
1712     @param skip_n_vectors - for add, returned value of skip_n_vectors in table
1713     @param match_n_vectors -for add, returned value of match_n_vectors in table
1714 */
1715 define classify_add_del_table_reply
1716 {
1717   u32 context;
1718   i32 retval;
1719   u32 new_table_index;
1720   u32 skip_n_vectors;
1721   u32 match_n_vectors;
1722 };
1723
1724 /** \brief Classify add / del session request
1725     @param client_index - opaque cookie to identify the sender
1726     @param context - sender context, to match reply w/ request
1727     @param is_add - add session if non-zero, else delete
1728     @param table_index - index of the table to add/del the session, required
1729     @param hit_next_index - for add, hit_next_index of new session, required
1730     @param opaque_index - for add, opaque_index of new session
1731     @param advance -for add, advance value for session
1732     @param match[] - for add, match value for session, required
1733 */
1734 define classify_add_del_session
1735 {
1736   u32 client_index;
1737   u32 context;
1738   u8 is_add;
1739   u32 table_index;
1740   u32 hit_next_index;
1741   u32 opaque_index;
1742   i32 advance;
1743   u8 match[0];
1744 };
1745
1746 /** \brief Classify add / del session response
1747     @param context - sender context, to match reply w/ request
1748     @param retval - return code for the add/del session request
1749 */
1750 define classify_add_del_session_reply
1751 {
1752   u32 context;
1753   i32 retval;
1754 };
1755
1756 /** \brief Set/unset the classification table for an interface request 
1757     @param client_index - opaque cookie to identify the sender
1758     @param context - sender context, to match reply w/ request
1759     @param is_ipv6 - ipv6 if non-zero, else ipv4
1760     @param sw_if_index - interface to associate with the table
1761     @param table_index - index of the table, if ~0 unset the table
1762 */
1763 define classify_set_interface_ip_table
1764 {
1765   u32 client_index;
1766   u32 context;
1767   u8 is_ipv6;
1768   u32 sw_if_index;
1769   u32 table_index;              /* ~0 => off */
1770 };
1771
1772 /** \brief Set/unset interface classification table response 
1773     @param context - sender context, to match reply w/ request
1774     @param retval - return code
1775 */
1776 define classify_set_interface_ip_table_reply
1777 {
1778   u32 context;
1779   i32 retval;
1780 };
1781
1782 /** \brief Set/unset l2 classification tables for an interface request
1783     @param client_index - opaque cookie to identify the sender
1784     @param context - sender context, to match reply w/ request
1785     @param sw_if_index - interface to set/unset tables for
1786     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
1787     @param ip6_table_index - ip6 index
1788     @param other_table_index - other index
1789 */
1790 define classify_set_interface_l2_tables
1791 {
1792   u32 client_index;
1793   u32 context;
1794   u32 sw_if_index;
1795   /* 3 x ~0 => off */
1796   u32 ip4_table_index;
1797   u32 ip6_table_index;
1798   u32 other_table_index;
1799   u8 is_input;
1800 };
1801
1802 /** \brief Set/unset l2 classification tables for an interface response
1803     @param context - sender context, to match reply w/ request
1804     @param retval - return code for the request
1805 */
1806 define classify_set_interface_l2_tables_reply
1807 {
1808   u32 context;
1809   i32 retval;
1810 };
1811
1812 /** \brief Get node index using name request
1813     @param client_index - opaque cookie to identify the sender
1814     @param context - sender context, to match reply w/ request
1815     @param node_name[] - name of the node
1816 */
1817 define get_node_index
1818 {
1819   u32 client_index;
1820   u32 context;
1821   u8 node_name[64];
1822 };
1823
1824 /** \brief Get node index using name request
1825     @param context - sender context, to match reply w/ request
1826     @param retval - return code for the request
1827     @param node_index - index of the desired node if found, else ~0
1828 */
1829 define get_node_index_reply
1830 {
1831   u32 context;
1832   i32 retval;
1833   u32 node_index;
1834 };
1835
1836 /** \brief Set the next node for a given node request
1837     @param client_index - opaque cookie to identify the sender
1838     @param context - sender context, to match reply w/ request
1839     @param node_name[] - node to add the next node to
1840     @param next_name[] - node to add as the next node
1841 */
1842 define add_node_next
1843 {
1844   u32 client_index;
1845   u32 context;
1846   u8 node_name[64];
1847   u8 next_name[64];
1848 };
1849
1850 /** \brief IP Set the next node for a given node response
1851     @param context - sender context, to match reply w/ request
1852     @param retval - return code for the add next node request
1853     @param next_index - the index of the next node if success, else ~0
1854 */
1855 define add_node_next_reply
1856 {
1857   u32 context;
1858   i32 retval;
1859   u32 next_index;
1860 };
1861
1862 /** \brief DHCP Proxy config 2 add / del request
1863     @param client_index - opaque cookie to identify the sender
1864     @param context - sender context, to match reply w/ request
1865     @param rx_vrf_id - receive vrf id
1866     @param server_vrf_id - server vrf id
1867     @param if_ipv6 - ipv6 if non-zero, else ipv4
1868     @param is_add - add the config if non-zero, else delete
1869     @param insert_circuit_id - option82 suboption 1 fib number
1870     @param dhcp_server[] - server address
1871     @param dhcp_src_address[] - <fix this, need details>
1872 */
1873 define dhcp_proxy_config_2
1874 {
1875   u32 client_index;
1876   u32 context;
1877   u32 rx_vrf_id;
1878   u32 server_vrf_id;
1879   u8 is_ipv6;
1880   u8 is_add;
1881   u8 insert_circuit_id;
1882   u8 dhcp_server[16];
1883   u8 dhcp_src_address[16];
1884 };
1885
1886 /** \brief DHCP Proxy config 2 add / del response
1887     @param context - sender context, to match reply w/ request
1888     @param retval - return code for request
1889 */
1890 define dhcp_proxy_config_2_reply
1891 {
1892   u32 context;
1893   i32 retval;
1894 };
1895
1896 /** \brief l2tpv3 tunnel interface create request
1897     @param client_index - opaque cookie to identify the sender
1898     @param context - sender context, to match reply w/ request
1899     @param client_address - remote client tunnel ip address
1900     @param client_address - local tunnel ip address
1901     @param is_ipv6 - ipv6 if non-zero, else ipv4
1902     @param local_session_id - local tunnel session id
1903     @param remote_session_id - remote tunnel session id
1904     @param local_cookie - local tunnel cookie
1905     @param l2_sublayer_present - l2 sublayer is present in packets if non-zero
1906     @param encap_vrf_id - fib identifier used for outgoing encapsulated packets
1907 */
1908 define l2tpv3_create_tunnel
1909 {
1910   u32 client_index;
1911   u32 context;
1912   u8 client_address[16];
1913   u8 our_address[16];
1914   u8 is_ipv6;
1915   u32 local_session_id;
1916   u32 remote_session_id;
1917   u64 local_cookie;
1918   u64 remote_cookie;
1919   u8 l2_sublayer_present;
1920   u32 encap_vrf_id;
1921 };
1922
1923 /** \brief l2tpv3 tunnel interface create response
1924     @param context - sender context, to match reply w/ request
1925     @param retval - return code for the request
1926     @param sw_if_index - index of the new tunnel interface
1927 */
1928 define l2tpv3_create_tunnel_reply
1929 {
1930   u32 context;
1931   i32 retval;
1932   u32 sw_if_index;
1933 };
1934
1935 define l2tpv3_set_tunnel_cookies
1936 {
1937   u32 client_index;
1938   u32 context;
1939   u32 sw_if_index;
1940   u64 new_local_cookie;
1941   u64 new_remote_cookie;
1942 };
1943
1944 /** \brief L2TP tunnel set cookies response
1945     @param context - sender context, to match reply w/ request
1946     @param retval - return code for the request
1947 */
1948 define l2tpv3_set_tunnel_cookies_reply
1949 {
1950   u32 context;
1951   i32 retval;
1952 };
1953
1954 define sw_if_l2tpv3_tunnel_details
1955 {
1956   u32 context;
1957   u32 sw_if_index;
1958   u8 interface_name[64];
1959   u8 client_address[16];
1960   u8 our_address[16];
1961   u32 local_session_id;
1962   u32 remote_session_id;
1963   u64 local_cookie[2];
1964   u64 remote_cookie;
1965   u8 l2_sublayer_present;
1966 };
1967
1968 define sw_if_l2tpv3_tunnel_dump
1969 {
1970   u32 client_index;
1971   u32 context;
1972 };
1973
1974 /** \brief L2 fib clear table request, clear all mac entries in the l2 fib
1975     @param client_index - opaque cookie to identify the sender
1976     @param context - sender context, to match reply w/ request
1977 */
1978 define l2_fib_clear_table
1979 {
1980   u32 client_index;
1981   u32 context;
1982 };
1983
1984 /** \brief L2 fib clear table response
1985     @param context - sender context, to match reply w/ request
1986     @param retval - return code for the request
1987 */
1988 define l2_fib_clear_table_reply
1989 {
1990   u32 context;
1991   i32 retval;
1992 };
1993
1994 /** \brief L2 interface ethernet flow point filtering enable/disable request
1995     @param client_index - opaque cookie to identify the sender
1996     @param context - sender context, to match reply w/ request
1997     @param sw_if_index - interface to enable/disable filtering on
1998     @param enable_disable - if non-zero enable filtering, else disable
1999 */
2000 define l2_interface_efp_filter
2001 {
2002   u32 client_index;
2003   u32 context;
2004   u32 sw_if_index;
2005   u32 enable_disable;
2006 };
2007
2008 /** \brief L2 interface ethernet flow point filtering response
2009     @param context - sender context, to match reply w/ request
2010     @param retval - return code for the request
2011 */
2012 define l2_interface_efp_filter_reply
2013 {
2014   u32 context;
2015   i32 retval;
2016 };
2017
2018 define l2tpv3_interface_enable_disable
2019 {
2020   u32 client_index;
2021   u32 context;
2022   u8 enable_disable;
2023   u32 sw_if_index;
2024 };
2025
2026 define l2tpv3_interface_enable_disable_reply
2027 {
2028   u32 context;
2029   i32 retval;
2030 };
2031
2032 define l2tpv3_set_lookup_key
2033 {
2034   u32 client_index;
2035   u32 context;
2036   /* 0 = ip6 src_address, 1 = ip6 dst_address, 2 = session_id */
2037   u8 key;
2038 };
2039
2040 define l2tpv3_set_lookup_key_reply
2041 {
2042   u32 context;
2043   i32 retval;
2044 };
2045
2046 define vxlan_add_del_tunnel
2047 {
2048   u32 client_index;
2049   u32 context;
2050   u8 is_add;
2051   u8 is_ipv6;
2052   u8 src_address[16];
2053   u8 dst_address[16];
2054   u32 encap_vrf_id;
2055   u32 decap_next_index;
2056   u32 vni;
2057 };
2058
2059 define vxlan_add_del_tunnel_reply
2060 {
2061   u32 context;
2062   i32 retval;
2063   u32 sw_if_index;
2064 };
2065
2066 define vxlan_tunnel_dump
2067 {
2068   u32 client_index;
2069   u32 context;
2070   u32 sw_if_index;
2071 };
2072
2073 define vxlan_tunnel_details
2074 {
2075   u32 context;
2076   u32 sw_if_index;
2077   u8 src_address[16];
2078   u8 dst_address[16];
2079   u32 encap_vrf_id;
2080   u32 decap_next_index;
2081   u32 vni;
2082   u8 is_ipv6;
2083 };
2084
2085 define gre_add_del_tunnel
2086 {
2087   u32 client_index;
2088   u32 context;
2089   u8 is_add;
2090   u8 is_ipv6;
2091   u8 teb;
2092   u8 src_address[16];
2093   u8 dst_address[16];
2094   u32 outer_fib_id;
2095 };
2096
2097 define gre_add_del_tunnel_reply
2098 {
2099   u32 context;
2100   i32 retval;
2101   u32 sw_if_index;
2102 };
2103
2104 define gre_tunnel_dump
2105 {
2106   u32 client_index;
2107   u32 context;
2108   u32 sw_if_index;
2109 };
2110
2111 define gre_tunnel_details
2112 {
2113   u32 context;
2114   u32 sw_if_index;
2115   u8 is_ipv6;
2116   u8 teb;
2117   u8 src_address[16];
2118   u8 dst_address[16];
2119   u32 outer_fib_id;
2120 };
2121
2122 /** \brief L2 interface vlan tag rewrite configure request
2123     @param client_index - opaque cookie to identify the sender
2124     @param context - sender context, to match reply w/ request
2125     @param sw_if_index - interface the operation is applied to
2126     @param vtr_op - Choose from l2_vtr_op_t enum values
2127     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
2128     @param tag1 - Needed for any push or translate vtr op
2129     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
2130 */
2131 define l2_interface_vlan_tag_rewrite
2132 {
2133   u32 client_index;
2134   u32 context;
2135   u32 sw_if_index;
2136   u32 vtr_op;
2137   u32 push_dot1q;               // ethertype of first pushed tag is dot1q/dot1ad
2138   u32 tag1;                     // first pushed tag
2139   u32 tag2;                     // second pushed tag
2140 };
2141
2142 /** \brief L2 interface vlan tag rewrite response
2143     @param context - sender context, to match reply w/ request
2144     @param retval - return code for the request
2145 */
2146 define l2_interface_vlan_tag_rewrite_reply
2147 {
2148   u32 context;
2149   i32 retval;
2150 };
2151
2152 /** \brief vhost-user interface create request
2153     @param client_index - opaque cookie to identify the sender
2154     @param is_server - our side is socket server
2155     @param sock_filename - unix socket filename, used to speak with frontend
2156     @param use_custom_mac - enable or disable the use of the provided hardware address
2157     @param mac_address - hardware address to use if 'use_custom_mac' is set
2158 */
2159 define create_vhost_user_if
2160 {
2161   u32 client_index;
2162   u32 context;
2163   u8 is_server;
2164   u8 sock_filename[256];
2165   u8 renumber;
2166   u32 custom_dev_instance;
2167   u8 use_custom_mac;
2168   u8 mac_address[6];
2169 };
2170
2171 /** \brief vhost-user interface create response
2172     @param context - sender context, to match reply w/ request
2173     @param retval - return code for the request
2174     @param sw_if_index - interface the operation is applied to
2175 */
2176 define create_vhost_user_if_reply
2177 {
2178   u32 context;
2179   i32 retval;
2180   u32 sw_if_index;
2181 };
2182
2183 /** \brief vhost-user interface modify request
2184     @param client_index - opaque cookie to identify the sender
2185     @param is_server - our side is socket server
2186     @param sock_filename - unix socket filename, used to speak with frontend
2187 */
2188 define modify_vhost_user_if
2189 {
2190   u32 client_index;
2191   u32 context;
2192   u32 sw_if_index;
2193   u8 is_server;
2194   u8 sock_filename[256];
2195   u8 renumber;
2196   u32 custom_dev_instance;
2197 };
2198
2199 /** \brief vhost-user interface modify response
2200     @param context - sender context, to match reply w/ request
2201     @param retval - return code for the request
2202 */
2203 define modify_vhost_user_if_reply
2204 {
2205   u32 context;
2206   i32 retval;
2207 };
2208
2209 /** \brief vhost-user interface delete request
2210     @param client_index - opaque cookie to identify the sender
2211 */
2212 define delete_vhost_user_if
2213 {
2214   u32 client_index;
2215   u32 context;
2216   u32 sw_if_index;
2217 };
2218
2219 /** \brief vhost-user interface delete response
2220     @param context - sender context, to match reply w/ request
2221     @param retval - return code for the request
2222 */
2223 define delete_vhost_user_if_reply
2224 {
2225   u32 context;
2226   i32 retval;
2227 };
2228
2229 define create_subif
2230 {
2231   u32 client_index;
2232   u32 context;
2233   u32 sw_if_index;
2234   u32 sub_id;
2235
2236   /* These fields map directly onto the subif template */
2237   u8 no_tags;
2238   u8 one_tag;
2239   u8 two_tags;
2240   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
2241   u8 exact_match;
2242   u8 default_sub;
2243   u8 outer_vlan_id_any;
2244   u8 inner_vlan_id_any;
2245   u16 outer_vlan_id;
2246   u16 inner_vlan_id;
2247 };
2248
2249 define create_subif_reply
2250 {
2251   u32 context;
2252   i32 retval;
2253   u32 sw_if_index;
2254 };
2255
2256 /** \brief show version
2257     @param client_index - opaque cookie to identify the sender
2258     @param context - sender context, to match reply w/ request
2259 */
2260 define show_version
2261 {
2262   u32 client_index;
2263   u32 context;
2264 };
2265
2266 /** \brief show version response
2267     @param context - sender context, to match reply w/ request
2268     @param retval - return code for the request
2269     @param program - name of the program (vpe)
2270     @param version  - version of the program
2271     @param build_directory - root of the workspace where the program was built
2272 */
2273 define show_version_reply
2274 {
2275   u32 context;
2276   i32 retval;
2277   u8 program[32];
2278   u8 version[32];
2279   u8 build_date[32];
2280   u8 build_directory[256];
2281 };
2282
2283 /** \brief Vhost-user interface details structure (fix this)
2284     @param sw_if_index - index of the interface
2285     @param interface_name - name of interface
2286     @param virtio_net_hdr_sz - net header size
2287     @param features - interface features
2288     @param is_server - vhost-user server socket
2289     @param sock_filename - socket filename
2290     @param num_regions - number of used memory regions
2291 */
2292 define sw_interface_vhost_user_details
2293 {
2294   u32 context;
2295   u32 sw_if_index;
2296   u8 interface_name[64];
2297   u32 virtio_net_hdr_sz;
2298   u64 features;
2299   u8 is_server;
2300   u8 sock_filename[256];
2301   u32 num_regions;
2302   i32 sock_errno;
2303 };
2304
2305 /* works */
2306 define sw_interface_vhost_user_dump
2307 {
2308   u32 client_index;
2309   u32 context;
2310 };
2311
2312 define ip_address_details
2313 {
2314   u32 client_index;
2315   u32 context;
2316   u8 ip[16];
2317   u8 prefix_length;
2318 };
2319
2320 define ip_address_dump
2321 {
2322   u32 client_index;
2323   u32 context;
2324   u32 sw_if_index;
2325   u8 is_ipv6;
2326 };
2327
2328 define ip_details
2329 {
2330   u32 sw_if_index;
2331   u32 context;
2332 };
2333
2334 define ip_dump
2335 {
2336   u32 client_index;
2337   u32 context;
2338   u8 is_ipv6;
2339 };
2340
2341 /** \brief l2 fib table entry structure
2342     @param bd_id - the l2 fib / bridge domain table id
2343     @param mac - the entry's mac address
2344     @param sw_if_index - index of the interface
2345     @param static_mac - the entry is statically configured.
2346     @param filter_mac - the entry is a mac filter entry.
2347     @param bvi_mac - the mac address is a bridge virtual interface
2348 */
2349 define l2_fib_table_entry
2350 {
2351   u32 context;
2352   u32 bd_id;
2353   u64 mac;
2354   u32 sw_if_index;
2355   u8 static_mac;
2356   u8 filter_mac;
2357   u8 bvi_mac;
2358 };
2359
2360 /** \brief Dump l2 fib (aka bridge domain) table
2361     @param client_index - opaque cookie to identify the sender
2362     @param bd_id - the l2 fib / bridge domain table identifier
2363 */
2364 define l2_fib_table_dump
2365 {
2366   u32 client_index;
2367   u32 context;
2368   u32 bd_id;
2369 };
2370
2371 define vxlan_gpe_add_del_tunnel
2372 {
2373   u32 client_index;
2374   u32 context;
2375   u8 is_ipv6;
2376   u8 local[16];
2377   u8 remote[16];
2378   u32 encap_vrf_id;
2379   u32 decap_vrf_id;
2380   u8 protocol;
2381   u32 vni;
2382   u8 is_add;
2383 };
2384
2385 define vxlan_gpe_add_del_tunnel_reply
2386 {
2387   u32 context;
2388   i32 retval;
2389   u32 sw_if_index;
2390 };
2391
2392 define vxlan_gpe_tunnel_dump
2393 {
2394   u32 client_index;
2395   u32 context;
2396   u32 sw_if_index;
2397 };
2398
2399 define vxlan_gpe_tunnel_details
2400 {
2401   u32 context;
2402   u32 sw_if_index;
2403   u8 local[16];
2404   u8 remote[16];
2405   u32 vni;
2406   u8 protocol;
2407   u32 encap_vrf_id;
2408   u32 decap_vrf_id;
2409   u8 is_ipv6;
2410 };
2411
2412 /** \brief add or delete locator_set
2413     @param client_index - opaque cookie to identify the sender
2414     @param context - sender context, to match reply w/ request
2415     @param is_add - add address if non-zero, else delete
2416     @param locator_set_name - locator name
2417     @param locator_num - number of locators
2418     @param locators - LISP locator records
2419         Structure of one locator record is as follows:
2420
2421         define locator_t {
2422           u32 sw_if_index;
2423           u8 priority;
2424           u8 weight;
2425         }
2426 */
2427 define lisp_add_del_locator_set
2428 {
2429   u32 client_index;
2430   u32 context;
2431   u8 is_add;
2432   u8 locator_set_name[64];
2433   u32 locator_num;
2434   u8 locators[0];
2435 };
2436
2437 /** \brief Reply for locator_set add/del
2438     @param context - returned sender context, to match reply w/ request
2439     @param retval - return code
2440     @param ls_index - locator set index
2441 */
2442 define lisp_add_del_locator_set_reply
2443 {
2444   u32 context;
2445   i32 retval;
2446   u32 ls_index;
2447 };
2448
2449 /** \brief add or delete locator for locator_set
2450     @param client_index - opaque cookie to identify the sender
2451     @param context - sender context, to match reply w/ request
2452     @param is_add - add address if non-zero, else delete
2453     @param locator_set_name - name of locator_set to add/del locator
2454     @param sw_if_index - index of the interface
2455     @param priority - priority of the lisp locator
2456     @param weight - weight of the lisp locator
2457 */
2458 define lisp_add_del_locator
2459 {
2460   u32 client_index;
2461   u32 context;
2462   u8 is_add;
2463   u8 locator_set_name[64];
2464   u32 sw_if_index;
2465   u8 priority;
2466   u8 weight;
2467 };
2468
2469 /** \brief Reply for locator add/del
2470     @param context - returned sender context, to match reply w/ request
2471     @param retval - return code
2472 */
2473 define lisp_add_del_locator_reply
2474 {
2475   u32 context;
2476   i32 retval;
2477 };
2478
2479 /** \brief add or delete lisp eid-table
2480     @param client_index - opaque cookie to identify the sender
2481     @param context - sender context, to match reply w/ request
2482     @param is_add - add address if non-zero, else delete
2483     @param eid_type:
2484       0 : ipv4
2485       1 : ipv6
2486       2 : mac
2487     @param eid - EID can be ip4, ip6 or mac
2488     @param prefix_len - prefix len
2489     @param locator_set_name - name of locator_set to add/del eid-table
2490     @param vni - virtual network instance
2491 */
2492 define lisp_add_del_local_eid
2493 {
2494   u32 client_index;
2495   u32 context;
2496   u8 is_add;
2497   u8 eid_type;
2498   u8 eid[16];
2499   u8 prefix_len;
2500   u8 locator_set_name[64];
2501   u32 vni;
2502 };
2503
2504 /** \brief Reply for local_eid add/del
2505     @param context - returned sender context, to match reply w/ request
2506     @param retval - return code
2507 */
2508 define lisp_add_del_local_eid_reply
2509 {
2510   u32 context;
2511   i32 retval;
2512 };
2513
2514 /** \brief add or delete lisp gpe tunnel
2515     @param client_index - opaque cookie to identify the sender
2516     @param context - sender context, to match reply w/ request
2517     @param is_add - add address if non-zero, else delete
2518     @param eid_type -
2519       0 : ipv4
2520       1 : ipv6
2521       2 : mac
2522     @param rmt_eid - remote eid
2523     @param lcl_eid - local eid
2524     @param rmt_len - remote prefix len
2525     @param lcl_len - local prefix len
2526     @param vni - virtual network identifier
2527     @param dp_table - vrf/bridge domain id
2528     @param loc_num - number of locators
2529     @param lcl_locs - array of local locators
2530     @param rmt_locs - array of remote locators
2531     @param action - negative action when 0 locators configured
2532 */
2533 define lisp_gpe_add_del_fwd_entry
2534 {
2535   u32 client_index;
2536   u32 context;
2537   u8 is_add;
2538   u8 eid_type;
2539   u8 rmt_eid[16];
2540   u8 lcl_eid[16];
2541   u8 rmt_len;
2542   u8 lcl_len;
2543   u32 vni;
2544   u32 dp_table;
2545   u32 loc_num;
2546   u8 lcl_locs[loc_num];
2547   u8 rmt_locs[loc_num];
2548   u8 action;
2549 };
2550
2551 /** \brief Reply for gpe_fwd_entry add/del
2552     @param context - returned sender context, to match reply w/ request
2553     @param retval - return code
2554 */
2555 define lisp_gpe_add_del_fwd_entry_reply
2556 {
2557   u32 context;
2558   i32 retval;
2559 };
2560
2561 /** \brief add or delete map-resolver
2562     @param client_index - opaque cookie to identify the sender
2563     @param context - sender context, to match reply w/ request
2564     @param is_add - add address if non-zero, else delete
2565     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
2566     @param ip_address - array of address bytes
2567 */
2568 define lisp_add_del_map_resolver
2569 {
2570   u32 client_index;
2571   u32 context;
2572   u8 is_add;
2573   u8 is_ipv6;
2574   u8 ip_address[16];
2575 };
2576
2577 /** \brief Reply for map_resolver add/del
2578     @param context - returned sender context, to match reply w/ request
2579     @param retval - return code
2580 */
2581 define lisp_add_del_map_resolver_reply
2582 {
2583   u32 context;
2584   i32 retval;
2585 };
2586
2587 /** \brief enable or disable lisp-gpe protocol
2588     @param client_index - opaque cookie to identify the sender
2589     @param context - sender context, to match reply w/ request
2590     @param is_en - enable protocol if non-zero, else disable
2591 */
2592 define lisp_gpe_enable_disable
2593 {
2594   u32 client_index;
2595   u32 context;
2596   u8 is_en;
2597 };
2598
2599 /** \brief Reply for gpe enable/disable
2600     @param context - returned sender context, to match reply w/ request
2601     @param retval - return code
2602 */
2603 define lisp_gpe_enable_disable_reply
2604 {
2605   u32 context;
2606   i32 retval;
2607 };
2608
2609 /** \brief enable or disable LISP feature
2610     @param client_index - opaque cookie to identify the sender
2611     @param context - sender context, to match reply w/ request
2612     @param is_en - enable protocol if non-zero, else disable
2613 */
2614 define lisp_enable_disable
2615 {
2616   u32 client_index;
2617   u32 context;
2618   u8 is_en;
2619 };
2620
2621 /** \brief Reply for gpe enable/disable
2622     @param context - returned sender context, to match reply w/ request
2623     @param retval - return code
2624 */
2625 define lisp_enable_disable_reply
2626 {
2627   u32 context;
2628   i32 retval;
2629 };
2630
2631 /** \brief add or delete gpe_iface
2632     @param client_index - opaque cookie to identify the sender
2633     @param context - sender context, to match reply w/ request
2634     @param is_add - add address if non-zero, else delete
2635 */
2636 define lisp_gpe_add_del_iface
2637 {
2638   u32 client_index;
2639   u32 context;
2640   u8 is_add;
2641   u8 is_l2;
2642   u32 dp_table;
2643   u32 vni;
2644 };
2645
2646 /** \brief Reply for gpe_iface add/del
2647     @param context - returned sender context, to match reply w/ request
2648     @param retval - return code
2649 */
2650 define lisp_gpe_add_del_iface_reply
2651 {
2652   u32 context;
2653   i32 retval;
2654 };
2655
2656 /** \brief configure or disable LISP PITR node
2657     @param client_index - opaque cookie to identify the sender
2658     @param context - sender context, to match reply w/ request
2659     @param ls_name - locator set name
2660     @param is_add - add locator set if non-zero, else disable pitr
2661 */
2662 define lisp_pitr_set_locator_set
2663 {
2664   u32 client_index;
2665   u32 context;
2666   u8 is_add;
2667   u8 ls_name[64];
2668 };
2669
2670 /** \brief Reply for lisp_pitr_set_locator_set
2671     @param context - returned sender context, to match reply w/ request
2672     @param retval - return code
2673 */
2674 define lisp_pitr_set_locator_set_reply
2675 {
2676   u32 context;
2677   i32 retval;
2678 };
2679
2680 /** \brief set LISP map-request mode. Based on configuration VPP will send
2681       src/dest or just normal destination map requests.
2682     @param client_index - opaque cookie to identify the sender
2683     @param context - sender context, to match reply w/ request
2684     @param mode - new map-request mode. Supported values are:
2685       0 - destination only
2686       1 - source/destaination
2687 */
2688 define lisp_map_request_mode
2689 {
2690   u32 client_index;
2691   u32 context;
2692   u8 mode;
2693 };
2694
2695 /** \brief Reply for lisp_map_request_mode
2696     @param context - returned sender context, to match reply w/ request
2697     @param retval - return code
2698 */
2699 define lisp_map_request_mode_reply
2700 {
2701   u32 context;
2702   i32 retval;
2703 };
2704
2705 /** \brief Request for LISP map-request mode
2706     @param client_index - opaque cookie to identify the sender
2707     @param context - sender context, to match reply w/ request
2708 */
2709 define show_lisp_map_request_mode
2710 {
2711   u32 client_index;
2712   u32 context;
2713 };
2714
2715 /** \brief Reply for show_lisp_map_request_mode
2716     @param context - returned sender context, to match reply w/ request
2717     @param retval - return code
2718     @param mode - map-request mode
2719 */
2720 define show_lisp_map_request_mode_reply
2721 {
2722   u32 context;
2723   i32 retval;
2724   u8 mode;
2725 };
2726
2727 /** \brief add or delete remote static mapping
2728     @param client_index - opaque cookie to identify the sender
2729     @param context - sender context, to match reply w/ request
2730     @param is_add - add address if non-zero, else delete
2731     @param is_src_dst - flag indicating src/dst based routing policy
2732     @param del_all - if set, delete all remote mappings
2733     @param vni - virtual network instance
2734     @param action - negative map-reply action
2735     @param eid_type -
2736       0 : ipv4
2737       1 : ipv6
2738       2 : mac
2739     @param deid - dst EID
2740     @param seid - src EID, valid only if is_src_dst is enabled
2741     @param rloc_num - number of remote locators
2742     @param rlocs - remote locator records
2743         Structure of remote locator:
2744
2745         define rloc_t {
2746           u8 is_ip4;
2747           u8 priority;
2748           u8 weight;
2749           u8 addr[16];
2750         }
2751 */
2752 define lisp_add_del_remote_mapping
2753 {
2754   u32 client_index;
2755   u32 context;
2756   u8 is_add;
2757   u8 is_src_dst;
2758   u8 del_all;
2759   u32 vni;
2760   u8 action;
2761   u8 eid_type;
2762   u8 eid[16];
2763   u8 eid_len;
2764   u8 seid[16];
2765   u8 seid_len;
2766   u32 rloc_num;
2767   u8 rlocs[0];
2768 };
2769
2770 /** \brief Reply for lisp_add_del_remote_mapping
2771     @param context - returned sender context, to match reply w/ request
2772     @param retval - return code
2773 */
2774 define lisp_add_del_remote_mapping_reply
2775 {
2776   u32 context;
2777   i32 retval;
2778 };
2779
2780 /** \brief add or delete LISP adjacency adjacency
2781     @param client_index - opaque cookie to identify the sender
2782     @param context - sender context, to match reply w/ request
2783     @param is_add - add address if non-zero, else delete
2784     @param vni - virtual network instance
2785     @param eid_type -
2786       0 : ipv4
2787       1 : ipv6
2788       2 : mac
2789     @param reid - remote EID
2790     @param leid - local EID
2791 */
2792 define lisp_add_del_adjacency
2793 {
2794   u32 client_index;
2795   u32 context;
2796   u8 is_add;
2797   u32 vni;
2798   u8 eid_type;
2799   u8 reid[16];
2800   u8 leid[16];
2801   u8 reid_len;
2802   u8 leid_len;
2803 };
2804
2805 /** \brief Reply for lisp_add_del_adjacency
2806     @param context - returned sender context, to match reply w/ request
2807     @param retval - return code
2808 */
2809 define lisp_add_del_adjacency_reply
2810 {
2811   u32 context;
2812   i32 retval;
2813 };
2814
2815 /** \brief add or delete map request itr rlocs
2816     @param client_index - opaque cookie to identify the sender
2817     @param context - sender context, to match reply w/ request
2818     @param is_add - add address if non-zero, else delete
2819     @param locator_set_name - locator set name
2820 */
2821 define lisp_add_del_map_request_itr_rlocs
2822 {
2823   u32 client_index;
2824   u32 context;
2825   u8 is_add;
2826   u8 locator_set_name[64];
2827 };
2828
2829 /** \brief Reply for lisp_add_del_map_request_itr_rlocs
2830     @param context - returned sender context, to match reply w/ request
2831     @param retval - return code
2832 */
2833
2834 define lisp_add_del_map_request_itr_rlocs_reply
2835 {
2836   u32 context;
2837   i32 retval;
2838 };
2839
2840 /** \brief map/unmap vni/bd_index to vrf
2841     @param client_index - opaque cookie to identify the sender
2842     @param context - sender context, to match reply w/ request
2843     @param is_add - add or delete mapping
2844     @param dp_table - virtual network id/bridge domain index
2845     @param vrf - vrf
2846 */
2847 define lisp_eid_table_add_del_map
2848 {
2849   u32 client_index;
2850   u32 context;
2851   u8 is_add;
2852   u32 vni;
2853   u32 dp_table;
2854   u8 is_l2;
2855 };
2856
2857 /** \brief Reply for lisp_eid_table_add_del_map
2858     @param context - returned sender context, to match reply w/ request
2859     @param retval - return code
2860 */
2861 define lisp_eid_table_add_del_map_reply
2862 {
2863   u32 context;
2864   i32 retval;
2865 };
2866
2867 /** \brief Request for map lisp locator status
2868     @param client_index - opaque cookie to identify the sender
2869     @param context - sender context, to match reply w/ request
2870     @param locator_set_index - index of locator_set
2871     @param ls_name - locator set name
2872     @param is_index_set - flag indicating whether ls_name or ls_index is set
2873  */
2874 define lisp_locator_dump
2875 {
2876   u32 client_index;
2877   u32 context;
2878   u32 ls_index;
2879   u8 ls_name[64];
2880   u8 is_index_set;
2881 };
2882
2883 /** \brief LISP locator_set status
2884     @param local - if is set, then locator is local
2885     @param locator_set_name - name of the locator_set
2886     @param sw_if_index - sw_if_index of the locator
2887     @param priority - locator priority
2888     @param weight - locator weight
2889   */
2890 define lisp_locator_details
2891 {
2892   u32 context;
2893   u8 local;
2894   u32 sw_if_index;
2895   u8 is_ipv6;
2896   u8 ip_address[16];
2897   u8 priority;
2898   u8 weight;
2899 };
2900
2901 /** \brief LISP locator_set status
2902     @param context - sender context, to match reply w/ request
2903     @param ls_index - locator set index
2904     @param ls_name - name of the locator set
2905  */
2906 define lisp_locator_set_details
2907 {
2908   u32 context;
2909   u32 ls_index;
2910   u8 ls_name[64];
2911 };
2912
2913 /** \brief Request for locator_set summary status
2914     @param client_index - opaque cookie to identify the sender
2915     @param context - sender context, to match reply w/ request
2916     @param filter - filter type
2917       Supported values:
2918         0: all locator sets
2919         1: local locator sets
2920         2: remote locator sets
2921  */
2922 define lisp_locator_set_dump
2923 {
2924   u32 client_index;
2925   u32 context;
2926   u8 filter;
2927 };
2928
2929 /** \brief Dump lisp eid-table
2930     @param client_index - opaque cookie to identify the sender
2931     @param context - sender context, to match reply w/ request
2932     @param locator_set_index - index of locator_set, if ~0 then the mapping
2933                                 is negative
2934     @param action - negative map request action
2935     @param is_local - local if non-zero, else remote
2936     @param eid_type:
2937       0 : ipv4
2938       1 : ipv6
2939       2 : mac
2940     @param is_src_dst - EID is type of source/destination
2941     @param eid - EID can be ip4, ip6 or mac
2942     @param eid_prefix_len - prefix length
2943     @param seid - source EID can be ip4, ip6 or mac
2944     @param seid_prefix_len - source prefix length
2945     @param vni - virtual network instance
2946     @param ttl - time to live
2947     @param authoritative - authoritative
2948 */
2949
2950 define lisp_eid_table_details
2951 {
2952   u32 context;
2953   u32 locator_set_index;
2954   u8 action;
2955   u8 is_local;
2956   u8 eid_type;
2957   u8 is_src_dst;
2958   u32 vni;
2959   u8 eid[16];
2960   u8 eid_prefix_len;
2961   u8 seid[16];
2962   u8 seid_prefix_len;
2963   u32 ttl;
2964   u8 authoritative;
2965 };
2966
2967 /** \brief Request for eid table summary status
2968     @param client_index - opaque cookie to identify the sender
2969     @param context - sender context, to match reply w/ request
2970     @param eid_set - if non-zero request info about specific mapping
2971     @param vni - virtual network instance; valid only if eid_set != 0
2972     @param prefix_length - prefix length if EID is IP address;
2973       valid only if eid_set != 0
2974     @param eid_type - EID type; valid only if eid_set != 0
2975       Supported values:
2976         0: EID is IPv4
2977         1: EID is IPv6
2978         2: EID is ethernet address
2979     @param eid - endpoint identifier
2980     @param filter - filter type;
2981       Support values:
2982         0: all eid
2983         1: local eid
2984         2: remote eid
2985  */
2986 define lisp_eid_table_dump
2987 {
2988   u32 client_index;
2989   u32 context;
2990   u8 eid_set;
2991   u8 prefix_length;
2992   u32 vni;
2993   u8 eid_type;
2994   u8 eid[16];
2995   u8 filter;
2996 };
2997
2998 /** \brief LISP adjacency
2999     @param eid_type -
3000       0 : ipv4
3001       1 : ipv6
3002       2 : mac
3003     @param reid - remote EID
3004     @param leid - local EID
3005     @param reid_prefix_len - remote EID IP prefix length
3006     @param leid_prefix_len - local EID IP prefix length
3007   */
3008 typeonly manual_print manual_endian define lisp_adjacency
3009 {
3010   u8 eid_type;
3011   u8 reid[16];
3012   u8 leid[16];
3013   u8 reid_prefix_len;
3014   u8 leid_prefix_len;
3015 };
3016
3017 /** \brief LISP adjacency reply
3018     @param count - number of adjacencies
3019     @param adjacencies - array of adjacencies
3020   */
3021 manual_endian manual_print define lisp_adjacencies_get_reply
3022 {
3023   u32 context;
3024   i32 retval;
3025   u32 count;
3026   vl_api_lisp_adjacency_t adjacencies[count];
3027 };
3028
3029 /** \brief Request for LISP adjacencies
3030     @param client_index - opaque cookie to identify the sender
3031     @param context - sender context, to match reply w/ request
3032     @param vni - filter adjacencies by VNI
3033  */
3034 define lisp_adjacencies_get
3035 {
3036   u32 client_index;
3037   u32 context;
3038   u32 vni;
3039 };
3040
3041 /** \brief Shows relationship between vni and vrf/bd
3042     @param dp_table - VRF index or bridge domain index
3043     @param vni - vitual network instance
3044   */
3045 define lisp_eid_table_map_details
3046 {
3047   u32 context;
3048   u32 vni;
3049   u32 dp_table;
3050 };
3051
3052 /** \brief Request for lisp_eid_table_map_details
3053     @param client_index - opaque cookie to identify the sender
3054     @param context - sender context, to match reply w/ request
3055     @param is_l2 - if set dump vni/bd mappings else vni/vrf
3056  */
3057 define lisp_eid_table_map_dump
3058 {
3059   u32 client_index;
3060   u32 context;
3061   u8 is_l2;
3062 };
3063
3064 /** \brief Dumps all VNIs used in mappings
3065     @param client_index - opaque cookie to identify the sender
3066     @param context - sender context, to match reply w/ request
3067   */
3068 define lisp_eid_table_vni_dump
3069 {
3070   u32 client_index;
3071   u32 context;
3072 };
3073
3074 /** \brief reply to lisp_eid_table_vni_dump
3075     @param client_index - opaque cookie to identify the sender
3076     @param context - sender context, to match reply w/ request
3077     @param vni - virtual network instance
3078  */
3079 define lisp_eid_table_vni_details
3080 {
3081   u32 client_index;
3082   u32 context;
3083   u32 vni;
3084 };
3085
3086 define lisp_gpe_tunnel_details
3087 {
3088   u32 context;
3089   u32 tunnels;
3090   u8 is_ipv6;
3091   u8 source_ip[16];
3092   u8 destination_ip[16];
3093   u32 encap_fib_id;
3094   u32 decap_fib_id;
3095   u32 dcap_next;
3096   u8 lisp_ver;
3097   u8 next_protocol;
3098   u8 flags;
3099   u8 ver_res;
3100   u8 res;
3101   u32 iid;
3102 };
3103
3104 /** \brief Request for gpe tunnel summary status
3105     @param client_index - opaque cookie to identify the sender
3106     @param context - sender context, to match reply w/ request
3107  */
3108 define lisp_gpe_tunnel_dump
3109 {
3110   u32 client_index;
3111   u32 context;
3112 };
3113
3114 /** \brief LISP map resolver status
3115     @param locator_set_name - name of the locator_set
3116     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
3117     @param ip_address - array of address bytes
3118  */
3119 define lisp_map_resolver_details
3120 {
3121   u32 context;
3122   u8 is_ipv6;
3123   u8 ip_address[16];
3124 };
3125
3126 /** \brief Request for map resolver summary status
3127     @param client_index - opaque cookie to identify the sender
3128     @param context - sender context, to match reply w/ request
3129  */
3130 define lisp_map_resolver_dump
3131 {
3132   u32 client_index;
3133   u32 context;
3134 };
3135
3136 /** \brief Request for lisp-gpe protocol status
3137     @param client_index - opaque cookie to identify the sender
3138     @param context - sender context, to match reply w/ request
3139 */
3140 define show_lisp_status
3141 {
3142   u32 client_index;
3143   u32 context;
3144 };
3145
3146 /** \brief Status of lisp, enable or disable
3147     @param context - sender context, to match reply w/ request
3148     @param feature_status - lisp enable if non-zero, else disable
3149     @param gpe_status - lisp enable if non-zero, else disable
3150 */
3151 define show_lisp_status_reply
3152 {
3153   u32 context;
3154   i32 retval;
3155   u8 feature_status;
3156   u8 gpe_status;
3157 };
3158
3159 /** \brief Get LISP map request itr rlocs status
3160     @param context - sender context, to match reply w/ request
3161     @param locator_set_name - name of the locator_set
3162  */
3163 define lisp_get_map_request_itr_rlocs
3164 {
3165   u32 client_index;
3166   u32 context;
3167 };
3168
3169 /** \brief Request for map request itr rlocs summary status
3170  */
3171 define lisp_get_map_request_itr_rlocs_reply
3172 {
3173   u32 context;
3174   i32 retval;
3175   u8 locator_set_name[64];
3176 };
3177
3178 /** \brief Request for lisp pitr status
3179     @param client_index - opaque cookie to identify the sender
3180     @param context - sender context, to match reply w/ request
3181 */
3182 define show_lisp_pitr
3183 {
3184   u32 client_index;
3185   u32 context;
3186 };
3187
3188 /** \brief Status of lisp pitr, enable or disable
3189     @param context - sender context, to match reply w/ request
3190     @param status - lisp pitr enable if non-zero, else disable
3191     @param locator_set_name -  name of the locator_set
3192 */
3193 define show_lisp_pitr_reply
3194 {
3195   u32 context;
3196   i32 retval;
3197   u8 status;
3198   u8 locator_set_name[64];
3199 };
3200
3201 /* Gross kludge, DGMS */
3202 define interface_name_renumber
3203 {
3204   u32 client_index;
3205   u32 context;
3206   u32 sw_if_index;
3207   u32 new_show_dev_instance;
3208 };
3209
3210 define interface_name_renumber_reply
3211 {
3212   u32 context;
3213   i32 retval;
3214 };
3215
3216 /** \brief Register for ip4 arp resolution events
3217     @param client_index - opaque cookie to identify the sender
3218     @param context - sender context, to match reply w/ request
3219     @param enable_disable - 1 => register for events, 0 => cancel registration
3220     @param pid - sender's pid
3221     @param address - the exact ip4 address of interest
3222 */
3223 define want_ip4_arp_events
3224 {
3225   u32 client_index;
3226   u32 context;
3227   u8 enable_disable;
3228   u32 pid;
3229   u32 address;
3230 };
3231
3232 /** \brief Reply for interface events registration
3233     @param context - returned sender context, to match reply w/ request
3234     @param retval - return code
3235 */
3236 define want_ip4_arp_events_reply
3237 {
3238   u32 context;
3239   i32 retval;
3240 };
3241
3242 /** \brief Tell client about an ip4 arp resolution event
3243     @param client_index - opaque cookie to identify the sender
3244     @param context - sender context, to match reply w/ request
3245     @param address - the exact ip4 address of interest
3246     @param pid - client pid registered to receive notification
3247     @param sw_if_index - interface which received ARP packet
3248     @param new_mac - the new mac address 
3249     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
3250 */
3251 define ip4_arp_event
3252 {
3253   u32 client_index;
3254   u32 context;
3255   u32 address;
3256   u32 pid;
3257   u32 sw_if_index;
3258   u8 new_mac[6];
3259   u8 mac_ip;
3260 };
3261
3262 /** \brief Register for ip6 nd resolution events
3263     @param client_index - opaque cookie to identify the sender
3264     @param context - sender context, to match reply w/ request
3265     @param enable_disable - 1 => register for events, 0 => cancel registration
3266     @param pid - sender's pid
3267     @param address - the exact ip6 address of interest
3268 */
3269 define want_ip6_nd_events
3270 {
3271   u32 client_index;
3272   u32 context;
3273   u8 enable_disable;
3274   u32 pid;
3275   u8 address[16];
3276 };
3277
3278 /** \brief Reply for ip6 nd resolution events registration
3279     @param context - returned sender context, to match reply w/ request
3280     @param retval - return code
3281 */
3282 define want_ip6_nd_events_reply
3283 {
3284   u32 context;
3285   i32 retval;
3286 };
3287
3288 /** \brief Tell client about an ip6 nd resolution or mac/ip event
3289     @param client_index - opaque cookie to identify the sender
3290     @param context - sender context, to match reply w/ request
3291     @param pid - client pid registered to receive notification
3292     @param sw_if_index - interface which received ARP packet
3293     @param address - the exact ip6 address of interest
3294     @param new_mac - the new mac address 
3295     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
3296 */
3297 define ip6_nd_event
3298 {
3299   u32 client_index;
3300   u32 context;
3301   u32 pid;
3302   u32 sw_if_index;
3303   u8 address[16];
3304   u8 new_mac[6];
3305   u8 mac_ip;
3306 };
3307     
3308 /** \brief L2 bridge domain add or delete request
3309     @param client_index - opaque cookie to identify the sender
3310     @param context - sender context, to match reply w/ request
3311     @param bd_id - the bridge domain to create
3312     @param flood - enable/disable bcast/mcast flooding in the bd
3313     @param uu_flood - enable/disable uknown unicast flood in the bd
3314     @param forward - enable/disable forwarding on all interfaces in the bd
3315     @param learn - enable/disable learning on all interfaces in the bd
3316     @param arp_term - enable/disable arp termination in the bd
3317     @param is_add - add or delete flag
3318 */
3319 define bridge_domain_add_del
3320 {
3321   u32 client_index;
3322   u32 context;
3323   u32 bd_id;
3324   u8 flood;
3325   u8 uu_flood;
3326   u8 forward;
3327   u8 learn;
3328   u8 arp_term;
3329   u8 is_add;
3330 };
3331
3332 /** \brief L2 bridge domain add or delete response
3333     @param context - sender context, to match reply w/ request
3334     @param retval - return code for the set bridge flags request
3335 */
3336 define bridge_domain_add_del_reply
3337 {
3338   u32 context;
3339   i32 retval;
3340 };
3341
3342 /** \brief L2 bridge domain request operational state details
3343     @param client_index - opaque cookie to identify the sender
3344     @param context - sender context, to match reply w/ request
3345     @param bd_id - the bridge domain id desired or ~0 to request all bds
3346 */
3347 define bridge_domain_dump
3348 {
3349   u32 client_index;
3350   u32 context;
3351   u32 bd_id;
3352 };
3353
3354 /** \brief L2 bridge domain operational state response
3355     @param bd_id - the bridge domain id
3356     @param flood - bcast/mcast flooding state on all interfaces in the bd
3357     @param uu_flood - uknown unicast flooding state on all interfaces in the bd
3358     @param forward - forwarding state on all interfaces in the bd
3359     @param learn - learning state on all interfaces in the bd
3360     @param arp_term - arp termination state on all interfaces in the bd
3361     @param n_sw_ifs - number of sw_if_index's in the domain
3362 */
3363 define bridge_domain_details
3364 {
3365   u32 context;
3366   u32 bd_id;
3367   u8 flood;
3368   u8 uu_flood;
3369   u8 forward;
3370   u8 learn;
3371   u8 arp_term;
3372   u32 bvi_sw_if_index;
3373   u32 n_sw_ifs;
3374 };
3375
3376 /** \brief L2 bridge domain sw interface operational state response
3377     @param bd_id - the bridge domain id
3378     @param sw_if_index - sw_if_index in the domain
3379     @param shg - split horizon group for the interface
3380 */
3381 define bridge_domain_sw_if_details
3382 {
3383   u32 context;
3384   u32 bd_id;
3385   u32 sw_if_index;
3386   u8 shg;
3387 };
3388
3389 /** \brief DHCP Client config add / del request
3390     @param client_index - opaque cookie to identify the sender
3391     @param context - sender context, to match reply w/ request
3392     @param sw_if_index - index of the interface for DHCP client
3393     @param hostname - hostname
3394     @param is_add - add the config if non-zero, else delete
3395     @param want_dhcp_event - DHCP event sent to the sender
3396            via dhcp_compl_event API message if non-zero
3397     @param pid - sender's pid
3398 */
3399 define dhcp_client_config
3400 {
3401   u32 client_index;
3402   u32 context;
3403   u32 sw_if_index;
3404   u8 hostname[64];
3405   u8 is_add;
3406   u8 want_dhcp_event;
3407   u32 pid;
3408 };
3409
3410 /** \brief DHCP Client config response
3411     @param context - sender context, to match reply w/ request
3412     @param retval - return code for the request
3413 */
3414 define dhcp_client_config_reply
3415 {
3416   u32 context;
3417   i32 retval;
3418 };
3419
3420 /** \brief Set/unset input ACL interface
3421     @param client_index - opaque cookie to identify the sender
3422     @param context - sender context, to match reply w/ request
3423     @param sw_if_index - interface to set/unset input ACL
3424     @param ip4_table_index - ip4 classify table index (~0 for skip)
3425     @param ip6_table_index - ip6 classify table index (~0 for skip)
3426     @param l2_table_index  -  l2 classify table index (~0 for skip)
3427     @param is_add - Set input ACL if non-zero, else unset
3428     Note: User is recommeneded to use just one valid table_index per call.
3429           (ip4_table_index, ip6_table_index, or l2_table_index)
3430 */
3431 define input_acl_set_interface
3432 {
3433   u32 client_index;
3434   u32 context;
3435   u32 sw_if_index;
3436   u32 ip4_table_index;
3437   u32 ip6_table_index;
3438   u32 l2_table_index;
3439   u8 is_add;
3440 };
3441
3442 /** \brief Set/unset input ACL interface response
3443     @param context - sender context, to match reply w/ request
3444     @param retval - return code for the request
3445 */
3446 define input_acl_set_interface_reply
3447 {
3448   u32 context;
3449   i32 retval;
3450 };
3451
3452 /** \brief IPsec: Add/delete Security Policy Database
3453     @param client_index - opaque cookie to identify the sender
3454     @param context - sender context, to match reply w/ request
3455     @param is_add - add SPD if non-zero, else delete
3456     @param spd_id - SPD instance id (control plane allocated)
3457 */
3458
3459 define ipsec_spd_add_del
3460 {
3461   u32 client_index;
3462   u32 context;
3463   u8 is_add;
3464   u32 spd_id;
3465 };
3466
3467 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
3468     @param context - returned sender context, to match reply w/ request
3469     @param retval - return code
3470 */
3471
3472 define ipsec_spd_add_del_reply
3473 {
3474   u32 context;
3475   i32 retval;
3476 };
3477
3478 /** \brief IPsec: Add/delete SPD from interface
3479
3480     @param client_index - opaque cookie to identify the sender
3481     @param context - sender context, to match reply w/ request
3482     @param is_add - add security mode if non-zero, else delete
3483     @param sw_if_index - index of the interface
3484     @param spd_id - SPD instance id to use for lookups
3485 */
3486
3487
3488 define ipsec_interface_add_del_spd
3489 {
3490   u32 client_index;
3491   u32 context;
3492
3493   u8 is_add;
3494   u32 sw_if_index;
3495   u32 spd_id;
3496 };
3497
3498 /** \brief Reply for IPsec: Add/delete SPD from interface
3499     @param context - returned sender context, to match reply w/ request
3500     @param retval - return code
3501 */
3502
3503 define ipsec_interface_add_del_spd_reply
3504 {
3505   u32 context;
3506   i32 retval;
3507 };
3508
3509 /** \brief IPsec: Add/delete Security Policy Database entry
3510
3511     See RFC 4301, 4.4.1.1 on how to match packet to selectors
3512
3513     @param client_index - opaque cookie to identify the sender
3514     @param context - sender context, to match reply w/ request
3515     @param is_add - add SPD if non-zero, else delete
3516     @param spd_id - SPD instance id (control plane allocated)
3517     @param priority - priority of SPD entry (non-unique value).  Used to order SPD matching - higher priorities match before lower
3518     @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic
3519     @param is_ipv6 - remote/local address are IPv6 if non-zero, else IPv4
3520     @param remote_address_start - start of remote address range to match
3521     @param remote_address_stop - end of remote address range to match
3522     @param local_address_start - start of local address range to match
3523     @param local_address_stop - end of local address range to match
3524     @param protocol - protocol type to match [0 means any]
3525     @param remote_port_start - start of remote port range to match ...
3526     @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
3527     @param local_port_start - start of local port range to match ...
3528     @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
3529     @param policy - 0 = bypass (no IPsec processing), 1 = discard (discard packet with ICMP processing), 2 = resolve (send request to control plane for SA resolving, and discard without ICMP processing), 3 = protect (apply IPsec policy using following parameters)
3530     @param sa_id - SAD instance id (control plane allocated)
3531
3532 */
3533
3534 define ipsec_spd_add_del_entry
3535 {
3536   u32 client_index;
3537   u32 context;
3538   u8 is_add;
3539
3540   u32 spd_id;
3541   i32 priority;
3542   u8 is_outbound;
3543
3544   // Selector
3545   u8 is_ipv6;
3546   u8 is_ip_any;
3547   u8 remote_address_start[16];
3548   u8 remote_address_stop[16];
3549   u8 local_address_start[16];
3550   u8 local_address_stop[16];
3551
3552   u8 protocol;
3553
3554   u16 remote_port_start;
3555   u16 remote_port_stop;
3556   u16 local_port_start;
3557   u16 local_port_stop;
3558
3559   // Policy
3560   u8 policy;
3561   u32 sa_id;
3562 };
3563
3564 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
3565     @param context - returned sender context, to match reply w/ request
3566     @param retval - return code
3567 */
3568
3569 define ipsec_spd_add_del_entry_reply
3570 {
3571   u32 context;
3572   i32 retval;
3573 };
3574
3575 /** \brief IPsec: Add/delete Security Association Database entry
3576     @param client_index - opaque cookie to identify the sender
3577     @param context - sender context, to match reply w/ request
3578     @param is_add - add SAD entry if non-zero, else delete
3579
3580     @param sad_id - sad id
3581
3582     @param spi - security parameter index
3583
3584     @param protocol - 0 = AH, 1 = ESP
3585
3586     @param crypto_algorithm - 0 = Null, 1 = AES-CBC-128, 2 = AES-CBC-192, 3 = AES-CBC-256, 4 = 3DES-CBC
3587     @param crypto_key_length - length of crypto_key in bytes
3588     @param crypto_key - crypto keying material
3589
3590     @param integrity_algorithm - 0 = None, 1 = MD5-96, 2 = SHA1-96, 3 = SHA-256, 4 = SHA-384, 5=SHA-512
3591     @param integrity_key_length - length of integrity_key in bytes
3592     @param integrity_key - integrity keying material
3593
3594     @param use_extended_sequence_number - use ESN when non-zero
3595
3596     @param is_tunnel - IPsec tunnel mode if non-zero, else transport mode
3597     @param is_tunnel_ipv6 - IPsec tunnel mode is IPv6 if non-zero, else IPv4 tunnel only valid if is_tunnel is non-zero
3598     @param tunnel_src_address - IPsec tunnel source address IPv6 if is_tunnel_ipv6 is non-zero, else IPv4. Only valid if is_tunnel is non-zero
3599     @param tunnel_dst_address - IPsec tunnel destination address IPv6 if is_tunnel_ipv6 is non-zero, else IPv4. Only valid if is_tunnel is non-zero
3600
3601     To be added:
3602      Anti-replay
3603      IPsec tunnel address copy mode (to support GDOI)
3604  */
3605
3606 define ipsec_sad_add_del_entry
3607 {
3608   u32 client_index;
3609   u32 context;
3610   u8 is_add;
3611
3612   u32 sad_id;
3613
3614   u32 spi;
3615
3616   u8 protocol;
3617
3618   u8 crypto_algorithm;
3619   u8 crypto_key_length;
3620   u8 crypto_key[128];
3621
3622   u8 integrity_algorithm;
3623   u8 integrity_key_length;
3624   u8 integrity_key[128];
3625
3626   u8 use_extended_sequence_number;
3627
3628   u8 is_tunnel;
3629   u8 is_tunnel_ipv6;
3630   u8 tunnel_src_address[16];
3631   u8 tunnel_dst_address[16];
3632 };
3633
3634 /** \brief Reply for IPsec: Add/delete Security Association Database entry
3635     @param context - returned sender context, to match reply w/ request
3636     @param retval - return code
3637 */
3638
3639 define ipsec_sad_add_del_entry_reply
3640 {
3641   u32 context;
3642   i32 retval;
3643 };
3644
3645 /** \brief IPsec: Update Security Association keys
3646     @param client_index - opaque cookie to identify the sender
3647     @param context - sender context, to match reply w/ request
3648
3649     @param sa_id - sa id
3650
3651     @param crypto_key_length - length of crypto_key in bytes
3652     @param crypto_key - crypto keying material
3653
3654     @param integrity_key_length - length of integrity_key in bytes
3655     @param integrity_key - integrity keying material
3656 */
3657
3658 define ipsec_sa_set_key
3659 {
3660   u32 client_index;
3661   u32 context;
3662
3663   u32 sa_id;
3664
3665   u8 crypto_key_length;
3666   u8 crypto_key[128];
3667
3668   u8 integrity_key_length;
3669   u8 integrity_key[128];
3670 };
3671
3672 /** \brief Reply for IPsec: Update Security Association keys
3673     @param context - returned sender context, to match reply w/ request
3674     @param retval - return code
3675 */
3676
3677 define ipsec_sa_set_key_reply
3678 {
3679   u32 context;
3680   i32 retval;
3681 };
3682
3683 /** \brief IKEv2: Add/delete profile
3684     @param client_index - opaque cookie to identify the sender
3685     @param context - sender context, to match reply w/ request
3686
3687     @param name - IKEv2 profile name
3688     @param is_add - Add IKEv2 profile if non-zero, else delete
3689 */
3690 define ikev2_profile_add_del
3691 {
3692   u32 client_index;
3693   u32 context;
3694
3695   u8 name[64];
3696   u8 is_add;
3697 };
3698
3699 /** \brief Reply for IKEv2: Add/delete profile
3700     @param context - returned sender context, to match reply w/ request
3701     @param retval - return code
3702 */
3703 define ikev2_profile_add_del_reply
3704 {
3705   u32 context;
3706   i32 retval;
3707 };
3708
3709 /** \brief IKEv2: Set IKEv2 profile authentication method
3710     @param client_index - opaque cookie to identify the sender
3711     @param context - sender context, to match reply w/ request
3712
3713     @param name - IKEv2 profile name
3714     @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
3715     @param is_hex - Authentication data in hex format if non-zero, else string
3716     @param data_len - Authentication data length
3717     @param data - Authentication data (for rsa-sig cert file path)
3718 */
3719 define ikev2_profile_set_auth
3720 {
3721   u32 client_index;
3722   u32 context;
3723
3724   u8 name[64];
3725   u8 auth_method;
3726   u8 is_hex;
3727   u32 data_len;
3728   u8 data[0];
3729 };
3730
3731 /** \brief Reply for IKEv2: Set IKEv2 profile authentication method
3732     @param context - returned sender context, to match reply w/ request
3733     @param retval - return code
3734 */
3735 define ikev2_profile_set_auth_reply
3736 {
3737   u32 context;
3738   i32 retval;
3739 };
3740
3741 /** \brief IKEv2: Set IKEv2 profile local/remote identification
3742     @param client_index - opaque cookie to identify the sender
3743     @param context - sender context, to match reply w/ request
3744
3745     @param name - IKEv2 profile name
3746     @param is_local - Identification is local if non-zero, else remote
3747     @param id_type - Identification type
3748     @param data_len - Identification data length
3749     @param data - Identification data
3750 */
3751 define ikev2_profile_set_id
3752 {
3753   u32 client_index;
3754   u32 context;
3755
3756   u8 name[64];
3757   u8 is_local;
3758   u8 id_type;
3759   u32 data_len;
3760   u8 data[0];
3761 };
3762
3763 /** \brief Reply for IKEv2:
3764     @param context - returned sender context, to match reply w/ request
3765     @param retval - return code
3766 */
3767 define ikev2_profile_set_id_reply
3768 {
3769   u32 context;
3770   i32 retval;
3771 };
3772
3773 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
3774     @param client_index - opaque cookie to identify the sender
3775     @param context - sender context, to match reply w/ request
3776
3777     @param name - IKEv2 profile name
3778     @param is_local - Traffic selector is local if non-zero, else remote
3779     @param proto - Traffic selector IP protocol (if zero not relevant)
3780     @param start_port - The smallest port number allowed by traffic selector
3781     @param end_port - The largest port number allowed by traffic selector
3782     @param start_addr - The smallest address included in traffic selector
3783     @param end_addr - The largest address included in traffic selector
3784 */
3785 define ikev2_profile_set_ts
3786 {
3787   u32 client_index;
3788   u32 context;
3789
3790   u8 name[64];
3791   u8 is_local;
3792   u8 proto;
3793   u16 start_port;
3794   u16 end_port;
3795   u32 start_addr;
3796   u32 end_addr;
3797 };
3798
3799 /** \brief Reply for IKEv2: Set IKEv2 profile traffic selector parameters
3800     @param context - returned sender context, to match reply w/ request
3801     @param retval - return code
3802 */
3803 define ikev2_profile_set_ts_reply
3804 {
3805   u32 context;
3806   i32 retval;
3807 };
3808
3809 /** \brief IKEv2: Set IKEv2 local RSA private key
3810     @param client_index - opaque cookie to identify the sender
3811     @param context - sender context, to match reply w/ request
3812
3813     @param key_file - Key file absolute path
3814 */
3815 define ikev2_set_local_key
3816 {
3817   u32 client_index;
3818   u32 context;
3819
3820   u8 key_file[256];
3821 };
3822
3823 /** \brief Reply for IKEv2: Set IKEv2 local key
3824     @param context - returned sender context, to match reply w/ request
3825     @param retval - return code
3826 */
3827 define ikev2_set_local_key_reply
3828 {
3829   u32 context;
3830   i32 retval;
3831 };
3832
3833 /** \brief Tell client about a DHCP completion event
3834     @param client_index - opaque cookie to identify the sender
3835     @param pid - client pid registered to receive notification
3836     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
3837     @param host_address - Host IP address
3838     @param router_address - Router IP address
3839     @param host_mac - Host MAC address
3840 */
3841 define dhcp_compl_event
3842 {
3843   u32 client_index;
3844   u32 pid;
3845   u8 hostname[64];
3846   u8 is_ipv6;
3847   u8 host_address[16];
3848   u8 router_address[16];
3849   u8 host_mac[6];
3850 };
3851
3852 /** \brief Add MAP domains
3853     @param client_index - opaque cookie to identify the sender
3854     @param context - sender context, to match reply w/ request
3855     @param ip6_prefix - Rule IPv6 prefix
3856     @param ip4_prefix - Rule IPv4 prefix
3857     @param ip6_src - MAP domain IPv6 BR address / Tunnel source
3858     @param ip6_prefix_len - Rule IPv6 prefix length
3859     @param ip4_prefix_len - Rule IPv4 prefix length
3860     @param ea_bits_len - Embedded Address bits length
3861     @param psid_offset - Port Set Identifider (PSID) offset
3862     @param psid_length - PSID length
3863     @param is_translation - MAP-E / MAP-T
3864     @param mtu - MTU
3865 */
3866 define map_add_domain
3867 {
3868   u32 client_index;
3869   u32 context;
3870   u8 ip6_prefix[16];
3871   u8 ip4_prefix[4];
3872   u8 ip6_src[16];
3873   u8 ip6_prefix_len;
3874   u8 ip4_prefix_len;
3875   u8 ip6_src_prefix_len;
3876   u8 ea_bits_len;
3877   u8 psid_offset;
3878   u8 psid_length;
3879   u8 is_translation;
3880   u16 mtu;
3881 };
3882
3883 /** \brief Reply for MAP domain add
3884     @param context - returned sender context, to match reply w/ request
3885     @param index - MAP domain index
3886     @param retval - return code
3887 */
3888 define map_add_domain_reply
3889 {
3890   u32 context;
3891   u32 index;
3892   i32 retval;
3893 };
3894
3895 /** \brief Delete MAP domain
3896     @param client_index - opaque cookie to identify the sender
3897     @param context - sender context, to match reply w/ request
3898     @param index - MAP Domain index
3899 */
3900 define map_del_domain
3901 {
3902   u32 client_index;
3903   u32 context;
3904   u32 index;
3905 };
3906
3907 /** \brief Reply for MAP domain del
3908     @param context - returned sender context, to match reply w/ request
3909     @param retval - return code
3910 */
3911 define map_del_domain_reply
3912 {
3913   u32 context;
3914   i32 retval;
3915 };
3916
3917 /** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
3918     @param client_index - opaque cookie to identify the sender
3919     @param context - sender context, to match reply w/ request
3920     @param index - MAP Domain index
3921     @param is_add - If 1 add rule, if 0 delete rule
3922     @param ip6_dst - MAP CE IPv6 address
3923     @param psid - Rule PSID
3924 */
3925 define map_add_del_rule
3926 {
3927   u32 client_index;
3928   u32 context;
3929   u32 index;
3930   u32 is_add;
3931   u8 ip6_dst[16];
3932   u16 psid;
3933 };
3934
3935 /** \brief Reply for MAP rule add/del
3936     @param context - returned sender context, to match reply w/ request
3937     @param retval - return code
3938 */
3939 define map_add_del_rule_reply
3940 {
3941   u32 context;
3942   i32 retval;
3943 };
3944
3945 /** \brief Get list of map domains
3946     @param client_index - opaque cookie to identify the sender
3947 */
3948 define map_domain_dump
3949 {
3950   u32 client_index;
3951   u32 context;
3952 };
3953
3954 define map_domain_details
3955 {
3956   u32 context;
3957   u32 domain_index;
3958   u8 ip6_prefix[16];
3959   u8 ip4_prefix[4];
3960   u8 ip6_src[16];
3961   u8 ip6_prefix_len;
3962   u8 ip4_prefix_len;
3963   u8 ip6_src_len;
3964   u8 ea_bits_len;
3965   u8 psid_offset;
3966   u8 psid_length;
3967   u8 flags;
3968   u16 mtu;
3969   u8 is_translation;
3970 };
3971
3972 define map_rule_dump
3973 {
3974   u32 client_index;
3975   u32 context;
3976   u32 domain_index;
3977 };
3978
3979 define map_rule_details
3980 {
3981   u32 context;
3982   u8 ip6_dst[16];
3983   u16 psid;
3984 };
3985
3986 /** \brief Request for a single block of summary stats
3987     @param client_index - opaque cookie to identify the sender
3988     @param context - sender context, to match reply w/ request
3989 */
3990 define map_summary_stats
3991 {
3992   u32 client_index;
3993   u32 context;
3994 };
3995
3996 /** \brief Reply for map_summary_stats request
3997     @param context - sender context, to match reply w/ request
3998     @param retval - return code for request
3999     @param total_bindings -  
4000     @param total_pkts -  
4001     @param total_ip4_fragments -
4002     @param total_security_check - 
4003 */
4004 define map_summary_stats_reply
4005 {
4006   u32 context;
4007   i32 retval;
4008   u64 total_bindings;
4009   u64 total_pkts[2];
4010   u64 total_bytes[2];
4011   u64 total_ip4_fragments;
4012   u64 total_security_check[2];
4013 };
4014
4015 /** \brief cop: enable/disable junk filtration features on an interface
4016     @param client_index - opaque cookie to identify the sender
4017     @param context - sender context, to match reply w/ request
4018     @param sw_if_inded - desired interface
4019     @param enable_disable - 1 => enable, 0 => disable
4020 */
4021
4022 define cop_interface_enable_disable
4023 {
4024   u32 client_index;
4025   u32 context;
4026   u32 sw_if_index;
4027   u8 enable_disable;
4028 };
4029
4030 /** \brief cop: interface enable/disable junk filtration reply
4031     @param context - returned sender context, to match reply w/ request
4032     @param retval - return code
4033 */
4034
4035 define cop_interface_enable_disable_reply
4036 {
4037   u32 context;
4038   i32 retval;
4039 };
4040
4041 /** \brief cop: enable/disable whitelist filtration features on an interface
4042     Note: the supplied fib_id must match in order to remove the feature!
4043     
4044     @param client_index - opaque cookie to identify the sender
4045     @param context - sender context, to match reply w/ request
4046     @param sw_if_index - interface handle, physical interfaces only
4047     @param fib_id - fib identifier for the whitelist / blacklist fib
4048     @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration
4049     @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration
4050     @param default_cop -  1 => enable non-ip4, non-ip6 filtration 0=> disable it
4051 */
4052
4053 define cop_whitelist_enable_disable
4054 {
4055   u32 client_index;
4056   u32 context;
4057   u32 sw_if_index;
4058   u32 fib_id;
4059   u8 ip4;
4060   u8 ip6;
4061   u8 default_cop;
4062 };
4063
4064 /** \brief cop: interface enable/disable junk filtration reply
4065     @param context - returned sender context, to match reply w/ request
4066     @param retval - return code
4067 */
4068
4069 define cop_whitelist_enable_disable_reply
4070 {
4071   u32 context;
4072   i32 retval;
4073 };
4074
4075 /** \brief get_node_graph - get a copy of the vpp node graph
4076     including the current set of graph arcs.
4077
4078     @param client_index - opaque cookie to identify the sender
4079     @param context - sender context, to match reply w/ request
4080 */
4081
4082 define get_node_graph
4083 {
4084   u32 client_index;
4085   u32 context;
4086 };
4087
4088 /** \brief get_node_graph_reply
4089     @param context - returned sender context, to match reply w/ request
4090     @param retval - return code
4091     @param reply_in_shmem - result from vlib_node_serialize, in shared
4092     memory. Process with vlib_node_unserialize, remember to switch
4093     heaps and free the result.
4094 */
4095
4096 define get_node_graph_reply
4097 {
4098   u32 context;
4099   i32 retval;
4100   u64 reply_in_shmem;
4101 };
4102
4103 /** \brief Clear interface statistics
4104     @param client_index - opaque cookie to identify the sender
4105     @param context - sender context, to match reply w/ request
4106     @param sw_if_index - index of the interface to clear statistics
4107 */
4108 define sw_interface_clear_stats
4109 {
4110   u32 client_index;
4111   u32 context;
4112   u32 sw_if_index;
4113 };
4114
4115 /** \brief Reply to sw_interface_clear_stats 
4116     @param context - sender context which was passed in the request
4117     @param retval - return code of the set flags request
4118 */
4119 define sw_interface_clear_stats_reply
4120 {
4121   u32 context;
4122   i32 retval;
4123 };
4124
4125 /** \brief IOAM enable : Enable in-band OAM
4126     @param id - profile id
4127     @param trace_ppc - Trace PPC (none/encap/decap)
4128     @param pow_enable - Proof of Work enabled or not flag
4129     @param trace_enable - iOAM Trace enabled or not flag
4130 */
4131 define ioam_enable
4132 {
4133   u32 client_index;
4134   u32 context;
4135   u16 id;
4136   u8 trace_ppc;
4137   u8 pow_enable;
4138   u8 trace_enable;
4139   u32 node_id;
4140 };
4141
4142 /** \brief iOAM Trace profile add / del response
4143     @param context - sender context, to match reply w/ request
4144     @param retval - return value for request
4145 */
4146 define ioam_enable_reply
4147 {
4148   u32 context;
4149   i32 retval;
4150 };
4151
4152 /** \brief iOAM disable
4153     @param client_index - opaque cookie to identify the sender
4154     @param context - sender context, to match reply w/ request
4155     @param index - MAP Domain index
4156 */
4157 define ioam_disable
4158 {
4159   u32 client_index;
4160   u32 context;
4161   u16 id;
4162 };
4163
4164 /** \brief iOAM disable response
4165     @param context - sender context, to match reply w/ request
4166     @param retval - return value for request
4167 */
4168 define ioam_disable_reply
4169 {
4170   u32 context;
4171   i32 retval;
4172 };
4173
4174 /** \brief Create host-interface
4175     @param client_index - opaque cookie to identify the sender
4176     @param context - sender context, to match reply w/ request
4177     @param host_if_name - interface name
4178     @param hw_addr - interface MAC
4179     @param use_random_hw_addr - use random generated MAC
4180 */
4181 define af_packet_create
4182 {
4183   u32 client_index;
4184   u32 context;
4185
4186   u8 host_if_name[64];
4187   u8 hw_addr[6];
4188   u8 use_random_hw_addr;
4189 };
4190
4191 /** \brief Create host-interface response
4192     @param context - sender context, to match reply w/ request
4193     @param retval - return value for request
4194 */
4195 define af_packet_create_reply
4196 {
4197   u32 context;
4198   i32 retval;
4199   u32 sw_if_index;
4200 };
4201
4202 /** \brief Delete host-interface
4203     @param client_index - opaque cookie to identify the sender
4204     @param context - sender context, to match reply w/ request
4205     @param host_if_name - interface name
4206 */
4207 define af_packet_delete
4208 {
4209   u32 client_index;
4210   u32 context;
4211
4212   u8 host_if_name[64];
4213 };
4214
4215 /** \brief Delete host-interface response
4216     @param context - sender context, to match reply w/ request
4217     @param retval - return value for request
4218 */
4219 define af_packet_delete_reply
4220 {
4221   u32 context;
4222   i32 retval;
4223 };
4224
4225 /** \brief Add/del policer
4226     @param client_index - opaque cookie to identify the sender
4227     @param context - sender context, to match reply w/ request
4228     @param is_add - add policer if non-zero, else delete
4229     @param name - policer name
4230     @param cir - CIR
4231     @param eir - EIR
4232     @param cb - Committed Burst
4233     @param eb - Excess or Peak Burst
4234     @param rate_type - rate type
4235     @param round_type - rounding type
4236     @param type - policer algorithm
4237     @param color_aware - 0=color-blind, 1=color-aware
4238     @param conform_action_type - conform action type
4239     @param conform_dscp - DSCP for conform mar-and-transmit action
4240     @param exceed_action_type - exceed action type
4241     @param exceed_dscp - DSCP for exceed mar-and-transmit action
4242     @param violate_action_type - violate action type
4243     @param violate_dscp - DSCP for violate mar-and-transmit action
4244 */
4245 define policer_add_del
4246 {
4247   u32 client_index;
4248   u32 context;
4249
4250   u8 is_add;
4251   u8 name[64];
4252   u32 cir;
4253   u32 eir;
4254   u64 cb;
4255   u64 eb;
4256   u8 rate_type;
4257   u8 round_type;
4258   u8 type;
4259   u8 color_aware;
4260   u8 conform_action_type;
4261   u8 conform_dscp;
4262   u8 exceed_action_type;
4263   u8 exceed_dscp;
4264   u8 violate_action_type;
4265   u8 violate_dscp;
4266 };
4267
4268 /** \brief Add/del policer response
4269     @param context - sender context, to match reply w/ request
4270     @param retval - return value for request
4271     @param policer_index - for add, returned index of the new policer
4272 */
4273 define policer_add_del_reply
4274 {
4275   u32 context;
4276   i32 retval;
4277   u32 policer_index;
4278 };
4279
4280 /** \brief Get list of policers
4281     @param client_index - opaque cookie to identify the sender
4282     @param context - sender context, to match reply w/ request
4283     @param match_name_valid - if 0 request all policers otherwise use match_name
4284     @param match_name - policer name
4285 */
4286 define policer_dump
4287 {
4288   u32 client_index;
4289   u32 context;
4290
4291   u8 match_name_valid;
4292   u8 match_name[64];
4293 };
4294
4295 /** \brief Policer operational state response.
4296     @param context - sender context, to match reply w/ request
4297     @param name - policer name
4298     @param cir - CIR
4299     @param eir - EIR
4300     @param cb - Committed Burst
4301     @param eb - Excess or Peak Burst
4302     @param rate_type - rate type
4303     @param round_type - rounding type
4304     @param type - policer algorithm
4305     @param conform_action_type - conform action type
4306     @param conform_dscp - DSCP for conform mar-and-transmit action
4307     @param exceed_action_type - exceed action type
4308     @param exceed_dscp - DSCP for exceed mar-and-transmit action
4309     @param violate_action_type - violate action type
4310     @param violate_dscp - DSCP for violate mar-and-transmit action
4311     @param single_rate - 1 = single rate policer, 0 = two rate policer
4312     @param color_aware - for hierarchical policing
4313     @param scale - power-of-2 shift amount for lower rates
4314     @param cir_tokens_per_period - number of tokens for each period
4315     @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
4316     @param current_limit - current limit
4317     @param current_bucket - current bucket
4318     @param extended_limit - extended limit
4319     @param extended_bucket - extended bucket
4320     @param last_update_time - last update time
4321 */
4322 define policer_details
4323 {
4324   u32 context;
4325
4326   u8 name[64];
4327   u32 cir;
4328   u32 eir;
4329   u64 cb;
4330   u64 eb;
4331   u8 rate_type;
4332   u8 round_type;
4333   u8 type;
4334   u8 conform_action_type;
4335   u8 conform_dscp;
4336   u8 exceed_action_type;
4337   u8 exceed_dscp;
4338   u8 violate_action_type;
4339   u8 violate_dscp;
4340   u8 single_rate;
4341   u8 color_aware;
4342   u32 scale;
4343   u32 cir_tokens_per_period;
4344   u32 pir_tokens_per_period;
4345   u32 current_limit;
4346   u32 current_bucket;
4347   u32 extended_limit;
4348   u32 extended_bucket;
4349   u64 last_update_time;
4350 };
4351
4352 /** \brief Set/unset policer classify interface
4353     @param client_index - opaque cookie to identify the sender
4354     @param context - sender context, to match reply w/ request
4355     @param sw_if_index - interface to set/unset policer classify
4356     @param ip4_table_index - ip4 classify table index (~0 for skip)
4357     @param ip6_table_index - ip6 classify table index (~0 for skip)
4358     @param l2_table_index  -  l2 classify table index (~0 for skip)
4359     @param is_add - Set if non-zero, else unset
4360     Note: User is recommeneded to use just one valid table_index per call.
4361           (ip4_table_index, ip6_table_index, or l2_table_index)
4362 */
4363 define policer_classify_set_interface
4364 {
4365   u32 client_index;
4366   u32 context;
4367   u32 sw_if_index;
4368   u32 ip4_table_index;
4369   u32 ip6_table_index;
4370   u32 l2_table_index;
4371   u8 is_add;
4372 };
4373
4374 /** \brief Set/unset policer classify interface response
4375     @param context - sender context, to match reply w/ request
4376     @param retval - return value for request
4377 */
4378 define policer_classify_set_interface_reply
4379 {
4380   u32 context;
4381   i32 retval;
4382 };
4383
4384 /** \brief Get list of policer classify interfaces and tables
4385     @param client_index - opaque cookie to identify the sender
4386     @param context - sender context, to match reply w/ request
4387     @param type - classify table type
4388 */
4389 define policer_classify_dump
4390 {
4391   u32 client_index;
4392   u32 context;
4393   u8 type;
4394 };
4395
4396 /** \brief Policer iclassify operational state response.
4397     @param context - sender context, to match reply w/ request
4398     @param sw_if_index - software interface index
4399     @param table_index - classify table index
4400 */
4401 define policer_classify_details
4402 {
4403   u32 context;
4404   u32 sw_if_index;
4405   u32 table_index;
4406 };
4407
4408 /** \brief Create netmap
4409     @param client_index - opaque cookie to identify the sender
4410     @param context - sender context, to match reply w/ request
4411     @param netmap_if_name - interface name
4412     @param hw_addr - interface MAC
4413     @param use_random_hw_addr - use random generated MAC
4414     @param is_pipe - is pipe
4415     @param is_master - 0=slave, 1=master
4416 */
4417 define netmap_create
4418 {
4419   u32 client_index;
4420   u32 context;
4421
4422   u8 netmap_if_name[64];
4423   u8 hw_addr[6];
4424   u8 use_random_hw_addr;
4425   u8 is_pipe;
4426   u8 is_master;
4427 };
4428
4429 /** \brief Create netmap response
4430     @param context - sender context, to match reply w/ request
4431     @param retval - return value for request
4432 */
4433 define netmap_create_reply
4434 {
4435   u32 context;
4436   i32 retval;
4437 };
4438
4439 /** \brief Delete netmap
4440     @param client_index - opaque cookie to identify the sender
4441     @param context - sender context, to match reply w/ request
4442     @param netmap_if_name - interface name
4443 */
4444 define netmap_delete
4445 {
4446   u32 client_index;
4447   u32 context;
4448
4449   u8 netmap_if_name[64];
4450 };
4451
4452 /** \brief Delete netmap response
4453     @param context - sender context, to match reply w/ request
4454     @param retval - return value for request
4455 */
4456 define netmap_delete_reply
4457 {
4458   u32 context;
4459   i32 retval;
4460 };
4461
4462 /** \brief Dump mpls gre tunnel table
4463     @param client_index - opaque cookie to identify the sender
4464     @param tunnel_index - gre tunnel identifier or -1 in case of all tunnels
4465 */
4466 define mpls_gre_tunnel_dump
4467 {
4468   u32 client_index;
4469   u32 context;
4470   i32 tunnel_index;
4471 };
4472
4473 /** \brief mpls gre tunnel operational state response
4474     @param tunnel_index - gre tunnel identifier
4475     @param intfc_address - interface ipv4 addr
4476     @param mask_width - interface ipv4 addr mask
4477     @param hw_if_index - interface id
4478     @param l2_only -
4479     @param tunnel_src - tunnel source ipv4 addr
4480     @param tunnel_dst - tunnel destination ipv4 addr
4481     @param outer_fib_index - gre tunnel identifier
4482     @param encap_index - reference to mpls label table
4483     @param nlabels - number of resolved labels
4484     @param labels - resolved labels
4485 */
4486 define mpls_gre_tunnel_details
4487 {
4488   u32 context;
4489   u32 tunnel_index;
4490
4491   u32 intfc_address;
4492   u32 inner_fib_index;
4493   u32 mask_width;
4494   u32 encap_index;
4495   u32 hw_if_index;
4496   u8 l2_only;
4497   u32 tunnel_src;
4498   u32 tunnel_dst;
4499   u32 outer_fib_index;
4500   u32 nlabels;
4501   u32 labels[nlabels];
4502 };
4503
4504 /** \brief Dump mpls eth tunnel table
4505     @param client_index - opaque cookie to identify the sender
4506     @param tunnel_index - eth tunnel identifier or -1 in case of all tunnels
4507 */
4508 define mpls_eth_tunnel_dump
4509 {
4510   u32 client_index;
4511   u32 context;
4512   i32 tunnel_index;
4513 };
4514
4515 /** \brief mpls eth tunnel operational state response
4516     @param tunnel_index - eth tunnel identifier
4517     @param intfc_address - interface ipv4 addr
4518     @param mask_width - interface ipv4 addr mask
4519     @param hw_if_index - interface id
4520     @param l2_only -
4521     @param tunnel_dst_mac -
4522     @param tx_sw_if_index -
4523     @param encap_index - reference to mpls label table
4524     @param nlabels - number of resolved labels
4525     @param labels - resolved labels
4526 */
4527 define mpls_eth_tunnel_details
4528 {
4529   u32 context;
4530   u32 tunnel_index;
4531
4532   u32 intfc_address;
4533   u32 inner_fib_index;
4534   u32 mask_width;
4535   u32 encap_index;
4536   u32 hw_if_index;
4537   u8 l2_only;
4538   u8 tunnel_dst_mac[6];
4539   u32 tx_sw_if_index;
4540   u32 nlabels;
4541   u32 labels[nlabels];
4542 };
4543
4544 /** \brief Dump mpls fib table
4545     @param client_index - opaque cookie to identify the sender
4546     @param fib_index    - mpls fib entry identifier or -1 in case of all entries
4547 */
4548 define mpls_fib_encap_dump
4549 {
4550   u32 client_index;
4551   u32 context;
4552 };
4553
4554 /** \brief mpls fib encap table response
4555     @param fib_index - fib table id
4556     @param dest - destination ipv4 addr
4557     @param s_bit -
4558     @param entry_index - reference to mpls label table
4559     @param nlabels - number of resolved labels
4560     @param labels - resolved labels
4561 */
4562 define mpls_fib_encap_details
4563 {
4564   u32 context;
4565
4566   u32 fib_index;
4567   u32 entry_index;
4568   u32 dest;
4569   u32 s_bit;
4570   u32 nlabels;
4571   u32 labels[nlabels];
4572 };
4573
4574 /** \brief Classify get table IDs request
4575     @param client_index - opaque cookie to identify the sender
4576     @param context - sender context, to match reply w/ request
4577 */
4578 define classify_table_ids
4579 {
4580   u32 client_index;
4581   u32 context;
4582 };
4583
4584 /** \brief Reply for classify get table IDs request
4585     @param context - sender context which was passed in the request
4586     @param count - number of ids returned in response
4587     @param ids - array of classify table ids
4588 */
4589 define classify_table_ids_reply
4590 {
4591   u32 context;
4592   i32 retval;
4593   u32 count;
4594   u32 ids[count];
4595 };
4596
4597 /** \brief Classify table ids by interface index request
4598     @param client_index - opaque cookie to identify the sender
4599     @param context - sender context, to match reply w/ request
4600     @param sw_if_index - index of the interface
4601 */
4602 define classify_table_by_interface
4603 {
4604   u32 client_index;
4605   u32 context;
4606   u32 sw_if_index;
4607 };
4608
4609 /** \brief Reply for classify table id by interface index request
4610     @param context - sender context which was passed in the request
4611     @param count - number of ids returned in response
4612     @param sw_if_index - index of the interface
4613     @param l2_table_id - l2 classify table index
4614     @param ip4_table_id - ip4 classify table index
4615     @param ip6_table_id - ip6 classify table index
4616 */
4617 define classify_table_by_interface_reply
4618 {
4619   u32 context;
4620   i32 retval;
4621   u32 sw_if_index;
4622   u32 l2_table_id;
4623   u32 ip4_table_id;
4624   u32 ip6_table_id;
4625 };
4626
4627 /** \brief Classify table info
4628     @param client_index - opaque cookie to identify the sender
4629     @param context - sender context, to match reply w/ request
4630     @param table_id - classify table index
4631 */
4632 define classify_table_info
4633 {
4634   u32 client_index;
4635   u32 context;
4636   u32 table_id;
4637 };
4638
4639 /** \brief Reply for classify table info request
4640     @param context - sender context which was passed in the request
4641     @param count - number of ids returned in response
4642     @param table_id - classify table index
4643     @param nbuckets - number of buckets when adding a table
4644     @param match_n_vectors - number of match vectors
4645     @param skip_n_vectors - number of skip_n_vectors
4646     @param active_sessions - number of sessions (active entries)
4647     @param next_table_index - index of next table
4648     @param miss_next_index - index of miss table
4649     @param mask[] - match mask
4650 */
4651 define classify_table_info_reply
4652 {
4653   u32 context;
4654   i32 retval;
4655   u32 table_id;
4656   u32 nbuckets;
4657   u32 match_n_vectors;
4658   u32 skip_n_vectors;
4659   u32 active_sessions;
4660   u32 next_table_index;
4661   u32 miss_next_index;
4662   u32 mask_length;
4663   u8 mask[mask_length];
4664 };
4665
4666 /** \brief Classify sessions dump request
4667     @param client_index - opaque cookie to identify the sender
4668     @param context - sender context, to match reply w/ request
4669     @param table_id - classify table index
4670 */
4671 define classify_session_dump
4672 {
4673   u32 client_index;
4674   u32 context;
4675   u32 table_id;
4676 };
4677
4678 /** \brief Reply for classify table session dump request
4679     @param context - sender context which was passed in the request
4680     @param count - number of ids returned in response
4681     @param table_id - classify table index
4682     @param hit_next_index - hit_next_index of session
4683     @param opaque_index - for add, opaque_index of session
4684     @param advance - advance value of session
4685     @param match[] - match value for session
4686 */
4687 define classify_session_details
4688 {
4689   u32 context;
4690   i32 retval;
4691   u32 table_id;
4692   u32 hit_next_index;
4693   i32 advance;
4694   u32 opaque_index;
4695   u32 match_length;
4696   u8 match[match_length];
4697 };
4698
4699 /** \brief Configure IPFIX exporter process request
4700     @param client_index - opaque cookie to identify the sender
4701     @param context - sender context, to match reply w/ request
4702     @param collector_address - address of IPFIX collector
4703     @param collector_port - port of IPFIX collector
4704     @param src_address - address of IPFIX exporter
4705     @param vrf_id - VRF / fib table ID
4706     @param path_mtu - Path MTU between exporter and collector
4707     @param template_interval - number of seconds after which to resend template
4708     @param udp_checksum - UDP checksum calculation enable flag
4709 */
4710 define set_ipfix_exporter
4711 {
4712   u32 client_index;
4713   u32 context;
4714   u8 collector_address[16];
4715   u16 collector_port;
4716   u8 src_address[16];
4717   u32 vrf_id;
4718   u32 path_mtu;
4719   u32 template_interval;
4720   u8 udp_checksum;
4721 };
4722
4723 /** \brief Reply to IPFIX exporter configure request
4724     @param context - sender context which was passed in the request
4725 */
4726 define set_ipfix_exporter_reply
4727 {
4728   u32 context;
4729   i32 retval;
4730 };
4731
4732 /** \brief IPFIX exporter dump request
4733     @param client_index - opaque cookie to identify the sender
4734     @param context - sender context, to match reply w/ request
4735 */
4736 define ipfix_exporter_dump
4737 {
4738   u32 client_index;
4739   u32 context;
4740 };
4741
4742 /** \brief Reply to IPFIX exporter dump request
4743     @param context - sender context which was passed in the request
4744     @param collector_address - address of IPFIX collector
4745     @param collector_port - port of IPFIX collector
4746     @param src_address - address of IPFIX exporter
4747     @param fib_index - fib table index
4748     @param path_mtu - Path MTU between exporter and collector
4749     @param template_interval - number of seconds after which to resend template
4750     @param udp_checksum - UDP checksum calculation enable flag
4751 */
4752 define ipfix_exporter_details
4753 {
4754   u32 context;
4755   u8 collector_address[16];
4756   u16 collector_port;
4757   u8 src_address[16];
4758   u32 vrf_id;
4759   u32 path_mtu;
4760   u32 template_interval;
4761   u8 udp_checksum;
4762 };
4763
4764 /** \brief IPFIX classify stream configure request
4765     @param client_index - opaque cookie to identify the sender
4766     @param context - sender context, to match reply w/ request
4767     @param domain_id - domain ID reported in IPFIX messages for classify stream
4768     @param src_port - source port of UDP session for classify stream
4769 */
4770 define set_ipfix_classify_stream {
4771     u32 client_index;
4772     u32 context;
4773     u32 domain_id;
4774     u16 src_port;
4775 };
4776
4777 /** \brief IPFIX classify stream configure response
4778     @param context - sender context, to match reply w/ request
4779     @param retval - return value for request
4780 */
4781 define set_ipfix_classify_stream_reply {
4782     u32 context;
4783     i32 retval;
4784 };
4785
4786 /** \brief IPFIX classify stream dump request
4787     @param client_index - opaque cookie to identify the sender
4788     @param context - sender context, to match reply w/ request
4789 */
4790 define ipfix_classify_stream_dump {
4791     u32 client_index;
4792     u32 context;
4793 };
4794
4795 /** \brief Reply to IPFIX classify stream dump request
4796     @param context - sender context, to match reply w/ request
4797     @param domain_id - domain ID reported in IPFIX messages for classify stream
4798     @param src_port - source port of UDP session for classify stream
4799 */
4800 define ipfix_classify_stream_details {
4801     u32 context;
4802     u32 domain_id;
4803     u16 src_port;
4804 };
4805
4806 /** \brief IPFIX add or delete classifier table request
4807     @param client_index - opaque cookie to identify the sender
4808     @param context - sender context, to match reply w/ request
4809     @param table_id - classifier table ID
4810     @param ip_version - version of IP used in the classifier table
4811     @param transport_protocol - transport protocol used in the classifier table or 255 for unspecified
4812 */
4813 define ipfix_classify_table_add_del {
4814     u32 client_index;
4815     u32 context;
4816     u32 table_id;
4817     u8 ip_version;
4818     u8 transport_protocol;
4819     u8 is_add;
4820 };
4821
4822 /** \brief IPFIX add classifier table response
4823     @param context - sender context which was passed in the request
4824 */
4825 define ipfix_classify_table_add_del_reply {
4826     u32 context;
4827     i32 retval;
4828 };
4829
4830 /** \brief IPFIX classify tables dump request
4831     @param client_index - opaque cookie to identify the sender
4832     @param context - sender context, to match reply w/ request
4833 */
4834 define ipfix_classify_table_dump {
4835     u32 client_index;
4836     u32 context;
4837 };
4838
4839 /** \brief Reply to IPFIX classify tables dump request
4840     @param context - sender context, to match reply w/ request
4841     @param table_id - classifier table ID
4842     @param ip_version - version of IP used in the classifier table
4843     @param transport_protocol - transport protocol used in the classifier table or 255 for unspecified
4844 */
4845 define ipfix_classify_table_details {
4846     u32 context;
4847     u32 table_id;
4848     u8 ip_version;
4849     u8 transport_protocol;
4850 };
4851
4852 /** \brief Set/unset flow classify interface
4853     @param client_index - opaque cookie to identify the sender
4854     @param context - sender context, to match reply w/ request
4855     @param sw_if_index - interface to set/unset flow classify
4856     @param ip4_table_index - ip4 classify table index (~0 for skip)
4857     @param ip6_table_index - ip6 classify table index (~0 for skip)
4858     @param l2_table_index  -  l2 classify table index (~0 for skip)
4859     @param is_add - Set if non-zero, else unset
4860     Note: User is recommeneded to use just one valid table_index per call.
4861           (ip4_table_index, ip6_table_index, or l2_table_index)
4862 */
4863 define flow_classify_set_interface {
4864     u32 client_index;
4865     u32 context;
4866     u32 sw_if_index;
4867     u32 ip4_table_index;
4868     u32 ip6_table_index;
4869     u8  is_add;
4870 };
4871
4872 /** \brief Set/unset flow classify interface response
4873     @param context - sender context, to match reply w/ request
4874     @param retval - return value for request
4875 */
4876 define flow_classify_set_interface_reply {
4877     u32 context;
4878     i32 retval;
4879 };
4880
4881 /** \brief Get list of flow classify interfaces and tables
4882     @param client_index - opaque cookie to identify the sender
4883     @param context - sender context, to match reply w/ request
4884     @param type - classify table type
4885 */
4886 define flow_classify_dump {
4887     u32 client_index;
4888     u32 context;
4889     u8 type;
4890 };
4891
4892 /** \brief Flow classify operational state response.
4893     @param context - sender context, to match reply w/ request
4894     @param sw_if_index - software interface index
4895     @param table_index - classify table index
4896 */
4897 define flow_classify_details {
4898     u32 context;
4899     u32 sw_if_index;
4900     u32 table_index;
4901 };
4902
4903 /** \brief Query relative index via node names
4904     @param client_index - opaque cookie to identify the sender
4905     @param context - sender context, to match reply w/ request
4906     @param node_name - name of node to find relative index from
4907     @param next_name - next node from node_name to find relative index of
4908 */
4909 define get_next_index
4910 {
4911   u32 client_index;
4912   u32 context;
4913   u8 node_name[64];
4914   u8 next_name[64];
4915 };
4916
4917 /** \brief Reply for get next node index
4918     @param context - sender context which was passed in the request
4919     @param retval - return value
4920     @param next_index - index of the next_node
4921 */
4922 define get_next_index_reply
4923 {
4924   u32 context;
4925   i32 retval;
4926   u32 next_index;
4927 };
4928
4929 /** \brief PacketGenerator create interface request
4930     @param client_index - opaque cookie to identify the sender
4931     @param context - sender context, to match reply w/ request
4932     @param interface_id - interface index
4933 */
4934 define pg_create_interface
4935 {
4936   u32 client_index;
4937   u32 context;
4938   u32 interface_id;
4939 };
4940
4941 /** \brief PacketGenerator create interface response
4942     @param context - sender context, to match reply w/ request
4943     @param retval - return value for request
4944 */
4945 define pg_create_interface_reply
4946 {
4947   u32 context;
4948   i32 retval;
4949   u32 sw_if_index;
4950 };
4951
4952 /** \brief PacketGenerator capture packets on given interface request
4953     @param client_index - opaque cookie to identify the sender
4954     @param context - sender context, to match reply w/ request
4955     @param interface_id - pg interface index
4956     @param is_enabled - 1 if enabling streams, 0 if disabling
4957     @param count - number of packets to be captured
4958     @param pcap_file - pacp file name to store captured packets
4959 */
4960 define pg_capture
4961 {
4962   u32 client_index;
4963   u32 context;
4964   u32 interface_id;
4965   u8 is_enabled;
4966   u32 count;
4967   u32 pcap_name_length;
4968   u8 pcap_file_name[pcap_name_length];
4969 };
4970
4971 /** \brief PacketGenerator capture packets response
4972     @param context - sender context, to match reply w/ request
4973     @param retval - return value for request
4974 */
4975 define pg_capture_reply
4976 {
4977   u32 context;
4978   i32 retval;
4979 };
4980
4981 /** \brief Enable / disable packet generator request
4982     @param client_index - opaque cookie to identify the sender
4983     @param context - sender context, to match reply w/ request
4984     @param is_enabled - 1 if enabling streams, 0 if disabling
4985     @param stream - stream name to be enable/disabled, if not specified handle all streams
4986 */
4987 define pg_enable_disable
4988 {
4989   u32 client_index;
4990   u32 context;
4991   u8 is_enabled;
4992   u32 stream_name_length;
4993   u8 stream_name[stream_name_length];
4994 };
4995
4996 /** \brief Reply for enable / disable packet generator
4997     @param context - returned sender context, to match reply w/ request
4998     @param retval - return code
4999 */
5000 define pg_enable_disable_reply
5001 {
5002   u32 context;
5003   i32 retval;
5004 };
5005
5006 /** \brief Configure IP source and L4 port-range check
5007     @param client_index - opaque cookie to identify the sender
5008     @param context - sender context, to match reply w/ request
5009     @param is_ip6 - 1 if source address type is IPv6
5010     @param is_add - 1 if add, 0 if delete
5011     @param mask_length - mask length for address entry
5012     @param address - array of address bytes
5013     @param number_of_ranges - length of low_port and high_port arrays (must match)
5014     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
5015     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
5016     @param vrf_id - fib table/vrf id to associate the source and port-range check with
5017     @note To specify a single port set low_port and high_port entry the same
5018 */
5019 define ip_source_and_port_range_check_add_del
5020 {
5021   u32 client_index;
5022   u32 context;
5023   u8 is_ipv6;
5024   u8 is_add;
5025   u8 mask_length;
5026   u8 address[16];
5027   u8 number_of_ranges;
5028   u16 low_ports[32];
5029   u16 high_ports[32];
5030   u32 vrf_id;
5031 };
5032
5033 /** \brief Configure IP source and L4 port-range check reply
5034     @param context - returned sender context, to match reply w/ request
5035     @param retval - return code
5036 */
5037 define ip_source_and_port_range_check_add_del_reply
5038 {
5039   u32 context;
5040   i32 retval;
5041 };
5042
5043 /** \brief Set interface source and L4 port-range request
5044     @param client_index - opaque cookie to identify the sender
5045     @param context - sender context, to match reply w/ request
5046     @param interface_id - interface index
5047     @param tcp_vrf_id - VRF associated with source and TCP port-range check
5048     @param udp_vrf_id - VRF associated with source and TCP port-range check
5049 */
5050 define ip_source_and_port_range_check_interface_add_del
5051 {
5052   u32 client_index;
5053   u32 context;
5054   u8 is_add;
5055   u32 sw_if_index;
5056   u32 tcp_in_vrf_id;
5057   u32 tcp_out_vrf_id;
5058   u32 udp_in_vrf_id;
5059   u32 udp_out_vrf_id;
5060 };
5061
5062 /** \brief Set interface source and L4 port-range response
5063     @param context - sender context, to match reply w/ request
5064     @param retval - return value for request
5065 */
5066 define ip_source_and_port_range_check_interface_add_del_reply
5067 {
5068   u32 context;
5069   i32 retval;
5070 };
5071
5072 /** \brief Add / del ipsec gre tunnel request
5073     @param client_index - opaque cookie to identify the sender
5074     @param context - sender context, to match reply w/ request
5075     @param local_sa_id - local SA id
5076     @param remote_sa_id - remote SA id
5077     @param is_add - 1 if adding the tunnel, 0 if deleting
5078     @param src_address - tunnel source address
5079     @param dst_address - tunnel destination address
5080 */
5081 define ipsec_gre_add_del_tunnel {
5082     u32 client_index;
5083     u32 context;
5084     u32 local_sa_id;
5085     u32 remote_sa_id;
5086     u8 is_add;
5087     u8 src_address[4];
5088     u8 dst_address[4];
5089 };
5090
5091 /** \brief Reply for add / del ipsec gre tunnel request
5092     @param context - returned sender context, to match reply w/ request
5093     @param retval - return code
5094     @param sw_if_index - software index of the new ipsec gre tunnel
5095 */
5096 define ipsec_gre_add_del_tunnel_reply {
5097     u32 context;
5098     i32 retval;
5099     u32 sw_if_index;
5100 };
5101
5102 /** \brief Dump ipsec gre tunnel table
5103     @param client_index - opaque cookie to identify the sender
5104     @param context - sender context, to match reply w/ request
5105     @param tunnel_index - gre tunnel identifier or -1 in case of all tunnels
5106 */
5107 define ipsec_gre_tunnel_dump {
5108     u32 client_index;
5109     u32 context;
5110     u32 sw_if_index;
5111 };
5112
5113 /** \brief mpls gre tunnel operational state response
5114     @param context - returned sender context, to match reply w/ request
5115     @param sw_if_index - software index of the ipsec gre tunnel
5116     @param local_sa_id - local SA id
5117     @param remote_sa_id - remote SA id
5118     @param src_address - tunnel source address
5119     @param dst_address - tunnel destination address
5120 */
5121 define ipsec_gre_tunnel_details {
5122     u32 context;
5123     u32 sw_if_index;
5124     u32 local_sa_id;
5125     u32 remote_sa_id;
5126     u8 src_address[4];
5127     u8 dst_address[4];
5128 };
5129
5130 /** \brief Delete sub interface request
5131     @param client_index - opaque cookie to identify the sender
5132     @param context - sender context, to match reply w/ request
5133     @param sw_if_index - sw index of the interface that was created by create_subif
5134 */
5135 define delete_subif {
5136   u32 client_index;
5137   u32 context;
5138   u32 sw_if_index;
5139 };
5140
5141 /** \brief Delete sub interface response
5142     @param context - sender context, to match reply w/ request
5143     @param retval - return code for the request
5144 */
5145 define delete_subif_reply {
5146   u32 context;
5147   i32 retval;
5148 };
5149
5150 /** \brief DPDK interface HQoS pipe profile set request
5151     @param client_index - opaque cookie to identify the sender
5152     @param context - sender context, to match reply w/ request
5153     @param sw_if_index - the interface
5154     @param subport - subport ID
5155     @param pipe - pipe ID within its subport
5156     @param profile - pipe profile ID
5157 */
5158 define sw_interface_set_dpdk_hqos_pipe {
5159     u32 client_index;
5160     u32 context;
5161     u32 sw_if_index;
5162     u32 subport;
5163     u32 pipe;
5164     u32 profile;
5165 };
5166
5167 /** \brief DPDK interface HQoS pipe profile set reply
5168     @param context - sender context, to match reply w/ request
5169     @param retval - request return code
5170 */
5171 define sw_interface_set_dpdk_hqos_pipe_reply {
5172     u32 context;
5173     i32 retval;
5174 };
5175
5176 /** \brief DPDK interface HQoS subport parameters set request
5177     @param client_index - opaque cookie to identify the sender
5178     @param context - sender context, to match reply w/ request
5179     @param sw_if_index - the interface
5180     @param subport - subport ID
5181     @param tb_rate - subport token bucket rate (measured in bytes/second)
5182     @param tb_size - subport token bucket size (measured in credits)
5183     @param tc_rate - subport traffic class 0 .. 3 rates (measured in bytes/second)
5184     @param tc_period - enforcement period for rates (measured in milliseconds)
5185 */
5186 define sw_interface_set_dpdk_hqos_subport {
5187     u32 client_index;
5188     u32 context;
5189     u32 sw_if_index;
5190     u32 subport;
5191     u32 tb_rate;
5192     u32 tb_size;
5193     u32 tc_rate[4];
5194     u32 tc_period;
5195 };
5196
5197 /** \brief DPDK interface HQoS subport parameters set reply
5198     @param context - sender context, to match reply w/ request
5199     @param retval - request return code
5200 */
5201 define sw_interface_set_dpdk_hqos_subport_reply {
5202     u32 context;
5203     i32 retval;
5204 };
5205
5206 /** \brief DPDK interface HQoS tctbl entry set request
5207     @param client_index - opaque cookie to identify the sender
5208     @param context - sender context, to match reply w/ request
5209     @param sw_if_index - the interface
5210     @param entry - entry index ID
5211     @param tc - traffic class (0 .. 3)
5212     @param queue - traffic class queue (0 .. 3)
5213 */
5214 define sw_interface_set_dpdk_hqos_tctbl {
5215     u32 client_index;
5216     u32 context;
5217     u32 sw_if_index;
5218     u32 entry;
5219     u32 tc;
5220     u32 queue;
5221 };
5222
5223 /** \brief DPDK interface HQoS tctbl entry set reply
5224     @param context - sender context, to match reply w/ request
5225     @param retval - request return code
5226 */
5227 define sw_interface_set_dpdk_hqos_tctbl_reply {
5228     u32 context;
5229     i32 retval;
5230 };
5231
5232 /** \brief L2 interface pbb tag rewrite configure request
5233     @param client_index - opaque cookie to identify the sender
5234     @param context - sender context, to match reply w/ request
5235     @param sw_if_index - interface the operation is applied to
5236     @param vtr_op - Choose from l2_vtr_op_t enum values
5237     @param inner_tag - needed for translate_qinq vtr op only
5238     @param outer_tag - needed for translate_qinq vtr op only 
5239     @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
5240     @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
5241     @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
5242     @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
5243 */
5244 define l2_interface_pbb_tag_rewrite
5245 {
5246   u32 client_index;
5247   u32 context;
5248   u32 sw_if_index;
5249   u32 vtr_op;
5250   u16 outer_tag;
5251   u8  b_dmac[6];
5252   u8  b_smac[6];
5253   u16 b_vlanid;
5254   u32 i_sid;
5255 };
5256
5257 /** \brief L2 interface pbb tag rewrite response
5258     @param context - sender context, to match reply w/ request
5259     @param retval - return code for the request
5260 */
5261 define l2_interface_pbb_tag_rewrite_reply
5262 {
5263   u32 context;
5264   i32 retval;
5265 };
5266
5267 /** \brief Punt traffic to the host
5268     @param client_index - opaque cookie to identify the sender
5269     @param context - sender context, to match reply w/ request
5270     @param is_add - add punt if non-zero, else delete
5271     @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
5272     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
5273     @param l4_port - TCP/UDP port to be punted
5274 */
5275 define punt {
5276     u32 client_index;
5277     u32 context;
5278     u8 is_add;
5279     u8 ipv;
5280     u8 l4_protocol;
5281     u16 l4_port;
5282 };
5283
5284 /** \brief Reply to the punt request
5285     @param context - sender context which was passed in the request
5286     @param retval - return code of punt request
5287 */
5288 define punt_reply
5289 {
5290     u32 context;
5291     i32 retval;
5292 };
5293