Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/tcpdump/print-smb.c
Show First 20 Lines • Show All 1,249 Lines • ▼ Show 20 Lines | goto trunc; | ||||
caplen -= 4; | caplen -= 4; | ||||
startbuf = data; | startbuf = data; | ||||
data += 4; | data += 4; | ||||
if (smb_len >= 4 && caplen >= 4 && memcmp(data,"\377SMB",4) == 0) { | if (smb_len >= 4 && caplen >= 4 && memcmp(data,"\377SMB",4) == 0) { | ||||
if ((int)smb_len > caplen) { | if ((int)smb_len > caplen) { | ||||
if ((int)smb_len > length) | if ((int)smb_len > length) | ||||
ND_PRINT((ndo, "WARNING: Packet is continued in later TCP segments\n")); | ND_PRINT((ndo, " WARNING: Packet is continued in later TCP segments\n")); | ||||
else | else | ||||
ND_PRINT((ndo, "WARNING: Short packet. Try increasing the snap length by %d\n", | ND_PRINT((ndo, " WARNING: Short packet. Try increasing the snap length by %d\n", | ||||
smb_len - caplen)); | smb_len - caplen)); | ||||
} | } else | ||||
ND_PRINT((ndo, " ")); | |||||
print_smb(ndo, data, maxbuf > data + smb_len ? data + smb_len : maxbuf); | print_smb(ndo, data, maxbuf > data + smb_len ? data + smb_len : maxbuf); | ||||
} else | } else | ||||
ND_PRINT((ndo, "SMB-over-TCP packet:(raw data or continuation?)\n")); | ND_PRINT((ndo, " SMB-over-TCP packet:(raw data or continuation?)\n")); | ||||
return; | return; | ||||
trunc: | trunc: | ||||
ND_PRINT((ndo, "%s", tstr)); | ND_PRINT((ndo, "%s", tstr)); | ||||
} | } | ||||
/* | /* | ||||
* print a NBT packet received across udp on port 138 | * print a NBT packet received across udp on port 138 | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 219 Lines • Show Last 20 Lines |