aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2006-05-03 05:07:04 +0000
committerAnders Broman <anders.broman@ericsson.com>2006-05-03 05:07:04 +0000
commit97419848da8486a623caed0821a7c73677ea38dc (patch)
tree79920594020a015d950a21d1be1486ed3c190de5 /epan
parent437baee30143cfc76fc4c03a8318a0151b94e5ed (diff)
From Andrei Emeltchenko:
I attached patch to add preferences in SDP for RTP stream detection. By default SDP decodes RTP stream but now I can disable it. svn path=/trunk/; revision=18080
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-sdp.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/epan/dissectors/packet-sdp.c b/epan/dissectors/packet-sdp.c
index 8919403c1d..666131e2d8 100644
--- a/epan/dissectors/packet-sdp.c
+++ b/epan/dissectors/packet-sdp.c
@@ -60,6 +60,9 @@
#include "packet-rtp.h"
#include <epan/rtp_pt.h>
+
+#include <epan/prefs.h>
+
#include "packet-rtcp.h"
#include "packet-t38.h"
@@ -73,6 +76,9 @@ static int sdp_tap = -1;
static int proto_sdp = -1;
+/* preference globals */
+static gboolean global_sdp_establish_conversation = TRUE;
+
/* Top level fields */
static int hf_protocol_version = -1;
static int hf_owner = -1;
@@ -390,11 +396,14 @@ dissect_sdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
port = atol(transport_info.media_port[n]);
}
if(transport_info.media_proto[n]!=NULL) {
- /* Check if media protocol is RTP */
- is_rtp = (strcmp(transport_info.media_proto[n],"RTP/AVP")==0);
- /* Check if media protocol is T38 */
- is_t38 = ( (strcmp(transport_info.media_proto[n],"UDPTL")==0) || (strcmp(transport_info.media_proto[n],"udptl")==0) );
-
+ /* Check if media protocol is RTP
+ * and stream decoding is enabled in preferences
+ */
+ if(global_sdp_establish_conversation){
+ is_rtp = (strcmp(transport_info.media_proto[n],"RTP/AVP")==0);
+ /* Check if media protocol is T38 */
+ is_t38 = ( (strcmp(transport_info.media_proto[n],"UDPTL")==0) || (strcmp(transport_info.media_proto[n],"udptl")==0) );
+ }
}
if(transport_info.connection_address!=NULL) {
if(transport_info.connection_type!=NULL) {
@@ -1495,12 +1504,24 @@ proto_register_sdp(void)
&ett_sdp_fmtp,
};
+ module_t *sdp_module;
+
proto_sdp = proto_register_protocol("Session Description Protocol",
"SDP", "sdp");
proto_register_field_array(proto_sdp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/*
+ * Preferences registration
+ */
+ sdp_module = prefs_register_protocol(proto_sdp, NULL);
+ prefs_register_bool_preference(sdp_module, "establish_conversation",
+ "Establish RTP Conversation",
+ "Specifies that RTP stream is decoded based "
+ "upon port numbers found in SIP/SDP payload",
+ &global_sdp_establish_conversation);
+
+ /*
* Register the dissector by name, so other dissectors can
* grab it by name rather than just referring to it directly.
*/