blob: 992a06386986084b27ad4cb7ff56a0877c55c393 [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 */
Dave Barach0d056e52017-09-28 15:11:16 -040015
16vl_api_version 1.0.0
17
Florin Coras6cf30ad2017-04-04 23:08:23 -070018/** \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*/
25 define application_attach {
26 u32 client_index;
27 u32 context;
28 u32 initial_segment_size;
29 u64 options[16];
30 };
31
32 /** \brief Application attach reply
33 @param context - sender context, to match reply w/ request
34 @param retval - return code for the request
35 @param app_event_queue_address - vpp event queue address or 0 if this
36 connection shouldn't send events
37 @param segment_size - size of first shm segment
38 @param segment_name_length - length of segment name
39 @param segment_name - name of segment client needs to attach to
40*/
41define application_attach_reply {
42 u32 context;
43 i32 retval;
44 u64 app_event_queue_address;
45 u32 segment_size;
46 u8 segment_name_length;
47 u8 segment_name[128];
48};
49
50 /** \brief client->vpp, attach application to session layer
51 @param client_index - opaque cookie to identify the sender
52 @param context - sender context, to match reply w/ request
53*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040054autoreply define application_detach {
Florin Coras6cf30ad2017-04-04 23:08:23 -070055 u32 client_index;
56 u32 context;
57 };
58
Florin Coras6cf30ad2017-04-04 23:08:23 -070059/** \brief vpp->client, please map an additional shared memory segment
60 @param client_index - opaque cookie to identify the sender
61 @param context - sender context, to match reply w/ request
62 @param segment_name -
63*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040064autoreply define map_another_segment {
Florin Coras6cf30ad2017-04-04 23:08:23 -070065 u32 client_index;
66 u32 context;
67 u32 segment_size;
68 u8 segment_name[128];
69};
70
Dave Barach68b0fb02017-02-28 15:15:56 -050071 /** \brief Bind to a given URI
72 @param client_index - opaque cookie to identify the sender
73 @param context - sender context, to match reply w/ request
74 @param accept_cookie - sender accept cookie, to identify this bind flavor
75 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
76 "tcp://::/0/80" [ipv6] etc.
77 @param options - socket options, fifo sizes, etc.
78*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040079autoreply define bind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -050080 u32 client_index;
81 u32 context;
82 u32 accept_cookie;
Dave Barach68b0fb02017-02-28 15:15:56 -050083 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -050084};
85
86/** \brief Unbind a given URI
87 @param client_index - opaque cookie to identify the sender
88 @param context - sender context, to match reply w/ request
89 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
90 "tcp://::/0/80" [ipv6], etc.
91 @param options - socket options, fifo sizes, etc.
92*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040093autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -050094 u32 client_index;
95 u32 context;
96 u8 uri[128];
97};
98
99/** \brief Connect to a given URI
100 @param client_index - opaque cookie to identify the sender
101 @param context - sender context, to match reply w/ request
102 @param accept_cookie - sender accept cookie, to identify this bind flavor
103 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
104 "tcp6://::/0/80" [ipv6], etc.
Florin Coras6cf30ad2017-04-04 23:08:23 -0700105 @param options - socket options, fifo sizes, etc. passed by vpp to the
106 server when redirecting connects
107 @param client_queue_address - binary API client queue address. Used by
108 local server when connect was redirected.
Dave Barach68b0fb02017-02-28 15:15:56 -0500109*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400110autoreply define connect_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500111 u32 client_index;
112 u32 context;
113 u8 uri[128];
114 u64 client_queue_address;
115 u64 options[16];
116};
117
Dave Barach68b0fb02017-02-28 15:15:56 -0500118/** \brief vpp->client, accept this session
119 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700120 @param listener_handle - tells client which listener this pertains to
121 @param handle - unique session identifier
122 @param session_thread_index - thread index of new session
Dave Barach68b0fb02017-02-28 15:15:56 -0500123 @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
124 @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
Dave Barach68b0fb02017-02-28 15:15:56 -0500125 @param vpp_event_queue_address - vpp's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700126 @param port - remote port
127 @param is_ip4 - 1 if the ip is ip4
128 @param ip - remote ip
Dave Barach68b0fb02017-02-28 15:15:56 -0500129*/
130define accept_session {
131 u32 client_index;
132 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700133 u64 listener_handle;
134 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500135 u64 server_rx_fifo;
136 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500137 u64 vpp_event_queue_address;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700138 u16 port;
139 u8 is_ip4;
140 u8 ip[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500141};
142
143/** \brief client->vpp, reply to an accept message
144 @param context - sender context, to match reply w/ request
145 @param retval - return code for the request
146 @param session_index - session index from accept_session / connect_reply
147 @param session_thread_index - thread index from accept_session /
148 connect_reply
149*/
150define accept_session_reply {
151 u32 context;
152 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700153 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500154};
155
156/** \brief bidirectional disconnect API
157 @param client_index - opaque cookie to identify the sender
158 client to vpp direction only
159 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700160 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500161*/
162define disconnect_session {
163 u32 client_index;
164 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700165 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500166};
167
168/** \brief bidirectional disconnect reply API
169 @param client_index - opaque cookie to identify the sender
170 client to vpp direction only
171 @param context - sender context, to match reply w/ request
172 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700173 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500174*/
175define disconnect_session_reply {
176 u32 client_index;
177 u32 context;
178 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700179 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500180};
181
182/** \brief vpp->client reset session API
183 @param client_index - opaque cookie to identify the sender
184 client to vpp direction only
185 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700186 @param handle - session handle obtained via accept/connects
Dave Barach68b0fb02017-02-28 15:15:56 -0500187*/
188define reset_session {
189 u32 client_index;
190 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700191 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500192};
193
194/** \brief client->vpp reset session reply
195 @param client_index - opaque cookie to identify the sender
196 client to vpp direction only
197 @param context - sender context, to match reply w/ request
198 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700199 @param handle - session handle obtained via accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500200*/
201define reset_session_reply {
202 u32 client_index;
203 u32 context;
204 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700205 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500206};
207
208/** \brief Bind to an ip:port pair for a given transport protocol
209 @param client_index - opaque cookie to identify the sender
210 @param context - sender context, to match reply w/ request
211 @param vrf - bind namespace
212 @param is_ip4 - flag that is 1 if ip address family is IPv4
213 @param ip - ip address
214 @param port - port
215 @param proto - protocol 0 - TCP 1 - UDP
216 @param options - socket options, fifo sizes, etc.
217*/
218define bind_sock {
219 u32 client_index;
220 u32 context;
221 u32 vrf;
222 u8 is_ip4;
223 u8 ip[16];
224 u16 port;
225 u8 proto;
226 u64 options[16];
227};
228
229/** \brief Unbind
230 @param client_index - opaque cookie to identify the sender
231 @param context - sender context, to match reply w/ request
232 @param handle - bind handle obtained from bind reply
233*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400234autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500235 u32 client_index;
236 u32 context;
237 u64 handle;
238};
239
240/** \brief Connect to a remote peer
241 @param client_index - opaque cookie to identify the sender
242 @param context - sender context, to match reply w/ request
Florin Coras2fcc49d2017-06-07 14:18:48 -0700243 @param app_connect - application connection id to be returned in reply
Dave Barach68b0fb02017-02-28 15:15:56 -0500244 @param vrf - connection namespace
245 @param is_ip4 - flag that is 1 if ip address family is IPv4
246 @param ip - ip address
247 @param port - port
248 @param proto - protocol 0 - TCP 1 - UDP
249 @param client_queue_address - client's API queue address. Non-zero when
250 used to perform redirects
Florin Coras6cf30ad2017-04-04 23:08:23 -0700251 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500252*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400253autoreply define connect_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500254 u32 client_index;
255 u32 context;
256 u32 vrf;
257 u8 is_ip4;
258 u8 ip[16];
259 u16 port;
260 u8 proto;
261 u64 client_queue_address;
262 u64 options[16];
263};
264
265/** \brief Bind reply
266 @param context - sender context, to match reply w/ request
267 @param handle - bind handle
268 @param retval - return code for the request
269 @param event_queue_address - vpp event queue address or 0 if this
270 connection shouldn't send events
271 @param segment_name_length - length of segment name
272 @param segment_name - name of segment client needs to attach to
273*/
274define bind_sock_reply {
275 u32 context;
276 u64 handle;
277 i32 retval;
278 u64 server_event_queue_address;
279 u32 segment_size;
280 u8 segment_name_length;
281 u8 segment_name[128];
282};
283
Dave Wallace33e002b2017-09-06 01:20:02 -0400284/* Dummy connect message -- needed to satisfy api generators
285*
286* NEVER USED, doxygen tags elided on purpose.
287*/
288define connect_session {
289 u32 client_index;
290 u32 context;
291};
292
293/** \brief vpp/server->client, connect reply -- used for all connect_* messages
Dave Barach68b0fb02017-02-28 15:15:56 -0500294 @param context - sender context, to match reply w/ request
295 @param retval - return code for the request
296 @param handle - connection handle
297 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
298 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
299 @param vpp_event_queue_address - vpp's event queue address
Florin Coras6cf30ad2017-04-04 23:08:23 -0700300 @param segment_size - size of segment to be attached. Only for redirects.
Dave Barach68b0fb02017-02-28 15:15:56 -0500301 @param segment_name_length - non-zero if the client needs to attach to
302 the fifo segment
303 @param segment_name - set if the client needs to attach to the segment
304*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400305define connect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500306 u32 context;
307 i32 retval;
308 u64 handle;
309 u64 server_rx_fifo;
310 u64 server_tx_fifo;
Dave Barach68b0fb02017-02-28 15:15:56 -0500311 u64 vpp_event_queue_address;
312 u32 segment_size;
313 u8 segment_name_length;
314 u8 segment_name[128];
315};
316
Florin Corase04c2992017-03-01 08:17:34 -0800317/** \brief enable/disable session layer
318 @param client_index - opaque cookie to identify the sender
319 client to vpp direction only
320 @param context - sender context, to match reply w/ request
321 @param is_enable - disable session layer if 0, enable otherwise
322*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400323autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800324 u32 client_index;
325 u32 context;
326 u8 is_enable;
327};
328
Dave Barach68b0fb02017-02-28 15:15:56 -0500329/*
330 * Local Variables:
331 * eval: (c-set-style "gnu")
332 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400333 */