]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-radius.c
bgp: Parse BGP extended message support capability
[tcpdump] / print-radius.c
index 8c33438f2ed00fbb4935b93913fe30bbd63b2d06..b3bf8ff7df1c93d82d3e725f218f682ad6389bcb 100644 (file)
@@ -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);
 
 
@@ -845,7 +845,6 @@ print_vendor_attr(netdissect_options *ndo,
 
     if (length < 4)
         goto trunc;
-    ND_TCHECK_4(data);
     vendor_id = GET_BE_U_4(data);
     data+=4;
     length-=4;
@@ -855,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);
 
@@ -911,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)
    {
@@ -1008,11 +1004,6 @@ print_attr_num(netdissect_options *ndo,
       } /* switch */
 
    } /* if-else */
-
-   return;
-
-   trunc:
-     nd_print_trunc(ndo);
 }
 
 /*****************************/
@@ -1032,8 +1023,6 @@ print_attr_address(netdissect_options *ndo,
        return;
    }
 
-   ND_TCHECK_4(data);
-
    switch(attr_code)
    {
       case FRM_IPADDR:
@@ -1051,11 +1040,6 @@ print_attr_address(netdissect_options *ndo,
           ND_PRINT("%s", GET_IPADDR_STRING(data));
       break;
    }
-
-   return;
-
-   trunc:
-     nd_print_trunc(ndo);
 }
 
 /*****************************/
@@ -1075,14 +1059,7 @@ print_attr_address6(netdissect_options *ndo,
        return;
    }
 
-   ND_TCHECK_16(data);
-
    ND_PRINT("%s", GET_IP6ADDR_STRING(data));
-
-   return;
-
-   trunc:
-     nd_print_trunc(ndo);
 }
 
 static void
@@ -1158,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;
 
@@ -1206,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;
@@ -1270,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("\"");
    }
 
@@ -1302,22 +1279,16 @@ print_attr_time(netdissect_options *ndo,
        return;
    }
 
-   ND_TCHECK_4(data);
-
    attr_time = GET_BE_U_4(data);
    strlcpy(string, ctime(&attr_time), sizeof(string));
    /* Get rid of the newline */
    string[24] = '\0';
    ND_PRINT("%.24s", string);
-   return;
-
-   trunc:
-     nd_print_trunc(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 = "";
@@ -1343,8 +1314,6 @@ print_attr_vector64(netdissect_options *ndo,
    }
 
    ND_PRINT("]");
-
-   return;
 }
 
 /***********************************/
@@ -1386,13 +1355,11 @@ print_attr_strange(netdissect_options *ndo,
                ND_PRINT("ERROR: length %u != 14", length);
                return;
            }
-           ND_TCHECK_1(data);
            if (GET_U_1(data))
               ND_PRINT("User can change password");
            else
               ND_PRINT("User cannot change password");
            data++;
-           ND_TCHECK_1(data);
            ND_PRINT(", Min password length: %u", GET_U_1(data));
            data++;
            ND_PRINT(", created at: ");
@@ -1426,7 +1393,6 @@ print_attr_strange(netdissect_options *ndo,
                ND_PRINT("Error: length %u != 4", length);
                return;
            }
-           ND_TCHECK_4(data);
 
            error_cause_value = GET_BE_U_4(data);
            ND_PRINT("Error cause %u: %s", error_cause_value, tok2str(errorcausetype, "Error-Cause %u not known", error_cause_value));