PageRenderTime 27ms CodeModel.GetById 20ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/unmaintained/sniffer/channels/bsd/bsd.factor

http://github.com/abeaumont/factor
Unknown | 16 lines | 14 code | 2 blank | 0 comment | 0 complexity | 247ec8f6f4dfa2043228160403b819a2 MD5 | raw file
 1! Copyright (C) 2007 Chris Double. All Rights Reserved.
 2! See http://factorcode.org/license.txt for BSD license.
 3!
 4! Wrap a sniffer in a channel
 5USING: kernel channels channels.sniffer.backend
 6threads io io.sniffer.backend io.sniffer.bsd
 7io.unix.backend ;
 8IN: channels.sniffer.bsd
 9
10M: unix-io sniff-channel ( -- channel ) 
11  "/dev/bpf0" "en1" <sniffer-spec> <sniffer> <channel> [
12    [
13      (sniff-channel) 
14    ] 3curry spawn drop
15  ] keep ;
16