X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7b50febe28e54e076a9917164eeddec4bc7a170e..4890d02f2cbdfd68f0dfb8ce7123fb61b4a591d4:/print-cip.c diff --git a/print-cip.c b/print-cip.c index 3b9e1f67..f3afd308 100644 --- a/print-cip.c +++ b/print-cip.c @@ -22,24 +22,22 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.6 2000-09-23 08:26:31 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-cip.c,v 1.13 2001-06-08 04:48:23 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include + #include #include #include #include -#include #include -#include -#include -#include #include #include @@ -49,9 +47,6 @@ static const char rcsid[] = #include "ethertype.h" #include "ether.h" -const u_char *packetp; -const u_char *snapend; - #define RFC1483LLC_LEN 8 static unsigned char rfcllc[] = { @@ -136,10 +131,11 @@ cip_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) extracted_ethertype = 0; if (ether_type < ETHERMTU) { /* Try to print the LLC-layer header & higher layers */ - if (llc_print(p, length, caplen, NULL, NULL)==0) { + if (llc_print(p, length, caplen, NULL, NULL, + &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))); @@ -147,7 +143,8 @@ cip_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) if (!xflag && !qflag) default_print(p, caplen); } - } else if (ether_encap_print(ether_type, p, length, caplen) == 0) { + } else if (ether_encap_print(ether_type, p, length, caplen, + &extracted_ethertype) == 0) { /* ether_type not known, print raw packet */ if (!eflag) cip_print((u_char *)bp, length + RFC1483LLC_LEN);