/*
 * Copyright (c) 2015-2019 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "2.0.0";

import "vnet/interface_types.api";
import "vnet/ip/ip_types.api";


enum transport_proto : u8
{
        TRANSPORT_PROTO_API_TCP,
        TRANSPORT_PROTO_API_UDP,
        TRANSPORT_PROTO_API_SCTP,
        TRANSPORT_PROTO_API_NONE,
        TRANSPORT_PROTO_API_TLS,
        TRANSPORT_PROTO_API_UDPC,
        TRANSPORT_PROTO_API_QUIC,
};

/** \brief client->vpp, attach application to session layer
 	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param initial_segment_size - size of the initial shm segment to be
    							  allocated
    @param options - segment size, fifo sizes, etc.
    @param namespace_id - string
*/
 define application_attach {
    u32 client_index;
    u32 context;
    u32 initial_segment_size;
    u64 options[17];
    string namespace_id[];
 };

 /** \brief Application attach reply
 	### WILL BE DEPRECATED POST 20.01 ###
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param app_event_queue_address - vpp event queue address or 0 if this
                                 	 connection shouldn't send events
    @param n_fds - number of fds exchanged
    @param fd_flags - set of flags that indicate which fds are to be expected
    				  over the socket (set only if socket transport available)
    @param segment_size - size of first shm segment
    @param app_index - index of the newly created app
    @param segment_handle - handle for segment
    @param segment_name - name of segment client needs to attach to
*/
define application_attach_reply {
    u32 context;
    i32 retval;
    u64 app_event_queue_address;
    u8 n_fds;
    u8 fd_flags;
    u32 segment_size;
    u32 app_index;
    u64 segment_handle;
    string segment_name[];
};

/** \brief Application attach to session layer
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param options - segment size, fifo sizes, etc.
    @param namespace_id - string
*/
 define app_attach {
    u32 client_index;
    u32 context;
    u64 options[17];
    string namespace_id[];
 };

 /** \brief Application attach reply
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param app_mq - app message queue
    @param vpp_ctrl_mq - vpp message queue for control events that should
    					 be handled in main thread, i.e., bind/connect
    @param vpp_ctrl_mq_thread_index - thread index of the ctrl mq
    @param app_index - index of the newly created app
    @param n_fds - number of fds exchanged
    @param fd_flags - set of flags that indicate which fds are to be expected
    				  over the socket (set only if socket transport available)
    @param segment_size - size of first shm segment
    @param segment_handle - handle for segment
    @param segment_name - name of segment client needs to attach to
*/
define app_attach_reply {
    u32 context;
    i32 retval;
    u64 app_mq;
    u64 vpp_ctrl_mq;
    u8 vpp_ctrl_mq_thread;
    u32 app_index;
    u8 n_fds;
    u8 fd_flags;
    u32 segment_size;
    u64 segment_handle;
    string segment_name[];
};

/** \brief Add certificate and key
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param engine - crypto engine
    @param cert_len - cert length (comes first)
    @param certkey_len - cert and key length
    @param certkey - cert & key data (due to API limitation)
*/
define app_add_cert_key_pair {
    u32 client_index;
    u32 context;
    u16 cert_len;
    u16 certkey_len;
    u8 certkey[certkey_len];
};

/** \brief Add certificate and key
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param index - index in certificate store
*/
define app_add_cert_key_pair_reply {
    u32 context;
    i32 retval;
    u32 index;
};

/** \brief Delete certificate and key
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param index - index in certificate store
*/
autoreply define app_del_cert_key_pair {
    u32 client_index;
    u32 context;
    u32 index;
};

/** \brief Application add TLS certificate
 	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param cert_len - certificate length
    @param cert - certificate as a string
*/
autoreply define application_tls_cert_add {
    u32 client_index;
    u32 context;
    u32 app_index;
    u16 cert_len;
    u8 cert[cert_len];
};

/** \brief Application add TLS key
 	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param key_len - certificate length
    @param key - PEM encoded key as a string
*/
autoreply define application_tls_key_add {
    u32 client_index;
    u32 context;
    u32 app_index;
    u16 key_len;
    u8 key[key_len];
};

 /** \brief client->vpp, attach application to session layer
 	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
autoreply define application_detach {
    u32 client_index;
    u32 context;
 };

/** \brief vpp->client, please map an additional shared memory segment
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
   	@param fd_flags - set of flags that indicate which, if any, fds are
   					  to be expected over the socket. This is set only if
   					  socket transport available
    @param segment_size - size of the segment to be mapped
    @param segment_name - name of the segment to be mapped
    @param segment_handle - unique identifier for segment
*/
autoreply define map_another_segment {
    u32 client_index;
    u32 context;
    u8 fd_flags;
    u32 segment_size;
    string segment_name[128];
    u64 segment_handle;
};

