Migrate all enumerators to venumerate() interface change

This commit is contained in:
Tobias Brunner
2017-05-26 13:56:44 +02:00
parent 16bffa8b55
commit 95a63bf281
68 changed files with 851 additions and 560 deletions
+8 -3
View File
@@ -235,9 +235,13 @@ typedef struct {
} shared_enumerator_t;
METHOD(enumerator_t, shared_enumerate, bool,
shared_enumerator_t *this, shared_key_t **key, id_match_t *me,
id_match_t *other)
shared_enumerator_t *this, va_list args)
{
shared_key_t **key;
id_match_t *me, *other;
VA_ARGS_VGET(args, key, me, other);
if (this->done)
{
return FALSE;
@@ -307,7 +311,8 @@ METHOD(credential_set_t, create_shared_enumerator, enumerator_t*,
INIT(enumerator,
.public = {
.enumerate = (void*)_shared_enumerate,
.enumerate = enumerator_enumerate_default,
.venumerate = _shared_enumerate,
.destroy = _shared_destroy,
},
.this = this,
+16 -11
View File
@@ -65,29 +65,33 @@ METHOD(attribute_handler_t, handle, bool,
return TRUE;
}
/**
* Implementation of create_attribute_enumerator().enumerate() for WINS
*/
static bool enumerate_nbns(enumerator_t *this,
configuration_attribute_type_t *type, chunk_t *data)
METHOD(enumerator_t, enumerate_nbns, bool,
enumerator_t *this, va_list args)
{
configuration_attribute_type_t *type;
chunk_t *data;
VA_ARGS_VGET(args, type, data);
*type = INTERNAL_IP4_NBNS;
*data = chunk_empty;
/* done */
this->enumerate = (void*)return_false;
this->venumerate = (void*)return_false;
return TRUE;
}
/**
* Implementation of create_attribute_enumerator().enumerate() for DNS
*/
static bool enumerate_dns(enumerator_t *this,
configuration_attribute_type_t *type, chunk_t *data)
METHOD(enumerator_t, enumerate_dns, bool,
enumerator_t *this, va_list args)
{
configuration_attribute_type_t *type;
chunk_t *data;
VA_ARGS_VGET(args, type, data);
*type = INTERNAL_IP4_DNS;
*data = chunk_empty;
/* enumerate WINS server as next attribute ... */
this->enumerate = (void*)enumerate_nbns;
this->venumerate = _enumerate_nbns;
return TRUE;
}
@@ -100,7 +104,8 @@ METHOD(attribute_handler_t, create_attribute_enumerator, enumerator_t*,
INIT(enumerator,
/* enumerate DNS attribute first ... */
.enumerate = (void*)enumerate_dns,
.enumerate = enumerator_enumerate_default,
.venumerate = _enumerate_dns,
.destroy = (void*)free,
);
return enumerator;