FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
det44.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 det44.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 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
35 */
36 autoreply define det44_plugin_enable_disable {
41  bool enable;
42  vl_api_interface_index_t sw_if_index;
43  option status="in_progress";
44 };
45 
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
52 */
53 autoreply define det44_interface_add_del_feature {
56  bool is_add;
57  bool is_inside;
58  vl_api_interface_index_t sw_if_index;
59  option status="in_progress";
60 };
61 
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
65 */
66 define det44_interface_dump {
69  option status="in_progress";
70 };
71 
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
76 */
77 define det44_interface_details {
79  bool is_inside;
80  bool is_outside;
81  vl_api_interface_index_t sw_if_index;
82  option status="in_progress";
83 };
84 
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
93 */
94 autoreply define det44_add_del_map {
97  bool is_add;
98  vl_api_ip4_address_t in_addr;
100  vl_api_ip4_address_t out_addr;
102 };
103 
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
108 */
109 define det44_forward {
112  vl_api_ip4_address_t in_addr;
113 };
114 
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
121 */
122 define det44_forward_reply {
127  vl_api_ip4_address_t out_addr;
128 };
129 
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
135 */
136 define det44_reverse {
140  vl_api_ip4_address_t out_addr;
141 };
142 
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
147 */
148 define det44_reverse_reply {
151  vl_api_ip4_address_t in_addr;
152 };
153 
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
157 */
158 define det44_map_dump {
161 };
162 
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
172 */
173 define det44_map_details {
175  vl_api_ip4_address_t in_addr;
177  vl_api_ip4_address_t out_addr;
182 };
183 
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
191 */
192 autoreply define det44_close_session_out {
195  vl_api_ip4_address_t out_addr;
197  vl_api_ip4_address_t ext_addr;
199 };
200 
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
208 */
209 autoreply define det44_close_session_in {
212  vl_api_ip4_address_t in_addr;
214  vl_api_ip4_address_t ext_addr;
216 };
217 
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
222 */
223 define det44_session_dump {
226  vl_api_ip4_address_t user_addr;
227 };
228 
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
237 */
238 define det44_session_details {
241  vl_api_ip4_address_t ext_addr;
246 };
247 
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)
255 */
256 autoreply define det44_set_timeouts {
263  option status="in_progress";
264 };
265 
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
269 */
273 };
274 
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
282 */
283 define det44_get_timeouts_reply {
290  option status="in_progress";
291 };
292 
293 /*
294  * Obsolete deterministic API to be removed
295  */
296 
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
305 */
306 autoreply define nat_det_add_del_map {
309  bool is_add;
310  vl_api_ip4_address_t in_addr;
312  vl_api_ip4_address_t out_addr;
314  option deprecated;
315 };
316 
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
321 */
322 define nat_det_forward {
325  vl_api_ip4_address_t in_addr;
326  option deprecated;
327 };
328 
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
335 */
336 define nat_det_forward_reply {
341  vl_api_ip4_address_t out_addr;
342  option deprecated;
343 };
344 
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
350 */
351 define nat_det_reverse {
355  vl_api_ip4_address_t out_addr;
356  option deprecated;
357 };
358 
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
363 */
364 define nat_det_reverse_reply {
367  vl_api_ip4_address_t in_addr;
368  option deprecated;
369 };
370 
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
374 */
375 define nat_det_map_dump {
378  option deprecated;
379 };
380 
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
390 */
391 define nat_det_map_details {
393  vl_api_ip4_address_t in_addr;
395  vl_api_ip4_address_t out_addr;
400  option deprecated;
401 };
402 
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
410 */
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 deprecated;
419 };
420 
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
428 */
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 deprecated;
437 };
438 
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
443 */
444 define nat_det_session_dump {
447  vl_api_ip4_address_t user_addr;
448  option deprecated;
449 };
450 
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
459 */
460 define nat_det_session_details {
463  vl_api_ip4_address_t ext_addr;
468  option deprecated;
469 };
vl_api_ip4_address_t ext_addr
Definition: det44.api:434
vl_api_ip4_address_t out_addr
Definition: det44.api:341
vl_api_ip4_address_t out_addr
Definition: det44.api:312
vl_api_ip4_address_t ext_addr
Definition: det44.api:241
vl_api_ip4_address_t in_addr
Definition: det44.api:175
vl_api_ip4_address_t out_addr
Definition: det44.api:100
vl_api_ip4_address_t in_addr
Definition: det44.api:212
vl_api_ip4_address_t out_addr
Definition: det44.api:177
unsigned char u8
Definition: types.h:56
vl_api_ip4_address_t ext_addr
Definition: det44.api:197
vl_api_ip4_address_t out_addr
Definition: det44.api:355
vl_api_ip4_address_t in_addr
Definition: det44.api:151
nat_timeouts_t det44_get_timeouts()
Definition: det44.c:181
unsigned int u32
Definition: types.h:88
vl_api_interface_index_t sw_if_index
Definition: det44.api:58
vl_api_ip4_address_t ext_addr
Definition: det44.api:463
vl_api_ip4_address_t ext_addr
Definition: det44.api:214
unsigned short u16
Definition: types.h:57
vl_api_ip4_address_t in_addr
Definition: det44.api:112
vl_api_ip4_address_t out_addr
Definition: det44.api:195
vl_api_ip4_address_t in_addr
Definition: det44.api:432
vl_api_interface_index_t sw_if_index
Definition: det44.api:81
vl_api_ip4_address_t ext_addr
Definition: det44.api:416
vl_api_ip4_address_t out_addr
Definition: det44.api:127
vl_api_interface_index_t sw_if_index
Definition: det44.api:42
vl_api_ip4_address_t out_addr
Definition: det44.api:414
vl_api_ip4_address_t in_addr
Definition: det44.api:325
int det44_set_timeouts(nat_timeouts_t *timeouts)
Definition: det44.c:166
signed int i32
Definition: types.h:77
option version
Definition: det44.api:16
vl_api_ip4_address_t in_addr
Definition: det44.api:393
vl_api_ip4_address_t in_addr
Definition: det44.api:98
vl_api_ip4_address_t out_addr
Definition: det44.api:140
vl_api_ip4_address_t user_addr
Definition: det44.api:447
vl_api_ip4_address_t in_addr
Definition: det44.api:367
vl_api_ip4_address_t in_addr
Definition: det44.api:310
vl_api_ip4_address_t out_addr
Definition: det44.api:395
vl_api_ip4_address_t user_addr
Definition: det44.api:226