use same filter as netstat -r in net_route_list

This commit is contained in:
Doug MacEachern 2005-07-15 03:55:56 +00:00
parent d36d72b16c
commit ddca24c78e
1 changed files with 9 additions and 0 deletions

View File

@ -1492,6 +1492,15 @@ int sigar_net_route_list_get(sigar_t *sigar,
(char *)entry < end; entry++)
{
sigar_net_route_t *route;
int type = entry->ipRouteInfo.re_ire_type;
/* filter same as netstat -r */
if ((type == IRE_CACHE) ||
(type == IRE_BROADCAST) ||
(type == IRE_LOCAL))
{
continue;
}
SIGAR_NET_ROUTE_LIST_GROW(routelist);
route = &routelist->data[routelist->number++];