FD.io VPP  v21.01-7-gd004ecdb5
Vector Packet Processing
nat64.api
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020 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 = "1.0.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/nat_types.api";
20 
21 /**
22  * @file nat64.api
23  * @brief VPP control-plane API messages.
24  *
25  * This file defines VPP control-plane API messages which are generally
26  * called through a shared memory interface.
27  */
28 
29 /** \brief Enable/disable NAT64 plugin
30  @param client_index - opaque cookie to identify the sender
31  @param context - sender context, to match reply w/ request
32  @param bib_buckets - Number of BIB hash buckets
33  @param bib_memory_size - Memory size of BIB hash
34  @param st_buckets - Number of session table hash buckets
35  @param st_memory_size - Memory size of session table hash
36  @param enable - true if enable, false if disable
37 */
38 autoreply define nat64_plugin_enable_disable {
45  bool enable;
46  option status="in_progress";
47 };
48 
49 /** \brief Set values of timeouts for NAT64 sessions (seconds)
50  @param client_index - opaque cookie to identify the sender
51  @param context - sender context, to match reply w/ request
52  @param udp - UDP timeout (default 300sec)
53  @param tcp_established - TCP established timeout (default 7440sec)
54  @param tcp_transitory - TCP transitory timeout (default 240sec)
55  @param icmp - ICMP timeout (default 60sec)
56 */
57 autoreply define nat64_set_timeouts {
64 };
65 
66 /** \brief Get values of timeouts for NAT64 sessions (seconds)
67  @param client_index - opaque cookie to identify the sender
68  @param context - sender context, to match reply w/ request
69 */
70 define nat64_get_timeouts {
73 };
74 
75 /** \brief Get values of timeouts for NAT64 sessions reply
76  @param context - sender context, to match reply w/ request
77  @param retval - return code
78  @param udp - UDP timeout
79  @param tcp_established - TCP established timeout
80  @param tcp_transitory - TCP transitory timeout
81  @param icmp - ICMP timeout
82 */
83 define nat64_get_timeouts_reply {
90 };
91 
92 /** \brief Add/delete address range to NAT64 pool
93  @param client_index - opaque cookie to identify the sender
94  @param context - sender context, to match reply w/ request
95  @param start_addr - start IPv4 address of the range
96  @param end_addr - end IPv4 address of the range
97  @param vrf_id - VRF id of tenant, ~0 means independent of VRF
98  @param is_add - true if add, false if delete
99 */
100 autoreply define nat64_add_del_pool_addr_range {
103  vl_api_ip4_address_t start_addr;
104  vl_api_ip4_address_t end_addr;
106  bool is_add;
107 };
108 
109 /** \brief Dump NAT64 pool addresses
110  @param client_index - opaque cookie to identify the sender
111  @param context - sender context, to match reply w/ request
112 */
113 define nat64_pool_addr_dump {
116 };
117 
118 /** \brief NAT64 pool address details response
119  @param context - sender context, to match reply w/ request
120  @param address - IPv4 address
121  @param vfr_id - VRF id of tenant, ~0 means independent of VRF
122 */
123 define nat64_pool_addr_details {
125  vl_api_ip4_address_t address;
127 };
128 
129 /** \brief Enable/disable NAT64 feature on the interface
130  @param client_index - opaque cookie to identify the sender
131  @param context - sender context, to match reply w/ request
132  @param is_add - true if add, false if delete
133  @param flags - flag NAT_IS_INSIDE if interface is inside else
134  interface is outside
135  @param sw_if_index - index of the interface
136 */
137 autoreply define nat64_add_del_interface {
140  bool is_add;
141  vl_api_nat_config_flags_t flags;
142  vl_api_interface_index_t sw_if_index;
143 };
144 
145 /** \brief Dump interfaces with NAT64 feature
146  @param client_index - opaque cookie to identify the sender
147  @param context - sender context, to match reply w/ request
148 */
149 define nat64_interface_dump {
152 };
153 
154 /** \brief NAT64 interface details response
155  @param context - sender context, to match reply w/ request
156  @param flags - flag NAT_IS_INSIDE if interface is inside,
157  flag NAT_IS_OUTSIDE if interface is outside
158  and if both flags are set the interface is
159  both inside and outside
160  @param sw_if_index - index of the interface
161 */
162 define nat64_interface_details {
164  vl_api_nat_config_flags_t flags;
165  vl_api_interface_index_t sw_if_index;
166 };
167 
168 /** \brief Add/delete NAT64 static BIB entry
169  @param client_index - opaque cookie to identify the sender
170  @param context - sender context, to match reply w/ request
171  @param i_addr - inside IPv6 address
172  @param o_addr - outside IPv4 address
173  @param i_port - inside port number
174  @param o_port - outside port number
175  @param vrf_id - VRF id of tenant
176  @param proto - protocol number
177  @param is_add - true if add, false if delete
178 */
179  autoreply define nat64_add_del_static_bib {
182  vl_api_ip6_address_t i_addr;
183  vl_api_ip4_address_t o_addr;
188  bool is_add;
189 };
190 
191 /** \brief Dump NAT64 BIB
192  @param client_index - opaque cookie to identify the sender
193  @param context - sender context, to match reply w/ request
194  @param proto - protocol of the BIB: 255 - all BIBs
195  6 - TCP BIB
196  17 - UDP BIB
197  1/58 - ICMP BIB
198  otherwise - "unknown" protocol BIB
199 */
200 define nat64_bib_dump {
204 };
205 
206 /** \brief NAT64 BIB details response
207  @param context - sender context, to match reply w/ request
208  @param i_addr - inside IPv6 address
209  @param o_addr - outside IPv4 address
210  @param i_port - inside port number
211  @param o_port - outside port number
212  @param vrf_id - VRF id of tenant
213  @param proto - protocol number
214  @param flags - flag NAT_IS_STATIC if BIB entry is static
215  or BIB entry is dynamic
216  @param ses_num - number of sessions associated with the BIB entry
217 */
218 define nat64_bib_details {
220  vl_api_ip6_address_t i_addr;
221  vl_api_ip4_address_t o_addr;
226  vl_api_nat_config_flags_t flags;
228 };
229 
230 /** \brief Dump NAT64 session table
231  @param client_index - opaque cookie to identify the sender
232  @param context - sender context, to match reply w/ request
233  @param proto - protocol of the session table: 255 - all STs
234  6 - TCP ST
235  17 - UDP ST
236  1/58 - ICMP ST
237  otherwise - "unknown" proto ST
238 */
239 define nat64_st_dump {
243 };
244 
245 /** \brief NAT64 session table details response
246  @param context - sender context, to match reply w/ request
247  @param il_addr - inside IPv6 address of the local host
248  @param ol_addr - outside IPv4 address of the local host
249  @param il_port - inside port number id of the local host/inside ICMP id
250  @param ol_port - outside port number of the local host/outside ICMP id
251  @param ir_addr - inside IPv6 address of the remote host
252  @param or_addr - outside IPv4 address of the remote host
253  @param r_port - port number of the remote host (not used for ICMP)
254  @param vrf_id - VRF id of tenant
255  @param proto - protocol number
256 */
257 define nat64_st_details {
259  vl_api_ip6_address_t il_addr;
260  vl_api_ip4_address_t ol_addr;
263  vl_api_ip6_address_t ir_addr;
264  vl_api_ip4_address_t or_addr;
268 };
269 
270 /** \brief Add/del NAT64 prefix
271  @param client_index - opaque cookie to identify the sender
272  @param context - sender context, to match reply w/ request
273  @param prefix - NAT64 prefix
274  @param vrf_id - VRF id of tenant
275  @param is_add - true if add, false if delete
276 */
277 autoreply define nat64_add_del_prefix {
280  vl_api_ip6_prefix_t prefix;
282  bool is_add;
283 };
284 
285 /** \brief Dump NAT64 prefix
286  @param client_index - opaque cookie to identify the sender
287  @param context - sender context, to match reply w/ request
288 */
289 define nat64_prefix_dump {
292 };
293 
294 /** \brief Dump NAT64 prefix details response
295  @param context - sender context, to match reply w/ request
296  @param prefix - NAT64 prefix
297  @param vrf_id - VRF id of tenant
298 */
299 define nat64_prefix_details {
301  vl_api_ip6_prefix_t prefix;
303 };
304 
305 /** \brief Add/delete NAT64 pool address from specific interfce
306  @param client_index - opaque cookie to identify the sender
307  @param context - sender context, to match reply w/ request
308  @param is_add - true if add, false if delete
309  @param sw_if_index - software index of the interface
310 */
311 autoreply define nat64_add_del_interface_addr {
314  bool is_add;
315  vl_api_interface_index_t sw_if_index;
316 };
vl_api_nat_config_flags_t flags
Definition: nat64.api:226
vl_api_ip6_prefix_t prefix
Definition: nat64.api:301
vl_api_ip4_address_t or_addr
Definition: nat64.api:264
unsigned char u8
Definition: types.h:56
vl_api_interface_index_t sw_if_index
Definition: nat64.api:315
vl_api_nat_config_flags_t flags
Definition: nat64.api:141
vl_api_ip6_address_t ir_addr
Definition: nat64.api:263
vl_api_ip4_address_t o_addr
Definition: nat64.api:183
vl_api_ip6_address_t i_addr
Definition: nat64.api:182
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
vl_api_ip6_address_t i_addr
Definition: nat64.api:220
vl_api_ip6_address_t il_addr
Definition: nat64.api:259
vl_api_interface_index_t sw_if_index
Definition: nat64.api:165
int nat64_add_del_prefix(ip6_address_t *prefix, u8 plen, u32 vrf_id, u8 is_add)
Add/delete NAT64 prefix.
Definition: nat64.c:1206
vl_api_ip4_address_t ol_addr
Definition: nat64.api:260
signed int i32
Definition: types.h:77
option version
Definition: nat64.api:16
vl_api_ip4_address_t o_addr
Definition: nat64.api:221
vl_api_ip4_address_t start_addr
Definition: nat64.api:103
vl_api_interface_index_t sw_if_index
Definition: nat64.api:142
vl_api_ip4_address_t end_addr
Definition: nat64.api:104
vl_api_ip6_prefix_t prefix
Definition: nat64.api:280
vl_api_ip4_address_t address
Definition: nat64.api:125
vl_api_nat_config_flags_t flags
Definition: nat64.api:164