summaryrefslogtreecommitdiff
path: root/src/libimcv/ietf/ietf_attr_installed_packages.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 21:03:44 +0200
commit335b7e322c795d86705aab67d2ecf72f1c9c5614 (patch)
treec3a2256cd4d3c9242c47da2a47077b12b3b7a1a6 /src/libimcv/ietf/ietf_attr_installed_packages.c
parent7f6fc258427831ed2e80f7540c4368cf6ceba385 (diff)
downloadvyos-strongswan-335b7e322c795d86705aab67d2ecf72f1c9c5614.tar.gz
vyos-strongswan-335b7e322c795d86705aab67d2ecf72f1c9c5614.zip
New upstream version 5.5.3
Diffstat (limited to 'src/libimcv/ietf/ietf_attr_installed_packages.c')
-rw-r--r--src/libimcv/ietf/ietf_attr_installed_packages.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libimcv/ietf/ietf_attr_installed_packages.c b/src/libimcv/ietf/ietf_attr_installed_packages.c
index 7a870ac40..d8e5b3342 100644
--- a/src/libimcv/ietf/ietf_attr_installed_packages.c
+++ b/src/libimcv/ietf/ietf_attr_installed_packages.c
@@ -179,7 +179,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
u_char *pos;
if (this->offset == 0)
- {
+ {
if (this->length < IETF_INSTALLED_PACKAGES_MIN_SIZE)
{
DBG1(DBG_TNC, "insufficient data for %N/%N", pen_names, PEN_IETF,
@@ -291,15 +291,21 @@ METHOD(ietf_attr_installed_packages_t, add, void,
this->packages->insert_last(this->packages, entry);
}
-/**
- * Enumerate package filter entries
- */
-static bool package_filter(void *null, package_entry_t **entry, chunk_t *name,
- void *i2, chunk_t *version)
+CALLBACK(package_filter, bool,
+ void *null, enumerator_t *orig, va_list args)
{
- *name = (*entry)->name;
- *version = (*entry)->version;
- return TRUE;
+ package_entry_t *entry;
+ chunk_t *name, *version;
+
+ VA_ARGS_VGET(args, name, version);
+
+ if (orig->enumerate(orig, &entry))
+ {
+ *name = entry->name;
+ *version = entry->version;
+ return TRUE;
+ }
+ return FALSE;
}
METHOD(ietf_attr_installed_packages_t, create_enumerator, enumerator_t*,
@@ -307,7 +313,7 @@ METHOD(ietf_attr_installed_packages_t, create_enumerator, enumerator_t*,
{
return enumerator_create_filter(
this->packages->create_enumerator(this->packages),
- (void*)package_filter, NULL, NULL);
+ package_filter, NULL, NULL);
}
METHOD(ietf_attr_installed_packages_t, get_count, uint16_t,