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