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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
21 @param options - segment size, fifo sizes, etc.
23 define application_attach {
26 u32 initial_segment_size;
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
39 define application_attach_reply {
42 u64 app_event_queue_address;
44 u8 segment_name_length;
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
52 define application_detach {
57 /** \brief detach reply
58 @param context - sender context, to match reply w/ request
59 @param retval - return code for the request
61 define application_detach_reply {
66 /** \brief vpp->client, please map an additional shared memory segment
67 @param client_index - opaque cookie to identify the sender
68 @param context - sender context, to match reply w/ request
71 define map_another_segment {
78 /** \brief Bind to a given URI
79 @param client_index - opaque cookie to identify the sender
80 @param context - sender context, to match reply w/ request
81 @param accept_cookie - sender accept cookie, to identify this bind flavor
82 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
83 "tcp://::/0/80" [ipv6] etc.
84 @param options - socket options, fifo sizes, etc.
93 /** \brief Unbind a given URI
94 @param client_index - opaque cookie to identify the sender
95 @param context - sender context, to match reply w/ request
96 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
97 "tcp://::/0/80" [ipv6], etc.
98 @param options - socket options, fifo sizes, etc.
106 /** \brief Connect to a given URI
107 @param client_index - opaque cookie to identify the sender
108 @param context - sender context, to match reply w/ request
109 @param accept_cookie - sender accept cookie, to identify this bind flavor
110 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
111 "tcp6://::/0/80" [ipv6], etc.
112 @param options - socket options, fifo sizes, etc. passed by vpp to the
113 server when redirecting connects
114 @param client_queue_address - binary API client queue address. Used by
115 local server when connect was redirected.
121 u64 client_queue_address;
125 /** \brief Bind reply
126 @param context - sender context, to match reply w/ request
127 @param retval - return code for the request
129 define bind_uri_reply {
134 /** \brief unbind reply
135 @param context - sender context, to match reply w/ request
136 @param retval - return code for the request
138 define unbind_uri_reply {
143 /** \brief vpp->client, connect reply
144 @param context - sender context, to match reply w/ request
145 @param retval - return code for the request
146 @param handle - session handle
147 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
148 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
149 @param vpp_event_queue_address - vpp's event queue address
150 @param segment_size - size of segment to be attached. Only for redirects.
151 @param segment_name_length - non-zero if the client needs to attach to
152 the fifo segment. This should only happen
153 if session was redirected.
154 @param segment_name - set if the client needs to attach to the segment
156 define connect_uri_reply {
162 u64 vpp_event_queue_address;
164 u8 segment_name_length;
165 u8 segment_name[128];
168 /** \brief client->vpp
169 @param context - sender context, to match reply w/ request
170 @param retval - return code for the request
172 define map_another_segment_reply {
177 /** \brief vpp->client, accept this session
178 @param context - sender context, to match reply w/ request
179 @param listener_handle - tells client which listener this pertains to
180 @param handle - unique session identifier
181 @param session_thread_index - thread index of new session
182 @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
183 @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
184 @param vpp_event_queue_address - vpp's event queue address
185 @param port - remote port
186 @param is_ip4 - 1 if the ip is ip4
187 @param ip - remote ip
189 define accept_session {
196 u64 vpp_event_queue_address;
202 /** \brief client->vpp, reply to an accept message
203 @param context - sender context, to match reply w/ request
204 @param retval - return code for the request
205 @param session_index - session index from accept_session / connect_reply
206 @param session_thread_index - thread index from accept_session /
209 define accept_session_reply {
215 /** \brief bidirectional disconnect API
216 @param client_index - opaque cookie to identify the sender
217 client to vpp direction only
218 @param context - sender context, to match reply w/ request
219 @param handle - session handle obtained from accept/connect
221 define disconnect_session {
227 /** \brief bidirectional disconnect reply API
228 @param client_index - opaque cookie to identify the sender
229 client to vpp direction only
230 @param context - sender context, to match reply w/ request
231 @param retval - return code for the request
232 @param handle - session handle
234 define disconnect_session_reply {
241 /** \brief vpp->client reset session API
242 @param client_index - opaque cookie to identify the sender
243 client to vpp direction only
244 @param context - sender context, to match reply w/ request
245 @param handle - session handle obtained via accept/connects
247 define reset_session {
253 /** \brief client->vpp reset session reply
254 @param client_index - opaque cookie to identify the sender
255 client to vpp direction only
256 @param context - sender context, to match reply w/ request
257 @param retval - return code for the request
258 @param handle - session handle obtained via accept/connect
260 define reset_session_reply {
267 /** \brief Bind to an ip:port pair for a given transport protocol
268 @param client_index - opaque cookie to identify the sender
269 @param context - sender context, to match reply w/ request
270 @param vrf - bind namespace
271 @param is_ip4 - flag that is 1 if ip address family is IPv4
272 @param ip - ip address
274 @param proto - protocol 0 - TCP 1 - UDP
275 @param options - socket options, fifo sizes, etc.
289 @param client_index - opaque cookie to identify the sender
290 @param context - sender context, to match reply w/ request
291 @param handle - bind handle obtained from bind reply
299 /** \brief Connect to a remote peer
300 @param client_index - opaque cookie to identify the sender
301 @param context - sender context, to match reply w/ request
302 @param vrf - connection namespace
303 @param is_ip4 - flag that is 1 if ip address family is IPv4
304 @param ip - ip address
306 @param proto - protocol 0 - TCP 1 - UDP
307 @param client_queue_address - client's API queue address. Non-zero when
308 used to perform redirects
309 @param options - socket options, fifo sizes, etc. when doing redirects
311 define connect_sock {
319 u64 client_queue_address;
323 /** \brief Bind reply
324 @param context - sender context, to match reply w/ request
325 @param handle - bind handle
326 @param retval - return code for the request
327 @param event_queue_address - vpp event queue address or 0 if this
328 connection shouldn't send events
329 @param segment_name_length - length of segment name
330 @param segment_name - name of segment client needs to attach to
332 define bind_sock_reply {
336 u64 server_event_queue_address;
338 u8 segment_name_length;
339 u8 segment_name[128];
342 /** \brief unbind reply
343 @param context - sender context, to match reply w/ request
344 @param retval - return code for the request
346 define unbind_sock_reply {
351 /** \brief vpp/server->client, connect reply
352 @param context - sender context, to match reply w/ request
353 @param retval - return code for the request
354 @param handle - connection handle
355 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
356 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
357 @param vpp_event_queue_address - vpp's event queue address
358 @param segment_size - size of segment to be attached. Only for redirects.
359 @param segment_name_length - non-zero if the client needs to attach to
361 @param segment_name - set if the client needs to attach to the segment
363 define connect_sock_reply {
369 u64 vpp_event_queue_address;
371 u8 segment_name_length;
372 u8 segment_name[128];
375 /** \brief enable/disable session layer
376 @param client_index - opaque cookie to identify the sender
377 client to vpp direction only
378 @param context - sender context, to match reply w/ request
379 @param is_enable - disable session layer if 0, enable otherwise
381 define session_enable_disable {
387 /** \brief Reply for session enable/disable
388 @param context - returned sender context, to match reply w/ request
389 @param retval - return code
391 define session_enable_disable_reply {
398 * eval: (c-set-style "gnu")