aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nbd.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-10-31 21:13:46 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2006-10-31 21:13:46 +0000
commit5f43f5b2151aa3abef067ab994801a044f79c94a (patch)
tree7661791a138ee58ed650b19c5672fd27fa20c7da /epan/dissectors/packet-nbd.c
parent9d8811e5397999da60be1622604eb4e4d40bf676 (diff)
prettify the info column and add a generated item for the type (read/write) to response packets
svn path=/trunk/; revision=19758
Diffstat (limited to 'epan/dissectors/packet-nbd.c')
-rw-r--r--epan/dissectors/packet-nbd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-nbd.c b/epan/dissectors/packet-nbd.c
index aaa91d9e2e..6bcf651e15 100644
--- a/epan/dissectors/packet-nbd.c
+++ b/epan/dissectors/packet-nbd.c
@@ -356,7 +356,7 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
offset+=4;
if(check_col(pinfo->cinfo, COL_INFO)){
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s 0x%"PRIx64" %d", val_to_str(nbd_trans->type, nbd_type_vals, "unknown:%x"), from, nbd_trans->datalen);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Request Offset:0x%"PRIx64" Length:%d", (nbd_trans->type==NBD_CMD_WRITE)?"Write":"Read", from, nbd_trans->datalen);
}
if(nbd_trans->type==NBD_CMD_WRITE){
@@ -364,6 +364,9 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
}
break;
case NBD_RESPONSE_MAGIC:
+ item=proto_tree_add_uint(tree, hf_nbd_type, tvb, 0, 0, nbd_trans->type);
+ PROTO_ITEM_SET_GENERATED(item);
+
error=tvb_get_ntohl(tvb, offset);
proto_tree_add_item(tree, hf_nbd_error, tvb, offset, 4, FALSE);
offset+=4;
@@ -373,7 +376,7 @@ dissect_nbd_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
offset+=8;
if(check_col(pinfo->cinfo, COL_INFO)){
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s Error:%d", val_to_str(nbd_trans->type, nbd_type_vals, "unknown:%x"), error);
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Response Error:%d", (nbd_trans->type==NBD_CMD_WRITE)?"Write":"Read", error);
}
if(nbd_trans->type==NBD_CMD_READ){