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 DET44 plugin
30 @param client_index - opaque cookie to identify the sender
31 @param context - sender context, to match reply w/ request
32 @param inside_vrf - inside VRF id
33 @param outside_vrf - outside VRF id
34 @param enable - true if enable, false if disable
36 autoreply define det44_plugin_enable_disable {
42 option status="in_progress";
45 /** \brief Enable/disable DET44 feature on the interface
46 @param client_index - opaque cookie to identify the sender
47 @param context - sender context, to match reply w/ request
48 @param is_add - true if add, false if delete
49 @param is_inside - true if interface is inside, false if outside
50 @param sw_if_index - software index of the interface
52 autoreply define det44_interface_add_del_feature {
57 vl_api_interface_index_t sw_if_index;
58 option status="in_progress";
61 /** \brief Dump interfaces with DET44 feature
62 @param client_index - opaque cookie to identify the sender
63 @param context - sender context, to match reply w/ request
65 define det44_interface_dump {
68 option status="in_progress";
71 /** \brief DET44 interface details response
72 @param context - sender context, to match reply w/ request
73 @param is_inside - true if interface is inside, false if outside
74 @param sw_if_index - software index of the interface
76 define det44_interface_details {
80 vl_api_interface_index_t sw_if_index;
81 option status="in_progress";
84 /** \brief Add/delete DET44 mapping
85 @param client_index - opaque cookie to identify the sender
86 @param context - sender context, to match reply w/ request
87 @param is_add - true if add, false if delete
88 @param in_addr - inside IPv4 address
89 @param in_plen - inside IPv4 address prefix length
90 @param out_addr - outside IPv4 address
91 @param out_plen - outside IPv4 address prefix length
93 autoreply define det44_add_del_map {
97 vl_api_ip4_address_t in_addr;
99 vl_api_ip4_address_t out_addr;
103 /** \brief Get outside address and port range from inside address
104 @param client_index - opaque cookie to identify the sender
105 @param context - sender context, to match reply w/ request
106 @param in_addr - inside IP address
108 define det44_forward {
111 vl_api_ip4_address_t in_addr;
114 /** \brief Get outside address and port range from inside address
115 @param context - sender context, to match reply w/ request
116 @param retval - return code
117 @param out_port_lo - outside port range start
118 @param out_port_hi - outside port range end
119 @param out_addr - outside IPv4 address
121 define det44_forward_reply {
126 vl_api_ip4_address_t out_addr;
129 /** \brief Get inside address from outside address and port
130 @param client_index - opaque cookie to identify the sender
131 @param context - sender context, to match reply w/ request
132 @param out_port - outside port
133 @param out_addr - outside IPv4 address
135 define det44_reverse {
139 vl_api_ip4_address_t out_addr;
142 /** \brief Get inside address from outside address and port reply
143 @param context - sender context, to match reply w/ request
144 @param retval - return code
145 @param in_addr - inside IP address
147 define det44_reverse_reply {
150 vl_api_ip4_address_t in_addr;
153 /** \brief Dump DET44 mappings
154 @param client_index - opaque cookie to identify the sender
155 @param context - sender context, to match reply w/ request
157 define det44_map_dump {
162 /** \brief DET44 users response
163 @param context - sender context, to match reply w/ request
164 @param in_addr - inside IPv4 address
165 @param in_plen - inside IPv4 address prefix length
166 @param out_addr - outside IPv4 address
167 @param out_plen - outside IPv4 address prefix length
168 @param sharing_ratio - outside to inside address sharing ratio
169 @param ports_per_host - number of ports available to a host
170 @param ses_num - number of sessions belonging to this mapping
172 define det44_map_details {
174 vl_api_ip4_address_t in_addr;
176 vl_api_ip4_address_t out_addr;
183 /** \brief Close DET44 session by outside address and port
184 @param client_index - opaque cookie to identify the sender
185 @param context - sender context, to match reply w/ request
186 @param out_addr - outside IPv4 address
187 @param out_port - outside port
188 @param ext_addr - external host IPv4 address
189 @param ext_port - external host port
191 autoreply define det44_close_session_out {
194 vl_api_ip4_address_t out_addr;
196 vl_api_ip4_address_t ext_addr;
200 /** \brief Close DET44 session by inside address and port
201 @param client_index - opaque cookie to identify the sender
202 @param context - sender context, to match reply w/ request
203 @param in_addr - inside IP address
204 @param in_port - inside port
205 @param ext_addr - external host IP address
206 @param ext_port - external host port
208 autoreply define det44_close_session_in {
211 vl_api_ip4_address_t in_addr;
213 vl_api_ip4_address_t ext_addr;
217 /** \brief Dump DET44 sessions
218 @param client_index - opaque cookie to identify the sender
219 @param context - sender context, to match reply w/ request
220 @param user_addr - address of an inside user whose sessions to dump
222 define det44_session_dump {
225 vl_api_ip4_address_t user_addr;
228 /** \brief DET44 sessions reply
229 @param context - sender context, to match reply w/ request
230 @param in_port - inside port
231 @param ext_addr - external host IPv4 address
232 @param ext_port - external host port
233 @param out_port - outside port
234 @param state - session state
235 @param expire - session expiration timestamp
237 define det44_session_details {
240 vl_api_ip4_address_t ext_addr;
247 /** \brief Set values of timeouts for DET44 sessions (seconds)
248 @param client_index - opaque cookie to identify the sender
249 @param context - sender context, to match reply w/ request
250 @param udp - UDP timeout (default 300sec)
251 @param tcp_established - TCP established timeout (default 7440sec)
252 @param tcp_transitory - TCP transitory timeout (default 240sec)
253 @param icmp - ICMP timeout (default 60sec)
255 autoreply define det44_set_timeouts {
262 option status="in_progress";
265 /** \brief Get values of timeouts for DET44 sessions (seconds)
266 @param client_index - opaque cookie to identify the sender
267 @param context - sender context, to match reply w/ request
269 define det44_get_timeouts {
274 /** \brief Get values of timeouts for DET44 sessions reply
275 @param context - sender context, to match reply w/ request
276 @param retval - return code
277 @param udp - UDP timeout
278 @param tcp_established - TCP established timeout
279 @param tcp_transitory - TCP transitory timeout
280 @param icmp - ICMP timeout
282 define det44_get_timeouts_reply {
289 option status="in_progress";
293 * Obsolete deterministic API to be removed
296 /** \brief Add/delete NAT deterministic mapping
297 @param client_index - opaque cookie to identify the sender
298 @param context - sender context, to match reply w/ request
299 @param is_add - true if add, false if delete
300 @param in_addr - inside IPv4 address
301 @param in_plen - inside IPv4 address prefix length
302 @param out_addr - outside IPv4 address
303 @param out_plen - outside IPv4 address prefix length
305 autoreply define nat_det_add_del_map {
309 vl_api_ip4_address_t in_addr;
311 vl_api_ip4_address_t out_addr;
316 /** \brief Get outside address and port range from inside address
317 @param client_index - opaque cookie to identify the sender
318 @param context - sender context, to match reply w/ request
319 @param in_addr - inside IP address
321 define nat_det_forward {
324 vl_api_ip4_address_t in_addr;
328 /** \brief Get outside address and port range from inside address
329 @param context - sender context, to match reply w/ request
330 @param retval - return code
331 @param out_port_lo - outside port range start
332 @param out_port_hi - outside port range end
333 @param out_addr - outside IPv4 address
335 define nat_det_forward_reply {
340 vl_api_ip4_address_t out_addr;
344 /** \brief Get inside address from outside address and port
345 @param client_index - opaque cookie to identify the sender
346 @param context - sender context, to match reply w/ request
347 @param out_port - outside port
348 @param out_addr - outside IPv4 address
350 define nat_det_reverse {
354 vl_api_ip4_address_t out_addr;
358 /** \brief Get inside address from outside address and port reply
359 @param context - sender context, to match reply w/ request
360 @param retval - return code
361 @param in_addr - inside IP address
363 define nat_det_reverse_reply {
366 vl_api_ip4_address_t in_addr;
370 /** \brief Dump NAT deterministic mappings
371 @param client_index - opaque cookie to identify the sender
372 @param context - sender context, to match reply w/ request
374 define nat_det_map_dump {
380 /** \brief NAT users response
381 @param context - sender context, to match reply w/ request
382 @param in_addr - inside IPv4 address
383 @param in_plen - inside IPv4 address prefix length
384 @param out_addr - outside IPv4 address
385 @param out_plen - outside IPv4 address prefix length
386 @param sharing_ratio - outside to inside address sharing ratio
387 @param ports_per_host - number of ports available to a host
388 @param ses_num - number of sessions belonging to this mapping
390 define nat_det_map_details {
392 vl_api_ip4_address_t in_addr;
394 vl_api_ip4_address_t out_addr;
402 /** \brief Close deterministic NAT session by outside address and port
403 @param client_index - opaque cookie to identify the sender
404 @param context - sender context, to match reply w/ request
405 @param out_addr - outside IPv4 address
406 @param out_port - outside port
407 @param ext_addr - external host IPv4 address
408 @param ext_port - external host port
410 autoreply define nat_det_close_session_out {
413 vl_api_ip4_address_t out_addr;
415 vl_api_ip4_address_t ext_addr;
420 /** \brief Close deterministic NAT session by inside address and port
421 @param client_index - opaque cookie to identify the sender
422 @param context - sender context, to match reply w/ request
423 @param in_addr - inside IP address
424 @param in_port - inside port
425 @param ext_addr - external host IP address
426 @param ext_port - external host port
428 autoreply define nat_det_close_session_in {
431 vl_api_ip4_address_t in_addr;
433 vl_api_ip4_address_t ext_addr;
438 /** \brief Dump determinstic NAT sessions
439 @param client_index - opaque cookie to identify the sender
440 @param context - sender context, to match reply w/ request
441 @param user_addr - address of an inside user whose sessions to dump
443 define nat_det_session_dump {
446 vl_api_ip4_address_t user_addr;
450 /** \brief Deterministic NAT sessions reply
451 @param context - sender context, to match reply w/ request
452 @param in_port - inside port
453 @param ext_addr - external host IPv4 address
454 @param ext_port - external host port
455 @param out_port - outside NAT port
456 @param state - session state
457 @param expire - session expiration timestamp
459 define nat_det_session_details {
462 vl_api_ip4_address_t ext_addr;