blob: bf88e82f336692cfb35a28b50110015bcdc9dcd0 [file] [log] [blame]
Dave Barach68b0fb02017-02-28 15:15:56 -05001/*
2 * Copyright (c) 2015-2016 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 */
Dave Barach0d056e52017-09-28 15:11:16 -040015
Florin Coras8f89dd02018-03-05 16:53:07 -080016option version = "1.0.2";
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
41 @param segment_size - size of first shm segment
42 @param segment_name_length - length of segment name
43 @param segment_name - name of segment client needs to attach to
44*/
45define application_attach_reply {
46 u32 context;
47 i32 retval;
48 u64 app_event_queue_address;
49 u32 segment_size;
50 u8 segment_name_length;
51 u8 segment_name[128];
52};
53
Florin Coras371ca502018-02-21 12:07:41 -080054/** \brief Application add TLS certificate
55 @param client_index - opaque cookie to identify the sender
56 @param context - sender context, to match reply w/ request
57 @param cert_len - certificate length
58 @param cert - certificate as a string
59*/
60autoreply define application_tls_cert_add {
61 u32 client_index;
62 u32 context;
63 u32 app_index;
64 u16 cert_len;
65 u8 cert[cert_len];
66};
67
68/** \brief Application add TLS key
69 @param client_index - opaque cookie to identify the sender
70 @param context - sender context, to match reply w/ request
71 @param key_len - certificate length
72 @param key - PEM encoded key as a string
73*/
74autoreply define application_tls_key_add {
75 u32 client_index;
76 u32 context;
77 u32 app_index;
78 u16 key_len;
79 u8 key[key_len];
80};
81
Florin Coras6cf30ad2017-04-04 23:08:23 -070082 /** \brief client->vpp, attach application to session layer
83 @param client_index - opaque cookie to identify the sender
84 @param context - sender context, to match reply w/ request
85*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040086autoreply define application_detach {
Florin Coras6cf30ad2017-04-04 23:08:23 -070087 u32 client_index;
88 u32 context;
89 };
90
Florin Coras6cf30ad2017-04-04 23:08:23 -070091/** \brief vpp->client, please map an additional shared memory segment
92 @param client_index - opaque cookie to identify the sender
93 @param context - sender context, to match reply w/ request
94 @param segment_name -
95*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040096autoreply define map_another_segment {
Florin Coras6cf30ad2017-04-04 23:08:23 -070097 u32 client_index;
98 u32 context;
99 u32 segment_size;
100 u8 segment_name[128];
101};
102
Florin Corasf8f516a2018-02-08 15:10:09 -0800103/** \brief vpp->client unmap shared memory segment
104 @param client_index - opaque cookie to identify the sender
105 @param context - sender context, to match reply w/ request
106 @param segment_name -
107*/
108autoreply define unmap_segment {
109 u32 client_index;
110 u32 context;
111 u8 segment_name[128];
112};
113
Dave Barach68b0fb02017-02-28 15:15:56 -0500114 /** \brief Bind to a given URI
115 @param client_index - opaque cookie to identify the sender
116 @param context - sender context, to match reply w/ request
117 @param accept_cookie - sender accept cookie, to identify this bind flavor
118 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
119 "tcp://::/0/80" [ipv6] etc.
120 @param options - socket options, fifo sizes, etc.
121*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400122autoreply define bind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500123 u32 client_index;
124 u32 context;
125 u32 accept_cookie;
Dave Barach68b0fb02017-02-28 15:15:56 -0500126 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500127};
128
129/** \brief Unbind a given URI
130 @param client_index - opaque cookie to identify the sender
131 @param context - sender context, to match reply w/ request
132 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
133 "tcp://::/0/80" [ipv6], etc.
134 @param options - socket options, fifo sizes, etc.
135*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400136autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500137 u32 client_index;
138 u32 context;
139 u8 uri[128];
140};
141
142/** \brief Connect to a given URI
143 @param client_index - opaque cookie to identify the sender
144 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700145 @param client_queue_address - binary API client queue address. Used by
146 local server when connect was redirected.
Florin Corascea194d2017-10-02 00:18:51 -0700147 @param options - socket options, fifo sizes, etc. passed by vpp to the
148 server when redirecting connects
149 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
150 "tcp6://::/0/80" [ipv6], etc.
Dave Barach68b0fb02017-02-28 15:15:56 -0500151*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400152autoreply define connect_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500153 u32 client_index;
154 u32 context;
Dave Barach68b0fb02017-02-28 15:15:56 -0500155 u64 client_queue_address;
156 u64 options[16];
Florin Corascea194d2017-10-02 00:18:51 -0700157 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500158};
159
Dave Barach68b0fb02017-02-28 15:15:56 -0500160/** \brief vpp->client, accept this session
161 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700162 @param listener_handle - tells client which listener this pertains to
163 @param handle - unique session identifier
Dave Barach68b0fb02017-02-28 15:15:56 -0500164 @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
165 @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
Florin Corasf8f516a2018-02-08 15:10:09 -0800166 @param vpp_event_queue_address - vpp's event queue address or client's
167 event queue for cut through
168 @param server_event_queue_address - server's event queue address for
169 cut through sessions
Florin Coras6cf30ad2017-04-04 23:08:23 -0700170 @param port - remote port
171 @param is_ip4 - 1 if the ip is ip4
172 @param ip - remote ip
Dave Barach68b0fb02017-02-28 15:15:56 -0500173*/
174define accept_session {
175 u32 client_index;
176 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700177 u64 listener_handle;
178 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500179 u64 server_rx_fifo;
180 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500181 u64 vpp_event_queue_address;
Florin Corasf8f516a2018-02-08 15:10:09 -0800182 u64 server_event_queue_address;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700183 u16 port;
184 u8 is_ip4;
185 u8 ip[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500186};
187
188/** \brief client->vpp, reply to an accept message
189 @param context - sender context, to match reply w/ request
190 @param retval - return code for the request
191 @param session_index - session index from accept_session / connect_reply
192 @param session_thread_index - thread index from accept_session /
193 connect_reply
194*/
195define accept_session_reply {
196 u32 context;
197 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700198 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500199};
200
201/** \brief bidirectional disconnect API
202 @param client_index - opaque cookie to identify the sender
203 client to vpp direction only
204 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700205 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500206*/
207define disconnect_session {
208 u32 client_index;
209 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700210 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500211};
212
213/** \brief bidirectional disconnect reply API
214 @param client_index - opaque cookie to identify the sender
215 client to vpp direction only
216 @param context - sender context, to match reply w/ request
217 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700218 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500219*/
220define disconnect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500221 u32 context;
222 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700223 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500224};
225
226/** \brief vpp->client reset session API
227 @param client_index - opaque cookie to identify the sender
228 client to vpp direction only
229 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700230 @param handle - session handle obtained via accept/connects
Dave Barach68b0fb02017-02-28 15:15:56 -0500231*/
232define reset_session {
233 u32 client_index;
234 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700235 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500236};
237
238/** \brief client->vpp reset session reply
239 @param client_index - opaque cookie to identify the sender
240 client to vpp direction only
241 @param context - sender context, to match reply w/ request
242 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700243 @param handle - session handle obtained via accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500244*/
245define reset_session_reply {
246 u32 client_index;
247 u32 context;
248 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700249 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500250};
251
252/** \brief Bind to an ip:port pair for a given transport protocol
253 @param client_index - opaque cookie to identify the sender
254 @param context - sender context, to match reply w/ request
255 @param vrf - bind namespace
256 @param is_ip4 - flag that is 1 if ip address family is IPv4
257 @param ip - ip address
258 @param port - port
259 @param proto - protocol 0 - TCP 1 - UDP
260 @param options - socket options, fifo sizes, etc.
261*/
262define bind_sock {
263 u32 client_index;
264 u32 context;
265 u32 vrf;
266 u8 is_ip4;
267 u8 ip[16];
268 u16 port;
269 u8 proto;
270 u64 options[16];
271};
272
273/** \brief Unbind
274 @param client_index - opaque cookie to identify the sender
275 @param context - sender context, to match reply w/ request
276 @param handle - bind handle obtained from bind reply
277*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400278autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500279 u32 client_index;
280 u32 context;
281 u64 handle;
282};
283
284/** \brief Connect to a remote peer
285 @param client_index - opaque cookie to identify the sender
286 @param context - sender context, to match reply w/ request
Florin Corascea194d2017-10-02 00:18:51 -0700287 @param client_queue_address - client's API queue address. Non-zero when
288 used to perform redirects
289 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500290 @param vrf - connection namespace
291 @param is_ip4 - flag that is 1 if ip address family is IPv4
292 @param ip - ip address
293 @param port - port
294 @param proto - protocol 0 - TCP 1 - UDP
Florin Coras8f89dd02018-03-05 16:53:07 -0800295 @param hostname-len - length of hostname
296 @param hostname - destination's hostname. If present, used by protocols
297 like tls.
Dave Barach68b0fb02017-02-28 15:15:56 -0500298*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400299autoreply define connect_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500300 u32 client_index;
301 u32 context;
Florin Corascea194d2017-10-02 00:18:51 -0700302 u64 client_queue_address;
303 u64 options[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500304 u32 vrf;
305 u8 is_ip4;
306 u8 ip[16];
307 u16 port;
308 u8 proto;
Florin Coras8f89dd02018-03-05 16:53:07 -0800309 u8 hostname_len;
310 u8 hostname[hostname_len];
Dave Barach68b0fb02017-02-28 15:15:56 -0500311};
312
313/** \brief Bind reply
314 @param context - sender context, to match reply w/ request
315 @param handle - bind handle
316 @param retval - return code for the request
317 @param event_queue_address - vpp event queue address or 0 if this
318 connection shouldn't send events
319 @param segment_name_length - length of segment name
320 @param segment_name - name of segment client needs to attach to
321*/
322define bind_sock_reply {
323 u32 context;
324 u64 handle;
325 i32 retval;
326 u64 server_event_queue_address;
Florin Corasdcf55ce2017-11-16 15:32:50 -0800327 u8 lcl_is_ip4;
328 u8 lcl_ip[16];
329 u16 lcl_port;
Dave Barach68b0fb02017-02-28 15:15:56 -0500330 u32 segment_size;
331 u8 segment_name_length;
332 u8 segment_name[128];
333};
334
Dave Wallace33e002b2017-09-06 01:20:02 -0400335/* Dummy connect message -- needed to satisfy api generators
336*
337* NEVER USED, doxygen tags elided on purpose.
338*/
339define connect_session {
340 u32 client_index;
341 u32 context;
342};
343
344/** \brief vpp/server->client, connect reply -- used for all connect_* messages
Dave Barach68b0fb02017-02-28 15:15:56 -0500345 @param context - sender context, to match reply w/ request
346 @param retval - return code for the request
347 @param handle - connection handle
348 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
349 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
350 @param vpp_event_queue_address - vpp's event queue address
Florin Corasf8f516a2018-02-08 15:10:09 -0800351 @param client_event_queue_address - client's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700352 @param segment_size - size of segment to be attached. Only for redirects.
Dave Barach68b0fb02017-02-28 15:15:56 -0500353 @param segment_name_length - non-zero if the client needs to attach to
354 the fifo segment
355 @param segment_name - set if the client needs to attach to the segment
Florin Corasade70e42017-10-14 18:56:41 -0700356 @param lcl_ip - local ip for connection
357 @param is_ip4 - flag to indicate if ip is v4 or v6
358 @param lcl_port - local port
Dave Barach68b0fb02017-02-28 15:15:56 -0500359*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400360define connect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500361 u32 context;
362 i32 retval;
363 u64 handle;
364 u64 server_rx_fifo;
365 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500366 u64 vpp_event_queue_address;
Florin Corasf8f516a2018-02-08 15:10:09 -0800367 u64 client_event_queue_address;
Dave Barach68b0fb02017-02-28 15:15:56 -0500368 u32 segment_size;
369 u8 segment_name_length;
370 u8 segment_name[128];
Florin Corasade70e42017-10-14 18:56:41 -0700371 u8 lcl_ip[16];
372 u8 is_ip4;
373 u16 lcl_port;
Dave Barach68b0fb02017-02-28 15:15:56 -0500374};
375
Florin Corase04c2992017-03-01 08:17:34 -0800376/** \brief enable/disable session layer
377 @param client_index - opaque cookie to identify the sender
378 client to vpp direction only
379 @param context - sender context, to match reply w/ request
380 @param is_enable - disable session layer if 0, enable otherwise
381*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400382autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800383 u32 client_index;
384 u32 context;
385 u8 is_enable;
386};
387
Florin Corascea194d2017-10-02 00:18:51 -0700388/** \brief add/del application namespace
389 @param client_index - opaque cookie to identify the sender
390 client to vpp direction only
391 @param context - sender context, to match reply w/ request
392 @param secret - secret shared between app and vpp
393 @param sw_if_index - local interface that "supports" namespace. Set to
394 ~0 if no preference
395 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
396 if sw_if_index set.
397 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
398 if sw_if_index set.
399 @param namespace_id_len - length of namespace id lower
400 @param namespace_id - namespace id
401*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800402define app_namespace_add_del {
Florin Corascea194d2017-10-02 00:18:51 -0700403 u32 client_index;
404 u32 context;
405 u64 secret;
406 u32 sw_if_index;
407 u32 ip4_fib_id;
408 u32 ip6_fib_id;
409 u8 namespace_id_len;
410 u8 namespace_id[64];
411};
412
Florin Coras6e8c6672017-11-10 09:03:54 -0800413/** \brief Reply for app namespace add/del
414 @param context - returned sender context, to match reply w/ request
415 @param retval - return code
416 @param appns_index - app namespace index
417*/
418define app_namespace_add_del_reply
419{
420 u32 context;
421 i32 retval;
422 u32 appns_index;
423};
424
Florin Coras1c710452017-10-17 00:03:13 -0700425/** \brief add/del session rule
426 @param client_index - opaque cookie to identify the sender
427 client to vpp direction only
428 @param context - sender context, to match reply w/ request
429 @param transport_proto - transport protocol (0 - tcp 1 - udp)
430 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
431 @param lcl_ip - local ip
432 @param lcl_plen - local prefix length
433 @param rmt_ip - remote ip
434 @param rmt_ple - remote prefix length
435 @param lcl_port - local port
436 @param rmt_port - remote port
437 @param action_index - the only action defined now is forward to
438 application with index action_index
439 @param is_add - flag to indicate if add or del
440 @param appns_index - application namespace where rule is to be applied
441 to
442 @param scope - flag that indicates scope of the rule: global or local.
443 If 0, default is global, 1 is global 2 is local, 3 is
444 both
445*/
446autoreply define session_rule_add_del {
447 u32 client_index;
448 u32 context;
449 u8 transport_proto;
450 u8 is_ip4;
451 u8 lcl_ip[16];
452 u8 lcl_plen;
453 u8 rmt_ip[16];
454 u8 rmt_plen;
455 u16 lcl_port;
456 u16 rmt_port;
457 u32 action_index;
458 u8 is_add;
459 u32 appns_index;
460 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800461 u8 tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700462};
463
Florin Coras6c36f532017-11-03 18:32:34 -0700464/** \brief Dump session rules
465 @param client_index - opaque cookie to identify the sender
466 @param context - sender context, to match reply w/ request
467 */
468define session_rules_dump
469{
470 u32 client_index;
471 u32 context;
472};
473
474/** \brief Session rules details
475 @param context - sender context, to match reply w/ request
476 @param transport_proto - transport protocol (0 - tcp 1 - udp)
477 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
478 @param lcl_ip - local ip
479 @param lcl_plen - local prefix length
480 @param rmt_ip - remote ip
481 @param rmt_ple - remote prefix length
482 @param lcl_port - local port
483 @param rmt_port - remote port
484 @param action_index - the only action defined now is forward to
485 application with index action_index
486 @param appns_index - application namespace where rule is to be applied
487 to
488 @param scope - flag that indicates scope of the rule: global or local.
489 If 0, default is global, 1 is global 2 is local, 3 is
490 both
491 */
492define session_rules_details
493{
494 u32 context;
495 u8 transport_proto;
496 u8 is_ip4;
497 u8 lcl_ip[16];
498 u8 lcl_plen;
499 u8 rmt_ip[16];
500 u8 rmt_plen;
501 u16 lcl_port;
502 u16 rmt_port;
503 u32 action_index;
504 u32 appns_index;
505 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800506 u8 tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700507};
508
Dave Barach68b0fb02017-02-28 15:15:56 -0500509/*
510 * Local Variables:
511 * eval: (c-set-style "gnu")
512 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400513 */