There are no raw sockets in BSD - apparently... Rather, raw network
device traffic is handled using the bpf interface.
To briefly quote man bpf:
BPF(4) BSD Kernel Interfaces
bpf -- Berkeley Packet Filter
The Berkeley Packet Filter provides a raw interface to data link
layers in a protocol independent fashion. All packets
on the network, even those destined for other hosts, are
accessible through this mechanism.
The packet filter appears as a character special device, /dev/
bpf0, /dev/bpf1, etc. After opening the device, the file
descriptor must be bound to a specific network interface with
the BIOCSETIF ioctl. A given interface can be shared be
multiple listeners, and the filter underlying each descriptor
will see an identical packet stream.
A separate device file is required for each minor device. If a
file is in use, the open will fail and errno will be set
Associated with each open instance of a bpf file is a user-
settable packet filter. Whenever a packet is received by an
interface, all file descriptors listening on that interface
apply their filter. Each descriptor that accepts the packet
receives its own copy.
- This communication is confidential to the parties it is intended to
Fred Cohen & Associates tel/fax: 925-454-0171
http://all.net/ 572 Leona Drive Livermore, CA 94550
Join http://tech.groups.yahoo.com/group/FCA-announce/join for our
Get latest updates about Open Source Projects, Conferences and News.