From 436ced3bd83f6b3a5b4a206538c56189837add59 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 28 Jan 2016 14:24:19 +0100 Subject: Change istr[] (for invalid string) to be global --- netdissect.h | 2 ++ print-ahcp.c | 1 - print-aoe.c | 1 - print-babel.c | 1 - print-dtp.c | 1 - print-lisp.c | 1 - print-loopback.c | 1 - print-m3ua.c | 1 - print-openflow-1.0.c | 1 - print-openflow.c | 1 - print-ospf.c | 1 - print-rsvp.c | 1 - print-udld.c | 1 - util-print.c | 2 ++ 14 files changed, 4 insertions(+), 12 deletions(-) diff --git a/netdissect.h b/netdissect.h index c2f9bd0a..dc3a473d 100644 --- a/netdissect.h +++ b/netdissect.h @@ -77,6 +77,8 @@ typedef signed char nd_int8_t; #include "ip.h" /* struct ip for nextproto4_cksum() */ extern int32_t thiszone; /* seconds offset from gmt to local time */ +/* invalid string to print '(invalid)' for malformed or corrupted packets */ +extern const char istr[]; #if !defined(HAVE_SNPRINTF) int snprintf (char *str, size_t sz, const char *format, ...) diff --git a/print-ahcp.c b/print-ahcp.c index 5a60e4fe..9f95947d 100644 --- a/print-ahcp.c +++ b/print-ahcp.c @@ -40,7 +40,6 @@ #include "addrtoname.h" static const char tstr[] = " [|ahcp]"; -static const char istr[] = " (invalid)"; #define AHCP_MAGIC_NUMBER 43 #define AHCP_VERSION_1 1 diff --git a/print-aoe.c b/print-aoe.c index abad1548..d4ac4fb7 100644 --- a/print-aoe.c +++ b/print-aoe.c @@ -41,7 +41,6 @@ #include "ether.h" static const char tstr[] = " [|aoe]"; -static const char istr[] = " (invalid)"; #define AOE_V1 1 #define ATA_SECTOR_SIZE 512 diff --git a/print-babel.c b/print-babel.c index c5147323..f4e62f34 100644 --- a/print-babel.c +++ b/print-babel.c @@ -40,7 +40,6 @@ #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); diff --git a/print-dtp.c b/print-dtp.c index 4170cc7a..63bde45b 100644 --- a/print-dtp.c +++ b/print-dtp.c @@ -28,7 +28,6 @@ #include "extract.h" static const char tstr[] = " [|dtp]"; -static const char istr[] = " (invalid)"; #define DTP_HEADER_LEN 1 #define DTP_DOMAIN_TLV 0x0001 diff --git a/print-lisp.c b/print-lisp.c index c6d8809c..757326dc 100644 --- a/print-lisp.c +++ b/print-lisp.c @@ -109,7 +109,6 @@ #include "addrtoname.h" static const char tstr[] = " [|LISP]"; -static const char istr[] = " (invalid)"; #define IPv4_AFI 1 #define IPv6_AFI 2 diff --git a/print-loopback.c b/print-loopback.c index 9e728656..2d5fca5d 100644 --- a/print-loopback.c +++ b/print-loopback.c @@ -42,7 +42,6 @@ #include "addrtoname.h" static const char tstr[] = " [|loopback]"; -static const char istr[] = " (invalid)"; #define LOOPBACK_REPLY 1 #define LOOPBACK_FWDDATA 2 diff --git a/print-m3ua.c b/print-m3ua.c index 40e52389..e4de7131 100644 --- a/print-m3ua.c +++ b/print-m3ua.c @@ -32,7 +32,6 @@ #include "extract.h" static const char tstr[] = " [|m3ua]"; -static const char istr[] = " (invalid)"; /* RFC 4666 */ diff --git a/print-openflow-1.0.c b/print-openflow-1.0.c index bc7fa42b..a1b9f1e0 100644 --- a/print-openflow-1.0.c +++ b/print-openflow-1.0.c @@ -72,7 +72,6 @@ #include "openflow.h" static const char tstr[] = " [|openflow]"; -static const char istr[] = " (invalid)"; #define OFPT_HELLO 0x00 #define OFPT_ERROR 0x01 diff --git a/print-openflow.c b/print-openflow.c index edad2148..07f15de6 100644 --- a/print-openflow.c +++ b/print-openflow.c @@ -42,7 +42,6 @@ #include "oui.h" static const char tstr[] = " [|openflow]"; -static const char istr[] = " (invalid)"; #define OF_VER_1_0 0x01 diff --git a/print-ospf.c b/print-ospf.c index 6d8abf48..e8aa26ce 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -35,7 +35,6 @@ #include "ospf.h" static const char tstr[] = " [|ospf2]"; -static const char istr[] = " (invalid)"; static const struct tok ospf_option_values[] = { { OSPF_OPTION_T, "MultiTopology" }, /* draft-ietf-ospf-mt-09 */ diff --git a/print-rsvp.c b/print-rsvp.c index 59168b82..93f6d670 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -30,7 +30,6 @@ #include "signature.h" static const char tstr[] = " [|rsvp]"; -static const char istr[] = " (invalid)"; /* * RFC 2205 common header diff --git a/print-udld.c b/print-udld.c index 0dc10d3c..22ae338d 100644 --- a/print-udld.c +++ b/print-udld.c @@ -27,7 +27,6 @@ #include "extract.h" static const char tstr[] = " [|udld]"; -static const char istr[] = " (invalid)"; #define UDLD_HEADER_LEN 4 #define UDLD_DEVICE_ID_TLV 0x0001 diff --git a/util-print.c b/util-print.c index bcb14337..6858ce36 100644 --- a/util-print.c +++ b/util-print.c @@ -57,6 +57,8 @@ #include "timeval-operations.h" int32_t thiszone; /* seconds offset from gmt to local time */ +/* invalid string to print '(invalid)' for malformed or corrupted packets */ +const char istr[] = " (invalid)"; /* * timestamp display buffer size, the biggest size of both formats is needed -- cgit v1.2.1