Migrate all enumerators to venumerate() interface change
This commit is contained in:
@@ -601,9 +601,12 @@ typedef struct {
|
||||
} rt_enumerator_t;
|
||||
|
||||
METHOD(enumerator_t, rt_enumerate, bool,
|
||||
rt_enumerator_t *this, int *xtype, struct sockaddr **addr)
|
||||
rt_enumerator_t *this, va_list args)
|
||||
{
|
||||
int i, type;
|
||||
struct sockaddr **addr;
|
||||
int i, type, *xtype;
|
||||
|
||||
VA_ARGS_VGET(args, xtype, addr);
|
||||
|
||||
if (this->remaining < sizeof(this->addr->sa_len) ||
|
||||
this->remaining < this->addr->sa_len)
|
||||
@@ -637,7 +640,8 @@ static enumerator_t *create_rt_enumerator(int types, int remaining,
|
||||
|
||||
INIT(this,
|
||||
.public = {
|
||||
.enumerate = (void*)_rt_enumerate,
|
||||
.enumerate = enumerator_enumerate_default,
|
||||
.venumerate = _rt_enumerate,
|
||||
.destroy = (void*)free,
|
||||
},
|
||||
.types = types,
|
||||
@@ -1789,13 +1793,18 @@ METHOD(enumerator_t, destroy_subnet_enumerator, void,
|
||||
}
|
||||
|
||||
METHOD(enumerator_t, enumerate_subnets, bool,
|
||||
subnet_enumerator_t *this, host_t **net, uint8_t *mask, char **ifname)
|
||||
subnet_enumerator_t *this, va_list args)
|
||||
{
|
||||
enumerator_t *enumerator;
|
||||
host_t **net;
|
||||
struct rt_msghdr *rtm;
|
||||
struct sockaddr *addr;
|
||||
uint8_t *mask;
|
||||
char **ifname;
|
||||
int type;
|
||||
|
||||
VA_ARGS_VGET(args, net, mask, ifname);
|
||||
|
||||
if (!this->current)
|
||||
{
|
||||
this->current = this->buf;
|
||||
@@ -1888,7 +1897,8 @@ METHOD(kernel_net_t, create_local_subnet_enumerator, enumerator_t*,
|
||||
|
||||
INIT(enumerator,
|
||||
.public = {
|
||||
.enumerate = (void*)_enumerate_subnets,
|
||||
.enumerate = enumerator_enumerate_default,
|
||||
.venumerate = _enumerate_subnets,
|
||||
.destroy = _destroy_subnet_enumerator,
|
||||
},
|
||||
.buf = buf,
|
||||
|
||||
Reference in New Issue
Block a user