aboutsummaryrefslogtreecommitdiffstats
path: root/packet-rtp.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-09-03 10:33:12 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2001-09-03 10:33:12 +0000
commit11d77b940d693a9821ca1ec9febc5538c7e4731a (patch)
tree1c0bb040cbd4022d4c91c56160dc76dca922f005 /packet-rtp.c
parent063cdb6bd1119e4cd87712d0b07e8db540fe70cc (diff)
Instead of having a single datum attached to a conversation, have a list
of protocol-id-plus-datum pairs, so that multiple protocols can attach information to the same conversation. Dissectors that attach information to a conversation should not assume that if they find a conversation it has one of its data attached to it; the conversation might've been created by another dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3901 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-rtp.c')
-rw-r--r--packet-rtp.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/packet-rtp.c b/packet-rtp.c
index bc0b12135d..34438f2144 100644
--- a/packet-rtp.c
+++ b/packet-rtp.c
@@ -6,7 +6,7 @@
* Copyright 2000, Philips Electronics N.V.
* Written by Andreas Sikkema <andreas.sikkema@philips.com>
*
- * $Id: packet-rtp.c,v 1.23 2001/07/16 05:16:57 guy Exp $
+ * $Id: packet-rtp.c,v 1.24 2001/09/03 10:33:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -194,12 +194,19 @@ static const value_string rtp_payload_type_vals[] =
static address fake_addr;
static int heur_init = FALSE;
-static const char rtp_proto[] = "RTP";
-
-void rtp_add_address( const unsigned char* ip_addr, int prt )
+void rtp_add_address( packet_info *pinfo, const unsigned char* ip_addr,
+ int prt )
{
address src_addr;
- conversation_t* pconv = ( conversation_t* ) NULL;
+ conversation_t* pconv;
+
+ /*
+ * If this isn't the first time this packet has been processed,
+ * we've already done this work, so we don't need to do it
+ * again.
+ */
+ if (pinfo->fd->flags.visited)
+ return;
src_addr.type = AT_IPv4;
src_addr.len = 4;
@@ -222,10 +229,12 @@ void rtp_add_address( const unsigned char* ip_addr, int prt )
/*
* If not, add
+ * XXX - use wildcard address and port B?
*/
if ( ! pconv ) {
- conversation_new( &src_addr, &fake_addr, PT_UDP, (guint32) prt,
- (guint32) 0, ( void * ) rtp_proto, 0 );
+ pconv = conversation_new( &src_addr, &fake_addr, PT_UDP,
+ (guint32) prt, (guint32) 0, 0 );
+ conversation_add_proto_data(pconv, proto_rtp, NULL);
}
}
@@ -274,15 +283,11 @@ dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
}
/*
- * An RTP conversation always contains data
- */
- if ( pconv->data == NULL )
- return FALSE;
-
- /*
- * An RTP conversation data always contains "RTP"
+ * An RTP conversation always has a data item for RTP.
+ * (Its existence is sufficient to indicate that this is an RTP
+ * conversation.)
*/
- if ( strcmp( pconv->data, rtp_proto ) != 0 )
+ if (conversation_get_proto_data(pconv, proto_rtp) == NULL)
return FALSE;
dissect_rtp( tvb, pinfo, tree );