aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nbd.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-10-31 21:13:46 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2006-10-31 21:13:46 +0000
commit848ee45605a7e43e3a7fe30606bdb88c1f46985f (patch)
tree7661791a138ee58ed650b19c5672fd27fa20c7da /epan/dissectors/packet-nbd.c
parent171b9ad819c59562e924a728ed70d5536cdb8d2c (diff)
prettify the info column and add a generated item for the type (read/write) to response packets
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19758 f5534014-38df-0310-8fa8-9805f1628bb7
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){