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