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