Paul Durrant writes: > Akhil Jain wrote: > > > > The route command is an administrative command. If there are any C api's > > which can directly read routing table (w.o. using system() call) .. > > > > man -s 7p route > > what other API do you need?
The big part you'd need (and that isn't documented) is the MIB2 interface that allows you to read the table itself, rather than just searching for individual matches (with RTM_GET) or getting updates. Look at /usr/include/inet/mib2.h for details, and see netstat.c for an example usage of it. (Or pppd's sys-solaris.c for a much simpler example.) Portable applications should avoid doing this, though, so I think the right initial question is "what are you doing and why do you need to read this table?" -- James Carlson, Solaris Networking <[email protected]> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677 _______________________________________________ opensolaris-discuss mailing list [email protected]
