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