Sat Mar 13 20:39:54 2010 UTC ()
Document BIOC{G,S}FEEDBACK; I forgot who sent me the patch, so whoever created
it, thanks!


(christos)
diff -r1.42 -r1.43 src/share/man/man4/bpf.4

cvs diff -r1.42 -r1.43 src/share/man/man4/bpf.4 (expand / switch to unified diff)

--- src/share/man/man4/bpf.4 2010/01/16 18:47:50 1.42
+++ src/share/man/man4/bpf.4 2010/03/13 20:39:54 1.43
@@ -1,40 +1,40 @@ @@ -1,40 +1,40 @@
1.\" -*- nroff -*- 1.\" -*- nroff -*-
2.\" 2.\"
3.\" $NetBSD: bpf.4,v 1.42 2010/01/16 18:47:50 pooka Exp $ 3.\" $NetBSD: bpf.4,v 1.43 2010/03/13 20:39:54 christos Exp $
4.\" 4.\"
5.\" Copyright (c) 1990, 1991, 1992, 1993, 1994 5.\" Copyright (c) 1990, 1991, 1992, 1993, 1994
6.\" The Regents of the University of California. All rights reserved. 6.\" The Regents of the University of California. All rights reserved.
7.\" 7.\"
8.\" Redistribution and use in source and binary forms, with or without 8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that: (1) source code distributions 9.\" modification, are permitted provided that: (1) source code distributions
10.\" retain the above copyright notice and this paragraph in its entirety, (2) 10.\" retain the above copyright notice and this paragraph in its entirety, (2)
11.\" distributions including binary code include the above copyright notice and 11.\" distributions including binary code include the above copyright notice and
12.\" this paragraph in its entirety in the documentation or other materials 12.\" this paragraph in its entirety in the documentation or other materials
13.\" provided with the distribution, and (3) all advertising materials mentioning 13.\" provided with the distribution, and (3) all advertising materials mentioning
14.\" features or use of this software display the following acknowledgement: 14.\" features or use of this software display the following acknowledgement:
15.\" ``This product includes software developed by the University of California, 15.\" ``This product includes software developed by the University of California,
16.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of 16.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
17.\" the University nor the names of its contributors may be used to endorse 17.\" the University nor the names of its contributors may be used to endorse
18.\" or promote products derived from this software without specific prior 18.\" or promote products derived from this software without specific prior
19.\" written permission. 19.\" written permission.
20.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 20.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
21.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 21.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
22.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 22.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23.\" 23.\"
24.\" This document is derived in part from the enet man page (enet.4) 24.\" This document is derived in part from the enet man page (enet.4)
25.\" distributed with 4.3BSD Unix. 25.\" distributed with 4.3BSD Unix.
26.\" 26.\"
27.Dd January 16, 2010 27.Dd March 13, 2010
28.Dt BPF 4 28.Dt BPF 4
29.Os 29.Os
30.Sh NAME 30.Sh NAME
31.Nm bpf 31.Nm bpf
32.Nd Berkeley Packet Filter raw network interface 32.Nd Berkeley Packet Filter raw network interface
33.Sh SYNOPSIS 33.Sh SYNOPSIS
34.Cd "pseudo-device bpfilter" 34.Cd "pseudo-device bpfilter"
35.Sh DESCRIPTION 35.Sh DESCRIPTION
36The Berkeley Packet Filter 36The Berkeley Packet Filter
37provides a raw interface to data link layers in a protocol 37provides a raw interface to data link layers in a protocol
38independent fashion. 38independent fashion.
39All packets on the network, even those destined for other hosts, 39All packets on the network, even those destined for other hosts,
40are accessible through this mechanism. 40are accessible through this mechanism.
@@ -287,28 +287,43 @@ may result in undefined behavior (most l @@ -287,28 +287,43 @@ may result in undefined behavior (most l
287.Xr ioctl 2 287.Xr ioctl 2
288or haphazard packet matching). 288or haphazard packet matching).
289.It Dv BIOCGHDRCMPLT BIOCSHDRCMPLT (u_int) 289.It Dv BIOCGHDRCMPLT BIOCSHDRCMPLT (u_int)
290Enable/disable or get the 290Enable/disable or get the
291.Dq header complete 291.Dq header complete
292flag status. 292flag status.
293If enabled, packets written to the bpf file descriptor will not have 293If enabled, packets written to the bpf file descriptor will not have
294network layer headers rewritten in the interface output routine. 294network layer headers rewritten in the interface output routine.
295By default, the flag is disabled (value is 0). 295By default, the flag is disabled (value is 0).
296.It Dv BIOCGSEESENT BIOCSSEESENT (u_int) 296.It Dv BIOCGSEESENT BIOCSSEESENT (u_int)
297Enable/disable or get the 297Enable/disable or get the
298.Dq see sent 298.Dq see sent
299flag status. 299flag status.
300If enabled, packets sent will be passed to the filter. 300If enabled, packets sent by the host (not from
 301.Nm )
 302will be passed to the filter.
301By default, the flag is enabled (value is 1). 303By default, the flag is enabled (value is 1).
 304.It Dv BIOCFEEDBACK BIOCSFEEDBACK BIOCGFEEDBACK (u_int)
 305Set (or get)
 306.Dq packet feedback mode .
 307This allows injected packets to be fed back as input to the interface when
 308output via the interface is successful.
 309The first name is meant for FreeBSD compatibility, the two others follow
 310the Get/Set convention.
 311.\"When
 312.\".Dv BPF_D_INOUT
 313.\"direction is set, injected
 314Injected
 315outgoing packets are not returned by BPF to avoid
 316duplication. This flag is initialized to zero by default.
302.El 317.El
303.Sh STANDARD IOCTLS 318.Sh STANDARD IOCTLS
304.Nm 319.Nm
305now supports several standard 320now supports several standard
306.Xr ioctl 2 Ns 's 321.Xr ioctl 2 Ns 's
307which allow the user to do async and/or non-blocking I/O to an open 322which allow the user to do async and/or non-blocking I/O to an open
308.Nm bpf 323.Nm bpf
309file descriptor. 324file descriptor.
310.Bl -tag -width indent -offset indent 325.Bl -tag -width indent -offset indent
311.It Dv FIONREAD (int) 326.It Dv FIONREAD (int)
312Returns the number of bytes that are immediately available for reading. 327Returns the number of bytes that are immediately available for reading.
313.It Dv SIOCGIFADDR (struct ifreq) 328.It Dv SIOCGIFADDR (struct ifreq)
314Returns the address associated with the interface. 329Returns the address associated with the interface.