-.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.28 2001-12-09 05:10:02 guy Exp $
+.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.29 2001-12-09 08:58:28 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
.ft
.LP
.ft B
+int pcap_setnonblock(pcap_t *, int nonblock, char *errbuf);
+int pcap_getnonblock(pcap_t *p, char *errbuf);
+.ft
+.LP
+.ft B
int pcap_findalldevs(pcap_if_t **alldevsp, char *errbuf)
void pcap_freealldevs(pcap_if_t *)
char *pcap_lookupdev(char *errbuf)
.ft
.LP
.ft B
-int pcap_setnonblock(pcap_t *, int nonblock, char *errbuf);
-int pcap_getnonblock(pcap_t *p, char *errbuf);
-.ft
-.LP
-.ft B
int pcap_datalink(pcap_t *p)
int pcap_snapshot(pcap_t *p)
int pcap_is_swapped(pcap_t *p)
NOTE:
.I errbuf
in
-.B pcap_open_live(),
-.B pcap_open_dead(),
-.B pcap_open_offline(),
-.B pcap_findalldevs(),
-.B pcap_lookupdev(),
+.BR pcap_open_live() ,
+.BR pcap_open_dead() ,
+.BR pcap_open_offline() ,
+.BR pcap_setnonblock() ,
+.BR pcap_getnonblock() ,
+.BR pcap_findalldevs() ,
+.BR pcap_lookupdev() ,
and
.B pcap_lookupnet()
is assumed to be able to hold at least
.B pcap_geterr()
can be used to get the error text.
.PP
+.B pcap_setnonblock()
+puts a capture descriptor, opened with
+.BR pcap_open_live() ,
+into ``non-blocking'' mode, or takes it out of ``non-blocking'' mode,
+depending on whether the
+.I nonblock
+argument is non-zero or zero. It has no effect on ``savefiles''.
+If there is an error, \-1 is returned and
+.I errbuf
+is filled in with an appropriate error message.
+In
+``non-blocking'' mode, an attempt to read from the capture descriptor
+with
+.B pcap_dispatch()
+will, if no packets are currently available to be read, return 0
+immediately rather than blocking waiting for packets to arrive.
+.B pcap_loop()
+and
+.B pcap_next()
+will not work in ``non-blocking'' mode.
+.PP
+.B pcap_getnonblock()
+returns the current ``non-blocking'' state of the capture descriptor; it
+always returns 0 on ``savefiles''.
+If there is an error, \-1 is returned and
+.I errbuf
+is filled in with an appropriate error message.
+.PP
.B pcap_findalldevs()
constructs a list of network devices that can be opened with
.BR pcap_open_live() .
has been made the filter program for a pcap structure by a call to
.BR pcap_setfilter() .
.PP
-.B pcap_setnonblock()
-puts a capture descriptor, opened with
-.BR pcap_open_live() ,
-into ``non-blocking'' mode, or takes it out of ``non-blocking'' mode,
-depending on whether the
-.I nonblock
-argument is non-zero or zero. It has no effect on ``savefiles''.
-If there is an error, \-1 is returned and
-.I errbuf
-is filled in with an appropriate error message.
-In
-``non-blocking'' mode, an attempt to read from the capture descriptor
-with
-.B pcap_dispatch()
-will, if no packets are currently available to be read, return 0
-immediately rather than blocking waiting for packets to arrive.
-.B pcap_loop()
-and
-.B pcap_next()
-will not work in ``non-blocking'' mode.
-.PP
-.B pcap_getnonblock()
-returns the current ``non-blocking'' state of the capture descriptor; it
-always returns 0 on ``savefiles''.
-If there is an error, \-1 is returned and
-.I errbuf
-is filled in with an appropriate error message.
-.PP
.B pcap_datalink()
returns the link layer type; link layer types it can return include:
.PP