Re: sample packet filter code
From: David W. Hankins
Date: Fri Oct 31 2008 - 11:45:43 EST
On Fri, Oct 31, 2008 at 08:05:42AM -0700, Allen Curtis wrote:
> I am working on an embedded system and would like to implement a
> PF_PACKET/SOCK_RAW with packet filtering. The objective is to create a
> filter based on a family of destination MAC addresses. Can anyone provide
> sample code which does this without the aid of the PCAP library? A previous
> posting suggested looking at tcpdump for an example of BPF but the current
> version seems to be PCAP based.
See ISC DHCP, common/bpf.c for bsd's, common/lpf.c for linuxes.
http://www.isc.org/sw/dhcp/
--
Ash bugud-gul durbatuluk agh burzum-ishi krimpatul.
Why settle for the lesser evil? https://secure.isc.org/store/t-shirt/
--
David W. Hankins "If you don't do it right the first time,
Software Engineer you'll just have to do it again."
Internet Systems Consortium, Inc. -- Jack T. Hankins
Attachment:
pgp00000.pgp
Description: PGP signature