]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Rename cstr[] to istr[] like invalid string
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 6 Sep 2015 18:05:50 +0000 (20:05 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 6 Sep 2015 18:47:42 +0000 (20:47 +0200)
Moreover:
Hamonise the output for error messages
Add istr[] in print-babel.c

print-ahcp.c
print-aoe.c
print-babel.c
print-loopback.c
print-m3ua.c
print-openflow-1.0.c
print-openflow.c

index 5d79f0fe54e5394f8dce56fc5005a769b720e36c..ebc7409173791e2d8f44d5c44ab656d445e8533d 100644 (file)
@@ -40,7 +40,7 @@
 #include "addrtoname.h"
 
 static const char tstr[] = " [|ahcp]";
-static const char cstr[] = "(invalid)";
+static const char istr[] = " (invalid)";
 
 #define AHCP_MAGIC_NUMBER 43
 #define AHCP_VERSION_1 1
@@ -118,7 +118,7 @@ ahcp_time_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -136,7 +136,7 @@ ahcp_seconds_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -164,7 +164,7 @@ ahcp_ipv6_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -188,7 +188,7 @@ ahcp_ipv4_addresses_print(netdissect_options *ndo, const u_char *cp, const u_cha
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -216,7 +216,7 @@ ahcp_ipv6_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -240,7 +240,7 @@ ahcp_ipv4_prefixes_print(netdissect_options *ndo, const u_char *cp, const u_char
        return 0;
 
 invalid:
-       ND_PRINT((ndo, ": %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return 0;
 trunc:
@@ -301,7 +301,7 @@ ahcp1_options_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return;
 
 invalid:
-       ND_PRINT((ndo, " %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -346,7 +346,7 @@ ahcp1_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep)
        return;
 
 invalid:
-       ND_PRINT((ndo, " %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -412,7 +412,7 @@ ahcp_print(netdissect_options *ndo, const u_char *cp, const u_int len)
        return;
 
 invalid:
-       ND_PRINT((ndo, " %s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
index 02eda7d9b2a759a45ee4e79fdbc2f964e5fcbe96..6a3cbb0322b629ac45085444e7080afa71c8faaf 100644 (file)
@@ -41,7 +41,7 @@
 #include "ether.h"
 
 static const char tstr[] = " [|aoe]";
-static const char cstr[] = " (invalid)";
+static const char istr[] = " (invalid)";
 
 #define AOE_V1 1
 #define ATA_SECTOR_SIZE 512
@@ -197,7 +197,7 @@ aoev1_issue_print(netdissect_options *ndo,
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -246,7 +246,7 @@ aoev1_query_print(netdissect_options *ndo,
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -297,7 +297,7 @@ aoev1_mac_print(netdissect_options *ndo,
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -332,7 +332,7 @@ aoev1_reserve_print(netdissect_options *ndo,
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -390,7 +390,7 @@ aoev1_print(netdissect_options *ndo,
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -422,7 +422,7 @@ aoe_print(netdissect_options *ndo,
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
index ea724666e25068c3e6626c35cf579701a27bc21f..2e9c26caa7e358b56f3cb2b40d77745024cedf3f 100644 (file)
@@ -40,6 +40,7 @@
 #include "extract.h"
 
 static const char tstr[] = "[|babel]";
+static const char istr[] = " (invalid)";
 
 static void babel_print_v2(netdissect_options *, const u_char *cp, u_int length);
 
@@ -337,7 +338,7 @@ subtlvs_print(netdissect_options *ndo,
     return;
 
  invalid:
-    ND_PRINT((ndo, " (invalid)"));
+    ND_PRINT((ndo, "%s", istr));
 }
 
 #define ICHECK(i, l) \
@@ -718,6 +719,6 @@ babel_print_v2(netdissect_options *ndo,
     return;
 
  invalid:
-    ND_PRINT((ndo, " (invalid)"));
+    ND_PRINT((ndo, "%s", istr));
     return;
 }
index fa679512aa8a49f12baf4084a58f526c429e08d1..1391ba71bebfeff835714a90512ef693f9418d1d 100644 (file)
@@ -42,7 +42,7 @@
 #include "addrtoname.h"
 
 static const char tstr[] = " [|loopback]";
-static const char cstr[] = " (invalid)";
+static const char istr[] = " (invalid)";
 
 #define LOOPBACK_REPLY   1
 #define LOOPBACK_FWDDATA 2
@@ -97,7 +97,7 @@ loopback_message_print(netdissect_options *ndo, const u_char *cp, const u_int le
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
@@ -126,7 +126,7 @@ loopback_print(netdissect_options *ndo, const u_char *cp, const u_int len)
        return;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return;
 trunc:
index 463a9540f474a9f6cb1370c26c1e65ddc091447c..9e37a9fb4b944c475f519a75d970a669757085c6 100644 (file)
@@ -32,7 +32,7 @@
 #include "extract.h"
 
 static const char tstr[] = " [|m3ua]";
-static const char cstr[] = " (invalid)";
+static const char istr[] = " (invalid)";
 
 /* RFC 4666 */
 
@@ -229,7 +229,7 @@ tag_value_print(netdissect_options *ndo,
   return;
 
 invalid:
-  ND_PRINT((ndo, "%s", cstr));
+  ND_PRINT((ndo, "%s", istr));
   ND_TCHECK2(*buf, size);
   return;
 trunc:
@@ -277,7 +277,7 @@ m3ua_tags_print(netdissect_options *ndo,
   return;
 
 invalid:
-  ND_PRINT((ndo, "%s", cstr));
+  ND_PRINT((ndo, "%s", istr));
   ND_TCHECK2(*buf, size);
   return;
 trunc:
@@ -329,7 +329,7 @@ m3ua_print(netdissect_options *ndo,
   return;
 
 invalid:
-  ND_PRINT((ndo, "%s", cstr));
+  ND_PRINT((ndo, "%s", istr));
   ND_TCHECK2(*buf, size);
   return;
 trunc:
index fd3ac3b06738e26d548f256f7b6c15ad032c4ff5..a981759951feefce70183b87b96421b064a92550 100644 (file)
@@ -72,7 +72,7 @@
 #include "openflow.h"
 
 static const char tstr[] = " [|openflow]";
-static const char cstr[] = " (invalid)";
+static const char istr[] = " (invalid)";
 
 #define OFPT_HELLO                    0x00
 #define OFPT_ERROR                    0x01
@@ -948,7 +948,7 @@ of10_bsn_message_print(netdissect_options *ndo,
        return cp;
 
 invalid: /* skip the undersized data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len);
        return cp0 + len;
 trunc:
@@ -1022,7 +1022,7 @@ of10_bsn_actions_print(netdissect_options *ndo,
        return cp;
 
 invalid:
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len);
        return cp0 + len;
 trunc:
@@ -1051,7 +1051,7 @@ of10_vendor_action_print(netdissect_options *ndo,
        return decoder(ndo, cp, ep, len - 4);
 
 invalid: /* skip the undersized data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, len);
        return cp + len;
 trunc:
@@ -1080,7 +1080,7 @@ of10_vendor_message_print(netdissect_options *ndo,
        return decoder(ndo, cp, ep, len - 4);
 
 invalid: /* skip the undersized data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, len);
        return cp + len;
 trunc:
@@ -1106,7 +1106,7 @@ of10_vendor_data_print(netdissect_options *ndo,
        return of10_data_print(ndo, cp, ep, len - 4);
 
 invalid: /* skip the undersized data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, len);
        return cp + len;
 trunc:
@@ -1203,7 +1203,7 @@ next_port:
        return cp;
 
 invalid: /* skip the undersized trailing data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -1279,7 +1279,7 @@ next_property:
        return cp;
 
 invalid: /* skip the rest of queue properties */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -1327,7 +1327,7 @@ next_queue:
        return cp;
 
 invalid: /* skip the rest of queues */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -1598,7 +1598,7 @@ next_action:
        return cp;
 
 invalid: /* skip the rest of actions */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -1815,7 +1815,7 @@ of10_stats_request_print(netdissect_options *ndo,
        return cp;
 
 invalid: /* skip the message body */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -1862,7 +1862,7 @@ of10_desc_stats_reply_print(netdissect_options *ndo,
        return cp + DESC_STR_LEN;
 
 invalid: /* skip the message body */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, len);
        return cp + len;
 trunc:
@@ -1943,7 +1943,7 @@ of10_flow_stats_reply_print(netdissect_options *ndo,
        return cp;
 
 invalid: /* skip the rest of flow statistics entries */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -1976,7 +1976,7 @@ of10_aggregate_stats_reply_print(netdissect_options *ndo,
        return cp + 4;
 
 invalid: /* skip the message body */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, len);
        return cp + len;
 trunc:
@@ -2035,7 +2035,7 @@ of10_table_stats_reply_print(netdissect_options *ndo,
        return cp;
 
 invalid: /* skip the undersized trailing data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -2120,7 +2120,7 @@ next_port:
        return cp;
 
 invalid: /* skip the undersized trailing data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -2168,7 +2168,7 @@ of10_queue_stats_reply_print(netdissect_options *ndo,
        return cp;
 
 invalid: /* skip the undersized trailing data */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -2246,7 +2246,7 @@ of10_packet_out_print(netdissect_options *ndo,
        return of10_packet_data_print(ndo, cp, ep, len - OF_PACKET_OUT_LEN - actions_len);
 
 invalid: /* skip the rest of the message body */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp0, len0);
        return cp0 + len0;
 trunc:
@@ -2549,7 +2549,7 @@ of10_header_body_print(netdissect_options *ndo,
        goto next_message;
 
 invalid: /* skip the message body */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
 next_message:
        ND_TCHECK2(*cp0, len0 - OF_HEADER_LEN);
        return cp0 + len0 - OF_HEADER_LEN;
index 233efc99c53946505c04714d41c7c8d8524ef87d..b1315f03476805898d872f2a584ead97ae450ec1 100644 (file)
@@ -42,7 +42,7 @@
 #include "oui.h"
 
 static const char tstr[] = " [|openflow]";
-static const char cstr[] = " (invalid)";
+static const char istr[] = " (invalid)";
 
 #define OF_VER_1_0    0x01
 
@@ -120,7 +120,7 @@ of_header_body_print(netdissect_options *ndo, const u_char *cp, const u_char *ep
        }
 
 invalid: /* fail current packet */
-       ND_PRINT((ndo, "%s", cstr));
+       ND_PRINT((ndo, "%s", istr));
        ND_TCHECK2(*cp, ep - cp);
        return ep;
 trunc: