FD.io VPP  v21.06-1-gbb7418cf9
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/lib/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  option status="in_progress";
43 };
44 
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
51 */
52 autoreply define det44_interface_add_del_feature {
55  bool is_add;
56  bool is_inside;
57  vl_api_interface_index_t sw_if_index;
58  option status="in_progress";
59 };
60 
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
64 */
65 define det44_interface_dump {
68  option status="in_progress";
69 };
70 
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
75 */
76 define det44_interface_details {
78  bool is_inside;
79  bool is_outside;
80  vl_api_interface_index_t sw_if_index;
81  option status="in_progress";
82 };
83 
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
92 */
93 autoreply define det44_add_del_map {
96  bool is_add;
97  vl_api_ip4_address_t in_addr;
99  vl_api_ip4_address_t out_addr;
101 };
102 
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
107 */
108 define det44_forward {
111  vl_api_ip4_address_t in_addr;
112 };
113 
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
120 */
121 define det44_forward_reply {
126  vl_api_ip4_address_t out_addr;
127 };
128 
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
134 */
135 define det44_reverse {
139  vl_api_ip4_address_t out_addr;
140 };
141 
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
146 */
147 define det44_reverse_reply {
150  vl_api_ip4_address_t in_addr;
151 };
152 
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
156 */
157 define det44_map_dump {
160 };
161 
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
171 */
172 define det44_map_details {
174  vl_api_ip4_address_t in_addr;
176  vl_api_ip4_address_t out_addr;
181 };
182 
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
190 */
191 autoreply define det44_close_session_out {
194  vl_api_ip4_address_t out_addr;
196  vl_api_ip4_address_t ext_addr;
198 };
199 
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
207 */
208 autoreply define det44_close_session_in {
211  vl_api_ip4_address_t in_addr;
213  vl_api_ip4_address_t ext_addr;
215 };
216 
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
221 */
222 define det44_session_dump {
225  vl_api_ip4_address_t user_addr;
226 };
227 
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
236 */
237 define det44_session_details {
240  vl_api_ip4_address_t ext_addr;
245 };
246 
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)
254 */
255 autoreply define det44_set_timeouts {
262  option status="in_progress";
263 };
264 
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
268 */
272 };
273 
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
281 */
282 define det44_get_timeouts_reply {
289  option status="in_progress";
290 };
291 
292 /*
293  * Obsolete deterministic API to be removed
294  */
295 
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
304 */
305 autoreply define nat_det_add_del_map {
308  bool is_add;
309  vl_api_ip4_address_t in_addr;
311  vl_api_ip4_address_t out_addr;
313  option deprecated;
314 };
315 
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
320 */
321 define nat_det_forward {
324  vl_api_ip4_address_t in_addr;
325  option deprecated;
326 };
327 
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
334 */
335 define nat_det_forward_reply {
340  vl_api_ip4_address_t out_addr;
341  option deprecated;
342 };
343 
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
349 */
350 define nat_det_reverse {
354  vl_api_ip4_address_t out_addr;
355  option deprecated;
356 };
357 
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
362 */
363 define nat_det_reverse_reply {
366  vl_api_ip4_address_t in_addr;
367  option deprecated;
368 };
369 
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
373 */
374 define nat_det_map_dump {
377  option deprecated;
378 };
379 
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
389 */
390 define nat_det_map_details {
392  vl_api_ip4_address_t in_addr;
394  vl_api_ip4_address_t out_addr;
399  option deprecated;
400 };
401 
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
409 */
410 autoreply define nat_det_close_session_out {
413  vl_api_ip4_address_t out_addr;
415  vl_api_ip4_address_t ext_addr;
417  option deprecated;
418 };
419 
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
427 */
428 autoreply define nat_det_close_session_in {
431  vl_api_ip4_address_t in_addr;
433  vl_api_ip4_address_t ext_addr;
435  option deprecated;
436 };
437 
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
442 */
443 define nat_det_session_dump {
446  vl_api_ip4_address_t user_addr;
447  option deprecated;
448 };
449 
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
458 */
459 define nat_det_session_details {
462  vl_api_ip4_address_t ext_addr;
467  option deprecated;
468 };
vl_api_ip4_address_t ext_addr
Definition: det44.api:433
vl_api_ip4_address_t out_addr
Definition: det44.api:340
vl_api_ip4_address_t out_addr
Definition: det44.api:311
vl_api_ip4_address_t ext_addr
Definition: det44.api:240
vl_api_ip4_address_t in_addr
Definition: det44.api:174
vl_api_ip4_address_t out_addr
Definition: det44.api:99
vl_api_ip4_address_t in_addr
Definition: det44.api:211
vl_api_ip4_address_t out_addr
Definition: det44.api:176
unsigned char u8
Definition: types.h:56
vl_api_ip4_address_t ext_addr
Definition: det44.api:196
vl_api_ip4_address_t out_addr
Definition: det44.api:354
unsigned int u32
Definition: types.h:88
vl_api_ip4_address_t in_addr
Definition: det44.api:150
nat_timeouts_t det44_get_timeouts()
Definition: det44.c:181
vl_api_interface_index_t sw_if_index
Definition: det44.api:57
vl_api_ip4_address_t ext_addr
Definition: det44.api:462
vl_api_ip4_address_t ext_addr
Definition: det44.api:213
unsigned short u16
Definition: types.h:57
vl_api_ip4_address_t in_addr
Definition: det44.api:111
vl_api_ip4_address_t out_addr
Definition: det44.api:194
vl_api_ip4_address_t in_addr
Definition: det44.api:431
vl_api_interface_index_t sw_if_index
Definition: det44.api:80
vl_api_ip4_address_t ext_addr
Definition: det44.api:415
vl_api_ip4_address_t out_addr
Definition: det44.api:126
vl_api_ip4_address_t out_addr
Definition: det44.api:413
vl_api_ip4_address_t in_addr
Definition: det44.api:324
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:392
vl_api_ip4_address_t in_addr
Definition: det44.api:97
vl_api_ip4_address_t out_addr
Definition: det44.api:139
vl_api_ip4_address_t user_addr
Definition: det44.api:446
vl_api_ip4_address_t in_addr
Definition: det44.api:366
vl_api_ip4_address_t in_addr
Definition: det44.api:309
vl_api_ip4_address_t out_addr
Definition: det44.api:394
vl_api_ip4_address_t user_addr
Definition: det44.api:225