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