4571c92df4d3c28a20bfe4f588d652a128dddcd2
[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[0];
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 Process a vpe parser cli string request
1077     @param client_index - opaque cookie to identify the sender
1078     @param context - sender context, to match reply w/ request
1079     @param cmd_in_shmem - pointer to cli command string
1080 */
1081 define cli_request {
1082     u32 client_index;
1083     u32 context;
1084     u64 cmd_in_shmem;
1085 };
1086
1087 /** \brief vpe parser cli string response
1088     @param context - sender context, to match reply w/ request
1089     @param retval - return code for request
1090     @param reply_in_shmem - Reply string from cli processing if any
1091 */
1092 define cli_reply {
1093     u32 context;
1094     i32 retval;
1095     u64 reply_in_shmem;
1096 };
1097
1098 /** \brief Set max allowed ARP or ip6 neighbor entries request
1099     @param client_index - opaque cookie to identify the sender
1100     @param context - sender context, to match reply w/ request
1101     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
1102     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
1103 */
1104 define set_arp_neighbor_limit {
1105     u32 client_index;
1106     u32 context;
1107     u8  is_ipv6;
1108     u32 arp_neighbor_limit;
1109 }; 
1110
1111 /** \brief Set max allowed ARP or ip6 neighbor entries response
1112     @param context - sender context, to match reply w/ request
1113     @param retval - return code for request
1114 */
1115 define set_arp_neighbor_limit_reply {
1116     u32 context;
1117     i32 retval;
1118 };
1119
1120 /** \brief L2 interface patch add / del request
1121     @param client_index - opaque cookie to identify the sender
1122     @param context - sender context, to match reply w/ request
1123     @param rx_sw_if_index - receive side interface 
1124     @param tx_sw_if_index - transmit side interface
1125     @param is_add - if non-zero set up the interface patch, else remove it
1126 */
1127 define l2_patch_add_del {
1128     u32 client_index;
1129     u32 context;
1130     u32 rx_sw_if_index;
1131     u32 tx_sw_if_index;
1132     u8 is_add;
1133 };
1134
1135 /** \brief L2 interface patch add / del response
1136     @param context - sender context, to match reply w/ request
1137     @param retval - return code for the request
1138 */
1139 define l2_patch_add_del_reply {
1140     u32 context;
1141     i32 retval;
1142 };
1143
1144 /** \brief IPv6 segment routing tunnel add / del request
1145     @param client_index - opaque cookie to identify the sender
1146     @param context - sender context, to match reply w/ request
1147     @param is_add - add the tunnel if non-zero, else delete it
1148     @param name[] - tunnel name (len. 64)
1149     @param src_address[] -
1150     @param dst_address[] -
1151     @param dst_mask_width -
1152     @param inner_vrf_id -
1153     @param outer_vrf_id -
1154     @param flags_net_byte_order -
1155     @param n_segments -
1156     @param n_tags -
1157     @param segs_and_tags[] -
1158     @param policy_name[] - name of policy to associate this tunnel to (len. 64)
1159 */
1160 define sr_tunnel_add_del {
1161     u32 client_index;
1162     u32 context;
1163     u8 is_add;
1164     u8 name[64];
1165     u8 src_address[16];
1166     u8 dst_address[16];
1167     u8 dst_mask_width;
1168     u32 inner_vrf_id;
1169     u32 outer_vrf_id;
1170     u16 flags_net_byte_order;
1171     u8 n_segments;
1172     u8 n_tags;
1173     u8 segs_and_tags[0];
1174     u8 policy_name[64];
1175 };
1176
1177 /** \brief IPv6 segment routing tunnel add / del response
1178     @param context - sender context, to match reply w/ request
1179     @param retval - return value for request
1180 */
1181 define sr_tunnel_add_del_reply {
1182     u32 context;
1183     i32 retval;
1184 };
1185
1186 /** \brief IPv6 segment routing policy add / del request
1187     @param client_index - opaque cookie to identify the sender
1188     @param context - sender context, to match reply w/ request
1189     @param is_add - add the tunnel if non-zero, else delete it
1190     @param name[] - policy name (len. 64)
1191     @param tunnel_names[] -
1192 */
1193 define sr_policy_add_del {
1194     u32 client_index;
1195     u32 context;
1196     u8 is_add;
1197     u8 name[64];
1198     u8 tunnel_names[0];
1199 };
1200
1201 /** \brief IPv6 segment routing policy add / del response
1202     @param context - sender context, to match reply w/ request
1203     @param retval - return value for request
1204 */
1205 define sr_policy_add_del_reply {
1206     u32 context;
1207     i32 retval;
1208 };
1209
1210 /** \brief IPv6 segment routing multicast map to policy add / del request
1211     @param client_index - opaque cookie to identify the sender
1212     @param context - sender context, to match reply w/ request
1213     @param is_add - add the tunnel if non-zero, else delete it
1214     @param multicast_address[] - IP6 multicast address
1215     @param policy_name[] = policy name (len.64)
1216 */
1217 define sr_multicast_map_add_del {
1218     u32 client_index;
1219     u32 context;
1220     u8 is_add;
1221     u8 multicast_address[16];
1222     u8 policy_name[64];
1223 };
1224
1225 /** \brief IPv6 segment routing multicast map to policy add / del response
1226     @param context - sender context, to match reply w/ request
1227     @param retval - return value for request
1228 */
1229 define sr_multicast_map_add_del_reply {
1230     u32 context;
1231     i32 retval;
1232 };
1233
1234 /** \brief Interface set vpath request
1235     @param client_index - opaque cookie to identify the sender
1236     @param context - sender context, to match reply w/ request
1237     @param sw_if_index - interface used to reach neighbor
1238     @param enable - if non-zero enable, else disable
1239 */
1240 define sw_interface_set_vpath {
1241     u32 client_index;
1242     u32 context;
1243     u32 sw_if_index;
1244     u8  enable;
1245 };
1246
1247 /** \brief Interface set vpath response
1248     @param context - sender context, to match reply w/ request
1249     @param retval - return code for the request
1250 */
1251 define sw_interface_set_vpath_reply {
1252     u32 context;
1253     i32 retval;
1254 };
1255
1256 /** \brief MPLS Ethernet add / del tunnel request
1257     @param client_index - opaque cookie to identify the sender
1258     @param context - sender context, to match reply w/ request
1259     @param vrf_id - vrf_id, only for IP4
1260     @param sw_if_index - interface used to reach neighbor
1261     @param is_add - add if set, tunnel delete if 0
1262     @param dst_mac_address - 
1263     @param adj_address - 
1264     @param adj_address_length -
1265 */
1266 define mpls_ethernet_add_del_tunnel {
1267     u32 client_index;
1268     u32 context;
1269     u32 vrf_id;
1270     u32 tx_sw_if_index;
1271     u8 is_add;
1272     u8 l2_only;
1273     u8 dst_mac_address[6];
1274     u8 adj_address[4];
1275     u8 adj_address_length;
1276 };
1277
1278 /** \brief Reply for MPLS Ethernet add / delete tunnel request
1279     @param context - sender context, to match reply w/ request
1280     @param retval - return code for the request
1281 */
1282 define mpls_ethernet_add_del_tunnel_reply {
1283     u32 context;
1284     i32 retval;
1285     u32 tunnel_sw_if_index;
1286 };
1287 /** \brief MPLS Ethernet add/ del tunnel 2
1288     @param client_index - opaque cookie to identify the sender
1289     @param context - sender context, to match reply w/ request
1290     @param inner_vrf_id - 
1291     @param outer_vrf_id - 
1292     @param resolve_attempts - 
1293     @param resolve_opaque - 
1294     @param resolve_if_needed -
1295     @param is_add -
1296     @param adj_address -
1297     @param adj_address_length -
1298     @param next_hop_ip4_address_in_outer_vrf -
1299 */
1300 define mpls_ethernet_add_del_tunnel_2 {
1301    u32 client_index;
1302    u32 context;
1303    u32 inner_vrf_id;
1304    u32 outer_vrf_id;
1305    u32 resolve_attempts;
1306    u32 resolve_opaque;          /* no need to set this */
1307    u8 resolve_if_needed;
1308    u8 is_add;
1309    u8 l2_only;
1310    u8 adj_address[4];
1311    u8 adj_address_length;
1312    u8 next_hop_ip4_address_in_outer_vrf [4];
1313 };
1314
1315 /** \brief MPLS Ethernet add/ del tunnel 2
1316     @param context - sender context, to match reply w/ request
1317     @param retval - return code for add /del request
1318 */
1319 define mpls_ethernet_add_del_tunnel_2_reply {
1320     u32 context;
1321     i32 retval;
1322 };
1323
1324 /** \brief Set L2 XConnect between two interfaces request
1325     @param client_index - opaque cookie to identify the sender
1326     @param context - sender context, to match reply w/ request
1327     @param rx_sw_if_index - Receive interface index
1328     @param tx_sw_if_index - Transmit interface index
1329     @param enable - enable xconnect if not 0, else set to L3 mode
1330 */
1331 define sw_interface_set_l2_xconnect {
1332     u32 client_index;
1333     u32 context;
1334     u32 rx_sw_if_index;
1335     u32 tx_sw_if_index;
1336     u8 enable;
1337 };
1338
1339 /** \brief Set L2 XConnect response
1340     @param context - sender context, to match reply w/ request
1341     @param retval - L2 XConnect request return code
1342 */
1343 define sw_interface_set_l2_xconnect_reply {
1344     u32 context;
1345     i32 retval;
1346 };
1347
1348 /** \brief Interface bridge mode request
1349     @param client_index - opaque cookie to identify the sender
1350     @param context - sender context, to match reply w/ request
1351     @param rx_sw_if_index - the interface
1352     @param bd_id - bridge domain id
1353     @param bvi - Setup interface as a bvi, bridge mode only
1354     @param shg - Shared horizon group, for bridge mode only
1355     @param enable - Enable beige mode if not 0, else set to L3 mode
1356 */
1357 define sw_interface_set_l2_bridge {
1358     u32 client_index;
1359     u32 context;
1360     u32 rx_sw_if_index;
1361     u32 bd_id;
1362     u8 shg;
1363     u8 bvi;
1364     u8 enable;
1365 };
1366
1367 /** \brief Interface bridge mode response
1368     @param context - sender context, to match reply w/ request
1369     @param retval - Bridge mode request return code
1370 */
1371 define sw_interface_set_l2_bridge_reply {
1372     u32 context;
1373     i32 retval;
1374 };
1375
1376 /** \brief L2 FIB add entry request
1377     @param client_index - opaque cookie to identify the sender
1378     @param context - sender context, to match reply w/ request
1379     @param mac - the entry's mac address
1380     @param bd_id - the entry's bridge domain id
1381     @param sw_if_index - the interface
1382     @param is_add - If non zero add the entry, else delete it
1383     @param static_mac - 
1384     @param filter_mac -
1385 */
1386 define l2fib_add_del {
1387     u32 client_index;
1388     u32 context;
1389     u64 mac;
1390     u32 bd_id;
1391     u32 sw_if_index;
1392     u8 is_add;
1393     u8 static_mac;
1394     u8 filter_mac;
1395     u8 bvi_mac;
1396 };
1397
1398 /** \brief L2 FIB add entry response
1399     @param context - sender context, to match reply w/ request
1400     @param retval - return code for the add l2fib entry request
1401 */
1402 define l2fib_add_del_reply {
1403     u32 context;
1404     i32 retval;
1405 };
1406
1407 /** \brief Set L2 flags request !!! TODO - need more info, feature bits in l2_input.h
1408     @param client_index - opaque cookie to identify the sender
1409     @param context - sender context, to match reply w/ request
1410     @param sw_if_index - interface 
1411     @param is_set - if non-zero, set the bits, else clear them
1412     @param feature_bitmap - non-zero bits to set or clear
1413 */
1414 define l2_flags {
1415     u32 client_index;
1416     u32 context;
1417     u32 sw_if_index;
1418     u8 is_set;
1419     u32 feature_bitmap;
1420 };
1421
1422 /** \brief Set L2 bits response
1423     @param context - sender context, to match reply w/ request
1424     @param retval - return code for the set l2 bits request
1425 */
1426 define l2_flags_reply {
1427     u32 context;
1428     i32 retval;
1429     u32 resulting_feature_bitmap;
1430 };
1431
1432 /** \brief Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, 
1433     L2_UU_FLOOD, or L2_ARP_TERM) request
1434     @param client_index - opaque cookie to identify the sender
1435     @param context - sender context, to match reply w/ request
1436     @param bd_id - the bridge domain to set the flags for
1437     @param is_set - if non-zero, set the flags, else clear them
1438     @param feature_bitmap - bits that are non-zero to set or clear
1439 */
1440 define bridge_flags {
1441     u32 client_index;
1442     u32 context;
1443     u32 bd_id;
1444     u8 is_set;
1445     u32 feature_bitmap;
1446 };
1447
1448 /** \brief Set bridge flags response
1449     @param context - sender context, to match reply w/ request
1450     @param retval - return code for the set bridge flags request
1451     @param resulting_feature_bitmap - the feature bitmap value after the request is implemented
1452 */
1453 define bridge_flags_reply {
1454     u32 context;
1455     i32 retval;
1456     u32 resulting_feature_bitmap;
1457 };
1458
1459 /** \brief Set bridge domain ip to mac entry request
1460     @param client_index - opaque cookie to identify the sender
1461     @param context - sender context, to match reply w/ request
1462     @param bd_id - the bridge domain to set the flags for
1463     @param is_add - if non-zero, add the entry, else clear it
1464     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
1465     @param mac_address - MAC address
1466     @param 
1467 */
1468 define bd_ip_mac_add_del {
1469     u32 client_index;
1470     u32 context;
1471     u32 bd_id;
1472     u8 is_add;
1473     u8 is_ipv6;
1474     u8 ip_address[16];
1475     u8 mac_address[6];
1476 };
1477
1478 /** \brief Set bridge domain ip to mac entry response
1479     @param context - sender context, to match reply w/ request
1480     @param retval - return code for the set bridge flags request
1481 */
1482 define bd_ip_mac_add_del_reply {
1483     u32 context;
1484     i32 retval;
1485 };
1486
1487 /** \brief Add/Delete classification table request
1488     @param client_index - opaque cookie to identify the sender
1489     @param context - sender context, to match reply w/ request
1490     @param is_add- if non-zero add the table, else delete it
1491     @param table_index - if add, reuturns index of the created table, else specifies the table to delete  
1492     @param nbuckets - number of buckets when adding a table
1493     @param memory_size - memory size when adding a table
1494     @param match_n_vectors - number of match vectors
1495     @param next_table_index - index of next table
1496     @param miss_next_index - index of miss table
1497     @param mask[] - match mask
1498 */
1499 define classify_add_del_table {
1500     u32 client_index;
1501     u32 context;
1502     u8  is_add;
1503     u32 table_index;
1504     u32 nbuckets;
1505     u32 memory_size;
1506     u32 skip_n_vectors;
1507     u32 match_n_vectors;
1508     u32 next_table_index;
1509     u32 miss_next_index;
1510     u8 mask[0];
1511 };
1512
1513 /** \brief Add/Delete classification table response
1514     @param context - sender context, to match reply w/ request
1515     @param retval - return code for the table add/del requst
1516     @param new_table_index - for add, returned index of the new table
1517     @param skip_n_vectors - for add, returned value of skip_n_vectors in table
1518     @param match_n_vectors -for add, returned value of match_n_vectors in table
1519 */
1520 define classify_add_del_table_reply {
1521     u32 context;
1522     i32 retval;
1523     u32 new_table_index;
1524     u32 skip_n_vectors;
1525     u32 match_n_vectors;
1526 };
1527
1528 /** \brief Classify add / del session request
1529     @param client_index - opaque cookie to identify the sender
1530     @param context - sender context, to match reply w/ request
1531     @param is_add - add session if non-zero, else delete
1532     @param table_index - index of the table to add/del the session, required
1533     @param hit_next_index - for add, hit_next_index of new session, required
1534     @param opaque_index - for add, opaque_index of new session
1535     @param advance -for add, advance value for session
1536     @param match[] - for add, match value for session, required
1537 */
1538 define classify_add_del_session {
1539     u32 client_index;
1540     u32 context;
1541     u8  is_add;
1542     u32 table_index;
1543     u32 hit_next_index;
1544     u32 opaque_index;
1545     i32 advance;
1546     u8 match[0];
1547 };
1548
1549 /** \brief Classify add / del session response
1550     @param context - sender context, to match reply w/ request
1551     @param retval - return code for the add/del session request
1552 */
1553 define classify_add_del_session_reply {
1554     u32 context;
1555     i32 retval;
1556 };
1557
1558 /** \brief Set/unset the classification table for an interface request 
1559     @param client_index - opaque cookie to identify the sender
1560     @param context - sender context, to match reply w/ request
1561     @param is_ipv6 - ipv6 if non-zero, else ipv4
1562     @param sw_if_index - interface to associate with the table
1563     @param table_index - index of the table, if ~0 unset the table
1564 */
1565 define classify_set_interface_ip_table {
1566     u32 client_index;
1567     u32 context;
1568     u8 is_ipv6;
1569     u32 sw_if_index;
1570     u32 table_index;            /* ~0 => off */
1571 };
1572
1573 /** \brief Set/unset interface classification table response 
1574     @param context - sender context, to match reply w/ request
1575     @param retval - return code
1576 */
1577 define classify_set_interface_ip_table_reply {
1578     u32 context;
1579     i32 retval;
1580 };
1581
1582 /** \brief Set/unset l2 classification tables for an interface request
1583     @param client_index - opaque cookie to identify the sender
1584     @param context - sender context, to match reply w/ request
1585     @param sw_if_index - interface to set/unset tables for
1586     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
1587     @param ip6_table_index - ip6 index
1588     @param other_table_index - other index
1589 */
1590 define classify_set_interface_l2_tables {
1591     u32 client_index;
1592     u32 context;
1593     u32 sw_if_index;
1594     /* 3 x ~0 => off */
1595     u32 ip4_table_index;
1596     u32 ip6_table_index;
1597     u32 other_table_index;
1598 };
1599
1600 /** \brief Set/unset l2 classification tables for an interface response
1601     @param context - sender context, to match reply w/ request
1602     @param retval - return code for the request
1603 */
1604 define classify_set_interface_l2_tables_reply {
1605     u32 context;
1606     i32 retval;
1607 };
1608
1609 /** \brief Get node index using name request
1610     @param client_index - opaque cookie to identify the sender
1611     @param context - sender context, to match reply w/ request
1612     @param node_name[] - name of the node
1613 */
1614 define get_node_index {
1615     u32 client_index;
1616     u32 context;
1617     u8 node_name[64];
1618 };
1619
1620 /** \brief Get node index using name request
1621     @param context - sender context, to match reply w/ request
1622     @param retval - return code for the request
1623     @param node_index - index of the desired node if found, else ~0
1624 */
1625 define get_node_index_reply {
1626     u32 context;
1627     i32 retval;
1628     u32 node_index;
1629 };
1630
1631 /** \brief Set the next node for a given node 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[] - node to add the next node to
1635     @param next_name[] - node to add as the next node
1636 */
1637 define add_node_next {
1638     u32 client_index;
1639     u32 context;
1640     u8 node_name[64];
1641     u8 next_name[64];
1642 };
1643
1644 /** \brief IP Set the next node for a given node response
1645     @param context - sender context, to match reply w/ request
1646     @param retval - return code for the add next node request
1647     @param next_index - the index of the next node if success, else ~0
1648 */
1649 define add_node_next_reply {
1650     u32 context;
1651     i32 retval;
1652     u32 next_index;
1653 };
1654
1655 /** \brief DHCP Proxy config 2 add / del request
1656     @param client_index - opaque cookie to identify the sender
1657     @param context - sender context, to match reply w/ request
1658     @param rx_vrf_id - receive vrf id
1659     @param server_vrf_id - server vrf id
1660     @param if_ipv6 - ipv6 if non-zero, else ipv4
1661     @param is_add - add the config if non-zero, else delete
1662     @param insert_circuit_id - option82 suboption 1 fib number
1663     @param dhcp_server[] - server address
1664     @param dhcp_src_address[] - <fix this, need details>
1665 */
1666 define dhcp_proxy_config_2 {
1667     u32 client_index;
1668     u32 context;
1669     u32 rx_vrf_id;
1670     u32 server_vrf_id;
1671     u8 is_ipv6;
1672     u8 is_add;
1673     u8 insert_circuit_id;
1674     u8 dhcp_server[16];
1675     u8 dhcp_src_address[16];
1676 };
1677
1678 /** \brief DHCP Proxy config 2 add / del response
1679     @param context - sender context, to match reply w/ request
1680     @param retval - return code for request
1681 */
1682 define dhcp_proxy_config_2_reply {
1683     u32 context;
1684     i32 retval;
1685 };
1686
1687 /** \brief l2tpv3 tunnel interface create request
1688     @param client_index - opaque cookie to identify the sender
1689     @param context - sender context, to match reply w/ request
1690     @param client_address - remote client tunnel ip address
1691     @param client_address - local tunnel ip address
1692     @param is_ipv6 - ipv6 if non-zero, else ipv4
1693     @param local_session_id - local tunnel session id
1694     @param remote_session_id - remote tunnel session id
1695     @param local_cookie - local tunnel cookie
1696     @param l2_sublayer_present - l2 sublayer is present in packets if non-zero
1697     @param encap_vrf_id - fib identifier used for outgoing encapsulated packets
1698 */
1699 define l2tpv3_create_tunnel {
1700     u32 client_index;
1701     u32 context;
1702     u8 client_address [16];
1703     u8 our_address [16];
1704     u8 is_ipv6;
1705     u32 local_session_id;
1706     u32 remote_session_id;
1707     u64 local_cookie;
1708     u64 remote_cookie;
1709     u8 l2_sublayer_present;
1710     u32 encap_vrf_id;
1711 };
1712
1713 /** \brief l2tpv3 tunnel interface create response
1714     @param context - sender context, to match reply w/ request
1715     @param retval - return code for the request
1716     @param sw_if_index - index of the new tunnel interface
1717 */
1718 define l2tpv3_create_tunnel_reply {
1719     u32 context;
1720     i32 retval;
1721     u32 sw_if_index;
1722 };
1723
1724 define l2tpv3_set_tunnel_cookies {
1725     u32 client_index;
1726     u32 context;
1727     u32 sw_if_index;
1728     u64 new_local_cookie;
1729     u64 new_remote_cookie;
1730 };
1731
1732 /** \brief L2TP tunnel set cookies response
1733     @param context - sender context, to match reply w/ request
1734     @param retval - return code for the request
1735 */
1736 define l2tpv3_set_tunnel_cookies_reply {
1737     u32 context;
1738     i32 retval;
1739 };
1740
1741 define sw_if_l2tpv3_tunnel_details {
1742     u32 context;
1743     u32 sw_if_index;
1744     u8 interface_name[64];
1745     u8 client_address [16];
1746     u8 our_address [16];
1747     u32 local_session_id;
1748     u32 remote_session_id;
1749     u64 local_cookie[2];
1750     u64 remote_cookie;
1751     u8 l2_sublayer_present;
1752 };
1753
1754 define sw_if_l2tpv3_tunnel_dump {
1755     u32 client_index;
1756     u32 context;
1757 };
1758
1759 /** \brief L2 fib clear table request, clear all mac entries in the l2 fib
1760     @param client_index - opaque cookie to identify the sender
1761     @param context - sender context, to match reply w/ request
1762 */
1763 define l2_fib_clear_table {
1764     u32 client_index;
1765     u32 context;
1766 };
1767
1768 /** \brief L2 fib clear table response
1769     @param context - sender context, to match reply w/ request
1770     @param retval - return code for the request
1771 */
1772 define l2_fib_clear_table_reply {
1773     u32 context;
1774     i32 retval;
1775 };
1776
1777 /** \brief L2 interface ethernet flow point filtering enable/disable request
1778     @param client_index - opaque cookie to identify the sender
1779     @param context - sender context, to match reply w/ request
1780     @param sw_if_index - interface to enable/disable filtering on
1781     @param enable_disable - if non-zero enable filtering, else disable
1782 */
1783 define l2_interface_efp_filter {
1784     u32 client_index;
1785     u32 context;
1786     u32 sw_if_index;
1787     u32 enable_disable;
1788 };
1789
1790 /** \brief L2 interface ethernet flow point filtering response
1791     @param context - sender context, to match reply w/ request
1792     @param retval - return code for the request
1793 */
1794 define l2_interface_efp_filter_reply {
1795     u32 context;
1796     i32 retval;
1797 };
1798
1799 define l2tpv3_interface_enable_disable {
1800     u32 client_index;
1801     u32 context;
1802     u8 enable_disable;
1803     u32 sw_if_index;
1804 }; 
1805
1806 define l2tpv3_interface_enable_disable_reply {
1807     u32 context;
1808     i32 retval;
1809 };
1810
1811 define l2tpv3_set_lookup_key {
1812     u32 client_index;
1813     u32 context;
1814     /* 0 = ip6 src_address, 1 = ip6 dst_address, 2 = session_id */
1815     u8 key;
1816 }; 
1817
1818 define l2tpv3_set_lookup_key_reply {
1819     u32 context;
1820     i32 retval;
1821 };
1822
1823 define vxlan_add_del_tunnel {
1824     u32 client_index;
1825     u32 context;
1826     u8 is_add;
1827     u8 is_ipv6;
1828     u8 src_address[16];
1829     u8 dst_address[16];
1830     u32 encap_vrf_id;
1831     u32 decap_next_index;
1832     u32 vni;
1833 };
1834
1835 define vxlan_add_del_tunnel_reply {
1836     u32 context;
1837     i32 retval;
1838     u32 sw_if_index;
1839 };
1840
1841 define vxlan_tunnel_dump {
1842     u32 client_index;
1843     u32 context;
1844     u32 sw_if_index;
1845 };
1846
1847 define vxlan_tunnel_details {
1848     u32 context;
1849     u32 sw_if_index;
1850     u8 src_address[16];
1851     u8 dst_address[16];
1852     u32 encap_vrf_id;
1853     u32 decap_next_index;
1854     u32 vni;
1855     u8 is_ipv6;
1856 };
1857
1858 define gre_add_del_tunnel {
1859     u32 client_index;
1860     u32 context;
1861     u8 is_add;
1862     u8 is_ipv6;
1863     u8 src_address[16];
1864     u8 dst_address[16];
1865     u32 outer_fib_id;
1866 };
1867
1868 define gre_add_del_tunnel_reply {
1869     u32 context;
1870     i32 retval;
1871     u32 sw_if_index;
1872 };
1873
1874 define gre_tunnel_dump {
1875     u32 client_index;
1876     u32 context;
1877     u32 sw_if_index;
1878 };
1879
1880 define gre_tunnel_details {
1881     u32 context;
1882     u32 sw_if_index;
1883     u8 is_ipv6;
1884     u8 src_address[16];
1885     u8 dst_address[16];
1886     u32 outer_fib_id;
1887 };
1888   
1889 /** \brief L2 interface vlan tag rewrite configure request
1890     @param client_index - opaque cookie to identify the sender
1891     @param context - sender context, to match reply w/ request
1892     @param sw_if_index - interface the operation is applied to
1893     @param vtr_op - Choose from l2_vtr_op_t enum values
1894     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
1895     @param tag1 - Needed for any push or translate vtr op
1896     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
1897 */
1898 define l2_interface_vlan_tag_rewrite {
1899     u32 client_index;
1900     u32 context;
1901     u32 sw_if_index;
1902     u32 vtr_op;
1903     u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
1904     u32 tag1;  // first pushed tag
1905     u32 tag2;  // second pushed tag
1906 };
1907
1908 /** \brief L2 interface vlan tag rewrite response
1909     @param context - sender context, to match reply w/ request
1910     @param retval - return code for the request
1911 */
1912 define l2_interface_vlan_tag_rewrite_reply {
1913     u32 context;
1914     i32 retval;
1915 };
1916
1917 /** \brief vhost-user interface create request
1918     @param client_index - opaque cookie to identify the sender
1919     @param is_server - our side is socket server
1920     @param sock_filename - unix socket filename, used to speak with frontend
1921     @param use_custom_mac - enable or disable the use of the provided hardware address
1922     @param mac_address - hardware address to use if 'use_custom_mac' is set
1923 */
1924 define create_vhost_user_if {
1925    u32 client_index;
1926    u32 context;
1927    u8 is_server;
1928    u8 sock_filename[256];
1929    u8 renumber;
1930    u32 custom_dev_instance;
1931    u8 use_custom_mac;
1932    u8 mac_address[6];
1933 };
1934
1935 /** \brief vhost-user interface create response
1936     @param context - sender context, to match reply w/ request
1937     @param retval - return code for the request
1938     @param sw_if_index - interface the operation is applied to
1939 */
1940 define create_vhost_user_if_reply {
1941    u32 context;
1942    i32 retval;
1943    u32 sw_if_index;
1944 };
1945
1946 /** \brief vhost-user interface modify request
1947     @param client_index - opaque cookie to identify the sender
1948     @param is_server - our side is socket server
1949     @param sock_filename - unix socket filename, used to speak with frontend
1950 */
1951 define modify_vhost_user_if {
1952    u32 client_index;
1953    u32 context;
1954    u32 sw_if_index;
1955    u8 is_server;
1956    u8 sock_filename[256];
1957    u8 renumber;
1958    u32 custom_dev_instance;
1959 };
1960
1961 /** \brief vhost-user interface modify response
1962     @param context - sender context, to match reply w/ request
1963     @param retval - return code for the request
1964 */
1965 define modify_vhost_user_if_reply {
1966    u32 context;
1967    i32 retval;
1968 };
1969
1970 /** \brief vhost-user interface delete request
1971     @param client_index - opaque cookie to identify the sender
1972 */
1973 define delete_vhost_user_if {
1974    u32 client_index;
1975    u32 context;
1976    u32 sw_if_index;
1977 };
1978
1979 /** \brief vhost-user interface delete response
1980     @param context - sender context, to match reply w/ request
1981     @param retval - return code for the request
1982 */
1983 define delete_vhost_user_if_reply {
1984    u32 context;
1985    i32 retval;
1986 };
1987
1988 define create_subif {
1989     u32 client_index;
1990     u32 context;
1991     u32 sw_if_index;
1992     u32 sub_id;
1993
1994     /* These fields map directly onto the subif template */
1995     u8 no_tags;
1996     u8 one_tag;
1997     u8 two_tags;
1998     u8 dot1ad;   // 0 = dot1q, 1=dot1ad
1999     u8 exact_match;
2000     u8 default_sub;
2001     u8 outer_vlan_id_any;
2002     u8 inner_vlan_id_any;
2003     u16 outer_vlan_id;
2004     u16 inner_vlan_id;
2005 };
2006
2007 define create_subif_reply {
2008     u32 context;
2009     i32 retval;
2010     u32 sw_if_index;
2011 };
2012
2013 /** \brief show version
2014     @param client_index - opaque cookie to identify the sender
2015     @param context - sender context, to match reply w/ request
2016 */
2017 define show_version {
2018    u32 client_index;
2019    u32 context;
2020 };
2021
2022 /** \brief show version response
2023     @param context - sender context, to match reply w/ request
2024     @param retval - return code for the request
2025     @param program - name of the program (vpe)
2026     @param version  - version of the program
2027     @param build_directory - root of the workspace where the program was built
2028 */
2029 define show_version_reply {
2030    u32 context;
2031    i32 retval;
2032    u8 program[32];
2033    u8 version[32];
2034    u8 build_date[32];
2035    u8 build_directory[256];
2036 };
2037
2038 /** \brief Vhost-user interface details structure (fix this)
2039     @param sw_if_index - index of the interface
2040     @param interface_name - name of interface
2041     @param virtio_net_hdr_sz - net header size
2042     @param features - interface features
2043     @param is_server - vhost-user server socket
2044     @param sock_filename - socket filename
2045     @param num_regions - number of used memory regions
2046 */
2047 define sw_interface_vhost_user_details {
2048     u32 context;
2049     u32 sw_if_index;
2050     u8 interface_name[64];
2051     u32 virtio_net_hdr_sz;
2052     u64 features;
2053     u8 is_server;
2054     u8 sock_filename[256];
2055     u32 num_regions;
2056     i32 sock_errno;
2057 };
2058
2059 /* works */
2060 define sw_interface_vhost_user_dump {
2061     u32 client_index;
2062     u32 context;
2063 };
2064
2065 define ip_address_details {
2066     u32 client_index;
2067     u32 context;
2068     u8 ip[16];
2069     u8 prefix_length;
2070 };
2071
2072 define ip_address_dump {
2073     u32 client_index;
2074     u32 context;
2075     u32 sw_if_index;
2076     u8 is_ipv6;
2077 };
2078
2079 define ip_details {
2080     u32 sw_if_index;
2081     u32 context;
2082 };
2083
2084 define ip_dump {
2085     u32 client_index;
2086     u32 context;
2087     u8 is_ipv6;
2088 };
2089
2090 /** \brief l2 fib table entry structure
2091     @param bd_id - the l2 fib / bridge domain table id
2092     @param mac - the entry's mac address
2093     @param sw_if_index - index of the interface
2094     @param static_mac - the entry is statically configured.
2095     @param filter_mac - the entry is a mac filter entry.
2096     @param bvi_mac - the mac address is a bridge virtual interface
2097 */
2098 define l2_fib_table_entry {
2099     u32 context;
2100     u32 bd_id;
2101     u64 mac;
2102     u32 sw_if_index;
2103     u8 static_mac;
2104     u8 filter_mac;
2105     u8 bvi_mac;
2106 };
2107
2108 /** \brief Dump l2 fib (aka bridge domain) table
2109     @param client_index - opaque cookie to identify the sender
2110     @param bd_id - the l2 fib / bridge domain table identifier
2111 */
2112 define l2_fib_table_dump {
2113     u32 client_index;
2114     u32 context;
2115     u32 bd_id;
2116 };
2117
2118 define vxlan_gpe_add_del_tunnel {
2119     u32 client_index;
2120     u32 context;
2121     u8 is_ipv6;
2122     u8 local[16];
2123     u8 remote[16];
2124     u32 encap_vrf_id;
2125     u32 decap_vrf_id;
2126     u8 protocol;
2127     u32 vni;
2128     u8 is_add;
2129 };
2130
2131 define vxlan_gpe_add_del_tunnel_reply {
2132     u32 context;
2133     i32 retval;
2134     u32 sw_if_index;
2135 };
2136
2137 define vxlan_gpe_tunnel_dump {
2138     u32 client_index;
2139     u32 context;
2140     u32 sw_if_index;
2141 };
2142
2143 define vxlan_gpe_tunnel_details {
2144     u32 context;
2145     u32 sw_if_index;
2146     u8 local[16];
2147     u8 remote[16];
2148     u32 vni;
2149     u8 protocol;
2150     u32 encap_vrf_id;
2151     u32 decap_vrf_id;
2152     u8 is_ipv6;
2153 };
2154
2155 /** \brief add or delete locator_set
2156     @param client_index - opaque cookie to identify the sender
2157     @param context - sender context, to match reply w/ request
2158     @param is_add - add address if non-zero, else delete
2159     @param locator_set_name - locator name
2160 */
2161 define lisp_add_del_locator_set {
2162     u32 client_index;
2163     u32 context;
2164     u8  is_add;
2165     u8  locator_set_name[64];
2166 };
2167
2168 /** \brief Reply for locator_set add/del
2169     @param context - returned sender context, to match reply w/ request
2170     @param retval - return code
2171 */
2172 define lisp_add_del_locator_set_reply {
2173     u32 context;
2174     i32 retval;
2175 };
2176
2177 /** \brief add or delete locator for 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 - name of locator_set to add/del locator
2182     @param sw_if_index - index of the interface
2183     @param priority - priority of the lisp locator
2184     @param weight - weight of the lisp locator
2185 */
2186 define lisp_add_del_locator {
2187     u32 client_index;
2188     u32 context;
2189     u8  is_add;
2190     u8  locator_set_name[64];
2191     u32 sw_if_index;
2192     u8  priority;
2193     u8  weight;
2194 };
2195
2196 /** \brief Reply for locator add/del
2197     @param context - returned sender context, to match reply w/ request
2198     @param retval - return code
2199 */
2200 define lisp_add_del_locator_reply {
2201     u32 context;
2202     i32 retval;
2203 };
2204
2205 /** \brief add or delete lisp eid-table
2206     @param client_index - opaque cookie to identify the sender
2207     @param context - sender context, to match reply w/ request
2208     @param is_add - add address if non-zero, else delete
2209     @param eid_type:
2210       0 : ipv4
2211       1 : ipv6
2212       2 : mac
2213     @param eid - EID can be ip4, ip6 or mac
2214     @param prefix_len - prefix len
2215     @param locator_set_name - name of locator_set to add/del eid-table
2216     @param vni - virtual network instance
2217 */
2218 define lisp_add_del_local_eid {
2219     u32 client_index;
2220     u32 context;
2221     u8  is_add;
2222     u8  eid_type;
2223     u8  eid[16];
2224     u8  prefix_len;
2225     u8  locator_set_name[64];
2226     u32 vni;
2227 };
2228
2229 /** \brief Reply for local_eid add/del
2230     @param context - returned sender context, to match reply w/ request
2231     @param retval - return code
2232 */
2233 define lisp_add_del_local_eid_reply {
2234     u32 context;
2235     i32 retval;
2236 };
2237
2238 /** \brief add or delete lisp gpe maptunel
2239     @param client_index - opaque cookie to identify the sender
2240     @param context - sender context, to match reply w/ request
2241     @param is_add - add address if non-zero, else delete
2242     @param eid_is_ipv6 - if non-zero the address is ipv6, else ipv4
2243     @param eid_ip_address - array of address bytes
2244     @param eid_prefix_len - prefix len
2245     @param address_is_ipv6 - if non-zero the address is ipv6, else ipv4
2246     @param source_ip_address - array of address bytes
2247     @param destination_ip_address - array of address bytes
2248 */
2249 define lisp_gpe_add_del_fwd_entry {
2250     u32 client_index;
2251     u32 context;
2252     u8  is_add;
2253     u8  eid_is_ipv6;
2254     u8  eid_ip_address[16];
2255     u8  eid_prefix_len;
2256     u8  address_is_ipv6;
2257     u8  source_ip_address[16];
2258     u8  destination_ip_address[16];
2259 };
2260
2261 /** \brief Reply for gpe_fwd_entry add/del
2262     @param context - returned sender context, to match reply w/ request
2263     @param retval - return code
2264 */
2265 define lisp_gpe_add_del_fwd_entry_reply {
2266     u32 context;
2267     i32 retval;
2268 };
2269
2270 /** \brief add or delete map-resolver
2271     @param client_index - opaque cookie to identify the sender
2272     @param context - sender context, to match reply w/ request
2273     @param is_add - add address if non-zero, else delete
2274     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
2275     @param ip_address - array of address bytes
2276 */
2277 define lisp_add_del_map_resolver {
2278     u32 client_index;
2279     u32 context;
2280     u8  is_add;
2281     u8  is_ipv6;
2282     u8  ip_address[16];
2283 };
2284
2285 /** \brief Reply for map_resolver add/del
2286     @param context - returned sender context, to match reply w/ request
2287     @param retval - return code
2288 */
2289 define lisp_add_del_map_resolver_reply {
2290     u32 context;
2291     i32 retval;
2292 };
2293
2294 /** \brief enable or disable lisp-gpe protocol
2295     @param client_index - opaque cookie to identify the sender
2296     @param context - sender context, to match reply w/ request
2297     @param is_en - enable protocol if non-zero, else disable
2298 */
2299 define lisp_gpe_enable_disable {
2300     u32 client_index;
2301     u32 context;
2302     u8  is_en;
2303 };
2304
2305 /** \brief Reply for gpe enable/disable
2306     @param context - returned sender context, to match reply w/ request
2307     @param retval - return code
2308 */
2309 define lisp_gpe_enable_disable_reply {
2310     u32 context;
2311     i32 retval;
2312 };
2313
2314 /** \brief enable or disable LISP feature
2315     @param client_index - opaque cookie to identify the sender
2316     @param context - sender context, to match reply w/ request
2317     @param is_en - enable protocol if non-zero, else disable
2318 */
2319 define lisp_enable_disable {
2320     u32 client_index;
2321     u32 context;
2322     u8  is_en;
2323 };
2324
2325 /** \brief Reply for gpe enable/disable
2326     @param context - returned sender context, to match reply w/ request
2327     @param retval - return code
2328 */
2329 define lisp_enable_disable_reply {
2330     u32 context;
2331     i32 retval;
2332 };
2333
2334 /** \brief add or delete gpe_iface
2335     @param client_index - opaque cookie to identify the sender
2336     @param context - sender context, to match reply w/ request
2337     @param is_add - add address if non-zero, else delete
2338 */
2339 define lisp_gpe_add_del_iface {
2340     u32 client_index;
2341     u32 context;
2342     u8  is_add;
2343     u32 table_id;
2344     u32 vni;
2345 };
2346
2347 /** \brief Reply for gpe_iface add/del
2348     @param context - returned sender context, to match reply w/ request
2349     @param retval - return code
2350 */
2351 define lisp_gpe_add_del_iface_reply {
2352     u32 context;
2353     i32 retval;
2354 };
2355
2356 /** \brief configure or disable LISP PITR node
2357     @param client_index - opaque cookie to identify the sender
2358     @param context - sender context, to match reply w/ request
2359     @param ls_name - locator set name
2360     @param is_add - add locator set if non-zero, else disable pitr
2361 */
2362 define lisp_pitr_set_locator_set {
2363     u32 client_index;
2364     u32 context;
2365     u8 is_add;
2366     u8 ls_name[64];
2367 };
2368
2369 /** \brief Reply for lisp_pitr_set_locator_set
2370     @param context - returned sender context, to match reply w/ request
2371     @param retval - return code
2372 */
2373 define lisp_pitr_set_locator_set_reply {
2374     u32 context;
2375     i32 retval;
2376 };
2377
2378 /** \brief add or delete remote static mapping
2379     @param client_index - opaque cookie to identify the sender
2380     @param context - sender context, to match reply w/ request
2381     @param is_add - add address if non-zero, else delete
2382     @param del_all - if set, delete all remote mappings
2383     @param vni - virtual network instance
2384     @param action - negative map-reply action
2385     @param eid_type -
2386       0 : ipv4
2387       1 : ipv6
2388       2 : mac
2389     @param deid - destination EID
2390     @param seid - source EID
2391     @param rloc_num - number of remote locators
2392     @param rlocs - remote locator data
2393 */
2394 define lisp_add_del_remote_mapping {
2395     u32 client_index;
2396     u32 context;
2397     u8  is_add;
2398     u8 del_all;
2399     u32 vni;
2400     u8 action;
2401     u8 eid_type;
2402     u8 deid[16];
2403     u8 seid[16];
2404     u8 deid_len;
2405     u8 seid_len;
2406     u32 rloc_num;
2407     u8 rlocs[0];
2408 };
2409
2410 /** \brief Reply for lisp_add_del_remote_mapping
2411     @param context - returned sender context, to match reply w/ request
2412     @param retval - return code
2413 */
2414 define lisp_add_del_remote_mapping_reply {
2415     u32 context;
2416     i32 retval;
2417 };
2418
2419 /** \brief add or delete LISP adjacency adjacency
2420     @param client_index - opaque cookie to identify the sender
2421     @param context - sender context, to match reply w/ request
2422     @param is_add - add address if non-zero, else delete
2423     @param vni - virtual network instance
2424     @param eid_type -
2425       0 : ipv4
2426       1 : ipv6
2427       2 : mac
2428     @param deid - destination EID
2429     @param seid - source EID
2430 */
2431 define lisp_add_del_adjacency {
2432     u32 client_index;
2433     u32 context;
2434     u8  is_add;
2435     u32 vni;
2436     u8 eid_type;
2437     u8 deid[16];
2438     u8 seid[16];
2439     u8 deid_len;
2440     u8 seid_len;
2441 };
2442
2443 /** \brief Reply for lisp_add_del_adjacency
2444     @param context - returned sender context, to match reply w/ request
2445     @param retval - return code
2446 */
2447 define lisp_add_del_adjacency_reply {
2448     u32 context;
2449     i32 retval;
2450 };
2451
2452 /** \brief add or delete map request itr rlocs
2453     @param client_index - opaque cookie to identify the sender
2454     @param context - sender context, to match reply w/ request
2455     @param is_add - add address if non-zero, else delete
2456     @param locator_set_name - locator set name
2457 */
2458 define lisp_add_del_map_request_itr_rlocs {
2459     u32 client_index;
2460     u32 context;
2461     u8 is_add;
2462     u8 locator_set_name[64];
2463 };
2464
2465 /** \brief Reply for lisp_add_del_map_request_itr_rlocs
2466     @param context - returned sender context, to match reply w/ request
2467     @param retval - return code
2468 */
2469
2470 define lisp_add_del_map_request_itr_rlocs_reply {
2471     u32 context;
2472     i32 retval;
2473 };
2474
2475 /** \brief map/unmap vni to vrf
2476     @param client_index - opaque cookie to identify the sender
2477     @param context - sender context, to match reply w/ request
2478     @param is_add - add or delete mapping
2479     @param vni - virtual network id
2480     @param vrf - vrf
2481 */
2482 define lisp_eid_table_add_del_map {
2483     u32 client_index;
2484     u32 context;
2485     u8 is_add;
2486     u32 vni;
2487     u32 vrf;
2488 };
2489
2490 /** \brief Reply for lisp_eid_table_add_del_map
2491     @param context - returned sender context, to match reply w/ request
2492     @param retval - return code
2493 */
2494 define lisp_eid_table_add_del_map_reply {
2495     u32 context;
2496     i32 retval;
2497 };
2498
2499 /** \brief LISP locator_set status
2500     @param locator_set_name - name of the locator_set
2501     @param sw_if_index - sw_if_index of the locator
2502     @param priority - locator priority
2503     @param weight - locator weight
2504  */
2505 define lisp_locator_set_details {
2506     u32 context;
2507     u8  local;
2508     u8  locator_set_name[64];
2509     u32 sw_if_index;
2510     u8  is_ipv6;
2511     u8  ip_address[16];
2512     u8  prefix_len;
2513     u8  priority;
2514     u8  weight;
2515 };
2516
2517 /** \brief Request for locator_set summary status
2518     @param client_index - opaque cookie to identify the sender
2519     @param context - sender context, to match reply w/ request
2520  */
2521 define lisp_locator_set_dump {
2522     u32 client_index;
2523     u32 context;
2524 };
2525
2526 /** \brief LISP local eid table status
2527     @param locator_set_name - name of the locator_set
2528     @param eid_type - ip4, ip6 or l2 mac address
2529     @param eid - array of address bytes
2530     @param eid_prefix_len - prefix len
2531  */
2532 define lisp_local_eid_table_details {
2533     u32 context;
2534     u8  locator_set_name[64];
2535     u8  eid_type;
2536     u32 vni;
2537     u8  eid[16];
2538     u8  eid_prefix_len;
2539 };
2540
2541 /** \brief Request for local eid table summary status
2542     @param client_index - opaque cookie to identify the sender
2543     @param context - sender context, to match reply w/ request
2544     @param eid_set - if non-zero request info about specific mapping
2545     @param vni - virtual network instance; valid only if eid_set != 0
2546     @param prefix_length - prefix length if EID is IP address;
2547       valid only if eid_set != 0
2548     @param eid_type - EID type; valid only if eid_set != 0
2549       Supported values:
2550         0: EID is IPv4
2551         1: EID is IPv6
2552         2: EID is ethernet address
2553     @param eid - endpoint identifier
2554  */
2555 define lisp_local_eid_table_dump {
2556     u32 client_index;
2557     u32 context;
2558     u8  eid_set;
2559     u8  prefix_length;
2560     u32 vni;
2561     u8  eid_type;
2562     u8  eid[16];
2563 };
2564
2565 /** \brief Shows relationship between vni and vrf
2566     @param vrf - VRF index
2567     @param vni - vitual network instance
2568   */
2569 define lisp_eid_table_map_details {
2570     u32 context;
2571     u32 vni;
2572     u32 vrf;
2573 };
2574
2575 /** \brief Request for lisp_eid_table_map_details
2576     @param client_index - opaque cookie to identify the sender
2577     @param context - sender context, to match reply w/ request
2578  */
2579 define lisp_eid_table_map_dump {
2580     u32 client_index;
2581     u32 context;
2582 };
2583
2584 define lisp_gpe_tunnel_details {
2585     u32 context;
2586     u32 tunnels;
2587     u8  is_ipv6;
2588     u8  source_ip[16];
2589     u8  destination_ip[16];
2590     u32 encap_fib_id;
2591     u32 decap_fib_id;
2592     u32 dcap_next;
2593     u8  lisp_ver;
2594     u8  next_protocol;
2595     u8  flags;
2596     u8  ver_res;
2597     u8  res;
2598     u32 iid;
2599 };
2600
2601 /** \brief Request for gpe tunnel summary status
2602     @param client_index - opaque cookie to identify the sender
2603     @param context - sender context, to match reply w/ request
2604  */
2605 define lisp_gpe_tunnel_dump {
2606     u32 client_index;
2607     u32 context;
2608 };
2609
2610 /** \brief LISP map resolver status
2611     @param locator_set_name - name of the locator_set
2612     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
2613     @param ip_address - array of address bytes
2614  */
2615 define lisp_map_resolver_details {
2616     u32 context;
2617     u8  is_ipv6;
2618     u8  ip_address[16];
2619 };
2620
2621 /** \brief Request for map resolver summary status
2622     @param client_index - opaque cookie to identify the sender
2623     @param context - sender context, to match reply w/ request
2624  */
2625 define lisp_map_resolver_dump {
2626     u32 client_index;
2627     u32 context;
2628 };
2629
2630 /** \brief Status of lisp-gpe protocol, enable or disable
2631     @param context - sender context, to match reply w/ request
2632     @param is_en - enable protocol if non-zero, else disable
2633 */
2634 define lisp_enable_disable_status_details {
2635     u32 context;
2636     u8 feature_status;
2637     u8 gpe_status;
2638 };
2639
2640 /** \brief Request for lisp-gpe protocol status
2641     @param client_index - opaque cookie to identify the sender
2642     @param context - sender context, to match reply w/ request
2643 */
2644 define lisp_enable_disable_status_dump {
2645     u32 client_index;
2646     u32 context;
2647 };
2648
2649 /** \brief Get LISP map request itr rlocs status
2650     @param context - sender context, to match reply w/ request
2651     @param locator_set_name - name of the locator_set
2652  */
2653 define lisp_get_map_request_itr_rlocs {
2654     u32 client_index;
2655     u32 context;
2656 };
2657
2658 /** \brief Request for map request itr rlocs summary status
2659  */
2660 define lisp_get_map_request_itr_rlocs_reply {
2661     u32 context;
2662     i32 retval;
2663     u8 locator_set_name[64];
2664 };
2665
2666 /** \brief Request for lisp pitr status
2667     @param client_index - opaque cookie to identify the sender
2668     @param context - sender context, to match reply w/ request
2669 */
2670 define show_lisp_pitr {
2671     u32 client_index;
2672     u32 context;
2673 };
2674
2675 /** \brief Status of lisp pitr, enable or disable
2676     @param context - sender context, to match reply w/ request
2677     @param status - lisp pitr enable if non-zero, else disable
2678     @param locator_set_name -  name of the locator_set
2679 */
2680 define show_lisp_pitr_reply {
2681     u32 context;
2682     i32 retval;
2683     u8  status;
2684     u8  locator_set_name[64];
2685 };
2686
2687 /* Gross kludge, DGMS */
2688 define interface_name_renumber {
2689     u32 client_index;
2690     u32 context;
2691     u32 sw_if_index;
2692     u32 new_show_dev_instance;
2693 };
2694
2695 define interface_name_renumber_reply {
2696     u32 context;
2697     i32 retval;
2698 };
2699
2700 /** \brief Register for ip4 arp resolution events
2701     @param client_index - opaque cookie to identify the sender
2702     @param context - sender context, to match reply w/ request
2703     @param enable_disable - 1 => register for events, 0 => cancel registration
2704     @param pid - sender's pid
2705     @param address - the exact ip4 address of interest
2706 */
2707 define want_ip4_arp_events {
2708     u32 client_index;
2709     u32 context;
2710     u8 enable_disable;
2711     u32 pid;
2712     u32 address;
2713 };
2714
2715 /** \brief Reply for interface events registration
2716     @param context - returned sender context, to match reply w/ request
2717     @param retval - return code
2718 */
2719 define want_ip4_arp_events_reply {
2720     u32 context;
2721     i32 retval;
2722 };
2723
2724 /** \brief Tell client about an ip4 arp resolution event
2725     @param client_index - opaque cookie to identify the sender
2726     @param context - sender context, to match reply w/ request
2727     @param address - the exact ip4 address of interest
2728     @param pid - client pid registered to receive notification
2729     @param sw_if_index - interface which received ARP packet
2730     @param new_mac - the new mac address 
2731 */
2732 define ip4_arp_event {
2733     u32 client_index;
2734     u32 context;
2735     u32 address;
2736     u32 pid;
2737     u32 sw_if_index;
2738     u8 new_mac[6];
2739 };
2740     
2741 /** \brief L2 bridge domain add or delete request
2742     @param client_index - opaque cookie to identify the sender
2743     @param context - sender context, to match reply w/ request
2744     @param bd_id - the bridge domain to create
2745     @param flood - enable/disable bcast/mcast flooding in the bd
2746     @param uu_flood - enable/disable uknown unicast flood in the bd
2747     @param forward - enable/disable forwarding on all interfaces in the bd
2748     @param learn - enable/disable learning on all interfaces in the bd
2749     @param arp_term - enable/disable arp termination in the bd
2750     @param is_add - add or delete flag
2751 */
2752 define bridge_domain_add_del {
2753     u32 client_index;
2754     u32 context;
2755     u32 bd_id;
2756     u8 flood;
2757     u8 uu_flood;
2758     u8 forward;
2759     u8 learn;
2760     u8 arp_term;
2761     u8 is_add;
2762 };
2763
2764 /** \brief L2 bridge domain add or delete response
2765     @param context - sender context, to match reply w/ request
2766     @param retval - return code for the set bridge flags request
2767 */
2768 define bridge_domain_add_del_reply {
2769     u32 context;
2770     i32 retval;
2771 };
2772
2773 /** \brief L2 bridge domain request operational state details
2774     @param client_index - opaque cookie to identify the sender
2775     @param context - sender context, to match reply w/ request
2776     @param bd_id - the bridge domain id desired or ~0 to request all bds
2777 */
2778 define bridge_domain_dump {
2779     u32 client_index;
2780     u32 context;
2781     u32 bd_id;
2782 };
2783
2784 /** \brief L2 bridge domain operational state response
2785     @param bd_id - the bridge domain id
2786     @param flood - bcast/mcast flooding state on all interfaces in the bd
2787     @param uu_flood - uknown unicast flooding state on all interfaces in the bd
2788     @param forward - forwarding state on all interfaces in the bd
2789     @param learn - learning state on all interfaces in the bd
2790     @param arp_term - arp termination state on all interfaces in the bd
2791     @param n_sw_ifs - number of sw_if_index's in the domain
2792 */
2793 define bridge_domain_details {
2794     u32 context;
2795     u32 bd_id;
2796     u8 flood;
2797     u8 uu_flood;
2798     u8 forward;
2799     u8 learn;
2800     u8 arp_term;
2801     u32 bvi_sw_if_index;
2802     u32 n_sw_ifs;
2803 };
2804
2805 /** \brief L2 bridge domain sw interface operational state response
2806     @param bd_id - the bridge domain id
2807     @param sw_if_index - sw_if_index in the domain
2808     @param shg - split horizon group for the interface
2809 */
2810 define bridge_domain_sw_if_details {
2811     u32 context;
2812     u32 bd_id;
2813     u32 sw_if_index;
2814     u8 shg;
2815 };
2816
2817 /** \brief DHCP Client config add / del request
2818     @param client_index - opaque cookie to identify the sender
2819     @param context - sender context, to match reply w/ request
2820     @param sw_if_index - index of the interface for DHCP client
2821     @param hostname - hostname
2822     @param is_add - add the config if non-zero, else delete
2823     @param want_dhcp_event - DHCP event sent to the sender
2824            via dhcp_compl_event API message if non-zero
2825     @param pid - sender's pid
2826 */
2827 define dhcp_client_config {
2828     u32 client_index;
2829     u32 context;
2830     u32 sw_if_index;
2831     u8 hostname[64];
2832     u8 is_add;
2833     u8 want_dhcp_event;
2834     u32 pid;
2835 };
2836
2837 /** \brief DHCP Client config response
2838     @param context - sender context, to match reply w/ request
2839     @param retval - return code for the request
2840 */
2841 define dhcp_client_config_reply {
2842     u32 context;
2843     i32 retval;
2844 };
2845
2846 /** \brief Set/unset input ACL interface
2847     @param client_index - opaque cookie to identify the sender
2848     @param context - sender context, to match reply w/ request
2849     @param sw_if_index - interface to set/unset input ACL
2850     @param ip4_table_index - ip4 classify table index (~0 for skip)
2851     @param ip6_table_index - ip6 classify table index (~0 for skip)
2852     @param l2_table_index  -  l2 classify table index (~0 for skip)
2853     @param is_add - Set input ACL if non-zero, else unset
2854     Note: User is recommeneded to use just one valid table_index per call.
2855           (ip4_table_index, ip6_table_index, or l2_table_index)
2856 */
2857 define input_acl_set_interface {
2858     u32 client_index;
2859     u32 context;
2860     u32 sw_if_index;
2861     u32 ip4_table_index;
2862     u32 ip6_table_index;
2863     u32 l2_table_index;
2864     u8  is_add;
2865 };
2866
2867 /** \brief Set/unset input ACL interface response
2868     @param context - sender context, to match reply w/ request
2869     @param retval - return code for the request
2870 */
2871 define input_acl_set_interface_reply {
2872     u32 context;
2873     i32 retval;
2874 };
2875
2876 /** \brief IPsec: Add/delete Security Policy Database
2877     @param client_index - opaque cookie to identify the sender
2878     @param context - sender context, to match reply w/ request
2879     @param is_add - add SPD if non-zero, else delete
2880     @param spd_id - SPD instance id (control plane allocated)
2881 */
2882
2883 define ipsec_spd_add_del {
2884     u32 client_index;
2885     u32 context;
2886     u8 is_add;
2887     u32 spd_id;
2888 };
2889
2890 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
2891     @param context - returned sender context, to match reply w/ request
2892     @param retval - return code
2893 */
2894
2895 define ipsec_spd_add_del_reply {
2896     u32 context;
2897     i32 retval;
2898 };
2899
2900 /** \brief IPsec: Add/delete SPD from interface
2901
2902     @param client_index - opaque cookie to identify the sender
2903     @param context - sender context, to match reply w/ request
2904     @param is_add - add security mode if non-zero, else delete
2905     @param sw_if_index - index of the interface
2906     @param spd_id - SPD instance id to use for lookups
2907 */
2908
2909
2910 define ipsec_interface_add_del_spd {
2911     u32 client_index;
2912     u32 context;
2913
2914     u8 is_add;
2915     u32 sw_if_index;
2916     u32 spd_id;
2917 };
2918
2919 /** \brief Reply for IPsec: Add/delete SPD from interface
2920     @param context - returned sender context, to match reply w/ request
2921     @param retval - return code
2922 */
2923
2924 define ipsec_interface_add_del_spd_reply {
2925     u32 context;
2926     i32 retval;
2927 };
2928
2929 /** \brief IPsec: Add/delete Security Policy Database entry
2930
2931     See RFC 4301, 4.4.1.1 on how to match packet to selectors
2932
2933     @param client_index - opaque cookie to identify the sender
2934     @param context - sender context, to match reply w/ request
2935     @param is_add - add SPD if non-zero, else delete
2936     @param spd_id - SPD instance id (control plane allocated)
2937     @param priority - priority of SPD entry (non-unique value).  Used to order SPD matching - higher priorities match before lower
2938     @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic
2939     @param is_ipv6 - remote/local address are IPv6 if non-zero, else IPv4
2940     @param remote_address_start - start of remote address range to match
2941     @param remote_address_stop - end of remote address range to match
2942     @param local_address_start - start of local address range to match
2943     @param local_address_stop - end of local address range to match
2944     @param protocol - protocol type to match [0 means any]
2945     @param remote_port_start - start of remote port range to match ...
2946     @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
2947     @param local_port_start - start of local port range to match ...
2948     @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
2949     @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)
2950     @param sa_id - SAD instance id (control plane allocated)
2951
2952 */
2953
2954 define ipsec_spd_add_del_entry {
2955     u32 client_index;
2956     u32 context;
2957     u8 is_add;
2958
2959     u32 spd_id;
2960     i32 priority;
2961     u8 is_outbound;
2962
2963     // Selector
2964     u8 is_ipv6;
2965     u8 is_ip_any;
2966     u8 remote_address_start[16];
2967     u8 remote_address_stop[16];
2968     u8 local_address_start[16];
2969     u8 local_address_stop[16];
2970
2971     u8 protocol;
2972
2973     u16 remote_port_start;
2974     u16 remote_port_stop;
2975     u16 local_port_start;
2976     u16 local_port_stop;
2977
2978     // Policy
2979     u8 policy;
2980     u32 sa_id;
2981 };
2982
2983 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
2984     @param context - returned sender context, to match reply w/ request
2985     @param retval - return code
2986 */
2987
2988 define ipsec_spd_add_del_entry_reply {
2989     u32 context;
2990     i32 retval;
2991 };
2992
2993 /** \brief IPsec: Add/delete Security Association Database entry
2994     @param client_index - opaque cookie to identify the sender
2995     @param context - sender context, to match reply w/ request
2996     @param is_add - add SAD entry if non-zero, else delete
2997
2998     @param sad_id - sad id
2999
3000     @param spi - security parameter index
3001
3002     @param protocol - 0 = AH, 1 = ESP
3003
3004     @param crypto_algorithm - 0 = Null, 1 = AES-CBC-128, 2 = AES-CBC-192, 3 = AES-CBC-256, 4 = 3DES-CBC
3005     @param crypto_key_length - length of crypto_key in bytes
3006     @param crypto_key - crypto keying material
3007
3008     @param integrity_algorithm - 0 = None, 1 = MD5-96, 2 = SHA1-96, 3 = SHA-256, 4 = SHA-384, 5=SHA-512
3009     @param integrity_key_length - length of integrity_key in bytes
3010     @param integrity_key - integrity keying material
3011
3012     @param use_extended_sequence_number - use ESN when non-zero
3013
3014     @param is_tunnel - IPsec tunnel mode if non-zero, else transport mode
3015     @param is_tunnel_ipv6 - IPsec tunnel mode is IPv6 if non-zero, else IPv4 tunnel only valid if is_tunnel is non-zero
3016     @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
3017     @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
3018
3019     To be added:
3020      Anti-replay
3021      IPsec tunnel address copy mode (to support GDOI)
3022  */
3023
3024 define ipsec_sad_add_del_entry {
3025     u32 client_index;
3026     u32 context;
3027     u8 is_add;
3028
3029     u32 sad_id;
3030
3031     u32 spi;
3032
3033     u8 protocol;
3034
3035     u8 crypto_algorithm;
3036     u8 crypto_key_length;
3037     u8 crypto_key[128];
3038
3039     u8 integrity_algorithm;
3040     u8 integrity_key_length;
3041     u8 integrity_key[128];
3042
3043     u8 use_extended_sequence_number;
3044
3045     u8 is_tunnel;
3046     u8 is_tunnel_ipv6;
3047     u8 tunnel_src_address[16];
3048     u8 tunnel_dst_address[16];
3049 };
3050
3051 /** \brief Reply for IPsec: Add/delete Security Association Database entry
3052     @param context - returned sender context, to match reply w/ request
3053     @param retval - return code
3054 */
3055
3056 define ipsec_sad_add_del_entry_reply {
3057     u32 context;
3058     i32 retval;
3059 };
3060
3061 /** \brief IPsec: Update Security Association keys
3062     @param client_index - opaque cookie to identify the sender
3063     @param context - sender context, to match reply w/ request
3064
3065     @param sa_id - sa id
3066
3067     @param crypto_key_length - length of crypto_key in bytes
3068     @param crypto_key - crypto keying material
3069
3070     @param integrity_key_length - length of integrity_key in bytes
3071     @param integrity_key - integrity keying material
3072 */
3073
3074 define ipsec_sa_set_key {
3075     u32 client_index;
3076     u32 context;
3077
3078     u32 sa_id;
3079
3080     u8 crypto_key_length;
3081     u8 crypto_key[128];
3082
3083     u8 integrity_key_length;
3084     u8 integrity_key[128];
3085 };
3086
3087 /** \brief Reply for IPsec: Update Security Association keys
3088     @param context - returned sender context, to match reply w/ request
3089     @param retval - return code
3090 */
3091
3092 define ipsec_sa_set_key_reply {
3093     u32 context;
3094     i32 retval;
3095 };
3096
3097 /** \brief IKEv2: Add/delete profile
3098     @param client_index - opaque cookie to identify the sender
3099     @param context - sender context, to match reply w/ request
3100
3101     @param name - IKEv2 profile name
3102     @param is_add - Add IKEv2 profile if non-zero, else delete
3103 */
3104 define ikev2_profile_add_del {
3105     u32 client_index;
3106     u32 context;
3107
3108     u8 name[64];
3109     u8 is_add;
3110 };
3111
3112 /** \brief Reply for IKEv2: Add/delete profile
3113     @param context - returned sender context, to match reply w/ request
3114     @param retval - return code
3115 */
3116 define ikev2_profile_add_del_reply {
3117     u32 context;
3118     i32 retval;
3119 };
3120
3121 /** \brief IKEv2: Set IKEv2 profile authentication method
3122     @param client_index - opaque cookie to identify the sender
3123     @param context - sender context, to match reply w/ request
3124
3125     @param name - IKEv2 profile name
3126     @param auth_method - IKEv2 authentication method (shared-key-mic/rsa-sig)
3127     @param is_hex - Authentication data in hex format if non-zero, else string
3128     @param data_len - Authentication data length
3129     @param data - Authentication data (for rsa-sig cert file path)
3130 */
3131 define ikev2_profile_set_auth {
3132     u32 client_index;
3133     u32 context;
3134
3135     u8 name[64];
3136     u8 auth_method;
3137     u8 is_hex;
3138     u32 data_len;
3139     u8 data[0];
3140 };
3141
3142 /** \brief Reply for IKEv2: Set IKEv2 profile authentication method
3143     @param context - returned sender context, to match reply w/ request
3144     @param retval - return code
3145 */
3146 define ikev2_profile_set_auth_reply {
3147     u32 context;
3148     i32 retval;
3149 };
3150
3151 /** \brief IKEv2: Set IKEv2 profile local/remote identification
3152     @param client_index - opaque cookie to identify the sender
3153     @param context - sender context, to match reply w/ request
3154
3155     @param name - IKEv2 profile name
3156     @param is_local - Identification is local if non-zero, else remote
3157     @param id_type - Identification type
3158     @param data_len - Identification data length
3159     @param data - Identification data
3160 */
3161 define ikev2_profile_set_id {
3162     u32 client_index;
3163     u32 context;
3164
3165     u8 name[64];
3166     u8 is_local;
3167     u8 id_type;
3168     u32 data_len;
3169     u8 data[0];
3170 };
3171
3172 /** \brief Reply for IKEv2:
3173     @param context - returned sender context, to match reply w/ request
3174     @param retval - return code
3175 */
3176 define ikev2_profile_set_id_reply {
3177     u32 context;
3178     i32 retval;
3179 };
3180
3181 /** \brief IKEv2: Set IKEv2 profile traffic selector parameters
3182     @param client_index - opaque cookie to identify the sender
3183     @param context - sender context, to match reply w/ request
3184
3185     @param name - IKEv2 profile name
3186     @param is_local - Traffic selector is local if non-zero, else remote
3187     @param proto - Traffic selector IP protocol (if zero not relevant)
3188     @param start_port - The smallest port number allowed by traffic selector
3189     @param end_port - The largest port number allowed by traffic selector
3190     @param start_addr - The smallest address included in traffic selector
3191     @param end_addr - The largest address included in traffic selector
3192 */
3193 define ikev2_profile_set_ts {
3194     u32 client_index;
3195     u32 context;
3196
3197     u8 name[64];
3198     u8 is_local;
3199     u8 proto;
3200     u16 start_port;
3201     u16 end_port;
3202     u32 start_addr;
3203     u32 end_addr;
3204 };
3205
3206 /** \brief Reply for IKEv2: Set IKEv2 profile traffic selector parameters
3207     @param context - returned sender context, to match reply w/ request
3208     @param retval - return code
3209 */
3210 define ikev2_profile_set_ts_reply {
3211     u32 context;
3212     i32 retval;
3213 };
3214
3215 /** \brief IKEv2: Set IKEv2 local RSA private key
3216     @param client_index - opaque cookie to identify the sender
3217     @param context - sender context, to match reply w/ request
3218
3219     @param key_file - Key file absolute path
3220 */
3221 define ikev2_set_local_key {
3222     u32 client_index;
3223     u32 context;
3224
3225     u8 key_file[256];
3226 };
3227
3228 /** \brief Reply for IKEv2: Set IKEv2 local key
3229     @param context - returned sender context, to match reply w/ request
3230     @param retval - return code
3231 */
3232 define ikev2_set_local_key_reply {
3233     u32 context;
3234     i32 retval;
3235 };
3236
3237 /** \brief Tell client about a DHCP completion event
3238     @param client_index - opaque cookie to identify the sender
3239     @param pid - client pid registered to receive notification
3240     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
3241     @param host_address - Host IP address
3242     @param router_address - Router IP address
3243     @param host_mac - Host MAC address
3244 */
3245 define dhcp_compl_event {
3246     u32 client_index;
3247     u32 pid;
3248     u8 hostname[64];
3249     u8 is_ipv6;
3250     u8 host_address[16];
3251     u8 router_address[16];
3252     u8 host_mac[6];
3253 };
3254
3255 /** \brief Add MAP domains
3256     @param client_index - opaque cookie to identify the sender
3257     @param context - sender context, to match reply w/ request
3258     @param ip6_prefix - Rule IPv6 prefix
3259     @param ip4_prefix - Rule IPv4 prefix
3260     @param ip6_src - MAP domain IPv6 BR address / Tunnel source
3261     @param ip6_prefix_len - Rule IPv6 prefix length
3262     @param ip4_prefix_len - Rule IPv4 prefix length
3263     @param ea_bits_len - Embedded Address bits length
3264     @param psid_offset - Port Set Identifider (PSID) offset
3265     @param psid_length - PSID length
3266     @param is_translation - MAP-E / MAP-T
3267     @param mtu - MTU
3268 */
3269 define map_add_domain {
3270   u32 client_index;
3271   u32 context;
3272   u8 ip6_prefix[16];
3273   u8 ip4_prefix[4];
3274   u8 ip6_src[16];
3275   u8 ip6_prefix_len;
3276   u8 ip4_prefix_len;
3277   u8 ip6_src_prefix_len;
3278   u8 ea_bits_len;
3279   u8 psid_offset;
3280   u8 psid_length;
3281   u8 is_translation;
3282   u16 mtu;
3283 };
3284
3285 /** \brief Reply for MAP domain add
3286     @param context - returned sender context, to match reply w/ request
3287     @param index - MAP domain index
3288     @param retval - return code
3289 */
3290 define map_add_domain_reply {
3291   u32 context;
3292   u32 index;
3293   i32 retval;
3294 };
3295
3296 /** \brief Delete MAP domain
3297     @param client_index - opaque cookie to identify the sender
3298     @param context - sender context, to match reply w/ request
3299     @param index - MAP Domain index
3300 */
3301 define map_del_domain {
3302   u32 client_index;
3303   u32 context;
3304   u32 index;
3305 };
3306
3307 /** \brief Reply for MAP domain del
3308     @param context - returned sender context, to match reply w/ request
3309     @param retval - return code
3310 */
3311 define map_del_domain_reply {
3312   u32 context;
3313   i32 retval;
3314 };
3315
3316 /** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
3317     @param client_index - opaque cookie to identify the sender
3318     @param context - sender context, to match reply w/ request
3319     @param index - MAP Domain index
3320     @param is_add - If 1 add rule, if 0 delete rule
3321     @param ip6_dst - MAP CE IPv6 address
3322     @param psid - Rule PSID
3323 */
3324 define map_add_del_rule {
3325   u32 client_index;
3326   u32 context;
3327   u32 index;
3328   u32 is_add;
3329   u8 ip6_dst[16];
3330   u16 psid;
3331 };
3332
3333 /** \brief Reply for MAP rule add/del
3334     @param context - returned sender context, to match reply w/ request
3335     @param retval - return code
3336 */
3337 define map_add_del_rule_reply {
3338   u32 context;
3339   i32 retval;
3340 };
3341
3342 /** \brief Get list of map domains
3343     @param client_index - opaque cookie to identify the sender
3344 */
3345 define map_domain_dump {
3346   u32 client_index;
3347   u32 context;
3348 };
3349
3350 define map_domain_details {
3351   u32 context;
3352   u32 domain_index;
3353   u8 ip6_prefix[16];
3354   u8 ip4_prefix[4];
3355   u8 ip6_src[16];
3356   u8 ip6_prefix_len;
3357   u8 ip4_prefix_len;
3358   u8 ip6_src_len;
3359   u8 ea_bits_len;
3360   u8 psid_offset;
3361   u8 psid_length;
3362   u8 flags;
3363   u16 mtu;
3364   u8 is_translation;
3365 };
3366
3367 define map_rule_dump {
3368   u32 client_index;
3369   u32 context;
3370   u32 domain_index;
3371 };
3372
3373 define map_rule_details {
3374   u32 context;
3375   u8 ip6_dst[16];
3376   u16 psid;
3377 };
3378
3379 /** \brief Request for a single block of summary stats
3380     @param client_index - opaque cookie to identify the sender
3381     @param context - sender context, to match reply w/ request
3382 */
3383 define map_summary_stats {
3384     u32 client_index;
3385     u32 context;
3386 };
3387
3388 /** \brief Reply for map_summary_stats request
3389     @param context - sender context, to match reply w/ request
3390     @param retval - return code for request
3391     @param total_bindings -  
3392     @param total_pkts -  
3393     @param total_ip4_fragments -
3394     @param total_security_check - 
3395 */
3396 define map_summary_stats_reply {
3397     u32 context;
3398     i32 retval;
3399     u64 total_bindings;
3400     u64 total_pkts[2];
3401     u64 total_bytes[2];
3402     u64 total_ip4_fragments;
3403     u64 total_security_check[2];
3404 };
3405
3406 /** \brief cop: enable/disable junk filtration features on an interface
3407     @param client_index - opaque cookie to identify the sender
3408     @param context - sender context, to match reply w/ request
3409     @param sw_if_inded - desired interface
3410     @param enable_disable - 1 => enable, 0 => disable
3411 */
3412
3413 define cop_interface_enable_disable {
3414     u32 client_index;
3415     u32 context;
3416     u32 sw_if_index;
3417     u8 enable_disable;
3418 };
3419
3420 /** \brief cop: interface enable/disable junk filtration reply
3421     @param context - returned sender context, to match reply w/ request
3422     @param retval - return code
3423 */
3424
3425 define cop_interface_enable_disable_reply {
3426     u32 context;
3427     i32 retval;
3428 };
3429
3430 /** \brief cop: enable/disable whitelist filtration features on an interface
3431     Note: the supplied fib_id must match in order to remove the feature!
3432     
3433     @param client_index - opaque cookie to identify the sender
3434     @param context - sender context, to match reply w/ request
3435     @param sw_if_index - interface handle, physical interfaces only
3436     @param fib_id - fib identifier for the whitelist / blacklist fib
3437     @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration
3438     @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration
3439     @param default_cop -  1 => enable non-ip4, non-ip6 filtration 0=> disable it
3440 */
3441
3442 define cop_whitelist_enable_disable {
3443     u32 client_index;
3444     u32 context;
3445     u32 sw_if_index;
3446     u32 fib_id;
3447     u8 ip4;
3448     u8 ip6;
3449     u8 default_cop;
3450 };
3451
3452 /** \brief cop: interface enable/disable junk filtration reply
3453     @param context - returned sender context, to match reply w/ request
3454     @param retval - return code
3455 */
3456
3457 define cop_whitelist_enable_disable_reply {
3458     u32 context;
3459     i32 retval;
3460 };
3461
3462 /** \brief get_node_graph - get a copy of the vpp node graph
3463     including the current set of graph arcs.
3464
3465     @param client_index - opaque cookie to identify the sender
3466     @param context - sender context, to match reply w/ request
3467 */
3468
3469 define get_node_graph {
3470     u32 client_index;
3471     u32 context;
3472 };
3473
3474 /** \brief get_node_graph_reply
3475     @param context - returned sender context, to match reply w/ request
3476     @param retval - return code
3477     @param reply_in_shmem - result from vlib_node_serialize, in shared
3478     memory. Process with vlib_node_unserialize, remember to switch
3479     heaps and free the result.
3480 */
3481
3482 define get_node_graph_reply {
3483     u32 context;
3484     i32 retval;
3485     u64 reply_in_shmem;
3486 };
3487
3488 /** \brief Clear interface statistics
3489     @param client_index - opaque cookie to identify the sender
3490     @param context - sender context, to match reply w/ request
3491     @param sw_if_index - index of the interface to clear statistics
3492 */
3493 define sw_interface_clear_stats {
3494     u32 client_index;
3495     u32 context;
3496     u32 sw_if_index;
3497 };
3498
3499 /** \brief Reply to sw_interface_clear_stats 
3500     @param context - sender context which was passed in the request
3501     @param retval - return code of the set flags request
3502 */
3503 define sw_interface_clear_stats_reply {
3504     u32 context;
3505     i32 retval;
3506 };
3507
3508 /** \brief IOAM Trace : Set TRACE profile
3509     @param id - profile id
3510     @param trace_type - Trace type
3511     @param trace_num_elt - Number of nodes in trace path
3512     @param trace_ppc - Trace PPC (none/encap/decap)
3513     @param trace_tsp - Trace timestamp precision (0-sec,1-ms,2-us,3-ns)
3514     @param trace_app_data - Trace application data, can be any 4 bytes
3515     @param pow_enable - Proof of Work enabled or not flag
3516     @param node_id - Id of this node
3517 */
3518 define trace_profile_add {
3519   u32 client_index;
3520   u32 context;
3521   u16 id;
3522   u8  trace_type;
3523   u8  trace_num_elt;
3524   u8  trace_ppc;
3525   u8  trace_tsp;
3526   u32 trace_app_data;
3527   u8  pow_enable;
3528   u32 node_id;
3529 };
3530
3531 /** \brief Trace profile add / del response
3532     @param context - sender context, to match reply w/ request
3533     @param retval - return value for request
3534 */
3535 define trace_profile_add_reply {
3536     u32 context;
3537     i32 retval;
3538 };
3539
3540 /** \brief IOAM Trace enable trace profile for a flow
3541     @param id - id of the trace profile to be applied
3542     @param dest_ipv6 - Destination IPv6 address
3543     @param prefix_length - prefix mask
3544     @param vrf_id - VRF ID
3545     @param trace_op - Trace operation (add/mod/del)
3546     @param enable - apply/remove the trace profile for the flow
3547 */
3548 define trace_profile_apply {
3549   u32 client_index;
3550   u32 context;
3551   u16 id;
3552   u8 dest_ipv6[16];
3553   u32 prefix_length;
3554   u32 vrf_id;
3555   u8 trace_op;
3556   u8 enable;
3557 };
3558
3559 /** \brief Trace profile apply response
3560     @param context - sender context, to match reply w/ request   
3561     @param retval - return value for request
3562 */
3563 define trace_profile_apply_reply {
3564   u32 context;
3565   i32 retval;
3566 };
3567
3568 /** \brief Delete Trace Profile 
3569     @param client_index - opaque cookie to identify the sender
3570     @param context - sender context, to match reply w/ request
3571     @param index - MAP Domain index
3572 */
3573 define trace_profile_del {
3574   u32 client_index;
3575   u32 context;
3576   u16 id;
3577 };
3578
3579 /** \brief Trace profile add / del response
3580     @param context - sender context, to match reply w/ request
3581     @param retval - return value for request
3582 */
3583 define trace_profile_del_reply {
3584     u32 context;
3585     i32 retval;
3586 };
3587
3588 /** \brief Create host-interface
3589     @param client_index - opaque cookie to identify the sender
3590     @param context - sender context, to match reply w/ request
3591     @param host_if_name - interface name
3592     @param hw_addr - interface MAC
3593     @param use_random_hw_addr - use random generated MAC
3594 */
3595 define af_packet_create {
3596     u32 client_index;
3597     u32 context;
3598
3599     u8 host_if_name[64];
3600     u8 hw_addr[6];
3601     u8 use_random_hw_addr;
3602 };
3603
3604 /** \brief Create host-interface response
3605     @param context - sender context, to match reply w/ request
3606     @param retval - return value for request
3607 */
3608 define af_packet_create_reply {
3609     u32 context;
3610     i32 retval;
3611     u32 sw_if_index;
3612 };
3613
3614 /** \brief Delete host-interface
3615     @param client_index - opaque cookie to identify the sender
3616     @param context - sender context, to match reply w/ request
3617     @param host_if_name - interface name
3618 */
3619 define af_packet_delete {
3620     u32 client_index;
3621     u32 context;
3622
3623     u8 host_if_name[64];
3624 };
3625
3626 /** \brief Delete host-interface response
3627     @param context - sender context, to match reply w/ request
3628     @param retval - return value for request
3629 */
3630 define af_packet_delete_reply {
3631     u32 context;
3632     i32 retval;
3633 };
3634
3635 /** \brief Add/del policer
3636     @param client_index - opaque cookie to identify the sender
3637     @param context - sender context, to match reply w/ request
3638     @param is_add - add policer if non-zero, else delete
3639     @param name - policer name
3640     @param cir - CIR
3641     @param eir - EIR
3642     @param cb - Committed Burst
3643     @param eb - Excess or Peak Burst
3644     @param rate_type - rate type
3645     @param round_type - rounding type
3646     @param type - policer algorithm
3647     @param color_aware - 0=color-blind, 1=color-aware
3648     @param conform_action_type - conform action type
3649     @param conform_dscp - DSCP for conform mar-and-transmit action
3650     @param exceed_action_type - exceed action type
3651     @param exceed_dscp - DSCP for exceed mar-and-transmit action
3652     @param violate_action_type - violate action type
3653     @param violate_dscp - DSCP for violate mar-and-transmit action
3654 */
3655 define policer_add_del {
3656     u32 client_index;
3657     u32 context;
3658
3659     u8 is_add;
3660     u8 name[64];
3661     u32 cir;
3662     u32 eir;
3663     u64 cb;
3664     u64 eb;
3665     u8 rate_type;
3666     u8 round_type;
3667     u8 type;
3668     u8 color_aware;
3669     u8 conform_action_type;
3670     u8 conform_dscp;
3671     u8 exceed_action_type;
3672     u8 exceed_dscp;
3673     u8 violate_action_type;
3674     u8 violate_dscp;
3675 };
3676
3677 /** \brief Add/del policer response
3678     @param context - sender context, to match reply w/ request
3679     @param retval - return value for request
3680     @param policer_index - for add, returned index of the new policer
3681 */
3682 define policer_add_del_reply {
3683     u32 context;
3684     i32 retval;
3685     u32 policer_index;
3686 };
3687
3688 /** \brief Get list of policers
3689     @param client_index - opaque cookie to identify the sender
3690     @param context - sender context, to match reply w/ request
3691     @param match_name_valid - if 0 request all policers otherwise use match_name
3692     @param match_name - policer name
3693 */
3694 define policer_dump {
3695     u32 client_index;
3696     u32 context;
3697
3698     u8 match_name_valid;
3699     u8 match_name[64];
3700 };
3701
3702 /** \brief Policer operational state response.
3703     @param context - sender context, to match reply w/ request
3704     @param name - policer name
3705     @param cir - CIR
3706     @param eir - EIR
3707     @param cb - Committed Burst
3708     @param eb - Excess or Peak Burst
3709     @param rate_type - rate type
3710     @param round_type - rounding type
3711     @param type - policer algorithm
3712     @param conform_action_type - conform action type
3713     @param conform_dscp - DSCP for conform mar-and-transmit action
3714     @param exceed_action_type - exceed action type
3715     @param exceed_dscp - DSCP for exceed mar-and-transmit action
3716     @param violate_action_type - violate action type
3717     @param violate_dscp - DSCP for violate mar-and-transmit action
3718     @param single_rate - 1 = single rate policer, 0 = two rate policer
3719     @param color_aware - for hierarchical policing
3720     @param scale - power-of-2 shift amount for lower rates
3721     @param cir_tokens_per_period - number of tokens for each period
3722     @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
3723     @param current_limit - current limit
3724     @param current_bucket - current bucket
3725     @param extended_limit - extended limit
3726     @param extended_bucket - extended bucket
3727     @param last_update_time - last update time
3728 */
3729 define policer_details {
3730     u32 context;
3731
3732     u8 name[64];
3733     u32 cir;
3734     u32 eir;
3735     u64 cb;
3736     u64 eb;
3737     u8 rate_type;
3738     u8 round_type;
3739     u8 type;
3740     u8 conform_action_type;
3741     u8 conform_dscp;
3742     u8 exceed_action_type;
3743     u8 exceed_dscp;
3744     u8 violate_action_type;
3745     u8 violate_dscp;
3746     u8 single_rate;
3747     u8 color_aware;
3748     u32 scale;
3749     u32 cir_tokens_per_period;
3750     u32 pir_tokens_per_period;
3751     u32 current_limit;
3752     u32 current_bucket;
3753     u32 extended_limit;
3754     u32 extended_bucket;
3755     u64 last_update_time;
3756 };
3757
3758 /** \brief Set/unset policer classify interface
3759     @param client_index - opaque cookie to identify the sender
3760     @param context - sender context, to match reply w/ request
3761     @param sw_if_index - interface to set/unset policer classify
3762     @param ip4_table_index - ip4 classify table index (~0 for skip)
3763     @param ip6_table_index - ip6 classify table index (~0 for skip)
3764     @param l2_table_index  -  l2 classify table index (~0 for skip)
3765     @param is_add - Set if non-zero, else unset
3766     Note: User is recommeneded to use just one valid table_index per call.
3767           (ip4_table_index, ip6_table_index, or l2_table_index)
3768 */
3769 define policer_classify_set_interface {
3770     u32 client_index;
3771     u32 context;
3772     u32 sw_if_index;
3773     u32 ip4_table_index;
3774     u32 ip6_table_index;
3775     u32 l2_table_index;
3776     u8  is_add;
3777 };
3778
3779 /** \brief Set/unset policer classify interface response
3780     @param context - sender context, to match reply w/ request
3781     @param retval - return value for request
3782 */
3783 define policer_classify_set_interface_reply {
3784     u32 context;
3785     i32 retval;
3786 };
3787
3788 /** \brief Get list of policer classify interfaces and tables
3789     @param client_index - opaque cookie to identify the sender
3790     @param context - sender context, to match reply w/ request
3791     @param type - classify table type
3792 */
3793 define policer_classify_dump {
3794     u32 client_index;
3795     u32 context;
3796     u8 type;
3797 };
3798
3799 /** \brief Policer iclassify operational state response.
3800     @param context - sender context, to match reply w/ request
3801     @param sw_if_index - software interface index
3802     @param table_index - classify table index
3803 */
3804 define policer_classify_details {
3805     u32 context;
3806     u32 sw_if_index;
3807     u32 table_index;
3808 };
3809
3810 /** \brief Create netmap
3811     @param client_index - opaque cookie to identify the sender
3812     @param context - sender context, to match reply w/ request
3813     @param netmap_if_name - interface name
3814     @param hw_addr - interface MAC
3815     @param use_random_hw_addr - use random generated MAC
3816     @param is_pipe - is pipe
3817     @param is_master - 0=slave, 1=master
3818 */
3819 define netmap_create {
3820     u32 client_index;
3821     u32 context;
3822
3823     u8 netmap_if_name[64];
3824     u8 hw_addr[6];
3825     u8 use_random_hw_addr;
3826     u8 is_pipe;
3827     u8 is_master;
3828 };
3829
3830 /** \brief Create netmap response
3831     @param context - sender context, to match reply w/ request
3832     @param retval - return value for request
3833 */
3834 define netmap_create_reply {
3835     u32 context;
3836     i32 retval;
3837 };
3838
3839 /** \brief Delete netmap
3840     @param client_index - opaque cookie to identify the sender
3841     @param context - sender context, to match reply w/ request
3842     @param netmap_if_name - interface name
3843 */
3844 define netmap_delete {
3845     u32 client_index;
3846     u32 context;
3847
3848     u8 netmap_if_name[64];
3849 };
3850
3851 /** \brief Delete netmap response
3852     @param context - sender context, to match reply w/ request
3853     @param retval - return value for request
3854 */
3855 define netmap_delete_reply {
3856     u32 context;
3857     i32 retval;
3858 };
3859
3860 /** \brief Dump mpls gre tunnel table
3861     @param client_index - opaque cookie to identify the sender
3862     @param tunnel_index - gre tunnel identifier or -1 in case of all tunnels
3863 */
3864 define mpls_gre_tunnel_dump {
3865     u32 client_index;
3866     u32 context;
3867     i32 tunnel_index;
3868 };
3869
3870 /** \brief mpls gre tunnel operational state response
3871     @param tunnel_index - gre tunnel identifier
3872     @param intfc_address - interface ipv4 addr
3873     @param mask_width - interface ipv4 addr mask
3874     @param hw_if_index - interface id
3875     @param l2_only -
3876     @param tunnel_src - tunnel source ipv4 addr
3877     @param tunnel_dst - tunnel destination ipv4 addr
3878     @param outer_fib_index - gre tunnel identifier
3879     @param encap_index - reference to mpls label table
3880     @param nlabels - number of resolved labels
3881     @param labels - resolved labels
3882 */
3883 define mpls_gre_tunnel_details {
3884     u32 context;
3885     u32 tunnel_index;
3886
3887     u32 intfc_address;
3888     u32 inner_fib_index;
3889     u32 mask_width;
3890     u32 encap_index;
3891     u32 hw_if_index;
3892     u8  l2_only;
3893     u32 tunnel_src;
3894     u32 tunnel_dst;
3895     u32 outer_fib_index;
3896     u32 nlabels;
3897     u32 labels[0];
3898 };
3899
3900 /** \brief Dump mpls eth tunnel table
3901     @param client_index - opaque cookie to identify the sender
3902     @param tunnel_index - eth tunnel identifier or -1 in case of all tunnels
3903 */
3904 define mpls_eth_tunnel_dump {
3905     u32 client_index;
3906     u32 context;
3907     i32 tunnel_index;
3908 };
3909
3910 /** \brief mpls eth tunnel operational state response
3911     @param tunnel_index - eth tunnel identifier
3912     @param intfc_address - interface ipv4 addr
3913     @param mask_width - interface ipv4 addr mask
3914     @param hw_if_index - interface id
3915     @param l2_only -
3916     @param tunnel_dst_mac -
3917     @param tx_sw_if_index -
3918     @param encap_index - reference to mpls label table
3919     @param nlabels - number of resolved labels
3920     @param labels - resolved labels
3921 */
3922 define mpls_eth_tunnel_details {
3923     u32 context;
3924     u32 tunnel_index;
3925
3926     u32 intfc_address;
3927     u32 inner_fib_index;
3928     u32 mask_width;
3929     u32 encap_index;
3930     u32 hw_if_index;
3931     u8  l2_only;
3932     u8  tunnel_dst_mac[6];
3933     u32 tx_sw_if_index;
3934     u32 nlabels;
3935     u32 labels[0];
3936 };
3937
3938 /** \brief Dump mpls fib table
3939     @param client_index - opaque cookie to identify the sender
3940     @param fib_index    - mpls fib entry identifier or -1 in case of all entries
3941 */
3942 define mpls_fib_encap_dump {
3943     u32 client_index;
3944     u32 context;
3945 };
3946
3947 /** \brief mpls fib encap table response
3948     @param fib_index - fib table id
3949     @param dest - destination ipv4 addr
3950     @param s_bit -
3951     @param entry_index - reference to mpls label table
3952     @param nlabels - number of resolved labels
3953     @param labels - resolved labels
3954 */
3955 define mpls_fib_encap_details {
3956     u32 context;
3957
3958     u32 fib_index;
3959     u32 entry_index;
3960     u32 dest;
3961     u32 s_bit;
3962     u32 nlabels;
3963     u32 labels[0];
3964 };
3965
3966 /** \brief Dump mpls fib decap table
3967     @param client_index - opaque cookie to identify the sender
3968     @param fib_index    - mpls fib entry identifier or -1 in case of all entries
3969 */
3970 define mpls_fib_decap_dump {
3971     u32 client_index;
3972     u32 context;
3973 };
3974
3975 /** \brief mpls fib decap table response
3976     @param fib_index - fib table id
3977     @param entry_index - reference to mpls label table
3978     @param dest - destination ipv4 addr
3979     @param s_bit -
3980     @param label - mpls labels
3981     @param rx_table_id - rx fib id
3982     @param tx_table_id - tx fib id
3983     @param swif_tag -
3984 */
3985 define mpls_fib_decap_details {
3986     u32 context;
3987
3988     u32 fib_index;
3989     u32 entry_index;
3990     u32 dest;
3991     u32 s_bit;
3992     u32 label;
3993     u32 rx_table_id;
3994     u32 tx_table_id;
3995     u8  swif_tag[8];
3996 };
3997
3998 /** \brief Classify get table IDs request
3999     @param client_index - opaque cookie to identify the sender
4000     @param context - sender context, to match reply w/ request
4001 */
4002 define classify_table_ids {
4003     u32 client_index;
4004     u32 context;
4005 };
4006
4007 /** \brief Reply for classify get table IDs request
4008     @param context - sender context which was passed in the request
4009     @param count - number of ids returned in response
4010     @param ids - array of classify table ids
4011 */
4012 define classify_table_ids_reply {
4013     u32 context;
4014     i32 retval;
4015     u32 count;
4016     u32 ids[count];
4017 };
4018
4019 /** \brief Classify table ids by interface index request
4020     @param client_index - opaque cookie to identify the sender
4021     @param context - sender context, to match reply w/ request
4022     @param sw_if_index - index of the interface
4023 */
4024 define classify_table_by_interface {
4025     u32 client_index;
4026     u32 context;
4027     u32 sw_if_index;
4028 };
4029
4030 /** \brief Reply for classify table id by interface index request
4031     @param context - sender context which was passed in the request
4032     @param count - number of ids returned in response
4033     @param sw_if_index - index of the interface
4034     @param l2_table_id - l2 classify table index
4035     @param ip4_table_id - ip4 classify table index
4036     @param ip6_table_id - ip6 classify table index
4037 */
4038 define classify_table_by_interface_reply {
4039     u32 context;
4040     i32 retval;
4041     u32 sw_if_index;
4042     u32 l2_table_id;
4043     u32 ip4_table_id;
4044     u32 ip6_table_id;
4045 };
4046
4047 /** \brief Classify table info
4048     @param client_index - opaque cookie to identify the sender
4049     @param context - sender context, to match reply w/ request
4050     @param table_id - classify table index
4051 */
4052 define classify_table_info {
4053     u32 client_index;
4054     u32 context;
4055     u32 table_id;
4056 };
4057
4058 /** \brief Reply for classify table info request
4059     @param context - sender context which was passed in the request
4060     @param count - number of ids returned in response
4061     @param table_id - classify table index
4062     @param nbuckets - number of buckets when adding a table
4063     @param match_n_vectors - number of match vectors
4064     @param skip_n_vectors - number of skip_n_vectors
4065     @param active_sessions - number of sessions (active entries)
4066     @param next_table_index - index of next table
4067     @param miss_next_index - index of miss table
4068     @param mask[] - match mask
4069 */
4070 define classify_table_info_reply {
4071     u32 context;
4072     i32 retval;
4073     u32 table_id;
4074     u32 nbuckets;
4075     u32 match_n_vectors;
4076     u32 skip_n_vectors;
4077     u32 active_sessions;
4078     u32 next_table_index;
4079     u32 miss_next_index;
4080     u32 mask_length;
4081     u8  mask[mask_length];
4082 };
4083
4084 /** \brief Classify sessions dump request
4085     @param client_index - opaque cookie to identify the sender
4086     @param context - sender context, to match reply w/ request
4087     @param table_id - classify table index
4088 */
4089 define classify_session_dump {
4090     u32 client_index;
4091     u32 context;
4092     u32 table_id;
4093 };
4094
4095 /** \brief Reply for classify table session dump request
4096     @param context - sender context which was passed in the request
4097     @param count - number of ids returned in response
4098     @param table_id - classify table index
4099     @param hit_next_index - hit_next_index of session
4100     @param opaque_index - for add, opaque_index of session
4101     @param advance - advance value of session
4102     @param match[] - match value for session
4103 */ 
4104 define classify_session_details {
4105     u32 context;
4106     i32 retval;
4107     u32 table_id;
4108     u32 hit_next_index;
4109     i32 advance;
4110     u32 opaque_index;
4111     u32 match_length;
4112     u8 match[match_length];
4113 };
4114
4115 /** \brief Enable and configure IPFIX exporter process request
4116     @param client_index - opaque cookie to identify the sender
4117     @param context - sender context, to match reply w/ request
4118     @param collector_address - address of IPFIX collector
4119     @param collector_port - port of IPFIX IPFIX collector
4120     @param src_address - address of IPFIX exporter
4121     @param vrf_id - VRF / fib table ID
4122     @param path_mtu - Path MTU between exporter and collector
4123     @param template_interval - number of seconds after which to resend template
4124 */
4125 define ipfix_enable {
4126     u32 client_index;
4127     u32 context;
4128     u8 collector_address[16];
4129     u16 collector_port;
4130     u8 src_address[16];
4131     u32 vrf_id;
4132     u32 path_mtu;
4133     u32 template_interval;
4134 };
4135
4136 /** \brief Reply to IPFIX enable and configure request
4137     @param context - sender context which was passed in the request
4138 */
4139 define ipfix_enable_reply {
4140     u32 context;
4141     i32 retval;
4142 };
4143
4144 /** \brief IPFIX dump request
4145     @param client_index - opaque cookie to identify the sender
4146     @param context - sender context, to match reply w/ request
4147 */
4148 define ipfix_dump {
4149     u32 client_index;
4150     u32 context;
4151 };
4152
4153 /** \brief Reply to IPFIX dump request
4154     @param context - sender context which was passed in the request
4155     @param collector_address - address of IPFIX collector
4156     @param collector_port - port of IPFIX IPFIX collector
4157     @param src_address - address of IPFIX exporter
4158     @param fib_index - fib table index
4159     @param path_mtu - Path MTU between exporter and collector
4160     @param template_interval - number of seconds after which to resend template
4161 */
4162 define ipfix_details {
4163     u32 context;
4164     u8 collector_address[16];
4165     u16 collector_port;
4166     u8 src_address[16];
4167     u32 fib_index;
4168     u32 path_mtu;
4169     u32 template_interval;
4170 };
4171
4172 /** \brief Query relative index via node names
4173     @param client_index - opaque cookie to identify the sender
4174     @param context - sender context, to match reply w/ request
4175     @param node_name - name of node to find relative index from
4176     @param next_name - next node from node_name to find relative index of
4177 */
4178 define get_next_index {
4179     u32 client_index;
4180     u32 context;
4181     u8 node_name[64];
4182     u8 next_name[64];
4183 };
4184
4185 /** \brief Reply for get next node index
4186     @param context - sender context which was passed in the request
4187     @param retval - return value
4188     @param next_index - index of the next_node
4189 */
4190 define get_next_index_reply {
4191     u32 context;
4192     i32 retval;
4193     u32 next_index;
4194 };
4195
4196 /** \brief PacketGenerator create interface request
4197     @param client_index - opaque cookie to identify the sender
4198     @param context - sender context, to match reply w/ request
4199     @param interface_id - interface index
4200 */
4201 define pg_create_interface {
4202     u32 client_index;
4203     u32 context;
4204     u32 interface_id;
4205 };
4206
4207 /** \brief PacketGenerator create interface response
4208     @param context - sender context, to match reply w/ request
4209     @param retval - return value for request
4210 */
4211 define pg_create_interface_reply {
4212     u32 context;
4213     i32 retval;
4214     u32 sw_if_index;
4215 };
4216
4217 /** \brief PacketGenerator capture packets on given interface request
4218     @param client_index - opaque cookie to identify the sender
4219     @param context - sender context, to match reply w/ request
4220     @param interface_id - pg interface index
4221     @param is_enabled - 1 if enabling streams, 0 if disabling
4222     @param count - number of packets to be captured
4223     @param pcap_file - pacp file name to store captured packets
4224 */
4225 define pg_capture {
4226     u32 client_index;
4227     u32 context;
4228     u32 interface_id;
4229     u8  is_enabled;
4230     u32 count;
4231     u32 pcap_name_length;
4232     u8  pcap_file_name[pcap_name_length];
4233 };
4234
4235 /** \brief PacketGenerator capture packets response
4236     @param context - sender context, to match reply w/ request
4237     @param retval - return value for request
4238 */
4239 define pg_capture_reply {
4240     u32 context;
4241     i32 retval;
4242 };
4243
4244 /** \brief Enable / disable packet generator request
4245     @param client_index - opaque cookie to identify the sender
4246     @param context - sender context, to match reply w/ request
4247     @param is_enabled - 1 if enabling streams, 0 if disabling
4248     @param stream - stream name to be enable/disabled, if not specified handle all streams 
4249 */
4250 define pg_enable_disable {
4251     u32 client_index;
4252     u32 context;
4253     u8  is_enabled;
4254     u32 stream_name_length;
4255     u8  stream_name[stream_name_length];
4256 };
4257
4258 /** \brief Reply for enable / disable packet generator
4259     @param context - returned sender context, to match reply w/ request
4260     @param retval - return code
4261 */
4262 define pg_enable_disable_reply {
4263     u32 context;
4264     i32 retval;
4265 };