summaryrefslogtreecommitdiffstats
path: root/sys/net/bpfdesc.h
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2007-02-26 22:24:14 +0000
committerjkim <jkim@FreeBSD.org>2007-02-26 22:24:14 +0000
commit2bd7382fdc16aa04088cebb691546535c56c484b (patch)
tree8efb23bc3668968e694845b80771f494e428f138 /sys/net/bpfdesc.h
parentfdcdf27f8008b78cf159fbc5e87092ebded35ab3 (diff)
downloadFreeBSD-src-2bd7382fdc16aa04088cebb691546535c56c484b.zip
FreeBSD-src-2bd7382fdc16aa04088cebb691546535c56c484b.tar.gz
Add three new ioctl(2) commands for bpf(4).
- BIOCGDIRECTION and BIOCSDIRECTION get or set the setting determining whether incoming, outgoing, or all packets on the interface should be returned by BPF. Set to BPF_D_IN to see only incoming packets on the interface. Set to BPF_D_INOUT to see packets originating locally and remotely on the interface. Set to BPF_D_OUT to see only outgoing packets on the interface. This setting is initialized to BPF_D_INOUT by default. BIOCGSEESENT and BIOCSSEESENT are obsoleted by these but kept for backward compatibility. - BIOCFEEDBACK sets packet feedback mode. This allows injected packets to be fed back as input to the interface when output via the interface is successful. When BPF_D_INOUT direction is set, injected outgoing packet is not returned by BPF to avoid duplication. This flag is initialized to zero by default. Note that libpcap has been modified to support BPF_D_OUT direction for pcap_setdirection(3) and PCAP_D_OUT direction is functional now. Reviewed by: rwatson
Diffstat (limited to 'sys/net/bpfdesc.h')
-rw-r--r--sys/net/bpfdesc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h
index 0edcaf6..7db0e12 100644
--- a/sys/net/bpfdesc.h
+++ b/sys/net/bpfdesc.h
@@ -81,7 +81,8 @@ struct bpf_d {
u_char bd_state; /* idle, waiting, or timed out */
u_char bd_immediate; /* true to return on packet arrival */
int bd_hdrcmplt; /* false to fill in src lladdr automatically */
- int bd_seesent; /* true if bpf should see sent packets */
+ int bd_direction; /* select packet direction */
+ int bd_feedback; /* true to feed back sent packets */
int bd_async; /* non-zero if packet reception should generate signal */
int bd_sig; /* signal to send upon packet reception */
struct sigio * bd_sigio; /* information for async I/O */
@@ -119,7 +120,8 @@ struct xbpf_d {
u_char bd_promisc;
u_char bd_immediate;
int bd_hdrcmplt;
- int bd_seesent;
+ int bd_direction;
+ int bd_feedback;
int bd_async;
u_long bd_rcount;
u_long bd_dcount;
OpenPOWER on IntegriCloud