Source-Changes-HG archive

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

[src/trunk]: src mdoc'ify pcap.3



details:   https://anonhg.NetBSD.org/src/rev/0eae622f19f4
branches:  trunk
changeset: 515728:0eae622f19f4
user:      gmcgarry <gmcgarry%NetBSD.org@localhost>
date:      Wed Oct 03 20:58:31 2001 +0000

description:
mdoc'ify pcap.3

diffstat:

 lib/libpcap/pcap.3  |  475 +++++++++++++++++++++++++--------------------------
 share/tmac/doc-syms |    3 +-
 2 files changed, 239 insertions(+), 239 deletions(-)

diffs (truncated from 603 to 300 lines):

diff -r 75064645544f -r 0eae622f19f4 lib/libpcap/pcap.3
--- a/lib/libpcap/pcap.3        Wed Oct 03 20:48:41 2001 +0000
+++ b/lib/libpcap/pcap.3        Wed Oct 03 20:58:31 2001 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pcap.3,v 1.8 2000/10/06 16:39:24 thorpej Exp $
+.\" $NetBSD: pcap.3,v 1.9 2001/10/03 20:58:31 gmcgarry Exp $
 .\"
 .\" Copyright (c) 1994, 1996, 1997
 .\"    The Regents of the University of California.  All rights reserved.
@@ -19,340 +19,339 @@
 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 .\"
-.TH PCAP 3  "24 June 1998"
-.SH NAME
-pcap \- Packet Capture library
-.SH SYNOPSIS
-.nf
-.ft B
-#include <pcap.h>
-.ft
-.LP
-.ft B
-pcap_t *pcap_open_live(char *device, int snaplen,
-.ti +8
-int promisc, int to_ms, char *ebuf)
-pcap_t *pcap_open_offline(char *fname, char *ebuf)
-pcap_dumper_t *pcap_dump_open(pcap_t *p, char *fname)
-.ft
-.LP
-.ft B
-char errbuf[PCAP_ERRBUF_SIZE];
-char *pcap_lookupdev(char *errbuf)
-int pcap_lookupnet(char *device, bpf_u_int32 *netp,
-.ti +8
-bpf_u_int32 *maskp, char *errbuf)
-.ft
-.LP
-.ft B
-int pcap_dispatch(pcap_t *p, int cnt,
-.ti +8
-pcap_handler callback, u_char *user)
-int pcap_loop(pcap_t *p, int cnt,
-.ti +8
-pcap_handler callback, u_char *user)
-void pcap_dump(u_char *user, struct pcap_pkthdr *h,
-.ti +8
-u_char *sp)
-.ft
-.LP
-.ft B
-int pcap_compile(pcap_t *p, struct bpf_program *fp,
-.ti +8
-char *str, int optimize, bpf_u_int32 netmask)
-int pcap_compile_nopcap(int snaplen, int linktype,
-.ti +8
-struct bpf_program *fp, char *str, int optimize,
-.ti +8
-bpf_uint32 netmask, char *errbuf)
-int pcap_setfilter(pcap_t *p, struct bpf_program *fp)
-.ft
-.LP
-.ft B
-u_char *pcap_next(pcap_t *p, struct pcap_pkthdr *h)
-.ft
-.LP
-.ft B
-int pcap_datalink(pcap_t *p)
-int pcap_snapshot(pcap_t *p)
-int pcap_is_swapped(pcap_t *p)
-int pcap_major_version(pcap_t *p)
-int pcap_minor_version(pcap_t *p)
-int pcap_stats(pcap_t *p, struct pcap_stat *ps)
-FILE *pcap_file(pcap_t *p)
-int pcap_fileno(pcap_t *p)
-void pcap_perror(pcap_t *p, char *prefix)
-char *pcap_geterr(pcap_t *p)
-char *pcap_strerror(int error)
-.ft
-.LP
-.ft B
-void pcap_close(pcap_t *p)
-void pcap_dump_close(pcap_dumper_t *p)
-.ft
-.fi
-.SH DESCRIPTION
-The Packet Capture library
-provides a high level interface to packet capture systems. All packets
-on the network, even those destined for other hosts, are accessible
-through this mechanism.
-.PP
-.SH ROUTINES
-.B pcap_open_live()
-is used to obtain a packet capture descriptor to look
-at packets on the network.
-.I device
+.Dd June 24, 1998
+.Os
+.Dt PCAP 3
+.Sh NAME
+.Nm pcap
+.Nd packet capture library
+.Sh LIBRARY
+.Lb libpcap
+.Sh SYNOPSIS
+.Fd #include <pcap.h>
+.Ft pcap_t *
+.Fn pcap_open_live "char *device" "int snaplen" "int promisc" \
+"int to_ms" "char *ebuf"
+.Ft pcap_t *
+.Fn pcap_open_offline "char *fname" "char *ebuf"
+.Ft pcap_dumper_t *
+.Fn pcap_dump_open "pcap_t *p" "char *fname"
+.Ft char
+errbuf[PCAP_ERRBUF_SIZE];
+.Ft char *
+.Fn pcap_lookupdev "char *errbuf"
+.Ft int
+.Fn pcap_lookupnet "char *device" "bpf_u_int32 *netp" \
+bpf_u_int32 *maskp" "char *errbuf"
+.Ft int
+.Fn pcap_dispatch "pcap_t *p" "int cnt" \
+"pcap_handler callback" "u_char *user"
+.Ft int
+.Fn pcap_loop "pcap_t *p" "int cnt" \
+"pcap_handler callback" "u_char *user"
+.Ft void
+.Fn pcap_dump "u_char *user" "struct pcap_pkthdr *h" \
+"u_char *sp"
+.Ft int
+.Fn pcap_compile "pcap_t *p" "struct bpf_program *fp" \
+"char *str" "int optimize" "bpf_u_int32 netmask"
+.Ft int
+.Fn pcap_compile_nopcap "int snaplen" "int linktype" \
+"struct bpf_program *fp" "char *str" "int optimize" \
+"bpf_uint32 netmask" "char *errbuf"
+.Ft int
+.Fn pcap_setfilter "pcap_t *p" "struct bpf_program *fp"
+.Ft u_char *
+.Fn pcap_next "pcap_t *p" "struct pcap_pkthdr *h"
+.Ft int
+.Fn pcap_datalink "pcap_t *p"
+.Ft int
+.Fn pcap_snapshot "pcap_t *p"
+.Ft int
+.Fn pcap_is_swapped "pcap_t *p"
+.Ft int
+.Fn pcap_major_version "pcap_t *p"
+.Ft int
+.Fn pcap_minor_version "pcap_t *p"
+.Ft int
+.Fn pcap_stats "pcap_t *p" "struct pcap_stat *ps"
+.Ft FILE *
+.Fn pcap_file "pcap_t *p"
+.Ft int
+.Fn pcap_fileno "pcap_t *p"
+.Ft void
+.Fn pcap_perror "pcap_t *p" "char *prefix"
+.Ft char *
+.Fn pcap_geterr "pcap_t *p"
+.Ft char *
+.Fn pcap_strerror "int error"
+.Ft void
+.Fn pcap_close "pcap_t *p"
+.Ft void
+.Fn pcap_dump_close "pcap_dumper_t *p"
+.Sh DESCRIPTION
+The
+.Nm
+library provides a high level interface to packet capture systems.
+All packets on the network, even those destined for other hosts, are
+accessible through this mechanism.
+.Pp
+.Sh ROUTINES
+.Fn pcap_open_live
+is used to obtain a packet capture descriptor to look at packets on
+the network.
+.Fa device
 is a string that specifies the network device to open.
