Reading the route table on Solaris
-
05-03-2021 - |
Domanda
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.
Soluzione
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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow