diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-12 10:03:17 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2005-08-12 10:03:17 +0000 |
commit | f6e45c9d5f78d4199e9ecffde89deec1d52929bc (patch) | |
tree | cc9b9a9eae8395066bd94aeecf6a8fdb0121f502 /epan/dissectors/packet-smtp.c | |
parent | d3b675c2d60121b06aa9a7a2cdf4e9e9b51b6893 (diff) |
remove some unused variables from scsi
change two gmemchunks in smtp to se_alloc() and remove one now redundant init routine.
svn path=/trunk/; revision=15308
Diffstat (limited to 'epan/dissectors/packet-smtp.c')
-rw-r--r-- | epan/dissectors/packet-smtp.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c index f3f5503d11..7c58f11de6 100644 --- a/epan/dissectors/packet-smtp.c +++ b/epan/dissectors/packet-smtp.c @@ -39,6 +39,7 @@ #include <epan/addr_resolv.h> #include <epan/prefs.h> #include <epan/strutil.h> +#include <epan/emem.h> #define TCP_PORT_SMTP 25 @@ -70,8 +71,6 @@ struct smtp_proto_data { guint16 pdu_type; }; -static int smtp_packet_init_count = 100; - /* * State information stored with a conversation. */ @@ -80,26 +79,6 @@ struct smtp_request_val { guint16 crlf_seen; /* Have we seen a CRLF on the end of a packet */ }; -static GMemChunk *smtp_request_vals = NULL; -static GMemChunk *smtp_packet_infos = NULL; - -static void -smtp_init_protocol(void) -{ - if (smtp_request_vals) - g_mem_chunk_destroy(smtp_request_vals); - if (smtp_packet_infos) - g_mem_chunk_destroy(smtp_packet_infos); - - smtp_request_vals = g_mem_chunk_new("smtp_request_vals", - sizeof(struct smtp_request_val), - smtp_packet_init_count * sizeof(struct smtp_request_val), G_ALLOC_AND_FREE); - smtp_packet_infos = g_mem_chunk_new("smtp_packet_infos", - sizeof(struct smtp_proto_data), - smtp_packet_init_count * sizeof(struct smtp_proto_data), G_ALLOC_AND_FREE); - -} - static void dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { @@ -195,7 +174,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* * No - create one and attach it. */ - request_val = g_mem_chunk_alloc(smtp_request_vals); + request_val = se_alloc(sizeof(struct smtp_request_val)); request_val->reading_data = FALSE; request_val->crlf_seen = 0; @@ -246,7 +225,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (request) { - frame_data = g_mem_chunk_alloc(smtp_packet_infos); + frame_data = se_alloc(sizeof(struct smtp_proto_data)); if (request_val->reading_data) { /* @@ -577,7 +556,6 @@ proto_register_smtp(void) proto_register_field_array(proto_smtp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); - register_init_routine(&smtp_init_protocol); smtp_module = prefs_register_protocol(proto_smtp, NULL); prefs_register_bool_preference(smtp_module, "desegment_lines", |