vppapigen: support per-file (major,minor,patch) version stamps
[vpp.git] / src / vnet / session / session.api
1 /*
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
16 vl_api_version 1.0.0
17
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 
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 */
41 define 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 */
54 autoreply define application_detach {
55     u32 client_index;
56     u32 context;
57  };
58  
59 /** \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 */
64 autoreply define map_another_segment {
65     u32 client_index;
66     u32 context;
67     u32 segment_size;
68     u8 segment_name[128];
69 };
70
71  /** \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 */
79 autoreply define bind_uri {
80   u32 client_index;
81   u32 context;
82   u32 accept_cookie;
83   u8 uri[128];
84 };
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 */
93 autoreply define unbind_uri {
94   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.
105     @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.
109 */
110 autoreply define connect_uri {
111   u32 client_index;
112   u32 context;
113   u8 uri[128];
114   u64 client_queue_address;
115   u64 options[16];
116 };
117
118 /** \brief vpp->client, accept this session
119     @param context - sender context, to match reply w/ request
120     @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
123     @param rx_fifo_address - rx (vpp -> vpp-client) fifo address 
124     @param tx_fifo_address - tx (vpp-client -> vpp) fifo address 
125     @param vpp_event_queue_address - vpp's event queue address
126     @param port - remote port
127     @param is_ip4 - 1 if the ip is ip4
128     @param ip - remote ip
129 */
130 define accept_session {
131   u32 client_index;
132   u32 context;
133   u64 listener_handle;
134   u64 handle; 
135   u64 server_rx_fifo;
136   u64 server_tx_fifo;
137   u64 vpp_event_queue_address;
138   u16 port;
139   u8 is_ip4;
140   u8 ip[16];
141 };
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 */
150 define accept_session_reply {
151   u32 context;
152   i32 retval;
153   u64 handle;
154 };
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
160     @param handle - session handle obtained from accept/connect
161 */
162 define disconnect_session {
163   u32 client_index;
164   u32 context;
165   u64 handle;
166 };
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
173     @param handle - session handle
174 */
175 define disconnect_session_reply {
176   u32 client_index;
177   u32 context;
178   i32 retval;
179   u64 handle;
180 };
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
186     @param handle - session handle obtained via accept/connects
187 */
188 define reset_session {
189   u32 client_index;
190   u32 context;
191   u64 handle;
192 };
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
199     @param handle - session handle obtained via accept/connect
200 */
201 define reset_session_reply {
202   u32 client_index;
203   u32 context;
204   i32 retval;
205   u64 handle;
206 };
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 */
218 define 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 */
234 autoreply define unbind_sock {
235   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
243     @param app_connect - application connection id to be returned in reply
244     @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
251     @param options - socket options, fifo sizes, etc. when doing redirects
252 */
253 autoreply define connect_sock {
254   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 */
274 define 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
284 /* Dummy connect message -- needed to satisfy api generators
285 *
286 *  NEVER USED, doxygen tags elided on purpose.
287 */
288 define connect_session {
289   u32 client_index;
290   u32 context;
291 };
292
293 /** \brief vpp/server->client, connect reply -- used for all connect_* messages
294     @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
300     @param segment_size - size of segment to be attached. Only for redirects.
301     @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 */
305 define connect_session_reply {
306   u32 context;
307   i32 retval;
308   u64 handle;
309   u64 server_rx_fifo;
310   u64 server_tx_fifo;
311   u64 vpp_event_queue_address;
312   u32 segment_size;
313   u8 segment_name_length;
314   u8 segment_name[128];
315 };
316
317 /** \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 */
323 autoreply define session_enable_disable {
324   u32 client_index;
325   u32 context;
326   u8 is_enable;
327 };
328
329 /*
330  * Local Variables:
331  * eval: (c-set-style "gnu")
332  * End:
333  */