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 = "2.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_SCTP,
27 TRANSPORT_PROTO_API_NONE,
28 TRANSPORT_PROTO_API_TLS,
29 TRANSPORT_PROTO_API_UDPC,
30 TRANSPORT_PROTO_API_QUIC,
33 /** \brief client->vpp, attach application to session layer
34 ### WILL BE DEPRECATED POST 20.01 ###
35 @param client_index - opaque cookie to identify the sender
36 @param context - sender context, to match reply w/ request
37 @param initial_segment_size - size of the initial shm segment to be
39 @param options - segment size, fifo sizes, etc.
40 @param namespace_id - string
42 define application_attach {
45 u32 initial_segment_size;
47 string namespace_id[];
50 /** \brief Application attach reply
51 ### WILL BE DEPRECATED POST 20.01 ###
52 @param context - sender context, to match reply w/ request
53 @param retval - return code for the request
54 @param app_event_queue_address - vpp event queue address or 0 if this
55 connection shouldn't send events
56 @param n_fds - number of fds exchanged
57 @param fd_flags - set of flags that indicate which fds are to be expected
58 over the socket (set only if socket transport available)
59 @param segment_size - size of first shm segment
60 @param app_index - index of the newly created app
61 @param segment_handle - handle for segment
62 @param segment_name - name of segment client needs to attach to
64 define application_attach_reply {
67 u64 app_event_queue_address;
73 string segment_name[];
76 /** \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.
80 @param namespace_id - string
86 string namespace_id[];
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
101 @param segment_handle - handle for segment
102 @param segment_name - name of segment client needs to attach to
104 define app_attach_reply {
109 u8 vpp_ctrl_mq_thread;
115 string segment_name[];
118 /** \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)
126 define app_add_cert_key_pair {
131 u8 certkey[certkey_len];
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
139 define app_add_cert_key_pair_reply {
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
150 autoreply define app_del_cert_key_pair {
156 /** \brief Application add TLS certificate
157 ### WILL BE DEPRECATED POST 20.01 ###
158 @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
163 autoreply define application_tls_cert_add {
171 /** \brief Application add TLS key
172 ### WILL BE DEPRECATED POST 20.01 ###
173 @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
178 autoreply define application_tls_key_add {
186 /** \brief client->vpp, attach application to session layer
187 ### WILL BE DEPRECATED POST 20.01 ###
188 @param client_index - opaque cookie to identify the sender
189 @param context - sender context, to match reply w/ request
191 autoreply define application_detach {
196 /** \brief vpp->client, please map an additional shared memory segment
197 ### WILL BE DEPRECATED POST 20.01 ###
198 @param client_index - opaque cookie to identify the sender
199 @param context - sender context, to match reply w/ request
200 @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
202 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
205 @param segment_handle - unique identifier for segment
207 autoreply define map_another_segment {
212 string segment_name[128];
216 /** \brief vpp->client unmap shared memory segment
217 ### WILL BE DEPRECATED POST 20.01 ###
218 @param client_index - opaque cookie to identify the sender
219 @param context - sender context, to match reply w/ request
220 @param segment_name - segment name
221 @param segment_handle - handle of the segment to be unmapped
223 autoreply define unmap_segment {
229 /** \brief Bind to a given URI
230 ### WILL BE DEPRECATED POST 20.01 ###
231 @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.
238 autoreply define bind_uri {
245 /** \brief Unbind a given URI
246 ### WILL BE DEPRECATED POST 20.01 ###
247 @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.
253 autoreply define unbind_uri {
259 /** \brief Connect to a given URI
260 ### WILL BE DEPRECATED POST 20.01 ###
261 @param client_index - opaque cookie to identify the sender
262 @param context - sender context, to match reply w/ request
263 @param client_queue_address - binary API client queue address. Used by
264 local server when connect was redirected.
265 @param options - socket options, fifo sizes, etc. passed by vpp to the
266 server when redirecting connects
267 @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
268 "tcp6://::/0/80" [ipv6], etc.
270 autoreply define connect_uri {
273 u64 client_queue_address;
278 /** \brief bidirectional disconnect API
279 ### WILL BE DEPRECATED POST 20.01 ###
280 @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
283 @param handle - session handle obtained from accept/connect
285 define disconnect_session {
291 /** \brief bidirectional disconnect reply API
292 ### WILL BE DEPRECATED POST 20.01 ###
293 @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
297 @param handle - session handle
299 define disconnect_session_reply {
305 /** \brief Bind to an ip:port pair for a given transport protocol
306 ### WILL BE DEPRECATED POST 20.01 ###
307 @param client_index - opaque cookie to identify the sender
308 @param context - sender context, to match reply w/ request
309 @param wrk_index - index of worker requesting the bind
310 @param vrf - bind namespace
311 @param ip - ip address
313 @param proto - protocol 0 - TCP 1 - UDP
314 @param options - socket options, fifo sizes, etc.
316 autoreply define bind_sock {
323 vl_api_transport_proto_t proto;
328 ### WILL BE DEPRECATED POST 20.01 ###s
329 @param client_index - opaque cookie to identify the sender
330 @param context - sender context, to match reply w/ request
331 @param wrk_index - index of worker requesting the bind
332 @param handle - bind handle obtained from bind reply
334 autoreply define unbind_sock {
341 /** \brief Connect to a remote peer
342 ### WILL BE DEPRECATED POST 20.01 ###
343 @param client_index - opaque cookie to identify the sender
344 @param context - sender context, to match reply w/ request
345 @param wrk_index - worker that requests the connect
346 @param client_queue_address - client's API queue address. Non-zero when
347 used to perform redirects
348 @param options - socket options, fifo sizes, etc. when doing redirects
349 @param vrf - connection namespace
350 @param ip - ip address
352 @param proto - protocol 0 - TCP 1 - UDP
353 @param hostname-len - length of hostname
354 @param hostname - destination's hostname. If present, used by protocols
356 @param parent_handle - handle of parent session (e.g. for opening quic streams).
358 autoreply define connect_sock {
362 u64 client_queue_address;
367 vl_api_transport_proto_t proto;
372 /** \brief ask app to add a new cut-through registration
373 ### WILL BE DEPRECATED POST 20.01 ###
374 @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
379 @param wrk_index - index of worker to receive the registration
380 @param n_fds - number of fds exchanged
381 @param fd_flags - flag indicating the fds that will be exchanged over
384 autoreply define app_cut_through_registration_add
389 u64 peer_evt_q_address;
395 /** \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
399 @param app_index - application index
400 @param wrk_index - worker index, if a delete
401 @param is_add - set if an add
403 define app_worker_add_del
409 bool is_add [default=true];
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
419 over the socket (set only if socket transport available)
420 @param segment_handle - handle for segment
421 @param is_add - add if non zero, else delete
422 @param segment_name - name of segment client needs to attach to
424 define app_worker_add_del_reply
429 u64 app_event_queue_address;
433 bool is_add [default=true];
434 string segment_name[];
437 /** \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
443 autoreply define session_enable_disable {
446 bool is_enable [default=true];
449 /** \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
453 @param secret - secret shared between app and vpp
454 @param sw_if_index - local interface that "supports" namespace. Set to
456 @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
458 @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
460 @param namespace_id - namespace id
462 define app_namespace_add_del {
466 vl_api_interface_index_t sw_if_index;
469 string namespace_id[];
472 /** \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
477 define app_namespace_add_del_reply
484 enum session_rule_scope {
485 SESSION_RULE_SCOPE_API_GLOBAL = 0,
486 SESSION_RULE_SCOPE_API_LOCAL = 1,
487 SESSION_RULE_SCOPE_API_BOTH = 2,
490 /** \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
494 @param transport_proto - transport protocol
495 @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
502 @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
506 @param scope - enum that indicates scope of the rule: global or local.
507 If 0, default is global, 1 is global 2 is local, 3 is both
510 autoreply define session_rule_add_del {
513 vl_api_transport_proto_t transport_proto;
519 bool is_add [default=true];
521 vl_api_session_rule_scope_t scope;
525 /** \brief Dump session rules
526 @param client_index - opaque cookie to identify the sender
527 @param context - sender context, to match reply w/ request
529 define session_rules_dump
535 /** \brief Session rules details
536 @param context - sender context, to match reply w/ request
537 @param transport_proto - transport protocol
538 @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
546 application with index action_index
547 @param appns_index - application namespace where rule is to be applied to
548 @param scope - enum that indicates scope of the rule: global or local.
549 If 0, default is global, 1 is global 2 is local, 3 is both
552 define session_rules_details
555 vl_api_transport_proto_t transport_proto;
562 vl_api_session_rule_scope_t scope;
568 * eval: (c-set-style "gnu")