Initial commit of vpp code.
[vpp.git] / 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 sub_if_id - A number 0-N to uniquely identify this subif on super if
55     @param sub_dot1ad -  0 = dot1q, 1=dot1ad
56     @param sub_number_of_tags - Number of tags (0 - 2)
57     @param sub_outer_vlan_id
58     @param sub_inner_vlan_id
59     @param sub_exact_match
60     @param sub_default
61     @param sub_outer_vlan_id_any
62     @param sub_inner_vlan_id_any
63     @param vtr_op - vlan tag rewrite operation
64     @param vtr_push_dot1q
65     @param vtr_tag1
66     @param vtr_tag2
67 */
68 manual_java define sw_interface_details {
69     u32 sw_if_index;
70
71     /* index of sup interface (e.g. hw interface).
72        equal to sw_if_index for super hw interface. */
73     u32 sup_sw_if_index;
74
75     /* Layer 2 address, if applicable */
76     u32 l2_address_length;
77     u8 l2_address[8];
78     
79     /* Interface name */
80     u8 interface_name[64];
81
82     /* 1 = up, 0 = down */
83     u8 admin_up_down;
84     u8 link_up_down;
85
86     /* 1 = half duplex, 2 = full duplex */
87     u8 link_duplex;
88
89     /* 1 = 10M, 2 = 100M, 4 = 1G, 8 = 10G, 16 = 40G, 32 = 100G */
90     u8 link_speed;
91
92     /* Subinterface ID. A number 0-N to uniquely identify this subinterface under the super interface*/
93     u32 sub_id;
94
95     /* 0 = dot1q, 1=dot1ad */
96     u8 sub_dot1ad;
97
98     /* Number of tags 0-2 */
99     u8 sub_number_of_tags;
100     u16 sub_outer_vlan_id;
101     u16 sub_inner_vlan_id;
102     u8 sub_exact_match;
103     u8 sub_default;
104     u8 sub_outer_vlan_id_any;
105     u8 sub_inner_vlan_id_any;
106
107     /* vlan tag rewrite state */
108     u32 vtr_op;
109     u32 vtr_push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
110     u32 vtr_tag1;       // first pushed tag
111     u32 vtr_tag2;       // second pushed tag
112 };
113
114 /** \brief Set flags on the interface
115     @param client_index - opaque cookie to identify the sender
116     @param context - sender context, to match reply w/ request
117     @param sw_if_index - index of the interface to set flags on
118     @param admin_up_down - set the admin state, 1 = up, 0 = down
119     @param link_up_down - Oper state sent on change event, not used in config.
120     @param deleted - interface was deleted
121 */
122 define sw_interface_set_flags {
123     u32 client_index;
124     u32 context;
125     u32 sw_if_index;
126     /* 1 = up, 0 = down */
127     u8 admin_up_down;
128     u8 link_up_down;
129     u8 deleted;
130 };
131
132 /** \brief Reply to sw_interface_set_flags 
133     @param context - sender context which was passed in the request
134     @param retval - return code of the set flags request
135 */
136 define sw_interface_set_flags_reply {
137     u32 context;
138     i32 retval;
139 };
140
141 /* works */
142 manual_java define sw_interface_dump {
143     u32 client_index;
144     u32 context;
145     u8 name_filter_valid;
146     u8 name_filter[49];
147 };
148
149 /** \brief Set or delete one or all ip addresses on a specified interface
150     @param client_index - opaque cookie to identify the sender
151     @param context - sender context, to match reply w/ request
152     @param sw_if_index - index of the interface to add/del addresses 
153     @param is_add - add address if non-zero, else delete
154     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
155     @param del_all - if non-zero delete all addresses on the interface
156     @param address_length - address length in bytes, 4 for ip4, 16 for ip6
157     @param address - array of address bytes
158 */
159 define sw_interface_add_del_address {
160     u32 client_index;
161     u32 context;
162     u32 sw_if_index;
163     u8 is_add;
164     u8 is_ipv6;
165     u8 del_all;
166     u8 address_length;
167     u8 address[16];
168 };
169
170 /** \brief Reply for interface events registration
171     @param context - returned sender context, to match reply w/ request
172     @param retval - return code
173 */
174 define sw_interface_add_del_address_reply {
175     u32 context;
176     i32 retval;
177 };
178
179 /** \brief Associate the specified interface with a fib table
180     @param client_index - opaque cookie to identify the sender
181     @param context - sender context, to match reply w/ request
182     @param sw_if_index - index of the interface
183     @param is_ipv6 - if non-zero ipv6, else ipv4
184     @param vrf_id - fib table/vrd id to associate the interface with
185 */
186 define sw_interface_set_table {
187     u32 client_index;
188     u32 context;
189     u32 sw_if_index;
190     u8 is_ipv6;
191     u32 vrf_id;
192 };
193
194 /** \brief Reply for interface events registration
195     @param context - returned sender context, to match reply w/ request
196     @param retval - return code
197 */
198 define sw_interface_set_table_reply {
199     u32 context;
200     i32 retval;
201 };
202
203 /** \brief Initialize a new tap interface with the given paramters 
204     @param client_index - opaque cookie to identify the sender
205     @param context - sender context, to match reply w/ request
206     @param use_random_mac - let the system generate a unique mac address
207     @param tap_name - name to associate with the new interface
208     @param mac_address - mac addr to assign to the interface if use_radom not set
209 */
210 define tap_connect {
211     u32 client_index;
212     u32 context;
213     u8 use_random_mac;
214     u8 tap_name [64];
215     u8 mac_address[6];
216     u8 renumber;
217     u32 custom_dev_instance;
218 };
219
220 /** \brief Reply for tap connect request
221     @param context - returned sender context, to match reply w/ request
222     @param retval - return code
223     @param sw_if_index - software index allocated for the new tap interface
224 */
225 define tap_connect_reply {
226     u32 context;
227     i32 retval;
228     u32 sw_if_index;
229 };
230
231 /** \brief Modify a tap interface with the given paramters 
232     @param client_index - opaque cookie to identify the sender
233     @param context - sender context, to match reply w/ request
234     @param sw_if_index - interface index of existing tap interface
235     @param use_random_mac - let the system generate a unique mac address
236     @param tap_name - name to associate with the new interface
237     @param mac_address - mac addr to assign to the interface if use_radom not set
238 */
239 define tap_modify {
240     u32 client_index;
241     u32 context;
242     u32 sw_if_index;
243     u8 use_random_mac;
244     u8 tap_name [64];
245     u8 mac_address[6];
246     u8 renumber;
247     u32 custom_dev_instance;
248 };
249
250 /** \brief Reply for tap modify request
251     @param context - returned sender context, to match reply w/ request
252     @param retval - return code
253     @param sw_if_index - software index if the modified tap interface
254 */
255 define tap_modify_reply {
256     u32 context;
257     i32 retval;
258     u32 sw_if_index;
259 };
260
261 /** \brief Delete tap interface
262     @param client_index - opaque cookie to identify the sender
263     @param context - sender context, to match reply w/ request
264     @param sw_if_index - interface index of existing tap interface
265 */
266 define tap_delete {
267     u32 client_index;
268     u32 context;
269     u32 sw_if_index;
270 };
271
272 /** \brief Reply for tap delete request
273     @param context - returned sender context, to match reply w/ request
274     @param retval - return code
275 */
276 define tap_delete_reply {
277     u32 context;
278     i32 retval;
279 };
280
281 /** \brief Dump tap interfaces request */
282 define sw_interface_tap_dump {
283     u32 client_index;
284     u32 context;
285 };
286
287 /** \brief Reply for tap dump request
288     @param sw_if_index - software index of tap interface
289     @param dev_name - Linux tap device name
290 */
291 manual_java define sw_interface_tap_details {
292     u32 context;
293     u32 sw_if_index;
294     u8 dev_name[64];
295 };
296
297 /** \brief Create a new subinterface with the given vlan id
298     @param client_index - opaque cookie to identify the sender
299     @param context - sender context, to match reply w/ request
300     @param sw_if_index - software index of the new vlan's parent interface
301     @param vlan_id - vlan tag of the new interface
302 */
303 define create_vlan_subif {
304     u32 client_index;
305     u32 context;
306     u32 sw_if_index;
307     u32 vlan_id;
308 };
309
310 /** \brief Reply for the vlan subinterface create request
311     @param context - returned sender context, to match reply w/ request
312     @param retval - return code
313     @param sw_if_index - software index allocated for the new subinterface
314 */
315 define create_vlan_subif_reply {
316     u32 context;
317     i32 retval;
318     u32 sw_if_index;
319 };
320
321 /** \brief Add / del route request
322     @param client_index - opaque cookie to identify the sender
323     @param context - sender context, to match reply w/ request
324     @param sw_if_index - software index of the new vlan's parent interface
325     @param vrf_id - fib table /vrf associated with the route
326     @param lookup_in_vrf - 
327     @param resolve_attempts - 
328     @param classify_table_index - 
329     @param create_vrf_if_needed - 
330     @param resolve_if_needed - 
331     @param is_add - 1 if adding the route, 0 if deleting
332     @param is_drop - 
333     @param is_ipv6 - 0 if an ip4 route, else ip6
334     @param is_local - 
335     @param is_classify - 
336     @param is_multipath - Set to 1 if this is a multipath route, else 0
337     @param not_last - Is last or not last msg in group of multiple add/del msgs
338     @param next_hop_weight - 
339     @param dst_address_length - 
340     @param dst_address[16] - 
341     @param next_hop_address[16] - 
342 */
343 define ip_add_del_route {
344     u32 client_index;
345     u32 context;
346     u32 next_hop_sw_if_index;
347     u32 vrf_id;
348     u32 lookup_in_vrf;
349     u32 resolve_attempts;
350     u32 classify_table_index;
351     u8 create_vrf_if_needed;
352     u8 resolve_if_needed;
353     u8 is_add;
354     u8 is_drop;
355     u8 is_ipv6;
356     u8 is_local;
357     u8 is_classify;
358     /* Is last/not-last message in group of multiple add/del messages. */
359     u8 is_multipath;
360     u8 not_last;
361     u8 next_hop_weight;
362     u8 dst_address_length;
363     u8 dst_address[16];
364     u8 next_hop_address[16];
365 };
366
367 /** \brief Reply for add / del route request
368     @param context - returned sender context, to match reply w/ request
369     @param retval - return code
370 */
371 define ip_add_del_route_reply {
372     u32 context;
373     i32 retval;
374 };
375
376 /* works */
377 /** \brief Add / del gre tunnel request
378     @param client_index - opaque cookie to identify the sender
379     @param context - sender context, to match reply w/ request
380     @param sw_if_index - software index of the new vlan's parent interface
381     @param inner_vrf_id -
382     @param outer_vrf_id - 
383     @param is_add - 1 if adding the tunnel, 0 if deleting
384     @param src_address[4] - tunnel source address
385     @param dst_address[4] - tunnel destination address
386     @param intf_address - 
387     @param intf_address_length - 
388 */
389 define mpls_gre_add_del_tunnel {
390     u32 client_index;
391     u32 context;
392     u32 inner_vrf_id;
393     u32 outer_vrf_id;
394     u8 is_add;
395     u8 l2_only;
396     u8 src_address[4];
397     u8 dst_address[4];
398     u8 intfc_address[4];
399     u8 intfc_address_length;
400 };
401
402 /** \brief Reply for add / del tunnel request
403     @param context - returned sender context, to match reply w/ request
404     @param retval - return code
405 */
406 define mpls_gre_add_del_tunnel_reply {
407     u32 context;
408     i32 retval;
409     u32 tunnel_sw_if_index;
410 };
411
412 /** \brief Add / del MPLS encapsulation request
413     @param client_index - opaque cookie to identify the sender
414     @param context - sender context, to match reply w/ request
415     @param vrf_id - vrf id
416     @param dst_address[4] - 
417     @param is_add - 1 if adding the encap, 0 if deleting
418     @param nlabels - number of labels 
419     @param labels - array of labels
420 */
421 define mpls_add_del_encap {
422     u32 client_index;
423     u32 context;
424     u32 vrf_id;
425     u8 dst_address[4];
426     /* 1 = add, 0 = delete */
427     u8 is_add;
428     u8 nlabels;
429     u32 labels[0];
430 }; 
431
432 /** \brief Reply for add / del encapsulation request
433     @param context - returned sender context, to match reply w/ request
434     @param retval - return code
435 */
436 define mpls_add_del_encap_reply {
437     u32 context;
438     i32 retval;
439 };
440
441 /** \brief Add / del MPLS decapsulation request
442     @param client_index - opaque cookie to identify the sender
443     @param context - sender context, to match reply w/ request
444     @param rx_vrf_id - receive vrf
445     @param tx_vrf_id - transmit vrf
446     @param label - 
447     @param next_index - 
448     @param s_bit - 
449     @param is_add - 1 if adding the encap, 0 if deleting
450 */
451 define mpls_add_del_decap {
452     u32 client_index;
453     u32 context;
454     u32 rx_vrf_id;
455     u32 tx_vrf_id;
456     u32 label;
457     u32 next_index;
458     u8 s_bit;
459     u8 is_add;
460 }; 
461
462 /** \brief Reply for MPLS decap add / del request
463     @param context - returned sender context, to match reply w/ request
464     @param retval - return code
465 */
466 define mpls_add_del_decap_reply {
467     u32 context;
468     i32 retval;
469 };
470
471 /** \brief Proxy ARP add / del request
472     @param client_index - opaque cookie to identify the sender
473     @param context - sender context, to match reply w/ request
474     @param vrf_id - VRF / Fib table ID
475     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
476     @param low_address[4] - Low address of the Proxy ARP range
477     @param hi_address[4] - High address of the Proxy ARP range
478 */
479 define proxy_arp_add_del {
480     u32 client_index;
481     u32 context;
482     u32 vrf_id;
483     u8 is_add;
484     u8 low_address[4];
485     u8 hi_address[4];
486 };
487
488 /** \brief Reply for proxy arp add / del request
489     @param context - returned sender context, to match reply w/ request
490     @param retval - return code
491 */
492 define proxy_arp_add_del_reply {
493     u32 context;
494     i32 retval;
495 };
496
497 /** \brief Proxy ARP add / del request
498     @param client_index - opaque cookie to identify the sender
499     @param context - sender context, to match reply w/ request
500     @param sw_if_index - Which interface to enable / disable Proxy Arp on
501     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
502 */
503 define proxy_arp_intfc_enable_disable {
504     u32 client_index;
505     u32 context;
506     u32 sw_if_index;
507     /* 1 = on, 0 = off */
508     u8 enable_disable;
509 };
510
511 /** \brief Reply for Proxy ARP interface enable / disable request
512     @param context - returned sender context, to match reply w/ request
513     @param retval - return code
514 */
515 define proxy_arp_intfc_enable_disable_reply {
516     u32 context;
517     i32 retval;
518 };
519
520 /** \brief IP neighbor add / del request
521     @param client_index - opaque cookie to identify the sender
522     @param context - sender context, to match reply w/ request
523     @param vrf_id - vrf_id, only for IP4
524     @param sw_if_index - interface used to reach neighbor
525     @param is_add - 1 to add neighbor, 0 to delete
526     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
527     @param is_static - 
528     @param mac_address - l2 address of the neighbor
529     @param dst_address - ip4 or ip6 address of the neighbor
530 */
531 define ip_neighbor_add_del {
532     u32 client_index;
533     u32 context;
534     u32 vrf_id;                 /* only makes sense for ip4 */
535     u32 sw_if_index;
536     /* 1 = add, 0 = delete */
537     u8 is_add;
538     u8 is_ipv6;
539     u8 is_static;
540     u8 mac_address[6];
541     u8 dst_address[16];
542 };
543
544 /** \brief Reply for IP Neighbor add / delete request
545     @param context - returned sender context, to match reply w/ request
546     @param retval - return code
547 */
548 define ip_neighbor_add_del_reply {
549     u32 context;
550     i32 retval;
551 };
552
553 /** \brief Reset VRF (remove all routes etc) request
554     @param client_index - opaque cookie to identify the sender
555     @param context - sender context, to match reply w/ request
556     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
557     @param vrf_id - ID of th FIB table / VRF to reset
558 */
559 define reset_vrf {
560     u32 client_index;
561     u32 context;
562     u8 is_ipv6;
563     u32 vrf_id;
564 }; 
565
566 /** \brief Reply for Reset VRF request
567     @param context - returned sender context, to match reply w/ request
568     @param retval - return code
569 */
570 define reset_vrf_reply {
571     u32 context;
572     i32 retval;
573 };
574
575 /** \brief Is Address Reachable request - DISABLED
576     @param client_index - opaque cookie to identify the sender
577     @param context - sender context, to match reply w/ request
578     @param next_hop_sw_if_index - index of interface used to get to next hop
579     @param is_ipv6 - 1 for IPv6, 0 for IPv4
580     @param is_error - address not found or does not match intf
581     @param address[] - Address in question 
582 */
583 define is_address_reachable {
584     u32 client_index;           /* (api_main_t *) am->my_client_index */
585     u32 context;
586     u32 next_hop_sw_if_index;
587     u8 is_known;                /* on reply, this is the answer */
588     u8 is_ipv6;
589     u8 is_error;                /* address not found or does not match intf */
590     u8 address[16];
591 };
592
593 /** \brief Want Stats, register for stats updates
594     @param client_index - opaque cookie to identify the sender
595     @param context - sender context, to match reply w/ request
596     @param enable_disable - 1 = enable stats, 0 = disable
597     @param pid - pid of process requesting stats updates
598 */
599 define want_stats {
600     u32 client_index;
601     u32 context;
602     u32 enable_disable;
603     u32 pid;
604 };
605
606 /** \brief Reply for Want Stats request
607     @param context - returned sender context, to match reply w/ request
608     @param retval - return code
609 */
610 manual_java define want_stats_reply {
611     u32 context;
612     i32 retval;
613 };
614
615 /** \brief Want stats counters structure 
616     @param vnet_counter_type- such as ip4, ip6, punts, etc
617     @param is_combined - rx & tx total (all types) counts   
618     @param first_sw_if_index - first sw index in block of index, counts
619     @param count - number of interfaces this stats block includes counters for
620     @param data - contiguous block of vlib_counter_t structures 
621 */
622 manual_java define vnet_interface_counters {
623     /* enums - plural - in vnet/interface.h */
624     u8 vnet_counter_type;
625     u8 is_combined;
626     u32 first_sw_if_index;
627     u32 count;
628     u8 data[0];
629 };
630
631 typeonly manual_print manual_endian define ip4_fib_counter {
632     u32 address;
633     u8 address_length;
634     u64 packets;
635     u64 bytes;
636 };
637
638 manual_java manual_print manual_endian define vnet_ip4_fib_counters {
639     u32 vrf_id;
640     u32 count;
641     vl_api_ip4_fib_counter_t c[0];
642 };
643
644 typeonly manual_print manual_endian define ip6_fib_counter {
645     u64 address[2];
646     u8 address_length;
647     u64 packets;
648     u64 bytes;
649 };
650
651 manual_java manual_print manual_endian define vnet_ip6_fib_counters {
652     u32 vrf_id;
653     u32 count;
654     vl_api_ip6_fib_counter_t c[0];
655 };
656
657 /** \brief Request for a single block of summary stats
658     @param client_index - opaque cookie to identify the sender
659     @param context - sender context, to match reply w/ request
660 */
661 define vnet_get_summary_stats {
662     u32 client_index;
663     u32 context;
664 };
665
666 /** \brief Reply for vnet_get_summary_stats request
667     @param context - sender context, to match reply w/ request
668     @param retval - return code for request
669     @param total_pkts -  
670     @param total_bytes -
671     @param vector_rate - 
672 */
673 define vnet_summary_stats_reply {
674     u32 context;
675     i32 retval;
676     u64 total_pkts[2];
677     u64 total_bytes[2];
678     f64 vector_rate; 
679 };
680
681 /** \brief OAM event structure
682     @param dst_address[] - 
683     @param state
684 */
685 manual_java define oam_event {
686     u8 dst_address[4];
687     u8 state;
688 };
689
690 /** \brief Want OAM events request
691     @param client_index - opaque cookie to identify the sender
692     @param context - sender context, to match reply w/ request
693     @param enable_disable- enable if non-zero, else disable
694     @param pid - pid of the requesting process
695 */
696 define want_oam_events {
697     u32 client_index;
698     u32 context;
699     u32 enable_disable;
700     u32 pid;
701 };
702
703 /** \brief Want OAM events response
704     @param context - sender context, to match reply w/ request
705     @param retval - return code for the want oam stats request
706 */
707 define want_oam_events_reply {
708     u32 context;
709     i32 retval;
710 };
711
712 /** \brief OAM add / del target request
713     @param client_index - opaque cookie to identify the sender
714     @param context - sender context, to match reply w/ request
715     @param vrf_id - vrf_id of the target
716     @param src_address[] - source address to use for the updates 
717     @param dst_address[] - destination address of the target
718     @param is_add - add target if non-zero, else delete
719 */
720 define oam_add_del {
721     u32 client_index;
722     u32 context;
723     u32 vrf_id;
724     u8 src_address[4];
725     u8 dst_address[4];
726     u8 is_add;
727 };
728
729 /** \brief OAM add / del target response
730     @param context - sender context, to match reply w/ request
731     @param retval - return code of the request
732 */
733 define oam_add_del_reply {
734     u32 context;
735     i32 retval;
736 };
737
738 /** \brief Reset fib table request
739     @param client_index - opaque cookie to identify the sender
740     @param context - sender context, to match reply w/ request
741     @param vrf_id - vrf/table id of the fib table to reset
742     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
743 */
744 define reset_fib {
745     u32 client_index;
746     u32 context;
747     u32 vrf_id;
748     u8 is_ipv6;
749 };
750
751 /** \brief Reset fib response
752     @param context - sender context, to match reply w/ request
753     @param retval - return code for the reset bfib request
754 */
755 define reset_fib_reply {
756     u32 context;
757     i32 retval;
758 };
759
760 /** \brief DHCP Proxy config add / del request
761     @param client_index - opaque cookie to identify the sender
762     @param context - sender context, to match reply w/ request
763     @param vrf_id - vrf id
764     @param if_ipv6 - ipv6 if non-zero, else ipv4
765     @param is_add - add the config if non-zero, else delete
766     @param insert_circuit_id - option82 suboption 1 fib number
767     @param dhcp_server[] - server address
768     @param dhcp_src_address[] - <fix this, need details>
769 */
770 define dhcp_proxy_config {
771     u32 client_index;
772     u32 context;
773     u32 vrf_id;
774     u8 is_ipv6;
775     u8 is_add;
776     u8 insert_circuit_id;
777     u8 dhcp_server[16];
778     u8 dhcp_src_address[16];
779 };
780
781 /** \brief DHCP Proxy config response
782     @param context - sender context, to match reply w/ request
783     @param retval - return code for the request
784 */
785 define dhcp_proxy_config_reply {
786     u32 context;
787     i32 retval;
788 };
789
790 /** \brief DHCP Proxy set / unset vss request
791     @param client_index - opaque cookie to identify the sender
792     @param context - sender context, to match reply w/ request
793     @param tbl_id - table id
794     @param oui - first part of vpn id
795     @param fib_id - second part of vpn id
796     @param is_ipv6 - ip6 if non-zero, else ip4
797     @param is_add - set vss if non-zero, else delete
798 */
799 define dhcp_proxy_set_vss {
800     u32 client_index;
801     u32 context;
802     u32 tbl_id;
803     u32 oui;
804     u32 fib_id;
805     u8 is_ipv6;
806     u8 is_add;
807 };
808
809 /** \brief DHCP proxy set / unset vss response
810     @param context - sender context, to match reply w/ request
811     @param retval - return code for the request
812 */
813 define dhcp_proxy_set_vss_reply {
814     u32 context;
815     i32 retval;
816 };
817
818 /* 
819  * These messages bounce off the dataplane and are not otherwise
820  * interpreted; each has its own publish / subscribe API.
821  * If the dataplane receives one of these and doesn't have an 
822  * active subscription for it, the message will be silently freed.
823  */
824
825 define from_netconf_server {
826     u32 client_index;
827     u32 context;
828     u8 data[0];
829 };
830
831 define want_from_netconf_server {
832     u32 client_index;
833     u32 context;
834     u32 enable_disable;
835     u32 pid;
836 };
837
838 define want_from_netconf_server_reply {
839     u32 context;
840     i32 retval;
841 };
842
843 define to_netconf_server {
844     u32 client_index;
845     u32 context;
846     u8 data[0];
847 };
848
849 define want_to_netconf_server {
850     u32 client_index;
851     u32 context;
852     u32 enable_disable;
853     u32 pid;
854 };
855
856 define want_to_netconf_server_reply {
857     u32 context;
858     i32 retval;
859 };
860
861 define from_netconf_client {
862     u32 client_index;
863     u32 context;
864     u8 data[0];
865 };
866
867 define want_from_netconf_client {
868     u32 client_index;
869     u32 context;
870     u32 enable_disable;
871     u32 pid;
872 };
873
874 define want_from_netconf_client_reply {
875     u32 context;
876     i32 retval;
877 };
878
879 define to_netconf_client {
880     u32 client_index;
881     u32 context;
882     u8 data[0];
883 };
884
885 define want_to_netconf_client {
886     u32 client_index;
887     u32 context;
888     u32 enable_disable;
889     u32 pid;
890 };
891
892 define want_to_netconf_client_reply {
893     u32 context;
894     i32 retval;
895 };
896
897 /** \brief Set the ip flow hash config for a fib request
898     @param client_index - opaque cookie to identify the sender
899     @param context - sender context, to match reply w/ request
900     @param vrf_id - vrf/fib id
901     @param is_ipv6 - if non-zero the fib is ip6, else ip4
902     @param src - if non-zero include src in flow hash
903     @param dst - if non-zero include dst in flow hash
904     @param sport - if non-zero include sport in flow hash
905     @param dport - if non-zero include dport in flow hash
906     @param proto -if non-zero include proto in flow hash
907     @param reverse - if non-zero include reverse in flow hash
908 */
909 define set_ip_flow_hash {
910     u32 client_index;
911     u32 context;
912     u32 vrf_id;
913     u8 is_ipv6;
914     u8 src;
915     u8 dst;
916     u8 sport;
917     u8 dport;
918     u8 proto;
919     u8 reverse;
920 };
921
922 /** \brief Set the ip flow hash config for a fib response
923     @param context - sender context, to match reply w/ request
924     @param retval - return code for the request
925 */
926 define set_ip_flow_hash_reply {
927     u32 context;
928     i32 retval;
929 };
930
931 /** \brief IPv6 router advertisement config request
932     @param client_index - opaque cookie to identify the sender
933     @param context - sender context, to match reply w/ request
934     @param surpress -
935     @param managed -
936     @param other -
937     @param ll_option -
938     @param send_unicast -
939     @param cease -
940     @param is_no -
941     @param default_router -
942     @param max_interval -
943     @param min_interval -
944     @param lifetime -
945     @param initial_count -
946     @param initial_interval -
947 */
948 define sw_interface_ip6nd_ra_config {
949     u32 client_index;
950     u32 context;
951     u32 sw_if_index;
952     u8 surpress;
953     u8  managed;
954     u8 other;
955     u8 ll_option;
956     u8 send_unicast;
957     u8 cease;
958     u8 is_no;
959     u8 default_router;
960     u32 max_interval;
961     u32 min_interval;
962     u32 lifetime;
963     u32 initial_count;
964     u32 initial_interval;
965 };
966
967 /** \brief IPv6 router advertisement config response
968     @param context - sender context, to match reply w/ request
969     @param retval - return code for the request
970 */
971 define sw_interface_ip6nd_ra_config_reply {
972     u32 context;
973     i32 retval;
974 };
975
976 /** \brief IPv6 router advertisement prefix config request
977     @param client_index - opaque cookie to identify the sender
978     @param context - sender context, to match reply w/ request
979     @param sw_if_index - 
980     @param address[] -
981     @param address_length -
982     @param use_default -
983     @param no_advertise -
984     @param off_link -
985     @param no_autoconfig -
986     @param no_onlink -
987     @param is_no -
988     @param val_lifetime -
989     @param pref_lifetime -
990 */
991 define sw_interface_ip6nd_ra_prefix {
992     u32 client_index;
993     u32 context;
994     u32 sw_if_index;
995     u8 address[16];
996     u8 address_length;
997     u8 use_default;
998     u8 no_advertise;
999     u8 off_link;
1000     u8 no_autoconfig;
1001     u8 no_onlink;
1002     u8 is_no;
1003     u32 val_lifetime;
1004     u32 pref_lifetime;
1005 };
1006
1007 /** \brief IPv6 router advertisement prefix config response
1008     @param context - sender context, to match reply w/ request
1009     @param retval - return code for the request
1010 */
1011 define sw_interface_ip6nd_ra_prefix_reply {
1012     u32 context;
1013     i32 retval;
1014 };
1015
1016 /** \brief IPv6 interface enable / disable request
1017     @param client_index - opaque cookie to identify the sender
1018     @param context - sender context, to match reply w/ request
1019     @param sw_if_index - interface used to reach neighbor
1020     @param enable - if non-zero enable ip6 on interface, else disable
1021 */
1022 define sw_interface_ip6_enable_disable  {
1023     u32 client_index;
1024     u32 context;
1025     u32 sw_if_index;
1026     u8 enable;                        /* set to true if enable*/
1027 };
1028
1029 /** \brief IPv6 interface enable / disable response
1030     @param context - sender context, to match reply w/ request
1031     @param retval - return code for the request
1032 */
1033 define  sw_interface_ip6_enable_disable_reply {
1034     u32 context;
1035     i32 retval;
1036 };
1037
1038 /** \brief IPv6 set link local address on interface request
1039     @param client_index - opaque cookie to identify the sender
1040     @param context - sender context, to match reply w/ request
1041     @param sw_if_index - interface to set link local on
1042     @param address[] - the new link local address
1043     @param address_length - link local address length
1044 */
1045 define sw_interface_ip6_set_link_local_address  {
1046     u32 client_index;
1047     u32 context;
1048     u32 sw_if_index;
1049     u8 address[16];
1050     u8 address_length;
1051 };
1052
1053 /** \brief IPv6 set link local address on interface response
1054     @param context - sender context, to match reply w/ request
1055     @param retval - error code for the request
1056 */
1057 define  sw_interface_ip6_set_link_local_address_reply {
1058     u32 context;
1059     i32 retval;
1060 };
1061
1062 /** \brief Set unnumbered interface add / del request
1063     @param client_index - opaque cookie to identify the sender
1064     @param context - sender context, to match reply w/ request
1065     @param sw_if_index - interface with an IP address
1066     @param unnumbered_sw_if_index - interface which will use the address
1067     @param is_add - if non-zero set the association, else unset it
1068 */
1069 define sw_interface_set_unnumbered {
1070     u32 client_index;
1071     u32 context;
1072     u32 sw_if_index;            /* use this intfc address */
1073     u32 unnumbered_sw_if_index; /* on this interface */
1074     u8 is_add;
1075 };
1076
1077 /** \brief Set unnumbered interface add / del response
1078     @param context - sender context, to match reply w/ request
1079     @param retval - return code for the request
1080 */
1081 define  sw_interface_set_unnumbered_reply {
1082     u32 context;
1083     i32 retval;
1084 };
1085
1086 /** \brief Create loopback interface request
1087     @param client_index - opaque cookie to identify the sender
1088     @param context - sender context, to match reply w/ request
1089     @param mac_address - mac addr to assign to the interface if none-zero
1090 */
1091 define create_loopback {
1092     u32 client_index;
1093     u32 context;
1094     u8  mac_address[6];
1095 };
1096
1097 /** \brief Create loopback interface response
1098     @param context - sender context, to match reply w/ request
1099     @param sw_if_index - sw index of the interface that was created
1100     @param retval - return code for the request
1101 */
1102 define create_loopback_reply {
1103     u32 context;
1104     i32 retval;
1105     u32 sw_if_index;
1106 };
1107
1108 /** \brief Delete loopback interface request
1109     @param client_index - opaque cookie to identify the sender
1110     @param context - sender context, to match reply w/ request
1111     @param sw_if_index - sw index of the interface that was created
1112 */
1113 define delete_loopback {
1114     u32 client_index;
1115     u32 context;
1116     u32 sw_if_index;
1117 };
1118
1119 /** \brief Delete loopback interface response
1120     @param context - sender context, to match reply w/ request
1121     @param retval - return code for the request
1122 */
1123 define delete_loopback_reply {
1124     u32 context;
1125     i32 retval;
1126 };
1127
1128 /** \brief Control ping from client to api server request
1129     @param client_index - opaque cookie to identify the sender
1130     @param context - sender context, to match reply w/ request
1131 */
1132 manual_java define control_ping {
1133     u32 client_index;
1134     u32 context;
1135 };
1136
1137 /** \brief Control ping from the client to the server response
1138     @param client_index - opaque cookie to identify the sender
1139     @param context - sender context, to match reply w/ request
1140     @param retval - return code for the request
1141     @param vpe_pid - the pid of the vpe, returned by the server
1142 */
1143 manual_java define control_ping_reply {
1144     u32 context;
1145     i32 retval;
1146     u32 client_index;
1147     u32 vpe_pid;
1148 };
1149
1150 /** \brief Process a vpe parser cli string request
1151     @param client_index - opaque cookie to identify the sender
1152     @param context - sender context, to match reply w/ request
1153     @param cmd_in_shmem - pointer to cli command string
1154 */
1155 define cli_request {
1156     u32 client_index;
1157     u32 context;
1158     u64 cmd_in_shmem;
1159 };
1160
1161 /** \brief vpe parser cli string response
1162     @param context - sender context, to match reply w/ request
1163     @param retval - return code for request
1164     @param reply_in_shmem - Reply string from cli processing if any
1165 */
1166 define cli_reply {
1167     u32 context;
1168     u32 retval;
1169     u64 reply_in_shmem;
1170 };
1171
1172 /** \brief Set max allowed ARP or ip6 neighbor entries request
1173     @param client_index - opaque cookie to identify the sender
1174     @param context - sender context, to match reply w/ request
1175     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
1176     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
1177 */
1178 define set_arp_neighbor_limit {
1179     u32 client_index;
1180     u32 context;
1181     u8  is_ipv6;
1182     u32 arp_neighbor_limit;
1183 }; 
1184
1185 /** \brief Set max allowed ARP or ip6 neighbor entries response
1186     @param context - sender context, to match reply w/ request
1187     @param retval - return code for request
1188 */
1189 define set_arp_neighbor_limit_reply {
1190     u32 context;
1191     i32 retval;
1192 };
1193
1194 /** \brief L2 interface patch add / del request
1195     @param client_index - opaque cookie to identify the sender
1196     @param context - sender context, to match reply w/ request
1197     @param rx_sw_if_index - receive side interface 
1198     @param tx_sw_if_index - transmit side interface
1199     @param is_add - if non-zero set up the interface patch, else remove it
1200 */
1201 define l2_patch_add_del {
1202     u32 client_index;
1203     u32 context;
1204     u32 rx_sw_if_index;
1205     u32 tx_sw_if_index;
1206     u8 is_add;
1207 };
1208
1209 /** \brief L2 interface patch add / del response
1210     @param context - sender context, to match reply w/ request
1211     @param retval - return code for the request
1212 */
1213 define l2_patch_add_del_reply {
1214     u32 context;
1215     i32 retval;
1216 };
1217
1218 /** \brief IPv6 segment routing tunnel add / del request
1219     @param client_index - opaque cookie to identify the sender
1220     @param context - sender context, to match reply w/ request
1221     @param is_add - add the tunnel if non-zero, else delete it
1222     @param src_address[] -
1223     @param dst_address[] -
1224     @param dst_mask_width -
1225     @param inner_vrf_id -
1226     @param outer_vrf_id -
1227     @param flags_net_byte_order -
1228     @param n_segments -
1229     @param n_tags -
1230     @param segs_and_tags[] -
1231 */
1232 define sr_tunnel_add_del {
1233     u32 client_index;
1234     u32 context;
1235     u8 is_add;
1236     u8 src_address[16];
1237     u8 dst_address[16];
1238     u8 dst_mask_width;
1239     u32 inner_vrf_id;
1240     u32 outer_vrf_id;
1241     u16 flags_net_byte_order;
1242     u8 n_segments;
1243     u8 n_tags;
1244     u8 segs_and_tags[0];
1245 };
1246
1247 /** \brief IPv6 segment routing tunnel add / del response
1248     @param context - sender context, to match reply w/ request
1249     @param retval - return value for request
1250 */
1251 define sr_tunnel_add_del_reply {
1252     u32 context;
1253     i32 retval;
1254 };
1255
1256 /** \brief Interface set vpath request
1257     @param client_index - opaque cookie to identify the sender
1258     @param context - sender context, to match reply w/ request
1259     @param sw_if_index - interface used to reach neighbor
1260     @param enable - if non-zero enable, else disable
1261 */
1262 define sw_interface_set_vpath {
1263     u32 client_index;
1264     u32 context;
1265     u32 sw_if_index;
1266     u8  enable;
1267 };
1268
1269 /** \brief Interface set vpath response
1270     @param context - sender context, to match reply w/ request
1271     @param retval - return code for the request
1272 */
1273 define sw_interface_set_vpath_reply {
1274     u32 context;
1275     i32 retval;
1276 };
1277
1278 /** \brief MPLS Ethernet add / del tunnel request
1279     @param client_index - opaque cookie to identify the sender
1280     @param context - sender context, to match reply w/ request
1281     @param vrf_id - vrf_id, only for IP4
1282     @param sw_if_index - interface used to reach neighbor
1283     @param is_add - add if set, tunnel delete if 0
1284     @param dst_mac_address - 
1285     @param adj_address - 
1286     @param adj_address_length -
1287 */
1288 define mpls_ethernet_add_del_tunnel {
1289     u32 client_index;
1290     u32 context;
1291     u32 vrf_id;
1292     u32 tx_sw_if_index;
1293     u8 is_add;
1294     u8 l2_only;
1295     u8 dst_mac_address[6];
1296     u8 adj_address[4];
1297     u8 adj_address_length;
1298 };
1299
1300 /** \brief Reply for MPLS Ethernet add / delete tunnel request
1301     @param context - sender context, to match reply w/ request
1302     @param retval - return code for the request
1303 */
1304 define mpls_ethernet_add_del_tunnel_reply {
1305     u32 context;
1306     i32 retval;
1307     u32 tunnel_sw_if_index;
1308 };
1309 /** \brief MPLS Ethernet add/ del tunnel 2
1310     @param client_index - opaque cookie to identify the sender
1311     @param context - sender context, to match reply w/ request
1312     @param inner_vrf_id - 
1313     @param outer_vrf_id - 
1314     @param resolve_attempts - 
1315     @param resolve_opaque - 
1316     @param resolve_if_needed -
1317     @param is_add -
1318     @param adj_address -
1319     @param adj_address_length -
1320     @param next_hop_ip4_address_in_outer_vrf -
1321 */
1322 define mpls_ethernet_add_del_tunnel_2 {
1323    u32 client_index;
1324    u32 context;
1325    u32 inner_vrf_id;
1326    u32 outer_vrf_id;
1327    u32 resolve_attempts;
1328    u32 resolve_opaque;          /* no need to set this */
1329    u8 resolve_if_needed;
1330    u8 is_add;
1331    u8 l2_only;
1332    u8 adj_address[4];
1333    u8 adj_address_length;
1334    u8 next_hop_ip4_address_in_outer_vrf [4];
1335 };
1336
1337 /** \brief MPLS Ethernet add/ del tunnel 2
1338     @param context - sender context, to match reply w/ request
1339     @param retval - return code for add /del request
1340 */
1341 define mpls_ethernet_add_del_tunnel_2_reply {
1342     u32 context;
1343     i32 retval;
1344 };
1345
1346 /** \brief Set L2 XConnect between two interfaces request
1347     @param client_index - opaque cookie to identify the sender
1348     @param context - sender context, to match reply w/ request
1349     @param rx_sw_if_index - Receive interface index
1350     @param tx_sw_if_index - Transmit interface index
1351     @param enable - enable xconnect if not 0, else set to L3 mode
1352 */
1353 define sw_interface_set_l2_xconnect {
1354     u32 client_index;
1355     u32 context;
1356     u32 rx_sw_if_index;
1357     u32 tx_sw_if_index;
1358     u8 enable;
1359 };
1360
1361 /** \brief Set L2 XConnect response
1362     @param context - sender context, to match reply w/ request
1363     @param retval - L2 XConnect request return code
1364 */
1365 define sw_interface_set_l2_xconnect_reply {
1366     u32 context;
1367     i32 retval;
1368 };
1369
1370 /** \brief Interface bridge mode request
1371     @param client_index - opaque cookie to identify the sender
1372     @param context - sender context, to match reply w/ request
1373     @param rx_sw_if_index - the interface
1374     @param bd_id - bridge domain id
1375     @param bvi - Setup interface as a bvi, bridge mode only
1376     @param shg - Shared horizon group, for bridge mode only
1377     @param enable - Enable beige mode if not 0, else set to L3 mode
1378 */
1379 define sw_interface_set_l2_bridge {
1380     u32 client_index;
1381     u32 context;
1382     u32 rx_sw_if_index;
1383     u32 bd_id;
1384     u8 shg;
1385     u8 bvi;
1386     u8 enable;
1387 };
1388
1389 /** \brief Interface bridge mode response
1390     @param context - sender context, to match reply w/ request
1391     @param retval - Bridge mode request return code
1392 */
1393 define sw_interface_set_l2_bridge_reply {
1394     u32 context;
1395     i32 retval;
1396 };
1397
1398 /** \brief L2 FIB add entry request
1399     @param client_index - opaque cookie to identify the sender
1400     @param context - sender context, to match reply w/ request
1401     @param mac - the entry's mac address
1402     @param bd_id - the entry's bridge domain id
1403     @param sw_if_index - the interface
1404     @param is_add - If non zero add the entry, else delete it
1405     @param static_mac - 
1406     @param filter_mac -
1407 */
1408 define l2fib_add_del {
1409     u32 client_index;
1410     u32 context;
1411     u64 mac;
1412     u32 bd_id;
1413     u32 sw_if_index;
1414     u8 is_add;
1415     u8 static_mac;
1416     u8 filter_mac;
1417 };
1418
1419 /** \brief L2 FIB add entry response
1420     @param context - sender context, to match reply w/ request
1421     @param retval - return code for the add l2fib entry request
1422 */
1423 define l2fib_add_del_reply {
1424     u32 context;
1425     i32 retval;
1426 };
1427
1428 /** \brief Set L2 flags request !!! TODO - need more info, feature bits in l2_input.h
1429     @param client_index - opaque cookie to identify the sender
1430     @param context - sender context, to match reply w/ request
1431     @param sw_if_index - interface 
1432     @param is_set - if non-zero, set the bits, else clear them
1433     @param feature_bitmap - non-zero bits to set or clear
1434 */
1435 define l2_flags {
1436     u32 client_index;
1437     u32 context;
1438     u32 sw_if_index;
1439     u8 is_set;
1440     u32 feature_bitmap;
1441 };
1442
1443 /** \brief Set L2 bits response
1444     @param context - sender context, to match reply w/ request
1445     @param retval - return code for the set l2 bits request
1446 */
1447 define l2_flags_reply {
1448     u32 context;
1449     u32 retval;
1450     u32 resulting_feature_bitmap;
1451 };
1452
1453 /** \brief Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, 
1454     L2_UU_FLOOD, or L2_ARP_TERM) request
1455     @param client_index - opaque cookie to identify the sender
1456     @param context - sender context, to match reply w/ request
1457     @param bd_id - the bridge domain to set the flags for
1458     @param is_set - if non-zero, set the flags, else clear them
1459     @param feature_bitmap - bits that are non-zero to set or clear
1460 */
1461 define bridge_flags {
1462     u32 client_index;
1463     u32 context;
1464     u32 bd_id;
1465     u8 is_set;
1466     u32 feature_bitmap;
1467 };
1468
1469 /** \brief Set bridge flags response
1470     @param context - sender context, to match reply w/ request
1471     @param retval - return code for the set bridge flags request
1472     @param resulting_feature_bitmap - the feature bitmap value after the request is implemented
1473 */
1474 define bridge_flags_reply {
1475     u32 context;
1476     u32 retval;
1477     u32 resulting_feature_bitmap;
1478 };
1479
1480 /** \brief Set bridge domain ip to mac entry request
1481     @param client_index - opaque cookie to identify the sender
1482     @param context - sender context, to match reply w/ request
1483     @param bd_id - the bridge domain to set the flags for
1484     @param is_add - if non-zero, add the entry, else clear it
1485     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
1486     @param mac_address - MAC address
1487     @param 
1488 */
1489 define bd_ip_mac_add_del {
1490     u32 client_index;
1491     u32 context;
1492     u32 bd_id;
1493     u8 is_add;
1494     u8 is_ipv6;
1495     u8 ip_address[16];
1496     u8 mac_address[6];
1497 };
1498
1499 /** \brief Set bridge domain ip to mac entry response
1500     @param context - sender context, to match reply w/ request
1501     @param retval - return code for the set bridge flags request
1502 */
1503 define bd_ip_mac_add_del_reply {
1504     u32 context;
1505     u32 retval;
1506 };
1507
1508 /** \brief Add/Delete classification table request
1509     @param client_index - opaque cookie to identify the sender
1510     @param context - sender context, to match reply w/ request
1511     @param is_add- if non-zero add the table, else delete it
1512     @param table_index - if add, reuturns index of the created table, else specifies the table to delete  
1513     @param nbuckets - number of buckets when adding a table
1514     @param memory_size - memory size when adding a table
1515     @param match_n_vectors - number of match vectors
1516     @param next_table_index - index of next table
1517     @param miss_next_index - index of miss table
1518     @param mask[] - match mask
1519 */
1520 define classify_add_del_table {
1521     u32 client_index;
1522     u32 context;
1523     u8  is_add;
1524     u32 table_index;
1525     u32 nbuckets;
1526     u32 memory_size;
1527     u32 skip_n_vectors;
1528     u32 match_n_vectors;
1529     u32 next_table_index;
1530     u32 miss_next_index;
1531     u8 mask[0];
1532 };
1533
1534 /** \brief Add/Delete classification table response
1535     @param context - sender context, to match reply w/ request
1536     @param retval - return code for the table add/del requst
1537     @param new_table_index - for add, returned index of the new table
1538     @param skip_n_vectors - for add, returned value of skip_n_vectors in table
1539     @param match_n_vectors -for add, returned value of match_n_vectors in table
1540 */
1541 define classify_add_del_table_reply {
1542     u32 context;
1543     i32 retval;
1544     u32 new_table_index;
1545     u32 skip_n_vectors;
1546     u32 match_n_vectors;
1547 };
1548
1549 /** \brief Classify add / del session request
1550     @param client_index - opaque cookie to identify the sender
1551     @param context - sender context, to match reply w/ request
1552     @param is_add - add session if non-zero, else delete
1553     @param table_index - index of the table to add/del the session, required
1554     @param hit_next_index - for add, hit_next_index of new session, required
1555     @param opaque_index - for add, opaque_index of new session
1556     @param advance -for add, advance value for session
1557     @param match[] - for add, match value for session, required
1558 */
1559 define classify_add_del_session {
1560     u32 client_index;
1561     u32 context;
1562     u8  is_add;
1563     u32 table_index;
1564     u32 hit_next_index;
1565     u32 opaque_index;
1566     i32 advance;
1567     u8 match[0];
1568 };
1569
1570 /** \brief Classify add / del session response
1571     @param context - sender context, to match reply w/ request
1572     @param retval - return code for the add/del session request
1573 */
1574 define classify_add_del_session_reply {
1575     u32 context;
1576     i32 retval;
1577 };
1578
1579 /** \brief Set/unset the classification table for an interface request 
1580     @param client_index - opaque cookie to identify the sender
1581     @param context - sender context, to match reply w/ request
1582     @param is_ipv6 - ipv6 if non-zero, else ipv4
1583     @param sw_if_index - interface to associate with the table
1584     @param table_index - index of the table, if ~0 unset the table
1585 */
1586 define classify_set_interface_ip_table {
1587     u32 client_index;
1588     u32 context;
1589     u8 is_ipv6;
1590     u32 sw_if_index;
1591     u32 table_index;            /* ~0 => off */
1592 };
1593
1594 /** \brief Set/unset interface classification table response 
1595     @param context - sender context, to match reply w/ request
1596     @param retval - return code
1597 */
1598 define classify_set_interface_ip_table_reply {
1599     u32 context;
1600     i32 retval;
1601 };
1602
1603 /** \brief Set/unset l2 classification tables for an interface request
1604     @param client_index - opaque cookie to identify the sender
1605     @param context - sender context, to match reply w/ request
1606     @param sw_if_index - interface to set/unset tables for
1607     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
1608     @param ip6_table_index - ip6 index
1609     @param other_table_index - other index
1610 */
1611 define classify_set_interface_l2_tables {
1612     u32 client_index;
1613     u32 context;
1614     u32 sw_if_index;
1615     /* 3 x ~0 => off */
1616     u32 ip4_table_index;
1617     u32 ip6_table_index;
1618     u32 other_table_index;
1619 };
1620
1621 /** \brief Set/unset l2 classification tables for an interface response
1622     @param context - sender context, to match reply w/ request
1623     @param retval - return code for the request
1624 */
1625 define classify_set_interface_l2_tables_reply {
1626     u32 context;
1627     i32 retval;
1628 };
1629
1630 /** \brief Get node index using name request
1631     @param client_index - opaque cookie to identify the sender
1632     @param context - sender context, to match reply w/ request
1633     @param node_name[] - name of the node
1634 */
1635 define get_node_index {
1636     u32 client_index;
1637     u32 context;
1638     u8 node_name[64];
1639 };
1640
1641 /** \brief Get node index using name request
1642     @param context - sender context, to match reply w/ request
1643     @param retval - return code for the request
1644     @param node_index - index of the desired node if found, else ~0
1645 */
1646 define get_node_index_reply {
1647     u32 context;
1648     i32 retval;
1649     u32 node_index;
1650 };
1651
1652 /** \brief Set the next node for a given node request
1653     @param client_index - opaque cookie to identify the sender
1654     @param context - sender context, to match reply w/ request
1655     @param node_name[] - node to add the next node to
1656     @param next_name[] - node to add as the next node
1657 */
1658 define add_node_next {
1659     u32 client_index;
1660     u32 context;
1661     u8 node_name[64];
1662     u8 next_name[64];
1663 };
1664
1665 /** \brief IP Set the next node for a given node response
1666     @param context - sender context, to match reply w/ request
1667     @param retval - return code for the add next node request
1668     @param next_index - the index of the next node if success, else ~0
1669 */
1670 define add_node_next_reply {
1671     u32 context;
1672     i32 retval;
1673     u32 next_index;
1674 };
1675
1676 /** \brief DHCP Proxy config 2 add / del request
1677     @param client_index - opaque cookie to identify the sender
1678     @param context - sender context, to match reply w/ request
1679     @param rx_vrf_id - receive vrf id
1680     @param server_vrf_id - server vrf id
1681     @param if_ipv6 - ipv6 if non-zero, else ipv4
1682     @param is_add - add the config if non-zero, else delete
1683     @param insert_circuit_id - option82 suboption 1 fib number
1684     @param dhcp_server[] - server address
1685     @param dhcp_src_address[] - <fix this, need details>
1686 */
1687 define dhcp_proxy_config_2 {
1688     u32 client_index;
1689     u32 context;
1690     u32 rx_vrf_id;
1691     u32 server_vrf_id;
1692     u8 is_ipv6;
1693     u8 is_add;
1694     u8 insert_circuit_id;
1695     u8 dhcp_server[16];
1696     u8 dhcp_src_address[16];
1697 };
1698
1699 /** \brief DHCP Proxy config 2 add / del response
1700     @param context - sender context, to match reply w/ request
1701     @param retval - return code for request
1702 */
1703 define dhcp_proxy_config_2_reply {
1704     u32 context;
1705     i32 retval;
1706 };
1707
1708 /** \brief l2tpv3 tunnel interface create request
1709     @param client_index - opaque cookie to identify the sender
1710     @param context - sender context, to match reply w/ request
1711     @param client_address - remote client tunnel ip address
1712     @param client_address - local tunnel ip address
1713     @param is_ipv6 - ipv6 if non-zero, else ipv4
1714     @param local_session_id - local tunnel session id
1715     @param remote_session_id - remote tunnel session id
1716     @param local_cookie - local tunnel cookie
1717     @param l2_sublayer_present - l2 sublayer is present in packets if non-zero
1718 */
1719 define l2tpv3_create_tunnel {
1720     u32 client_index;
1721     u32 context;
1722     u8 client_address [16];
1723     u8 our_address [16];
1724     u8 is_ipv6;
1725     u32 local_session_id;
1726     u32 remote_session_id;
1727     u64 local_cookie;
1728     u64 remote_cookie;
1729     u8 l2_sublayer_present;
1730 };
1731
1732 /** \brief l2tpv3 tunnel interface create response
1733     @param context - sender context, to match reply w/ request
1734     @param retval - return code for the request
1735     @param sw_if_index - index of the new tunnel interface
1736 */
1737 define l2tpv3_create_tunnel_reply {
1738     u32 context;
1739     i32 retval;
1740     u32 sw_if_index;
1741 };
1742
1743 define l2tpv3_set_tunnel_cookies {
1744     u32 client_index;
1745     u32 context;
1746     u32 sw_if_index;
1747     u64 new_local_cookie;
1748     u64 new_remote_cookie;
1749 };
1750
1751 /** \brief L2TP tunnel set cookies response
1752     @param context - sender context, to match reply w/ request
1753     @param retval - return code for the request
1754 */
1755 define l2tpv3_set_tunnel_cookies_reply {
1756     u32 context;
1757     i32 retval;
1758 };
1759
1760 manual_java define sw_if_l2tpv3_tunnel_details {
1761     u32 sw_if_index;
1762     u8 interface_name[64];
1763     u8 client_address [16];
1764     u8 our_address [16];
1765     u32 local_session_id;
1766     u32 remote_session_id;
1767     u64 local_cookie[2];
1768     u64 remote_cookie;
1769     u8 l2_sublayer_present;
1770 };
1771
1772 define sw_if_l2tpv3_tunnel_dump {
1773     u32 client_index;
1774     u32 context;
1775 };
1776
1777 /** \brief L2 fib clear table request, clear all mac entries in the l2 fib
1778     @param client_index - opaque cookie to identify the sender
1779     @param context - sender context, to match reply w/ request
1780 */
1781 define l2_fib_clear_table {
1782     u32 client_index;
1783     u32 context;
1784 };
1785
1786 /** \brief L2 fib clear table response
1787     @param context - sender context, to match reply w/ request
1788     @param retval - return code for the request
1789 */
1790 define l2_fib_clear_table_reply {
1791     u32 context;
1792     i32 retval;
1793 };
1794
1795 /** \brief L2 interface ethernet flow point filtering enable/disable request
1796     @param client_index - opaque cookie to identify the sender
1797     @param context - sender context, to match reply w/ request
1798     @param sw_if_index - interface to enable/disable filtering on
1799     @param enable_disable - if non-zero enable filtering, else disable
1800 */
1801 define l2_interface_efp_filter {
1802     u32 client_index;
1803     u32 context;
1804     u32 sw_if_index;
1805     u32 enable_disable;
1806 };
1807
1808 /** \brief L2 interface ethernet flow point filtering response
1809     @param context - sender context, to match reply w/ request
1810     @param retval - return code for the request
1811 */
1812 define l2_interface_efp_filter_reply {
1813     u32 context;
1814     i32 retval;
1815 };
1816
1817 define l2tpv3_interface_enable_disable {
1818     u32 client_index;
1819     u32 context;
1820     u8 enable_disable;
1821     u32 sw_if_index;
1822 }; 
1823
1824 define l2tpv3_interface_enable_disable_reply {
1825     u32 context;
1826     i32 retval;
1827 };
1828
1829 define l2tpv3_set_lookup_key {
1830     u32 client_index;
1831     u32 context;
1832     /* 0 = ip6 src_address, 1 = ip6 dst_address, 2 = session_id */
1833     u8 key;
1834 }; 
1835
1836 define l2tpv3_set_lookup_key_reply {
1837     u32 context;
1838     i32 retval;
1839 };
1840
1841 define vxlan_add_del_tunnel {
1842     u32 client_index;
1843     u32 context;
1844     u8 is_add;
1845     u32 src_address;
1846     u32 dst_address;
1847     u32 encap_vrf_id;
1848     u32 decap_next_index;
1849     u32 vni;
1850 };
1851
1852 define vxlan_add_del_tunnel_reply {
1853     u32 context;
1854     i32 retval;
1855     u32 sw_if_index;
1856 };
1857   
1858 /** \brief L2 interface vlan tag rewrite configure request
1859     @param client_index - opaque cookie to identify the sender
1860     @param context - sender context, to match reply w/ request
1861     @param sw_if_index - interface the operation is applied to
1862     @param vtr_op - Choose from l2_vtr_op_t enum values
1863     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
1864     @param tag1 - Needed for any push or translate vtr op
1865     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
1866 */
1867 define l2_interface_vlan_tag_rewrite {
1868     u32 client_index;
1869     u32 context;
1870     u32 sw_if_index;
1871     u32 vtr_op;
1872     u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
1873     u32 tag1;  // first pushed tag
1874     u32 tag2;  // second pushed tag
1875 };
1876
1877 /** \brief L2 interface vlan tag rewrite response
1878     @param context - sender context, to match reply w/ request
1879     @param retval - return code for the request
1880 */
1881 define l2_interface_vlan_tag_rewrite_reply {
1882     u32 context;
1883     i32 retval;
1884 };
1885
1886 /** \brief vhost-user interface create request
1887     @param client_index - opaque cookie to identify the sender
1888     @param is_server - our side is socket server
1889     @param sock_filename - unix socket filename, used to speak with frontend
1890 */
1891 define create_vhost_user_if {
1892    u32 client_index;
1893    u32 context;
1894    u8 is_server;
1895    u8 sock_filename[256];
1896    u8 renumber;
1897    u32 custom_dev_instance;
1898 };
1899
1900 /** \brief vhost-user interface create response
1901     @param context - sender context, to match reply w/ request
1902     @param retval - return code for the request
1903     @param sw_if_index - interface the operation is applied to
1904 */
1905 define create_vhost_user_if_reply {
1906    u32 context;
1907    i32 retval;
1908    u32 sw_if_index;
1909 };
1910
1911 /** \brief vhost-user interface modify request
1912     @param client_index - opaque cookie to identify the sender
1913     @param is_server - our side is socket server
1914     @param sock_filename - unix socket filename, used to speak with frontend
1915 */
1916 define modify_vhost_user_if {
1917    u32 client_index;
1918    u32 context;
1919    u32 sw_if_index;
1920    u8 is_server;
1921    u8 sock_filename[256];
1922    u8 renumber;
1923    u32 custom_dev_instance;
1924 };
1925
1926 /** \brief vhost-user interface modify response
1927     @param context - sender context, to match reply w/ request
1928     @param retval - return code for the request
1929 */
1930 define modify_vhost_user_if_reply {
1931    u32 context;
1932    i32 retval;
1933 };
1934
1935 /** \brief vhost-user interface delete request
1936     @param client_index - opaque cookie to identify the sender
1937 */
1938 define delete_vhost_user_if {
1939    u32 client_index;
1940    u32 context;
1941    u32 sw_if_index;
1942 };
1943
1944 /** \brief vhost-user interface delete response
1945     @param context - sender context, to match reply w/ request
1946     @param retval - return code for the request
1947 */
1948 define delete_vhost_user_if_reply {
1949    u32 context;
1950    i32 retval;
1951 };
1952
1953 define create_subif {
1954     u32 client_index;
1955     u32 context;
1956     u32 sw_if_index;
1957     u32 sub_id;
1958
1959     /* These fields map directly onto the subif template */
1960     u8 no_tags;
1961     u8 one_tag;
1962     u8 two_tags;
1963     u8 dot1ad;   // 0 = dot1q, 1=dot1ad
1964     u8 exact_match;
1965     u8 default_sub;
1966     u8 outer_vlan_id_any;
1967     u8 inner_vlan_id_any;
1968     u16 outer_vlan_id;
1969     u16 inner_vlan_id;
1970 };
1971
1972 define create_subif_reply {
1973     u32 context;
1974     i32 retval;
1975     u32 sw_if_index;
1976 };
1977
1978 /** \brief show version
1979     @param client_index - opaque cookie to identify the sender
1980     @param context - sender context, to match reply w/ request
1981 */
1982 define show_version {
1983    u32 client_index;
1984    u32 context;
1985 };
1986
1987 /** \brief show version response
1988     @param context - sender context, to match reply w/ request
1989     @param retval - return code for the request
1990     @param program - name of the program (vpe)
1991     @param build_directory - root of the workspace where the program was built
1992     @param git_branch - the git branch for the workspace
1993 */
1994 manual_java define show_version_reply {
1995    u32 context;
1996    i32 retval;
1997    u8 program[32];
1998    u8 git_branch[32];
1999    u8 build_date[32];
2000    u8 build_directory[256];
2001 };
2002
2003 define nsh_gre_add_del_tunnel {
2004     u32 client_index;
2005     u32 context;
2006     u32 src;
2007     u32 dst;
2008     u32 encap_vrf_id;
2009     u32 decap_vrf_id;
2010     u32 decap_next_index;
2011     u8 tlv_len_in_words;
2012     u8 is_add;
2013     u8 ver_o_c;
2014     u8 length;
2015     u8 md_type;
2016     u8 next_protocol;
2017     /* in network byte order */
2018     u32 spi_si;
2019     u32 c1;
2020     u32 c2;
2021     u32 c3;
2022     u32 c4;
2023     u32 tlvs[0];
2024 };
2025
2026 define nsh_gre_add_del_tunnel_reply {
2027     u32 context;
2028     i32 retval;
2029     u32 sw_if_index;
2030 };
2031
2032 /** \brief Vhost-user interface details structure (fix this)
2033     @param sw_if_index - index of the interface
2034     @param interface_name - name of interface
2035     @param virtio_net_hdr_sz - net header size
2036     @param features - interface features
2037     @param is_server - vhost-user server socket
2038     @param sock_filename - socket filename
2039     @param num_regions - number of used memory regions
2040 */
2041 manual_java define sw_interface_vhost_user_details {
2042     u32 sw_if_index;
2043     u8 interface_name[64];
2044     u32 virtio_net_hdr_sz;
2045     u64 features;
2046     u8 is_server;
2047     u8 sock_filename[256];
2048     u32 num_regions;
2049     i32 sock_errno;
2050 };
2051
2052 /* works */
2053 define sw_interface_vhost_user_dump {
2054     u32 client_index;
2055     u32 context;
2056 };
2057
2058 manual_java define ip_address_details {
2059     u32 client_index;
2060     u32 context;
2061     u8 ip[16];
2062     u8 prefix_length;
2063 };
2064
2065 define ip_address_dump {
2066     u32 client_index;
2067     u32 context;
2068     u32 sw_if_index;
2069     u8 is_ipv6;
2070 };
2071
2072 manual_java define ip_details {
2073     u32 sw_if_index;
2074     u32 context;
2075 };
2076
2077 define ip_dump {
2078     u32 client_index;
2079     u32 context;
2080     u8 is_ipv6;
2081 };
2082
2083 /** \brief l2 fib table entry structure
2084     @param bd_id - the l2 fib / bridge domain table id
2085     @param mac - the entry's mac address
2086     @param sw_if_index - index of the interface
2087     @param static_mac - the entry is statically configured.
2088     @param filter_mac - the entry is a mac filter entry.
2089     @param bvi_mac - the mac address is a bridge virtual interface
2090 */
2091 manual_java define l2_fib_table_entry {
2092     u32 bd_id;
2093     u64 mac;
2094     u32 sw_if_index;
2095     u8 static_mac;
2096     u8 filter_mac;
2097     u8 bvi_mac;
2098 };
2099
2100 /** \brief Dump l2 fib (aka bridge domain) table
2101     @param client_index - opaque cookie to identify the sender
2102     @param bd_id - the l2 fib / bridge domain table identifier
2103 */
2104 manual_java define l2_fib_table_dump {
2105     u32 client_index;
2106     u32 context;
2107     u32 bd_id;
2108 };
2109
2110 define nsh_vxlan_gpe_add_del_tunnel {
2111     u32 client_index;
2112     u32 context;
2113     u32 src;
2114     u32 dst;
2115     u32 encap_vrf_id;
2116     u32 decap_vrf_id;
2117     u32 decap_next_index;
2118     u32 vni;
2119     u8 tlv_len_in_words;
2120     u8 is_add;
2121     u8 ver_o_c;
2122     u8 length;
2123     u8 md_type;
2124     u8 next_protocol;
2125     /* in network byte order */
2126     u32 spi_si;
2127     u32 c1;
2128     u32 c2;
2129     u32 c3;
2130     u32 c4;
2131     u32 tlvs[0];
2132 };
2133
2134 define nsh_vxlan_gpe_add_del_tunnel_reply {
2135     u32 context;
2136     i32 retval;
2137     u32 sw_if_index;
2138 };
2139
2140 define lisp_gpe_add_del_tunnel {
2141     u32 client_index;
2142     u32 context;
2143     u32 src;
2144     u32 dst;
2145     u32 encap_vrf_id;
2146     u32 decap_vrf_id;
2147     u32 decap_next_index;
2148     u8 is_add;
2149     u8 flags;
2150     u8 ver_res;
2151     u8 res;
2152     u8 next_protocol;
2153     /* in network byte order */
2154     u32 iid;
2155 };
2156
2157 define lisp_gpe_add_del_tunnel_reply {
2158     u32 context;
2159     i32 retval;
2160     u32 sw_if_index;
2161 };
2162
2163 /* Gross kludge, DGMS */
2164 define interface_name_renumber {
2165     u32 client_index;
2166     u32 context;
2167     u32 sw_if_index;
2168     u32 new_show_dev_instance;
2169 };
2170
2171 define interface_name_renumber_reply {
2172     u32 context;
2173     i32 retval;
2174 };
2175
2176 /** \brief Register for ip4 arp resolution events
2177     @param client_index - opaque cookie to identify the sender
2178     @param context - sender context, to match reply w/ request
2179     @param enable_disable - 1 => register for events, 0 => cancel registration
2180     @param pid - sender's pid
2181     @param address - the exact ip4 address of interest
2182 */
2183 define want_ip4_arp_events {
2184     u32 client_index;
2185     u32 context;
2186     u8 enable_disable;
2187     u32 pid;
2188     u32 address;
2189 };
2190
2191 /** \brief Reply for interface events registration
2192     @param context - returned sender context, to match reply w/ request
2193     @param retval - return code
2194 */
2195 define want_ip4_arp_events_reply {
2196     u32 context;
2197     i32 retval;
2198 };
2199
2200 /** \brief Tell client about an ip4 arp resolution event
2201     @param client_index - opaque cookie to identify the sender
2202     @param context - sender context, to match reply w/ request
2203     @param address - the exact ip4 address of interest
2204     @param pid - client pid registered to receive notification
2205     @param sw_if_index - interface which received ARP packet
2206     @param new_mac - the new mac address 
2207 */
2208 define ip4_arp_event {
2209     u32 client_index;
2210     u32 context;
2211     u32 address;
2212     u32 pid;
2213     u32 sw_if_index;
2214     u8 new_mac[6];
2215 };
2216     
2217 /** \brief L2 bridge domain add or delete request
2218     @param client_index - opaque cookie to identify the sender
2219     @param context - sender context, to match reply w/ request
2220     @param bd_id - the bridge domain to create
2221     @param flood - enable/disable bcast/mcast flooding in the bd
2222     @param uu_flood - enable/disable uknown unicast flood in the bd
2223     @param forward - enable/disable forwarding on all interfaces in the bd
2224     @param learn - enable/disable learning on all interfaces in the bd
2225     @param arp_term - enable/disable arp termination in the bd
2226     @param is_add - add or delete flag
2227 */
2228 define bridge_domain_add_del {
2229     u32 client_index;
2230     u32 context;
2231     u32 bd_id;
2232     u8 flood;
2233     u8 uu_flood;
2234     u8 forward;
2235     u8 learn;
2236     u8 arp_term;
2237     u8 is_add;
2238 };
2239
2240 /** \brief L2 bridge domain add or delete response
2241     @param context - sender context, to match reply w/ request
2242     @param retval - return code for the set bridge flags request
2243 */
2244 define bridge_domain_add_del_reply {
2245     u32 context;
2246     u32 retval;
2247 };
2248
2249 /** \brief L2 bridge domain request operational state details
2250     @param client_index - opaque cookie to identify the sender
2251     @param context - sender context, to match reply w/ request
2252     @param bd_id - the bridge domain id desired or ~0 to request all bds
2253 */
2254 manual_java define bridge_domain_dump {
2255     u32 client_index;
2256     u32 context;
2257     u32 bd_id;
2258 };
2259
2260 /** \brief L2 bridge domain operational state response
2261     @param bd_id - the bridge domain id
2262     @param flood - bcast/mcast flooding state on all interfaces in the bd
2263     @param uu_flood - uknown unicast flooding state on all interfaces in the bd
2264     @param forward - forwarding state on all interfaces in the bd
2265     @param learn - learning state on all interfaces in the bd
2266     @param arp_term - arp termination state on all interfaces in the bd
2267     @param n_sw_ifs - number of sw_if_index's in the domain
2268 */
2269 manual_java define bridge_domain_details {
2270     u32 context;
2271     u32 bd_id;
2272     u8 flood;
2273     u8 uu_flood;
2274     u8 forward;
2275     u8 learn;
2276     u8 arp_term;
2277     u32 bvi_sw_if_index;
2278     u32 n_sw_ifs;
2279 };
2280
2281 /** \brief L2 bridge domain sw interface operational state response
2282     @param bd_id - the bridge domain id
2283     @param sw_if_index - sw_if_index in the domain
2284     @param shg - split horizon group for the interface
2285 */
2286 manual_java define bridge_domain_sw_if_details {
2287     u32 context;
2288     u32 bd_id;
2289     u32 sw_if_index;
2290     u8 shg;
2291 };
2292
2293 /** \brief DHCP Client config add / del request
2294     @param client_index - opaque cookie to identify the sender
2295     @param context - sender context, to match reply w/ request
2296     @param sw_if_index - index of the interface for DHCP client
2297     @param hostname - hostname
2298     @param is_add - add the config if non-zero, else delete
2299     @param want_dhcp_event - DHCP event sent to the sender
2300            via dhcp_compl_event API message if non-zero
2301     @param pid - sender's pid
2302 */
2303 define dhcp_client_config {
2304     u32 client_index;
2305     u32 context;
2306     u32 sw_if_index;
2307     u8 hostname[64];
2308     u8 is_add;
2309     u8 want_dhcp_event;
2310     u32 pid;
2311 };
2312
2313 /** \brief DHCP Client config response
2314     @param context - sender context, to match reply w/ request
2315     @param retval - return code for the request
2316 */
2317 define dhcp_client_config_reply {
2318     u32 context;
2319     i32 retval;
2320 };
2321
2322 /** \brief Set/unset input ACL interface
2323     @param client_index - opaque cookie to identify the sender
2324     @param context - sender context, to match reply w/ request
2325     @param sw_if_index - interface to set/unset input ACL
2326     @param ip4_table_index - ip4 classify table index (~0 for skip)
2327     @param ip6_table_index - ip6 classify table index (~0 for skip)
2328     @param l2_table_index  -  l2 classify table index (~0 for skip)
2329     @param is_add - Set input ACL if non-zero, else unset
2330     Note: User is recommeneded to use just one valid table_index per call.
2331           (ip4_table_index, ip6_table_index, or l2_table_index)
2332 */
2333 define input_acl_set_interface {
2334     u32 client_index;
2335     u32 context;
2336     u32 sw_if_index;
2337     u32 ip4_table_index;
2338     u32 ip6_table_index;
2339     u32 l2_table_index;
2340     u8  is_add;
2341 };
2342
2343 /** \brief Set/unset input ACL interface response
2344     @param context - sender context, to match reply w/ request
2345     @param retval - return code for the request
2346 */
2347 define input_acl_set_interface_reply {
2348     u32 context;
2349     i32 retval;
2350 };
2351
2352 /** \brief IPsec: Add/delete Security Policy Database
2353     @param client_index - opaque cookie to identify the sender
2354     @param context - sender context, to match reply w/ request
2355     @param is_add - add SPD if non-zero, else delete
2356     @param spd_id - SPD instance id (control plane allocated)
2357 */
2358
2359 define ipsec_spd_add_del {
2360     u32 client_index;
2361     u32 context;
2362     u8 is_add;
2363     u32 spd_id;
2364 };
2365
2366 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
2367     @param context - returned sender context, to match reply w/ request
2368     @param retval - return code
2369 */
2370
2371 define ipsec_spd_add_del_reply {
2372     u32 context;
2373     i32 retval;
2374 };
2375
2376 /** \brief IPsec: Add/delete SPD from interface
2377
2378     @param client_index - opaque cookie to identify the sender
2379     @param context - sender context, to match reply w/ request
2380     @param is_add - add security mode if non-zero, else delete
2381     @param sw_if_index - index of the interface
2382     @param spd_id - SPD instance id to use for lookups
2383 */
2384
2385
2386 define ipsec_interface_add_del_spd {
2387     u32 client_index;
2388     u32 context;
2389
2390     u8 is_add;
2391     u32 sw_if_index;
2392     u32 spd_id;
2393 };
2394
2395 /** \brief Reply for IPsec: Add/delete SPD from interface
2396     @param context - returned sender context, to match reply w/ request
2397     @param retval - return code
2398 */
2399
2400 define ipsec_interface_add_del_spd_reply {
2401     u32 context;
2402     i32 retval;
2403 };
2404
2405 /** \brief IPsec: Add/delete Security Policy Database entry
2406
2407     See RFC 4301, 4.4.1.1 on how to match packet to selectors
2408
2409     @param client_index - opaque cookie to identify the sender
2410     @param context - sender context, to match reply w/ request
2411     @param is_add - add SPD if non-zero, else delete
2412     @param spd_id - SPD instance id (control plane allocated)
2413     @param priority - priority of SPD entry (non-unique value).  Used to order SPD matching - higher priorities match before lower
2414     @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic
2415     @param is_ipv6 - remote/local address are IPv6 if non-zero, else IPv4
2416     @param remote_address_start - start of remote address range to match
2417     @param remote_address_stop - end of remote address range to match
2418     @param local_address_start - start of local address range to match
2419     @param local_address_stop - end of local address range to match
2420     @param protocol - protocol type to match [0 means any]
2421     @param remote_port_start - start of remote port range to match ...
2422     @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
2423     @param local_port_start - start of local port range to match ...
2424     @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
2425     @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)
2426     @param sa_id - SAD instance id (control plane allocated)
2427
2428 */
2429
2430 define ipsec_spd_add_del_entry {
2431     u32 client_index;
2432     u32 context;
2433     u8 is_add;
2434
2435     u32 spd_id;
2436     i32 priority;
2437     u8 is_outbound;
2438
2439     // Selector
2440     u8 is_ipv6;
2441     u8 is_ip_any;
2442     u8 remote_address_start[16];
2443     u8 remote_address_stop[16];
2444     u8 local_address_start[16];
2445     u8 local_address_stop[16];
2446
2447     u8 protocol;
2448
2449     u16 remote_port_start;
2450     u16 remote_port_stop;
2451     u16 local_port_start;
2452     u16 local_port_stop;
2453
2454     // Policy
2455     u8 policy;
2456     u32 sa_id;
2457 };
2458
2459 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
2460     @param context - returned sender context, to match reply w/ request
2461     @param retval - return code
2462 */
2463
2464 define ipsec_spd_add_del_entry_reply {
2465     u32 context;
2466     i32 retval;
2467 };
2468
2469 /** \brief IPsec: Add/delete Security Association Database entry
2470     @param client_index - opaque cookie to identify the sender
2471     @param context - sender context, to match reply w/ request
2472     @param is_add - add SAD entry if non-zero, else delete
2473
2474     @param sad_id - sad id
2475
2476     @param spi - security parameter index
2477
2478     @param protocol - 0 = AH, 1 = ESP
2479
2480     @param crypto_algorithm - 0 = Null, 1 = AES-CBC-128, 2 = AES-CBC-192, 3 = AES-CBC-256, 4 = 3DES-CBC
2481     @param crypto_key_length - length of crypto_key in bytes
2482     @param crypto_key - crypto keying material
2483
2484     @param integrity_algorithm - 0 = None, 1 = MD5-96, 2 = SHA1-96, 3 = SHA-256, 4 = SHA-384, 5=SHA-512
2485     @param integrity_key_length - length of integrity_key in bytes
2486     @param integrity_key - integrity keying material
2487
2488     @param use_extended_sequence_number - use ESN when non-zero
2489
2490     @param is_tunnel - IPsec tunnel mode if non-zero, else transport mode
2491     @param is_tunnel_ipv6 - IPsec tunnel mode is IPv6 if non-zero, else IPv4 tunnel only valid if is_tunnel is non-zero
2492     @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
2493     @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
2494
2495     To be added:
2496      Anti-replay
2497      IPsec tunnel address copy mode (to support GDOI)
2498  */
2499
2500 define ipsec_sad_add_del_entry {
2501     u32 client_index;
2502     u32 context;
2503     u8 is_add;
2504
2505     u32 sad_id;
2506
2507     u32 spi;
2508
2509     u8 protocol;
2510
2511     u8 crypto_algorithm;
2512     u8 crypto_key_length;
2513     u8 crypto_key[128];
2514
2515     u8 integrity_algorithm;
2516     u8 integrity_key_length;
2517     u8 integrity_key[128];
2518
2519     u8 use_extended_sequence_number;
2520
2521     u8 is_tunnel;
2522     u8 is_tunnel_ipv6;
2523     u8 tunnel_src_address[16];
2524     u8 tunnel_dst_address[16];
2525 };
2526
2527 /** \brief Reply for IPsec: Add/delete Security Association Database entry
2528     @param context - returned sender context, to match reply w/ request
2529     @param retval - return code
2530 */
2531
2532 define ipsec_sad_add_del_entry_reply {
2533     u32 context;
2534     i32 retval;
2535 };
2536
2537 /** \brief IPsec: Update Security Association keys
2538     @param client_index - opaque cookie to identify the sender
2539     @param context - sender context, to match reply w/ request
2540
2541     @param sa_id - sa id
2542
2543     @param crypto_key_length - length of crypto_key in bytes
2544     @param crypto_key - crypto keying material
2545
2546     @param integrity_key_length - length of integrity_key in bytes
2547     @param integrity_key - integrity keying material
2548 */
2549
2550 define ipsec_sa_set_key {
2551     u32 client_index;
2552     u32 context;
2553
2554     u32 sa_id;
2555
2556     u8 crypto_key_length;
2557     u8 crypto_key[128];
2558
2559     u8 integrity_key_length;
2560     u8 integrity_key[128];
2561 };
2562
2563 /** \brief Reply for IPsec: Update Security Association keys
2564     @param context - returned sender context, to match reply w/ request
2565     @param retval - return code
2566 */
2567
2568 define ipsec_sa_set_key_reply {
2569     u32 context;
2570     i32 retval;
2571 };
2572
2573 /** \brief Tell client about a DHCP completion event
2574     @param client_index - opaque cookie to identify the sender
2575     @param pid - client pid registered to receive notification
2576     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
2577     @param host_address - Host IP address
2578     @param router_address - Router IP address
2579     @param host_mac - Host MAC address
2580 */
2581 manual_java define dhcp_compl_event {
2582     u32 client_index;
2583     u32 pid;
2584     u8 hostname[64];
2585     u8 is_ipv6;
2586     u8 host_address[16];
2587     u8 router_address[16];
2588     u8 host_mac[6];
2589 };
2590
2591 /** \brief Add MAP domains
2592     @param client_index - opaque cookie to identify the sender
2593     @param context - sender context, to match reply w/ request
2594     @param ip6_prefix - Rule IPv6 prefix
2595     @param ip4_prefix - Rule IPv4 prefix
2596     @param ip6_src - MAP domain IPv6 BR address / Tunnel source
2597     @param ip6_prefix_len - Rule IPv6 prefix length
2598     @param ip4_prefix_len - Rule IPv4 prefix length
2599     @param ea_bits_len - Embedded Address bits length
2600     @param psid_offset - Port Set Identifider (PSID) offset
2601     @param psid_length - PSID length
2602     @param is_translation - MAP-E / MAP-T
2603     @param mtu - MTU
2604 */
2605 define map_add_domain {
2606   u32 client_index;
2607   u32 context;
2608   u8 ip6_prefix[16];
2609   u8 ip4_prefix[4];
2610   u8 ip6_src[16];
2611   u8 ip6_prefix_len;
2612   u8 ip4_prefix_len;
2613   u8 ip6_src_prefix_len;
2614   u8 ea_bits_len;
2615   u8 psid_offset;
2616   u8 psid_length;
2617   u8 is_translation;
2618   u16 mtu;
2619 };
2620
2621 /** \brief Reply for MAP domain add
2622     @param context - returned sender context, to match reply w/ request
2623     @param index - MAP domain index
2624     @param retval - return code
2625 */
2626 define map_add_domain_reply {
2627   u32 context;
2628   u32 index;
2629   i32 retval;
2630 };
2631
2632 /** \brief Delete MAP domain
2633     @param client_index - opaque cookie to identify the sender
2634     @param context - sender context, to match reply w/ request
2635     @param index - MAP Domain index
2636 */
2637 define map_del_domain {
2638   u32 client_index;
2639   u32 context;
2640   u32 index;
2641 };
2642
2643 /** \brief Reply for MAP domain del
2644     @param context - returned sender context, to match reply w/ request
2645     @param retval - return code
2646 */
2647 define map_del_domain_reply {
2648   u32 context;
2649   i32 retval;
2650 };
2651
2652 /** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
2653     @param client_index - opaque cookie to identify the sender
2654     @param context - sender context, to match reply w/ request
2655     @param index - MAP Domain index
2656     @param is_add - If 1 add rule, if 0 delete rule
2657     @param ip6_dst - MAP CE IPv6 address
2658     @param psid - Rule PSID
2659 */
2660 define map_add_del_rule {
2661   u32 client_index;
2662   u32 context;
2663   u32 index;
2664   u32 is_add;
2665   u8 ip6_dst[16];
2666   u16 psid;
2667 };
2668
2669 /** \brief Reply for MAP rule add/del
2670     @param context - returned sender context, to match reply w/ request
2671     @param retval - return code
2672 */
2673 define map_add_del_rule_reply {
2674   u32 context;
2675   i32 retval;
2676 };
2677
2678 /** \brief Get list of map domains
2679     @param client_index - opaque cookie to identify the sender
2680 */
2681 define map_domain_dump {
2682   u32 client_index;
2683   u32 context;
2684 };
2685
2686 manual_java define map_domain_details {
2687   u32 domain_index;
2688   u8 ip6_prefix[16];
2689   u8 ip4_prefix[4];
2690   u8 ip6_src[16];
2691   u8 ip6_prefix_len;
2692   u8 ip4_prefix_len;
2693   u8 ip6_src_len;
2694   u8 ea_bits_len;
2695   u8 psid_offset;
2696   u8 psid_length;
2697   u8 flags;
2698   u16 mtu;
2699   u8 is_translation;
2700 };
2701
2702 define map_rule_dump {
2703   u32 client_index;
2704   u32 context;
2705   u32 domain_index;
2706 };
2707
2708 manual_java define map_rule_details {
2709   u8 ip6_dst[16];
2710   u16 psid;
2711 };
2712
2713 /** \brief Request for a single block of summary stats
2714     @param client_index - opaque cookie to identify the sender
2715     @param context - sender context, to match reply w/ request
2716 */
2717 define map_summary_stats {
2718     u32 client_index;
2719     u32 context;
2720 };
2721
2722 /** \brief Reply for map_summary_stats request
2723     @param context - sender context, to match reply w/ request
2724     @param retval - return code for request
2725     @param total_bindings -  
2726     @param total_pkts -  
2727     @param total_ip4_fragments -
2728     @param total_security_check - 
2729 */
2730 define map_summary_stats_reply {
2731     u32 context;
2732     i32 retval;
2733     u64 total_bindings;
2734     u64 total_pkts[2];
2735     u64 total_bytes[2];
2736     u64 total_ip4_fragments;
2737     u64 total_security_check[2];
2738 };