Sniffers

Mike Bilow mikebw at bilow.bilow.uu.ids.net
Tue Feb 2 15:15:00 EST 1999



gaf wrote in a message to Mike Bilow:

 g> Does anyone have a recommendation for sniffer code that we can 
 g> install on the Linux server to watch all TCP traffic on a 
 g> specified port. While I can look in the various archives, I 
 g> would prefer to download code that someone has used before. 

The "tcpdump" utility works well.

 g> A pthreads solution would have been better because I could spin 
 g> a bunch of threads and have them wait on a condition, which 
 g> would eliminating the forking. Shared memory and semaphores 
 g> would also work. 

That's not a significant difference under the hood of 2.0.34.

I couldn't really follow your pseudocode, but it is the responsibility of the
socket owner to close the socket when done.  If the child is the product of an
accept call, then it should take ownership subject to a sockowner call.  The
parent should continue to own the listening socket and keep it open.  If you
are running out of sockets because of a leak, look in this area.
 
-- Mike


***
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list