Getting Routing tables

Michael Stefaniuc mstefani at redhat.de
Wed Sep 26 07:13:29 CDT 2001


On Wed, Sep 26, 2001 at 07:17:36AM +1000, Robert Lunnon wrote:
> In my pitiful attempt to hack on WINE I have come to an impasse. I have 
> managed to find portable equivalents to get the interface name and the number 
> of interfaces in winsock/wsock32 but I can't seem to find a portable way to 
> get to the routing table. In Solaris (why I'm doing the hacking) there is a 
> vague mention in the man pages of being able to get this info by reading 
> /dev/ip but no information about how to actually do it.
> 
> Can anyone provide a hint on how this can be done portably or to a multi-os 
> implementation of netstat that might serve as an example. (Only netstat 
> sources I have found are OS specific)
You can't realy do that in a portable way. That's why I choosed to parse
/proc/net/route (and because most of the winsock stuff was also only
Linux specific).

> Hurry because  in desperation I am actually thinking of piping the output of 
> netstat -r
That seems to be the most resonable way to go. If you want to also parse the
header of the netstat output you should set LANG=C before.

bye
	michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
System Administration           Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.de
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart




More information about the wine-devel mailing list