Clean up the last two DIRTY_DISSECTOR_SRC entries.

svn path=/trunk/; revision=29321
This commit is contained in:
Gerald Combs 2009-08-07 00:15:35 +00:00
parent 3c1bc8f251
commit 367bcb7abd
4 changed files with 24 additions and 34 deletions

View File

@ -28,7 +28,6 @@ INCLUDES = -I$(srcdir)/../.. -I$(srcdir)/.. \
include Makefile.common
libdirtydissectors_la_SOURCES = \
$(DIRTY_DISSECTOR_SRC) \
$(DIRTY_ASN1_DISSECTOR_SRC) \
$(DIRTY_PIDL_DISSECTOR_SRC)

View File

@ -649,6 +649,7 @@ DISSECTOR_SRC = \
packet-nas_eps.c \
packet-nasdaq-itch.c \
packet-nat-pmp.c \
packet-nbd.c \
packet-nbipx.c \
packet-nbns.c \
packet-ncp.c \
@ -781,6 +782,7 @@ DISSECTOR_SRC = \
packet-sccpmg.c \
packet-scsi.c \
packet-scsi-mmc.c \
packet-scsi-osd.c \
packet-scsi-sbc.c \
packet-scsi-smc.c \
packet-scsi-ssc.c \
@ -933,13 +935,6 @@ DISSECTOR_SRC = \
packet-ziop.c \
packet-zrtp.c
#
# Dissectors with warnings.
#
DIRTY_DISSECTOR_SRC = \
packet-nbd.c \
packet-scsi-osd.c
#
# Headers for dissectors.
#
@ -1296,7 +1291,6 @@ noinst_HEADERS = \
ALL_DISSECTORS_SRC = \
$(DISSECTOR_SRC) \
$(DIRTY_DISSECTOR_SRC) \
$(PIDL_DISSECTOR_SRC) \
$(DIRTY_PIDL_DISSECTOR_SRC) \
$(ASN1_DISSECTOR_SRC) \

View File

