api: clean up use of deprecated flag
[vpp.git] / src / plugins / nat / det44 / det44.api
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 {
37   u32 client_index;
38   u32 context;
39   u32 inside_vrf;
40   u32 outside_vrf;
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 {
54   u32 client_index;
55   u32 context;
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 {
67   u32 client_index;
68   u32 context;
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 {
78   u32 context;
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 {
95   u32 client_index;
96   u32 context;
97   bool is_add;
98   vl_api_ip4_address_t in_addr;
99   u8 in_plen;
100   vl_api_ip4_address_t out_addr;
101   u8 out_plen;
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 {
110   u32 client_index;
111   u32 context;
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 {
123   u32 context;
124   i32 retval;
125   u16 out_port_lo;
126   u16 out_port_hi;
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 {
137   u32 client_index;
138   u32 context;
139   u16 out_port;
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 {
149   u32 context;
150   i32 retval;
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 {
159   u32 client_index;
160   u32 context;
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 {
174   u32 context;
175   vl_api_ip4_address_t in_addr;
176   u8 in_plen;
177   vl_api_ip4_address_t out_addr;
178   u8 out_plen;
179   u32 sharing_ratio;
180   u16 ports_per_host;
181   u32 ses_num;
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 {
193   u32 client_index;
194   u32 context;
195   vl_api_ip4_address_t out_addr;
196   u16 out_port;
197   vl_api_ip4_address_t ext_addr;
198   u16 ext_port;
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 {
210   u32 client_index;
211   u32 context;
212   vl_api_ip4_address_t in_addr;
213   u16 in_port;
214   vl_api_ip4_address_t ext_addr;
215   u16 ext_port;
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 {
224   u32 client_index;
225   u32 context;
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 {
239   u32 context;
240   u16 in_port;
241   vl_api_ip4_address_t ext_addr;
242   u16 ext_port;
243   u16 out_port;
244   u8 state;
245   u32 expire;
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 {
257   u32 client_index;
258   u32 context;
259   u32 udp;
260   u32 tcp_established;
261   u32 tcp_transitory;
262   u32 icmp;
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 */
270 define det44_get_timeouts {
271   u32 client_index;
272   u32 context;
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 {
284   u32 context;
285   i32 retval;
286   u32 udp;
287   u32 tcp_established;
288   u32 tcp_transitory;
289   u32 icmp;
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 {
307   u32 client_index;
308   u32 context;
309   bool is_add;
310   vl_api_ip4_address_t in_addr;
311   u8 in_plen;
312   vl_api_ip4_address_t out_addr;
313   u8 out_plen;
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 {
323   u32 client_index;
324   u32 context;
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 {
337   u32 context;
338   i32 retval;
339   u16 out_port_lo;
340   u16 out_port_hi;
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 {
352   u32 client_index;
353   u32 context;
354   u16 out_port;
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 {
365   u32 context;
366   i32 retval;
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 {
376   u32 client_index;
377   u32 context;
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 {
392   u32 context;
393   vl_api_ip4_address_t in_addr;
394   u8 in_plen;
395   vl_api_ip4_address_t out_addr;
396   u8 out_plen;
397   u32 sharing_ratio;
398   u16 ports_per_host;
399   u32 ses_num;
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 {
412   u32 client_index;
413   u32 context;
414   vl_api_ip4_address_t out_addr;
415   u16 out_port;
416   vl_api_ip4_address_t ext_addr;
417   u16 ext_port;
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 {
430   u32 client_index;
431   u32 context;
432   vl_api_ip4_address_t in_addr;
433   u16 in_port;
434   vl_api_ip4_address_t ext_addr;
435   u16 ext_port;
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 {
445   u32 client_index;
446   u32 context;
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 {
461   u32 context;
462   u16 in_port;
463   vl_api_ip4_address_t ext_addr;
464   u16 ext_port;
465   u16 out_port;
466   u8 state;
467   u32 expire;
468   option deprecated;
469 };