0

I'm working on a C++ application on Solaris 11 that needs to read the network routes (similar to the output of "route" on Linux or "netstat -r" on Solaris).

What is the best way to do on Solaris ? Solaris doesn't support getting it via sysctl() on an AF_ROUTE socket, like FreeBSD does.

I don't want to fork netstat and parse the output.

4

1 回答 1

2

You might have a look to the Solaris way to implement netstat: https://hg.java.net/hg/solaris~on-src/file/tip/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c

于 2011-11-20T22:44:30.237 回答