]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap.3
NetBSD support for multiple data link types on an interface, from David
[libpcap] / pcap.3
diff --git a/pcap.3 b/pcap.3
index 517621d774124d0085413c392da7f97cfbd829b6..8036e69157fd3fdd16ddb0c3bc2224398ac0a05b 100644 (file)
--- 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()