blob: a6739fc61bf206c51afdba5bc0257997ce20732f [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 Corasf8f516a2018-02-08 15:10:09 -080016option version = "1.0.1";
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
54 /** \brief client->vpp, attach application to session layer
55 @param client_index - opaque cookie to identify the sender
56 @param context - sender context, to match reply w/ request
57*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040058autoreply define application_detach {
Florin Coras6cf30ad2017-04-04 23:08:23 -070059 u32 client_index;
60 u32 context;
61 };
62
Florin Coras6cf30ad2017-04-04 23:08:23 -070063/** \brief vpp->client, please map an additional shared memory segment
64 @param client_index - opaque cookie to identify the sender
65 @param context - sender context, to match reply w/ request
66 @param segment_name -
67*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040068autoreply define map_another_segment {
Florin Coras6cf30ad2017-04-04 23:08:23 -070069 u32 client_index;
70 u32 context;
71 u32 segment_size;
72 u8 segment_name[128];
73};
74
Florin Corasf8f516a2018-02-08 15:10:09 -080075/** \brief vpp->client unmap shared memory segment
76 @param client_index - opaque cookie to identify the sender
77 @param context - sender context, to match reply w/ request
78 @param segment_name -
79*/
80autoreply define unmap_segment {
81 u32 client_index;
82 u32 context;
83 u8 segment_name[128];
84};
85
Dave Barach68b0fb02017-02-28 15:15:56 -050086 /** \brief Bind to a given URI
87 @param client_index - opaque cookie to identify the sender
88 @param context - sender context, to match reply w/ request
89 @param accept_cookie - sender accept cookie, to identify this bind flavor
90 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
91 "tcp://::/0/80" [ipv6] etc.
92 @param options - socket options, fifo sizes, etc.
93*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040094autoreply define bind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -050095 u32 client_index;
96 u32 context;
97 u32 accept_cookie;
Dave Barach68b0fb02017-02-28 15:15:56 -050098 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -050099};
100
101/** \brief Unbind a given URI
102 @param client_index - opaque cookie to identify the sender
103 @param context - sender context, to match reply w/ request
104 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
105 "tcp://::/0/80" [ipv6], etc.
106 @param options - socket options, fifo sizes, etc.
107*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400108autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500109 u32 client_index;
110 u32 context;
111 u8 uri[128];
112};
113
114/** \brief Connect to a given URI
115 @param client_index - opaque cookie to identify the sender
116 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700117 @param client_queue_address - binary API client queue address. Used by
118 local server when connect was redirected.
Florin Corascea194d2017-10-02 00:18:51 -0700119 @param options - socket options, fifo sizes, etc. passed by vpp to the
120 server when redirecting connects
121 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
122 "tcp6://::/0/80" [ipv6], etc.
Dave Barach68b0fb02017-02-28 15:15:56 -0500123*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400124autoreply define connect_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500125 u32 client_index;
126 u32 context;
Dave Barach68b0fb02017-02-28 15:15:56 -0500127 u64 client_queue_address;
128 u64 options[16];
Florin Corascea194d2017-10-02 00:18:51 -0700129 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500130};
131
Dave Barach68b0fb02017-02-28 15:15:56 -0500132/** \brief vpp->client, accept this session
133 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700134 @param listener_handle - tells client which listener this pertains to
135 @param handle - unique session identifier
Dave Barach68b0fb02017-02-28 15:15:56 -0500136 @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
137 @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
Florin Corasf8f516a2018-02-08 15:10:09 -0800138 @param vpp_event_queue_address - vpp's event queue address or client's
139 event queue for cut through
140 @param server_event_queue_address - server's event queue address for
141 cut through sessions
Florin Coras6cf30ad2017-04-04 23:08:23 -0700142 @param port - remote port
143 @param is_ip4 - 1 if the ip is ip4
144 @param ip - remote ip
Dave Barach68b0fb02017-02-28 15:15:56 -0500145*/
146define accept_session {
147 u32 client_index;
148 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700149 u64 listener_handle;
150 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500151 u64 server_rx_fifo;
152 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500153 u64 vpp_event_queue_address;
Florin Corasf8f516a2018-02-08 15:10:09 -0800154 u64 server_event_queue_address;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700155 u16 port;
156 u8 is_ip4;
157 u8 ip[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500158};
159
160/** \brief client->vpp, reply to an accept message
161 @param context - sender context, to match reply w/ request
162 @param retval - return code for the request
163 @param session_index - session index from accept_session / connect_reply
164 @param session_thread_index - thread index from accept_session /
165 connect_reply
166*/
167define accept_session_reply {
168 u32 context;
169 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700170 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500171};
172
173/** \brief bidirectional disconnect API
174 @param client_index - opaque cookie to identify the sender
175 client to vpp direction only
176 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700177 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500178*/
179define disconnect_session {
180 u32 client_index;
181 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700182 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500183};
184
185/** \brief bidirectional disconnect reply API
186 @param client_index - opaque cookie to identify the sender
187 client to vpp direction only
188 @param context - sender context, to match reply w/ request
189 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700190 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500191*/
192define disconnect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500193 u32 context;
194 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700195 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500196};
197
198/** \brief vpp->client reset session API
199 @param client_index - opaque cookie to identify the sender
200 client to vpp direction only
201 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700202 @param handle - session handle obtained via accept/connects
Dave Barach68b0fb02017-02-28 15:15:56 -0500203*/
204define reset_session {
205 u32 client_index;
206 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700207 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500208};
209
210/** \brief client->vpp reset session reply
211 @param client_index - opaque cookie to identify the sender
212 client to vpp direction only
213 @param context - sender context, to match reply w/ request
214 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700215 @param handle - session handle obtained via accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500216*/
217define reset_session_reply {
218 u32 client_index;
219 u32 context;
220 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700221 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500222};
223
224/** \brief Bind to an ip:port pair for a given transport protocol
225 @param client_index - opaque cookie to identify the sender
226 @param context - sender context, to match reply w/ request
227 @param vrf - bind namespace
228 @param is_ip4 - flag that is 1 if ip address family is IPv4
229 @param ip - ip address
230 @param port - port
231 @param proto - protocol 0 - TCP 1 - UDP
232 @param options - socket options, fifo sizes, etc.
233*/
234define bind_sock {
235 u32 client_index;
236 u32 context;
237 u32 vrf;
238 u8 is_ip4;
239 u8 ip[16];
240 u16 port;
241 u8 proto;
242 u64 options[16];
243};
244
245/** \brief Unbind
246 @param client_index - opaque cookie to identify the sender
247 @param context - sender context, to match reply w/ request
248 @param handle - bind handle obtained from bind reply
249*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400250autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500251 u32 client_index;
252 u32 context;
253 u64 handle;
254};
255
256/** \brief Connect to a remote peer
257 @param client_index - opaque cookie to identify the sender
258 @param context - sender context, to match reply w/ request
Florin Corascea194d2017-10-02 00:18:51 -0700259 @param client_queue_address - client's API queue address. Non-zero when
260 used to perform redirects
261 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500262 @param vrf - connection namespace
263 @param is_ip4 - flag that is 1 if ip address family is IPv4
264 @param ip - ip address
265 @param port - port
266 @param proto - protocol 0 - TCP 1 - UDP
Dave Barach68b0fb02017-02-28 15:15:56 -0500267*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400268autoreply define connect_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500269 u32 client_index;
270 u32 context;
Florin Corascea194d2017-10-02 00:18:51 -0700271 u64 client_queue_address;
272 u64 options[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500273 u32 vrf;
274 u8 is_ip4;
275 u8 ip[16];
276 u16 port;
277 u8 proto;
Dave Barach68b0fb02017-02-28 15:15:56 -0500278};
279
280/** \brief Bind reply
281 @param context - sender context, to match reply w/ request
282 @param handle - bind handle
283 @param retval - return code for the request
284 @param event_queue_address - vpp event queue address or 0 if this
285 connection shouldn't send events
286 @param segment_name_length - length of segment name
287 @param segment_name - name of segment client needs to attach to
288*/
289define bind_sock_reply {
290 u32 context;
291 u64 handle;
292 i32 retval;
293 u64 server_event_queue_address;
Florin Corasdcf55ce2017-11-16 15:32:50 -0800294 u8 lcl_is_ip4;
295 u8 lcl_ip[16];
296 u16 lcl_port;
Dave Barach68b0fb02017-02-28 15:15:56 -0500297 u32 segment_size;
298 u8 segment_name_length;
299 u8 segment_name[128];
300};
301
Dave Wallace33e002b2017-09-06 01:20:02 -0400302/* Dummy connect message -- needed to satisfy api generators
303*
304* NEVER USED, doxygen tags elided on purpose.
305*/
306define connect_session {
307 u32 client_index;
308 u32 context;
309};
310
311/** \brief vpp/server->client, connect reply -- used for all connect_* messages
Dave Barach68b0fb02017-02-28 15:15:56 -0500312 @param context - sender context, to match reply w/ request
313 @param retval - return code for the request
314 @param handle - connection handle
315 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
316 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
317 @param vpp_event_queue_address - vpp's event queue address
Florin Corasf8f516a2018-02-08 15:10:09 -0800318 @param client_event_queue_address - client's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700319 @param segment_size - size of segment to be attached. Only for redirects.
Dave Barach68b0fb02017-02-28 15:15:56 -0500320 @param segment_name_length - non-zero if the client needs to attach to
321 the fifo segment
322 @param segment_name - set if the client needs to attach to the segment
Florin Corasade70e42017-10-14 18:56:41 -0700323 @param lcl_ip - local ip for connection
324 @param is_ip4 - flag to indicate if ip is v4 or v6
325 @param lcl_port - local port
Dave Barach68b0fb02017-02-28 15:15:56 -0500326*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400327define connect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500328 u32 context;
329 i32 retval;
330 u64 handle;
331 u64 server_rx_fifo;
332 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500333 u64 vpp_event_queue_address;
Florin Corasf8f516a2018-02-08 15:10:09 -0800334 u64 client_event_queue_address;
Dave Barach68b0fb02017-02-28 15:15:56 -0500335 u32 segment_size;
336 u8 segment_name_length;
337 u8 segment_name[128];
Florin Corasade70e42017-10-14 18:56:41 -0700338 u8 lcl_ip[16];
339 u8 is_ip4;
340 u16 lcl_port;
Dave Barach68b0fb02017-02-28 15:15:56 -0500341};
342
Florin Corase04c2992017-03-01 08:17:34 -0800343/** \brief enable/disable session layer
344 @param client_index - opaque cookie to identify the sender
345 client to vpp direction only
346 @param context - sender context, to match reply w/ request
347 @param is_enable - disable session layer if 0, enable otherwise
348*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400349autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800350 u32 client_index;
351 u32 context;
352 u8 is_enable;
353};
354
Florin Corascea194d2017-10-02 00:18:51 -0700355/** \brief add/del application namespace
356 @param client_index - opaque cookie to identify the sender
357 client to vpp direction only
358 @param context - sender context, to match reply w/ request
359 @param secret - secret shared between app and vpp
360 @param sw_if_index - local interface that "supports" namespace. Set to
361 ~0 if no preference
362 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
363 if sw_if_index set.
364 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
365 if sw_if_index set.
366 @param namespace_id_len - length of namespace id lower
367 @param namespace_id - namespace id
368*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800369define app_namespace_add_del {
Florin Corascea194d2017-10-02 00:18:51 -0700370 u32 client_index;
371 u32 context;
372 u64 secret;
373 u32 sw_if_index;
374 u32 ip4_fib_id;
375 u32 ip6_fib_id;
376 u8 namespace_id_len;
377 u8 namespace_id[64];
378};
379
Florin Coras6e8c6672017-11-10 09:03:54 -0800380/** \brief Reply for app namespace add/del
381 @param context - returned sender context, to match reply w/ request
382 @param retval - return code
383 @param appns_index - app namespace index
384*/
385define app_namespace_add_del_reply
386{
387 u32 context;
388 i32 retval;
389 u32 appns_index;
390};
391
Florin Coras1c710452017-10-17 00:03:13 -0700392/** \brief add/del session rule
393 @param client_index - opaque cookie to identify the sender
394 client to vpp direction only
395 @param context - sender context, to match reply w/ request
396 @param transport_proto - transport protocol (0 - tcp 1 - udp)
397 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
398 @param lcl_ip - local ip
399 @param lcl_plen - local prefix length
400 @param rmt_ip - remote ip
401 @param rmt_ple - remote prefix length
402 @param lcl_port - local port
403 @param rmt_port - remote port
404 @param action_index - the only action defined now is forward to
405 application with index action_index
406 @param is_add - flag to indicate if add or del
407 @param appns_index - application namespace where rule is to be applied
408 to
409 @param scope - flag that indicates scope of the rule: global or local.
410 If 0, default is global, 1 is global 2 is local, 3 is
411 both
412*/
413autoreply define session_rule_add_del {
414 u32 client_index;
415 u32 context;
416 u8 transport_proto;
417 u8 is_ip4;
418 u8 lcl_ip[16];
419 u8 lcl_plen;
420 u8 rmt_ip[16];
421 u8 rmt_plen;
422 u16 lcl_port;
423 u16 rmt_port;
424 u32 action_index;
425 u8 is_add;
426 u32 appns_index;
427 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800428 u8 tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700429};
430
Florin Coras6c36f532017-11-03 18:32:34 -0700431/** \brief Dump session rules
432 @param client_index - opaque cookie to identify the sender
433 @param context - sender context, to match reply w/ request
434 */
435define session_rules_dump
436{
437 u32 client_index;
438 u32 context;
439};
440
441/** \brief Session rules details
442 @param context - sender context, to match reply w/ request
443 @param transport_proto - transport protocol (0 - tcp 1 - udp)
444 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
445 @param lcl_ip - local ip
446 @param lcl_plen - local prefix length
447 @param rmt_ip - remote ip
448 @param rmt_ple - remote prefix length
449 @param lcl_port - local port
450 @param rmt_port - remote port
451 @param action_index - the only action defined now is forward to
452 application with index action_index
453 @param appns_index - application namespace where rule is to be applied
454 to
455 @param scope - flag that indicates scope of the rule: global or local.
456 If 0, default is global, 1 is global 2 is local, 3 is
457 both
458 */
459define session_rules_details
460{
461 u32 context;
462 u8 transport_proto;
463 u8 is_ip4;
464 u8 lcl_ip[16];
465 u8 lcl_plen;
466 u8 rmt_ip[16];
467 u8 rmt_plen;
468 u16 lcl_port;
469 u16 rmt_port;
470 u32 action_index;
471 u32 appns_index;
472 u8 scope;
Florin Corasc97a7392017-11-05 23:07:07 -0800473 u8 tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700474};
475
Dave Barach68b0fb02017-02-28 15:15:56 -0500476/*
477 * Local Variables:
478 * eval: (c-set-style "gnu")
479 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400480 */