#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.36 2005-04-19 08:06:09 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-chdlc.c,v 1.39 2005-04-27 14:33:24 hannes Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
} un;
};
-#define SLARP_LEN 14
+#define SLARP_MIN_LEN 14
+#define SLARP_MAX_LEN 18
static void
chdlc_slarp_print(const u_char *cp, u_int length)
u_int sec,min,hrs,days;
printf("SLARP (length: %u), ",length);
- if (length < SLARP_LEN)
+ if (length < SLARP_MIN_LEN)
goto trunc;
slarp = (const struct cisco_slarp *)cp;
- TCHECK2(*slarp, SLARP_LEN);
+ TCHECK2(*slarp, SLARP_MIN_LEN);
switch (EXTRACT_32BITS(&slarp->code)) {
case SLARP_REQUEST:
printf("request");
EXTRACT_32BITS(&slarp->un.keep.yourseq),
EXTRACT_16BITS(&slarp->un.keep.rel));
- if (length >= SLARP_LEN) { /* uptime-stamp is optional */
- cp += SLARP_LEN;
+ if (length >= SLARP_MAX_LEN) { /* uptime-stamp is optional */
+ cp += SLARP_MIN_LEN;
if (!TTEST2(*cp, 4))
goto trunc;
sec = EXTRACT_32BITS(cp) / 1000;
break;
}
- if (SLARP_LEN < length && vflag)
- printf(", (trailing junk: %d bytes)", length - SLARP_LEN);
+ if (SLARP_MAX_LEN < length && vflag)
+ printf(", (trailing junk: %d bytes)", length - SLARP_MAX_LEN);
if (vflag > 1)
print_unknown_data(cp+4,"\n\t",length-4);
return;