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/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 vl_api_interface_index_t sw_if_index;
43 option status="in_progress";
46 /** \brief Enable/disable DET44 feature on the interface
47 @param client_index - opaque cookie to identify the sender
48 @param context - sender context, to match reply w/ request
49 @param is_add - true if add, false if delete
50 @param is_inside - true if interface is inside, false if outside
51 @param sw_if_index - software index of the interface
53 autoreply define det44_interface_add_del_feature {
58 vl_api_interface_index_t sw_if_index;
59 option status="in_progress";
62 /** \brief Dump interfaces with DET44 feature
63 @param client_index - opaque cookie to identify the sender
64 @param context - sender context, to match reply w/ request
66 define det44_interface_dump {
69 option status="in_progress";
72 /** \brief DET44 interface details response
73 @param context - sender context, to match reply w/ request
74 @param is_inside - true if interface is inside, false if outside
75 @param sw_if_index - software index of the interface
77 define det44_interface_details {
81 vl_api_interface_index_t sw_if_index;
82 option status="in_progress";
85 /** \brief Add/delete DET44 mapping
86 @param client_index - opaque cookie to identify the sender
87 @param context - sender context, to match reply w/ request
88 @param is_add - true if add, false if delete
89 @param in_addr - inside IPv4 address
90 @param in_plen - inside IPv4 address prefix length
91 @param out_addr - outside IPv4 address
92 @param out_plen - outside IPv4 address prefix length
94 autoreply define det44_add_del_map {
98 vl_api_ip4_address_t in_addr;
100 vl_api_ip4_address_t out_addr;
104 /** \brief Get outside address and port range from inside address
105 @param client_index - opaque cookie to identify the sender
106 @param context - sender context, to match reply w/ request
107 @param in_addr - inside IP address
109 define det44_forward {
112 vl_api_ip4_address_t in_addr;
115 /** \brief Get outside address and port range from inside address
116 @param context - sender context, to match reply w/ request
117 @param retval - return code
118 @param out_port_lo - outside port range start
119 @param out_port_hi - outside port range end
120 @param out_addr - outside IPv4 address
122 define det44_forward_reply {
127 vl_api_ip4_address_t out_addr;
130 /** \brief Get inside address from outside address and port
131 @param client_index - opaque cookie to identify the sender
132 @param context - sender context, to match reply w/ request
133 @param out_port - outside port
134 @param out_addr - outside IPv4 address
136 define det44_reverse {
140 vl_api_ip4_address_t out_addr;
143 /** \brief Get inside address from outside address and port reply
144 @param context - sender context, to match reply w/ request
145 @param retval - return code
146 @param in_addr - inside IP address
148 define det44_reverse_reply {
151 vl_api_ip4_address_t in_addr;
154 /** \brief Dump DET44 mappings
155 @param client_index - opaque cookie to identify the sender
156 @param context - sender context, to match reply w/ request
158 define det44_map_dump {
163 /** \brief DET44 users response
164 @param context - sender context, to match reply w/ request
165 @param in_addr - inside IPv4 address
166 @param in_plen - inside IPv4 address prefix length
167 @param out_addr - outside IPv4 address
168 @param out_plen - outside IPv4 address prefix length
169 @param sharing_ratio - outside to inside address sharing ratio
170 @param ports_per_host - number of ports available to a host
171 @param ses_num - number of sessions belonging to this mapping
173 define det44_map_details {
175 vl_api_ip4_address_t in_addr;
177 vl_api_ip4_address_t out_addr;
184 /** \brief Close DET44 session by outside address and port
185 @param client_index - opaque cookie to identify the sender
186 @param context - sender context, to match reply w/ request
187 @param out_addr - outside IPv4 address
188 @param out_port - outside port
189 @param ext_addr - external host IPv4 address
190 @param ext_port - external host port
192 autoreply define det44_close_session_out {
195 vl_api_ip4_address_t out_addr;
197 vl_api_ip4_address_t ext_addr;
201 /** \brief Close DET44 session by inside address and port
202 @param client_index - opaque cookie to identify the sender
203 @param context - sender context, to match reply w/ request
204 @param in_addr - inside IP address
205 @param in_port - inside port
206 @param ext_addr - external host IP address
207 @param ext_port - external host port
209 autoreply define det44_close_session_in {
212 vl_api_ip4_address_t in_addr;
214 vl_api_ip4_address_t ext_addr;
218 /** \brief Dump DET44 sessions
219 @param client_index - opaque cookie to identify the sender
220 @param context - sender context, to match reply w/ request
221 @param user_addr - address of an inside user whose sessions to dump
223 define det44_session_dump {
226 vl_api_ip4_address_t user_addr;
229 /** \brief DET44 sessions reply
230 @param context - sender context, to match reply w/ request
231 @param in_port - inside port
232 @param ext_addr - external host IPv4 address
233 @param ext_port - external host port
234 @param out_port - outside port
235 @param state - session state
236 @param expire - session expiration timestamp
238 define det44_session_details {
241 vl_api_ip4_address_t ext_addr;
248 /** \brief Set values of timeouts for DET44 sessions (seconds)
249 @param client_index - opaque cookie to identify the sender
250 @param context - sender context, to match reply w/ request
251 @param udp - UDP timeout (default 300sec)
252 @param tcp_established - TCP established timeout (default 7440sec)
253 @param tcp_transitory - TCP transitory timeout (default 240sec)
254 @param icmp - ICMP timeout (default 60sec)
256 autoreply define det44_set_timeouts {
263 option status="in_progress";
266 /** \brief Get values of timeouts for DET44 sessions (seconds)
267 @param client_index - opaque cookie to identify the sender
268 @param context - sender context, to match reply w/ request
270 define det44_get_timeouts {
275 /** \brief Get values of timeouts for DET44 sessions reply
276 @param context - sender context, to match reply w/ request
277 @param retval - return code
278 @param udp - UDP timeout
279 @param tcp_established - TCP established timeout
280 @param tcp_transitory - TCP transitory timeout
281 @param icmp - ICMP timeout
283 define det44_get_timeouts_reply {
290 option status="in_progress";
294 * Obsolete deterministic API to be removed
297 /** \brief Add/delete NAT deterministic mapping
298 @param client_index - opaque cookie to identify the sender
299 @param context - sender context, to match reply w/ request
300 @param is_add - true if add, false if delete
301 @param in_addr - inside IPv4 address
302 @param in_plen - inside IPv4 address prefix length
303 @param out_addr - outside IPv4 address
304 @param out_plen - outside IPv4 address prefix length
306 autoreply define nat_det_add_del_map {
310 vl_api_ip4_address_t in_addr;
312 vl_api_ip4_address_t out_addr;
314 option status="deprecated";
317 /** \brief Get outside address and port range from inside address
318 @param client_index - opaque cookie to identify the sender
319 @param context - sender context, to match reply w/ request
320 @param in_addr - inside IP address
322 define nat_det_forward {
325 vl_api_ip4_address_t in_addr;
326 option status="deprecated";
329 /** \brief Get outside address and port range from inside address
330 @param context - sender context, to match reply w/ request
331 @param retval - return code
332 @param out_port_lo - outside port range start
333 @param out_port_hi - outside port range end
334 @param out_addr - outside IPv4 address
336 define nat_det_forward_reply {
341 vl_api_ip4_address_t out_addr;
342 option status="deprecated";
345 /** \brief Get inside address from outside address and port
346 @param client_index - opaque cookie to identify the sender
347 @param context - sender context, to match reply w/ request
348 @param out_port - outside port
349 @param out_addr - outside IPv4 address
351 define nat_det_reverse {
355 vl_api_ip4_address_t out_addr;
356 option status="deprecated";
359 /** \brief Get inside address from outside address and port reply
360 @param context - sender context, to match reply w/ request
361 @param retval - return code
362 @param in_addr - inside IP address
364 define nat_det_reverse_reply {
367 vl_api_ip4_address_t in_addr;
368 option status="deprecated";
371 /** \brief Dump NAT deterministic mappings
372 @param client_index - opaque cookie to identify the sender
373 @param context - sender context, to match reply w/ request
375 define nat_det_map_dump {
378 option status="deprecated";
381 /** \brief NAT users response
382 @param context - sender context, to match reply w/ request
383 @param in_addr - inside IPv4 address
384 @param in_plen - inside IPv4 address prefix length
385 @param out_addr - outside IPv4 address
386 @param out_plen - outside IPv4 address prefix length
387 @param sharing_ratio - outside to inside address sharing ratio
388 @param ports_per_host - number of ports available to a host
389 @param ses_num - number of sessions belonging to this mapping
391 define nat_det_map_details {
393 vl_api_ip4_address_t in_addr;
395 vl_api_ip4_address_t out_addr;
400 option status="deprecated";
403 /** \brief Close deterministic NAT session by outside address and port
404 @param client_index - opaque cookie to identify the sender
405 @param context - sender context, to match reply w/ request
406 @param out_addr - outside IPv4 address
407 @param out_port - outside port
408 @param ext_addr - external host IPv4 address
409 @param ext_port - external host port
411 autoreply define nat_det_close_session_out {
414 vl_api_ip4_address_t out_addr;
416 vl_api_ip4_address_t ext_addr;
418 option status="deprecated";
421 /** \brief Close deterministic NAT session by inside address and port
422 @param client_index - opaque cookie to identify the sender
423 @param context - sender context, to match reply w/ request
424 @param in_addr - inside IP address
425 @param in_port - inside port
426 @param ext_addr - external host IP address
427 @param ext_port - external host port
429 autoreply define nat_det_close_session_in {
432 vl_api_ip4_address_t in_addr;
434 vl_api_ip4_address_t ext_addr;
436 option status="deprecated";
439 /** \brief Dump determinstic NAT sessions
440 @param client_index - opaque cookie to identify the sender
441 @param context - sender context, to match reply w/ request
442 @param user_addr - address of an inside user whose sessions to dump
444 define nat_det_session_dump {
447 vl_api_ip4_address_t user_addr;
448 option status="deprecated";
451 /** \brief Deterministic NAT sessions reply
452 @param context - sender context, to match reply w/ request
453 @param in_port - inside port
454 @param ext_addr - external host IPv4 address
455 @param ext_port - external host port
456 @param out_port - outside NAT port
457 @param state - session state
458 @param expire - session expiration timestamp
460 define nat_det_session_details {
463 vl_api_ip4_address_t ext_addr;
468 option status="deprecated";