61 u32 this_transfer, max_deq, max_enq;
64 session_fifo_event_t evt;
68 rx_fifo = s->server_rx_fifo;
69 tx_fifo = s->server_tx_fifo;
73 this_transfer = max_enq < max_deq ? max_enq : max_deq;
76 _vec_len (my_copy_buffer) = this_transfer;
80 ASSERT (actual_transfer == this_transfer);
83 ASSERT (actual_transfer == this_transfer);
114 u8 segment_name[128];
115 u32 segment_name_length;
118 segment_name_length =
ARRAY_LEN (segment_name);
120 memset (a, 0,
sizeof (*a));
121 memset (options, 0,
sizeof (options));
123 a->api_client_index = ~0;
124 a->segment_name = segment_name;
125 a->segment_name_length = segment_name_length;
133 a->options = options;
152 memset (a, 0,
sizeof (*a));
153 a->uri = (
char *) uri;
167 a->uri = (
char *) uri;
196 if (
unformat (input,
"uri %s", &uri))
227 .path =
"builtin uri bind",
228 .short_help =
"builtin uri bind",
243 if (
unformat (input,
"uri %s", &uri))
272 .path =
"builtin uri unbind",
273 .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 _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...)
void stream_session_cleanup(stream_session_t *s)
Cleanup transport and session state.
struct _stream_session_t stream_session_t
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)
clib_error_t * vnet_session_enable_disable(vlib_main_t *vm, u8 is_en)
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)
u8 * format_stream_session(u8 *s, va_list *args)
Format stream session as per the following format.
#define vec_free(V)
Free vector's memory (no header).
#define clib_warning(format, args...)
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,...)
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.
void builtin_session_reset_callback(stream_session_t *s)
clib_error_t * vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
static int bind_builtin_uri_server(u8 *uri)
int builtin_session_connected_callback(u32 app_index, u32 api_context, stream_session_t *s, u8 is_fail)
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