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