From d27f07f6dbe1fb5c14da76f2edf6d0a346f624b2 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Wed, 31 Oct 2012 12:46:16 +0000 Subject: 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 --- epan/dissectors/packet-uasip.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'epan/dissectors/packet-uasip.c') 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) { -- cgit v1.2.3