From 0266cceef3e00f56bcdf68282a3937a18cd956de Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Thu, 29 Nov 2012 20:15:37 +0000 Subject: [PATCH] Make all enum_val_t's const. svn path=/trunk/; revision=46292 --- asn1/ansi_map/packet-ansi_map-template.c | 2 +- asn1/ansi_tcap/packet-ansi_tcap-template.c | 88 +++++++++++----------- asn1/camel/packet-camel-template.c | 2 +- asn1/gsm_map/packet-gsm_map-template.c | 4 +- epan/dissectors/packet-amr.c | 4 +- epan/dissectors/packet-ansi_a.c | 2 +- epan/dissectors/packet-ansi_map.c | 2 +- epan/dissectors/packet-ansi_tcap.c | 88 +++++++++++----------- epan/dissectors/packet-atm.c | 2 +- epan/dissectors/packet-bgp.c | 10 +-- epan/dissectors/packet-bootp.c | 2 +- epan/dissectors/packet-bssap.c | 4 +- epan/dissectors/packet-btsap.c | 2 +- epan/dissectors/packet-camel.c | 2 +- epan/dissectors/packet-ccsds.c | 2 +- epan/dissectors/packet-cigi.c | 12 +-- epan/dissectors/packet-dmp.c | 6 +- epan/dissectors/packet-dmx-chan.c | 6 +- epan/dissectors/packet-enip.c | 11 ++- epan/dissectors/packet-enttec.c | 6 +- epan/dissectors/packet-erf.c | 4 +- epan/dissectors/packet-fcoib.c | 2 +- epan/dissectors/packet-flip.c | 2 +- epan/dissectors/packet-fr.c | 2 +- epan/dissectors/packet-gsm_map.c | 4 +- epan/dissectors/packet-ieee80211.c | 8 +- epan/dissectors/packet-ieee802154.c | 2 +- epan/dissectors/packet-infiniband_sdp.c | 2 +- epan/dissectors/packet-iscsi.c | 2 +- epan/dissectors/packet-isdn.c | 2 +- epan/dissectors/packet-ismacryp.c | 4 +- epan/dissectors/packet-isup.c | 16 ++-- epan/dissectors/packet-l2tp.c | 36 ++++----- epan/dissectors/packet-m2pa.c | 2 +- epan/dissectors/packet-m2ua.c | 2 +- epan/dissectors/packet-m3ua.c | 2 +- epan/dissectors/packet-mac-lte.c | 4 +- epan/dissectors/packet-mpls.c | 6 +- epan/dissectors/packet-mtp3.c | 10 +-- epan/dissectors/packet-ndmp.c | 2 +- epan/dissectors/packet-nflog.c | 2 +- epan/dissectors/packet-nfs.c | 2 +- epan/dissectors/packet-p_mul.c | 2 +- epan/dissectors/packet-pdcp-lte.c | 4 +- epan/dissectors/packet-rlc-lte.c | 6 +- epan/dissectors/packet-rsvp.c | 4 +- epan/dissectors/packet-rtp.c | 2 +- epan/dissectors/packet-sctp.c | 2 +- epan/dissectors/packet-sdh.c | 12 +-- epan/dissectors/packet-sigcomp.c | 12 +-- epan/dissectors/packet-socketcan.c | 2 +- epan/dissectors/packet-sscop.c | 2 +- epan/dissectors/packet-sua.c | 2 +- epan/dissectors/packet-tcp.c | 2 +- epan/dissectors/packet-time.c | 2 +- epan/dissectors/packet-tipc.c | 4 +- epan/dissectors/packet-zbee-security.c | 2 +- 57 files changed, 217 insertions(+), 218 deletions(-) diff --git a/asn1/ansi_map/packet-ansi_map-template.c b/asn1/ansi_map/packet-ansi_map-template.c index af90f980cd..d9362e2095 100644 --- a/asn1/ansi_map/packet-ansi_map-template.c +++ b/asn1/ansi_map/packet-ansi_map-template.c @@ -5269,7 +5269,7 @@ void proto_register_ansi_map(void) { #include "packet-ansi_map-ettarr.c" }; - static enum_val_t ansi_map_response_matching_type_values[] = { + static const enum_val_t ansi_map_response_matching_type_values[] = { {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", 0}, {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", 1}, {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", 2}, diff --git a/asn1/ansi_tcap/packet-ansi_tcap-template.c b/asn1/ansi_tcap/packet-ansi_tcap-template.c index f7b52ef5b7..9a5497d0f9 100644 --- a/asn1/ansi_tcap/packet-ansi_tcap-template.c +++ b/asn1/ansi_tcap/packet-ansi_tcap-template.c @@ -77,7 +77,7 @@ static gboolean tcap_subdissector_used=FALSE; static struct tcaphash_context_t * gp_tcap_context=NULL; /* Note the high bit should be masked off when registering in this table (0x7fff)*/ -static dissector_table_t ansi_tcap_national_opcode_table; /* National Operation Codes */ +static dissector_table_t ansi_tcap_national_opcode_table; /* National Operation Codes */ #include "packet-ansi_tcap-ett.c" @@ -193,17 +193,17 @@ save_invoke_data(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){ /* Only do this once XXX I hope its the right thing to do */ /* The hash string needs to contain src and dest to distiguish differnt flows */ - switch(ansi_tcap_response_matching_type){ - case 0: - buf = ep_strdup(ansi_tcap_private.TransactionID_str); - break; - case 1: - buf = ep_strdup_printf("%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src)); - break; - default: - buf = ep_strdup_printf("%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src),ep_address_to_str(dst)); - break; - } + switch(ansi_tcap_response_matching_type){ + case 0: + buf = ep_strdup(ansi_tcap_private.TransactionID_str); + break; + case 1: + buf = ep_strdup_printf("%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src)); + break; + default: + buf = ep_strdup_printf("%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src),ep_address_to_str(dst)); + break; + } /* If the entry allready exists don't owervrite it */ ansi_tcap_saved_invokedata = (struct ansi_tcap_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf); @@ -243,16 +243,16 @@ find_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U ansi_tcap_private.TransactionID_str, ep_address_to_str(dst), ep_address_to_str(src)); switch(ansi_tcap_response_matching_type){ - case 0: - g_snprintf(buf,MAX_TID_STR_LEN,"%s",ansi_tcap_private.TransactionID_str); - break; - case 1: - g_snprintf(buf,MAX_TID_STR_LEN,"%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst)); - break; - default: - g_snprintf(buf,MAX_TID_STR_LEN,"%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst),ep_address_to_str(src)); - break; - } + case 0: + g_snprintf(buf,MAX_TID_STR_LEN,"%s",ansi_tcap_private.TransactionID_str); + break; + case 1: + g_snprintf(buf,MAX_TID_STR_LEN,"%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst)); + break; + default: + g_snprintf(buf,MAX_TID_STR_LEN,"%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst),ep_address_to_str(src)); + break; + } ansi_tcap_saved_invokedata = (struct ansi_tcap_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf); if(ansi_tcap_saved_invokedata){ @@ -310,23 +310,23 @@ find_tcap_subdissector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){ } if(ansi_tcap_private.d.OperationCode == 0){ /* national */ - guint8 family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8; - guint8 specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff); - if(!dissector_try_uint(ansi_tcap_national_opcode_table, ansi_tcap_private.d.OperationCode_national, tvb, actx->pinfo, tcap_top_tree)){ - item = proto_tree_add_text(tree, tvb, 0, -1, - "Dissector for ANSI TCAP NATIONAL code:0x%x(Family %u, Specifier %u) \n" - "not implemented. Contact Wireshark developers if you want this supported(Spec required)", - ansi_tcap_private.d.OperationCode_national, family, specifier); - PROTO_ITEM_SET_GENERATED(item); - return FALSE; - } - return TRUE; + guint8 family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8; + guint8 specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff); + if(!dissector_try_uint(ansi_tcap_national_opcode_table, ansi_tcap_private.d.OperationCode_national, tvb, actx->pinfo, tcap_top_tree)){ + item = proto_tree_add_text(tree, tvb, 0, -1, + "Dissector for ANSI TCAP NATIONAL code:0x%x(Family %u, Specifier %u) \n" + "not implemented. Contact Wireshark developers if you want this supported(Spec required)", + ansi_tcap_private.d.OperationCode_national, family, specifier); + PROTO_ITEM_SET_GENERATED(item); + return FALSE; + } + return TRUE; }else if(ansi_tcap_private.d.OperationCode == 1){ /* private */ if((ansi_tcap_private.d.OperationCode_private & 0x0900) != 0x0900){ item = proto_tree_add_text(tree, tvb, 0, -1, "Dissector for ANSI TCAP PRIVATE code:%u not implemented.\n" - "Contact Wireshark developers if you want this supported(Spec required)", + "Contact Wireshark developers if you want this supported(Spec required)", ansi_tcap_private.d.OperationCode_private); PROTO_ITEM_SET_GENERATED(item); return FALSE; @@ -466,18 +466,18 @@ proto_register_ansi_tcap(void) FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_ansi_tcap_bit_h, + { &hf_ansi_tcap_bit_h, { "Require Reply", "ansi_tcap.req_rep", FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL } }, - { &hf_ansi_tcap_op_family, + { &hf_ansi_tcap_op_family, { "Family", "ansi_tcap.op_family", FT_UINT16, BASE_DEC, VALS(ansi_tcap_national_op_code_family_vals), 0x7f00, NULL, HFILL } }, - { &hf_ansi_tcap_op_specifier, + { &hf_ansi_tcap_op_specifier, { "Specifier", "ansi_tcap.op_specifier", FT_UINT16, BASE_DEC, NULL, 0x00ff, @@ -493,16 +493,16 @@ proto_register_ansi_tcap(void) &ett_otid, &ett_dtid, &ett_ansi_tcap_stat, - &ett_ansi_tcap_op_code_nat, + &ett_ansi_tcap_op_code_nat, #include "packet-ansi_tcap-ettarr.c" }; - static enum_val_t ansi_tcap_response_matching_type_values[] = { - {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", 0}, - {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", 1}, - {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", 2}, - {NULL, NULL, -1} - }; + static const enum_val_t ansi_tcap_response_matching_type_values[] = { + {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", 0}, + {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", 1}, + {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", 2}, + {NULL, NULL, -1} + }; /* Register the protocol name and description */ diff --git a/asn1/camel/packet-camel-template.c b/asn1/camel/packet-camel-template.c index 327b2ebb81..4e5bad4727 100644 --- a/asn1/camel/packet-camel-template.c +++ b/asn1/camel/packet-camel-template.c @@ -173,7 +173,7 @@ static const true_false_string camel_extension_value = { #define AMERICAN_DATE 2 #define CAMEL_DATE_AND_TIME_LEN 20 /* 2*5 + 4 + 5 + 1 (HH:MM:SS;mm/dd/yyyy) */ -static enum_val_t date_options[] = { +static const enum_val_t date_options[] = { { "european", "DD/MM/YYYY", EUROPEAN_DATE }, { "american", "MM/DD/YYYY", AMERICAN_DATE }, { NULL, NULL, 0 } diff --git a/asn1/gsm_map/packet-gsm_map-template.c b/asn1/gsm_map/packet-gsm_map-template.c index 90a0074af8..bc6550e728 100644 --- a/asn1/gsm_map/packet-gsm_map-template.c +++ b/asn1/gsm_map/packet-gsm_map-template.c @@ -140,7 +140,7 @@ static int hf_gsm_apn_str = -1; static int hf_gsm_map_locationnumber_odd_even = -1; static int hf_gsm_map_locationnumber_nai = -1; static int hf_gsm_map_locationnumber_inn = -1; -static int hf_gsm_map_locationnumber_npi = -1; +static int hf_gsm_map_locationnumber_npi = -1; static int hf_gsm_map_locationnumber_apri = -1; static int hf_gsm_map_locationnumber_screening_ind = -1; static int hf_gsm_map_locationnumber_digits = -1; @@ -2637,7 +2637,7 @@ void proto_register_gsm_map(void) { #include "packet-gsm_map-ettarr.c" }; - static enum_val_t application_context_modes[] = { + static const enum_val_t application_context_modes[] = { {"Use Application Context from the trace", "Use application context from the trace", APPLICATON_CONTEXT_FROM_TRACE}, {"Treat as AC 1", "Treat as AC 1", 1}, {"Treat as AC 2", "Treat as AC 2", 2}, diff --git a/epan/dissectors/packet-amr.c b/epan/dissectors/packet-amr.c index 317b9d2e42..8a4c773aa5 100644 --- a/epan/dissectors/packet-amr.c +++ b/epan/dissectors/packet-amr.c @@ -728,7 +728,7 @@ proto_register_amr(void) &ett_amr, &ett_amr_toc, }; - static enum_val_t encoding_types[] = { + static const enum_val_t encoding_types[] = { {"RFC 3267 Byte aligned", "RFC 3267 octet aligned", 0}, {"RFC 3267 Bandwidth-efficient", "RFC 3267 BW-efficient", 1}, {"AMR IF1", "AMR IF1", 2}, @@ -736,7 +736,7 @@ proto_register_amr(void) {NULL, NULL, -1} }; - static enum_val_t modes[] = { + static const enum_val_t modes[] = { {"AMR-NB", "Narrowband AMR", AMR_NB}, {"AMR-WB", "Wideband AMR", AMR_WB}, {NULL, NULL, -1} diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index 3d56b01f65..0ad6d88773 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -12062,7 +12062,7 @@ proto_register_ansi_a(void) } }; - static enum_val_t a_variant_options[] = { + static const enum_val_t a_variant_options[] = { { "is-634-rev0", "IS-634 rev. 0", A_VARIANT_IS634 }, { "tsb-80", "TSB-80", A_VARIANT_TSB80 }, { "is-634-a", "IS-634-A", A_VARIANT_IS634A }, diff --git a/epan/dissectors/packet-ansi_map.c b/epan/dissectors/packet-ansi_map.c index 4c1f574de8..51bdeb6a00 100644 --- a/epan/dissectors/packet-ansi_map.c +++ b/epan/dissectors/packet-ansi_map.c @@ -19568,7 +19568,7 @@ void proto_register_ansi_map(void) { #line 5270 "../../asn1/ansi_map/packet-ansi_map-template.c" }; - static enum_val_t ansi_map_response_matching_type_values[] = { + static const enum_val_t ansi_map_response_matching_type_values[] = { {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", 0}, {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", 1}, {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", 2}, diff --git a/epan/dissectors/packet-ansi_tcap.c b/epan/dissectors/packet-ansi_tcap.c index 9744d70626..1ef4f0821f 100644 --- a/epan/dissectors/packet-ansi_tcap.c +++ b/epan/dissectors/packet-ansi_tcap.c @@ -141,7 +141,7 @@ static gboolean tcap_subdissector_used=FALSE; static struct tcaphash_context_t * gp_tcap_context=NULL; /* Note the high bit should be masked off when registering in this table (0x7fff)*/ -static dissector_table_t ansi_tcap_national_opcode_table; /* National Operation Codes */ +static dissector_table_t ansi_tcap_national_opcode_table; /* National Operation Codes */ /*--- Included file: packet-ansi_tcap-ett.c ---*/ @@ -284,17 +284,17 @@ save_invoke_data(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U_){ /* Only do this once XXX I hope its the right thing to do */ /* The hash string needs to contain src and dest to distiguish differnt flows */ - switch(ansi_tcap_response_matching_type){ - case 0: - buf = ep_strdup(ansi_tcap_private.TransactionID_str); - break; - case 1: - buf = ep_strdup_printf("%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src)); - break; - default: - buf = ep_strdup_printf("%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src),ep_address_to_str(dst)); - break; - } + switch(ansi_tcap_response_matching_type){ + case 0: + buf = ep_strdup(ansi_tcap_private.TransactionID_str); + break; + case 1: + buf = ep_strdup_printf("%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src)); + break; + default: + buf = ep_strdup_printf("%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(src),ep_address_to_str(dst)); + break; + } /* If the entry allready exists don't owervrite it */ ansi_tcap_saved_invokedata = (struct ansi_tcap_invokedata_t *)g_hash_table_lookup(TransactionId_table,buf); @@ -334,16 +334,16 @@ find_saved_invokedata(packet_info *pinfo, proto_tree *tree _U_, tvbuff_t *tvb _U ansi_tcap_private.TransactionID_str, ep_address_to_str(dst), ep_address_to_str(src)); switch(ansi_tcap_response_matching_type){ - case 0: - g_snprintf(buf,MAX_TID_STR_LEN,"%s",ansi_tcap_private.TransactionID_str); - break; - case 1: - g_snprintf(buf,MAX_TID_STR_LEN,"%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst)); - break; - default: - g_snprintf(buf,MAX_TID_STR_LEN,"%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst),ep_address_to_str(src)); - break; - } + case 0: + g_snprintf(buf,MAX_TID_STR_LEN,"%s",ansi_tcap_private.TransactionID_str); + break; + case 1: + g_snprintf(buf,MAX_TID_STR_LEN,"%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst)); + break; + default: + g_snprintf(buf,MAX_TID_STR_LEN,"%s%s%s",ansi_tcap_private.TransactionID_str,ep_address_to_str(dst),ep_address_to_str(src)); + break; + } ansi_tcap_saved_invokedata = (struct ansi_tcap_invokedata_t *)g_hash_table_lookup(TransactionId_table, buf); if(ansi_tcap_saved_invokedata){ @@ -401,23 +401,23 @@ find_tcap_subdissector(tvbuff_t *tvb, asn1_ctx_t *actx, proto_tree *tree){ } if(ansi_tcap_private.d.OperationCode == 0){ /* national */ - guint8 family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8; - guint8 specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff); - if(!dissector_try_uint(ansi_tcap_national_opcode_table, ansi_tcap_private.d.OperationCode_national, tvb, actx->pinfo, tcap_top_tree)){ - item = proto_tree_add_text(tree, tvb, 0, -1, - "Dissector for ANSI TCAP NATIONAL code:0x%x(Family %u, Specifier %u) \n" - "not implemented. Contact Wireshark developers if you want this supported(Spec required)", - ansi_tcap_private.d.OperationCode_national, family, specifier); - PROTO_ITEM_SET_GENERATED(item); - return FALSE; - } - return TRUE; + guint8 family = (ansi_tcap_private.d.OperationCode_national & 0x7f00)>>8; + guint8 specifier = (guint8)(ansi_tcap_private.d.OperationCode_national & 0xff); + if(!dissector_try_uint(ansi_tcap_national_opcode_table, ansi_tcap_private.d.OperationCode_national, tvb, actx->pinfo, tcap_top_tree)){ + item = proto_tree_add_text(tree, tvb, 0, -1, + "Dissector for ANSI TCAP NATIONAL code:0x%x(Family %u, Specifier %u) \n" + "not implemented. Contact Wireshark developers if you want this supported(Spec required)", + ansi_tcap_private.d.OperationCode_national, family, specifier); + PROTO_ITEM_SET_GENERATED(item); + return FALSE; + } + return TRUE; }else if(ansi_tcap_private.d.OperationCode == 1){ /* private */ if((ansi_tcap_private.d.OperationCode_private & 0x0900) != 0x0900){ item = proto_tree_add_text(tree, tvb, 0, -1, "Dissector for ANSI TCAP PRIVATE code:%u not implemented.\n" - "Contact Wireshark developers if you want this supported(Spec required)", + "Contact Wireshark developers if you want this supported(Spec required)", ansi_tcap_private.d.OperationCode_private); PROTO_ITEM_SET_GENERATED(item); return FALSE; @@ -1512,18 +1512,18 @@ proto_register_ansi_tcap(void) FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &hf_ansi_tcap_bit_h, + { &hf_ansi_tcap_bit_h, { "Require Reply", "ansi_tcap.req_rep", FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL } }, - { &hf_ansi_tcap_op_family, + { &hf_ansi_tcap_op_family, { "Family", "ansi_tcap.op_family", FT_UINT16, BASE_DEC, VALS(ansi_tcap_national_op_code_family_vals), 0x7f00, NULL, HFILL } }, - { &hf_ansi_tcap_op_specifier, + { &hf_ansi_tcap_op_specifier, { "Specifier", "ansi_tcap.op_specifier", FT_UINT16, BASE_DEC, NULL, 0x00ff, @@ -1748,7 +1748,7 @@ proto_register_ansi_tcap(void) &ett_otid, &ett_dtid, &ett_ansi_tcap_stat, - &ett_ansi_tcap_op_code_nat, + &ett_ansi_tcap_op_code_nat, /*--- Included file: packet-ansi_tcap-ettarr.c ---*/ #line 1 "../../asn1/ansi_tcap/packet-ansi_tcap-ettarr.c" @@ -1779,12 +1779,12 @@ proto_register_ansi_tcap(void) #line 498 "../../asn1/ansi_tcap/packet-ansi_tcap-template.c" }; - static enum_val_t ansi_tcap_response_matching_type_values[] = { - {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", 0}, - {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", 1}, - {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", 2}, - {NULL, NULL, -1} - }; + static const enum_val_t ansi_tcap_response_matching_type_values[] = { + {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", 0}, + {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", 1}, + {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", 2}, + {NULL, NULL, -1} + }; /* Register the protocol name and description */ diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 27be79ef4c..3a7366a1e7 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -1979,7 +1979,7 @@ proto_register_atm(void) &ett_atm_lane_lc_tlv, }; - static enum_val_t unknown_aal2_options[] = { + static const enum_val_t unknown_aal2_options[] = { { "raw", "Raw data", TRAF_UNKNOWN }, { "umts_fp", "UMTS FP", TRAF_UMTS_FP }, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c index 4f39527a1e..ef782bf2e6 100644 --- a/epan/dissectors/packet-bgp.c +++ b/epan/dissectors/packet-bgp.c @@ -1172,7 +1172,7 @@ decode_mdt_safi(proto_tree *tree, tvbuff_t *tvb, gint offset) guint length; /* length in bits */ gint orig_offset = offset; proto_item *item; - + length = tvb_get_guint8(tvb, offset); if (length != mdt_safi_nlri_length_bits) return -1; @@ -1516,15 +1516,15 @@ decode_prefix_MP(proto_tree *tree, int hf_addr4, int hf_addr6, tvb_get_ntohs(tvb, offset + 1 + 10)); break; case BGP_EXT_COM_RT_2: - ep_strbuf_printf(comm_strbuf, "%u:%u", - tvb_get_ntohl(tvb, 6), + ep_strbuf_printf(comm_strbuf, "%u:%u", + tvb_get_ntohl(tvb, 6), tvb_get_ntohs(tvb, offset + 1 + 10)); break; default: ep_strbuf_printf(comm_strbuf, "Invalid RT type"); break; } - ti = proto_tree_add_text(tree, tvb, offset + 1, length, "%s %u:%s/%u", + ti = proto_tree_add_text(tree, tvb, offset + 1, length, "%s %u:%s/%u", tag, tvb_get_ntohl(tvb, offset + 1 + 0), comm_strbuf->str, plen); @@ -4407,7 +4407,7 @@ proto_register_bgp(void) &ett_bgp_tunnel_subtlv_subtree, }; module_t *bgp_module; - static enum_val_t asn_len[] = { + static const enum_val_t asn_len[] = { {"auto-detect", "Auto-detect", 0}, {"2", "2 octet", 2}, {"4", "4 octet", 4}, diff --git a/epan/dissectors/packet-bootp.c b/epan/dissectors/packet-bootp.c index d0905b4174..c80f2e9384 100644 --- a/epan/dissectors/packet-bootp.c +++ b/epan/dissectors/packet-bootp.c @@ -743,7 +743,7 @@ static const true_false_string flag_set_broadcast = { #define PACKETCABLE_CCC_DRAFT5 2 #define PACKETCABLE_CCC_RFC_3495 3 -static enum_val_t pkt_ccc_protocol_versions[] = { +static const enum_val_t pkt_ccc_protocol_versions[] = { { "ccc_i05", "PKT-SP-PROV-I05-021127", PACKETCABLE_CCC_I05 }, { "ccc_draft_5", "IETF Draft 5", PACKETCABLE_CCC_DRAFT5 }, { "rfc_3495", "RFC 3495", PACKETCABLE_CCC_RFC_3495 }, diff --git a/epan/dissectors/packet-bssap.c b/epan/dissectors/packet-bssap.c index 995c9ebf26..cfdf6461b1 100644 --- a/epan/dissectors/packet-bssap.c +++ b/epan/dissectors/packet-bssap.c @@ -2546,13 +2546,13 @@ proto_register_bssap(void) &ett_bssap_plmn, }; - static enum_val_t gsm_or_lb_interface_options[] = { + static const enum_val_t gsm_or_lb_interface_options[] = { { "gsm a", "GSM A", GSM_INTERFACE }, { "lb", "Lb", LB_INTERFACE }, { NULL, NULL, 0 } }; - static enum_val_t bssap_or_bsap_options[] = { + static const enum_val_t bssap_or_bsap_options[] = { { "bssap", "BSSAP", BSSAP }, { "bsap", "BSAP", BSAP }, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-btsap.c b/epan/dissectors/packet-btsap.c index c068d0baff..848707b019 100644 --- a/epan/dissectors/packet-btsap.c +++ b/epan/dissectors/packet-btsap.c @@ -162,7 +162,7 @@ static const value_string status_change_vals[] = { { 0, NULL } }; -static enum_val_t pref_top_dissect[] = { +static const enum_val_t pref_top_dissect[] = { { "off", "off", TOP_DISSECT_OFF }, { "internal", "Put higher dissectors under this one", TOP_DISSECT_INTERNAL }, { "top", "On top", TOP_DISSECT_TOP }, diff --git a/epan/dissectors/packet-camel.c b/epan/dissectors/packet-camel.c index fda0ad0372..9783af9baf 100644 --- a/epan/dissectors/packet-camel.c +++ b/epan/dissectors/packet-camel.c @@ -869,7 +869,7 @@ static const true_false_string camel_extension_value = { #define AMERICAN_DATE 2 #define CAMEL_DATE_AND_TIME_LEN 20 /* 2*5 + 4 + 5 + 1 (HH:MM:SS;mm/dd/yyyy) */ -static enum_val_t date_options[] = { +static const enum_val_t date_options[] = { { "european", "DD/MM/YYYY", EUROPEAN_DATE }, { "american", "MM/DD/YYYY", AMERICAN_DATE }, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-ccsds.c b/epan/dissectors/packet-ccsds.c index 3d201ae45d..0a56ec22f1 100644 --- a/epan/dissectors/packet-ccsds.c +++ b/epan/dissectors/packet-ccsds.c @@ -92,7 +92,7 @@ static gint ett_ccsds_checkword = -1; /* Generic data handle */ static dissector_handle_t data_handle; -static enum_val_t dissect_checkword[] = { +static const enum_val_t dissect_checkword[] = { { "hdr", "Use header flag", 2 }, { "no", "Override header flag to be false", 0 }, { "yes", "Override header flag to be true", 1 }, diff --git a/epan/dissectors/packet-cigi.c b/epan/dissectors/packet-cigi.c index ac91512a0a..30cf7aeb83 100644 --- a/epan/dissectors/packet-cigi.c +++ b/epan/dissectors/packet-cigi.c @@ -5729,9 +5729,9 @@ cigi3_3_add_short_symbol_control(tvbuff_t *tvb, proto_tree *tree, gint offset) } else { if (select1 >= 5 && select1 <= 11) { proto_tree_add_item(tree, hf_cigi3_3_short_symbol_control_attribute_value1f, tvb, offset, 4, cigi_byte_order); - } else { + } else { proto_tree_add_item(tree, hf_cigi3_3_short_symbol_control_attribute_value1, tvb, offset, 4, cigi_byte_order); - } + } offset += 4; } @@ -5765,9 +5765,9 @@ cigi3_3_add_short_symbol_control(tvbuff_t *tvb, proto_tree *tree, gint offset) } else { if (select2 >= 5 && select2 <= 11) { proto_tree_add_item(tree, hf_cigi3_3_short_symbol_control_attribute_value2f, tvb, offset, 4, cigi_byte_order); - } else { + } else { proto_tree_add_item(tree, hf_cigi3_3_short_symbol_control_attribute_value2, tvb, offset, 4, cigi_byte_order); - } + } offset += 4; } @@ -11909,14 +11909,14 @@ proto_register_cigi(void) }; /* CIGI preferences */ - static enum_val_t cigi_versions[] = { + static const enum_val_t cigi_versions[] = { { "from_packet", "From Packet", CIGI_VERSION_FROM_PACKET }, { "cigi2", "CIGI 2", CIGI_VERSION_2 }, { "cigi3", "CIGI 3", CIGI_VERSION_3 }, { NULL, NULL, 0 } }; - static enum_val_t cigi_byte_orders[] = { + static const enum_val_t cigi_byte_orders[] = { { "from_packet", "From Packet", CIGI_BYTE_ORDER_FROM_PACKET }, { "big_endian", "Big-Endian", CIGI_BYTE_ORDER_BIG_ENDIAN }, { "little_endian", "Little-Endian", CIGI_BYTE_ORDER_LITTLE_ENDIAN }, diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index 668134ed10..3495485d9a 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -778,7 +778,7 @@ static value_string nat_pol_id[MAX_NATIONAL_VALUES+1]; * for description we use the Country Name and * for value we use the DMP value for National Policy Identifier. */ -static enum_val_t dmp_national_values[MAX_NATIONAL_VALUES+1] = { +static const enum_val_t dmp_national_values[MAX_NATIONAL_VALUES+1] = { { "???", "None", 0x00 }, { "alb", "Albania", 0x1B }, { "arm", "Armenia", 0x20 }, @@ -967,7 +967,7 @@ static const value_string ack_msg_type [] = { { ACK, " (ack)" }, { 0, NULL } }; -static enum_val_t struct_id_options[] = { +static const enum_val_t struct_id_options[] = { { "none", "None", STRUCT_ID_NONE }, { "1byte", "1 Byte value", STRUCT_ID_UINT8 }, { "2byte", "2 Byte value", STRUCT_ID_UINT16 }, @@ -978,7 +978,7 @@ static enum_val_t struct_id_options[] = { { NULL, NULL, 0 } }; -static enum_val_t national_decoding[] = { +static const enum_val_t national_decoding[] = { { "none", "None (raw data)", NAT_DECODE_NONE }, { "dmp", "As for regular", NAT_DECODE_DMP }, { "thales", "Thales XOmail", NAT_DECODE_THALES }, diff --git a/epan/dissectors/packet-dmx-chan.c b/epan/dissectors/packet-dmx-chan.c index 297688a73e..9e7671f1ac 100644 --- a/epan/dissectors/packet-dmx-chan.c +++ b/epan/dissectors/packet-dmx-chan.c @@ -139,20 +139,20 @@ proto_register_dmx_chan(void) module_t *dmx_chan_module; - static enum_val_t disp_chan_val_types[] = { + static const enum_val_t disp_chan_val_types[] = { { "pro", "Percent", 0 }, { "hex", "Hexadecimal", 1 }, { "dec", "Decimal", 2 }, { NULL, NULL, 0 } }; - static enum_val_t disp_chan_nr_types[] = { + static const enum_val_t disp_chan_nr_types[] = { { "hex", "Hexadecimal", 0 }, { "dec", "Decimal", 1 }, { NULL, NULL, 0 } }; - static enum_val_t col_count[] = { + static const enum_val_t col_count[] = { { "6", "6", 6 }, { "10", "10", 10 }, { "12", "12", 12 }, diff --git a/epan/dissectors/packet-enip.c b/epan/dissectors/packet-enip.c index dfd982a93f..de8e7c68f7 100644 --- a/epan/dissectors/packet-enip.c +++ b/epan/dissectors/packet-enip.c @@ -329,12 +329,11 @@ static int hf_dlr_soreserved = -1; static gint ett_dlr = -1; -static enum_val_t enip_io_dissector_types[] = { +static const enum_val_t enip_io_dissector_types[] = { { "Off", "Regular Ethernet/IP I/O data", ENIP_IO_OFF}, { "CIP Safety", "CIP Safety", ENIP_IO_SAFETY }, { "CIP Motion", "CIP Motion", ENIP_IO_MOTION }, - - { NULL, NULL, 0 } + { NULL, NULL, 0 } }; /* decode I/O traffic as this type if ForwardOpen isn't captured */ @@ -1984,7 +1983,7 @@ dissect_enip_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item( header_tree, hf_enip_length, tvb, 2, 2, ENC_LITTLE_ENDIAN ); proto_tree_add_item( header_tree, hf_enip_session, tvb, 4, 4, ENC_LITTLE_ENDIAN ); proto_tree_add_item( header_tree, hf_enip_status, tvb, 8, 4, ENC_LITTLE_ENDIAN ); - if ((encap_cmd == LIST_IDENTITY) && + if ((encap_cmd == LIST_IDENTITY) && /* Length of 0 probably indicates a request */ ((encap_data_length == 0) || (packet_type == ENIP_REQUEST_PACKET))) { @@ -2178,7 +2177,7 @@ dissect_dlr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) proto_tree_add_item( dlr_tree, hf_dlr_sequenceid, tvb, DLR_MPF_SEQUENCE_ID, 4, ENC_BIG_ENDIAN ); /* Add frame type to col info */ - col_add_fstr(pinfo->cinfo, COL_INFO, "%s", + col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str(dlr_frametype, dlr_frame_type_vals, "Unknown (0x%04x)") ); if( dlr_frametype == DLR_FT_BEACON ) @@ -3068,7 +3067,7 @@ proto_register_enip(void) FT_BOOLEAN, 32, TFS(&tfs_true_false), 0x00000020, NULL, HFILL }}, - { &hf_dlr_capflags_reserved2, + { &hf_dlr_capflags_reserved2, { "Reserved", "cip.dlr.capflags.reserved2", FT_BOOLEAN, 32, NULL, 0xFFFFFFC0, NULL, HFILL }} diff --git a/epan/dissectors/packet-enttec.c b/epan/dissectors/packet-enttec.c index c3e5d645a0..7b675d91f8 100644 --- a/epan/dissectors/packet-enttec.c +++ b/epan/dissectors/packet-enttec.c @@ -478,20 +478,20 @@ proto_register_enttec(void) module_t *enttec_module; - static enum_val_t disp_chan_val_types[] = { + static const enum_val_t disp_chan_val_types[] = { { "pro", "Percent", 0 }, { "hex", "Hexadecimal", 1 }, { "dec", "Decimal", 2 }, { NULL, NULL, 0 } }; - static enum_val_t disp_chan_nr_types[] = { + static const enum_val_t disp_chan_nr_types[] = { { "hex", "Hexadecimal", 0 }, { "dec", "Decimal", 1 }, { NULL, NULL, 0 } }; - static enum_val_t col_count[] = { + static const enum_val_t col_count[] = { { "6", "6", 6 }, { "10", "10", 10 }, { "12", "12", 12 }, diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c index f20e531322..cc25c4f1de 100644 --- a/epan/dissectors/packet-erf.c +++ b/epan/dissectors/packet-erf.c @@ -1872,7 +1872,7 @@ proto_register_erf(void) &ett_erf_eth }; - static enum_val_t erf_hdlc_options[] = { + static const enum_val_t erf_hdlc_options[] = { { "chdlc", "Cisco HDLC", ERF_HDLC_CHDLC }, { "ppp", "PPP serial", ERF_HDLC_PPP }, { "frelay", "Frame Relay", ERF_HDLC_FRELAY }, @@ -1881,7 +1881,7 @@ proto_register_erf(void) { NULL, NULL, 0 } }; - static enum_val_t erf_aal5_options[] = { + static const enum_val_t erf_aal5_options[] = { { "guess", "Attempt to guess", ERF_AAL5_GUESS }, { "llc", "LLC multiplexed", ERF_AAL5_LLC }, { "unspec", "Unspecified", ERF_AAL5_UNSPEC }, diff --git a/epan/dissectors/packet-fcoib.c b/epan/dissectors/packet-fcoib.c index 53c8aad581..dcd90b0913 100644 --- a/epan/dissectors/packet-fcoib.c +++ b/epan/dissectors/packet-fcoib.c @@ -129,7 +129,7 @@ static guint gPREF_QP[2] = {0}; static address manual_addr[2]; static void *manual_addr_data[2]; -static enum_val_t pref_address_types[] = { +static const enum_val_t pref_address_types[] = { {"lid", "LID", 0}, {"gid", "GID", 1}, {NULL, NULL, -1} diff --git a/epan/dissectors/packet-flip.c b/epan/dissectors/packet-flip.c index 6674e5da9d..9465b20791 100644 --- a/epan/dissectors/packet-flip.c +++ b/epan/dissectors/packet-flip.c @@ -108,7 +108,7 @@ static const value_string flip_etype[] = { #define FLIP_PAYLOAD_DECODING_MODE_HEURISTIC (1) #define FLIP_PAYLOAD_DECODING_MODE_FORCED (2) -static enum_val_t flip_payload_decoding_modes[] = { +static const enum_val_t flip_payload_decoding_modes[] = { {"none", "no decoding", FLIP_PAYLOAD_DECODING_MODE_NONE}, {"heuristic", "heuristic", FLIP_PAYLOAD_DECODING_MODE_HEURISTIC}, {"forced", "forced", FLIP_PAYLOAD_DECODING_MODE_FORCED}, diff --git a/epan/dissectors/packet-fr.c b/epan/dissectors/packet-fr.c index da92cb64cd..f3a3cb2b4e 100644 --- a/epan/dissectors/packet-fr.c +++ b/epan/dissectors/packet-fr.c @@ -958,7 +958,7 @@ proto_register_fr(void) &ett_fr_address, &ett_fr_control, }; - static enum_val_t fr_encap_options[] = { + static const enum_val_t fr_encap_options[] = { { "frf-3.2", "FRF 3.2/Cisco HDLC", FRF_3_2 }, { "gprs-ns", "GPRS Network Service", GPRS_NS }, { "ethernet", "Raw Ethernet", RAW_ETHER }, diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c index b5175b20ab..bb4c767a2f 100644 --- a/epan/dissectors/packet-gsm_map.c +++ b/epan/dissectors/packet-gsm_map.c @@ -148,7 +148,7 @@ static int hf_gsm_apn_str = -1; static int hf_gsm_map_locationnumber_odd_even = -1; static int hf_gsm_map_locationnumber_nai = -1; static int hf_gsm_map_locationnumber_inn = -1; -static int hf_gsm_map_locationnumber_npi = -1; +static int hf_gsm_map_locationnumber_npi = -1; static int hf_gsm_map_locationnumber_apri = -1; static int hf_gsm_map_locationnumber_screening_ind = -1; static int hf_gsm_map_locationnumber_digits = -1; @@ -26634,7 +26634,7 @@ void proto_register_gsm_map(void) { #line 2638 "../../asn1/gsm_map/packet-gsm_map-template.c" }; - static enum_val_t application_context_modes[] = { + static const enum_val_t application_context_modes[] = { {"Use Application Context from the trace", "Use application context from the trace", APPLICATON_CONTEXT_FROM_TRACE}, {"Treat as AC 1", "Treat as AC 1", 1}, {"Treat as AC 2", "Treat as AC 2", 2}, diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 924fde65d1..86b37770cf 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -3872,7 +3872,7 @@ static const fragment_items frag_items = { "fragments" }; -static enum_val_t wlan_ignore_wep_options[] = { +static const enum_val_t wlan_ignore_wep_options[] = { { "no", "No", WLAN_IGNORE_WEP_NO }, { "without_iv", "Yes - without IV", WLAN_IGNORE_WEP_WO_IV }, { "with_iv", "Yes - with IV", WLAN_IGNORE_WEP_W_IV }, @@ -7839,10 +7839,10 @@ dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, i /* B16 - B18 */ proto_tree_add_item(cap_tree, hf_ieee80211_vht_sounding_dimensions, tvb, offset, 4, ENC_LITTLE_ENDIAN); - /* B19 */ + /* B19 */ proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN); - /* B20 - B22 2x 1 bit fields */ + /* B20 - B22 2x 1 bit fields */ proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(cap_tree, hf_ieee80211_vht_txop_ps, tvb, offset, 4, ENC_LITTLE_ENDIAN); proto_tree_add_item(cap_tree, hf_ieee80211_vht_var_htc_field, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -8493,7 +8493,7 @@ dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in proto_tree_add_item(cap_tree, hf_ieee80211_ht_psmp, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(cap_tree, hf_ieee80211_ht_40_mhz_intolerant, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_item(cap_tree, hf_ieee80211_ht_l_sig, tvb, offset, 2, ENC_LITTLE_ENDIAN); - offset += 2; + offset += 2; /* 1 byte A-MPDU Parameters */ if(vs) diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index bbb47f563e..2d4ba0f56b 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -344,7 +344,7 @@ static const true_false_string ieee802154_gts_direction_tfs = { /* The 802.15.4-2003 security suites for the security preferences (only AES-CCM suites are supported). */ /* NOTE: The equivalent 2006 security level identifer enumerations are used to simplify 2003 & 2006 integration! */ -static enum_val_t ieee802154_2003_sec_suite_enums[] = { +static const enum_val_t ieee802154_2003_sec_suite_enums[] = { { "AES-CCM-128", "AES-128 Encryption, 128-bit Integrity Protection", SECURITY_LEVEL_ENC_MIC_128 }, { "AES-CCM-64", "AES-128 Encryption, 64-bit Integrity Protection", SECURITY_LEVEL_ENC_MIC_64 }, { "AES-CCM-32", "AES-128 Encryption, 32-bit Integrity Protection", SECURITY_LEVEL_ENC_MIC_32 }, diff --git a/epan/dissectors/packet-infiniband_sdp.c b/epan/dissectors/packet-infiniband_sdp.c index 8615cd3afc..16ce732099 100644 --- a/epan/dissectors/packet-infiniband_sdp.c +++ b/epan/dissectors/packet-infiniband_sdp.c @@ -117,7 +117,7 @@ static guint gPREF_QP[2] = {0}; address manual_addr[2]; void *manual_addr_data[2]; -static enum_val_t pref_address_types[] = { +static const enum_val_t pref_address_types[] = { {"lid", "LID", 0}, {"gid", "GID", 1}, {NULL, NULL, -1} diff --git a/epan/dissectors/packet-iscsi.c b/epan/dissectors/packet-iscsi.c index 838b9f7c92..cd455ce48f 100644 --- a/epan/dissectors/packet-iscsi.c +++ b/epan/dissectors/packet-iscsi.c @@ -57,7 +57,7 @@ #define ISCSI_PROTOCOL_DRAFT12 4 #define ISCSI_PROTOCOL_DRAFT13 5 -static enum_val_t iscsi_protocol_versions[] = { +static const enum_val_t iscsi_protocol_versions[] = { { "draft-08", "Draft 08", ISCSI_PROTOCOL_DRAFT08 }, { "draft-09", "Draft 09", ISCSI_PROTOCOL_DRAFT09 }, { "draft-11", "Draft 11", ISCSI_PROTOCOL_DRAFT11 }, diff --git a/epan/dissectors/packet-isdn.c b/epan/dissectors/packet-isdn.c index 3c0e7875d9..e3350ce145 100644 --- a/epan/dissectors/packet-isdn.c +++ b/epan/dissectors/packet-isdn.c @@ -40,7 +40,7 @@ static gint ett_isdn = -1; #define DCHANNEL_LAPD 0 /* LAPD */ #define DCHANNEL_DPNSS 1 /* DPNSS link layer */ -static enum_val_t dchannel_protocol_options[] = { +static const enum_val_t dchannel_protocol_options[] = { { "lapd", "LAPD", DCHANNEL_LAPD }, { "DPNSS", "DPNSS", DCHANNEL_DPNSS }, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-ismacryp.c b/epan/dissectors/packet-ismacryp.c index 8599c73bd8..6a718b0acc 100644 --- a/epan/dissectors/packet-ismacryp.c +++ b/epan/dissectors/packet-ismacryp.c @@ -841,13 +841,13 @@ void proto_register_ismacryp (void) &ett_ismacryp_message }; - static enum_val_t version_types[] = { + static const enum_val_t version_types[] = { {PROTO_TAG_ISMACRYP_11, "ISMACryp v1.1", V11}, {PROTO_TAG_ISMACRYP_20, "ISMACryp v2.0", V20}, {NULL, NULL, -1} }; - static enum_val_t mode_types[] = { + static const enum_val_t mode_types[] = { {"aac-hbr", "aac-hbr", AAC_HBR_MODE}, {"mpeg4-video", "mpeg4-video", MPEG4_VIDEO_MODE}, {"avc-video", "avc-video", AVC_VIDEO_MODE}, diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c index 8a079e1e2b..04753cef6d 100644 --- a/epan/dissectors/packet-isup.c +++ b/epan/dissectors/packet-isup.c @@ -41,7 +41,7 @@ * French ISUP Specification: SPIROU 1998 - 002-005 edition 1 ( Info found here http://www.icg-corp.com/docs/ISUP.pdf ). * Israeli ISUP Specification: excertp (for BCM messsage) found in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4231 . * Russian national ISUP-R 2000: RD 45.217-2001 book 4 - * Japan ISUP http://www.ttc.or.jp/jp/document_list/sum/sum_JT-Q763v21.1.pdf + * Japan ISUP http://www.ttc.or.jp/jp/document_list/sum/sum_JT-Q763v21.1.pdf */ #include "config.h" @@ -6348,7 +6348,7 @@ static const value_string isup_jpn_redirect_capabilit_vals[] = { static void dissect_isup_redirect_capability_parameter(tvbuff_t *parameter_tvb, proto_tree *parameter_tree, proto_item *parameter_item, guint8 itu_isup_variant) -{ +{ guint length = tvb_length(parameter_tvb); switch(itu_isup_variant) { @@ -6891,7 +6891,7 @@ Information Type Tag 00000100 Invoking redirect reason 00000101 to Spare -11111111 +11111111 Note: In standard this value is marked as -Not used-, here is treated as reserved. @@ -6902,7 +6902,7 @@ Performing redirect indicator +-----+-----+-----+-----+-----+-----+-----+-----+ - ext - Performing redirect reason - 1 +-----+-----------------------------------------+ -- -Redirect possible- +- -Redirect possible- - Spare - indicator at - 2 - - performing - - - exchange - @@ -6912,7 +6912,7 @@ Performing redirect indicator +-----------------------------------------------+ - ext - Performing redirect reason - 2n|1 +-----+-----------------------|-----------------+ Reason n -- -Redirect possible- +- -Redirect possible- - Spare - indicator at - 2n - - performing - - - exchange - @@ -6956,7 +6956,7 @@ to Spare 0111111 1000000 to Reserved for national use -1111101 +1111101 1111110 Local number portability / Mobile number portability 1111111 Reserved for national use @@ -11266,7 +11266,7 @@ proto_register_isup(void) {"Redirect possible indicator at performing exchange", "isup.rfi.redir_pos_ind", FT_UINT8, BASE_DEC, VALS(redir_pos_ind_vals), 0x07, NULL, HFILL }}, - /* Value string values the same as perf_redir_reason_vals */ + /* Value string values the same as perf_redir_reason_vals */ { &hf_japan_isup_inv_redir_reason, {"Invoking redirect reason", "isup.rfi.inv_redir_reason", FT_UINT8, BASE_DEC, VALS(perf_redir_reason_vals), 0x7f, @@ -11434,7 +11434,7 @@ proto_register_isup(void) &ett_isup_apm_msg_fragments, }; - static enum_val_t isup_variants[] = { + static const enum_val_t isup_variants[] = { {"ITU Standard", "ITU Standard", ISUP_ITU_STANDARD_VARIANT}, {"French National Standard", "French National Standard", ISUP_FRENCH_VARIANT}, {"Israeli National Standard", "Israeli National Standard", ISUP_ISRAELI_VARIANT}, diff --git a/epan/dissectors/packet-l2tp.c b/epan/dissectors/packet-l2tp.c index d2ce86690a..8e785decff 100644 --- a/epan/dissectors/packet-l2tp.c +++ b/epan/dissectors/packet-l2tp.c @@ -142,7 +142,7 @@ static gint ett_l2tp_avp_sub = -1; static gint ett_l2tp_lcp = -1; static gint ett_l2tp_l2_spec = -1; -static enum_val_t l2tpv3_cookies[] = { +static const enum_val_t l2tpv3_cookies[] = { {"detect", "Detect", -1}, {"cookie0", "None", 0}, {"cookie4", "4 Byte Cookie", 4}, @@ -150,7 +150,7 @@ static enum_val_t l2tpv3_cookies[] = { {NULL, NULL, 0} }; -#define L2TPv3_COOKIE_DEFAULT 0 +#define L2TPv3_COOKIE_DEFAULT 0 #define L2TPv3_PROTOCOL_ETH 0 #define L2TPv3_PROTOCOL_CHDLC 1 @@ -166,7 +166,7 @@ static enum_val_t l2tpv3_cookies[] = { #define L2TPv3_PROTOCOL_DEFAULT L2TPv3_PROTOCOL_CHDLC -static enum_val_t l2tpv3_protocols[] = { +static const enum_val_t l2tpv3_protocols[] = { {"detect", "Detect", -1}, {"eth", "Ethernet", L2TPv3_PROTOCOL_ETH}, {"chdlc", "Cisco HDLC", L2TPv3_PROTOCOL_CHDLC}, @@ -188,7 +188,7 @@ static enum_val_t l2tpv3_protocols[] = { #define L2TPv3_L2_SPECIFIC_DOCSIS_DMPT 4 #define L2TPv3_L2_SPECIFIC_MAX (L2TPv3_L2_SPECIFIC_DOCSIS_DMPT + 1) -static enum_val_t l2tpv3_l2_specifics[] = { +static const enum_val_t l2tpv3_l2_specifics[] = { {"detect", "Detect", -1}, {"none", "None", L2TPv3_L2_SPECIFIC_NONE}, {"default", "Default L2-Specific", L2TPv3_L2_SPECIFIC_DEFAULT}, @@ -895,7 +895,7 @@ static l2tpv3_session_t *find_session(l2tpv3_tunnel_t *tunnel, (session->lcce2.id == lcce2_id)) { return session; } - + iterator = g_slist_next(iterator); } @@ -1015,18 +1015,18 @@ static l2tpv3_session_t *store_pw_type(l2tpv3_session_t *_session, l2tpv3_session_t *session = _session; gint result = l2tpv3_protocol; guint16 pw_type; - + switch (msg_type) { case MESSAGE_TYPE_ICRQ: case MESSAGE_TYPE_OCRQ: break; default: return session; - } - + } + if (session == NULL) session = alloc_session(); - + pw_type = tvb_get_ntohs(tvb, offset); switch (pw_type) { case 0x0007: @@ -1042,9 +1042,9 @@ static l2tpv3_session_t *store_pw_type(l2tpv3_session_t *_session, default: break; } - + session->pw_type = result; - + return session; } @@ -1056,7 +1056,7 @@ static l2tpv3_session_t *store_l2_sublayer(l2tpv3_session_t *_session, l2tpv3_session_t *session = _session; gint result = l2tpv3_l2_specific; guint16 l2_sublayer; - + switch (msg_type) { case MESSAGE_TYPE_ICRQ: case MESSAGE_TYPE_OCRQ: @@ -1067,11 +1067,11 @@ static l2tpv3_session_t *store_l2_sublayer(l2tpv3_session_t *_session, break; default: return session; - } - + } + if (session == NULL) session = alloc_session(); - + l2_sublayer = tvb_get_ntohs(tvb, offset); switch (l2_sublayer) { case 0x0000: @@ -1096,8 +1096,8 @@ static l2tpv3_session_t *store_l2_sublayer(l2tpv3_session_t *_session, case MESSAGE_TYPE_OCRP: session->lcce2.l2_specific = result; break; - } - + } + return session; } @@ -1338,7 +1338,7 @@ static void process_control_avps(tvbuff_t *tvb, idx += avp_len; continue; - } else { + } else { /* Vendor-Specific AVP */ tf = proto_tree_add_text(l2tp_tree, tvb, idx, avp_len, "Vendor %s AVP Type %u", diff --git a/epan/dissectors/packet-m2pa.c b/epan/dissectors/packet-m2pa.c index 6a0635af6f..b26b684866 100644 --- a/epan/dissectors/packet-m2pa.c +++ b/epan/dissectors/packet-m2pa.c @@ -583,7 +583,7 @@ proto_register_m2pa(void) &ett_m2pa_li }; - static enum_val_t m2pa_version_options[] = { + static const enum_val_t m2pa_version_options[] = { { "draft-2", "Internet Draft version 2", M2PA_V02 }, { "draft-8", "Internet Draft version 8", M2PA_V08 }, { "RFC4165", "RFC 4165", M2PA_RFC4165 }, diff --git a/epan/dissectors/packet-m2ua.c b/epan/dissectors/packet-m2ua.c index ccad7a5cde..5490f2a39e 100644 --- a/epan/dissectors/packet-m2ua.c +++ b/epan/dissectors/packet-m2ua.c @@ -1118,7 +1118,7 @@ proto_register_m2ua(void) &ett_m2ua_parameter, }; - static enum_val_t protocol_data_1_options[] = { + static const enum_val_t protocol_data_1_options[] = { { "draft-7", "0x000e (Draft 7)", PROTOCOL_DATA_1_DRAFT_7 }, { "rfc3331", "0x0300 (RFC3331)", PROTOCOL_DATA_1_PARAMETER_TAG }, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-m3ua.c b/epan/dissectors/packet-m3ua.c index bf83c09582..4603c7a029 100644 --- a/epan/dissectors/packet-m3ua.c +++ b/epan/dissectors/packet-m3ua.c @@ -2053,7 +2053,7 @@ proto_register_m3ua(void) &ett_q708_dpc, }; - static enum_val_t options[] = { + static const enum_val_t options[] = { { "draft-5", "Internet Draft version 5", M3UA_V5 }, { "draft-6", "Internet Draft version 6", M3UA_V6 }, { "draft-7", "Internet Draft version 7", M3UA_V7 }, diff --git a/epan/dissectors/packet-mac-lte.c b/epan/dissectors/packet-mac-lte.c index 5688b608a2..5366c8e3f2 100644 --- a/epan/dissectors/packet-mac-lte.c +++ b/epan/dissectors/packet-mac-lte.c @@ -5741,14 +5741,14 @@ void proto_register_mac_lte(void) &ett_mac_lte_oob }; - static enum_val_t show_info_col_vals[] = { + static const enum_val_t show_info_col_vals[] = { {"show-phy", "PHY Info", ShowPHYLayer}, {"show-mac", "MAC Info", ShowMACLayer}, {"show-rlc", "RLC Info", ShowRLCLayer}, {NULL, NULL, -1} }; - static enum_val_t lcid_drb_source_vals[] = { + static const enum_val_t lcid_drb_source_vals[] = { {"from-static-stable", "From static table", FromStaticTable}, {"from-configuration-protocol", "From configuration protocol", FromConfigurationProtocol}, {NULL, NULL, -1} diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index 7d48da4618..b2069a8c7b 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -23,8 +23,8 @@ * Nikitha Malgi * - Identification of BFD CC, BFD CV and ON-Demand CV ACH types as per RFC 6428, RFC 6426 * respectively and the corresponding decoding of messages - * - Decoding support for MPLS-TP Lock Instruct as per RFC 6435 - * - Decoding support for MPLS-TP Fault-Management as per RFC 6427 + * - Decoding support for MPLS-TP Lock Instruct as per RFC 6435 + * - Decoding support for MPLS-TP Fault-Management as per RFC 6427 * * (c) Copyright 2012, Aditya Ambadkar and Diana Chris * - Added preference to select BOS label as flowlabel as per RFC 6391 @@ -138,7 +138,7 @@ enum mpls_default_dissector_t { * this way, mpls_default_payload will be automatically filled up when * new mpls-specific dissector added. */ -static enum_val_t mpls_default_payload_defs[] = { +static const enum_val_t mpls_default_payload_defs[] = { { "pw satop" ,pwc_longname_pw_satop diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c index dcb49ff1bb..e7a9d7646e 100644 --- a/epan/dissectors/packet-mtp3.c +++ b/epan/dissectors/packet-mtp3.c @@ -822,15 +822,15 @@ proto_register_mtp3(void) &ett_mtp3_label_opc }; - static enum_val_t mtp3_options[] = { + static const enum_val_t mtp3_options[] = { { "itu", "ITU", ITU_STANDARD }, { "ansi", "ANSI", ANSI_STANDARD }, { "chinese-itu", "Chinese ITU", CHINESE_ITU_STANDARD }, { "japan", "Japan", JAPAN_STANDARD }, - { NULL, NULL, 0 } + { NULL, NULL, 0 } }; - static enum_val_t mtp3_addr_fmt_str_e[] = { + static const enum_val_t mtp3_addr_fmt_str_e[] = { { "decimal", "Decimal", MTP3_ADDR_FMT_DEC }, { "hexadecimal", "Hexadecimal", MTP3_ADDR_FMT_HEX }, { "ni-decimal", "NI-Decimal", MTP3_ADDR_FMT_NI_DEC }, @@ -839,14 +839,14 @@ proto_register_mtp3(void) { NULL, NULL, 0 } }; - static enum_val_t itu_pc_structures[] = { + static const enum_val_t itu_pc_structures[] = { { "unstructured", "Unstructured", ITU_PC_STRUCTURE_NONE}, { "3-8-3", "3-8-3", ITU_PC_STRUCTURE_3_8_3 }, { "4-3-4-3", "4-3-4-3", ITU_PC_STRUCTURE_4_3_4_3 }, { NULL, NULL, 0 } }; - static enum_val_t japan_pc_structures[] = { + static const enum_val_t japan_pc_structures[] = { { "unstructured", "Unstructured", JAPAN_PC_STRUCTURE_NONE}, { "7-4-5", "7-4-5", JAPAN_PC_STRUCTURE_7_4_5 }, { "3-4-4-5", "3-4-4-5", JAPAN_PC_STRUCTURE_3_4_4_5 }, diff --git a/epan/dissectors/packet-ndmp.c b/epan/dissectors/packet-ndmp.c index 865be6cb27..27078be65c 100644 --- a/epan/dissectors/packet-ndmp.c +++ b/epan/dissectors/packet-ndmp.c @@ -293,7 +293,7 @@ static GHashTable *ndmp_reassembled_table = NULL; #define NDMP_PROTOCOL_V3 3 #define NDMP_PROTOCOL_V4 4 #define NDMP_PROTOCOL_V5 5 -static enum_val_t ndmp_protocol_versions[] = { +static const enum_val_t ndmp_protocol_versions[] = { { "version2", "Version 2", NDMP_PROTOCOL_V2 }, { "version3", "Version 3", NDMP_PROTOCOL_V3 }, { "version4", "Version 4", NDMP_PROTOCOL_V4 }, diff --git a/epan/dissectors/packet-nflog.c b/epan/dissectors/packet-nflog.c index 2dcc45de89..9ae9548dd5 100644 --- a/epan/dissectors/packet-nflog.c +++ b/epan/dissectors/packet-nflog.c @@ -57,7 +57,7 @@ enum ws_nfulnl_attr_type { #define BYTE_ORDER_LE 2 #define BYTE_ORDER_HOST 3 -static enum_val_t byte_order_types[] = { +static const enum_val_t byte_order_types[] = { { "Auto", "Auto", BYTE_ORDER_AUTO }, { "Host", "Host", BYTE_ORDER_HOST }, { "LE", "Little Endian", BYTE_ORDER_LE }, diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 0b9cbf457b..5d681e51a2 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -710,7 +710,7 @@ static dissector_table_t nfs_fhandle_table; #define FHT_CELERRA 8 -static enum_val_t nfs_fhandle_types[] = { +static const enum_val_t nfs_fhandle_types[] = { { "unknown", "Unknown", FHT_UNKNOWN }, { "svr4", "SVR4", FHT_SVR4 }, { "knfsd_le", "KNFSD_LE", FHT_LINUX_KNFSD_LE }, diff --git a/epan/dissectors/packet-p_mul.c b/epan/dissectors/packet-p_mul.c index 13433ef972..26e1329832 100644 --- a/epan/dissectors/packet-p_mul.c +++ b/epan/dissectors/packet-p_mul.c @@ -245,7 +245,7 @@ static const value_string pdu_vals[] = { { 0, NULL } }; -static enum_val_t decode_options[] = { +static const enum_val_t decode_options[] = { { "none", "No decoding", DECODE_NONE }, { "ber", "BER encoded ASN.1", DECODE_BER }, { "cdt", "Compressed Data Type", DECODE_CDT }, diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c index 90b4704c4f..d8ffe99749 100644 --- a/epan/dissectors/packet-pdcp-lte.c +++ b/epan/dissectors/packet-pdcp-lte.c @@ -1670,14 +1670,14 @@ void proto_register_pdcp(void) &ett_pdcp_report_bitmap }; - static enum_val_t sequence_analysis_vals[] = { + static const enum_val_t sequence_analysis_vals[] = { {"no-analysis", "No-Analysis", FALSE}, {"rlc-only", "Only-RLC-frames", SEQUENCE_ANALYSIS_RLC_ONLY}, {"pdcp-only", "Only-PDCP-frames", SEQUENCE_ANALYSIS_PDCP_ONLY}, {NULL, NULL, -1} }; - static enum_val_t show_info_col_vals[] = { + static const enum_val_t show_info_col_vals[] = { {"show-rlc", "RLC Info", ShowRLCLayer}, {"show-pdcp", "PDCP Info", ShowPDCPLayer}, {"show-traffic", "Traffic Info", ShowTrafficLayer}, diff --git a/epan/dissectors/packet-rlc-lte.c b/epan/dissectors/packet-rlc-lte.c index 840d8af406..cc09867428 100644 --- a/epan/dissectors/packet-rlc-lte.c +++ b/epan/dissectors/packet-rlc-lte.c @@ -64,7 +64,7 @@ static gint global_rlc_lte_um_sequence_analysis = FALSE; static gboolean global_rlc_lte_call_pdcp_for_srb = FALSE; enum pdcp_for_drb { PDCP_drb_off, PDCP_drb_SN_7, PDCP_drb_SN_12, PDCP_drb_SN_signalled, PDCP_drb_SN_15}; -static enum_val_t pdcp_drb_col_vals[] = { +static const enum_val_t pdcp_drb_col_vals[] = { {"pdcp-drb-off", "Off", PDCP_drb_off}, {"pdcp-drb-sn-7", "7-bit SN", PDCP_drb_SN_7}, {"pdcp-drb-sn-12", "12-bit SN", PDCP_drb_SN_12}, @@ -382,7 +382,7 @@ static GHashTable *sequence_analysis_channel_hash = NULL; /* for context information before the dissector is called */ /* Info to attach to frame when first read, recording what to show about sequence */ -typedef enum { +typedef enum { SN_OK, SN_Repeated, SN_MAC_Retx, SN_Retx, SN_Missing, ACK_Out_of_Window, SN_Error } sequence_analysis_state; @@ -3282,7 +3282,7 @@ void proto_register_rlc_lte(void) &ett_rlc_lte_reassembly_source_segment }; - static enum_val_t sequence_analysis_vals[] = { + static const enum_val_t sequence_analysis_vals[] = { {"no-analysis", "No-Analysis", FALSE}, {"mac-only", "Only-MAC-frames", SEQUENCE_ANALYSIS_MAC_ONLY}, {"rlc-only", "Only-RLC-frames", SEQUENCE_ANALYSIS_RLC_ONLY}, diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c index 06ccb0ccb1..0e9c6ed604 100644 --- a/epan/dissectors/packet-rsvp.c +++ b/epan/dissectors/packet-rsvp.c @@ -380,7 +380,7 @@ static gint ett_treelist[TT_MAX]; static gboolean rsvp_bundle_dissect = TRUE; /* FF: How should we dissect generalized label? */ -static enum_val_t rsvp_generalized_label_options[] = { +static const enum_val_t rsvp_generalized_label_options[] = { /* see RFC 3471 Section 3.2.1.2 */ { "data", "data (no interpretation)", 1 }, /* see RFC 4606 Section 3 */ @@ -4210,7 +4210,7 @@ dissect_rsvp_session_attribute(proto_item *ti, proto_tree *rsvp_object_tree, } /*------------------------------------------------------------------------------ - * EXPLICIT ROUTE AND RECORD ROUTE SUBOBJECTS, + * EXPLICIT ROUTE AND RECORD ROUTE SUBOBJECTS, * RFC 3209, RFC 3473, RFC 5420, RFC 4873, RFC 5553 *------------------------------------------------------------------------------*/ static void diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 5f80d3ce54..e7d7fc665b 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -216,7 +216,7 @@ static int hf_rtp_ext_rfc5285_data = -1; #define RTP0_T38 2 #define RTP0_SPRT 3 -static enum_val_t rtp_version0_types[] = { +static const enum_val_t rtp_version0_types[] = { { "invalid", "Invalid or ZRTP packets", RTP0_INVALID }, { "classicstun", "CLASSIC-STUN packets", RTP0_CLASSICSTUN }, { "t38", "T.38 packets", RTP0_T38 }, diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 79249a8d44..7c83497877 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -4215,7 +4215,7 @@ proto_register_sctp(void) &ett_sctp_tsn_retransmitted }; - static enum_val_t sctp_checksum_options[] = { + static const enum_val_t sctp_checksum_options[] = { { "none", "None", SCTP_CHECKSUM_NONE }, { "adler-32", "Adler 32", SCTP_CHECKSUM_ADLER32 }, { "crc-32c", "CRC 32c", SCTP_CHECKSUM_CRC32C }, diff --git a/epan/dissectors/packet-sdh.c b/epan/dissectors/packet-sdh.c index b37c24d2cf..8406392d68 100644 --- a/epan/dissectors/packet-sdh.c +++ b/epan/dissectors/packet-sdh.c @@ -68,7 +68,7 @@ static dissector_handle_t data_handle; static gint sdh_data_rate = 1; -static enum_val_t data_rates[] = { +static const enum_val_t data_rates[] = { {"Attempt to guess", "Attempt to guess", -1}, {"OC-3", "OC-3", 1}, {"OC-12", "OC-12", 4}, @@ -97,21 +97,21 @@ const value_string sdh_s1_vals[] = { { 0, NULL } }; -static int +static int get_sdh_level(tvbuff_t *tvb, packet_info *pinfo) { /*data rate has been set in the SDH options*/ if(sdh_data_rate != -1) return sdh_data_rate; /*ERF specifies data rate*/ - switch((pinfo->pseudo_header->erf.ehdr_list[0].ehdr & 0xff00) >> 8){ + switch((pinfo->pseudo_header->erf.ehdr_list[0].ehdr & 0xff00) >> 8){ case 1: /*OC-3*/ return 1; case 2: /*OC-12*/ return 4; case 3: /*OC-48*/ - return 16; + return 16; default: /*drop through and try the next method*/ - ; + ; } /*returns the multiplier for each data level*/ switch(tvb_reported_length(tvb)){ @@ -122,7 +122,7 @@ get_sdh_level(tvbuff_t *tvb, packet_info *pinfo) case 19440: /*OC-24*/ return 8; case 38880: /*OC-48*/ - return 16; + return 16; } return 1; diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c index 286baa9efc..d6c232dd93 100644 --- a/epan/dissectors/packet-sigcomp.c +++ b/epan/dissectors/packet-sigcomp.c @@ -2581,12 +2581,12 @@ proto_register_sigcomp(void) }; module_t *sigcomp_module; - static enum_val_t udvm_detail_vals[] = { - {"no-printout", "No-Printout", 0}, - {"low-detail", "Low-detail", 1}, - {"medium-detail", "Medium-detail", 2}, - {"high-detail", "High-detail", 3}, - {NULL, NULL, -1} + static const enum_val_t udvm_detail_vals[] = { + {"no-printout", "No-Printout", 0}, + {"low-detail", "Low-detail", 1}, + {"medium-detail", "Medium-detail", 2}, + {"high-detail", "High-detail", 3}, + {NULL, NULL, -1} }; diff --git a/epan/dissectors/packet-socketcan.c b/epan/dissectors/packet-socketcan.c index 52cdb2970b..5c2b0c17ad 100644 --- a/epan/dissectors/packet-socketcan.c +++ b/epan/dissectors/packet-socketcan.c @@ -69,7 +69,7 @@ typedef enum { CAN_CANOPEN_DISSECTOR = 2 } Dissector_Option; -static enum_val_t can_high_level_protocol_dissector_options[] = { +static const enum_val_t can_high_level_protocol_dissector_options[] = { { "raw", "Raw data (no further dissection)", CAN_DATA_DISSECTOR }, { "CANopen", "CANopen protocol", CAN_CANOPEN_DISSECTOR }, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-sscop.c b/epan/dissectors/packet-sscop.c index 1c5abdfd75..b70416cc26 100644 --- a/epan/dissectors/packet-sscop.c +++ b/epan/dissectors/packet-sscop.c @@ -58,7 +58,7 @@ static range_t *global_udp_port_range; static dissector_handle_t sscop_handle; -static enum_val_t sscop_payload_dissector_options[] = { +static const enum_val_t sscop_payload_dissector_options[] = { { "data", "Data (no further dissection)", DATA_DISSECTOR }, { "Q.2931", "Q.2931", Q2931_DISSECTOR }, { "SSCF-NNI", "SSCF-NNI (MTP3-b)", SSCF_NNI_DISSECTOR }, diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c index ed690ac694..33020b0f74 100644 --- a/epan/dissectors/packet-sua.c +++ b/epan/dissectors/packet-sua.c @@ -2398,7 +2398,7 @@ proto_register_sua(void) module_t *sua_module; - static enum_val_t options[] = { + static const enum_val_t options[] = { { "draft-08", "Internet Draft version 08", SUA_V08 }, { "rfc3868", "RFC 3868", SUA_RFC }, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index a469289fc9..ba4ec1619d 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -5604,7 +5604,7 @@ proto_register_tcp(void) &ett_tcp_process_info }; - static enum_val_t window_scaling_vals[] = { + static const enum_val_t window_scaling_vals[] = { {"not-known", "Not known", WindowScaling_NotKnown}, {"0", "0 (no scaling)", WindowScaling_0}, {"1", "1 (multiply by 2)", WindowScaling_1}, diff --git a/epan/dissectors/packet-time.c b/epan/dissectors/packet-time.c index de92d2cf16..f426d2f05e 100644 --- a/epan/dissectors/packet-time.c +++ b/epan/dissectors/packet-time.c @@ -32,7 +32,7 @@ #include -static enum_val_t time_display_types[] = { +static const enum_val_t time_display_types[] = { { "UTC", "UTC", ABSOLUTE_TIME_UTC }, { "Local", "Local", ABSOLUTE_TIME_LOCAL}, { NULL, NULL, 0 } diff --git a/epan/dissectors/packet-tipc.c b/epan/dissectors/packet-tipc.c index 929d3d2597..dc52882e78 100644 --- a/epan/dissectors/packet-tipc.c +++ b/epan/dissectors/packet-tipc.c @@ -2883,11 +2883,11 @@ proto_register_tipc(void) module_t *tipc_module; /* options for the enum in the protocol preferences */ - static enum_val_t handle_v2_as_options[] = { + static const enum_val_t handle_v2_as_options[] = { { "all", "ALL", V2_AS_ALL }, { "tipc l.5/1.6", "TIPC 1.5/1.6", V2_AS_1_6 }, { "tipc 1.7", "TIPC 1.7", V2_AS_1_7 }, - { NULL, NULL, 0 } + { NULL, NULL, 0 } }; /* Register the protocol name and description */ diff --git a/epan/dissectors/packet-zbee-security.c b/epan/dissectors/packet-zbee-security.c index 58d1ce4b72..042b2fdd11 100644 --- a/epan/dissectors/packet-zbee-security.c +++ b/epan/dissectors/packet-zbee-security.c @@ -101,7 +101,7 @@ static const value_string zbee_sec_level_names[] = { #endif /* The ZigBee security level, in enum_val_t for the security preferences. */ -static enum_val_t zbee_sec_level_enums[] = { +static const enum_val_t zbee_sec_level_enums[] = { { "None", "No Security", ZBEE_SEC_NONE }, { "MIC32", "No Encryption, 32-bit Integrity Protection", ZBEE_SEC_MIC32 }, { "MIC64", "No Encryption, 64-bit Integrity Protection", ZBEE_SEC_MIC64 },