2 * Copyright (c) 2015-2020 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.
16 option version = "4.0.0";
18 import "vnet/interface_types.api";
19 import "vnet/ip/ip_types.api";
22 enum transport_proto : u8
24 TRANSPORT_PROTO_API_TCP,
25 TRANSPORT_PROTO_API_UDP,
26 TRANSPORT_PROTO_API_NONE,
27 TRANSPORT_PROTO_API_TLS,
28 TRANSPORT_PROTO_API_QUIC,
31 /** \brief Application attach to session layer
32 @param client_index - opaque cookie to identify the sender
33 @param context - sender context, to match reply w/ request
34 @param options - segment size, fifo sizes, etc.
35 @param namespace_id - string
41 string namespace_id[];
44 /** \brief Application attach reply
45 @param context - sender context, to match reply w/ request
46 @param retval - return code for the request
47 @param app_mq - app message queue
48 @param vpp_ctrl_mq - vpp message queue for control events that should
49 be handled in main thread, i.e., bind/connect
50 @param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
51 @param app_index - index of the newly created app
52 @param n_fds - number of fds exchanged
53 @param fd_flags - set of flags that indicate which fds are to be expected
54 over the socket (set only if socket transport available)
55 @param segment_size - size of first shm segment
56 @param segment_handle - handle for segment
57 @param segment_name - name of segment client needs to attach to
59 define app_attach_reply {
64 u8 vpp_ctrl_mq_thread;
70 string segment_name[];
73 /** \brief Application detach from session layer
74 @param client_index - opaque cookie to identify the sender
75 @param context - sender context, to match reply w/ request
77 autoreply define application_detach {
82 /** \brief Add certificate and key
83 @param client_index - opaque cookie to identify the sender
84 @param context - sender context, to match reply w/ request
85 @param engine - crypto engine
86 @param cert_len - cert length (comes first)
87 @param certkey_len - cert and key length
88 @param certkey - cert & key data (due to API limitation)
90 define app_add_cert_key_pair {
95 u8 certkey[certkey_len];
98 /** \brief Add certificate and key
99 @param context - sender context, to match reply w/ request
100 @param retval - return code for the request
101 @param index - index in certificate store
103 define app_add_cert_key_pair_reply {
109 /** \brief Delete certificate and key
110 @param client_index - opaque cookie to identify the sender
111 @param context - sender context, to match reply w/ request
112 @param index - index in certificate store
114 autoreply define app_del_cert_key_pair {
120 /** \brief add/del application worker
121 @param client_index - opaque cookie to identify the sender
122 client to vpp direction only
123 @param context - sender context, to match reply w/ request
124 @param app_index - application index
125 @param wrk_index - worker index, if a delete
126 @param is_add - set if an add
128 define app_worker_add_del
134 bool is_add [default=true];
137 /** \brief Reply for app worker add/del
138 @param context - returned sender context, to match reply w/ request
139 @param retval - return code
140 @param wrk_index - worker index, if add
141 @param app_event_queue_address - vpp event queue address of new worker
142 @param n_fds - number of fds exchanged
143 @param fd_flags - set of flags that indicate which fds are to be expected
144 over the socket (set only if socket transport available)
145 @param segment_handle - handle for segment
146 @param is_add - add if non zero, else delete
147 @param segment_name - name of segment client needs to attach to
149 define app_worker_add_del_reply
154 u64 app_event_queue_address;
158 bool is_add [default=true];
159 string segment_name[];
162 /** \brief enable/disable session layer
163 @param client_index - opaque cookie to identify the sender
164 client to vpp direction only
165 @param context - sender context, to match reply w/ request
166 @param is_enable - disable session layer if 0, enable otherwise
168 autoreply define session_enable_disable {
171 bool is_enable [default=true];
174 /** \brief enable/disable session layer socket api
175 @param client_index - opaque cookie to identify the sender
176 client to vpp direction only
177 @param context - sender context, to match reply w/ request
178 @param is_enable - disable session layer if 0, enable otherwise
180 autoreply define session_sapi_enable_disable {
183 bool is_enable [default=true];
186 /** \brief add/del application namespace
187 @param client_index - opaque cookie to identify the sender
188 client to vpp direction only
189 @param context - sender context, to match reply w/ request
190 @param secret - secret shared between app and vpp
191 @param sw_if_index - local interface that "supports" namespace. Set to
193 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
195 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
197 @param namespace_id - namespace id
199 define app_namespace_add_del {
204 vl_api_interface_index_t sw_if_index [default=0xffffffff];
207 string namespace_id[];
210 /** \brief add/del application namespace
211 @param client_index - opaque cookie to identify the sender
212 client to vpp direction only
213 @param context - sender context, to match reply w/ request
214 @param secret - secret shared between app and vpp
215 @param sw_if_index - local interface that "supports" namespace. Set to
217 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
219 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
221 @param namespace_id - namespace id
222 @param sock_name - socket name (path, abstract socket name)
224 define app_namespace_add_del_v4 {
229 bool is_add [default=true];
230 vl_api_interface_index_t sw_if_index [default=0xffffffff];
233 string namespace_id[64];
237 /** \brief Reply for app namespace add/del
238 @param context - returned sender context, to match reply w/ request
239 @param retval - return code
240 @param appns_index - app namespace index
242 define app_namespace_add_del_v4_reply
249 /** \brief add/del application namespace
250 @param client_index - opaque cookie to identify the sender
251 client to vpp direction only
252 @param context - sender context, to match reply w/ request
253 @param secret - secret shared between app and vpp
254 @param sw_if_index - local interface that "supports" namespace. Set to
256 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
258 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
260 @param namespace_id - namespace id
261 @param netns - linux net namespace
263 define app_namespace_add_del_v2 {
268 vl_api_interface_index_t sw_if_index [default=0xffffffff];
271 string namespace_id[64];
275 /** \brief add/del application namespace
276 @param client_index - opaque cookie to identify the sender
277 client to vpp direction only
278 @param context - sender context, to match reply w/ request
279 @param secret - secret shared between app and vpp
280 @param sw_if_index - local interface that "supports" namespace. Set to
282 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
284 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
286 @param namespace_id - namespace id
287 @param netns - linux net namespace
288 @param sock_name - socket name (path, abstract socket name)
290 define app_namespace_add_del_v3 {
295 bool is_add [default=true];
296 vl_api_interface_index_t sw_if_index [default=0xffffffff];
299 string namespace_id[64];
304 /** \brief Reply for app namespace add/del
305 @param context - returned sender context, to match reply w/ request
306 @param retval - return code
307 @param appns_index - app namespace index
309 define app_namespace_add_del_reply
317 /** \brief Reply for app namespace add/del
318 @param context - returned sender context, to match reply w/ request
319 @param retval - return code
320 @param appns_index - app namespace index
322 define app_namespace_add_del_v2_reply
330 define app_namespace_add_del_v3_reply
338 enum session_rule_scope {
339 SESSION_RULE_SCOPE_API_GLOBAL = 0,
340 SESSION_RULE_SCOPE_API_LOCAL = 1,
341 SESSION_RULE_SCOPE_API_BOTH = 2,
344 /** \brief add/del session rule
345 @param client_index - opaque cookie to identify the sender
346 client to vpp direction only
347 @param context - sender context, to match reply w/ request
348 @param transport_proto - transport protocol
349 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
350 @param lcl_ip - local ip
351 @param lcl_plen - local prefix length
352 @param rmt_ip - remote ip
353 @param rmt_ple - remote prefix length
354 @param lcl_port - local port
355 @param rmt_port - remote port
356 @param action_index - the only action defined now is forward to
357 application with index action_index
358 @param is_add - flag to indicate if add or del
359 @param appns_index - application namespace where rule is to be applied to
360 @param scope - enum that indicates scope of the rule: global or local.
361 If 0, default is global, 1 is global 2 is local, 3 is both
364 autoreply define session_rule_add_del {
367 vl_api_transport_proto_t transport_proto;
373 bool is_add [default=true];
375 vl_api_session_rule_scope_t scope;
379 /** \brief Dump session rules
380 @param client_index - opaque cookie to identify the sender
381 @param context - sender context, to match reply w/ request
383 define session_rules_dump
389 /** \brief Session rules details
390 @param context - sender context, to match reply w/ request
391 @param transport_proto - transport protocol
392 @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
393 @param lcl_ip - local ip
394 @param lcl_plen - local prefix length
395 @param rmt_ip - remote ip
396 @param rmt_ple - remote prefix length
397 @param lcl_port - local port
398 @param rmt_port - remote port
399 @param action_index - the only action defined now is forward to
400 application with index action_index
401 @param appns_index - application namespace where rule is to be applied to
402 @param scope - enum that indicates scope of the rule: global or local.
403 If 0, default is global, 1 is global 2 is local, 3 is both
406 define session_rules_details
409 vl_api_transport_proto_t transport_proto;
416 vl_api_session_rule_scope_t scope;
422 * eval: (c-set-style "gnu")