aboutsummaryrefslogtreecommitdiff
path: root/contrib/libpcap/pcap_datalink.3pcap.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libpcap/pcap_datalink.3pcap.in')
-rw-r--r--contrib/libpcap/pcap_datalink.3pcap.in33
1 files changed, 30 insertions, 3 deletions
diff --git a/contrib/libpcap/pcap_datalink.3pcap.in b/contrib/libpcap/pcap_datalink.3pcap.in
index 3d4ace1d794c..b07fc28f0982 100644
--- a/contrib/libpcap/pcap_datalink.3pcap.in
+++ b/contrib/libpcap/pcap_datalink.3pcap.in
@@ -1,5 +1,3 @@
-.\" @(#) $Header: /tcpdump/master/libpcap/pcap_datalink.3pcap.in,v 1.1 2008-10-21 07:33:02 guy Exp $
-.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -19,7 +17,7 @@
.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
.\"
-.TH PCAP_DATALINK 3PCAP "22 August 2010"
+.TH PCAP_DATALINK 3PCAP "13 October 2013"
.SH NAME
pcap_datalink \- get the link-layer header type
.SH SYNOPSIS
@@ -37,5 +35,34 @@ int pcap_datalink(pcap_t *p);
returns the link-layer header type for the live capture or ``savefile''
specified by
.IR p .
+.PP
+It must not be called on a pcap descriptor created by
+.B pcap_create()
+that has not yet been activated by
+.BR pcap_activate() .
+.PP
+.I http://www.tcpdump.org/linktypes.html
+lists the values
+.B pcap_datalink()
+can return and describes the packet formats that
+correspond to those values.
+.PP
+Do
+.B NOT
+assume that the packets for a given capture or ``savefile`` will have
+any given link-layer header type, such as
+.B DLT_EN10MB
+for Ethernet. For example, the "any" device on Linux will have a
+link-layer header type of
+.B DLT_LINUX_SLL
+even if all devices on the system at the time the "any" device is opened
+have some other data link type, such as
+.B DLT_EN10MB
+for Ethernet.
+.SH RETURN VALUE
+.B pcap_datalink()
+returns the link-layer header type on success and
+.B PCAP_ERROR_NOT_ACTIVATED
+if called on a capture handle that has been created but not activated.
.SH SEE ALSO
pcap(3PCAP), pcap-linktype(@MAN_MISC_INFO@)