NAT: Destination NAT44 with load-balancing (VPP-954)
[vpp.git] / src / plugins / nat / nat.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 nat.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 /*
24  * Old "snat" APIs, will be deprecated after 17.10
25  */
26
27 /** \brief Add/del NAT44 address range
28     @param client_index - opaque cookie to identify the sender
29     @param context - sender context, to match reply w/ request
30     @param is_ip4 - 1 if address type is IPv4
31     @param first_ip_address - first IP address
32     @param last_ip_address - last IP address
33     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
34     @param is_add - 1 if add, 0 if delete
35 */
36 autoreply define snat_add_address_range {
37   u32 client_index;
38   u32 context;
39   u8 is_ip4;
40   u8 first_ip_address[16];
41   u8 last_ip_address[16];
42   u32 vrf_id;
43   u8 is_add;
44 };
45
46 /** \brief Dump NAT44 addresses
47     @param client_index - opaque cookie to identify the sender
48     @param context - sender context, to match reply w/ request
49 */
50 define snat_address_dump {
51   u32 client_index;
52   u32 context;
53 };
54
55 /** \brief NAT44 address details response
56     @param context - sender context, to match reply w/ request
57     @param is_ip4 - 1 if address type is IPv4
58     @param ip_address - IP address
59     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
60 */
61 define snat_address_details {
62   u32 context;
63   u8 is_ip4;
64   u8 ip_address[16];
65   u32 vrf_id;
66 };
67
68 /** \brief Enable/disable NAT44 feature on the interface
69     @param client_index - opaque cookie to identify the sender
70     @param context - sender context, to match reply w/ request
71     @param is_add - 1 if add, 0 if delete
72     @param is_inside - 1 if inside, 0 if outside
73     @param sw_if_index - software index of the interface
74 */
75 autoreply define snat_interface_add_del_feature {
76   u32 client_index;
77   u32 context;
78   u8 is_add;
79   u8 is_inside;
80   u32 sw_if_index;
81 };
82
83 /** \brief Dump interfaces with NAT44 feature
84     @param client_index - opaque cookie to identify the sender
85     @param context - sender context, to match reply w/ request
86 */
87 define snat_interface_dump {
88   u32 client_index;
89   u32 context;
90 };
91
92 /** \brief NAT44 interface details response
93     @param context - sender context, to match reply w/ request
94     @param is_inside - 1 if inside, 0 if outside
95     @param sw_if_index - software index of the interface
96 */
97 define snat_interface_details {
98   u32 context;
99   u8 is_inside;
100   u32 sw_if_index;
101 };
102
103 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
104            in2out translation)
105     @param client_index - opaque cookie to identify the sender
106     @param context - sender context, to match reply w/ request
107     @param is_add - 1 if add, 0 if delete
108     @param is_inside - 1 if inside, 0 if outside
109     @param sw_if_index - software index of the interface
110 */
111 autoreply define snat_interface_add_del_output_feature {
112   u32 client_index;
113   u32 context;
114   u8 is_add;
115   u8 is_inside;
116   u32 sw_if_index;
117 };
118
119 /** \brief Dump interfaces with NAT44 output feature
120     @param client_index - opaque cookie to identify the sender
121     @param context - sender context, to match reply w/ request
122 */
123 define snat_interface_output_feature_dump {
124   u32 client_index;
125   u32 context;
126 };
127
128 /** \brief NAT44 interface with output feature details response
129     @param context - sender context, to match reply w/ request
130     @param is_inside - 1 if inside, 0 if outside
131     @param sw_if_index - software index of the interface
132 */
133 define snat_interface_output_feature_details {
134   u32 context;
135   u8 is_inside;
136   u32 sw_if_index;
137 };
138
139 /** \brief Add/delete NAT44 static mapping
140     @param client_index - opaque cookie to identify the sender
141     @param context - sender context, to match reply w/ request
142     @param is_add - 1 if add, 0 if delete
143     @param is_ip4 - 1 if address type is IPv4
144     @param addr_only - 1 if address only mapping
145     @param local_ip_address - local IP address
146     @param external_ip_address - external IP address
147     @param protocol - IP protocol
148     @param local_port - local port number
149     @param external_port - external port number
150     @param external_sw_if_index - external interface (if set
151                                   external_ip_address is ignored, ~0 means not
152                                   used)
153     @param vfr_id - VRF ID
154 */
155 autoreply define snat_add_static_mapping {
156   u32 client_index;
157   u32 context;
158   u8 is_add;
159   u8 is_ip4;
160   u8 addr_only;
161   u8 local_ip_address[16];
162   u8 external_ip_address[16];
163   u8 protocol;
164   u16 local_port;
165   u16 external_port;
166   u32 external_sw_if_index;
167   u32 vrf_id;
168 };
169
170 /** \brief Dump NAT44 static mappings
171     @param client_index - opaque cookie to identify the sender
172     @param context - sender context, to match reply w/ request
173 */
174 define snat_static_mapping_dump {
175   u32 client_index;
176   u32 context;
177 };
178
179 /** \brief NAT44 static mapping details response
180     @param context - sender context, to match reply w/ request
181     @param is_ip4 - 1 if address type is IPv4
182     @param addr_only - 1 if address only mapping
183     @param local_ip_address - local IP address
184     @param external_ip_address - external IP address
185     @param protocol - IP protocol
186     @param local_port - local port number
187     @param external_port - external port number
188     @param external_sw_if_index - external interface
189     @param vfr_id - VRF ID
190 */
191 define snat_static_mapping_details {
192   u32 context;
193   u8 is_ip4;
194   u8 addr_only;
195   u8 local_ip_address[16];
196   u8 external_ip_address[16];
197   u8 protocol;
198   u16 local_port;
199   u16 external_port;
200   u32 external_sw_if_index;
201   u32 vrf_id;
202 };
203
204 /** \brief Control ping from client to api server request
205     @param client_index - opaque cookie to identify the sender
206     @param context - sender context, to match reply w/ request
207 */
208 define snat_control_ping
209 {
210   u32 client_index;
211   u32 context;
212 };
213
214 /** \brief Control ping from the client to the server response
215     @param client_index - opaque cookie to identify the sender
216     @param context - sender context, to match reply w/ request
217     @param retval - return code for the request
218     @param vpe_pid - the pid of the vpe, returned by the server
219 */
220 define snat_control_ping_reply
221 {
222   u32 context;
223   i32 retval;
224   u32 client_index;
225   u32 vpe_pid;
226 };
227
228 /** \brief Show NAT plugin startup config
229     @param client_index - opaque cookie to identify the sender
230     @param context - sender context, to match reply w/ request
231 */
232 define snat_show_config
233 {
234   u32 client_index;
235   u32 context;
236 };
237
238 /** \brief Show NAT plugin startup config reply
239     @param context - sender context, to match reply w/ request
240     @param retval - return code for the request
241     @param static_mapping_only - if 1 dynamic translations disabled
242     @param static_mapping_connection_tracking - if 1 create session data
243     @param deterministic - if 1 deterministic mapping
244     @param translation_buckets - number of translation hash buckets
245     @param translation_memory_size - translation hash memory size
246     @param user_buckets - number of user hash buckets
247     @param user_memory_size - user hash memory size
248     @param max_translations_per_user - maximum number of translations per user
249     @param outside_vrf_id - outside VRF id
250     @param inside_vrf_id - default inside VRF id
251 */
252 define snat_show_config_reply
253 {
254   u32 context;
255   i32 retval;
256   u8 static_mapping_only;
257   u8 static_mapping_connection_tracking;
258   u8 deterministic;
259   u32 translation_buckets;
260   u32 translation_memory_size;
261   u32 user_buckets;
262   u32 user_memory_size;
263   u32 max_translations_per_user;
264   u32 outside_vrf_id;
265   u32 inside_vrf_id;
266 };
267
268 /** \brief Set NAT workers
269     @param client_index - opaque cookie to identify the sender
270     @param context - sender context, to match reply w/ request
271     @param worker_mask - NAT workers mask
272 */
273 autoreply define snat_set_workers {
274   u32 client_index;
275   u32 context;
276   u64 worker_mask;
277 };
278
279 /** \brief Dump NAT workers
280     @param client_index - opaque cookie to identify the sender
281     @param context - sender context, to match reply w/ request
282 */
283 define snat_worker_dump {
284   u32 client_index;
285   u32 context;
286 };
287
288 /** \brief NAT workers details response
289     @param context - sender context, to match reply w/ request
290     @param worker_index - worker index
291     @param lcore_id - lcore ID
292     @param name - worker name
293 */
294 define snat_worker_details {
295   u32 context;
296   u32 worker_index;
297   u32 lcore_id;
298   u8 name[64];
299 };
300
301 /** \brief Add/delete NAT44 pool address from specific interfce
302     @param client_index - opaque cookie to identify the sender
303     @param context - sender context, to match reply w/ request
304     @param is_add - 1 if add, 0 if delete
305     @param sw_if_index - software index of the interface
306 */
307 autoreply define snat_add_del_interface_addr {
308   u32 client_index;
309   u32 context;
310   u8 is_add;
311   u8 is_inside;
312   u32 sw_if_index;
313 };
314
315 /** \brief Dump NAT44 pool addresses interfaces
316     @param client_index - opaque cookie to identify the sender
317     @param context - sender context, to match reply w/ request
318 */
319 define snat_interface_addr_dump {
320   u32 client_index;
321   u32 context;
322 };
323
324 /** \brief NAT44 pool addresses interfaces details response
325     @param context - sender context, to match reply w/ request
326     @param sw_if_index - software index of the interface
327 */
328 define snat_interface_addr_details {
329   u32 context;
330   u32 sw_if_index;
331 };
332
333 /** \brief Enable/disable NAT IPFIX logging
334     @param client_index - opaque cookie to identify the sender
335     @param context - sender context, to match reply w/ request
336     @param domain_id - observation domain ID
337     @param src_port - source port number
338     @param enable - 1 if enable, 0 if disable
339 */
340 autoreply define snat_ipfix_enable_disable {
341   u32 client_index;
342   u32 context;
343   u32 domain_id;
344   u16 src_port;
345   u8 enable;
346 };
347
348 /** \brief Dump NAT44 users
349     @param client_index - opaque cookie to identify the sender
350     @param context - sender context, to match reply w/ request
351 */
352 define snat_user_dump {
353   u32 client_index;
354   u32 context;
355 };
356
357 /** \brief NAT44 users response
358     @param context - sender context, to match reply w/ request
359     @vrf_id - VRF ID
360     @param is_ip4 - 1 if address type is IPv4
361     @param ip_adress - IP address
362     @param nsessions - number of dynamic sessions
363     @param nstaticsessions - number of static sessions
364 */
365 define snat_user_details {
366   u32 context;
367   u32 vrf_id;
368   u8 is_ip4;
369   u8 ip_address[16];
370   u32 nsessions;
371   u32 nstaticsessions;
372 };
373
374 /** \brief NAT44 user's sessions
375     @param client_index - opaque cookie to identify the sender
376     @param context - sender context, to match reply w/ request
377     @param is_ip4 - 1 if address type is IPv4
378     @param user_ip - IP address of the user to dump
379     @param vrf_id - VRF_ID
380 */
381 define snat_user_session_dump {
382   u32 client_index;
383   u32 context;
384   u8 is_ip4;
385   u8 ip_address[16];
386   u32 vrf_id;
387 };
388
389 /** \brief NAT44 user's sessions response
390     @param context - sender context, to match reply w/ request
391     @param is_ip4 - 1 if address type is IPv4
392     @param outside_ip_address - outside IP address
393     @param outside_port - outside port
394     @param inside_ip_address - inside IP address
395     @param inside_port - inside port
396     @param protocol - protocol
397     @param is_static - 1 if session is static
398     @param last_heard - last heard timer
399     @param total_bytes - count of bytes sent through session
400     @param total_pkts - count of pakets sent through session
401 */
402 define snat_user_session_details {
403   u32 context;
404   u8 is_ip4;
405   u8 outside_ip_address[16];
406   u16 outside_port;
407   u8 inside_ip_address[16];
408   u16 inside_port;
409   u16 protocol;
410   u8 is_static;
411   u64 last_heard;
412   u64 total_bytes;
413   u32 total_pkts;
414 };
415
416 /** \brief Add/delete NAT deterministic mapping
417     @param client_index - opaque cookie to identify the sender
418     @param context - sender context, to match reply w/ request
419     @param is_add - 1 if add, 0 if delete
420     @param is_ip4 - 1 if address type is IPv4
421     @param in_addr - inside IP address
422     @param in_plen - inside IP address prefix length
423     @param out_addr - outside IP address
424     @param out_addr - outside IP address prefix length
425 */
426 autoreply define snat_add_det_map {
427   u32 client_index;
428   u32 context;
429   u8 is_add;
430   u8 is_ip4;
431   u8 addr_only;
432   u8 in_addr[16];
433   u8 in_plen;
434   u8 out_addr[16];
435   u8 out_plen;
436 };
437
438 /** \brief Get outside address and port range from inside address
439     @param client_index - opaque cookie to identify the sender
440     @param context - sender context, to match reply w/ request
441     @param is_ip4 - 1 if address type is IPv4
442     @param in_addr - inside IP address
443 */
444 define snat_det_forward {
445   u32 client_index;
446   u32 context;
447   u8 is_ip4;
448   u8 in_addr[16];
449 };
450
451 /** \brief Get outside address and port range from inside address
452     @param context - sender context, to match reply w/ request
453     @param retval - return code
454     @param out_port_lo - outside port range start
455     @param out_port_hi - outside port range end
456     @param is_ip4 - 1 if address type is IPv4
457     @param out_addr - outside IP address
458 */
459 define snat_det_forward_reply {
460   u32 context;
461   i32 retval;
462   u16 out_port_lo;
463   u16 out_port_hi;
464   u8 is_ip4;
465   u8 out_addr[16];
466 };
467
468 /** \brief Get inside address from outside address and port
469     @param client_index - opaque cookie to identify the sender
470     @param context - sender context, to match reply w/ request
471     @param out_port - outside port
472     @param is_ip4 - 1 if address type is IPv4
473     @param out_addr - outside IP address
474 */
475 define snat_det_reverse {
476   u32 client_index;
477   u32 context;
478   u16 out_port;
479   u8 is_ip4;
480   u8 out_addr[16];
481 };
482
483 /** \brief Get inside address from outside address and port reply
484     @param context - sender context, to match reply w/ request
485     @param retval - return code
486     @param is_ip4 - 1 if address type is IPv4
487     @param in_addr - inside IP address
488 */
489 define snat_det_reverse_reply {
490   u32 context;
491   i32 retval;
492   u8 is_ip4;
493   u8 in_addr[16];
494 };
495
496 /** \brief Dump NAT deterministic mappings
497     @param client_index - opaque cookie to identify the sender
498     @param context - sender context, to match reply w/ request
499 */
500 define snat_det_map_dump {
501   u32 client_index;
502   u32 context;
503 };
504
505 /** \brief NAT users response
506     @param context - sender context, to match reply w/ request
507     @param is_ip4 - 1 if address type is IPv4
508     @param in_addr - inside IP address
509     @param in_plen - inside IP address prefix length
510     @param out_addr - outside IP address
511     @param out_plen - outside IP address prefix length
512     @param sharing_ratio - outside to inside address sharing ratio
513     @param ports_per_host - number of ports available to a host
514     @param ses_num - number of sessions belonging to this mapping
515 */
516 define snat_det_map_details {
517   u32 context;
518   u8 is_ip4;
519   u8 in_addr[16];
520   u8 in_plen;
521   u8 out_addr[16];
522   u8 out_plen;
523   u32 sharing_ratio;
524   u16 ports_per_host;
525   u32 ses_num;
526 };
527
528 /** \brief Set values of timeouts for deterministic NAT (seconds, 0 = default)
529     @param client_index - opaque cookie to identify the sender
530     @param context - sender context, to match reply w/ request
531     @param udp - UDP timeout (default 300sec)
532     @param tcp_established - TCP established timeout (default 7440sec)
533     @param tcp_transitory - TCP transitory timeout (default 240sec)
534     @param icmp - ICMP timeout (default 60sec)
535 */
536 autoreply define snat_det_set_timeouts {
537   u32 client_index;
538   u32 context;
539   u32 udp;
540   u32 tcp_established;
541   u32 tcp_transitory;
542   u32 icmp;
543 };
544
545 /** \brief Get values of timeouts for deterministic NAT (seconds)
546     @param client_index - opaque cookie to identify the sender
547     @param context - sender context, to match reply w/ request
548 */
549 define snat_det_get_timeouts {
550   u32 client_index;
551   u32 context;
552 };
553
554 /** \brief Get values of timeouts for deterministic NAT reply
555     @param context - sender context, to match reply w/ request
556     @param retval - return code
557     @param udp - UDP timeout (default 300sec)
558     @param tcp_established - TCP established timeout (default 7440sec)
559     @param tcp_transitory - TCP transitory timeout (default 240sec)
560     @param icmp - ICMP timeout (default 60sec)
561 */
562 define snat_det_get_timeouts_reply {
563   u32 context;
564   i32 retval;
565   u32 udp;
566   u32 tcp_established;
567   u32 tcp_transitory;
568   u32 icmp;
569 };
570
571 /** \brief Close deterministic NAT session by outside address and port
572     @param client_index - opaque cookie to identify the sender
573     @param context - sender context, to match reply w/ request
574     @param is_ip4 - 1 if address type is IPv4
575     @param out_addr - outside IP address
576     @param out_port - outside port
577     @param ext_addr - external host address
578     @param ext_port - external host port
579 */
580 autoreply define snat_det_close_session_out {
581   u32 client_index;
582   u32 context;
583   u8 is_ip4;
584   u8 out_addr[16];
585   u16 out_port;
586   u8 ext_addr[16];
587   u16 ext_port;
588 };
589
590 /** \brief Close deterministic NAT session by inside address and port
591     @param client_index - opaque cookie to identify the sender
592     @param context - sender context, to match reply w/ request
593     @param is_ip4 - 1 if address type is IPv4
594     @param in_addr - inside IP address
595     @param in_port - inside port
596     @param ext_addr - external host address
597     @param ext_port - external host port
598 */
599 autoreply define snat_det_close_session_in {
600   u32 client_index;
601   u32 context;
602   u8 is_ip4;
603   u8 in_addr[16];
604   u16 in_port;
605   u8 ext_addr[16];
606   u16 ext_port;
607 };
608
609 /** \brief Dump determinstic NAT sessions
610     @param client_index - opaque cookie to identify the sender
611     @param context - sender context, to match reply w/ request
612     @param is_ip4 - 1 if address type is IPv4
613     @param user_addr - address of an inside user whose sessions to dump
614 */
615 define snat_det_session_dump {
616   u32 client_index;
617   u32 context;
618   u8 is_ip4;
619   u8 user_addr[16];
620 };
621
622 /** \brief Deterministic NAT sessions reply
623     @param context - sender context, to match reply w/ request
624     @param is_ip4 - 1 if address type is IPv4
625     @param in_port - inside port
626     @param ext_addr - external host address
627     @param ext_port - external host port
628     @param out_port - outside NAT port
629     @param state - session state
630     @param expire - session expiration timestamp
631 */
632 define snat_det_session_details {
633   u32 client_index;
634   u32 context;
635   u8 is_ip4;
636   u16 in_port;
637   u8 ext_addr[16];
638   u16 ext_port;
639   u16 out_port;
640   u8 state;
641   u32 expire;
642 };
643
644 /*
645  * Common NAT plugin APIs
646  */
647
648 /** \brief Control ping from client to api server request
649     @param client_index - opaque cookie to identify the sender
650     @param context - sender context, to match reply w/ request
651 */
652 define nat_control_ping
653 {
654   u32 client_index;
655   u32 context;
656 };
657
658 /** \brief Control ping from the client to the server response
659     @param client_index - opaque cookie to identify the sender
660     @param context - sender context, to match reply w/ request
661     @param retval - return code for the request
662     @param vpe_pid - the pid of the vpe, returned by the server
663 */
664 define nat_control_ping_reply
665 {
666   u32 context;
667   i32 retval;
668   u32 client_index;
669   u32 vpe_pid;
670 };
671
672 /** \brief Show NAT plugin startup config
673     @param client_index - opaque cookie to identify the sender
674     @param context - sender context, to match reply w/ request
675 */
676 define nat_show_config
677 {
678   u32 client_index;
679   u32 context;
680 };
681
682 /** \brief Show NAT plugin startup config reply
683     @param context - sender context, to match reply w/ request
684     @param retval - return code for the request
685     @param static_mapping_only - if 1 dynamic translations disabled
686     @param static_mapping_connection_tracking - if 1 create session data
687     @param deterministic - if 1 deterministic mapping
688     @param translation_buckets - number of translation hash buckets
689     @param translation_memory_size - translation hash memory size
690     @param user_buckets - number of user hash buckets
691     @param user_memory_size - user hash memory size
692     @param max_translations_per_user - maximum number of translations per user
693     @param outside_vrf_id - outside VRF id
694     @param inside_vrf_id - default inside VRF id
695 */
696 define nat_show_config_reply
697 {
698   u32 context;
699   i32 retval;
700   u8 static_mapping_only;
701   u8 static_mapping_connection_tracking;
702   u8 deterministic;
703   u32 translation_buckets;
704   u32 translation_memory_size;
705   u32 user_buckets;
706   u32 user_memory_size;
707   u32 max_translations_per_user;
708   u32 outside_vrf_id;
709   u32 inside_vrf_id;
710 };
711
712 /** \brief Set NAT workers
713     @param client_index - opaque cookie to identify the sender
714     @param context - sender context, to match reply w/ request
715     @param worker_mask - NAT workers mask
716 */
717 autoreply define nat_set_workers {
718   u32 client_index;
719   u32 context;
720   u64 worker_mask;
721 };
722
723 /** \brief Dump NAT workers
724     @param client_index - opaque cookie to identify the sender
725     @param context - sender context, to match reply w/ request
726 */
727 define nat_worker_dump {
728   u32 client_index;
729   u32 context;
730 };
731
732 /** \brief NAT workers details response
733     @param context - sender context, to match reply w/ request
734     @param worker_index - worker index
735     @param lcore_id - lcore ID
736     @param name - worker name
737 */
738 define nat_worker_details {
739   u32 context;
740   u32 worker_index;
741   u32 lcore_id;
742   u8 name[64];
743 };
744
745 /** \brief Enable/disable NAT IPFIX logging
746     @param client_index - opaque cookie to identify the sender
747     @param context - sender context, to match reply w/ request
748     @param domain_id - observation domain ID
749     @param src_port - source port number
750     @param enable - 1 if enable, 0 if disable
751 */
752 autoreply define nat_ipfix_enable_disable {
753   u32 client_index;
754   u32 context;
755   u32 domain_id;
756   u16 src_port;
757   u8 enable;
758 };
759
760 /*
761  * NAT44 APIs
762  */
763
764 /** \brief Add/del NAT44 address range
765     @param client_index - opaque cookie to identify the sender
766     @param context - sender context, to match reply w/ request
767     @param first_ip_address - first IPv4 address
768     @param last_ip_address - last IPv4 address
769     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
770     @param is_add - 1 if add, 0 if delete
771 */
772 autoreply define nat44_add_del_address_range {
773   u32 client_index;
774   u32 context;
775   u8 first_ip_address[4];
776   u8 last_ip_address[4];
777   u32 vrf_id;
778   u8 is_add;
779 };
780
781 /** \brief Dump NAT44 addresses
782     @param client_index - opaque cookie to identify the sender
783     @param context - sender context, to match reply w/ request
784 */
785 define nat44_address_dump {
786   u32 client_index;
787   u32 context;
788 };
789
790 /** \brief NAT44 address details response
791     @param context - sender context, to match reply w/ request
792     @param ip_address - IPv4 address
793     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
794 */
795 define nat44_address_details {
796   u32 context;
797   u8 ip_address[4];
798   u32 vrf_id;
799 };
800
801 /** \brief Enable/disable NAT44 feature on the interface
802     @param client_index - opaque cookie to identify the sender
803     @param context - sender context, to match reply w/ request
804     @param is_add - 1 if add, 0 if delete
805     @param is_inside - 1 if inside, 0 if outside
806     @param sw_if_index - software index of the interface
807 */
808 autoreply define nat44_interface_add_del_feature {
809   u32 client_index;
810   u32 context;
811   u8 is_add;
812   u8 is_inside;
813   u32 sw_if_index;
814 };
815
816 /** \brief Dump interfaces with NAT44 feature
817     @param client_index - opaque cookie to identify the sender
818     @param context - sender context, to match reply w/ request
819 */
820 define nat44_interface_dump {
821   u32 client_index;
822   u32 context;
823 };
824
825 /** \brief NAT44 interface details response
826     @param context - sender context, to match reply w/ request
827     @param is_inside - 1 if inside, 0 if outside
828     @param sw_if_index - software index of the interface
829 */
830 define nat44_interface_details {
831   u32 context;
832   u8 is_inside;
833   u32 sw_if_index;
834 };
835
836 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
837            in2out translation)
838     @param client_index - opaque cookie to identify the sender
839     @param context - sender context, to match reply w/ request
840     @param is_add - 1 if add, 0 if delete
841     @param is_inside - 1 if inside, 0 if outside
842     @param sw_if_index - software index of the interface
843 */
844 autoreply define nat44_interface_add_del_output_feature {
845   u32 client_index;
846   u32 context;
847   u8 is_add;
848   u8 is_inside;
849   u32 sw_if_index;
850 };
851
852 /** \brief Dump interfaces with NAT44 output feature
853     @param client_index - opaque cookie to identify the sender
854     @param context - sender context, to match reply w/ request
855 */
856 define nat44_interface_output_feature_dump {
857   u32 client_index;
858   u32 context;
859 };
860
861 /** \brief NAT44 interface with output feature details response
862     @param context - sender context, to match reply w/ request
863     @param is_inside - 1 if inside, 0 if outside
864     @param sw_if_index - software index of the interface
865 */
866 define nat44_interface_output_feature_details {
867   u32 context;
868   u8 is_inside;
869   u32 sw_if_index;
870 };
871
872 /** \brief Add/delete NAT44 static mapping
873     @param client_index - opaque cookie to identify the sender
874     @param context - sender context, to match reply w/ request
875     @param is_add - 1 if add, 0 if delete
876     @param addr_only - 1 if address only mapping
877     @param local_ip_address - local IPv4 address
878     @param external_ip_address - external IPv4 address
879     @param protocol - IP protocol
880     @param local_port - local port number
881     @param external_port - external port number
882     @param external_sw_if_index - external interface (if set
883                                   external_ip_address is ignored, ~0 means not
884                                   used)
885     @param vfr_id - VRF ID
886 */
887 autoreply define nat44_add_del_static_mapping {
888   u32 client_index;
889   u32 context;
890   u8 is_add;
891   u8 addr_only;
892   u8 local_ip_address[4];
893   u8 external_ip_address[4];
894   u8 protocol;
895   u16 local_port;
896   u16 external_port;
897   u32 external_sw_if_index;
898   u32 vrf_id;
899 };
900
901 /** \brief Dump NAT44 static mappings
902     @param client_index - opaque cookie to identify the sender
903     @param context - sender context, to match reply w/ request
904 */
905 define nat44_static_mapping_dump {
906   u32 client_index;
907   u32 context;
908 };
909
910 /** \brief NAT44 static mapping details response
911     @param context - sender context, to match reply w/ request
912     @param addr_only - 1 if address only mapping
913     @param local_ip_address - local IPv4 address
914     @param external_ip_address - external IPv4 address
915     @param protocol - IP protocol
916     @param local_port - local port number
917     @param external_port - external port number
918     @param external_sw_if_index - external interface
919     @param vfr_id - VRF ID
920 */
921 define nat44_static_mapping_details {
922   u32 context;
923   u8 addr_only;
924   u8 local_ip_address[4];
925   u8 external_ip_address[4];
926   u8 protocol;
927   u16 local_port;
928   u16 external_port;
929   u32 external_sw_if_index;
930   u32 vrf_id;
931 };
932
933 /** \brief Add/delete NAT44 pool address from specific interfce
934     @param client_index - opaque cookie to identify the sender
935     @param context - sender context, to match reply w/ request
936     @param is_add - 1 if add, 0 if delete
937     @param sw_if_index - software index of the interface
938 */
939 autoreply define nat44_add_del_interface_addr {
940   u32 client_index;
941   u32 context;
942   u8 is_add;
943   u8 is_inside;
944   u32 sw_if_index;
945 };
946
947 /** \brief Dump NAT44 pool addresses interfaces
948     @param client_index - opaque cookie to identify the sender
949     @param context - sender context, to match reply w/ request
950 */
951 define nat44_interface_addr_dump {
952   u32 client_index;
953   u32 context;
954 };
955
956 /** \brief NAT44 pool addresses interfaces details response
957     @param context - sender context, to match reply w/ request
958     @param sw_if_index - software index of the interface
959 */
960 define nat44_interface_addr_details {
961   u32 context;
962   u32 sw_if_index;
963 };
964
965 /** \brief Dump NAT44 users
966     @param client_index - opaque cookie to identify the sender
967     @param context - sender context, to match reply w/ request
968 */
969 define nat44_user_dump {
970   u32 client_index;
971   u32 context;
972 };
973
974 /** \brief NAT44 users response
975     @param context - sender context, to match reply w/ request
976     @vrf_id - VRF ID
977     @param ip_adress - IPv4 address
978     @param nsessions - number of dynamic sessions
979     @param nstaticsessions - number of static sessions
980 */
981 define nat44_user_details {
982   u32 context;
983   u32 vrf_id;
984   u8 ip_address[4];
985   u32 nsessions;
986   u32 nstaticsessions;
987 };
988
989 /** \brief NAT44 user's sessions
990     @param client_index - opaque cookie to identify the sender
991     @param context - sender context, to match reply w/ request
992     @param is_ip4 - 1 if address type is IPv4
993     @param user_ip - IP address of the user to dump
994     @param vrf_id - VRF_ID
995 */
996 define nat44_user_session_dump {
997   u32 client_index;
998   u32 context;
999   u8 ip_address[4];
1000   u32 vrf_id;
1001 };
1002
1003 /** \brief NAT44 user's sessions response
1004     @param context - sender context, to match reply w/ request
1005     @param outside_ip_address - outside IPv4 address
1006     @param outside_port - outside port
1007     @param inside_ip_address - inside IPv4 address
1008     @param inside_port - inside port
1009     @param protocol - protocol
1010     @param is_static - 1 if session is static
1011     @param last_heard - last heard timer
1012     @param total_bytes - count of bytes sent through session
1013     @param total_pkts - count of pakets sent through session
1014 */
1015 define nat44_user_session_details {
1016   u32 context;
1017   u8 outside_ip_address[4];
1018   u16 outside_port;
1019   u8 inside_ip_address[4];
1020   u16 inside_port;
1021   u16 protocol;
1022   u8 is_static;
1023   u64 last_heard;
1024   u64 total_bytes;
1025   u32 total_pkts;
1026 };
1027
1028 typeonly manual_endian define nat44_lb_addr_port {
1029   u8 addr[4];
1030   u16 port;
1031   u8 probability;
1032 };
1033
1034 autoreply manual_endian define nat44_add_del_lb_static_mapping {
1035   u32 client_index;
1036   u32 context;
1037   u8 is_add;
1038   u8 external_addr[4];
1039   u16 external_port;
1040   u8 protocol;
1041   u32 vrf_id;
1042   u8 local_num;
1043   vl_api_nat44_lb_addr_port_t locals[local_num];
1044 };
1045
1046 define nat44_lb_static_mapping_dump {
1047   u32 client_index;
1048   u32 context;
1049 };
1050
1051 manual_endian define nat44_lb_static_mapping_details {
1052   u32 context;
1053   u8 external_addr[4];
1054   u16 external_port;
1055   u8 protocol;
1056   u32 vrf_id;
1057   u8 local_num;
1058   vl_api_nat44_lb_addr_port_t locals[local_num];
1059 };
1060
1061 /*
1062  * Deterministic NAT (CGN) APIs
1063  */
1064
1065 /** \brief Add/delete NAT deterministic mapping
1066     @param client_index - opaque cookie to identify the sender
1067     @param context - sender context, to match reply w/ request
1068     @param is_add - 1 if add, 0 if delete
1069     @param is_nat44 - 1 if NAT44
1070     @param in_addr - inside IP address
1071     @param in_plen - inside IP address prefix length
1072     @param out_addr - outside IPv4 address
1073     @param out_addr - outside IPv4 address prefix length
1074 */
1075 autoreply define nat_det_add_del_map {
1076   u32 client_index;
1077   u32 context;
1078   u8 is_add;
1079   u8 is_nat44;
1080   u8 addr_only;
1081   u8 in_addr[16];
1082   u8 in_plen;
1083   u8 out_addr[4];
1084   u8 out_plen;
1085 };
1086
1087 /** \brief Get outside address and port range from inside address
1088     @param client_index - opaque cookie to identify the sender
1089     @param context - sender context, to match reply w/ request
1090     @param is_nat44 - 1 if NAT44
1091     @param in_addr - inside IP address
1092 */
1093 define nat_det_forward {
1094   u32 client_index;
1095   u32 context;
1096   u8 is_nat44;
1097   u8 in_addr[16];
1098 };
1099
1100 /** \brief Get outside address and port range from inside address
1101     @param context - sender context, to match reply w/ request
1102     @param retval - return code
1103     @param out_port_lo - outside port range start
1104     @param out_port_hi - outside port range end
1105     @param out_addr - outside IPv4 address
1106 */
1107 define nat_det_forward_reply {
1108   u32 context;
1109   i32 retval;
1110   u16 out_port_lo;
1111   u16 out_port_hi;
1112   u8 out_addr[4];
1113 };
1114
1115 /** \brief Get inside address from outside address and port
1116     @param client_index - opaque cookie to identify the sender
1117     @param context - sender context, to match reply w/ request
1118     @param out_port - outside port
1119     @param out_addr - outside IPv4 address
1120 */
1121 define nat_det_reverse {
1122   u32 client_index;
1123   u32 context;
1124   u16 out_port;
1125   u8 out_addr[4];
1126 };
1127
1128 /** \brief Get inside address from outside address and port reply
1129     @param context - sender context, to match reply w/ request
1130     @param retval - return code
1131     @param is_nat44 - 1 if NAT44
1132     @param in_addr - inside IP address
1133 */
1134 define nat_det_reverse_reply {
1135   u32 context;
1136   i32 retval;
1137   u8 is_nat44;
1138   u8 in_addr[16];
1139 };
1140
1141 /** \brief Dump NAT deterministic mappings
1142     @param client_index - opaque cookie to identify the sender
1143     @param context - sender context, to match reply w/ request
1144 */
1145 define nat_det_map_dump {
1146   u32 client_index;
1147   u32 context;
1148 };
1149
1150 /** \brief NAT users response
1151     @param context - sender context, to match reply w/ request
1152     @param is_nat44 - 1 if NAT44
1153     @param in_addr - inside IP address
1154     @param in_plen - inside IP address prefix length
1155     @param out_addr - outside IPv4 address
1156     @param out_plen - outside IPv4 address prefix length
1157     @param sharing_ratio - outside to inside address sharing ratio
1158     @param ports_per_host - number of ports available to a host
1159     @param ses_num - number of sessions belonging to this mapping
1160 */
1161 define nat_det_map_details {
1162   u32 context;
1163   u8 is_nat44;
1164   u8 in_addr[16];
1165   u8 in_plen;
1166   u8 out_addr[4];
1167   u8 out_plen;
1168   u32 sharing_ratio;
1169   u16 ports_per_host;
1170   u32 ses_num;
1171 };
1172
1173 /** \brief Set values of timeouts for deterministic NAT (seconds, 0 = default)
1174     @param client_index - opaque cookie to identify the sender
1175     @param context - sender context, to match reply w/ request
1176     @param udp - UDP timeout (default 300sec)
1177     @param tcp_established - TCP established timeout (default 7440sec)
1178     @param tcp_transitory - TCP transitory timeout (default 240sec)
1179     @param icmp - ICMP timeout (default 60sec)
1180 */
1181 autoreply define nat_det_set_timeouts {
1182   u32 client_index;
1183   u32 context;
1184   u32 udp;
1185   u32 tcp_established;
1186   u32 tcp_transitory;
1187   u32 icmp;
1188 };
1189
1190 /** \brief Get values of timeouts for deterministic NAT (seconds)
1191     @param client_index - opaque cookie to identify the sender
1192     @param context - sender context, to match reply w/ request
1193 */
1194 define nat_det_get_timeouts {
1195   u32 client_index;
1196   u32 context;
1197 };
1198
1199 /** \brief Get values of timeouts for deterministic NAT reply
1200     @param context - sender context, to match reply w/ request
1201     @param retval - return code
1202     @param udp - UDP timeout (default 300sec)
1203     @param tcp_established - TCP established timeout (default 7440sec)
1204     @param tcp_transitory - TCP transitory timeout (default 240sec)
1205     @param icmp - ICMP timeout (default 60sec)
1206 */
1207 define nat_det_get_timeouts_reply {
1208   u32 context;
1209   i32 retval;
1210   u32 udp;
1211   u32 tcp_established;
1212   u32 tcp_transitory;
1213   u32 icmp;
1214 };
1215
1216 /** \brief Close deterministic NAT session by outside address and port
1217     @param client_index - opaque cookie to identify the sender
1218     @param context - sender context, to match reply w/ request
1219     @param out_addr - outside IPv4 address
1220     @param out_port - outside port
1221     @param ext_addr - external host IPv4 address
1222     @param ext_port - external host port
1223 */
1224 autoreply define nat_det_close_session_out {
1225   u32 client_index;
1226   u32 context;
1227   u8 out_addr[4];
1228   u16 out_port;
1229   u8 ext_addr[4];
1230   u16 ext_port;
1231 };
1232
1233 /** \brief Close deterministic NAT session by inside address and port
1234     @param client_index - opaque cookie to identify the sender
1235     @param context - sender context, to match reply w/ request
1236     @param is_nat44 - 1 if NAT44
1237     @param in_addr - inside IP address
1238     @param in_port - inside port
1239     @param ext_addr - external host IP address
1240     @param ext_port - external host port
1241 */
1242 autoreply define nat_det_close_session_in {
1243   u32 client_index;
1244   u32 context;
1245   u8 is_nat44;
1246   u8 in_addr[16];
1247   u16 in_port;
1248   u8 ext_addr[16];
1249   u16 ext_port;
1250 };
1251
1252 /** \brief Dump determinstic NAT sessions
1253     @param client_index - opaque cookie to identify the sender
1254     @param context - sender context, to match reply w/ request
1255     @param is_nat44 - 1 if NAT44
1256     @param user_addr - address of an inside user whose sessions to dump
1257 */
1258 define nat_det_session_dump {
1259   u32 client_index;
1260   u32 context;
1261   u8 is_nat44;
1262   u8 user_addr[16];
1263 };
1264
1265 /** \brief Deterministic NAT sessions reply
1266     @param context - sender context, to match reply w/ request
1267     @param in_port - inside port
1268     @param ext_addr - external host address
1269     @param ext_port - external host port
1270     @param out_port - outside NAT port
1271     @param state - session state
1272     @param expire - session expiration timestamp
1273 */
1274 define nat_det_session_details {
1275   u32 client_index;
1276   u32 context;
1277   u16 in_port;
1278   u8 ext_addr[4];
1279   u16 ext_port;
1280   u16 out_port;
1281   u8 state;
1282   u32 expire;
1283 };
1284
1285 /*
1286  * NAT64 APIs
1287  */
1288
1289 /** \brief Add/delete address range to NAT64 pool
1290     @param client_index - opaque cookie to identify the sender
1291     @param context - sender context, to match reply w/ request
1292     @param start_addr - start address of the range
1293     @param end_addr - end address of the range
1294     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1295     @param is_add - 1 if add, 0 if delete
1296 */
1297 autoreply define nat64_add_del_pool_addr_range {
1298   u32 client_index;
1299   u32 context;
1300   u8 start_addr[4];
1301   u8 end_addr[4];
1302   u32 vrf_id;
1303   u8 is_add;
1304 };
1305
1306 /** \brief Dump NAT64 pool addresses
1307     @param client_index - opaque cookie to identify the sender
1308     @param context - sender context, to match reply w/ request
1309 */
1310 define nat64_pool_addr_dump {
1311   u32 client_index;
1312   u32 context;
1313 };
1314
1315 /** \brief NAT64 pool address details response
1316     @param context - sender context, to match reply w/ request
1317     @param address - IPv4 address
1318     @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1319 */
1320 define nat64_pool_addr_details {
1321   u32 context;
1322   u8 address[4];
1323   u32 vrf_id;
1324 };
1325
1326 /** \brief Enable/disable NAT64 feature on the interface
1327     @param client_index - opaque cookie to identify the sender
1328     @param context - sender context, to match reply w/ request
1329     @param sw_if_index - index of the interface
1330     @param is_inside - 1 if inside, 0 if outside
1331     @param is_add - 1 if add, 0 if delete
1332 */
1333 autoreply define nat64_add_del_interface {
1334   u32 client_index;
1335   u32 context;
1336   u32 sw_if_index;
1337   u8 is_inside;
1338   u8 is_add;
1339 };
1340
1341 /** \brief Dump interfaces with NAT64 feature
1342     @param client_index - opaque cookie to identify the sender
1343     @param context - sender context, to match reply w/ request
1344 */
1345 define nat64_interface_dump {
1346   u32 client_index;
1347   u32 context;
1348 };
1349
1350 /** \brief NAT64 interface details response
1351     @param context - sender context, to match reply w/ request
1352     @param is_inside - 1 if inside, 0 if outside
1353     @param sw_if_index - index of the interface
1354 */
1355 define nat64_interface_details {
1356   u32 context;
1357   u8 is_inside;
1358   u32 sw_if_index;
1359 };
1360
1361 /** \brief Add/delete NAT64 static BIB entry
1362     @param client_index - opaque cookie to identify the sender
1363     @param context - sender context, to match reply w/ request
1364     @param i_addr - inside IPv6 address
1365     @param o_addr - outside IPv4 address
1366     @param i_port - inside port number
1367     @param o_port - outside port number
1368     @param vrf_id - VRF id of tenant
1369     @param proto - protocol number
1370     @param is_add - 1 if add, 0 if delete
1371 */
1372  autoreply define nat64_add_del_static_bib {
1373   u32 client_index;
1374   u32 context;
1375   u8 i_addr[16];
1376   u8 o_addr[4];
1377   u16 i_port;
1378   u16 o_port;
1379   u32 vrf_id;
1380   u8 proto;
1381   u8 is_add;
1382 };
1383
1384 /** \brief Dump NAT64 BIB
1385     @param client_index - opaque cookie to identify the sender
1386     @param context - sender context, to match reply w/ request
1387     @param proto - protocol of the BIB: 255 - all BIBs
1388                                         6 - TCP BIB
1389                                         17 - UDP BIB
1390                                         1/58 - ICMP BIB
1391                                         otherwise - "unknown" protocol BIB
1392 */
1393 define nat64_bib_dump {
1394   u32 client_index;
1395   u32 context;
1396   u8 proto;
1397 };
1398
1399 /** \brief NAT64 BIB details response
1400     @param context - sender context, to match reply w/ request
1401     @param i_addr - inside IPv6 address
1402     @param o_addr - outside IPv4 address
1403     @param i_port - inside port number
1404     @param o_port - outside port number
1405     @param vrf_id - VRF id of tenant
1406     @param proto - protocol number
1407     @param is_static - 1 if static BIB entry, 0 if dynamic
1408     @param ses_num - number of sessions associated with the BIB entry
1409 */
1410 define nat64_bib_details {
1411   u32 context;
1412   u8 i_addr[16];
1413   u8 o_addr[4];
1414   u16 i_port;
1415   u16 o_port;
1416   u32 vrf_id;
1417   u8 proto;
1418   u8 is_static;
1419   u32 ses_num;
1420 };
1421
1422 /** \brief Set values of timeouts for NAT64 (seconds, 0 = default)
1423     @param client_index - opaque cookie to identify the sender
1424     @param context - sender context, to match reply w/ request
1425     @param udp - UDP timeout (default 300sec)
1426     @param icmp - ICMP timeout (default 60sec)
1427     @param tcp_trans - TCP transitory timeout (default 240sec)
1428     @param tcp_est - TCP established timeout (default 7440sec)
1429     @param tcp_incoming_syn - TCP incoming SYN timeout (default 6sec)
1430 */
1431 autoreply define nat64_set_timeouts {
1432   u32 client_index;
1433   u32 context;
1434   u32 udp;
1435   u32 icmp;
1436   u32 tcp_trans;
1437   u32 tcp_est;
1438   u32 tcp_incoming_syn;
1439 };
1440
1441 /** \brief Get values of timeouts for NAT64 (seconds)
1442     @param client_index - opaque cookie to identify the sender
1443     @param context - sender context, to match reply w/ request
1444 */
1445 define nat64_get_timeouts {
1446   u32 client_index;
1447   u32 context;
1448 };
1449
1450 /** \brief Get values of timeouts for NAT64 reply
1451     @param context - sender context, to match reply w/ request
1452     @param retval - return code
1453     @param udp - UDP timeout
1454     @param icmp - ICMP timeout
1455     @param tcp_trans - TCP transitory timeout
1456     @param tcp_est - TCP established timeout
1457     @param tcp_incoming_syn - TCP incoming SYN timeout
1458 */
1459 define nat64_get_timeouts_reply {
1460   u32 context;
1461   i32 retval;
1462   u32 udp;
1463   u32 icmp;
1464   u32 tcp_trans;
1465   u32 tcp_est;
1466   u32 tcp_incoming_syn;
1467 };
1468
1469 /** \brief Dump NAT64 session table
1470     @param client_index - opaque cookie to identify the sender
1471     @param context - sender context, to match reply w/ request
1472     @param proto - protocol of the session table: 255 - all STs
1473                                                   6 - TCP ST
1474                                                   17 - UDP ST
1475                                                   1/58 - ICMP ST
1476                                                   otherwise - "unknown" proto ST
1477 */
1478 define nat64_st_dump {
1479   u32 client_index;
1480   u32 context;
1481   u8 proto;
1482 };
1483
1484 /** \brief NAT64 session table details response
1485     @param context - sender context, to match reply w/ request
1486     @param il_addr - inside IPv6 address of the local host
1487     @param ol_addr - outside IPv4 address of the local host
1488     @param il_port - inside port number id of the local host/inside ICMP id
1489     @param ol_port - outside port number of the local host/outside ICMP id
1490     @param il_addr - inside IPv6 address of the remote host
1491     @param ol_addr - outside IPv4 address of the remote host
1492     @param l_port - port number of the remote host (not used for ICMP)
1493     @param vrf_id - VRF id of tenant
1494     @param proto - protocol number
1495 */
1496 define nat64_st_details {
1497   u32 context;
1498   u8 il_addr[16];
1499   u8 ol_addr[4];
1500   u16 il_port;
1501   u16 ol_port;
1502   u8 ir_addr[16];
1503   u8 or_addr[4];
1504   u16 r_port;
1505   u32 vrf_id;
1506   u8 proto;
1507 };
1508
1509 /** \brief Add/del NAT64 prefix
1510     @param client_index - opaque cookie to identify the sender
1511     @param context - sender context, to match reply w/ request
1512     @param prefix - NAT64 prefix
1513     @param prefix - NAT64 prefix length
1514     @param vrf_id - VRF id of tenant
1515     @param is_add - 1 if add, 0 if delete
1516 */
1517 autoreply define nat64_add_del_prefix {
1518   u32 client_index;
1519   u32 context;
1520   u8 prefix[16];
1521   u8 prefix_len;
1522   u32 vrf_id;
1523   u8 is_add;
1524 };
1525
1526 /** \brief Dump NAT64 prefix
1527     @param client_index - opaque cookie to identify the sender
1528     @param context - sender context, to match reply w/ request
1529 */
1530 define nat64_prefix_dump {
1531   u32 client_index;
1532   u32 context;
1533 };
1534
1535 /** \brief Dump NAT64 prefix details response
1536     @param context - sender context, to match reply w/ request
1537     @param prefix - NAT64 prefix
1538     @param prefix - NAT64 prefix length
1539     @param vrf_id - VRF id of tenant
1540 */
1541 define nat64_prefix_details {
1542   u32 context;
1543   u8 prefix[16];
1544   u8 prefix_len;
1545   u32 vrf_id;
1546 };