15 #ifndef __included_uri_h__ 16 #define __included_uri_h__ 26 typedef struct _vnet_app_attach_args_t
47 u64 app_event_queue_address;
51 typedef struct _vnet_app_detach_args_t
56 typedef struct _vnet_bind_args_t
70 u32 segment_name_length;
71 u64 server_event_queue_address;
75 typedef struct _vnet_unbind_args_t
85 typedef struct _vnet_connect_args
98 typedef struct _vnet_disconnect_args_t
104 typedef struct _vnet_application_add_tls_cert_args_t
110 typedef struct _vnet_application_add_tls_key_args_t
135 #define foreach_app_options_flags \ 136 _(ACCEPT_REDIRECT, "Use FIFO with redirects") \ 137 _(ADD_SEGMENT, "Add segment and signal app if needed") \ 138 _(IS_BUILTIN, "Application is builtin") \ 139 _(IS_PROXY, "Application is proxying") \ 140 _(USE_GLOBAL_SCOPE, "App can use global session scope") \ 141 _(USE_LOCAL_SCOPE, "App can use local session scope") 143 typedef enum _app_options
145 #define _(sym, str) APP_OPTIONS_##sym, 150 typedef enum _app_options_flags
152 #define _(sym, str) APP_OPTIONS_FLAGS_##sym = 1 << APP_OPTIONS_##sym, 201 u32 max_enqueue, actual_write;
202 session_dgram_hdr_t hdr;
203 session_fifo_event_t evt;
207 if (max_enqueue <=
sizeof (session_dgram_hdr_t))
210 max_enqueue -=
sizeof (session_dgram_hdr_t);
211 actual_write =
clib_min (len, max_enqueue);
212 hdr.data_length = actual_write;
220 ASSERT (rv ==
sizeof (hdr));
246 session_fifo_event_t evt;
286 if (max_deq <
sizeof (session_dgram_hdr_t))
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)
u32 session_index
index in owning pool
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
svm_fifo_t * tx_fifo
tx fifo
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)
u8 is_dgram
set if it works in dgram mode
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
session_type_t session_type
session type
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.
struct app_session_ app_session_t
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
volatile u8 session_state
session state
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.
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)
svm_fifo_t * rx_fifo
rx fifo
app_session_transport_t transport
transport info
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
svm_queue_t * vpp_evt_q
vpp event queue for session
struct _session_endpoint_extended session_endpoint_extended_t
static int app_recv_dgram(app_session_t *s, u8 *buf, u32 len)