FD.io VPP  v17.07-30-g839fa73
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 client->vpp, attach application to session layer
17  @param client_index - opaque cookie to identify the sender
18  @param context - sender context, to match reply w/ request
19  @param initial_segment_size - size of the initial shm segment to be
20  allocated
21  @param options - segment size, fifo sizes, etc.
22 */
23  define application_attach {
27  u64 options[16];
28  };
29 
30  /** \brief Application attach reply
31  @param context - sender context, to match reply w/ request
32  @param retval - return code for the request
33  @param app_event_queue_address - vpp event queue address or 0 if this
34  connection shouldn't send events
35  @param segment_size - size of first shm segment
36  @param segment_name_length - length of segment name
37  @param segment_name - name of segment client needs to attach to
38 */
39 define application_attach_reply {
45  u8 segment_name[128];
46 };
47 
48  /** \brief client->vpp, attach application to session layer
49  @param client_index - opaque cookie to identify the sender
50  @param context - sender context, to match reply w/ request
51 */
52 autoreply define application_detach {
55  };
56 
57 /** \brief vpp->client, please map an additional shared memory segment
58  @param client_index - opaque cookie to identify the sender
59  @param context - sender context, to match reply w/ request
60  @param segment_name -
61 */
62 autoreply define map_another_segment {
66  u8 segment_name[128];
67 };
68 
69  /** \brief Bind to a given URI
70  @param client_index - opaque cookie to identify the sender
71  @param context - sender context, to match reply w/ request
72  @param accept_cookie - sender accept cookie, to identify this bind flavor
73  @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
74  "tcp://::/0/80" [ipv6] etc.
75  @param options - socket options, fifo sizes, etc.
76 */
77 autoreply define bind_uri {
81  u8 uri[128];
82 };
83 
84 /** \brief Unbind a given URI
85  @param client_index - opaque cookie to identify the sender
86  @param context - sender context, to match reply w/ request
87  @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
88  "tcp://::/0/80" [ipv6], etc.
89  @param options - socket options, fifo sizes, etc.
90 */
91 autoreply define unbind_uri {
94  u8 uri[128];
95 };
96 
97 /** \brief Connect to a given URI
98  @param client_index - opaque cookie to identify the sender
99  @param context - sender context, to match reply w/ request
100  @param accept_cookie - sender accept cookie, to identify this bind flavor
101  @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
102  "tcp6://::/0/80" [ipv6], etc.
103  @param options - socket options, fifo sizes, etc. passed by vpp to the
104  server when redirecting connects
105  @param client_queue_address - binary API client queue address. Used by
106  local server when connect was redirected.
107 */
108 define connect_uri {
111  u8 uri[128];
113  u64 options[16];
114 };
115 
116 /** \brief vpp->client, connect reply
117  @param context - sender context, to match reply w/ request
118  @param retval - return code for the request
119  @param handle - session handle
120  @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
121  @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
122  @param vpp_event_queue_address - vpp's event queue address
123  @param segment_size - size of segment to be attached. Only for redirects.
124  @param segment_name_length - non-zero if the client needs to attach to
125  the fifo segment. This should only happen
126  if session was redirected.
127  @param segment_name - set if the client needs to attach to the segment
128 */
129 define connect_uri_reply {
138  u8 segment_name[128];
139 };
140 
141 /** \brief vpp->client, accept this session
142  @param context - sender context, to match reply w/ request
143  @param listener_handle - tells client which listener this pertains to
144  @param handle - unique session identifier
145  @param session_thread_index - thread index of new session
146  @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
147  @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
148  @param vpp_event_queue_address - vpp's event queue address
149  @param port - remote port
150  @param is_ip4 - 1 if the ip is ip4
151  @param ip - remote ip
152 */
153 define accept_session {
163  u8 ip[16];
164 };
165 
166 /** \brief client->vpp, reply to an accept message
167  @param context - sender context, to match reply w/ request
168  @param retval - return code for the request
169  @param session_index - session index from accept_session / connect_reply
170  @param session_thread_index - thread index from accept_session /
171  connect_reply
172 */
173 define accept_session_reply {
177 };
178 
179 /** \brief bidirectional disconnect API
180  @param client_index - opaque cookie to identify the sender
181  client to vpp direction only
182  @param context - sender context, to match reply w/ request
183  @param handle - session handle obtained from accept/connect
184 */
185 define disconnect_session {
189 };
190 
191 /** \brief bidirectional disconnect reply API
192  @param client_index - opaque cookie to identify the sender
193  client to vpp direction only
194  @param context - sender context, to match reply w/ request
195  @param retval - return code for the request
196  @param handle - session handle
197 */
198 define disconnect_session_reply {
203 };
204 
205 /** \brief vpp->client reset session API
206  @param client_index - opaque cookie to identify the sender
207  client to vpp direction only
208  @param context - sender context, to match reply w/ request
209  @param handle - session handle obtained via accept/connects
210 */
211 define reset_session {
215 };
216 
217 /** \brief client->vpp reset session reply
218  @param client_index - opaque cookie to identify the sender
219  client to vpp direction only
220  @param context - sender context, to match reply w/ request
221  @param retval - return code for the request
222  @param handle - session handle obtained via accept/connect
223 */
224 define reset_session_reply {
229 };
230 
231 /** \brief Bind to an ip:port pair for a given transport protocol
232  @param client_index - opaque cookie to identify the sender
233  @param context - sender context, to match reply w/ request
234  @param vrf - bind namespace
235  @param is_ip4 - flag that is 1 if ip address family is IPv4
236  @param ip - ip address
237  @param port - port
238  @param proto - protocol 0 - TCP 1 - UDP
239  @param options - socket options, fifo sizes, etc.
240 */
241 define bind_sock {
246  u8 ip[16];
249  u64 options[16];
250 };
251 
252 /** \brief Unbind
253  @param client_index - opaque cookie to identify the sender
254  @param context - sender context, to match reply w/ request
255  @param handle - bind handle obtained from bind reply
256 */
257 autoreply define unbind_sock {
261 };
262 
263 /** \brief Connect to a remote peer
264  @param client_index - opaque cookie to identify the sender
265  @param context - sender context, to match reply w/ request
266  @param app_connect - application connection id to be returned in reply
267  @param vrf - connection 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 client_queue_address - client's API queue address. Non-zero when
273  used to perform redirects
274  @param options - socket options, fifo sizes, etc. when doing redirects
275 */
276 define connect_sock {
282  u8 ip[16];
286  u64 options[16];
287 };
288 
289 /** \brief Bind reply
290  @param context - sender context, to match reply w/ request
291  @param handle - bind handle
292  @param retval - return code for the request
293  @param event_queue_address - vpp event queue address or 0 if this
294  connection shouldn't send events
295  @param segment_name_length - length of segment name
296  @param segment_name - name of segment client needs to attach to
297 */
298 define bind_sock_reply {
305  u8 segment_name[128];
306 };
307 
308 /** \brief vpp/server->client, connect reply
309  @param context - sender context, to match reply w/ request
310  @param retval - return code for the request
311  @param handle - connection handle
312  @param app_connect - application connection id from connect msg
313  @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
314  @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
315  @param vpp_event_queue_address - vpp's event queue address
316  @param segment_size - size of segment to be attached. Only for redirects.
317  @param segment_name_length - non-zero if the client needs to attach to
318  the fifo segment
319  @param segment_name - set if the client needs to attach to the segment
320 */
321 define connect_sock_reply {
331  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 /*
347  * Local Variables:
348  * eval: (c-set-style "gnu")
349  * End:
350  */
int i32
Definition: types.h:81
unsigned long u64
Definition: types.h:89
unsigned int u32
Definition: types.h:88
unsigned short u16
Definition: types.h:57
unsigned char u8
Definition: types.h:56