T.38: don't register for TCP and UDP ports 6004.
authorJeff Morriss <jeff.morriss.ws@gmail.com>
Tue, 15 Dec 2015 03:08:13 +0000 (22:08 -0500)
committerAnders Broman <a.broman58@gmail.com>
Tue, 15 Dec 2015 04:38:34 +0000 (04:38 +0000)
T.38 normally picks up its port number dynamically from signalling, port 6004
isn't registered to T.38, and anyway port 6004 is now (correctly) registered
to X11.

(For the cases where the signaling is missing there's still Decode-As.)

Change-Id: I53d8aa27ed1b042dd60bbdb0df2bd89254f1f001
Reviewed-on: https://code.wireshark.org/review/12640
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
asn1/t38/packet-t38-template.c
epan/dissectors/packet-t38.c

index 426fa14da5ef7f67cc885abf3c37ed085031d63e..c459c31dab2e406964fd3286c760b3cf2614eefc 100644 (file)
 
 void proto_register_t38(void);
 
-#define PORT_T38 6004
-static guint global_t38_tcp_port = PORT_T38;
-static guint global_t38_udp_port = PORT_T38;
-
 static int t38_tap = -1;
 
 /* dissect using the Pre Corrigendum T.38 ASN.1 specification (1998) */
@@ -273,25 +269,25 @@ void t38_add_address(packet_info *pinfo,
          */
         g_strlcpy(p_conversation_data->setup_method, setup_method, MAX_T38_SETUP_METHOD_SIZE);
         p_conversation_data->setup_frame_number = setup_frame_number;
-               p_conversation_data->src_t38_info.reass_ID = 0;
-               p_conversation_data->src_t38_info.reass_start_seqnum = -1;
-               p_conversation_data->src_t38_info.reass_data_type = 0;
-               p_conversation_data->src_t38_info.last_seqnum = -1;
-               p_conversation_data->src_t38_info.packet_lost = 0;
-               p_conversation_data->src_t38_info.burst_lost = 0;
-               p_conversation_data->src_t38_info.time_first_t4_data = 0;
-               p_conversation_data->src_t38_info.additional_hdlc_data_field_counter = 0;
-               p_conversation_data->src_t38_info.seqnum_prev_data_field = -1;
-
-               p_conversation_data->dst_t38_info.reass_ID = 0;
-               p_conversation_data->dst_t38_info.reass_start_seqnum = -1;
-               p_conversation_data->dst_t38_info.reass_data_type = 0;
-               p_conversation_data->dst_t38_info.last_seqnum = -1;
-               p_conversation_data->dst_t38_info.packet_lost = 0;
-               p_conversation_data->dst_t38_info.burst_lost = 0;
-               p_conversation_data->dst_t38_info.time_first_t4_data = 0;
-               p_conversation_data->dst_t38_info.additional_hdlc_data_field_counter = 0;
-               p_conversation_data->dst_t38_info.seqnum_prev_data_field = -1;
+        p_conversation_data->src_t38_info.reass_ID = 0;
+        p_conversation_data->src_t38_info.reass_start_seqnum = -1;
+        p_conversation_data->src_t38_info.reass_data_type = 0;
+        p_conversation_data->src_t38_info.last_seqnum = -1;
+        p_conversation_data->src_t38_info.packet_lost = 0;
+        p_conversation_data->src_t38_info.burst_lost = 0;
+        p_conversation_data->src_t38_info.time_first_t4_data = 0;
+        p_conversation_data->src_t38_info.additional_hdlc_data_field_counter = 0;
+        p_conversation_data->src_t38_info.seqnum_prev_data_field = -1;
+
+        p_conversation_data->dst_t38_info.reass_ID = 0;
+        p_conversation_data->dst_t38_info.reass_start_seqnum = -1;
+        p_conversation_data->dst_t38_info.reass_data_type = 0;
+        p_conversation_data->dst_t38_info.last_seqnum = -1;
+        p_conversation_data->dst_t38_info.packet_lost = 0;
+        p_conversation_data->dst_t38_info.burst_lost = 0;
+        p_conversation_data->dst_t38_info.time_first_t4_data = 0;
+        p_conversation_data->dst_t38_info.additional_hdlc_data_field_counter = 0;
+        p_conversation_data->dst_t38_info.seqnum_prev_data_field = -1;
 }
 
 
@@ -556,7 +552,7 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
        proto_item *it;
        proto_tree *tr;
        guint32 offset=0;
-    tvbuff_t *next_tvb;
+        tvbuff_t *next_tvb;
        guint16 ifp_packet_number=1;
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.38");
@@ -742,14 +738,8 @@ proto_register_t38(void)
                "be dissected as RTP packet or T.38 packet. If enabled there is a risk that T.38 UDPTL "
                "packets with sequence number higher than 32767 may be dissected as RTP.",
            &dissect_possible_rtpv2_packets_as_rtp);
-       prefs_register_uint_preference(t38_module, "tcp.port",
-               "T.38 TCP Port",
-               "Set the TCP port for T.38 messages",
-               10, &global_t38_tcp_port);
-       prefs_register_uint_preference(t38_module, "udp.port",
-               "T.38 UDP Port",
-               "Set the UDP port for T.38 messages",
-               10, &global_t38_udp_port);
+       prefs_register_obsolete_preference(t38_module, "tcp.port");
+       prefs_register_obsolete_preference(t38_module, "udp.port");
        prefs_register_bool_preference(t38_module, "reassembly",
                "Reassemble T.38 PDUs over TPKT over TCP",
                "Whether the dissector should reassemble T.38 PDUs spanning multiple TCP segments "
@@ -774,8 +764,6 @@ void
 proto_reg_handoff_t38(void)
 {
        static gboolean t38_prefs_initialized = FALSE;
-       static guint tcp_port;
-       static guint udp_port;
 
        if (!t38_prefs_initialized) {
                t38_udp_handle=create_dissector_handle(dissect_t38_udp, proto_t38);
@@ -786,15 +774,5 @@ proto_reg_handoff_t38(void)
                data_handle = find_dissector("data");
                t38_prefs_initialized = TRUE;
        }
-       else {
-               dissector_delete_uint("tcp.port", tcp_port, t38_tcp_handle);
-               dissector_delete_uint("udp.port", udp_port, t38_udp_handle);
-       }
-       tcp_port = global_t38_tcp_port;
-       udp_port = global_t38_udp_port;
-
-       dissector_add_uint("tcp.port", tcp_port, t38_tcp_handle);
-       dissector_add_uint("udp.port", udp_port, t38_udp_handle);
-
 }
 
index 4527d635b5145f880ce01e7c518ec465244d6bba..b3b6b19cd625e137f091f69a624b52f09351ccef 100644 (file)
 
 void proto_register_t38(void);
 
-#define PORT_T38 6004
-static guint global_t38_tcp_port = PORT_T38;
-static guint global_t38_udp_port = PORT_T38;
-
 static int t38_tap = -1;
 
 /* dissect using the Pre Corrigendum T.38 ASN.1 specification (1998) */
@@ -145,7 +141,7 @@ static int hf_t38_fec_data = -1;                  /* T_fec_data */
 static int hf_t38_fec_data_item = -1;             /* OCTET_STRING */
 
 /*--- End of included file: packet-t38-hf.c ---*/
-#line 118 "../../asn1/t38/packet-t38-template.c"
+#line 114 "../../asn1/t38/packet-t38-template.c"
 
 /* T38 setup fields */
 static int hf_t38_setup        = -1;
@@ -179,7 +175,7 @@ static gint ett_t38_T_fec_info = -1;
 static gint ett_t38_T_fec_data = -1;
 
 /*--- End of included file: packet-t38-ett.c ---*/
-#line 138 "../../asn1/t38/packet-t38-template.c"
+#line 134 "../../asn1/t38/packet-t38-template.c"
 static gint ett_t38_setup = -1;
 
 static gint ett_data_fragment = -1;
@@ -318,25 +314,25 @@ void t38_add_address(packet_info *pinfo,
          */
         g_strlcpy(p_conversation_data->setup_method, setup_method, MAX_T38_SETUP_METHOD_SIZE);
         p_conversation_data->setup_frame_number = setup_frame_number;
-               p_conversation_data->src_t38_info.reass_ID = 0;
-               p_conversation_data->src_t38_info.reass_start_seqnum = -1;
-               p_conversation_data->src_t38_info.reass_data_type = 0;
-               p_conversation_data->src_t38_info.last_seqnum = -1;
-               p_conversation_data->src_t38_info.packet_lost = 0;
-               p_conversation_data->src_t38_info.burst_lost = 0;
-               p_conversation_data->src_t38_info.time_first_t4_data = 0;
-               p_conversation_data->src_t38_info.additional_hdlc_data_field_counter = 0;
-               p_conversation_data->src_t38_info.seqnum_prev_data_field = -1;
-
-               p_conversation_data->dst_t38_info.reass_ID = 0;
-               p_conversation_data->dst_t38_info.reass_start_seqnum = -1;
-               p_conversation_data->dst_t38_info.reass_data_type = 0;
-               p_conversation_data->dst_t38_info.last_seqnum = -1;
-               p_conversation_data->dst_t38_info.packet_lost = 0;
-               p_conversation_data->dst_t38_info.burst_lost = 0;
-               p_conversation_data->dst_t38_info.time_first_t4_data = 0;
-               p_conversation_data->dst_t38_info.additional_hdlc_data_field_counter = 0;
-               p_conversation_data->dst_t38_info.seqnum_prev_data_field = -1;
+        p_conversation_data->src_t38_info.reass_ID = 0;
+        p_conversation_data->src_t38_info.reass_start_seqnum = -1;
+        p_conversation_data->src_t38_info.reass_data_type = 0;
+        p_conversation_data->src_t38_info.last_seqnum = -1;
+        p_conversation_data->src_t38_info.packet_lost = 0;
+        p_conversation_data->src_t38_info.burst_lost = 0;
+        p_conversation_data->src_t38_info.time_first_t4_data = 0;
+        p_conversation_data->src_t38_info.additional_hdlc_data_field_counter = 0;
+        p_conversation_data->src_t38_info.seqnum_prev_data_field = -1;
+
+        p_conversation_data->dst_t38_info.reass_ID = 0;
+        p_conversation_data->dst_t38_info.reass_start_seqnum = -1;
+        p_conversation_data->dst_t38_info.reass_data_type = 0;
+        p_conversation_data->dst_t38_info.last_seqnum = -1;
+        p_conversation_data->dst_t38_info.packet_lost = 0;
+        p_conversation_data->dst_t38_info.burst_lost = 0;
+        p_conversation_data->dst_t38_info.time_first_t4_data = 0;
+        p_conversation_data->dst_t38_info.additional_hdlc_data_field_counter = 0;
+        p_conversation_data->dst_t38_info.seqnum_prev_data_field = -1;
 }
 
 
@@ -982,7 +978,7 @@ static int dissect_UDPTLPacket_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, pr
 
 
 /*--- End of included file: packet-t38-fn.c ---*/
-#line 397 "../../asn1/t38/packet-t38-template.c"
+#line 393 "../../asn1/t38/packet-t38-template.c"
 
 /* initialize the tap t38_info and the conversation */
 static void
@@ -1145,7 +1141,7 @@ dissect_t38_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* d
        proto_item *it;
        proto_tree *tr;
        guint32 offset=0;
-    tvbuff_t *next_tvb;
+        tvbuff_t *next_tvb;
        guint16 ifp_packet_number=1;
 
        col_set_str(pinfo->cinfo, COL_PROTOCOL, "T.38");
@@ -1323,7 +1319,7 @@ proto_register_t38(void)
         "OCTET_STRING", HFILL }},
 
 /*--- End of included file: packet-t38-hfarr.c ---*/
-#line 661 "../../asn1/t38/packet-t38-template.c"
+#line 657 "../../asn1/t38/packet-t38-template.c"
                {   &hf_t38_setup,
                    { "Stream setup", "t38.setup", FT_STRING, BASE_NONE,
                    NULL, 0x0, "Stream setup, method and frame number", HFILL }},
@@ -1384,7 +1380,7 @@ proto_register_t38(void)
     &ett_t38_T_fec_data,
 
 /*--- End of included file: packet-t38-ettarr.c ---*/
-#line 708 "../../asn1/t38/packet-t38-template.c"
+#line 704 "../../asn1/t38/packet-t38-template.c"
                &ett_t38_setup,
                &ett_data_fragment,
                &ett_data_fragments
@@ -1422,14 +1418,8 @@ proto_register_t38(void)
                "be dissected as RTP packet or T.38 packet. If enabled there is a risk that T.38 UDPTL "
                "packets with sequence number higher than 32767 may be dissected as RTP.",
            &dissect_possible_rtpv2_packets_as_rtp);
-       prefs_register_uint_preference(t38_module, "tcp.port",
-               "T.38 TCP Port",
-               "Set the TCP port for T.38 messages",
-               10, &global_t38_tcp_port);
-       prefs_register_uint_preference(t38_module, "udp.port",
-               "T.38 UDP Port",
-               "Set the UDP port for T.38 messages",
-               10, &global_t38_udp_port);
+       prefs_register_obsolete_preference(t38_module, "tcp.port");
+       prefs_register_obsolete_preference(t38_module, "udp.port");
        prefs_register_bool_preference(t38_module, "reassembly",
                "Reassemble T.38 PDUs over TPKT over TCP",
                "Whether the dissector should reassemble T.38 PDUs spanning multiple TCP segments "
@@ -1454,8 +1444,6 @@ void
 proto_reg_handoff_t38(void)
 {
        static gboolean t38_prefs_initialized = FALSE;
-       static guint tcp_port;
-       static guint udp_port;
 
        if (!t38_prefs_initialized) {
                t38_udp_handle=create_dissector_handle(dissect_t38_udp, proto_t38);
@@ -1466,15 +1454,5 @@ proto_reg_handoff_t38(void)
                data_handle = find_dissector("data");
                t38_prefs_initialized = TRUE;
        }
-       else {
-               dissector_delete_uint("tcp.port", tcp_port, t38_tcp_handle);
-               dissector_delete_uint("udp.port", udp_port, t38_udp_handle);
-       }
-       tcp_port = global_t38_tcp_port;
-       udp_port = global_t38_udp_port;
-
-       dissector_add_uint("tcp.port", tcp_port, t38_tcp_handle);
-       dissector_add_uint("udp.port", udp_port, t38_udp_handle);
-
 }