Blame pcap.3pcap.in

Packit 209cc3
.\" Copyright (c) 1994, 1996, 1997
Packit 209cc3
.\"	The Regents of the University of California.  All rights reserved.
Packit 209cc3
.\"
Packit 209cc3
.\" Redistribution and use in source and binary forms, with or without
Packit 209cc3
.\" modification, are permitted provided that: (1) source code distributions
Packit 209cc3
.\" retain the above copyright notice and this paragraph in its entirety, (2)
Packit 209cc3
.\" distributions including binary code include the above copyright notice and
Packit 209cc3
.\" this paragraph in its entirety in the documentation or other materials
Packit 209cc3
.\" provided with the distribution, and (3) all advertising materials mentioning
Packit 209cc3
.\" features or use of this software display the following acknowledgement:
Packit 209cc3
.\" ``This product includes software developed by the University of California,
Packit 209cc3
.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
Packit 209cc3
.\" the University nor the names of its contributors may be used to endorse
Packit 209cc3
.\" or promote products derived from this software without specific prior
Packit 209cc3
.\" written permission.
Packit 209cc3
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
Packit 209cc3
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
Packit 209cc3
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Packit 209cc3
.\"
Packit 209cc3
.TH PCAP 3PCAP "25 July 2018"
Packit 209cc3
.SH NAME
Packit 209cc3
pcap \- Packet Capture library
Packit 209cc3
.SH SYNOPSIS
Packit 209cc3
.nf
Packit 209cc3
.ft B
Packit 209cc3
#include <pcap/pcap.h>
Packit 209cc3
.LP
Packit 209cc3
.ft B
Packit 209cc3
.ft
Packit 209cc3
.fi
Packit 209cc3
.SH DESCRIPTION
Packit 209cc3
The Packet Capture library
Packit 209cc3
provides a high level interface to packet capture systems. All packets
Packit 209cc3
on the network, even those destined for other hosts, are accessible
Packit 209cc3
through this mechanism.
Packit 209cc3
It also supports saving captured packets to a ``savefile'', and reading
Packit 209cc3
packets from a ``savefile''.
Packit 209cc3
.SS Opening a capture handle for reading
Packit 209cc3
To open a handle for a live capture, given the name of the network or
Packit 209cc3
other interface on which the capture should be done, call
Packit 209cc3
.BR pcap_create (),
Packit 209cc3
set the appropriate options on the handle, and then activate it with
Packit 209cc3
.BR pcap_activate ().
Packit 209cc3
.PP
Packit 209cc3
To obtain a list of devices that can be opened for a live capture, call
Packit 209cc3
.BR pcap_findalldevs ();
Packit 209cc3
to free the list returned by
Packit 209cc3
.BR pcap_findalldevs (),
Packit 209cc3
call
Packit 209cc3
.BR pcap_freealldevs ().
Packit 209cc3
.BR pcap_lookupdev ()
Packit 209cc3
will return the first device on that list that is not a ``loopback``
Packit 209cc3
network interface.
Packit 209cc3
.PP
Packit 209cc3
To open a handle for a ``savefile'' from which to read packets, given the
Packit 209cc3
pathname of the ``savefile'', call
Packit 209cc3
.BR pcap_open_offline ();
Packit 209cc3
to set up a handle for a ``savefile'', given a
Packit 209cc3
.B "FILE\ *"
Packit 209cc3
referring to a file already opened for reading, call
Packit 209cc3
.BR pcap_fopen_offline ().
Packit 209cc3
.PP
Packit 209cc3
In order to get a ``fake''
Packit 209cc3
.B pcap_t
Packit 209cc3
for use in routines that require a
Packit 209cc3
.B pcap_t
Packit 209cc3
as an argument, such as routines to open a ``savefile'' for writing and
Packit 209cc3
to compile a filter expression, call
Packit 209cc3
.BR pcap_open_dead ().
Packit 209cc3
.PP
Packit 209cc3
.BR pcap_create (),
Packit 209cc3
.BR pcap_open_offline (),
Packit 209cc3
.BR pcap_fopen_offline (),
Packit 209cc3
and
Packit 209cc3
.BR pcap_open_dead ()
Packit 209cc3
return a pointer to a
Packit 209cc3
.BR pcap_t ,
Packit 209cc3
which is the handle used for reading packets from the capture stream or
Packit 209cc3
the ``savefile'', and for finding out information about the capture
Packit 209cc3
stream or ``savefile''.
Packit 209cc3
To close a handle, use
Packit 209cc3
.BR pcap_close ().
Packit 209cc3
.PP
Packit 209cc3
The options that can be set on a capture handle include
Packit 209cc3
.IP "snapshot length"
Packit 209cc3
If, when capturing, you capture the entire contents of the packet, that
Packit 209cc3
requires more CPU time to copy the packet to your application, more disk
Packit 209cc3
and possibly network bandwidth to write the packet data to a file, and
Packit 209cc3
more disk space to save the packet.  If you don't need the entire
Packit 209cc3
contents of the packet - for example, if you are only interested in the
Packit 209cc3
TCP headers of packets - you can set the "snapshot length" for the
Packit 209cc3
capture to an appropriate value.  If the snapshot length is set to
Packit 209cc3
.IR snaplen ,
Packit 209cc3
and
Packit 209cc3
.I snaplen
Packit 209cc3
is less
Packit 209cc3
than the size of a packet that is captured, only the first
Packit 209cc3
.I snaplen
Packit 209cc3
bytes of that packet will be captured and provided as packet data.
Packit 209cc3
.IP
Packit 209cc3
A snapshot length of 65535 should be sufficient, on most if not all
Packit 209cc3
networks, to capture all the data available from the packet.
Packit 209cc3
.IP
Packit 209cc3
The snapshot length is set with
Packit 209cc3
.BR pcap_set_snaplen ().
Packit 209cc3
.IP "promiscuous mode"
Packit 209cc3
On broadcast LANs such as Ethernet, if the network isn't switched, or if
Packit 209cc3
the adapter is connected to a "mirror port" on a switch to which all
Packit 209cc3
packets passing through the switch are sent, a network adapter receives
Packit 209cc3
all packets on the LAN, including unicast or multicast packets not sent
Packit 209cc3
to a network address that the network adapter isn't configured to
Packit 209cc3
recognize.
Packit 209cc3
.IP
Packit 209cc3
Normally, the adapter will discard those packets; however, many network
Packit 209cc3
adapters support "promiscuous mode", which is a mode in which all
Packit 209cc3
packets, even if they are not sent to an address that the adapter
Packit 209cc3
recognizes, are provided to the host.  This is useful for passively
Packit 209cc3
capturing traffic between two or more other hosts for analysis.
Packit 209cc3
.IP
Packit 209cc3
Note that even if an application does not set promiscuous mode, the
Packit 209cc3
adapter could well be in promiscuous mode for some other reason.
Packit 209cc3
.IP
Packit 209cc3
For now, this doesn't work on the "any" device; if an argument of "any"
Packit 209cc3
or NULL is supplied, the setting of promiscuous mode is ignored.
Packit 209cc3
.IP
Packit 209cc3
Promiscuous mode is set with
Packit 209cc3
.BR pcap_set_promisc ().
Packit 209cc3
.IP "monitor mode"
Packit 209cc3
On IEEE 802.11 wireless LANs, even if an adapter is in promiscuous mode,
Packit 209cc3
it will supply to the host only frames for the network with which it's
Packit 209cc3
associated.  It might also supply only data frames, not management or
Packit 209cc3
control frames, and might not provide the 802.11 header or radio
Packit 209cc3
information pseudo-header for those frames.
Packit 209cc3
.IP
Packit 209cc3
In "monitor mode", sometimes also called "rfmon mode" (for "Radio
Packit 209cc3
Frequency MONitor"), the adapter will supply all frames that it
Packit 209cc3
receives, with 802.11 headers, and might supply a pseudo-header with
Packit 209cc3
radio information about the frame as well.
Packit 209cc3
.IP
Packit 209cc3
Note that in monitor mode the adapter might disassociate from the
Packit 209cc3
network with which it's associated, so that you will not be able to use
Packit 209cc3
any wireless networks with that adapter.  This could prevent accessing
Packit 209cc3
files on a network server, or resolving host names or network addresses,
Packit 209cc3
if you are capturing in monitor mode and are not connected to another
Packit 209cc3
network with another adapter.
Packit 209cc3
.IP
Packit 209cc3
Monitor mode is set with
Packit 209cc3
.BR pcap_set_rfmon (),
Packit 209cc3
and
Packit 209cc3
.BR pcap_can_set_rfmon ()
Packit 209cc3
can be used to determine whether an adapter can be put into monitor
Packit 209cc3
mode.
Packit 209cc3
.IP "packet buffer timeout"
Packit 209cc3
If, when capturing, packets are delivered as soon as they arrive, the
Packit 209cc3
application capturing the packets will be woken up for each packet as it
Packit 209cc3
arrives, and might have to make one or more calls to the operating
Packit 209cc3
system to fetch each packet.
Packit 209cc3
.IP
Packit 209cc3
If, instead, packets are not delivered as soon as they arrive, but are
Packit 209cc3
delivered after a short delay (called a "packet buffer timeout"), more
Packit 209cc3
than one packet can be accumulated before the packets are delivered, so
Packit 209cc3
that a single wakeup would be done for multiple packets, and each set of
Packit 209cc3
calls made to the operating system would supply multiple packets, rather
Packit 209cc3
than a single packet.  This reduces the per-packet CPU overhead if
Packit 209cc3
packets are arriving at a high rate, increasing the number of packets
Packit 209cc3
per second that can be captured.
Packit 209cc3
.IP
Packit 209cc3
The packet buffer timeout is required so that an application won't wait
Packit 209cc3
for the operating system's capture buffer to fill up before packets are
Packit 209cc3
delivered; if packets are arriving slowly, that wait could take an
Packit 209cc3
arbitrarily long period of time.
Packit 209cc3
.IP
Packit 209cc3
Not all platforms support a packet buffer timeout; on platforms that
Packit 209cc3
don't, the packet buffer timeout is ignored.  A zero value for the
Packit 209cc3
timeout, on platforms that support a packet buffer timeout, will cause a
Packit 209cc3
read to wait forever to allow enough packets to arrive, with no timeout.
Packit 209cc3
A negative value is invalid; the result of setting the timeout to a
Packit 209cc3
negative value is unpredictable.
Packit 209cc3
.IP
Packit 209cc3
.BR NOTE :
Packit 209cc3
the packet buffer timeout cannot be used to cause calls that read
Packit 209cc3
packets to return within a limited period of time, because, on some
Packit 209cc3
platforms, the packet buffer timeout isn't supported, and, on other
Packit 209cc3
platforms, the timer doesn't start until at least one packet arrives.
Packit 209cc3
This means that the packet buffer timeout should
Packit 209cc3
.B NOT
Packit 209cc3
be used, for example, in an interactive application to allow the packet
Packit 209cc3
capture loop to ``poll'' for user input periodically, as there's no
Packit 209cc3
guarantee that a call reading packets will return after the timeout
Packit 209cc3
expires even if no packets have arrived.
Packit 209cc3
.IP
Packit 209cc3
The packet buffer timeout is set with
Packit 209cc3
.BR pcap_set_timeout ().
Packit 209cc3
.IP "immediate mode"
Packit 209cc3
In immediate mode, packets are always delivered as soon as they arrive,
Packit 209cc3
with no buffering.  Immediate mode is set with
Packit 209cc3
.BR pcap_set_immediate_mode ().
Packit 209cc3
.IP "buffer size"
Packit 209cc3
Packets that arrive for a capture are stored in a buffer, so that they
Packit 209cc3
do not have to be read by the application as soon as they arrive.  On
Packit 209cc3
some platforms, the buffer's size can be set; a size that's too small
Packit 209cc3
could mean that, if too many packets are being captured and the snapshot
Packit 209cc3
length doesn't limit the amount of data that's buffered, packets could
Packit 209cc3
be dropped if the buffer fills up before the application can read
Packit 209cc3
packets from it, while a size that's too large could use more
Packit 209cc3
non-pageable operating system memory than is necessary to prevent
Packit 209cc3
packets from being dropped.
Packit 209cc3
.IP
Packit 209cc3
The buffer size is set with
Packit 209cc3
.BR pcap_set_buffer_size ().
Packit 209cc3
.IP "timestamp type"
Packit 209cc3
On some platforms, the time stamp given to packets on live captures can
Packit 209cc3
come from different sources that can have different resolutions or that
Packit 209cc3
can have different relationships to the time values for the current time
Packit 209cc3
supplied by routines on the native operating system.  See
Packit 209cc3
.BR pcap-tstamp (@MAN_MISC_INFO@)
Packit 209cc3
for a list of time stamp types.
Packit 209cc3
.IP
Packit 209cc3
The time stamp type is set with
Packit 209cc3
.BR pcap_set_tstamp_type ().
Packit 209cc3
.PP
Packit 209cc3
Reading packets from a network interface may require that you have
Packit 209cc3
special privileges:
Packit 209cc3
.TP
Packit 209cc3
.B Under SunOS 3.x or 4.x with NIT or BPF:
Packit 209cc3
You must have read access to
Packit 209cc3
.I /dev/nit
Packit 209cc3
or
Packit 209cc3
.IR /dev/bpf* .
Packit 209cc3
.TP
Packit 209cc3
.B Under Solaris with DLPI:
Packit 209cc3
You must have read/write access to the network pseudo device, e.g.
Packit 209cc3
.IR /dev/le .
Packit 209cc3
On at least some versions of Solaris, however, this is not sufficient to
Packit 209cc3
allow
Packit 209cc3
.I tcpdump
Packit 209cc3
to capture in promiscuous mode; on those versions of Solaris, you must
Packit 209cc3
be root, or the application capturing packets
Packit 209cc3
must be installed setuid to root, in order to capture in promiscuous
Packit 209cc3
mode.  Note that, on many (perhaps all) interfaces, if you don't capture
Packit 209cc3
in promiscuous mode, you will not see any outgoing packets, so a capture
Packit 209cc3
not done in promiscuous mode may not be very useful.
Packit 209cc3
.IP
Packit 209cc3
In newer versions of Solaris, you must have been given the
Packit 209cc3
.B net_rawaccess
Packit 209cc3
privilege; this is both necessary and sufficient to give you access to the
Packit 209cc3
network pseudo-device - there is no need to change the privileges on
Packit 209cc3
that device.  A user can be given that privilege by, for example, adding
Packit 209cc3
that privilege to the user's
Packit 209cc3
.B defaultpriv
Packit 209cc3
key with the
Packit 209cc3
.B usermod (@MAN_ADMIN_COMMANDS@)
Packit 209cc3
command.
Packit 209cc3
.TP
Packit 209cc3
.B Under HP-UX with DLPI:
Packit 209cc3
You must be root or the application capturing packets must be installed
Packit 209cc3
setuid to root.
Packit 209cc3
.TP
Packit 209cc3
.B Under IRIX with snoop:
Packit 209cc3
You must be root or the application capturing packets must be installed
Packit 209cc3
setuid to root.
Packit 209cc3
.TP
Packit 209cc3
.B Under Linux:
Packit 209cc3
You must be root or the application capturing packets must be installed
Packit 209cc3
setuid to root (unless your distribution has a kernel
Packit 209cc3
that supports capability bits such as CAP_NET_RAW and code to allow
Packit 209cc3
those capability bits to be given to particular accounts and to cause
Packit 209cc3
those bits to be set on a user's initial processes when they log in, in
Packit 209cc3
which case you  must have CAP_NET_RAW in order to capture and
Packit 209cc3
CAP_NET_ADMIN to enumerate network devices with, for example, the
Packit 209cc3
.B \-D
Packit 209cc3
flag).
Packit 209cc3
.TP
Packit 209cc3
.B Under ULTRIX and Digital UNIX/Tru64 UNIX:
Packit 209cc3
Any user may capture network traffic.
Packit 209cc3
However, no user (not even the super-user) can capture in promiscuous
Packit 209cc3
mode on an interface unless the super-user has enabled promiscuous-mode
Packit 209cc3
operation on that interface using
Packit 209cc3
.IR pfconfig (8),
Packit 209cc3
and no user (not even the super-user) can capture unicast traffic
Packit 209cc3
received by or sent by the machine on an interface unless the super-user
Packit 209cc3
has enabled copy-all-mode operation on that interface using
Packit 209cc3
.IR pfconfig ,
Packit 209cc3
so
Packit 209cc3
.I useful
Packit 209cc3
packet capture on an interface probably requires that either
Packit 209cc3
promiscuous-mode or copy-all-mode operation, or both modes of
Packit 209cc3
operation, be enabled on that interface.
Packit 209cc3
.TP
Packit 209cc3
.B Under BSD (this includes macOS):
Packit 209cc3
You must have read access to
Packit 209cc3
.I /dev/bpf*
Packit 209cc3
on systems that don't have a cloning BPF device, or to
Packit 209cc3
.I /dev/bpf
Packit 209cc3
on systems that do.
Packit 209cc3
On BSDs with a devfs (this includes macOS), this might involve more
Packit 209cc3
than just having somebody with super-user access setting the ownership
Packit 209cc3
or permissions on the BPF devices - it might involve configuring devfs
Packit 209cc3
to set the ownership or permissions every time the system is booted,
Packit 209cc3
if the system even supports that; if it doesn't support that, you might
Packit 209cc3
have to find some other way to make that happen at boot time.
Packit 209cc3
.PP
Packit 209cc3
Reading a saved packet file doesn't require special privileges.
Packit 209cc3
.PP
Packit 209cc3
The packets read from the handle may include a ``pseudo-header''
Packit 209cc3
containing various forms of packet meta-data, and probably includes a
Packit 209cc3
link-layer header whose contents can differ for different network
Packit 209cc3
interfaces.  To determine the format of the packets supplied by the
Packit 209cc3
handle, call
Packit 209cc3
.BR pcap_datalink ();
Packit 209cc3
.I https://www.tcpdump.org/linktypes.html
Packit 209cc3
lists the values it returns and describes the packet formats that
Packit 209cc3
correspond to those values.
Packit 209cc3
.PP
Packit 209cc3
Do
Packit 209cc3
.B NOT
Packit 209cc3
assume that the packets for a given capture or ``savefile`` will have
Packit 209cc3
any given link-layer header type, such as
Packit 209cc3
.B DLT_EN10MB
Packit 209cc3
for Ethernet.  For example, the "any" device on Linux will have a
Packit 209cc3
link-layer header type of
Packit 209cc3
.B DLT_LINUX_SLL
Packit 209cc3
even if all devices on the system at the time the "any" device is opened
Packit 209cc3
have some other data link type, such as
Packit 209cc3
.B DLT_EN10MB
Packit 209cc3
for Ethernet.
Packit 209cc3
.PP
Packit 209cc3
To obtain the
Packit 209cc3
.B "FILE\ *"
Packit 209cc3
corresponding to a
Packit 209cc3
.B pcap_t
Packit 209cc3
opened for a ``savefile'', call
Packit 209cc3
.BR pcap_file ().
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_create (3PCAP)
Packit 209cc3
get a
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_activate (3PCAP)
Packit 209cc3
activate a
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_findalldevs (3PCAP)
Packit 209cc3
get a list of devices that can be opened for a live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_freealldevs (3PCAP)
Packit 209cc3
free list of devices
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_lookupdev (3PCAP)
Packit 209cc3
get first non-loopback device on that list
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_open_offline (3PCAP)
Packit 209cc3
open a
Packit 209cc3
.B pcap_t
Packit 209cc3
for a ``savefile'', given a pathname
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_open_offline_with_tstamp_precision (3PCAP)
Packit 209cc3
open a
Packit 209cc3
.B pcap_t
Packit 209cc3
for a ``savefile'', given a pathname, and specify the precision to
Packit 209cc3
provide for packet time stamps
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_fopen_offline (3PCAP)
Packit 209cc3
open a
Packit 209cc3
.B pcap_t
Packit 209cc3
for a ``savefile'', given a
Packit 209cc3
.B "FILE\ *"
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_fopen_offline_with_tstamp_precision (3PCAP)
Packit 209cc3
open a
Packit 209cc3
.B pcap_t
Packit 209cc3
for a ``savefile'', given a
Packit 209cc3
.BR "FILE\ *" ,
Packit 209cc3
and specify the precision to provide for packet time stamps
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_open_dead (3PCAP)
Packit 209cc3
create a ``fake''
Packit 209cc3
.B pcap_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_close (3PCAP)
Packit 209cc3
close a
Packit 209cc3
.B pcap_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_snaplen (3PCAP)
Packit 209cc3
set the snapshot length for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_snapshot (3PCAP)
Packit 209cc3
get the snapshot length for a
Packit 209cc3
.B pcap_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_promisc (3PCAP)
Packit 209cc3
set promiscuous mode for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_protocol_linux (3PCAP)
Packit 209cc3
set capture protocol for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture (Linux only)
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_rfmon (3PCAP)
Packit 209cc3
set monitor mode for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_can_set_rfmon (3PCAP)
Packit 209cc3
determine whether monitor mode can be set for a
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_timeout (3PCAP)
Packit 209cc3
set packet buffer timeout for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_immediate_mode (3PCAP)
Packit 209cc3
set immediate mode for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_buffer_size (3PCAP)
Packit 209cc3
set buffer size for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_tstamp_type (3PCAP)
Packit 209cc3
set time stamp type for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_list_tstamp_types (3PCAP)
Packit 209cc3
get list of available time stamp types for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_free_tstamp_types (3PCAP)
Packit 209cc3
free list of available time stamp types
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_tstamp_type_val_to_name (3PCAP)
Packit 209cc3
get name for a time stamp type
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_tstamp_type_val_to_description (3PCAP)
Packit 209cc3
get description for a time stamp type
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_tstamp_type_name_to_val (3PCAP)
Packit 209cc3
get time stamp type corresponding to a name
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_tstamp_precision (3PCAP)
Packit 209cc3
set time stamp precision for a not-yet-activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_get_tstamp_precision (3PCAP)
Packit 209cc3
get the time stamp precision of a
Packit 209cc3
.B pcap_t
Packit 209cc3
for live capture
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_datalink (3PCAP)
Packit 209cc3
get link-layer header type for a
Packit 209cc3
.B pcap_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_file (3PCAP)
Packit 209cc3
get the
Packit 209cc3
.B "FILE\ *"
Packit 209cc3
for a
Packit 209cc3
.B pcap_t
Packit 209cc3
opened for a ``savefile''
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_is_swapped (3PCAP)
Packit 209cc3
determine whether a ``savefile'' being read came from a machine with the
Packit 209cc3
opposite byte order
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_major_version (3PCAP)
Packit 209cc3
.PD 0
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_minor_version (3PCAP)
Packit 209cc3
get the major and minor version of the file format version for a
Packit 209cc3
``savefile''
Packit 209cc3
.PD
Packit 209cc3
.RE
Packit 209cc3
.SS Selecting a link-layer header type for a live capture
Packit 209cc3
Some devices may provide more than one link-layer header type.  To
Packit 209cc3
obtain a list of all link-layer header types provided by a device, call
Packit 209cc3
.BR pcap_list_datalinks ()
Packit 209cc3
on an activated
Packit 209cc3
.B pcap_t
Packit 209cc3
for the device.
Packit 209cc3
To free a list of link-layer header types, call
Packit 209cc3
.BR pcap_free_datalinks ().
Packit 209cc3
To set the link-layer header type for a device, call
Packit 209cc3
.BR pcap_set_datalink ().
Packit 209cc3
This should be done after the device has been activated but before any
Packit 209cc3
packets are read and before any filters are compiled or installed.
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_list_datalinks (3PCAP)
Packit 209cc3
get a list of link-layer header types for a device
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_free_datalinks (3PCAP)
Packit 209cc3
free list of link-layer header types
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_set_datalink (3PCAP)
Packit 209cc3
set link-layer header type for a device
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_datalink_val_to_name (3PCAP)
Packit 209cc3
get name for a link-layer header type
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_datalink_val_to_description (3PCAP)
Packit 209cc3
get description for a link-layer header type
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_datalink_name_to_val (3PCAP)
Packit 209cc3
get link-layer header type corresponding to a name
Packit 209cc3
.RE
Packit 209cc3
.SS Reading packets
Packit 209cc3
Packets are read with
Packit 209cc3
.BR pcap_dispatch ()
Packit 209cc3
or
Packit 209cc3
.BR pcap_loop (),
Packit 209cc3
which process one or more packets, calling a callback routine for each
Packit 209cc3
packet, or with
Packit 209cc3
.BR pcap_next ()
Packit 209cc3
or
Packit 209cc3
.BR pcap_next_ex (),
Packit 209cc3
which return the next packet.
Packit 209cc3
The callback for
Packit 209cc3
.BR pcap_dispatch ()
Packit 209cc3
and
Packit 209cc3
.BR pcap_loop ()
Packit 209cc3
is supplied a pointer to a
Packit 209cc3
.IR "struct pcap_pkthdr" ,
Packit 209cc3
which includes the following members:
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.B ts
Packit 209cc3
a
Packit 209cc3
.I struct timeval
Packit 209cc3
containing the time when the packet was captured
Packit 209cc3
.TP
Packit 209cc3
.B caplen
Packit 209cc3
a
Packit 209cc3
.I bpf_u_int32
Packit 209cc3
giving the number of bytes of the packet that are available from the
Packit 209cc3
capture
Packit 209cc3
.TP
Packit 209cc3
.B len
Packit 209cc3
a
Packit 209cc3
.I bpf_u_int32
Packit 209cc3
giving the length of the packet, in bytes (which might be more than the
Packit 209cc3
number of bytes available from the capture, if the length of the packet
Packit 209cc3
is larger than the maximum number of bytes to capture).
Packit 209cc3
.RE
Packit 209cc3
.PP
Packit 209cc3
The callback is also supplied a
Packit 209cc3
.I const u_char
Packit 209cc3
pointer to the first
Packit 209cc3
.B caplen
Packit 209cc3
(as given in the
Packit 209cc3
.I struct pcap_pkthdr
Packit 209cc3
mentioned above)
Packit 209cc3
bytes of data from the packet.  This won't necessarily be the entire
Packit 209cc3
packet; to capture the entire packet, you will have to provide a value
Packit 209cc3
for
Packit 209cc3
.I snaplen
Packit 209cc3
in your call to
Packit 209cc3
.BR pcap_set_snaplen ()
Packit 209cc3
that is sufficiently large to get all of the packet's data - a value of
Packit 209cc3
65535 should be sufficient on most if not all networks).  When reading
Packit 209cc3
from a ``savefile'', the snapshot length specified when the capture was
Packit 209cc3
performed will limit the amount of packet data available.
Packit 209cc3
.PP
Packit 209cc3
.BR pcap_next ()
Packit 209cc3
is passed an argument that points to a
Packit 209cc3
.I struct pcap_pkthdr
Packit 209cc3
structure, and fills it in with the time stamp and length values for the
Packit 209cc3
packet.  It returns a
Packit 209cc3
.I const u_char
Packit 209cc3
to the first
Packit 209cc3
.B caplen
Packit 209cc3
bytes of the packet on success, and NULL on error.
Packit 209cc3
.PP
Packit 209cc3
.BR pcap_next_ex ()
Packit 209cc3
is passed two pointer arguments, one of which points to a
Packit 209cc3
.IR struct pcap_pkthdr *
Packit 209cc3
and one of which points to a
Packit 209cc3
.IR "const u_char" *.
Packit 209cc3
It sets the first pointer to point to a
Packit 209cc3
.I struct pcap_pkthdr
Packit 209cc3
structure with the time stamp and length values for the packet, and sets
Packit 209cc3
the second pointer to point to the first
Packit 209cc3
.B caplen
Packit 209cc3
bytes of the packet.
Packit 209cc3
.PP
Packit 209cc3
To force the loop in
Packit 209cc3
.BR pcap_dispatch ()
Packit 209cc3
or
Packit 209cc3
.BR pcap_loop ()
Packit 209cc3
to terminate, call
Packit 209cc3
.BR pcap_breakloop ().
Packit 209cc3
.PP
Packit 209cc3
By default, when reading packets from an interface opened for a live
Packit 209cc3
capture,
Packit 209cc3
.BR pcap_dispatch (),
Packit 209cc3
.BR pcap_next (),
Packit 209cc3
and
Packit 209cc3
.BR pcap_next_ex ()
Packit 209cc3
will, if no packets are currently available to be read, block waiting
Packit 209cc3
for packets to become available.  On some, but
Packit 209cc3
.I not
Packit 209cc3
all, platforms, if a packet buffer timeout was specified, the wait will
Packit 209cc3
terminate after the packet buffer timeout expires; applications should
Packit 209cc3
be prepared for this, as it happens on some platforms, but should not
Packit 209cc3
rely on it, as it does not happen on other platforms.  Note that the
Packit 209cc3
wait might, or might not, terminate even if no packets are available;
Packit 209cc3
applications should be prepared for this to happen, but must not rely on
Packit 209cc3
it happening.
Packit 209cc3
.PP
Packit 209cc3
A handle can be put into ``non-blocking mode'', so that those routines
Packit 209cc3
will, rather than blocking, return an indication that no packets are
Packit 209cc3
available to read.  Call
Packit 209cc3
.BR pcap_setnonblock ()
Packit 209cc3
to put a handle into non-blocking mode or to take it out of non-blocking
Packit 209cc3
mode; call
Packit 209cc3
.BR pcap_getnonblock ()
Packit 209cc3
to determine whether a handle is in non-blocking mode.  Note that
Packit 209cc3
non-blocking mode does not work correctly in Mac OS X 10.6.
Packit 209cc3
.PP
Packit 209cc3
Non-blocking mode is often combined with routines such as
Packit 209cc3
.BR select (2)
Packit 209cc3
or
Packit 209cc3
.BR poll (2)
Packit 209cc3
or other routines a platform offers to wait for any of a set of
Packit 209cc3
descriptors to be ready to read.  To obtain, for a handle, a descriptor
Packit 209cc3
that can be used in those routines, call
Packit 209cc3
.BR pcap_get_selectable_fd ().
Packit 209cc3
If the routine indicates that data is
Packit 209cc3
available to read on the descriptor, an attempt should be made to read
Packit 209cc3
from the device.
Packit 209cc3
.PP
Packit 209cc3
Not all handles have such a descriptor available;
Packit 209cc3
.BR pcap_get_selectable_fd ()
Packit 209cc3
will return
Packit 209cc3
.B PCAP_ERROR
Packit 209cc3
if no such descriptor is available.  If no such
Packit 209cc3
descriptor is available, this may be because the device must be polled
Packit 209cc3
periodically for packets; in that case,
Packit 209cc3
.BR pcap_get_required_select_timeout ()
Packit 209cc3
will return a pointer to a
Packit 209cc3
.B struct timeval
Packit 209cc3
whose value can be used as a timeout in those routines.  When the
Packit 209cc3
routine returns, an attmept should be made to read packets from the
Packit 209cc3
device.  If
Packit 209cc3
.BR pcap_get_required_select_timeout ()
Packit 209cc3
returns NULL, no such timeout is available, and those routines cannot be
Packit 209cc3
used with the device.
Packit 209cc3
.PP
Packit 209cc3
In addition, for various
Packit 209cc3
reasons, one or more of those routines will not work properly with the
Packit 209cc3
descriptor; the documentation for
Packit 209cc3
.BR pcap_get_selectable_fd ()
Packit 209cc3
gives details.  Note that, just as an attempt to read packets from a
Packit 209cc3
.B pcap_t
Packit 209cc3
may not return any packets if the packet buffer timeout expires, a
Packit 209cc3
.BR select (),
Packit 209cc3
.BR poll (),
Packit 209cc3
or other such call may, if the packet buffer timeout expires, indicate
Packit 209cc3
that a descriptor is ready to read even if there are no packets
Packit 209cc3
available to read.
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dispatch (3PCAP)
Packit 209cc3
read a bufferful of packets from a
Packit 209cc3
.B pcap_t
Packit 209cc3
open for a live capture or the full set of packets from a
Packit 209cc3
.B pcap_t
Packit 209cc3
open for a ``savefile''
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_loop (3PCAP)
Packit 209cc3
read packets from a
Packit 209cc3
.B pcap_t
Packit 209cc3
until an interrupt or error occurs
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_next (3PCAP)
Packit 209cc3
read the next packet from a
Packit 209cc3
.B pcap_t
Packit 209cc3
without an indication whether an error occurred
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_next_ex (3PCAP)
Packit 209cc3
read the next packet from a
Packit 209cc3
.B pcap_t
Packit 209cc3
with an error indication on an error
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_breakloop (3PCAP)
Packit 209cc3
prematurely terminate the loop in
Packit 209cc3
.BR pcap_dispatch ()
Packit 209cc3
or
Packit 209cc3
.BR pcap_loop ()
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_setnonblock (3PCAP)
Packit 209cc3
set or clear non-blocking mode on a
Packit 209cc3
.B pcap_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_getnonblock (3PCAP)
Packit 209cc3
get the state of non-blocking mode for a
Packit 209cc3
.B pcap_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_get_selectable_fd (3PCAP)
Packit 209cc3
attempt to get a descriptor for a
Packit 209cc3
.B pcap_t
Packit 209cc3
that can be used in calls such as
Packit 209cc3
.BR select (2)
Packit 209cc3
and
Packit 209cc3
.BR poll (2)
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_get_required_select_timeout (3PCAP)
Packit 209cc3
if no descriptor usable with
Packit 209cc3
.BR select (2)
Packit 209cc3
and
Packit 209cc3
.BR poll (2)
Packit 209cc3
is available for the
Packit 209cc3
.BR pcap_t ,
Packit 209cc3
attempt to get a timeout usable with those routines
Packit 209cc3
.RE
Packit 209cc3
.SS Filters
Packit 209cc3
In order to cause only certain packets to be returned when reading
Packit 209cc3
packets, a filter can be set on a handle.  For a live capture, the
Packit 209cc3
filtering will be performed in kernel mode, if possible, to avoid
Packit 209cc3
copying ``uninteresting'' packets from the kernel to user mode.
Packit 209cc3
.PP
Packit 209cc3
A filter can be specified as a text string; the syntax and semantics of
Packit 209cc3
the string are as described by
Packit 209cc3
.BR pcap-filter (@MAN_MISC_INFO@).
Packit 209cc3
A filter string is compiled into a program in a pseudo-machine-language
Packit 209cc3
by
Packit 209cc3
.BR pcap_compile ()
Packit 209cc3
and the resulting program can be made a filter for a handle with
Packit 209cc3
.BR pcap_setfilter ().
Packit 209cc3
The result of
Packit 209cc3
.BR pcap_compile ()
Packit 209cc3
can be freed with a call to
Packit 209cc3
.BR pcap_freecode ().
Packit 209cc3
.BR pcap_compile ()
Packit 209cc3
may require a network mask for certain expressions in the filter string;
Packit 209cc3
.BR pcap_lookupnet ()
Packit 209cc3
can be used to find the network address and network mask for a given
Packit 209cc3
capture device.
Packit 209cc3
.PP
Packit 209cc3
A compiled filter can also be applied directly to a packet that has been
Packit 209cc3
read using
Packit 209cc3
.BR pcap_offline_filter ().
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_compile (3PCAP)
Packit 209cc3
compile filter expression to a pseudo-machine-language code program
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_freecode (3PCAP)
Packit 209cc3
free a filter program
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_setfilter (3PCAP)
Packit 209cc3
set filter for a
Packit 209cc3
.B pcap_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_lookupnet (3PCAP)
Packit 209cc3
get network address and network mask for a capture device
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_offline_filter (3PCAP)
Packit 209cc3
apply a filter program to a packet
Packit 209cc3
.RE
Packit 209cc3
.SS Incoming and outgoing packets
Packit 209cc3
By default, libpcap will attempt to capture both packets sent by the
Packit 209cc3
machine and packets received by the machine.  To limit it to capturing
Packit 209cc3
only packets received by the machine or, if possible, only packets sent
Packit 209cc3
by the machine, call
Packit 209cc3
.BR pcap_setdirection ().
Packit 209cc3
.TP
Packit 209cc3
.BR Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_setdirection (3PCAP)
Packit 209cc3
specify whether to capture incoming packets, outgoing packets, or both
Packit 209cc3
.RE
Packit 209cc3
.SS Capture statistics
Packit 209cc3
To get statistics about packets received and dropped in a live capture,
Packit 209cc3
call
Packit 209cc3
.BR pcap_stats ().
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_stats (3PCAP)
Packit 209cc3
get capture statistics
Packit 209cc3
.RE
Packit 209cc3
.SS Opening a handle for writing captured packets
Packit 209cc3
To open a ``savefile`` to which to write packets, given the pathname the
Packit 209cc3
``savefile'' should have, call
Packit 209cc3
.BR pcap_dump_open ().
Packit 209cc3
To open a ``savefile`` to which to write packets, given the pathname the
Packit 209cc3
``savefile'' should have, call
Packit 209cc3
.BR pcap_dump_open ();
Packit 209cc3
to set up a handle for a ``savefile'', given a
Packit 209cc3
.B "FILE\ *"
Packit 209cc3
referring to a file already opened for writing, call
Packit 209cc3
.BR pcap_dump_fopen ().
Packit 209cc3
They each return pointers to a
Packit 209cc3
.BR pcap_dumper_t ,
Packit 209cc3
which is the handle used for writing packets to the ``savefile''.  If it
Packit 209cc3
succeeds, it will have created the file if it doesn't exist and
Packit 209cc3
truncated the file if it does exist.
Packit 209cc3
To close a
Packit 209cc3
.BR pcap_dumper_t ,
Packit 209cc3
call
Packit 209cc3
.BR pcap_dump_close ().
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dump_open (3PCAP)
Packit 209cc3
open a
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
for a ``savefile``, given a pathname
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dump_fopen (3PCAP)
Packit 209cc3
open a
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
for a ``savefile``, given a
Packit 209cc3
.B "FILE\ *"
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dump_close (3PCAP)
Packit 209cc3
close a
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dump_file (3PCAP)
Packit 209cc3
get the
Packit 209cc3
.B "FILE\ *"
Packit 209cc3
for a
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
opened for a ``savefile''
Packit 209cc3
.RE
Packit 209cc3
.SS Writing packets
Packit 209cc3
To write a packet to a
Packit 209cc3
.BR pcap_dumper_t ,
Packit 209cc3
call
Packit 209cc3
.BR pcap_dump ().
Packit 209cc3
Packets written with
Packit 209cc3
.BR pcap_dump ()
Packit 209cc3
may be buffered, rather than being immediately written to the
Packit 209cc3
``savefile''.  Closing the
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
will cause all buffered-but-not-yet-written packets to be written to the
Packit 209cc3
``savefile''.
Packit 209cc3
To force all packets written to the
Packit 209cc3
.BR pcap_dumper_t ,
Packit 209cc3
and not yet written to the ``savefile'' because they're buffered by the
Packit 209cc3
.BR pcap_dumper_t ,
Packit 209cc3
to be written to the ``savefile'', without closing the
Packit 209cc3
.BR pcap_dumper_t ,
Packit 209cc3
call
Packit 209cc3
.BR pcap_dump_flush ().
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dump (3PCAP)
Packit 209cc3
write packet to a
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dump_flush (3PCAP)
Packit 209cc3
flush buffered packets written to a
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
to the ``savefile''
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_dump_ftell (3PCAP)
Packit 209cc3
get current file position for a
Packit 209cc3
.B pcap_dumper_t
Packit 209cc3
.RE
Packit 209cc3
.SS Injecting packets
Packit 209cc3
If you have the required privileges, you can inject packets onto a
Packit 209cc3
network with a
Packit 209cc3
.B pcap_t
Packit 209cc3
for a live capture, using
Packit 209cc3
.BR pcap_inject ()
Packit 209cc3
or
Packit 209cc3
.BR pcap_sendpacket ().
Packit 209cc3
(The two routines exist for compatibility with both OpenBSD and WinPcap;
Packit 209cc3
they perform the same function, but have different return values.)
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_inject (3PCAP)
Packit 209cc3
.PD 0
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_sendpacket (3PCAP)
Packit 209cc3
transmit a packet
Packit 209cc3
.PD
Packit 209cc3
.RE
Packit 209cc3
.SS Reporting errors
Packit 209cc3
Some routines return error or warning status codes; to convert them to a
Packit 209cc3
string, use
Packit 209cc3
.BR pcap_statustostr ().
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_statustostr (3PCAP)
Packit 209cc3
get a string for an error or warning status code
Packit 209cc3
.RE
Packit 209cc3
.SS Getting library version information
Packit 209cc3
To get a string giving version information about libpcap, call
Packit 209cc3
.BR pcap_lib_version ().
Packit 209cc3
.TP
Packit 209cc3
.B Routines
Packit 209cc3
.RS
Packit 209cc3
.TP
Packit 209cc3
.BR pcap_lib_version (3PCAP)
Packit 209cc3
get library version string
Packit 209cc3
.RE
Packit 209cc3
.SH BACKWARD COMPATIBILITY
Packit 209cc3
.PP
Packit 209cc3
In versions of libpcap prior to 1.0, the
Packit 209cc3
.B pcap.h
Packit 209cc3
header file was not in a
Packit 209cc3
.B pcap
Packit 209cc3
directory on most platforms; if you are writing an application that must
Packit 209cc3
work on versions of libpcap prior to 1.0, include
Packit 209cc3
.BR <pcap.h> ,
Packit 209cc3
which will include
Packit 209cc3
.B <pcap/pcap.h>
Packit 209cc3
for you, rather than including
Packit 209cc3
.BR <pcap/pcap.h> .
Packit 209cc3
.PP
Packit 209cc3
.BR pcap_create ()
Packit 209cc3
and
Packit 209cc3
.BR pcap_activate ()
Packit 209cc3
were not available in versions of libpcap prior to 1.0; if you are
Packit 209cc3
writing an application that must work on versions of libpcap prior to
Packit 209cc3
1.0, either use
Packit 209cc3
.BR pcap_open_live ()
Packit 209cc3
to get a handle for a live capture or, if you want to be able to use the
Packit 209cc3
additional capabilities offered by using
Packit 209cc3
.BR pcap_create ()
Packit 209cc3
and
Packit 209cc3
.BR pcap_activate (),
Packit 209cc3
use an
Packit 209cc3
.BR autoconf (1)
Packit 209cc3
script or some other configuration script to check whether the libpcap
Packit 209cc3
1.0 APIs are available and use them only if they are.
Packit 209cc3
.SH SEE ALSO
Packit 209cc3
autoconf(1), tcpdump(1), tcpslice(1), pcap-filter(@MAN_MISC_INFO@), pfconfig(8),
Packit 209cc3
usermod(@MAN_ADMIN_COMMANDS@)
Packit 209cc3
.SH AUTHORS
Packit 209cc3
The original authors of libpcap are:
Packit 209cc3
.LP
Packit 209cc3
Van Jacobson,
Packit 209cc3
Craig Leres and
Packit 209cc3
Steven McCanne, all of the
Packit 209cc3
Lawrence Berkeley National Laboratory, University of California, Berkeley, CA.
Packit 209cc3
.LP
Packit 209cc3
The current version is available from "The Tcpdump Group"'s Web site at
Packit 209cc3
.LP
Packit 209cc3
.RS
Packit 209cc3
.I https://www.tcpdump.org/
Packit 209cc3
.RE
Packit 209cc3
.SH BUGS
Packit 209cc3
To report a security issue please send an e-mail to security@tcpdump.org.
Packit 209cc3
.LP
Packit 209cc3
To report bugs and other problems, contribute patches, request a
Packit 209cc3
feature, provide generic feedback etc please see the file
Packit 209cc3
.I CONTRIBUTING
Packit 209cc3
in the libpcap source tree root.