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