1832086 Members
3041 Online
110037 Solutions
New Discussion

kernel routing table

 
elisheva alexander
Occasional Contributor

kernel routing table

how would one get the routing table
from the kernel?
in BSD* one uses sysctl() or a routing socket (AF_ROUTE) in solaris an ioctl() to /dev/ip, in Linux it's using the special AF_NETLINK socket.
how is it done in HP-UX? if you can point me to documentation i would be grateful.
thanks.
1 REPLY 1
Dan Hetzel
Honored Contributor

Re: kernel routing table

Hi,

Using ioctl().
/usr/include/sys/ioctl.h has the following socket I/O definitions for the route entry and the route table (amongst others):
#define SIOCGRTENTRY _IOWR('r', 13, struct rtreq) /* get route entry */
#define SIOCGRTTABLE _IOWR('r', 14, struct rtlist) /* get route table */

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com