/*
 * Copyright (c) 2015-2016 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 = "1.5.0";

/** \brief client->vpp, attach application to session layer
    @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_len - length of the namespace id c-string
    @param namespace_id - 0 terminted c-string
*/
 define application_attach {
    u32 client_index;
    u32 context;
    u32 initial_segment_size;
    u64 options[16];
    u8 namespace_id_len;
    u8 namespace_id [64];
 };
 
 /** \brief Application attach reply
    @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 segment_name_length - length of segment name 
    @param segment_name - name of segment client needs to attach to
    @param app_index - index of the newly created app
    @param segment_handle - handle for segment
*/
define application_attach_reply {
    u32 context;
    i32 retval;
    u64 app_event_queue_address;
    u8 n_fds;
    u8 fd_flags;
    u32 segment_size;
    u8 segment_name_length;
    u8 segment_name[128];
    u32 app_index;
    u64 segment_handle;
};

/** \brief Application add TLS certificate
    @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
    @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
    @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
    @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;
    u8 segment_name[128];
    u64 segment_handle;
};

/** \brief vpp->client unmap shared memory segment
    @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
    @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.
*/
define bind_uri {
  u32 client_index;
  u32 context;
  u32 accept_cookie;
  u8 uri[128];
};
/** *** Will be DEPRECATED. Use message queue instead. *** */
define bind_uri_reply {
  u32 context;
  u64 handle;
  i32 retval;
  u64 rx_fifo;
  u64 tx_fifo;
  u8 lcl_is_ip4;
  u8 lcl_ip[16];
  u16 lcl_port;
  u64 vpp_evt_q;
};

/** \brief Unbind a given URI
    @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
    @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 vpp->client, accept this session
	*** Will be DEPRECATED. Use message queue instead. ***
    @param context - sender context, to match reply w/ request
    @param listener_handle - tells client which listener this pertains to
    @param handle - unique session identifier
    @param rx_fifo_address - rx (vpp -> vpp-client) fifo address 
    @param tx_fifo_address - tx (vpp-client -> vpp) fifo address 
    @param vpp_event_queue_address - vpp's event queue address or client's
    									event queue for cut through
    @param server_event_queue_address - server's event queue address for
    									   cut through sessions
    @param port - remote port
    @param is_ip4 - 1 if the ip is ip4
    @param ip - remote ip
*/
define accept_session {
  u32 client_index;
  u32 context;
  u64 listener_handle;
  u64 handle; 
  u64 server_rx_fifo;
  u64 server_tx_fifo;
  u64 vpp_event_queue_address;
  u64 server_event_queue_address;
  u16 port;
  u8 is_ip4;
  u8 ip[16];
};

/** \brief client->vpp, reply to an accept message
	*** Will be DEPRECATED. Use message queue instead. ***
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param session_index - session index from accept_session / connect_reply
    @param session_thread_index - thread index from accept_session /
                                  connect_reply
*/
define accept_session_reply {
  u32 context;
  i32 retval;
  u64 handle;
};

/** \brief bidirectional disconnect API
    @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. Use message queue instead. ***
    @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 vpp->client reset session API
	*** Will be DEPRECATED. Use message queue instead. ***
    @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 via accept/connects
*/
define reset_session {
  u32 client_index;
  u32 context;
  u64 handle;
};

/** \brief client->vpp reset session reply
	*** Will be DEPRECATED. Use message queue instead. ***
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param handle - session handle obtained via accept/connect
*/
define reset_session_reply {
  u32 context;
  i32 retval;
  u64 handle;
};

/** \brief Bind to an ip:port pair for a given transport protocol
    @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 is_ip4 - flag that is 1 if ip address family is IPv4
    @param ip - ip address
    @param port - port 
    @param proto - protocol 0 - TCP 1 - UDP
    @param options - socket options, fifo sizes, etc.
*/
define bind_sock {
  u32 client_index;
  u32 context;
  u32 wrk_index;
  u32 vrf;
  u8 is_ip4;
  u8 ip[16];
  u16 port;
  u8 proto;
  u64 options[16];
};

/** \brief Unbind 
    @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
    @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 is_ip4 - flag that is 1 if ip address family is IPv4
    @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.
*/
autoreply define connect_sock {
  u32 client_index;
  u32 context;
  u32 wrk_index;
  u64 client_queue_address;
  u64 options[16];
  u32 vrf;
  u8 is_ip4;
  u8 ip[16];
  u16 port;
  u8 proto;
  u8 hostname_len;
  u8 hostname[hostname_len];
};

