summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/unity/unity_handler.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/unity/unity_handler.c
parent05ddd767992d68bb38c7f16ece142e8c2e9ae016 (diff)
downloadvyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.tar.gz
vyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.zip
New upstream version 5.5.3
Diffstat (limited to 'src/libcharon/plugins/unity/unity_handler.c')
-rw-r--r--src/libcharon/plugins/unity/unity_handler.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/libcharon/plugins/unity/unity_handler.c b/src/libcharon/plugins/unity/unity_handler.c
index 25e0756b7..4a1478c6d 100644
--- a/src/libcharon/plugins/unity/unity_handler.c
+++ b/src/libcharon/plugins/unity/unity_handler.c
@@ -368,9 +368,12 @@ typedef struct {
} attribute_enumerator_t;
METHOD(enumerator_t, enumerate_attributes, bool,
- attribute_enumerator_t *this, configuration_attribute_type_t *type,
- chunk_t *data)
+ attribute_enumerator_t *this, va_list args)
{
+ configuration_attribute_type_t *type;
+ chunk_t *data;
+
+ VA_ARGS_VGET(args, type, data);
if (this->i < countof(attributes))
{
*type = attributes[this->i++];
@@ -393,7 +396,8 @@ METHOD(attribute_handler_t, create_attribute_enumerator, enumerator_t *,
}
INIT(enumerator,
.public = {
- .enumerate = (void*)_enumerate_attributes,
+ .enumerate = enumerator_enumerate_default,
+ .venumerate = _enumerate_attributes,
.destroy = (void*)free,
},
);
@@ -407,24 +411,27 @@ typedef struct {
ike_sa_id_t *id;
} include_filter_t;
-/**
- * Include enumerator filter function
- */
-static bool include_filter(include_filter_t *data,
- entry_t **entry, traffic_selector_t **ts)
+CALLBACK(include_filter, bool,
+ include_filter_t *data, enumerator_t *orig, va_list args)
{
- if (data->id->equals(data->id, (*entry)->id))
+ entry_t *entry;
+ traffic_selector_t **ts;
+
+ VA_ARGS_VGET(args, ts);
+
+ while (orig->enumerate(orig, &entry))
{
- *ts = (*entry)->ts;
- return TRUE;
+ if (data->id->equals(data->id, entry->id))
+ {
+ *ts = entry->ts;
+ return TRUE;
+ }
}
return FALSE;
}
-/**
- * Destroy include filter data, unlock mutex
- */
-static void destroy_filter(include_filter_t *data)
+CALLBACK(destroy_filter, void,
+ include_filter_t *data)
{
data->mutex->unlock(data->mutex);
free(data);
@@ -442,7 +449,7 @@ METHOD(unity_handler_t, create_include_enumerator, enumerator_t*,
data->mutex->lock(data->mutex);
return enumerator_create_filter(
this->include->create_enumerator(this->include),
- (void*)include_filter, data, (void*)destroy_filter);
+ include_filter, data, destroy_filter);
}
METHOD(unity_handler_t, destroy, void,