blob: 98748d8fbbbb8eadb0fd5e7db674aa389000a8de [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 Coras7fb0fe12018-04-09 09:24:52 -070016option version = "1.0.3";
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*/
Florin Coras7fb0fe12018-04-09 09:24:52 -0700122define 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
Florin Coras7fb0fe12018-04-09 09:24:52 -0700129define bind_uri_reply {
130 u32 context;
131 u64 handle;
132 i32 retval;
133 u64 rx_fifo;
134 u64 tx_fifo;
135 u8 lcl_is_ip4;
136 u8 lcl_ip[16];
137 u16 lcl_port;
138 u64 vpp_evt_q;
139};
140
Dave Barach68b0fb02017-02-28 15:15:56 -0500141/** \brief Unbind a given URI
142 @param client_index - opaque cookie to identify the sender
143 @param context - sender context, to match reply w/ request
144 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
145 "tcp://::/0/80" [ipv6], etc.
146 @param options - socket options, fifo sizes, etc.
147*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400148autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500149 u32 client_index;
150 u32 context;
151 u8 uri[128];
152};
153
154/** \brief Connect to a given URI
155 @param client_index - opaque cookie to identify the sender
156 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700157 @param client_queue_address - binary API client queue address. Used by
158 local server when connect was redirected.
Florin Corascea194d2017-10-02 00:18:51 -0700159 @param options - socket options, fifo sizes, etc. passed by vpp to the
160 server when redirecting connects
161 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
162 "tcp6://::/0/80" [ipv6], etc.
Dave Barach68b0fb02017-02-28 15:15:56 -0500163*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400164autoreply define connect_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500165 u32 client_index;
166 u32 context;
Dave Barach68b0fb02017-02-28 15:15:56 -0500167 u64 client_queue_address;
168 u64 options[16];
Florin Corascea194d2017-10-02 00:18:51 -0700169 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500170};
171
Dave Barach68b0fb02017-02-28 15:15:56 -0500172/** \brief vpp->client, accept this session
173 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700174 @param listener_handle - tells client which listener this pertains to
175 @param handle - unique session identifier
Dave Barach68b0fb02017-02-28 15:15:56 -0500176 @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
177 @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
Florin Corasf8f516a2018-02-08 15:10:09 -0800178 @param vpp_event_queue_address - vpp's event queue address or client's
179 event queue for cut through
180 @param server_event_queue_address - server's event queue address for
181 cut through sessions
Florin Coras6cf30ad2017-04-04 23:08:23 -0700182 @param port - remote port
183 @param is_ip4 - 1 if the ip is ip4
184 @param ip - remote ip
Dave Barach68b0fb02017-02-28 15:15:56 -0500185*/
186define accept_session {
187 u32 client_index;
188 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700189 u64 listener_handle;
190 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500191 u64 server_rx_fifo;
192 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500193 u64 vpp_event_queue_address;
Florin Corasf8f516a2018-02-08 15:10:09 -0800194 u64 server_event_queue_address;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700195 u16 port;
196 u8 is_ip4;
197 u8 ip[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500198};
199
200/** \brief client->vpp, reply to an accept message
201 @param context - sender context, to match reply w/ request
202 @param retval - return code for the request
203 @param session_index - session index from accept_session / connect_reply
204 @param session_thread_index - thread index from accept_session /
205 connect_reply
206*/
207define accept_session_reply {
208 u32 context;
209 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700210 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500211};
212
213/** \brief bidirectional disconnect 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
Florin Coras6cf30ad2017-04-04 23:08:23 -0700217 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500218*/
219define disconnect_session {
220 u32 client_index;
221 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700222 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500223};
224
225/** \brief bidirectional disconnect reply API
226 @param client_index - opaque cookie to identify the sender
227 client to vpp direction only
228 @param context - sender context, to match reply w/ request
229 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700230 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500231*/
232define disconnect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500233 u32 context;
234 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700235 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500236};
237
238/** \brief vpp->client reset session API
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
Florin Coras6cf30ad2017-04-04 23:08:23 -0700242 @param handle - session handle obtained via accept/connects
Dave Barach68b0fb02017-02-28 15:15:56 -0500243*/
244define reset_session {
245 u32 client_index;
246 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700247 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500248};
249
250/** \brief client->vpp reset session reply
251 @param client_index - opaque cookie to identify the sender
252 client to vpp direction only
253 @param context - sender context, to match reply w/ request
254 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700255 @param handle - session handle obtained via accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500256*/
257define reset_session_reply {
258 u32 client_index;
259 u32 context;
260 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700261 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500262};
263
264/** \brief Bind to an ip:port pair for a given transport protocol
265 @param client_index - opaque cookie to identify the sender
266 @param context - sender context, to match reply w/ request
267 @param vrf - bind namespace
268 @param is_ip4 - flag that is 1 if ip address family is IPv4
269 @param ip - ip address
270 @param port - port
271 @param proto - protocol 0 - TCP 1 - UDP
272 @param options - socket options, fifo sizes, etc.
273*/
274define bind_sock {
275 u32 client_index;
276 u32 context;
277 u32 vrf;
278 u8 is_ip4;
279 u8 ip[16];
280 u16 port;
281 u8 proto;
282 u64 options[16];
283};
284
285/** \brief Unbind
286 @param client_index - opaque cookie to identify the sender
287 @param context - sender context, to match reply w/ request
288 @param handle - bind handle obtained from bind reply
289*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400290autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500291 u32 client_index;
292 u32 context;
293 u64 handle;
294};
295
296/** \brief Connect to a remote peer
297 @param client_index - opaque cookie to identify the sender
298 @param context - sender context, to match reply w/ request
Florin Corascea194d2017-10-02 00:18:51 -0700299 @param client_queue_address - client's API queue address. Non-zero when
300 used to perform redirects
301 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500302 @param vrf - connection namespace
303 @param is_ip4 - flag that is 1 if ip address family is IPv4
304 @param ip - ip address
305 @param port - port
306 @param proto - protocol 0 - TCP 1 - UDP
Florin Coras8f89dd02018-03-05 16:53:07 -0800307 @param hostname-len - length of hostname
308 @param hostname - destination's hostname. If present, used by protocols
309 like tls.
Dave Barach68b0fb02017-02-28 15:15:56 -0500310*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400311autoreply define connect_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500312 u32 client_index;
313 u32 context;
Florin Corascea194d2017-10-02 00:18:51 -0700314 u64 client_queue_address;
315 u64 options[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500316 u32 vrf;
317 u8 is_ip4;
318 u8 ip[16];
319 u16 port;
320 u8 proto;
Florin Coras8f89dd02018-03-05 16:53:07 -0800321 u8 hostname_len;
322 u8 hostname[hostname_len];
Dave Barach68b0fb02017-02-28 15:15:56 -0500323};
324
325/** \brief Bind reply
326 @param context - sender context, to match reply w/ request
327 @param handle - bind handle
328 @param retval - return code for the request
Florin Coras7fb0fe12018-04-09 09:24:52 -0700329 @param lcl_is_ip4 - local ip address type
330 @param lcl_ip6 - local ip address
331 @param lcl_port - local port
332 @param rx_fifo - rx fifo address if allocated (connectionless)
333 @param tx_fifo - tx fifo address if allocated (connectionless)
334 @param vpp_evt_q - vpp event queue address (connectionless)
Dave Barach68b0fb02017-02-28 15:15:56 -0500335 @param segment_name_length - length of segment name
336 @param segment_name - name of segment client needs to attach to
337*/
338define bind_sock_reply {
339 u32 context;
340 u64 handle;
341 i32 retval;
Florin Corasdcf55ce2017-11-16 15:32:50 -0800342 u8 lcl_is_ip4;
343 u8 lcl_ip[16];
344 u16 lcl_port;
Florin Coras7fb0fe12018-04-09 09:24:52 -0700345 u64 rx_fifo;
346 u64 tx_fifo;
347 u64 vpp_evt_q;
Dave Barach68b0fb02017-02-28 15:15:56 -0500348 u32 segment_size;
349 u8 segment_name_length;
350 u8 segment_name[128];
351};
352
Dave Wallace33e002b2017-09-06 01:20:02 -0400353/* Dummy connect message -- needed to satisfy api generators
354*
355* NEVER USED, doxygen tags elided on purpose.
356*/
357define connect_session {
358 u32 client_index;
359 u32 context;
360};
361
362/** \brief vpp/server->client, connect reply -- used for all connect_* messages
Dave Barach68b0fb02017-02-28 15:15:56 -0500363 @param context - sender context, to match reply w/ request
364 @param retval - return code for the request
365 @param handle - connection handle
366 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
367 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
368 @param vpp_event_queue_address - vpp's event queue address
Florin Corasf8f516a2018-02-08 15:10:09 -0800369 @param client_event_queue_address - client's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700370 @param segment_size - size of segment to be attached. Only for redirects.
Dave Barach68b0fb02017-02-28 15:15:56 -0500371 @param segment_name_length - non-zero if the client needs to attach to
372 the fifo segment
373 @param segment_name - set if the client needs to attach to the segment
Florin Corasade70e42017-10-14 18:56:41 -0700374 @param lcl_ip - local ip for connection
375 @param is_ip4 - flag to indicate if ip is v4 or v6
376 @param lcl_port - local port
Dave Barach68b0fb02017-02-28 15:15:56 -0500377*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400378define connect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500379 u32 context;
380 i32 retval;
381 u64 handle;
382 u64 server_rx_fifo;
383 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500384 u64 vpp_event_queue_address;
Florin Corasf8f516a2018-02-08 15:10:09 -0800385 u64 client_event_queue_address;
Dave Barach68b0fb02017-02-28 15:15:56 -0500386 u32 segment_size;
387 u8 segment_name_length;
388 u8 segment_name[128];
Florin Corasade70e42017-10-14 18:56:41 -0700389 u8 lcl_ip[16];
390 u8 is_ip4;
391 u16 lcl_port;
Dave Barach68b0fb02017-02-28 15:15:56 -0500392};
393
Florin Corase04c2992017-03-01 08:17:34 -0800394/** \brief enable/disable session layer
395 @param client_index - opaque cookie to identify the sender
396 client to vpp direction only
397 @param context - sender context, to match reply w/ request
398 @param is_enable - disable session layer if 0, enable otherwise
399*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400400autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800401 u32 client_index;
402 u32 context;
403 u8 is_enable;
404};
405
Florin Corascea194d2017-10-02 00:18:51 -0700406/** \brief add/del application namespace
407 @param client_index - opaque cookie to identify the sender
408 client to vpp direction only
409 @param context - sender context, to match reply w/ request
410 @param secret - secret shared between app and vpp
411 @param sw_if_index - local interface that "supports" namespace. Set to
412 ~0 if no preference
413 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
414 if sw_if_index set.
415 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
416 if sw_if_index set.
417 @param namespace_id_len - length of namespace id lower
418 @param namespace_id - namespace id
419*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800420define app_namespace_add_del {
Florin Corascea194d2017-10-02 00:18:51 -0700421 u32 client_index;
422 u32 context;
423 u64 secret;
424 u32 sw_if_index;
425 u32 ip4_fib_id;
426 u32 ip6_fib_id;
427 u8 namespace_id_len;
428 u8 namespace_id[64];
429};
430
Florin Coras6e8c6672017-11-10 09:03:54 -0800431/** \brief Reply for app namespace add/del
432 @param context - returned sender context, to match reply w/ request
433 @param retval - return code
434 @param appns_index - app namespace index
435*/
436define app_namespace_add_del_reply
437{
438 u32 context;
439 i32 retval;
440 u32 appns_index;
441};
442
Florin Coras1c710452017-10-17 00:03:13 -0700443/** \brief add/del session rule
444 @param client_index - opaque cookie to identify the sender
445 client to vpp direction only
446 @param context - sender context, to match reply w/ request
447 @param transport_proto - transport protocol (0 - tcp 1 - udp)
448 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
449 @param lcl_ip - local ip
450 @param lcl_plen - local prefix length
451 @param rmt_ip - remote ip
452 @param rmt_ple - remote prefix length
453 @param lcl_port - local port
454 @param rmt_port - remote port
455 @param action_index - the only action defined now is forward to
456 application with index action_index
457 @param is_add - flag to indicate if add or del
458 @param appns_index - application namespace where rule is to be applied
459 to
460 @param scope - flag that indicates scope of the rule: global or local.
461 If 0, default is global, 1 is global 2 is local, 3 is
462 both
463*/
464autoreply define session_rule_add_del {
465 u32 client_index;
466 u32 context;
467 u8 transport_proto;
468 u8 is_ip4;
469 u8 lcl_ip[16];
470 u8 lcl_plen;
471 u8 rmt_ip[16];
472 u8 rmt_plen;
473 u16 lcl_port;
474 u16 rmt_port;
475 u32 action_index;
476 u8 is_add;
477 u32 appns_index;
478 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800479 u8 tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700480};
481
Florin Coras6c36f532017-11-03 18:32:34 -0700482/** \brief Dump session rules
483 @param client_index - opaque cookie to identify the sender
484 @param context - sender context, to match reply w/ request
485 */
486define session_rules_dump
487{
488 u32 client_index;
489 u32 context;
490};
491
492/** \brief Session rules details
493 @param context - sender context, to match reply w/ request
494 @param transport_proto - transport protocol (0 - tcp 1 - udp)
495 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
496 @param lcl_ip - local ip
497 @param lcl_plen - local prefix length
498 @param rmt_ip - remote ip
499 @param rmt_ple - remote prefix length
500 @param lcl_port - local port
501 @param rmt_port - remote port
502 @param action_index - the only action defined now is forward to
503 application with index action_index
504 @param appns_index - application namespace where rule is to be applied
505 to
506 @param scope - flag that indicates scope of the rule: global or local.
507 If 0, default is global, 1 is global 2 is local, 3 is
508 both
509 */
510define session_rules_details
511{
512 u32 context;
513 u8 transport_proto;
514 u8 is_ip4;
515 u8 lcl_ip[16];
516 u8 lcl_plen;
517 u8 rmt_ip[16];
518 u8 rmt_plen;
519 u16 lcl_port;
520 u16 rmt_port;
521 u32 action_index;
522 u32 appns_index;
523 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800524 u8 tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700525};
526
Dave Barach68b0fb02017-02-28 15:15:56 -0500527/*
528 * Local Variables:
529 * eval: (c-set-style "gnu")
530 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400531 */