FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
session.api
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2019 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.6.0";
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 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)
44  @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
47  @param app_index - index of the newly created app
48  @param segment_handle - handle for segment
49 */
50 define application_attach_reply {
58  u8 segment_name[128];
61 };
62 
63 /** \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 */
69 autoreply define application_tls_cert_add {
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 */
83 autoreply define application_tls_key_add {
88  u8 key[key_len];
89 };
90 
91  /** \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 */
95 autoreply define application_detach {
98  };
99 
100 /** \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
103  @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
108  @param segment_handle - unique identifier for segment
109 */
110 autoreply define map_another_segment {
115  u8 segment_name[128];
117 };
118 
119 /** \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
122  @param segment_name - segment name
123  @param segment_handle - handle of the segment to be unmapped
124 */
125 autoreply define unmap_segment {
129 };
130 
131  /** \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 */
139 autoreply define bind_uri {
143  u8 uri[128];
144 };
145 
146 /** \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 */
153 autoreply define unbind_uri {
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
162  @param client_queue_address - binary API client queue address. Used by
163  local server when connect was redirected.
164  @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.
168 */
169 autoreply define connect_uri {
173  u64 options[16];
174  u8 uri[128];
175 };
176 
177 /** \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
181  @param handle - session handle obtained from accept/connect
182 */
183 define disconnect_session {
187 };
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
194  @param handle - session handle
195 */
196 define disconnect_session_reply {
200 };
201 
202 /** \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
205  @param wrk_index - index of worker requesting the bind
206  @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 */
213 autoreply define bind_sock {
219  u8 ip[16];
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
228  @param wrk_index - index of worker requesting the bind
229  @param handle - bind handle obtained from bind reply
230 */
231 autoreply define unbind_sock {
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
241  @param wrk_index - worker that requests the connect
242  @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
245  @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
250  @param hostname-len - length of hostname
251  @param hostname - destination's hostname. If present, used by protocols
252  like tls.
253 */
254 autoreply define connect_sock {
259  u64 options[16];
262  u8 ip[16];
266  u8 hostname[hostname_len];
267 };
268 
269 /** \brief ask app to add a new cut-through registration
270  @param client_index - opaque cookie to identify the sender
271  client to vpp direction only
272  @param context - sender context, to match reply w/ request
273  @param evt_q_address - address of the mq in ssvm segment
274  @param peer_evt_q_address - address of peer's mq in ssvm segment
275  @param wrk_index - index of worker to receive the registration
276  @param n_fds - number of fds exchanged
277  @param fd_flags - flag indicating the fds that will be exchanged over
278  api socket
279 */
280 autoreply define app_cut_through_registration_add
281 {
289 };
290 
291 /** \brief add/del application worker
292  @param client_index - opaque cookie to identify the sender
293  client to vpp direction only
294  @param context - sender context, to match reply w/ request
295  @param app_index - application index
296  @param wrk_index - worker index, if a delete
297  @param is_add - set if an add
298 */
299 define app_worker_add_del
300 {
306 };
307 
308 /** \brief Reply for app worker add/del
309  @param context - returned sender context, to match reply w/ request
310  @param retval - return code
311  @param wrk_index - worker index, if add
312  @param app_event_queue_address - vpp event queue address of new worker
313  @param n_fds - number of fds exchanged
314  @param fd_flags - set of flags that indicate which fds are to be expected
315  over the socket (set only if socket transport available)
316  @param segment_name_length - length of segment name
317  @param segment_name - name of segment client needs to attach to
318  @param segment_handle - handle for segment
319 */
320 define app_worker_add_del_reply
321 {
329  u8 segment_name[128];
332 };
333 
334 /** \brief enable/disable session layer
335  @param client_index - opaque cookie to identify the sender
336  client to vpp direction only
337  @param context - sender context, to match reply w/ request
338  @param is_enable - disable session layer if 0, enable otherwise
339 */
340 autoreply define session_enable_disable {
344 };
345 
346 /** \brief add/del application namespace
347  @param client_index - opaque cookie to identify the sender
348  client to vpp direction only
349  @param context - sender context, to match reply w/ request
350  @param secret - secret shared between app and vpp
351  @param sw_if_index - local interface that "supports" namespace. Set to
352  ~0 if no preference
353  @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
354  if sw_if_index set.
355  @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
356  if sw_if_index set.
357  @param namespace_id_len - length of namespace id lower
358  @param namespace_id - namespace id
359 */
360 define app_namespace_add_del {
368  u8 namespace_id[64];
369 };
370 
371 /** \brief Reply for app namespace add/del
372  @param context - returned sender context, to match reply w/ request
373  @param retval - return code
374  @param appns_index - app namespace index
375 */
376 define app_namespace_add_del_reply
377 {
381 };
382 
383 /** \brief add/del session rule
384  @param client_index - opaque cookie to identify the sender
385  client to vpp direction only
386  @param context - sender context, to match reply w/ request
387  @param transport_proto - transport protocol (0 - tcp 1 - udp)
388  @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
389  @param lcl_ip - local ip
390  @param lcl_plen - local prefix length
391  @param rmt_ip - remote ip
392  @param rmt_ple - remote prefix length
393  @param lcl_port - local port
394  @param rmt_port - remote port
395  @param action_index - the only action defined now is forward to
396  application with index action_index
397  @param is_add - flag to indicate if add or del
398  @param appns_index - application namespace where rule is to be applied to
399  @param scope - flag that indicates scope of the rule: global or local.
400  If 0, default is global, 1 is global 2 is local, 3 is both
401 */
402 autoreply define session_rule_add_del {
407  u8 lcl_ip[16];
409  u8 rmt_ip[16];
417  u8 tag[64];
418 };
419 
420 /** \brief Dump session rules
421  @param client_index - opaque cookie to identify the sender
422  @param context - sender context, to match reply w/ request
423  */
424 define session_rules_dump
425 {
428 };
429 
430 /** \brief Session rules details
431  @param context - sender context, to match reply w/ request
432  @param transport_proto - transport protocol (0 - tcp 1 - udp)
433  @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
434  @param lcl_ip - local ip
435  @param lcl_plen - local prefix length
436  @param rmt_ip - remote ip
437  @param rmt_ple - remote prefix length
438  @param lcl_port - local port
439  @param rmt_port - remote port
440  @param action_index - the only action defined now is forward to
441  application with index action_index
442  @param appns_index - application namespace where rule is to be applied to
443  @param scope - flag that indicates scope of the rule: global or local.
444  If 0, default is global, 1 is global 2 is local, 3 is both
445  */
446 define session_rules_details
447 {
451  u8 lcl_ip[16];
453  u8 rmt_ip[16];
460  u8 tag[64];
461 };
462 
463 /*
464  * Local Variables:
465  * eval: (c-set-style "gnu")
466  * End:
467  */
unsigned long u64
Definition: types.h:89
unsigned char u8
Definition: types.h:56
unsigned int u32
Definition: types.h:88
option version
Definition: session.api:16
unsigned short u16
Definition: types.h:57
signed int i32
Definition: types.h:77
typedef key
Definition: ipsec.api:244