X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/5ee4e508deb94d0a8a0268cd72fd66dcfc680eb5..ca513b2d06ad2db95ab4041cecb4702edc27c0df:/print-ascii.c diff --git a/print-ascii.c b/print-ascii.c index 2f5fe854..b4789435 100644 --- a/print-ascii.c +++ b/print-ascii.c @@ -102,7 +102,7 @@ ascii_print(netdissect_options *ndo, } static void -hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *ident, +hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *indent, const u_char *cp, u_int length, u_int oset) { u_int caplength; @@ -135,7 +135,7 @@ hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *ident, if (i >= HEXDUMP_SHORTS_PER_LINE) { *hsp = *asp = '\0'; ND_PRINT("%s0x%04x: %-*s %s", - ident, oset, HEXDUMP_HEXSTUFF_PER_LINE, + indent, oset, HEXDUMP_HEXSTUFF_PER_LINE, hexstuff, asciistuff); i = 0; hsp = hexstuff; asp = asciistuff; oset += HEXDUMP_BYTES_PER_LINE; @@ -154,7 +154,7 @@ hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *ident, if (i > 0) { *hsp = *asp = '\0'; ND_PRINT("%s0x%04x: %-*s %s", - ident, oset, HEXDUMP_HEXSTUFF_PER_LINE, + indent, oset, HEXDUMP_HEXSTUFF_PER_LINE, hexstuff, asciistuff); } if (truncated) @@ -162,10 +162,10 @@ hex_and_ascii_print_with_offset(netdissect_options *ndo, const char *ident, } void -hex_and_ascii_print(netdissect_options *ndo, const char *ident, +hex_and_ascii_print(netdissect_options *ndo, const char *indent, const u_char *cp, u_int length) { - hex_and_ascii_print_with_offset(ndo, ident, cp, length, 0); + hex_and_ascii_print_with_offset(ndo, indent, cp, length, 0); } /* @@ -173,7 +173,7 @@ hex_and_ascii_print(netdissect_options *ndo, const char *ident, */ void hex_print_with_offset(netdissect_options *ndo, - const char *ident, const u_char *cp, u_int length, + const char *indent, const u_char *cp, u_int length, u_int oset) { u_int caplength; @@ -190,7 +190,7 @@ hex_print_with_offset(netdissect_options *ndo, i = 0; while (nshorts != 0) { if ((i++ % 8) == 0) { - ND_PRINT("%s0x%04x: ", ident, oset); + ND_PRINT("%s0x%04x: ", indent, oset); oset += HEXDUMP_BYTES_PER_LINE; } s = GET_U_1(cp); @@ -201,7 +201,7 @@ hex_print_with_offset(netdissect_options *ndo, } if (length & 1) { if ((i % 8) == 0) - ND_PRINT("%s0x%04x: ", ident, oset); + ND_PRINT("%s0x%04x: ", indent, oset); ND_PRINT(" %02x", GET_U_1(cp)); } if (truncated) @@ -210,9 +210,9 @@ hex_print_with_offset(netdissect_options *ndo, void hex_print(netdissect_options *ndo, - const char *ident, const u_char *cp, u_int length) + const char *indent, const u_char *cp, u_int length) { - hex_print_with_offset(ndo, ident, cp, length, 0); + hex_print_with_offset(ndo, indent, cp, length, 0); } #ifdef MAIN