API refactoring : l2, mpls, sr
[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 .../src/vnet/{interface.api,interface_api.c}
26  * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
27  * TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
28  * VXLAN APIs: see .../src/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 ... /src/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 .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
33  * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
34  * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
35  * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
36  * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
37  * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
38  * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
39  * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
40  * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
41  * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
42  * SR APIs: see .../src/vnet/sr/{sr.api, sr_api.c}
43  * DPDK APIs: ... see /src/vnet/devices/dpdk/{dpdk.api, dpdk_api.c}
44  */
45
46 /** \brief Create a new subinterface with the given vlan id
47     @param client_index - opaque cookie to identify the sender
48     @param context - sender context, to match reply w/ request
49     @param sw_if_index - software index of the new vlan's parent interface
50     @param vlan_id - vlan tag of the new interface
51 */
52 define create_vlan_subif
53 {
54   u32 client_index;
55   u32 context;
56   u32 sw_if_index;
57   u32 vlan_id;
58 };
59
60 /** \brief Reply for the vlan subinterface create request
61     @param context - returned sender context, to match reply w/ request
62     @param retval - return code
63     @param sw_if_index - software index allocated for the new subinterface
64 */
65 define create_vlan_subif_reply
66 {
67   u32 context;
68   i32 retval;
69   u32 sw_if_index;
70 };
71
72 /** \brief Enable or Disable MPLS on and interface
73     @param client_index - opaque cookie to identify the sender
74     @param context - sender context, to match reply w/ request
75     @param sw_if_index - index of the interface
76     @param enable - if non-zero enable, else disable
77 */
78 define sw_interface_set_mpls_enable
79 {
80   u32 client_index;
81   u32 context;
82   u32 sw_if_index;
83   u8 enable;
84 };
85
86 /** \brief Reply for MPLS state on an interface
87     @param context - returned sender context, to match reply w/ request
88     @param retval - return code
89 */
90 define sw_interface_set_mpls_enable_reply
91 {
92   u32 context;
93   i32 retval;
94 };
95
96 /** \brief Proxy ARP add / del request
97     @param client_index - opaque cookie to identify the sender
98     @param context - sender context, to match reply w/ request
99     @param vrf_id - VRF / Fib table ID
100     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
101     @param low_address[4] - Low address of the Proxy ARP range
102     @param hi_address[4] - High address of the Proxy ARP range
103 */
104 define proxy_arp_add_del
105 {
106   u32 client_index;
107   u32 context;
108   u32 vrf_id;
109   u8 is_add;
110   u8 low_address[4];
111   u8 hi_address[4];
112 };
113
114 /** \brief Reply for proxy arp add / del request
115     @param context - returned sender context, to match reply w/ request
116     @param retval - return code
117 */
118 define proxy_arp_add_del_reply
119 {
120   u32 context;
121   i32 retval;
122 };
123
124 /** \brief Proxy ARP add / del request
125     @param client_index - opaque cookie to identify the sender
126     @param context - sender context, to match reply w/ request
127     @param sw_if_index - Which interface to enable / disable Proxy Arp on
128     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
129 */
130 define proxy_arp_intfc_enable_disable
131 {
132   u32 client_index;
133   u32 context;
134   u32 sw_if_index;
135   /* 1 = on, 0 = off */
136   u8 enable_disable;
137 };
138
139 /** \brief Reply for Proxy ARP interface enable / disable request
140     @param context - returned sender context, to match reply w/ request
141     @param retval - return code
142 */
143 define proxy_arp_intfc_enable_disable_reply
144 {
145   u32 context;
146   i32 retval;
147 };
148
149 /** \brief Reset VRF (remove all routes etc) request
150     @param client_index - opaque cookie to identify the sender
151     @param context - sender context, to match reply w/ request
152     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
153     @param vrf_id - ID of th FIB table / VRF to reset
154 */
155 define reset_vrf
156 {
157   u32 client_index;
158   u32 context;
159   u8 is_ipv6;
160   u32 vrf_id;
161 };
162
163 /** \brief Reply for Reset VRF request
164     @param context - returned sender context, to match reply w/ request
165     @param retval - return code
166 */
167 define reset_vrf_reply
168 {
169   u32 context;
170   i32 retval;
171 };
172
173 /** \brief Is Address Reachable request - DISABLED
174     @param client_index - opaque cookie to identify the sender
175     @param context - sender context, to match reply w/ request
176     @param next_hop_sw_if_index - index of interface used to get to next hop
177     @param is_ipv6 - 1 for IPv6, 0 for IPv4
178     @param is_error - address not found or does not match intf
179     @param address[] - Address in question 
180 */
181 define is_address_reachable
182 {
183   u32 client_index;             /* (api_main_t *) am->my_client_index */
184   u32 context;
185   u32 next_hop_sw_if_index;
186   u8 is_known;                  /* on reply, this is the answer */
187   u8 is_ipv6;
188   u8 is_error;                  /* address not found or does not match intf */
189   u8 address[16];
190 };
191
192 /** \brief Want Stats, register for stats updates
193     @param client_index - opaque cookie to identify the sender
194     @param context - sender context, to match reply w/ request
195     @param enable_disable - 1 = enable stats, 0 = disable
196     @param pid - pid of process requesting stats updates
197 */
198 define want_stats
199 {
200   u32 client_index;
201   u32 context;
202   u32 enable_disable;
203   u32 pid;
204 };
205
206 /** \brief Reply for Want Stats request
207     @param context - returned sender context, to match reply w/ request
208     @param retval - return code
209 */
210 define want_stats_reply
211 {
212   u32 context;
213   i32 retval;
214 };
215
216 typeonly manual_print manual_endian define ip4_fib_counter
217 {
218   u32 address;
219   u8 address_length;
220   u64 packets;
221   u64 bytes;
222 };
223
224 manual_print manual_endian define vnet_ip4_fib_counters
225 {
226   u32 vrf_id;
227   u32 count;
228   vl_api_ip4_fib_counter_t c[count];
229 };
230
231 typeonly manual_print manual_endian define ip6_fib_counter
232 {
233   u64 address[2];
234   u8 address_length;
235   u64 packets;
236   u64 bytes;
237 };
238
239 manual_print manual_endian define vnet_ip6_fib_counters
240 {
241   u32 vrf_id;
242   u32 count;
243   vl_api_ip6_fib_counter_t c[count];
244 };
245
246 /** \brief Request for a single block of summary stats
247     @param client_index - opaque cookie to identify the sender
248     @param context - sender context, to match reply w/ request
249 */
250 define vnet_get_summary_stats
251 {
252   u32 client_index;
253   u32 context;
254 };
255
256 /** \brief Reply for vnet_get_summary_stats request
257     @param context - sender context, to match reply w/ request
258     @param retval - return code for request
259     @param total_pkts -  
260     @param total_bytes -
261     @param vector_rate - 
262 */
263 define vnet_summary_stats_reply
264 {
265   u32 context;
266   i32 retval;
267   u64 total_pkts[2];
268   u64 total_bytes[2];
269   f64 vector_rate;
270 };
271
272 /** \brief OAM event structure
273     @param dst_address[] - 
274     @param state
275 */
276 define oam_event
277 {
278   u8 dst_address[4];
279   u8 state;
280 };
281
282 /** \brief Want OAM events request
283     @param client_index - opaque cookie to identify the sender
284     @param context - sender context, to match reply w/ request
285     @param enable_disable- enable if non-zero, else disable
286     @param pid - pid of the requesting process
287 */
288 define want_oam_events
289 {
290   u32 client_index;
291   u32 context;
292   u32 enable_disable;
293   u32 pid;
294 };
295
296 /** \brief Want OAM events response
297     @param context - sender context, to match reply w/ request
298     @param retval - return code for the want oam stats request
299 */
300 define want_oam_events_reply
301 {
302   u32 context;
303   i32 retval;
304 };
305
306 /** \brief OAM add / del target request
307     @param client_index - opaque cookie to identify the sender
308     @param context - sender context, to match reply w/ request
309     @param vrf_id - vrf_id of the target
310     @param src_address[] - source address to use for the updates 
311     @param dst_address[] - destination address of the target
312     @param is_add - add target if non-zero, else delete
313 */
314 define oam_add_del
315 {
316   u32 client_index;
317   u32 context;
318   u32 vrf_id;
319   u8 src_address[4];
320   u8 dst_address[4];
321   u8 is_add;
322 };
323
324 /** \brief OAM add / del target response
325     @param context - sender context, to match reply w/ request
326     @param retval - return code of the request
327 */
328 define oam_add_del_reply
329 {
330   u32 context;
331   i32 retval;
332 };
333
334 /** \brief Reset fib table request
335     @param client_index - opaque cookie to identify the sender
336     @param context - sender context, to match reply w/ request
337     @param vrf_id - vrf/table id of the fib table to reset
338     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
339 */
340 define reset_fib
341 {
342   u32 client_index;
343   u32 context;
344   u32 vrf_id;
345   u8 is_ipv6;
346 };
347
348 /** \brief Reset fib response
349     @param context - sender context, to match reply w/ request
350     @param retval - return code for the reset bfib request
351 */
352 define reset_fib_reply
353 {
354   u32 context;
355   i32 retval;
356 };
357
358 /** \brief DHCP Proxy config add / del request
359     @param client_index - opaque cookie to identify the sender
360     @param context - sender context, to match reply w/ request
361     @param vrf_id - vrf id
362     @param if_ipv6 - ipv6 if non-zero, else ipv4
363     @param is_add - add the config if non-zero, else delete
364     @param insert_circuit_id - option82 suboption 1 fib number
365     @param dhcp_server[] - server address
366     @param dhcp_src_address[] - <fix this, need details>
367 */
368 define dhcp_proxy_config
369 {
370   u32 client_index;
371   u32 context;
372   u32 vrf_id;
373   u8 is_ipv6;
374   u8 is_add;
375   u8 insert_circuit_id;
376   u8 dhcp_server[16];
377   u8 dhcp_src_address[16];
378 };
379
380 /** \brief DHCP Proxy config response
381     @param context - sender context, to match reply w/ request
382     @param retval - return code for the request
383 */
384 define dhcp_proxy_config_reply
385 {
386   u32 context;
387   i32 retval;
388 };
389
390 /** \brief DHCP Proxy set / unset vss request
391     @param client_index - opaque cookie to identify the sender
392     @param context - sender context, to match reply w/ request
393     @param tbl_id - table id
394     @param oui - first part of vpn id
395     @param fib_id - second part of vpn id
396     @param is_ipv6 - ip6 if non-zero, else ip4
397     @param is_add - set vss if non-zero, else delete
398 */
399 define dhcp_proxy_set_vss
400 {
401   u32 client_index;
402   u32 context;
403   u32 tbl_id;
404   u32 oui;
405   u32 fib_id;
406   u8 is_ipv6;
407   u8 is_add;
408 };
409
410 /** \brief DHCP proxy set / unset vss response
411     @param context - sender context, to match reply w/ request
412     @param retval - return code for the request
413 */
414 define dhcp_proxy_set_vss_reply
415 {
416   u32 context;
417   i32 retval;
418 };
419
420 /** \brief Create loopback interface request
421     @param client_index - opaque cookie to identify the sender
422     @param context - sender context, to match reply w/ request
423     @param mac_address - mac addr to assign to the interface if none-zero
424 */
425 define create_loopback
426 {
427   u32 client_index;
428   u32 context;
429   u8 mac_address[6];
430 };
431
432 /** \brief Create loopback interface response
433     @param context - sender context, to match reply w/ request
434     @param sw_if_index - sw index of the interface that was created
435     @param retval - return code for the request
436 */
437 define create_loopback_reply
438 {
439   u32 context;
440   i32 retval;
441   u32 sw_if_index;
442 };
443
444 /** \brief Delete loopback interface request
445     @param client_index - opaque cookie to identify the sender
446     @param context - sender context, to match reply w/ request
447     @param sw_if_index - sw index of the interface that was created
448 */
449 define delete_loopback
450 {
451   u32 client_index;
452   u32 context;
453   u32 sw_if_index;
454 };
455
456 /** \brief Delete loopback interface response
457     @param context - sender context, to match reply w/ request
458     @param retval - return code for the request
459 */
460 define delete_loopback_reply
461 {
462   u32 context;
463   i32 retval;
464 };
465
466 /** \brief Control ping from client to api server request
467     @param client_index - opaque cookie to identify the sender
468     @param context - sender context, to match reply w/ request
469 */
470 define control_ping
471 {
472   u32 client_index;
473   u32 context;
474 };
475
476 /** \brief Control ping from the client to the server response
477     @param client_index - opaque cookie to identify the sender
478     @param context - sender context, to match reply w/ request
479     @param retval - return code for the request
480     @param vpe_pid - the pid of the vpe, returned by the server
481 */
482 define control_ping_reply
483 {
484   u32 context;
485   i32 retval;
486   u32 client_index;
487   u32 vpe_pid;
488 };
489
490 /** \brief Process a vpe parser cli string request
491     @param client_index - opaque cookie to identify the sender
492     @param context - sender context, to match reply w/ request
493     @param cmd_in_shmem - pointer to cli command string
494 */
495 define cli_request
496 {
497   u32 client_index;
498   u32 context;
499   u64 cmd_in_shmem;
500 };
501 define cli_inband
502 {
503   u32 client_index;
504   u32 context;
505   u32 length;
506   u8 cmd[length];
507 };
508
509 /** \brief vpe parser cli string response
510     @param context - sender context, to match reply w/ request
511     @param retval - return code for request
512     @param reply_in_shmem - Reply string from cli processing if any
513 */
514 define cli_reply
515 {
516   u32 context;
517   i32 retval;
518   u64 reply_in_shmem;
519 };
520 define cli_inband_reply
521 {
522   u32 context;
523   i32 retval;
524   u32 length;
525   u8 reply[length];
526 };
527
528 /** \brief Set max allowed ARP or ip6 neighbor entries request
529     @param client_index - opaque cookie to identify the sender
530     @param context - sender context, to match reply w/ request
531     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
532     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
533 */
534 define set_arp_neighbor_limit
535 {
536   u32 client_index;
537   u32 context;
538   u8 is_ipv6;
539   u32 arp_neighbor_limit;
540 };
541
542 /** \brief Set max allowed ARP or ip6 neighbor entries response
543     @param context - sender context, to match reply w/ request
544     @param retval - return code for request
545 */
546 define set_arp_neighbor_limit_reply
547 {
548   u32 context;
549   i32 retval;
550 };
551
552 /** \brief L2 interface patch add / del request
553     @param client_index - opaque cookie to identify the sender
554     @param context - sender context, to match reply w/ request
555     @param rx_sw_if_index - receive side interface 
556     @param tx_sw_if_index - transmit side interface
557     @param is_add - if non-zero set up the interface patch, else remove it
558 */
559 define l2_patch_add_del
560 {
561   u32 client_index;
562   u32 context;
563   u32 rx_sw_if_index;
564   u32 tx_sw_if_index;
565   u8 is_add;
566 };
567
568 /** \brief L2 interface patch add / del response
569     @param context - sender context, to match reply w/ request
570     @param retval - return code for the request
571 */
572 define l2_patch_add_del_reply
573 {
574   u32 context;
575   i32 retval;
576 };
577
578 /** \brief Interface set vpath request
579     @param client_index - opaque cookie to identify the sender
580     @param context - sender context, to match reply w/ request
581     @param sw_if_index - interface used to reach neighbor
582     @param enable - if non-zero enable, else disable
583 */
584 define sw_interface_set_vpath
585 {
586   u32 client_index;
587   u32 context;
588   u32 sw_if_index;
589   u8 enable;
590 };
591
592 /** \brief Interface set vpath response
593     @param context - sender context, to match reply w/ request
594     @param retval - return code for the request
595 */
596 define sw_interface_set_vpath_reply
597 {
598   u32 context;
599   i32 retval;
600 };
601
602 /** \brief Set L2 XConnect between two interfaces request
603     @param client_index - opaque cookie to identify the sender
604     @param context - sender context, to match reply w/ request
605     @param rx_sw_if_index - Receive interface index
606     @param tx_sw_if_index - Transmit interface index
607     @param enable - enable xconnect if not 0, else set to L3 mode
608 */
609 define sw_interface_set_l2_xconnect
610 {
611   u32 client_index;
612   u32 context;
613   u32 rx_sw_if_index;
614   u32 tx_sw_if_index;
615   u8 enable;
616 };
617
618 /** \brief Set L2 XConnect response
619     @param context - sender context, to match reply w/ request
620     @param retval - L2 XConnect request return code
621 */
622 define sw_interface_set_l2_xconnect_reply
623 {
624   u32 context;
625   i32 retval;
626 };
627
628 /** \brief Interface bridge mode request
629     @param client_index - opaque cookie to identify the sender
630     @param context - sender context, to match reply w/ request
631     @param rx_sw_if_index - the interface
632     @param bd_id - bridge domain id
633     @param bvi - Setup interface as a bvi, bridge mode only
634     @param shg - Shared horizon group, for bridge mode only
635     @param enable - Enable beige mode if not 0, else set to L3 mode
636 */
637 define sw_interface_set_l2_bridge
638 {
639   u32 client_index;
640   u32 context;
641   u32 rx_sw_if_index;
642   u32 bd_id;
643   u8 shg;
644   u8 bvi;
645   u8 enable;
646 };
647
648 /** \brief Interface bridge mode response
649     @param context - sender context, to match reply w/ request
650     @param retval - Bridge mode request return code
651 */
652 define sw_interface_set_l2_bridge_reply
653 {
654   u32 context;
655   i32 retval;
656 };
657
658 /** \brief Set bridge domain ip to mac entry request
659     @param client_index - opaque cookie to identify the sender
660     @param context - sender context, to match reply w/ request
661     @param bd_id - the bridge domain to set the flags for
662     @param is_add - if non-zero, add the entry, else clear it
663     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
664     @param mac_address - MAC address
665     @param 
666 */
667 define bd_ip_mac_add_del
668 {
669   u32 client_index;
670   u32 context;
671   u32 bd_id;
672   u8 is_add;
673   u8 is_ipv6;
674   u8 ip_address[16];
675   u8 mac_address[6];
676 };
677
678 /** \brief Set bridge domain ip to mac entry response
679     @param context - sender context, to match reply w/ request
680     @param retval - return code for the set bridge flags request
681 */
682 define bd_ip_mac_add_del_reply
683 {
684   u32 context;
685   i32 retval;
686 };
687
688 /** \brief Add/Delete classification table request
689     @param client_index - opaque cookie to identify the sender
690     @param context - sender context, to match reply w/ request
691     @param is_add- if non-zero add the table, else delete it
692     @param del_chain - if non-zero delete the whole chain of tables
693     @param table_index - if add, reuturns index of the created table, else specifies the table to delete  
694     @param nbuckets - number of buckets when adding a table
695     @param memory_size - memory size when adding a table
696     @param match_n_vectors - number of match vectors
697     @param next_table_index - index of next table
698     @param miss_next_index - index of miss table
699     @param current_data_flag - option to use current node's packet payload
700             as the starting point from where packets are classified,
701             This option is only valid for L2/L3 input ACL for now.
702             0: by default, classify data from the buffer's start location
703             1: classify packets from VPP node’s current data pointer
704     @param current_data_offset - a signed value to shift the start location of
705             the packet to be classified
706             For example, if input IP ACL node is used, L2 header’s first byte
707             can be accessible by configuring current_data_offset to -14
708             if there is no vlan tag.
709             This is valid only if current_data_flag is set to 1.
710     @param mask[] - match mask
711 */
712 define classify_add_del_table
713 {
714   u32 client_index;
715   u32 context;
716   u8 is_add;
717   u8 del_chain;
718   u32 table_index;
719   u32 nbuckets;
720   u32 memory_size;
721   u32 skip_n_vectors;
722   u32 match_n_vectors;
723   u32 next_table_index;
724   u32 miss_next_index;
725   u32 current_data_flag;
726   i32 current_data_offset;
727   u8 mask[0];
728 };
729
730 /** \brief Add/Delete classification table response
731     @param context - sender context, to match reply w/ request
732     @param retval - return code for the table add/del requst
733     @param new_table_index - for add, returned index of the new table
734     @param skip_n_vectors - for add, returned value of skip_n_vectors in table
735     @param match_n_vectors -for add, returned value of match_n_vectors in table
736 */
737 define classify_add_del_table_reply
738 {
739   u32 context;
740   i32 retval;
741   u32 new_table_index;
742   u32 skip_n_vectors;
743   u32 match_n_vectors;
744 };
745
746 /** \brief Classify add / del session request
747     @param client_index - opaque cookie to identify the sender
748     @param context - sender context, to match reply w/ request
749     @param is_add - add session if non-zero, else delete
750     @param table_index - index of the table to add/del the session, required
751     @param hit_next_index - for add, hit_next_index of new session, required
752     @param opaque_index - for add, opaque_index of new session
753     @param advance -for add, advance value for session
754     @param action -
755            0: no action (by default)
756               metadata is not used.
757            1: Classified IP packets will be looked up from the
758               specified ipv4 fib table (configured by metadata as VRF id).
759               Only valid for L3 input ACL node
760            2: Classified IP packets will be looked up from the
761               specified ipv6 fib table (configured by metadata as VRF id).
762               Only valid for L3 input ACL node
763     @param metadata - valid only if action != 0
764            VRF id if action is 1 or 2.
765     @param match[] - for add, match value for session, required
766 */
767 define classify_add_del_session
768 {
769   u32 client_index;
770   u32 context;
771   u8 is_add;
772   u32 table_index;
773   u32 hit_next_index;
774   u32 opaque_index;
775   i32 advance;
776   u8 action;
777   u32 metadata;
778   u8 match[0];
779 };
780
781 /** \brief Classify add / del session response
782     @param context - sender context, to match reply w/ request
783     @param retval - return code for the add/del session request
784 */
785 define classify_add_del_session_reply
786 {
787   u32 context;
788   i32 retval;
789 };
790
791 /** \brief Set/unset the classification table for an interface request 
792     @param client_index - opaque cookie to identify the sender
793     @param context - sender context, to match reply w/ request
794     @param is_ipv6 - ipv6 if non-zero, else ipv4
795     @param sw_if_index - interface to associate with the table
796     @param table_index - index of the table, if ~0 unset the table
797 */
798 define classify_set_interface_ip_table
799 {
800   u32 client_index;
801   u32 context;
802   u8 is_ipv6;
803   u32 sw_if_index;
804   u32 table_index;              /* ~0 => off */
805 };
806
807 /** \brief Set/unset interface classification table response 
808     @param context - sender context, to match reply w/ request
809     @param retval - return code
810 */
811 define classify_set_interface_ip_table_reply
812 {
813   u32 context;
814   i32 retval;
815 };
816
817 /** \brief Set/unset l2 classification tables for an interface request
818     @param client_index - opaque cookie to identify the sender
819     @param context - sender context, to match reply w/ request
820     @param sw_if_index - interface to set/unset tables for
821     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
822     @param ip6_table_index - ip6 index
823     @param other_table_index - other index
824 */
825 define classify_set_interface_l2_tables
826 {
827   u32 client_index;
828   u32 context;
829   u32 sw_if_index;
830   /* 3 x ~0 => off */
831   u32 ip4_table_index;
832   u32 ip6_table_index;
833   u32 other_table_index;
834   u8 is_input;
835 };
836
837 /** \brief Set/unset l2 classification tables for an interface response
838     @param context - sender context, to match reply w/ request
839     @param retval - return code for the request
840 */
841 define classify_set_interface_l2_tables_reply
842 {
843   u32 context;
844   i32 retval;
845 };
846
847 /** \brief Get node index using name request
848     @param client_index - opaque cookie to identify the sender
849     @param context - sender context, to match reply w/ request
850     @param node_name[] - name of the node
851 */
852 define get_node_index
853 {
854   u32 client_index;
855   u32 context;
856   u8 node_name[64];
857 };
858
859 /** \brief Get node index using name request
860     @param context - sender context, to match reply w/ request
861     @param retval - return code for the request
862     @param node_index - index of the desired node if found, else ~0
863 */
864 define get_node_index_reply
865 {
866   u32 context;
867   i32 retval;
868   u32 node_index;
869 };
870
871 /** \brief Set the next node for a given node request
872     @param client_index - opaque cookie to identify the sender
873     @param context - sender context, to match reply w/ request
874     @param node_name[] - node to add the next node to
875     @param next_name[] - node to add as the next node
876 */
877 define add_node_next
878 {
879   u32 client_index;
880   u32 context;
881   u8 node_name[64];
882   u8 next_name[64];
883 };
884
885 /** \brief IP Set the next node for a given node response
886     @param context - sender context, to match reply w/ request
887     @param retval - return code for the add next node request
888     @param next_index - the index of the next node if success, else ~0
889 */
890 define add_node_next_reply
891 {
892   u32 context;
893   i32 retval;
894   u32 next_index;
895 };
896
897 /** \brief DHCP Proxy config 2 add / del request
898     @param client_index - opaque cookie to identify the sender
899     @param context - sender context, to match reply w/ request
900     @param rx_vrf_id - receive vrf id
901     @param server_vrf_id - server vrf id
902     @param if_ipv6 - ipv6 if non-zero, else ipv4
903     @param is_add - add the config if non-zero, else delete
904     @param insert_circuit_id - option82 suboption 1 fib number
905     @param dhcp_server[] - server address
906     @param dhcp_src_address[] - <fix this, need details>
907 */
908 define dhcp_proxy_config_2
909 {
910   u32 client_index;
911   u32 context;
912   u32 rx_vrf_id;
913   u32 server_vrf_id;
914   u8 is_ipv6;
915   u8 is_add;
916   u8 insert_circuit_id;
917   u8 dhcp_server[16];
918   u8 dhcp_src_address[16];
919 };
920
921 /** \brief DHCP Proxy config 2 add / del response
922     @param context - sender context, to match reply w/ request
923     @param retval - return code for request
924 */
925 define dhcp_proxy_config_2_reply
926 {
927   u32 context;
928   i32 retval;
929 };
930
931 /** \brief L2 interface ethernet flow point filtering enable/disable request
932     @param client_index - opaque cookie to identify the sender
933     @param context - sender context, to match reply w/ request
934     @param sw_if_index - interface to enable/disable filtering on
935     @param enable_disable - if non-zero enable filtering, else disable
936 */
937 define l2_interface_efp_filter
938 {
939   u32 client_index;
940   u32 context;
941   u32 sw_if_index;
942   u32 enable_disable;
943 };
944
945 /** \brief L2 interface ethernet flow point filtering response
946     @param context - sender context, to match reply w/ request
947     @param retval - return code for the request
948 */
949 define l2_interface_efp_filter_reply
950 {
951   u32 context;
952   i32 retval;
953 };
954
955 /** \brief L2 interface vlan tag rewrite configure request
956     @param client_index - opaque cookie to identify the sender
957     @param context - sender context, to match reply w/ request
958     @param sw_if_index - interface the operation is applied to
959     @param vtr_op - Choose from l2_vtr_op_t enum values
960     @param push_dot1q - first pushed flag dot1q id set, else dot1ad
961     @param tag1 - Needed for any push or translate vtr op
962     @param tag2 - Needed for any push 2 or translate x-2 vtr ops
963 */
964 define l2_interface_vlan_tag_rewrite
965 {
966   u32 client_index;
967   u32 context;
968   u32 sw_if_index;
969   u32 vtr_op;
970   u32 push_dot1q;               // ethertype of first pushed tag is dot1q/dot1ad
971   u32 tag1;                     // first pushed tag
972   u32 tag2;                     // second pushed tag
973 };
974
975 /** \brief L2 interface vlan tag rewrite response
976     @param context - sender context, to match reply w/ request
977     @param retval - return code for the request
978 */
979 define l2_interface_vlan_tag_rewrite_reply
980 {
981   u32 context;
982   i32 retval;
983 };
984
985 define create_subif
986 {
987   u32 client_index;
988   u32 context;
989   u32 sw_if_index;
990   u32 sub_id;
991
992   /* These fields map directly onto the subif template */
993   u8 no_tags;
994   u8 one_tag;
995   u8 two_tags;
996   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
997   u8 exact_match;
998   u8 default_sub;
999   u8 outer_vlan_id_any;
1000   u8 inner_vlan_id_any;
1001   u16 outer_vlan_id;
1002   u16 inner_vlan_id;
1003 };
1004
1005 define create_subif_reply
1006 {
1007   u32 context;
1008   i32 retval;
1009   u32 sw_if_index;
1010 };
1011
1012 /** \brief show version
1013     @param client_index - opaque cookie to identify the sender
1014     @param context - sender context, to match reply w/ request
1015 */
1016 define show_version
1017 {
1018   u32 client_index;
1019   u32 context;
1020 };
1021
1022 /** \brief show version response
1023     @param context - sender context, to match reply w/ request
1024     @param retval - return code for the request
1025     @param program - name of the program (vpe)
1026     @param version  - version of the program
1027     @param build_directory - root of the workspace where the program was built
1028 */
1029 define show_version_reply
1030 {
1031   u32 context;
1032   i32 retval;
1033   u8 program[32];
1034   u8 version[32];
1035   u8 build_date[32];
1036   u8 build_directory[256];
1037 };
1038
1039 /* Gross kludge, DGMS */
1040 define interface_name_renumber
1041 {
1042   u32 client_index;
1043   u32 context;
1044   u32 sw_if_index;
1045   u32 new_show_dev_instance;
1046 };
1047
1048 define interface_name_renumber_reply
1049 {
1050   u32 context;
1051   i32 retval;
1052 };
1053
1054 /** \brief Register for ip4 arp resolution events
1055     @param client_index - opaque cookie to identify the sender
1056     @param context - sender context, to match reply w/ request
1057     @param enable_disable - 1 => register for events, 0 => cancel registration
1058     @param pid - sender's pid
1059     @param address - the exact ip4 address of interest
1060 */
1061 define want_ip4_arp_events
1062 {
1063   u32 client_index;
1064   u32 context;
1065   u8 enable_disable;
1066   u32 pid;
1067   u32 address;
1068 };
1069
1070 /** \brief Reply for interface events registration
1071     @param context - returned sender context, to match reply w/ request
1072     @param retval - return code
1073 */
1074 define want_ip4_arp_events_reply
1075 {
1076   u32 context;
1077   i32 retval;
1078 };
1079
1080 /** \brief Tell client about an ip4 arp resolution event
1081     @param client_index - opaque cookie to identify the sender
1082     @param context - sender context, to match reply w/ request
1083     @param address - the exact ip4 address of interest
1084     @param pid - client pid registered to receive notification
1085     @param sw_if_index - interface which received ARP packet
1086     @param new_mac - the new mac address 
1087     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
1088 */
1089 define ip4_arp_event
1090 {
1091   u32 client_index;
1092   u32 context;
1093   u32 address;
1094   u32 pid;
1095   u32 sw_if_index;
1096   u8 new_mac[6];
1097   u8 mac_ip;
1098 };
1099
1100 /** \brief Register for ip6 nd resolution events
1101     @param client_index - opaque cookie to identify the sender
1102     @param context - sender context, to match reply w/ request
1103     @param enable_disable - 1 => register for events, 0 => cancel registration
1104     @param pid - sender's pid
1105     @param address - the exact ip6 address of interest
1106 */
1107 define want_ip6_nd_events
1108 {
1109   u32 client_index;
1110   u32 context;
1111   u8 enable_disable;
1112   u32 pid;
1113   u8 address[16];
1114 };
1115
1116 /** \brief Reply for ip6 nd resolution events registration
1117     @param context - returned sender context, to match reply w/ request
1118     @param retval - return code
1119 */
1120 define want_ip6_nd_events_reply
1121 {
1122   u32 context;
1123   i32 retval;
1124 };
1125
1126 /** \brief Tell client about an ip6 nd resolution or mac/ip event
1127     @param client_index - opaque cookie to identify the sender
1128     @param context - sender context, to match reply w/ request
1129     @param pid - client pid registered to receive notification
1130     @param sw_if_index - interface which received ARP packet
1131     @param address - the exact ip6 address of interest
1132     @param new_mac - the new mac address 
1133     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
1134 */
1135 define ip6_nd_event
1136 {
1137   u32 client_index;
1138   u32 context;
1139   u32 pid;
1140   u32 sw_if_index;
1141   u8 address[16];
1142   u8 new_mac[6];
1143   u8 mac_ip;
1144 };
1145     
1146 /** \brief DHCP Client config add / del request
1147     @param client_index - opaque cookie to identify the sender
1148     @param context - sender context, to match reply w/ request
1149     @param sw_if_index - index of the interface for DHCP client
1150     @param hostname - hostname
1151     @param is_add - add the config if non-zero, else delete
1152     @param want_dhcp_event - DHCP event sent to the sender
1153            via dhcp_compl_event API message if non-zero
1154     @param pid - sender's pid
1155 */
1156 define dhcp_client_config
1157 {
1158   u32 client_index;
1159   u32 context;
1160   u32 sw_if_index;
1161   u8 hostname[64];
1162   u8 is_add;
1163   u8 want_dhcp_event;
1164   u32 pid;
1165 };
1166
1167 /** \brief DHCP Client config response
1168     @param context - sender context, to match reply w/ request
1169     @param retval - return code for the request
1170 */
1171 define dhcp_client_config_reply
1172 {
1173   u32 context;
1174   i32 retval;
1175 };
1176
1177 /** \brief Set/unset input ACL interface
1178     @param client_index - opaque cookie to identify the sender
1179     @param context - sender context, to match reply w/ request
1180     @param sw_if_index - interface to set/unset input ACL
1181     @param ip4_table_index - ip4 classify table index (~0 for skip)
1182     @param ip6_table_index - ip6 classify table index (~0 for skip)
1183     @param l2_table_index  -  l2 classify table index (~0 for skip)
1184     @param is_add - Set input ACL if non-zero, else unset
1185     Note: User is recommeneded to use just one valid table_index per call.
1186           (ip4_table_index, ip6_table_index, or l2_table_index)
1187 */
1188 define input_acl_set_interface
1189 {
1190   u32 client_index;
1191   u32 context;
1192   u32 sw_if_index;
1193   u32 ip4_table_index;
1194   u32 ip6_table_index;
1195   u32 l2_table_index;
1196   u8 is_add;
1197 };
1198
1199 /** \brief Set/unset input ACL interface response
1200     @param context - sender context, to match reply w/ request
1201     @param retval - return code for the request
1202 */
1203 define input_acl_set_interface_reply
1204 {
1205   u32 context;
1206   i32 retval;
1207 };
1208
1209 /** \brief Tell client about a DHCP completion event
1210     @param client_index - opaque cookie to identify the sender
1211     @param pid - client pid registered to receive notification
1212     @param is_ipv6 - if non-zero the address is ipv6, else ipv4
1213     @param host_address - Host IP address
1214     @param router_address - Router IP address
1215     @param host_mac - Host MAC address
1216 */
1217 define dhcp_compl_event
1218 {
1219   u32 client_index;
1220   u32 pid;
1221   u8 hostname[64];
1222   u8 is_ipv6;
1223   u8 host_address[16];
1224   u8 router_address[16];
1225   u8 host_mac[6];
1226 };
1227
1228 /** \brief cop: enable/disable junk filtration features on an interface
1229     @param client_index - opaque cookie to identify the sender
1230     @param context - sender context, to match reply w/ request
1231     @param sw_if_inded - desired interface
1232     @param enable_disable - 1 => enable, 0 => disable
1233 */
1234
1235 define cop_interface_enable_disable
1236 {
1237   u32 client_index;
1238   u32 context;
1239   u32 sw_if_index;
1240   u8 enable_disable;
1241 };
1242
1243 /** \brief cop: interface enable/disable junk filtration reply
1244     @param context - returned sender context, to match reply w/ request
1245     @param retval - return code
1246 */
1247
1248 define cop_interface_enable_disable_reply
1249 {
1250   u32 context;
1251   i32 retval;
1252 };
1253
1254 /** \brief cop: enable/disable whitelist filtration features on an interface
1255     Note: the supplied fib_id must match in order to remove the feature!
1256     
1257     @param client_index - opaque cookie to identify the sender
1258     @param context - sender context, to match reply w/ request
1259     @param sw_if_index - interface handle, physical interfaces only
1260     @param fib_id - fib identifier for the whitelist / blacklist fib
1261     @param ip4 - 1 => enable ip4 filtration, 0=> disable ip4 filtration
1262     @param ip6 - 1 => enable ip6 filtration, 0=> disable ip6 filtration
1263     @param default_cop -  1 => enable non-ip4, non-ip6 filtration 0=> disable it
1264 */
1265
1266 define cop_whitelist_enable_disable
1267 {
1268   u32 client_index;
1269   u32 context;
1270   u32 sw_if_index;
1271   u32 fib_id;
1272   u8 ip4;
1273   u8 ip6;
1274   u8 default_cop;
1275 };
1276
1277 /** \brief cop: interface enable/disable junk filtration reply
1278     @param context - returned sender context, to match reply w/ request
1279     @param retval - return code
1280 */
1281
1282 define cop_whitelist_enable_disable_reply
1283 {
1284   u32 context;
1285   i32 retval;
1286 };
1287
1288 /** \brief get_node_graph - get a copy of the vpp node graph
1289     including the current set of graph arcs.
1290
1291     @param client_index - opaque cookie to identify the sender
1292     @param context - sender context, to match reply w/ request
1293 */
1294
1295 define get_node_graph
1296 {
1297   u32 client_index;
1298   u32 context;
1299 };
1300
1301 /** \brief get_node_graph_reply
1302     @param context - returned sender context, to match reply w/ request
1303     @param retval - return code
1304     @param reply_in_shmem - result from vlib_node_serialize, in shared
1305     memory. Process with vlib_node_unserialize, remember to switch
1306     heaps and free the result.
1307 */
1308
1309 define get_node_graph_reply
1310 {
1311   u32 context;
1312   i32 retval;
1313   u64 reply_in_shmem;
1314 };
1315
1316 /** \brief IOAM enable : Enable in-band OAM
1317     @param id - profile id
1318     @param seqno - To enable Seqno Processing
1319     @param analyse - Enabling analysis of iOAM at decap node 
1320     @param pow_enable - Proof of Work enabled or not flag
1321     @param trace_enable - iOAM Trace enabled or not flag
1322 */
1323 define ioam_enable
1324 {
1325   u32 client_index;
1326   u32 context;
1327   u16 id;
1328   u8 seqno;
1329   u8 analyse;
1330   u8 pot_enable;
1331   u8 trace_enable;
1332   u32 node_id;
1333 };
1334
1335 /** \brief iOAM Trace profile add / del response
1336     @param context - sender context, to match reply w/ request
1337     @param retval - return value for request
1338 */
1339 define ioam_enable_reply
1340 {
1341   u32 context;
1342   i32 retval;
1343 };
1344
1345 /** \brief iOAM disable
1346     @param client_index - opaque cookie to identify the sender
1347     @param context - sender context, to match reply w/ request
1348     @param index - MAP Domain index
1349 */
1350 define ioam_disable
1351 {
1352   u32 client_index;
1353   u32 context;
1354   u16 id;
1355 };
1356
1357 /** \brief iOAM disable response
1358     @param context - sender context, to match reply w/ request
1359     @param retval - return value for request
1360 */
1361 define ioam_disable_reply
1362 {
1363   u32 context;
1364   i32 retval;
1365 };
1366
1367 /** \brief Add/del policer
1368     @param client_index - opaque cookie to identify the sender
1369     @param context - sender context, to match reply w/ request
1370     @param is_add - add policer if non-zero, else delete
1371     @param name - policer name
1372     @param cir - CIR
1373     @param eir - EIR
1374     @param cb - Committed Burst
1375     @param eb - Excess or Peak Burst
1376     @param rate_type - rate type
1377     @param round_type - rounding type
1378     @param type - policer algorithm
1379     @param color_aware - 0=color-blind, 1=color-aware
1380     @param conform_action_type - conform action type
1381     @param conform_dscp - DSCP for conform mar-and-transmit action
1382     @param exceed_action_type - exceed action type
1383     @param exceed_dscp - DSCP for exceed mar-and-transmit action
1384     @param violate_action_type - violate action type
1385     @param violate_dscp - DSCP for violate mar-and-transmit action
1386 */
1387 define policer_add_del
1388 {
1389   u32 client_index;
1390   u32 context;
1391
1392   u8 is_add;
1393   u8 name[64];
1394   u32 cir;
1395   u32 eir;
1396   u64 cb;
1397   u64 eb;
1398   u8 rate_type;
1399   u8 round_type;
1400   u8 type;
1401   u8 color_aware;
1402   u8 conform_action_type;
1403   u8 conform_dscp;
1404   u8 exceed_action_type;
1405   u8 exceed_dscp;
1406   u8 violate_action_type;
1407   u8 violate_dscp;
1408 };
1409
1410 /** \brief Add/del policer response
1411     @param context - sender context, to match reply w/ request
1412     @param retval - return value for request
1413     @param policer_index - for add, returned index of the new policer
1414 */
1415 define policer_add_del_reply
1416 {
1417   u32 context;
1418   i32 retval;
1419   u32 policer_index;
1420 };
1421
1422 /** \brief Get list of policers
1423     @param client_index - opaque cookie to identify the sender
1424     @param context - sender context, to match reply w/ request
1425     @param match_name_valid - if 0 request all policers otherwise use match_name
1426     @param match_name - policer name
1427 */
1428 define policer_dump
1429 {
1430   u32 client_index;
1431   u32 context;
1432
1433   u8 match_name_valid;
1434   u8 match_name[64];
1435 };
1436
1437 /** \brief Policer operational state response.
1438     @param context - sender context, to match reply w/ request
1439     @param name - policer name
1440     @param cir - CIR
1441     @param eir - EIR
1442     @param cb - Committed Burst
1443     @param eb - Excess or Peak Burst
1444     @param rate_type - rate type
1445     @param round_type - rounding type
1446     @param type - policer algorithm
1447     @param conform_action_type - conform action type
1448     @param conform_dscp - DSCP for conform mar-and-transmit action
1449     @param exceed_action_type - exceed action type
1450     @param exceed_dscp - DSCP for exceed mar-and-transmit action
1451     @param violate_action_type - violate action type
1452     @param violate_dscp - DSCP for violate mar-and-transmit action
1453     @param single_rate - 1 = single rate policer, 0 = two rate policer
1454     @param color_aware - for hierarchical policing
1455     @param scale - power-of-2 shift amount for lower rates
1456     @param cir_tokens_per_period - number of tokens for each period
1457     @param pir_tokens_per_period - number of tokens for each period for 2-rate policer
1458     @param current_limit - current limit
1459     @param current_bucket - current bucket
1460     @param extended_limit - extended limit
1461     @param extended_bucket - extended bucket
1462     @param last_update_time - last update time
1463 */
1464 define policer_details
1465 {
1466   u32 context;
1467
1468   u8 name[64];
1469   u32 cir;
1470   u32 eir;
1471   u64 cb;
1472   u64 eb;
1473   u8 rate_type;
1474   u8 round_type;
1475   u8 type;
1476   u8 conform_action_type;
1477   u8 conform_dscp;
1478   u8 exceed_action_type;
1479   u8 exceed_dscp;
1480   u8 violate_action_type;
1481   u8 violate_dscp;
1482   u8 single_rate;
1483   u8 color_aware;
1484   u32 scale;
1485   u32 cir_tokens_per_period;
1486   u32 pir_tokens_per_period;
1487   u32 current_limit;
1488   u32 current_bucket;
1489   u32 extended_limit;
1490   u32 extended_bucket;
1491   u64 last_update_time;
1492 };
1493
1494 /** \brief Set/unset policer classify interface
1495     @param client_index - opaque cookie to identify the sender
1496     @param context - sender context, to match reply w/ request
1497     @param sw_if_index - interface to set/unset policer classify
1498     @param ip4_table_index - ip4 classify table index (~0 for skip)
1499     @param ip6_table_index - ip6 classify table index (~0 for skip)
1500     @param l2_table_index  -  l2 classify table index (~0 for skip)
1501     @param is_add - Set if non-zero, else unset
1502     Note: User is recommeneded to use just one valid table_index per call.
1503           (ip4_table_index, ip6_table_index, or l2_table_index)
1504 */
1505 define policer_classify_set_interface
1506 {
1507   u32 client_index;
1508   u32 context;
1509   u32 sw_if_index;
1510   u32 ip4_table_index;
1511   u32 ip6_table_index;
1512   u32 l2_table_index;
1513   u8 is_add;
1514 };
1515
1516 /** \brief Set/unset policer classify interface response
1517     @param context - sender context, to match reply w/ request
1518     @param retval - return value for request
1519 */
1520 define policer_classify_set_interface_reply
1521 {
1522   u32 context;
1523   i32 retval;
1524 };
1525
1526 /** \brief Get list of policer classify interfaces and tables
1527     @param client_index - opaque cookie to identify the sender
1528     @param context - sender context, to match reply w/ request
1529     @param type - classify table type
1530 */
1531 define policer_classify_dump
1532 {
1533   u32 client_index;
1534   u32 context;
1535   u8 type;
1536 };
1537
1538 /** \brief Policer iclassify operational state response.
1539     @param context - sender context, to match reply w/ request
1540     @param sw_if_index - software interface index
1541     @param table_index - classify table index
1542 */
1543 define policer_classify_details
1544 {
1545   u32 context;
1546   u32 sw_if_index;
1547   u32 table_index;
1548 };
1549
1550 /** \brief Classify get table IDs request
1551     @param client_index - opaque cookie to identify the sender
1552     @param context - sender context, to match reply w/ request
1553 */
1554 define classify_table_ids
1555 {
1556   u32 client_index;
1557   u32 context;
1558 };
1559
1560 /** \brief Reply for classify get table IDs request
1561     @param context - sender context which was passed in the request
1562     @param count - number of ids returned in response
1563     @param ids - array of classify table ids
1564 */
1565 define classify_table_ids_reply
1566 {
1567   u32 context;
1568   i32 retval;
1569   u32 count;
1570   u32 ids[count];
1571 };
1572
1573 /** \brief Classify table ids by interface index request
1574     @param client_index - opaque cookie to identify the sender
1575     @param context - sender context, to match reply w/ request
1576     @param sw_if_index - index of the interface
1577 */
1578 define classify_table_by_interface
1579 {
1580   u32 client_index;
1581   u32 context;
1582   u32 sw_if_index;
1583 };
1584
1585 /** \brief Reply for classify table id by interface index request
1586     @param context - sender context which was passed in the request
1587     @param count - number of ids returned in response
1588     @param sw_if_index - index of the interface
1589     @param l2_table_id - l2 classify table index
1590     @param ip4_table_id - ip4 classify table index
1591     @param ip6_table_id - ip6 classify table index
1592 */
1593 define classify_table_by_interface_reply
1594 {
1595   u32 context;
1596   i32 retval;
1597   u32 sw_if_index;
1598   u32 l2_table_id;
1599   u32 ip4_table_id;
1600   u32 ip6_table_id;
1601 };
1602
1603 /** \brief Classify table info
1604     @param client_index - opaque cookie to identify the sender
1605     @param context - sender context, to match reply w/ request
1606     @param table_id - classify table index
1607 */
1608 define classify_table_info
1609 {
1610   u32 client_index;
1611   u32 context;
1612   u32 table_id;
1613 };
1614
1615 /** \brief Reply for classify table info request
1616     @param context - sender context which was passed in the request
1617     @param count - number of ids returned in response
1618     @param table_id - classify table index
1619     @param nbuckets - number of buckets when adding a table
1620     @param match_n_vectors - number of match vectors
1621     @param skip_n_vectors - number of skip_n_vectors
1622     @param active_sessions - number of sessions (active entries)
1623     @param next_table_index - index of next table
1624     @param miss_next_index - index of miss table
1625     @param mask[] - match mask
1626 */
1627 define classify_table_info_reply
1628 {
1629   u32 context;
1630   i32 retval;
1631   u32 table_id;
1632   u32 nbuckets;
1633   u32 match_n_vectors;
1634   u32 skip_n_vectors;
1635   u32 active_sessions;
1636   u32 next_table_index;
1637   u32 miss_next_index;
1638   u32 mask_length;
1639   u8 mask[mask_length];
1640 };
1641
1642 /** \brief Classify sessions dump request
1643     @param client_index - opaque cookie to identify the sender
1644     @param context - sender context, to match reply w/ request
1645     @param table_id - classify table index
1646 */
1647 define classify_session_dump
1648 {
1649   u32 client_index;
1650   u32 context;
1651   u32 table_id;
1652 };
1653
1654 /** \brief Reply for classify table session dump request
1655     @param context - sender context which was passed in the request
1656     @param count - number of ids returned in response
1657     @param table_id - classify table index
1658     @param hit_next_index - hit_next_index of session
1659     @param opaque_index - for add, opaque_index of session
1660     @param advance - advance value of session
1661     @param match[] - match value for session
1662 */
1663 define classify_session_details
1664 {
1665   u32 context;
1666   i32 retval;
1667   u32 table_id;
1668   u32 hit_next_index;
1669   i32 advance;
1670   u32 opaque_index;
1671   u32 match_length;
1672   u8 match[match_length];
1673 };
1674
1675 /** \brief Configure IPFIX exporter process request
1676     @param client_index - opaque cookie to identify the sender
1677     @param context - sender context, to match reply w/ request
1678     @param collector_address - address of IPFIX collector
1679     @param collector_port - port of IPFIX collector
1680     @param src_address - address of IPFIX exporter
1681     @param vrf_id - VRF / fib table ID
1682     @param path_mtu - Path MTU between exporter and collector
1683     @param template_interval - number of seconds after which to resend template
1684     @param udp_checksum - UDP checksum calculation enable flag
1685 */
1686 define set_ipfix_exporter
1687 {
1688   u32 client_index;
1689   u32 context;
1690   u8 collector_address[16];
1691   u16 collector_port;
1692   u8 src_address[16];
1693   u32 vrf_id;
1694   u32 path_mtu;
1695   u32 template_interval;
1696   u8 udp_checksum;
1697 };
1698
1699 /** \brief Reply to IPFIX exporter configure request
1700     @param context - sender context which was passed in the request
1701 */
1702 define set_ipfix_exporter_reply
1703 {
1704   u32 context;
1705   i32 retval;
1706 };
1707
1708 /** \brief IPFIX exporter dump request
1709     @param client_index - opaque cookie to identify the sender
1710     @param context - sender context, to match reply w/ request
1711 */
1712 define ipfix_exporter_dump
1713 {
1714   u32 client_index;
1715   u32 context;
1716 };
1717
1718 /** \brief Reply to IPFIX exporter dump request
1719     @param context - sender context which was passed in the request
1720     @param collector_address - address of IPFIX collector
1721     @param collector_port - port of IPFIX collector
1722     @param src_address - address of IPFIX exporter
1723     @param fib_index - fib table index
1724     @param path_mtu - Path MTU between exporter and collector
1725     @param template_interval - number of seconds after which to resend template
1726     @param udp_checksum - UDP checksum calculation enable flag
1727 */
1728 define ipfix_exporter_details
1729 {
1730   u32 context;
1731   u8 collector_address[16];
1732   u16 collector_port;
1733   u8 src_address[16];
1734   u32 vrf_id;
1735   u32 path_mtu;
1736   u32 template_interval;
1737   u8 udp_checksum;
1738 };
1739
1740 /** \brief IPFIX classify stream configure request
1741     @param client_index - opaque cookie to identify the sender
1742     @param context - sender context, to match reply w/ request
1743     @param domain_id - domain ID reported in IPFIX messages for classify stream
1744     @param src_port - source port of UDP session for classify stream
1745 */
1746 define set_ipfix_classify_stream {
1747     u32 client_index;
1748     u32 context;
1749     u32 domain_id;
1750     u16 src_port;
1751 };
1752
1753 /** \brief IPFIX classify stream configure response
1754     @param context - sender context, to match reply w/ request
1755     @param retval - return value for request
1756 */
1757 define set_ipfix_classify_stream_reply {
1758     u32 context;
1759     i32 retval;
1760 };
1761
1762 /** \brief IPFIX classify stream dump request
1763     @param client_index - opaque cookie to identify the sender
1764     @param context - sender context, to match reply w/ request
1765 */
1766 define ipfix_classify_stream_dump {
1767     u32 client_index;
1768     u32 context;
1769 };
1770
1771 /** \brief Reply to IPFIX classify stream dump request
1772     @param context - sender context, to match reply w/ request
1773     @param domain_id - domain ID reported in IPFIX messages for classify stream
1774     @param src_port - source port of UDP session for classify stream
1775 */
1776 define ipfix_classify_stream_details {
1777     u32 context;
1778     u32 domain_id;
1779     u16 src_port;
1780 };
1781
1782 /** \brief IPFIX add or delete classifier table request
1783     @param client_index - opaque cookie to identify the sender
1784     @param context - sender context, to match reply w/ request
1785     @param table_id - classifier table ID
1786     @param ip_version - version of IP used in the classifier table
1787     @param transport_protocol - transport protocol used in the classifier table or 255 for unspecified
1788 */
1789 define ipfix_classify_table_add_del {
1790     u32 client_index;
1791     u32 context;
1792     u32 table_id;
1793     u8 ip_version;
1794     u8 transport_protocol;
1795     u8 is_add;
1796 };
1797
1798 /** \brief IPFIX add classifier table response
1799     @param context - sender context which was passed in the request
1800 */
1801 define ipfix_classify_table_add_del_reply {
1802     u32 context;
1803     i32 retval;
1804 };
1805
1806 /** \brief IPFIX classify tables dump request
1807     @param client_index - opaque cookie to identify the sender
1808     @param context - sender context, to match reply w/ request
1809 */
1810 define ipfix_classify_table_dump {
1811     u32 client_index;
1812     u32 context;
1813 };
1814
1815 /** \brief Reply to IPFIX classify tables dump request
1816     @param context - sender context, to match reply w/ request
1817     @param table_id - classifier table ID
1818     @param ip_version - version of IP used in the classifier table
1819     @param transport_protocol - transport protocol used in the classifier table or 255 for unspecified
1820 */
1821 define ipfix_classify_table_details {
1822     u32 context;
1823     u32 table_id;
1824     u8 ip_version;
1825     u8 transport_protocol;
1826 };
1827
1828 /** \brief Set/unset flow classify interface
1829     @param client_index - opaque cookie to identify the sender
1830     @param context - sender context, to match reply w/ request
1831     @param sw_if_index - interface to set/unset flow classify
1832     @param ip4_table_index - ip4 classify table index (~0 for skip)
1833     @param ip6_table_index - ip6 classify table index (~0 for skip)
1834     @param l2_table_index  -  l2 classify table index (~0 for skip)
1835     @param is_add - Set if non-zero, else unset
1836     Note: User is recommeneded to use just one valid table_index per call.
1837           (ip4_table_index, ip6_table_index, or l2_table_index)
1838 */
1839 define flow_classify_set_interface {
1840     u32 client_index;
1841     u32 context;
1842     u32 sw_if_index;
1843     u32 ip4_table_index;
1844     u32 ip6_table_index;
1845     u8  is_add;
1846 };
1847
1848 /** \brief Set/unset flow classify interface response
1849     @param context - sender context, to match reply w/ request
1850     @param retval - return value for request
1851 */
1852 define flow_classify_set_interface_reply {
1853     u32 context;
1854     i32 retval;
1855 };
1856
1857 /** \brief Get list of flow classify interfaces and tables
1858     @param client_index - opaque cookie to identify the sender
1859     @param context - sender context, to match reply w/ request
1860     @param type - classify table type
1861 */
1862 define flow_classify_dump {
1863     u32 client_index;
1864     u32 context;
1865     u8 type;
1866 };
1867
1868 /** \brief Flow classify operational state response.
1869     @param context - sender context, to match reply w/ request
1870     @param sw_if_index - software interface index
1871     @param table_index - classify table index
1872 */
1873 define flow_classify_details {
1874     u32 context;
1875     u32 sw_if_index;
1876     u32 table_index;
1877 };
1878
1879 /** \brief Query relative index via node names
1880     @param client_index - opaque cookie to identify the sender
1881     @param context - sender context, to match reply w/ request
1882     @param node_name - name of node to find relative index from
1883     @param next_name - next node from node_name to find relative index of
1884 */
1885 define get_next_index
1886 {
1887   u32 client_index;
1888   u32 context;
1889   u8 node_name[64];
1890   u8 next_name[64];
1891 };
1892
1893 /** \brief Reply for get next node index
1894     @param context - sender context which was passed in the request
1895     @param retval - return value
1896     @param next_index - index of the next_node
1897 */
1898 define get_next_index_reply
1899 {
1900   u32 context;
1901   i32 retval;
1902   u32 next_index;
1903 };
1904
1905 /** \brief PacketGenerator create interface request
1906     @param client_index - opaque cookie to identify the sender
1907     @param context - sender context, to match reply w/ request
1908     @param interface_id - interface index
1909 */
1910 define pg_create_interface
1911 {
1912   u32 client_index;
1913   u32 context;
1914   u32 interface_id;
1915 };
1916
1917 /** \brief PacketGenerator create interface response
1918     @param context - sender context, to match reply w/ request
1919     @param retval - return value for request
1920 */
1921 define pg_create_interface_reply
1922 {
1923   u32 context;
1924   i32 retval;
1925   u32 sw_if_index;
1926 };
1927
1928 /** \brief PacketGenerator capture packets on given interface request
1929     @param client_index - opaque cookie to identify the sender
1930     @param context - sender context, to match reply w/ request
1931     @param interface_id - pg interface index
1932     @param is_enabled - 1 if enabling streams, 0 if disabling
1933     @param count - number of packets to be captured
1934     @param pcap_file - pacp file name to store captured packets
1935 */
1936 define pg_capture
1937 {
1938   u32 client_index;
1939   u32 context;
1940   u32 interface_id;
1941   u8 is_enabled;
1942   u32 count;
1943   u32 pcap_name_length;
1944   u8 pcap_file_name[pcap_name_length];
1945 };
1946
1947 /** \brief PacketGenerator capture packets response
1948     @param context - sender context, to match reply w/ request
1949     @param retval - return value for request
1950 */
1951 define pg_capture_reply
1952 {
1953   u32 context;
1954   i32 retval;
1955 };
1956
1957 /** \brief Enable / disable packet generator request
1958     @param client_index - opaque cookie to identify the sender
1959     @param context - sender context, to match reply w/ request
1960     @param is_enabled - 1 if enabling streams, 0 if disabling
1961     @param stream - stream name to be enable/disabled, if not specified handle all streams
1962 */
1963 define pg_enable_disable
1964 {
1965   u32 client_index;
1966   u32 context;
1967   u8 is_enabled;
1968   u32 stream_name_length;
1969   u8 stream_name[stream_name_length];
1970 };
1971
1972 /** \brief Reply for enable / disable packet generator
1973     @param context - returned sender context, to match reply w/ request
1974     @param retval - return code
1975 */
1976 define pg_enable_disable_reply
1977 {
1978   u32 context;
1979   i32 retval;
1980 };
1981
1982 /** \brief Configure IP source and L4 port-range check
1983     @param client_index - opaque cookie to identify the sender
1984     @param context - sender context, to match reply w/ request
1985     @param is_ip6 - 1 if source address type is IPv6
1986     @param is_add - 1 if add, 0 if delete
1987     @param mask_length - mask length for address entry
1988     @param address - array of address bytes
1989     @param number_of_ranges - length of low_port and high_port arrays (must match)
1990     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
1991     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
1992     @param vrf_id - fib table/vrf id to associate the source and port-range check with
1993     @note To specify a single port set low_port and high_port entry the same
1994 */
1995 define ip_source_and_port_range_check_add_del
1996 {
1997   u32 client_index;
1998   u32 context;
1999   u8 is_ipv6;
2000   u8 is_add;
2001   u8 mask_length;
2002   u8 address[16];
2003   u8 number_of_ranges;
2004   u16 low_ports[32];
2005   u16 high_ports[32];
2006   u32 vrf_id;
2007 };
2008
2009 /** \brief Configure IP source and L4 port-range check reply
2010     @param context - returned sender context, to match reply w/ request
2011     @param retval - return code
2012 */
2013 define ip_source_and_port_range_check_add_del_reply
2014 {
2015   u32 context;
2016   i32 retval;
2017 };
2018
2019 /** \brief Set interface source and L4 port-range request
2020     @param client_index - opaque cookie to identify the sender
2021     @param context - sender context, to match reply w/ request
2022     @param interface_id - interface index
2023     @param tcp_vrf_id - VRF associated with source and TCP port-range check
2024     @param udp_vrf_id - VRF associated with source and TCP port-range check
2025 */
2026 define ip_source_and_port_range_check_interface_add_del
2027 {
2028   u32 client_index;
2029   u32 context;
2030   u8 is_add;
2031   u32 sw_if_index;
2032   u32 tcp_in_vrf_id;
2033   u32 tcp_out_vrf_id;
2034   u32 udp_in_vrf_id;
2035   u32 udp_out_vrf_id;
2036 };
2037
2038 /** \brief Set interface source and L4 port-range response
2039     @param context - sender context, to match reply w/ request
2040     @param retval - return value for request
2041 */
2042 define ip_source_and_port_range_check_interface_add_del_reply
2043 {
2044   u32 context;
2045   i32 retval;
2046 };
2047
2048 /** \brief Delete sub interface request
2049     @param client_index - opaque cookie to identify the sender
2050     @param context - sender context, to match reply w/ request
2051     @param sw_if_index - sw index of the interface that was created by create_subif
2052 */
2053 define delete_subif {
2054   u32 client_index;
2055   u32 context;
2056   u32 sw_if_index;
2057 };
2058
2059 /** \brief Delete sub interface response
2060     @param context - sender context, to match reply w/ request
2061     @param retval - return code for the request
2062 */
2063 define delete_subif_reply {
2064   u32 context;
2065   i32 retval;
2066 };
2067
2068 /** \brief L2 interface pbb tag rewrite configure request
2069     @param client_index - opaque cookie to identify the sender
2070     @param context - sender context, to match reply w/ request
2071     @param sw_if_index - interface the operation is applied to
2072     @param vtr_op - Choose from l2_vtr_op_t enum values
2073     @param inner_tag - needed for translate_qinq vtr op only
2074     @param outer_tag - needed for translate_qinq vtr op only 
2075     @param b_dmac - B-tag remote mac address, needed for any push or translate_qinq vtr op
2076     @param b_smac - B-tag local mac address, needed for any push or translate qinq vtr op
2077     @param b_vlanid - B-tag vlanid, needed for any push or translate qinq vtr op
2078     @param i_sid - I-tag service id, needed for any push or translate qinq vtr op
2079 */
2080 define l2_interface_pbb_tag_rewrite
2081 {
2082   u32 client_index;
2083   u32 context;
2084   u32 sw_if_index;
2085   u32 vtr_op;
2086   u16 outer_tag;
2087   u8  b_dmac[6];
2088   u8  b_smac[6];
2089   u16 b_vlanid;
2090   u32 i_sid;
2091 };
2092
2093 /** \brief L2 interface pbb tag rewrite response
2094     @param context - sender context, to match reply w/ request
2095     @param retval - return code for the request
2096 */
2097 define l2_interface_pbb_tag_rewrite_reply
2098 {
2099   u32 context;
2100   i32 retval;
2101 };
2102
2103 /** \brief Punt traffic to the host
2104     @param client_index - opaque cookie to identify the sender
2105     @param context - sender context, to match reply w/ request
2106     @param is_add - add punt if non-zero, else delete
2107     @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
2108     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
2109     @param l4_port - TCP/UDP port to be punted
2110 */
2111 define punt {
2112     u32 client_index;
2113     u32 context;
2114     u8 is_add;
2115     u8 ipv;
2116     u8 l4_protocol;
2117     u16 l4_port;
2118 };
2119
2120 /** \brief Reply to the punt request
2121     @param context - sender context which was passed in the request
2122     @param retval - return code of punt request
2123 */
2124 define punt_reply
2125 {
2126     u32 context;
2127     i32 retval;
2128 };
2129
2130 /** \brief Feature path enable/disable request
2131     @param client_index - opaque cookie to identify the sender
2132     @param context - sender context, to match reply w/ request
2133     @param sw_if_index - the interface
2134     @param enable - 1 = on, 0 = off
2135 */
2136 define feature_enable_disable {
2137     u32 client_index;
2138     u32 context;
2139     u32 sw_if_index;
2140     u8 enable;
2141     u8 arc_name[64];
2142     u8 feature_name[64];
2143 };
2144
2145 /** \brief Reply to the eature path enable/disable request
2146     @param context - sender context which was passed in the request
2147     @param retval - return code for the request
2148 */
2149 define feature_enable_disable_reply
2150 {
2151     u32 context;
2152     i32 retval;
2153 };
2154
2155 /*
2156  * Local Variables:
2157  * eval: (c-set-style "gnu")
2158  * End:
2159  */