-.I snaplen
+.Fa snaplen
 specifies the maximum number of bytes to capture.
-.I promisc
-specifies if the interface is to be put into promiscuous mode.
-(Note that even if this parameter is false, the interface
-could well be in promiscuous mode for some other reason.)
-.I to_ms
+.Fa promisc
+specifies if the interface is to be put into promiscuous mode.  (Note
+that even if this parameter is false, the interface could well be in
+promiscuous mode for some other reason.)
+.Fa to_ms
 specifies the read timeout in milliseconds.
-.I ebuf
+.Fa ebuf
 is used to return error text and is only set when
-.B pcap_open_live()
+.Fn pcap_open_live
 fails and returns
-.BR NULL .
-.PP
-.B pcap_open_offline()
+.Em NULL .
+.Pp
+.Fn pcap_open_offline
 is called to open a ``savefile'' for reading.
-.I fname
-specifies the name of the file to open. The file has
+.Fa fname
+specifies the name of the file to open.  The file has
 the same format as those used by
-.B tcpdump(8) .
+.Xr tcpdump 8 .
 The name "-" in a synonym for
-.BR stdin .
-.I ebuf
+.Em stdin .
+.Fa ebuf
 is used to return error text and is only set when
-.B pcap_open_offline()
+.Fn pcap_open_offline
 fails and returns
-.BR NULL .
-.PP
-.B pcap_dump_open()
-is called to open a ``savefile'' for writing. The name "-" in a synonym
+.Em NULL .
+.Pp
+.Fn pcap_dump_open
+is called to open a ``savefile'' for writing.  The name "-" in a synonym
 for
-.BR stdout .
-.B NULL
+.Em stdout .
+.Em NULL
 is returned on failure.
-.I p
+.Fa p
 is a
-.I pcap
+.Fa pcap
 struct as returned by
-.B pcap_open_offline()
+.Fn pcap_open_offline
 or
-.BR pcap_open_live() .
-.I fname
+.Fn pcap_open_live .
+.Fa fname
 specifies the name of the file to open.
 If
-.B NULL
+.Em NULL
 is returned,
-.B pcap_geterr()
+.Fn pcap_geterr
 can be used to get the error text.
-.PP
-.B pcap_lookupdev()
+.Pp
+.Fn pcap_lookupdev
 returns a pointer to a network device suitable for use with
-.B pcap_open_live()
+.Fn pcap_open_live
 and
-.BR pcap_lookupnet() .
+.Fn pcap_lookupnet .
 If there is an error,
-.B NULL
+.Em NULL
 is returned and
-.I errbuf
+.Fa errbuf
 is filled in with with an appropriate error message.
-.PP
-.B pcap_lookupnet()
+.Pp
+.Fn pcap_lookupnet
 is used to determine the network number and mask
 associated with the network device
-.BR device .
+.Em device .
 Both
-.I netp
+.Fa netp
 and
-.I maskp
+.Fa maskp
 are
-.I bpf_u_int32
+.Fa bpf_u_int32
 pointers.
 A return of -1 indicates an error in which case
-.I errbuf
+.Fa errbuf
 is filled in with with an appropriate error message.
-.PP
-.B pcap_dispatch()
+.Pp
+.Fn pcap_dispatch



Home | Main Index | Thread Index | Old Index