diff options
author | Yves-Alexis Perez <corsac@corsac.net> | 2017-05-30 20:59:31 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@corsac.net> | 2017-05-30 21:03:44 +0200 |
commit | 335b7e322c795d86705aab67d2ecf72f1c9c5614 (patch) | |
tree | c3a2256cd4d3c9242c47da2a47077b12b3b7a1a6 /src/libimcv/pts | |
parent | 7f6fc258427831ed2e80f7540c4368cf6ceba385 (diff) | |
download | vyos-strongswan-335b7e322c795d86705aab67d2ecf72f1c9c5614.tar.gz vyos-strongswan-335b7e322c795d86705aab67d2ecf72f1c9c5614.zip |
New upstream version 5.5.3
Diffstat (limited to 'src/libimcv/pts')
-rw-r--r-- | src/libimcv/pts/pts_file_meas.c | 25 | ||||
-rw-r--r-- | src/libimcv/pts/pts_pcr.c | 16 |
2 files changed, 22 insertions, 19 deletions
diff --git a/src/libimcv/pts/pts_file_meas.c b/src/libimcv/pts/pts_file_meas.c index 6cfb86cb3..92f513a2d 100644 --- a/src/libimcv/pts/pts_file_meas.c +++ b/src/libimcv/pts/pts_file_meas.c @@ -94,22 +94,29 @@ METHOD(pts_file_meas_t, add, void, this->list->insert_last(this->list, entry); } -/** - * Enumerate file measurement entries - */ -static bool entry_filter(void *null, entry_t **entry, char **filename, - void *i2, chunk_t *measurement) +CALLBACK(entry_filter, bool, + void *null, enumerator_t *orig, va_list args) { - *filename = (*entry)->filename; - *measurement = (*entry)->measurement; - return TRUE; + entry_t *entry; + chunk_t *measurement; + char **filename; + + VA_ARGS_VGET(args, filename, measurement); + + if (orig->enumerate(orig, &entry)) + { + *filename = entry->filename; + *measurement = entry->measurement; + return TRUE; + } + return FALSE; } METHOD(pts_file_meas_t, create_enumerator, enumerator_t*, private_pts_file_meas_t *this) { return enumerator_create_filter(this->list->create_enumerator(this->list), - (void*)entry_filter, NULL, NULL); + entry_filter, NULL, NULL); } METHOD(pts_file_meas_t, check, bool, diff --git a/src/libimcv/pts/pts_pcr.c b/src/libimcv/pts/pts_pcr.c index d514532c5..9f098c08e 100644 --- a/src/libimcv/pts/pts_pcr.c +++ b/src/libimcv/pts/pts_pcr.c @@ -111,17 +111,12 @@ typedef struct { private_pts_pcr_t *pcrs; } pcr_enumerator_t; -/** - * Implementation of enumerator.enumerate - */ -static bool pcr_enumerator_enumerate(pcr_enumerator_t *this, ...) +METHOD(enumerator_t, pcr_enumerator_enumerate, bool, + pcr_enumerator_t *this, va_list args) { - uint32_t *pcr, i, f; - va_list args; + uint32_t i, f, *pcr; - va_start(args, this); - pcr = va_arg(args, uint32_t*); - va_end(args); + VA_ARGS_VGET(args, pcr); while (this->pcr <= this->pcrs->pcr_max) { @@ -148,7 +143,8 @@ METHOD(pts_pcr_t, create_enumerator, enumerator_t*, INIT(enumerator, .public = { - .enumerate = (void*)pcr_enumerator_enumerate, + .enumerate = enumerator_enumerate_default, + .venumerate = _pcr_enumerator_enumerate, .destroy = (void*)free, }, .pcrs = this, |