diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2012-07-10 11:39:06 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2012-07-10 11:39:06 +0000 |
commit | 8898cb4eab2e930a7cf3326f7abcd0083dc6e1e7 (patch) | |
tree | 822d52e6c6ece931e055a80be994db13b83b8f3b /asn1 | |
parent | 7db6f2bd5190e271b27490a22859b5e106aa1a32 (diff) |
Introduce a preference setting for application context version.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@43641 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1')
-rw-r--r-- | asn1/gsm_map/packet-gsm_map-template.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/asn1/gsm_map/packet-gsm_map-template.c b/asn1/gsm_map/packet-gsm_map-template.c index 6ee265cb25..0e3fa56c53 100644 --- a/asn1/gsm_map/packet-gsm_map-template.c +++ b/asn1/gsm_map/packet-gsm_map-template.c @@ -189,6 +189,8 @@ static dissector_table_t map_prop_err_opcode_table; /* prorietary operation code /* Preferenc settings default */ #define MAX_SSN 254 static range_t *global_ssn_range; +#define APPLICATON_CONTEXT_FROM_TRACE 0 +static gint pref_application_context_version = APPLICATON_CONTEXT_FROM_TRACE; /* Global variables */ static guint32 opcode=0; @@ -1833,15 +1835,19 @@ dissect_gsm_map_GSMMAPPDU(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, struct tcap_private_t * p_private_tcap; opcode = 0; - application_context_version = 0; - if (actx->pinfo->private_data != NULL){ - p_private_tcap = (struct tcap_private_t *)actx->pinfo->private_data; - if (p_private_tcap->acv==TRUE ){ - version_ptr = strrchr((const char*)p_private_tcap->oid,'.'); - if (version_ptr){ - application_context_version = atoi(version_ptr+1); + if (pref_application_context_version == APPLICATON_CONTEXT_FROM_TRACE) { + application_context_version = 0; + if (actx->pinfo->private_data != NULL){ + p_private_tcap = (struct tcap_private_t *)actx->pinfo->private_data; + if (p_private_tcap->acv==TRUE ){ + version_ptr = strrchr((const char*)p_private_tcap->oid,'.'); + if (version_ptr){ + application_context_version = atoi(version_ptr+1); + } + } } - } + }else{ + application_context_version = pref_application_context_version; } gsmmap_pdu_type = tvb_get_guint8(tvb, offset)&0x0f; @@ -2598,6 +2604,15 @@ void proto_register_gsm_map(void) { #include "packet-gsm_map-ettarr.c" }; + static 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}, + {"Treat as AC 3", "Treat as AC 3", 3}, + {NULL, NULL, -1} + }; + + /* Register protocol */ proto_gsm_map_dialogue =proto_gsm_map = proto_register_protocol(PNAME, PSNAME, PFNAME); @@ -2632,4 +2647,10 @@ void proto_register_gsm_map(void) { prefs_register_range_preference(gsm_map_module, "tcap.ssn", "TCAP SSNs", "TCAP Subsystem numbers used for GSM MAP", &global_ssn_range, MAX_SSN); + + prefs_register_enum_preference(gsm_map_module, "application.context.version", + "Application context version", + "How to treat Application context", + &pref_application_context_version, application_context_modes, APPLICATON_CONTEXT_FROM_TRACE); + } |