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