blob: 26346eaa466cf5c6f990f813a1d42332d5faebcd [file] [log] [blame]
Dave Barach68b0fb02017-02-28 15:15:56 -05001/*
Vratko Polak6fdd7a52020-04-06 15:01:46 +02002 * Copyright (c) 2015-2020 Cisco and/or its affiliates.
Dave Barach68b0fb02017-02-28 15:15:56 -05003 * 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 */
Dave Barach0d056e52017-09-28 15:11:16 -040015
Steven Luongc4b5d102024-07-30 13:44:01 -070016option version = "4.0.1";
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010017
18import "vnet/interface_types.api";
19import "vnet/ip/ip_types.api";
20
21
Steven Luongc4b5d102024-07-30 13:44:01 -070022typedef sdl_rule
23{
24 vl_api_prefix_t lcl;
25 u32 action_index;
26 string tag[64];
27};
28
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010029enum transport_proto : u8
30{
31 TRANSPORT_PROTO_API_TCP,
32 TRANSPORT_PROTO_API_UDP,
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010033 TRANSPORT_PROTO_API_NONE,
34 TRANSPORT_PROTO_API_TLS,
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010035 TRANSPORT_PROTO_API_QUIC,
36};
Dave Barach0d056e52017-09-28 15:11:16 -040037
Steven Luongc4b5d102024-07-30 13:44:01 -070038enum rt_backend_engine : u8
39{
40 RT_BACKEND_ENGINE_API_DISABLE = 0,
41 RT_BACKEND_ENGINE_API_RULE_TABLE,
42 RT_BACKEND_ENGINE_API_NONE,
43 RT_BACKEND_ENGINE_API_SDL,
44};
45
Florin Coras458089b2019-08-21 16:20:44 -070046/** \brief Application attach to session layer
47 @param client_index - opaque cookie to identify the sender
48 @param context - sender context, to match reply w/ request
49 @param options - segment size, fifo sizes, etc.
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010050 @param namespace_id - string
Florin Coras458089b2019-08-21 16:20:44 -070051*/
52 define app_attach {
53 u32 client_index;
54 u32 context;
Florin Coras9845c202020-04-28 01:54:22 +000055 u64 options[18];
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010056 string namespace_id[];
Florin Coras458089b2019-08-21 16:20:44 -070057 };
58
Vratko Polak6fdd7a52020-04-06 15:01:46 +020059/** \brief Application attach reply
Florin Coras458089b2019-08-21 16:20:44 -070060 @param context - sender context, to match reply w/ request
61 @param retval - return code for the request
62 @param app_mq - app message queue
63 @param vpp_ctrl_mq - vpp message queue for control events that should
64 be handled in main thread, i.e., bind/connect
65 @param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
66 @param app_index - index of the newly created app
67 @param n_fds - number of fds exchanged
68 @param fd_flags - set of flags that indicate which fds are to be expected
69 over the socket (set only if socket transport available)
70 @param segment_size - size of first shm segment
Florin Coras458089b2019-08-21 16:20:44 -070071 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010072 @param segment_name - name of segment client needs to attach to
Florin Coras458089b2019-08-21 16:20:44 -070073*/
74define app_attach_reply {
75 u32 context;
76 i32 retval;
77 u64 app_mq;
78 u64 vpp_ctrl_mq;
79 u8 vpp_ctrl_mq_thread;
80 u32 app_index;
81 u8 n_fds;
82 u8 fd_flags;
83 u32 segment_size;
Florin Coras458089b2019-08-21 16:20:44 -070084 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010085 string segment_name[];
Florin Coras458089b2019-08-21 16:20:44 -070086};
87
Vratko Polak6fdd7a52020-04-06 15:01:46 +020088/** \brief Application detach from session layer
Florin Coras888d9f02020-04-02 23:00:13 +000089 @param client_index - opaque cookie to identify the sender
90 @param context - sender context, to match reply w/ request
91*/
92autoreply define application_detach {
93 u32 client_index;
94 u32 context;
95};
96
Nathan Skrzypczak79f89532019-09-13 11:08:13 +020097/** \brief Add certificate and key
98 @param client_index - opaque cookie to identify the sender
99 @param context - sender context, to match reply w/ request
100 @param engine - crypto engine
101 @param cert_len - cert length (comes first)
102 @param certkey_len - cert and key length
103 @param certkey - cert & key data (due to API limitation)
104*/
105define app_add_cert_key_pair {
106 u32 client_index;
107 u32 context;
108 u16 cert_len;
109 u16 certkey_len;
110 u8 certkey[certkey_len];
111};
112
113/** \brief Add certificate and key
114 @param context - sender context, to match reply w/ request
115 @param retval - return code for the request
116 @param index - index in certificate store
117*/
118define app_add_cert_key_pair_reply {
119 u32 context;
120 i32 retval;
121 u32 index;
122};
123
124/** \brief Delete certificate and key
125 @param client_index - opaque cookie to identify the sender
126 @param context - sender context, to match reply w/ request
127 @param index - index in certificate store
128*/
129autoreply define app_del_cert_key_pair {
130 u32 client_index;
131 u32 context;
132 u32 index;
133};
134
Florin Coras15531972018-08-12 23:50:53 -0700135/** \brief add/del application worker
136 @param client_index - opaque cookie to identify the sender
137 client to vpp direction only
138 @param context - sender context, to match reply w/ request
Florin Corasc1f5a432018-11-20 11:31:26 -0800139 @param app_index - application index
Florin Coras15531972018-08-12 23:50:53 -0700140 @param wrk_index - worker index, if a delete
141 @param is_add - set if an add
142*/
143define app_worker_add_del
144{
145 u32 client_index;
146 u32 context;
Florin Corasc1f5a432018-11-20 11:31:26 -0800147 u32 app_index;
Florin Coras15531972018-08-12 23:50:53 -0700148 u32 wrk_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100149 bool is_add [default=true];
Florin Coras15531972018-08-12 23:50:53 -0700150};
151
152/** \brief Reply for app worker add/del
153 @param context - returned sender context, to match reply w/ request
154 @param retval - return code
155 @param wrk_index - worker index, if add
156 @param app_event_queue_address - vpp event queue address of new worker
157 @param n_fds - number of fds exchanged
158 @param fd_flags - set of flags that indicate which fds are to be expected
Florin Coras458089b2019-08-21 16:20:44 -0700159 over the socket (set only if socket transport available)
Florin Corasfa76a762018-11-29 12:40:10 -0800160 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100161 @param is_add - add if non zero, else delete
162 @param segment_name - name of segment client needs to attach to
Florin Coras15531972018-08-12 23:50:53 -0700163*/
164define app_worker_add_del_reply
165{
166 u32 context;
167 i32 retval;
168 u32 wrk_index;
169 u64 app_event_queue_address;
170 u8 n_fds;
171 u8 fd_flags;
Florin Corasfa76a762018-11-29 12:40:10 -0800172 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100173 bool is_add [default=true];
174 string segment_name[];
Florin Coras15531972018-08-12 23:50:53 -0700175};
176
Florin Corase04c2992017-03-01 08:17:34 -0800177/** \brief enable/disable session layer
178 @param client_index - opaque cookie to identify the sender
179 client to vpp direction only
180 @param context - sender context, to match reply w/ request
181 @param is_enable - disable session layer if 0, enable otherwise
182*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400183autoreply define session_enable_disable {
Steven Luongc4b5d102024-07-30 13:44:01 -0700184 option deprecated;
Florin Corase04c2992017-03-01 08:17:34 -0800185 u32 client_index;
186 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100187 bool is_enable [default=true];
Florin Corase04c2992017-03-01 08:17:34 -0800188};
189
Steven Luongc4b5d102024-07-30 13:44:01 -0700190autoreply define session_enable_disable_v2 {
191 u32 client_index;
192 u32 context;
193 vl_api_rt_backend_engine_t rt_engine_type;
194};
195
Nathan Skrzypczak7b3a3df2021-07-28 14:09:50 +0200196/** \brief enable/disable session layer socket api
197 @param client_index - opaque cookie to identify the sender
198 client to vpp direction only
199 @param context - sender context, to match reply w/ request
200 @param is_enable - disable session layer if 0, enable otherwise
201*/
202autoreply define session_sapi_enable_disable {
203 u32 client_index;
204 u32 context;
205 bool is_enable [default=true];
206};
207
Florin Corascea194d2017-10-02 00:18:51 -0700208/** \brief add/del application namespace
209 @param client_index - opaque cookie to identify the sender
210 client to vpp direction only
211 @param context - sender context, to match reply w/ request
Florin Coras64424012019-03-02 10:47:47 -0800212 @param secret - secret shared between app and vpp
Florin Corascea194d2017-10-02 00:18:51 -0700213 @param sw_if_index - local interface that "supports" namespace. Set to
Florin Coras64424012019-03-02 10:47:47 -0800214 ~0 if no preference
215 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
216 if sw_if_index set.
217 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
218 if sw_if_index set.
Florin Corascea194d2017-10-02 00:18:51 -0700219 @param namespace_id - namespace id
220*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800221define app_namespace_add_del {
Florin Coras7cb471a2021-07-23 08:39:26 -0700222 option deprecated;
Florin Corascea194d2017-10-02 00:18:51 -0700223 u32 client_index;
224 u32 context;
225 u64 secret;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400226 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Florin Corascea194d2017-10-02 00:18:51 -0700227 u32 ip4_fib_id;
228 u32 ip6_fib_id;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100229 string namespace_id[];
Florin Corascea194d2017-10-02 00:18:51 -0700230};
231
Florin Coras7cb471a2021-07-23 08:39:26 -0700232/** \brief add/del application namespace
233 @param client_index - opaque cookie to identify the sender
234 client to vpp direction only
235 @param context - sender context, to match reply w/ request
236 @param secret - secret shared between app and vpp
237 @param sw_if_index - local interface that "supports" namespace. Set to
238 ~0 if no preference
239 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
240 if sw_if_index set.
241 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
242 if sw_if_index set.
243 @param namespace_id - namespace id
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200244 @param sock_name - socket name (path, abstract socket name)
245*/
246define app_namespace_add_del_v4 {
247 option deprecated;
248 u32 client_index;
249 u32 context;
250 u64 secret;
251 bool is_add [default=true];
252 vl_api_interface_index_t sw_if_index [default=0xffffffff];
253 u32 ip4_fib_id;
254 u32 ip6_fib_id;
255 string namespace_id[64];
256 string sock_name[];
257};
258
259/** \brief Reply for app namespace add/del
260 @param context - returned sender context, to match reply w/ request
261 @param retval - return code
262 @param appns_index - app namespace index
263*/
264define app_namespace_add_del_v4_reply
265{
266 u32 context;
267 i32 retval;
268 u32 appns_index;
269};
270
271/** \brief add/del application namespace
272 @param client_index - opaque cookie to identify the sender
273 client to vpp direction only
274 @param context - sender context, to match reply w/ request
275 @param secret - secret shared between app and vpp
276 @param sw_if_index - local interface that "supports" namespace. Set to
277 ~0 if no preference
278 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
279 if sw_if_index set.
280 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
281 if sw_if_index set.
282 @param namespace_id - namespace id
Florin Coras7cb471a2021-07-23 08:39:26 -0700283 @param netns - linux net namespace
284*/
285define app_namespace_add_del_v2 {
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200286 option deprecated;
Florin Coras7cb471a2021-07-23 08:39:26 -0700287 u32 client_index;
288 u32 context;
289 u64 secret;
290 vl_api_interface_index_t sw_if_index [default=0xffffffff];
291 u32 ip4_fib_id;
292 u32 ip6_fib_id;
293 string namespace_id[64];
294 string netns[64];
295};
296
Nathan Skrzypczak1a9e2f92021-07-28 19:35:08 +0200297/** \brief add/del application namespace
298 @param client_index - opaque cookie to identify the sender
299 client to vpp direction only
300 @param context - sender context, to match reply w/ request
301 @param secret - secret shared between app and vpp
302 @param sw_if_index - local interface that "supports" namespace. Set to
303 ~0 if no preference
304 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
305 if sw_if_index set.
306 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
307 if sw_if_index set.
308 @param namespace_id - namespace id
309 @param netns - linux net namespace
310 @param sock_name - socket name (path, abstract socket name)
311*/
312define app_namespace_add_del_v3 {
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200313 option deprecated;
Nathan Skrzypczak1a9e2f92021-07-28 19:35:08 +0200314 u32 client_index;
315 u32 context;
316 u64 secret;
317 bool is_add [default=true];
318 vl_api_interface_index_t sw_if_index [default=0xffffffff];
319 u32 ip4_fib_id;
320 u32 ip6_fib_id;
321 string namespace_id[64];
322 string netns[64];
323 string sock_name[];
324};
325
Florin Coras6e8c6672017-11-10 09:03:54 -0800326/** \brief Reply for app namespace add/del
327 @param context - returned sender context, to match reply w/ request
328 @param retval - return code
329 @param appns_index - app namespace index
330*/
331define app_namespace_add_del_reply
332{
Florin Coras7cb471a2021-07-23 08:39:26 -0700333 option deprecated;
334 u32 context;
335 i32 retval;
336 u32 appns_index;
337};
338
339/** \brief Reply for app namespace add/del
340 @param context - returned sender context, to match reply w/ request
341 @param retval - return code
342 @param appns_index - app namespace index
343*/
344define app_namespace_add_del_v2_reply
345{
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200346 option deprecated;
Florin Coras6e8c6672017-11-10 09:03:54 -0800347 u32 context;
348 i32 retval;
349 u32 appns_index;
350};
351
Nathan Skrzypczak1a9e2f92021-07-28 19:35:08 +0200352define app_namespace_add_del_v3_reply
353{
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200354 option deprecated;
Nathan Skrzypczak1a9e2f92021-07-28 19:35:08 +0200355 u32 context;
356 i32 retval;
357 u32 appns_index;
358};
359
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100360enum session_rule_scope {
361 SESSION_RULE_SCOPE_API_GLOBAL = 0,
362 SESSION_RULE_SCOPE_API_LOCAL = 1,
363 SESSION_RULE_SCOPE_API_BOTH = 2,
364};
365
Florin Coras1c710452017-10-17 00:03:13 -0700366/** \brief add/del session rule
367 @param client_index - opaque cookie to identify the sender
368 client to vpp direction only
369 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100370 @param transport_proto - transport protocol
Florin Coras1c710452017-10-17 00:03:13 -0700371 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
372 @param lcl_ip - local ip
373 @param lcl_plen - local prefix length
374 @param rmt_ip - remote ip
375 @param rmt_ple - remote prefix length
376 @param lcl_port - local port
377 @param rmt_port - remote port
Florin Coras64424012019-03-02 10:47:47 -0800378 @param action_index - the only action defined now is forward to
379 application with index action_index
380 @param is_add - flag to indicate if add or del
381 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100382 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800383 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100384 @param tag - tag
Florin Coras1c710452017-10-17 00:03:13 -0700385*/
386autoreply define session_rule_add_del {
387 u32 client_index;
388 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100389 vl_api_transport_proto_t transport_proto;
390 vl_api_prefix_t lcl;
391 vl_api_prefix_t rmt;
Florin Coras1c710452017-10-17 00:03:13 -0700392 u16 lcl_port;
393 u16 rmt_port;
394 u32 action_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100395 bool is_add [default=true];
Florin Coras1c710452017-10-17 00:03:13 -0700396 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100397 vl_api_session_rule_scope_t scope;
398 string tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700399};
400
Florin Coras6c36f532017-11-03 18:32:34 -0700401/** \brief Dump session rules
402 @param client_index - opaque cookie to identify the sender
403 @param context - sender context, to match reply w/ request
404 */
405define session_rules_dump
406{
407 u32 client_index;
408 u32 context;
409};
410
411/** \brief Session rules details
Florin Coras64424012019-03-02 10:47:47 -0800412 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100413 @param transport_proto - transport protocol
Florin Coras6c36f532017-11-03 18:32:34 -0700414 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
415 @param lcl_ip - local ip
416 @param lcl_plen - local prefix length
417 @param rmt_ip - remote ip
418 @param rmt_ple - remote prefix length
419 @param lcl_port - local port
420 @param rmt_port - remote port
421 @param action_index - the only action defined now is forward to
Florin Coras64424012019-03-02 10:47:47 -0800422 application with index action_index
423 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100424 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800425 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100426 @param tag - tag
Florin Coras6c36f532017-11-03 18:32:34 -0700427 */
428define session_rules_details
429{
430 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100431 vl_api_transport_proto_t transport_proto;
432 vl_api_prefix_t lcl;
433 vl_api_prefix_t rmt;
Florin Coras6c36f532017-11-03 18:32:34 -0700434 u16 lcl_port;
435 u16 rmt_port;
436 u32 action_index;
437 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100438 vl_api_session_rule_scope_t scope;
439 string tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700440};
441
Steven Luongc4b5d102024-07-30 13:44:01 -0700442autoreply define session_sdl_add_del {
443 u32 client_index;
444 u32 context;
445 u32 appns_index;
446 bool is_add;
447 u32 count;
448 vl_api_sdl_rule_t r[count];
449};
450
451/** \brief Dump session sdl
452 @param client_index - opaque cookie to identify the sender
453 @param context - sender context, to match reply w/ request
454 */
455define session_sdl_dump
456{
457 u32 client_index;
458 u32 context;
459};
460
461/** \brief Session sdl details
462 @param context - sender context, to match reply w/ request
463 @param lcl - local prefix
464 @param action_index - the only action defined now is forward to
465 application with index action_index
466 @param appns_index - application namespace where rule is to be applied to
467 @param tag - tag
468 */
469define session_sdl_details
470{
471 u32 context;
472 vl_api_prefix_t lcl;
473 u32 action_index;
474 u32 appns_index;
475 string tag[64];
476};
477
Dave Barach68b0fb02017-02-28 15:15:56 -0500478/*
479 * Local Variables:
480 * eval: (c-set-style "gnu")
481 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400482 */