diff options
author | Martin Willi <martin@revosec.ch> | 2010-11-09 11:17:20 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-01-05 16:45:42 +0100 |
commit | a60b8928412f6fbe6e6fa0d5f8a68c9f3e96025b (patch) | |
tree | a781471d727c7596f24532ebe57cc6a050e9228c /src/conftest/hooks | |
parent | e5e71e46d9decbfeac85530f3e12d0c4d6b78781 (diff) | |
download | strongswan-a60b8928412f6fbe6e6fa0d5f8a68c9f3e96025b.tar.bz2 strongswan-a60b8928412f6fbe6e6fa0d5f8a68c9f3e96025b.tar.xz |
Support hook suffixes to use the same hook multiple times
Diffstat (limited to 'src/conftest/hooks')
-rw-r--r-- | src/conftest/hooks/add_notify.c | 14 | ||||
-rw-r--r-- | src/conftest/hooks/ignore_message.c | 8 | ||||
-rw-r--r-- | src/conftest/hooks/ike_auth_fill.c | 8 | ||||
-rw-r--r-- | src/conftest/hooks/unencrypted_notify.c | 12 | ||||
-rw-r--r-- | src/conftest/hooks/unsort_message.c | 8 |
5 files changed, 25 insertions, 25 deletions
diff --git a/src/conftest/hooks/add_notify.c b/src/conftest/hooks/add_notify.c index d73bdbaf8..4ae7c2db7 100644 --- a/src/conftest/hooks/add_notify.c +++ b/src/conftest/hooks/add_notify.c @@ -111,7 +111,7 @@ METHOD(hook_t, destroy, void, /** * Create the IKE_AUTH fill hook */ -hook_t *add_notify_hook_create(void) +hook_t *add_notify_hook_create(char *name) { private_add_notify_t *this; @@ -123,17 +123,17 @@ hook_t *add_notify_hook_create(void) .destroy = _destroy, }, .req = conftest->test->get_bool(conftest->test, - "hooks.add_notify.request", TRUE), + "hooks.%s.request", TRUE, name), .id = conftest->test->get_int(conftest->test, - "hooks.add_notify.id", 0), + "hooks.%s.id", 0, name), .type = conftest->test->get_str(conftest->test, - "hooks.add_notify.type", ""), + "hooks.%s.type", "", name), .data = conftest->test->get_str(conftest->test, - "hooks.add_notify.data", ""), + "hooks.%s.data", "", name), .spi = conftest->test->get_int(conftest->test, - "hooks.add_notify.spi", 0), + "hooks.%s.spi", 0, name), .esp = conftest->test->get_bool(conftest->test, - "hooks.add_notify.esp", FALSE), + "hooks.%s.esp", FALSE, name), ); return &this->hook; diff --git a/src/conftest/hooks/ignore_message.c b/src/conftest/hooks/ignore_message.c index 33182dd9b..210f3ac50 100644 --- a/src/conftest/hooks/ignore_message.c +++ b/src/conftest/hooks/ignore_message.c @@ -66,7 +66,7 @@ METHOD(hook_t, destroy, void, /** * Create the ignore_message hook */ -hook_t *ignore_message_hook_create(void) +hook_t *ignore_message_hook_create(char *name) { private_ignore_message_t *this; @@ -78,11 +78,11 @@ hook_t *ignore_message_hook_create(void) .destroy = _destroy, }, .in = conftest->test->get_bool(conftest->test, - "hooks.ignore_message.inbound", TRUE), + "hooks.%s.inbound", TRUE, name), .req = conftest->test->get_bool(conftest->test, - "hooks.ignore_message.request", TRUE), + "hooks.%s.request", TRUE, name), .id = conftest->test->get_int(conftest->test, - "hooks.ignore_message.id", 0), + "hooks.%s.id", 0, name), ); return &this->hook; diff --git a/src/conftest/hooks/ike_auth_fill.c b/src/conftest/hooks/ike_auth_fill.c index 7f3ff08c2..0e1a1d38f 100644 --- a/src/conftest/hooks/ike_auth_fill.c +++ b/src/conftest/hooks/ike_auth_fill.c @@ -121,7 +121,7 @@ METHOD(hook_t, destroy, void, /** * Create the IKE_AUTH fill hook */ -hook_t *ike_auth_fill_hook_create(void) +hook_t *ike_auth_fill_hook_create(char *name) { private_ike_auth_fill_t *this; @@ -133,11 +133,11 @@ hook_t *ike_auth_fill_hook_create(void) .destroy = _destroy, }, .req = conftest->test->get_bool(conftest->test, - "hooks.ike_auth_fill.request", TRUE), + "hooks.%s.request", TRUE, name), .id = conftest->test->get_int(conftest->test, - "hooks.ike_auth_fill.id", 1), + "hooks.%s.id", 1, name), .bytes = conftest->test->get_int(conftest->test, - "hooks.ike_auth_fill.bytes", 0), + "hooks.%s.bytes", 0, name), ); return &this->hook; diff --git a/src/conftest/hooks/unencrypted_notify.c b/src/conftest/hooks/unencrypted_notify.c index 7db929614..1d7f42def 100644 --- a/src/conftest/hooks/unencrypted_notify.c +++ b/src/conftest/hooks/unencrypted_notify.c @@ -126,7 +126,7 @@ METHOD(hook_t, destroy, void, /** * Create the IKE_AUTH fill hook */ -hook_t *unencrypted_notify_hook_create(void) +hook_t *unencrypted_notify_hook_create(char *name) { private_unencrypted_notify_t *this; @@ -138,15 +138,15 @@ hook_t *unencrypted_notify_hook_create(void) .destroy = _destroy, }, .id = conftest->test->get_int(conftest->test, - "hooks.unencrypted_notify.id", 2), + "hooks.%s.id", 2, name), .type = conftest->test->get_str(conftest->test, - "hooks.unencrypted_notify.type", ""), + "hooks.%s.type", "", name), .data = conftest->test->get_str(conftest->test, - "hooks.unencrypted_notify.data", ""), + "hooks.%s.data", "", name), .spi = conftest->test->get_int(conftest->test, - "hooks.unencrypted_notify.spi", 0), + "hooks.%s.spi", 0, name), .esp = conftest->test->get_bool(conftest->test, - "hooks.unencrypted_notify.esp", FALSE), + "hooks.%s.esp", FALSE, name), ); return &this->hook; diff --git a/src/conftest/hooks/unsort_message.c b/src/conftest/hooks/unsort_message.c index c12f55601..9af13e8e0 100644 --- a/src/conftest/hooks/unsort_message.c +++ b/src/conftest/hooks/unsort_message.c @@ -110,7 +110,7 @@ METHOD(hook_t, destroy, void, /** * Create the IKE_AUTH fill hook */ -hook_t *unsort_message_hook_create(void) +hook_t *unsort_message_hook_create(char *name) { private_unsort_message_t *this; @@ -122,11 +122,11 @@ hook_t *unsort_message_hook_create(void) .destroy = _destroy, }, .req = conftest->test->get_bool(conftest->test, - "hooks.unsort_message.request", TRUE), + "hooks.%s.request", TRUE, name), .id = conftest->test->get_int(conftest->test, - "hooks.unsort_message.id", 0), + "hooks.%s.id", 0, name), .order = conftest->test->get_str(conftest->test, - "hooks.unsort_message.order", ""), + "hooks.%s.order", "", name), ); return &this->hook; |