convert net_route to use net_address_t

This commit is contained in:
Doug MacEachern 2006-07-04 19:27:59 +00:00
parent 9751e49318
commit e7e089d5e7
1 changed files with 10 additions and 5 deletions

View File

@ -697,13 +697,18 @@ int sigar_net_route_list_get(sigar_t *sigar,
route = &routelist->data[routelist->number++]; route = &routelist->data[routelist->number++];
SIGAR_ZERO(route); /* XXX: other fields */ SIGAR_ZERO(route); /* XXX: other fields */
route->destination = ent->Dest; sigar_net_address_set(route->destination,
route->mask = ent->Mask; ent->Dest);
route->gateway = ent->NextHop;
sigar_net_address_set(route->mask,
ent->Mask);
sigar_net_address_set(route->gateway,
ent->NextHop);
route->flags = SIGAR_RTF_UP; route->flags = SIGAR_RTF_UP;
if ((route->destination == 0) && if ((ent->Dest == 0) &&
(route->mask == 0)) (ent->Mask == 0))
{ {
route->flags |= SIGAR_RTF_GATEWAY; route->flags |= SIGAR_RTF_GATEWAY;
} }