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