aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/h248
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-10-05 16:33:54 -0400
committerMichael Mann <mmann78@netscape.net>2016-10-13 02:51:18 +0000
commit2eb7b05b8c9c6408268f0d1e81f0a18a02610f1c (patch)
treebd0a909e3d506ea2e61c446aa8a809b6f728af3b /epan/dissectors/asn1/h248
parent4d8581d7e15fe4a80a53496b83a853271fc674b6 (diff)
Convert most UDP dissectors to use "auto" preferences.
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67, convert dissectors that use "udp.port". More cleanup done on dissectors that use both TCP and UDP dissector tables, so that less preference callbacks exist. Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3 Reviewed-on: https://code.wireshark.org/review/18120 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/asn1/h248')
-rw-r--r--epan/dissectors/asn1/h248/packet-h248-template.c32
1 files changed, 6 insertions, 26 deletions
diff --git a/epan/dissectors/asn1/h248/packet-h248-template.c b/epan/dissectors/asn1/h248/packet-h248-template.c
index abe81546fb..3dbc8940a4 100644
--- a/epan/dissectors/asn1/h248/packet-h248-template.c
+++ b/epan/dissectors/asn1/h248/packet-h248-template.c
@@ -835,9 +835,8 @@ void gcp_analyze_msg(proto_tree* gcp_tree, packet_info* pinfo, tvbuff_t* gcp_tvb
/* END Gateway Control Protocol -- Context Tracking */
+#define H248_PORT 2945
static gboolean keep_persistent_data = FALSE;
-static guint global_udp_port = 2945;
-#define H248_TCP_PORT 2945
static gboolean h248_desegment = TRUE;
@@ -2373,16 +2372,11 @@ void proto_register_h248(void) {
subdissector_table = register_dissector_table("h248.magic_num", "H248 Magic Num", proto_h248, FT_UINT32, BASE_HEX);
- h248_module = prefs_register_protocol(proto_h248, proto_reg_handoff_h248);
+ h248_module = prefs_register_protocol(proto_h248, NULL);
prefs_register_bool_preference(h248_module, "ctx_info",
"Track Context",
"Maintain relationships between transactions and contexts and display an extra tree showing context data",
&keep_persistent_data);
- prefs_register_uint_preference(h248_module, "udp_port",
- "UDP port",
- "Port to be decoded as h248",
- 10,
- &global_udp_port);
prefs_register_bool_preference(h248_module, "desegment",
"Desegment H.248 over TCP",
"Desegment H.248 messages that span more TCP segments",
@@ -2399,24 +2393,10 @@ void proto_register_h248(void) {
/*--- proto_reg_handoff_h248 -------------------------------------------*/
void proto_reg_handoff_h248(void) {
- static gboolean initialized = FALSE;
- static guint32 udp_port;
-
- if (!initialized) {
- dissector_add_uint("mtp3.service_indicator", MTP_SI_GCP, h248_handle);
- h248_term_handle = find_dissector_add_dependency("h248term", proto_h248);
- dissector_add_uint_with_preference("tcp.port", H248_TCP_PORT, h248_tpkt_handle);
- initialized = TRUE;
- } else {
- if (udp_port != 0)
- dissector_delete_uint("udp.port", udp_port, h248_handle);
- }
-
- udp_port = global_udp_port;
-
- if (udp_port != 0) {
- dissector_add_uint("udp.port", udp_port, h248_handle);
- }
+ dissector_add_uint("mtp3.service_indicator", MTP_SI_GCP, h248_handle);
+ h248_term_handle = find_dissector_add_dependency("h248term", proto_h248);
+ dissector_add_uint_with_preference("tcp.port", H248_PORT, h248_tpkt_handle);
+ dissector_add_uint_with_preference("udp.port", H248_PORT, h248_handle);
ss7pc_address_type = address_type_get_by_name("AT_SS7PC");
exported_pdu_tap = find_tap_id(EXPORT_PDU_TAP_NAME_LAYER_7);