Reorganize source tree to use single autotools instance
[vpp.git] / src / 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  * IPSEC-GRE APIs: see .../vnet/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
38  * LISP APIs: see .../vnet/vnet/lisp/{lisp.api, lisp_api.c}
39  * LISP-GPE APIs: see .../vnet/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
40  */
41
42 /** \brief Create a new subinterface with the given vlan id
43     @param client_index - opaque cookie to identify the sender
44     @param context - sender context, to match reply w/ request
45     @param sw_if_index - software index of the new vlan's parent interface
46     @param vlan_id - vlan tag of the new interface
47 */
48 define create_vlan_subif
49 {
50   u32 client_index;
51   u32 context;
52   u32 sw_if_index;
53   u32 vlan_id;
54 };
55
56 /** \brief Reply for the vlan subinterface create request
57     @param context - returned sender context, to match reply w/ request
58     @param retval - return code
59     @param sw_if_index - software index allocated for the new subinterface
60 */
61 define create_vlan_subif_reply
62 {
63   u32 context;
64   i32 retval;
65   u32 sw_if_index;
66 };
67
68 /** \brief Enable or Disable MPLS on and interface
69     @param client_index - opaque cookie to identify the sender
70     @param context - sender context, to match reply w/ request
71     @param sw_if_index - index of the interface
72     @param enable - if non-zero enable, else disable
73 */
74 define sw_interface_set_mpls_enable
75 {
76   u32 client_index;
77   u32 context;
78   u32 sw_if_index;
79   u8 enable;
80 };
81
82 /** \brief Reply for MPLS state on an interface
83     @param context - returned sender context, to match reply w/ request
84     @param retval - return code
85 */
86 define sw_interface_set_mpls_enable_reply
87 {
88   u32 context;
89   i32 retval;
90 };
91
92 /** \brief MPLS Route Add / del route
93     @param client_index - opaque cookie to identify the sender
94     @param context - sender context, to match reply w/ request
95     @param mr_label - The MPLS label value
96     @param mr_eos - The End of stack bit
97     @param mr_table_id - The MPLS table-id the route is added in
98     @param mr_classify_table_index - If this is a classify route, 
99                                      this is the classify table index
100     @param  mr_create_table_if_needed - If the MPLS or IP tables do not exist,
101                                         create them
102     @param mr_is_add - Is this a route add or delete
103     @param mr_is_classify - Is this route result a classify
104     @param mr_is_multipath - Is this route update a multipath - i.e. is this
105                              a path addition to an existing route
106     @param mr_is_resolve_host - Recurse resolution constraint via a host prefix
107     @param mr_is_resolve_attached - Recurse resolution constraint via attached prefix
108     @param mr_next_hop_proto_is_ip4 - The next-hop is IPV4
109     @param mr_next_hop_weight - The weight, for UCMP
110     @param mr_next_hop[16] - the nextop address
111     @param mr_next_hop_sw_if_index - the next-hop SW interface
112     @param mr_next_hop_table_id - the next-hop table-id (if appropriate)
113     @param mr_next_hop_n_out_labels - the number of labels in the label stack
114     @param mr_next_hop_out_label_stack - the next-hop output label stack, outer most first
115     @param next_hop_via_label - The next-hop is a resolved via a local label
116 */
117 define mpls_route_add_del
118 {
119   u32 client_index;
120   u32 context;
121   u32 mr_label;
122   u8 mr_eos;
123   u32 mr_table_id;
124   u32 mr_classify_table_index;
125   u8 mr_create_table_if_needed;
126   u8 mr_is_add;
127   u8 mr_is_classify;
128   u8 mr_is_multipath;
129   u8 mr_is_resolve_host;
130   u8 mr_is_resolve_attached;
131   u8 mr_next_hop_proto_is_ip4;
132   u8 mr_next_hop_weight;
133   u8 mr_next_hop[16];
134   u8 mr_next_hop_n_out_labels;
135   u32 mr_next_hop_sw_if_index;
136   u32 mr_next_hop_table_id;
137   u32 mr_next_hop_via_label;
138   u32 mr_next_hop_out_label_stack[mr_next_hop_n_out_labels];
139 };
140
141 /** \brief Reply for MPLS route add / del request
142     @param context - returned sender context, to match reply w/ request
143     @param retval - return code
144 */
145 define mpls_route_add_del_reply
146 {
147   u32 context;
148   i32 retval;
149 };
150
151 /** \brief Dump MPLS fib table
152     @param client_index - opaque cookie to identify the sender
153 */
154 define mpls_fib_dump
155 {
156   u32 client_index;
157   u32 context;
158 };
159
160 /** \brief FIB path
161     @param sw_if_index - index of the interface
162     @param weight - The weight, for UCMP
163     @param is_local - local if non-zero, else remote
164     @param is_drop - Drop the packet
165     @param is_unreach - Drop the packet and rate limit send ICMP unreachable
166     @param is_prohibit - Drop the packet and rate limit send ICMP prohibited
167     @param afi - the afi of the next hop, IP46_TYPE_IP4=1, IP46_TYPE_IP6=2
168     @param next_hop[16] - the next hop address
169
170     WARNING: this type is replicated, pending cleanup completion
171
172 */
173 typeonly manual_print manual_endian define fib_path2
174 {
175   u32 sw_if_index;
176   u32 weight;
177   u8 is_local;
178   u8 is_drop;
179   u8 is_unreach;
180   u8 is_prohibit;
181   u8 afi;
182   u8 next_hop[16];
183 };
184
185 /** \brief mpls FIB table response
186     @param table_id - MPLS fib table id
187     @param s_bit - End-of-stack bit
188     @param label - MPLS label value
189     @param count - the number of fib_path in path
190     @param path  - array of of fib_path structures
191 */
192 manual_endian manual_print define mpls_fib_details
193 {
194   u32 context;
195   u32 table_id;
196   u8  eos_bit;
197   u32 label;
198   u32 count;
199   vl_api_fib_path2_t path[count];
200 };
201
202 /** \brief Bind/Unbind an MPLS local label to an IP prefix. i.e. create
203            a per-prefix label entry.
204     @param client_index - opaque cookie to identify the sender
205     @param context - sender context, to match reply w/ request
206     @param mb_mpls_table_id - The MPLS table-id the MPLS entry will be added in
207     @param mb_label - The MPLS label value to bind
208     @param mb_ip_table_id - The IP table-id of the IP prefix to bind to.
209     @param mb_create_table_if_needed - Create either/both tables if required.
210     @param mb_is_bind - Bind or unbind
211     @param mb_is_ip4 - The prefix to bind to is IPv4
212     @param mb_address_length - Length of IP prefix
213     @param mb_address[16] - IP prefix/
214 */
215 define mpls_ip_bind_unbind
216 {
217   u32 client_index;
218   u32 context;
219   u32 mb_mpls_table_id;
220   u32 mb_label;
221   u32 mb_ip_table_id;
222   u8 mb_create_table_if_needed;
223   u8 mb_is_bind;
224   u8 mb_is_ip4;
225   u8 mb_address_length;
226   u8 mb_address[16];
227 };
228
229 /** \brief Reply for MPLS IP bind/unbind request
230     @param context - returned sender context, to match reply w/ request
231     @param retval - return code
232 */
233 define mpls_ip_bind_unbind_reply
234 {
235   u32 context;
236   i32 retval;
237 };
238
239 /** \brief MPLS tunnel Add / del route
240     @param client_index - opaque cookie to identify the sender
241     @param context - sender context, to match reply w/ request
242     @param mt_is_add - Is this a route add or delete
243     @param mt_sw_if_index - The SW interface index of the tunnel to delete
244     @param mt_next_hop_proto_is_ip4 - The next-hop is IPV4
245     @param mt_next_hop_weight - The weight, for UCMP
246     @param mt_next_hop[16] - the nextop address
247     @param mt_next_hop_sw_if_index - the next-hop SW interface
248     @param mt_next_hop_table_id - the next-hop table-id (if appropriate)
249     @param mt_next_hop_n_out_labels - the number of next-hop output labels
250     @param mt_next_hop_out_label_stack - the next-hop output label stack,  outer most first
251 */
252 define mpls_tunnel_add_del
253 {
254   u32 client_index;
255   u32 context;
256   u32 mt_sw_if_index;
257   u8 mt_is_add;
258   u8 mt_l2_only;
259   u8 mt_next_hop_proto_is_ip4;
260   u8 mt_next_hop_weight;
261   u8 mt_next_hop[16];
262   u8 mt_next_hop_n_out_labels;
263   u32 mt_next_hop_sw_if_index;
264   u32 mt_next_hop_table_id;
265   u32 mt_next_hop_out_label_stack[mt_next_hop_n_out_labels];
266 };
267
268 /** \brief Reply for MPLS tunnel add / del request
269     @param context - returned sender context, to match reply w/ request
270     @param retval - return code
271     @param sw_if_index - SW interface index of the tunnel created
272 */
273 define mpls_tunnel_add_del_reply
274 {
275   u32 context;
276   i32 retval;
277   u32 sw_if_index;
278 };
279
280 /** \brief Dump mpls eth tunnel table
281     @param client_index - opaque cookie to identify the sender
282     @param tunnel_index - eth tunnel identifier or -1 in case of all tunnels
283 */
284 define mpls_tunnel_dump
285 {
286   u32 client_index;
287   u32 context;
288   i32 tunnel_index;
289 };
290
291 /** \brief mpls eth tunnel operational state response
292     @param tunnel_index - eth tunnel identifier
293     @param intfc_address - interface ipv4 addr
294     @param mask_width - interface ipv4 addr mask
295     @param hw_if_index - interface id
296     @param l2_only -
297     @param tunnel_dst_mac -
298     @param tx_sw_if_index -
299     @param encap_index - reference to mpls label table
300     @param nlabels - number of resolved labels
301     @param labels - resolved labels
302 */
303 define mpls_tunnel_details
304 {
305   u32 context;
306   u32 tunnel_index;
307   u8 mt_l2_only;
308   u8 mt_sw_if_index;
309   u8 mt_next_hop_proto_is_ip4;
310   u8 mt_next_hop[16];
311   u32 mt_next_hop_sw_if_index;
312   u32 mt_next_hop_table_id;
313   u32 mt_next_hop_n_labels;
314   u32 mt_next_hop_out_labels[mt_next_hop_n_labels];
315 };
316
317 /** \brief Proxy ARP add / del request
318     @param client_index - opaque cookie to identify the sender
319     @param context - sender context, to match reply w/ request
320     @param vrf_id - VRF / Fib table ID
321     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
322     @param low_address[4] - Low address of the Proxy ARP range
323     @param hi_address[4] - High address of the Proxy ARP range
324 */
325 define proxy_arp_add_del
326 {
327   u32 client_index;
328   u32 context;
329   u32 vrf_id;
330   u8 is_add;
331   u8 low_address[4];
332   u8 hi_address[4];
333 };
334
335 /** \brief Reply for proxy arp add / del request
336     @param context - returned sender context, to match reply w/ request
337     @param retval - return code
338 */
339 define proxy_arp_add_del_reply
340 {
341   u32 context;
342   i32 retval;
343 };
344
345 /** \brief Proxy ARP add / del request
346     @param client_index - opaque cookie to identify the sender
347     @param context - sender context, to match reply w/ request
348     @param sw_if_index - Which interface to enable / disable Proxy Arp on
349     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
350 */
351 define proxy_arp_intfc_enable_disable
352 {
353   u32 client_index;
354   u32 context;
355   u32 sw_if_index;
356   /* 1 = on, 0 = off */
357   u8 enable_disable;
358 };
359
360 /** \brief Reply for Proxy ARP interface enable / disable request
361     @param context - returned sender context, to match reply w/ request
362     @param retval - return code
363 */
364 define proxy_arp_intfc_enable_disable_reply
365 {
366   u32 context;
367   i32 retval;
368 };
369
370 /** \brief Reset VRF (remove all routes etc) request
371     @param client_index - opaque cookie to identify the sender
372     @param context - sender context, to match reply w/ request
373     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
374     @param vrf_id - ID of th FIB table / VRF to reset
375 */
376 define reset_vrf
377 {
378   u32 client_index;
379   u32 context;
380   u8 is_ipv6;
381   u32 vrf_id;
382 };
383
384 /** \brief Reply for Reset VRF request
385     @param context - returned sender context, to match reply w/ request
386     @param retval - return code
387 */
388 define reset_vrf_reply
389 {
390   u32 context;
391   i32 retval;
392 };
393
394 /** \brief Is Address Reachable request - DISABLED
395     @param client_index - opaque cookie to identify the sender
396     @param context - sender context, to match reply w/ request
397     @param next_hop_sw_if_index - index of interface used to get to next hop
398     @param is_ipv6 - 1 for IPv6, 0 for IPv4
399     @param is_error - address not found or does not match intf
400     @param address[] - Address in question 
401 */
402 define is_address_reachable
403 {
404   u32 client_index;             /* (api_main_t *) am->my_client_index */
405   u32 context;
406   u32 next_hop_sw_if_index;
407   u8 is_known;                  /* on reply, this is the answer */
408   u8 is_ipv6;
409   u8 is_error;                  /* address not found or does not match intf */
410   u8 address[16];
411 };
412
413 /** \brief Want Stats, register for stats updates
414     @param client_index - opaque cookie to identify the sender
415     @param context - sender context, to match reply w/ request
416     @param enable_disable - 1 = enable stats, 0 = disable
417     @param pid - pid of process requesting stats updates
418 */
419 define want_stats
420 {
421   u32 client_index;
422   u32 context;
423   u32 enable_disable;
424   u32 pid;
425 };
426
427 /** \brief Reply for Want Stats request
428     @param context - returned sender context, to match reply w/ request
429     @param retval - return code
430 */
431 define want_stats_reply
432 {
433   u32 context;
434   i32 retval;
435 };
436
437 typeonly manual_print manual_endian define ip4_fib_counter
438 {
439   u32 address;
440   u8 address_length;
441   u64 packets;
442   u64 bytes;
443 };
444
445 manual_print manual_endian define vnet_ip4_fib_counters
446 {
447   u32 vrf_id;
448   u32 count;
449   vl_api_ip4_fib_counter_t c[count];
450 };
451
452 typeonly manual_print manual_endian define ip6_fib_counter
453 {
454   u64 address[2];
455   u8 address_length;
456   u64 packets;
457   u64 bytes;
458 };
459
460 manual_print manual_endian define vnet_ip6_fib_counters
461 {
462   u32 vrf_id;
463   u32 count;
464   vl_api_ip6_fib_counter_t c[count];
465 };
466
467 /** \brief Request for a single block of summary stats
468     @param client_index - opaque cookie to identify the sender
469     @param context - sender context, to match reply w/ request
470 */
471 define vnet_get_summary_stats
472 {
473   u32 client_index;
474   u32 context;
475 };
476
477 /** \brief Reply for vnet_get_summary_stats request
478     @param context - sender context, to match reply w/ request
479     @param retval - return code for request
480     @param total_pkts -  
481     @param total_bytes -
482     @param vector_rate - 
483 */
484 define vnet_summary_stats_reply
485 {
486   u32 context;
487   i32 retval;
488   u64 total_pkts[2];
489   u64 total_bytes[2];
490   f64 vector_rate;
491 };
492
493 /** \brief OAM event structure
494     @param dst_address[] - 
495     @param state
496 */
497 define oam_event
498 {
499   u8 dst_address[4];
500   u8 state;
501 };
502
503 /** \brief Want OAM events request
504     @param client_index - opaque cookie to identify the sender
505     @param context - sender context, to match reply w/ request
506     @param enable_disable- enable if non-zero, else disable
507     @param pid - pid of the requesting process
508 */
509 define want_oam_events
510 {
511   u32 client_index;
512   u32 context;
513   u32 enable_disable;
514   u32 pid;
515 };
516
517 /** \brief Want OAM events response
518     @param context - sender context, to match reply w/ request
519     @param retval - return code for the want oam stats request
520 */
521 define want_oam_events_reply
522 {
523   u32 context;
524   i32 retval;
525 };
526
527 /** \brief OAM add / del target request
528     @param client_index - opaque cookie to identify the sender
529     @param context - sender context, to match reply w/ request
530     @param vrf_id - vrf_id of the target
531     @param src_address[] - source address to use for the updates 
532     @param dst_address[] - destination address of the target
533     @param is_add - add target if non-zero, else delete
534 */
535 define oam_add_del
536 {
537   u32 client_index;
538   u32 context;
539   u32 vrf_id;
540   u8 src_address[4];
541   u8 dst_address[4];
542   u8 is_add;
543 };
544
545 /** \brief OAM add / del target response
546     @param context - sender context, to match reply w/ request
547     @param retval - return code of the request
548 */
549 define oam_add_del_reply
550 {
551   u32 context;
552   i32 retval;
553 };
554
555 /** \brief Reset fib table request
556     @param client_index - opaque cookie to identify the sender
557     @param context - sender context, to match reply w/ request
558     @param vrf_id - vrf/table id of the fib table to reset
559     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
560 */
561 define reset_fib
562 {
563   u32 client_index;
564   u32 context;
565   u32 vrf_id;
566   u8 is_ipv6;
567 };
568
569 /** \brief Reset fib response
570     @param context - sender context, to match reply w/ request
571     @param retval - return code for the reset bfib request
572 */
573 define reset_fib_reply
574 {
575   u32 context;
576   i32 retval;
577 };
578
579 /** \brief DHCP Proxy config add / del request
580     @param client_index - opaque cookie to identify the sender
581     @param context - sender context, to match reply w/ request
582     @param vrf_id - vrf id
583     @param if_ipv6 - ipv6 if non-zero, else ipv4
584     @param is_add - add the config if non-zero, else delete
585     @param insert_circuit_id - option82 suboption 1 fib number
586     @param dhcp_server[] - server address
587     @param dhcp_src_address[] - <fix this, need details>
588 */
589 define dhcp_proxy_config
590 {
591   u32 client_index;
592   u32 context;
593   u32 vrf_id;
594   u8 is_ipv6;
595   u8 is_add;
596   u8 insert_circuit_id;
597   u8 dhcp_server[16];
598   u8 dhcp_src_address[16];
599 };
600
601 /** \brief DHCP Proxy config response
602     @param context - sender context, to match reply w/ request
603     @param retval - return code for the request
604 */
605 define dhcp_proxy_config_reply
606 {
607   u32 context;
608   i32 retval;
609 };
610
611 /** \brief DHCP Proxy set / unset vss request
612     @param client_index - opaque cookie to identify the sender
613     @param context - sender context, to match reply w/ request
614     @param tbl_id - table id
615     @param oui - first part of vpn id
616     @param fib_id - second part of vpn id
617     @param is_ipv6 - ip6 if non-zero, else ip4
618     @param is_add - set vss if non-zero, else delete
619 */
620 define dhcp_proxy_set_vss
621 {
622   u32 client_index;
623   u32 context;
624   u32 tbl_id;
625   u32 oui;
626   u32 fib_id;
627   u8 is_ipv6;
628   u8 is_add;
629 };
630
631 /** \brief DHCP proxy set / unset vss response
632     @param context - sender context, to match reply w/ request
633     @param retval - return code for the request
634 */
635 define dhcp_proxy_set_vss_reply
636 {
637   u32 context;
638   i32 retval;
639 };
640
641 /** \brief Create loopback interface request
642     @param client_index - opaque cookie to identify the sender
643     @param context - sender context, to match reply w/ request
644     @param mac_address - mac addr to assign to the interface if none-zero
645 */
646 define create_loopback
647 {
648   u32 client_index;
649   u32 context;
650   u8 mac_address[6];
651 };
652
653 /** \brief Create loopback interface response
654     @param context - sender context, to match reply w/ request
655     @param sw_if_index - sw index of the interface that was created
656     @param retval - return code for the request
657 */
658 define create_loopback_reply
659 {
660   u32 context;
661   i32 retval;
662   u32 sw_if_index;
663 };
664
665 /** \brief Delete loopback interface request
666     @param client_index - opaque cookie to identify the sender
667     @param context - sender context, to match reply w/ request
668     @param sw_if_index - sw index of the interface that was created
669 */
670 define delete_loopback
671 {
672   u32 client_index;
673   u32 context;
674   u32 sw_if_index;
675 };
676
677 /** \brief Delete loopback interface response
678     @param context - sender context, to match reply w/ request
679     @param retval - return code for the request
680 */
681 define delete_loopback_reply
682 {
683   u32 context;
684   i32 retval;
685 };
686
687 /** \brief Control ping from client to api server request
688     @param client_index - opaque cookie to identify the sender
689     @param context - sender context, to match reply w/ request
690 */
691 define control_ping
692 {
693   u32 client_index;
694   u32 context;
695 };
696
697 /** \brief Control ping from the client to the server response
698     @param client_index - opaque cookie to identify the sender
699     @param context - sender context, to match reply w/ request
700     @param retval - return code for the request
701     @param vpe_pid - the pid of the vpe, returned by the server
702 */
703 define control_ping_reply
704 {
705   u32 context;
706   i32 retval;
707   u32 client_index;
708   u32 vpe_pid;
709 };
710
711 /** \brief Process a vpe parser cli string request
712     @param client_index - opaque cookie to identify the sender
713     @param context - sender context, to match reply w/ request
714     @param cmd_in_shmem - pointer to cli command string
715 */
716 define cli_request
717 {
718   u32 client_index;
719   u32 context;
720   u64 cmd_in_shmem;
721 };
722 define cli_inband
723 {
724   u32 client_index;
725   u32 context;
726   u32 length;
727   u8 cmd[length];
728 };
729
730 /** \brief vpe parser cli string response
731     @param context - sender context, to match reply w/ request
732     @param retval - return code for request
733     @param reply_in_shmem - Reply string from cli processing if any
734 */
735 define cli_reply
736 {
737   u32 context;
738   i32 retval;
739   u64 reply_in_shmem;
740 };
741 define cli_inband_reply
742 {
743   u32 context;
744   i32 retval;
745   u32 length;
746   u8 reply[length];
747 };
748
749 /** \brief Set max allowed ARP or ip6 neighbor entries request
750     @param client_index - opaque cookie to identify the sender
751     @param context - sender context, to match reply w/ request
752     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
753     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
754 */
755 define set_arp_neighbor_limit
756 {
757   u32 client_index;
758   u32 context;
759   u8 is_ipv6;
760   u32 arp_neighbor_limit;
761 };
762
763 /** \brief Set max allowed ARP or ip6 neighbor entries response
764     @param context - sender context, to match reply w/ request
765     @param retval - return code for request
766 */
767 define set_arp_neighbor_limit_reply
768 {
769   u32 context;
770   i32 retval;
771 };
772
773 /** \brief L2 interface patch add / del request
774     @param client_index - opaque cookie to identify the sender
775     @param context - sender context, to match reply w/ request
776     @param rx_sw_if_index - receive side interface 
777     @param tx_sw_if_index - transmit side interface
778     @param is_add - if non-zero set up the interface patch, else remove it
779 */
780 define l2_patch_add_del
781 {
782   u32 client_index;
783   u32 context;
784   u32 rx_sw_if_index;
785   u32 tx_sw_if_index;
786   u8 is_add;
787 };
788
789 /** \brief L2 interface patch add / del response
790     @param context - sender context, to match reply w/ request
791     @param retval - return code for the request
792 */
793 define l2_patch_add_del_reply
794 {
795   u32 context;
796   i32 retval;
797 };
798
799 /** \brief IPv6 segment routing tunnel add / del request
800     @param client_index - opaque cookie to identify the sender
801     @param context - sender context, to match reply w/ request
802     @param is_add - add the tunnel if non-zero, else delete it
803     @param name[] - tunnel name (len. 64)
804     @param src_address[] -
805     @param dst_address[] -
806     @param dst_mask_width -
807     @param inner_vrf_id -
808     @param outer_vrf_id -
809     @param flags_net_byte_order -
810     @param n_segments -
811     @param n_tags -
812     @param segs_and_tags[] -
813     @param policy_name[] - name of policy to associate this tunnel to (len. 64)
814 */
815 define sr_tunnel_add_del
816 {
817   u32 client_index;
818   u32 context;
819   u8 is_add;
820   u8 name[64];
821   u8 src_address[16];
822   u8 dst_address[16];
823   u8 dst_mask_width;
824   u32 inner_vrf_id;
825   u32 outer_vrf_id;
826   u16 flags_net_byte_order;
827   u8 n_segments;
828   u8 n_tags;
829   u8 policy_name[64];
830   u8 segs_and_tags[0];
831 };
832
833 /** \brief IPv6 segment routing tunnel add / del response
834     @param context - sender context, to match reply w/ request
835     @param retval - return value for request
836 */
837 define sr_tunnel_add_del_reply
838 {
839   u32 context;
840   i32 retval;
841 };
842
843 /** \brief IPv6 segment routing policy add / del request
844     @param client_index - opaque cookie to identify the sender
845     @param context - sender context, to match reply w/ request
846     @param is_add - add the tunnel if non-zero, else delete it
847     @param name[] - policy name (len. 64)
848     @param tunnel_names[] -
849 */
850 define sr_policy_add_del
851 {
852   u32 client_index;
853   u32 context;
854   u8 is_add;
855   u8 name[64];
856   u8 tunnel_names[0];
857 };
858
859 /** \brief IPv6 segment routing policy add / del response
860     @param context - sender context, to match reply w/ request
861     @param retval - return value for request
862 */
863 define sr_policy_add_del_reply
864 {
865   u32 context;
866   i32 retval;
867 };
868
869 /** \brief IPv6 segment routing multicast map to policy add / del request
870     @param client_index - opaque cookie to identify the sender
871     @param context - sender context, to match reply w/ request
872     @param is_add - add the tunnel if non-zero, else delete it
873     @param multicast_address[] - IP6 multicast address
874     @param policy_name[] = policy name (len.64)
875 */
876 define sr_multicast_map_add_del
877 {
878   u32 client_index;
879   u32 context;
880   u8 is_add;
881   u8 multicast_address[16];
882   u8 policy_name[64];
883 };
884
885 /** \brief IPv6 segment routing multicast map to policy add / del response
886     @param context - sender context, to match reply w/ request
887     @param retval - return value for request
888 */
889 define sr_multicast_map_add_del_reply
890 {
891   u32 context;
892   i32 retval;
893 };
894
895 /** \brief Interface set vpath request
896     @param client_index - opaque cookie to identify the sender
897     @param context - sender context, to match reply w/ request
898     @param sw_if_index - interface used to reach neighbor
899     @param enable - if non-zero enable, else disable
900 */
901 define sw_interface_set_vpath
902 {
903   u32 client_index;
904   u32 context;
905   u32 sw_if_index;
906   u8 enable;
907 };
908
909 /** \brief Interface set vpath response
910     @param context - sender context, to match reply w/ request
911     @param retval - return code for the request
912 */
913 define sw_interface_set_vpath_reply
914 {
915   u32 context;
916   i32 retval;
917 };
918
919 /** \brief Set L2 XConnect between two interfaces request
920     @param client_index - opaque cookie to identify the sender
921     @param context - sender context, to match reply w/ request
922     @param rx_sw_if_index - Receive interface index
923     @param tx_sw_if_index - Transmit interface index
924     @param enable - enable xconnect if not 0, else set to L3 mode
925 */
926 define sw_interface_set_l2_xconnect
927 {
928   u32 client_index;
929   u32 context;
930   u32 rx_sw_if_index;
931   u32 tx_sw_if_index;
932   u8 enable;
933 };
934
935 /** \brief Set L2 XConnect response
936     @param context - sender context, to match reply w/ request
937     @param retval - L2 XConnect request return code
938 */
939 define sw_interface_set_l2_xconnect_reply
940 {
941   u32 context;
942   i32 retval;
943 };
944
945 /** \brief Interface bridge mode request
946     @param client_index - opaque cookie to identify the sender
947     @param context - sender context, to match reply w/ request
948     @param rx_sw_if_index - the interface
949     @param bd_id - bridge domain id
950     @param bvi - Setup interface as a bvi, bridge mode only
951     @param shg - Shared horizon group, for bridge mode only
952     @param enable - Enable beige mode if not 0, else set to L3 mode
953 */
954 define sw_interface_set_l2_bridge
955 {
956   u32 client_index;
957   u32 context;
958   u32 rx_sw_if_index;
959   u32 bd_id;
960   u8 shg;
961   u8 bvi;
962   u8 enable;
963 };
964
965 /** \brief Interface bridge mode response
966     @param context - sender context, to match reply w/ request
967     @param retval - Bridge mode request return code
968 */
969 define sw_interface_set_l2_bridge_reply
970 {
971   u32 context;
972   i32 retval;
973 };
974
975 /** \brief L2 FIB add entry request
976     @param client_index - opaque cookie to identify the sender
977     @param context - sender context, to match reply w/ request
978     @param mac - the entry's mac address
979     @param bd_id - the entry's bridge domain id
980     @param sw_if_index - the interface
981     @param is_add - If non zero add the entry, else delete it
982     @param static_mac - 
983     @param filter_mac -
984 */
985 define l2fib_add_del
986 {
987   u32 client_index;
988   u32 context;
989   u64 mac;
990   u32 bd_id;
991   u32 sw_if_index;
992   u8 is_add;
993   u8 static_mac;
994   u8 filter_mac;
995   u8 bvi_mac;
996 };
997
998 /** \brief L2 FIB add entry response
999     @param context - sender context, to match reply w/ request
1000     @param retval - return code for the add l2fib entry request
1001 */
1002 define l2fib_add_del_reply
1003 {
1004   u32 context;
1005   i32 retval;
1006 };
1007
1008 /** \brief Set L2 flags request !!! TODO - need more info, feature bits in l2_input.h
1009     @param client_index - opaque cookie to identify the sender
1010     @param context - sender context, to match reply w/ request
1011     @param sw_if_index - interface 
1012     @param is_set - if non-zero, set the bits, else clear them
1013     @param feature_bitmap - non-zero bits to set or clear
1014 */
1015 define l2_flags
1016 {
1017   u32 client_index;
1018   u32 context;
1019   u32 sw_if_index;
1020   u8 is_set;
1021   u32 feature_bitmap;
1022 };
1023
1024 /** \brief Set L2 bits response
1025     @param context - sender context, to match reply w/ request
1026     @param retval - return code for the set l2 bits request
1027 */
1028 define l2_flags_reply
1029 {
1030   u32 context;
1031   i32 retval;
1032   u32 resulting_feature_bitmap;
1033 };
1034
1035 /** \brief Set bridge flags (such as L2_LEARN, L2_FWD, L2_FLOOD, 
1036     L2_UU_FLOOD, or L2_ARP_TERM) request
1037     @param client_index - opaque cookie to identify the sender
1038     @param context - sender context, to match reply w/ request
1039     @param bd_id - the bridge domain to set the flags for
1040     @param is_set - if non-zero, set the flags, else clear them
1041     @param feature_bitmap - bits that are non-zero to set or clear
1042 */
1043 define bridge_flags
1044 {
1045   u32 client_index;
1046   u32 context;
1047   u32 bd_id;
1048   u8 is_set;
1049   u32 feature_bitmap;
1050 };
1051
1052 /** \brief Set bridge flags response
1053     @param context - sender context, to match reply w/ request
1054     @param retval - return code for the set bridge flags request
1055     @param resulting_feature_bitmap - the feature bitmap value after the request is implemented
1056 */
1057 define bridge_flags_reply
1058 {
1059   u32 context;
1060   i32 retval;
1061   u32 resulting_feature_bitmap;
1062 };
1063
1064 /** \brief Set bridge domain ip to mac entry request
1065     @param client_index - opaque cookie to identify the sender
1066     @param context - sender context, to match reply w/ request
1067     @param bd_id - the bridge domain to set the flags for
1068     @param is_add - if non-zero, add the entry, else clear it
1069     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
1070     @param mac_address - MAC address
1071     @param 
1072 */
1073 define bd_ip_mac_add_del
1074 {
1075   u32 client_index;
1076   u32 context;
1077   u32 bd_id;
1078   u8 is_add;
1079   u8 is_ipv6;
1080   u8 ip_address[16];
1081   u8 mac_address[6];
1082 };
1083
1084 /** \brief Set bridge domain ip to mac entry response
1085     @param context - sender context, to match reply w/ request
1086     @param retval - return code for the set bridge flags request
1087 */
1088 define bd_ip_mac_add_del_reply
1089 {
1090   u32 context;
1091   i32 retval;
1092 };
1093
1094 /** \brief Add/Delete classification table request
1095     @param client_index - opaque cookie to identify the sender
1096     @param context - sender context, to match reply w/ request
1097     @param is_add- if non-zero add the table, else delete it
1098     @param del_chain - if non-zero delete the whole chain of tables
1099     @param table_index - if add, reuturns index of the created table, else specifies the table to delete  
1100     @param nbuckets - number of buckets when adding a table
1101     @param memory_size - memory size when adding a table
1102     @param match_n_vectors - number of match vectors
1103     @param next_table_index - index of next table
1104     @param miss_next_index - index of miss table
1105     @param current_data_flag - option to use current node's packet payload
1106             as the starting point from where packets are classified,
1107             This option is only valid for L2/L3 input ACL for now.
1108             0: by default, classify data from the buffer's start location
1109             1: classify packets from VPP node’s current data pointer
1110     @param current_data_offset - a signed value to shift the start location of
1111             the packet to be classified
1112             For example, if input IP ACL node is used, L2 header’s first byte
1113             can be accessible by configuring current_data_offset to -14
1114             if there is no vlan tag.
1115             This is valid only if current_data_flag is set to 1.
1116     @param mask[] - match mask
1117 */
1118 define classify_add_del_table
1119 {
1120   u32 client_index;
1121   u32 context;
1122   u8 is_add;
1123   u8 del_chain;
1124   u32 table_index;
1125   u32 nbuckets;
1126   u32 memory_size;
1127   u32 skip_n_vectors;
1128   u32 match_n_vectors;
1129   u32 next_table_index;
1130   u32 miss_next_index;
1131   u32 current_data_flag;
1132   i32 current_data_offset;
1133   u8 mask[0];
1134 };
1135
1136 /** \brief Add/Delete classification table response
1137     @param context - sender context, to match reply w/ request
1138     @param retval - return code for the table add/del requst
1139     @param new_table_index - for add, returned index of the new table
1140     @param skip_n_vectors - for add, returned value of skip_n_vectors in table
1141     @param match_n_vectors -for add, returned value of match_n_vectors in table
1142 */
1143 define classify_add_del_table_reply
1144 {
1145   u32 context;
1146   i32 retval;
1147   u32 new_table_index;
1148   u32 skip_n_vectors;
1149   u32 match_n_vectors;
1150 };
1151
1152 /** \brief Classify add / del session request
1153     @param client_index - opaque cookie to identify the sender
1154     @param context - sender context, to match reply w/ request
1155     @param is_add - add session if non-zero, else delete
1156     @param table_index - index of the table to add/del the session, required
1157     @param hit_next_index - for add, hit_next_index of new session, required
1158     @param opaque_index - for add, opaque_index of new session
1159     @param advance -for add, advance value for session
1160     @param action -
1161            0: no action (by default)
1162               metadata is not used.
1163            1: Classified IP packets will be looked up from the
1164               specified ipv4 fib table (configured by metadata as VRF id).
1165               Only valid for L3 input ACL node
1166            2: Classified IP packets will be looked up from the
1167               specified ipv6 fib table (configured by metadata as VRF id).
1168               Only valid for L3 input ACL node
1169     @param metadata - valid only if action != 0
1170            VRF id if action is 1 or 2.
1171     @param match[] - for add, match value for session, required
1172 */
1173 define classify_add_del_session
1174 {
1175   u32 client_index;
1176   u32 context;
1177   u8 is_add;
1178   u32 table_index;
1179   u32 hit_next_index;
1180   u32 opaque_index;
1181   i32 advance;
1182   u8 action;
1183   u32 metadata;
1184   u8 match[0];
1185 };
1186
1187 /** \brief Classify add / del session response
1188     @param context - sender context, to match reply w/ request
1189     @param retval - return code for the add/del session request
1190 */
1191 define classify_add_del_session_reply
1192 {
1193   u32 context;
1194   i32 retval;
1195 };
1196
1197 /** \brief Set/unset the classification table for an interface request 
1198     @param client_index - opaque cookie to identify the sender
1199     @param context - sender context, to match reply w/ request
1200     @param is_ipv6 - ipv6 if non-zero, else ipv4
1201     @param sw_if_index - interface to associate with the table
1202     @param table_index - index of the table, if ~0 unset the table
1203 */
1204 define classify_set_interface_ip_table
1205 {
1206   u32 client_index;
1207   u32 context;
1208   u8 is_ipv6;
1209   u32 sw_if_index;
1210   u32 table_index;              /* ~0 => off */
1211 };
1212
1213 /** \brief Set/unset interface classification table response 
1214     @param context - sender context, to match reply w/ request
1215     @param retval - return code
1216 */
1217 define classify_set_interface_ip_table_reply
1218 {
1219   u32 context;
1220   i32 retval;
1221 };
1222
1223 /** \brief Set/unset l2 classification tables for an interface request
1224     @param client_index - opaque cookie to identify the sender
1225     @param context - sender context, to match reply w/ request
1226     @param sw_if_index - interface to set/unset tables for
1227     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
1228     @param ip6_table_index - ip6 index
1229     @param other_table_index - other index
1230 */
1231 define classify_set_interface_l2_tables
1232 {
1233   u32 client_index;
1234   u32 context;
1235   u32 sw_if_index;
1236   /* 3 x ~0 => off */
1237   u32 ip4_table_index;
1238   u32 ip6_table_index;
1239   u32 other_table_index;
1240   u8 is_input;
1241 };
1242
1243 /** \brief Set/unset l2 classification tables for an interface response
1244     @param context - sender context, to match reply w/ request
1245     @param retval - return code for the request
1246 */
1247 define classify_set_interface_l2_tables_reply
1248 {
1249   u32 context;
1250   i32 retval;
1251 };
1252
1253 /** \brief Get node index using name request
1254     @param client_index - opaque cookie to identify the sender
1255     @param context - sender context, to match reply w/ request
1256     @param node_name[] - name of the node
1257 */
1258 define get_node_index
1259 {
1260   u32 client_index;
1261   u32 context;
1262   u8 node_name[64];
1263 };
1264
1265 /** \brief Get node index using name request
1266     @param context - sender context, to match reply w/ request
1267     @param retval - return code for the request
1268     @param node_index - index of the desired node if found, else ~0
1269 */
1270 define get_node_index_reply
1271 {
1272   u32 context;
1273   i32 retval;
1274   u32 node_index;
1275 };
1276
1277 /** \brief Set the next node for a given node request
1278     @param client_index - opaque cookie to identify the sender
1279     @param context - sender context, to match reply w/ request
1280     @param node_name[] - node to add the next node to
1281     @param next_name[] - node to add as the next node
1282 */
1283 define add_node_next
1284 {
1285   u32 client_index;
1286   u32 context;
1287   u8 node_name[64];
1288   u8 next_name[64];
1289 };
1290
1291 /** \brief IP Set the next node for a given node response
1292     @param context - sender context, to match reply w/ request
1293     @param retval - return code for the add next node request
1294     @param next_index - the index of the next node if success, else ~0
1295 */
1296 define add_node_next_reply
1297 {
1298   u32 context;
1299   i32 retval;
1300   u32 next_index;
1301 };
1302
1303 /** \brief DHCP Proxy config 2 add / del request
1304     @param client_index - opaque cookie to identify the sender
1305     @param context - sender context, to match reply w/ request
1306     @param rx_vrf_id - receive vrf id
1307     @param server_vrf_id - server vrf id
1308     @param if_ipv6 - ipv6 if non-zero, else ipv4
1309     @param is_add - add the config if non-zero, else delete
1310     @param insert_circuit_id - option82 suboption 1 fib number
1311     @param dhcp_server[] - server address
1312     @param dhcp_src_address[] - <fix this, need details>
1313 */
1314 define dhcp_proxy_config_2
1315 {
1316   u32 client_index;
1317   u32 context;
1318   u32 rx_vrf_id;
1319   u32 server_vrf_id;
1320   u8 is_ipv6;
1321   u8 is_add;
1322   u8 insert_circuit_id;
1323   u8 dhcp_server[16];
1324   u8 dhcp_src_address[16];
1325 };
1326
1327 /** \brief DHCP Proxy config 2 add / del response
1328     @param context - sender context, to match reply w/ request
1329     @param retval - return code for request
1330 */
1331 define dhcp_proxy_config_2_reply
1332 {
1333   u32 context;
1334   i32 retval;
1335 };
1336
1337 /** \brief L2 fib clear table request, clear all mac entries in the l2 fib
1338     @param client_index - opaque cookie to identify the sender
1339     @param context - sender context, to match reply w/ request
1340 */
1341 define l2_fib_clear_table
1342 {
1343   u32 client_index;
1344   u32 context;
1345 };
1346
1347 /** \brief L2 fib clear table response
1348     @param context - sender context, to match reply w/ request
1349     @param retval - return code for the request
1350 */
1351 define l2_fib_clear_table_reply
1352 {
1353   u32 context;
1354   i32 retval;
1355 };
1356
1357 /** \brief L2 interface ethernet flow point filtering enable/disable request
1358     @param client_index - opaque cookie to identify the sender
1359     @param context - sender context, to match reply w/ request
1360     @param sw_if_index - interface to enable/disable filtering on
1361     @param enable_disable - if non-zero enable filtering, else disable
1362 */
1363 define l2_interface_efp_filter
1364 {
1365   u32 client_index;
1366   u32 context;
1367   u32 sw_if_index;
1368   u32 enable_disable;
1369 };
1370
1371 /** \brief L2 interface ethernet flow point filtering response
1372     @param context - sender context, to match reply w/ request
1373     @param retval - return code for the request
1374 */
1375 define l2_interface_efp_filter_reply
1376 {
1377   u32 context;
1378   i32 retval;
1379 };
1380
1381 /** \brief L2 interface vlan tag rewrite configure request
1382     @param client_index - opaque cookie to identify the sender
1383     @param context - sender context, to match reply w/ request
1384     @param sw_if_index - interface the operation is applied to
1385     @param vtr_op - Choose from l2_vtr_op_t enum values
1386     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
1387     @param tag1 - Needed for any push or translate vtr op
1388     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
1389 */
1390 define l2_interface_vlan_tag_rewrite
1391 {
1392   u32 client_index;
1393   u32 context;
1394   u32 sw_if_index;
1395   u32 vtr_op;
1396   u32 push_dot1q;               // ethertype of first pushed tag is dot1q/dot1ad
1397   u32 tag1;                     // first pushed tag
1398   u32 tag2;                     // second pushed tag
1399 };
1400
1401 /** \brief L2 interface vlan tag rewrite response
1402     @param context - sender context, to match reply w/ request
1403     @param retval - return code for the request
1404 */
1405 define l2_interface_vlan_tag_rewrite_reply
1406 {
1407   u32 context;
1408   i32 retval;
1409 };
1410
1411 define create_subif
1412 {
1413   u32 client_index;
1414   u32 context;
1415   u32 sw_if_index;
1416   u32 sub_id;
1417
1418   /* These fields map directly onto the subif template */
1419   u8 no_tags;
1420   u8 one_tag;
1421   u8 two_tags;
1422   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
1423   u8 exact_match;
1424   u8 default_sub;
1425   u8 outer_vlan_id_any;
1426   u8 inner_vlan_id_any;
1427   u16 outer_vlan_id;
1428   u16 inner_vlan_id;
1429 };
1430
1431 define create_subif_reply
1432 {
1433   u32 context;
1434   i32 retval;
1435   u32 sw_if_index;
1436 };
1437
1438 /** \brief show version
1439     @param client_index - opaque cookie to identify the sender
1440     @param context - sender context, to match reply w/ request
1441 */
1442 define show_version
1443 {
1444   u32 client_index;
1445   u32 context;
1446 };
1447
1448 /** \brief show version response
1449     @param context - sender context, to match reply w/ request
1450     @param retval - return code for the request
1451     @param program - name of the program (vpe)
1452     @param version  - version of the program
1453     @param build_directory - root of the workspace where the program was built
1454 */
1455 define show_version_reply
1456 {
1457   u32 context;
1458   i32 retval;
1459   u8 program[32];
1460   u8 version[32];
1461   u8 build_date[32];
1462   u8 build_directory[256];
1463 };
1464
1465 /** \brief l2 fib table entry structure
1466     @param bd_id - the l2 fib / bridge domain table id
1467     @param mac - the entry's mac address
1468     @param sw_if_index - index of the interface
1469     @param static_mac - the entry is statically configured.
1470     @param filter_mac - the entry is a mac filter entry.
1471     @param bvi_mac - the mac address is a bridge virtual interface
1472 */
1473 define l2_fib_table_entry
1474 {
1475   u32 context;
1476   u32 bd_id;
1477   u64 mac;
1478   u32 sw_if_index;
1479   u8 static_mac;
1480   u8 filter_mac;
1481   u8 bvi_mac;
1482 };
1483
1484 /** \brief Dump l2 fib (aka bridge domain) table
1485     @param client_index - opaque cookie to identify the sender
1486     @param bd_id - the l2 fib / bridge domain table identifier
1487 */
1488 define l2_fib_table_dump
1489 {
1490   u32 client_index;
1491   u32 context;
1492   u32 bd_id;
1493 };
1494
1495 /* Gross kludge, DGMS */
1496 define interface_name_renumber
1497 {
1498   u32 client_index;
1499   u32 context;
1500   u32 sw_if_index;
1501   u32 new_show_dev_instance;
1502 };
1503
1504 define interface_name_renumber_reply
1505 {
1506   u32 context;
1507   i32 retval;
1508 };
1509
1510 /** \brief Register for ip4 arp resolution events
1511     @param client_index - opaque cookie to identify the sender
1512     @param context - sender context, to match reply w/ request
1513     @param enable_disable - 1 => register for events, 0 => cancel registration
1514     @param pid - sender's pid
1515     @param address - the exact ip4 address of interest
1516 */
1517 define want_ip4_arp_events
1518 {
1519   u32 client_index;
1520   u32 context;
1521   u8 enable_disable;
1522   u32 pid;
1523   u32 address;
1524 };
1525
1526 /** \brief Reply for interface events registration
1527     @param context - returned sender context, to match reply w/ request
1528     @param retval - return code
1529 */
1530 define want_ip4_arp_events_reply
1531 {
1532   u32 context;
1533   i32 retval;
1534 };
1535
1536 /** \brief Tell client about an ip4 arp resolution event
1537     @param client_index - opaque cookie to identify the sender
1538     @param context - sender context, to match reply w/ request
1539     @param address - the exact ip4 address of interest
1540     @param pid - client pid registered to receive notification
1541     @param sw_if_index - interface which received ARP packet
1542     @param new_mac - the new mac address 
1543     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
1544 */
1545 define ip4_arp_event
1546 {
1547   u32 client_index;
1548   u32 context;
1549   u32 address;
1550   u32 pid;
1551   u32 sw_if_index;
1552   u8 new_mac[6];
1553   u8 mac_ip;
1554 };
1555
1556 /** \brief Register for ip6 nd resolution events
1557     @param client_index - opaque cookie to identify the sender
1558     @param context - sender context, to match reply w/ request
1559     @param enable_disable - 1 => register for events, 0 => cancel registration
1560     @param pid - sender's pid
1561     @param address - the exact ip6 address of interest
1562 */
1563 define want_ip6_nd_events
1564 {
1565   u32 client_index;
1566   u32 context;
1567   u8 enable_disable;
1568   u32 pid;
1569   u8 address[16];
1570 };
1571
1572 /** \brief Reply for ip6 nd resolution events registration
1573     @param context - returned sender context, to match reply w/ request
1574     @param retval - return code
1575 */
1576 define want_ip6_nd_events_reply
1577 {
1578   u32 context;
1579   i32 retval;
1580 };
1581
1582 /** \brief Tell client about an ip6 nd resolution or mac/ip event
1583     @param client_index - opaque cookie to identify the sender
1584     @param context - sender context, to match reply w/ request
1585     @param pid - client pid registered to receive notification
1586     @param sw_if_index - interface which received ARP packet
1587     @param address - the exact ip6 address of interest
1588     @param new_mac - the new mac address 
1589     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
1590 */
1591 define ip6_nd_event
1592 {
1593   u32 client_index;
1594   u32 context;
1595   u32 pid;
1596   u32 sw_if_index;
1597   u8 address[16];
1598   u8 new_mac[6];
1599   u8 mac_ip;
1600 };
1601     
1602 /** \brief L2 bridge domain add or delete request
1603     @param client_index - opaque cookie to identify the sender
1604     @param context - sender context, to match reply w/ request
1605     @param bd_id - the bridge domain to create
1606     @param flood - enable/disable bcast/mcast flooding in the bd
1607     @param uu_flood - enable/disable uknown unicast flood in the bd
1608     @param forward - enable/disable forwarding on all interfaces in the bd
1609     @param learn - enable/disable learning on all interfaces in the bd
1610     @param arp_term - enable/disable arp termination in the bd
1611     @param mac_age - mac aging time in min, 0 for disabled
1612     @param is_add - add or delete flag
1613 */
1614 define bridge_domain_add_del
1615 {
1616   u32 client_index;
1617   u32 context;
1618   u32 bd_id;
1619   u8 flood;
1620   u8 uu_flood;
1621   u8 forward;
1622   u8 learn;
1623   u8 arp_term;
1624   u8 mac_age;
1625   u8 is_add;
1626 };
1627
1628 /** \brief L2 bridge domain add or delete response
1629     @param context - sender context, to match reply w/ request
1630     @param retval - return code for the set bridge flags request
1631 */
1632 define bridge_domain_add_del_reply
1633 {
1634   u32 context;
1635   i32 retval;
1636 };
1637
1638 /** \brief L2 bridge domain request operational state details
1639     @param client_index - opaque cookie to identify the sender
1640     @param context - sender context, to match reply w/ request
1641     @param bd_id - the bridge domain id desired or ~0 to request all bds
1642 */
1643 define bridge_domain_dump
1644 {
1645   u32 client_index;
1646   u32 context;
1647   u32 bd_id;
1648 };
1649
1650 /** \brief L2 bridge domain operational state response
1651     @param bd_id - the bridge domain id
1652     @param flood - bcast/mcast flooding state on all interfaces in the bd
1653     @param uu_flood - uknown unicast flooding state on all interfaces in the bd
1654     @param forward - forwarding state on all interfaces in the bd
1655     @param learn - learning state on all interfaces in the bd
1656     @param arp_term - arp termination state on all interfaces in the bd
1657     @param mac_age - mac aging time in min, 0 for disabled
1658     @param n_sw_ifs - number of sw_if_index's in the domain
1659 */
1660 define bridge_domain_details
1661 {
1662   u32 context;
1663   u32 bd_id;
1664   u8 flood;
1665   u8 uu_flood;
1666   u8 forward;
1667   u8 learn;
1668   u8 arp_term;
1669   u8 mac_age;
1670   u32 bvi_sw_if_index;
1671   u32 n_sw_ifs;
1672 };
1673
1674 /** \brief L2 bridge domain sw interface operational state response
1675     @param bd_id - the bridge domain id
1676     @param sw_if_index - sw_if_index in the domain
1677     @param shg - split horizon group for the interface
1678 */
1679 define bridge_domain_sw_if_details
1680 {
1681   u32 context;
1682   u32 bd_id;
1683   u32 sw_if_index;
1684   u8 shg;
1685 };
1686
1687 /** \brief DHCP Client config add / del request
1688     @param client_index - opaque cookie to identify the sender
1689     @param context - sender context, to match reply w/ request
1690     @param sw_if_index - index of the interface for DHCP client
1691     @param hostname - hostname
1692     @param is_add - add the config if non-zero, else delete
1693     @param want_dhcp_event - DHCP event sent to the sender
1694            via dhcp_compl_event API message if non-zero
1695     @param pid - sender's pid
1696 */
1697 define dhcp_client_config
1698 {
1699   u32 client_index;
1700   u32 context;
1701   u32 sw_if_index;
1702   u8 hostname[64];
1703   u8 is_add;
1704   u8 want_dhcp_event;
1705   u32 pid;
1706 };
1707
1708 /** \brief DHCP Client config response
1709     @param context - sender context, to match reply w/ request
1710     @param retval - return code for the request
1711 */
1712 define dhcp_client_config_reply
1713 {
1714   u32 context;
1715   i32 retval;
1716 };
1717
1718 /** \brief Set/unset input ACL interface
1719     @param client_index - opaque cookie to identify the sender
1720     @param context - sender context, to match reply w/ request
1721     @param sw_if_index - interface to set/unset input ACL
1722     @param ip4_table_index - ip4 classify table index (~0 for skip)
1723     @param ip6_table_index - ip6 classify table index (~0 for skip)
1724     @param l2_table_index  -  l2 classify table index (~0 for skip)
1725     @param is_add - Set input ACL if non-zero, else unset
1726     Note: User is recommeneded to use just one valid table_index per call.
1727           (ip4_table_index, ip6_table_index, or l2_table_index)
1728 */
1729 define input_acl_set_interface
1730 {
1731   u32 client_index;
1732   u32 context;
1733   u32 sw_if_index;
1734   u32 ip4_table_index;
1735   u32 ip6_table_index;
1736   u32 l2_table_index;
1737   u8 is_add;
1738 };
1739
1740 /** \brief Set/unset input ACL interface response
1741     @param context - sender context, to match reply w/ request
1742     @param retval - return code for the request
1743 */
1744 define input_acl_set_interface_reply
1745 {
1746   u32 context;
1747   i32 retval;
1748 };
1749
1750 /** \brief Tell client about a DHCP completion event
1751     @param client_index - opaque cookie to identify the sender
1752     @param pid - client pid registered to receive notification
1753     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
1754     @param host_address - Host IP address
1755     @param router_address - Router IP address
1756     @param host_mac - Host MAC address
1757 */
1758 define dhcp_compl_event
1759 {
1760   u32 client_index;
1761   u32 pid;
1762   u8 hostname[64];
1763   u8 is_ipv6;
1764   u8 host_address[16];
1765   u8 router_address[16];
1766   u8 host_mac[6];
1767 };
1768
1769 /** \brief cop: enable/disable junk filtration features on an interface
1770     @param client_index - opaque cookie to identify the sender
1771     @param context - sender context, to match reply w/ request
1772     @param sw_if_inded - desired interface
1773     @param enable_disable - 1 => enable, 0 => disable
1774 */
1775
1776 define cop_interface_enable_disable
1777 {
1778   u32 client_index;
1779   u32 context;
1780   u32 sw_if_index;
1781   u8 enable_disable;
1782 };
1783
1784 /** \brief cop: interface enable/disable junk filtration reply
1785     @param context - returned sender context, to match reply w/ request
1786     @param retval - return code
1787 */
1788
1789 define cop_interface_enable_disable_reply
1790 {
1791   u32 context;
1792   i32 retval;
1793 };
1794
1795 /** \brief cop: enable/disable whitelist filtration features on an interface
1796     Note: the supplied fib_id must match in order to remove the feature!
1797     
1798     @param client_index - opaque cookie to identify the sender
1799     @param context - sender context, to match reply w/ request
1800     @param sw_if_index - interface handle, physical interfaces only
1801     @param fib_id - fib identifier for the whitelist / blacklist fib
1802     @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration
1803     @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration
1804     @param default_cop -  1 => enable non-ip4, non-ip6 filtration 0=> disable it
1805 */
1806
1807 define cop_whitelist_enable_disable
1808 {
1809   u32 client_index;
1810   u32 context;
1811   u32 sw_if_index;
1812   u32 fib_id;
1813   u8 ip4;
1814   u8 ip6;
1815   u8 default_cop;
1816 };
1817
1818 /** \brief cop: interface enable/disable junk filtration reply
1819     @param context - returned sender context, to match reply w/ request
1820     @param retval - return code
1821 */
1822
1823 define cop_whitelist_enable_disable_reply
1824 {
1825   u32 context;
1826   i32 retval;
1827 };
1828
1829 /** \brief get_node_graph - get a copy of the vpp node graph
1830     including the current set of graph arcs.
1831
1832     @param client_index - opaque cookie to identify the sender
1833     @param context - sender context, to match reply w/ request
1834 */
1835
1836 define get_node_graph
1837 {
1838   u32 client_index;
1839   u32 context;
1840 };
1841
1842 /** \brief get_node_graph_reply
1843     @param context - returned sender context, to match reply w/ request
1844     @param retval - return code
1845     @param reply_in_shmem - result from vlib_node_serialize, in shared
1846     memory. Process with vlib_node_unserialize, remember to switch
1847     heaps and free the result.
1848 */
1849
1850 define get_node_graph_reply
1851 {
1852   u32 context;
1853   i32 retval;
1854   u64 reply_in_shmem;
1855 };
1856
1857 /** \brief IOAM enable : Enable in-band OAM
1858     @param id - profile id
1859     @param seqno - To enable Seqno Processing
1860     @param analyse - Enabling analysis of iOAM at decap node 
1861     @param pow_enable - Proof of Work enabled or not flag
1862     @param trace_enable - iOAM Trace enabled or not flag
1863 */
1864 define ioam_enable
1865 {
1866   u32 client_index;
1867   u32 context;
1868   u16 id;
1869   u8 seqno;
1870   u8 analyse;
1871   u8 pot_enable;
1872   u8 trace_enable;
1873   u32 node_id;
1874 };
1875
1876 /** \brief iOAM Trace profile add / del response
1877     @param context - sender context, to match reply w/ request
1878     @param retval - return value for request
1879 */
1880 define ioam_enable_reply
1881 {
1882   u32 context;
1883   i32 retval;
1884 };
1885
1886 /** \brief iOAM disable
1887     @param client_index - opaque cookie to identify the sender
1888     @param context - sender context, to match reply w/ request
1889     @param index - MAP Domain index
1890 */
1891 define ioam_disable
1892 {
1893   u32 client_index;
1894   u32 context;
1895   u16 id;
1896 };
1897
1898 /** \brief iOAM disable response
1899     @param context - sender context, to match reply w/ request
1900     @param retval - return value for request
1901 */
1902 define ioam_disable_reply
1903 {
1904   u32 context;
1905   i32 retval;
1906 };
1907
1908 /** \brief Add/del policer
1909     @param client_index - opaque cookie to identify the sender
1910     @param context - sender context, to match reply w/ request
1911     @param is_add - add policer if non-zero, else delete
1912     @param name - policer name
1913     @param cir - CIR
1914     @param eir - EIR
1915     @param cb - Committed Burst
1916     @param eb - Excess or Peak Burst
1917     @param rate_type - rate type
1918     @param round_type - rounding type
1919     @param type - policer algorithm
1920     @param color_aware - 0=color-blind, 1=color-aware
1921     @param conform_action_type - conform action type
1922     @param conform_dscp - DSCP for conform mar-and-transmit action
1923     @param exceed_action_type - exceed action type
1924     @param exceed_dscp - DSCP for exceed mar-and-transmit action
1925     @param violate_action_type - violate action type
1926     @param violate_dscp - DSCP for violate mar-and-transmit action
1927 */
1928 define policer_add_del
1929 {
1930   u32 client_index;
1931   u32 context;
1932
1933   u8 is_add;
1934   u8 name[64];
1935   u32 cir;
1936   u32 eir;
1937   u64 cb;
1938   u64 eb;
1939   u8 rate_type;
1940   u8 round_type;
1941   u8 type;
1942   u8 color_aware;
1943   u8 conform_action_type;
1944   u8 conform_dscp;
1945   u8 exceed_action_type;
1946   u8 exceed_dscp;
1947   u8 violate_action_type;
1948   u8 violate_dscp;
1949 };
1950
1951 /** \brief Add/del policer response
1952     @param context - sender context, to match reply w/ request
1953     @param retval - return value for request
1954     @param policer_index - for add, returned index of the new policer
1955 */
1956 define policer_add_del_reply
1957 {
1958   u32 context;
1959   i32 retval;
1960   u32 policer_index;
1961 };
1962
1963 /** \brief Get list of policers
1964     @param client_index - opaque cookie to identify the sender
1965     @param context - sender context, to match reply w/ request
1966     @param match_name_valid - if 0 request all policers otherwise use match_name
1967     @param match_name - policer name
1968 */
1969 define policer_dump
1970 {
1971   u32 client_index;
1972   u32 context;
1973
1974   u8 match_name_valid;
1975   u8 match_name[64];
1976 };
1977
1978 /** \brief Policer operational state response.
1979     @param context - sender context, to match reply w/ request
1980     @param name - policer name
1981     @param cir - CIR
1982     @param eir - EIR
1983     @param cb - Committed Burst
1984     @param eb - Excess or Peak Burst
1985     @param rate_type - rate type
1986     @param round_type - rounding type
1987     @param type - policer algorithm
1988     @param conform_action_type - conform action type
1989     @param conform_dscp - DSCP for conform mar-and-transmit action
1990     @param exceed_action_type - exceed action type
1991     @param exceed_dscp - DSCP for exceed mar-and-transmit action
1992     @param violate_action_type - violate action type
1993     @param violate_dscp - DSCP for violate mar-and-transmit action
1994     @param single_rate - 1 = single rate policer, 0 = two rate policer
1995     @param color_aware - for hierarchical policing
1996     @param scale - power-of-2 shift amount for lower rates
1997     @param cir_tokens_per_period - number of tokens for each period
1998     @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
1999     @param current_limit - current limit
2000     @param current_bucket - current bucket
2001     @param extended_limit - extended limit
2002     @param extended_bucket - extended bucket
2003     @param last_update_time - last update time
2004 */
2005 define policer_details
2006 {
2007   u32 context;
2008
2009   u8 name[64];
2010   u32 cir;
2011   u32 eir;
2012   u64 cb;
2013   u64 eb;
2014   u8 rate_type;
2015   u8 round_type;
2016   u8 type;
2017   u8 conform_action_type;
2018   u8 conform_dscp;
2019   u8 exceed_action_type;
2020   u8 exceed_dscp;
2021   u8 violate_action_type;
2022   u8 violate_dscp;
2023   u8 single_rate;
2024   u8 color_aware;
2025   u32 scale;
2026   u32 cir_tokens_per_period;
2027   u32 pir_tokens_per_period;
2028   u32 current_limit;
2029   u32 current_bucket;
2030   u32 extended_limit;
2031   u32 extended_bucket;
2032   u64 last_update_time;
2033 };
2034
2035 /** \brief Set/unset policer classify interface
2036     @param client_index - opaque cookie to identify the sender
2037     @param context - sender context, to match reply w/ request
2038     @param sw_if_index - interface to set/unset policer classify
2039     @param ip4_table_index - ip4 classify table index (~0 for skip)
2040     @param ip6_table_index - ip6 classify table index (~0 for skip)
2041     @param l2_table_index  -  l2 classify table index (~0 for skip)
2042     @param is_add - Set if non-zero, else unset
2043     Note: User is recommeneded to use just one valid table_index per call.
2044           (ip4_table_index, ip6_table_index, or l2_table_index)
2045 */
2046 define policer_classify_set_interface
2047 {
2048   u32 client_index;
2049   u32 context;
2050   u32 sw_if_index;
2051   u32 ip4_table_index;
2052   u32 ip6_table_index;
2053   u32 l2_table_index;
2054   u8 is_add;
2055 };
2056
2057 /** \brief Set/unset policer classify interface response
2058     @param context - sender context, to match reply w/ request
2059     @param retval - return value for request
2060 */
2061 define policer_classify_set_interface_reply
2062 {
2063   u32 context;
2064   i32 retval;
2065 };
2066
2067 /** \brief Get list of policer classify interfaces and tables
2068     @param client_index - opaque cookie to identify the sender
2069     @param context - sender context, to match reply w/ request
2070     @param type - classify table type
2071 */
2072 define policer_classify_dump
2073 {
2074   u32 client_index;
2075   u32 context;
2076   u8 type;
2077 };
2078
2079 /** \brief Policer iclassify operational state response.
2080     @param context - sender context, to match reply w/ request
2081     @param sw_if_index - software interface index
2082     @param table_index - classify table index
2083 */
2084 define policer_classify_details
2085 {
2086   u32 context;
2087   u32 sw_if_index;
2088   u32 table_index;
2089 };
2090
2091 /** \brief Classify get table IDs request
2092     @param client_index - opaque cookie to identify the sender
2093     @param context - sender context, to match reply w/ request
2094 */
2095 define classify_table_ids
2096 {
2097   u32 client_index;
2098   u32 context;
2099 };
2100
2101 /** \brief Reply for classify get table IDs request
2102     @param context - sender context which was passed in the request
2103     @param count - number of ids returned in response
2104     @param ids - array of classify table ids
2105 */
2106 define classify_table_ids_reply
2107 {
2108   u32 context;
2109   i32 retval;
2110   u32 count;
2111   u32 ids[count];
2112 };
2113
2114 /** \brief Classify table ids by interface index request
2115     @param client_index - opaque cookie to identify the sender
2116     @param context - sender context, to match reply w/ request
2117     @param sw_if_index - index of the interface
2118 */
2119 define classify_table_by_interface
2120 {
2121   u32 client_index;
2122   u32 context;
2123   u32 sw_if_index;
2124 };
2125
2126 /** \brief Reply for classify table id by interface index request
2127     @param context - sender context which was passed in the request
2128     @param count - number of ids returned in response
2129     @param sw_if_index - index of the interface
2130     @param l2_table_id - l2 classify table index
2131     @param ip4_table_id - ip4 classify table index
2132     @param ip6_table_id - ip6 classify table index
2133 */
2134 define classify_table_by_interface_reply
2135 {
2136   u32 context;
2137   i32 retval;
2138   u32 sw_if_index;
2139   u32 l2_table_id;
2140   u32 ip4_table_id;
2141   u32 ip6_table_id;
2142 };
2143
2144 /** \brief Classify table info
2145     @param client_index - opaque cookie to identify the sender
2146     @param context - sender context, to match reply w/ request
2147     @param table_id - classify table index
2148 */
2149 define classify_table_info
2150 {
2151   u32 client_index;
2152   u32 context;
2153   u32 table_id;
2154 };
2155
2156 /** \brief Reply for classify table info request
2157     @param context - sender context which was passed in the request
2158     @param count - number of ids returned in response
2159     @param table_id - classify table index
2160     @param nbuckets - number of buckets when adding a table
2161     @param match_n_vectors - number of match vectors
2162     @param skip_n_vectors - number of skip_n_vectors
2163     @param active_sessions - number of sessions (active entries)
2164     @param next_table_index - index of next table
2165     @param miss_next_index - index of miss table
2166     @param mask[] - match mask
2167 */
2168 define classify_table_info_reply
2169 {
2170   u32 context;
2171   i32 retval;
2172   u32 table_id;
2173   u32 nbuckets;
2174   u32 match_n_vectors;
2175   u32 skip_n_vectors;
2176   u32 active_sessions;
2177   u32 next_table_index;
2178   u32 miss_next_index;
2179   u32 mask_length;
2180   u8 mask[mask_length];
2181 };
2182
2183 /** \brief Classify sessions dump request
2184     @param client_index - opaque cookie to identify the sender
2185     @param context - sender context, to match reply w/ request
2186     @param table_id - classify table index
2187 */
2188 define classify_session_dump
2189 {
2190   u32 client_index;
2191   u32 context;
2192   u32 table_id;
2193 };
2194
2195 /** \brief Reply for classify table session dump request
2196     @param context - sender context which was passed in the request
2197     @param count - number of ids returned in response
2198     @param table_id - classify table index
2199     @param hit_next_index - hit_next_index of session
2200     @param opaque_index - for add, opaque_index of session
2201     @param advance - advance value of session
2202     @param match[] - match value for session
2203 */
2204 define classify_session_details
2205 {
2206   u32 context;
2207   i32 retval;
2208   u32 table_id;
2209   u32 hit_next_index;
2210   i32 advance;
2211   u32 opaque_index;
2212   u32 match_length;
2213   u8 match[match_length];
2214 };
2215
2216 /** \brief Configure IPFIX exporter process request
2217     @param client_index - opaque cookie to identify the sender
2218     @param context - sender context, to match reply w/ request
2219     @param collector_address - address of IPFIX collector
2220     @param collector_port - port of IPFIX collector
2221     @param src_address - address of IPFIX exporter
2222     @param vrf_id - VRF / fib table ID
2223     @param path_mtu - Path MTU between exporter and collector
2224     @param template_interval - number of seconds after which to resend template
2225     @param udp_checksum - UDP checksum calculation enable flag
2226 */
2227 define set_ipfix_exporter
2228 {
2229   u32 client_index;
2230   u32 context;
2231   u8 collector_address[16];
2232   u16 collector_port;
2233   u8 src_address[16];
2234   u32 vrf_id;
2235   u32 path_mtu;
2236   u32 template_interval;
2237   u8 udp_checksum;
2238 };
2239
2240 /** \brief Reply to IPFIX exporter configure request
2241     @param context - sender context which was passed in the request
2242 */
2243 define set_ipfix_exporter_reply
2244 {
2245   u32 context;
2246   i32 retval;
2247 };
2248
2249 /** \brief IPFIX exporter dump request
2250     @param client_index - opaque cookie to identify the sender
2251     @param context - sender context, to match reply w/ request
2252 */
2253 define ipfix_exporter_dump
2254 {
2255   u32 client_index;
2256   u32 context;
2257 };
2258
2259 /** \brief Reply to IPFIX exporter dump request
2260     @param context - sender context which was passed in the request
2261     @param collector_address - address of IPFIX collector
2262     @param collector_port - port of IPFIX collector
2263     @param src_address - address of IPFIX exporter
2264     @param fib_index - fib table index
2265     @param path_mtu - Path MTU between exporter and collector
2266     @param template_interval - number of seconds after which to resend template
2267     @param udp_checksum - UDP checksum calculation enable flag
2268 */
2269 define ipfix_exporter_details
2270 {
2271   u32 context;
2272   u8 collector_address[16];
2273   u16 collector_port;
2274   u8 src_address[16];
2275   u32 vrf_id;
2276   u32 path_mtu;
2277   u32 template_interval;
2278   u8 udp_checksum;
2279 };
2280
2281 /** \brief IPFIX classify stream configure request
2282     @param client_index - opaque cookie to identify the sender
2283     @param context - sender context, to match reply w/ request
2284     @param domain_id - domain ID reported in IPFIX messages for classify stream
2285     @param src_port - source port of UDP session for classify stream
2286 */
2287 define set_ipfix_classify_stream {
2288     u32 client_index;
2289     u32 context;
2290     u32 domain_id;
2291     u16 src_port;
2292 };
2293
2294 /** \brief IPFIX classify stream configure response
2295     @param context - sender context, to match reply w/ request
2296     @param retval - return value for request
2297 */
2298 define set_ipfix_classify_stream_reply {
2299     u32 context;
2300     i32 retval;
2301 };
2302
2303 /** \brief IPFIX classify stream dump request
2304     @param client_index - opaque cookie to identify the sender
2305     @param context - sender context, to match reply w/ request
2306 */
2307 define ipfix_classify_stream_dump {
2308     u32 client_index;
2309     u32 context;
2310 };
2311
2312 /** \brief Reply to IPFIX classify stream dump request
2313     @param context - sender context, to match reply w/ request
2314     @param domain_id - domain ID reported in IPFIX messages for classify stream
2315     @param src_port - source port of UDP session for classify stream
2316 */
2317 define ipfix_classify_stream_details {
2318     u32 context;
2319     u32 domain_id;
2320     u16 src_port;
2321 };
2322
2323 /** \brief IPFIX add or delete classifier table request
2324     @param client_index - opaque cookie to identify the sender
2325     @param context - sender context, to match reply w/ request
2326     @param table_id - classifier table ID
2327     @param ip_version - version of IP used in the classifier table
2328     @param transport_protocol - transport protocol used in the classifier table or 255 for unspecified
2329 */
2330 define ipfix_classify_table_add_del {
2331     u32 client_index;
2332     u32 context;
2333     u32 table_id;
2334     u8 ip_version;
2335     u8 transport_protocol;
2336     u8 is_add;
2337 };
2338
2339 /** \brief IPFIX add classifier table response
2340     @param context - sender context which was passed in the request
2341 */
2342 define ipfix_classify_table_add_del_reply {
2343     u32 context;
2344     i32 retval;
2345 };
2346
2347 /** \brief IPFIX classify tables dump request
2348     @param client_index - opaque cookie to identify the sender
2349     @param context - sender context, to match reply w/ request
2350 */
2351 define ipfix_classify_table_dump {
2352     u32 client_index;
2353     u32 context;
2354 };
2355
2356 /** \brief Reply to IPFIX classify tables dump request
2357     @param context - sender context, to match reply w/ request
2358     @param table_id - classifier table ID
2359     @param ip_version - version of IP used in the classifier table
2360     @param transport_protocol - transport protocol used in the classifier table or 255 for unspecified
2361 */
2362 define ipfix_classify_table_details {
2363     u32 context;
2364     u32 table_id;
2365     u8 ip_version;
2366     u8 transport_protocol;
2367 };
2368
2369 /** \brief Set/unset flow classify interface
2370     @param client_index - opaque cookie to identify the sender
2371     @param context - sender context, to match reply w/ request
2372     @param sw_if_index - interface to set/unset flow classify
2373     @param ip4_table_index - ip4 classify table index (~0 for skip)
2374     @param ip6_table_index - ip6 classify table index (~0 for skip)
2375     @param l2_table_index  -  l2 classify table index (~0 for skip)
2376     @param is_add - Set if non-zero, else unset
2377     Note: User is recommeneded to use just one valid table_index per call.
2378           (ip4_table_index, ip6_table_index, or l2_table_index)
2379 */
2380 define flow_classify_set_interface {
2381     u32 client_index;
2382     u32 context;
2383     u32 sw_if_index;
2384     u32 ip4_table_index;
2385     u32 ip6_table_index;
2386     u8  is_add;
2387 };
2388
2389 /** \brief Set/unset flow classify interface response
2390     @param context - sender context, to match reply w/ request
2391     @param retval - return value for request
2392 */
2393 define flow_classify_set_interface_reply {
2394     u32 context;
2395     i32 retval;
2396 };
2397
2398 /** \brief Get list of flow classify interfaces and tables
2399     @param client_index - opaque cookie to identify the sender
2400     @param context - sender context, to match reply w/ request
2401     @param type - classify table type
2402 */
2403 define flow_classify_dump {
2404     u32 client_index;
2405     u32 context;
2406     u8 type;
2407 };
2408
2409 /** \brief Flow classify operational state response.
2410     @param context - sender context, to match reply w/ request
2411     @param sw_if_index - software interface index
2412     @param table_index - classify table index
2413 */
2414 define flow_classify_details {
2415     u32 context;
2416     u32 sw_if_index;
2417     u32 table_index;
2418 };
2419
2420 /** \brief Query relative index via node names
2421     @param client_index - opaque cookie to identify the sender
2422     @param context - sender context, to match reply w/ request
2423     @param node_name - name of node to find relative index from
2424     @param next_name - next node from node_name to find relative index of
2425 */
2426 define get_next_index
2427 {
2428   u32 client_index;
2429   u32 context;
2430   u8 node_name[64];
2431   u8 next_name[64];
2432 };
2433
2434 /** \brief Reply for get next node index
2435     @param context - sender context which was passed in the request
2436     @param retval - return value
2437     @param next_index - index of the next_node
2438 */
2439 define get_next_index_reply
2440 {
2441   u32 context;
2442   i32 retval;
2443   u32 next_index;
2444 };
2445
2446 /** \brief PacketGenerator create interface request
2447     @param client_index - opaque cookie to identify the sender
2448     @param context - sender context, to match reply w/ request
2449     @param interface_id - interface index
2450 */
2451 define pg_create_interface
2452 {
2453   u32 client_index;
2454   u32 context;
2455   u32 interface_id;
2456 };
2457
2458 /** \brief PacketGenerator create interface response
2459     @param context - sender context, to match reply w/ request
2460     @param retval - return value for request
2461 */
2462 define pg_create_interface_reply
2463 {
2464   u32 context;
2465   i32 retval;
2466   u32 sw_if_index;
2467 };
2468
2469 /** \brief PacketGenerator capture packets on given interface request
2470     @param client_index - opaque cookie to identify the sender
2471     @param context - sender context, to match reply w/ request
2472     @param interface_id - pg interface index
2473     @param is_enabled - 1 if enabling streams, 0 if disabling
2474     @param count - number of packets to be captured
2475     @param pcap_file - pacp file name to store captured packets
2476 */
2477 define pg_capture
2478 {
2479   u32 client_index;
2480   u32 context;
2481   u32 interface_id;
2482   u8 is_enabled;
2483   u32 count;
2484   u32 pcap_name_length;
2485   u8 pcap_file_name[pcap_name_length];
2486 };
2487
2488 /** \brief PacketGenerator capture packets response
2489     @param context - sender context, to match reply w/ request
2490     @param retval - return value for request
2491 */
2492 define pg_capture_reply
2493 {
2494   u32 context;
2495   i32 retval;
2496 };
2497
2498 /** \brief Enable / disable packet generator request
2499     @param client_index - opaque cookie to identify the sender
2500     @param context - sender context, to match reply w/ request
2501     @param is_enabled - 1 if enabling streams, 0 if disabling
2502     @param stream - stream name to be enable/disabled, if not specified handle all streams
2503 */
2504 define pg_enable_disable
2505 {
2506   u32 client_index;
2507   u32 context;
2508   u8 is_enabled;
2509   u32 stream_name_length;
2510   u8 stream_name[stream_name_length];
2511 };
2512
2513 /** \brief Reply for enable / disable packet generator
2514     @param context - returned sender context, to match reply w/ request
2515     @param retval - return code
2516 */
2517 define pg_enable_disable_reply
2518 {
2519   u32 context;
2520   i32 retval;
2521 };
2522
2523 /** \brief Configure IP source and L4 port-range check
2524     @param client_index - opaque cookie to identify the sender
2525     @param context - sender context, to match reply w/ request
2526     @param is_ip6 - 1 if source address type is IPv6
2527     @param is_add - 1 if add, 0 if delete
2528     @param mask_length - mask length for address entry
2529     @param address - array of address bytes
2530     @param number_of_ranges - length of low_port and high_port arrays (must match)
2531     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
2532     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
2533     @param vrf_id - fib table/vrf id to associate the source and port-range check with
2534     @note To specify a single port set low_port and high_port entry the same
2535 */
2536 define ip_source_and_port_range_check_add_del
2537 {
2538   u32 client_index;
2539   u32 context;
2540   u8 is_ipv6;
2541   u8 is_add;
2542   u8 mask_length;
2543   u8 address[16];
2544   u8 number_of_ranges;
2545   u16 low_ports[32];
2546   u16 high_ports[32];
2547   u32 vrf_id;
2548 };
2549
2550 /** \brief Configure IP source and L4 port-range check reply
2551     @param context - returned sender context, to match reply w/ request
2552     @param retval - return code
2553 */
2554 define ip_source_and_port_range_check_add_del_reply
2555 {
2556   u32 context;
2557   i32 retval;
2558 };
2559
2560 /** \brief Set interface source and L4 port-range request
2561     @param client_index - opaque cookie to identify the sender
2562     @param context - sender context, to match reply w/ request
2563     @param interface_id - interface index
2564     @param tcp_vrf_id - VRF associated with source and TCP port-range check
2565     @param udp_vrf_id - VRF associated with source and TCP port-range check
2566 */
2567 define ip_source_and_port_range_check_interface_add_del
2568 {
2569   u32 client_index;
2570   u32 context;
2571   u8 is_add;
2572   u32 sw_if_index;
2573   u32 tcp_in_vrf_id;
2574   u32 tcp_out_vrf_id;
2575   u32 udp_in_vrf_id;
2576   u32 udp_out_vrf_id;
2577 };
2578
2579 /** \brief Set interface source and L4 port-range response
2580     @param context - sender context, to match reply w/ request
2581     @param retval - return value for request
2582 */
2583 define ip_source_and_port_range_check_interface_add_del_reply
2584 {
2585   u32 context;
2586   i32 retval;
2587 };
2588
2589 /** \brief Delete sub interface request
2590     @param client_index - opaque cookie to identify the sender
2591     @param context - sender context, to match reply w/ request
2592     @param sw_if_index - sw index of the interface that was created by create_subif
2593 */
2594 define delete_subif {
2595   u32 client_index;
2596   u32 context;
2597   u32 sw_if_index;
2598 };
2599
2600 /** \brief Delete sub interface response
2601     @param context - sender context, to match reply w/ request
2602     @param retval - return code for the request
2603 */
2604 define delete_subif_reply {
2605   u32 context;
2606   i32 retval;
2607 };
2608
2609 /** \brief DPDK interface HQoS pipe profile set request
2610     @param client_index - opaque cookie to identify the sender
2611     @param context - sender context, to match reply w/ request
2612     @param sw_if_index - the interface
2613     @param subport - subport ID
2614     @param pipe - pipe ID within its subport
2615     @param profile - pipe profile ID
2616 */
2617 define sw_interface_set_dpdk_hqos_pipe {
2618     u32 client_index;
2619     u32 context;
2620     u32 sw_if_index;
2621     u32 subport;
2622     u32 pipe;
2623     u32 profile;
2624 };
2625
2626 /** \brief DPDK interface HQoS pipe profile set reply
2627     @param context - sender context, to match reply w/ request
2628     @param retval - request return code
2629 */
2630 define sw_interface_set_dpdk_hqos_pipe_reply {
2631     u32 context;
2632     i32 retval;
2633 };
2634
2635 /** \brief DPDK interface HQoS subport parameters set request
2636     @param client_index - opaque cookie to identify the sender
2637     @param context - sender context, to match reply w/ request
2638     @param sw_if_index - the interface
2639     @param subport - subport ID
2640     @param tb_rate - subport token bucket rate (measured in bytes/second)
2641     @param tb_size - subport token bucket size (measured in credits)
2642     @param tc_rate - subport traffic class 0 .. 3 rates (measured in bytes/second)
2643     @param tc_period - enforcement period for rates (measured in milliseconds)
2644 */
2645 define sw_interface_set_dpdk_hqos_subport {
2646     u32 client_index;
2647     u32 context;
2648     u32 sw_if_index;
2649     u32 subport;
2650     u32 tb_rate;
2651     u32 tb_size;
2652     u32 tc_rate[4];
2653     u32 tc_period;
2654 };
2655
2656 /** \brief DPDK interface HQoS subport parameters set reply
2657     @param context - sender context, to match reply w/ request
2658     @param retval - request return code
2659 */
2660 define sw_interface_set_dpdk_hqos_subport_reply {
2661     u32 context;
2662     i32 retval;
2663 };
2664
2665 /** \brief DPDK interface HQoS tctbl entry set request
2666     @param client_index - opaque cookie to identify the sender
2667     @param context - sender context, to match reply w/ request
2668     @param sw_if_index - the interface
2669     @param entry - entry index ID
2670     @param tc - traffic class (0 .. 3)
2671     @param queue - traffic class queue (0 .. 3)
2672 */
2673 define sw_interface_set_dpdk_hqos_tctbl {
2674     u32 client_index;
2675     u32 context;
2676     u32 sw_if_index;
2677     u32 entry;
2678     u32 tc;
2679     u32 queue;
2680 };
2681
2682 /** \brief DPDK interface HQoS tctbl entry set reply
2683     @param context - sender context, to match reply w/ request
2684     @param retval - request return code
2685 */
2686 define sw_interface_set_dpdk_hqos_tctbl_reply {
2687     u32 context;
2688     i32 retval;
2689 };
2690
2691 /** \brief L2 interface pbb tag rewrite configure request
2692     @param client_index - opaque cookie to identify the sender
2693     @param context - sender context, to match reply w/ request
2694     @param sw_if_index - interface the operation is applied to
2695     @param vtr_op - Choose from l2_vtr_op_t enum values
2696     @param inner_tag - needed for translate_qinq vtr op only
2697     @param outer_tag - needed for translate_qinq vtr op only 
2698     @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
2699     @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
2700     @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
2701     @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
2702 */
2703 define l2_interface_pbb_tag_rewrite
2704 {
2705   u32 client_index;
2706   u32 context;
2707   u32 sw_if_index;
2708   u32 vtr_op;
2709   u16 outer_tag;
2710   u8  b_dmac[6];
2711   u8  b_smac[6];
2712   u16 b_vlanid;
2713   u32 i_sid;
2714 };
2715
2716 /** \brief L2 interface pbb tag rewrite response
2717     @param context - sender context, to match reply w/ request
2718     @param retval - return code for the request
2719 */
2720 define l2_interface_pbb_tag_rewrite_reply
2721 {
2722   u32 context;
2723   i32 retval;
2724 };
2725
2726 /** \brief Punt traffic to the host
2727     @param client_index - opaque cookie to identify the sender
2728     @param context - sender context, to match reply w/ request
2729     @param is_add - add punt if non-zero, else delete
2730     @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
2731     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
2732     @param l4_port - TCP/UDP port to be punted
2733 */
2734 define punt {
2735     u32 client_index;
2736     u32 context;
2737     u8 is_add;
2738     u8 ipv;
2739     u8 l4_protocol;
2740     u16 l4_port;
2741 };
2742
2743 /** \brief Reply to the punt request
2744     @param context - sender context which was passed in the request
2745     @param retval - return code of punt request
2746 */
2747 define punt_reply
2748 {
2749     u32 context;
2750     i32 retval;
2751 };
2752
2753 /** \brief Feature path enable/disable request
2754     @param client_index - opaque cookie to identify the sender
2755     @param context - sender context, to match reply w/ request
2756     @param sw_if_index - the interface
2757     @param enable - 1 = on, 0 = off
2758 */
2759 define feature_enable_disable {
2760     u32 client_index;
2761     u32 context;
2762     u32 sw_if_index;
2763     u8 enable;
2764     u8 arc_name[64];
2765     u8 feature_name[64];
2766 };
2767
2768 /** \brief Reply to the eature path enable/disable request
2769     @param context - sender context which was passed in the request
2770     @param retval - return code for the request
2771 */
2772 define feature_enable_disable_reply
2773 {
2774     u32 context;
2775     i32 retval;
2776 };
2777
2778 /*
2779  * Local Variables:
2780  * eval: (c-set-style "gnu")
2781  * End:
2782  */