45 u32 this_transfer, max_deq, max_enq;
48 session_fifo_event_t evt;
52 rx_fifo = s->server_rx_fifo;
53 tx_fifo = s->server_tx_fifo;
57 this_transfer = max_enq < max_deq ? max_enq : max_deq;
60 _vec_len (my_copy_buffer) = this_transfer;
64 ASSERT (actual_transfer == this_transfer);
67 ASSERT (actual_transfer == this_transfer);
98 u32 segment_name_length;
101 segment_name_length =
ARRAY_LEN (segment_name);
103 memset (a, 0,
sizeof (*a));
104 memset (options, 0,
sizeof (options));
106 a->api_client_index = ~0;
107 a->segment_name = segment_name;
108 a->segment_name_length = segment_name_length;
116 a->options = options;
131 memset (a, 0,
sizeof (*a));
132 a->uri = (
char *) uri;
146 a->uri = (
char *) uri;
175 if (
unformat (input,
"uri %s", &uri))
204 .path =
"builtin uri bind",
205 .short_help =
"builtin uri bind",
220 if (
unformat (input,
"uri %s", &uri))
249 .path =
"builtin uri unbind",
250 .short_help =
"builtin uri unbind",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static int builtin_session_create_callback(stream_session_t *s)
int vnet_bind_uri(vnet_bind_args_t *a)
static session_cb_vft_t builtin_server
static int attach_builtin_uri_server()
static u32 svm_fifo_max_enqueue(svm_fifo_t *f)
struct _stream_session_t stream_session_t
struct _svm_fifo svm_fifo_t
int vnet_unbind_uri(vnet_unbind_args_t *a)
#define VLIB_INIT_FUNCTION(x)
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
#define clib_error_return(e, args...)
struct _vnet_app_attach_args_t vnet_app_attach_args_t
int unix_shared_memory_queue_add(unix_shared_memory_queue_t *q, u8 *elem, int nowait)
void builtin_session_disconnect_callback(stream_session_t *s)
static u8 svm_fifo_set_event(svm_fifo_t *f)
Sets fifo event flag.
static unix_shared_memory_queue_t * session_manager_get_vpp_event_queue(u32 thread_index)
#define vec_free(V)
Free vector's memory (no header).
static int unbind_builtin_uri_server(u8 *uri)
int svm_fifo_enqueue_nowait(svm_fifo_t *f, u32 max_bytes, u8 *copy_from_here)
#define VLIB_CLI_COMMAND(x,...)
int vnet_application_attach(vnet_app_attach_args_t *a)
Attaches application.
static clib_error_t * builtin_server_init(vlib_main_t *vm)
u8 ** copy_buffers
per-worker built-in server copy buffers
int builtin_server_rx_callback(stream_session_t *s)
void stream_session_disconnect(stream_session_t *s)
Disconnect session and propagate to transport.
static int bind_builtin_uri_server(u8 *uri)
static vlib_thread_main_t * vlib_get_thread_main()
static clib_error_t * builtin_uri_bind_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int svm_fifo_dequeue_nowait(svm_fifo_t *f, u32 max_bytes, u8 *copy_here)
struct _vnet_bind_args_t vnet_bind_args_t
static clib_error_t * builtin_uri_unbind_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
struct _unix_shared_memory_queue unix_shared_memory_queue_t