}
static int
-server_add_segment_callback (u32 client_index,
- const u8 * seg_name, u32 seg_size)
+server_add_segment_callback (u32 client_index, const ssvm_private_t * sp)
{
clib_warning ("called...");
return -1;
clib_spinlock_unlock_if_init (&bpm->sessions_lock);
- a->uri = "tcp://6.0.2.2/23";
+ a->uri = (char *) bpm->client_uri;
a->api_context = proxy_index;
a->app_index = bpm->active_open_app_index;
a->mp = 0;
server_attach ()
{
builtin_proxy_main_t *bpm = &builtin_proxy_main;
- u8 segment_name[128];
u64 options[APP_OPTIONS_N_OPTIONS];
vnet_app_attach_args_t _a, *a = &_a;
u32 segment_size = 512 << 20;
a->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
- a->segment_name = segment_name;
- a->segment_name_length = ARRAY_LEN (segment_name);
-
if (vnet_application_attach (a))
{
clib_warning ("failed to attach server");
{
builtin_proxy_main_t *bpm = &builtin_proxy_main;
vnet_app_attach_args_t _a, *a = &_a;
- u8 segment_name[128];
- u32 segment_name_length;
u64 options[16];
- segment_name_length = ARRAY_LEN (segment_name);
-
memset (a, 0, sizeof (*a));
memset (options, 0, sizeof (options));
a->api_client_index = bpm->active_open_client_index;
- a->segment_name = segment_name;
- a->segment_name_length = segment_name_length;
a->session_cb_vft = &builtin_clients;
options[APP_OPTIONS_ACCEPT_COOKIE] = 0x12345678;
vnet_bind_args_t _a, *a = &_a;
memset (a, 0, sizeof (*a));
a->app_index = bpm->server_app_index;
- a->uri = "tcp://0.0.0.0/23";
+ a->uri = (char *) bpm->server_uri;
return vnet_bind_uri (a);
}
bpm->prealloc_fifos = 0;
bpm->private_segment_count = 0;
bpm->private_segment_size = 0;
+ bpm->server_uri = 0;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
{
(0, "private segment size %lld (%llu) too large", tmp, tmp);
bpm->private_segment_size = tmp;
}
+ else if (unformat (input, "server-uri %s", &bpm->server_uri))
+ ;
+ else if (unformat (input, "client-uri %s", &bpm->client_uri))
+ ;
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);
}
+ if (!bpm->server_uri)
+ bpm->server_uri = format (0, "%s%c", "tcp://0.0.0.0/23", 0);
+ if (!bpm->client_uri)
+ bpm->client_uri = format (0, "%s%c", "tcp://6.0.2.2/23", 0);
+
vnet_session_enable_disable (vm, 1 /* turn on TCP, etc. */ );
rv = server_create (vm);
VLIB_CLI_COMMAND (server_create_command, static) =
{
.path = "test proxy server",
- .short_help = "test proxy server",
+ .short_help = "test proxy server [server-uri <tcp://ip/port>]"
+ "[client-uri <tcp://ip/port>][fifo-size <nn>][rcv-buf-size <nn>]"
+ "[prealloc-fifos <nn>][private-segment-size <mem>]"
+ "[private-segment-count <nn>]",
.function = proxy_server_create_command_fn,
};
/* *INDENT-ON* */