/** \brief vpp->client unmap shared memory segment
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param segment_name - segment name
    @param segment_handle - handle of the segment to be unmapped
*/
autoreply define unmap_segment {
    u32 client_index;
    u32 context;
    u64 segment_handle;
};

 /** \brief Bind to a given URI
 	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param accept_cookie - sender accept cookie, to identify this bind flavor
    @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
                 "tcp://::/0/80" [ipv6] etc.
    @param options - socket options, fifo sizes, etc.
*/
autoreply define bind_uri {
  u32 client_index;
  u32 context;
  u32 accept_cookie;
  u8 uri[128];
};

/** \brief Unbind a given URI
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param uri - a URI, e.g. "tcp://0.0.0.0/0/80" [ipv4]
                 "tcp://::/0/80" [ipv6], etc.
    @param options - socket options, fifo sizes, etc.
*/
autoreply define unbind_uri {
  u32 client_index;
  u32 context;
  u8 uri[128];
};

/** \brief Connect to a given URI
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param client_queue_address - binary API client queue address. Used by
    							  local server when connect was redirected.
    @param options - socket options, fifo sizes, etc. passed by vpp to the
    				 server when redirecting connects
    @param uri - a URI, e.g. "tcp4://0.0.0.0/0/80"
                 "tcp6://::/0/80" [ipv6], etc.
*/
autoreply define connect_uri {
  u32 client_index;
  u32 context;
  u64 client_queue_address;
  u64 options[16];
  u8 uri[128];
};

/** \brief bidirectional disconnect API
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
                          client to vpp direction only
    @param context - sender context, to match reply w/ request
    @param handle - session handle obtained from accept/connect
*/
define disconnect_session {
  u32 client_index;
  u32 context;
  u64 handle;
};

/** \brief bidirectional disconnect reply API
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
                          client to vpp direction only
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param handle - session handle
*/
define disconnect_session_reply {
  u32 context;
  i32 retval;
  u64 handle;
};

/** \brief Bind to an ip:port pair for a given transport protocol
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param wrk_index - index of worker requesting the bind
    @param vrf - bind namespace
    @param ip - ip address
    @param port - port
    @param proto - protocol 0 - TCP 1 - UDP
    @param options - socket options, fifo sizes, etc.
*/
autoreply define bind_sock {
  u32 client_index;
  u32 context;
  u32 wrk_index;
  u32 vrf;
  vl_api_address_t ip;
  u16 port;
  vl_api_transport_proto_t proto;
  u64 options[16];
};

/** \brief Unbind
	### WILL BE DEPRECATED POST 20.01 ###s
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param wrk_index - index of worker requesting the bind
    @param handle - bind handle obtained from bind reply
*/
autoreply define unbind_sock {
  u32 client_index;
  u32 context;
  u32 wrk_index;
  u64 handle;
};

/** \brief Connect to a remote peer
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param wrk_index - worker that requests the connect
    @param client_queue_address - client's API queue address. Non-zero when
                                  used to perform redirects
    @param options - socket options, fifo sizes, etc. when doing redirects
    @param vrf - connection namespace
    @param ip - ip address
    @param port - port
    @param proto - protocol 0 - TCP 1 - UDP
    @param hostname-len - length of hostname
    @param hostname - destination's hostname. If present, used by protocols
					  like tls.
    @param parent_handle - handle of parent session (e.g. for opening quic streams).
*/
autoreply define connect_sock {
  u32 client_index;
  u32 context;
  u32 wrk_index;
  u64 client_queue_address;
  u64 options[16];
  u32 vrf;
  vl_api_address_t ip;
  u16 port;
  vl_api_transport_proto_t proto;
  u64 parent_handle;
  string hostname[];
};

/** \brief ask app to add a new cut-through registration
	### WILL BE DEPRECATED POST 20.01 ###
    @param client_index - opaque cookie to identify the sender
                          client to vpp direction only
    @param context - sender context, to match reply w/ request
    @param evt_q_address - address of the mq in ssvm segment
    @param peer_evt_q_address - address of peer's mq in ssvm segment
    @param wrk_index - index of worker to receive the registration
    @param n_fds - number of fds exchanged
    @param fd_flags - flag indicating the fds that will be exchanged over
    				  api socket
*/
autoreply define app_cut_through_registration_add
{
  u32 client_index;
  u32 context;
  u64 evt_q_address;
  u64 peer_evt_q_address;
  u32 wrk_index;
  u8 n_fds;
  u8 fd_flags;
};

/** \brief add/del application worker
    @param client_index - opaque cookie to identify the sender
                          client to vpp direction only
    @param context - sender context, to match reply w/ request
    @param app_index - application index
    @param wrk_index - worker index, if a delete
    @param is_add - set if an add
*/
define app_worker_add_del
{
  u32 client_index;
  u32 context;
  u32 app_index;
  u32 wrk_index;
  bool is_add [default=true];
};

/** \brief Reply for app worker add/del
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param wrk_index - worker index, if add
    @param app_event_queue_address - vpp event queue address of new worker
    @param n_fds - number of fds exchanged
    @param fd_flags - set of flags that indicate which fds are to be expected
    				  over the socket (set only if socket transport available)
    @param segment_handle - handle for segment
    @param is_add - add if non zero, else delete
    @param segment_name - name of segment client needs to attach to
*/
define app_worker_add_del_reply
{
  u32 context;
  i32 retval;
  u32 wrk_index;
  u64 app_event_queue_address;
  u8 n_fds;
  u8 fd_flags;
  u64 segment_handle;
  bool is_add [default=true];
  string segment_name[];
};

/** \brief enable/disable session layer
    @param client_index - opaque cookie to identify the sender
                          client to vpp direction only
    @param context - sender context, to match reply w/ request
    @param is_enable - disable session layer if 0, enable otherwise
*/
autoreply define session_enable_disable {
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

/** \brief add/del application namespace
    @param client_index - opaque cookie to identify the sender
                          client to vpp direction only
    @param context - sender context, to match reply w/ request
    @param secret - secret shared between app and vpp
    @param sw_if_index - local interface that "supports" namespace. Set to
                         ~0 if no preference
    @param ip4_fib_id - id of ip4 fib that "supports" the namespace. Ignored
                        if sw_if_index set.
    @param ip6_fib_id - id of ip6 fib that "supports" the namespace. Ignored
                        if sw_if_index set.
    @param namespace_id - namespace id
*/
define app_namespace_add_del {
  u32 client_index;
  u32 context;
  u64 secret;
  vl_api_interface_index_t sw_if_index;
  u32 ip4_fib_id;
  u32 ip6_fib_id;
  string namespace_id[];
};

/** \brief Reply for app namespace add/del
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param appns_index - app namespace index
*/
define app_namespace_add_del_reply
{
  u32 context;
  i32 retval;
  u32 appns_index;
};

enum session_rule_scope {
	SESSION_RULE_SCOPE_API_GLOBAL = 0,
	SESSION_RULE_SCOPE_API_LOCAL = 1,
	SESSION_RULE_SCOPE_API_BOTH = 2,
};

/** \brief add/del session rule
    @param client_index - opaque cookie to identify the sender
                          client to vpp direction only
    @param context - sender context, to match reply w/ request
    @param transport_proto - transport protocol
    @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
    @param lcl_ip - local ip
    @param lcl_plen - local prefix length
    @param rmt_ip - remote ip
    @param rmt_ple - remote prefix length
    @param lcl_port - local port
    @param rmt_port - remote port
    @param action_index - the only action defined now is forward to
                          application with index action_index
    @param is_add - flag to indicate if add or del
    @param appns_index - application namespace where rule is to be applied to
    @param scope - enum that indicates scope of the rule: global or local.
                   If 0, default is global, 1 is global 2 is local, 3 is both
    @param tag - tag
*/
autoreply define session_rule_add_del {
  u32 client_index;
  u32 context;
  vl_api_transport_proto_t transport_proto;
  vl_api_prefix_t lcl;
  vl_api_prefix_t rmt;
  u16 lcl_port;
  u16 rmt_port;
  u32 action_index;
  bool is_add [default=true];
  u32 appns_index;
  vl_api_session_rule_scope_t scope;
  string tag[64];
};

/** \brief Dump session rules
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
 */
define session_rules_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Session rules details
    @param context - sender context, to match reply w/ request
    @param transport_proto - transport protocol
    @param is_ip4 - flag to indicate if ip addresses are ip4 or 6
    @param lcl_ip - local ip
    @param lcl_plen - local prefix length
    @param rmt_ip - remote ip
    @param rmt_ple - remote prefix length
    @param lcl_port - local port
    @param rmt_port - remote port
    @param action_index - the only action defined now is forward to
                          application with index action_index
    @param appns_index - application namespace where rule is to be applied to
    @param scope - enum that indicates scope of the rule: global or local.
                   If 0, default is global, 1 is global 2 is local, 3 is both
    @param tag - tag
  */
define session_rules_details
{
  u32 context;
  vl_api_transport_proto_t transport_proto;
  vl_api_prefix_t lcl;
  vl_api_prefix_t rmt;
  u16 lcl_port;
  u16 rmt_port;
  u32 action_index;
  u32 appns_index;
  vl_api_session_rule_scope_t scope;
  string tag[64];
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
