]> The Tcpdump Group git mirrors - libpcap/commitdiff
Add support for NetBSD DLT_PPP_SERIAL (PPP in HDLC-like framing, as per
authorguy <guy>
Mon, 18 Sep 2000 05:08:02 +0000 (05:08 +0000)
committerguy <guy>
Mon, 18 Sep 2000 05:08:02 +0000 (05:08 +0000)
RFC 1662, or Cisco point-to-point with HDLC framing, as per seciont
4.3.1 of RFC 1547; there's always an address and control octet at the
beginning of these packets, but they're not necessarily 0xff 0x03),
which we map to PCAP_ENCAP_PPP_HDLC.

pcap-bpf.c
pcap.h

index ceae5984de4c60fa8a7374487c8256ec55314710..f2a18228ef343f63f38d25cdcea52b4d1de72f4e 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.40 2000-09-17 04:04:36 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.41 2000-09-18 05:08:02 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -321,6 +321,13 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
                break;
 #endif
 
+#ifdef DLT_PPP_SERIAL
+       case DLT_PPP_SERIAL:
+               /* NetBSD sync/async serial PPP (or Cisco HDLC) */
+               v = PCAP_ENCAP_PPP_HDLC;
+               break;
+#endif
+
        default:
                /*
                 * We don't know what this is; we'd need to add a
diff --git a/pcap.h b/pcap.h
index cf6fcdc7e465c9a680aea38d81fa7c631ae8fb62..1bee81497165f7da36403e7b1aabffb3db62233c 100644 (file)
--- a/pcap.h
+++ b/pcap.h
@@ -30,7 +30,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.26 2000-09-17 04:04:39 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.27 2000-09-18 05:08:02 guy Exp $ (LBL)
  */
 
 #ifndef lib_pcap_h
@@ -177,6 +177,18 @@ struct pcap_file_header {
 #define PCAP_ENCAP_IEEE802_11  105             /* IEEE 802.11 (wireless) */
 #define PCAP_ENCAP_ATM_CLIP    106             /* Linux Classical IP over ATM */
 
+/*
+ * PCAP_ENCAP_PPP is for use when there might, or might not, be an RFC 1662
+ * PPP in HDLC-like framing header (with 0xff 0x03 before the PPP protocol
+ * field) at the beginning of the packet.
+ *
+ * This is for use when there is always such a header; the address field
+ * might be 0xff, for regular PPP, or it might be an address field for Cisco
+ * point-to-point with HDLC framing as per section 4.3.1 of RFC 1547 ("Cisco
+ * HDLC").  This is, for example, what you get with NetBSD's DLT_PPP_SERIAL.
+ */
+#define PCAP_ENCAP_PPP_HDLC    107             /* PPP in HDLC-like framing */
+
 /*
  * Each packet in the dump file is prepended with this generic header.
  * This gets around the problem of different headers for different