[rtems-libbsd commit] tcpdump: Constify

Sebastian Huber sebh at rtems.org
Mon Mar 11 08:41:18 UTC 2019


Module:    rtems-libbsd
Branch:    master
Commit:    12c2cfb7934cd0be8c90517d6c9e36385c19dc38
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=12c2cfb7934cd0be8c90517d6c9e36385c19dc38

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Mar 11 09:16:02 2019 +0100

tcpdump: Constify

---

 freebsd/contrib/tcpdump/print-802_11.c |  4 ++--
 freebsd/contrib/tcpdump/print-icmp6.c  |  2 +-
 freebsd/contrib/tcpdump/print-isakmp.c | 16 ++++++++--------
 freebsd/contrib/tcpdump/util-print.c   |  4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/freebsd/contrib/tcpdump/print-802_11.c b/freebsd/contrib/tcpdump/print-802_11.c
index 990b577..ff2ac02 100644
--- a/freebsd/contrib/tcpdump/print-802_11.c
+++ b/freebsd/contrib/tcpdump/print-802_11.c
@@ -2809,7 +2809,7 @@ print_radiotap_field(netdissect_options *ndo,
 		uint8_t known;
 		uint8_t flags;
 		uint8_t mcs_index;
-		static const char *ht_bandwidth[4] = {
+		static const char * const ht_bandwidth[4] = {
 			"20 MHz",
 			"40 MHz",
 			"20 MHz (L)",
@@ -2929,7 +2929,7 @@ print_radiotap_field(netdissect_options *ndo,
 		uint8_t coding;
 		uint8_t group_id;
 		uint16_t partial_aid;
-		static const char *vht_bandwidth[32] = {
+		static const char * const vht_bandwidth[32] = {
 			"20 MHz",
 			"40 MHz",
 			"20 MHz (L)",
diff --git a/freebsd/contrib/tcpdump/print-icmp6.c b/freebsd/contrib/tcpdump/print-icmp6.c
index e2d44df..33f36dd 100644
--- a/freebsd/contrib/tcpdump/print-icmp6.c
+++ b/freebsd/contrib/tcpdump/print-icmp6.c
@@ -590,7 +590,7 @@ static const struct tok mldv2report2str[] = {
 static const char *
 get_rtpref(u_int v)
 {
-	static const char *rtpref_str[] = {
+	static const char * const rtpref_str[] = {
 		"medium",		/* 00 */
 		"high",			/* 01 */
 		"rsv",			/* 10 */
diff --git a/freebsd/contrib/tcpdump/print-isakmp.c b/freebsd/contrib/tcpdump/print-isakmp.c
index fd78bf8..bcb1caf 100644
--- a/freebsd/contrib/tcpdump/print-isakmp.c
+++ b/freebsd/contrib/tcpdump/print-isakmp.c
@@ -1343,10 +1343,10 @@ ikev1_id_print(netdissect_options *ndo, u_char tpay _U_,
 #define USE_IPSECDOI_IN_PHASE1	1
 	const struct ikev1_pl_id *p;
 	struct ikev1_pl_id id;
-	static const char *idtypestr[] = {
+	static const char * const idtypestr[] = {
 		"IPv4", "IPv4net", "IPv6", "IPv6net",
 	};
-	static const char *ipsecidtypestr[] = {
+	static const char * const ipsecidtypestr[] = {
 		NULL, "IPv4", "FQDN", "user FQDN", "IPv4net", "IPv6",
 		"IPv6net", "IPv4range", "IPv6range", "ASN1 DN", "ASN1 GN",
 		"keyid",
@@ -1512,7 +1512,7 @@ ikev1_cert_print(netdissect_options *ndo, u_char tpay _U_,
 {
 	const struct ikev1_pl_cert *p;
 	struct ikev1_pl_cert cert;
-	static const char *certstr[] = {
+	static const char * const certstr[] = {
 		"none",	"pkcs7", "pgp", "dns",
 		"x509sign", "x509ke", "kerberos", "crl",
 		"arl", "spki", "x509attr",
@@ -1545,7 +1545,7 @@ ikev1_cr_print(netdissect_options *ndo, u_char tpay _U_,
 {
 	const struct ikev1_pl_cert *p;
 	struct ikev1_pl_cert cert;
-	static const char *certstr[] = {
+	static const char * const certstr[] = {
 		"none",	"pkcs7", "pgp", "dns",
 		"x509sign", "x509ke", "kerberos", "crl",
 		"arl", "spki", "x509attr",
@@ -1667,7 +1667,7 @@ ikev1_n_print(netdissect_options *ndo, u_char tpay _U_,
 	const u_char *ep2;
 	uint32_t doi;
 	uint32_t proto;
-	static const char *notify_error_str[] = {
+	static const char * const notify_error_str[] = {
 		NULL,				"INVALID-PAYLOAD-TYPE",
 		"DOI-NOT-SUPPORTED",		"SITUATION-NOT-SUPPORTED",
 		"INVALID-COOKIE",		"INVALID-MAJOR-VERSION",
@@ -1685,13 +1685,13 @@ ikev1_n_print(netdissect_options *ndo, u_char tpay _U_,
 		"CERTIFICATE-UNAVAILABLE",	"UNSUPPORTED-EXCHANGE-TYPE",
 		"UNEQUAL-PAYLOAD-LENGTHS",
 	};
-	static const char *ipsec_notify_error_str[] = {
+	static const char * const ipsec_notify_error_str[] = {
 		"RESERVED",
 	};
-	static const char *notify_status_str[] = {
+	static const char * const notify_status_str[] = {
 		"CONNECTED",
 	};
-	static const char *ipsec_notify_status_str[] = {
+	static const char * const ipsec_notify_status_str[] = {
 		"RESPONDER-LIFETIME",		"REPLAY-STATUS",
 		"INITIAL-CONTACT",
 	};
diff --git a/freebsd/contrib/tcpdump/util-print.c b/freebsd/contrib/tcpdump/util-print.c
index 7a5269d..8a99553 100644
--- a/freebsd/contrib/tcpdump/util-print.c
+++ b/freebsd/contrib/tcpdump/util-print.c
@@ -401,9 +401,9 @@ void
 unsigned_relts_print(netdissect_options *ndo,
                      uint32_t secs)
 {
-	static const char *lengths[] = {"y", "w", "d", "h", "m", "s"};
+	static const char * const lengths[] = {"y", "w", "d", "h", "m", "s"};
 	static const u_int seconds[] = {31536000, 604800, 86400, 3600, 60, 1};
-	const char **l = lengths;
+	const char * const *l = lengths;
 	const u_int *s = seconds;
 
 	if (secs == 0) {




More information about the vc mailing list