]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Expand the comment before the "#if 0"ed out code to dump the address and
authorguy <guy>
Sat, 9 Sep 2000 07:06:17 +0000 (07:06 +0000)
committerguy <guy>
Sat, 9 Sep 2000 07:06:17 +0000 (07:06 +0000)
control fields of a PPP frame, to indicate what I've found from trolling
through the FreeBSD and NetBSD PPP code.

print-ppp.c

index 9332bcdeba6bd6c682a1963992b2d223f35fea09..3beb022023ff8d217f23c8f7d0cab03dfeb4ccf9 100644 (file)
@@ -31,7 +31,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.42 2000-08-18 08:20:10 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.43 2000-09-09 07:06:17 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -1070,6 +1070,36 @@ ppp_if_print(u_char *user, const struct pcap_pkthdr *h,
         * actual PPP frame. The 1st octet looks like Input/Output flag
         * while 2nd octet is unknown, at least to me
         * ([email protected]).
+        *
+        * That was what the original tcpdump code did.
+        *
+        * FreeBSD's "if_ppp.c" *does* set the first octet to 1 for outbound
+        * packets and 0 for inbound packets - but only if the
+        * protocol field has the 0x8000 bit set (i.e., it's a network
+        * control protocol); it does so before running the packet through
+        * "bpf_filter" to see if it should be discarded, and to see
+        * if we should update the time we sent the most recent packet...
+        *
+        * ...but it puts the original address field back after doing
+        * so.
+        *
+        * NetBSD's "if_ppp.c" doesn't set the first octet in that fashion.
+        *
+        * I don't know if any PPP implementation handed up to a BPF
+        * device packets with the first octet being 1 for outbound and
+        * 0 for inbound packets, so I ([email protected]) don't know
+        * whether that ever needs to be checked or not.
+        *
+        * Note that NetBSD has a DLT_PPP_SERIAL, which it uses for PPP,
+        * and its tcpdump appears to assume that the frame always
+        * begins with an address field and a control field, and that
+        * the address field might be 0x0f or 0x8f, for Cisco
+        * point-to-point with HDLC framing as per section 4.3.1 of RFC
+        * 1547, as well as 0xff, for PPP in HDLC-like framing as per
+        * RFC 1662.
+        *
+        * (Is the Cisco framing in question what DLT_C_HDLC, in
+        * BSD/OS, is?)
         */
        if (eflag)
                printf("%c %4d %02x ", p[0] ? 'O' : 'I', length, p[1]);