Sign in to follow this  

BSD sockets & device

This topic is 4391 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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
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

This topic is 4391 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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