{
u8 intf_mac[6];
- memset (intf_mac, 0, sizeof (intf_mac));
+ clib_memset (intf_mac, 0, sizeof (intf_mac));
if (vnet_create_loopback_interface (sw_if_index, intf_mac, 0, 0))
{
clib_error_t *error = 0;
u32 server_index;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_USE_LOCAL_SCOPE;
{
u64 options[APP_OPTIONS_N_OPTIONS], dummy_secret = 1234;
u32 server_index, server_st_index, server_local_st_index;
- u32 dummy_port = 1234, client_index;
+ u32 dummy_port = 1234, client_index, server_wrk_index;
u32 dummy_api_context = 4321, dummy_client_api_index = 1234;
u32 dummy_server_api_index = ~0, sw_if_index = 0;
session_endpoint_t server_sep = SESSION_ENDPOINT_NULL;
server_sep.port = dummy_port;
client_sep.is_ip4 = 1;
client_sep.port = dummy_port;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
vnet_app_attach_args_t attach_args = {
};
ip4_address_t intf_addr = {
- .as_u32 = clib_host_to_net_u32 (0x06000105),
+ .as_u32 = clib_host_to_net_u32 (0x07000105),
};
intf_sep.ip.ip4 = intf_addr;
SESSION_TEST ((error == 0), "server attachment should work");
server_index = attach_args.app_index;
server = application_get (server_index);
+ server_wrk_index = application_get_default_worker (server)->wrk_index;
SESSION_TEST ((server->ns_index == 0),
"server should be in the default ns");
server_st_index = application_session_table (server, FIB_PROTOCOL_IP4);
s = session_lookup_listener (server_st_index, &server_sep);
SESSION_TEST ((s != 0), "listener should exist in global table");
- SESSION_TEST ((s->app_index == server_index), "app_index should be that of "
- "the server");
+ SESSION_TEST ((s->app_wrk_index == server_wrk_index), "app_index should be"
+ " that of the server");
server_local_st_index = application_local_session_table (server);
SESSION_TEST ((server_local_st_index == APP_INVALID_INDEX),
"server shouldn't have access to local table");
SESSION_TEST ((error == 0), "server attachment should work");
server_index = attach_args.app_index;
server = application_get (server_index);
+ server_wrk_index = application_get_default_worker (server)->wrk_index;
SESSION_TEST ((server->ns_index == app_namespace_index (app_ns)),
"server should be in the right ns");
server_st_index = application_session_table (server, FIB_PROTOCOL_IP4);
s = session_lookup_listener (server_st_index, &server_sep);
SESSION_TEST ((s != 0), "listener should exist in global table");
- SESSION_TEST ((s->app_index == server_index), "app_index should be that of "
- "the server");
+ SESSION_TEST ((s->app_wrk_index == server_wrk_index), "app_index should be"
+ " that of the server");
server_local_st_index = application_local_session_table (server);
handle = session_lookup_local_endpoint (server_local_st_index, &server_sep);
SESSION_TEST ((handle != SESSION_INVALID_HANDLE),
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "server attachment should work");
server_index = attach_args.app_index;
+ server = application_get (server_index);
+ server_wrk_index = application_get_default_worker (server)->wrk_index;
bind_args.app_index = server_index;
error = vnet_bind (&bind_args);
s = session_lookup_listener (server_st_index, &intf_sep);
SESSION_TEST ((s != 0), "intf listener should exist in global table");
- SESSION_TEST ((s->app_index == server_index), "app_index should be that of "
- "the server");
+ SESSION_TEST ((s->app_wrk_index == server_wrk_index), "app_index should be "
+ "that of the server");
server_local_st_index = application_local_session_table (server);
handle = session_lookup_local_endpoint (server_local_st_index, &server_sep);
SESSION_TEST ((handle != SESSION_INVALID_HANDLE),
}
}
- memset (srt, 0, sizeof (*srt));
+ clib_memset (srt, 0, sizeof (*srt));
session_rules_table_init (srt);
ip4_address_t lcl_ip = {
server_sep.is_ip4 = 1;
server_sep.port = dummy_port;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
vnet_app_attach_args_t attach_args = {
.api_client_index = ~0,
app_ns = app_namespace_get_default ();
app_ns->sw_if_index = sw_if_index;
- memset (options, 0, sizeof (options));
+ clib_memset (options, 0, sizeof (options));
options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_IS_BUILTIN;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_ACCEPT_REDIRECT;
options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_IS_PROXY;
SESSION_TEST ((tc != 0), "lookup 1.2.3.4 1234 5.6.7.8 4321 should be "
"successful");
s = listen_session_get (tc->s_index);
- SESSION_TEST ((s->app_index == server_index), "lookup should return the"
- " server");
+ SESSION_TEST ((s->app_index == server_index), "lookup should return"
+ " the server");
tc = session_lookup_connection_wt4 (0, &rmt_ip, &rmt_ip, lcl_port, rmt_port,
TRANSPORT_PROTO_TCP, 0, &is_filtered);