]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-rx.c
Fix small misspellings
[tcpdump] / print-rx.c
index ca6b467274202f18fcc98d8c2a888c6efe2f3848..5e0315ef4ebccf0633d1ee2b0c8f748c309b9b7f 100644 (file)
@@ -534,6 +534,7 @@ rx_print(netdissect_options *ndo,
        uint8_t type, flags;
        uint32_t opcode;
 
+       ndo->ndo_protocol = "rx";
        if (!ND_TTEST_LEN(bp, sizeof(struct rx_header))) {
                ND_PRINT(" [|rx] (%u)", length);
                return;
@@ -697,8 +698,8 @@ rx_cache_insert(netdissect_options *ndo,
                rx_cache_next = 0;
 
        rxent->callnum = EXTRACT_BE_U_4(rxh->callNumber);
-       UNALIGNED_MEMCPY(&rxent->client, &ip->ip_src, sizeof(uint32_t));
-       UNALIGNED_MEMCPY(&rxent->server, &ip->ip_dst, sizeof(uint32_t));
+       UNALIGNED_MEMCPY(&rxent->client, ip->ip_src, sizeof(uint32_t));
+       UNALIGNED_MEMCPY(&rxent->server, ip->ip_dst, sizeof(uint32_t));
        rxent->dport = dport;
        rxent->serviceId = EXTRACT_BE_U_4(rxh->serviceId);
        rxent->opcode = EXTRACT_BE_U_4(bp + sizeof(struct rx_header));
@@ -720,8 +721,8 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport,
        uint32_t clip;
        uint32_t sip;
 
-       UNALIGNED_MEMCPY(&clip, &ip->ip_dst, sizeof(uint32_t));
-       UNALIGNED_MEMCPY(&sip, &ip->ip_src, sizeof(uint32_t));
+       UNALIGNED_MEMCPY(&clip, ip->ip_dst, sizeof(uint32_t));
+       UNALIGNED_MEMCPY(&sip, ip->ip_src, sizeof(uint32_t));
 
        /* Start the search where we last left off */
 
@@ -749,7 +750,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport,
 }
 
 /*
- * These extrememly grody macros handle the printing of various AFS stuff.
+ * These extremely grody macros handle the printing of various AFS stuff.
  */
 
 #define FIDOUT() { uint32_t n1, n2, n3; \
@@ -770,7 +771,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport,
                                goto trunc; \
                        bp += sizeof(uint32_t); \
                        ND_PRINT(" \""); \
-                       if (fn_printn(ndo, bp, _i, ndo->ndo_snapend)) \
+                       if (nd_printn(ndo, bp, _i, ndo->ndo_snapend)) \
                                goto trunc; \
                        ND_PRINT("\""); \
                        bp += ((_i + sizeof(uint32_t) - 1) / sizeof(uint32_t)) * sizeof(uint32_t); \
@@ -868,7 +869,7 @@ rx_cache_find(const struct rx_header *rxh, const struct ip *ip, u_int sport,
                        } \
                        s[(MAX)] = '\0'; \
                        ND_PRINT(" \""); \
-                       fn_print(ndo, s, NULL); \
+                       fn_print_str(ndo, s); \
                        ND_PRINT("\""); \
                }
 
@@ -1022,6 +1023,7 @@ fs_print(netdissect_options *ndo,
                        }
                        if (j == 0)
                                ND_PRINT(" <none!>");
+                       break;
                }
                case 65537:     /* Fetch data 64 */
                        FIDOUT();
@@ -1159,7 +1161,7 @@ acl_print(netdissect_options *ndo,
        char fmt[1024];
 
        if ((user = (char *)malloc(maxsize)) == NULL)
-               return;
+               (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, "acl_print: malloc");
 
        if (sscanf((char *) s, "%d %d\n%n", &pos, &neg, &n) != 2)
                goto finish;
@@ -1189,7 +1191,7 @@ acl_print(netdissect_options *ndo,
                        goto finish;
                s += n;
                ND_PRINT(" +{");
-               fn_print(ndo, (u_char *)user, NULL);
+               fn_print_str(ndo, (u_char *)user);
                ND_PRINT(" ");
                ACLOUT(acl);
                ND_PRINT("}");
@@ -1203,7 +1205,7 @@ acl_print(netdissect_options *ndo,
                        goto finish;
                s += n;
                ND_PRINT(" -{");
-               fn_print(ndo, (u_char *)user, NULL);
+               fn_print_str(ndo, (u_char *)user);
                ND_PRINT(" ");
                ACLOUT(acl);
                ND_PRINT("}");
@@ -1283,6 +1285,7 @@ cb_print(netdissect_options *ndo,
                                bp += sizeof(uint32_t);
                                tok2str(cb_types, "type %u", t);
                        }
+                       break;
                }
                case 214: {
                        ND_PRINT(" afsuuid");
@@ -1744,6 +1747,7 @@ vldb_reply_print(netdissect_options *ndo,
                        INTOUT();
                        ND_PRINT(" nextindex");
                        INTOUT();
+                       ND_FALL_THROUGH;
                case 503:       /* Get entry by id */
                case 504:       /* Get entry by name */
                {       uint32_t nservers, j;
@@ -1760,8 +1764,8 @@ vldb_reply_print(netdissect_options *ndo,
                                ND_TCHECK_4(bp);
                                if (i < nservers)
                                        ND_PRINT(" %s",
-                                          intoa(((const struct in_addr *) bp)->s_addr));
-                               bp += sizeof(uint32_t);
+                                          intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(bp)));
+                               bp += sizeof(nd_ipv4);
                        }
                        ND_PRINT(" partitions");
                        for (i = 0; i < 8; i++) {
@@ -1793,6 +1797,7 @@ vldb_reply_print(netdissect_options *ndo,
                        INTOUT();
                        ND_PRINT(" nextindex");
                        INTOUT();
+                       ND_FALL_THROUGH;
                case 518:       /* Get entry by ID N */
                case 519:       /* Get entry by name N */
                {       uint32_t nservers, j;
@@ -1807,8 +1812,8 @@ vldb_reply_print(netdissect_options *ndo,
                                ND_TCHECK_4(bp);
                                if (i < nservers)
                                        ND_PRINT(" %s",
-                                          intoa(((const struct in_addr *) bp)->s_addr));
-                               bp += sizeof(uint32_t);
+                                          intoa(EXTRACT_IPV4_TO_NETWORK_ORDER(bp)));
+                               bp += sizeof(nd_ipv4);
                        }
                        ND_PRINT(" partitions");
                        for (i = 0; i < 13; i++) {
@@ -2786,7 +2791,7 @@ rx_ack_print(netdissect_options *ndo,
                                 * the range (such as an nacked packet in
                                 * the middle of some acked packets),
                                 * then print the current packet number
-                                * seperated from the last number by
+                                * separated from the last number by
                                 * a comma.
                                 */
 
@@ -2809,7 +2814,7 @@ rx_ack_print(netdissect_options *ndo,
                                 * we hit a nack ... in _this_ case we
                                 * want to print out the range of packets
                                 * that were acked, so we need to print
-                                * the _previous_ packet number seperated
+                                * the _previous_ packet number separated
                                 * from the first by a dash (-).  Since we
                                 * already printed the first packet above,
                                 * just print the final packet.  Don't