aboutsummaryrefslogtreecommitdiffstats
path: root/packet-tftp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-11-03 02:25:26 +0000
committerGuy Harris <guy@alum.mit.edu>2001-11-03 02:25:26 +0000
commit7adba9a67284bf46ed01e1d8916b0136d39d63da (patch)
tree396a4e35328865889e6b293cb5fdda207a1ad723 /packet-tftp.c
parent2e0d08317210345b5af1264dc56bb1adbd145fee (diff)
Put the error code into the Info column symbolically, if possible.
Put the error message string into the Info column as well. svn path=/trunk/; revision=4134
Diffstat (limited to 'packet-tftp.c')
-rw-r--r--packet-tftp.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/packet-tftp.c b/packet-tftp.c
index 6cc90fec1d..8f3e716901 100644
--- a/packet-tftp.c
+++ b/packet-tftp.c
@@ -5,7 +5,7 @@
* Craig Newell <CraigN@cheque.uq.edu.au>
* RFC2347 TFTP Option Extension
*
- * $Id: packet-tftp.c,v 1.29 2001/11/03 02:19:10 guy Exp $
+ * $Id: packet-tftp.c,v 1.30 2001/11/03 02:25:26 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -97,6 +97,7 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint offset = 0;
guint16 opcode;
u_int i1;
+ guint16 error;
CHECK_DISPLAY_AS_DATA(proto_tftp, tvb, pinfo, tree);
@@ -238,21 +239,26 @@ dissect_tftp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
case TFTP_ERROR:
+ error = tvb_get_ntohs(tvb, offset);
if (tree) {
- proto_tree_add_item(tftp_tree, hf_tftp_error_code, tvb, offset, 2,
- FALSE);
+ proto_tree_add_uint(tftp_tree, hf_tftp_error_code, tvb, offset, 2,
+ error);
}
if (check_col(pinfo->fd, COL_INFO)) {
- col_append_fstr(pinfo->fd, COL_INFO, ", Code: %i",
- tvb_get_ntohs(tvb, offset));
+ col_append_fstr(pinfo->fd, COL_INFO, ", Code: %s",
+ val_to_str(error, tftp_error_code_vals, "Unknown (%u)"));
}
offset += 2;
+ i1 = tvb_strsize(tvb, offset);
if (tree) {
- i1 = tvb_strsize(tvb, offset);
proto_tree_add_item(tftp_tree, hf_tftp_error_string, tvb, offset,
i1, FALSE);
}
+ if (check_col(pinfo->fd, COL_INFO)) {
+ col_append_fstr(pinfo->fd, COL_INFO, ", Message: %s",
+ tvb_get_ptr(tvb, offset, i1));
+ }
break;
case TFTP_OACK: