API refactoring : policer
[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  * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
45  * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
46  * DHCP APIs: see ... /src/vnet/dhcp/{dhcpk.api, dhcp_api.c}
47  * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
48  * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
49  */
50
51 /** \brief Create a new subinterface with the given vlan id
52     @param client_index - opaque cookie to identify the sender
53     @param context - sender context, to match reply w/ request
54     @param sw_if_index - software index of the new vlan's parent interface
55     @param vlan_id - vlan tag of the new interface
56 */
57 define create_vlan_subif
58 {
59   u32 client_index;
60   u32 context;
61   u32 sw_if_index;
62   u32 vlan_id;
63 };
64
65 /** \brief Reply for the vlan subinterface create request
66     @param context - returned sender context, to match reply w/ request
67     @param retval - return code
68     @param sw_if_index - software index allocated for the new subinterface
69 */
70 define create_vlan_subif_reply
71 {
72   u32 context;
73   i32 retval;
74   u32 sw_if_index;
75 };
76
77 /** \brief Enable or Disable MPLS on and interface
78     @param client_index - opaque cookie to identify the sender
79     @param context - sender context, to match reply w/ request
80     @param sw_if_index - index of the interface
81     @param enable - if non-zero enable, else disable
82 */
83 define sw_interface_set_mpls_enable
84 {
85   u32 client_index;
86   u32 context;
87   u32 sw_if_index;
88   u8 enable;
89 };
90
91 /** \brief Reply for MPLS state on an interface
92     @param context - returned sender context, to match reply w/ request
93     @param retval - return code
94 */
95 define sw_interface_set_mpls_enable_reply
96 {
97   u32 context;
98   i32 retval;
99 };
100
101 /** \brief Proxy ARP add / del request
102     @param client_index - opaque cookie to identify the sender
103     @param context - sender context, to match reply w/ request
104     @param vrf_id - VRF / Fib table ID
105     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
106     @param low_address[4] - Low address of the Proxy ARP range
107     @param hi_address[4] - High address of the Proxy ARP range
108 */
109 define proxy_arp_add_del
110 {
111   u32 client_index;
112   u32 context;
113   u32 vrf_id;
114   u8 is_add;
115   u8 low_address[4];
116   u8 hi_address[4];
117 };
118
119 /** \brief Reply for proxy arp add / del request
120     @param context - returned sender context, to match reply w/ request
121     @param retval - return code
122 */
123 define proxy_arp_add_del_reply
124 {
125   u32 context;
126   i32 retval;
127 };
128
129 /** \brief Proxy ARP add / del request
130     @param client_index - opaque cookie to identify the sender
131     @param context - sender context, to match reply w/ request
132     @param sw_if_index - Which interface to enable / disable Proxy Arp on
133     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
134 */
135 define proxy_arp_intfc_enable_disable
136 {
137   u32 client_index;
138   u32 context;
139   u32 sw_if_index;
140   /* 1 = on, 0 = off */
141   u8 enable_disable;
142 };
143
144 /** \brief Reply for Proxy ARP interface enable / disable request
145     @param context - returned sender context, to match reply w/ request
146     @param retval - return code
147 */
148 define proxy_arp_intfc_enable_disable_reply
149 {
150   u32 context;
151   i32 retval;
152 };
153
154 /** \brief Reset VRF (remove all routes etc) request
155     @param client_index - opaque cookie to identify the sender
156     @param context - sender context, to match reply w/ request
157     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
158     @param vrf_id - ID of th FIB table / VRF to reset
159 */
160 define reset_vrf
161 {
162   u32 client_index;
163   u32 context;
164   u8 is_ipv6;
165   u32 vrf_id;
166 };
167
168 /** \brief Reply for Reset VRF request
169     @param context - returned sender context, to match reply w/ request
170     @param retval - return code
171 */
172 define reset_vrf_reply
173 {
174   u32 context;
175   i32 retval;
176 };
177
178 /** \brief Is Address Reachable request - DISABLED
179     @param client_index - opaque cookie to identify the sender
180     @param context - sender context, to match reply w/ request
181     @param next_hop_sw_if_index - index of interface used to get to next hop
182     @param is_ipv6 - 1 for IPv6, 0 for IPv4
183     @param is_error - address not found or does not match intf
184     @param address[] - Address in question 
185 */
186 define is_address_reachable
187 {
188   u32 client_index;             /* (api_main_t *) am->my_client_index */
189   u32 context;
190   u32 next_hop_sw_if_index;
191   u8 is_known;                  /* on reply, this is the answer */
192   u8 is_ipv6;
193   u8 is_error;                  /* address not found or does not match intf */
194   u8 address[16];
195 };
196
197 /** \brief Want Stats, register for stats updates
198     @param client_index - opaque cookie to identify the sender
199     @param context - sender context, to match reply w/ request
200     @param enable_disable - 1 = enable stats, 0 = disable
201     @param pid - pid of process requesting stats updates
202 */
203 define want_stats
204 {
205   u32 client_index;
206   u32 context;
207   u32 enable_disable;
208   u32 pid;
209 };
210
211 /** \brief Reply for Want Stats request
212     @param context - returned sender context, to match reply w/ request
213     @param retval - return code
214 */
215 define want_stats_reply
216 {
217   u32 context;
218   i32 retval;
219 };
220
221 typeonly manual_print manual_endian define ip4_fib_counter
222 {
223   u32 address;
224   u8 address_length;
225   u64 packets;
226   u64 bytes;
227 };
228
229 manual_print manual_endian define vnet_ip4_fib_counters
230 {
231   u32 vrf_id;
232   u32 count;
233   vl_api_ip4_fib_counter_t c[count];
234 };
235
236 typeonly manual_print manual_endian define ip4_nbr_counter
237 {
238   u32 address;
239   u8  link_type;
240   u64 packets;
241   u64 bytes;
242 };
243
244 /**
245  * @brief Per-neighbour (i.e. per-adjacency) coutners
246  * @param count The size of the array of counters
247  * @param sw_if_index The interface the adjacency is on
248  * @param begin Flag to indicate this is the first set of stats for this
249  *        interface. If this flag is not set the it is a continuation of
250  *        stats for this interface
251  * @param  c counters
252  */
253 manual_print manual_endian define vnet_ip4_nbr_counters
254 {
255   u32 count;
256   u32 sw_if_index;
257   u8 begin;
258   vl_api_ip4_nbr_counter_t c[count];
259 };
260
261 typeonly manual_print manual_endian define ip6_fib_counter
262 {
263   u64 address[2];
264   u8 address_length;
265   u64 packets;
266   u64 bytes;
267 };
268
269 manual_print manual_endian define vnet_ip6_fib_counters
270 {
271   u32 vrf_id;
272   u32 count;
273   vl_api_ip6_fib_counter_t c[count];
274 };
275
276 typeonly manual_print manual_endian define ip6_nbr_counter
277 {
278   u64 address[2];
279   u8  link_type;
280   u64 packets;
281   u64 bytes;
282 };
283
284 manual_print manual_endian define vnet_ip6_nbr_counters
285 {
286   u32 count;
287   u32 sw_if_index;
288   u8 begin;
289   vl_api_ip6_nbr_counter_t c[count];
290 };
291
292 /** \brief Request for a single block of summary stats
293     @param client_index - opaque cookie to identify the sender
294     @param context - sender context, to match reply w/ request
295 */
296 define vnet_get_summary_stats
297 {
298   u32 client_index;
299   u32 context;
300 };
301
302 /** \brief Reply for vnet_get_summary_stats request
303     @param context - sender context, to match reply w/ request
304     @param retval - return code for request
305     @param total_pkts -  
306     @param total_bytes -
307     @param vector_rate - 
308 */
309 define vnet_summary_stats_reply
310 {
311   u32 context;
312   i32 retval;
313   u64 total_pkts[2];
314   u64 total_bytes[2];
315   f64 vector_rate;
316 };
317
318 /** \brief OAM event structure
319     @param dst_address[] - 
320     @param state
321 */
322 define oam_event
323 {
324   u8 dst_address[4];
325   u8 state;
326 };
327
328 /** \brief Want OAM events request
329     @param client_index - opaque cookie to identify the sender
330     @param context - sender context, to match reply w/ request
331     @param enable_disable- enable if non-zero, else disable
332     @param pid - pid of the requesting process
333 */
334 define want_oam_events
335 {
336   u32 client_index;
337   u32 context;
338   u32 enable_disable;
339   u32 pid;
340 };
341
342 /** \brief Want OAM events response
343     @param context - sender context, to match reply w/ request
344     @param retval - return code for the want oam stats request
345 */
346 define want_oam_events_reply
347 {
348   u32 context;
349   i32 retval;
350 };
351
352 /** \brief OAM add / del target request
353     @param client_index - opaque cookie to identify the sender
354     @param context - sender context, to match reply w/ request
355     @param vrf_id - vrf_id of the target
356     @param src_address[] - source address to use for the updates 
357     @param dst_address[] - destination address of the target
358     @param is_add - add target if non-zero, else delete
359 */
360 define oam_add_del
361 {
362   u32 client_index;
363   u32 context;
364   u32 vrf_id;
365   u8 src_address[4];
366   u8 dst_address[4];
367   u8 is_add;
368 };
369
370 /** \brief OAM add / del target response
371     @param context - sender context, to match reply w/ request
372     @param retval - return code of the request
373 */
374 define oam_add_del_reply
375 {
376   u32 context;
377   i32 retval;
378 };
379
380 /** \brief Reset fib table request
381     @param client_index - opaque cookie to identify the sender
382     @param context - sender context, to match reply w/ request
383     @param vrf_id - vrf/table id of the fib table to reset
384     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
385 */
386 define reset_fib
387 {
388   u32 client_index;
389   u32 context;
390   u32 vrf_id;
391   u8 is_ipv6;
392 };
393
394 /** \brief Reset fib response
395     @param context - sender context, to match reply w/ request
396     @param retval - return code for the reset bfib request
397 */
398 define reset_fib_reply
399 {
400   u32 context;
401   i32 retval;
402 };
403
404 /** \brief Create loopback interface request
405     @param client_index - opaque cookie to identify the sender
406     @param context - sender context, to match reply w/ request
407     @param mac_address - mac addr to assign to the interface if none-zero
408 */
409 define create_loopback
410 {
411   u32 client_index;
412   u32 context;
413   u8 mac_address[6];
414 };
415
416 /** \brief Create loopback interface response
417     @param context - sender context, to match reply w/ request
418     @param sw_if_index - sw index of the interface that was created
419     @param retval - return code for the request
420 */
421 define create_loopback_reply
422 {
423   u32 context;
424   i32 retval;
425   u32 sw_if_index;
426 };
427
428 /** \brief Delete loopback interface request
429     @param client_index - opaque cookie to identify the sender
430     @param context - sender context, to match reply w/ request
431     @param sw_if_index - sw index of the interface that was created
432 */
433 define delete_loopback
434 {
435   u32 client_index;
436   u32 context;
437   u32 sw_if_index;
438 };
439
440 /** \brief Delete loopback interface response
441     @param context - sender context, to match reply w/ request
442     @param retval - return code for the request
443 */
444 define delete_loopback_reply
445 {
446   u32 context;
447   i32 retval;
448 };
449
450 /** \brief Control ping from client to api server request
451     @param client_index - opaque cookie to identify the sender
452     @param context - sender context, to match reply w/ request
453 */
454 define control_ping
455 {
456   u32 client_index;
457   u32 context;
458 };
459
460 /** \brief Control ping from the client to the server response
461     @param client_index - opaque cookie to identify the sender
462     @param context - sender context, to match reply w/ request
463     @param retval - return code for the request
464     @param vpe_pid - the pid of the vpe, returned by the server
465 */
466 define control_ping_reply
467 {
468   u32 context;
469   i32 retval;
470   u32 client_index;
471   u32 vpe_pid;
472 };
473
474 /** \brief Process a vpe parser cli string request
475     @param client_index - opaque cookie to identify the sender
476     @param context - sender context, to match reply w/ request
477     @param cmd_in_shmem - pointer to cli command string
478 */
479 define cli_request
480 {
481   u32 client_index;
482   u32 context;
483   u64 cmd_in_shmem;
484 };
485 define cli_inband
486 {
487   u32 client_index;
488   u32 context;
489   u32 length;
490   u8 cmd[length];
491 };
492
493 /** \brief vpe parser cli string response
494     @param context - sender context, to match reply w/ request
495     @param retval - return code for request
496     @param reply_in_shmem - Reply string from cli processing if any
497 */
498 define cli_reply
499 {
500   u32 context;
501   i32 retval;
502   u64 reply_in_shmem;
503 };
504 define cli_inband_reply
505 {
506   u32 context;
507   i32 retval;
508   u32 length;
509   u8 reply[length];
510 };
511
512 /** \brief Set max allowed ARP or ip6 neighbor entries request
513     @param client_index - opaque cookie to identify the sender
514     @param context - sender context, to match reply w/ request
515     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
516     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
517 */
518 define set_arp_neighbor_limit
519 {
520   u32 client_index;
521   u32 context;
522   u8 is_ipv6;
523   u32 arp_neighbor_limit;
524 };
525
526 /** \brief Set max allowed ARP or ip6 neighbor entries response
527     @param context - sender context, to match reply w/ request
528     @param retval - return code for request
529 */
530 define set_arp_neighbor_limit_reply
531 {
532   u32 context;
533   i32 retval;
534 };
535
536 /** \brief L2 interface patch add / del request
537     @param client_index - opaque cookie to identify the sender
538     @param context - sender context, to match reply w/ request
539     @param rx_sw_if_index - receive side interface 
540     @param tx_sw_if_index - transmit side interface
541     @param is_add - if non-zero set up the interface patch, else remove it
542 */
543 define l2_patch_add_del
544 {
545   u32 client_index;
546   u32 context;
547   u32 rx_sw_if_index;
548   u32 tx_sw_if_index;
549   u8 is_add;
550 };
551
552 /** \brief L2 interface patch add / del response
553     @param context - sender context, to match reply w/ request
554     @param retval - return code for the request
555 */
556 define l2_patch_add_del_reply
557 {
558   u32 context;
559   i32 retval;
560 };
561
562 /** \brief Interface set vpath request
563     @param client_index - opaque cookie to identify the sender
564     @param context - sender context, to match reply w/ request
565     @param sw_if_index - interface used to reach neighbor
566     @param enable - if non-zero enable, else disable
567 */
568 define sw_interface_set_vpath
569 {
570   u32 client_index;
571   u32 context;
572   u32 sw_if_index;
573   u8 enable;
574 };
575
576 /** \brief Interface set vpath response
577     @param context - sender context, to match reply w/ request
578     @param retval - return code for the request
579 */
580 define sw_interface_set_vpath_reply
581 {
582   u32 context;
583   i32 retval;
584 };
585
586 /** \brief Set L2 XConnect between two interfaces request
587     @param client_index - opaque cookie to identify the sender
588     @param context - sender context, to match reply w/ request
589     @param rx_sw_if_index - Receive interface index
590     @param tx_sw_if_index - Transmit interface index
591     @param enable - enable xconnect if not 0, else set to L3 mode
592 */
593 define sw_interface_set_l2_xconnect
594 {
595   u32 client_index;
596   u32 context;
597   u32 rx_sw_if_index;
598   u32 tx_sw_if_index;
599   u8 enable;
600 };
601
602 /** \brief Set L2 XConnect response
603     @param context - sender context, to match reply w/ request
604     @param retval - L2 XConnect request return code
605 */
606 define sw_interface_set_l2_xconnect_reply
607 {
608   u32 context;
609   i32 retval;
610 };
611
612 /** \brief Interface bridge mode request
613     @param client_index - opaque cookie to identify the sender
614     @param context - sender context, to match reply w/ request
615     @param rx_sw_if_index - the interface
616     @param bd_id - bridge domain id
617     @param bvi - Setup interface as a bvi, bridge mode only
618     @param shg - Shared horizon group, for bridge mode only
619     @param enable - Enable beige mode if not 0, else set to L3 mode
620 */
621 define sw_interface_set_l2_bridge
622 {
623   u32 client_index;
624   u32 context;
625   u32 rx_sw_if_index;
626   u32 bd_id;
627   u8 shg;
628   u8 bvi;
629   u8 enable;
630 };
631
632 /** \brief Interface bridge mode response
633     @param context - sender context, to match reply w/ request
634     @param retval - Bridge mode request return code
635 */
636 define sw_interface_set_l2_bridge_reply
637 {
638   u32 context;
639   i32 retval;
640 };
641
642 /** \brief Set bridge domain ip to mac entry request
643     @param client_index - opaque cookie to identify the sender
644     @param context - sender context, to match reply w/ request
645     @param bd_id - the bridge domain to set the flags for
646     @param is_add - if non-zero, add the entry, else clear it
647     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
648     @param mac_address - MAC address
649     @param 
650 */
651 define bd_ip_mac_add_del
652 {
653   u32 client_index;
654   u32 context;
655   u32 bd_id;
656   u8 is_add;
657   u8 is_ipv6;
658   u8 ip_address[16];
659   u8 mac_address[6];
660 };
661
662 /** \brief Set bridge domain ip to mac entry response
663     @param context - sender context, to match reply w/ request
664     @param retval - return code for the set bridge flags request
665 */
666 define bd_ip_mac_add_del_reply
667 {
668   u32 context;
669   i32 retval;
670 };
671
672 /** \brief Set/unset the classification table for an interface request 
673     @param client_index - opaque cookie to identify the sender
674     @param context - sender context, to match reply w/ request
675     @param is_ipv6 - ipv6 if non-zero, else ipv4
676     @param sw_if_index - interface to associate with the table
677     @param table_index - index of the table, if ~0 unset the table
678 */
679 define classify_set_interface_ip_table
680 {
681   u32 client_index;
682   u32 context;
683   u8 is_ipv6;
684   u32 sw_if_index;
685   u32 table_index;              /* ~0 => off */
686 };
687
688 /** \brief Set/unset interface classification table response 
689     @param context - sender context, to match reply w/ request
690     @param retval - return code
691 */
692 define classify_set_interface_ip_table_reply
693 {
694   u32 context;
695   i32 retval;
696 };
697
698 /** \brief Set/unset l2 classification tables for an interface request
699     @param client_index - opaque cookie to identify the sender
700     @param context - sender context, to match reply w/ request
701     @param sw_if_index - interface to set/unset tables for
702     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
703     @param ip6_table_index - ip6 index
704     @param other_table_index - other index
705 */
706 define classify_set_interface_l2_tables
707 {
708   u32 client_index;
709   u32 context;
710   u32 sw_if_index;
711   /* 3 x ~0 => off */
712   u32 ip4_table_index;
713   u32 ip6_table_index;
714   u32 other_table_index;
715   u8 is_input;
716 };
717
718 /** \brief Set/unset l2 classification tables for an interface response
719     @param context - sender context, to match reply w/ request
720     @param retval - return code for the request
721 */
722 define classify_set_interface_l2_tables_reply
723 {
724   u32 context;
725   i32 retval;
726 };
727
728 /** \brief Get node index using name request
729     @param client_index - opaque cookie to identify the sender
730     @param context - sender context, to match reply w/ request
731     @param node_name[] - name of the node
732 */
733 define get_node_index
734 {
735   u32 client_index;
736   u32 context;
737   u8 node_name[64];
738 };
739
740 /** \brief Get node index using name request
741     @param context - sender context, to match reply w/ request
742     @param retval - return code for the request
743     @param node_index - index of the desired node if found, else ~0
744 */
745 define get_node_index_reply
746 {
747   u32 context;
748   i32 retval;
749   u32 node_index;
750 };
751
752 /** \brief Set the next node for a given node request
753     @param client_index - opaque cookie to identify the sender
754     @param context - sender context, to match reply w/ request
755     @param node_name[] - node to add the next node to
756     @param next_name[] - node to add as the next node
757 */
758 define add_node_next
759 {
760   u32 client_index;
761   u32 context;
762   u8 node_name[64];
763   u8 next_name[64];
764 };
765
766 /** \brief IP Set the next node for a given node response
767     @param context - sender context, to match reply w/ request
768     @param retval - return code for the add next node request
769     @param next_index - the index of the next node if success, else ~0
770 */
771 define add_node_next_reply
772 {
773   u32 context;
774   i32 retval;
775   u32 next_index;
776 };
777
778 /** \brief L2 interface ethernet flow point filtering enable/disable request
779     @param client_index - opaque cookie to identify the sender
780     @param context - sender context, to match reply w/ request
781     @param sw_if_index - interface to enable/disable filtering on
782     @param enable_disable - if non-zero enable filtering, else disable
783 */
784 define l2_interface_efp_filter
785 {
786   u32 client_index;
787   u32 context;
788   u32 sw_if_index;
789   u32 enable_disable;
790 };
791
792 /** \brief L2 interface ethernet flow point filtering response
793     @param context - sender context, to match reply w/ request
794     @param retval - return code for the request
795 */
796 define l2_interface_efp_filter_reply
797 {
798   u32 context;
799   i32 retval;
800 };
801
802 define create_subif
803 {
804   u32 client_index;
805   u32 context;
806   u32 sw_if_index;
807   u32 sub_id;
808
809   /* These fields map directly onto the subif template */
810   u8 no_tags;
811   u8 one_tag;
812   u8 two_tags;
813   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
814   u8 exact_match;
815   u8 default_sub;
816   u8 outer_vlan_id_any;
817   u8 inner_vlan_id_any;
818   u16 outer_vlan_id;
819   u16 inner_vlan_id;
820 };
821
822 define create_subif_reply
823 {
824   u32 context;
825   i32 retval;
826   u32 sw_if_index;
827 };
828
829 /** \brief show version
830     @param client_index - opaque cookie to identify the sender
831     @param context - sender context, to match reply w/ request
832 */
833 define show_version
834 {
835   u32 client_index;
836   u32 context;
837 };
838
839 /** \brief show version response
840     @param context - sender context, to match reply w/ request
841     @param retval - return code for the request
842     @param program - name of the program (vpe)
843     @param version  - version of the program
844     @param build_directory - root of the workspace where the program was built
845 */
846 define show_version_reply
847 {
848   u32 context;
849   i32 retval;
850   u8 program[32];
851   u8 version[32];
852   u8 build_date[32];
853   u8 build_directory[256];
854 };
855
856 /* Gross kludge, DGMS */
857 define interface_name_renumber
858 {
859   u32 client_index;
860   u32 context;
861   u32 sw_if_index;
862   u32 new_show_dev_instance;
863 };
864
865 define interface_name_renumber_reply
866 {
867   u32 context;
868   i32 retval;
869 };
870
871 /** \brief Register for ip4 arp resolution events
872     @param client_index - opaque cookie to identify the sender
873     @param context - sender context, to match reply w/ request
874     @param enable_disable - 1 => register for events, 0 => cancel registration
875     @param pid - sender's pid
876     @param address - the exact ip4 address of interest
877 */
878 define want_ip4_arp_events
879 {
880   u32 client_index;
881   u32 context;
882   u8 enable_disable;
883   u32 pid;
884   u32 address;
885 };
886
887 /** \brief Reply for interface events registration
888     @param context - returned sender context, to match reply w/ request
889     @param retval - return code
890 */
891 define want_ip4_arp_events_reply
892 {
893   u32 context;
894   i32 retval;
895 };
896
897 /** \brief Tell client about an ip4 arp resolution event
898     @param client_index - opaque cookie to identify the sender
899     @param context - sender context, to match reply w/ request
900     @param address - the exact ip4 address of interest
901     @param pid - client pid registered to receive notification
902     @param sw_if_index - interface which received ARP packet
903     @param new_mac - the new mac address 
904     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
905 */
906 define ip4_arp_event
907 {
908   u32 client_index;
909   u32 context;
910   u32 address;
911   u32 pid;
912   u32 sw_if_index;
913   u8 new_mac[6];
914   u8 mac_ip;
915 };
916
917 /** \brief Register for ip6 nd resolution events
918     @param client_index - opaque cookie to identify the sender
919     @param context - sender context, to match reply w/ request
920     @param enable_disable - 1 => register for events, 0 => cancel registration
921     @param pid - sender's pid
922     @param address - the exact ip6 address of interest
923 */
924 define want_ip6_nd_events
925 {
926   u32 client_index;
927   u32 context;
928   u8 enable_disable;
929   u32 pid;
930   u8 address[16];
931 };
932
933 /** \brief Reply for ip6 nd resolution events registration
934     @param context - returned sender context, to match reply w/ request
935     @param retval - return code
936 */
937 define want_ip6_nd_events_reply
938 {
939   u32 context;
940   i32 retval;
941 };
942
943 /** \brief Tell client about an ip6 nd resolution or mac/ip event
944     @param client_index - opaque cookie to identify the sender
945     @param context - sender context, to match reply w/ request
946     @param pid - client pid registered to receive notification
947     @param sw_if_index - interface which received ARP packet
948     @param address - the exact ip6 address of interest
949     @param new_mac - the new mac address 
950     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
951 */
952 define ip6_nd_event
953 {
954   u32 client_index;
955   u32 context;
956   u32 pid;
957   u32 sw_if_index;
958   u8 address[16];
959   u8 new_mac[6];
960   u8 mac_ip;
961 };
962     
963 /** \brief Set/unset input ACL interface
964     @param client_index - opaque cookie to identify the sender
965     @param context - sender context, to match reply w/ request
966     @param sw_if_index - interface to set/unset input ACL
967     @param ip4_table_index - ip4 classify table index (~0 for skip)
968     @param ip6_table_index - ip6 classify table index (~0 for skip)
969     @param l2_table_index  -  l2 classify table index (~0 for skip)
970     @param is_add - Set input ACL if non-zero, else unset
971     Note: User is recommeneded to use just one valid table_index per call.
972           (ip4_table_index, ip6_table_index, or l2_table_index)
973 */
974 define input_acl_set_interface
975 {
976   u32 client_index;
977   u32 context;
978   u32 sw_if_index;
979   u32 ip4_table_index;
980   u32 ip6_table_index;
981   u32 l2_table_index;
982   u8 is_add;
983 };
984
985 /** \brief Set/unset input ACL interface response
986     @param context - sender context, to match reply w/ request
987     @param retval - return code for the request
988 */
989 define input_acl_set_interface_reply
990 {
991   u32 context;
992   i32 retval;
993 };
994
995 define get_node_graph
996 {
997   u32 client_index;
998   u32 context;
999 };
1000
1001 /** \brief get_node_graph_reply
1002     @param context - returned sender context, to match reply w/ request
1003     @param retval - return code
1004     @param reply_in_shmem - result from vlib_node_serialize, in shared
1005     memory. Process with vlib_node_unserialize, remember to switch
1006     heaps and free the result.
1007 */
1008
1009 define get_node_graph_reply
1010 {
1011   u32 context;
1012   i32 retval;
1013   u64 reply_in_shmem;
1014 };
1015
1016 /** \brief IOAM enable : Enable in-band OAM
1017     @param id - profile id
1018     @param seqno - To enable Seqno Processing
1019     @param analyse - Enabling analysis of iOAM at decap node 
1020     @param pow_enable - Proof of Work enabled or not flag
1021     @param trace_enable - iOAM Trace enabled or not flag
1022 */
1023 define ioam_enable
1024 {
1025   u32 client_index;
1026   u32 context;
1027   u16 id;
1028   u8 seqno;
1029   u8 analyse;
1030   u8 pot_enable;
1031   u8 trace_enable;
1032   u32 node_id;
1033 };
1034
1035 /** \brief iOAM Trace profile add / del response
1036     @param context - sender context, to match reply w/ request
1037     @param retval - return value for request
1038 */
1039 define ioam_enable_reply
1040 {
1041   u32 context;
1042   i32 retval;
1043 };
1044
1045 /** \brief iOAM disable
1046     @param client_index - opaque cookie to identify the sender
1047     @param context - sender context, to match reply w/ request
1048     @param index - MAP Domain index
1049 */
1050 define ioam_disable
1051 {
1052   u32 client_index;
1053   u32 context;
1054   u16 id;
1055 };
1056
1057 /** \brief iOAM disable response
1058     @param context - sender context, to match reply w/ request
1059     @param retval - return value for request
1060 */
1061 define ioam_disable_reply
1062 {
1063   u32 context;
1064   i32 retval;
1065 };
1066
1067 /** \brief Query relative index via node names
1068     @param client_index - opaque cookie to identify the sender
1069     @param context - sender context, to match reply w/ request
1070     @param node_name - name of node to find relative index from
1071     @param next_name - next node from node_name to find relative index of
1072 */
1073 define get_next_index
1074 {
1075   u32 client_index;
1076   u32 context;
1077   u8 node_name[64];
1078   u8 next_name[64];
1079 };
1080
1081 /** \brief Reply for get next node index
1082     @param context - sender context which was passed in the request
1083     @param retval - return value
1084     @param next_index - index of the next_node
1085 */
1086 define get_next_index_reply
1087 {
1088   u32 context;
1089   i32 retval;
1090   u32 next_index;
1091 };
1092
1093 /** \brief PacketGenerator create interface request
1094     @param client_index - opaque cookie to identify the sender
1095     @param context - sender context, to match reply w/ request
1096     @param interface_id - interface index
1097 */
1098 define pg_create_interface
1099 {
1100   u32 client_index;
1101   u32 context;
1102   u32 interface_id;
1103 };
1104
1105 /** \brief PacketGenerator create interface response
1106     @param context - sender context, to match reply w/ request
1107     @param retval - return value for request
1108 */
1109 define pg_create_interface_reply
1110 {
1111   u32 context;
1112   i32 retval;
1113   u32 sw_if_index;
1114 };
1115
1116 /** \brief PacketGenerator capture packets on given interface request
1117     @param client_index - opaque cookie to identify the sender
1118     @param context - sender context, to match reply w/ request
1119     @param interface_id - pg interface index
1120     @param is_enabled - 1 if enabling streams, 0 if disabling
1121     @param count - number of packets to be captured
1122     @param pcap_file - pacp file name to store captured packets
1123 */
1124 define pg_capture
1125 {
1126   u32 client_index;
1127   u32 context;
1128   u32 interface_id;
1129   u8 is_enabled;
1130   u32 count;
1131   u32 pcap_name_length;
1132   u8 pcap_file_name[pcap_name_length];
1133 };
1134
1135 /** \brief PacketGenerator capture packets response
1136     @param context - sender context, to match reply w/ request
1137     @param retval - return value for request
1138 */
1139 define pg_capture_reply
1140 {
1141   u32 context;
1142   i32 retval;
1143 };
1144
1145 /** \brief Enable / disable packet generator request
1146     @param client_index - opaque cookie to identify the sender
1147     @param context - sender context, to match reply w/ request
1148     @param is_enabled - 1 if enabling streams, 0 if disabling
1149     @param stream - stream name to be enable/disabled, if not specified handle all streams
1150 */
1151 define pg_enable_disable
1152 {
1153   u32 client_index;
1154   u32 context;
1155   u8 is_enabled;
1156   u32 stream_name_length;
1157   u8 stream_name[stream_name_length];
1158 };
1159
1160 /** \brief Reply for enable / disable packet generator
1161     @param context - returned sender context, to match reply w/ request
1162     @param retval - return code
1163 */
1164 define pg_enable_disable_reply
1165 {
1166   u32 context;
1167   i32 retval;
1168 };
1169
1170 /** \brief Configure IP source and L4 port-range check
1171     @param client_index - opaque cookie to identify the sender
1172     @param context - sender context, to match reply w/ request
1173     @param is_ip6 - 1 if source address type is IPv6
1174     @param is_add - 1 if add, 0 if delete
1175     @param mask_length - mask length for address entry
1176     @param address - array of address bytes
1177     @param number_of_ranges - length of low_port and high_port arrays (must match)
1178     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
1179     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
1180     @param vrf_id - fib table/vrf id to associate the source and port-range check with
1181     @note To specify a single port set low_port and high_port entry the same
1182 */
1183 define ip_source_and_port_range_check_add_del
1184 {
1185   u32 client_index;
1186   u32 context;
1187   u8 is_ipv6;
1188   u8 is_add;
1189   u8 mask_length;
1190   u8 address[16];
1191   u8 number_of_ranges;
1192   u16 low_ports[32];
1193   u16 high_ports[32];
1194   u32 vrf_id;
1195 };
1196
1197 /** \brief Configure IP source and L4 port-range check reply
1198     @param context - returned sender context, to match reply w/ request
1199     @param retval - return code
1200 */
1201 define ip_source_and_port_range_check_add_del_reply
1202 {
1203   u32 context;
1204   i32 retval;
1205 };
1206
1207 /** \brief Set interface source and L4 port-range request
1208     @param client_index - opaque cookie to identify the sender
1209     @param context - sender context, to match reply w/ request
1210     @param interface_id - interface index
1211     @param tcp_vrf_id - VRF associated with source and TCP port-range check
1212     @param udp_vrf_id - VRF associated with source and TCP port-range check
1213 */
1214 define ip_source_and_port_range_check_interface_add_del
1215 {
1216   u32 client_index;
1217   u32 context;
1218   u8 is_add;
1219   u32 sw_if_index;
1220   u32 tcp_in_vrf_id;
1221   u32 tcp_out_vrf_id;
1222   u32 udp_in_vrf_id;
1223   u32 udp_out_vrf_id;
1224 };
1225
1226 /** \brief Set interface source and L4 port-range response
1227     @param context - sender context, to match reply w/ request
1228     @param retval - return value for request
1229 */
1230 define ip_source_and_port_range_check_interface_add_del_reply
1231 {
1232   u32 context;
1233   i32 retval;
1234 };
1235
1236 /** \brief Delete sub interface request
1237     @param client_index - opaque cookie to identify the sender
1238     @param context - sender context, to match reply w/ request
1239     @param sw_if_index - sw index of the interface that was created by create_subif
1240 */
1241 define delete_subif {
1242   u32 client_index;
1243   u32 context;
1244   u32 sw_if_index;
1245 };
1246
1247 /** \brief Delete sub interface response
1248     @param context - sender context, to match reply w/ request
1249     @param retval - return code for the request
1250 */
1251 define delete_subif_reply {
1252   u32 context;
1253   i32 retval;
1254 };
1255
1256 /** \brief Punt traffic to the host
1257     @param client_index - opaque cookie to identify the sender
1258     @param context - sender context, to match reply w/ request
1259     @param is_add - add punt if non-zero, else delete
1260     @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
1261     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
1262     @param l4_port - TCP/UDP port to be punted
1263 */
1264 define punt {
1265     u32 client_index;
1266     u32 context;
1267     u8 is_add;
1268     u8 ipv;
1269     u8 l4_protocol;
1270     u16 l4_port;
1271 };
1272
1273 /** \brief Reply to the punt request
1274     @param context - sender context which was passed in the request
1275     @param retval - return code of punt request
1276 */
1277 define punt_reply
1278 {
1279     u32 context;
1280     i32 retval;
1281 };
1282
1283 /** \brief Feature path enable/disable request
1284     @param client_index - opaque cookie to identify the sender
1285     @param context - sender context, to match reply w/ request
1286     @param sw_if_index - the interface
1287     @param enable - 1 = on, 0 = off
1288 */
1289 define feature_enable_disable {
1290     u32 client_index;
1291     u32 context;
1292     u32 sw_if_index;
1293     u8 enable;
1294     u8 arc_name[64];
1295     u8 feature_name[64];
1296 };
1297
1298 /** \brief Reply to the eature path enable/disable request
1299     @param context - sender context which was passed in the request
1300     @param retval - return code for the request
1301 */
1302 define feature_enable_disable_reply
1303 {
1304     u32 context;
1305     i32 retval;
1306 };
1307
1308 /*
1309  * Local Variables:
1310  * eval: (c-set-style "gnu")
1311  * End:
1312  */