X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b9811ef5bb1b7d45a90e042f81f3aaf233c8bcb2..refs/heads/master:/print-ppp.c diff --git a/print-ppp.c b/print-ppp.c index 9aed23eb..f7af42a5 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -31,9 +31,7 @@ * o BAP support */ -#ifdef HAVE_CONFIG_H #include -#endif #include "netdissect-stdinc.h" @@ -697,7 +695,6 @@ print_lcp_config_options(netdissect_options *ndo, ND_PRINT(" (length bogus, should be >= 3)"); return 0; } - ND_PRINT(": "); ND_PRINT(": Callback Operation %s (%u)", tok2str(ppp_callback_values, "Unknown", GET_U_1(p + 2)), GET_U_1(p + 2)); @@ -874,19 +871,13 @@ handle_chap(netdissect_options *ndo, } name_size = len - (u_int)(p - p0); ND_PRINT(", Name "); - for (i = 0; i < name_size; i++) { - fn_print_char(ndo, GET_U_1(p)); - p++; - } + nd_printjn(ndo, p, name_size); break; case CHAP_SUCC: case CHAP_FAIL: msg_size = len - (u_int)(p - p0); ND_PRINT(", Msg "); - for (i = 0; i< msg_size; i++) { - fn_print_char(ndo, GET_U_1(p)); - p++; - } + nd_printjn(ndo, p, msg_size); break; } } @@ -899,7 +890,6 @@ handle_pap(netdissect_options *ndo, u_int code, len; u_int peerid_len, passwd_len, msg_len; const u_char *p0; - u_int i; p0 = p; if (length < 1) { @@ -944,10 +934,8 @@ handle_pap(netdissect_options *ndo, if (length - (p - p0) < peerid_len) return; ND_PRINT(", Peer "); - for (i = 0; i < peerid_len; i++) { - fn_print_char(ndo, GET_U_1(p)); - p++; - } + nd_printjn(ndo, p, peerid_len); + p += peerid_len; if (length - (p - p0) < 1) return; @@ -956,10 +944,7 @@ handle_pap(netdissect_options *ndo, if (length - (p - p0) < passwd_len) return; ND_PRINT(", Name "); - for (i = 0; i < passwd_len; i++) { - fn_print_char(ndo, GET_U_1(p)); - p++; - } + nd_printjn(ndo, p, passwd_len); break; case PAP_AACK: case PAP_ANAK: @@ -977,10 +962,7 @@ handle_pap(netdissect_options *ndo, if (length - (p - p0) < msg_len) return; ND_PRINT(", Msg "); - for (i = 0; i< msg_len; i++) { - fn_print_char(ndo, GET_U_1(p)); - p++; - } + nd_printjn(ndo, p, msg_len); break; } return;