blob: 905ab5630d934bb07d2dda37e246ee00ea670703 [file] [log] [blame]
Dave Barach68b0fb02017-02-28 15:15:56 -05001/*
Florin Coras64424012019-03-02 10:47:47 -08002 * Copyright (c) 2015-2019 Cisco and/or its affiliates.
Dave Barach68b0fb02017-02-28 15:15:56 -05003 * 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
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010016option version = "2.0.0";
17
18import "vnet/interface_types.api";
19import "vnet/ip/ip_types.api";
20
21
22enum transport_proto : u8
23{
24 TRANSPORT_PROTO_API_TCP,
25 TRANSPORT_PROTO_API_UDP,
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010026 TRANSPORT_PROTO_API_NONE,
27 TRANSPORT_PROTO_API_TLS,
28 TRANSPORT_PROTO_API_UDPC,
29 TRANSPORT_PROTO_API_QUIC,
30};
Dave Barach0d056e52017-09-28 15:11:16 -040031
Florin Coras6cf30ad2017-04-04 23:08:23 -070032/** \brief client->vpp, attach application to session layer
Florin Coras458089b2019-08-21 16:20:44 -070033 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -070034 @param client_index - opaque cookie to identify the sender
35 @param context - sender context, to match reply w/ request
Florin Coras458089b2019-08-21 16:20:44 -070036 @param initial_segment_size - size of the initial shm segment to be
Florin Coras6cf30ad2017-04-04 23:08:23 -070037 allocated
38 @param options - segment size, fifo sizes, etc.
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010039 @param namespace_id - string
Florin Coras6cf30ad2017-04-04 23:08:23 -070040*/
41 define application_attach {
42 u32 client_index;
43 u32 context;
44 u32 initial_segment_size;
Florin Coras2de9c0f2020-02-02 19:30:39 +000045 u64 options[17];
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010046 string namespace_id[];
Florin Coras6cf30ad2017-04-04 23:08:23 -070047 };
Florin Coras458089b2019-08-21 16:20:44 -070048
Florin Coras6cf30ad2017-04-04 23:08:23 -070049 /** \brief Application attach reply
Florin Coras458089b2019-08-21 16:20:44 -070050 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -070051 @param context - sender context, to match reply w/ request
52 @param retval - return code for the request
Florin Coras458089b2019-08-21 16:20:44 -070053 @param app_event_queue_address - vpp event queue address or 0 if this
Florin Coras6cf30ad2017-04-04 23:08:23 -070054 connection shouldn't send events
Florin Coras99368312018-08-02 10:45:44 -070055 @param n_fds - number of fds exchanged
56 @param fd_flags - set of flags that indicate which fds are to be expected
Florin Coras458089b2019-08-21 16:20:44 -070057 over the socket (set only if socket transport available)
Florin Coras6cf30ad2017-04-04 23:08:23 -070058 @param segment_size - size of first shm segment
Florin Corasc1f5a432018-11-20 11:31:26 -080059 @param app_index - index of the newly created app
Florin Corasd85de682018-11-29 17:02:29 -080060 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010061 @param segment_name - name of segment client needs to attach to
Florin Coras6cf30ad2017-04-04 23:08:23 -070062*/
63define application_attach_reply {
64 u32 context;
65 i32 retval;
66 u64 app_event_queue_address;
Florin Coras99368312018-08-02 10:45:44 -070067 u8 n_fds;
68 u8 fd_flags;
Florin Coras6cf30ad2017-04-04 23:08:23 -070069 u32 segment_size;
Florin Corasc1f5a432018-11-20 11:31:26 -080070 u32 app_index;
Florin Corasd85de682018-11-29 17:02:29 -080071 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010072 string segment_name[];
Florin Coras6cf30ad2017-04-04 23:08:23 -070073};
74
Florin Coras458089b2019-08-21 16:20:44 -070075/** \brief Application attach to session layer
76 @param client_index - opaque cookie to identify the sender
77 @param context - sender context, to match reply w/ request
78 @param options - segment size, fifo sizes, etc.
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010079 @param namespace_id - string
Florin Coras458089b2019-08-21 16:20:44 -070080*/
81 define app_attach {
82 u32 client_index;
83 u32 context;
Florin Coras2de9c0f2020-02-02 19:30:39 +000084 u64 options[17];
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010085 string namespace_id[];
Florin Coras458089b2019-08-21 16:20:44 -070086 };
87
88 /** \brief Application attach reply
89 @param context - sender context, to match reply w/ request
90 @param retval - return code for the request
91 @param app_mq - app message queue
92 @param vpp_ctrl_mq - vpp message queue for control events that should
93 be handled in main thread, i.e., bind/connect
94 @param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
95 @param app_index - index of the newly created app
96 @param n_fds - number of fds exchanged
97 @param fd_flags - set of flags that indicate which fds are to be expected
98 over the socket (set only if socket transport available)
99 @param segment_size - size of first shm segment
Florin Coras458089b2019-08-21 16:20:44 -0700100 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100101 @param segment_name - name of segment client needs to attach to
Florin Coras458089b2019-08-21 16:20:44 -0700102*/
103define app_attach_reply {
104 u32 context;
105 i32 retval;
106 u64 app_mq;
107 u64 vpp_ctrl_mq;
108 u8 vpp_ctrl_mq_thread;
109 u32 app_index;
110 u8 n_fds;
111 u8 fd_flags;
112 u32 segment_size;
Florin Coras458089b2019-08-21 16:20:44 -0700113 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100114 string segment_name[];
Florin Coras458089b2019-08-21 16:20:44 -0700115};
116
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200117/** \brief Add certificate and key
118 @param client_index - opaque cookie to identify the sender
119 @param context - sender context, to match reply w/ request
120 @param engine - crypto engine
121 @param cert_len - cert length (comes first)
122 @param certkey_len - cert and key length
123 @param certkey - cert & key data (due to API limitation)
124*/
125define app_add_cert_key_pair {
126 u32 client_index;
127 u32 context;
128 u16 cert_len;
129 u16 certkey_len;
130 u8 certkey[certkey_len];
131};
132
133/** \brief Add certificate and key
134 @param context - sender context, to match reply w/ request
135 @param retval - return code for the request
136 @param index - index in certificate store
137*/
138define app_add_cert_key_pair_reply {
139 u32 context;
140 i32 retval;
141 u32 index;
142};
143
144/** \brief Delete certificate and key
145 @param client_index - opaque cookie to identify the sender
146 @param context - sender context, to match reply w/ request
147 @param index - index in certificate store
148*/
149autoreply define app_del_cert_key_pair {
150 u32 client_index;
151 u32 context;
152 u32 index;
153};
154
Florin Coras371ca502018-02-21 12:07:41 -0800155/** \brief Application add TLS certificate
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200156 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800157 @param client_index - opaque cookie to identify the sender
158 @param context - sender context, to match reply w/ request
159 @param cert_len - certificate length
160 @param cert - certificate as a string
161*/
162autoreply define application_tls_cert_add {
163 u32 client_index;
164 u32 context;
165 u32 app_index;
166 u16 cert_len;
167 u8 cert[cert_len];
168};
169
170/** \brief Application add TLS key
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200171 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800172 @param client_index - opaque cookie to identify the sender
173 @param context - sender context, to match reply w/ request
174 @param key_len - certificate length
175 @param key - PEM encoded key as a string
176*/
177autoreply define application_tls_key_add {
178 u32 client_index;
179 u32 context;
180 u32 app_index;
181 u16 key_len;
182 u8 key[key_len];
183};
184
Florin Coras6cf30ad2017-04-04 23:08:23 -0700185 /** \brief client->vpp, attach application to session layer
Florin Coras458089b2019-08-21 16:20:44 -0700186 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -0700187 @param client_index - opaque cookie to identify the sender
188 @param context - sender context, to match reply w/ request
189*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400190autoreply define application_detach {
Florin Coras6cf30ad2017-04-04 23:08:23 -0700191 u32 client_index;
192 u32 context;
193 };
Florin Coras458089b2019-08-21 16:20:44 -0700194
Florin Coras6cf30ad2017-04-04 23:08:23 -0700195/** \brief vpp->client, please map an additional shared memory segment
Florin Corasc4c4cf52019-08-24 18:17:34 -0700196 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -0700197 @param client_index - opaque cookie to identify the sender
198 @param context - sender context, to match reply w/ request
Florin Coras458089b2019-08-21 16:20:44 -0700199 @param fd_flags - set of flags that indicate which, if any, fds are
200 to be expected over the socket. This is set only if
Florin Coras99368312018-08-02 10:45:44 -0700201 socket transport available
202 @param segment_size - size of the segment to be mapped
203 @param segment_name - name of the segment to be mapped
Florin Corasfa76a762018-11-29 12:40:10 -0800204 @param segment_handle - unique identifier for segment
Florin Coras6cf30ad2017-04-04 23:08:23 -0700205*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400206autoreply define map_another_segment {
Florin Coras6cf30ad2017-04-04 23:08:23 -0700207 u32 client_index;
208 u32 context;
Florin Coras99368312018-08-02 10:45:44 -0700209 u8 fd_flags;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700210 u32 segment_size;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100211 string segment_name[128];
Florin Corasfa76a762018-11-29 12:40:10 -0800212 u64 segment_handle;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700213};
214
Florin Corasf8f516a2018-02-08 15:10:09 -0800215/** \brief vpp->client unmap shared memory segment
Florin Corasc4c4cf52019-08-24 18:17:34 -0700216 ### WILL BE DEPRECATED POST 20.01 ###
Florin Corasf8f516a2018-02-08 15:10:09 -0800217 @param client_index - opaque cookie to identify the sender
218 @param context - sender context, to match reply w/ request
Florin Corasfa76a762018-11-29 12:40:10 -0800219 @param segment_name - segment name
Florin Coras458089b2019-08-21 16:20:44 -0700220 @param segment_handle - handle of the segment to be unmapped
Florin Corasf8f516a2018-02-08 15:10:09 -0800221*/
222autoreply define unmap_segment {
223 u32 client_index;
224 u32 context;
Florin Corasfa76a762018-11-29 12:40:10 -0800225 u64 segment_handle;
Florin Corasf8f516a2018-02-08 15:10:09 -0800226};
227
Dave Barach68b0fb02017-02-28 15:15:56 -0500228 /** \brief Bind to a given URI
Florin Coras458089b2019-08-21 16:20:44 -0700229 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500230 @param client_index - opaque cookie to identify the sender
231 @param context - sender context, to match reply w/ request
232 @param accept_cookie - sender accept cookie, to identify this bind flavor
233 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
234 "tcp://::/0/80" [ipv6] etc.
235 @param options - socket options, fifo sizes, etc.
236*/
Florin Coras64424012019-03-02 10:47:47 -0800237autoreply define bind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500238 u32 client_index;
239 u32 context;
240 u32 accept_cookie;
Dave Barach68b0fb02017-02-28 15:15:56 -0500241 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500242};
Florin Coras7fb0fe12018-04-09 09:24:52 -0700243
Dave Barach68b0fb02017-02-28 15:15:56 -0500244/** \brief Unbind a given URI
Florin Coras458089b2019-08-21 16:20:44 -0700245 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500246 @param client_index - opaque cookie to identify the sender
247 @param context - sender context, to match reply w/ request
248 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
249 "tcp://::/0/80" [ipv6], etc.
250 @param options - socket options, fifo sizes, etc.
251*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400252autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500253 u32 client_index;
254 u32 context;
255 u8 uri[128];
256};
257
258/** \brief Connect to a given URI
Florin Coras458089b2019-08-21 16:20:44 -0700259 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500260 @param client_index - opaque cookie to identify the sender
261 @param context - sender context, to match reply w/ request
Florin Coras458089b2019-08-21 16:20:44 -0700262 @param client_queue_address - binary API client queue address. Used by
Florin Coras6cf30ad2017-04-04 23:08:23 -0700263 local server when connect was redirected.
Florin Corascea194d2017-10-02 00:18:51 -0700264 @param options - socket options, fifo sizes, etc. passed by vpp to the
Florin Coras458089b2019-08-21 16:20:44 -0700265 server when redirecting connects
Florin Corascea194d2017-10-02 00:18:51 -0700266 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
267 "tcp6://::/0/80" [ipv6], etc.
Dave Barach68b0fb02017-02-28 15:15:56 -0500268*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400269autoreply define connect_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500270 u32 client_index;
271 u32 context;
Dave Barach68b0fb02017-02-28 15:15:56 -0500272 u64 client_queue_address;
273 u64 options[16];
Florin Corascea194d2017-10-02 00:18:51 -0700274 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500275};
276
Dave Barach68b0fb02017-02-28 15:15:56 -0500277/** \brief bidirectional disconnect API
Florin Coras458089b2019-08-21 16:20:44 -0700278 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500279 @param client_index - opaque cookie to identify the sender
280 client to vpp direction only
281 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700282 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500283*/
284define disconnect_session {
285 u32 client_index;
286 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700287 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500288};
289
290/** \brief bidirectional disconnect reply API
Florin Coras458089b2019-08-21 16:20:44 -0700291 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500292 @param client_index - opaque cookie to identify the sender
293 client to vpp direction only
294 @param context - sender context, to match reply w/ request
295 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700296 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500297*/
298define disconnect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500299 u32 context;
300 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700301 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500302};
303
Dave Barach68b0fb02017-02-28 15:15:56 -0500304/** \brief Bind to an ip:port pair for a given transport protocol
Florin Coras458089b2019-08-21 16:20:44 -0700305 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500306 @param client_index - opaque cookie to identify the sender
307 @param context - sender context, to match reply w/ request
Florin Coras15531972018-08-12 23:50:53 -0700308 @param wrk_index - index of worker requesting the bind
Dave Barach68b0fb02017-02-28 15:15:56 -0500309 @param vrf - bind namespace
Dave Barach68b0fb02017-02-28 15:15:56 -0500310 @param ip - ip address
Florin Coras458089b2019-08-21 16:20:44 -0700311 @param port - port
Dave Barach68b0fb02017-02-28 15:15:56 -0500312 @param proto - protocol 0 - TCP 1 - UDP
313 @param options - socket options, fifo sizes, etc.
314*/
Florin Coras64424012019-03-02 10:47:47 -0800315autoreply define bind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500316 u32 client_index;
317 u32 context;
Florin Coras15531972018-08-12 23:50:53 -0700318 u32 wrk_index;
Dave Barach68b0fb02017-02-28 15:15:56 -0500319 u32 vrf;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100320 vl_api_address_t ip;
Dave Barach68b0fb02017-02-28 15:15:56 -0500321 u16 port;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100322 vl_api_transport_proto_t proto;
Dave Barach68b0fb02017-02-28 15:15:56 -0500323 u64 options[16];
324};
325
Florin Coras458089b2019-08-21 16:20:44 -0700326/** \brief Unbind
327 ### WILL BE DEPRECATED POST 20.01 ###s
Dave Barach68b0fb02017-02-28 15:15:56 -0500328 @param client_index - opaque cookie to identify the sender
329 @param context - sender context, to match reply w/ request
Florin Corasab2f6db2018-08-31 14:31:41 -0700330 @param wrk_index - index of worker requesting the bind
Dave Barach68b0fb02017-02-28 15:15:56 -0500331 @param handle - bind handle obtained from bind reply
332*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400333autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500334 u32 client_index;
335 u32 context;
Florin Corasab2f6db2018-08-31 14:31:41 -0700336 u32 wrk_index;
Dave Barach68b0fb02017-02-28 15:15:56 -0500337 u64 handle;
338};
339
340/** \brief Connect to a remote peer
Florin Coras458089b2019-08-21 16:20:44 -0700341 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500342 @param client_index - opaque cookie to identify the sender
343 @param context - sender context, to match reply w/ request
Florin Coras15531972018-08-12 23:50:53 -0700344 @param wrk_index - worker that requests the connect
Florin Coras458089b2019-08-21 16:20:44 -0700345 @param client_queue_address - client's API queue address. Non-zero when
Florin Corascea194d2017-10-02 00:18:51 -0700346 used to perform redirects
347 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500348 @param vrf - connection namespace
Dave Barach68b0fb02017-02-28 15:15:56 -0500349 @param ip - ip address
Florin Coras458089b2019-08-21 16:20:44 -0700350 @param port - port
Dave Barach68b0fb02017-02-28 15:15:56 -0500351 @param proto - protocol 0 - TCP 1 - UDP
Florin Coras8f89dd02018-03-05 16:53:07 -0800352 @param hostname-len - length of hostname
353 @param hostname - destination's hostname. If present, used by protocols
354 like tls.
Nathan Skrzypczak8ac1d6d2019-07-17 11:02:20 +0200355 @param parent_handle - handle of parent session (e.g. for opening quic streams).
Dave Barach68b0fb02017-02-28 15:15:56 -0500356*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400357autoreply define connect_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500358 u32 client_index;
359 u32 context;
Florin Coras15531972018-08-12 23:50:53 -0700360 u32 wrk_index;
Florin Corascea194d2017-10-02 00:18:51 -0700361 u64 client_queue_address;
362 u64 options[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500363 u32 vrf;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100364 vl_api_address_t ip;
Dave Barach68b0fb02017-02-28 15:15:56 -0500365 u16 port;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100366 vl_api_transport_proto_t proto;
Ole Troane5ff5a32019-08-23 22:55:18 +0200367 u64 parent_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100368 string hostname[];
Dave Barach68b0fb02017-02-28 15:15:56 -0500369};
370
Florin Coras99368312018-08-02 10:45:44 -0700371/** \brief ask app to add a new cut-through registration
Florin Coras458089b2019-08-21 16:20:44 -0700372 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras99368312018-08-02 10:45:44 -0700373 @param client_index - opaque cookie to identify the sender
374 client to vpp direction only
375 @param context - sender context, to match reply w/ request
376 @param evt_q_address - address of the mq in ssvm segment
377 @param peer_evt_q_address - address of peer's mq in ssvm segment
Florin Coras134a9962018-08-28 11:32:04 -0700378 @param wrk_index - index of worker to receive the registration
Florin Coras99368312018-08-02 10:45:44 -0700379 @param n_fds - number of fds exchanged
380 @param fd_flags - flag indicating the fds that will be exchanged over
381 api socket
382*/
383autoreply define app_cut_through_registration_add
384{
385 u32 client_index;
386 u32 context;
387 u64 evt_q_address;
388 u64 peer_evt_q_address;
Florin Coras134a9962018-08-28 11:32:04 -0700389 u32 wrk_index;
Florin Coras99368312018-08-02 10:45:44 -0700390 u8 n_fds;
391 u8 fd_flags;
392};
393
Florin Coras15531972018-08-12 23:50:53 -0700394/** \brief add/del application worker
395 @param client_index - opaque cookie to identify the sender
396 client to vpp direction only
397 @param context - sender context, to match reply w/ request
Florin Corasc1f5a432018-11-20 11:31:26 -0800398 @param app_index - application index
Florin Coras15531972018-08-12 23:50:53 -0700399 @param wrk_index - worker index, if a delete
400 @param is_add - set if an add
401*/
402define app_worker_add_del
403{
404 u32 client_index;
405 u32 context;
Florin Corasc1f5a432018-11-20 11:31:26 -0800406 u32 app_index;
Florin Coras15531972018-08-12 23:50:53 -0700407 u32 wrk_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100408 bool is_add [default=true];
Florin Coras15531972018-08-12 23:50:53 -0700409};
410
411/** \brief Reply for app worker add/del
412 @param context - returned sender context, to match reply w/ request
413 @param retval - return code
414 @param wrk_index - worker index, if add
415 @param app_event_queue_address - vpp event queue address of new worker
416 @param n_fds - number of fds exchanged
417 @param fd_flags - set of flags that indicate which fds are to be expected
Florin Coras458089b2019-08-21 16:20:44 -0700418 over the socket (set only if socket transport available)
Florin Corasfa76a762018-11-29 12:40:10 -0800419 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100420 @param is_add - add if non zero, else delete
421 @param segment_name - name of segment client needs to attach to
Florin Coras15531972018-08-12 23:50:53 -0700422*/
423define app_worker_add_del_reply
424{
425 u32 context;
426 i32 retval;
427 u32 wrk_index;
428 u64 app_event_queue_address;
429 u8 n_fds;
430 u8 fd_flags;
Florin Corasfa76a762018-11-29 12:40:10 -0800431 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100432 bool is_add [default=true];
433 string segment_name[];
Florin Coras15531972018-08-12 23:50:53 -0700434};
435
Florin Corase04c2992017-03-01 08:17:34 -0800436/** \brief enable/disable session layer
437 @param client_index - opaque cookie to identify the sender
438 client to vpp direction only
439 @param context - sender context, to match reply w/ request
440 @param is_enable - disable session layer if 0, enable otherwise
441*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400442autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800443 u32 client_index;
444 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100445 bool is_enable [default=true];
Florin Corase04c2992017-03-01 08:17:34 -0800446};
447
Florin Corascea194d2017-10-02 00:18:51 -0700448/** \brief add/del application namespace
449 @param client_index - opaque cookie to identify the sender
450 client to vpp direction only
451 @param context - sender context, to match reply w/ request
Florin Coras64424012019-03-02 10:47:47 -0800452 @param secret - secret shared between app and vpp
Florin Corascea194d2017-10-02 00:18:51 -0700453 @param sw_if_index - local interface that "supports" namespace. Set to
Florin Coras64424012019-03-02 10:47:47 -0800454 ~0 if no preference
455 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
456 if sw_if_index set.
457 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
458 if sw_if_index set.
Florin Corascea194d2017-10-02 00:18:51 -0700459 @param namespace_id - namespace id
460*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800461define app_namespace_add_del {
Florin Corascea194d2017-10-02 00:18:51 -0700462 u32 client_index;
463 u32 context;
464 u64 secret;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100465 vl_api_interface_index_t sw_if_index;
Florin Corascea194d2017-10-02 00:18:51 -0700466 u32 ip4_fib_id;
467 u32 ip6_fib_id;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100468 string namespace_id[];
Florin Corascea194d2017-10-02 00:18:51 -0700469};
470
Florin Coras6e8c6672017-11-10 09:03:54 -0800471/** \brief Reply for app namespace add/del
472 @param context - returned sender context, to match reply w/ request
473 @param retval - return code
474 @param appns_index - app namespace index
475*/
476define app_namespace_add_del_reply
477{
478 u32 context;
479 i32 retval;
480 u32 appns_index;
481};
482
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100483enum session_rule_scope {
484 SESSION_RULE_SCOPE_API_GLOBAL = 0,
485 SESSION_RULE_SCOPE_API_LOCAL = 1,
486 SESSION_RULE_SCOPE_API_BOTH = 2,
487};
488
Florin Coras1c710452017-10-17 00:03:13 -0700489/** \brief add/del session rule
490 @param client_index - opaque cookie to identify the sender
491 client to vpp direction only
492 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100493 @param transport_proto - transport protocol
Florin Coras1c710452017-10-17 00:03:13 -0700494 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
495 @param lcl_ip - local ip
496 @param lcl_plen - local prefix length
497 @param rmt_ip - remote ip
498 @param rmt_ple - remote prefix length
499 @param lcl_port - local port
500 @param rmt_port - remote port
Florin Coras64424012019-03-02 10:47:47 -0800501 @param action_index - the only action defined now is forward to
502 application with index action_index
503 @param is_add - flag to indicate if add or del
504 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100505 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800506 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100507 @param tag - tag
Florin Coras1c710452017-10-17 00:03:13 -0700508*/
509autoreply define session_rule_add_del {
510 u32 client_index;
511 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100512 vl_api_transport_proto_t transport_proto;
513 vl_api_prefix_t lcl;
514 vl_api_prefix_t rmt;
Florin Coras1c710452017-10-17 00:03:13 -0700515 u16 lcl_port;
516 u16 rmt_port;
517 u32 action_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100518 bool is_add [default=true];
Florin Coras1c710452017-10-17 00:03:13 -0700519 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100520 vl_api_session_rule_scope_t scope;
521 string tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700522};
523
Florin Coras6c36f532017-11-03 18:32:34 -0700524/** \brief Dump session rules
525 @param client_index - opaque cookie to identify the sender
526 @param context - sender context, to match reply w/ request
527 */
528define session_rules_dump
529{
530 u32 client_index;
531 u32 context;
532};
533
534/** \brief Session rules details
Florin Coras64424012019-03-02 10:47:47 -0800535 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100536 @param transport_proto - transport protocol
Florin Coras6c36f532017-11-03 18:32:34 -0700537 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
538 @param lcl_ip - local ip
539 @param lcl_plen - local prefix length
540 @param rmt_ip - remote ip
541 @param rmt_ple - remote prefix length
542 @param lcl_port - local port
543 @param rmt_port - remote port
544 @param action_index - the only action defined now is forward to
Florin Coras64424012019-03-02 10:47:47 -0800545 application with index action_index
546 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100547 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800548 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100549 @param tag - tag
Florin Coras6c36f532017-11-03 18:32:34 -0700550 */
551define session_rules_details
552{
553 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100554 vl_api_transport_proto_t transport_proto;
555 vl_api_prefix_t lcl;
556 vl_api_prefix_t rmt;
Florin Coras6c36f532017-11-03 18:32:34 -0700557 u16 lcl_port;
558 u16 rmt_port;
559 u32 action_index;
560 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100561 vl_api_session_rule_scope_t scope;
562 string tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700563};
564
Dave Barach68b0fb02017-02-28 15:15:56 -0500565/*
566 * Local Variables:
567 * eval: (c-set-style "gnu")
568 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400569 */