u_short snet;
u_int hdrlen;
+ if (length < sizeof(*lp)) {
+ (void)printf(" [|llap %u]", length);
+ return (length);
+ }
lp = (const struct LAP *)bp;
bp += sizeof(*lp);
length -= sizeof(*lp);
case lapShortDDP:
if (length < ddpSSize) {
- (void)printf(" [|sddp %d]", length);
+ (void)printf(" [|sddp %u]", length);
return (length);
}
sdp = (const struct atShortDDP *)bp;
case lapDDP:
if (length < ddpSize) {
- (void)printf(" [|ddp %d]", length);
+ (void)printf(" [|ddp %u]", length);
return (length);
}
dp = (const struct atDDP *)bp;
#endif
default:
- printf("%d > %d at-lap#%d %d",
+ printf("%d > %d at-lap#%d %u",
lp->src, lp->dst, lp->type, length);
break;
}
printf("AT ");
if (length < ddpSize) {
- (void)printf(" [|ddp %d]", length);
+ (void)printf(" [|ddp %u]", length);
return;
}
dp = (const struct atDDP *)bp;
fputs(tstr, stdout);
return;
}
+ if (length < sizeof(*ap)) {
+ (void)printf(" [|atp %u]", length);
+ return;
+ }
length -= sizeof(*ap);
switch (ap->control & 0xc0) {
atp_bitmap_print(ap->bitmap);
if (length != 0)
- (void)printf(" [len=%d]", length);
+ (void)printf(" [len=%u]", length);
switch (ap->control & (atpEOM|atpSTS)) {
case atpEOM:
break;
case atpRspCode:
- (void)printf(" atp-resp%s%d:%d (%d)",
+ (void)printf(" atp-resp%s%d:%d (%u)",
ap->control & atpEOM? "*" : " ",
EXTRACT_16BITS(&ap->transID), ap->bitmap, length);
switch (ap->control & (atpXO|atpSTS)) {
/* length should be zero */
if (length)
- (void)printf(" [len=%d]", length);
+ (void)printf(" [len=%u]", length);
/* there shouldn't be any control flags */
if (ap->control & (atpXO|atpEOM|atpSTS)) {
break;
default:
- (void)printf(" atp-0x%x %d (%d)", ap->control,
+ (void)printf(" atp-0x%x %d (%u)", ap->control,
EXTRACT_16BITS(&ap->transID), length);
break;
}
const u_char *ep;
if (length < nbpHeaderSize) {
- (void)printf(" truncated-nbp %d", length);
+ (void)printf(" truncated-nbp %u", length);
return;
}
length -= nbpHeaderSize;
if (length < 8) {
/* must be room for at least one tuple */
- (void)printf(" truncated-nbp %d", length + nbpHeaderSize);
+ (void)printf(" truncated-nbp %u", length + nbpHeaderSize);
return;
}
/* ep points to end of available data */
break;
default:
- (void)printf(" nbp-0x%x %d (%d)", np->control, np->id,
+ (void)printf(" nbp-0x%x %d (%u)", np->control, np->id,
length);
break;
}