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