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 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.
28 u32 initial_segment_size;
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.
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.
58 u64 client_queue_address;
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
70 define bind_uri_reply {
73 u64 server_event_queue_address;
74 u8 segment_name_length;
79 /** \brief unbind reply
80 @param context - sender context, to match reply w/ request
81 @param retval - return code for the request
83 define unbind_uri_reply {
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
100 @param segment_name - set if the client needs to attach to the segment
102 define connect_uri_reply {
108 u32 session_thread_index;
110 u64 client_event_queue_address;
111 u64 vpp_event_queue_address;
113 u8 segment_name_length;
114 u8 segment_name[128];
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 -
121 define map_another_segment {
125 u8 segment_name[128];
128 /** \brief client->vpp
129 @param context - sender context, to match reply w/ request
130 @param retval - return code for the request
132 define map_another_segment_reply {
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
148 define accept_session {
155 u32 session_thread_index;
156 u64 vpp_event_queue_address;
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 /
167 define accept_session_reply {
171 u8 session_thread_index;
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
182 define disconnect_session {
186 u32 session_thread_index;
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 /
198 define disconnect_session_reply {
203 u32 session_thread_index;
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 /
214 define reset_session {
218 u32 session_thread_index;
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 /
230 define reset_session_reply {
235 u32 session_thread_index;
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
245 @param proto - protocol 0 - TCP 1 - UDP
246 @param options - socket options, fifo sizes, etc.
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
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
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.
282 define connect_sock {
290 u64 client_queue_address;
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
303 define bind_sock_reply {
307 u64 server_event_queue_address;
309 u8 segment_name_length;
310 u8 segment_name[128];
313 /** \brief unbind reply
314 @param context - sender context, to match reply w/ request
315 @param retval - return code for the request
317 define unbind_sock_reply {
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
332 @param segment_name - set if the client needs to attach to the segment
334 define connect_sock_reply {
340 u64 client_event_queue_address;
341 u64 vpp_event_queue_address;
343 u8 segment_name_length;
344 u8 segment_name[128];
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
353 define disconnect_sock {
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
365 define disconnect_sock_reply {
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
387 u64 vpp_event_queue_address;
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
395 define accept_sock_reply {
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
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
419 define reset_sock_reply {
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
432 define session_enable_disable {
438 /** \brief Reply for session enable/disable
439 @param context - returned sender context, to match reply w/ request
440 @param retval - return code
442 define session_enable_disable_reply {
449 * eval: (c-set-style "gnu")