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