blob: d2a942fb68b03661277f9320731038f6524a8c7b [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
Florin Corasa5a9efd2021-01-05 17:03:29 -080016option version = "4.0.0";
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010017
18import "vnet/interface_types.api";
19import "vnet/ip/ip_types.api";
20
21
22enum transport_proto : u8
23{
24 TRANSPORT_PROTO_API_TCP,
25 TRANSPORT_PROTO_API_UDP,
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010026 TRANSPORT_PROTO_API_NONE,
27 TRANSPORT_PROTO_API_TLS,
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010028 TRANSPORT_PROTO_API_QUIC,
29};
Dave Barach0d056e52017-09-28 15:11:16 -040030
Florin Coras458089b2019-08-21 16:20:44 -070031/** \brief Application attach to session layer
32 @param client_index - opaque cookie to identify the sender
33 @param context - sender context, to match reply w/ request
34 @param options - segment size, fifo sizes, etc.
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010035 @param namespace_id - string
Florin Coras458089b2019-08-21 16:20:44 -070036*/
37 define app_attach {
38 u32 client_index;
39 u32 context;
Florin Coras9845c202020-04-28 01:54:22 +000040 u64 options[18];
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010041 string namespace_id[];
Florin Coras458089b2019-08-21 16:20:44 -070042 };
43
Vratko Polak6fdd7a52020-04-06 15:01:46 +020044/** \brief Application attach reply
Florin Coras458089b2019-08-21 16:20:44 -070045 @param context - sender context, to match reply w/ request
46 @param retval - return code for the request
47 @param app_mq - app message queue
48 @param vpp_ctrl_mq - vpp message queue for control events that should
49 be handled in main thread, i.e., bind/connect
50 @param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
51 @param app_index - index of the newly created app
52 @param n_fds - number of fds exchanged
53 @param fd_flags - set of flags that indicate which fds are to be expected
54 over the socket (set only if socket transport available)
55 @param segment_size - size of first shm segment
Florin Coras458089b2019-08-21 16:20:44 -070056 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010057 @param segment_name - name of segment client needs to attach to
Florin Coras458089b2019-08-21 16:20:44 -070058*/
59define app_attach_reply {
60 u32 context;
61 i32 retval;
62 u64 app_mq;
63 u64 vpp_ctrl_mq;
64 u8 vpp_ctrl_mq_thread;
65 u32 app_index;
66 u8 n_fds;
67 u8 fd_flags;
68 u32 segment_size;
Florin Coras458089b2019-08-21 16:20:44 -070069 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010070 string segment_name[];
Florin Coras458089b2019-08-21 16:20:44 -070071};
72
Vratko Polak6fdd7a52020-04-06 15:01:46 +020073/** \brief Application detach from session layer
Florin Coras888d9f02020-04-02 23:00:13 +000074 @param client_index - opaque cookie to identify the sender
75 @param context - sender context, to match reply w/ request
76*/
77autoreply define application_detach {
78 u32 client_index;
79 u32 context;
80};
81
Nathan Skrzypczak79f89532019-09-13 11:08:13 +020082/** \brief Add certificate and key
83 @param client_index - opaque cookie to identify the sender
84 @param context - sender context, to match reply w/ request
85 @param engine - crypto engine
86 @param cert_len - cert length (comes first)
87 @param certkey_len - cert and key length
88 @param certkey - cert & key data (due to API limitation)
89*/
90define app_add_cert_key_pair {
91 u32 client_index;
92 u32 context;
93 u16 cert_len;
94 u16 certkey_len;
95 u8 certkey[certkey_len];
96};
97
98/** \brief Add certificate and key
99 @param context - sender context, to match reply w/ request
100 @param retval - return code for the request
101 @param index - index in certificate store
102*/
103define app_add_cert_key_pair_reply {
104 u32 context;
105 i32 retval;
106 u32 index;
107};
108
109/** \brief Delete certificate and key
110 @param client_index - opaque cookie to identify the sender
111 @param context - sender context, to match reply w/ request
112 @param index - index in certificate store
113*/
114autoreply define app_del_cert_key_pair {
115 u32 client_index;
116 u32 context;
117 u32 index;
118};
119
Florin Coras371ca502018-02-21 12:07:41 -0800120/** \brief Application add TLS certificate
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200121 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800122 @param client_index - opaque cookie to identify the sender
123 @param context - sender context, to match reply w/ request
124 @param cert_len - certificate length
125 @param cert - certificate as a string
126*/
127autoreply define application_tls_cert_add {
Florin Corasa5a9efd2021-01-05 17:03:29 -0800128 option deprecated="to be removed post 21.06";
Florin Coras371ca502018-02-21 12:07:41 -0800129 u32 client_index;
130 u32 context;
131 u32 app_index;
132 u16 cert_len;
133 u8 cert[cert_len];
134};
135
136/** \brief Application add TLS key
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200137 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800138 @param client_index - opaque cookie to identify the sender
139 @param context - sender context, to match reply w/ request
140 @param key_len - certificate length
141 @param key - PEM encoded key as a string
142*/
143autoreply define application_tls_key_add {
Florin Corasa5a9efd2021-01-05 17:03:29 -0800144 option deprecated="to be removed post 21.06";
Florin Coras371ca502018-02-21 12:07:41 -0800145 u32 client_index;
146 u32 context;
147 u32 app_index;
148 u16 key_len;
149 u8 key[key_len];
150};
151
Florin Coras15531972018-08-12 23:50:53 -0700152/** \brief add/del application worker
153 @param client_index - opaque cookie to identify the sender
154 client to vpp direction only
155 @param context - sender context, to match reply w/ request
Florin Corasc1f5a432018-11-20 11:31:26 -0800156 @param app_index - application index
Florin Coras15531972018-08-12 23:50:53 -0700157 @param wrk_index - worker index, if a delete
158 @param is_add - set if an add
159*/
160define app_worker_add_del
161{
162 u32 client_index;
163 u32 context;
Florin Corasc1f5a432018-11-20 11:31:26 -0800164 u32 app_index;
Florin Coras15531972018-08-12 23:50:53 -0700165 u32 wrk_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100166 bool is_add [default=true];
Florin Coras15531972018-08-12 23:50:53 -0700167};
168
169/** \brief Reply for app worker add/del
170 @param context - returned sender context, to match reply w/ request
171 @param retval - return code
172 @param wrk_index - worker index, if add
173 @param app_event_queue_address - vpp event queue address of new worker
174 @param n_fds - number of fds exchanged
175 @param fd_flags - set of flags that indicate which fds are to be expected
Florin Coras458089b2019-08-21 16:20:44 -0700176 over the socket (set only if socket transport available)
Florin Corasfa76a762018-11-29 12:40:10 -0800177 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100178 @param is_add - add if non zero, else delete
179 @param segment_name - name of segment client needs to attach to
Florin Coras15531972018-08-12 23:50:53 -0700180*/
181define app_worker_add_del_reply
182{
183 u32 context;
184 i32 retval;
185 u32 wrk_index;
186 u64 app_event_queue_address;
187 u8 n_fds;
188 u8 fd_flags;
Florin Corasfa76a762018-11-29 12:40:10 -0800189 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100190 bool is_add [default=true];
191 string segment_name[];
Florin Coras15531972018-08-12 23:50:53 -0700192};
193
Florin Corase04c2992017-03-01 08:17:34 -0800194/** \brief enable/disable session layer
195 @param client_index - opaque cookie to identify the sender
196 client to vpp direction only
197 @param context - sender context, to match reply w/ request
198 @param is_enable - disable session layer if 0, enable otherwise
199*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400200autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800201 u32 client_index;
202 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100203 bool is_enable [default=true];
Florin Corase04c2992017-03-01 08:17:34 -0800204};
205
Nathan Skrzypczak7b3a3df2021-07-28 14:09:50 +0200206/** \brief enable/disable session layer socket api
207 @param client_index - opaque cookie to identify the sender
208 client to vpp direction only
209 @param context - sender context, to match reply w/ request
210 @param is_enable - disable session layer if 0, enable otherwise
211*/
212autoreply define session_sapi_enable_disable {
213 u32 client_index;
214 u32 context;
215 bool is_enable [default=true];
216};
217
Florin Corascea194d2017-10-02 00:18:51 -0700218/** \brief add/del application namespace
219 @param client_index - opaque cookie to identify the sender
220 client to vpp direction only
221 @param context - sender context, to match reply w/ request
Florin Coras64424012019-03-02 10:47:47 -0800222 @param secret - secret shared between app and vpp
Florin Corascea194d2017-10-02 00:18:51 -0700223 @param sw_if_index - local interface that "supports" namespace. Set to
Florin Coras64424012019-03-02 10:47:47 -0800224 ~0 if no preference
225 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
226 if sw_if_index set.
227 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
228 if sw_if_index set.
Florin Corascea194d2017-10-02 00:18:51 -0700229 @param namespace_id - namespace id
230*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800231define app_namespace_add_del {
Florin Coras7cb471a2021-07-23 08:39:26 -0700232 option deprecated;
Florin Corascea194d2017-10-02 00:18:51 -0700233 u32 client_index;
234 u32 context;
235 u64 secret;
Paul Vinciguerrac0e94412020-04-28 01:12:04 -0400236 vl_api_interface_index_t sw_if_index [default=0xffffffff];
Florin Corascea194d2017-10-02 00:18:51 -0700237 u32 ip4_fib_id;
238 u32 ip6_fib_id;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100239 string namespace_id[];
Florin Corascea194d2017-10-02 00:18:51 -0700240};
241
Florin Coras7cb471a2021-07-23 08:39:26 -0700242/** \brief add/del application namespace
243 @param client_index - opaque cookie to identify the sender
244 client to vpp direction only
245 @param context - sender context, to match reply w/ request
246 @param secret - secret shared between app and vpp
247 @param sw_if_index - local interface that "supports" namespace. Set to
248 ~0 if no preference
249 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
250 if sw_if_index set.
251 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
252 if sw_if_index set.
253 @param namespace_id - namespace id
254 @param netns - linux net namespace
255*/
256define app_namespace_add_del_v2 {
257 u32 client_index;
258 u32 context;
259 u64 secret;
260 vl_api_interface_index_t sw_if_index [default=0xffffffff];
261 u32 ip4_fib_id;
262 u32 ip6_fib_id;
263 string namespace_id[64];
264 string netns[64];
265};
266
Nathan Skrzypczak1a9e2f92021-07-28 19:35:08 +0200267/** \brief add/del application namespace
268 @param client_index - opaque cookie to identify the sender
269 client to vpp direction only
270 @param context - sender context, to match reply w/ request
271 @param secret - secret shared between app and vpp
272 @param sw_if_index - local interface that "supports" namespace. Set to
273 ~0 if no preference
274 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
275 if sw_if_index set.
276 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
277 if sw_if_index set.
278 @param namespace_id - namespace id
279 @param netns - linux net namespace
280 @param sock_name - socket name (path, abstract socket name)
281*/
282define app_namespace_add_del_v3 {
283 u32 client_index;
284 u32 context;
285 u64 secret;
286 bool is_add [default=true];
287 vl_api_interface_index_t sw_if_index [default=0xffffffff];
288 u32 ip4_fib_id;
289 u32 ip6_fib_id;
290 string namespace_id[64];
291 string netns[64];
292 string sock_name[];
293};
294
Florin Coras6e8c6672017-11-10 09:03:54 -0800295/** \brief Reply for app namespace add/del
296 @param context - returned sender context, to match reply w/ request
297 @param retval - return code
298 @param appns_index - app namespace index
299*/
300define app_namespace_add_del_reply
301{
Florin Coras7cb471a2021-07-23 08:39:26 -0700302 option deprecated;
303 u32 context;
304 i32 retval;
305 u32 appns_index;
306};
307
308/** \brief Reply for app namespace add/del
309 @param context - returned sender context, to match reply w/ request
310 @param retval - return code
311 @param appns_index - app namespace index
312*/
313define app_namespace_add_del_v2_reply
314{
Florin Coras6e8c6672017-11-10 09:03:54 -0800315 u32 context;
316 i32 retval;
317 u32 appns_index;
318};
319
Nathan Skrzypczak1a9e2f92021-07-28 19:35:08 +0200320define app_namespace_add_del_v3_reply
321{
322 u32 context;
323 i32 retval;
324 u32 appns_index;
325};
326
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100327enum session_rule_scope {
328 SESSION_RULE_SCOPE_API_GLOBAL = 0,
329 SESSION_RULE_SCOPE_API_LOCAL = 1,
330 SESSION_RULE_SCOPE_API_BOTH = 2,
331};
332
Florin Coras1c710452017-10-17 00:03:13 -0700333/** \brief add/del session rule
334 @param client_index - opaque cookie to identify the sender
335 client to vpp direction only
336 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100337 @param transport_proto - transport protocol
Florin Coras1c710452017-10-17 00:03:13 -0700338 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
339 @param lcl_ip - local ip
340 @param lcl_plen - local prefix length
341 @param rmt_ip - remote ip
342 @param rmt_ple - remote prefix length
343 @param lcl_port - local port
344 @param rmt_port - remote port
Florin Coras64424012019-03-02 10:47:47 -0800345 @param action_index - the only action defined now is forward to
346 application with index action_index
347 @param is_add - flag to indicate if add or del
348 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100349 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800350 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100351 @param tag - tag
Florin Coras1c710452017-10-17 00:03:13 -0700352*/
353autoreply define session_rule_add_del {
354 u32 client_index;
355 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100356 vl_api_transport_proto_t transport_proto;
357 vl_api_prefix_t lcl;
358 vl_api_prefix_t rmt;
Florin Coras1c710452017-10-17 00:03:13 -0700359 u16 lcl_port;
360 u16 rmt_port;
361 u32 action_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100362 bool is_add [default=true];
Florin Coras1c710452017-10-17 00:03:13 -0700363 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100364 vl_api_session_rule_scope_t scope;
365 string tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700366};
367
Florin Coras6c36f532017-11-03 18:32:34 -0700368/** \brief Dump session rules
369 @param client_index - opaque cookie to identify the sender
370 @param context - sender context, to match reply w/ request
371 */
372define session_rules_dump
373{
374 u32 client_index;
375 u32 context;
376};
377
378/** \brief Session rules details
Florin Coras64424012019-03-02 10:47:47 -0800379 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100380 @param transport_proto - transport protocol
Florin Coras6c36f532017-11-03 18:32:34 -0700381 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
382 @param lcl_ip - local ip
383 @param lcl_plen - local prefix length
384 @param rmt_ip - remote ip
385 @param rmt_ple - remote prefix length
386 @param lcl_port - local port
387 @param rmt_port - remote port
388 @param action_index - the only action defined now is forward to
Florin Coras64424012019-03-02 10:47:47 -0800389 application with index action_index
390 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100391 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800392 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100393 @param tag - tag
Florin Coras6c36f532017-11-03 18:32:34 -0700394 */
395define session_rules_details
396{
397 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100398 vl_api_transport_proto_t transport_proto;
399 vl_api_prefix_t lcl;
400 vl_api_prefix_t rmt;
Florin Coras6c36f532017-11-03 18:32:34 -0700401 u16 lcl_port;
402 u16 rmt_port;
403 u32 action_index;
404 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100405 vl_api_session_rule_scope_t scope;
406 string tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700407};
408
Dave Barach68b0fb02017-02-28 15:15:56 -0500409/*
410 * Local Variables:
411 * eval: (c-set-style "gnu")
412 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400413 */