X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/7ae15799542662cb1e860a6befc250fa199fd880..e69972a8ef1ddbf73924e42f76f53a1f9d0aab0a:/print-radius.c diff --git a/print-radius.c b/print-radius.c index 4c186510..658bb532 100644 --- a/print-radius.c +++ b/print-radius.c @@ -104,7 +104,7 @@ #define PRINT_HEX(bytes_len, ptr_data) \ while(bytes_len) \ { \ - ND_PRINT("%02X", *ptr_data ); \ + ND_PRINT("%02X", GET_U_1(ptr_data)); \ ptr_data++; \ bytes_len--; \ } @@ -214,7 +214,7 @@ static void print_attr_location_information(netdissect_options *, const u_char * static void print_attr_location_data(netdissect_options *, const u_char *, u_int, u_short); static void print_basic_location_policy_rules(netdissect_options *, const u_char *, u_int, u_short); static void print_attr_time(netdissect_options *, const u_char *, u_int, u_short); -static void print_attr_vector64(netdissect_options *, register const u_char *, u_int, u_short); +static void print_attr_vector64(netdissect_options *, const u_char *, u_int, u_short); static void print_attr_strange(netdissect_options *, const u_char *, u_int, u_short); @@ -854,8 +854,6 @@ print_vendor_attr(netdissect_options *ndo, vendor_id); while (length >= 2) { - ND_TCHECK_2(data); - vendor_type = GET_U_1(data); vendor_length = GET_U_1(data + 1); @@ -910,7 +908,6 @@ print_attr_num(netdissect_options *ndo, return; } - ND_TCHECK_4(data); /* This attribute has standard values */ if (attr_type[attr_code].siz_subtypes) { @@ -1007,11 +1004,6 @@ print_attr_num(netdissect_options *ndo, } /* switch */ } /* if-else */ - - return; - - trunc: - nd_print_trunc(ndo); } /*****************************/ @@ -1031,8 +1023,6 @@ print_attr_address(netdissect_options *ndo, return; } - ND_TCHECK_4(data); - switch(attr_code) { case FRM_IPADDR: @@ -1050,11 +1040,6 @@ print_attr_address(netdissect_options *ndo, ND_PRINT("%s", GET_IPADDR_STRING(data)); break; } - - return; - - trunc: - nd_print_trunc(ndo); } /*****************************/ @@ -1099,7 +1084,7 @@ print_attr_netmask6(netdissect_options *ndo, if (length > 2) memcpy(data2, data+2, length-2); - ND_PRINT("%s/%u", ip6addr_string(ndo, data2), GET_U_1(data + 1)); + ND_PRINT("%s/%u", ip6addr_string(ndo, data2), GET_U_1(data + 1)); /* local buffer, not packet data; don't use GET_IP6ADDR_STRING() */ if (GET_U_1(data + 1) > 8 * (length - 2)) ND_PRINT(" (inconsistent prefix length)"); @@ -1150,7 +1135,7 @@ print_attr_operator_name(netdissect_options *ndo, data++; ND_PRINT("[%s] ", tok2str(operator_name_vector, "unknown namespace %u", namespace_value)); - nd_printn(ndo, data, length - 1, NULL); + nd_printjn(ndo, data, length - 1); return; @@ -1198,7 +1183,7 @@ print_attr_location_information(netdissect_options *ndo, data += 8; ND_PRINT("method \""); - nd_printn(ndo, data, length - 20, NULL); + nd_printjn(ndo, data, length - 20); ND_PRINT("\""); return; @@ -1262,7 +1247,7 @@ print_basic_location_policy_rules(netdissect_options *ndo, if (length > 10) { ND_PRINT(", note well \""); - nd_printn(ndo, data, length - 10, NULL); + nd_printjn(ndo, data, length - 10); ND_PRINT("\""); } @@ -1303,7 +1288,7 @@ print_attr_time(netdissect_options *ndo, static void print_attr_vector64(netdissect_options *ndo, - register const u_char *data, u_int length, u_short attr_code _U_) + const u_char *data, u_int length, u_short attr_code _U_) { uint64_t data_value, i; const char *sep = ""; @@ -1329,8 +1314,6 @@ print_attr_vector64(netdissect_options *ndo, } ND_PRINT("]"); - - return; } /***********************************/ @@ -1356,11 +1339,9 @@ print_attr_strange(netdissect_options *ndo, return; } ND_PRINT("User_challenge ("); - ND_TCHECK_8(data); len_data = 8; PRINT_HEX(len_data, data); ND_PRINT(") User_resp("); - ND_TCHECK_8(data); len_data = 8; PRINT_HEX(len_data, data); ND_PRINT(")"); @@ -1380,15 +1361,12 @@ print_attr_strange(netdissect_options *ndo, ND_PRINT(", Min password length: %u", GET_U_1(data)); data++; ND_PRINT(", created at: "); - ND_TCHECK_4(data); len_data = 4; PRINT_HEX(len_data, data); ND_PRINT(", expires in: "); - ND_TCHECK_4(data); len_data = 4; PRINT_HEX(len_data, data); ND_PRINT(", Current Time: "); - ND_TCHECK_4(data); len_data = 4; PRINT_HEX(len_data, data); break; @@ -1399,7 +1377,6 @@ print_attr_strange(netdissect_options *ndo, ND_PRINT("ERROR: length %u != 8", length); return; } - ND_TCHECK_8(data); len_data = 8; PRINT_HEX(len_data, data); break; @@ -1416,9 +1393,6 @@ print_attr_strange(netdissect_options *ndo, break; } return; - - trunc: - nd_print_trunc(ndo); } static void