nat: api & cli command for forcing session cleanup
[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   u32 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   u32 nat64_bib_memory_size;
119   u32 nat64_st_buckets;
120   u32 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 Add/del NAT44 address range
460     @param client_index - opaque cookie to identify the sender
461     @param context - sender context, to match reply w/ request
462     @param first_ip_address - first IPv4 address
463     @param last_ip_address - last IPv4 address
464     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
465     @param is_add - true if add, false if delete
466     @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
467
468 */
469 autoreply define nat44_add_del_address_range {
470   u32 client_index;
471   u32 context;
472   vl_api_ip4_address_t first_ip_address;
473   vl_api_ip4_address_t last_ip_address;
474   u32 vrf_id;
475   bool is_add;
476   vl_api_nat_config_flags_t flags;
477 };
478
479 /** \brief Dump NAT44 addresses
480     @param client_index - opaque cookie to identify the sender
481     @param context - sender context, to match reply w/ request
482 */
483 define nat44_address_dump {
484   u32 client_index;
485   u32 context;
486 };
487
488 /** \brief NAT44 address details response
489     @param context - sender context, to match reply w/ request
490     @param ip_address - IPv4 address
491     @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
492     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
493 */
494 define nat44_address_details {
495   u32 context;
496   vl_api_ip4_address_t ip_address;
497   vl_api_nat_config_flags_t flags;
498   u32 vrf_id;
499 };
500
501 /** \brief Enable/disable NAT44 feature on the interface
502     @param client_index - opaque cookie to identify the sender
503     @param context - sender context, to match reply w/ request
504     @param is_add - true if add, false if delete
505     @param flags - flag NAT_IS_INSIDE if interface is inside else
506                    interface is outside
507     @param sw_if_index - software index of the interface
508 */
509 autoreply define nat44_interface_add_del_feature {
510   u32 client_index;
511   u32 context;
512   bool is_add;
513   vl_api_nat_config_flags_t flags;
514   vl_api_interface_index_t sw_if_index;
515 };
516
517 /** \brief Dump interfaces with NAT44 feature
518     @param client_index - opaque cookie to identify the sender
519     @param context - sender context, to match reply w/ request
520 */
521 define nat44_interface_dump {
522   u32 client_index;
523   u32 context;
524 };
525
526 /** \brief NAT44 interface details response
527     @param context - sender context, to match reply w/ request
528     @param sw_if_index - software index of the interface
529     @param flags - flag NAT_IS_INSIDE if interface is inside,
530                    flag NAT_IS_OUTSIDE if interface is outside
531                    and if both flags are set the interface is
532                    both inside and outside
533 */
534 define nat44_interface_details {
535   u32 context;
536   vl_api_nat_config_flags_t flags;
537   vl_api_interface_index_t sw_if_index;
538 };
539
540 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
541            in2out translation)
542     @param client_index - opaque cookie to identify the sender
543     @param context - sender context, to match reply w/ request
544     @param is_add - true if add, false if delete
545     @param flags - flag NAT_IS_INSIDE if interface is inside else
546                    interface is outside
547     @param sw_if_index - software index of the interface
548 */
549 autoreply define nat44_interface_add_del_output_feature {
550   u32 client_index;
551   u32 context;
552   bool is_add;
553   vl_api_nat_config_flags_t flags;
554   vl_api_interface_index_t sw_if_index;
555 };
556
557 /** \brief Dump interfaces with NAT44 output feature
558     @param client_index - opaque cookie to identify the sender
559     @param context - sender context, to match reply w/ request
560 */
561 define nat44_interface_output_feature_dump {
562   u32 client_index;
563   u32 context;
564 };
565
566 /** \brief NAT44 interface with output feature details response
567     @param context - sender context, to match reply w/ request
568     @param flags - flag NAT_IS_INSIDE if interface is inside else
569                    interface is outside
570     @param sw_if_index - software index of the interface
571 */
572 define nat44_interface_output_feature_details {
573   u32 context;
574   vl_api_nat_config_flags_t flags;
575   vl_api_interface_index_t sw_if_index;
576 };
577
578 /** \brief Add/delete NAT44 static mapping
579     @param client_index - opaque cookie to identify the sender
580     @param context - sender context, to match reply w/ request
581     @param is_add - true if add, false if delete
582     @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
583                    flag nat_is_twice_nat if nat address range for external hosts,
584                    flag NAT_IS_SELF_TWICE_NAT if translate external host address
585                    and port whenever external host address equals local
586                    address of internal host,
587                    flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
588     @param local_ip_address - local IPv4 address
589     @param external_ip_address - external IPv4 address
590     @param protocol - IP protocol, used only if addr_only=0
591     @param local_port - local port number, used only if addr_only=0
592     @param external_port - external port number, used only if addr_only=0
593     @param external_sw_if_index - external interface (if set
594                                   external_ip_address is ignored, ~0 means not
595                                   used)
596     @param vfr_id - VRF ID
597     @param tag - opaque string tag
598 */
599 autoreply define nat44_add_del_static_mapping {
600   u32 client_index;
601   u32 context;
602   bool is_add;
603   vl_api_nat_config_flags_t flags;
604   vl_api_ip4_address_t local_ip_address;
605   vl_api_ip4_address_t external_ip_address;
606   u8 protocol;
607   u16 local_port;
608   u16 external_port;
609   vl_api_interface_index_t external_sw_if_index;
610   u32 vrf_id;
611   string tag[64];
612 };
613
614 /** \brief Dump NAT44 static mappings
615     @param client_index - opaque cookie to identify the sender
616     @param context - sender context, to match reply w/ request
617 */
618 define nat44_static_mapping_dump {
619   u32 client_index;
620   u32 context;
621 };
622
623 /** \brief NAT44 static mapping details response
624     @param context - sender context, to match reply w/ request
625     @param flags - flag NAT_ADDR_ONLY if address only mapping,
626                    flag NAT_TWICE_NAT if NAT address range for external hosts,
627                    flag NAT_SELF_TWICE_NAT if translate external host address
628                    and port whenever external host address equals local
629                    address of internal host,
630                    flag NAT_OUT2IN_ONLY if rule match only out2in direction
631     @param local_ip_address - local IPv4 address
632     @param external_ip_address - external IPv4 address
633     @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
634     @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
635     @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
636     @param external_sw_if_index - external interface
637     @param vfr_id - VRF ID
638     @param tag - opaque string tag
639 */
640 define nat44_static_mapping_details {
641   u32 context;
642   vl_api_nat_config_flags_t flags;
643   vl_api_ip4_address_t local_ip_address;
644   vl_api_ip4_address_t external_ip_address;
645   u8 protocol;
646   u16 local_port;
647   u16 external_port;
648   vl_api_interface_index_t external_sw_if_index;
649   u32 vrf_id;
650   string tag[64];
651 };
652
653 /** \brief Add/delete NAT44 identity mapping
654     @param client_index - opaque cookie to identify the sender
655     @param context - sender context, to match reply w/ request
656     @param is_add - true if add, false if delete
657     @param flags - flag NAT_ADDR_ONLY if address only mapping
658     @param ip_address - IPv4 address
659     @param protocol - IP protocol
660     @param port - port number
661     @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
662                                     used)
663     @param vfr_id - VRF ID (if ~0 use default VRF)
664     @param tag - opaque string tag
665 */
666 autoreply define nat44_add_del_identity_mapping {
667   u32 client_index;
668   u32 context;
669   bool is_add;
670   vl_api_nat_config_flags_t flags;
671   vl_api_ip4_address_t ip_address;
672   u8 protocol;
673   u16 port;
674   vl_api_interface_index_t sw_if_index;
675   u32 vrf_id;
676   string tag[64];
677 };
678
679 /** \brief Dump NAT44 identity mappings
680     @param client_index - opaque cookie to identify the sender
681     @param context - sender context, to match reply w/ request
682 */
683 define nat44_identity_mapping_dump {
684   u32 client_index;
685   u32 context;
686 };
687
688 /** \brief NAT44 identity mapping details response
689     @param context - sender context, to match reply w/ request
690     @param flags - flag NAT_ADDR_ONLY if address only mapping
691     @param ip_address - IPv4 address
692     @param protocol - IP protocol
693     @param port - port number
694     @param sw_if_index - interface
695     @param vfr_id - VRF ID
696     @param tag - opaque string tag
697 */
698 define nat44_identity_mapping_details {
699   u32 context;
700   vl_api_nat_config_flags_t flags;
701   vl_api_ip4_address_t ip_address;
702   u8 protocol;
703   u16 port;
704   vl_api_interface_index_t sw_if_index;
705   u32 vrf_id;
706   string tag[64];
707 };
708
709 /** \brief Add/delete NAT44 pool address from specific interfce
710     @param client_index - opaque cookie to identify the sender
711     @param context - sender context, to match reply w/ request
712     @param is_add - true if add, false if delete
713     @param sw_if_index - software index of the interface
714     @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
715 */
716 autoreply define nat44_add_del_interface_addr {
717   u32 client_index;
718   u32 context;
719   bool is_add;
720   vl_api_interface_index_t sw_if_index;
721   vl_api_nat_config_flags_t flags;
722 };
723
724 /** \brief Dump NAT44 pool addresses interfaces
725     @param client_index - opaque cookie to identify the sender
726     @param context - sender context, to match reply w/ request
727 */
728 define nat44_interface_addr_dump {
729   u32 client_index;
730   u32 context;
731 };
732
733 /** \brief NAT44 pool addresses interfaces details response
734     @param context - sender context, to match reply w/ request
735     @param sw_if_index - software index of the interface
736     @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
737
738 */
739 define nat44_interface_addr_details {
740   u32 context;
741   vl_api_interface_index_t sw_if_index;
742   vl_api_nat_config_flags_t flags;
743 };
744
745 /** \brief Dump NAT44 users
746     @param client_index - opaque cookie to identify the sender
747     @param context - sender context, to match reply w/ request
748 */
749 define nat44_user_dump {
750   u32 client_index;
751   u32 context;
752 };
753
754 /** \brief NAT44 users response
755     @param context - sender context, to match reply w/ request
756     @vrf_id - VRF ID
757     @param ip_address - IPv4 address
758     @param nsessions - number of dynamic sessions
759     @param nstaticsessions - number of static sessions
760 */
761 define nat44_user_details {
762   u32 context;
763   u32 vrf_id;
764   vl_api_ip4_address_t ip_address;
765   u32 nsessions;
766   u32 nstaticsessions;
767 };
768
769 /** \brief NAT44 user's sessions
770     @param client_index - opaque cookie to identify the sender
771     @param context - sender context, to match reply w/ request
772     @param ip_address - IPv4 address of the user to dump
773     @param vrf_id - VRF_ID
774 */
775 define nat44_user_session_dump {
776   u32 client_index;
777   u32 context;
778   vl_api_ip4_address_t ip_address;
779   u32 vrf_id;
780 };
781
782 /** \brief NAT44 user's sessions response
783     @param context - sender context, to match reply w/ request
784     @param outside_ip_address - outside IPv4 address
785     @param outside_port - outside port
786     @param inside_ip_address - inside IPv4 address
787     @param inside_port - inside port
788     @param protocol - protocol
789     @param flags - flag NAT_IS_STATIC if session is static,
790                    flag NAT_IS_TWICE_NAT if session is twice-nat,
791                    flag NAT_IS_EXT_HOST_VALID if external host address
792                    and port are valid
793     @param last_heard - last heard timer
794     @param total_bytes - count of bytes sent through session
795     @param total_pkts - count of pakets sent through session
796     @param ext_host_address - external host IPv4 address
797     @param ext_host_port - external host port
798     @param ext_host_nat_address - post-NAT external host IPv4 address (valid
799                                   only if twice-nat session)
800     @param ext_host_nat_port - post-NAT external host port (valid only if
801                                twice-nat session)
802 */
803 define nat44_user_session_details {
804   u32 context;
805   vl_api_ip4_address_t outside_ip_address;
806   u16 outside_port;
807   vl_api_ip4_address_t inside_ip_address;
808   u16 inside_port;
809   u16 protocol;
810   vl_api_nat_config_flags_t flags;
811   u64 last_heard;
812   u64 total_bytes;
813   u32 total_pkts;
814   vl_api_ip4_address_t ext_host_address;
815   u16 ext_host_port;
816   vl_api_ip4_address_t ext_host_nat_address;
817   u16 ext_host_nat_port;
818 };
819
820 /** \brief NAT44 load-balancing address and port pair
821     @param addr - IPv4 address of the internal node
822     @param port - L4 port number of the internal node
823     @param probability - probability of the internal node to be randomly matched
824     @param vrf_id - VRF id
825 */
826 typedef nat44_lb_addr_port {
827   vl_api_ip4_address_t addr;
828   u16 port;
829   u8 probability;
830   u32 vrf_id;
831 };
832
833 /** \brief Add/delete NAT44 load-balancing static mapping rule
834     @param client_index - opaque cookie to identify the sender
835     @param context - sender context, to match reply w/ request
836     @param is_add - true if add, false if delete
837     @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
838                    flag NAT_SELF_TWICE_NAT if translate external host address
839                    and port whenever external host address equals local
840                    address of internal host,
841                    flag NAT_OUT2IN_ONLY if rule match only out2in direction
842     @param external_addr - external IPv4 address of the service
843     @param external_port - external L4 port number of the service
844     @param protocol - IP protocol number of the service
845     @param affinity - if 0 disabled, otherwise client IP affinity sticky time
846                       in seconds
847     @param local_num - number of local network nodes
848     @param locals - local network nodes
849     @param tag - opaque string tag
850 */
851 autoreply manual_endian define nat44_add_del_lb_static_mapping {
852   u32 client_index;
853   u32 context;
854   bool is_add;
855   vl_api_nat_config_flags_t flags;
856   vl_api_ip4_address_t external_addr;
857   u16 external_port;
858   u8 protocol;
859   u32 affinity;
860   string tag[64];
861   u32 local_num;
862   vl_api_nat44_lb_addr_port_t locals[local_num];
863 };
864
865 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
866     @param client_index - opaque cookie to identify the sender
867     @param context - sender context, to match reply w/ request
868     @param is_add - true if add, false if delete
869     @param external_addr - external IPv4 address of the service
870     @param external_port - external L4 port number of the service
871     @param protocol - IP protocol number of the service
872     @param local - local network node
873 */
874 autoreply define nat44_lb_static_mapping_add_del_local {
875   u32 client_index;
876   u32 context;
877   bool is_add;
878   vl_api_ip4_address_t external_addr;
879   u16 external_port;
880   u8 protocol;
881   vl_api_nat44_lb_addr_port_t local;
882 };
883
884 /** \brief Dump NAT44 load-balancing static mapping rules
885     @param client_index - opaque cookie to identify the sender
886     @param context - sender context, to match reply w/ request
887 */
888 define nat44_lb_static_mapping_dump {
889   u32 client_index;
890   u32 context;
891 };
892
893 /** \brief NAT44 load-balancing static mapping rule details response
894     @param context - sender context, to match reply w/ request
895     @param external_addr - external IPv4 address of the service
896     @param external_port - external L4 port number of the service
897     @param protocol - IP protocol number of the service
898     @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
899                    flag NAT_SELF_TWICE_NAT if translate external host address
900                    and port whenever external host address equals local
901                    address of internal host,
902                    flag NAT_OUT2IN_ONLY if rule match only out2in direction
903     @param affinity - if 0 disabled, otherwise client IP affinity sticky time
904                       in seconds
905     @param local_num - number of local network nodes
906     @param locals - local network nodes
907     @param tag - opaque string tag
908 */
909 manual_endian define nat44_lb_static_mapping_details {
910   u32 context;
911   vl_api_ip4_address_t external_addr;
912   u16 external_port;
913   u8 protocol;
914   vl_api_nat_config_flags_t flags;
915   u32 affinity;
916   string tag[64];
917   u32 local_num;
918   vl_api_nat44_lb_addr_port_t locals[local_num];
919 };
920
921 /** \brief Delete NAT44 session
922     @param client_index - opaque cookie to identify the sender
923     @param context - sender context, to match reply w/ request
924     @param ip_address - IPv4 address
925     @param protocol - IP protocol
926     @param port - port number
927     @param vfr_id - VRF ID
928     @param flags - flag NAT_IS_INSIDE if interface is inside or
929                    interface is outside,
930                    flag NAT_IS_EXT_HOST_VALID if external host address and
931                    port are valid
932     @param ext_host_address - external host IPv4 address
933     @param ext_host_port - external host port
934 */
935 autoreply define nat44_del_session {
936   u32 client_index;
937   u32 context;
938   vl_api_ip4_address_t address;
939   u8 protocol;
940   u16 port;
941   u32 vrf_id;
942   vl_api_nat_config_flags_t flags;
943   vl_api_ip4_address_t ext_host_address;
944   u16 ext_host_port;
945 };
946
947 /** \brief Enable/disable forwarding for NAT44
948     Forward packets which don't match existing translation
949     or static mapping instead of dropping them.
950     @param client_index - opaque cookie to identify the sender
951     @param context - sender context, to match reply w/ request
952     @param enable - true for enable, false for disable
953 */
954 autoreply define nat44_forwarding_enable_disable {
955   u32 client_index;
956   u32 context;
957   bool enable;
958 };
959
960 /** \brief Check if forwarding is enabled or disabled
961     @param client_index - opaque cookie to identify the sender
962     @param context - sender context, to match reply w/ request
963 */
964 define nat44_forwarding_is_enabled {
965   u32 client_index;
966   u32 context;
967 };
968
969 /** \brief Response to check if forwarding is enabled or disabled
970     @param context - sender context, to match reply w/ request
971     @param enabled - true if enabled, false if disabled
972 */
973 define nat44_forwarding_is_enabled_reply {
974   u32 context;
975   bool enabled;
976 };
977
978
979 /*
980  * Deterministic NAT (CGN) APIs
981  */
982
983 /** \brief Add/delete NAT deterministic mapping
984     @param client_index - opaque cookie to identify the sender
985     @param context - sender context, to match reply w/ request
986     @param is_add - true if add, false if delete
987     @param in_addr - inside IPv4 address
988     @param in_plen - inside IPv4 address prefix length
989     @param out_addr - outside IPv4 address
990     @param out_plen - outside IPv4 address prefix length
991 */
992 autoreply define nat_det_add_del_map {
993   u32 client_index;
994   u32 context;
995   bool is_add;
996   vl_api_ip4_address_t in_addr;
997   u8 in_plen;
998   vl_api_ip4_address_t out_addr;
999   u8 out_plen;
1000 };
1001
1002 /** \brief Get outside address and port range from inside address
1003     @param client_index - opaque cookie to identify the sender
1004     @param context - sender context, to match reply w/ request
1005     @param in_addr - inside IP address
1006 */
1007 define nat_det_forward {
1008   u32 client_index;
1009   u32 context;
1010   vl_api_ip4_address_t in_addr;
1011 };
1012
1013 /** \brief Get outside address and port range from inside address
1014     @param context - sender context, to match reply w/ request
1015     @param retval - return code
1016     @param out_port_lo - outside port range start
1017     @param out_port_hi - outside port range end
1018     @param out_addr - outside IPv4 address
1019 */
1020 define nat_det_forward_reply {
1021   u32 context;
1022   i32 retval;
1023   u16 out_port_lo;
1024   u16 out_port_hi;
1025   vl_api_ip4_address_t out_addr;
1026 };
1027
1028 /** \brief Get inside address from outside address and port
1029     @param client_index - opaque cookie to identify the sender
1030     @param context - sender context, to match reply w/ request
1031     @param out_port - outside port
1032     @param out_addr - outside IPv4 address
1033 */
1034 define nat_det_reverse {
1035   u32 client_index;
1036   u32 context;
1037   u16 out_port;
1038   vl_api_ip4_address_t out_addr;
1039 };
1040
1041 /** \brief Get inside address from outside address and port reply
1042     @param context - sender context, to match reply w/ request
1043     @param retval - return code
1044     @param in_addr - inside IP address
1045 */
1046 define nat_det_reverse_reply {
1047   u32 context;
1048   i32 retval;
1049   vl_api_ip4_address_t in_addr;
1050 };
1051
1052 /** \brief Dump NAT deterministic mappings
1053     @param client_index - opaque cookie to identify the sender
1054     @param context - sender context, to match reply w/ request
1055 */
1056 define nat_det_map_dump {
1057   u32 client_index;
1058   u32 context;
1059 };
1060
1061 /** \brief NAT users response
1062     @param context - sender context, to match reply w/ request
1063     @param in_addr - inside IPv4 address
1064     @param in_plen - inside IPv4 address prefix length
1065     @param out_addr - outside IPv4 address
1066     @param out_plen - outside IPv4 address prefix length
1067     @param sharing_ratio - outside to inside address sharing ratio
1068     @param ports_per_host - number of ports available to a host
1069     @param ses_num - number of sessions belonging to this mapping
1070 */
1071 define nat_det_map_details {
1072   u32 context;
1073   vl_api_ip4_address_t in_addr;
1074   u8 in_plen;
1075   vl_api_ip4_address_t out_addr;
1076   u8 out_plen;
1077   u32 sharing_ratio;
1078   u16 ports_per_host;
1079   u32 ses_num;
1080 };
1081
1082 /** \brief Close deterministic NAT session by outside address and port
1083     @param client_index - opaque cookie to identify the sender
1084     @param context - sender context, to match reply w/ request
1085     @param out_addr - outside IPv4 address
1086     @param out_port - outside port
1087     @param ext_addr - external host IPv4 address
1088     @param ext_port - external host port
1089 */
1090 autoreply define nat_det_close_session_out {
1091   u32 client_index;
1092   u32 context;
1093   vl_api_ip4_address_t out_addr;
1094   u16 out_port;
1095   vl_api_ip4_address_t ext_addr;
1096   u16 ext_port;
1097 };
1098
1099 /** \brief Close deterministic NAT session by inside address and port
1100     @param client_index - opaque cookie to identify the sender
1101     @param context - sender context, to match reply w/ request
1102     @param in_addr - inside IP address
1103     @param in_port - inside port
1104     @param ext_addr - external host IP address
1105     @param ext_port - external host port
1106 */
1107 autoreply define nat_det_close_session_in {
1108   u32 client_index;
1109   u32 context;
1110   vl_api_ip4_address_t in_addr;
1111   u16 in_port;
1112   vl_api_ip4_address_t ext_addr;
1113   u16 ext_port;
1114 };
1115
1116 /** \brief Dump determinstic NAT sessions
1117     @param client_index - opaque cookie to identify the sender
1118     @param context - sender context, to match reply w/ request
1119     @param user_addr - address of an inside user whose sessions to dump
1120 */
1121 define nat_det_session_dump {
1122   u32 client_index;
1123   u32 context;
1124   vl_api_ip4_address_t user_addr;
1125 };
1126
1127 /** \brief Deterministic NAT sessions reply
1128     @param context - sender context, to match reply w/ request
1129     @param in_port - inside port
1130     @param ext_addr - external host IPv4 address
1131     @param ext_port - external host port
1132     @param out_port - outside NAT port
1133     @param state - session state
1134     @param expire - session expiration timestamp
1135 */
1136 define nat_det_session_details {
1137   u32 context;
1138   u16 in_port;
1139   vl_api_ip4_address_t ext_addr;
1140   u16 ext_port;
1141   u16 out_port;
1142   u8 state;
1143   u32 expire;
1144 };
1145
1146 /*
1147  * NAT64 APIs
1148  */
1149
1150 /** \brief Add/delete address range to NAT64 pool
1151     @param client_index - opaque cookie to identify the sender
1152     @param context - sender context, to match reply w/ request
1153     @param start_addr - start IPv4 address of the range
1154     @param end_addr - end IPv4 address of the range
1155     @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1156     @param is_add - true if add, false if delete
1157 */
1158 autoreply define nat64_add_del_pool_addr_range {
1159   u32 client_index;
1160   u32 context;
1161   vl_api_ip4_address_t start_addr;
1162   vl_api_ip4_address_t end_addr;
1163   u32 vrf_id;
1164   bool is_add;
1165 };
1166
1167 /** \brief Dump NAT64 pool addresses
1168     @param client_index - opaque cookie to identify the sender
1169     @param context - sender context, to match reply w/ request
1170 */
1171 define nat64_pool_addr_dump {
1172   u32 client_index;
1173   u32 context;
1174 };
1175
1176 /** \brief NAT64 pool address details response
1177     @param context - sender context, to match reply w/ request
1178     @param address - IPv4 address
1179     @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1180 */
1181 define nat64_pool_addr_details {
1182   u32 context;
1183   vl_api_ip4_address_t address;
1184   u32 vrf_id;
1185 };
1186
1187 /** \brief Enable/disable NAT64 feature on the interface
1188     @param client_index - opaque cookie to identify the sender
1189     @param context - sender context, to match reply w/ request
1190     @param is_add - true if add, false if delete
1191     @param flags - flag NAT_IS_INSIDE if interface is inside else
1192                    interface is outside
1193     @param sw_if_index - index of the interface
1194 */
1195 autoreply define nat64_add_del_interface {
1196   u32 client_index;
1197   u32 context;
1198   bool is_add;
1199   vl_api_nat_config_flags_t flags;
1200   vl_api_interface_index_t sw_if_index;
1201 };
1202
1203 /** \brief Dump interfaces with NAT64 feature
1204     @param client_index - opaque cookie to identify the sender
1205     @param context - sender context, to match reply w/ request
1206 */
1207 define nat64_interface_dump {
1208   u32 client_index;
1209   u32 context;
1210 };
1211
1212 /** \brief NAT64 interface details response
1213     @param context - sender context, to match reply w/ request
1214     @param flags - flag NAT_IS_INSIDE if interface is inside,
1215                    flag NAT_IS_OUTSIDE if interface is outside
1216                    and if both flags are set the interface is
1217                    both inside and outside
1218     @param sw_if_index - index of the interface
1219 */
1220 define nat64_interface_details {
1221   u32 context;
1222   vl_api_nat_config_flags_t flags;
1223   vl_api_interface_index_t sw_if_index;
1224 };
1225
1226 /** \brief Add/delete NAT64 static BIB entry
1227     @param client_index - opaque cookie to identify the sender
1228     @param context - sender context, to match reply w/ request
1229     @param i_addr - inside IPv6 address
1230     @param o_addr - outside IPv4 address
1231     @param i_port - inside port number
1232     @param o_port - outside port number
1233     @param vrf_id - VRF id of tenant
1234     @param proto - protocol number
1235     @param is_add - true if add, false if delete
1236 */
1237  autoreply define nat64_add_del_static_bib {
1238   u32 client_index;
1239   u32 context;
1240   vl_api_ip6_address_t i_addr;
1241   vl_api_ip4_address_t o_addr;
1242   u16 i_port;
1243   u16 o_port;
1244   u32 vrf_id;
1245   u8 proto;
1246   bool is_add;
1247 };
1248
1249 /** \brief Dump NAT64 BIB
1250     @param client_index - opaque cookie to identify the sender
1251     @param context - sender context, to match reply w/ request
1252     @param proto - protocol of the BIB: 255 - all BIBs
1253                                         6 - TCP BIB
1254                                         17 - UDP BIB
1255                                         1/58 - ICMP BIB
1256                                         otherwise - "unknown" protocol BIB
1257 */
1258 define nat64_bib_dump {
1259   u32 client_index;
1260   u32 context;
1261   u8 proto;
1262 };
1263
1264 /** \brief NAT64 BIB details response
1265     @param context - sender context, to match reply w/ request
1266     @param i_addr - inside IPv6 address
1267     @param o_addr - outside IPv4 address
1268     @param i_port - inside port number
1269     @param o_port - outside port number
1270     @param vrf_id - VRF id of tenant
1271     @param proto - protocol number
1272     @param flags - flag NAT_IS_STATIC if BIB entry is static 
1273                    or BIB entry is dynamic
1274     @param ses_num - number of sessions associated with the BIB entry
1275 */
1276 define nat64_bib_details {
1277   u32 context;
1278   vl_api_ip6_address_t i_addr;
1279   vl_api_ip4_address_t o_addr;
1280   u16 i_port;
1281   u16 o_port;
1282   u32 vrf_id;
1283   u8 proto;
1284   vl_api_nat_config_flags_t flags;
1285   u32 ses_num;
1286 };
1287
1288 /** \brief Dump NAT64 session table
1289     @param client_index - opaque cookie to identify the sender
1290     @param context - sender context, to match reply w/ request
1291     @param proto - protocol of the session table: 255 - all STs
1292                                                   6 - TCP ST
1293                                                   17 - UDP ST
1294                                                   1/58 - ICMP ST
1295                                                   otherwise - "unknown" proto ST
1296 */
1297 define nat64_st_dump {
1298   u32 client_index;
1299   u32 context;
1300   u8 proto;
1301 };
1302
1303 /** \brief NAT64 session table details response
1304     @param context - sender context, to match reply w/ request
1305     @param il_addr - inside IPv6 address of the local host
1306     @param ol_addr - outside IPv4 address of the local host
1307     @param il_port - inside port number id of the local host/inside ICMP id
1308     @param ol_port - outside port number of the local host/outside ICMP id
1309     @param ir_addr - inside IPv6 address of the remote host
1310     @param or_addr - outside IPv4 address of the remote host
1311     @param r_port - port number of the remote host (not used for ICMP)
1312     @param vrf_id - VRF id of tenant
1313     @param proto - protocol number
1314 */
1315 define nat64_st_details {
1316   u32 context;
1317   vl_api_ip6_address_t il_addr;
1318   vl_api_ip4_address_t ol_addr;
1319   u16 il_port;
1320   u16 ol_port;
1321   vl_api_ip6_address_t ir_addr;
1322   vl_api_ip4_address_t or_addr;
1323   u16 r_port;
1324   u32 vrf_id;
1325   u8 proto;
1326 };
1327
1328 /** \brief Add/del NAT64 prefix
1329     @param client_index - opaque cookie to identify the sender
1330     @param context - sender context, to match reply w/ request
1331     @param prefix - NAT64 prefix
1332     @param vrf_id - VRF id of tenant
1333     @param is_add - true if add, false if delete
1334 */
1335 autoreply define nat64_add_del_prefix {
1336   u32 client_index;
1337   u32 context;
1338   vl_api_ip6_prefix_t prefix;
1339   u32 vrf_id;
1340   bool is_add;
1341 };
1342
1343 /** \brief Dump NAT64 prefix
1344     @param client_index - opaque cookie to identify the sender
1345     @param context - sender context, to match reply w/ request
1346 */
1347 define nat64_prefix_dump {
1348   u32 client_index;
1349   u32 context;
1350 };
1351
1352 /** \brief Dump NAT64 prefix details response
1353     @param context - sender context, to match reply w/ request
1354     @param prefix - NAT64 prefix
1355     @param vrf_id - VRF id of tenant
1356 */
1357 define nat64_prefix_details {
1358   u32 context;
1359   vl_api_ip6_prefix_t prefix;
1360   u32 vrf_id;
1361 };
1362
1363 /** \brief Add/delete NAT64 pool address from specific interfce
1364     @param client_index - opaque cookie to identify the sender
1365     @param context - sender context, to match reply w/ request
1366     @param is_add - true if add, false if delete
1367     @param sw_if_index - software index of the interface
1368 */
1369 autoreply define nat64_add_del_interface_addr {
1370   u32 client_index;
1371   u32 context;
1372   bool is_add;
1373   vl_api_interface_index_t sw_if_index;
1374 };
1375
1376 /*
1377  * NAT66 APIs
1378  */
1379 /** \brief Enable/disable NAT66 feature on the interface
1380     @param client_index - opaque cookie to identify the sender
1381     @param context - sender context, to match reply w/ request
1382     @param is_add - true if add, false if delete
1383     @param flags - flag NAT_IS_INSIDE if interface is inside or
1384                    interface is outside,
1385     @param sw_if_index - software index of the interface
1386 */
1387 autoreply define nat66_add_del_interface {
1388   u32 client_index;
1389   u32 context;
1390   bool is_add;
1391   vl_api_nat_config_flags_t flags;
1392   vl_api_interface_index_t sw_if_index;
1393 };
1394
1395 /** \brief Dump interfaces with NAT66 feature
1396     @param client_index - opaque cookie to identify the sender
1397     @param context - sender context, to match reply w/ request
1398 */
1399 define nat66_interface_dump {
1400   u32 client_index;
1401   u32 context;
1402 };
1403
1404 /** \brief NAT66 interface details response
1405     @param context - sender context, to match reply w/ request
1406     @param flags - flag NAT_IS_INSIDE if interface is inside or
1407                    interface is outside,
1408     @param sw_if_index - software index of the interface
1409 */
1410 define nat66_interface_details {
1411   u32 context;
1412   vl_api_nat_config_flags_t flags;
1413   vl_api_interface_index_t sw_if_index;
1414 };
1415
1416 /** \brief Add/delete 1:1 NAT66
1417     @param client_index - opaque cookie to identify the sender
1418     @param context - sender context, to match reply w/ request
1419     @param is_add - true if add, false if delete
1420     @param local_ip_address - local IPv6 address
1421     @param external_ip_address - external IPv6 address
1422     @param vrf_id - VRF id of tenant
1423 */
1424 autoreply define nat66_add_del_static_mapping {
1425   u32 client_index;
1426   u32 context;
1427   bool is_add;
1428   vl_api_ip6_address_t local_ip_address;
1429   vl_api_ip6_address_t external_ip_address;
1430   u32 vrf_id;
1431 };
1432
1433 /** \brief Dump NAT66 static mappings
1434     @param client_index - opaque cookie to identify the sender
1435     @param context - sender context, to match reply w/ request
1436 */
1437 define nat66_static_mapping_dump {
1438   u32 client_index;
1439   u32 context;
1440 };
1441
1442 /** \brief NAT66 static mapping details response
1443     @param context - sender context, to match reply w/ request
1444     @param local_ip_address - local IPv6 address
1445     @param external_ip_address - external IPv6 address
1446     @param vrf_id - VRF id of tenant
1447     @param total_bytes - count of bytes sent through static mapping
1448     @param total_pkts - count of pakets sent through static mapping
1449 */
1450 define nat66_static_mapping_details {
1451   u32 context;
1452   vl_api_ip6_address_t local_ip_address;
1453   vl_api_ip6_address_t external_ip_address;
1454   u32 vrf_id;
1455   u64 total_bytes;
1456   u64 total_pkts;
1457 };