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