]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ospf6.c
Clean up whitespaces
[tcpdump] / print-ospf6.c
index e115d8e8d09268e37ff816fb0f97e70f8e4f8be2..756d25e21a92e55577c7d79d400d8d63564dd9cc 100644 (file)
@@ -284,7 +284,6 @@ struct lsu6 {
     struct lsa6 lsu_lsa[1]; /* may repeat      */
 };
 
-static const char tstr[] = " [|ospf3]";
 
 static const struct tok ospf6_option_values[] = {
        { OSPF6_OPTION_V6,      "V6" },
@@ -412,7 +411,7 @@ ospf6_print_lsaprefix(netdissect_options *ndo,
 {
        const struct lsa6_prefix *lsapp = (const struct lsa6_prefix *)tptr;
        u_int wordlen;
-       struct in6_addr prefix;
+       nd_ipv6 prefix;
 
        if (lsa_length < sizeof (*lsapp) - IPV6_ADDR_LEN_BYTES)
                goto trunc;
@@ -427,10 +426,10 @@ ospf6_print_lsaprefix(netdissect_options *ndo,
                goto trunc;
        lsa_length -= wordlen * 4;
        ND_TCHECK_LEN(lsapp->lsa_p_prefix, wordlen * 4);
-       memset(&prefix, 0, sizeof(prefix));
-       memcpy(&prefix, lsapp->lsa_p_prefix, wordlen * 4);
-       ND_PRINT("\n\t\t%s/%u", ip6addr_string(ndo, (const u_char *)&prefix),
-               EXTRACT_U_1(lsapp->lsa_p_len));
+       memset(prefix, 0, sizeof(prefix));
+       memcpy(prefix, lsapp->lsa_p_prefix, wordlen * 4);
+       ND_PRINT("\n\t\t%s/%u", ip6addr_string(ndo, prefix),
+                EXTRACT_U_1(lsapp->lsa_p_len));
         if (EXTRACT_U_1(lsapp->lsa_p_opt)) {
             ND_PRINT(", Options [%s]",
                    bittok2str(ospf6_lsa_prefix_option_values,
@@ -483,7 +482,7 @@ ospf6_print_lsa(netdissect_options *ndo,
         * header.
         */
         if (length < sizeof(struct lsa6_hdr) || (const u_char *)lsap + length > dataend)
-               return (1);
+               return (1);
         lsa_length = length - sizeof(struct lsa6_hdr);
         tptr = (const uint8_t *)lsap+sizeof(struct lsa6_hdr);
 
@@ -693,13 +692,13 @@ ospf6_print_lsa(netdissect_options *ndo,
                break;
 
         case LS_TYPE_GRACE | LS_SCOPE_LINKLOCAL:
-                if (ospf_print_grace_lsa(ndo, tptr, lsa_length) == -1) {
+                if (ospf_grace_lsa_print(ndo, tptr, lsa_length) == -1) {
                     return 1;
                 }
                 break;
 
         case LS_TYPE_INTRA_ATE | LS_SCOPE_LINKLOCAL:
-                if (ospf_print_te_lsa(ndo, tptr, lsa_length) == -1) {
+                if (ospf_te_lsa_print(ndo, tptr, lsa_length) == -1) {
                     return 1;
                 }
                 break;
@@ -962,6 +961,7 @@ ospf6_print(netdissect_options *ndo,
        const char *cp;
        uint16_t datalen;
 
+       ndo->ndo_protocol = "ospf3";
        op = (const struct ospf6hdr *)bp;
 
        /* If the type is valid translate it, or just print the type */
@@ -1011,5 +1011,5 @@ ospf6_print(netdissect_options *ndo,
 
        return;
 trunc:
-       ND_PRINT("%s", tstr);
+       nd_print_trunc(ndo);
 }