| @@ -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 |
36 | The Berkeley Packet Filter | | 36 | The Berkeley Packet Filter |
37 | provides a raw interface to data link layers in a protocol | | 37 | provides a raw interface to data link layers in a protocol |
38 | independent fashion. | | 38 | independent fashion. |
39 | All packets on the network, even those destined for other hosts, | | 39 | All packets on the network, even those destined for other hosts, |
40 | are accessible through this mechanism. | | 40 | are 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 |
288 | or haphazard packet matching). | | 288 | or haphazard packet matching). |
289 | .It Dv BIOCGHDRCMPLT BIOCSHDRCMPLT (u_int) | | 289 | .It Dv BIOCGHDRCMPLT BIOCSHDRCMPLT (u_int) |
290 | Enable/disable or get the | | 290 | Enable/disable or get the |
291 | .Dq header complete | | 291 | .Dq header complete |
292 | flag status. | | 292 | flag status. |
293 | If enabled, packets written to the bpf file descriptor will not have | | 293 | If enabled, packets written to the bpf file descriptor will not have |
294 | network layer headers rewritten in the interface output routine. | | 294 | network layer headers rewritten in the interface output routine. |
295 | By default, the flag is disabled (value is 0). | | 295 | By default, the flag is disabled (value is 0). |
296 | .It Dv BIOCGSEESENT BIOCSSEESENT (u_int) | | 296 | .It Dv BIOCGSEESENT BIOCSSEESENT (u_int) |
297 | Enable/disable or get the | | 297 | Enable/disable or get the |
298 | .Dq see sent | | 298 | .Dq see sent |
299 | flag status. | | 299 | flag status. |
300 | If enabled, packets sent will be passed to the filter. | | 300 | If enabled, packets sent by the host (not from |
| | | 301 | .Nm ) |
| | | 302 | will be passed to the filter. |
301 | By default, the flag is enabled (value is 1). | | 303 | By default, the flag is enabled (value is 1). |
| | | 304 | .It Dv BIOCFEEDBACK BIOCSFEEDBACK BIOCGFEEDBACK (u_int) |
| | | 305 | Set (or get) |
| | | 306 | .Dq packet feedback mode . |
| | | 307 | This allows injected packets to be fed back as input to the interface when |
| | | 308 | output via the interface is successful. |
| | | 309 | The first name is meant for FreeBSD compatibility, the two others follow |
| | | 310 | the Get/Set convention. |
| | | 311 | .\"When |
| | | 312 | .\".Dv BPF_D_INOUT |
| | | 313 | .\"direction is set, injected |
| | | 314 | Injected |
| | | 315 | outgoing packets are not returned by BPF to avoid |
| | | 316 | duplication. This flag is initialized to zero by default. |
302 | .El | | 317 | .El |
303 | .Sh STANDARD IOCTLS | | 318 | .Sh STANDARD IOCTLS |
304 | .Nm | | 319 | .Nm |
305 | now supports several standard | | 320 | now supports several standard |
306 | .Xr ioctl 2 Ns 's | | 321 | .Xr ioctl 2 Ns 's |
307 | which allow the user to do async and/or non-blocking I/O to an open | | 322 | which allow the user to do async and/or non-blocking I/O to an open |
308 | .Nm bpf | | 323 | .Nm bpf |
309 | file descriptor. | | 324 | file 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) |
312 | Returns the number of bytes that are immediately available for reading. | | 327 | Returns the number of bytes that are immediately available for reading. |
313 | .It Dv SIOCGIFADDR (struct ifreq) | | 328 | .It Dv SIOCGIFADDR (struct ifreq) |
314 | Returns the address associated with the interface. | | 329 | Returns the address associated with the interface. |