blob: 53d05dfe426b36c9e883b2e51d608811908caf37 [file] [log] [blame]
Dave Barach68b0fb02017-02-28 15:15:56 -05001/*
Florin Coras64424012019-03-02 10:47:47 -08002 * Copyright (c) 2015-2019 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 Coras64424012019-03-02 10:47:47 -080016option version = "1.6.0";
Dave Barach0d056e52017-09-28 15:11:16 -040017
Florin Coras6cf30ad2017-04-04 23:08:23 -070018/** \brief client->vpp, attach application to session layer
19 @param client_index - opaque cookie to identify the sender
20 @param context - sender context, to match reply w/ request
21 @param initial_segment_size - size of the initial shm segment to be
22 allocated
23 @param options - segment size, fifo sizes, etc.
Florin Corascea194d2017-10-02 00:18:51 -070024 @param namespace_id_len - length of the namespace id c-string
25 @param namespace_id - 0 terminted c-string
Florin Coras6cf30ad2017-04-04 23:08:23 -070026*/
27 define application_attach {
28 u32 client_index;
29 u32 context;
30 u32 initial_segment_size;
31 u64 options[16];
Florin Corascea194d2017-10-02 00:18:51 -070032 u8 namespace_id_len;
33 u8 namespace_id [64];
Florin Coras6cf30ad2017-04-04 23:08:23 -070034 };
35
36 /** \brief Application attach reply
37 @param context - sender context, to match reply w/ request
38 @param retval - return code for the request
39 @param app_event_queue_address - vpp event queue address or 0 if this
40 connection shouldn't send events
Florin Coras99368312018-08-02 10:45:44 -070041 @param n_fds - number of fds exchanged
42 @param fd_flags - set of flags that indicate which fds are to be expected
43 over the socket (set only if socket transport available)
Florin Coras6cf30ad2017-04-04 23:08:23 -070044 @param segment_size - size of first shm segment
45 @param segment_name_length - length of segment name
46 @param segment_name - name of segment client needs to attach to
Florin Corasc1f5a432018-11-20 11:31:26 -080047 @param app_index - index of the newly created app
Florin Corasd85de682018-11-29 17:02:29 -080048 @param segment_handle - handle for segment
Florin Coras6cf30ad2017-04-04 23:08:23 -070049*/
50define application_attach_reply {
51 u32 context;
52 i32 retval;
53 u64 app_event_queue_address;
Florin Coras99368312018-08-02 10:45:44 -070054 u8 n_fds;
55 u8 fd_flags;
Florin Coras6cf30ad2017-04-04 23:08:23 -070056 u32 segment_size;
57 u8 segment_name_length;
58 u8 segment_name[128];
Florin Corasc1f5a432018-11-20 11:31:26 -080059 u32 app_index;
Florin Corasd85de682018-11-29 17:02:29 -080060 u64 segment_handle;
Florin Coras6cf30ad2017-04-04 23:08:23 -070061};
62
Florin Coras371ca502018-02-21 12:07:41 -080063/** \brief Application add TLS certificate
64 @param client_index - opaque cookie to identify the sender
65 @param context - sender context, to match reply w/ request
66 @param cert_len - certificate length
67 @param cert - certificate as a string
68*/
69autoreply define application_tls_cert_add {
70 u32 client_index;
71 u32 context;
72 u32 app_index;
73 u16 cert_len;
74 u8 cert[cert_len];
75};
76
77/** \brief Application add TLS key
78 @param client_index - opaque cookie to identify the sender
79 @param context - sender context, to match reply w/ request
80 @param key_len - certificate length
81 @param key - PEM encoded key as a string
82*/
83autoreply define application_tls_key_add {
84 u32 client_index;
85 u32 context;
86 u32 app_index;
87 u16 key_len;
88 u8 key[key_len];
89};
90
Florin Coras6cf30ad2017-04-04 23:08:23 -070091 /** \brief client->vpp, attach application to session layer
92 @param client_index - opaque cookie to identify the sender
93 @param context - sender context, to match reply w/ request
94*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040095autoreply define application_detach {
Florin Coras6cf30ad2017-04-04 23:08:23 -070096 u32 client_index;
97 u32 context;
98 };
99
Florin Coras6cf30ad2017-04-04 23:08:23 -0700100/** \brief vpp->client, please map an additional shared memory segment
101 @param client_index - opaque cookie to identify the sender
102 @param context - sender context, to match reply w/ request
Florin Coras99368312018-08-02 10:45:44 -0700103 @param fd_flags - set of flags that indicate which, if any, fds are
104 to be expected over the socket. This is set only if
105 socket transport available
106 @param segment_size - size of the segment to be mapped
107 @param segment_name - name of the segment to be mapped
Florin Corasfa76a762018-11-29 12:40:10 -0800108 @param segment_handle - unique identifier for segment
Florin Coras6cf30ad2017-04-04 23:08:23 -0700109*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400110autoreply define map_another_segment {
Florin Coras6cf30ad2017-04-04 23:08:23 -0700111 u32 client_index;
112 u32 context;
Florin Coras99368312018-08-02 10:45:44 -0700113 u8 fd_flags;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700114 u32 segment_size;
115 u8 segment_name[128];
Florin Corasfa76a762018-11-29 12:40:10 -0800116 u64 segment_handle;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700117};
118
Florin Corasf8f516a2018-02-08 15:10:09 -0800119/** \brief vpp->client unmap shared memory segment
120 @param client_index - opaque cookie to identify the sender
121 @param context - sender context, to match reply w/ request
Florin Corasfa76a762018-11-29 12:40:10 -0800122 @param segment_name - segment name
123 @param segment_handle - handle of the segment to be unmapped
Florin Corasf8f516a2018-02-08 15:10:09 -0800124*/
125autoreply define unmap_segment {
126 u32 client_index;
127 u32 context;
Florin Corasfa76a762018-11-29 12:40:10 -0800128 u64 segment_handle;
Florin Corasf8f516a2018-02-08 15:10:09 -0800129};
130
Dave Barach68b0fb02017-02-28 15:15:56 -0500131 /** \brief Bind to a given URI
132 @param client_index - opaque cookie to identify the sender
133 @param context - sender context, to match reply w/ request
134 @param accept_cookie - sender accept cookie, to identify this bind flavor
135 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
136 "tcp://::/0/80" [ipv6] etc.
137 @param options - socket options, fifo sizes, etc.
138*/
Florin Coras64424012019-03-02 10:47:47 -0800139autoreply define bind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500140 u32 client_index;
141 u32 context;
142 u32 accept_cookie;
Dave Barach68b0fb02017-02-28 15:15:56 -0500143 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500144};
Florin Coras7fb0fe12018-04-09 09:24:52 -0700145
Dave Barach68b0fb02017-02-28 15:15:56 -0500146/** \brief Unbind a given URI
147 @param client_index - opaque cookie to identify the sender
148 @param context - sender context, to match reply w/ request
149 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
150 "tcp://::/0/80" [ipv6], etc.
151 @param options - socket options, fifo sizes, etc.
152*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400153autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500154 u32 client_index;
155 u32 context;
156 u8 uri[128];
157};
158
159/** \brief Connect to a given URI
160 @param client_index - opaque cookie to identify the sender
161 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700162 @param client_queue_address - binary API client queue address. Used by
163 local server when connect was redirected.
Florin Corascea194d2017-10-02 00:18:51 -0700164 @param options - socket options, fifo sizes, etc. passed by vpp to the
165 server when redirecting connects
166 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
167 "tcp6://::/0/80" [ipv6], etc.
Dave Barach68b0fb02017-02-28 15:15:56 -0500168*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400169autoreply define connect_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500170 u32 client_index;
171 u32 context;
Dave Barach68b0fb02017-02-28 15:15:56 -0500172 u64 client_queue_address;
173 u64 options[16];
Florin Corascea194d2017-10-02 00:18:51 -0700174 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500175};
176
Dave Barach68b0fb02017-02-28 15:15:56 -0500177/** \brief bidirectional disconnect API
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
Florin Coras6cf30ad2017-04-04 23:08:23 -0700181 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500182*/
183define disconnect_session {
184 u32 client_index;
185 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700186 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500187};
188
189/** \brief bidirectional disconnect reply API
190 @param client_index - opaque cookie to identify the sender
191 client to vpp direction only
192 @param context - sender context, to match reply w/ request
193 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700194 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500195*/
196define disconnect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500197 u32 context;
198 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700199 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500200};
201
Dave Barach68b0fb02017-02-28 15:15:56 -0500202/** \brief Bind to an ip:port pair for a given transport protocol
203 @param client_index - opaque cookie to identify the sender
204 @param context - sender context, to match reply w/ request
Florin Coras15531972018-08-12 23:50:53 -0700205 @param wrk_index - index of worker requesting the bind
Dave Barach68b0fb02017-02-28 15:15:56 -0500206 @param vrf - bind namespace
207 @param is_ip4 - flag that is 1 if ip address family is IPv4
208 @param ip - ip address
209 @param port - port
210 @param proto - protocol 0 - TCP 1 - UDP
211 @param options - socket options, fifo sizes, etc.
212*/
Florin Coras64424012019-03-02 10:47:47 -0800213autoreply define bind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500214 u32 client_index;
215 u32 context;
Florin Coras15531972018-08-12 23:50:53 -0700216 u32 wrk_index;
Dave Barach68b0fb02017-02-28 15:15:56 -0500217 u32 vrf;
218 u8 is_ip4;
219 u8 ip[16];
220 u16 port;
221 u8 proto;
222 u64 options[16];
223};
224
225/** \brief Unbind
226 @param client_index - opaque cookie to identify the sender
227 @param context - sender context, to match reply w/ request
Florin Corasab2f6db2018-08-31 14:31:41 -0700228 @param wrk_index - index of worker requesting the bind
Dave Barach68b0fb02017-02-28 15:15:56 -0500229 @param handle - bind handle obtained from bind reply
230*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400231autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500232 u32 client_index;
233 u32 context;
Florin Corasab2f6db2018-08-31 14:31:41 -0700234 u32 wrk_index;
Dave Barach68b0fb02017-02-28 15:15:56 -0500235 u64 handle;
236};
237
238/** \brief Connect to a remote peer
239 @param client_index - opaque cookie to identify the sender
240 @param context - sender context, to match reply w/ request
Florin Coras15531972018-08-12 23:50:53 -0700241 @param wrk_index - worker that requests the connect
Florin Corascea194d2017-10-02 00:18:51 -0700242 @param client_queue_address - client's API queue address. Non-zero when
243 used to perform redirects
244 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500245 @param vrf - connection namespace
246 @param is_ip4 - flag that is 1 if ip address family is IPv4
247 @param ip - ip address
248 @param port - port
249 @param proto - protocol 0 - TCP 1 - UDP
Florin Coras8f89dd02018-03-05 16:53:07 -0800250 @param hostname-len - length of hostname
251 @param hostname - destination's hostname. If present, used by protocols
252 like tls.
Nathan Skrzypczakba65ca42019-05-16 16:35:40 +0200253 @param transport_opts - transport option (e.g. session id for quic).
Dave Barach68b0fb02017-02-28 15:15:56 -0500254*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400255autoreply define connect_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500256 u32 client_index;
257 u32 context;
Florin Coras15531972018-08-12 23:50:53 -0700258 u32 wrk_index;
Florin Corascea194d2017-10-02 00:18:51 -0700259 u64 client_queue_address;
260 u64 options[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500261 u32 vrf;
262 u8 is_ip4;
263 u8 ip[16];
264 u16 port;
265 u8 proto;
Florin Coras8f89dd02018-03-05 16:53:07 -0800266 u8 hostname_len;
267 u8 hostname[hostname_len];
Nathan Skrzypczakba65ca42019-05-16 16:35:40 +0200268 u64 transport_opts;
Dave Barach68b0fb02017-02-28 15:15:56 -0500269};
270
Florin Coras99368312018-08-02 10:45:44 -0700271/** \brief ask app to add a new cut-through registration
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 evt_q_address - address of the mq in ssvm segment
276 @param peer_evt_q_address - address of peer's mq in ssvm segment
Florin Coras134a9962018-08-28 11:32:04 -0700277 @param wrk_index - index of worker to receive the registration
Florin Coras99368312018-08-02 10:45:44 -0700278 @param n_fds - number of fds exchanged
279 @param fd_flags - flag indicating the fds that will be exchanged over
280 api socket
281*/
282autoreply define app_cut_through_registration_add
283{
284 u32 client_index;
285 u32 context;
286 u64 evt_q_address;
287 u64 peer_evt_q_address;
Florin Coras134a9962018-08-28 11:32:04 -0700288 u32 wrk_index;
Florin Coras99368312018-08-02 10:45:44 -0700289 u8 n_fds;
290 u8 fd_flags;
291};
292
Florin Coras15531972018-08-12 23:50:53 -0700293/** \brief add/del application worker
294 @param client_index - opaque cookie to identify the sender
295 client to vpp direction only
296 @param context - sender context, to match reply w/ request
Florin Corasc1f5a432018-11-20 11:31:26 -0800297 @param app_index - application index
Florin Coras15531972018-08-12 23:50:53 -0700298 @param wrk_index - worker index, if a delete
299 @param is_add - set if an add
300*/
301define app_worker_add_del
302{
303 u32 client_index;
304 u32 context;
Florin Corasc1f5a432018-11-20 11:31:26 -0800305 u32 app_index;
Florin Coras15531972018-08-12 23:50:53 -0700306 u32 wrk_index;
307 u8 is_add;
308};
309
310/** \brief Reply for app worker add/del
311 @param context - returned sender context, to match reply w/ request
312 @param retval - return code
313 @param wrk_index - worker index, if add
314 @param app_event_queue_address - vpp event queue address of new worker
315 @param n_fds - number of fds exchanged
316 @param fd_flags - set of flags that indicate which fds are to be expected
317 over the socket (set only if socket transport available)
318 @param segment_name_length - length of segment name
319 @param segment_name - name of segment client needs to attach to
Florin Corasfa76a762018-11-29 12:40:10 -0800320 @param segment_handle - handle for segment
Florin Coras15531972018-08-12 23:50:53 -0700321*/
322define app_worker_add_del_reply
323{
324 u32 context;
325 i32 retval;
326 u32 wrk_index;
327 u64 app_event_queue_address;
328 u8 n_fds;
329 u8 fd_flags;
330 u8 segment_name_length;
331 u8 segment_name[128];
Florin Corasfa76a762018-11-29 12:40:10 -0800332 u64 segment_handle;
Florin Coras15531972018-08-12 23:50:53 -0700333 u8 is_add;
334};
335
Florin Corase04c2992017-03-01 08:17:34 -0800336/** \brief enable/disable session layer
337 @param client_index - opaque cookie to identify the sender
338 client to vpp direction only
339 @param context - sender context, to match reply w/ request
340 @param is_enable - disable session layer if 0, enable otherwise
341*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400342autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800343 u32 client_index;
344 u32 context;
345 u8 is_enable;
346};
347
Florin Corascea194d2017-10-02 00:18:51 -0700348/** \brief add/del application namespace
349 @param client_index - opaque cookie to identify the sender
350 client to vpp direction only
351 @param context - sender context, to match reply w/ request
Florin Coras64424012019-03-02 10:47:47 -0800352 @param secret - secret shared between app and vpp
Florin Corascea194d2017-10-02 00:18:51 -0700353 @param sw_if_index - local interface that "supports" namespace. Set to
Florin Coras64424012019-03-02 10:47:47 -0800354 ~0 if no preference
355 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
356 if sw_if_index set.
357 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
358 if sw_if_index set.
Florin Corascea194d2017-10-02 00:18:51 -0700359 @param namespace_id_len - length of namespace id lower
360 @param namespace_id - namespace id
361*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800362define app_namespace_add_del {
Florin Corascea194d2017-10-02 00:18:51 -0700363 u32 client_index;
364 u32 context;
365 u64 secret;
366 u32 sw_if_index;
367 u32 ip4_fib_id;
368 u32 ip6_fib_id;
369 u8 namespace_id_len;
370 u8 namespace_id[64];
371};
372
Florin Coras6e8c6672017-11-10 09:03:54 -0800373/** \brief Reply for app namespace add/del
374 @param context - returned sender context, to match reply w/ request
375 @param retval - return code
376 @param appns_index - app namespace index
377*/
378define app_namespace_add_del_reply
379{
380 u32 context;
381 i32 retval;
382 u32 appns_index;
383};
384
Florin Coras1c710452017-10-17 00:03:13 -0700385/** \brief add/del session rule
386 @param client_index - opaque cookie to identify the sender
387 client to vpp direction only
388 @param context - sender context, to match reply w/ request
389 @param transport_proto - transport protocol (0 - tcp 1 - udp)
390 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
391 @param lcl_ip - local ip
392 @param lcl_plen - local prefix length
393 @param rmt_ip - remote ip
394 @param rmt_ple - remote prefix length
395 @param lcl_port - local port
396 @param rmt_port - remote port
Florin Coras64424012019-03-02 10:47:47 -0800397 @param action_index - the only action defined now is forward to
398 application with index action_index
399 @param is_add - flag to indicate if add or del
400 @param appns_index - application namespace where rule is to be applied to
401 @param scope - flag that indicates scope of the rule: global or local.
402 If 0, default is global, 1 is global 2 is local, 3 is both
Florin Coras1c710452017-10-17 00:03:13 -0700403*/
404autoreply define session_rule_add_del {
405 u32 client_index;
406 u32 context;
407 u8 transport_proto;
408 u8 is_ip4;
409 u8 lcl_ip[16];
410 u8 lcl_plen;
411 u8 rmt_ip[16];
412 u8 rmt_plen;
413 u16 lcl_port;
414 u16 rmt_port;
415 u32 action_index;
416 u8 is_add;
417 u32 appns_index;
418 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800419 u8 tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700420};
421
Florin Coras6c36f532017-11-03 18:32:34 -0700422/** \brief Dump session rules
423 @param client_index - opaque cookie to identify the sender
424 @param context - sender context, to match reply w/ request
425 */
426define session_rules_dump
427{
428 u32 client_index;
429 u32 context;
430};
431
432/** \brief Session rules details
Florin Coras64424012019-03-02 10:47:47 -0800433 @param context - sender context, to match reply w/ request
Florin Coras6c36f532017-11-03 18:32:34 -0700434 @param transport_proto - transport protocol (0 - tcp 1 - udp)
435 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
436 @param lcl_ip - local ip
437 @param lcl_plen - local prefix length
438 @param rmt_ip - remote ip
439 @param rmt_ple - remote prefix length
440 @param lcl_port - local port
441 @param rmt_port - remote port
442 @param action_index - the only action defined now is forward to
Florin Coras64424012019-03-02 10:47:47 -0800443 application with index action_index
444 @param appns_index - application namespace where rule is to be applied to
445 @param scope - flag that indicates scope of the rule: global or local.
446 If 0, default is global, 1 is global 2 is local, 3 is both
Florin Coras6c36f532017-11-03 18:32:34 -0700447 */
448define session_rules_details
449{
450 u32 context;
451 u8 transport_proto;
452 u8 is_ip4;
453 u8 lcl_ip[16];
454 u8 lcl_plen;
455 u8 rmt_ip[16];
456 u8 rmt_plen;
457 u16 lcl_port;
458 u16 rmt_port;
459 u32 action_index;
460 u32 appns_index;
461 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800462 u8 tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700463};
464
Dave Barach68b0fb02017-02-28 15:15:56 -0500465/*
466 * Local Variables:
467 * eval: (c-set-style "gnu")
468 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400469 */