blob: 4aef09da2a8aa9e4a0a649f66cf2b0f04edadc37 [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 */
15
Florin Coras6cf30ad2017-04-04 23:08:23 -070016/** \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 {
24 u32 client_index;
25 u32 context;
26 u32 initial_segment_size;
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*/
39define application_attach_reply {
40 u32 context;
41 i32 retval;
42 u64 app_event_queue_address;
43 u32 segment_size;
44 u8 segment_name_length;
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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040052autoreply define application_detach {
Florin Coras6cf30ad2017-04-04 23:08:23 -070053 u32 client_index;
54 u32 context;
55 };
56
Florin Coras6cf30ad2017-04-04 23:08:23 -070057/** \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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040062autoreply define map_another_segment {
Florin Coras6cf30ad2017-04-04 23:08:23 -070063 u32 client_index;
64 u32 context;
65 u32 segment_size;
66 u8 segment_name[128];
67};
68
Dave Barach68b0fb02017-02-28 15:15:56 -050069 /** \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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040077autoreply define bind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -050078 u32 client_index;
79 u32 context;
80 u32 accept_cookie;
Dave Barach68b0fb02017-02-28 15:15:56 -050081 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -050082};
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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040091autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -050092 u32 client_index;
93 u32 context;
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.
Florin Coras6cf30ad2017-04-04 23:08:23 -0700103 @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.
Dave Barach68b0fb02017-02-28 15:15:56 -0500107*/
108define connect_uri {
109 u32 client_index;
110 u32 context;
111 u8 uri[128];
112 u64 client_queue_address;
113 u64 options[16];
114};
115
Dave Barach68b0fb02017-02-28 15:15:56 -0500116/** \brief vpp->client, connect reply
117 @param context - sender context, to match reply w/ request
118 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700119 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500120 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
121 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
Dave Barach68b0fb02017-02-28 15:15:56 -0500122 @param vpp_event_queue_address - vpp's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700123 @param segment_size - size of segment to be attached. Only for redirects.
Dave Barach68b0fb02017-02-28 15:15:56 -0500124 @param segment_name_length - non-zero if the client needs to attach to
Florin Coras6cf30ad2017-04-04 23:08:23 -0700125 the fifo segment. This should only happen
126 if session was redirected.
Dave Barach68b0fb02017-02-28 15:15:56 -0500127 @param segment_name - set if the client needs to attach to the segment
128*/
129define connect_uri_reply {
130 u32 context;
131 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700132 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500133 u64 server_rx_fifo;
134 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500135 u64 vpp_event_queue_address;
136 u32 segment_size;
137 u8 segment_name_length;
138 u8 segment_name[128];
139};
140
Dave Barach68b0fb02017-02-28 15:15:56 -0500141/** \brief vpp->client, accept this session
142 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700143 @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
Dave Barach68b0fb02017-02-28 15:15:56 -0500146 @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
147 @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
Dave Barach68b0fb02017-02-28 15:15:56 -0500148 @param vpp_event_queue_address - vpp's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700149 @param port - remote port
150 @param is_ip4 - 1 if the ip is ip4
151 @param ip - remote ip
Dave Barach68b0fb02017-02-28 15:15:56 -0500152*/
153define accept_session {
154 u32 client_index;
155 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700156 u64 listener_handle;
157 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500158 u64 server_rx_fifo;
159 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500160 u64 vpp_event_queue_address;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700161 u16 port;
162 u8 is_ip4;
163 u8 ip[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500164};
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*/
173define accept_session_reply {
174 u32 context;
175 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700176 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500177};
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
Florin Coras6cf30ad2017-04-04 23:08:23 -0700183 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500184*/
185define disconnect_session {
186 u32 client_index;
187 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700188 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500189};
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
Florin Coras6cf30ad2017-04-04 23:08:23 -0700196 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500197*/
198define disconnect_session_reply {
199 u32 client_index;
200 u32 context;
201 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700202 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500203};
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
Florin Coras6cf30ad2017-04-04 23:08:23 -0700209 @param handle - session handle obtained via accept/connects
Dave Barach68b0fb02017-02-28 15:15:56 -0500210*/
211define reset_session {
212 u32 client_index;
213 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700214 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500215};
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
Florin Coras6cf30ad2017-04-04 23:08:23 -0700222 @param handle - session handle obtained via accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500223*/
224define reset_session_reply {
225 u32 client_index;
226 u32 context;
227 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700228 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500229};
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*/
241define bind_sock {
242 u32 client_index;
243 u32 context;
244 u32 vrf;
245 u8 is_ip4;
246 u8 ip[16];
247 u16 port;
248 u8 proto;
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*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400257autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500258 u32 client_index;
259 u32 context;
260 u64 handle;
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 vrf - connection namespace
267 @param is_ip4 - flag that is 1 if ip address family is IPv4
268 @param ip - ip address
269 @param port - port
270 @param proto - protocol 0 - TCP 1 - UDP
271 @param client_queue_address - client's API queue address. Non-zero when
272 used to perform redirects
Florin Coras6cf30ad2017-04-04 23:08:23 -0700273 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500274*/
275define connect_sock {
276 u32 client_index;
277 u32 context;
278 u32 vrf;
279 u8 is_ip4;
280 u8 ip[16];
281 u16 port;
282 u8 proto;
283 u64 client_queue_address;
284 u64 options[16];
285};
286
287/** \brief Bind reply
288 @param context - sender context, to match reply w/ request
289 @param handle - bind handle
290 @param retval - return code for the request
291 @param event_queue_address - vpp event queue address or 0 if this
292 connection shouldn't send events
293 @param segment_name_length - length of segment name
294 @param segment_name - name of segment client needs to attach to
295*/
296define bind_sock_reply {
297 u32 context;
298 u64 handle;
299 i32 retval;
300 u64 server_event_queue_address;
301 u32 segment_size;
302 u8 segment_name_length;
303 u8 segment_name[128];
304};
305
Dave Barach68b0fb02017-02-28 15:15:56 -0500306/** \brief vpp/server->client, connect reply
307 @param context - sender context, to match reply w/ request
308 @param retval - return code for the request
309 @param handle - connection handle
310 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
311 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
312 @param vpp_event_queue_address - vpp's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700313 @param segment_size - size of segment to be attached. Only for redirects.
Dave Barach68b0fb02017-02-28 15:15:56 -0500314 @param segment_name_length - non-zero if the client needs to attach to
315 the fifo segment
316 @param segment_name - set if the client needs to attach to the segment
317*/
318define connect_sock_reply {
319 u32 context;
320 i32 retval;
321 u64 handle;
322 u64 server_rx_fifo;
323 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500324 u64 vpp_event_queue_address;
325 u32 segment_size;
326 u8 segment_name_length;
327 u8 segment_name[128];
328};
329
Florin Corase04c2992017-03-01 08:17:34 -0800330/** \brief enable/disable session layer
331 @param client_index - opaque cookie to identify the sender
332 client to vpp direction only
333 @param context - sender context, to match reply w/ request
334 @param is_enable - disable session layer if 0, enable otherwise
335*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400336autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800337 u32 client_index;
338 u32 context;
339 u8 is_enable;
340};
341
Dave Barach68b0fb02017-02-28 15:15:56 -0500342/*
343 * Local Variables:
344 * eval: (c-set-style "gnu")
345 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400346 */