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