diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-10-31 12:46:16 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-10-31 12:46:16 +0000 |
commit | d27f07f6dbe1fb5c14da76f2edf6d0a346f624b2 (patch) | |
tree | a966ad90f89662b0399bf209b0ed8e498389d522 /epan/dissectors/packet-uasip.c | |
parent | c07227bef3bb500d147354f24089186bb9881499 (diff) |
Add a preference to disable the registration for media type
"application/octet-stream" default to OFF effectivly disabling the protocol as default as the use of this protocol should be limited
and false positives are seen.
svn path=/trunk/; revision=45846
Diffstat (limited to 'epan/dissectors/packet-uasip.c')
-rw-r--r-- | epan/dissectors/packet-uasip.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/epan/dissectors/packet-uasip.c b/epan/dissectors/packet-uasip.c index f9c823da81..ac48b6eee4 100644 --- a/epan/dissectors/packet-uasip.c +++ b/epan/dissectors/packet-uasip.c @@ -73,6 +73,7 @@ static gint ett_uasip = -1; static guint8 proxy_ipaddr[4]; static const char *pref_proxy_ipaddr_s = NULL; +static gboolean uasip_enabled = FALSE; static gboolean use_proxy_ipaddr = FALSE; static gboolean noesip_enabled = FALSE; @@ -470,6 +471,7 @@ void proto_register_uasip(void) proto_register_subtree_array(ett, array_length(ett)); uasip_module = prefs_register_protocol(proto_uasip, proto_reg_handoff_uasip); + prefs_register_bool_preference(uasip_module, "aplication_octet_stream", "Try to decode application/octet-stream as UASIP", "UA SIP Protocol enabled", &uasip_enabled); prefs_register_bool_preference(uasip_module, "noesip", "Try to decode SIP NOE", "NOE SIP Protocol", &noesip_enabled); prefs_register_string_preference(uasip_module, "proxy_ipaddr", "Proxy IP Address", "IPv4 address of the proxy (Invalid values will be ignored)", @@ -487,7 +489,6 @@ void proto_reg_handoff_uasip(void) if (!prefs_initialized) { uasip_handle = create_dissector_handle(dissect_uasip, proto_uasip); - dissector_add_string("media_type", "application/octet-stream", uasip_handle); ua_sys_to_term_handle = find_dissector("ua_sys_to_term"); ua_term_to_sys_handle = find_dissector("ua_term_to_sys"); prefs_initialized = TRUE; @@ -496,6 +497,12 @@ void proto_reg_handoff_uasip(void) use_proxy_ipaddr = FALSE; memset(proxy_ipaddr, 0, sizeof(proxy_ipaddr)); + if(uasip_enabled){ + dissector_add_string("media_type", "application/octet-stream", uasip_handle); + }else{ + dissector_delete_string("media_type", "application/octet-stream", uasip_handle); + } + if (strcmp(pref_proxy_ipaddr_s, "") != 0) { if (inet_pton(AF_INET, pref_proxy_ipaddr_s, proxy_ipaddr) == 1) { |