.options = options,
.namespace_id = 0,
.session_cb_vft = &dummy_session_cbs,
+ .name = format (0, "session_test"),
};
error = vnet_application_attach (&attach_args);
SESSION_TEST ((error == 0), "app attached");
server_index = attach_args.app_index;
+ vec_free (attach_args.name);
server_sep.is_ip4 = 1;
vnet_bind_args_t bind_args = {
.options = options,
.namespace_id = 0,
.session_cb_vft = &dummy_session_cbs,
+ .name = format (0, "session_test"),
};
vnet_bind_args_t bind_args = {
};
vnet_connect_args_t connect_args = {
- .sep = client_sep,
.app_index = 0,
.api_context = 0,
};
+ clib_memcpy (&connect_args.sep, &client_sep, sizeof (client_sep));
vnet_unbind_args_t unbind_args = {
.handle = bind_args.handle,
/*
* Cleanup
*/
+ vec_free (attach_args.name);
vec_free (ns_id);
session_delete_loopback (sw_if_index);
return 0;
.options = options,
.namespace_id = 0,
.session_cb_vft = &dummy_session_cbs,
+ .name = format (0, "session_test"),
};
vnet_bind_args_t bind_args = {
" 5.6.7.9/32 4321 in local table should return deny");
vnet_connect_args_t connect_args = {
- .sep = sep,
.app_index = attach_args.app_index,
.api_context = 0,
};
+ clib_memcpy (&connect_args.sep, &sep, sizeof (sep));
/* Try connecting */
error = vnet_connect (&connect_args);
connect_args.app_index = server_index;
- connect_args.sep = sep;
+ clib_memcpy (&connect_args.sep, &sep, sizeof (sep));
error = vnet_connect (&connect_args);
SESSION_TEST ((error != 0), "connect should fail");
vnet_application_detach (&detach_args);
vec_free (ns_id);
+ vec_free (attach_args.name);
return 0;
}
u32 server_index, app_index;
u32 dummy_server_api_index = ~0, sw_if_index = 0;
clib_error_t *error = 0;
- u8 sst, is_filtered = 0;
+ u8 is_filtered = 0;
stream_session_t *s;
transport_connection_t *tc;
u16 lcl_port = 1234, rmt_port = 4321;
.options = options,
.namespace_id = 0,
.session_cb_vft = &dummy_session_cbs,
+ .name = format (0, "session_test"),
};
attach_args.api_client_index = dummy_server_api_index;
TRANSPORT_PROTO_TCP, 0, &is_filtered);
SESSION_TEST ((tc != 0), "lookup 1.2.3.4 1234 5.6.7.8 4321 should be "
"successful");
- sst = session_type_from_proto_and_ip (TRANSPORT_PROTO_TCP, 1);
- s = listen_session_get (sst, tc->s_index);
+ s = listen_session_get (tc->s_index);
SESSION_TEST ((s->app_index == server_index), "lookup should return the"
" server");
"local session endpoint lookup should not work after detach");
if (verbose)
unformat_free (&tmp_input);
+ vec_free (attach_args.name);
return 0;
}