*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.19 2000-10-06 04:23:10 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-atm.c,v 1.20 2000-12-22 22:45:09 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
/* ether_type not known, print raw packet */
if (!eflag)
printf("%02x %02x %02x %02x-%02x-%02x %04x: ",
- p[0], p[1], p[2], /* dsap/ssap/ctrl */
- p[3], p[4], p[5], /* manufacturer's code */
+ packetp[0], packetp[1], packetp[2], /* dsap/ssap/ctrl */
+ packetp[3], packetp[4], packetp[5], /* manufacturer's code */
ethertype);
if (!xflag && !qflag)
default_print(p, caplen);
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.10 2000-12-18 05:41:58 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.11 2000-12-22 22:45:10 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
&extracted_ethertype)==0) {
/* ether_type not known, print raw packet */
if (!eflag)
- cip_print((u_char *)bp, length);
+ cip_print((u_char *)bp, length + RFC1483LLC_LEN);
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.60 2000-12-18 05:41:59 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ether.c,v 1.61 2000-12-22 22:45:10 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
&extracted_ethertype) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
- ether_print((u_char *)ep, length);
+ ether_print((u_char *)ep, length + ETHER_HDRLEN);
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.48 2000-12-18 05:41:59 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-fddi.c,v 1.49 2000-12-22 22:45:11 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
* handle intelligently
*/
if (!eflag)
- fddi_print(fddip, length,
+ fddi_print(fddip, length + FDDI_HDRLEN,
ESRC(&ehdr), EDST(&ehdr));
if (extracted_ethertype) {
printf("(LLC %s) ",
else {
/* Some kinds of FDDI packet we cannot handle intelligently */
if (!eflag)
- fddi_print(fddip, length, ESRC(&ehdr), EDST(&ehdr));
+ fddi_print(fddip, length + FDDI_HDRLEN, ESRC(&ehdr),
+ EDST(&ehdr));
if (!xflag && !qflag)
default_print(p, caplen);
}
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.10 2000-12-18 05:42:00 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lane.c,v 1.11 2000-12-22 22:45:11 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
&extracted_ethertype) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
- lane_print((u_char *)ep, length);
+ lane_print((u_char *)ep, length + sizeof(*ep));
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.1 2000-12-21 10:43:22 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.2 2000-12-22 22:45:11 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
ether_type = ntohs(sllp->sll_protocol);
/*
- * Is it (gag) an 802.3 encapsulation?
+ * Is it (gag) an 802.3 encapsulation, or some non-Ethernet
+ * packet type?
*/
extracted_ethertype = 0;
if (ether_type <= ETHERMTU) {
- /* Try to print the LLC-layer header & higher layers */
- if (llc_print(p, length, caplen, ESRC(&ehdr), EDST(&ehdr),
- &extracted_ethertype) == 0) {
+ /*
+ * Yes - what type is it?
+ */
+ switch (ether_type) {
+
+ case LINUX_SLL_P_802_2:
+ /*
+ * 802.2.
+ * Try to print the LLC-layer header & higher layers.
+ */
+ if (llc_print(p, length, caplen, ESRC(&ehdr),
+ EDST(&ehdr), &extracted_ethertype) == 0)
+ goto unknown; /* unknown LLC type */
+ break;
+
+ default:
+ unknown:
/* ether_type not known, print raw packet */
if (!eflag)
- sll_print(packetp, length);
+ sll_print(packetp, length + SLL_HDR_LEN);
if (extracted_ethertype) {
printf("(LLC %s) ",
etherproto_string(htons(extracted_ethertype)));
}
if (!xflag && !qflag)
default_print(p, caplen);
+ break;
}
} else if (ether_encap_print(ether_type, p, length, caplen,
&extracted_ethertype) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
- sll_print(p - SLL_HDR_LEN, length + SLL_HDR_LEN);
+ sll_print(packetp, length + SLL_HDR_LEN);
if (!xflag && !qflag)
default_print(p, caplen);
}
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.9 2000-12-18 05:42:00 guy Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-token.c,v 1.10 2000-12-22 22:45:12 guy Exp $";
#endif
#ifdef HAVE_CONFIG_H
&extracted_ethertype) == 0) {
/* ether_type not known, print raw packet */
if (!eflag)
- token_print(trp, length,
+ token_print(trp,
+ length + TOKEN_HDRLEN + route_len,
ESRC(&ehdr), EDST(&ehdr));
if (extracted_ethertype) {
printf("(LLC %s) ",
/* Some kinds of TR packet we cannot handle intelligently */
/* XXX - dissect MAC packets if frame type is 0 */
if (!eflag)
- token_print(trp, length, ESRC(&ehdr), EDST(&ehdr));
+ token_print(trp, length + TOKEN_HDRLEN + route_len,
+ ESRC(&ehdr), EDST(&ehdr));
if (!xflag && !qflag)
default_print(p, caplen);
}
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/sll.h,v 1.2 2000-12-22 12:18:32 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/sll.h,v 1.3 2000-12-22 22:45:12 guy Exp $ (LBL)
*/
/*
#define LINUX_SLL_MULTICAST 2
#define LINUX_SLL_OTHERHOST 3
#define LINUX_SLL_OUTGOING 4
+
+/*
+ * The LINUX_SLL_ values for "sll_protocol"; these correspond to the
+ * ETH_P_ values on Linux, but are defined here so that they're
+ * available even on systems other than Linux. We assume, for now,
+ * that the ETH_P_ values won't change in Linux; if they do, then:
+ *
+ * if we don't translate them in "pcap-linux.c", capture files
+ * won't necessarily be readable if captured on a system that
+ * defines ETH_P_ values that don't match these values;
+ *
+ * if we do translate them in "pcap-linux.c", that makes life
+ * unpleasant for the BPF code generator, as the values you test
+ * for in the kernel aren't the values that you test for when
+ * reading a capture file, so the fixup code run on BPF programs
+ * handed to the kernel ends up having to do more work.
+ *
+ * Add other values here as necessary, for handling packet types that
+ * might show up on non-Ethernet, non-802.x networks. (Not all the ones
+ * in the Linux "if_ether.h" will, I suspect, actually show up in
+ * captures.)
+ */
+#define LINUX_SLL_P_802_3 0x0001 /* Novell 802.3 frames without 802.2 LLC header */
+#define LINUX_SLL_P_802_2 0x0004 /* 802.2 frames (not D/I/X Ethernet) */