vppapigen: support per-file (major,minor,patch) version stamps
[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 vl_api_version 1.0.0
23
24 /* 
25  * Note: API placement cleanup in progress
26  * If you're looking for interface APIs, please
27  * see .../src/vnet/{interface.api,interface_api.c}
28  * IP APIs: see .../src/vnet/ip/{ip.api, ip_api.c}
29  * TAP APIs: see .../src/vnet/unix/{tap.api, tap_api.c}
30  * VXLAN APIs: see .../src/vnet/vxlan/{vxlan.api, vxlan_api.c}
31  * GENEVE APIs: see .../src/vnet/geneve/{geneve.api, geneve_api.c}
32  * LLDP APIs: see .../src/vnet/lldp/{lldp.api, lldp_api.c}
33  * AF-PACKET APIs: see ... /vnet/devices/af_packet/{af_packet.api, af_packet_api.c}
34  * NETMAP APIs: see ... /src/vnet/devices/netmap/{netmap.api, netmap_api.c}
35  * VHOST-USER APIs: see .../vnet/devices/virtio/{vhost_user.api, vhost_user_api.c}
36  * VXLAN GPE APIs: see .../src/vnet/vxlan-gpe/{vxlan_gpe.api, vxlan_gpe_api.c}
37  * GRE APIs: see .../src/vnet/gre/{gre.api, gre_api.c}
38  * L2 APIs: see .../src/vnet/l2/{l2.api, l2_api.c}
39  * L2TP APIs: see .../src/vnet/l2tp/{l2tp.api, l2tp_api.c}
40  * BFD APIs: see .../src/vnet/bfd/{bfd.api, bfd_api.c}
41  * IPSEC APIs: see .../src/vnet/ipsec/{ipsec.api, ipsec_api.c}
42  * IPSEC-GRE APIs: see .../src/vnet/ipsec-gre/{ipsec_gre.api, ipsec_gre_api.c}
43  * LISP APIs: see .../src/vnet/lisp/{lisp.api, lisp_api.c}
44  * LISP-GPE APIs: see .../src/vnet/lisp-gpe/{lisp_gpe.api, lisp_gpe_api.c}
45  * SESSION APIs: .../vnet/session/{session.api session_api.c}
46  * MPLS APIs: see .../src/vnet/mpls/{mpls.api, mpls_api.c}
47  * SR APIs: see .../src/vnet/srv6/{sr.api, sr_api.c}
48  * CLASSIFY APIs: see ... /src/vnet/classify/{classify.api, classify_api.c}
49  * FLOW APIs: see ... /src/vnet/flow/{flow.api, flow_api.c}
50  * DHCP APIs: see ... /src/vnet/dhcp/{dhcpk.api, dhcp_api.c}
51  * COP APIs: see ... /src/vnet/cop/{cop.api, cop_api.c}
52  * POLICER APIs: see ... /src/vnet/policer/{policer.api, policer_api.c}
53  * STATS APIs: see .../src/vpp/stats/{stats.api, stats.c}
54  */
55
56 /** \brief Create a new subinterface with the given vlan id
57     @param client_index - opaque cookie to identify the sender
58     @param context - sender context, to match reply w/ request
59     @param sw_if_index - software index of the new vlan's parent interface
60     @param vlan_id - vlan tag of the new interface
61 */
62 define create_vlan_subif
63 {
64   u32 client_index;
65   u32 context;
66   u32 sw_if_index;
67   u32 vlan_id;
68 };
69
70 /** \brief Reply for the vlan subinterface create request
71     @param context - returned sender context, to match reply w/ request
72     @param retval - return code
73     @param sw_if_index - software index allocated for the new subinterface
74 */
75 define create_vlan_subif_reply
76 {
77   u32 context;
78   i32 retval;
79   u32 sw_if_index;
80 };
81
82 /** \brief Enable or Disable MPLS on and interface
83     @param client_index - opaque cookie to identify the sender
84     @param context - sender context, to match reply w/ request
85     @param sw_if_index - index of the interface
86     @param enable - if non-zero enable, else disable
87 */
88 autoreply define sw_interface_set_mpls_enable
89 {
90   u32 client_index;
91   u32 context;
92   u32 sw_if_index;
93   u8 enable;
94 };
95
96 /** \brief Proxy ARP add / del request
97     @param client_index - opaque cookie to identify the sender
98     @param context - sender context, to match reply w/ request
99     @param vrf_id - VRF / Fib table ID
100     @param is_add - 1 if adding the Proxy ARP range, 0 if deleting
101     @param low_address[4] - Low address of the Proxy ARP range
102     @param hi_address[4] - High address of the Proxy ARP range
103 */
104 autoreply define proxy_arp_add_del
105 {
106   u32 client_index;
107   u32 context;
108   u32 vrf_id;
109   u8 is_add;
110   u8 low_address[4];
111   u8 hi_address[4];
112 };
113
114 /** \brief Proxy ARP add / del request
115     @param client_index - opaque cookie to identify the sender
116     @param context - sender context, to match reply w/ request
117     @param sw_if_index - Which interface to enable / disable Proxy Arp on
118     @param enable_disable - 1 to enable Proxy ARP on interface, 0 to disable
119 */
120 autoreply define proxy_arp_intfc_enable_disable
121 {
122   u32 client_index;
123   u32 context;
124   u32 sw_if_index;
125   /* 1 = on, 0 = off */
126   u8 enable_disable;
127 };
128
129 /** \brief Reset VRF (remove all routes etc) request
130     @param client_index - opaque cookie to identify the sender
131     @param context - sender context, to match reply w/ request
132     @param is_ipv6 - 1 for IPv6 neighbor, 0 for IPv4
133     @param vrf_id - ID of th FIB table / VRF to reset
134 */
135 autoreply define reset_vrf
136 {
137   u32 client_index;
138   u32 context;
139   u8 is_ipv6;
140   u32 vrf_id;
141 };
142
143 /** \brief OAM event structure
144     @param dst_address[] - 
145     @param state
146 */
147 define oam_event
148 {
149   u8 dst_address[4];
150   u8 state;
151 };
152
153 /** \brief Want OAM events request
154     @param client_index - opaque cookie to identify the sender
155     @param context - sender context, to match reply w/ request
156     @param enable_disable- enable if non-zero, else disable
157     @param pid - pid of the requesting process
158 */
159 autoreply define want_oam_events
160 {
161   u32 client_index;
162   u32 context;
163   u32 enable_disable;
164   u32 pid;
165 };
166
167 /** \brief OAM add / del target request
168     @param client_index - opaque cookie to identify the sender
169     @param context - sender context, to match reply w/ request
170     @param vrf_id - vrf_id of the target
171     @param src_address[] - source address to use for the updates 
172     @param dst_address[] - destination address of the target
173     @param is_add - add target if non-zero, else delete
174 */
175 autoreply define oam_add_del
176 {
177   u32 client_index;
178   u32 context;
179   u32 vrf_id;
180   u8 src_address[4];
181   u8 dst_address[4];
182   u8 is_add;
183 };
184
185 /** \brief Reset fib table request
186     @param client_index - opaque cookie to identify the sender
187     @param context - sender context, to match reply w/ request
188     @param vrf_id - vrf/table id of the fib table to reset
189     @param is_ipv6 - an ipv6 fib to reset if non-zero, else ipv4
190 */
191 autoreply define reset_fib
192 {
193   u32 client_index;
194   u32 context;
195   u32 vrf_id;
196   u8 is_ipv6;
197 };
198
199 /** \brief Create loopback interface request
200     @param client_index - opaque cookie to identify the sender
201     @param context - sender context, to match reply w/ request
202     @param mac_address - mac addr to assign to the interface if none-zero
203 */
204 define create_loopback
205 {
206   u32 client_index;
207   u32 context;
208   u8 mac_address[6];
209 };
210
211 /** \brief Create loopback interface response
212     @param context - sender context, to match reply w/ request
213     @param sw_if_index - sw index of the interface that was created
214     @param retval - return code for the request
215 */
216 define create_loopback_reply
217 {
218   u32 context;
219   i32 retval;
220   u32 sw_if_index;
221 };
222
223 /** \brief Create loopback interface instance request
224     @param client_index - opaque cookie to identify the sender
225     @param context - sender context, to match reply w/ request
226     @param mac_address - mac addr to assign to the interface if none-zero
227     @param is_specified - if non-0, a specific user_instance is being requested
228     @param user_instance - requested instance, ~0 => dynamically allocate
229 */
230 define create_loopback_instance
231 {
232   u32 client_index;
233   u32 context;
234   u8 mac_address[6];
235   u8 is_specified;
236   u32 user_instance;
237 };
238
239 /** \brief Create loopback interface instance response
240     @param context - sender context, to match reply w/ request
241     @param sw_if_index - sw index of the interface that was created
242     @param retval - return code for the request
243 */
244 define create_loopback_instance_reply
245 {
246   u32 context;
247   i32 retval;
248   u32 sw_if_index;
249 };
250
251 /** \brief Delete loopback interface request
252     @param client_index - opaque cookie to identify the sender
253     @param context - sender context, to match reply w/ request
254     @param sw_if_index - sw index of the interface that was created
255 */
256 autoreply define delete_loopback
257 {
258   u32 client_index;
259   u32 context;
260   u32 sw_if_index;
261 };
262
263 /** \brief Control ping from client to api server request
264     @param client_index - opaque cookie to identify the sender
265     @param context - sender context, to match reply w/ request
266 */
267 define control_ping
268 {
269   u32 client_index;
270   u32 context;
271 };
272
273 /** \brief Control ping from the client to the server response
274     @param client_index - opaque cookie to identify the sender
275     @param context - sender context, to match reply w/ request
276     @param retval - return code for the request
277     @param vpe_pid - the pid of the vpe, returned by the server
278 */
279 define control_ping_reply
280 {
281   u32 context;
282   i32 retval;
283   u32 client_index;
284   u32 vpe_pid;
285 };
286
287 /** \brief Process a vpe parser cli string request
288     @param client_index - opaque cookie to identify the sender
289     @param context - sender context, to match reply w/ request
290     @param cmd_in_shmem - pointer to cli command string
291 */
292 define cli
293 {
294   u32 client_index;
295   u32 context;
296   u64 cmd_in_shmem;
297 };
298 define cli_inband
299 {
300   u32 client_index;
301   u32 context;
302   u32 length;
303   u8 cmd[length];
304 };
305
306 /** \brief vpe parser cli string response
307     @param context - sender context, to match reply w/ request
308     @param retval - return code for request
309     @param reply_in_shmem - Reply string from cli processing if any
310 */
311 define cli_reply
312 {
313   u32 context;
314   i32 retval;
315   u64 reply_in_shmem;
316 };
317 define cli_inband_reply
318 {
319   u32 context;
320   i32 retval;
321   u32 length;
322   u8 reply[length];
323 };
324
325 /** \brief Set max allowed ARP or ip6 neighbor entries request
326     @param client_index - opaque cookie to identify the sender
327     @param context - sender context, to match reply w/ request
328     @param is_ipv6 - neighbor limit if non-zero, else ARP limit
329     @param arp_neighbor_limit - the new limit, defaults are ~ 50k
330 */
331 autoreply define set_arp_neighbor_limit
332 {
333   u32 client_index;
334   u32 context;
335   u8 is_ipv6;
336   u32 arp_neighbor_limit;
337 };
338
339 /** \brief L2 interface patch add / del request
340     @param client_index - opaque cookie to identify the sender
341     @param context - sender context, to match reply w/ request
342     @param rx_sw_if_index - receive side interface 
343     @param tx_sw_if_index - transmit side interface
344     @param is_add - if non-zero set up the interface patch, else remove it
345 */
346 autoreply define l2_patch_add_del
347 {
348   u32 client_index;
349   u32 context;
350   u32 rx_sw_if_index;
351   u32 tx_sw_if_index;
352   u8 is_add;
353 };
354
355 /** \brief Interface set vpath request
356     @param client_index - opaque cookie to identify the sender
357     @param context - sender context, to match reply w/ request
358     @param sw_if_index - interface used to reach neighbor
359     @param enable - if non-zero enable, else disable
360 */
361 autoreply define sw_interface_set_vpath
362 {
363   u32 client_index;
364   u32 context;
365   u32 sw_if_index;
366   u8 enable;
367 };
368
369 /** \brief Set L2 XConnect between two interfaces request
370     @param client_index - opaque cookie to identify the sender
371     @param context - sender context, to match reply w/ request
372     @param rx_sw_if_index - Receive interface index
373     @param tx_sw_if_index - Transmit interface index
374     @param enable - enable xconnect if not 0, else set to L3 mode
375 */
376 autoreply define sw_interface_set_l2_xconnect
377 {
378   u32 client_index;
379   u32 context;
380   u32 rx_sw_if_index;
381   u32 tx_sw_if_index;
382   u8 enable;
383 };
384
385 /** \brief Interface bridge mode request
386     @param client_index - opaque cookie to identify the sender
387     @param context - sender context, to match reply w/ request
388     @param rx_sw_if_index - the interface
389     @param bd_id - bridge domain id
390     @param bvi - Setup interface as a bvi, bridge mode only
391     @param shg - Shared horizon group, for bridge mode only
392     @param enable - Enable beige mode if not 0, else set to L3 mode
393 */
394 autoreply define sw_interface_set_l2_bridge
395 {
396   u32 client_index;
397   u32 context;
398   u32 rx_sw_if_index;
399   u32 bd_id;
400   u8 shg;
401   u8 bvi;
402   u8 enable;
403 };
404
405 /** \brief Set bridge domain ip to mac entry request
406     @param client_index - opaque cookie to identify the sender
407     @param context - sender context, to match reply w/ request
408     @param bd_id - the bridge domain to set the flags for
409     @param is_add - if non-zero, add the entry, else clear it
410     @param is_ipv6 - if non-zero, ipv6 address, else ipv4 address
411     @param mac_address - MAC address
412     @param 
413 */
414 autoreply define bd_ip_mac_add_del
415 {
416   u32 client_index;
417   u32 context;
418   u32 bd_id;
419   u8 is_add;
420   u8 is_ipv6;
421   u8 ip_address[16];
422   u8 mac_address[6];
423 };
424
425 /** \brief Set/unset the classification table for an interface request 
426     @param client_index - opaque cookie to identify the sender
427     @param context - sender context, to match reply w/ request
428     @param is_ipv6 - ipv6 if non-zero, else ipv4
429     @param sw_if_index - interface to associate with the table
430     @param table_index - index of the table, if ~0 unset the table
431 */
432 autoreply define classify_set_interface_ip_table
433 {
434   u32 client_index;
435   u32 context;
436   u8 is_ipv6;
437   u32 sw_if_index;
438   u32 table_index;              /* ~0 => off */
439 };
440
441 /** \brief Set/unset l2 classification tables for an interface request
442     @param client_index - opaque cookie to identify the sender
443     @param context - sender context, to match reply w/ request
444     @param sw_if_index - interface to set/unset tables for
445     @param ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset
446     @param ip6_table_index - ip6 index
447     @param other_table_index - other index
448 */
449 autoreply define classify_set_interface_l2_tables
450 {
451   u32 client_index;
452   u32 context;
453   u32 sw_if_index;
454   /* 3 x ~0 => off */
455   u32 ip4_table_index;
456   u32 ip6_table_index;
457   u32 other_table_index;
458   u8 is_input;
459 };
460
461 /** \brief Get node index using name request
462     @param client_index - opaque cookie to identify the sender
463     @param context - sender context, to match reply w/ request
464     @param node_name[] - name of the node
465 */
466 define get_node_index
467 {
468   u32 client_index;
469   u32 context;
470   u8 node_name[64];
471 };
472
473 /** \brief Get node index using name request
474     @param context - sender context, to match reply w/ request
475     @param retval - return code for the request
476     @param node_index - index of the desired node if found, else ~0
477 */
478 define get_node_index_reply
479 {
480   u32 context;
481   i32 retval;
482   u32 node_index;
483 };
484
485 /** \brief Set the next node for a given node request
486     @param client_index - opaque cookie to identify the sender
487     @param context - sender context, to match reply w/ request
488     @param node_name[] - node to add the next node to
489     @param next_name[] - node to add as the next node
490 */
491 define add_node_next
492 {
493   u32 client_index;
494   u32 context;
495   u8 node_name[64];
496   u8 next_name[64];
497 };
498
499 /** \brief IP Set the next node for a given node response
500     @param context - sender context, to match reply w/ request
501     @param retval - return code for the add next node request
502     @param next_index - the index of the next node if success, else ~0
503 */
504 define add_node_next_reply
505 {
506   u32 context;
507   i32 retval;
508   u32 next_index;
509 };
510
511 /** \brief L2 interface ethernet flow point filtering enable/disable request
512     @param client_index - opaque cookie to identify the sender
513     @param context - sender context, to match reply w/ request
514     @param sw_if_index - interface to enable/disable filtering on
515     @param enable_disable - if non-zero enable filtering, else disable
516 */
517 autoreply define l2_interface_efp_filter
518 {
519   u32 client_index;
520   u32 context;
521   u32 sw_if_index;
522   u32 enable_disable;
523 };
524
525 define create_subif
526 {
527   u32 client_index;
528   u32 context;
529   u32 sw_if_index;
530   u32 sub_id;
531
532   /* These fields map directly onto the subif template */
533   u8 no_tags;
534   u8 one_tag;
535   u8 two_tags;
536   u8 dot1ad;                    // 0 = dot1q, 1=dot1ad
537   u8 exact_match;
538   u8 default_sub;
539   u8 outer_vlan_id_any;
540   u8 inner_vlan_id_any;
541   u16 outer_vlan_id;
542   u16 inner_vlan_id;
543 };
544
545 define create_subif_reply
546 {
547   u32 context;
548   i32 retval;
549   u32 sw_if_index;
550 };
551
552 /** \brief show version
553     @param client_index - opaque cookie to identify the sender
554     @param context - sender context, to match reply w/ request
555 */
556 define show_version
557 {
558   u32 client_index;
559   u32 context;
560 };
561
562 /** \brief show version response
563     @param context - sender context, to match reply w/ request
564     @param retval - return code for the request
565     @param program - name of the program (vpe)
566     @param version  - version of the program
567     @param build_directory - root of the workspace where the program was built
568 */
569 define show_version_reply
570 {
571   u32 context;
572   i32 retval;
573   u8 program[32];
574   u8 version[32];
575   u8 build_date[32];
576   u8 build_directory[256];
577 };
578
579 /* Gross kludge, DGMS */
580 autoreply define interface_name_renumber
581 {
582   u32 client_index;
583   u32 context;
584   u32 sw_if_index;
585   u32 new_show_dev_instance;
586 };
587
588 /** \brief Register for ip4 arp resolution events
589     @param client_index - opaque cookie to identify the sender
590     @param context - sender context, to match reply w/ request
591     @param enable_disable - 1 => register for events, 0 => cancel registration
592     @param pid - sender's pid
593     @param address - the exact ip4 address of interest
594 */
595 autoreply define want_ip4_arp_events
596 {
597   u32 client_index;
598   u32 context;
599   u8 enable_disable;
600   u32 pid;
601   u32 address;
602 };
603
604 /** \brief Tell client about an ip4 arp resolution event
605     @param client_index - opaque cookie to identify the sender
606     @param address - the exact ip4 address of interest
607     @param pid - client pid registered to receive notification
608     @param sw_if_index - interface which received ARP packet
609     @param new_mac - the new mac address 
610     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
611 */
612 define ip4_arp_event
613 {
614   u32 client_index;
615   u32 address;
616   u32 pid;
617   u32 sw_if_index;
618   u8 new_mac[6];
619   u8 mac_ip;
620 };
621
622 /** \brief Register for ip6 nd resolution events
623     @param client_index - opaque cookie to identify the sender
624     @param context - sender context, to match reply w/ request
625     @param enable_disable - 1 => register for events, 0 => cancel registration
626     @param pid - sender's pid
627     @param address - the exact ip6 address of interest
628 */
629 autoreply define want_ip6_nd_events
630 {
631   u32 client_index;
632   u32 context;
633   u8 enable_disable;
634   u32 pid;
635   u8 address[16];
636 };
637
638 /** \brief Tell client about an ip6 nd resolution or mac/ip event
639     @param client_index - opaque cookie to identify the sender
640     @param pid - client pid registered to receive notification
641     @param sw_if_index - interface which received ARP packet
642     @param address - the exact ip6 address of interest
643     @param new_mac - the new mac address 
644     @param mac_ip - 0: resolution event, 1: mac/ip binding in bd
645 */
646 define ip6_nd_event
647 {
648   u32 client_index;
649   u32 pid;
650   u32 sw_if_index;
651   u8 address[16];
652   u8 new_mac[6];
653   u8 mac_ip;
654 };
655     
656 /** \brief Set/unset input ACL interface
657     @param client_index - opaque cookie to identify the sender
658     @param context - sender context, to match reply w/ request
659     @param sw_if_index - interface to set/unset input ACL
660     @param ip4_table_index - ip4 classify table index (~0 for skip)
661     @param ip6_table_index - ip6 classify table index (~0 for skip)
662     @param l2_table_index  -  l2 classify table index (~0 for skip)
663     @param is_add - Set input ACL if non-zero, else unset
664     Note: User is recommeneded to use just one valid table_index per call.
665           (ip4_table_index, ip6_table_index, or l2_table_index)
666 */
667 autoreply define input_acl_set_interface
668 {
669   u32 client_index;
670   u32 context;
671   u32 sw_if_index;
672   u32 ip4_table_index;
673   u32 ip6_table_index;
674   u32 l2_table_index;
675   u8 is_add;
676 };
677
678 define get_node_graph
679 {
680   u32 client_index;
681   u32 context;
682 };
683
684 /** \brief get_node_graph_reply
685     @param context - returned sender context, to match reply w/ request
686     @param retval - return code
687     @param reply_in_shmem - result from vlib_node_serialize, in shared
688     memory. Process with vlib_node_unserialize, remember to switch
689     heaps and free the result.
690 */
691
692 define get_node_graph_reply
693 {
694   u32 context;
695   i32 retval;
696   u64 reply_in_shmem;
697 };
698
699 /** \brief IOAM enable : Enable in-band OAM
700     @param id - profile id
701     @param seqno - To enable Seqno Processing
702     @param analyse - Enabling analysis of iOAM at decap node 
703     @param pow_enable - Proof of Work enabled or not flag
704     @param trace_enable - iOAM Trace enabled or not flag
705 */
706 autoreply define ioam_enable
707 {
708   u32 client_index;
709   u32 context;
710   u16 id;
711   u8 seqno;
712   u8 analyse;
713   u8 pot_enable;
714   u8 trace_enable;
715   u32 node_id;
716 };
717
718 /** \brief iOAM disable
719     @param client_index - opaque cookie to identify the sender
720     @param context - sender context, to match reply w/ request
721     @param index - MAP Domain index
722 */
723 autoreply define ioam_disable
724 {
725   u32 client_index;
726   u32 context;
727   u16 id;
728 };
729
730 /** \brief Query relative index via node names
731     @param client_index - opaque cookie to identify the sender
732     @param context - sender context, to match reply w/ request
733     @param node_name - name of node to find relative index from
734     @param next_name - next node from node_name to find relative index of
735 */
736 define get_next_index
737 {
738   u32 client_index;
739   u32 context;
740   u8 node_name[64];
741   u8 next_name[64];
742 };
743
744 /** \brief Reply for get next node index
745     @param context - sender context which was passed in the request
746     @param retval - return value
747     @param next_index - index of the next_node
748 */
749 define get_next_index_reply
750 {
751   u32 context;
752   i32 retval;
753   u32 next_index;
754 };
755
756 /** \brief PacketGenerator create interface request
757     @param client_index - opaque cookie to identify the sender
758     @param context - sender context, to match reply w/ request
759     @param interface_id - interface index
760 */
761 define pg_create_interface
762 {
763   u32 client_index;
764   u32 context;
765   u32 interface_id;
766 };
767
768 /** \brief PacketGenerator create interface response
769     @param context - sender context, to match reply w/ request
770     @param retval - return value for request
771 */
772 define pg_create_interface_reply
773 {
774   u32 context;
775   i32 retval;
776   u32 sw_if_index;
777 };
778
779 /** \brief PacketGenerator capture packets on given interface request
780     @param client_index - opaque cookie to identify the sender
781     @param context - sender context, to match reply w/ request
782     @param interface_id - pg interface index
783     @param is_enabled - 1 if enabling streams, 0 if disabling
784     @param count - number of packets to be captured
785     @param pcap_file - pacp file name to store captured packets
786 */
787 autoreply define pg_capture
788 {
789   u32 client_index;
790   u32 context;
791   u32 interface_id;
792   u8 is_enabled;
793   u32 count;
794   u32 pcap_name_length;
795   u8 pcap_file_name[pcap_name_length];
796 };
797
798 /** \brief Enable / disable packet generator request
799     @param client_index - opaque cookie to identify the sender
800     @param context - sender context, to match reply w/ request
801     @param is_enabled - 1 if enabling streams, 0 if disabling
802     @param stream - stream name to be enable/disabled, if not specified handle all streams
803 */
804 autoreply define pg_enable_disable
805 {
806   u32 client_index;
807   u32 context;
808   u8 is_enabled;
809   u32 stream_name_length;
810   u8 stream_name[stream_name_length];
811 };
812
813 /** \brief Configure IP source and L4 port-range check
814     @param client_index - opaque cookie to identify the sender
815     @param context - sender context, to match reply w/ request
816     @param is_ip6 - 1 if source address type is IPv6
817     @param is_add - 1 if add, 0 if delete
818     @param mask_length - mask length for address entry
819     @param address - array of address bytes
820     @param number_of_ranges - length of low_port and high_port arrays (must match)
821     @param low_ports[32] - up to 32 low end of port range entries (must have corresponding high_ports entry)
822     @param high_ports[32] - up to 32 high end of port range entries (must have corresponding low_ports entry)
823     @param vrf_id - fib table/vrf id to associate the source and port-range check with
824     @note To specify a single port set low_port and high_port entry the same
825 */
826 autoreply define ip_source_and_port_range_check_add_del
827 {
828   u32 client_index;
829   u32 context;
830   u8 is_ipv6;
831   u8 is_add;
832   u8 mask_length;
833   u8 address[16];
834   u8 number_of_ranges;
835   u16 low_ports[32];
836   u16 high_ports[32];
837   u32 vrf_id;
838 };
839
840 /** \brief Set interface source and L4 port-range request
841     @param client_index - opaque cookie to identify the sender
842     @param context - sender context, to match reply w/ request
843     @param interface_id - interface index
844     @param tcp_vrf_id - VRF associated with source and TCP port-range check
845     @param udp_vrf_id - VRF associated with source and TCP port-range check
846 */
847 autoreply define ip_source_and_port_range_check_interface_add_del
848 {
849   u32 client_index;
850   u32 context;
851   u8 is_add;
852   u32 sw_if_index;
853   u32 tcp_in_vrf_id;
854   u32 tcp_out_vrf_id;
855   u32 udp_in_vrf_id;
856   u32 udp_out_vrf_id;
857 };
858
859 /** \brief Delete sub interface request
860     @param client_index - opaque cookie to identify the sender
861     @param context - sender context, to match reply w/ request
862     @param sw_if_index - sw index of the interface that was created by create_subif
863 */
864 autoreply define delete_subif {
865   u32 client_index;
866   u32 context;
867   u32 sw_if_index;
868 };
869
870 /** \brief Punt traffic to the host
871     @param client_index - opaque cookie to identify the sender
872     @param context - sender context, to match reply w/ request
873     @param is_add - add punt if non-zero, else delete
874     @param ipv - L3 protocol 4 - IPv4, 6 - IPv6, ~0 - All
875     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
876     @param l4_port - TCP/UDP port to be punted
877 */
878 autoreply define punt {
879     u32 client_index;
880     u32 context;
881     u8 is_add;
882     u8 ipv;
883     u8 l4_protocol;
884     u16 l4_port;
885 };
886
887 /** \brief Punt traffic to the host via socket
888     @param client_index - opaque cookie to identify the sender
889     @param context - sender context, to match reply w/ request
890     @param header_version - expected meta data header version (currently 1)
891     @param is_ip4 - L3 protocol 1 - IPv4, 0 - IPv6
892     @param l4_protocol - L4 protocol to be punted, only UDP (0x11) is supported
893     @param l4_port - TCP/UDP port to be punted
894 */
895 define punt_socket_register {
896     u32 client_index;
897     u32 context;
898     u32 header_version;
899     u8 is_ip4;
900     u8 l4_protocol;
901     u16 l4_port;
902     u8 pathname[108]; /* Linux sun_path defined to be 108 bytes, see unix(7) */
903 };
904
905 define punt_socket_register_reply
906 {
907   u32 context;
908   i32 retval;
909   u8 pathname[64];
910 };
911
912 autoreply define punt_socket_deregister {
913     u32 client_index;
914     u32 context;
915     u8 is_ip4;
916     u8 l4_protocol;
917     u16 l4_port;
918 };
919
920 /** \brief Feature path enable/disable request
921     @param client_index - opaque cookie to identify the sender
922     @param context - sender context, to match reply w/ request
923     @param sw_if_index - the interface
924     @param enable - 1 = on, 0 = off
925 */
926 autoreply define feature_enable_disable {
927     u32 client_index;
928     u32 context;
929     u32 sw_if_index;
930     u8 enable;
931     u8 arc_name[64];
932     u8 feature_name[64];
933 };
934
935 /*
936  * Local Variables:
937  * eval: (c-set-style "gnu")
938  * End:
939  */