Hi all

I doubt that this can be done, but it would solve me a lot of headaches
if it can!

I would like to know if there is a way I can, given a file descriptor
(which will be a TCP socket), determine how many bytes have been sent
and received through that socket since it was opened. Obviously one
way is to keep a count of reads and writes, but what I really want is
to have a wrapper process that can spawn arbitrary one-shot servers and
then log the traffic produced and consumed by that server when it
terminates. Another option is to communicate with the server via pipes,
but that may break if the server needs to be able to do getsockname()
and getpeername() calls. So the real solution would (I imagine) involve
some kind of kernel querying.

Any ideas, anyone?

TIA
gram
-- 
Dr Graham Wheeler                        E-mail: [EMAIL PROTECTED]
Director, Research and Development       WWW:    http://www.cequrux.com
CEQURUX Technologies                     Phone:  +27(21)423-6065
Firewalls/VPN Specialists                Fax:    +27(21)424-3656


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to