programmatic access to "ip route show"

strace shows ip route show creating a NETLINK_ROUTE socket to get that: http://man7.org/linux/man-pages/man7/netlink.7.html


Same information is on "/proc/net/route". You could check that file, instead of capture standar output information from "netstat -n" command.