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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 option version = "1.0.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/lib/nat_types.api";
23 * @brief VPP control-plane API messages.
25 * This file defines VPP control-plane API messages which are generally
26 * called through a shared memory interface.
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
38 autoreply define nat64_plugin_enable_disable {
46 option status="in_progress";
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)
57 autoreply define nat64_set_timeouts {
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
70 define nat64_get_timeouts {
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
83 define nat64_get_timeouts_reply {
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
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;
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
113 define nat64_pool_addr_dump {
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
123 define nat64_pool_addr_details {
125 vl_api_ip4_address_t address;
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
135 @param sw_if_index - index of the interface
137 autoreply define nat64_add_del_interface {
141 vl_api_nat_config_flags_t flags;
142 vl_api_interface_index_t sw_if_index;
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
149 define nat64_interface_dump {
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
162 define nat64_interface_details {
164 vl_api_nat_config_flags_t flags;
165 vl_api_interface_index_t sw_if_index;
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
179 autoreply define nat64_add_del_static_bib {
182 vl_api_ip6_address_t i_addr;
183 vl_api_ip4_address_t o_addr;
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
198 otherwise - "unknown" protocol BIB
200 define nat64_bib_dump {
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
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;
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
237 otherwise - "unknown" proto ST
239 define nat64_st_dump {
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
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;
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
277 autoreply define nat64_add_del_prefix {
280 vl_api_ip6_prefix_t prefix;
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
289 define nat64_prefix_dump {
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
299 define nat64_prefix_details {
301 vl_api_ip6_prefix_t prefix;
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
311 autoreply define nat64_add_del_interface_addr {
315 vl_api_interface_index_t sw_if_index;