blob: 4ff6367fa27f9ba7c0467b64504bcd791ad26d34 [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,
26 TRANSPORT_PROTO_API_SCTP,
27 TRANSPORT_PROTO_API_NONE,
28 TRANSPORT_PROTO_API_TLS,
29 TRANSPORT_PROTO_API_UDPC,
30 TRANSPORT_PROTO_API_QUIC,
31};
Dave Barach0d056e52017-09-28 15:11:16 -040032
Florin Coras6cf30ad2017-04-04 23:08:23 -070033/** \brief client->vpp, attach application to session layer
Florin Coras458089b2019-08-21 16:20:44 -070034 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -070035 @param client_index - opaque cookie to identify the sender
36 @param context - sender context, to match reply w/ request
Florin Coras458089b2019-08-21 16:20:44 -070037 @param initial_segment_size - size of the initial shm segment to be
Florin Coras6cf30ad2017-04-04 23:08:23 -070038 allocated
39 @param options - segment size, fifo sizes, etc.
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010040 @param namespace_id - string
Florin Coras6cf30ad2017-04-04 23:08:23 -070041*/
42 define application_attach {
43 u32 client_index;
44 u32 context;
45 u32 initial_segment_size;
Florin Coras2de9c0f2020-02-02 19:30:39 +000046 u64 options[17];
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010047 string namespace_id[];
Florin Coras6cf30ad2017-04-04 23:08:23 -070048 };
Florin Coras458089b2019-08-21 16:20:44 -070049
Florin Coras6cf30ad2017-04-04 23:08:23 -070050 /** \brief Application attach reply
Florin Coras458089b2019-08-21 16:20:44 -070051 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -070052 @param context - sender context, to match reply w/ request
53 @param retval - return code for the request
Florin Coras458089b2019-08-21 16:20:44 -070054 @param app_event_queue_address - vpp event queue address or 0 if this
Florin Coras6cf30ad2017-04-04 23:08:23 -070055 connection shouldn't send events
Florin Coras99368312018-08-02 10:45:44 -070056 @param n_fds - number of fds exchanged
57 @param fd_flags - set of flags that indicate which fds are to be expected
Florin Coras458089b2019-08-21 16:20:44 -070058 over the socket (set only if socket transport available)
Florin Coras6cf30ad2017-04-04 23:08:23 -070059 @param segment_size - size of first shm segment
Florin Corasc1f5a432018-11-20 11:31:26 -080060 @param app_index - index of the newly created app
Florin Corasd85de682018-11-29 17:02:29 -080061 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010062 @param segment_name - name of segment client needs to attach to
Florin Coras6cf30ad2017-04-04 23:08:23 -070063*/
64define application_attach_reply {
65 u32 context;
66 i32 retval;
67 u64 app_event_queue_address;
Florin Coras99368312018-08-02 10:45:44 -070068 u8 n_fds;
69 u8 fd_flags;
Florin Coras6cf30ad2017-04-04 23:08:23 -070070 u32 segment_size;
Florin Corasc1f5a432018-11-20 11:31:26 -080071 u32 app_index;
Florin Corasd85de682018-11-29 17:02:29 -080072 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010073 string segment_name[];
Florin Coras6cf30ad2017-04-04 23:08:23 -070074};
75
Florin Coras458089b2019-08-21 16:20:44 -070076/** \brief Application attach to session layer
77 @param client_index - opaque cookie to identify the sender
78 @param context - sender context, to match reply w/ request
79 @param options - segment size, fifo sizes, etc.
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010080 @param namespace_id - string
Florin Coras458089b2019-08-21 16:20:44 -070081*/
82 define app_attach {
83 u32 client_index;
84 u32 context;
Florin Coras2de9c0f2020-02-02 19:30:39 +000085 u64 options[17];
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010086 string namespace_id[];
Florin Coras458089b2019-08-21 16:20:44 -070087 };
88
89 /** \brief Application attach reply
90 @param context - sender context, to match reply w/ request
91 @param retval - return code for the request
92 @param app_mq - app message queue
93 @param vpp_ctrl_mq - vpp message queue for control events that should
94 be handled in main thread, i.e., bind/connect
95 @param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
96 @param app_index - index of the newly created app
97 @param n_fds - number of fds exchanged
98 @param fd_flags - set of flags that indicate which fds are to be expected
99 over the socket (set only if socket transport available)
100 @param segment_size - size of first shm segment
Florin Coras458089b2019-08-21 16:20:44 -0700101 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100102 @param segment_name - name of segment client needs to attach to
Florin Coras458089b2019-08-21 16:20:44 -0700103*/
104define app_attach_reply {
105 u32 context;
106 i32 retval;
107 u64 app_mq;
108 u64 vpp_ctrl_mq;
109 u8 vpp_ctrl_mq_thread;
110 u32 app_index;
111 u8 n_fds;
112 u8 fd_flags;
113 u32 segment_size;
Florin Coras458089b2019-08-21 16:20:44 -0700114 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100115 string segment_name[];
Florin Coras458089b2019-08-21 16:20:44 -0700116};
117
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200118/** \brief Add certificate and key
119 @param client_index - opaque cookie to identify the sender
120 @param context - sender context, to match reply w/ request
121 @param engine - crypto engine
122 @param cert_len - cert length (comes first)
123 @param certkey_len - cert and key length
124 @param certkey - cert & key data (due to API limitation)
125*/
126define app_add_cert_key_pair {
127 u32 client_index;
128 u32 context;
129 u16 cert_len;
130 u16 certkey_len;
131 u8 certkey[certkey_len];
132};
133
134/** \brief Add certificate and key
135 @param context - sender context, to match reply w/ request
136 @param retval - return code for the request
137 @param index - index in certificate store
138*/
139define app_add_cert_key_pair_reply {
140 u32 context;
141 i32 retval;
142 u32 index;
143};
144
145/** \brief Delete certificate and key
146 @param client_index - opaque cookie to identify the sender
147 @param context - sender context, to match reply w/ request
148 @param index - index in certificate store
149*/
150autoreply define app_del_cert_key_pair {
151 u32 client_index;
152 u32 context;
153 u32 index;
154};
155
Florin Coras371ca502018-02-21 12:07:41 -0800156/** \brief Application add TLS certificate
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200157 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800158 @param client_index - opaque cookie to identify the sender
159 @param context - sender context, to match reply w/ request
160 @param cert_len - certificate length
161 @param cert - certificate as a string
162*/
163autoreply define application_tls_cert_add {
164 u32 client_index;
165 u32 context;
166 u32 app_index;
167 u16 cert_len;
168 u8 cert[cert_len];
169};
170
171/** \brief Application add TLS key
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200172 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800173 @param client_index - opaque cookie to identify the sender
174 @param context - sender context, to match reply w/ request
175 @param key_len - certificate length
176 @param key - PEM encoded key as a string
177*/
178autoreply define application_tls_key_add {
179 u32 client_index;
180 u32 context;
181 u32 app_index;
182 u16 key_len;
183 u8 key[key_len];
184};
185
Florin Coras6cf30ad2017-04-04 23:08:23 -0700186 /** \brief client->vpp, attach application to session layer
Florin Coras458089b2019-08-21 16:20:44 -0700187 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -0700188 @param client_index - opaque cookie to identify the sender
189 @param context - sender context, to match reply w/ request
190*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400191autoreply define application_detach {
Florin Coras6cf30ad2017-04-04 23:08:23 -0700192 u32 client_index;
193 u32 context;
194 };
Florin Coras458089b2019-08-21 16:20:44 -0700195
Florin Coras6cf30ad2017-04-04 23:08:23 -0700196/** \brief vpp->client, please map an additional shared memory segment
Florin Corasc4c4cf52019-08-24 18:17:34 -0700197 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras6cf30ad2017-04-04 23:08:23 -0700198 @param client_index - opaque cookie to identify the sender
199 @param context - sender context, to match reply w/ request
Florin Coras458089b2019-08-21 16:20:44 -0700200 @param fd_flags - set of flags that indicate which, if any, fds are
201 to be expected over the socket. This is set only if
Florin Coras99368312018-08-02 10:45:44 -0700202 socket transport available
203 @param segment_size - size of the segment to be mapped
204 @param segment_name - name of the segment to be mapped
Florin Corasfa76a762018-11-29 12:40:10 -0800205 @param segment_handle - unique identifier for segment
Florin Coras6cf30ad2017-04-04 23:08:23 -0700206*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400207autoreply define map_another_segment {
Florin Coras6cf30ad2017-04-04 23:08:23 -0700208 u32 client_index;
209 u32 context;
Florin Coras99368312018-08-02 10:45:44 -0700210 u8 fd_flags;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700211 u32 segment_size;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100212 string segment_name[128];
Florin Corasfa76a762018-11-29 12:40:10 -0800213 u64 segment_handle;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700214};
215
Florin Corasf8f516a2018-02-08 15:10:09 -0800216/** \brief vpp->client unmap shared memory segment
Florin Corasc4c4cf52019-08-24 18:17:34 -0700217 ### WILL BE DEPRECATED POST 20.01 ###
Florin Corasf8f516a2018-02-08 15:10:09 -0800218 @param client_index - opaque cookie to identify the sender
219 @param context - sender context, to match reply w/ request
Florin Corasfa76a762018-11-29 12:40:10 -0800220 @param segment_name - segment name
Florin Coras458089b2019-08-21 16:20:44 -0700221 @param segment_handle - handle of the segment to be unmapped
Florin Corasf8f516a2018-02-08 15:10:09 -0800222*/
223autoreply define unmap_segment {
224 u32 client_index;
225 u32 context;
Florin Corasfa76a762018-11-29 12:40:10 -0800226 u64 segment_handle;
Florin Corasf8f516a2018-02-08 15:10:09 -0800227};
228
Dave Barach68b0fb02017-02-28 15:15:56 -0500229 /** \brief Bind to a given URI
Florin Coras458089b2019-08-21 16:20:44 -0700230 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500231 @param client_index - opaque cookie to identify the sender
232 @param context - sender context, to match reply w/ request
233 @param accept_cookie - sender accept cookie, to identify this bind flavor
234 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
235 "tcp://::/0/80" [ipv6] etc.
236 @param options - socket options, fifo sizes, etc.
237*/
Florin Coras64424012019-03-02 10:47:47 -0800238autoreply define bind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500239 u32 client_index;
240 u32 context;
241 u32 accept_cookie;
Dave Barach68b0fb02017-02-28 15:15:56 -0500242 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500243};
Florin Coras7fb0fe12018-04-09 09:24:52 -0700244
Dave Barach68b0fb02017-02-28 15:15:56 -0500245/** \brief Unbind a given URI
Florin Coras458089b2019-08-21 16:20:44 -0700246 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500247 @param client_index - opaque cookie to identify the sender
248 @param context - sender context, to match reply w/ request
249 @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
250 "tcp://::/0/80" [ipv6], etc.
251 @param options - socket options, fifo sizes, etc.
252*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400253autoreply define unbind_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500254 u32 client_index;
255 u32 context;
256 u8 uri[128];
257};
258
259/** \brief Connect to a given URI
Florin Coras458089b2019-08-21 16:20:44 -0700260 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500261 @param client_index - opaque cookie to identify the sender
262 @param context - sender context, to match reply w/ request
Florin Coras458089b2019-08-21 16:20:44 -0700263 @param client_queue_address - binary API client queue address. Used by
Florin Coras6cf30ad2017-04-04 23:08:23 -0700264 local server when connect was redirected.
Florin Corascea194d2017-10-02 00:18:51 -0700265 @param options - socket options, fifo sizes, etc. passed by vpp to the
Florin Coras458089b2019-08-21 16:20:44 -0700266 server when redirecting connects
Florin Corascea194d2017-10-02 00:18:51 -0700267 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
268 "tcp6://::/0/80" [ipv6], etc.
Dave Barach68b0fb02017-02-28 15:15:56 -0500269*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400270autoreply define connect_uri {
Dave Barach68b0fb02017-02-28 15:15:56 -0500271 u32 client_index;
272 u32 context;
Dave Barach68b0fb02017-02-28 15:15:56 -0500273 u64 client_queue_address;
274 u64 options[16];
Florin Corascea194d2017-10-02 00:18:51 -0700275 u8 uri[128];
Dave Barach68b0fb02017-02-28 15:15:56 -0500276};
277
Dave Barach68b0fb02017-02-28 15:15:56 -0500278/** \brief bidirectional disconnect API
Florin Coras458089b2019-08-21 16:20:44 -0700279 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500280 @param client_index - opaque cookie to identify the sender
281 client to vpp direction only
282 @param context - sender context, to match reply w/ request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700283 @param handle - session handle obtained from accept/connect
Dave Barach68b0fb02017-02-28 15:15:56 -0500284*/
285define disconnect_session {
286 u32 client_index;
287 u32 context;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700288 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500289};
290
291/** \brief bidirectional disconnect reply API
Florin Coras458089b2019-08-21 16:20:44 -0700292 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500293 @param client_index - opaque cookie to identify the sender
294 client to vpp direction only
295 @param context - sender context, to match reply w/ request
296 @param retval - return code for the request
Florin Coras6cf30ad2017-04-04 23:08:23 -0700297 @param handle - session handle
Dave Barach68b0fb02017-02-28 15:15:56 -0500298*/
299define disconnect_session_reply {
Dave Barach68b0fb02017-02-28 15:15:56 -0500300 u32 context;
301 i32 retval;
Florin Coras6cf30ad2017-04-04 23:08:23 -0700302 u64 handle;
Dave Barach68b0fb02017-02-28 15:15:56 -0500303};
304
Dave Barach68b0fb02017-02-28 15:15:56 -0500305/** \brief Bind to an ip:port pair for a given transport protocol
Florin Coras458089b2019-08-21 16:20:44 -0700306 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500307 @param client_index - opaque cookie to identify the sender
308 @param context - sender context, to match reply w/ request
Florin Coras15531972018-08-12 23:50:53 -0700309 @param wrk_index - index of worker requesting the bind
Dave Barach68b0fb02017-02-28 15:15:56 -0500310 @param vrf - bind namespace
Dave Barach68b0fb02017-02-28 15:15:56 -0500311 @param ip - ip address
Florin Coras458089b2019-08-21 16:20:44 -0700312 @param port - port
Dave Barach68b0fb02017-02-28 15:15:56 -0500313 @param proto - protocol 0 - TCP 1 - UDP
314 @param options - socket options, fifo sizes, etc.
315*/
Florin Coras64424012019-03-02 10:47:47 -0800316autoreply define bind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500317 u32 client_index;
318 u32 context;
Florin Coras15531972018-08-12 23:50:53 -0700319 u32 wrk_index;
Dave Barach68b0fb02017-02-28 15:15:56 -0500320 u32 vrf;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100321 vl_api_address_t ip;
Dave Barach68b0fb02017-02-28 15:15:56 -0500322 u16 port;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100323 vl_api_transport_proto_t proto;
Dave Barach68b0fb02017-02-28 15:15:56 -0500324 u64 options[16];
325};
326
Florin Coras458089b2019-08-21 16:20:44 -0700327/** \brief Unbind
328 ### WILL BE DEPRECATED POST 20.01 ###s
Dave Barach68b0fb02017-02-28 15:15:56 -0500329 @param client_index - opaque cookie to identify the sender
330 @param context - sender context, to match reply w/ request
Florin Corasab2f6db2018-08-31 14:31:41 -0700331 @param wrk_index - index of worker requesting the bind
Dave Barach68b0fb02017-02-28 15:15:56 -0500332 @param handle - bind handle obtained from bind reply
333*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400334autoreply define unbind_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500335 u32 client_index;
336 u32 context;
Florin Corasab2f6db2018-08-31 14:31:41 -0700337 u32 wrk_index;
Dave Barach68b0fb02017-02-28 15:15:56 -0500338 u64 handle;
339};
340
341/** \brief Connect to a remote peer
Florin Coras458089b2019-08-21 16:20:44 -0700342 ### WILL BE DEPRECATED POST 20.01 ###
Dave Barach68b0fb02017-02-28 15:15:56 -0500343 @param client_index - opaque cookie to identify the sender
344 @param context - sender context, to match reply w/ request
Florin Coras15531972018-08-12 23:50:53 -0700345 @param wrk_index - worker that requests the connect
Florin Coras458089b2019-08-21 16:20:44 -0700346 @param client_queue_address - client's API queue address. Non-zero when
Florin Corascea194d2017-10-02 00:18:51 -0700347 used to perform redirects
348 @param options - socket options, fifo sizes, etc. when doing redirects
Dave Barach68b0fb02017-02-28 15:15:56 -0500349 @param vrf - connection namespace
Dave Barach68b0fb02017-02-28 15:15:56 -0500350 @param ip - ip address
Florin Coras458089b2019-08-21 16:20:44 -0700351 @param port - port
Dave Barach68b0fb02017-02-28 15:15:56 -0500352 @param proto - protocol 0 - TCP 1 - UDP
Florin Coras8f89dd02018-03-05 16:53:07 -0800353 @param hostname-len - length of hostname
354 @param hostname - destination's hostname. If present, used by protocols
355 like tls.
Nathan Skrzypczak8ac1d6d2019-07-17 11:02:20 +0200356 @param parent_handle - handle of parent session (e.g. for opening quic streams).
Dave Barach68b0fb02017-02-28 15:15:56 -0500357*/
Dave Wallace33e002b2017-09-06 01:20:02 -0400358autoreply define connect_sock {
Dave Barach68b0fb02017-02-28 15:15:56 -0500359 u32 client_index;
360 u32 context;
Florin Coras15531972018-08-12 23:50:53 -0700361 u32 wrk_index;
Florin Corascea194d2017-10-02 00:18:51 -0700362 u64 client_queue_address;
363 u64 options[16];
Dave Barach68b0fb02017-02-28 15:15:56 -0500364 u32 vrf;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100365 vl_api_address_t ip;
Dave Barach68b0fb02017-02-28 15:15:56 -0500366 u16 port;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100367 vl_api_transport_proto_t proto;
Ole Troane5ff5a32019-08-23 22:55:18 +0200368 u64 parent_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100369 string hostname[];
Dave Barach68b0fb02017-02-28 15:15:56 -0500370};
371
Florin Coras99368312018-08-02 10:45:44 -0700372/** \brief ask app to add a new cut-through registration
Florin Coras458089b2019-08-21 16:20:44 -0700373 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras99368312018-08-02 10:45:44 -0700374 @param client_index - opaque cookie to identify the sender
375 client to vpp direction only
376 @param context - sender context, to match reply w/ request
377 @param evt_q_address - address of the mq in ssvm segment
378 @param peer_evt_q_address - address of peer's mq in ssvm segment
Florin Coras134a9962018-08-28 11:32:04 -0700379 @param wrk_index - index of worker to receive the registration
Florin Coras99368312018-08-02 10:45:44 -0700380 @param n_fds - number of fds exchanged
381 @param fd_flags - flag indicating the fds that will be exchanged over
382 api socket
383*/
384autoreply define app_cut_through_registration_add
385{
386 u32 client_index;
387 u32 context;
388 u64 evt_q_address;
389 u64 peer_evt_q_address;
Florin Coras134a9962018-08-28 11:32:04 -0700390 u32 wrk_index;
Florin Coras99368312018-08-02 10:45:44 -0700391 u8 n_fds;
392 u8 fd_flags;
393};
394
Florin Coras15531972018-08-12 23:50:53 -0700395/** \brief add/del application worker
396 @param client_index - opaque cookie to identify the sender
397 client to vpp direction only
398 @param context - sender context, to match reply w/ request
Florin Corasc1f5a432018-11-20 11:31:26 -0800399 @param app_index - application index
Florin Coras15531972018-08-12 23:50:53 -0700400 @param wrk_index - worker index, if a delete
401 @param is_add - set if an add
402*/
403define app_worker_add_del
404{
405 u32 client_index;
406 u32 context;
Florin Corasc1f5a432018-11-20 11:31:26 -0800407 u32 app_index;
Florin Coras15531972018-08-12 23:50:53 -0700408 u32 wrk_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100409 bool is_add [default=true];
Florin Coras15531972018-08-12 23:50:53 -0700410};
411
412/** \brief Reply for app worker add/del
413 @param context - returned sender context, to match reply w/ request
414 @param retval - return code
415 @param wrk_index - worker index, if add
416 @param app_event_queue_address - vpp event queue address of new worker
417 @param n_fds - number of fds exchanged
418 @param fd_flags - set of flags that indicate which fds are to be expected
Florin Coras458089b2019-08-21 16:20:44 -0700419 over the socket (set only if socket transport available)
Florin Corasfa76a762018-11-29 12:40:10 -0800420 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100421 @param is_add - add if non zero, else delete
422 @param segment_name - name of segment client needs to attach to
Florin Coras15531972018-08-12 23:50:53 -0700423*/
424define app_worker_add_del_reply
425{
426 u32 context;
427 i32 retval;
428 u32 wrk_index;
429 u64 app_event_queue_address;
430 u8 n_fds;
431 u8 fd_flags;
Florin Corasfa76a762018-11-29 12:40:10 -0800432 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100433 bool is_add [default=true];
434 string segment_name[];
Florin Coras15531972018-08-12 23:50:53 -0700435};
436
Florin Corase04c2992017-03-01 08:17:34 -0800437/** \brief enable/disable session layer
438 @param client_index - opaque cookie to identify the sender
439 client to vpp direction only
440 @param context - sender context, to match reply w/ request
441 @param is_enable - disable session layer if 0, enable otherwise
442*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400443autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800444 u32 client_index;
445 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100446 bool is_enable [default=true];
Florin Corase04c2992017-03-01 08:17:34 -0800447};
448
Florin Corascea194d2017-10-02 00:18:51 -0700449/** \brief add/del application namespace
450 @param client_index - opaque cookie to identify the sender
451 client to vpp direction only
452 @param context - sender context, to match reply w/ request
Florin Coras64424012019-03-02 10:47:47 -0800453 @param secret - secret shared between app and vpp
Florin Corascea194d2017-10-02 00:18:51 -0700454 @param sw_if_index - local interface that "supports" namespace. Set to
Florin Coras64424012019-03-02 10:47:47 -0800455 ~0 if no preference
456 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
457 if sw_if_index set.
458 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
459 if sw_if_index set.
Florin Corascea194d2017-10-02 00:18:51 -0700460 @param namespace_id - namespace id
461*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800462define app_namespace_add_del {
Florin Corascea194d2017-10-02 00:18:51 -0700463 u32 client_index;
464 u32 context;
465 u64 secret;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100466 vl_api_interface_index_t sw_if_index;
Florin Corascea194d2017-10-02 00:18:51 -0700467 u32 ip4_fib_id;
468 u32 ip6_fib_id;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100469 string namespace_id[];
Florin Corascea194d2017-10-02 00:18:51 -0700470};
471
Florin Coras6e8c6672017-11-10 09:03:54 -0800472/** \brief Reply for app namespace add/del
473 @param context - returned sender context, to match reply w/ request
474 @param retval - return code
475 @param appns_index - app namespace index
476*/
477define app_namespace_add_del_reply
478{
479 u32 context;
480 i32 retval;
481 u32 appns_index;
482};
483
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100484enum session_rule_scope {
485 SESSION_RULE_SCOPE_API_GLOBAL = 0,
486 SESSION_RULE_SCOPE_API_LOCAL = 1,
487 SESSION_RULE_SCOPE_API_BOTH = 2,
488};
489
Florin Coras1c710452017-10-17 00:03:13 -0700490/** \brief add/del session rule
491 @param client_index - opaque cookie to identify the sender
492 client to vpp direction only
493 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100494 @param transport_proto - transport protocol
Florin Coras1c710452017-10-17 00:03:13 -0700495 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
496 @param lcl_ip - local ip
497 @param lcl_plen - local prefix length
498 @param rmt_ip - remote ip
499 @param rmt_ple - remote prefix length
500 @param lcl_port - local port
501 @param rmt_port - remote port
Florin Coras64424012019-03-02 10:47:47 -0800502 @param action_index - the only action defined now is forward to
503 application with index action_index
504 @param is_add - flag to indicate if add or del
505 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100506 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800507 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100508 @param tag - tag
Florin Coras1c710452017-10-17 00:03:13 -0700509*/
510autoreply define session_rule_add_del {
511 u32 client_index;
512 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100513 vl_api_transport_proto_t transport_proto;
514 vl_api_prefix_t lcl;
515 vl_api_prefix_t rmt;
Florin Coras1c710452017-10-17 00:03:13 -0700516 u16 lcl_port;
517 u16 rmt_port;
518 u32 action_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100519 bool is_add [default=true];
Florin Coras1c710452017-10-17 00:03:13 -0700520 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100521 vl_api_session_rule_scope_t scope;
522 string tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700523};
524
Florin Coras6c36f532017-11-03 18:32:34 -0700525/** \brief Dump session rules
526 @param client_index - opaque cookie to identify the sender
527 @param context - sender context, to match reply w/ request
528 */
529define session_rules_dump
530{
531 u32 client_index;
532 u32 context;
533};
534
535/** \brief Session rules details
Florin Coras64424012019-03-02 10:47:47 -0800536 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100537 @param transport_proto - transport protocol
Florin Coras6c36f532017-11-03 18:32:34 -0700538 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
539 @param lcl_ip - local ip
540 @param lcl_plen - local prefix length
541 @param rmt_ip - remote ip
542 @param rmt_ple - remote prefix length
543 @param lcl_port - local port
544 @param rmt_port - remote port
545 @param action_index - the only action defined now is forward to
Florin Coras64424012019-03-02 10:47:47 -0800546 application with index action_index
547 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100548 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800549 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100550 @param tag - tag
Florin Coras6c36f532017-11-03 18:32:34 -0700551 */
552define session_rules_details
553{
554 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100555 vl_api_transport_proto_t transport_proto;
556 vl_api_prefix_t lcl;
557 vl_api_prefix_t rmt;
Florin Coras6c36f532017-11-03 18:32:34 -0700558 u16 lcl_port;
559 u16 rmt_port;
560 u32 action_index;
561 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100562 vl_api_session_rule_scope_t scope;
563 string tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700564};
565
Dave Barach68b0fb02017-02-28 15:15:56 -0500566/*
567 * Local Variables:
568 * eval: (c-set-style "gnu")
569 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400570 */