/** \brief Bind reply
	*** Will be DEPRECATED. Use message queue instead. ***
    @param context - sender context, to match reply w/ request
    @param handle - bind handle
    @param retval - return code for the request
    @param lcl_is_ip4 - local ip address type
    @param lcl_ip6 - local ip address
    @param lcl_port - local port
    @param rx_fifo - rx fifo address if allocated (connectionless)
    @param tx_fifo - tx fifo address if allocated (connectionless) 
    @param vpp_evt_q - vpp event queue address (connectionless)
    @param segment_name_length - length of segment name 
    @param segment_name - name of segment client needs to attach to
*/
define bind_sock_reply {
  u32 context;
  u64 handle;
  i32 retval;
  u8 lcl_is_ip4;
  u8 lcl_ip[16];
  u16 lcl_port;
  u64 rx_fifo;
  u64 tx_fifo;
  u64 vpp_evt_q;
  u32 segment_size;
  u8 segment_name_length;
  u8 segment_name[128];
};

/* Dummy connect message -- needed to satisfy api generators
*
*  NEVER USED, doxygen tags elided on purpose.
*/
define connect_session {
  u32 client_index;
  u32 context;
};

/** \brief vpp/server->client, connect reply -- used for all connect_* messages
	*** Will be DEPRECATED. Use message queue instead. ***
    @param context - sender context, to match reply w/ request
    @param retval - return code for the request
    @param handle - connection handle
    @param server_rx_fifo - rx (vpp -> vpp-client) fifo address 
    @param server_tx_fifo - tx (vpp-client -> vpp) fifo address 
    @param vpp_event_queue_address - vpp's event queue address
    @param client_event_queue_address - client's event queue address
    @param segment_size - size of segment to be attached. Only for redirects.
    @param segment_name_length - non-zero if the client needs to attach to 
                                 the fifo segment
    @param segment_name - set if the client needs to attach to the segment
    @param lcl_ip - local ip for connection
    @param is_ip4 - flag to indicate if ip is v4 or v6
    @param lcl_port - local port
*/
define connect_session_reply {
  u32 context;
  i32 retval;
  u64 handle;
  u64 server_rx_fifo;
  u64 server_tx_fifo;
  u64 vpp_event_queue_address;
  u64 client_event_queue_address;
  u32 segment_size;
  u8 segment_name_length;
  u8 segment_name[128];
  u8 lcl_ip[16];
  u8 is_ip4;
  u16 lcl_port;
};

/** \brief ask app to add a new cut-through registration
    @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;
  u8 is_add;
};

/** \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_name_length - length of segment name 
    @param segment_name - name of segment client needs to attach to
    @param segment_handle - handle for segment
*/
define app_worker_add_del_reply
{
  u32 context;
  i32 retval;
  u32 wrk_index;
  u64 app_event_queue_address;
  u8 n_fds;
  u8 fd_flags;
  u8 segment_name_length;
  u8 segment_name[128];
  u64 segment_handle;
  u8 is_add;
};

/** \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;
  u8 is_enable;
};

/** \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_len - length of namespace id lower
    @param namespace_id - namespace id
*/
define app_namespace_add_del {
  u32 client_index;
  u32 context;
  u64 secret;
  u32 sw_if_index;
  u32 ip4_fib_id;
  u32 ip6_fib_id;
  u8 namespace_id_len;
  u8 namespace_id[64];
};

/** \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;
};

/** \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 (0 - tcp 1 - udp)
    @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 - flag that indicates scope of the rule: global or local.
    				   If 0, default is global, 1 is global 2 is local, 3 is
    				   both
*/
autoreply define session_rule_add_del {
  u32 client_index;
  u32 context;
  u8 transport_proto;
  u8 is_ip4;
  u8 lcl_ip[16];
  u8 lcl_plen;
  u8 rmt_ip[16];
  u8 rmt_plen;
  u16 lcl_port;
  u16 rmt_port;
  u32 action_index;
  u8 is_add;
  u32 appns_index;
  u8 scope;
  u8 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 (0 - tcp 1 - udp)
    @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 - flag that indicates scope of the rule: global or local.
    				   If 0, default is global, 1 is global 2 is local, 3 is
    				   both
  */
define session_rules_details
{
  u32 context;
  u8 transport_proto;
  u8 is_ip4;
  u8 lcl_ip[16];
  u8 lcl_plen;
  u8 rmt_ip[16];
  u8 rmt_plen;
  u16 lcl_port;
  u16 rmt_port;
  u32 action_index;
  u32 appns_index;
  u8 scope;
  u8 tag[64];
};

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