Fix vl_map_shmem() root_path dangling reference.
[vpp.git] / src / plugins / snat / snat.api
1 /*
2  * Copyright (c) 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 snat.api
17  * @brief VPP control-plane API messages.
18  *
19  * This file defines VPP control-plane API messages which are generally
20  * called through a shared memory interface.
21  */
22
23 /** \brief Add/del S-NAT address range
24     @param client_index - opaque cookie to identify the sender
25     @param context - sender context, to match reply w/ request
26     @param is_ip4 - 1 if address type is IPv4
27     @param first_ip_address - first IP address
28     @param last_ip_address - last IP address
29     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
30     @param is_add - 1 if add, 0 if delete
31 */
32 autoreply define snat_add_address_range {
33   u32 client_index;
34   u32 context;
35   u8 is_ip4;
36   u8 first_ip_address[16];
37   u8 last_ip_address[16];
38   u32 vrf_id;
39   u8 is_add;
40 };
41
42 /** \brief Dump S-NAT addresses
43     @param client_index - opaque cookie to identify the sender
44     @param context - sender context, to match reply w/ request
45 */
46 define snat_address_dump {
47   u32 client_index;
48   u32 context;
49 };
50
51 /** \brief S-NAT address details response
52     @param context - sender context, to match reply w/ request
53     @param is_ip4 - 1 if address type is IPv4
54     @param ip_address - IP address
55     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
56 */
57 define snat_address_details {
58   u32 context;
59   u8 is_ip4;
60   u8 ip_address[16];
61   u32 vrf_id;
62 };
63
64 /** \brief Enable/disable S-NAT feature on the interface
65     @param client_index - opaque cookie to identify the sender
66     @param context - sender context, to match reply w/ request
67     @param is_add - 1 if add, 0 if delete
68     @param is_inside - 1 if inside, 0 if outside
69     @param sw_if_index - software index of the interface
70 */
71 autoreply define snat_interface_add_del_feature {
72   u32 client_index;
73   u32 context;
74   u8 is_add;
75   u8 is_inside;
76   u32 sw_if_index;
77 };
78
79 /** \brief Dump interfaces with S-NAT feature
80     @param client_index - opaque cookie to identify the sender
81     @param context - sender context, to match reply w/ request
82 */
83 define snat_interface_dump {
84   u32 client_index;
85   u32 context;
86 };
87
88 /** \brief S-NAT interface details response
89     @param context - sender context, to match reply w/ request
90     @param is_inside - 1 if inside, 0 if outside
91     @param sw_if_index - software index of the interface
92 */
93 define snat_interface_details {
94   u32 context;
95   u8 is_inside;
96   u32 sw_if_index;
97 };
98
99 /** \brief Enable/disbale S-NAT as an interface output feature (postrouting
100            in2out translation)
101     @param client_index - opaque cookie to identify the sender
102     @param context - sender context, to match reply w/ request
103     @param is_add - 1 if add, 0 if delete
104     @param is_inside - 1 if inside, 0 if outside
105     @param sw_if_index - software index of the interface
106 */
107 autoreply define snat_interface_add_del_output_feature {
108   u32 client_index;
109   u32 context;
110   u8 is_add;
111   u8 is_inside;
112   u32 sw_if_index;
113 };
114
115 /** \brief Dump interfaces with S-NAT output feature
116     @param client_index - opaque cookie to identify the sender
117     @param context - sender context, to match reply w/ request
118 */
119 define snat_interface_output_feature_dump {
120   u32 client_index;
121   u32 context;
122 };
123
124 /** \brief S-NAT interface with output feature details response
125     @param context - sender context, to match reply w/ request
126     @param is_inside - 1 if inside, 0 if outside
127     @param sw_if_index - software index of the interface
128 */
129 define snat_interface_output_feature_details {
130   u32 context;
131   u8 is_inside;
132   u32 sw_if_index;
133 };
134
135 /** \brief Add/delete S-NAT static mapping
136     @param client_index - opaque cookie to identify the sender
137     @param context - sender context, to match reply w/ request
138     @param is_add - 1 if add, 0 if delete
139     @param is_ip4 - 1 if address type is IPv4
140     @param addr_only - 1 if address only mapping
141     @param local_ip_address - local IP address
142     @param external_ip_address - external IP address
143     @param protocol - IP protocol
144     @param local_port - local port number
145     @param external_port - external port number
146     @param external_sw_if_index - external interface (if set
147                                   external_ip_address is ignored, ~0 means not
148                                   used)
149     @param vfr_id - VRF ID
150 */
151 autoreply define snat_add_static_mapping {
152   u32 client_index;
153   u32 context;
154   u8 is_add;
155   u8 is_ip4;
156   u8 addr_only;
157   u8 local_ip_address[16];
158   u8 external_ip_address[16];
159   u8 protocol;
160   u16 local_port;
161   u16 external_port;
162   u32 external_sw_if_index;
163   u32 vrf_id;
164 };
165
166 /** \brief Dump S-NAT static mappings
167     @param client_index - opaque cookie to identify the sender
168     @param context - sender context, to match reply w/ request
169 */
170 define snat_static_mapping_dump {
171   u32 client_index;
172   u32 context;
173 };
174
175 /** \brief S-NAT static mapping details response
176     @param context - sender context, to match reply w/ request
177     @param is_ip4 - 1 if address type is IPv4
178     @param addr_only - 1 if address only mapping
179     @param local_ip_address - local IP address
180     @param external_ip_address - external IP address
181     @param protocol - IP protocol
182     @param local_port - local port number
183     @param external_port - external port number
184     @param external_sw_if_index - external interface
185     @param vfr_id - VRF ID
186 */
187 define snat_static_mapping_details {
188   u32 context;
189   u8 is_ip4;
190   u8 addr_only;
191   u8 local_ip_address[16];
192   u8 external_ip_address[16];
193   u8 protocol;
194   u16 local_port;
195   u16 external_port;
196   u32 external_sw_if_index;
197   u32 vrf_id;
198 };
199
200 /** \brief Control ping from client to api server request
201     @param client_index - opaque cookie to identify the sender
202     @param context - sender context, to match reply w/ request
203 */
204 define snat_control_ping
205 {
206   u32 client_index;
207   u32 context;
208 };
209
210 /** \brief Control ping from the client to the server response
211     @param client_index - opaque cookie to identify the sender
212     @param context - sender context, to match reply w/ request
213     @param retval - return code for the request
214     @param vpe_pid - the pid of the vpe, returned by the server
215 */
216 define snat_control_ping_reply
217 {
218   u32 context;
219   i32 retval;
220   u32 client_index;
221   u32 vpe_pid;
222 };
223
224 /** \brief Show S-NAT plugin startup config
225     @param client_index - opaque cookie to identify the sender
226     @param context - sender context, to match reply w/ request
227 */
228 define snat_show_config
229 {
230   u32 client_index;
231   u32 context;
232 };
233
234 /** \brief Show S-NAT plugin startup config reply
235     @param context - sender context, to match reply w/ request
236     @param retval - return code for the request
237     @param static_mapping_only - if 1 dynamic translations disabled
238     @param static_mapping_connection_tracking - if 1 create session data
239     @param deterministic - if 1 deterministic mapping
240     @param translation_buckets - number of translation hash buckets
241     @param translation_memory_size - translation hash memory size
242     @param user_buckets - number of user hash buckets
243     @param user_memory_size - user hash memory size
244     @param max_translations_per_user - maximum number of translations per user
245     @param outside_vrf_id - outside VRF id
246     @param inside_vrf_id - default inside VRF id
247 */
248 define snat_show_config_reply
249 {
250   u32 context;
251   i32 retval;
252   u8 static_mapping_only;
253   u8 static_mapping_connection_tracking;
254   u8 deterministic;
255   u32 translation_buckets;
256   u32 translation_memory_size;
257   u32 user_buckets;
258   u32 user_memory_size;
259   u32 max_translations_per_user;
260   u32 outside_vrf_id;
261   u32 inside_vrf_id;
262 };
263
264 /** \brief Set S-NAT workers
265     @param client_index - opaque cookie to identify the sender
266     @param context - sender context, to match reply w/ request
267     @param worker_mask - S-NAT workers mask
268 */
269 autoreply define snat_set_workers {
270   u32 client_index;
271   u32 context;
272   u64 worker_mask;
273 };
274
275 /** \brief Dump S-NAT workers
276     @param client_index - opaque cookie to identify the sender
277     @param context - sender context, to match reply w/ request
278 */
279 define snat_worker_dump {
280   u32 client_index;
281   u32 context;
282 };
283
284 /** \brief S-NAT workers details response
285     @param context - sender context, to match reply w/ request
286     @param worker_index - worker index
287     @param lcore_id - lcore ID
288     @param name - worker name
289 */
290 define snat_worker_details {
291   u32 context;
292   u32 worker_index;
293   u32 lcore_id;
294   u8 name[64];
295 };
296
297 /** \brief Add/delete S-NAT pool address from specific interfce
298     @param client_index - opaque cookie to identify the sender
299     @param context - sender context, to match reply w/ request
300     @param is_add - 1 if add, 0 if delete
301     @param sw_if_index - software index of the interface
302 */
303 autoreply define snat_add_del_interface_addr {
304   u32 client_index;
305   u32 context;
306   u8 is_add;
307   u8 is_inside;
308   u32 sw_if_index;
309 };
310
311 /** \brief Dump S-NAT pool addresses interfaces
312     @param client_index - opaque cookie to identify the sender
313     @param context - sender context, to match reply w/ request
314 */
315 define snat_interface_addr_dump {
316   u32 client_index;
317   u32 context;
318 };
319
320 /** \brief S-NAT pool addresses interfaces details response
321     @param context - sender context, to match reply w/ request
322     @param sw_if_index - software index of the interface
323 */
324 define snat_interface_addr_details {
325   u32 context;
326   u32 sw_if_index;
327 };
328
329 /** \brief Enable/disable S-NAT IPFIX logging
330     @param client_index - opaque cookie to identify the sender
331     @param context - sender context, to match reply w/ request
332     @param domain_id - observation domain ID
333     @param src_port - source port number
334     @param enable - 1 if enable, 0 if disable
335 */
336 autoreply define snat_ipfix_enable_disable {
337   u32 client_index;
338   u32 context;
339   u32 domain_id;
340   u16 src_port;
341   u8 enable;
342 };
343
344 /** \brief Dump S-NAT users
345     @param client_index - opaque cookie to identify the sender
346     @param context - sender context, to match reply w/ request
347 */
348 define snat_user_dump {
349   u32 client_index;
350   u32 context;
351 };
352
353 /** \brief S-NAT users response
354     @param context - sender context, to match reply w/ request
355     @vrf_id - VRF ID
356     @param is_ip4 - 1 if address type is IPv4
357     @param ip_adress - IP address
358     @param nsessions - number of dynamic sessions
359     @param nstaticsessions - number of static sessions
360 */
361 define snat_user_details {
362   u32 context;
363   u32 vrf_id;
364   u8 is_ip4;
365   u8 ip_address[16];
366   u32 nsessions;
367   u32 nstaticsessions;
368 };
369
370 /** \brief S-NAT user's sessions
371     @param client_index - opaque cookie to identify the sender
372     @param context - sender context, to match reply w/ request
373     @param is_ip4 - 1 if address type is IPv4
374     @param user_ip - IP address of the user to dump
375     @param vrf_id - VRF_ID
376 */
377 define snat_user_session_dump {
378   u32 client_index;
379   u32 context;
380   u8 is_ip4;
381   u8 ip_address[16];
382   u32 vrf_id;
383 };
384
385 /** \brief S-NAT user's sessions response
386     @param context - sender context, to match reply w/ request
387     @param is_ip4 - 1 if address type is IPv4
388     @param outside_ip_address - outside IP address
389     @param outside_port - outside port
390     @param inside_ip_address - inside IP address
391     @param inside_port - inside port
392     @param protocol - protocol
393     @param is_static - 1 if session is static
394     @param last_heard - last heard timer
395     @param total_bytes - count of bytes sent through session
396     @param total_pkts - count of pakets sent through session
397 */
398 define snat_user_session_details {
399   u32 context;
400   u8 is_ip4;
401   u8 outside_ip_address[16];
402   u16 outside_port;
403   u8 inside_ip_address[16];
404   u16 inside_port;
405   u16 protocol;
406   u8 is_static;
407   u64 last_heard;
408   u64 total_bytes;
409   u32 total_pkts;
410 };
411
412 /** \brief Add/delete S-NAT deterministic mapping
413     @param client_index - opaque cookie to identify the sender
414     @param context - sender context, to match reply w/ request
415     @param is_add - 1 if add, 0 if delete
416     @param is_ip4 - 1 if address type is IPv4
417     @param in_addr - inside IP address
418     @param in_plen - inside IP address prefix length
419     @param out_addr - outside IP address
420     @param out_addr - outside IP address prefix length
421 */
422 autoreply define snat_add_det_map {
423   u32 client_index;
424   u32 context;
425   u8 is_add;
426   u8 is_ip4;
427   u8 addr_only;
428   u8 in_addr[16];
429   u8 in_plen;
430   u8 out_addr[16];
431   u8 out_plen;
432 };
433
434 /** \brief Get outside address and port range from inside address
435     @param client_index - opaque cookie to identify the sender
436     @param context - sender context, to match reply w/ request
437     @param is_ip4 - 1 if address type is IPv4
438     @param in_addr - inside IP address
439 */
440 define snat_det_forward {
441   u32 client_index;
442   u32 context;
443   u8 is_ip4;
444   u8 in_addr[16];
445 };
446
447 /** \brief Get outside address and port range from inside address
448     @param context - sender context, to match reply w/ request
449     @param retval - return code
450     @param out_port_lo - outside port range start
451     @param out_port_hi - outside port range end
452     @param is_ip4 - 1 if address type is IPv4
453     @param out_addr - outside IP address
454 */
455 define snat_det_forward_reply {
456   u32 context;
457   i32 retval;
458   u16 out_port_lo;
459   u16 out_port_hi;
460   u8 is_ip4;
461   u8 out_addr[16];
462 };
463
464 /** \brief Get inside address from outside address and port
465     @param client_index - opaque cookie to identify the sender
466     @param context - sender context, to match reply w/ request
467     @param out_port - outside port
468     @param is_ip4 - 1 if address type is IPv4
469     @param out_addr - outside IP address
470 */
471 define snat_det_reverse {
472   u32 client_index;
473   u32 context;
474   u16 out_port;
475   u8 is_ip4;
476   u8 out_addr[16];
477 };
478
479 /** \brief Get inside address from outside address and port reply
480     @param context - sender context, to match reply w/ request
481     @param retval - return code
482     @param is_ip4 - 1 if address type is IPv4
483     @param in_addr - inside IP address
484 */
485 define snat_det_reverse_reply {
486   u32 context;
487   i32 retval;
488   u8 is_ip4;
489   u8 in_addr[16];
490 };
491
492 /** \brief Dump S-NAT deterministic mappings
493     @param client_index - opaque cookie to identify the sender
494     @param context - sender context, to match reply w/ request
495 */
496 define snat_det_map_dump {
497   u32 client_index;
498   u32 context;
499 };
500
501 /** \brief S-NAT users response
502     @param context - sender context, to match reply w/ request
503     @param is_ip4 - 1 if address type is IPv4
504     @param in_addr - inside IP address
505     @param in_plen - inside IP address prefix length
506     @param out_addr - outside IP address
507     @param out_plen - outside IP address prefix length
508     @param sharing_ratio - outside to inside address sharing ratio
509     @param ports_per_host - number of ports available to a host
510     @param ses_num - number of sessions belonging to this mapping
511 */
512 define snat_det_map_details {
513   u32 context;
514   u8 is_ip4;
515   u8 in_addr[16];
516   u8 in_plen;
517   u8 out_addr[16];
518   u8 out_plen;
519   u32 sharing_ratio;
520   u16 ports_per_host;
521   u32 ses_num;
522 };
523
524 /** \brief Set values of timeouts for deterministic NAT (seconds, 0 = default)
525     @param client_index - opaque cookie to identify the sender
526     @param context - sender context, to match reply w/ request
527     @param udp - UDP timeout (default 300sec)
528     @param tcp_established - TCP established timeout (default 7440sec)
529     @param tcp_transitory - TCP transitory timeout (default 240sec)
530     @param icmp - ICMP timeout (default 60sec)
531 */
532 autoreply define snat_det_set_timeouts {
533   u32 client_index;
534   u32 context;
535   u32 udp;
536   u32 tcp_established;
537   u32 tcp_transitory;
538   u32 icmp;
539 };
540
541 /** \brief Get values of timeouts for deterministic NAT (seconds)
542     @param client_index - opaque cookie to identify the sender
543     @param context - sender context, to match reply w/ request
544 */
545 define snat_det_get_timeouts {
546   u32 client_index;
547   u32 context;
548 };
549
550 /** \brief Get values of timeouts for deterministic NAT reply
551     @param context - sender context, to match reply w/ request
552     @param retval - return code
553     @param udp - UDP timeout (default 300sec)
554     @param tcp_established - TCP established timeout (default 7440sec)
555     @param tcp_transitory - TCP transitory timeout (default 240sec)
556     @param icmp - ICMP timeout (default 60sec)
557 */
558 define snat_det_get_timeouts_reply {
559   u32 context;
560   i32 retval;
561   u32 udp;
562   u32 tcp_established;
563   u32 tcp_transitory;
564   u32 icmp;
565 };
566
567 /** \brief Close CGNAT session by outside address and port
568     @param client_index - opaque cookie to identify the sender
569     @param context - sender context, to match reply w/ request
570     @param is_ip4 - 1 if address type is IPv4
571     @param out_addr - outside IP address
572     @param out_port - outside port
573     @param ext_addr - external host address
574     @param ext_port - external host port
575 */
576 autoreply define snat_det_close_session_out {
577   u32 client_index;
578   u32 context;
579   u8 is_ip4;
580   u8 out_addr[16];
581   u16 out_port;
582   u8 ext_addr[16];
583   u16 ext_port;
584 };
585
586 /** \brief Close CGNAT session by inside address and port
587     @param client_index - opaque cookie to identify the sender
588     @param context - sender context, to match reply w/ request
589     @param is_ip4 - 1 if address type is IPv4
590     @param in_addr - inside IP address
591     @param in_port - inside port
592     @param ext_addr - external host address
593     @param ext_port - external host port
594 */
595 autoreply define snat_det_close_session_in {
596   u32 client_index;
597   u32 context;
598   u8 is_ip4;
599   u8 in_addr[16];
600   u16 in_port;
601   u8 ext_addr[16];
602   u16 ext_port;
603 };
604
605 /** \brief Dump S-NAT deterministic sessions
606     @param client_index - opaque cookie to identify the sender
607     @param context - sender context, to match reply w/ request
608     @param is_ip4 - 1 if address type is IPv4
609     @param user_addr - address of an inside user whose sessions to dump
610 */
611 define snat_det_session_dump {
612   u32 client_index;
613   u32 context;
614   u8 is_ip4;
615   u8 user_addr[16];
616 };
617
618 /** \brief S-NAT deterministic sessions reply
619     @param context - sender context, to match reply w/ request
620     @param is_ip4 - 1 if address type is IPv4
621     @param in_port - inside port
622     @param ext_addr - external host address
623     @param ext_port - external host port
624     @param out_port - outside NAT port
625     @param state - session state
626     @param expire - session expiration timestamp
627 */
628 define snat_det_session_details {
629   u32 client_index;
630   u32 context;
631   u8 is_ip4;
632   u16 in_port;
633   u8 ext_addr[16];
634   u16 ext_port;
635   u16 out_port;
636   u8 state;
637   u32 expire;
638 };
639
640 /** \brief Add/delete address range to NAT64 pool
641     @param client_index - opaque cookie to identify the sender
642     @param context - sender context, to match reply w/ request
643     @param start_addr - start address of the range
644     @param end_addr - end address of the range
645     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
646     @param is_add - 1 if add, 0 if delete
647 */
648 autoreply define nat64_add_del_pool_addr_range {
649   u32 client_index;
650   u32 context;
651   u8 start_addr[4];
652   u8 end_addr[4];
653   u32 vrf_id;
654   u8 is_add;
655 };
656
657 /** \brief Dump NAT64 pool addresses
658     @param client_index - opaque cookie to identify the sender
659     @param context - sender context, to match reply w/ request
660 */
661 define nat64_pool_addr_dump {
662   u32 client_index;
663   u32 context;
664 };
665
666 /** \brief NAT64 pool address details response
667     @param context - sender context, to match reply w/ request
668     @param address - IPv4 address
669     @param vfr_id - VRF id of tenant, ~0 means independent of VRF
670 */
671 define nat64_pool_addr_details {
672   u32 context;
673   u8 address[4];
674   u32 vrf_id;
675 };
676
677 /** \brief Enable/disable NAT64 feature on the interface
678     @param client_index - opaque cookie to identify the sender
679     @param context - sender context, to match reply w/ request
680     @param sw_if_index - index of the interface
681     @param is_inside - 1 if inside, 0 if outside
682     @param is_add - 1 if add, 0 if delete
683 */
684 autoreply define nat64_add_del_interface {
685   u32 client_index;
686   u32 context;
687   u32 sw_if_index;
688   u8 is_inside;
689   u8 is_add;
690 };
691
692 /** \brief Dump interfaces with NAT64 feature
693     @param client_index - opaque cookie to identify the sender
694     @param context - sender context, to match reply w/ request
695 */
696 define nat64_interface_dump {
697   u32 client_index;
698   u32 context;
699 };
700
701 /** \brief NAT64 interface details response
702     @param context - sender context, to match reply w/ request
703     @param is_inside - 1 if inside, 0 if outside
704     @param sw_if_index - index of the interface
705 */
706 define nat64_interface_details {
707   u32 context;
708   u8 is_inside;
709   u32 sw_if_index;
710 };
711
712 /** \brief Add/delete NAT64 static BIB entry
713     @param client_index - opaque cookie to identify the sender
714     @param context - sender context, to match reply w/ request
715     @param i_addr - inside IPv6 address
716     @param o_addr - outside IPv4 address
717     @param i_port - inside port number
718     @param o_port - outside port number
719     @param vrf_id - VRF id of tenant
720     @param proto - protocol number
721     @param is_add - 1 if add, 0 if delete
722 */
723  autoreply define nat64_add_del_static_bib {
724   u32 client_index;
725   u32 context;
726   u8 i_addr[16];
727   u8 o_addr[4];
728   u16 i_port;
729   u16 o_port;
730   u32 vrf_id;
731   u8 proto;
732   u8 is_add;
733 };
734
735 /** \brief Dump NAT64 BIB
736     @param client_index - opaque cookie to identify the sender
737     @param context - sender context, to match reply w/ request
738     @param proto - protocol of the BIB: 255 - all BIBs
739                                         6 - TCP BIB
740                                         17 - UDP BIB
741                                         1/58 - ICMP BIB
742                                         otherwise - "unknown" protocol BIB
743 */
744 define nat64_bib_dump {
745   u32 client_index;
746   u32 context;
747   u8 proto;
748 };
749
750 /** \brief NAT64 BIB details response
751     @param context - sender context, to match reply w/ request
752     @param i_addr - inside IPv6 address
753     @param o_addr - outside IPv4 address
754     @param i_port - inside port number
755     @param o_port - outside port number
756     @param vrf_id - VRF id of tenant
757     @param proto - protocol number
758     @param is_static - 1 if static BIB entry, 0 if dynamic
759     @param ses_num - number of sessions associated with the BIB entry
760 */
761 define nat64_bib_details {
762   u32 context;
763   u8 i_addr[16];
764   u8 o_addr[4];
765   u16 i_port;
766   u16 o_port;
767   u32 vrf_id;
768   u8 proto;
769   u8 is_static;
770   u32 ses_num;
771 };
772
773 /** \brief Set values of timeouts for NAT64 (seconds, 0 = default)
774     @param client_index - opaque cookie to identify the sender
775     @param context - sender context, to match reply w/ request
776     @param udp - UDP timeout (default 300sec)
777     @param icmp - ICMP timeout (default 60sec)
778     @param tcp_trans - TCP transitory timeout (default 240sec)
779     @param tcp_est - TCP established timeout (default 7440sec)
780     @param tcp_incoming_syn - TCP incoming SYN timeout (default 6sec)
781 */
782 autoreply define nat64_set_timeouts {
783   u32 client_index;
784   u32 context;
785   u32 udp;
786   u32 icmp;
787   u32 tcp_trans;
788   u32 tcp_est;
789   u32 tcp_incoming_syn;
790 };
791
792 /** \brief Get values of timeouts for NAT64 (seconds)
793     @param client_index - opaque cookie to identify the sender
794     @param context - sender context, to match reply w/ request
795 */
796 define nat64_get_timeouts {
797   u32 client_index;
798   u32 context;
799 };
800
801 /** \brief Get values of timeouts for NAT64 reply
802     @param context - sender context, to match reply w/ request
803     @param retval - return code
804     @param udp - UDP timeout
805     @param icmp - ICMP timeout
806     @param tcp_trans - TCP transitory timeout
807     @param tcp_est - TCP established timeout
808     @param tcp_incoming_syn - TCP incoming SYN timeout
809 */
810 define nat64_get_timeouts_reply {
811   u32 context;
812   i32 retval;
813   u32 udp;
814   u32 icmp;
815   u32 tcp_trans;
816   u32 tcp_est;
817   u32 tcp_incoming_syn;
818 };
819
820 /** \brief Dump NAT64 session table
821     @param client_index - opaque cookie to identify the sender
822     @param context - sender context, to match reply w/ request
823     @param proto - protocol of the session table: 255 - all STs
824                                                   6 - TCP ST
825                                                   17 - UDP ST
826                                                   1/58 - ICMP ST
827                                                   otherwise - "unknown" proto ST
828 */
829 define nat64_st_dump {
830   u32 client_index;
831   u32 context;
832   u8 proto;
833 };
834
835 /** \brief NAT64 session table details response
836     @param context - sender context, to match reply w/ request
837     @param il_addr - inside IPv6 address of the local host
838     @param ol_addr - outside IPv4 address of the local host
839     @param il_port - inside port number id of the local host/inside ICMP id
840     @param ol_port - outside port number of the local host/outside ICMP id
841     @param il_addr - inside IPv6 address of the remote host
842     @param ol_addr - outside IPv4 address of the remote host
843     @param l_port - port number of the remote host (not used for ICMP)
844     @param vrf_id - VRF id of tenant
845     @param proto - protocol number
846 */
847 define nat64_st_details {
848   u32 context;
849   u8 il_addr[16];
850   u8 ol_addr[4];
851   u16 il_port;
852   u16 ol_port;
853   u8 ir_addr[16];
854   u8 or_addr[4];
855   u16 r_port;
856   u32 vrf_id;
857   u8 proto;
858 };
859
860 /** \brief Add/del NAT64 prefix
861     @param client_index - opaque cookie to identify the sender
862     @param context - sender context, to match reply w/ request
863     @param prefix - NAT64 prefix
864     @param prefix - NAT64 prefix length
865     @param vrf_id - VRF id of tenant
866     @param is_add - 1 if add, 0 if delete
867 */
868 autoreply define nat64_add_del_prefix {
869   u32 client_index;
870   u32 context;
871   u8 prefix[16];
872   u8 prefix_len;
873   u32 vrf_id;
874   u8 is_add;
875 };
876
877 /** \brief Dump NAT64 prefix
878     @param client_index - opaque cookie to identify the sender
879     @param context - sender context, to match reply w/ request
880 */
881 define nat64_prefix_dump {
882   u32 client_index;
883   u32 context;
884 };
885
886 /** \brief Dump NAT64 prefix details response
887     @param context - sender context, to match reply w/ request
888     @param prefix - NAT64 prefix
889     @param prefix - NAT64 prefix length
890     @param vrf_id - VRF id of tenant
891 */
892 define nat64_prefix_details {
893   u32 context;
894   u8 prefix[16];
895   u8 prefix_len;
896   u32 vrf_id;
897 };