aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rtp.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-08-12 10:50:55 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2005-08-12 10:50:55 +0000
commit234f09c6637f6e211cdd6059189b07c490554c38 (patch)
treea86d3896cad28dcfed5bb550b013def6304812c4 /epan/dissectors/packet-rtp.c
parente9e87bb4a6c7c751ea95c83b421ca2b7c64b46cf (diff)
more gmemchunk -> se_alloc() improvements
svn path=/trunk/; revision=15312
Diffstat (limited to 'epan/dissectors/packet-rtp.c')
-rw-r--r--epan/dissectors/packet-rtp.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c
index 9098672ef2..60a28e9c66 100644
--- a/epan/dissectors/packet-rtp.c
+++ b/epan/dissectors/packet-rtp.c
@@ -67,6 +67,7 @@
#include <epan/tap.h>
#include <epan/prefs.h>
+#include <epan/emem.h>
static dissector_handle_t rtp_handle;
static dissector_handle_t stun_handle;
@@ -134,9 +135,6 @@ static gboolean global_rtp_show_setup_info = TRUE;
/* Try heuristic RTP decode */
static gboolean global_rtp_heur = FALSE;
-/* Memory chunk for storing conversation and per-packet info */
-static GMemChunk *rtp_conversations = NULL;
-
/*
* Fields in the first octet of the RTP header.
*/
@@ -303,7 +301,7 @@ void rtp_add_address(packet_info *pinfo,
*/
if ( ! p_conv_data ) {
/* Create conversation data */
- p_conv_data = g_mem_chunk_alloc(rtp_conversations);
+ p_conv_data = se_alloc(sizeof(struct _rtp_conversation_info));
p_conv_data->rtp_dyn_payload = NULL;
conversation_add_proto_data(p_conv, proto_rtp, p_conv_data);
@@ -321,19 +319,6 @@ void rtp_add_address(packet_info *pinfo,
p_conv_data->rtp_dyn_payload = rtp_dyn_payload;
}
-static void rtp_init( void )
-{
- /* (Re)allocate mem chunk for conversations */
- if (rtp_conversations)
- {
- g_mem_chunk_destroy(rtp_conversations);
- }
- rtp_conversations = g_mem_chunk_new("rtp_conversations",
- sizeof(struct _rtp_conversation_info),
- 20 * sizeof(struct _rtp_conversation_info),
- G_ALLOC_ONLY);
-}
-
static gboolean
dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree )
{
@@ -777,7 +762,7 @@ static void get_conv_info(packet_info *pinfo, struct _rtp_info *rtp_info)
if (p_conv_data) {
/* Save this conversation info into packet info */
- p_conv_packet_data = g_mem_chunk_alloc(rtp_conversations);
+ p_conv_packet_data = se_alloc(sizeof(struct _rtp_conversation_info));
strcpy(p_conv_packet_data->method, p_conv_data->method);
p_conv_packet_data->frame_number = p_conv_data->frame_number;
p_conv_packet_data->rtp_dyn_payload = p_conv_data->rtp_dyn_payload;
@@ -1104,7 +1089,6 @@ proto_register_rtp(void)
"If an RTP version 0 packet is encountered, it can be treated as an invalid packet or a STUN packet",
&global_rtp_version0_type,
rtp_version0_types, FALSE);
- register_init_routine( &rtp_init );
}
void