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 {
44 /** \brief Enable/disable DET44 feature on the interface
45 @param client_index - opaque cookie to identify the sender
46 @param context - sender context, to match reply w/ request
47 @param is_add - true if add, false if delete
48 @param is_inside - true if interface is inside, false if outside
49 @param sw_if_index - software index of the interface
51 autoreply define det44_interface_add_del_feature {
56 vl_api_interface_index_t sw_if_index;
59 /** \brief Dump interfaces with DET44 feature
60 @param client_index - opaque cookie to identify the sender
61 @param context - sender context, to match reply w/ request
63 define det44_interface_dump {
68 /** \brief DET44 interface details response
69 @param context - sender context, to match reply w/ request
70 @param is_inside - true if interface is inside, false if outside
71 @param sw_if_index - software index of the interface
73 define det44_interface_details {
77 vl_api_interface_index_t sw_if_index;
80 /** \brief Add/delete DET44 mapping
81 @param client_index - opaque cookie to identify the sender
82 @param context - sender context, to match reply w/ request
83 @param is_add - true if add, false if delete
84 @param in_addr - inside IPv4 address
85 @param in_plen - inside IPv4 address prefix length
86 @param out_addr - outside IPv4 address
87 @param out_plen - outside IPv4 address prefix length
89 autoreply define det44_add_del_map {
93 vl_api_ip4_address_t in_addr;
95 vl_api_ip4_address_t out_addr;
99 /** \brief Get outside address and port range from inside address
100 @param client_index - opaque cookie to identify the sender
101 @param context - sender context, to match reply w/ request
102 @param in_addr - inside IP address
104 define det44_forward {
107 vl_api_ip4_address_t in_addr;
110 /** \brief Get outside address and port range from inside address
111 @param context - sender context, to match reply w/ request
112 @param retval - return code
113 @param out_port_lo - outside port range start
114 @param out_port_hi - outside port range end
115 @param out_addr - outside IPv4 address
117 define det44_forward_reply {
122 vl_api_ip4_address_t out_addr;
125 /** \brief Get inside address from outside address and port
126 @param client_index - opaque cookie to identify the sender
127 @param context - sender context, to match reply w/ request
128 @param out_port - outside port
129 @param out_addr - outside IPv4 address
131 define det44_reverse {
135 vl_api_ip4_address_t out_addr;
138 /** \brief Get inside address from outside address and port reply
139 @param context - sender context, to match reply w/ request
140 @param retval - return code
141 @param in_addr - inside IP address
143 define det44_reverse_reply {
146 vl_api_ip4_address_t in_addr;
149 /** \brief Dump DET44 mappings
150 @param client_index - opaque cookie to identify the sender
151 @param context - sender context, to match reply w/ request
153 define det44_map_dump {
158 /** \brief DET44 users response
159 @param context - sender context, to match reply w/ request
160 @param in_addr - inside IPv4 address
161 @param in_plen - inside IPv4 address prefix length
162 @param out_addr - outside IPv4 address
163 @param out_plen - outside IPv4 address prefix length
164 @param sharing_ratio - outside to inside address sharing ratio
165 @param ports_per_host - number of ports available to a host
166 @param ses_num - number of sessions belonging to this mapping
168 define det44_map_details {
170 vl_api_ip4_address_t in_addr;
172 vl_api_ip4_address_t out_addr;
179 /** \brief Close DET44 session by outside address and port
180 @param client_index - opaque cookie to identify the sender
181 @param context - sender context, to match reply w/ request
182 @param out_addr - outside IPv4 address
183 @param out_port - outside port
184 @param ext_addr - external host IPv4 address
185 @param ext_port - external host port
187 autoreply define det44_close_session_out {
190 vl_api_ip4_address_t out_addr;
192 vl_api_ip4_address_t ext_addr;
196 /** \brief Close DET44 session by inside address and port
197 @param client_index - opaque cookie to identify the sender
198 @param context - sender context, to match reply w/ request
199 @param in_addr - inside IP address
200 @param in_port - inside port
201 @param ext_addr - external host IP address
202 @param ext_port - external host port
204 autoreply define det44_close_session_in {
207 vl_api_ip4_address_t in_addr;
209 vl_api_ip4_address_t ext_addr;
213 /** \brief Dump DET44 sessions
214 @param client_index - opaque cookie to identify the sender
215 @param context - sender context, to match reply w/ request
216 @param user_addr - address of an inside user whose sessions to dump
218 define det44_session_dump {
221 vl_api_ip4_address_t user_addr;
224 /** \brief DET44 sessions reply
225 @param context - sender context, to match reply w/ request
226 @param in_port - inside port
227 @param ext_addr - external host IPv4 address
228 @param ext_port - external host port
229 @param out_port - outside port
230 @param state - session state
231 @param expire - session expiration timestamp
233 define det44_session_details {
236 vl_api_ip4_address_t ext_addr;
243 /** \brief Set values of timeouts for DET44 sessions (seconds)
244 @param client_index - opaque cookie to identify the sender
245 @param context - sender context, to match reply w/ request
246 @param udp - UDP timeout (default 300sec)
247 @param tcp_established - TCP established timeout (default 7440sec)
248 @param tcp_transitory - TCP transitory timeout (default 240sec)
249 @param icmp - ICMP timeout (default 60sec)
251 autoreply define det44_set_timeouts {
258 option status="in_progress";
261 /** \brief Get values of timeouts for DET44 sessions (seconds)
262 @param client_index - opaque cookie to identify the sender
263 @param context - sender context, to match reply w/ request
265 define det44_get_timeouts {
270 /** \brief Get values of timeouts for DET44 sessions reply
271 @param context - sender context, to match reply w/ request
272 @param retval - return code
273 @param udp - UDP timeout
274 @param tcp_established - TCP established timeout
275 @param tcp_transitory - TCP transitory timeout
276 @param icmp - ICMP timeout
278 define det44_get_timeouts_reply {
285 option status="in_progress";
289 * Obsolete deterministic API to be removed
292 /** \brief Add/delete NAT deterministic mapping
293 @param client_index - opaque cookie to identify the sender
294 @param context - sender context, to match reply w/ request
295 @param is_add - true if add, false if delete
296 @param in_addr - inside IPv4 address
297 @param in_plen - inside IPv4 address prefix length
298 @param out_addr - outside IPv4 address
299 @param out_plen - outside IPv4 address prefix length
301 autoreply define nat_det_add_del_map {
305 vl_api_ip4_address_t in_addr;
307 vl_api_ip4_address_t out_addr;
312 /** \brief Get outside address and port range from inside address
313 @param client_index - opaque cookie to identify the sender
314 @param context - sender context, to match reply w/ request
315 @param in_addr - inside IP address
317 define nat_det_forward {
320 vl_api_ip4_address_t in_addr;
324 /** \brief Get outside address and port range from inside address
325 @param context - sender context, to match reply w/ request
326 @param retval - return code
327 @param out_port_lo - outside port range start
328 @param out_port_hi - outside port range end
329 @param out_addr - outside IPv4 address
331 define nat_det_forward_reply {
336 vl_api_ip4_address_t out_addr;
340 /** \brief Get inside address from outside address and port
341 @param client_index - opaque cookie to identify the sender
342 @param context - sender context, to match reply w/ request
343 @param out_port - outside port
344 @param out_addr - outside IPv4 address
346 define nat_det_reverse {
350 vl_api_ip4_address_t out_addr;
354 /** \brief Get inside address from outside address and port reply
355 @param context - sender context, to match reply w/ request
356 @param retval - return code
357 @param in_addr - inside IP address
359 define nat_det_reverse_reply {
362 vl_api_ip4_address_t in_addr;
366 /** \brief Dump NAT deterministic mappings
367 @param client_index - opaque cookie to identify the sender
368 @param context - sender context, to match reply w/ request
370 define nat_det_map_dump {
376 /** \brief NAT users response
377 @param context - sender context, to match reply w/ request
378 @param in_addr - inside IPv4 address
379 @param in_plen - inside IPv4 address prefix length
380 @param out_addr - outside IPv4 address
381 @param out_plen - outside IPv4 address prefix length
382 @param sharing_ratio - outside to inside address sharing ratio
383 @param ports_per_host - number of ports available to a host
384 @param ses_num - number of sessions belonging to this mapping
386 define nat_det_map_details {
388 vl_api_ip4_address_t in_addr;
390 vl_api_ip4_address_t out_addr;
398 /** \brief Close deterministic NAT session by outside address and port
399 @param client_index - opaque cookie to identify the sender
400 @param context - sender context, to match reply w/ request
401 @param out_addr - outside IPv4 address
402 @param out_port - outside port
403 @param ext_addr - external host IPv4 address
404 @param ext_port - external host port
406 autoreply define nat_det_close_session_out {
409 vl_api_ip4_address_t out_addr;
411 vl_api_ip4_address_t ext_addr;
416 /** \brief Close deterministic NAT session by inside address and port
417 @param client_index - opaque cookie to identify the sender
418 @param context - sender context, to match reply w/ request
419 @param in_addr - inside IP address
420 @param in_port - inside port
421 @param ext_addr - external host IP address
422 @param ext_port - external host port
424 autoreply define nat_det_close_session_in {
427 vl_api_ip4_address_t in_addr;
429 vl_api_ip4_address_t ext_addr;
434 /** \brief Dump determinstic NAT sessions
435 @param client_index - opaque cookie to identify the sender
436 @param context - sender context, to match reply w/ request
437 @param user_addr - address of an inside user whose sessions to dump
439 define nat_det_session_dump {
442 vl_api_ip4_address_t user_addr;
446 /** \brief Deterministic NAT sessions reply
447 @param context - sender context, to match reply w/ request
448 @param in_port - inside port
449 @param ext_addr - external host IPv4 address
450 @param ext_port - external host port
451 @param out_port - outside NAT port
452 @param state - session state
453 @param expire - session expiration timestamp
455 define nat_det_session_details {
458 vl_api_ip4_address_t ext_addr;