Date: Mon, 8 Sep 2003 10:04:54 +0300 From: Peter Pentchev <roam@ringlet.net> To: Lev Walkin <vlm@netli.com> Cc: Dmitry Morozovsky <marck@rinet.ru> Subject: Re: if bpf fd's select()able? Message-ID: <20030908070453.GO556@straylight.oblivion.bg> In-Reply-To: <3F5BB991.2050601@netli.com> References: <20030907233940.M18589@woozle.rinet.ru> <3F5BB991.2050601@netli.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Sun, Sep 07, 2003 at 04:04:49PM -0700, Lev Walkin wrote: > Dmitry Morozovsky wrote: > >Dear colleagues, > > > >[all below is for 4-STABLE] > > > >I'm trying to write effective arp scanner for multi-interface router (esp. > >multi-vlan); I plan to use multiple bpf devices attached to different > >interfaces emitting ARP requests and filters listening to ARP replies; the > >most > >natural way to multiplex them for me is select(). > > > >However, my tests show that select()ing bpf fd does not lead to trigger > >packets > >available to bpf filter; the process hangs in select state while parallel > >tcpdump process shows packets desired *and* is in bpf state. > > > >Am I missing something "base"? References (surely, I'd already read > >manpages for bpf, pcap and related -- but did I still missed something > >serious?) would be greatly appreciated. > > Yes, you're missing the interactive mode. > > Refer to BIOCIMMEDIATE in the bpf(4) manual page. Also, I believe that for a month or so bpf devices have been able to issue kqueue notifications, too, so - at least for FreeBSD - the "most natural" way might now be kqueue() and not select() :) G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If wishes were fishes, the antecedent of this conditional would be true. [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/XCoV7Ri2jRYZRVMRAijiAJ9MfH/4jtyV9ygSVLWitgAd/Rj8GwCfTc37 G4nrkpJXcPV9XgS69R7dIxo= =iPjd -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030908070453.GO556>
