15 #ifndef __included_uri_h__ 16 #define __included_uri_h__ 24 typedef struct _vnet_app_attach_args_t
45 u64 app_event_queue_address;
49 typedef struct _vnet_app_detach_args_t
54 typedef struct _vnet_bind_args_t
68 u32 segment_name_length;
69 u64 server_event_queue_address;
73 typedef struct _vnet_unbind_args_t
83 typedef struct _vnet_connect_args
96 typedef struct _vnet_disconnect_args_t
102 typedef struct _vnet_application_add_tls_cert_args_t
108 typedef struct _vnet_application_add_tls_key_args_t
133 #define foreach_app_options_flags \ 134 _(ACCEPT_REDIRECT, "Use FIFO with redirects") \ 135 _(ADD_SEGMENT, "Add segment and signal app if needed") \ 136 _(IS_BUILTIN, "Application is builtin") \ 137 _(IS_PROXY, "Application is proxying") \ 138 _(USE_GLOBAL_SCOPE, "App can use global session scope") \ 139 _(USE_LOCAL_SCOPE, "App can use local session scope") 141 typedef enum _app_options
143 #define _(sym, str) APP_OPTIONS_##sym, 148 typedef enum _app_options_flags
150 #define _(sym, str) APP_OPTIONS_FLAGS_##sym = 1 << APP_OPTIONS_##sym, 183 #define foreach_app_session_field \ 184 _(svm_fifo_t, *rx_fifo) \ 185 _(svm_fifo_t, *tx_fifo) \ 186 _(session_type_t, session_type) \ 187 _(volatile u8, session_state) \ 188 _(u32, session_index) \ 189 _(app_session_transport_t, transport) \ 190 _(svm_queue_t, *vpp_evt_q) \ 195 #define _(type, name) type name; 204 u32 max_enqueue, actual_write;
205 session_dgram_hdr_t hdr;
206 session_fifo_event_t evt;
210 if (max_enqueue <=
sizeof (session_dgram_hdr_t))
213 max_enqueue -=
sizeof (session_dgram_hdr_t);
214 actual_write =
clib_min (len, max_enqueue);
215 hdr.data_length = actual_write;
223 ASSERT (rv ==
sizeof (hdr));
249 session_fifo_event_t evt;
289 if (max_deq <
sizeof (session_dgram_hdr_t))
#define foreach_app_session_field
flag for dgram mode
clib_error_t * vnet_connect_uri(vnet_connect_args_t *a)
int svm_queue_add(svm_queue_t *q, u8 *elem, int nowait)
u8 is_ip4
set if uses ip4 networking
#define SESSION_CONN_HDR_LEN
struct _vnet_connect_args vnet_connect_args_t
static int app_recv_dgram_raw(svm_fifo_t *f, u8 *buf, u32 len, app_session_transport_t *at, u8 clear_evt)
const char test_srv_key_rsa[]
const u32 test_srv_crt_rsa_len
clib_error_t * vnet_unbind(vnet_unbind_args_t *a)
static int app_send_stream(app_session_t *s, u8 *data, u32 len, u8 noblock)
void svm_fifo_overwrite_head(svm_fifo_t *f, u8 *data, u32 len)
static u32 svm_fifo_max_enqueue(svm_fifo_t *f)
struct _vnet_application_add_tls_cert_args_t vnet_app_add_tls_cert_args_t
struct _svm_fifo svm_fifo_t
clib_error_t * vnet_connect(vnet_connect_args_t *a)
static int app_send(app_session_t *s, u8 *data, u32 len, u8 noblock)
struct _vnet_disconnect_args_t vnet_disconnect_args_t
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
struct _stream_session_cb_vft session_cb_vft_t
struct _vnet_unbind_args_t vnet_unbind_args_t
int svm_fifo_enqueue_nowait(svm_fifo_t *f, u32 max_bytes, const u8 *copy_from_here)
struct _vnet_app_attach_args_t vnet_app_attach_args_t
clib_error_t * vnet_app_add_tls_key(vnet_app_add_tls_key_args_t *a)
static int app_recv(app_session_t *s, u8 *data, u32 len)
static session_cb_vft_t session_cb_vft
int vnet_unbind_uri(vnet_unbind_args_t *a)
struct _session_endpoint session_endpoint_t
clib_error_t * vnet_bind(vnet_bind_args_t *a)
static session_handle_t session_handle(stream_session_t *s)
ip46_address_t rmt_ip
remote ip
static void svm_fifo_unset_event(svm_fifo_t *f)
Unsets fifo event flag.
int vnet_bind_uri(vnet_bind_args_t *)
const u32 test_srv_key_rsa_len
static u8 svm_fifo_set_event(svm_fifo_t *f)
Sets fifo event flag.
clib_error_t * vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
static int app_send_dgram_raw(svm_fifo_t *f, app_session_transport_t *at, svm_queue_t *vpp_evt_q, u8 *data, u32 len, u8 noblock)
#define clib_memcpy(a, b, c)
struct app_session_transport_ app_session_transport_t
static int app_recv_stream(app_session_t *s, u8 *buf, u32 len)
enum _app_options_flags app_options_flags_t
const char test_srv_crt_rsa[]
static int app_send_stream_raw(svm_fifo_t *f, svm_queue_t *vpp_evt_q, u8 *data, u32 len, u8 noblock)
clib_error_t * vnet_app_add_tls_cert(vnet_app_add_tls_cert_args_t *a)
int vnet_disconnect_session(vnet_disconnect_args_t *a)
enum _app_options app_options_t
app_attach_options_index_t
static int app_send_dgram(app_session_t *s, u8 *data, u32 len, u8 noblock)
struct _vnet_application_add_tls_key_args_t vnet_app_add_tls_key_args_t
int vnet_application_detach(vnet_app_detach_args_t *a)
Detach application from vpp.
u16 lcl_port
local port (network order)
struct _vnet_app_detach_args_t vnet_app_detach_args_t
ip46_address_t lcl_ip
local ip
int svm_fifo_dequeue_drop(svm_fifo_t *f, u32 max_bytes)
static int app_recv_stream_raw(svm_fifo_t *f, u8 *buf, u32 len, u8 clear_evt)
struct _svm_queue svm_queue_t
#define foreach_app_options_flags
int svm_fifo_peek(svm_fifo_t *f, u32 relative_offset, u32 max_bytes, u8 *copy_here)
int svm_fifo_dequeue_nowait(svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
struct _vnet_bind_args_t vnet_bind_args_t
struct _session_endpoint_extended session_endpoint_extended_t
static int app_recv_dgram(app_session_t *s, u8 *buf, u32 len)
u16 rmt_port
remote port (network order)