blob: f95abb92f78eaea78160cb46588acf97a4769a19 [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
Florin Coras888d9f02020-04-02 23:00:13 +000016option version = "3.0.0";
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010017
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 Coras458089b2019-08-21 16:20:44 -070032/** \brief Application attach to session layer
33 @param client_index - opaque cookie to identify the sender
34 @param context - sender context, to match reply w/ request
35 @param options - segment size, fifo sizes, etc.
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010036 @param namespace_id - string
Florin Coras458089b2019-08-21 16:20:44 -070037*/
38 define app_attach {
39 u32 client_index;
40 u32 context;
Florin Coras2de9c0f2020-02-02 19:30:39 +000041 u64 options[17];
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010042 string namespace_id[];
Florin Coras458089b2019-08-21 16:20:44 -070043 };
44
45 /** \brief Application attach reply
46 @param context - sender context, to match reply w/ request
47 @param retval - return code for the request
48 @param app_mq - app message queue
49 @param vpp_ctrl_mq - vpp message queue for control events that should
50 be handled in main thread, i.e., bind/connect
51 @param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
52 @param app_index - index of the newly created app
53 @param n_fds - number of fds exchanged
54 @param fd_flags - set of flags that indicate which fds are to be expected
55 over the socket (set only if socket transport available)
56 @param segment_size - size of first shm segment
Florin Coras458089b2019-08-21 16:20:44 -070057 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010058 @param segment_name - name of segment client needs to attach to
Florin Coras458089b2019-08-21 16:20:44 -070059*/
60define app_attach_reply {
61 u32 context;
62 i32 retval;
63 u64 app_mq;
64 u64 vpp_ctrl_mq;
65 u8 vpp_ctrl_mq_thread;
66 u32 app_index;
67 u8 n_fds;
68 u8 fd_flags;
69 u32 segment_size;
Florin Coras458089b2019-08-21 16:20:44 -070070 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +010071 string segment_name[];
Florin Coras458089b2019-08-21 16:20:44 -070072};
73
Florin Coras888d9f02020-04-02 23:00:13 +000074 /** \brief client->vpp, attach application to session layer
75 @param client_index - opaque cookie to identify the sender
76 @param context - sender context, to match reply w/ request
77*/
78autoreply define application_detach {
79 u32 client_index;
80 u32 context;
81};
82
Nathan Skrzypczak79f89532019-09-13 11:08:13 +020083/** \brief Add certificate and key
84 @param client_index - opaque cookie to identify the sender
85 @param context - sender context, to match reply w/ request
86 @param engine - crypto engine
87 @param cert_len - cert length (comes first)
88 @param certkey_len - cert and key length
89 @param certkey - cert & key data (due to API limitation)
90*/
91define app_add_cert_key_pair {
92 u32 client_index;
93 u32 context;
94 u16 cert_len;
95 u16 certkey_len;
96 u8 certkey[certkey_len];
97};
98
99/** \brief Add certificate and key
100 @param context - sender context, to match reply w/ request
101 @param retval - return code for the request
102 @param index - index in certificate store
103*/
104define app_add_cert_key_pair_reply {
105 u32 context;
106 i32 retval;
107 u32 index;
108};
109
110/** \brief Delete certificate and key
111 @param client_index - opaque cookie to identify the sender
112 @param context - sender context, to match reply w/ request
113 @param index - index in certificate store
114*/
115autoreply define app_del_cert_key_pair {
116 u32 client_index;
117 u32 context;
118 u32 index;
119};
120
Florin Coras371ca502018-02-21 12:07:41 -0800121/** \brief Application add TLS certificate
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200122 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800123 @param client_index - opaque cookie to identify the sender
124 @param context - sender context, to match reply w/ request
125 @param cert_len - certificate length
126 @param cert - certificate as a string
127*/
128autoreply define application_tls_cert_add {
129 u32 client_index;
130 u32 context;
131 u32 app_index;
132 u16 cert_len;
133 u8 cert[cert_len];
134};
135
136/** \brief Application add TLS key
Nathan Skrzypczak79f89532019-09-13 11:08:13 +0200137 ### WILL BE DEPRECATED POST 20.01 ###
Florin Coras371ca502018-02-21 12:07:41 -0800138 @param client_index - opaque cookie to identify the sender
139 @param context - sender context, to match reply w/ request
140 @param key_len - certificate length
141 @param key - PEM encoded key as a string
142*/
143autoreply define application_tls_key_add {
144 u32 client_index;
145 u32 context;
146 u32 app_index;
147 u16 key_len;
148 u8 key[key_len];
149};
150
Florin Coras15531972018-08-12 23:50:53 -0700151/** \brief add/del application worker
152 @param client_index - opaque cookie to identify the sender
153 client to vpp direction only
154 @param context - sender context, to match reply w/ request
Florin Corasc1f5a432018-11-20 11:31:26 -0800155 @param app_index - application index
Florin Coras15531972018-08-12 23:50:53 -0700156 @param wrk_index - worker index, if a delete
157 @param is_add - set if an add
158*/
159define app_worker_add_del
160{
161 u32 client_index;
162 u32 context;
Florin Corasc1f5a432018-11-20 11:31:26 -0800163 u32 app_index;
Florin Coras15531972018-08-12 23:50:53 -0700164 u32 wrk_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100165 bool is_add [default=true];
Florin Coras15531972018-08-12 23:50:53 -0700166};
167
168/** \brief Reply for app worker add/del
169 @param context - returned sender context, to match reply w/ request
170 @param retval - return code
171 @param wrk_index - worker index, if add
172 @param app_event_queue_address - vpp event queue address of new worker
173 @param n_fds - number of fds exchanged
174 @param fd_flags - set of flags that indicate which fds are to be expected
Florin Coras458089b2019-08-21 16:20:44 -0700175 over the socket (set only if socket transport available)
Florin Corasfa76a762018-11-29 12:40:10 -0800176 @param segment_handle - handle for segment
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100177 @param is_add - add if non zero, else delete
178 @param segment_name - name of segment client needs to attach to
Florin Coras15531972018-08-12 23:50:53 -0700179*/
180define app_worker_add_del_reply
181{
182 u32 context;
183 i32 retval;
184 u32 wrk_index;
185 u64 app_event_queue_address;
186 u8 n_fds;
187 u8 fd_flags;
Florin Corasfa76a762018-11-29 12:40:10 -0800188 u64 segment_handle;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100189 bool is_add [default=true];
190 string segment_name[];
Florin Coras15531972018-08-12 23:50:53 -0700191};
192
Florin Corase04c2992017-03-01 08:17:34 -0800193/** \brief enable/disable session layer
194 @param client_index - opaque cookie to identify the sender
195 client to vpp direction only
196 @param context - sender context, to match reply w/ request
197 @param is_enable - disable session layer if 0, enable otherwise
198*/
Dave Barach11b8dbf2017-04-24 10:46:54 -0400199autoreply define session_enable_disable {
Florin Corase04c2992017-03-01 08:17:34 -0800200 u32 client_index;
201 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100202 bool is_enable [default=true];
Florin Corase04c2992017-03-01 08:17:34 -0800203};
204
Florin Corascea194d2017-10-02 00:18:51 -0700205/** \brief add/del application namespace
206 @param client_index - opaque cookie to identify the sender
207 client to vpp direction only
208 @param context - sender context, to match reply w/ request
Florin Coras64424012019-03-02 10:47:47 -0800209 @param secret - secret shared between app and vpp
Florin Corascea194d2017-10-02 00:18:51 -0700210 @param sw_if_index - local interface that "supports" namespace. Set to
Florin Coras64424012019-03-02 10:47:47 -0800211 ~0 if no preference
212 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
213 if sw_if_index set.
214 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
215 if sw_if_index set.
Florin Corascea194d2017-10-02 00:18:51 -0700216 @param namespace_id - namespace id
217*/
Florin Coras6e8c6672017-11-10 09:03:54 -0800218define app_namespace_add_del {
Florin Corascea194d2017-10-02 00:18:51 -0700219 u32 client_index;
220 u32 context;
221 u64 secret;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100222 vl_api_interface_index_t sw_if_index;
Florin Corascea194d2017-10-02 00:18:51 -0700223 u32 ip4_fib_id;
224 u32 ip6_fib_id;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100225 string namespace_id[];
Florin Corascea194d2017-10-02 00:18:51 -0700226};
227
Florin Coras6e8c6672017-11-10 09:03:54 -0800228/** \brief Reply for app namespace add/del
229 @param context - returned sender context, to match reply w/ request
230 @param retval - return code
231 @param appns_index - app namespace index
232*/
233define app_namespace_add_del_reply
234{
235 u32 context;
236 i32 retval;
237 u32 appns_index;
238};
239
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100240enum session_rule_scope {
241 SESSION_RULE_SCOPE_API_GLOBAL = 0,
242 SESSION_RULE_SCOPE_API_LOCAL = 1,
243 SESSION_RULE_SCOPE_API_BOTH = 2,
244};
245
Florin Coras1c710452017-10-17 00:03:13 -0700246/** \brief add/del session rule
247 @param client_index - opaque cookie to identify the sender
248 client to vpp direction only
249 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100250 @param transport_proto - transport protocol
Florin Coras1c710452017-10-17 00:03:13 -0700251 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
252 @param lcl_ip - local ip
253 @param lcl_plen - local prefix length
254 @param rmt_ip - remote ip
255 @param rmt_ple - remote prefix length
256 @param lcl_port - local port
257 @param rmt_port - remote port
Florin Coras64424012019-03-02 10:47:47 -0800258 @param action_index - the only action defined now is forward to
259 application with index action_index
260 @param is_add - flag to indicate if add or del
261 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100262 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800263 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100264 @param tag - tag
Florin Coras1c710452017-10-17 00:03:13 -0700265*/
266autoreply define session_rule_add_del {
267 u32 client_index;
268 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100269 vl_api_transport_proto_t transport_proto;
270 vl_api_prefix_t lcl;
271 vl_api_prefix_t rmt;
Florin Coras1c710452017-10-17 00:03:13 -0700272 u16 lcl_port;
273 u16 rmt_port;
274 u32 action_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100275 bool is_add [default=true];
Florin Coras1c710452017-10-17 00:03:13 -0700276 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100277 vl_api_session_rule_scope_t scope;
278 string tag[64];
Florin Coras1c710452017-10-17 00:03:13 -0700279};
280
Florin Coras6c36f532017-11-03 18:32:34 -0700281/** \brief Dump session rules
282 @param client_index - opaque cookie to identify the sender
283 @param context - sender context, to match reply w/ request
284 */
285define session_rules_dump
286{
287 u32 client_index;
288 u32 context;
289};
290
291/** \brief Session rules details
Florin Coras64424012019-03-02 10:47:47 -0800292 @param context - sender context, to match reply w/ request
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100293 @param transport_proto - transport protocol
Florin Coras6c36f532017-11-03 18:32:34 -0700294 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
295 @param lcl_ip - local ip
296 @param lcl_plen - local prefix length
297 @param rmt_ip - remote ip
298 @param rmt_ple - remote prefix length
299 @param lcl_port - local port
300 @param rmt_port - remote port
301 @param action_index - the only action defined now is forward to
Florin Coras64424012019-03-02 10:47:47 -0800302 application with index action_index
303 @param appns_index - application namespace where rule is to be applied to
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100304 @param scope - enum that indicates scope of the rule: global or local.
Florin Coras64424012019-03-02 10:47:47 -0800305 If 0, default is global, 1 is global 2 is local, 3 is both
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100306 @param tag - tag
Florin Coras6c36f532017-11-03 18:32:34 -0700307 */
308define session_rules_details
309{
310 u32 context;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100311 vl_api_transport_proto_t transport_proto;
312 vl_api_prefix_t lcl;
313 vl_api_prefix_t rmt;
Florin Coras6c36f532017-11-03 18:32:34 -0700314 u16 lcl_port;
315 u16 rmt_port;
316 u32 action_index;
317 u32 appns_index;
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100318 vl_api_session_rule_scope_t scope;
319 string tag[64];
Florin Coras6c36f532017-11-03 18:32:34 -0700320};
321
Dave Barach68b0fb02017-02-28 15:15:56 -0500322/*
323 * Local Variables:
324 * eval: (c-set-style "gnu")
325 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400326 */