ike-cfg: Pass arguments as struct
This commit is contained in:
@@ -19,11 +19,17 @@
|
||||
|
||||
static void assert_family(int expected, char *addr, bool local)
|
||||
{
|
||||
ike_cfg_create_t ike = {
|
||||
.version = IKEV2,
|
||||
.local = local ? addr : "%any",
|
||||
.local_port = 500,
|
||||
.remote = local ? "%any" : addr,
|
||||
.remote_port = 500,
|
||||
};
|
||||
ike_cfg_t *cfg;
|
||||
int family;
|
||||
|
||||
cfg = ike_cfg_create(IKEV2, FALSE, FALSE, local ? addr : "%any", 500,
|
||||
local ? "%any" : addr, 500, FRAGMENTATION_NO, 0);
|
||||
cfg = ike_cfg_create(&ike);
|
||||
family = ike_cfg_get_family(cfg, local);
|
||||
ck_assert_msg(expected == family, "expected family %d != %d (addr: '%s')",
|
||||
expected, family, addr);
|
||||
|
||||
@@ -23,8 +23,14 @@
|
||||
*/
|
||||
static ike_cfg_t *create_ike_cfg()
|
||||
{
|
||||
return ike_cfg_create(IKEV2, TRUE, FALSE, "127.0.0.1", 500,
|
||||
"127.0.0.1", 500, FRAGMENTATION_NO, 0);
|
||||
ike_cfg_create_t ike = {
|
||||
.version = IKEV2,
|
||||
.local = "127.0.0.1",
|
||||
.local_port = 500,
|
||||
.remote = "127.0.0.1",
|
||||
.remote_port = 500,
|
||||
};
|
||||
return ike_cfg_create(&ike);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -85,11 +85,17 @@ exchange_test_helper_t *exchange_test_helper;
|
||||
|
||||
static ike_cfg_t *create_ike_cfg(bool initiator, exchange_test_sa_conf_t *conf)
|
||||
{
|
||||
ike_cfg_create_t ike = {
|
||||
.version = IKEV2,
|
||||
.local = "127.0.0.1",
|
||||
.local_port = IKEV2_UDP_PORT,
|
||||
.remote = "127.0.0.1",
|
||||
.remote_port = IKEV2_UDP_PORT,
|
||||
};
|
||||
ike_cfg_t *ike_cfg;
|
||||
char *proposal = NULL;
|
||||
|
||||
ike_cfg = ike_cfg_create(IKEV2, TRUE, FALSE, "127.0.0.1", IKEV2_UDP_PORT,
|
||||
"127.0.0.1", IKEV2_UDP_PORT, FRAGMENTATION_NO, 0);
|
||||
ike_cfg = ike_cfg_create(&ike);
|
||||
if (conf)
|
||||
{
|
||||
proposal = initiator ? conf->initiator.ike : conf->responder.ike;
|
||||
|
||||
Reference in New Issue
Block a user