aboutsummaryrefslogtreecommitdiffstats
path: root/pcap.3
diff options
context:
space:
mode:
authorguy <guy>2002-12-19 09:05:45 +0000
committerguy <guy>2002-12-19 09:05:45 +0000
commit482fa426bca50908c3739ba8b0539398dc01c9ae (patch)
tree0f954479d9e0117e34cc066d0766f09ece979ef5 /pcap.3
parent1e574aa6fd73fdc835e340d9e1d00fc1b67a2614 (diff)
NetBSD support for multiple data link types on an interface, from David
Young <dyoung@ojctech.com>, with some minor changes by Jason R. Thorpe <thorpej@netbsd.org>, and further changes by me to support it on BPF systems lacking BIOCGDLTLIST and other platforms lacking an equivalent feature. Update Jason Thorpe's e-mail address (Zembu is going away, if it hasn't done so already). Add APIs to map DLT names to DLT values and vice versa.
Diffstat (limited to 'pcap.3')
-rw-r--r--pcap.343
1 files changed, 41 insertions, 2 deletions
diff --git a/pcap.3 b/pcap.3
index 517621d..8036e69 100644
--- a/pcap.3
+++ b/pcap.3
@@ -1,4 +1,4 @@
-.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.40 2002-12-17 07:32:55 guy Exp $
+.\" @(#) $Header: /tcpdump/master/libpcap/Attic/pcap.3,v 1.41 2002-12-19 09:05:48 guy Exp $
.\"
.\" Copyright (c) 1994, 1996, 1997
.\" The Regents of the University of California. All rights reserved.
@@ -82,6 +82,10 @@ u_char *pcap_next(pcap_t *p, struct pcap_pkthdr *h)
.LP
.ft B
int pcap_datalink(pcap_t *p)
+int pcap_list_datalinks(pcap_t *p, int **dlt_buf);
+int pcap_set_datalink(pcap_t *p, int dlt);
+int pcap_datalink_name_to_val(const char *name);
+const char *pcap_datalink_val_to_name(int dlt);
int pcap_snapshot(pcap_t *p)
int pcap_is_swapped(pcap_t *p)
int pcap_major_version(pcap_t *p)
@@ -765,10 +769,45 @@ a 2-byte VCI field, in network byte order.
.B DLT_IP_OVER_FC
RFC 2625 IP-over-Fibre Channel, with the link-layer header being the
Network_Header as described in that RFC.
+.RE
+.PP
+.B pcap_list_datalinks()
+is used to get a list of the supported data link types of the interface
+associated with the pcap descriptor.
+.B pcap_list_datalinks()
+allocates an array to hold the list and sets
+.IR *dlt_buf .
+The caller is responsible for freeing the array.
+.B \-1
+is returned on failure;
+otherwise, the number of data link types in the array is returned.
+.PP
+.B pcap_set_datalink()
+is used to set the current data link type of the pcap descriptor
+to the type specified by
+.IR dlt .
+.B \-1
+is returned on failure.
+.PP
+.B pcap_datalink_name_to_val()
+translates a data link type name, which is a
+.B DLT_
+name with the
+.B DLT_
+removed, to the corresponding data link type value. The translation
+is case-insensitive.
+is used to set the current data link type of the pcap descriptor
+NULL is returned on failure.
+.PP
+.B pcap_datalink_val_to_name()
+translates a data link type value to the corresponding data link type
+name.
+.B \-1
+is returned on failure.
.PP
.B pcap_snapshot()
returns the snapshot length specified when
-.B pcap_open_live
+.B pcap_open_live()
was called.
.PP
.B pcap_is_swapped()