Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man4 Convert to use mdoc macros more. The perviou...



details:   https://anonhg.NetBSD.org/src/rev/7e8b8555388d
branches:  trunk
changeset: 486640:7e8b8555388d
user:      enami <enami%NetBSD.org@localhost>
date:      Sat May 27 02:23:19 2000 +0000

description:
Convert to use mdoc macros more.  The pervious commit, which partially
converted to mdoc, just results malformed output.

diffstat:

 share/man/man4/bpf.4 |  746 ++++++++++++++++++++++----------------------------
 1 files changed, 335 insertions(+), 411 deletions(-)

diffs (truncated from 1035 to 300 lines):

diff -r 49228fa017fd -r 7e8b8555388d share/man/man4/bpf.4
--- a/share/man/man4/bpf.4      Sat May 27 02:19:34 2000 +0000
+++ b/share/man/man4/bpf.4      Sat May 27 02:23:19 2000 +0000
@@ -1,6 +1,6 @@
 .\" -*- nroff -*-
 .\"
-.\"    $NetBSD: bpf.4,v 1.11 1999/12/15 22:07:30 abs Exp $
+.\"    $NetBSD: bpf.4,v 1.12 2000/05/27 02:23:19 enami Exp $
 .\"
 .\" Copyright (c) 1990, 1991, 1992, 1993, 1994
 .\"    The Regents of the University of California.  All rights reserved.
@@ -24,7 +24,9 @@
 .\" This document is derived in part from the enet man page (enet.4)
 .\" distributed with 4.3BSD Unix.
 .\"
-.TH BPF 4  "28 June 1994"
+.Dd June 28, 1994
+.Dt BPF 4
+.Os
 .Sh NAME
 .Nm bpf
 .Nd Berkeley Packet Filter raw network interface
@@ -36,618 +38,535 @@
 independent fashion.
 All packets on the network, even those destined for other hosts,
 are accessible through this mechanism.
-.PP
+.Pp
 The packet filter appears as a character special device,
-.I /dev/bpf0, /dev/bpf1,
+.Pa /dev/bpf0 ,
+.Pa /dev/bpf1 ,
 etc.
 After opening the device, the file descriptor must be bound to a
-specific network interface with the BIOSETIF ioctl.
+specific network interface with the
+.Dv BIOSETIF
+ioctl.
 A given interface can be shared be multiple listeners, and the filter
 underlying each descriptor will see an identical packet stream.
 The total number of open
 files is limited to the value given in the kernel configuration; the
 example given in the SYNOPSIS above sets the limit to 16.
-.PP
+.Pp
 A separate device file is required for each minor device.
 If a file is in use, the open will fail and
-.I errno
+.Va errno
 will be set to EBUSY.
-.PP
+.Pp
 Associated with each open instance of a
-.I bpf
+.Nm
 file is a user-settable packet filter.
 Whenever a packet is received by an interface,
 all file descriptors listening on that interface apply their filter.
 Each descriptor that accepts the packet receives its own copy.
-.PP
+.Pp
 Reads from these files return the next group of packets
 that have matched the filter.
 To improve performance, the buffer passed to read must be
 the same size as the buffers used internally by
-.I bpf.
-This size is returned by the BIOCGBLEN ioctl (see below), and under
-BSD, can be set with BIOCSBLEN.
+.Nm "" .
+This size is returned by the
+.Dv BIOCGBLEN
+ioctl (see below), and under
+BSD, can be set with
+.Dv BIOCSBLEN .
 Note that an individual packet larger than this size is necessarily
 truncated.
-.PP
+.Pp
 The packet filter will support any link level protocol that has fixed length
 headers.  Currently, only Ethernet, SLIP and PPP drivers have been
 modified to interact with
-.I bpf.
-.PP
+.Nm "" .
+.Pp
 Since packet data is in network byte order, applications should use the
-.I byteorder(3n)
+.Xr byteorder 3
 macros to extract multi-byte values.
-.PP
+.Pp
 A packet can be sent out on the network by writing to a
-.I bpf
+.Nm
 file descriptor.  The writes are unbuffered, meaning only one
 packet can be processed per write.
 Currently, only writes to Ethernets and SLIP links are supported.
 .Sh IOCTLS
 The
-.I ioctl
+.Xr ioctl 2
 command codes below are defined in <net/bpf.h>.  All commands require
 these includes:
-.ft B
-.nf
-
-       #include <sys/types.h>
-       #include <sys/time.h>
-       #include <sys/ioctl.h>
-       #include <net/bpf.h>
-
-.fi
-.ft R
-Additionally, BIOCGETIF and BIOCSETIF require \fB<net/if.h>\fR.
-
+.Bd -literal -offset indent
+.Fd #include <sys/types.h>
+.Fd #include <sys/time.h>
+.Fd #include <sys/ioctl.h>
+.Fd #include <net/bpf.h>
+.Ed
+.Pp
+Additionally, BIOCGETIF and BIOCSETIF require
+.Pa <net/if.h> .
+.Pp
 The (third) argument to the
-.I ioctl
+.Xr ioctl 2
 should be a pointer to the type indicated.
-.TP 10
-.B BIOCGBLEN (u_int)
+.Bl -tag -width -offset indent
+.It Dv "BIOCGBLEN (u_int)"
 Returns the required buffer length for reads on
-.I bpf
+.Nm
 files.
