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