convert net_route to use net_address_t

This commit is contained in:
Doug MacEachern 2006-07-04 19:33:03 +00:00
parent 28c7957ec7
commit aedc5d075e
1 changed files with 12 additions and 6 deletions

View File

@ -1862,14 +1862,20 @@ SIGAR_DECLARE(int) sigar_net_route_list_get(sigar_t *sigar,
route = &routelist->data[routelist->number++];
SIGAR_ZERO(route); /* XXX: other fields */
route->destination = ipr->dwForwardDest;
route->mask = ipr->dwForwardMask;
route->gateway = ipr->dwForwardNextHop;
sigar_net_address_set(route->destination,
ipr->dwForwardDest);
sigar_net_address_set(route->mask,
ipr->dwForwardMask);
sigar_net_address_set(route->gateway,
ipr->dwForwardNextHop);
route->metric = ipr->dwForwardMetric1;
route->flags = SIGAR_RTF_UP;
if ((route->destination == 0) &&
(route->mask == 0))
if ((ipr->dwForwardDest == 0) &&
(ipr->dwForwardMask == 0))
{
route->flags |= SIGAR_RTF_GATEWAY;
}