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