diff options
author | Denis Ovsienko <infrastation@yandex.ru> | 2013-09-24 20:46:24 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2013-09-24 20:54:03 +0400 |
commit | 7de355927bb4dac90db045d52a69bf95c841b807 (patch) | |
tree | 61668ba48012b8bbd61af1fc765ab27cf0233ac3 | |
parent | 1db497c3176b331b768ed1b5326473f8fbca73bf (diff) | |
download | tcpdump-7de355927bb4dac90db045d52a69bf95c841b807.tar.gz |
justify declarations of struct tok arrays
Make sure all of them are declared const and most of them -- static.
Proper declaration of token arrays is a common review point for new code
that is based on existing decoders. Thus fix the issue at its root.
-rw-r--r-- | ppp.h | 2 | ||||
-rw-r--r-- | print-arcnet.c | 2 | ||||
-rw-r--r-- | print-arp.c | 4 | ||||
-rw-r--r-- | print-atalk.c | 4 | ||||
-rw-r--r-- | print-atm.c | 16 | ||||
-rw-r--r-- | print-bgp.c | 40 | ||||
-rw-r--r-- | print-bootp.c | 14 | ||||
-rw-r--r-- | print-cdp.c | 4 | ||||
-rw-r--r-- | print-chdlc.c | 2 | ||||
-rw-r--r-- | print-decnet.c | 2 | ||||
-rw-r--r-- | print-domain.c | 4 | ||||
-rw-r--r-- | print-dtp.c | 2 | ||||
-rw-r--r-- | print-forces.c | 4 | ||||
-rw-r--r-- | print-fr.c | 16 | ||||
-rw-r--r-- | print-gre.c | 2 | ||||
-rw-r--r-- | print-hsrp.c | 2 | ||||
-rw-r--r-- | print-icmp.c | 6 | ||||
-rw-r--r-- | print-icmp6.c | 14 | ||||
-rw-r--r-- | print-igmp.c | 2 | ||||
-rw-r--r-- | print-igrp.c | 2 | ||||
-rw-r--r-- | print-ip.c | 4 | ||||
-rw-r--r-- | print-ipnet.c | 2 | ||||
-rw-r--r-- | print-isoclns.c | 66 | ||||
-rw-r--r-- | print-juniper.c | 14 | ||||
-rw-r--r-- | print-krb.c | 4 | ||||
-rw-r--r-- | print-l2tp.c | 8 | ||||
-rw-r--r-- | print-llc.c | 4 | ||||
-rw-r--r-- | print-lwres.c | 6 | ||||
-rw-r--r-- | print-nflog.c | 2 | ||||
-rw-r--r-- | print-nfs.c | 6 | ||||
-rw-r--r-- | print-ntp.c | 6 | ||||
-rw-r--r-- | print-olsr.c | 6 | ||||
-rw-r--r-- | print-ospf.c | 34 | ||||
-rw-r--r-- | print-ospf6.c | 10 | ||||
-rw-r--r-- | print-pflog.c | 6 | ||||
-rw-r--r-- | print-pim.c | 6 | ||||
-rw-r--r-- | print-ppp.c | 26 | ||||
-rw-r--r-- | print-pppoe.c | 4 | ||||
-rw-r--r-- | print-radius.c | 2 | ||||
-rw-r--r-- | print-rsvp.c | 10 | ||||
-rw-r--r-- | print-rx.c | 26 | ||||
-rw-r--r-- | print-sctp.c | 2 | ||||
-rw-r--r-- | print-sll.c | 2 | ||||
-rw-r--r-- | print-stp.c | 8 | ||||
-rw-r--r-- | print-sunrpc.c | 2 | ||||
-rw-r--r-- | print-tcp.c | 4 | ||||
-rw-r--r-- | print-tftp.c | 4 | ||||
-rw-r--r-- | print-udld.c | 6 | ||||
-rw-r--r-- | print-vtp.c | 12 | ||||
-rw-r--r-- | print-zephyr.c | 2 |
50 files changed, 218 insertions, 220 deletions
@@ -67,5 +67,3 @@ #define PPP_MPCP 0xc03d /* Multi-Link */ #define PPP_SPAP_OLD 0xc123 #define PPP_EAP 0xc227 - -extern struct tok ppptype2str[]; diff --git a/print-arcnet.c b/print-arcnet.c index 9531f346..2d605373 100644 --- a/print-arcnet.c +++ b/print-arcnet.c @@ -41,7 +41,7 @@ static const char rcsid[] _U_ = static int arcnet_encap_print(u_char arctype, const u_char *p, u_int length, u_int caplen); -struct tok arctypemap[] = { +static const struct tok arctypemap[] = { { ARCTYPE_IP_OLD, "oldip" }, { ARCTYPE_ARP_OLD, "oldarp" }, { ARCTYPE_IP, "ip" }, diff --git a/print-arp.c b/print-arp.c index 905ef465..b5047a0d 100644 --- a/print-arp.c +++ b/print-arp.c @@ -99,7 +99,7 @@ struct arp_pkthdr { #define TPA(ap) (ar_tpa(ap)) -struct tok arpop_values[] = { +static const struct tok arpop_values[] = { { ARPOP_REQUEST, "Request" }, { ARPOP_REPLY, "Reply" }, { ARPOP_REVREQUEST, "Reverse Request" }, @@ -110,7 +110,7 @@ struct tok arpop_values[] = { { 0, NULL } }; -struct tok arphrd_values[] = { +static const struct tok arphrd_values[] = { { ARPHRD_ETHER, "Ethernet" }, { ARPHRD_IEEE802, "TokenRing" }, { ARPHRD_ARCNET, "ArcNet" }, diff --git a/print-atalk.c b/print-atalk.c index a075b189..be1c154f 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -43,7 +43,7 @@ static const char rcsid[] _U_ = #include "extract.h" /* must come after interface.h */ #include "appletalk.h" -static struct tok type2str[] = { +static const struct tok type2str[] = { { ddpRTMP, "rtmp" }, { ddpRTMPrequest, "rtmpReq" }, { ddpECHO, "echo" }, @@ -602,7 +602,7 @@ ataddr_string(u_short atnet, u_char athost) return (tp->name); } -static struct tok skt2str[] = { +static const struct tok skt2str[] = { { rtmpSkt, "rtmp" }, /* routing table maintenance */ { nbpSkt, "nis" }, /* name info socket */ { echoSkt, "echo" }, /* AppleTalk echo protocol */ diff --git a/print-atm.c b/print-atm.c index 935d1827..b132a6de 100644 --- a/print-atm.c +++ b/print-atm.c @@ -48,13 +48,13 @@ static const char rcsid[] _U_ = #define OAM_FUNCTION_SPECIFIC_LEN 45 /* this excludes crc10 and cell-type/function-type */ #define OAM_CELLTYPE_FUNCTYPE_LEN 1 -struct tok oam_f_values[] = { +static const struct tok oam_f_values[] = { { VCI_OAMF4SC, "OAM F4 (segment)" }, { VCI_OAMF4EC, "OAM F4 (end)" }, { 0, NULL } }; -struct tok atm_pty_values[] = { +static const struct tok atm_pty_values[] = { { 0x0, "user data, uncongested, SDU 0" }, { 0x1, "user data, uncongested, SDU 1" }, { 0x2, "user data, congested, SDU 0" }, @@ -70,7 +70,7 @@ struct tok atm_pty_values[] = { #define OAM_CELLTYPE_AD 0x8 #define OAM_CELLTYPE_SM 0xf -struct tok oam_celltype_values[] = { +static const struct tok oam_celltype_values[] = { { OAM_CELLTYPE_FM, "Fault Management" }, { OAM_CELLTYPE_PM, "Performance Management" }, { OAM_CELLTYPE_AD, "activate/deactivate" }, @@ -83,7 +83,7 @@ struct tok oam_celltype_values[] = { #define OAM_FM_FUNCTYPE_CONTCHECK 0x4 #define OAM_FM_FUNCTYPE_LOOPBACK 0x8 -struct tok oam_fm_functype_values[] = { +static const struct tok oam_fm_functype_values[] = { { OAM_FM_FUNCTYPE_AIS, "AIS" }, { OAM_FM_FUNCTYPE_RDI, "RDI" }, { OAM_FM_FUNCTYPE_CONTCHECK, "Continuity Check" }, @@ -91,14 +91,14 @@ struct tok oam_fm_functype_values[] = { { 0, NULL } }; -struct tok oam_pm_functype_values[] = { +static const struct tok oam_pm_functype_values[] = { { 0x0, "Forward Monitoring" }, { 0x1, "Backward Reporting" }, { 0x2, "Monitoring and Reporting" }, { 0, NULL } }; -struct tok oam_ad_functype_values[] = { +static const struct tok oam_ad_functype_values[] = { { 0x0, "Performance Monitoring" }, { 0x1, "Continuity Check" }, { 0, NULL } @@ -106,7 +106,7 @@ struct tok oam_ad_functype_values[] = { #define OAM_FM_LOOPBACK_INDICATOR_MASK 0x1 -struct tok oam_fm_loopback_indicator_values[] = { +static const struct tok oam_fm_loopback_indicator_values[] = { { 0x0, "Reply" }, { 0x1, "Request" }, { 0, NULL } @@ -229,7 +229,7 @@ atm_if_print(const struct pcap_pkthdr *h, const u_char *p) /* * ATM signalling. */ -static struct tok msgtype2str[] = { +static const struct tok msgtype2str[] = { { CALL_PROCEED, "Call_proceeding" }, { CONNECT, "Connect" }, { CONNECT_ACK, "Connect_ack" }, diff --git a/print-bgp.c b/print-bgp.c index 4f7053c2..2ad7cbcb 100644 --- a/print-bgp.c +++ b/print-bgp.c @@ -65,7 +65,7 @@ struct bgp { #define BGP_KEEPALIVE 4 #define BGP_ROUTE_REFRESH 5 -static struct tok bgp_msg_values[] = { +static const struct tok bgp_msg_values[] = { { BGP_OPEN, "Open"}, { BGP_UPDATE, "Update"}, { BGP_NOTIFICATION, "Notification"}, @@ -142,7 +142,7 @@ struct bgp_route_refresh { #define BGP_MP_NLRI_MINSIZE 3 /* End of RIB Marker detection */ -static struct tok bgp_attr_values[] = { +static const struct tok bgp_attr_values[] = { { BGPTYPE_ORIGIN, "Origin"}, { BGPTYPE_AS_PATH, "AS Path"}, { BGPTYPE_AS4_PATH, "AS4 Path"}, @@ -175,7 +175,7 @@ static struct tok bgp_attr_values[] = { #define BGP_AS_SEG_TYPE_MIN BGP_AS_SET #define BGP_AS_SEG_TYPE_MAX BGP_CONFED_AS_SET -static struct tok bgp_as_path_segment_open_values[] = { +static const struct tok bgp_as_path_segment_open_values[] = { { BGP_AS_SEQUENCE, ""}, { BGP_AS_SET, "{ "}, { BGP_CONFED_AS_SEQUENCE, "( "}, @@ -183,7 +183,7 @@ static struct tok bgp_as_path_segment_open_values[] = { { 0, NULL} }; -static struct tok bgp_as_path_segment_close_values[] = { +static const struct tok bgp_as_path_segment_close_values[] = { { BGP_AS_SEQUENCE, ""}, { BGP_AS_SET, "}"}, { BGP_CONFED_AS_SEQUENCE, ")"}, @@ -195,7 +195,7 @@ static struct tok bgp_as_path_segment_close_values[] = { #define BGP_OPT_CAP 2 -static struct tok bgp_opt_values[] = { +static const struct tok bgp_opt_values[] = { { BGP_OPT_AUTH, "Authentication Information"}, { BGP_OPT_CAP, "Capabilities Advertisement"}, { 0, NULL} @@ -209,7 +209,7 @@ static struct tok bgp_opt_values[] = { #define BGP_CAPCODE_DYN_CAP 67 /* XXX */ #define BGP_CAPCODE_RR_CISCO 128 -static struct tok bgp_capcode_values[] = { +static const struct tok bgp_capcode_values[] = { { BGP_CAPCODE_MP, "Multiprotocol Extensions"}, { BGP_CAPCODE_RR, "Route Refresh"}, { BGP_CAPCODE_ORF, "Cooperative Route Filtering"}, @@ -228,7 +228,7 @@ static struct tok bgp_capcode_values[] = { #define BGP_NOTIFY_MAJOR_CEASE 6 #define BGP_NOTIFY_MAJOR_CAP 7 -static struct tok bgp_notify_major_values[] = { +static const struct tok bgp_notify_major_values[] = { { BGP_NOTIFY_MAJOR_MSG, "Message Header Error"}, { BGP_NOTIFY_MAJOR_OPEN, "OPEN Message Error"}, { BGP_NOTIFY_MAJOR_UPDATE, "UPDATE Message Error"}, @@ -241,7 +241,7 @@ static struct tok bgp_notify_major_values[] = { /* draft-ietf-idr-cease-subcode-02 */ #define BGP_NOTIFY_MINOR_CEASE_MAXPRFX 1 -static struct tok bgp_notify_minor_cease_values[] = { +static const struct tok bgp_notify_minor_cease_values[] = { { BGP_NOTIFY_MINOR_CEASE_MAXPRFX, "Maximum Number of Prefixes Reached"}, { 2, "Administratively Shutdown"}, { 3, "Peer Unconfigured"}, @@ -252,14 +252,14 @@ static struct tok bgp_notify_minor_cease_values[] = { { 0, NULL} }; -static struct tok bgp_notify_minor_msg_values[] = { +static const struct tok bgp_notify_minor_msg_values[] = { { 1, "Connection Not Synchronized"}, { 2, "Bad Message Length"}, { 3, "Bad Message Type"}, { 0, NULL} }; -static struct tok bgp_notify_minor_open_values[] = { +static const struct tok bgp_notify_minor_open_values[] = { { 1, "Unsupported Version Number"}, { 2, "Bad Peer AS"}, { 3, "Bad BGP Identifier"}, @@ -270,7 +270,7 @@ static struct tok bgp_notify_minor_open_values[] = { { 0, NULL} }; -static struct tok bgp_notify_minor_update_values[] = { +static const struct tok bgp_notify_minor_update_values[] = { { 1, "Malformed Attribute List"}, { 2, "Unrecognized Well-known Attribute"}, { 3, "Missing Well-known Attribute"}, @@ -285,7 +285,7 @@ static struct tok bgp_notify_minor_update_values[] = { { 0, NULL} }; -static struct tok bgp_notify_minor_cap_values[] = { +static const struct tok bgp_notify_minor_cap_values[] = { { 1, "Invalid Action Value" }, { 2, "Invalid Capability Length" }, { 3, "Malformed Capability Value" }, @@ -293,7 +293,7 @@ static struct tok bgp_notify_minor_cap_values[] = { { 0, NULL } }; -static struct tok bgp_origin_values[] = { +static const struct tok bgp_origin_values[] = { { 0, "IGP"}, { 1, "EGP"}, { 2, "Incomplete"}, @@ -308,7 +308,7 @@ static struct tok bgp_origin_values[] = { #define BGP_PMSI_TUNNEL_INGRESS 6 #define BGP_PMSI_TUNNEL_LDP_MP2MP 7 -static struct tok bgp_pmsi_tunnel_values[] = { +static const struct tok bgp_pmsi_tunnel_values[] = { { BGP_PMSI_TUNNEL_RSVP_P2MP, "RSVP-TE P2MP LSP"}, { BGP_PMSI_TUNNEL_LDP_P2MP, "LDP P2MP LSP"}, { BGP_PMSI_TUNNEL_PIM_SSM, "PIM-SSM Tree"}, @@ -319,7 +319,7 @@ static struct tok bgp_pmsi_tunnel_values[] = { { 0, NULL} }; -static struct tok bgp_pmsi_flag_values[] = { +static const struct tok bgp_pmsi_flag_values[] = { { 0x01, "Leaf Information required"}, { 0, NULL} }; @@ -347,7 +347,7 @@ static struct tok bgp_pmsi_flag_values[] = { #define BGP_VPN_RD_LEN 8 -static struct tok bgp_safi_values[] = { +static const struct tok bgp_safi_values[] = { { SAFNUM_RES, "Reserved"}, { SAFNUM_UNICAST, "Unicast"}, { SAFNUM_MULTICAST, "Multicast"}, @@ -405,13 +405,13 @@ static struct tok bgp_safi_values[] = { #define BGP_EXT_COM_EIGRP_EXT_REMAS_REMID 0x8804 #define BGP_EXT_COM_EIGRP_EXT_REMPROTO_REMMETRIC 0x8805 -static struct tok bgp_extd_comm_flag_values[] = { +static const struct tok bgp_extd_comm_flag_values[] = { { 0x8000, "vendor-specific"}, { 0x4000, "non-transitive"}, { 0, NULL}, }; -static struct tok bgp_extd_comm_subtype_values[] = { +static const struct tok bgp_extd_comm_subtype_values[] = { { BGP_EXT_COM_RT_0, "target"}, { BGP_EXT_COM_RT_1, "target"}, { BGP_EXT_COM_RT_2, "target"}, @@ -450,7 +450,7 @@ static struct tok bgp_extd_comm_subtype_values[] = { #define BGP_OSPF_RTYPE_SHAM 129 /* OSPF-MPLS-VPN Sham link */ #define BGP_OSPF_RTYPE_METRIC_TYPE 0x1 /* LSB of RTYPE Options Field */ -static struct tok bgp_extd_comm_ospf_rtype_values[] = { +static const struct tok bgp_extd_comm_ospf_rtype_values[] = { { BGP_OSPF_RTYPE_RTR, "Router" }, { BGP_OSPF_RTYPE_NET, "Network" }, { BGP_OSPF_RTYPE_SUM, "Summary" }, @@ -838,7 +838,7 @@ return -2; #define BGP_MULTICAST_VPN_ROUTE_TYPE_SHARED_TREE_JOIN 6 #define BGP_MULTICAST_VPN_ROUTE_TYPE_SOURCE_TREE_JOIN 7 -static struct tok bgp_multicast_vpn_route_type_values[] = { +static const struct tok bgp_multicast_vpn_route_type_values[] = { { BGP_MULTICAST_VPN_ROUTE_TYPE_INTRA_AS_I_PMSI, "Intra-AS I-PMSI"}, { BGP_MULTICAST_VPN_ROUTE_TYPE_INTER_AS_I_PMSI, "Inter-AS I-PMSI"}, { BGP_MULTICAST_VPN_ROUTE_TYPE_S_PMSI, "S-PMSI"}, diff --git a/print-bootp.c b/print-bootp.c index c7538ff8..c9e7a11e 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -187,7 +187,7 @@ trunc: * B - on/off (8 bits) * $ - special (explicit code to handle) */ -static struct tok tag2str[] = { +static const struct tok tag2str[] = { /* RFC1048 tags */ { TAG_PAD, " PAD" }, { TAG_SUBNET_MASK, "iSubnet-Mask" }, /* subnet mask (RFC950) */ @@ -308,12 +308,12 @@ static struct tok tag2str[] = { { 0, NULL } }; /* 2-byte extended tags */ -static struct tok xtag2str[] = { +static const struct tok xtag2str[] = { { 0, NULL } }; /* DHCP "options overload" types */ -static struct tok oo2str[] = { +static const struct tok oo2str[] = { { 1, "file" }, { 2, "sname" }, { 3, "file+sname" }, @@ -321,7 +321,7 @@ static struct tok oo2str[] = { }; /* NETBIOS over TCP/IP node type options */ -static struct tok nbo2str[] = { +static const struct tok nbo2str[] = { { 0x1, "b-node" }, { 0x2, "p-node" }, { 0x4, "m-node" }, @@ -330,7 +330,7 @@ static struct tok nbo2str[] = { }; /* ARP Hardware types, for Client-ID option */ -static struct tok arp2str[] = { +static const struct tok arp2str[] = { { 0x1, "ether" }, { 0x6, "ieee802" }, { 0x7, "arcnet" }, @@ -340,7 +340,7 @@ static struct tok arp2str[] = { { 0, NULL } }; -static struct tok dhcp_msg_values[] = { +static const struct tok dhcp_msg_values[] = { { DHCPDISCOVER, "Discover" }, { DHCPOFFER, "Offer" }, { DHCPREQUEST, "Request" }, @@ -355,7 +355,7 @@ static struct tok dhcp_msg_values[] = { #define AGENT_SUBOPTION_CIRCUIT_ID 1 /* RFC 3046 */ #define AGENT_SUBOPTION_REMOTE_ID 2 /* RFC 3046 */ #define AGENT_SUBOPTION_SUBSCRIBER_ID 6 /* RFC 3993 */ -static struct tok agent_suboption_values[] = { +static const struct tok agent_suboption_values[] = { { AGENT_SUBOPTION_CIRCUIT_ID, "Circuit-ID" }, { AGENT_SUBOPTION_REMOTE_ID, "Remote-ID" }, { AGENT_SUBOPTION_SUBSCRIBER_ID, "Subscriber-ID" }, diff --git a/print-cdp.c b/print-cdp.c index 7bc617a9..152b2f98 100644 --- a/print-cdp.c +++ b/print-cdp.c @@ -45,7 +45,7 @@ static const char rcsid[] _U_ = #define CDP_HEADER_LEN 4 -static struct tok cdp_tlv_values[] = { +static const struct tok cdp_tlv_values[] = { { 0x01, "Device-ID"}, { 0x02, "Address"}, { 0x03, "Port-ID"}, @@ -70,7 +70,7 @@ static struct tok cdp_tlv_values[] = { { 0, NULL} }; -static struct tok cdp_capability_values[] = { +static const struct tok cdp_capability_values[] = { { 0x01, "Router" }, { 0x02, "Transparent Bridge" }, { 0x04, "Source Route Bridge" }, diff --git a/print-chdlc.c b/print-chdlc.c index 261b15ad..36db69db 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -42,7 +42,7 @@ static const char rcsid[] _U_ = static void chdlc_slarp_print(const u_char *, u_int); -const struct tok chdlc_cast_values[] = { +static const struct tok chdlc_cast_values[] = { { CHDLC_UNICAST, "unicast" }, { CHDLC_BCAST, "bcast" }, { 0, NULL} diff --git a/print-decnet.c b/print-decnet.c index 7fea582e..5b9dcfb5 100644 --- a/print-decnet.c +++ b/print-decnet.c @@ -819,7 +819,7 @@ trunc: return (0); } -static struct tok reason2str[] = { +static const struct tok reason2str[] = { { UC_OBJREJECT, "object rejected connect" }, { UC_RESOURCES, "insufficient resources" }, { UC_NOSUCHNODE, "unrecognized node name" }, diff --git a/print-domain.c b/print-domain.c index 4bf1a52d..80e8ce9d 100644 --- a/print-domain.c +++ b/print-domain.c @@ -242,7 +242,7 @@ ns_cprint(register const u_char *cp) } /* http://www.iana.org/assignments/dns-parameters */ -struct tok ns_type2str[] = { +const struct tok ns_type2str[] = { { T_A, "A" }, /* RFC 1035 */ { T_NS, "NS" }, /* RFC 1035 */ { T_MD, "MD" }, /* RFC 1035 */ @@ -307,7 +307,7 @@ struct tok ns_type2str[] = { { 0, NULL } }; -struct tok ns_class2str[] = { +const struct tok ns_class2str[] = { { C_IN, "IN" }, /* Not used */ { C_CHAOS, "CHAOS" }, { C_HS, "HS" }, diff --git a/print-dtp.c b/print-dtp.c index c358a893..14ac6916 100644 --- a/print-dtp.c +++ b/print-dtp.c @@ -37,7 +37,7 @@ #define DTP_DTP_TYPE_TLV 0x0003 #define DTP_NEIGHBOR_TLV 0x0004 -static struct tok dtp_tlv_values[] = { +static const struct tok dtp_tlv_values[] = { { DTP_DOMAIN_TLV, "Domain TLV"}, { DTP_STATUS_TLV, "Status TLV"}, { DTP_DTP_TYPE_TLV, "DTP type TLV"}, diff --git a/print-forces.c b/print-forces.c index dda94d82..9fcc68b9 100644 --- a/print-forces.c +++ b/print-forces.c @@ -199,7 +199,7 @@ struct forcesh { #define F_LFB_RSVD 0x0 #define F_LFB_FEO 0x1 #define F_LFB_FEPO 0x2 -const struct tok ForCES_LFBs[] = { +static const struct tok ForCES_LFBs[] = { {F_LFB_RSVD, "Invalid TLV"}, {F_LFB_FEO, "FEObj LFB"}, {F_LFB_FEPO, "FEProtoObj LFB"}, @@ -627,7 +627,7 @@ enum { E_UNSPECIFIED_ERROR = 0XFF }; -const struct tok ForCES_errs[] = { +static const struct tok ForCES_errs[] = { {E_SUCCESS, "SUCCESS"}, {E_INVALID_HEADER, "INVALID HEADER"}, {E_LENGTH_MISMATCH, "LENGTH MISMATCH"}, @@ -73,7 +73,7 @@ static void frf15_print(const u_char *, u_int); #define FR_SDLC_BIT 0x00000002 -struct tok fr_header_flag_values[] = { +static const struct tok fr_header_flag_values[] = { { FR_CR_BIT, "C!" }, { FR_DE_BIT, "DE" }, { FR_BECN_BIT, "BECN" }, @@ -90,7 +90,7 @@ struct tok fr_header_flag_values[] = { #define MFR_CTRL_FRAME (MFR_B_BIT | MFR_E_BIT | MFR_C_BIT) #define MFR_FRAG_FRAME (MFR_B_BIT | MFR_E_BIT ) -struct tok frf_flag_values[] = { +static const struct tok frf_flag_values[] = { { MFR_B_BIT, "Begin" }, { MFR_E_BIT, "End" }, { MFR_C_BIT, "Control" }, @@ -360,7 +360,7 @@ mfr_if_print(const struct pcap_pkthdr *h, register const u_char *p) #define MFR_CTRL_MSG_REMOVE_LINK 6 #define MFR_CTRL_MSG_REMOVE_LINK_ACK 7 -struct tok mfr_ctrl_msg_values[] = { +static const struct tok mfr_ctrl_msg_values[] = { { MFR_CTRL_MSG_ADD_LINK, "Add Link" }, { MFR_CTRL_MSG_ADD_LINK_ACK, "Add Link ACK" }, { MFR_CTRL_MSG_ADD_LINK_REJ, "Add Link Reject" }, @@ -378,7 +378,7 @@ struct tok mfr_ctrl_msg_values[] = { #define MFR_CTRL_IE_VENDOR_EXT 6 #define MFR_CTRL_IE_CAUSE 7 -struct tok mfr_ctrl_ie_values[] = { +static const struct tok mfr_ctrl_ie_values[] = { { MFR_CTRL_IE_BUNDLE_ID, "Bundle ID"}, { MFR_CTRL_IE_LINK_ID, "Link ID"}, { MFR_CTRL_IE_MAGIC_NUM, "Magic Number"}, @@ -626,7 +626,7 @@ frf15_print (const u_char *p, u_int length) { #define MSG_TYPE_STATUS 0x7D #define MSG_TYPE_STATUS_ENQ 0x75 -struct tok fr_q933_msg_values[] = { +static const struct tok fr_q933_msg_values[] = { { MSG_TYPE_ESC_TO_NATIONAL, "ESC to National" }, { MSG_TYPE_ALERT, "Alert" }, { MSG_TYPE_CALL_PROCEEDING, "Call proceeding" }, @@ -655,7 +655,7 @@ struct tok fr_q933_msg_values[] = { #define FR_LMI_CCITT_LINK_VERIFY_IE 0x53 #define FR_LMI_CCITT_PVC_STATUS_IE 0x57 -struct tok fr_q933_ie_values_codeset5[] = { +static const struct tok fr_q933_ie_values_codeset5[] = { { FR_LMI_ANSI_REPORT_TYPE_IE, "ANSI Report Type" }, { FR_LMI_ANSI_LINK_VERIFY_IE_91, "ANSI Link Verify" }, { FR_LMI_ANSI_LINK_VERIFY_IE, "ANSI Link Verify" }, @@ -670,7 +670,7 @@ struct tok fr_q933_ie_values_codeset5[] = { #define FR_LMI_REPORT_TYPE_IE_LINK_VERIFY 1 #define FR_LMI_REPORT_TYPE_IE_ASYNC_PVC 2 -struct tok fr_lmi_report_type_ie_values[] = { +static const struct tok fr_lmi_report_type_ie_values[] = { { FR_LMI_REPORT_TYPE_IE_FULL_STATUS, "Full Status" }, { FR_LMI_REPORT_TYPE_IE_LINK_VERIFY, "Link verify" }, { FR_LMI_REPORT_TYPE_IE_ASYNC_PVC, "Async PVC Status" }, @@ -678,7 +678,7 @@ struct tok fr_lmi_report_type_ie_values[] = { }; /* array of 16 codepages - currently we only support codepage 1,5 */ -static struct tok *fr_q933_ie_codesets[] = { +static const struct tok *fr_q933_ie_codesets[] = { NULL, fr_q933_ie_values_codeset5, NULL, diff --git a/print-gre.c b/print-gre.c index b6fa5223..b4ad09a4 100644 --- a/print-gre.c +++ b/print-gre.c @@ -65,7 +65,7 @@ static const char rcsid[] _U_ = #define GRE_RECRS 0x0700 /* recursion count */ #define GRE_AP 0x0080 /* acknowledgment# present */ -struct tok gre_flag_values[] = { +static const struct tok gre_flag_values[] = { { GRE_CP, "checksum present"}, { GRE_RP, "routing present"}, { GRE_KP, "key present"}, diff --git a/print-hsrp.c b/print-hsrp.c index 06304fd5..9f0f40c5 100644 --- a/print-hsrp.c +++ b/print-hsrp.c @@ -53,7 +53,7 @@ static const char *op_code_str[] = { }; /* HSRP states and associated names. */ -static struct tok states[] = { +static const struct tok states[] = { { 0, "initial" }, { 1, "learn" }, { 2, "listen" }, diff --git a/print-icmp.c b/print-icmp.c index 03b9505b..98925944 100644 --- a/print-icmp.c +++ b/print-icmp.c @@ -194,7 +194,7 @@ struct icmp { #endif /* Most of the icmp types */ -static struct tok icmp2str[] = { +static const struct tok icmp2str[] = { { ICMP_ECHOREPLY, "echo reply" }, { ICMP_SOURCEQUENCH, "source quench" }, { ICMP_ECHO, "echo request" }, @@ -208,7 +208,7 @@ static struct tok icmp2str[] = { }; /* Formats for most of the ICMP_UNREACH codes */ -static struct tok unreach2str[] = { +static const struct tok unreach2str[] = { { ICMP_UNREACH_NET, "net %s unreachable" }, { ICMP_UNREACH_HOST, "host %s unreachable" }, { ICMP_UNREACH_SRCFAIL, @@ -235,7 +235,7 @@ static struct tok unreach2str[] = { }; /* Formats for the ICMP_REDIRECT codes */ -static struct tok type2str[] = { +static const struct tok type2str[] = { { ICMP_REDIRECT_NET, "redirect %s to net %s" }, { ICMP_REDIRECT_HOST, "redirect %s to host %s" }, { ICMP_REDIRECT_TOSNET, "redirect-tos %s to net %s" }, diff --git a/print-icmp6.c b/print-icmp6.c index 4f669410..0b38c43e 100644 --- a/print-icmp6.c +++ b/print-icmp6.c @@ -65,7 +65,7 @@ static void icmp6_rrenum_print(const u_char *, const u_char *); /* inline the various RPL definitions */ #define ND_RPL_MESSAGE 0x9B -static struct tok icmp6_type_values[] = { +static const struct tok icmp6_type_values[] = { { ICMP6_DST_UNREACH, "destination unreachable"}, { ICMP6_PACKET_TOO_BIG, "packet too big"}, { ICMP6_TIME_EXCEEDED, "time exceeded in-transit"}, @@ -98,7 +98,7 @@ static struct tok icmp6_type_values[] = { { 0, NULL } }; -static struct tok icmp6_dst_unreach_code_values[] = { +static const struct tok icmp6_dst_unreach_code_values[] = { { ICMP6_DST_UNREACH_NOROUTE, "unreachable route" }, { ICMP6_DST_UNREACH_ADMIN, " unreachable prohibited"}, { ICMP6_DST_UNREACH_BEYONDSCOPE, "beyond scope"}, @@ -107,21 +107,21 @@ static struct tok icmp6_dst_unreach_code_values[] = { { 0, NULL } }; -static struct tok icmp6_opt_pi_flag_values[] = { +static const struct tok icmp6_opt_pi_flag_values[] = { { ND_OPT_PI_FLAG_ONLINK, "onlink" }, { ND_OPT_PI_FLAG_AUTO, "auto" }, { ND_OPT_PI_FLAG_ROUTER, "router" }, { 0, NULL } }; -static struct tok icmp6_opt_ra_flag_values[] = { +static const struct tok icmp6_opt_ra_flag_values[] = { { ND_RA_FLAG_MANAGED, "managed" }, { ND_RA_FLAG_OTHER, "other stateful"}, { ND_RA_FLAG_HOME_AGENT, "home agent"}, { 0, NULL } }; -static struct tok icmp6_nd_na_flag_values[] = { +static const struct tok icmp6_nd_na_flag_values[] = { { ND_NA_FLAG_ROUTER, "router" }, { ND_NA_FLAG_SOLICITED, "solicited" }, { ND_NA_FLAG_OVERRIDE, "override" }, @@ -129,7 +129,7 @@ static struct tok icmp6_nd_na_flag_values[] = { }; -static struct tok icmp6_opt_values[] = { +static const struct tok icmp6_opt_values[] = { { ND_OPT_SOURCE_LINKADDR, "source link-address"}, { ND_OPT_TARGET_LINKADDR, "destination link-address"}, { ND_OPT_PREFIX_INFORMATION, "prefix info"}, @@ -144,7 +144,7 @@ static struct tok icmp6_opt_values[] = { }; /* mldv2 report types */ -static struct tok mldv2report2str[] = { +static const struct tok mldv2report2str[] = { { 1, "is_in" }, { 2, "is_ex" }, { 3, "to_in" }, diff --git a/print-igmp.c b/print-igmp.c index 4087ee09..bc431026 100644 --- a/print-igmp.c +++ b/print-igmp.c @@ -96,7 +96,7 @@ struct tr_resp { #define TR_PROTO_CBT 4 /* igmpv3 report types */ -static struct tok igmpv3report2str[] = { +static const struct tok igmpv3report2str[] = { { 1, "is_in" }, { 2, "is_ex" }, { 3, "to_in" }, diff --git a/print-igrp.c b/print-igrp.c index 3cede7ec..90694b3a 100644 --- a/print-igrp.c +++ b/print-igrp.c @@ -70,7 +70,7 @@ igrp_entry_print(register struct igrprte *igr, register int is_interior, mtu, igr->igr_hct); } -static struct tok op2str[] = { +static const struct tok op2str[] = { { IGRP_UPDATE, "update" }, { IGRP_REQUEST, "request" }, { 0, NULL } @@ -41,7 +41,7 @@ static const char rcsid[] _U_ = #include "ip.h" #include "ipproto.h" -struct tok ip_option_values[] = { +static const struct tok ip_option_values[] = { { IPOPT_EOL, "EOL" }, { IPOPT_NOP, "NOP" }, { IPOPT_TS, "timestamp" }, @@ -303,7 +303,7 @@ trunc: #define IP_RES 0x8000 -static struct tok ip_frag_values[] = { +static const struct tok ip_frag_values[] = { { IP_MF, "+" }, { IP_DF, "DF" }, { IP_RES, "rsvd" }, /* The RFC3514 evil ;-) bit */ diff --git a/print-ipnet.c b/print-ipnet.c index 187f939d..e8ed94d5 100644 --- a/print-ipnet.c +++ b/print-ipnet.c @@ -14,7 +14,7 @@ #ifdef DLT_IPNET -const struct tok ipnet_values[] = { +static const struct tok ipnet_values[] = { { IPH_AF_INET, "IPv4" }, { IPH_AF_INET6, "IPv6" }, { 0, NULL } diff --git a/print-isoclns.c b/print-isoclns.c index 4f8a5bb7..4b72f549 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -76,7 +76,7 @@ static const char rcsid[] _U_ = #define ISIS_PDU_L1_PSNP 26 #define ISIS_PDU_L2_PSNP 27 -static struct tok isis_pdu_values[] = { +static const struct tok isis_pdu_values[] = { { ISIS_PDU_L1_LAN_IIH, "L1 Lan IIH"}, { ISIS_PDU_L2_LAN_IIH, "L2 Lan IIH"}, { ISIS_PDU_PTP_IIH, "p2p IIH"}, @@ -146,7 +146,7 @@ static struct tok isis_pdu_values[] = { #define ISIS_TLV_VENDOR_PRIVATE 250 /* draft-ietf-isis-experimental-tlv-01 */ #define ISIS_TLV_VENDOR_PRIVATE_MINLEN 3 -static struct tok isis_tlv_values[] = { +static const struct tok isis_tlv_values[] = { { ISIS_TLV_AREA_ADDR, "Area address(es)"}, { ISIS_TLV_IS_REACH, "IS Reachability"}, { ISIS_TLV_ESNEIGH, "ES Neighbor(s)"}, @@ -198,7 +198,7 @@ static struct tok isis_tlv_values[] = { #define ESIS_OPTION_ADDRESS_MASK 225 /* iso9542 */ #define ESIS_OPTION_SNPA_MASK 226 /* iso9542 */ -static struct tok esis_option_values[] = { +static const struct tok esis_option_values[] = { { ESIS_OPTION_PROTOCOLS, "Protocols supported"}, { ESIS_OPTION_QOS_MAINTENANCE, "QoS Maintenance" }, { ESIS_OPTION_SECURITY, "Security" }, @@ -217,7 +217,7 @@ static struct tok esis_option_values[] = { #define CLNP_OPTION_PADDING 204 /* iso8473 */ #define CLNP_OPTION_PRIORITY 205 /* iso8473 */ -static struct tok clnp_option_values[] = { +static const struct tok clnp_option_values[] = { { CLNP_OPTION_DISCARD_REASON, "Discard Reason"}, { CLNP_OPTION_PRIORITY, "Priority"}, { CLNP_OPTION_QOS_MAINTENANCE, "QoS Maintenance"}, @@ -228,7 +228,7 @@ static struct tok clnp_option_values[] = { { 0, NULL } }; -static struct tok clnp_option_rfd_class_values[] = { +static const struct tok clnp_option_rfd_class_values[] = { { 0x0, "General"}, { 0x8, "Address"}, { 0x9, "Source Routeing"}, @@ -238,7 +238,7 @@ static struct tok clnp_option_rfd_class_values[] = { { 0, NULL } }; -static struct tok clnp_option_rfd_general_values[] = { +static const struct tok clnp_option_rfd_general_values[] = { { 0x0, "Reason not specified"}, { 0x1, "Protocol procedure error"}, { 0x2, "Incorrect checksum"}, @@ -250,13 +250,13 @@ static struct tok clnp_option_rfd_general_values[] = { { 0, NULL } }; -static struct tok clnp_option_rfd_address_values[] = { +static const struct tok clnp_option_rfd_address_values[] = { { 0x0, "Destination address unreachable"}, { 0x1, "Destination address unknown"}, { 0, NULL } }; -static struct tok clnp_option_rfd_source_routeing_values[] = { +static const struct tok clnp_option_rfd_source_routeing_values[] = { { 0x0, "Unspecified source routeing error"}, { 0x1, "Syntax error in source routeing field"}, { 0x2, "Unknown address in source routeing field"}, @@ -264,13 +264,13 @@ static struct tok clnp_option_rfd_source_routeing_values[] = { { 0, NULL } }; -static struct tok clnp_option_rfd_lifetime_values[] = { +static const struct tok clnp_option_rfd_lifetime_values[] = { { 0x0, "Lifetime expired while data unit in transit"}, { 0x1, "Lifetime expired during reassembly"}, { 0, NULL } }; -static struct tok clnp_option_rfd_pdu_discard_values[] = { +static const struct tok clnp_option_rfd_pdu_discard_values[] = { { 0x0, "Unsupported option not specified"}, { 0x1, "Unsupported protocol version"}, { 0x2, "Unsupported security option"}, @@ -279,13 +279,13 @@ static struct tok clnp_option_rfd_pdu_discard_values[] = { { 0, NULL } }; -static struct tok clnp_option_rfd_reassembly_values[] = { +static const struct tok clnp_option_rfd_reassembly_values[] = { { 0x0, "Reassembly interference"}, { 0, NULL } }; /* array of 16 error-classes */ -static struct tok *clnp_option_rfd_error_class[] = { +static const struct tok *clnp_option_rfd_error_class[] = { clnp_option_rfd_general_values, NULL, NULL, @@ -310,26 +310,26 @@ static struct tok *clnp_option_rfd_error_class[] = { #define CLNP_OPTION_SCOPE_DA_SPEC 0x80 #define CLNP_OPTION_SCOPE_GLOBAL 0xc0 -static struct tok clnp_option_scope_values[] = { +static const struct tok clnp_option_scope_values[] = { { CLNP_OPTION_SCOPE_SA_SPEC, "Source Address Specific"}, { CLNP_OPTION_SCOPE_DA_SPEC, "Destination Address Specific"}, { CLNP_OPTION_SCOPE_GLOBAL, "Globally unique"}, { 0, NULL } }; -static struct tok clnp_option_sr_rr_values[] = { +static const struct tok clnp_option_sr_rr_values[] = { { 0x0, "partial"}, { 0x1, "complete"}, { 0, NULL } }; -static struct tok clnp_option_sr_rr_string_values[] = { +static const struct tok clnp_option_sr_rr_string_values[] = { { CLNP_OPTION_SOURCE_ROUTING, "source routing"}, { CLNP_OPTION_ROUTE_RECORDING, "recording of route in progress"}, { 0, NULL } }; -static struct tok clnp_option_qos_global_values[] = { +static const struct tok clnp_option_qos_global_values[] = { { 0x20, "reserved"}, { 0x10, "sequencing vs. delay"}, { 0x08, "congested"}, @@ -356,7 +356,7 @@ static struct tok clnp_option_qos_global_values[] = { #define ISIS_SUBTLV_SPB_METRIC 29 /* rfc6329 */ -static struct tok isis_ext_is_reach_subtlv_values[] = { +static const struct tok isis_ext_is_reach_subtlv_values[] = { { ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP, "Administrative groups" }, { ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID, "Link Local/Remote Identifier" }, { ISIS_SUBTLV_EXT_IS_REACH_LINK_REMOTE_ID, "Link Remote Identifier" }, @@ -385,14 +385,14 @@ static struct tok isis_ext_is_reach_subtlv_values[] = { #define ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG64 2 /* draft-ietf-isis-admin-tags-01 */ #define ISIS_SUBTLV_EXTD_IP_REACH_MGMT_PREFIX_COLOR 117 /* draft-ietf-isis-wg-multi-topology-05 */ -static struct tok isis_ext_ip_reach_subtlv_values[] = { +static const struct tok isis_ext_ip_reach_subtlv_values[] = { { ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG32, "32-Bit Administrative tag" }, { ISIS_SUBTLV_EXTD_IP_REACH_ADMIN_TAG64, "64-Bit Administrative tag" }, { ISIS_SUBTLV_EXTD_IP_REACH_MGMT_PREFIX_COLOR, "Management Prefix Color" }, { 0, NULL } }; -static struct tok isis_subtlv_link_attribute_values[] = { +static const struct tok isis_subtlv_link_attribute_values[] = { { 0x01, "Local Protection Available" }, { 0x02, "Link excluded from local protection path" }, { 0x04, "Local maintenance required"}, @@ -405,7 +405,7 @@ static struct tok isis_subtlv_link_attribute_values[] = { #define ISIS_SUBTLV_AUTH_MD5_LEN 16 #define ISIS_SUBTLV_AUTH_PRIVATE 255 -static struct tok isis_subtlv_auth_values[] = { +static const struct tok isis_subtlv_auth_values[] = { { ISIS_SUBTLV_AUTH_SIMPLE, "simple text password"}, { ISIS_SUBTLV_AUTH_GENERIC, "Generic Crypto key-id"}, { ISIS_SUBTLV_AUTH_MD5, "HMAC-MD5 password"}, @@ -417,7 +417,7 @@ static struct tok isis_subtlv_auth_values[] = { #define ISIS_SUBTLV_IDRP_LOCAL 1 #define ISIS_SUBTLV_IDRP_ASN 2 -static struct tok isis_subtlv_idrp_values[] = { +static const struct tok isis_subtlv_idrp_values[] = { { ISIS_SUBTLV_IDRP_RES, "Reserved"}, { ISIS_SUBTLV_IDRP_LOCAL, "Routing-Domain Specific"}, { ISIS_SUBTLV_IDRP_ASN, "AS Number Tag"}, @@ -438,14 +438,14 @@ static struct tok isis_subtlv_idrp_values[] = { #define ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN 19 #define ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN 8 -static struct tok isis_mt_port_cap_subtlv_values[] = { +static const struct tok isis_mt_port_cap_subtlv_values[] = { { ISIS_SUBTLV_SPB_MCID, "SPB MCID" }, { ISIS_SUBTLV_SPB_DIGEST, "SPB Digest" }, { ISIS_SUBTLV_SPB_BVID, "SPB BVID" }, { 0, NULL } }; -static struct tok isis_mt_capability_subtlv_values[] = { +static const struct tok isis_mt_capability_subtlv_values[] = { { ISIS_SUBTLV_SPB_INSTANCE, "SPB Instance" }, { ISIS_SUBTLV_SPBM_SI, "SPBM Service Identifier and Unicast Address" }, { 0, NULL } @@ -475,7 +475,7 @@ struct isis_subtlv_spb_instance { #define CLNP_MORE_SEGMENTS 0x40 #define CLNP_REQUEST_ER 0x20 -static struct tok clnp_flag_values[] = { +static const struct tok clnp_flag_values[] = { { CLNP_SEGMENT_PART, "Segmentation permitted"}, { CLNP_MORE_SEGMENTS, "more Segments"}, { CLNP_REQUEST_ER, "request Error Report"}, @@ -494,7 +494,7 @@ static struct tok clnp_flag_values[] = { #define ISIS_MASK_MTID(x) ((x)&0x0fff) #define ISIS_MASK_MTFLAGS(x) ((x)&0xf000) -static struct tok isis_mt_flag_values[] = { +static const struct tok isis_mt_flag_values[] = { { 0x4000, "ATT bit set"}, { 0x8000, "Overload bit set"}, { 0, NULL} @@ -513,7 +513,7 @@ static struct tok isis_mt_flag_values[] = { #define ISIS_MASK_TLV_SHARED_RISK_GROUP(x) ((x)&0x1) -static struct tok isis_mt_values[] = { +static const struct tok isis_mt_values[] = { { 0, "IPv4 unicast"}, { 1, "In-Band Management"}, { 2, "IPv6 unicast"}, @@ -522,7 +522,7 @@ static struct tok isis_mt_values[] = { { 0, NULL } }; -static struct tok isis_iih_circuit_type_values[] = { +static const struct tok isis_iih_circuit_type_values[] = { { 1, "Level 1 only"}, { 2, "Level 2 only"}, { 3, "Level 1, Level 2"}, @@ -534,7 +534,7 @@ static struct tok isis_iih_circuit_type_values[] = { #define ISIS_LSP_TYPE_UNUSED2 2 #define ISIS_LSP_TYPE_LEVEL_2 3 -static struct tok isis_lsp_istype_values[] = { +static const struct tok isis_lsp_istype_values[] = { { ISIS_LSP_TYPE_UNUSED0, "Unused 0x0 (invalid)"}, { ISIS_LSP_TYPE_LEVEL_1, "L1 IS"}, { ISIS_LSP_TYPE_UNUSED2, "Unused 0x2 (invalid)"}, @@ -551,7 +551,7 @@ static struct tok isis_lsp_istype_values[] = { #define ISIS_PTP_ADJ_INIT 1 #define ISIS_PTP_ADJ_DOWN 2 -static struct tok isis_ptp_adjancey_values[] = { +static const struct tok isis_ptp_adjancey_values[] = { { ISIS_PTP_ADJ_UP, "Up" }, { ISIS_PTP_ADJ_INIT, "Initializing" }, { ISIS_PTP_ADJ_DOWN, "Down" }, @@ -594,13 +594,13 @@ struct isis_tlv_ip_reach { u_int8_t mask[4]; }; -static struct tok isis_is_reach_virtual_values[] = { +static const struct tok isis_is_reach_virtual_values[] = { { 0, "IsNotVirtual"}, { 1, "IsVirtual"}, { 0, NULL } }; -static struct tok isis_restart_flag_values[] = { +static const struct tok isis_restart_flag_values[] = { { 0x1, "Restart Request"}, { 0x2, "Restart Acknowledgement"}, { 0x4, "Suppress adjacency advertisement"}, @@ -740,7 +740,7 @@ void isoclns_print(const u_int8_t *p, u_int length, u_int caplen) #define CLNP_PDU_ERQ 30 #define CLNP_PDU_ERP 31 -static struct tok clnp_pdu_values[] = { +static const struct tok clnp_pdu_values[] = { { CLNP_PDU_ER, "Error Report"}, { CLNP_PDU_MD, "MD"}, { CLNP_PDU_DT, "Data"}, @@ -1007,7 +1007,7 @@ static int clnp_print (const u_int8_t *pptr, u_int length) #define ESIS_PDU_ESH 2 #define ESIS_PDU_ISH 4 -static struct tok esis_pdu_values[] = { +static const struct tok esis_pdu_values[] = { { ESIS_PDU_REDIRECT, "redirect"}, { ESIS_PDU_ESH, "ESH"}, { ESIS_PDU_ISH, "ISH"}, diff --git a/print-juniper.c b/print-juniper.c index 3bf68c38..1789fb51 100644 --- a/print-juniper.c +++ b/print-juniper.c @@ -65,7 +65,7 @@ __RCSID("NetBSD: print-juniper.c,v 1.3 2007/07/25 06:31:32 dogcow Exp "); #define JUNIPER_IPSEC_O_AH_AUTHENTICATION_TYPE 4 #define JUNIPER_IPSEC_O_ESP_ENCRYPTION_TYPE 5 -static struct tok juniper_ipsec_type_values[] = { +static const struct tok juniper_ipsec_type_values[] = { { JUNIPER_IPSEC_O_ESP_ENCRYPT_ESP_AUTHEN_TYPE, "ESP ENCR-AUTH" }, { JUNIPER_IPSEC_O_ESP_ENCRYPT_AH_AUTHEN_TYPE, "ESP ENCR-AH AUTH" }, { JUNIPER_IPSEC_O_ESP_AUTHENTICATION_TYPE, "ESP AUTH" }, @@ -74,7 +74,7 @@ static struct tok juniper_ipsec_type_values[] = { { 0, NULL} }; -static struct tok juniper_direction_values[] = { +static const struct tok juniper_direction_values[] = { { JUNIPER_BPF_IN, "In"}, { JUNIPER_BPF_OUT, "Out"}, { 0, NULL} @@ -95,7 +95,7 @@ enum { /* 1 byte type and 1-byte length */ #define JUNIPER_EXT_TLV_OVERHEAD 2 -struct tok jnx_ext_tlv_values[] = { +static const struct tok jnx_ext_tlv_values[] = { { JUNIPER_EXT_TLV_IFD_IDX, "Device Interface Index" }, { JUNIPER_EXT_TLV_IFD_NAME,"Device Interface Name" }, { JUNIPER_EXT_TLV_IFD_MEDIATYPE, "Device Media Type" }, @@ -107,7 +107,7 @@ struct tok jnx_ext_tlv_values[] = { { 0, NULL } }; -struct tok jnx_flag_values[] = { +static const struct tok jnx_flag_values[] = { { JUNIPER_BPF_EXT, "Ext" }, { JUNIPER_BPF_FILTER, "Filter" }, { JUNIPER_BPF_IIF, "IIF" }, @@ -177,7 +177,7 @@ struct tok jnx_flag_values[] = { #define JUNIPER_IFML_DFC 59 #define JUNIPER_IFML_PICPEER 60 -struct tok juniper_ifmt_values[] = { +static const struct tok juniper_ifmt_values[] = { { JUNIPER_IFML_ETHER, "Ethernet" }, { JUNIPER_IFML_FDDI, "FDDI" }, { JUNIPER_IFML_TOKENRING, "Token-Ring" }, @@ -300,7 +300,7 @@ struct tok juniper_ifmt_values[] = { #define JUNIPER_IFLE_DFC 66 #define JUNIPER_IFLE_PICPEER 67 -struct tok juniper_ifle_values[] = { +static const struct tok juniper_ifle_values[] = { { JUNIPER_IFLE_AGGREGATOR, "Aggregator" }, { JUNIPER_IFLE_ATM_CCC, "CCC over ATM" }, { JUNIPER_IFLE_ATM_CELLRELAY_CCC, "ATM CCC Cell Relay" }, @@ -439,7 +439,7 @@ struct juniper_l2info_t { #define MFR_BE_MASK 0xc0 -static struct tok juniper_protocol_values[] = { +static const struct tok juniper_protocol_values[] = { { JUNIPER_PROTO_NULL, "Null" }, { JUNIPER_PROTO_IPV4, "IPv4" }, { JUNIPER_PROTO_IPV6, "IPv6" }, diff --git a/print-krb.c b/print-krb.c index 213db642..733334bf 100644 --- a/print-krb.c +++ b/print-krb.c @@ -71,7 +71,7 @@ struct krb { static char tstr[] = " [|kerberos]"; -static struct tok type2str[] = { +static const struct tok type2str[] = { { AUTH_MSG_KDC_REQUEST, "KDC_REQUEST" }, { AUTH_MSG_KDC_REPLY, "KDC_REPLY" }, { AUTH_MSG_APPL_REQUEST, "APPL_REQUEST" }, @@ -84,7 +84,7 @@ static struct tok type2str[] = { { 0, NULL } }; -static struct tok kerr2str[] = { +static const struct tok kerr2str[] = { { KERB_ERR_OK, "OK" }, { KERB_ERR_NAME_EXP, "NAME_EXP" }, { KERB_ERR_SERVICE_EXP, "SERVICE_EXP" }, diff --git a/print-l2tp.c b/print-l2tp.c index 2f726574..840239cd 100644 --- a/print-l2tp.c +++ b/print-l2tp.c @@ -55,7 +55,7 @@ static char tstr[] = " [|l2tp]"; #define L2TP_MSGTYPE_WEN 15 /* WAN-Error-Notify */ #define L2TP_MSGTYPE_SLI 16 /* Set-Link-Info */ -static struct tok l2tp_msgtype2str[] = { +static const struct tok l2tp_msgtype2str[] = { { L2TP_MSGTYPE_SCCRQ, "SCCRQ" }, { L2TP_MSGTYPE_SCCRP, "SCCRP" }, { L2TP_MSGTYPE_SCCCN, "SCCCN" }, @@ -115,7 +115,7 @@ static struct tok l2tp_msgtype2str[] = { #define L2TP_AVP_SEQ_REQUIRED 39 /* Sequencing Required */ #define L2TP_AVP_PPP_DISCON_CC 46 /* PPP Disconnect Cause Code */ -static struct tok l2tp_avp2str[] = { +static const struct tok l2tp_avp2str[] = { { L2TP_AVP_MSGTYPE, "MSGTYPE" }, { L2TP_AVP_RESULT_CODE, "RESULT_CODE" }, { L2TP_AVP_PROTO_VER, "PROTO_VER" }, @@ -160,7 +160,7 @@ static struct tok l2tp_avp2str[] = { { 0, NULL } }; -static struct tok l2tp_authentype2str[] = { +static const struct tok l2tp_authentype2str[] = { { L2TP_AUTHEN_TYPE_RESERVED, "Reserved" }, { L2TP_AUTHEN_TYPE_TEXTUAL, "Textual" }, { L2TP_AUTHEN_TYPE_CHAP, "CHAP" }, @@ -174,7 +174,7 @@ static struct tok l2tp_authentype2str[] = { #define L2TP_PPP_DISCON_CC_DIRECTION_AT_PEER 1 #define L2TP_PPP_DISCON_CC_DIRECTION_AT_LOCAL 2 -static struct tok l2tp_cc_direction2str[] = { +static const struct tok l2tp_cc_direction2str[] = { { L2TP_PPP_DISCON_CC_DIRECTION_GLOBAL, "global error" }, { L2TP_PPP_DISCON_CC_DIRECTION_AT_PEER, "at peer" }, { L2TP_PPP_DISCON_CC_DIRECTION_AT_LOCAL,"at local" }, diff --git a/print-llc.c b/print-llc.c index 5ba81894..356e313d 100644 --- a/print-llc.c +++ b/print-llc.c @@ -44,7 +44,7 @@ static const char rcsid[] _U_ = #include "ethertype.h" #include "oui.h" -static struct tok llc_values[] = { +static const struct tok llc_values[] = { { LLCSAP_NULL, "Null" }, { LLCSAP_GLOBAL, "Global" }, { LLCSAP_8021B_I, "802.1B I" }, @@ -63,7 +63,7 @@ static struct tok llc_values[] = { { 0, NULL }, }; -static struct tok llc_cmd_values[] = { +static const struct tok llc_cmd_values[] = { { LLC_UI, "ui" }, { LLC_TEST, "test" }, { LLC_XID, "xid" }, diff --git a/print-lwres.c b/print-lwres.c index aad4eee3..60acc5b5 100644 --- a/print-lwres.c +++ b/print-lwres.c @@ -175,7 +175,7 @@ typedef struct { #define LWRES_MAX_ALIASES 16 /* max # of aliases */ #define LWRES_MAX_ADDRS 64 /* max # of addrs */ -struct tok opcode[] = { +static const struct tok opcode[] = { { LWRES_OPCODE_NOOP, "noop", }, { LWRES_OPCODE_GETADDRSBYNAME, "getaddrsbyname", }, { LWRES_OPCODE_GETNAMEBYADDR, "getnamebyaddr", }, @@ -184,8 +184,8 @@ struct tok opcode[] = { }; /* print-domain.c */ -extern struct tok ns_type2str[]; -extern struct tok ns_class2str[]; +extern const struct tok ns_type2str[]; +extern const struct tok ns_class2str[]; static int lwres_printname(size_t, const char *); static int lwres_printnamelen(const char *); diff --git a/print-nflog.c b/print-nflog.c index 238226e1..194d9304 100644 --- a/print-nflog.c +++ b/print-nflog.c @@ -44,7 +44,7 @@ #define NFULA_PAYLOAD 9 #define NFULA_MAX 17 -const struct tok nflog_values[] = { +static const struct tok nflog_values[] = { { AF_INET, "IPv4" }, { AF_INET6, "IPv6" }, { 0, NULL } diff --git a/print-nfs.c b/print-nfs.c index 6aafde7e..d5816cee 100644 --- a/print-nfs.c +++ b/print-nfs.c @@ -100,7 +100,7 @@ u_int32_t nfsv3_procid[NFS_NPROCS] = { * the first NFS server was the SunOS 2.0 one, and until 5.0 SunOS * was primarily BSD-derived. */ -static struct tok status2str[] = { +static const struct tok status2str[] = { { 1, "Operation not permitted" }, /* EPERM */ { 2, "No such file or directory" }, /* ENOENT */ { 5, "Input/output error" }, /* EIO */ @@ -138,14 +138,14 @@ static struct tok status2str[] = { { 0, NULL } }; -static struct tok nfsv3_writemodes[] = { +static const struct tok nfsv3_writemodes[] = { { 0, "unstable" }, { 1, "datasync" }, { 2, "filesync" }, { 0, NULL } }; -static struct tok type2str[] = { +static const struct tok type2str[] = { { NFNON, "NON" }, { NFREG, "REG" }, { NFDIR, "DIR" }, diff --git a/print-ntp.c b/print-ntp.c index b814cb57..28c86199 100644 --- a/print-ntp.c +++ b/print-ntp.c @@ -52,7 +52,7 @@ static void p_sfix(const struct s_fixedpt *); static void p_ntp_time(const struct l_fixedpt *); static void p_ntp_delta(const struct l_fixedpt *, const struct l_fixedpt *); -static struct tok ntp_mode_values[] = { +static const struct tok ntp_mode_values[] = { { MODE_UNSPEC, "unspecified" }, { MODE_SYM_ACT, "symmetric active" }, { MODE_SYM_PAS, "symmetric passive" }, @@ -64,7 +64,7 @@ static struct tok ntp_mode_values[] = { { 0, NULL } }; -static struct tok ntp_leapind_values[] = { +static const struct tok ntp_leapind_values[] = { { NO_WARNING, "" }, { PLUS_SEC, "+1s" }, { MINUS_SEC, "-1s" }, @@ -72,7 +72,7 @@ static struct tok ntp_leapind_values[] = { { 0, NULL } }; -static struct tok ntp_stratum_values[] = { +static const struct tok ntp_stratum_values[] = { { UNSPECIFIED, "unspecified" }, { PRIM_REF, "primary reference" }, { 0, NULL } diff --git a/print-olsr.c b/print-olsr.c index ba0ed2be..2713c09c 100644 --- a/print-olsr.c +++ b/print-olsr.c @@ -78,7 +78,7 @@ struct olsr_common { #define OLSR_HELLO_LQ_MSG 201 /* LQ extensions olsr.org */ #define OLSR_TC_LQ_MSG 202 /* LQ extensions olsr.org */ -static struct tok olsr_msg_values[] = { +static const struct tok olsr_msg_values[] = { { OLSR_HELLO_MSG, "Hello" }, { OLSR_TC_MSG, "TC" }, { OLSR_MID_MSG, "MID" }, @@ -141,7 +141,7 @@ struct olsr_hna6 { #define OLSR_EXTRACT_LINK_TYPE(link_code) (link_code & 0x3) #define OLSR_EXTRACT_NEIGHBOR_TYPE(link_code) (link_code >> 2) -static struct tok olsr_link_type_values[] = { +static const struct tok olsr_link_type_values[] = { { 0, "Unspecified" }, { 1, "Asymmetric" }, { 2, "Symmetric" }, @@ -149,7 +149,7 @@ static struct tok olsr_link_type_values[] = { { 0, NULL} }; -static struct tok olsr_neighbor_type_values[] = { +static const struct tok olsr_neighbor_type_values[] = { { 0, "Not-Neighbor" }, { 1, "Symmetric" }, { 2, "Symmetric-MPR" }, diff --git a/print-ospf.c b/print-ospf.c index 736f5df3..9533cb63 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -43,7 +43,7 @@ static const char rcsid[] _U_ = #include "ip.h" -static struct tok ospf_option_values[] = { +static const struct tok ospf_option_values[] = { { OSPF_OPTION_T, "MultiTopology" }, /* draft-ietf-ospf-mt-09 */ { OSPF_OPTION_E, "External" }, { OSPF_OPTION_MC, "Multicast" }, @@ -55,14 +55,14 @@ static struct tok ospf_option_values[] = { { 0, NULL } }; -static struct tok ospf_authtype_values[] = { +static const struct tok ospf_authtype_values[] = { { OSPF_AUTH_NONE, "none" }, { OSPF_AUTH_SIMPLE, "simple" }, { OSPF_AUTH_MD5, "MD5" }, { 0, NULL } }; -static struct tok ospf_rla_flag_values[] = { +static const struct tok ospf_rla_flag_values[] = { { RLA_FLAG_B, "ABR" }, { RLA_FLAG_E, "ASBR" }, { RLA_FLAG_W1, "Virtual" }, @@ -70,7 +70,7 @@ static struct tok ospf_rla_flag_values[] = { { 0, NULL } }; -static struct tok type2str[] = { +static const struct tok type2str[] = { { OSPF_TYPE_UMD, "UMD" }, { OSPF_TYPE_HELLO, "Hello" }, { OSPF_TYPE_DD, "Database Description" }, @@ -80,7 +80,7 @@ static struct tok type2str[] = { { 0, NULL } }; -static struct tok lsa_values[] = { +static const struct tok lsa_values[] = { { LS_TYPE_ROUTER, "Router" }, { LS_TYPE_NETWORK, "Network" }, { LS_TYPE_SUM_IP, "Summary" }, @@ -94,7 +94,7 @@ static struct tok lsa_values[] = { { 0, NULL } }; -static struct tok ospf_dd_flag_values[] = { +static const struct tok ospf_dd_flag_values[] = { { OSPF_DB_INIT, "Init" }, { OSPF_DB_MORE, "More" }, { OSPF_DB_MASTER, "Master" }, @@ -102,20 +102,20 @@ static struct tok ospf_dd_flag_values[] = { { 0, NULL } }; -static struct tok lsa_opaque_values[] = { +static const struct tok lsa_opaque_values[] = { { LS_OPAQUE_TYPE_TE, "Traffic Engineering" }, { LS_OPAQUE_TYPE_GRACE, "Graceful restart" }, { LS_OPAQUE_TYPE_RI, "Router Information" }, { 0, NULL } }; -static struct tok lsa_opaque_te_tlv_values[] = { +static const struct tok lsa_opaque_te_tlv_values[] = { { LS_OPAQUE_TE_TLV_ROUTER, "Router Address" }, { LS_OPAQUE_TE_TLV_LINK, "Link" }, { 0, NULL } }; -static struct tok lsa_opaque_te_link_tlv_subtlv_values[] = { +static const struct tok lsa_opaque_te_link_tlv_subtlv_values[] = { { LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE, "Link Type" }, { LS_OPAQUE_TE_LINK_SUBTLV_LINK_ID, "Link ID" }, { LS_OPAQUE_TE_LINK_SUBTLV_LOCAL_IP, "Local Interface IP address" }, @@ -133,14 +133,14 @@ static struct tok lsa_opaque_te_link_tlv_subtlv_values[] = { { 0, NULL } }; -static struct tok lsa_opaque_grace_tlv_values[] = { +static const struct tok lsa_opaque_grace_tlv_values[] = { { LS_OPAQUE_GRACE_TLV_PERIOD, "Grace Period" }, { LS_OPAQUE_GRACE_TLV_REASON, "Graceful restart Reason" }, { LS_OPAQUE_GRACE_TLV_INT_ADDRESS, "IPv4 interface address" }, { 0, NULL } }; -static struct tok lsa_opaque_grace_tlv_reason_values[] = { +static const struct tok lsa_opaque_grace_tlv_reason_values[] = { { LS_OPAQUE_GRACE_TLV_REASON_UNKNOWN, "Unknown" }, { LS_OPAQUE_GRACE_TLV_REASON_SW_RESTART, "Software Restart" }, { LS_OPAQUE_GRACE_TLV_REASON_SW_UPGRADE, "Software Reload/Upgrade" }, @@ -148,18 +148,18 @@ static struct tok lsa_opaque_grace_tlv_reason_values[] = { { 0, NULL } }; -static struct tok lsa_opaque_te_tlv_link_type_sub_tlv_values[] = { +static const struct tok lsa_opaque_te_tlv_link_type_sub_tlv_values[] = { { LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_PTP, "Point-to-point" }, { LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE_MA, "Multi-Access" }, { 0, NULL } }; -static struct tok lsa_opaque_ri_tlv_values[] = { +static const struct tok lsa_opaque_ri_tlv_values[] = { { LS_OPAQUE_RI_TLV_CAP, "Router Capabilities" }, { 0, NULL } }; -static struct tok lsa_opaque_ri_tlv_cap_values[] = { +static const struct tok lsa_opaque_ri_tlv_cap_values[] = { { 1, "Reserved" }, { 2, "Reserved" }, { 4, "Reserved" }, @@ -173,13 +173,13 @@ static struct tok lsa_opaque_ri_tlv_cap_values[] = { { 0, NULL } }; -static struct tok ospf_lls_tlv_values[] = { +static const struct tok ospf_lls_tlv_values[] = { { OSPF_LLS_EO, "Extended Options" }, { OSPF_LLS_MD5, "MD5 Authentication" }, { 0, NULL } }; -static struct tok ospf_lls_eo_options[] = { +static const struct tok ospf_lls_eo_options[] = { { OSPF_LLS_EO_LR, "LSDB resync" }, { OSPF_LLS_EO_RS, "Restart" }, { 0, NULL } @@ -516,7 +516,7 @@ trunc: } /* draft-ietf-ospf-mt-09 */ -static struct tok ospf_topology_values[] = { +static const struct tok ospf_topology_values[] = { { 0, "default " }, { 1, "multicast " }, { 2, "management " }, diff --git a/print-ospf6.c b/print-ospf6.c index dbd07ec3..b0a6f272 100644 --- a/print-ospf6.c +++ b/print-ospf6.c @@ -68,7 +68,7 @@ static const struct tok ospf6_asla_flag_values[] = { { 0, NULL } }; -static struct tok ospf6_type_values[] = { +static const struct tok ospf6_type_values[] = { { OSPF_TYPE_HELLO, "Hello" }, { OSPF_TYPE_DD, "Database Description" }, { OSPF_TYPE_LS_REQ, "LS-Request" }, @@ -77,7 +77,7 @@ static struct tok ospf6_type_values[] = { { 0, NULL } }; -static struct tok ospf6_lsa_values[] = { +static const struct tok ospf6_lsa_values[] = { { LS_TYPE_ROUTER, "Router" }, { LS_TYPE_NETWORK, "Network" }, { LS_TYPE_INTER_AP, "Inter-Area Prefix" }, @@ -92,21 +92,21 @@ static struct tok ospf6_lsa_values[] = { { 0, NULL } }; -static struct tok ospf6_ls_scope_values[] = { +static const struct tok ospf6_ls_scope_values[] = { { LS_SCOPE_LINKLOCAL, "Link Local" }, { LS_SCOPE_AREA, "Area Local" }, { LS_SCOPE_AS, "Domain Wide" }, { 0, NULL } }; -static struct tok ospf6_dd_flag_values[] = { +static const struct tok ospf6_dd_flag_values[] = { { OSPF6_DB_INIT, "Init" }, { OSPF6_DB_MORE, "More" }, { OSPF6_DB_MASTER, "Master" }, { 0, NULL } }; -static struct tok ospf6_lsa_prefix_option_values[] = { +static const struct tok ospf6_lsa_prefix_option_values[] = { { LSA_PREFIX_OPT_NU, "No Unicast" }, { LSA_PREFIX_OPT_LA, "Local address" }, { LSA_PREFIX_OPT_MC, "Multicast" }, diff --git a/print-pflog.c b/print-pflog.c index ac325f4b..8a3b66aa 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -46,7 +46,7 @@ static const char rcsid[] _U_ = #include "interface.h" #include "addrtoname.h" -static struct tok pf_reasons[] = { +static const struct tok pf_reasons[] = { { 0, "0(match)" }, { 1, "1(bad-offset)" }, { 2, "2(fragment)" }, @@ -65,7 +65,7 @@ static struct tok pf_reasons[] = { { 0, NULL } }; -static struct tok pf_actions[] = { +static const struct tok pf_actions[] = { { PF_PASS, "pass" }, { PF_DROP, "block" }, { PF_SCRUB, "scrub" }, @@ -79,7 +79,7 @@ static struct tok pf_actions[] = { { 0, NULL } }; -static struct tok pf_directions[] = { +static const struct tok pf_directions[] = { { PF_INOUT, "in/out" }, { PF_IN, "in" }, { PF_OUT, "out" }, diff --git a/print-pim.c b/print-pim.c index e0cca125..3cd68109 100644 --- a/print-pim.c +++ b/print-pim.c @@ -50,7 +50,7 @@ static const char rcsid[] _U_ = #define PIMV2_TYPE_CANDIDATE_RP 8 #define PIMV2_TYPE_PRUNE_REFRESH 9 -static struct tok pimv2_type_values[] = { +static const struct tok pimv2_type_values[] = { { PIMV2_TYPE_HELLO, "Hello" }, { PIMV2_TYPE_REGISTER, "Register" }, { PIMV2_TYPE_REGISTER_STOP, "Register Stop" }, @@ -74,7 +74,7 @@ static struct tok pimv2_type_values[] = { #define PIMV2_HELLO_OPTION_ADDRESS_LIST 24 #define PIMV2_HELLO_OPTION_ADDRESS_LIST_OLD 65001 -static struct tok pimv2_hello_option_values[] = { +static const struct tok pimv2_hello_option_values[] = { { PIMV2_HELLO_OPTION_HOLDTIME, "Hold Time" }, { PIMV2_HELLO_OPTION_LANPRUNEDELAY, "LAN Prune Delay" }, { PIMV2_HELLO_OPTION_DR_PRIORITY_OLD, "DR Priority (Old)" }, @@ -91,7 +91,7 @@ static struct tok pimv2_hello_option_values[] = { #define PIMV2_REGISTER_FLAG_BORDER 0x80000000 #define PIMV2_REGISTER_FLAG_NULL 0x40000000 -static struct tok pimv2_register_flag_values[] = { +static const struct tok pimv2_register_flag_values[] = { { PIMV2_REGISTER_FLAG_BORDER, "Border" }, { PIMV2_REGISTER_FLAG_NULL, "Null" }, { 0, NULL} diff --git a/print-ppp.c b/print-ppp.c index ea8e00b2..0ae88118 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -65,7 +65,7 @@ static const char rcsid[] _U_ = /* Protocol Codes defined in ppp.h */ -struct tok ppptype2str[] = { +static const struct tok ppptype2str[] = { { PPP_IP, "IP" }, { PPP_OSI, "OSI" }, { PPP_NS, "NS" }, @@ -129,7 +129,7 @@ struct tok ppptype2str[] = { #define CPCODES_RESET_REQ 14 /* Reset-Request (CCP only) RFC1962 */ #define CPCODES_RESET_REP 15 /* Reset-Reply (CCP only) */ -struct tok cpcodes[] = { +static const struct tok cpcodes[] = { {CPCODES_VEXT, "Vendor-Extension"}, /* RFC2153 */ {CPCODES_CONF_REQ, "Conf-Request"}, {CPCODES_CONF_ACK, "Conf-Ack"}, @@ -243,7 +243,7 @@ static const char *lcpconfopts[] = { /* 27-254 unassigned */ #define CCPOPT_RESV 255 /* RFC1962 */ -const struct tok ccpconfopts_values[] = { +static const struct tok ccpconfopts_values[] = { { CCPOPT_OUI, "OUI" }, { CCPOPT_PRED1, "Pred-1" }, { CCPOPT_PRED2, "Pred-2" }, @@ -266,7 +266,7 @@ const struct tok ccpconfopts_values[] = { #define BACPOPT_FPEER 1 /* RFC2125 */ -const struct tok bacconfopts_values[] = { +static const struct tok bacconfopts_values[] = { { BACPOPT_FPEER, "Favored-Peer" }, {0, NULL} }; @@ -284,7 +284,7 @@ const struct tok bacconfopts_values[] = { #define IPCPOPT_SECDNS 131 /* RFC1877 */ #define IPCPOPT_SECNBNS 132 /* RFC1877 */ -struct tok ipcpopt_values[] = { +static const struct tok ipcpopt_values[] = { { IPCPOPT_2ADDR, "IP-Addrs" }, { IPCPOPT_IPCOMP, "IP-Comp" }, { IPCPOPT_ADDR, "IP-Addr" }, @@ -299,13 +299,13 @@ struct tok ipcpopt_values[] = { #define IPCPOPT_IPCOMP_HDRCOMP 0x61 /* rfc3544 */ #define IPCPOPT_IPCOMP_MINLEN 14 -struct tok ipcpopt_compproto_values[] = { +static const struct tok ipcpopt_compproto_values[] = { { PPP_VJC, "VJ-Comp" }, { IPCPOPT_IPCOMP_HDRCOMP, "IP Header Compression" }, { 0, NULL } }; -struct tok ipcpopt_compproto_subopt_values[] = { +static const struct tok ipcpopt_compproto_subopt_values[] = { { 1, "RTP-Compression" }, { 2, "Enhanced RTP-Compression" }, { 0, NULL } @@ -314,7 +314,7 @@ struct tok ipcpopt_compproto_subopt_values[] = { /* IP6CP Config Options */ #define IP6CP_IFID 1 -struct tok ip6cpopt_values[] = { +static const struct tok ip6cpopt_values[] = { { IP6CP_IFID, "Interface-ID" }, { 0, NULL } }; @@ -333,7 +333,7 @@ struct tok ip6cpopt_values[] = { #define AUTHALG_MSCHAP1 128 /* RFC2433 */ #define AUTHALG_MSCHAP2 129 /* RFC2795 */ -struct tok authalg_values[] = { +static const struct tok authalg_values[] = { { AUTHALG_CHAPMD5, "MD5" }, { AUTHALG_MSCHAP1, "MS-CHAPv1" }, { AUTHALG_MSCHAP2, "MS-CHAPv2" }, @@ -358,7 +358,7 @@ struct tok authalg_values[] = { #define CALLBACK_X500 4 /* X.500 distinguished name */ #define CALLBACK_CBCP 6 /* Location is determined during CBCP nego */ -struct tok ppp_callback_values[] = { +static const struct tok ppp_callback_values[] = { { CALLBACK_AUTH, "UserAuth" }, { CALLBACK_DSTR, "DialString" }, { CALLBACK_LID, "LocalID" }, @@ -375,7 +375,7 @@ struct tok ppp_callback_values[] = { #define CHAP_SUCC 3 #define CHAP_FAIL 4 -struct tok chapcode_values[] = { +static const struct tok chapcode_values[] = { { CHAP_CHAL, "Challenge" }, { CHAP_RESP, "Response" }, { CHAP_SUCC, "Success" }, @@ -389,7 +389,7 @@ struct tok chapcode_values[] = { #define PAP_AACK 2 #define PAP_ANAK 3 -struct tok papcode_values[] = { +static const struct tok papcode_values[] = { { PAP_AREQ, "Auth-Req" }, { PAP_AACK, "Auth-ACK" }, { PAP_ANAK, "Auth-NACK" }, @@ -773,7 +773,7 @@ trunc: } /* ML-PPP*/ -struct tok ppp_ml_flag_values[] = { +static const struct tok ppp_ml_flag_values[] = { { 0x80, "begin" }, { 0x40, "end" }, { 0, NULL } diff --git a/print-pppoe.c b/print-pppoe.c index 8040c7ae..f8c9008a 100644 --- a/print-pppoe.c +++ b/print-pppoe.c @@ -51,7 +51,7 @@ enum { PPPOE_PADT = 0xa7 }; -static struct tok pppoecode2str[] = { +static const struct tok pppoecode2str[] = { { PPPOE_PADI, "PADI" }, { PPPOE_PADO, "PADO" }, { PPPOE_PADR, "PADR" }, @@ -76,7 +76,7 @@ enum { PPPOE_GENERIC_ERROR = 0x0203 }; -static struct tok pppoetag2str[] = { +static const struct tok pppoetag2str[] = { { PPPOE_EOL, "EOL" }, { PPPOE_SERVICE_NAME, "Service-Name" }, { PPPOE_AC_NAME, "AC-Name" }, diff --git a/print-radius.c b/print-radius.c index 44f0c7fc..74fd72d1 100644 --- a/print-radius.c +++ b/print-radius.c @@ -84,7 +84,7 @@ static const char rcsid[] _U_ = #define RADCMD_STATUS_CLI 13 /* Status-Client */ #define RADCMD_RESERVED 255 /* Reserved */ -static struct tok radius_command_values[] = { +static const struct tok radius_command_values[] = { { RADCMD_ACCESS_REQ, "Access Request" }, { RADCMD_ACCESS_ACC, "Access Accept" }, { RADCMD_ACCESS_REJ, "Access Reject" }, diff --git a/print-rsvp.c b/print-rsvp.c index 1c76dcbb..2d54a3eb 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -390,7 +390,7 @@ static const struct tok rsvp_intserv_parameter_id_values[] = { { 0, NULL} }; -static struct tok rsvp_session_attribute_flag_values[] = { +static const struct tok rsvp_session_attribute_flag_values[] = { { 0x01, "Local Protection" }, { 0x02, "Label Recording" }, { 0x04, "SE Style" }, @@ -399,7 +399,7 @@ static struct tok rsvp_session_attribute_flag_values[] = { { 0, NULL} }; -static struct tok rsvp_obj_prop_tlv_values[] = { +static const struct tok rsvp_obj_prop_tlv_values[] = { { 0x01, "Cos" }, { 0x02, "Metric 1" }, { 0x04, "Metric 2" }, @@ -413,7 +413,7 @@ static struct tok rsvp_obj_prop_tlv_values[] = { #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE 28 #define RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE_OLD 125 -static struct tok rsvp_obj_error_code_values[] = { +static const struct tok rsvp_obj_error_code_values[] = { { RSVP_OBJ_ERROR_SPEC_CODE_ROUTING, "Routing Problem" }, { RSVP_OBJ_ERROR_SPEC_CODE_NOTIFY, "Notify Error" }, { RSVP_OBJ_ERROR_SPEC_CODE_DIFFSERV_TE, "Diffserv TE Error" }, @@ -421,7 +421,7 @@ static struct tok rsvp_obj_error_code_values[] = { { 0, NULL} }; -static struct tok rsvp_obj_error_code_routing_values[] = { +static const struct tok rsvp_obj_error_code_routing_values[] = { { 1, "Bad EXPLICIT_ROUTE object" }, { 2, "Bad strict node" }, { 3, "Bad loose node" }, @@ -435,7 +435,7 @@ static struct tok rsvp_obj_error_code_routing_values[] = { { 0, NULL} }; -static struct tok rsvp_obj_error_code_diffserv_te_values[] = { +static const struct tok rsvp_obj_error_code_diffserv_te_values[] = { { 1, "Unexpected CT object" }, { 2, "Unsupported CT" }, { 3, "Invalid CT value" }, @@ -54,7 +54,7 @@ static const char rcsid[] _U_ = #include "ip.h" -static struct tok rx_types[] = { +static const struct tok rx_types[] = { { RX_PACKET_TYPE_DATA, "data" }, { RX_PACKET_TYPE_ACK, "ack" }, { RX_PACKET_TYPE_BUSY, "busy" }, @@ -82,7 +82,7 @@ static struct double_tok { { RX_JUMBO_PACKET, RX_PACKET_TYPE_DATA, "jumbogram" } }; -static struct tok fs_req[] = { +static const struct tok fs_req[] = { { 130, "fetch-data" }, { 131, "fetch-acl" }, { 132, "fetch-status" }, @@ -127,7 +127,7 @@ static struct tok fs_req[] = { { 0, NULL }, }; -static struct tok cb_req[] = { +static const struct tok cb_req[] = { { 204, "callback" }, { 205, "initcb" }, { 206, "probe" }, @@ -149,7 +149,7 @@ static struct tok cb_req[] = { { 0, NULL }, }; -static struct tok pt_req[] = { +static const struct tok pt_req[] = { { 500, "new-user" }, { 501, "where-is-it" }, { 502, "dump-entry" }, @@ -176,7 +176,7 @@ static struct tok pt_req[] = { { 0, NULL }, }; -static struct tok vldb_req[] = { +static const struct tok vldb_req[] = { { 501, "create-entry" }, { 502, "delete-entry" }, { 503, "get-entry-by-id" }, @@ -214,7 +214,7 @@ static struct tok vldb_req[] = { { 0, NULL }, }; -static struct tok kauth_req[] = { +static const struct tok kauth_req[] = { { 1, "auth-old" }, { 21, "authenticate" }, { 22, "authenticate-v2" }, @@ -236,7 +236,7 @@ static struct tok kauth_req[] = { { 0, NULL }, }; -static struct tok vol_req[] = { +static const struct tok vol_req[] = { { 100, "create-volume" }, { 101, "delete-volume" }, { 102, "restore" }, @@ -272,7 +272,7 @@ static struct tok vol_req[] = { { 0, NULL }, }; -static struct tok bos_req[] = { +static const struct tok bos_req[] = { { 80, "create-bnode" }, { 81, "delete-bnode" }, { 82, "set-status" }, @@ -313,7 +313,7 @@ static struct tok bos_req[] = { { 0, NULL }, }; -static struct tok ubik_req[] = { +static const struct tok ubik_req[] = { { 10000, "vote-beacon" }, { 10001, "vote-debug-old" }, { 10002, "vote-sdebug-old" }, @@ -344,14 +344,14 @@ static struct tok ubik_req[] = { #define DISK_LOW 20000 #define DISK_HIGH 20013 -static struct tok cb_types[] = { +static const struct tok cb_types[] = { { 1, "exclusive" }, { 2, "shared" }, { 3, "dropped" }, { 0, NULL }, }; -static struct tok ubik_lock_types[] = { +static const struct tok ubik_lock_types[] = { { 1, "read" }, { 2, "write" }, { 3, "wait" }, @@ -360,7 +360,7 @@ static struct tok ubik_lock_types[] = { static const char *voltype[] = { "read-write", "read-only", "backup" }; -static struct tok afs_fs_errors[] = { +static const struct tok afs_fs_errors[] = { { 101, "salvage volume" }, { 102, "no such vnode" }, { 103, "no such volume" }, @@ -381,7 +381,7 @@ static struct tok afs_fs_errors[] = { * Reasons for acknowledging a packet */ -static struct tok rx_ack_reasons[] = { +static const struct tok rx_ack_reasons[] = { { 1, "ack requested" }, { 2, "duplicate packet" }, { 3, "out of sequence" }, diff --git a/print-sctp.c b/print-sctp.c index fb5d7e3a..5a4b1e93 100644 --- a/print-sctp.c +++ b/print-sctp.c @@ -63,7 +63,7 @@ static const char rcsid[] _U_ = #define CHAN_MP 6705 #define CHAN_LP 6706 -struct tok ForCES_channels[] = { +static const struct tok ForCES_channels[] = { { CHAN_HP, "ForCES HP" }, { CHAN_MP, "ForCES MP" }, { CHAN_LP, "ForCES LP" }, diff --git a/print-sll.c b/print-sll.c index a044de67..062398e1 100644 --- a/print-sll.c +++ b/print-sll.c @@ -41,7 +41,7 @@ static const char rcsid[] _U_ = #include "ether.h" #include "sll.h" -const struct tok sll_pkttype_values[] = { +static const struct tok sll_pkttype_values[] = { { LINUX_SLL_HOST, "In" }, { LINUX_SLL_BROADCAST, "B" }, { LINUX_SLL_MULTICAST, "M" }, diff --git a/print-stp.c b/print-stp.c index 1b6f38f8..5c9b12d7 100644 --- a/print-stp.c +++ b/print-stp.c @@ -54,7 +54,7 @@ struct stp_bpdu_ { #define STP_PROTO_MSTP 0x03 #define STP_PROTO_SPB 0x04 -struct tok stp_proto_values[] = { +static const struct tok stp_proto_values[] = { { STP_PROTO_REGULAR, "802.1d" }, { STP_PROTO_RAPID, "802.1w" }, { STP_PROTO_MSTP, "802.1s" }, @@ -66,7 +66,7 @@ struct tok stp_proto_values[] = { #define STP_BPDU_TYPE_RSTP 0x02 #define STP_BPDU_TYPE_TOPO_CHANGE 0x80 -struct tok stp_bpdu_flag_values[] = { +static const struct tok stp_bpdu_flag_values[] = { { 0x01, "Topology change" }, { 0x02, "Proposal" }, { 0x10, "Learn" }, @@ -76,14 +76,14 @@ struct tok stp_bpdu_flag_values[] = { { 0, NULL} }; -struct tok stp_bpdu_type_values[] = { +static const struct tok stp_bpdu_type_values[] = { { STP_BPDU_TYPE_CONFIG, "Config" }, { STP_BPDU_TYPE_RSTP, "Rapid STP" }, { STP_BPDU_TYPE_TOPO_CHANGE, "Topology Change" }, { 0, NULL} }; -struct tok rstp_obj_port_role_values[] = { +static const struct tok rstp_obj_port_role_values[] = { { 0x00, "Unknown" }, { 0x01, "Alternate" }, { 0x02, "Root" }, diff --git a/print-sunrpc.c b/print-sunrpc.c index 21cd85a9..195825d7 100644 --- a/print-sunrpc.c +++ b/print-sunrpc.c @@ -68,7 +68,7 @@ static const char rcsid[] _U_ = #include "rpc_msg.h" #include "pmap_prot.h" -static struct tok proc2str[] = { +static const struct tok proc2str[] = { { SUNRPC_PMAPPROC_NULL, "null" }, { SUNRPC_PMAPPROC_SET, "set" }, { SUNRPC_PMAPPROC_UNSET, "unset" }, diff --git a/print-tcp.c b/print-tcp.c index 032001d1..48dd6254 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -94,7 +94,7 @@ struct tcp_seq_hash { static struct tcp_seq_hash tcp_seq_hash[TSEQ_HASHSIZE]; -struct tok tcp_flag_values[] = { +static const struct tok tcp_flag_values[] = { { TH_FIN, "F" }, { TH_SYN, "S" }, { TH_RST, "R" }, @@ -106,7 +106,7 @@ struct tok tcp_flag_values[] = { { 0, NULL } }; -struct tok tcp_option_values[] = { +static const struct tok tcp_option_values[] = { { TCPOPT_EOL, "eol" }, { TCPOPT_NOP, "nop" }, { TCPOPT_MAXSEG, "mss" }, diff --git a/print-tftp.c b/print-tftp.c index 84cde396..62e2c998 100644 --- a/print-tftp.c +++ b/print-tftp.c @@ -45,7 +45,7 @@ static const char rcsid[] _U_ = #include "tftp.h" /* op code to string mapping */ -static struct tok op2str[] = { +static const struct tok op2str[] = { { RRQ, "RRQ" }, /* read request */ { WRQ, "WRQ" }, /* write request */ { DATA, "DATA" }, /* data packet */ @@ -56,7 +56,7 @@ static struct tok op2str[] = { }; /* error code to string mapping */ -static struct tok err2str[] = { +static const struct tok err2str[] = { { EUNDEF, "EUNDEF" }, /* not defined */ { ENOTFOUND, "ENOTFOUND" }, /* file not found */ { EACCESS, "EACCESS" }, /* access violation */ diff --git a/print-udld.c b/print-udld.c index a5488dda..e8395d0a 100644 --- a/print-udld.c +++ b/print-udld.c @@ -41,7 +41,7 @@ #define UDLD_DEVICE_NAME_TLV 0x0006 #define UDLD_SEQ_NUMBER_TLV 0x0007 -static struct tok udld_tlv_values[] = { +static const struct tok udld_tlv_values[] = { { UDLD_DEVICE_ID_TLV, "Device-ID TLV"}, { UDLD_PORT_ID_TLV, "Port-ID TLV"}, { UDLD_ECHO_TLV, "Echo TLV"}, @@ -52,7 +52,7 @@ static struct tok udld_tlv_values[] = { { 0, NULL} }; -static struct tok udld_code_values[] = { +static const struct tok udld_code_values[] = { { 0x00, "Reserved"}, { 0x01, "Probe message"}, { 0x02, "Echo message"}, @@ -60,7 +60,7 @@ static struct tok udld_code_values[] = { { 0, NULL} }; -static struct tok udld_flags_values[] = { +static const struct tok udld_flags_values[] = { { 0x00, "RT"}, { 0x01, "RSY"}, { 0, NULL} diff --git a/print-vtp.c b/print-vtp.c index 7631c6f6..04ae24c7 100644 --- a/print-vtp.c +++ b/print-vtp.c @@ -57,7 +57,7 @@ struct vtp_vlan_ { u_int32_t index; }; -static struct tok vtp_message_type_values[] = { +static const struct tok vtp_message_type_values[] = { { VTP_SUMMARY_ADV, "Summary advertisement"}, { VTP_SUBSET_ADV, "Subset advertisement"}, { VTP_ADV_REQUEST, "Advertisement request"}, @@ -65,7 +65,7 @@ static struct tok vtp_message_type_values[] = { { 0, NULL } }; -static struct tok vtp_header_values[] = { +static const struct tok vtp_header_values[] = { { 0x01, "Followers"}, /* On Summary advertisement, 3rd byte is Followers */ { 0x02, "Seq number"}, /* On Subset advertisement, 3rd byte is Sequence number */ { 0x03, "Rsvd"}, /* On Adver. requests 3rd byte is Rsvd */ @@ -73,7 +73,7 @@ static struct tok vtp_header_values[] = { { 0, NULL } }; -static struct tok vtp_vlan_type_values[] = { +static const struct tok vtp_vlan_type_values[] = { { 0x01, "Ethernet"}, { 0x02, "FDDI"}, { 0x03, "TrCRF"}, @@ -82,7 +82,7 @@ static struct tok vtp_vlan_type_values[] = { { 0, NULL } }; -static struct tok vtp_vlan_status[] = { +static const struct tok vtp_vlan_status[] = { { 0x00, "Operational"}, { 0x01, "Suspended"}, { 0, NULL } @@ -99,7 +99,7 @@ static struct tok vtp_vlan_status[] = { #define VTP_VLAN_STE_HOP_COUNT 0x09 #define VTP_VLAN_BACKUP_CRF_MODE 0x0A -static struct tok vtp_vlan_tlv_values[] = { +static const struct tok vtp_vlan_tlv_values[] = { { VTP_VLAN_SOURCE_ROUTING_RING_NUMBER, "Source-Routing Ring Number TLV"}, { VTP_VLAN_SOURCE_ROUTING_BRIDGE_NUMBER, "Source-Routing Bridge Number TLV"}, { VTP_VLAN_STP_TYPE, "STP type TLV"}, @@ -113,7 +113,7 @@ static struct tok vtp_vlan_tlv_values[] = { { 0, NULL } }; -static struct tok vtp_stp_type_values[] = { +static const struct tok vtp_stp_type_values[] = { { 1, "SRT"}, { 2, "SRB"}, { 3, "Auto"}, diff --git a/print-zephyr.c b/print-zephyr.c index 7c52e654..d8252cca 100644 --- a/print-zephyr.c +++ b/print-zephyr.c @@ -70,7 +70,7 @@ enum z_packet_type { Z_PACKET_STAT }; -static struct tok z_types[] = { +static const struct tok z_types[] = { { Z_PACKET_UNSAFE, "unsafe" }, { Z_PACKET_UNACKED, "unacked" }, { Z_PACKET_ACKED, "acked" }, |