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