2 * Copyright (c) 2015-2019 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 = "3.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_UDPC,
29 TRANSPORT_PROTO_API_QUIC,
32 /** \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.
36 @param namespace_id - string
42 string namespace_id[];
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
57 @param segment_handle - handle for segment
58 @param segment_name - name of segment client needs to attach to
60 define app_attach_reply {
65 u8 vpp_ctrl_mq_thread;
71 string segment_name[];
74 /** \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
78 autoreply define application_detach {
83 /** \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)
91 define app_add_cert_key_pair {
96 u8 certkey[certkey_len];
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
104 define app_add_cert_key_pair_reply {
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
115 autoreply define app_del_cert_key_pair {
121 /** \brief Application add TLS certificate
122 ### WILL BE DEPRECATED POST 20.01 ###
123 @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
128 autoreply define application_tls_cert_add {
136 /** \brief Application add TLS key
137 ### WILL BE DEPRECATED POST 20.01 ###
138 @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
143 autoreply define application_tls_key_add {
151 /** \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
155 @param app_index - application index
156 @param wrk_index - worker index, if a delete
157 @param is_add - set if an add
159 define app_worker_add_del
165 bool is_add [default=true];
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
175 over the socket (set only if socket transport available)
176 @param segment_handle - handle for segment
177 @param is_add - add if non zero, else delete
178 @param segment_name - name of segment client needs to attach to
180 define app_worker_add_del_reply
185 u64 app_event_queue_address;
189 bool is_add [default=true];
190 string segment_name[];
193 /** \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
199 autoreply define session_enable_disable {
202 bool is_enable [default=true];
205 /** \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
209 @param secret - secret shared between app and vpp
210 @param sw_if_index - local interface that "supports" namespace. Set to
212 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
214 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
216 @param namespace_id - namespace id
218 define app_namespace_add_del {
222 vl_api_interface_index_t sw_if_index;
225 string namespace_id[];
228 /** \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
233 define app_namespace_add_del_reply
240 enum session_rule_scope {
241 SESSION_RULE_SCOPE_API_GLOBAL = 0,
242 SESSION_RULE_SCOPE_API_LOCAL = 1,
243 SESSION_RULE_SCOPE_API_BOTH = 2,
246 /** \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
250 @param transport_proto - transport protocol
251 @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
258 @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
262 @param scope - enum that indicates scope of the rule: global or local.
263 If 0, default is global, 1 is global 2 is local, 3 is both
266 autoreply define session_rule_add_del {
269 vl_api_transport_proto_t transport_proto;
275 bool is_add [default=true];
277 vl_api_session_rule_scope_t scope;
281 /** \brief Dump session rules
282 @param client_index - opaque cookie to identify the sender
283 @param context - sender context, to match reply w/ request
285 define session_rules_dump
291 /** \brief Session rules details
292 @param context - sender context, to match reply w/ request
293 @param transport_proto - transport protocol
294 @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
302 application with index action_index
303 @param appns_index - application namespace where rule is to be applied to
304 @param scope - enum that indicates scope of the rule: global or local.
305 If 0, default is global, 1 is global 2 is local, 3 is both
308 define session_rules_details
311 vl_api_transport_proto_t transport_proto;
318 vl_api_session_rule_scope_t scope;
324 * eval: (c-set-style "gnu")