-.TP 10
-.B BIOCSBLEN (u_int)
+.It Dv "BIOCSBLEN (u_int)"
 Sets the buffer length for reads on
-.I bpf
+.Nm
 files.  The buffer must be set before the file is attached to an interface
-with BIOCSETIF.
+with
+.Dv BIOCSETIF .
 If the requested buffer size cannot be accommodated, the closest
 allowable size will be set and returned in the argument.
 A read call will result in EIO if it is passed a buffer that is not this size.
-.TP 10
-.B BIOCGDLT (u_int)
+.It Dv BIOCGDLT (u_int)
 Returns the type of the data link layer underlying the attached interface.
 EINVAL is returned if no interface has been specified.
-The device types, prefixed with ``DLT_'', are defined in <net/bpf.h>.
-.TP 10
-.B BIOCPROMISC
+The device types, prefixed with
+.Dq DLT_ ,
+are defined in <net/bpf.h>.
+.It Dv BIOCPROMISC
 Forces the interface into promiscuous mode.
 All packets, not just those destined for the local host, are processed.
 Since more than one file can be listening on a given interface,
 a listener that opened its interface non-promiscuously may receive
 packets promiscuously.  This problem can be remedied with an
 appropriate filter.
-.IP
+.Pp
 The interface remains in promiscuous mode until all files listening
 promiscuously are closed.
-.TP 10
-.B BIOCFLUSH
+.It Dv BIOCFLUSH
 Flushes the buffer of incoming packets,
-and resets the statistics that are returned by BIOCGSTATS.
-.TP 10
-.B BIOCGETIF (struct ifreq)
+and resets the statistics that are returned by
+.Dv BIOCGSTATS .
+.It Dv BIOCGETIF (struct ifreq)
 Returns the name of the hardware interface that the file is listening on.
 The name is returned in the ifr_name field of
-.I ifr.
+.Fa ifr .
 All other fields are undefined.
-.TP 10
-.B BIOCSETIF (struct ifreq)
+.It Dv BIOCSETIF (struct ifreq)
 Sets the hardware interface associate with the file.  This
 command must be performed before any packets can be read.
 The device is indicated by name using the
-.I ifr_name
+.Dv ifr_name
 field of the
-.I ifreq.
-Additionally, performs the actions of BIOCFLUSH.
-.TP 10
-.B BIOCSRTIMEOUT, BIOCGRTIMEOUT (struct timeval)
+.Fa ifreq .
+Additionally, performs the actions of
+.Dv BIOCFLUSH .
+.It Dv BIOCSRTIMEOUT, BIOCGRTIMEOUT (struct timeval)
 Set or get the read timeout parameter.
 The
-.I timeval
+.Fa timeval
 specifies the length of time to wait before timing
 out on a read request.
 This parameter is initialized to zero by
-.IR open(2),
+.Xr open 2 ,
 indicating no timeout.
-.TP 10
-.B BIOCGSTATS (struct bpf_stat)
+.It Dv BIOCGSTATS (struct bpf_stat)
 Returns the following structure of packet statistics:
-.ft B
-.nf
-
+.Bd -literal -offset indent
 struct bpf_stat {
        u_int bs_recv;
        u_int bs_drop;
 };
-.fi
-.ft R
-.IP
+.Ed
+.Pp
 The fields are:
-.RS
-.TP 15
-.I bs_recv
+.Bl -tag -width bs_recv -offset indent
+.It Va bs_recv
 the number of packets received by the descriptor since opened or reset
 (including any buffered since the last read call);
 and
-.TP
-.I bs_drop
+.It Va bs_drop
 the number of packets which were accepted by the filter but dropped by the
 kernel because of buffer overflows
 (i.e., the application's reads aren't keeping up with the packet traffic).
-.RE
-.TP 10
-.B BIOCIMMEDIATE (u_int)
-Enable or disable ``immediate mode'', based on the truth value of the argument.
+.El
+.It Dv BIOCIMMEDIATE (u_int)
+Enable or disable
+.Dq immediate mode ,
+based on the truth value of the argument.
 When immediate mode is enabled, reads return immediately upon packet
 reception.  Otherwise, a read will block until either the kernel buffer
 becomes full or a timeout occurs.
 This is useful for programs like
-.I rarpd(8c),
+.Xr rarpd 8 ,
 which must respond to messages in real time.
 The default for a new file is off.
-.TP 10
-.B BIOCSETF (struct bpf_program)
+.It Dv BIOCSETF (struct bpf_program)
 Sets the filter program used by the kernel to discard uninteresting
 packets.  An array of instructions and its length is passed in using
 the following structure:
-.ft B
-.nf
-
+.Bd -literal -offset indent
 struct bpf_program {
        int bf_len;
        struct bpf_insn *bf_insns;
 };
-.fi
-.ft R
-.IP
+.Ed
+.Pp
 The filter program is pointed to by the
-.I bf_insns
-field while its length in units of `struct bpf_insn' is given by the
-.I bf_len
+.Va bf_insns
+field while its length in units of
+.Sq struct bpf_insn
+is given by the
+.Va bf_len
 field.
-Also, the actions of BIOCFLUSH are performed.
-.IP
-See section \fBFILTER MACHINE\fP for an explanation of the filter language.
-.TP 10
-.B BIOCVERSION (struct bpf_version)
+Also, the actions of
+.Dv BIOCFLUSH
+are performed.



Home | Main Index | Thread Index | Old Index