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