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