FD.io VPP  v17.04-9-g99c0734
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  /** \brief Bind to a given URI
17  @param client_index - opaque cookie to identify the sender
18  @param context - sender context, to match reply w/ request
19  @param accept_cookie - sender accept cookie, to identify this bind flavor
20  @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
21  "tcp://::/0/80" [ipv6] etc.
22  @param options - socket options, fifo sizes, etc.
23 */
24 define bind_uri {
29  u8 uri[128];
30  u64 options[16];
31 };
32 
33 /** \brief Unbind a given URI
34  @param client_index - opaque cookie to identify the sender
35  @param context - sender context, to match reply w/ request
36  @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
37  "tcp://::/0/80" [ipv6], etc.
38  @param options - socket options, fifo sizes, etc.
39 */
40 define unbind_uri {
43  u8 uri[128];
44 };
45 
46 /** \brief Connect to a given URI
47  @param client_index - opaque cookie to identify the sender
48  @param context - sender context, to match reply w/ request
49  @param accept_cookie - sender accept cookie, to identify this bind flavor
50  @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
51  "tcp6://::/0/80" [ipv6], etc.
52  @param options - socket options, fifo sizes, etc.
53 */
54 define connect_uri {
57  u8 uri[128];
59  u64 options[16];
60 };
61 
62 /** \brief Bind reply
63  @param context - sender context, to match reply w/ request
64  @param retval - return code for the request
65  @param event_queue_address - vpp event queue address or 0 if this
66  connection shouldn't send events
67  @param segment_name_length - length of segment name
68  @param segment_name - name of segment client needs to attach to
69 */
70 define bind_uri_reply {
76  u8 segment_name[128];
77 };
78 
79 /** \brief unbind reply
80  @param context - sender context, to match reply w/ request
81  @param retval - return code for the request
82 */
83 define unbind_uri_reply {
86 };
87 
88 /** \brief vpp->client, connect reply
89  @param context - sender context, to match reply w/ request
90  @param retval - return code for the request
91  @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
92  @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
93  @param session_index - session index;
94  @param session_thread_index - session thread index
95  @param session_type - session thread type
96  @param vpp_event_queue_address - vpp's event queue address
97  @param client_event_queue_address - client's event queue address
98  @param segment_name_length - non-zero if the client needs to attach to
99  the fifo segment
100  @param segment_name - set if the client needs to attach to the segment
101 */
102 define connect_uri_reply {
114  u8 segment_name[128];
115 };
116 
117 /** \brief vpp->client, please map an additional shared memory segment
118  @param context - sender context, to match reply w/ request
119  @param segment_name -
120 */
121 define map_another_segment {
125  u8 segment_name[128];
126 };
127 
128 /** \brief client->vpp
129  @param context - sender context, to match reply w/ request
130  @param retval - return code for the request
131 */
132 define map_another_segment_reply {
135 };
136 
137 /** \brief vpp->client, accept this session
138  @param context - sender context, to match reply w/ request
139  @param accept_cookie - tells client which bind flavor just occurred
140  @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
141  @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
142  @param session_index - index of new session
143  @param session_thread_index - thread index of new session
144  @param vpp_event_queue_address - vpp's event queue address
145  @param session_type - type of session
146 
147 */
148 define accept_session {
158 };
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 */
167 define accept_session_reply {
173 };
174 
175 /** \brief bidirectional disconnect API
176  @param client_index - opaque cookie to identify the sender
177  client to vpp direction only
178  @param context - sender context, to match reply w/ request
179  @param session_index - cookie #1 from accept_session / connect_reply
180  @param session_thread_index - cookie #2
181 */
182 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 session_index - session index from accept_session / connect_reply
195  @param session_thread_index - thread index from accept_session /
196  connect_reply
197 */
198 define disconnect_session_reply {
204 };
205 
206 /** \brief vpp->client reset session API
207  @param client_index - opaque cookie to identify the sender
208  client to vpp direction only
209  @param context - sender context, to match reply w/ request
210  @param session_index - session index from accept_session / connect_reply
211  @param session_thread_index - thread index from accept_session /
212  connect_reply
213 */
214 define reset_session {
219 };
220 
221 /** \brief client->vpp reset session reply
222  @param client_index - opaque cookie to identify the sender
223  client to vpp direction only
224  @param context - sender context, to match reply w/ request
225  @param retval - return code for the request
226  @param session_index - session index from accept_session / connect_reply
227  @param session_thread_index - thread index from accept_session /
228  connect_reply
229 */
230 define reset_session_reply {
236 };
237 
238 /** \brief Bind to an ip:port pair for a given transport protocol
239  @param client_index - opaque cookie to identify the sender
240  @param context - sender context, to match reply w/ request
241  @param vrf - bind namespace
242  @param is_ip4 - flag that is 1 if ip address family is IPv4
243  @param ip - ip address
244  @param port - port
245  @param proto - protocol 0 - TCP 1 - UDP
246  @param options - socket options, fifo sizes, etc.
247 */
248 define bind_sock {
253  u8 ip[16];
256  u64 options[16];
257 };
258 
259 /** \brief Unbind
260  @param client_index - opaque cookie to identify the sender
261  @param context - sender context, to match reply w/ request
262  @param handle - bind handle obtained from bind reply
263 */
264 define unbind_sock {
268 };
269 
270 /** \brief Connect to a remote peer
271  @param client_index - opaque cookie to identify the sender
272  @param context - sender context, to match reply w/ request
273  @param vrf - connection namespace
274  @param is_ip4 - flag that is 1 if ip address family is IPv4
275  @param ip - ip address
276  @param port - port
277  @param proto - protocol 0 - TCP 1 - UDP
278  @param client_queue_address - client's API queue address. Non-zero when
279  used to perform redirects
280  @param options - socket options, fifo sizes, etc.
281 */
282 define connect_sock {
287  u8 ip[16];
291  u64 options[16];
292 };
293 
294 /** \brief Bind reply
295  @param context - sender context, to match reply w/ request
296  @param handle - bind handle
297  @param retval - return code for the request
298  @param event_queue_address - vpp event queue address or 0 if this
299  connection shouldn't send events
300  @param segment_name_length - length of segment name
301  @param segment_name - name of segment client needs to attach to
302 */
303 define bind_sock_reply {
310  u8 segment_name[128];
311 };
312 
313 /** \brief unbind reply
314  @param context - sender context, to match reply w/ request
315  @param retval - return code for the request
316 */
317 define unbind_sock_reply {
320 };
321 
322 /** \brief vpp/server->client, connect reply
323  @param context - sender context, to match reply w/ request
324  @param retval - return code for the request
325  @param handle - connection handle
326  @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
327  @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
328  @param vpp_event_queue_address - vpp's event queue address
329  @param client_event_queue_address - client's event queue address
330  @param segment_name_length - non-zero if the client needs to attach to
331  the fifo segment
332  @param segment_name - set if the client needs to attach to the segment
333 */
334 define connect_sock_reply {
344  u8 segment_name[128];
345 };
346 
347 /** \brief bidirectional disconnect API
348  @param client_index - opaque cookie to identify the sender
349  client to vpp direction only
350  @param context - sender context, to match reply w/ request
351  @param handle - session handle obtained through accept/connect
352 */
353 define disconnect_sock {
357 };
358 
359 /** \brief bidirectional disconnect reply API
360  @param client_index - opaque cookie to identify the sender
361  client to vpp direction only
362  @param client_context - sender context, to match reply w/ request
363  @param handle - session handle obtained through accept/connect
364 */
365 define disconnect_sock_reply {
370 };
371 
372 /** \brief vpp->client, accept this session
373  @param context - sender context, to match reply w/ request
374  @param accept_cookie - tells client which bind flavor just occurred
375  @param handle - session handle obtained through accept/connect
376  @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
377  @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
378  @param vpp_event_queue_address - vpp's event queue address
379 */
380 define accept_sock {
388 };
389 
390 /** \brief client->vpp, reply to an accept message
391  @param context - sender context, to match reply w/ request
392  @param retval - return code for the request
393  @param handle - session handle obtained through accept/connect
394 */
395 define accept_sock_reply {
399 };
400 
401 /** \brief vpp->client reset session API
402  @param client_index - opaque cookie to identify the sender
403  client to vpp direction only
404  @param context - sender context, to match reply w/ request
405  @param handle - session handle obtained through accept/connect
406 */
407 define reset_sock {
411 };
412 
413 /** \brief client->vpp reset session reply
414  @param client_index - opaque cookie to identify the sender
415  client to vpp direction only
416  @param context - sender context, to match reply w/ request
417  @param handle - session handle obtained through accept/connect
418 */
419 define reset_sock_reply {
424 };
425 
426 /** \brief enable/disable session layer
427  @param client_index - opaque cookie to identify the sender
428  client to vpp direction only
429  @param context - sender context, to match reply w/ request
430  @param is_enable - disable session layer if 0, enable otherwise
431 */
432 define session_enable_disable {
436 };
437 
438 /** \brief Reply for session enable/disable
439  @param context - returned sender context, to match reply w/ request
440  @param retval - return code
441 */
442 define session_enable_disable_reply {
445 };
446 
447 /*
448  * Local Variables:
449  * eval: (c-set-style "gnu")
450  * End:
451  */
int i32
Definition: types.h:81
unsigned long u64
Definition: types.h:89
u32 initial_segment_size
Definition: session.api:28
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56