aboutsummaryrefslogtreecommitdiffstats
path: root/src/conftest
diff options
context:
space:
mode:
Diffstat (limited to 'src/conftest')
-rw-r--r--src/conftest/hooks/add_notify.c3
-rw-r--r--src/conftest/hooks/add_payload.c3
-rw-r--r--src/conftest/hooks/custom_proposal.c3
-rw-r--r--src/conftest/hooks/set_critical.c3
-rw-r--r--src/conftest/hooks/set_length.c3
-rw-r--r--src/conftest/hooks/set_reserved.c3
-rw-r--r--src/conftest/hooks/unencrypted_notify.c3
-rw-r--r--src/conftest/hooks/unsort_message.c3
8 files changed, 8 insertions, 16 deletions
diff --git a/src/conftest/hooks/add_notify.c b/src/conftest/hooks/add_notify.c
index 9611cad6c..504b02a7b 100644
--- a/src/conftest/hooks/add_notify.c
+++ b/src/conftest/hooks/add_notify.c
@@ -73,8 +73,7 @@ METHOD(listener_t, message, bool,
type = atoi(this->type);
if (!type)
{
- type = enum_from_name(notify_type_names, this->type);
- if (type == -1)
+ if (!enum_from_name(notify_type_names, this->type, &type))
{
DBG1(DBG_CFG, "unknown notify: '%s', skipped", this->type);
return TRUE;
diff --git a/src/conftest/hooks/add_payload.c b/src/conftest/hooks/add_payload.c
index 2903bb20f..cb5be1aef 100644
--- a/src/conftest/hooks/add_payload.c
+++ b/src/conftest/hooks/add_payload.c
@@ -77,8 +77,7 @@ METHOD(listener_t, message, bool,
type = atoi(this->type);
if (!type)
{
- type = enum_from_name(payload_type_short_names, this->type);
- if (type == -1)
+ if (!enum_from_name(payload_type_short_names, this->type, &type))
{
DBG1(DBG_CFG, "unknown payload: '%s', skipped", this->type);
return TRUE;
diff --git a/src/conftest/hooks/custom_proposal.c b/src/conftest/hooks/custom_proposal.c
index 38d4286c4..6086d13b5 100644
--- a/src/conftest/hooks/custom_proposal.c
+++ b/src/conftest/hooks/custom_proposal.c
@@ -79,8 +79,7 @@ static linked_list_t* load_proposals(private_custom_proposal_t *this,
type = strtoul(key, &end, 10);
if (end == key || errno)
{
- type = enum_from_name(transform_type_names, key);
- if (type == -1)
+ if (!enum_from_name(transform_type_names, key, &type))
{
DBG1(DBG_CFG, "unknown transform: '%s', skipped", key);
continue;
diff --git a/src/conftest/hooks/set_critical.c b/src/conftest/hooks/set_critical.c
index 8ec84e13d..15c313c51 100644
--- a/src/conftest/hooks/set_critical.c
+++ b/src/conftest/hooks/set_critical.c
@@ -65,8 +65,7 @@ METHOD(listener_t, message, bool,
type = atoi(name);
if (!type)
{
- type = enum_from_name(payload_type_short_names, name);
- if (type == -1)
+ if (!enum_from_name(payload_type_short_names, name, &type))
{
DBG1(DBG_CFG, "invalid payload name '%s'", name);
break;
diff --git a/src/conftest/hooks/set_length.c b/src/conftest/hooks/set_length.c
index c1a867a99..b1a1a4723 100644
--- a/src/conftest/hooks/set_length.c
+++ b/src/conftest/hooks/set_length.c
@@ -63,8 +63,7 @@ METHOD(listener_t, message, bool,
type = atoi(this->type);
if (!type)
{
- type = enum_from_name(payload_type_short_names, this->type);
- if (type == -1)
+ if (!enum_from_name(payload_type_short_names, this->type, &type))
{
DBG1(DBG_CFG, "unknown payload: '%s', skipped", this->type);
return TRUE;
diff --git a/src/conftest/hooks/set_reserved.c b/src/conftest/hooks/set_reserved.c
index d1a4a977b..5961aebc4 100644
--- a/src/conftest/hooks/set_reserved.c
+++ b/src/conftest/hooks/set_reserved.c
@@ -181,8 +181,7 @@ METHOD(listener_t, message, bool,
type = atoi(name);
if (!type)
{
- type = enum_from_name(payload_type_short_names, name);
- if (type == -1)
+ if (!enum_from_name(payload_type_short_names, name, &type))
{
DBG1(DBG_CFG, "invalid payload name '%s'", name);
break;
diff --git a/src/conftest/hooks/unencrypted_notify.c b/src/conftest/hooks/unencrypted_notify.c
index f4c35725c..dae76faba 100644
--- a/src/conftest/hooks/unencrypted_notify.c
+++ b/src/conftest/hooks/unencrypted_notify.c
@@ -68,8 +68,7 @@ METHOD(listener_t, ike_updown, bool,
type = atoi(this->type);
if (!type)
{
- type = enum_from_name(notify_type_names, this->type);
- if (type == -1)
+ if (!enum_from_name(notify_type_names, this->type, &type))
{
DBG1(DBG_CFG, "unknown notify: '%s', skipped", this->type);
return TRUE;
diff --git a/src/conftest/hooks/unsort_message.c b/src/conftest/hooks/unsort_message.c
index 1b2b302af..399d2932a 100644
--- a/src/conftest/hooks/unsort_message.c
+++ b/src/conftest/hooks/unsort_message.c
@@ -69,8 +69,7 @@ METHOD(listener_t, message, bool,
order = enumerator_create_token(this->order, ", ", " ");
while (order->enumerate(order, &name))
{
- type = enum_from_name(payload_type_short_names, name);
- if (type != -1)
+ if (enum_from_name(payload_type_short_names, name, &type))
{
enumerator = list->create_enumerator(list);
while (enumerator->enumerate(enumerator, &payload))