From: Francois-Xavier Le Bail Date: Sun, 6 Sep 2015 18:05:50 +0000 (+0200) Subject: Rename cstr[] to istr[] like invalid string X-Git-Tag: tcpdump-4.8.0~172 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/3fb4560e1ebe3144a0f475373eeaaaf7ca91f501 Rename cstr[] to istr[] like invalid string Moreover: Hamonise the output for error messages Add istr[] in print-babel.c --- diff --git a/print-ahcp.c b/print-ahcp.c index 5d79f0fe..ebc74091 100644 --- a/print-ahcp.c +++ b/print-ahcp.c @@ -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: diff --git a/print-aoe.c b/print-aoe.c index 02eda7d9..6a3cbb03 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -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: diff --git a/print-babel.c b/print-babel.c index ea724666..2e9c26ca 100644 --- a/print-babel.c +++ b/print-babel.c @@ -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; } diff --git a/print-loopback.c b/print-loopback.c index fa679512..1391ba71 100644 --- a/print-loopback.c +++ b/print-loopback.c @@ -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: diff --git a/print-m3ua.c b/print-m3ua.c index 463a9540..9e37a9fb 100644 --- a/print-m3ua.c +++ b/print-m3ua.c @@ -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: diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index fd3ac3b0..a9817599 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -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; diff --git a/print-openflow.c b/print-openflow.c index 233efc99..b1315f03 100644 --- a/print-openflow.c +++ b/print-openflow.c @@ -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: