ieee1609dot2: fix no previous prototype for function 'proto_register_ieee1609dot2...
[metze/wireshark/wip.git] / epan / dissectors / packet-dlm3.c
index f6e52423a42c5c64272191ba7bbdf50c4713ab7c..c96cbefe05a29acdd472fc04035c50502ca3791f 100644 (file)
@@ -6,19 +6,7 @@
  * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * SPDX-License-Identifier: GPL-2.0-or-later
  */
 
 /* This dissector supports version 3.0 of the dlm(Distributed Lock Manager)
@@ -50,7 +38,7 @@
 
 
 
-#define TCP_PORT_DLM3           21064
+#define TCP_PORT_DLM3           21064 /* Not IANA registered */
 #define SCTP_PORT_DLM3          TCP_PORT_DLM3
 
 #define DLM3_MAJOR_VERSION      0x00030000
@@ -351,7 +339,6 @@ static gint ett_dlm3_rl_name     = -1;
 
 
 /* configurable parameters */
-static guint dlm3_tcp_port  = TCP_PORT_DLM3;
 static guint dlm3_sctp_port = SCTP_PORT_DLM3;
 
 /*
@@ -1552,11 +1539,6 @@ proto_register_dlm3(void)
   dlm3_module = prefs_register_protocol(proto_dlm3,
                                         proto_reg_handoff_dlm3);
 
-  prefs_register_uint_preference(dlm3_module, "tcp.port",
-                                 "DLM3 TCP Port",
-                                 "Set the TCP port for Distributed Lock Manager",
-                                 10,
-                                 &dlm3_tcp_port);
   prefs_register_uint_preference(dlm3_module, "sctp.port",
                                  "DLM3 SCTP Port",
                                  "Set the SCTP port for Distributed Lock Manager",
@@ -1570,7 +1552,6 @@ proto_reg_handoff_dlm3(void)
 {
   static gboolean dissector_registered = FALSE;
 
-  static guint tcp_port;
   static guint sctp_port;
 
   static dissector_handle_t dlm3_tcp_handle;
@@ -1579,15 +1560,13 @@ proto_reg_handoff_dlm3(void)
   if (!dissector_registered) {
     dlm3_sctp_handle = create_dissector_handle(dissect_dlm3, proto_dlm3);
     dlm3_tcp_handle = create_dissector_handle(dissect_dlm3, proto_dlm3);
+    dissector_add_uint_with_preference("tcp.port", TCP_PORT_DLM3, dlm3_tcp_handle);
     dissector_registered = TRUE;
   } else {
-    dissector_delete_uint("tcp.port",  tcp_port,  dlm3_tcp_handle);
     dissector_delete_uint("sctp.port", sctp_port, dlm3_sctp_handle);
   }
 
-  tcp_port  = dlm3_tcp_port;
   sctp_port = dlm3_sctp_port;
-  dissector_add_uint("tcp.port",  tcp_port,  dlm3_tcp_handle);
   dissector_add_uint("sctp.port", sctp_port, dlm3_sctp_handle);
 }