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
This commit is contained in:
Ronnie Sahlberg 2005-08-12 10:03:17 +00:00
parent d3b675c2d6
commit f6e45c9d5f
2 changed files with 3 additions and 29 deletions

View File

@ -3516,7 +3516,6 @@ dissect_mmc4_reportkey (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
{
guint8 flags, agid, key_format, key_class;
char *str;
if (tree && isreq && iscdb) {
proto_tree_add_item (tree, hf_scsi_lba, tvb, offset+1,
@ -3578,7 +3577,6 @@ dissect_mmc4_setstreaming (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
{
guint8 flags, type;
char *str;
if (tree && isreq && iscdb) {
type=tvb_get_guint8(tvb, offset+7);
@ -3697,7 +3695,6 @@ dissect_mmc4_getconfiguration (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree
{
guint8 flags;
gint32 len;
char *str;
guint old_offset;
if (tree && isreq && iscdb) {
@ -3841,7 +3838,6 @@ dissect_mmc4_readtocpmaatip (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *
{
guint8 flags, format;
gint16 len;
char *str;
if (tree && isreq && iscdb) {
format=tvb_get_guint8(tvb, offset+1)&0x0f;

View File

@ -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",