summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/attr/attr_provider.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
committerYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
commitbba25e2ff6c4a193acb54560ea4417537bd2954e (patch)
tree9e074fe343f9ab6f5ce1e9c5142d9a6cf180fcda /src/libcharon/plugins/attr/attr_provider.c
parent05ddd767992d68bb38c7f16ece142e8c2e9ae016 (diff)
downloadvyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.tar.gz
vyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.zip
New upstream version 5.5.3
Diffstat (limited to 'src/libcharon/plugins/attr/attr_provider.c')
-rw-r--r--src/libcharon/plugins/attr/attr_provider.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libcharon/plugins/attr/attr_provider.c b/src/libcharon/plugins/attr/attr_provider.c
index f4c143641..3310f79fd 100644
--- a/src/libcharon/plugins/attr/attr_provider.c
+++ b/src/libcharon/plugins/attr/attr_provider.c
@@ -75,17 +75,23 @@ typedef struct {
ike_version_t ike;
} enumerator_data_t;
-/**
- * convert enumerator value from attribute_entry
- */
-static bool attr_enum_filter(enumerator_data_t *data, attribute_entry_t **in,
- configuration_attribute_type_t *type, void* none, chunk_t *value)
+CALLBACK(attr_enum_filter, bool,
+ enumerator_data_t *data, enumerator_t *orig, va_list args)
{
- if ((*in)->ike == IKE_ANY || (*in)->ike == data->ike)
+ configuration_attribute_type_t *type;
+ attribute_entry_t *entry;
+ chunk_t *value;
+
+ VA_ARGS_VGET(args, type, value);
+
+ while (orig->enumerate(orig, &entry))
{
- *type = (*in)->type;
- *value = (*in)->value;
- return TRUE;
+ if (entry->ike == IKE_ANY || entry->ike == data->ike)
+ {
+ *type = entry->type;
+ *value = entry->value;
+ return TRUE;
+ }
}
return FALSE;
}
@@ -112,7 +118,7 @@ METHOD(attribute_provider_t, create_attribute_enumerator, enumerator_t*,
this->lock->read_lock(this->lock);
return enumerator_create_filter(
this->attributes->create_enumerator(this->attributes),
- (void*)attr_enum_filter, data, attr_enum_destroy);
+ attr_enum_filter, data, attr_enum_destroy);
}
return enumerator_create_empty();
}