Sign in to follow this  
widggman

BSD sockets & device

Recommended Posts

widggman    100
Hi, I'm very desesperated. I've tried all the example I've found on Internet and no one work. I tried the make a sniffer to analyse the data for a homework at the university. I'm currently on FreeBSD, I tried Linux, and other things went wrong with it too... One article said to open the pseudo-file: "/dev/bpf0", but the file is already opened and I don't know how to close the other process which use this file. And if this process manages all my Internet connection, I don't want to close it. In other article, the authors said to open a raw socket, but when I try to listen on this socket, nothing append. PLEASE, someone, or sometwo, help me, I really need to this to finish my little project. P.S.: excuse my english

Share this post


Link to post
Share on other sites
hplus0603    11347
Why not just use Ethereal, or plain-old tcpdump (which can dump things other than TCP, too)?

If you want to sniff, you should set an interface into promiscuous mode, and then create a socket at a lower level address family (the specifics vary by OS, but can be found in your man pages). Or just use libpcap.

Share this post


Link to post
Share on other sites
widggman    100
With tcpdump... can i write to ???

pcap is to complicated and 90% of the functionnalities won't be used... and I want to make things my self... not use the stuff over others programmers

for the promiscuous mode, how can I make this ?? Before the socket, or after ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this