Paul Durrant writes: > On 4/19/07, sukruta <[EMAIL PROTECTED]> wrote: > > > > I'm working on a project which requires me to find the TCP/IP statistics > > using [b]ONLY SYSTEM CALLS or APIs[/b] on a solaris system. I [b]should > > not[/b] be using the command netstat itself. I can use the netstat.c code. > > The statistics should be found without actually establishing a connection. > > One should first find the [b]active connections[/b] and then find the the > > following for those connections. A simple program in C would do the job. > > Plzzz [b]do not[/b] suggest any commands or utilities. Kindly help > > > > Looking at the code in netstat.c is a start (IIRC it creates a socket > and extracts mibs). You should also look at the source to ndd; may be > useful to you.
Noting, of course, that those interfaces (mostly the MIB2 bits, but also kstats) are almost entirely Consolidation Private to ON. This means that they're not documented and may change at any time without warning. They're not "secret," but they're not stable. As long as your application is just a toy, and you don't care whether it breaks after applying a patch, this should work fine. If it's not just a toy (or can't be retooled on each kernel change), then you'll need to get a stable interface. We don't have one, so either: - Propose a new OpenSolaris project to create one, and work through the problems. (Start by filing an RFE at bugs.opensolaris.org.) or: - Contact your local Solaris support folks and ask them to file an RFE for you, and then work through getting a fix. -- James Carlson, Solaris Networking <[EMAIL PROTECTED]> Sun Microsystems / 1 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 opensolaris-discuss@opensolaris.org