"autoreply" flag: autogenerate standard xxx_reply_t messages
[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  * 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 autoreply 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 Proxy ARP add / del request
92     @param client_index - opaque cookie to identify the sender
93     @param context - sender context, to match reply w/ request
94     @param vrf_id - VRF / Fib table ID
95     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
96     @param low_address[4] - Low address of the Proxy ARP range
97     @param hi_address[4] - High address of the Proxy ARP range
98 */
99 autoreply define proxy_arp_add_del
100 {
101   u32 client_index;
102   u32 context;
103   u32 vrf_id;
104   u8 is_add;
105   u8 low_address[4];
106   u8 hi_address[4];
107 };
108
109 /** \brief Proxy ARP add / del request
110     @param client_index - opaque cookie to identify the sender
111     @param context - sender context, to match reply w/ request
112     @param sw_if_index - Which interface to enable / disable Proxy Arp on
113     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
114 */
115 autoreply define proxy_arp_intfc_enable_disable
116 {
117   u32 client_index;
118   u32 context;
119   u32 sw_if_index;
120   /* 1 = on, 0 = off */
121   u8 enable_disable;
122 };
123
124 /** \brief Reset VRF (remove all routes etc) request
125     @param client_index - opaque cookie to identify the sender
126     @param context - sender context, to match reply w/ request
127     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
128     @param vrf_id - ID of th FIB table / VRF to reset
129 */
130 autoreply define reset_vrf
131 {
132   u32 client_index;
133   u32 context;
134   u8 is_ipv6;
135   u32 vrf_id;
136 };
137
138 /** \brief Is Address Reachable request - DISABLED
139     @param client_index - opaque cookie to identify the sender
140     @param context - sender context, to match reply w/ request
141     @param next_hop_sw_if_index - index of interface used to get to next hop
142     @param is_ipv6 - 1 for IPv6, 0 for IPv4
143     @param is_error - address not found or does not match intf
144     @param address[] - Address in question 
145 */
146 define is_address_reachable
147 {
148   u32 client_index;             /* (api_main_t *) am->my_client_index */
149   u32 context;
150   u32 next_hop_sw_if_index;
151   u8 is_known;                  /* on reply, this is the answer */
152   u8 is_ipv6;
153   u8 is_error;                  /* address not found or does not match intf */
154   u8 address[16];
155 };
156
157 /** \brief Want Stats, register for stats updates
158     @param client_index - opaque cookie to identify the sender
159     @param context - sender context, to match reply w/ request
160     @param enable_disable - 1 = enable stats, 0 = disable
161     @param pid - pid of process requesting stats updates
162 */
163 autoreply define want_stats
164 {
165   u32 client_index;
166   u32 context;
167   u32 enable_disable;
168   u32 pid;
169 };
170
171 typeonly manual_print manual_endian define ip4_fib_counter
172 {
173   u32 address;
174   u8 address_length;
175   u64 packets;
176   u64 bytes;
177 };
178
179 manual_print manual_endian define vnet_ip4_fib_counters
180 {
181   u32 vrf_id;
182   u32 count;
183   vl_api_ip4_fib_counter_t c[count];
184 };
185
186 typeonly manual_print manual_endian define ip4_nbr_counter
187 {
188   u32 address;
189   u8  link_type;
190   u64 packets;
191   u64 bytes;
192 };
193
194 /**
195  * @brief Per-neighbour (i.e. per-adjacency) coutners
196  * @param count The size of the array of counters
197  * @param sw_if_index The interface the adjacency is on
198  * @param begin Flag to indicate this is the first set of stats for this
199  *        interface. If this flag is not set the it is a continuation of
200  *        stats for this interface
201  * @param  c counters
202  */
203 manual_print manual_endian define vnet_ip4_nbr_counters
204 {
205   u32 count;
206   u32 sw_if_index;
207   u8 begin;
208   vl_api_ip4_nbr_counter_t c[count];
209 };
210
211 typeonly manual_print manual_endian define ip6_fib_counter
212 {
213   u64 address[2];
214   u8 address_length;
215   u64 packets;
216   u64 bytes;
217 };
218
219 manual_print manual_endian define vnet_ip6_fib_counters
220 {
221   u32 vrf_id;
222   u32 count;
223   vl_api_ip6_fib_counter_t c[count];
224 };
225
226 typeonly manual_print manual_endian define ip6_nbr_counter
227 {
228   u64 address[2];
229   u8  link_type;
230   u64 packets;
231   u64 bytes;
232 };
233
234 manual_print manual_endian define vnet_ip6_nbr_counters
235 {
236   u32 count;
237   u32 sw_if_index;
238   u8 begin;
239   vl_api_ip6_nbr_counter_t c[count];
240 };
241
242 /** \brief Request for a single block of summary stats
243     @param client_index - opaque cookie to identify the sender
244     @param context - sender context, to match reply w/ request
245 */
246 define vnet_get_summary_stats
247 {
248   u32 client_index;
249   u32 context;
250 };
251
252 /** \brief Reply for vnet_get_summary_stats request
253     @param context - sender context, to match reply w/ request
254     @param retval - return code for request
255     @param total_pkts -  
256     @param total_bytes -
257     @param vector_rate - 
258 */
259 define vnet_summary_stats_reply
260 {
261   u32 context;
262   i32 retval;
263   u64 total_pkts[2];
264   u64 total_bytes[2];
265   f64 vector_rate;
266 };
267
268 /** \brief OAM event structure
269     @param dst_address[] - 
270     @param state
271 */
272 define oam_event
273 {
274   u8 dst_address[4];
275   u8 state;
276 };
277
278 /** \brief Want OAM events request
279     @param client_index - opaque cookie to identify the sender
280     @param context - sender context, to match reply w/ request
281     @param enable_disable- enable if non-zero, else disable
282     @param pid - pid of the requesting process
283 */
284 autoreply define want_oam_events
285 {
286   u32 client_index;
287   u32 context;
288   u32 enable_disable;
289   u32 pid;
290 };
291
292 /** \brief OAM add / del target request
293     @param client_index - opaque cookie to identify the sender
294     @param context - sender context, to match reply w/ request
295     @param vrf_id - vrf_id of the target
296     @param src_address[] - source address to use for the updates 
297     @param dst_address[] - destination address of the target
298     @param is_add - add target if non-zero, else delete
299 */
300 autoreply define oam_add_del
301 {
302   u32 client_index;
303   u32 context;
304   u32 vrf_id;
305   u8 src_address[4];
306   u8 dst_address[4];
307   u8 is_add;
308 };
309
310 /** \brief Reset fib table request
311     @param client_index - opaque cookie to identify the sender
312     @param context - sender context, to match reply w/ request
313     @param vrf_id - vrf/table id of the fib table to reset
314     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
315 */
316 autoreply define reset_fib
317 {
318   u32 client_index;
319   u32 context;
320   u32 vrf_id;
321   u8 is_ipv6;
322 };
323
324 /** \brief Create loopback interface request
325     @param client_index - opaque cookie to identify the sender
326     @param context - sender context, to match reply w/ request
327     @param mac_address - mac addr to assign to the interface if none-zero
328 */
329 define create_loopback
330 {
331   u32 client_index;
332   u32 context;
333   u8 mac_address[6];
334 };
335
336 /** \brief Create loopback interface response
337     @param context - sender context, to match reply w/ request
338     @param sw_if_index - sw index of the interface that was created
339     @param retval - return code for the request
340 */
341 define create_loopback_reply
342 {
343   u32 context;
344   i32 retval;
345   u32 sw_if_index;
346 };
347
348 /** \brief Create loopback interface instance request
349     @param client_index - opaque cookie to identify the sender
350     @param context - sender context, to match reply w/ request
351     @param mac_address - mac addr to assign to the interface if none-zero
352     @param is_specified - if non-0, a specific user_instance is being requested
353     @param user_instance - requested instance, ~0 => dynamically allocate
354 */
355 define create_loopback_instance
356 {
357   u32 client_index;
358   u32 context;
359   u8 mac_address[6];
360   u8 is_specified;
361   u32 user_instance;
362 };
363
364 /** \brief Create loopback interface instance response
365     @param context - sender context, to match reply w/ request
366     @param sw_if_index - sw index of the interface that was created
367     @param retval - return code for the request
368 */
369 define create_loopback_instance_reply
370 {
371   u32 context;
372   i32 retval;
373   u32 sw_if_index;
374 };
375
376 /** \brief Delete loopback interface request
377     @param client_index - opaque cookie to identify the sender
378     @param context - sender context, to match reply w/ request
379     @param sw_if_index - sw index of the interface that was created
380 */
381 autoreply define delete_loopback
382 {
383   u32 client_index;
384   u32 context;
385   u32 sw_if_index;
386 };
387
388 /** \brief Control ping from client to api server request
389     @param client_index - opaque cookie to identify the sender
390     @param context - sender context, to match reply w/ request
391 */
392 define control_ping
393 {
394   u32 client_index;
395   u32 context;
396 };
397
398 /** \brief Control ping from the client to the server response
399     @param client_index - opaque cookie to identify the sender
400     @param context - sender context, to match reply w/ request
401     @param retval - return code for the request
402     @param vpe_pid - the pid of the vpe, returned by the server
403 */
404 define control_ping_reply
405 {
406   u32 context;
407   i32 retval;
408   u32 client_index;
409   u32 vpe_pid;
410 };
411
412 /** \brief Process a vpe parser cli string request
413     @param client_index - opaque cookie to identify the sender
414     @param context - sender context, to match reply w/ request
415     @param cmd_in_shmem - pointer to cli command string
416 */
417 define cli_request
418 {
419   u32 client_index;
420   u32 context;
421   u64 cmd_in_shmem;
422 };
423 define cli_inband
424 {
425   u32 client_index;
426   u32 context;
427   u32 length;
428   u8 cmd[length];
429 };
430
431 /** \brief vpe parser cli string response
432     @param context - sender context, to match reply w/ request
433     @param retval - return code for request
434     @param reply_in_shmem - Reply string from cli processing if any
435 */
436 define cli_reply
437 {
438   u32 context;
439   i32 retval;
440   u64 reply_in_shmem;
441 };
442 define cli_inband_reply
443 {
444   u32 context;
445   i32 retval;
446   u32 length;
447   u8 reply[length];
448 };
449
450 /** \brief Set max allowed ARP or ip6 neighbor entries request
451     @param client_index - opaque cookie to identify the sender
452     @param context - sender context, to match reply w/ request
453     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
454     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
455 */
456 autoreply define set_arp_neighbor_limit
457 {
458   u32 client_index;
459   u32 context;
460   u8 is_ipv6;
461   u32 arp_neighbor_limit;
462 };
463
464 /** \brief L2 interface patch add / del request
465     @param client_index - opaque cookie to identify the sender
466     @param context - sender context, to match reply w/ request
467     @param rx_sw_if_index - receive side interface 
468     @param tx_sw_if_index - transmit side interface
469     @param is_add - if non-zero set up the interface patch, else remove it
470 */
471 autoreply define l2_patch_add_del
472 {
473   u32 client_index;
474   u32 context;
475   u32 rx_sw_if_index;
476   u32 tx_sw_if_index;
477   u8 is_add;
478 };
479
480 /** \brief Interface set vpath request
481     @param client_index - opaque cookie to identify the sender
482     @param context - sender context, to match reply w/ request
483     @param sw_if_index - interface used to reach neighbor
484     @param enable - if non-zero enable, else disable
485 */
486 autoreply define sw_interface_set_vpath
487 {
488   u32 client_index;
489   u32 context;
490   u32 sw_if_index;
491   u8 enable;
492 };
493
494 /** \brief Set L2 XConnect between two interfaces request
495     @param client_index - opaque cookie to identify the sender
496     @param context - sender context, to match reply w/ request
497     @param rx_sw_if_index - Receive interface index
498     @param tx_sw_if_index - Transmit interface index
499     @param enable - enable xconnect if not 0, else set to L3 mode
500 */
501 autoreply define sw_interface_set_l2_xconnect
502 {
503   u32 client_index;
504   u32 context;
505   u32 rx_sw_if_index;
506   u32 tx_sw_if_index;
507   u8 enable;
508 };
509
510 /** \brief Interface bridge mode request
511     @param client_index - opaque cookie to identify the sender
512     @param context - sender context, to match reply w/ request
513     @param rx_sw_if_index - the interface
514     @param bd_id - bridge domain id
515     @param bvi - Setup interface as a bvi, bridge mode only
516     @param shg - Shared horizon group, for bridge mode only
517     @param enable - Enable beige mode if not 0, else set to L3 mode
518 */
519 autoreply define sw_interface_set_l2_bridge
520 {
521   u32 client_index;
522   u32 context;
523   u32 rx_sw_if_index;
524   u32 bd_id;
525   u8 shg;
526   u8 bvi;
527   u8 enable;
528 };
529
530 /** \brief Set bridge domain ip to mac entry request
531     @param client_index - opaque cookie to identify the sender
532     @param context - sender context, to match reply w/ request
533     @param bd_id - the bridge domain to set the flags for
534     @param is_add - if non-zero, add the entry, else clear it
535     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
536     @param mac_address - MAC address
537     @param 
538 */
539 autoreply define bd_ip_mac_add_del
540 {
541   u32 client_index;
542   u32 context;
543   u32 bd_id;
544   u8 is_add;
545   u8 is_ipv6;
546   u8 ip_address[16];
547   u8 mac_address[6];
548 };
549
550 /** \brief Set/unset the classification table for an interface request 
551     @param client_index - opaque cookie to identify the sender
552     @param context - sender context, to match reply w/ request
553     @param is_ipv6 - ipv6 if non-zero, else ipv4
554     @param sw_if_index - interface to associate with the table
555     @param table_index - index of the table, if ~0 unset the table
556 */
557 autoreply define classify_set_interface_ip_table
558 {
559   u32 client_index;
560   u32 context;
561   u8 is_ipv6;
562   u32 sw_if_index;
563   u32 table_index;              /* ~0 => off */
564 };
565
566 /** \brief Set/unset l2 classification tables for an interface request
567     @param client_index - opaque cookie to identify the sender
568     @param context - sender context, to match reply w/ request
569     @param sw_if_index - interface to set/unset tables for
570     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
571     @param ip6_table_index - ip6 index
572     @param other_table_index - other index
573 */
574 autoreply define classify_set_interface_l2_tables
575 {
576   u32 client_index;
577   u32 context;
578   u32 sw_if_index;
579   /* 3 x ~0 => off */
580   u32 ip4_table_index;
581   u32 ip6_table_index;
582   u32 other_table_index;
583   u8 is_input;
584 };
585
586 /** \brief Get node index using name request
587     @param client_index - opaque cookie to identify the sender
588     @param context - sender context, to match reply w/ request
589     @param node_name[] - name of the node
590 */
591 define get_node_index
592 {
593   u32 client_index;
594   u32 context;
595   u8 node_name[64];
596 };
597
598 /** \brief Get node index using name request
599     @param context - sender context, to match reply w/ request
600     @param retval - return code for the request
601     @param node_index - index of the desired node if found, else ~0
602 */
603 define get_node_index_reply
604 {
605   u32 context;
606   i32 retval;
607   u32 node_index;
608 };
609
610 /** \brief Set the next node for a given node request
611     @param client_index - opaque cookie to identify the sender
612     @param context - sender context, to match reply w/ request
613     @param node_name[] - node to add the next node to
614     @param next_name[] - node to add as the next node
615 */
616 define add_node_next
617 {
618   u32 client_index;
619   u32 context;
620   u8 node_name[64];
621   u8 next_name[64];
622 };
623
624 /** \brief IP Set the next node for a given node response
625     @param context - sender context, to match reply w/ request
626     @param retval - return code for the add next node request
627     @param next_index - the index of the next node if success, else ~0
628 */
629 define add_node_next_reply
630 {
631   u32 context;
632   i32 retval;
633   u32 next_index;
634 };
635
636 /** \brief L2 interface ethernet flow point filtering enable/disable request
637     @param client_index - opaque cookie to identify the sender
638     @param context - sender context, to match reply w/ request
639     @param sw_if_index - interface to enable/disable filtering on
640     @param enable_disable - if non-zero enable filtering, else disable
641 */
642 autoreply define l2_interface_efp_filter
643 {
644   u32 client_index;
645   u32 context;
646   u32 sw_if_index;
647   u32 enable_disable;
648 };
649
650 define create_subif
651 {
652   u32 client_index;
653   u32 context;
654   u32 sw_if_index;
655   u32 sub_id;
656
657   /* These fields map directly onto the subif template */
658   u8 no_tags;
659   u8 one_tag;
660   u8 two_tags;
661   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
662   u8 exact_match;
663   u8 default_sub;
664   u8 outer_vlan_id_any;
665   u8 inner_vlan_id_any;
666   u16 outer_vlan_id;
667   u16 inner_vlan_id;
668 };
669
670 define create_subif_reply
671 {
672   u32 context;
673   i32 retval;
674   u32 sw_if_index;
675 };
676
677 /** \brief show version
678     @param client_index - opaque cookie to identify the sender
679     @param context - sender context, to match reply w/ request
680 */
681 define show_version
682 {
683   u32 client_index;
684   u32 context;
685 };
686
687 /** \brief show version response
688     @param context - sender context, to match reply w/ request
689     @param retval - return code for the request
690     @param program - name of the program (vpe)
691     @param version  - version of the program
692     @param build_directory - root of the workspace where the program was built
693 */
694 define show_version_reply
695 {
696   u32 context;
697   i32 retval;
698   u8 program[32];
699   u8 version[32];
700   u8 build_date[32];
701   u8 build_directory[256];
702 };
703
704 /* Gross kludge, DGMS */
705 autoreply define interface_name_renumber
706 {
707   u32 client_index;
708   u32 context;
709   u32 sw_if_index;
710   u32 new_show_dev_instance;
711 };
712
713 /** \brief Register for ip4 arp resolution events
714     @param client_index - opaque cookie to identify the sender
715     @param context - sender context, to match reply w/ request
716     @param enable_disable - 1 => register for events, 0 => cancel registration
717     @param pid - sender's pid
718     @param address - the exact ip4 address of interest
719 */
720 autoreply define want_ip4_arp_events
721 {
722   u32 client_index;
723   u32 context;
724   u8 enable_disable;
725   u32 pid;
726   u32 address;
727 };
728
729 /** \brief Tell client about an ip4 arp resolution event
730     @param client_index - opaque cookie to identify the sender
731     @param context - sender context, to match reply w/ request
732     @param address - the exact ip4 address of interest
733     @param pid - client pid registered to receive notification
734     @param sw_if_index - interface which received ARP packet
735     @param new_mac - the new mac address 
736     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
737 */
738 define ip4_arp_event
739 {
740   u32 client_index;
741   u32 context;
742   u32 address;
743   u32 pid;
744   u32 sw_if_index;
745   u8 new_mac[6];
746   u8 mac_ip;
747 };
748
749 /** \brief Register for ip6 nd resolution events
750     @param client_index - opaque cookie to identify the sender
751     @param context - sender context, to match reply w/ request
752     @param enable_disable - 1 => register for events, 0 => cancel registration
753     @param pid - sender's pid
754     @param address - the exact ip6 address of interest
755 */
756 autoreply define want_ip6_nd_events
757 {
758   u32 client_index;
759   u32 context;
760   u8 enable_disable;
761   u32 pid;
762   u8 address[16];
763 };
764
765 /** \brief Tell client about an ip6 nd resolution or mac/ip event
766     @param client_index - opaque cookie to identify the sender
767     @param context - sender context, to match reply w/ request
768     @param pid - client pid registered to receive notification
769     @param sw_if_index - interface which received ARP packet
770     @param address - the exact ip6 address of interest
771     @param new_mac - the new mac address 
772     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
773 */
774 define ip6_nd_event
775 {
776   u32 client_index;
777   u32 context;
778   u32 pid;
779   u32 sw_if_index;
780   u8 address[16];
781   u8 new_mac[6];
782   u8 mac_ip;
783 };
784     
785 /** \brief Set/unset input ACL interface
786     @param client_index - opaque cookie to identify the sender
787     @param context - sender context, to match reply w/ request
788     @param sw_if_index - interface to set/unset input ACL
789     @param ip4_table_index - ip4 classify table index (~0 for skip)
790     @param ip6_table_index - ip6 classify table index (~0 for skip)
791     @param l2_table_index  -  l2 classify table index (~0 for skip)
792     @param is_add - Set input ACL if non-zero, else unset
793     Note: User is recommeneded to use just one valid table_index per call.
794           (ip4_table_index, ip6_table_index, or l2_table_index)
795 */
796 autoreply define input_acl_set_interface
797 {
798   u32 client_index;
799   u32 context;
800   u32 sw_if_index;
801   u32 ip4_table_index;
802   u32 ip6_table_index;
803   u32 l2_table_index;
804   u8 is_add;
805 };
806
807 define get_node_graph
808 {
809   u32 client_index;
810   u32 context;
811 };
812
813 /** \brief get_node_graph_reply
814     @param context - returned sender context, to match reply w/ request
815     @param retval - return code
816     @param reply_in_shmem - result from vlib_node_serialize, in shared
817     memory. Process with vlib_node_unserialize, remember to switch
818     heaps and free the result.
819 */
820
821 define get_node_graph_reply
822 {
823   u32 context;
824   i32 retval;
825   u64 reply_in_shmem;
826 };
827
828 /** \brief IOAM enable : Enable in-band OAM
829     @param id - profile id
830     @param seqno - To enable Seqno Processing
831     @param analyse - Enabling analysis of iOAM at decap node 
832     @param pow_enable - Proof of Work enabled or not flag
833     @param trace_enable - iOAM Trace enabled or not flag
834 */
835 autoreply define ioam_enable
836 {
837   u32 client_index;
838   u32 context;
839   u16 id;
840   u8 seqno;
841   u8 analyse;
842   u8 pot_enable;
843   u8 trace_enable;
844   u32 node_id;
845 };
846
847 /** \brief iOAM disable
848     @param client_index - opaque cookie to identify the sender
849     @param context - sender context, to match reply w/ request
850     @param index - MAP Domain index
851 */
852 autoreply define ioam_disable
853 {
854   u32 client_index;
855   u32 context;
856   u16 id;
857 };
858
859 /** \brief Query relative index via node names
860     @param client_index - opaque cookie to identify the sender
861     @param context - sender context, to match reply w/ request
862     @param node_name - name of node to find relative index from
863     @param next_name - next node from node_name to find relative index of
864 */
865 define get_next_index
866 {
867   u32 client_index;
868   u32 context;
869   u8 node_name[64];
870   u8 next_name[64];
871 };
872
873 /** \brief Reply for get next node index
874     @param context - sender context which was passed in the request
875     @param retval - return value
876     @param next_index - index of the next_node
877 */
878 define get_next_index_reply
879 {
880   u32 context;
881   i32 retval;
882   u32 next_index;
883 };
884
885 /** \brief PacketGenerator create interface request
886     @param client_index - opaque cookie to identify the sender
887     @param context - sender context, to match reply w/ request
888     @param interface_id - interface index
889 */
890 define pg_create_interface
891 {
892   u32 client_index;
893   u32 context;
894   u32 interface_id;
895 };
896
897 /** \brief PacketGenerator create interface response
898     @param context - sender context, to match reply w/ request
899     @param retval - return value for request
900 */
901 define pg_create_interface_reply
902 {
903   u32 context;
904   i32 retval;
905   u32 sw_if_index;
906 };
907
908 /** \brief PacketGenerator capture packets on given interface request
909     @param client_index - opaque cookie to identify the sender
910     @param context - sender context, to match reply w/ request
911     @param interface_id - pg interface index
912     @param is_enabled - 1 if enabling streams, 0 if disabling
913     @param count - number of packets to be captured
914     @param pcap_file - pacp file name to store captured packets
915 */
916 autoreply define pg_capture
917 {
918   u32 client_index;
919   u32 context;
920   u32 interface_id;
921   u8 is_enabled;
922   u32 count;
923   u32 pcap_name_length;
924   u8 pcap_file_name[pcap_name_length];
925 };
926
927 /** \brief Enable / disable packet generator request
928     @param client_index - opaque cookie to identify the sender
929     @param context - sender context, to match reply w/ request
930     @param is_enabled - 1 if enabling streams, 0 if disabling
931     @param stream - stream name to be enable/disabled, if not specified handle all streams
932 */
933 autoreply define pg_enable_disable
934 {
935   u32 client_index;
936   u32 context;
937   u8 is_enabled;
938   u32 stream_name_length;
939   u8 stream_name[stream_name_length];
940 };
941
942 /** \brief Configure IP source and L4 port-range check
943     @param client_index - opaque cookie to identify the sender
944     @param context - sender context, to match reply w/ request
945     @param is_ip6 - 1 if source address type is IPv6
946     @param is_add - 1 if add, 0 if delete
947     @param mask_length - mask length for address entry
948     @param address - array of address bytes
949     @param number_of_ranges - length of low_port and high_port arrays (must match)
950     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
951     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
952     @param vrf_id - fib table/vrf id to associate the source and port-range check with
953     @note To specify a single port set low_port and high_port entry the same
954 */
955 autoreply define ip_source_and_port_range_check_add_del
956 {
957   u32 client_index;
958   u32 context;
959   u8 is_ipv6;
960   u8 is_add;
961   u8 mask_length;
962   u8 address[16];
963   u8 number_of_ranges;
964   u16 low_ports[32];
965   u16 high_ports[32];
966   u32 vrf_id;
967 };
968
969 /** \brief Set interface source and L4 port-range request
970     @param client_index - opaque cookie to identify the sender
971     @param context - sender context, to match reply w/ request
972     @param interface_id - interface index
973     @param tcp_vrf_id - VRF associated with source and TCP port-range check
974     @param udp_vrf_id - VRF associated with source and TCP port-range check
975 */
976 autoreply define ip_source_and_port_range_check_interface_add_del
977 {
978   u32 client_index;
979   u32 context;
980   u8 is_add;
981   u32 sw_if_index;
982   u32 tcp_in_vrf_id;
983   u32 tcp_out_vrf_id;
984   u32 udp_in_vrf_id;
985   u32 udp_out_vrf_id;
986 };
987
988 /** \brief Delete sub interface request
989     @param client_index - opaque cookie to identify the sender
990     @param context - sender context, to match reply w/ request
991     @param sw_if_index - sw index of the interface that was created by create_subif
992 */
993 autoreply define delete_subif {
994   u32 client_index;
995   u32 context;
996   u32 sw_if_index;
997 };
998
999 /** \brief Punt traffic to the host
1000     @param client_index - opaque cookie to identify the sender
1001     @param context - sender context, to match reply w/ request
1002     @param is_add - add punt if non-zero, else delete
1003     @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
1004     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
1005     @param l4_port - TCP/UDP port to be punted
1006 */
1007 autoreply define punt {
1008     u32 client_index;
1009     u32 context;
1010     u8 is_add;
1011     u8 ipv;
1012     u8 l4_protocol;
1013     u16 l4_port;
1014 };
1015
1016 /** \brief Feature path enable/disable request
1017     @param client_index - opaque cookie to identify the sender
1018     @param context - sender context, to match reply w/ request
1019     @param sw_if_index - the interface
1020     @param enable - 1 = on, 0 = off
1021 */
1022 autoreply define feature_enable_disable {
1023     u32 client_index;
1024     u32 context;
1025     u32 sw_if_index;
1026     u8 enable;
1027     u8 arc_name[64];
1028     u8 feature_name[64];
1029 };
1030
1031 /*
1032  * Local Variables:
1033  * eval: (c-set-style "gnu")
1034  * End:
1035  */