(E-Mail Removed) wrote:
> hello ... this is rakesh ..... i am new to socket programming
> ..... i just want to know wheather if we could get statistics
> related to a particular port using socket programming in C?
> statistics in the sense .... no of packets transmitted,received etc
> ..... or is there any file in linux( i use fedora) which gives this
> kind of information? .... thanks in advance !!!
The closest you can get IIRC is what is reported by a TCP_INFO
getsockopt(), which is described in the manpage for tcp under linux.
It is decidedly non-portable. That of course won't do anything for
UDP, or DCCP or SCTP etc etc. And it is very specific to the Linux
stack - it may not be there on other stacks.
There might be some way using netfilter (?) to gather those stats, but
I'm not sufficiently familiar with how one uses that to say.
rick jones
--
portable adj, code that compiles under more than one compiler
these opinions are mine, all mine; HP might not want them anyway...

feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...