Serialize and upload the data plane node graph
[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 manual_java define vxlan_tunnel_dump {
1859     u32 client_index;
1860     u32 context;
1861     u32 sw_if_index;
1862 };
1863
1864 manual_java define vxlan_tunnel_details {
1865     u32 context;
1866     u32 sw_if_index;
1867     u32 src_address;
1868     u32 dst_address;
1869     u32 encap_vrf_id;
1870     u32 decap_next_index;
1871     u32 vni;
1872 };
1873   
1874 /** \brief L2 interface vlan tag rewrite configure request
1875     @param client_index - opaque cookie to identify the sender
1876     @param context - sender context, to match reply w/ request
1877     @param sw_if_index - interface the operation is applied to
1878     @param vtr_op - Choose from l2_vtr_op_t enum values
1879     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
1880     @param tag1 - Needed for any push or translate vtr op
1881     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
1882 */
1883 define l2_interface_vlan_tag_rewrite {
1884     u32 client_index;
1885     u32 context;
1886     u32 sw_if_index;
1887     u32 vtr_op;
1888     u32 push_dot1q; // ethertype of first pushed tag is dot1q/dot1ad
1889     u32 tag1;  // first pushed tag
1890     u32 tag2;  // second pushed tag
1891 };
1892
1893 /** \brief L2 interface vlan tag rewrite response
1894     @param context - sender context, to match reply w/ request
1895     @param retval - return code for the request
1896 */
1897 define l2_interface_vlan_tag_rewrite_reply {
1898     u32 context;
1899     i32 retval;
1900 };
1901
1902 /** \brief vhost-user interface create request
1903     @param client_index - opaque cookie to identify the sender
1904     @param is_server - our side is socket server
1905     @param sock_filename - unix socket filename, used to speak with frontend
1906 */
1907 define create_vhost_user_if {
1908    u32 client_index;
1909    u32 context;
1910    u8 is_server;
1911    u8 sock_filename[256];
1912    u8 renumber;
1913    u32 custom_dev_instance;
1914 };
1915
1916 /** \brief vhost-user interface create response
1917     @param context - sender context, to match reply w/ request
1918     @param retval - return code for the request
1919     @param sw_if_index - interface the operation is applied to
1920 */
1921 define create_vhost_user_if_reply {
1922    u32 context;
1923    i32 retval;
1924    u32 sw_if_index;
1925 };
1926
1927 /** \brief vhost-user interface modify request
1928     @param client_index - opaque cookie to identify the sender
1929     @param is_server - our side is socket server
1930     @param sock_filename - unix socket filename, used to speak with frontend
1931 */
1932 define modify_vhost_user_if {
1933    u32 client_index;
1934    u32 context;
1935    u32 sw_if_index;
1936    u8 is_server;
1937    u8 sock_filename[256];
1938    u8 renumber;
1939    u32 custom_dev_instance;
1940 };
1941
1942 /** \brief vhost-user interface modify response
1943     @param context - sender context, to match reply w/ request
1944     @param retval - return code for the request
1945 */
1946 define modify_vhost_user_if_reply {
1947    u32 context;
1948    i32 retval;
1949 };
1950
1951 /** \brief vhost-user interface delete request
1952     @param client_index - opaque cookie to identify the sender
1953 */
1954 define delete_vhost_user_if {
1955    u32 client_index;
1956    u32 context;
1957    u32 sw_if_index;
1958 };
1959
1960 /** \brief vhost-user interface delete response
1961     @param context - sender context, to match reply w/ request
1962     @param retval - return code for the request
1963 */
1964 define delete_vhost_user_if_reply {
1965    u32 context;
1966    i32 retval;
1967 };
1968
1969 define create_subif {
1970     u32 client_index;
1971     u32 context;
1972     u32 sw_if_index;
1973     u32 sub_id;
1974
1975     /* These fields map directly onto the subif template */
1976     u8 no_tags;
1977     u8 one_tag;
1978     u8 two_tags;
1979     u8 dot1ad;   // 0 = dot1q, 1=dot1ad
1980     u8 exact_match;
1981     u8 default_sub;
1982     u8 outer_vlan_id_any;
1983     u8 inner_vlan_id_any;
1984     u16 outer_vlan_id;
1985     u16 inner_vlan_id;
1986 };
1987
1988 define create_subif_reply {
1989     u32 context;
1990     i32 retval;
1991     u32 sw_if_index;
1992 };
1993
1994 /** \brief show version
1995     @param client_index - opaque cookie to identify the sender
1996     @param context - sender context, to match reply w/ request
1997 */
1998 define show_version {
1999    u32 client_index;
2000    u32 context;
2001 };
2002
2003 /** \brief show version response
2004     @param context - sender context, to match reply w/ request
2005     @param retval - return code for the request
2006     @param program - name of the program (vpe)
2007     @param version  - version of the program
2008     @param build_directory - root of the workspace where the program was built
2009 */
2010 manual_java define show_version_reply {
2011    u32 context;
2012    i32 retval;
2013    u8 program[32];
2014    u8 version[32];
2015    u8 build_date[32];
2016    u8 build_directory[256];
2017 };
2018
2019 define nsh_gre_add_del_tunnel {
2020     u32 client_index;
2021     u32 context;
2022     u32 src;
2023     u32 dst;
2024     u32 encap_vrf_id;
2025     u32 decap_vrf_id;
2026     u32 decap_next_index;
2027     u8 tlv_len_in_words;
2028     u8 is_add;
2029     u8 ver_o_c;
2030     u8 length;
2031     u8 md_type;
2032     u8 next_protocol;
2033     /* in network byte order */
2034     u32 spi_si;
2035     u32 c1;
2036     u32 c2;
2037     u32 c3;
2038     u32 c4;
2039     u32 tlvs[0];
2040 };
2041
2042 define nsh_gre_add_del_tunnel_reply {
2043     u32 context;
2044     i32 retval;
2045     u32 sw_if_index;
2046 };
2047
2048 /** \brief Vhost-user interface details structure (fix this)
2049     @param sw_if_index - index of the interface
2050     @param interface_name - name of interface
2051     @param virtio_net_hdr_sz - net header size
2052     @param features - interface features
2053     @param is_server - vhost-user server socket
2054     @param sock_filename - socket filename
2055     @param num_regions - number of used memory regions
2056 */
2057 manual_java define sw_interface_vhost_user_details {
2058     u32 sw_if_index;
2059     u8 interface_name[64];
2060     u32 virtio_net_hdr_sz;
2061     u64 features;
2062     u8 is_server;
2063     u8 sock_filename[256];
2064     u32 num_regions;
2065     i32 sock_errno;
2066 };
2067
2068 /* works */
2069 define sw_interface_vhost_user_dump {
2070     u32 client_index;
2071     u32 context;
2072 };
2073
2074 manual_java define ip_address_details {
2075     u32 client_index;
2076     u32 context;
2077     u8 ip[16];
2078     u8 prefix_length;
2079 };
2080
2081 manual_java define ip_address_dump {
2082     u32 client_index;
2083     u32 context;
2084     u32 sw_if_index;
2085     u8 is_ipv6;
2086 };
2087
2088 manual_java define ip_details {
2089     u32 sw_if_index;
2090     u32 context;
2091 };
2092
2093 define ip_dump {
2094     u32 client_index;
2095     u32 context;
2096     u8 is_ipv6;
2097 };
2098
2099 /** \brief l2 fib table entry structure
2100     @param bd_id - the l2 fib / bridge domain table id
2101     @param mac - the entry's mac address
2102     @param sw_if_index - index of the interface
2103     @param static_mac - the entry is statically configured.
2104     @param filter_mac - the entry is a mac filter entry.
2105     @param bvi_mac - the mac address is a bridge virtual interface
2106 */
2107 manual_java define l2_fib_table_entry {
2108     u32 bd_id;
2109     u64 mac;
2110     u32 sw_if_index;
2111     u8 static_mac;
2112     u8 filter_mac;
2113     u8 bvi_mac;
2114 };
2115
2116 /** \brief Dump l2 fib (aka bridge domain) table
2117     @param client_index - opaque cookie to identify the sender
2118     @param bd_id - the l2 fib / bridge domain table identifier
2119 */
2120 manual_java define l2_fib_table_dump {
2121     u32 client_index;
2122     u32 context;
2123     u32 bd_id;
2124 };
2125
2126 define nsh_vxlan_gpe_add_del_tunnel {
2127     u32 client_index;
2128     u32 context;
2129     u32 src;
2130     u32 dst;
2131     u32 encap_vrf_id;
2132     u32 decap_vrf_id;
2133     u32 decap_next_index;
2134     u32 vni;
2135     u8 tlv_len_in_words;
2136     u8 is_add;
2137     u8 ver_o_c;
2138     u8 length;
2139     u8 md_type;
2140     u8 next_protocol;
2141     /* in network byte order */
2142     u32 spi_si;
2143     u32 c1;
2144     u32 c2;
2145     u32 c3;
2146     u32 c4;
2147     u32 tlvs[0];
2148 };
2149
2150 define nsh_vxlan_gpe_add_del_tunnel_reply {
2151     u32 context;
2152     i32 retval;
2153     u32 sw_if_index;
2154 };
2155
2156 define lisp_gpe_add_del_tunnel {
2157     u32 client_index;
2158     u32 context;
2159     u32 src;
2160     u32 dst;
2161     u32 encap_vrf_id;
2162     u32 decap_vrf_id;
2163     u32 decap_next_index;
2164     u8 is_add;
2165     u8 flags;
2166     u8 ver_res;
2167     u8 res;
2168     u8 next_protocol;
2169     /* in network byte order */
2170     u32 iid;
2171 };
2172
2173 define lisp_gpe_add_del_tunnel_reply {
2174     u32 context;
2175     i32 retval;
2176     u32 sw_if_index;
2177 };
2178
2179 /* Gross kludge, DGMS */
2180 define interface_name_renumber {
2181     u32 client_index;
2182     u32 context;
2183     u32 sw_if_index;
2184     u32 new_show_dev_instance;
2185 };
2186
2187 define interface_name_renumber_reply {
2188     u32 context;
2189     i32 retval;
2190 };
2191
2192 /** \brief Register for ip4 arp resolution events
2193     @param client_index - opaque cookie to identify the sender
2194     @param context - sender context, to match reply w/ request
2195     @param enable_disable - 1 => register for events, 0 => cancel registration
2196     @param pid - sender's pid
2197     @param address - the exact ip4 address of interest
2198 */
2199 define want_ip4_arp_events {
2200     u32 client_index;
2201     u32 context;
2202     u8 enable_disable;
2203     u32 pid;
2204     u32 address;
2205 };
2206
2207 /** \brief Reply for interface events registration
2208     @param context - returned sender context, to match reply w/ request
2209     @param retval - return code
2210 */
2211 define want_ip4_arp_events_reply {
2212     u32 context;
2213     i32 retval;
2214 };
2215
2216 /** \brief Tell client about an ip4 arp resolution event
2217     @param client_index - opaque cookie to identify the sender
2218     @param context - sender context, to match reply w/ request
2219     @param address - the exact ip4 address of interest
2220     @param pid - client pid registered to receive notification
2221     @param sw_if_index - interface which received ARP packet
2222     @param new_mac - the new mac address 
2223 */
2224 define ip4_arp_event {
2225     u32 client_index;
2226     u32 context;
2227     u32 address;
2228     u32 pid;
2229     u32 sw_if_index;
2230     u8 new_mac[6];
2231 };
2232     
2233 /** \brief L2 bridge domain add or delete request
2234     @param client_index - opaque cookie to identify the sender
2235     @param context - sender context, to match reply w/ request
2236     @param bd_id - the bridge domain to create
2237     @param flood - enable/disable bcast/mcast flooding in the bd
2238     @param uu_flood - enable/disable uknown unicast flood in the bd
2239     @param forward - enable/disable forwarding on all interfaces in the bd
2240     @param learn - enable/disable learning on all interfaces in the bd
2241     @param arp_term - enable/disable arp termination in the bd
2242     @param is_add - add or delete flag
2243 */
2244 define bridge_domain_add_del {
2245     u32 client_index;
2246     u32 context;
2247     u32 bd_id;
2248     u8 flood;
2249     u8 uu_flood;
2250     u8 forward;
2251     u8 learn;
2252     u8 arp_term;
2253     u8 is_add;
2254 };
2255
2256 /** \brief L2 bridge domain add or delete response
2257     @param context - sender context, to match reply w/ request
2258     @param retval - return code for the set bridge flags request
2259 */
2260 define bridge_domain_add_del_reply {
2261     u32 context;
2262     u32 retval;
2263 };
2264
2265 /** \brief L2 bridge domain request operational state details
2266     @param client_index - opaque cookie to identify the sender
2267     @param context - sender context, to match reply w/ request
2268     @param bd_id - the bridge domain id desired or ~0 to request all bds
2269 */
2270 manual_java define bridge_domain_dump {
2271     u32 client_index;
2272     u32 context;
2273     u32 bd_id;
2274 };
2275
2276 /** \brief L2 bridge domain operational state response
2277     @param bd_id - the bridge domain id
2278     @param flood - bcast/mcast flooding state on all interfaces in the bd
2279     @param uu_flood - uknown unicast flooding state on all interfaces in the bd
2280     @param forward - forwarding state on all interfaces in the bd
2281     @param learn - learning state on all interfaces in the bd
2282     @param arp_term - arp termination state on all interfaces in the bd
2283     @param n_sw_ifs - number of sw_if_index's in the domain
2284 */
2285 manual_java define bridge_domain_details {
2286     u32 context;
2287     u32 bd_id;
2288     u8 flood;
2289     u8 uu_flood;
2290     u8 forward;
2291     u8 learn;
2292     u8 arp_term;
2293     u32 bvi_sw_if_index;
2294     u32 n_sw_ifs;
2295 };
2296
2297 /** \brief L2 bridge domain sw interface operational state response
2298     @param bd_id - the bridge domain id
2299     @param sw_if_index - sw_if_index in the domain
2300     @param shg - split horizon group for the interface
2301 */
2302 manual_java define bridge_domain_sw_if_details {
2303     u32 context;
2304     u32 bd_id;
2305     u32 sw_if_index;
2306     u8 shg;
2307 };
2308
2309 /** \brief DHCP Client config add / del request
2310     @param client_index - opaque cookie to identify the sender
2311     @param context - sender context, to match reply w/ request
2312     @param sw_if_index - index of the interface for DHCP client
2313     @param hostname - hostname
2314     @param is_add - add the config if non-zero, else delete
2315     @param want_dhcp_event - DHCP event sent to the sender
2316            via dhcp_compl_event API message if non-zero
2317     @param pid - sender's pid
2318 */
2319 define dhcp_client_config {
2320     u32 client_index;
2321     u32 context;
2322     u32 sw_if_index;
2323     u8 hostname[64];
2324     u8 is_add;
2325     u8 want_dhcp_event;
2326     u32 pid;
2327 };
2328
2329 /** \brief DHCP Client config response
2330     @param context - sender context, to match reply w/ request
2331     @param retval - return code for the request
2332 */
2333 define dhcp_client_config_reply {
2334     u32 context;
2335     i32 retval;
2336 };
2337
2338 /** \brief Set/unset input ACL interface
2339     @param client_index - opaque cookie to identify the sender
2340     @param context - sender context, to match reply w/ request
2341     @param sw_if_index - interface to set/unset input ACL
2342     @param ip4_table_index - ip4 classify table index (~0 for skip)
2343     @param ip6_table_index - ip6 classify table index (~0 for skip)
2344     @param l2_table_index  -  l2 classify table index (~0 for skip)
2345     @param is_add - Set input ACL if non-zero, else unset
2346     Note: User is recommeneded to use just one valid table_index per call.
2347           (ip4_table_index, ip6_table_index, or l2_table_index)
2348 */
2349 define input_acl_set_interface {
2350     u32 client_index;
2351     u32 context;
2352     u32 sw_if_index;
2353     u32 ip4_table_index;
2354     u32 ip6_table_index;
2355     u32 l2_table_index;
2356     u8  is_add;
2357 };
2358
2359 /** \brief Set/unset input ACL interface response
2360     @param context - sender context, to match reply w/ request
2361     @param retval - return code for the request
2362 */
2363 define input_acl_set_interface_reply {
2364     u32 context;
2365     i32 retval;
2366 };
2367
2368 /** \brief IPsec: Add/delete Security Policy Database
2369     @param client_index - opaque cookie to identify the sender
2370     @param context - sender context, to match reply w/ request
2371     @param is_add - add SPD if non-zero, else delete
2372     @param spd_id - SPD instance id (control plane allocated)
2373 */
2374
2375 define ipsec_spd_add_del {
2376     u32 client_index;
2377     u32 context;
2378     u8 is_add;
2379     u32 spd_id;
2380 };
2381
2382 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
2383     @param context - returned sender context, to match reply w/ request
2384     @param retval - return code
2385 */
2386
2387 define ipsec_spd_add_del_reply {
2388     u32 context;
2389     i32 retval;
2390 };
2391
2392 /** \brief IPsec: Add/delete SPD from interface
2393
2394     @param client_index - opaque cookie to identify the sender
2395     @param context - sender context, to match reply w/ request
2396     @param is_add - add security mode if non-zero, else delete
2397     @param sw_if_index - index of the interface
2398     @param spd_id - SPD instance id to use for lookups
2399 */
2400
2401
2402 define ipsec_interface_add_del_spd {
2403     u32 client_index;
2404     u32 context;
2405
2406     u8 is_add;
2407     u32 sw_if_index;
2408     u32 spd_id;
2409 };
2410
2411 /** \brief Reply for IPsec: Add/delete SPD from interface
2412     @param context - returned sender context, to match reply w/ request
2413     @param retval - return code
2414 */
2415
2416 define ipsec_interface_add_del_spd_reply {
2417     u32 context;
2418     i32 retval;
2419 };
2420
2421 /** \brief IPsec: Add/delete Security Policy Database entry
2422
2423     See RFC 4301, 4.4.1.1 on how to match packet to selectors
2424
2425     @param client_index - opaque cookie to identify the sender
2426     @param context - sender context, to match reply w/ request
2427     @param is_add - add SPD if non-zero, else delete
2428     @param spd_id - SPD instance id (control plane allocated)
2429     @param priority - priority of SPD entry (non-unique value).  Used to order SPD matching - higher priorities match before lower
2430     @param is_outbound - entry applies to outbound traffic if non-zero, otherwise applies to inbound traffic
2431     @param is_ipv6 - remote/local address are IPv6 if non-zero, else IPv4
2432     @param remote_address_start - start of remote address range to match
2433     @param remote_address_stop - end of remote address range to match
2434     @param local_address_start - start of local address range to match
2435     @param local_address_stop - end of local address range to match
2436     @param protocol - protocol type to match [0 means any]
2437     @param remote_port_start - start of remote port range to match ...
2438     @param remote_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
2439     @param local_port_start - start of local port range to match ...
2440     @param local_port_stop - end of remote port range to match [0 to 65535 means ANY, 65535 to 0 means OPAQUE]
2441     @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)
2442     @param sa_id - SAD instance id (control plane allocated)
2443
2444 */
2445
2446 define ipsec_spd_add_del_entry {
2447     u32 client_index;
2448     u32 context;
2449     u8 is_add;
2450
2451     u32 spd_id;
2452     i32 priority;
2453     u8 is_outbound;
2454
2455     // Selector
2456     u8 is_ipv6;
2457     u8 is_ip_any;
2458     u8 remote_address_start[16];
2459     u8 remote_address_stop[16];
2460     u8 local_address_start[16];
2461     u8 local_address_stop[16];
2462
2463     u8 protocol;
2464
2465     u16 remote_port_start;
2466     u16 remote_port_stop;
2467     u16 local_port_start;
2468     u16 local_port_stop;
2469
2470     // Policy
2471     u8 policy;
2472     u32 sa_id;
2473 };
2474
2475 /** \brief Reply for IPsec: Add/delete Security Policy Database entry
2476     @param context - returned sender context, to match reply w/ request
2477     @param retval - return code
2478 */
2479
2480 define ipsec_spd_add_del_entry_reply {
2481     u32 context;
2482     i32 retval;
2483 };
2484
2485 /** \brief IPsec: Add/delete Security Association Database entry
2486     @param client_index - opaque cookie to identify the sender
2487     @param context - sender context, to match reply w/ request
2488     @param is_add - add SAD entry if non-zero, else delete
2489
2490     @param sad_id - sad id
2491
2492     @param spi - security parameter index
2493
2494     @param protocol - 0 = AH, 1 = ESP
2495
2496     @param crypto_algorithm - 0 = Null, 1 = AES-CBC-128, 2 = AES-CBC-192, 3 = AES-CBC-256, 4 = 3DES-CBC
2497     @param crypto_key_length - length of crypto_key in bytes
2498     @param crypto_key - crypto keying material
2499
2500     @param integrity_algorithm - 0 = None, 1 = MD5-96, 2 = SHA1-96, 3 = SHA-256, 4 = SHA-384, 5=SHA-512
2501     @param integrity_key_length - length of integrity_key in bytes
2502     @param integrity_key - integrity keying material
2503
2504     @param use_extended_sequence_number - use ESN when non-zero
2505
2506     @param is_tunnel - IPsec tunnel mode if non-zero, else transport mode
2507     @param is_tunnel_ipv6 - IPsec tunnel mode is IPv6 if non-zero, else IPv4 tunnel only valid if is_tunnel is non-zero
2508     @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
2509     @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
2510
2511     To be added:
2512      Anti-replay
2513      IPsec tunnel address copy mode (to support GDOI)
2514  */
2515
2516 define ipsec_sad_add_del_entry {
2517     u32 client_index;
2518     u32 context;
2519     u8 is_add;
2520
2521     u32 sad_id;
2522
2523     u32 spi;
2524
2525     u8 protocol;
2526
2527     u8 crypto_algorithm;
2528     u8 crypto_key_length;
2529     u8 crypto_key[128];
2530
2531     u8 integrity_algorithm;
2532     u8 integrity_key_length;
2533     u8 integrity_key[128];
2534
2535     u8 use_extended_sequence_number;
2536
2537     u8 is_tunnel;
2538     u8 is_tunnel_ipv6;
2539     u8 tunnel_src_address[16];
2540     u8 tunnel_dst_address[16];
2541 };
2542
2543 /** \brief Reply for IPsec: Add/delete Security Association Database entry
2544     @param context - returned sender context, to match reply w/ request
2545     @param retval - return code
2546 */
2547
2548 define ipsec_sad_add_del_entry_reply {
2549     u32 context;
2550     i32 retval;
2551 };
2552
2553 /** \brief IPsec: Update Security Association keys
2554     @param client_index - opaque cookie to identify the sender
2555     @param context - sender context, to match reply w/ request
2556
2557     @param sa_id - sa id
2558
2559     @param crypto_key_length - length of crypto_key in bytes
2560     @param crypto_key - crypto keying material
2561
2562     @param integrity_key_length - length of integrity_key in bytes
2563     @param integrity_key - integrity keying material
2564 */
2565
2566 define ipsec_sa_set_key {
2567     u32 client_index;
2568     u32 context;
2569
2570     u32 sa_id;
2571
2572     u8 crypto_key_length;
2573     u8 crypto_key[128];
2574
2575     u8 integrity_key_length;
2576     u8 integrity_key[128];
2577 };
2578
2579 /** \brief Reply for IPsec: Update Security Association keys
2580     @param context - returned sender context, to match reply w/ request
2581     @param retval - return code
2582 */
2583
2584 define ipsec_sa_set_key_reply {
2585     u32 context;
2586     i32 retval;
2587 };
2588
2589 /** \brief Tell client about a DHCP completion event
2590     @param client_index - opaque cookie to identify the sender
2591     @param pid - client pid registered to receive notification
2592     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
2593     @param host_address - Host IP address
2594     @param router_address - Router IP address
2595     @param host_mac - Host MAC address
2596 */
2597 manual_java define dhcp_compl_event {
2598     u32 client_index;
2599     u32 pid;
2600     u8 hostname[64];
2601     u8 is_ipv6;
2602     u8 host_address[16];
2603     u8 router_address[16];
2604     u8 host_mac[6];
2605 };
2606
2607 /** \brief Add MAP domains
2608     @param client_index - opaque cookie to identify the sender
2609     @param context - sender context, to match reply w/ request
2610     @param ip6_prefix - Rule IPv6 prefix
2611     @param ip4_prefix - Rule IPv4 prefix
2612     @param ip6_src - MAP domain IPv6 BR address / Tunnel source
2613     @param ip6_prefix_len - Rule IPv6 prefix length
2614     @param ip4_prefix_len - Rule IPv4 prefix length
2615     @param ea_bits_len - Embedded Address bits length
2616     @param psid_offset - Port Set Identifider (PSID) offset
2617     @param psid_length - PSID length
2618     @param is_translation - MAP-E / MAP-T
2619     @param mtu - MTU
2620 */
2621 define map_add_domain {
2622   u32 client_index;
2623   u32 context;
2624   u8 ip6_prefix[16];
2625   u8 ip4_prefix[4];
2626   u8 ip6_src[16];
2627   u8 ip6_prefix_len;
2628   u8 ip4_prefix_len;
2629   u8 ip6_src_prefix_len;
2630   u8 ea_bits_len;
2631   u8 psid_offset;
2632   u8 psid_length;
2633   u8 is_translation;
2634   u16 mtu;
2635 };
2636
2637 /** \brief Reply for MAP domain add
2638     @param context - returned sender context, to match reply w/ request
2639     @param index - MAP domain index
2640     @param retval - return code
2641 */
2642 define map_add_domain_reply {
2643   u32 context;
2644   u32 index;
2645   i32 retval;
2646 };
2647
2648 /** \brief Delete MAP domain
2649     @param client_index - opaque cookie to identify the sender
2650     @param context - sender context, to match reply w/ request
2651     @param index - MAP Domain index
2652 */
2653 define map_del_domain {
2654   u32 client_index;
2655   u32 context;
2656   u32 index;
2657 };
2658
2659 /** \brief Reply for MAP domain del
2660     @param context - returned sender context, to match reply w/ request
2661     @param retval - return code
2662 */
2663 define map_del_domain_reply {
2664   u32 context;
2665   i32 retval;
2666 };
2667
2668 /** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
2669     @param client_index - opaque cookie to identify the sender
2670     @param context - sender context, to match reply w/ request
2671     @param index - MAP Domain index
2672     @param is_add - If 1 add rule, if 0 delete rule
2673     @param ip6_dst - MAP CE IPv6 address
2674     @param psid - Rule PSID
2675 */
2676 define map_add_del_rule {
2677   u32 client_index;
2678   u32 context;
2679   u32 index;
2680   u32 is_add;
2681   u8 ip6_dst[16];
2682   u16 psid;
2683 };
2684
2685 /** \brief Reply for MAP rule add/del
2686     @param context - returned sender context, to match reply w/ request
2687     @param retval - return code
2688 */
2689 define map_add_del_rule_reply {
2690   u32 context;
2691   i32 retval;
2692 };
2693
2694 /** \brief Get list of map domains
2695     @param client_index - opaque cookie to identify the sender
2696 */
2697 define map_domain_dump {
2698   u32 client_index;
2699   u32 context;
2700 };
2701
2702 manual_java define map_domain_details {
2703   u32 domain_index;
2704   u8 ip6_prefix[16];
2705   u8 ip4_prefix[4];
2706   u8 ip6_src[16];
2707   u8 ip6_prefix_len;
2708   u8 ip4_prefix_len;
2709   u8 ip6_src_len;
2710   u8 ea_bits_len;
2711   u8 psid_offset;
2712   u8 psid_length;
2713   u8 flags;
2714   u16 mtu;
2715   u8 is_translation;
2716 };
2717
2718 define map_rule_dump {
2719   u32 client_index;
2720   u32 context;
2721   u32 domain_index;
2722 };
2723
2724 manual_java define map_rule_details {
2725   u8 ip6_dst[16];
2726   u16 psid;
2727 };
2728
2729 /** \brief Request for a single block of summary stats
2730     @param client_index - opaque cookie to identify the sender
2731     @param context - sender context, to match reply w/ request
2732 */
2733 define map_summary_stats {
2734     u32 client_index;
2735     u32 context;
2736 };
2737
2738 /** \brief Reply for map_summary_stats request
2739     @param context - sender context, to match reply w/ request
2740     @param retval - return code for request
2741     @param total_bindings -  
2742     @param total_pkts -  
2743     @param total_ip4_fragments -
2744     @param total_security_check - 
2745 */
2746 define map_summary_stats_reply {
2747     u32 context;
2748     i32 retval;
2749     u64 total_bindings;
2750     u64 total_pkts[2];
2751     u64 total_bytes[2];
2752     u64 total_ip4_fragments;
2753     u64 total_security_check[2];
2754 };
2755
2756 /** \brief cop: enable/disable junk filtration features on an interface
2757     @param client_index - opaque cookie to identify the sender
2758     @param context - sender context, to match reply w/ request
2759     @param sw_if_inded - desired interface
2760     @param enable_disable - 1 => enable, 0 => disable
2761 */
2762
2763 define cop_interface_enable_disable {
2764     u32 client_index;
2765     u32 context;
2766     u32 sw_if_index;
2767     u8 enable_disable;
2768 };
2769
2770 /** \brief cop: interface enable/disable junk filtration reply
2771     @param context - returned sender context, to match reply w/ request
2772     @param retval - return code
2773 */
2774
2775 define cop_interface_enable_disable_reply {
2776     u32 context;
2777     i32 retval;
2778 };
2779
2780 /** \brief cop: enable/disable whitelist filtration features on an interface
2781     Note: the supplied fib_id must match in order to remove the feature!
2782     
2783     @param client_index - opaque cookie to identify the sender
2784     @param context - sender context, to match reply w/ request
2785     @param sw_if_index - interface handle, physical interfaces only
2786     @param fib_id - fib identifier for the whitelist / blacklist fib
2787     @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration
2788     @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration
2789     @param default_cop -  1 => enable non-ip4, non-ip6 filtration 0=> disable it
2790 */
2791
2792 define cop_whitelist_enable_disable {
2793     u32 client_index;
2794     u32 context;
2795     u32 sw_if_index;
2796     u32 fib_id;
2797     u8 ip4;
2798     u8 ip6;
2799     u8 default_cop;
2800 };
2801
2802 /** \brief cop: interface enable/disable junk filtration reply
2803     @param context - returned sender context, to match reply w/ request
2804     @param retval - return code
2805 */
2806
2807 define cop_whitelist_enable_disable_reply {
2808     u32 context;
2809     i32 retval;
2810 };
2811
2812 /** \brief get_node_graph - get a copy of the vpp node graph
2813     including the current set of graph arcs.
2814
2815     @param client_index - opaque cookie to identify the sender
2816     @param context - sender context, to match reply w/ request
2817 */
2818
2819 define get_node_graph {
2820     u32 client_index;
2821     u32 context;
2822 };
2823
2824 /** \brief get_node_graph_reply
2825     @param context - returned sender context, to match reply w/ request
2826     @param retval - return code
2827     @param reply_in_shmem - result from vlib_node_serialize, in shared
2828     memory. Process with vlib_node_unserialize, remember to switch
2829     heaps and free the result.
2830 */
2831
2832 define get_node_graph_reply {
2833     u32 context;
2834     i32 retval;
2835     u64 reply_in_shmem;
2836 };