@ -96,7 +96,7 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
nbd_conv_info_t *nbd_info;
nbd_transaction_t *nbd_trans=NULL;
emem_tree_key_t hkey[3];
guint64 handle;
guint32 handle[2];
magic=tvb_get_ntohl(tvb, offset);
@ -133,9 +133,10 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
/*
* Do we have a state structure for this transaction
*/
handle=tvb_get_ntoh64(tvb, offset+8);
handle[0]=tvb_get_ntohl(tvb, offset+8);
handle[1]=tvb_get_ntohl(tvb, offset+12);
hkey[0].length=2;
hkey[0].key=(guint32 *)&handle;
hkey[0].key=handle;
hkey[1].length=0;
nbd_trans=se_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
if(!nbd_trans){
@ -146,12 +147,13 @@ get_nbd_tcp_pdu_len(packet_info *pinfo, tvbuff_t *tvb, int offset)
/*
* Do we have a state structure for this transaction
*/
handle=tvb_get_ntoh64(tvb, offset+8);
handle[0]=tvb_get_ntohl(tvb, offset+8);
handle[1]=tvb_get_ntohl(tvb, offset+12);
packet=pinfo->fd->num;
hkey[0].length=1;
hkey[0].key=&packet;
hkey[1].length=2;
hkey[1].key=(guint32 *)&handle;
hkey[1].key=handle;
hkey[2].length=0;
nbd_trans=se_tree_lookup32_array(nbd_info->acked_pdus, hkey);
if(!nbd_trans){
@ -179,7 +181,8 @@ static void
dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
{
guint32 magic, error, packet;
guint64 handle=0, from;
guint32 handle[2];
guint64 from;
int offset=0;
proto_tree *tree=NULL;
proto_item *item=NULL;
@ -208,10 +211,9 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
/* grab what we need to do the request/response matching */
switch(magic){
case NBD_REQUEST_MAGIC:
handle=tvb_get_ntoh64(tvb, offset+4);
break;
case NBD_RESPONSE_MAGIC:
handle=tvb_get_ntoh64(tvb, offset+4);
handle[0]=tvb_get_ntohl(tvb, offset+4);
handle[1]=tvb_get_ntohl(tvb, offset+8);
break;
default:
return;
@ -256,13 +258,13 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
nbd_trans->datalen=tvb_get_ntohl(tvb, offset+20);
hkey[0].length=2;
hkey[0].key=(guint32 *)&handle;
hkey[0].key=handle;
hkey[1].length=0;
se_tree_insert32_array(nbd_info->unacked_pdus, hkey, (void *)nbd_trans);
} else if(magic==NBD_RESPONSE_MAGIC){
hkey[0].length=2;
hkey[0].key=(guint32 *)&handle;
hkey[0].key=handle;
hkey[1].length=0;
nbd_trans=se_tree_lookup32_array(nbd_info->unacked_pdus, hkey);
@ -272,13 +274,13 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
hkey[0].length=1;
hkey[0].key=&nbd_trans->rep_frame;
hkey[1].length=2;
hkey[1].key=(guint32 *)&handle;
hkey[1].key=handle;
hkey[2].length=0;
se_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
hkey[0].length=1;
hkey[0].key=&nbd_trans->req_frame;
hkey[1].length=2;
hkey[1].key=(guint32 *)&handle;
hkey[1].key=handle;
hkey[2].length=0;
se_tree_insert32_array(nbd_info->acked_pdus, hkey, (void *)nbd_trans);
}
@ -288,7 +290,7 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
hkey[0].length=1;
hkey[0].key=&packet;
hkey[1].length=2;
hkey[1].key=(guint32 *)&handle;
hkey[1].key=handle;
hkey[2].length=0;
nbd_trans=se_tree_lookup32_array(nbd_info->acked_pdus, hkey);
@ -343,7 +345,6 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
proto_tree_add_item(tree, hf_nbd_type, tvb, offset, 4, FALSE);
offset+=4;
handle=tvb_get_ntoh64(tvb, offset);
proto_tree_add_item(tree, hf_nbd_handle, tvb, offset, 8, FALSE);
offset+=8;
@ -380,7 +381,6 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
proto_tree_add_item(tree, hf_nbd_error, tvb, offset, 4, FALSE);
offset+=4;
handle=tvb_get_ntoh64(tvb, offset);
proto_tree_add_item(tree, hf_nbd_handle, tvb, offset, 8, FALSE);
offset+=8;
@ -401,7 +401,6 @@ static gboolean
dissect_nbd_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint32 magic, type;
guint64 handle, from;
/* We need at least this much to tell whether this is NBD or not */
if(tvb_length(tvb)<4){
@ -426,9 +425,6 @@ dissect_nbd_tcp_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
default:
return FALSE;
}
handle=tvb_get_ntoh64(tvb, 8);
from=tvb_get_ntoh64(tvb, 16);
tcp_dissect_pdus(tvb, pinfo, tree, nbd_desegment, 28, get_nbd_tcp_pdu_len, dissect_nbd_tcp_pdu);
return TRUE;

View File

@ -873,12 +873,13 @@ static void
dissect_osd_partition_id(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tree *tree, int hf_index, scsi_osd_lun_info_t *lun_info, gboolean is_created, gboolean is_removed)
{
proto_item *item=NULL;
guint64 partition_id;
guint32 partition_id[2];
/* partition id */
item=proto_tree_add_item(tree, hf_index, tvb, offset, 8, 0);
partition_id=tvb_get_ntoh64(tvb, offset);
if(!partition_id){
partition_id[0]=tvb_get_ntohl(tvb, offset);
partition_id[1]=tvb_get_ntohl(tvb, offset+4);
if(!partition_id[0] && !partition_id[1]){
proto_item_append_text(item, " (ROOT partition)");
} else {
partition_info_t *part_info;
@ -886,7 +887,7 @@ dissect_osd_partition_id(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tr
proto_tree *partition_tree=NULL;
pikey[0].length=2;
pikey[0].key=(guint32 *)&partition_id;
pikey[0].key=partition_id;
pikey[1].length=0;
part_info=se_tree_lookup32_array(lun_info->partitions, &pikey[0]);
if(!part_info){
@ -895,7 +896,7 @@ dissect_osd_partition_id(packet_info *pinfo, tvbuff_t *tvb, int offset, proto_tr
part_info->removed_in=0;
pikey[0].length=2;
pikey[0].key=(guint32 *)&partition_id;
pikey[0].key=partition_id;
pikey[1].length=0;
se_tree_insert32_array(lun_info->partitions, &pikey[0], part_info);
}