FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
session.api
Go to the documentation of this file.
1 /*
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  */
15 
16 option version = "1.0.2";
17 
18 /** \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.
24  @param namespace_id_len - length of the namespace id c-string
25  @param namespace_id - 0 terminted c-string
26 */
27  define application_attach {
31  u64 options[16];
33  u8 namespace_id [64];
34  };
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 */
45 define application_attach_reply {
51  u8 segment_name[128];
52 };
53 
54 /** \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 */
60 autoreply define application_tls_cert_add {
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 */
74 autoreply define application_tls_key_add {
79  u8 key[key_len];
80 };
81 
82  /** \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 */
86 autoreply define application_detach {
89  };
90 
91 /** \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 */
96 autoreply define map_another_segment {
100  u8 segment_name[128];
101 };
102 
103 /** \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 */
108 autoreply define unmap_segment {
111  u8 segment_name[128];
112 };
113 
114  /** \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 */
122 autoreply define bind_uri {
126  u8 uri[128];
127 };
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 */
136 autoreply define unbind_uri {
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
145  @param client_queue_address - binary API client queue address. Used by
146  local server when connect was redirected.
147  @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.
151 */
152 autoreply define connect_uri {
156  u64 options[16];
157  u8 uri[128];
158 };
159 
160 /** \brief vpp->client, accept this session
161  @param context - sender context, to match reply w/ request
162  @param listener_handle - tells client which listener this pertains to
163  @param handle - unique session identifier
164  @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
165  @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
166  @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
170  @param port - remote port
171  @param is_ip4 - 1 if the ip is ip4
172  @param ip - remote ip
173 */
174 define accept_session {
185  u8 ip[16];
186 };
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 */
195 define accept_session_reply {
199 };
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
205  @param handle - session handle obtained from accept/connect
206 */
207 define disconnect_session {
211 };
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
218  @param handle - session handle
219 */
220 define disconnect_session_reply {
224 };
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
230  @param handle - session handle obtained via accept/connects
231 */
232 define reset_session {
236 };
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
243  @param handle - session handle obtained via accept/connect
244 */
245 define reset_session_reply {
250 };
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 */
262 define bind_sock {
267  u8 ip[16];
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 */
278 autoreply define unbind_sock {
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
287  @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
290  @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
295  @param hostname-len - length of hostname
296  @param hostname - destination's hostname. If present, used by protocols
297  like tls.
298 */
299 autoreply define connect_sock {
303  u64 options[16];
306  u8 ip[16];
310  u8 hostname[hostname_len];
311 };
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 */
322 define bind_sock_reply {
328  u8 lcl_ip[16];
332  u8 segment_name[128];
333 };
334 
335 /* Dummy connect message -- needed to satisfy api generators
336 *
337 * NEVER USED, doxygen tags elided on purpose.
338 */
339 define connect_session {
342 };
343 
344 /** \brief vpp/server->client, connect reply -- used for all connect_* messages
345  @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
351  @param client_event_queue_address - client's event queue address
352  @param segment_size - size of segment to be attached. Only for redirects.
353  @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
356  @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
359 */
360 define connect_session_reply {
370  u8 segment_name[128];
371  u8 lcl_ip[16];
374 };
375 
376 /** \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 */
382 autoreply define session_enable_disable {
386 };
387 
388 /** \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 */
402 define app_namespace_add_del {
410  u8 namespace_id[64];
411 };
412 
413 /** \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 */
418 define app_namespace_add_del_reply
419 {
423 };
424 
425 /** \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 */
446 autoreply define session_rule_add_del {
451  u8 lcl_ip[16];
453  u8 rmt_ip[16];
461  u8 tag[64];
462 };
463 
464 /** \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  */
468 define session_rules_dump
469 {
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  */
492 define session_rules_details
493 {
497  u8 lcl_ip[16];
499  u8 rmt_ip[16];
506  u8 tag[64];
507 };
508 
509 /*
510  * Local Variables:
511  * eval: (c-set-style "gnu")
512  * End:
513  */
int i32
Definition: types.h:81
unsigned long u64
Definition: types.h:89
option version
Definition: session.api:16
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56