diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-12-31 21:09:15 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-01-01 05:10:07 +0000 |
commit | 1fcf7d7041fc2e10f6b5490cbaacbeb25ec42bde (patch) | |
tree | 987a5c61bd9f913ce7228fe82a7208adf6168e8e /asn1 | |
parent | f499265df7ab9588284d14298e258fe39ad5539d (diff) |
Clean up response matching type preference.
Add #defines for all the value types and use them.
Make the preference static, as it's not used outside this module.
Change-Id: Ibd04274b4160d18a55b10f47ce866ac97a76309e
Reviewed-on: https://code.wireshark.org/review/12987
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/ansi_map/packet-ansi_map-template.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/asn1/ansi_map/packet-ansi_map-template.c b/asn1/ansi_map/packet-ansi_map-template.c index 1c8bb8ceeb..70bcb33531 100644 --- a/asn1/ansi_map/packet-ansi_map-template.c +++ b/asn1/ansi_map/packet-ansi_map-template.c @@ -106,12 +106,13 @@ void proto_register_ansi_map(void); void proto_reg_handoff_ansi_map(void); -/* Preference settings default */ +/* Preference settings */ #define MAX_SSN 254 static range_t *global_ssn_range; -gint ansi_map_response_matching_type = 1; - -#define ANSI_MAP_TID_ONLY 0 +#define ANSI_MAP_TID_ONLY 0 +#define ANSI_MAP_TID_AND_SOURCE 1 +#define ANSI_MAP_TID_SOURCE_AND_DEST 2 +static gint ansi_map_response_matching_type = ANSI_MAP_TID_AND_SOURCE; static dissector_handle_t ansi_map_handle=NULL; @@ -422,9 +423,10 @@ update_saved_invokedata(packet_info *pinfo, struct ansi_tcap_private_t *p_privat case ANSI_MAP_TID_ONLY: buf = wmem_strdup(wmem_packet_scope(), p_private_tcap->TransactionID_str); break; - case 1: + case ANSI_MAP_TID_AND_SOURCE: buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s",p_private_tcap->TransactionID_str,src_str); break; + case ANSI_MAP_TID_SOURCE_AND_DEST: default: buf = wmem_strdup_printf(wmem_packet_scope(), "%s%s%s",p_private_tcap->TransactionID_str,src_str,dst_str); break; @@ -4343,9 +4345,10 @@ find_saved_invokedata(asn1_ctx_t *actx, struct ansi_tcap_private_t *p_private_tc case ANSI_MAP_TID_ONLY: g_snprintf(buf,1024,"%s",p_private_tcap->TransactionID_str); break; - case 1: + case ANSI_MAP_TID_AND_SOURCE: g_snprintf(buf,1024,"%s%s",p_private_tcap->TransactionID_str,dst_str); break; + case ANSI_MAP_TID_SOURCE_AND_DEST: default: g_snprintf(buf,1024,"%s%s%s",p_private_tcap->TransactionID_str,dst_str,src_str); break; @@ -5427,9 +5430,9 @@ void proto_register_ansi_map(void) { expert_module_t* expert_ansi_map; 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}, + {"Only Transaction ID will be used in Invoke/response matching", "Transaction ID only", ANSI_MAP_TID_ONLY}, + {"Transaction ID and Source will be used in Invoke/response matching", "Transaction ID and Source", ANSI_MAP_TID_AND_SOURCE}, + {"Transaction ID Source and Destination will be used in Invoke/response matching", "Transaction ID Source and Destination", ANSI_MAP_TID_SOURCE_AND_DEST}, {NULL, NULL, -1} }; |