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.
18 /** \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
23 @param options - segment size, fifo sizes, etc.
24 @param namespace_id_len - length of the namespace id c-string
25 @param namespace_id - 0 terminted c-string
27 define application_attach {
30 u32 initial_segment_size;
36 /** \brief Application attach reply
37 @param context - sender context, to match reply w/ request
38 @param retval - return code for the request
39 @param app_event_queue_address - vpp event queue address or 0 if this
40 connection shouldn't send events
41 @param segment_size - size of first shm segment
42 @param segment_name_length - length of segment name
43 @param segment_name - name of segment client needs to attach to
45 define application_attach_reply {
48 u64 app_event_queue_address;
50 u8 segment_name_length;
54 /** \brief client->vpp, attach application to session layer
55 @param client_index - opaque cookie to identify the sender
56 @param context - sender context, to match reply w/ request
58 autoreply define application_detach {
63 /** \brief vpp->client, please map an additional shared memory segment
64 @param client_index - opaque cookie to identify the sender
65 @param context - sender context, to match reply w/ request
68 autoreply define map_another_segment {
75 /** \brief Bind to a given URI
76 @param client_index - opaque cookie to identify the sender
77 @param context - sender context, to match reply w/ request
78 @param accept_cookie - sender accept cookie, to identify this bind flavor
79 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
80 "tcp://::/0/80" [ipv6] etc.
81 @param options - socket options, fifo sizes, etc.
83 autoreply define bind_uri {
90 /** \brief Unbind a given URI
91 @param client_index - opaque cookie to identify the sender
92 @param context - sender context, to match reply w/ request
93 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
94 "tcp://::/0/80" [ipv6], etc.
95 @param options - socket options, fifo sizes, etc.
97 autoreply define unbind_uri {
103 /** \brief Connect to a given URI
104 @param client_index - opaque cookie to identify the sender
105 @param context - sender context, to match reply w/ request
106 @param client_queue_address - binary API client queue address. Used by
107 local server when connect was redirected.
108 @param options - socket options, fifo sizes, etc. passed by vpp to the
109 server when redirecting connects
110 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
111 "tcp6://::/0/80" [ipv6], etc.
113 autoreply define connect_uri {
116 u64 client_queue_address;
121 /** \brief vpp->client, accept this session
122 @param context - sender context, to match reply w/ request
123 @param listener_handle - tells client which listener this pertains to
124 @param handle - unique session identifier
125 @param session_thread_index - thread index of new session
126 @param rx_fifo_address - rx (vpp -> vpp-client) fifo address
127 @param tx_fifo_address - tx (vpp-client -> vpp) fifo address
128 @param vpp_event_queue_address - vpp's event queue address
129 @param port - remote port
130 @param is_ip4 - 1 if the ip is ip4
131 @param ip - remote ip
133 define accept_session {
140 u64 vpp_event_queue_address;
146 /** \brief client->vpp, reply to an accept message
147 @param context - sender context, to match reply w/ request
148 @param retval - return code for the request
149 @param session_index - session index from accept_session / connect_reply
150 @param session_thread_index - thread index from accept_session /
153 define accept_session_reply {
159 /** \brief bidirectional disconnect API
160 @param client_index - opaque cookie to identify the sender
161 client to vpp direction only
162 @param context - sender context, to match reply w/ request
163 @param handle - session handle obtained from accept/connect
165 define disconnect_session {
171 /** \brief bidirectional disconnect reply API
172 @param client_index - opaque cookie to identify the sender
173 client to vpp direction only
174 @param context - sender context, to match reply w/ request
175 @param retval - return code for the request
176 @param handle - session handle
178 define disconnect_session_reply {
185 /** \brief vpp->client reset session API
186 @param client_index - opaque cookie to identify the sender
187 client to vpp direction only
188 @param context - sender context, to match reply w/ request
189 @param handle - session handle obtained via accept/connects
191 define reset_session {
197 /** \brief client->vpp reset session reply
198 @param client_index - opaque cookie to identify the sender
199 client to vpp direction only
200 @param context - sender context, to match reply w/ request
201 @param retval - return code for the request
202 @param handle - session handle obtained via accept/connect
204 define reset_session_reply {
211 /** \brief Bind to an ip:port pair for a given transport protocol
212 @param client_index - opaque cookie to identify the sender
213 @param context - sender context, to match reply w/ request
214 @param vrf - bind namespace
215 @param is_ip4 - flag that is 1 if ip address family is IPv4
216 @param ip - ip address
218 @param proto - protocol 0 - TCP 1 - UDP
219 @param options - socket options, fifo sizes, etc.
233 @param client_index - opaque cookie to identify the sender
234 @param context - sender context, to match reply w/ request
235 @param handle - bind handle obtained from bind reply
237 autoreply define unbind_sock {
243 /** \brief Connect to a remote peer
244 @param client_index - opaque cookie to identify the sender
245 @param context - sender context, to match reply w/ request
246 @param client_queue_address - client's API queue address. Non-zero when
247 used to perform redirects
248 @param options - socket options, fifo sizes, etc. when doing redirects
249 @param vrf - connection namespace
250 @param is_ip4 - flag that is 1 if ip address family is IPv4
251 @param ip - ip address
253 @param proto - protocol 0 - TCP 1 - UDP
255 autoreply define connect_sock {
258 u64 client_queue_address;
267 /** \brief Bind reply
268 @param context - sender context, to match reply w/ request
269 @param handle - bind handle
270 @param retval - return code for the request
271 @param event_queue_address - vpp event queue address or 0 if this
272 connection shouldn't send events
273 @param segment_name_length - length of segment name
274 @param segment_name - name of segment client needs to attach to
276 define bind_sock_reply {
280 u64 server_event_queue_address;
282 u8 segment_name_length;
283 u8 segment_name[128];
286 /* Dummy connect message -- needed to satisfy api generators
288 * NEVER USED, doxygen tags elided on purpose.
290 define connect_session {
295 /** \brief vpp/server->client, connect reply -- used for all connect_* messages
296 @param context - sender context, to match reply w/ request
297 @param retval - return code for the request
298 @param handle - connection handle
299 @param server_rx_fifo - rx (vpp -> vpp-client) fifo address
300 @param server_tx_fifo - tx (vpp-client -> vpp) fifo address
301 @param vpp_event_queue_address - vpp's event queue address
302 @param segment_size - size of segment to be attached. Only for redirects.
303 @param segment_name_length - non-zero if the client needs to attach to
305 @param segment_name - set if the client needs to attach to the segment
306 @param lcl_ip - local ip for connection
307 @param is_ip4 - flag to indicate if ip is v4 or v6
308 @param lcl_port - local port
310 define connect_session_reply {
316 u64 vpp_event_queue_address;
318 u8 segment_name_length;
319 u8 segment_name[128];
325 /** \brief enable/disable session layer
326 @param client_index - opaque cookie to identify the sender
327 client to vpp direction only
328 @param context - sender context, to match reply w/ request
329 @param is_enable - disable session layer if 0, enable otherwise
331 autoreply define session_enable_disable {
337 /** \brief add/del application namespace
338 @param client_index - opaque cookie to identify the sender
339 client to vpp direction only
340 @param context - sender context, to match reply w/ request
341 @param secret - secret shared between app and vpp
342 @param sw_if_index - local interface that "supports" namespace. Set to
344 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
346 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
348 @param namespace_id_len - length of namespace id lower
349 @param namespace_id - namespace id
351 define app_namespace_add_del {
362 /** \brief Reply for app namespace add/del
363 @param context - returned sender context, to match reply w/ request
364 @param retval - return code
365 @param appns_index - app namespace index
367 define app_namespace_add_del_reply
374 /** \brief add/del session rule
375 @param client_index - opaque cookie to identify the sender
376 client to vpp direction only
377 @param context - sender context, to match reply w/ request
378 @param transport_proto - transport protocol (0 - tcp 1 - udp)
379 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
380 @param lcl_ip - local ip
381 @param lcl_plen - local prefix length
382 @param rmt_ip - remote ip
383 @param rmt_ple - remote prefix length
384 @param lcl_port - local port
385 @param rmt_port - remote port
386 @param action_index - the only action defined now is forward to
387 application with index action_index
388 @param is_add - flag to indicate if add or del
389 @param appns_index - application namespace where rule is to be applied
391 @param scope - flag that indicates scope of the rule: global or local.
392 If 0, default is global, 1 is global 2 is local, 3 is
395 autoreply define session_rule_add_del {
413 /** \brief Dump session rules
414 @param client_index - opaque cookie to identify the sender
415 @param context - sender context, to match reply w/ request
417 define session_rules_dump
423 /** \brief Session rules details
424 @param context - sender context, to match reply w/ request
425 @param transport_proto - transport protocol (0 - tcp 1 - udp)
426 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
427 @param lcl_ip - local ip
428 @param lcl_plen - local prefix length
429 @param rmt_ip - remote ip
430 @param rmt_ple - remote prefix length
431 @param lcl_port - local port
432 @param rmt_port - remote port
433 @param action_index - the only action defined now is forward to
434 application with index action_index
435 @param appns_index - application namespace where rule is to be applied
437 @param scope - flag that indicates scope of the rule: global or local.
438 If 0, default is global, 1 is global 2 is local, 3 is
441 define session_rules_details
460 * eval: (c-set-style "gnu")