diff options
author | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2012-11-29 20:15:37 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2012-11-29 20:15:37 +0000 |
commit | 0266cceef3e00f56bcdf68282a3937a18cd956de (patch) | |
tree | 0bb294b06d441b252bc343133359c316a8ebd29c /asn1 | |
parent | c33b0ad215b2f8be059b0a00319358547e5bac34 (diff) | |
download | wireshark-0266cceef3e00f56bcdf68282a3937a18cd956de.tar.gz |
Make all enum_val_t's const.
svn path=/trunk/; revision=46292
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/ansi_map/packet-ansi_map-template.c | 2 | ||||
-rw-r--r-- | asn1/ansi_tcap/packet-ansi_tcap-template.c | 88 | ||||
-rw-r--r-- | asn1/camel/packet-camel-template.c | 2 | ||||
-rw-r--r-- | asn1/gsm_map/packet-gsm_map-template.c | 4 |
4 files changed, 48 insertions, 48 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}, |