[Prev][Next][Index][Thread]
Re: socket in linux
Lo and behold, Klaus Espenlaub once said:
>
> Sure there is both SOCK_PACKET and SOCK_RAW under Linux. But don't expect
> much documentation about these things. SOCK_PACKET is used by packet sniffers
> to receive all packets arriving/sent through an interface. AFAIK there is no
> way of sending data through a SOCK_PACKET socket.
>
>[...]
> just using the low level drivers directly). The OSKIT authors probably
> can suggest the best places to hack once you tell them roughly what you're
> trying to achieve.
>
> Note that I don't know much about the BSD networking code, so maybe this is
> a piece of cake once the terminology is out of the way.
If you're trying to port a Linux-only packet sniffer to the oskit, you
might run into some problems. Kristin did some work a while ago getting
various packet filters (dpf, mostly) working under the oskit, but I'm not
sure what the status of BPF support is, which would be necessary for a
FreeBSD packet sniffer.
If all you want to do is snarf packets, you can simply stuff a listener
between the network stack and the ethernet devices.
More detail about what you're trying to accomplish would help. :)
-Dave
References: