X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/bf93670b6c3a5f8527c06f8981f525ecb384f443..refs/pull/482/head:/print-smb.c diff --git a/print-smb.c b/print-smb.c index f5be9ffc..0147b20d 100644 --- a/print-smb.c +++ b/print-smb.c @@ -6,16 +6,15 @@ * or later */ -#define NETDISSECT_REWORKED #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include #include -#include "interface.h" +#include "netdissect.h" #include "extract.h" #include "smb.h" @@ -100,7 +99,7 @@ trans2_findfirst(netdissect_options *ndo, smb_fdata(ndo, param, fmt, param + pcnt, unicodestr); if (dcnt) { ND_PRINT((ndo, "data:\n")); - print_data(ndo, data, dcnt); + smb_print_data(ndo, data, dcnt); } } @@ -135,7 +134,7 @@ trans2_qfsinfo(netdissect_options *ndo, } if (dcnt) { ND_PRINT((ndo, "data:\n")); - print_data(ndo, data, dcnt); + smb_print_data(ndo, data, dcnt); } return; trunc: @@ -416,7 +415,7 @@ print_negprot(netdissect_options *ndo, smb_fdata(ndo, words + 1, f1, min(words + 1 + wct * 2, maxbuf), unicodestr); else - print_data(ndo, words + 1, min(wct * 2, PTR_DIFF(maxbuf, words + 1))); + smb_print_data(ndo, words + 1, min(wct * 2, PTR_DIFF(maxbuf, words + 1))); ND_TCHECK2(*data, 2); bcc = EXTRACT_LE_16BITS(data); @@ -426,7 +425,7 @@ print_negprot(netdissect_options *ndo, smb_fdata(ndo, data + 2, f2, min(data + 2 + EXTRACT_LE_16BITS(data), maxbuf), unicodestr); else - print_data(ndo, data + 2, min(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); + smb_print_data(ndo, data + 2, min(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); } return; trunc: @@ -460,7 +459,7 @@ print_sesssetup(netdissect_options *ndo, smb_fdata(ndo, words + 1, f1, min(words + 1 + wct * 2, maxbuf), unicodestr); else - print_data(ndo, words + 1, min(wct * 2, PTR_DIFF(maxbuf, words + 1))); + smb_print_data(ndo, words + 1, min(wct * 2, PTR_DIFF(maxbuf, words + 1))); ND_TCHECK2(*data, 2); bcc = EXTRACT_LE_16BITS(data); @@ -470,7 +469,7 @@ print_sesssetup(netdissect_options *ndo, smb_fdata(ndo, data + 2, f2, min(data + 2 + EXTRACT_LE_16BITS(data), maxbuf), unicodestr); else - print_data(ndo, data + 2, min(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); + smb_print_data(ndo, data + 2, min(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); } return; trunc: @@ -510,7 +509,7 @@ print_lockingandx(netdissect_options *ndo, smb_fdata(ndo, data + 2, f2, min(data + 2 + EXTRACT_LE_16BITS(data), maxbuf), unicodestr); else - print_data(ndo, data + 2, min(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); + smb_print_data(ndo, data + 2, min(EXTRACT_LE_16BITS(data), PTR_DIFF(maxbuf, data + 2))); } return; trunc: @@ -883,7 +882,7 @@ print_smb(netdissect_options *ndo, } else { if (bcc > 0) { ND_PRINT((ndo, "smb_buf[]=\n")); - print_data(ndo, data + 2, min(bcc, PTR_DIFF(maxbuf, data + 2))); + smb_print_data(ndo, data + 2, min(bcc, PTR_DIFF(maxbuf, data + 2))); } } } @@ -1209,7 +1208,7 @@ nbt_udp137_print(netdissect_options *ndo, p += 2; } } else { - print_data(ndo, p, min(rdlen, length - (p - data))); + smb_print_data(ndo, p, min(rdlen, length - (p - data))); p += rdlen; } }