]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use nd_print_protocol_caps() to print the protocol name in caps
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 23 Jun 2019 07:54:14 +0000 (09:54 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 23 Jun 2019 12:22:19 +0000 (14:22 +0200)
print-ipoib.c
print-isoclns.c
print-ssh.c
util-print.c

index c0ebf03387a44be58afbb36f7a77f110c4a896b4..bbda3ad685c41e6c68bb6a65079e86fe5e7c34d3 100644 (file)
@@ -81,7 +81,7 @@ ipoib_print(netdissect_options *ndo, const u_char *p, u_int length, u_int caplen
        }
 
        if (ndo->ndo_eflag) {
-               ND_PRINT("IPOIB");
+               nd_print_protocol_caps(ndo);
                if (print_encap_header != NULL)
                        (*print_encap_header)(encap_header_arg);
                ipoib_hdr_print(ndo, p, length);
index b154f8e26524745aa3b682a5e149302819474776..96a16bc3155b84aa38520895eedf31175547eeae 100644 (file)
@@ -786,7 +786,7 @@ clnp_print(netdissect_options *ndo,
         optr = pptr;
 
         if (!ndo->ndo_eflag)
-            ND_PRINT("CLNP");
+            nd_print_protocol_caps(ndo);
 
         /*
          * Sanity checking of the header.
index 0126bd0ed175b2d1bd478994e9c6023c524867dc..bb983355a29228842a90e435b2873b027d4bcb3b 100644 (file)
@@ -29,7 +29,6 @@ static int
 ssh_print_version(netdissect_options *ndo, const u_char *pptr, u_int len)
 {
        u_int idx = 0;
-       const char *pnp;
 
        if ( GET_U_1(pptr+idx) != 'S' )
                return 0;
@@ -86,9 +85,7 @@ trunc:
        return -1;
 print:
        ND_PRINT(": ");
-       /* Capitalize the protocol name */
-       for (pnp = ndo->ndo_protocol; *pnp != '\0'; pnp++)
-               ND_PRINT("%c", ND_TOUPPER((u_char)*pnp));
+       nd_print_protocol_caps(ndo);
        ND_PRINT(": %.*s", (int)idx, pptr);
        return idx;
 }
index 9436711107f2bc0adf31689af9200b4eee343eb0..fd3e654d863964a67d47591bb0ce80dc17f1be88 100644 (file)
@@ -845,7 +845,6 @@ txtproto_print(netdissect_options *ndo, const u_char *pptr, u_int len,
        u_char token[MAX_TOKEN+1];
        const char *cmd;
        int print_this = 0;
-       const char *pnp;
 
        if (cmds != NULL) {
                /*
@@ -910,9 +909,7 @@ txtproto_print(netdissect_options *ndo, const u_char *pptr, u_int len,
                print_this = 1;
        }
 
-       /* Capitalize the protocol name */
-       for (pnp = ndo->ndo_protocol; *pnp != '\0'; pnp++)
-               ND_PRINT("%c", ND_TOUPPER((u_char)*pnp));
+       nd_print_protocol_caps(ndo);
 
        if (print_this) {
                /*