Ethereal-dev: [Ethereal-dev] [patch] packet-dsi.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: didier <dgautheron@xxxxxxxx>
Date: Sun, 14 Apr 2002 18:39:27 +0000
Hi
I'm playing with an afp dissector (Apple filing protocol). 
For dsi, from the spec dsi.code type is not obvious. In netatalk it's
unsigned, but offset is < 2Gig (I thing it's always 12) and afp error
codes are signed numbers.
This patch changes dsi.code to a decimal signed number.

Didier
Index: packet-dsi.c
===================================================================
RCS file: /cvsroot/ethereal/packet-dsi.c,v
retrieving revision 1.9
diff -u -r1.9 packet-dsi.c
--- packet-dsi.c	2002/01/24 09:20:47	1.9
+++ packet-dsi.c	2002/04/14 18:29:14
@@ -117,7 +117,7 @@
 	int	state;
 	guint8	flags,command;
 	guint16	requestid;
-	guint32	code;
+	gint32	code;
 	guint32	length;		/* total length of this DSI request/reply */
 	guint32	reserved;
 	guint32	seen;		/* bytes seen so far */
@@ -304,12 +304,12 @@
 	gboolean	prev_cont;	/* TRUE if a previously known
 					* continuation packet */
 	char		cont_str[256];
-
+	
 	gchar	*flag_str;
 	gchar	*func_str;
 	guint8	dsi_flags,dsi_command;
 	guint16 dsi_requestid;
-	guint32 dsi_code;
+	gint32 	dsi_code;
 	guint32 dsi_length;
 	guint32 dsi_reserved;
  
@@ -395,7 +395,7 @@
 				offset+1, 1, dsi_command);
 			proto_tree_add_uint(dsi_tree, hf_dsi_requestid, tvb,
 				offset+2, 2, dsi_requestid);
-			proto_tree_add_uint(dsi_tree, hf_dsi_code, tvb,
+			proto_tree_add_int(dsi_tree, hf_dsi_code, tvb,
 				offset+4, 4, dsi_code);
 			proto_tree_add_uint_format(dsi_tree, hf_dsi_length, tvb,
 				offset+8, 4, dsi_length,
@@ -461,7 +461,7 @@
 
     { &hf_dsi_code,
       { "Code",           "dsi.code",
-	FT_UINT32, BASE_HEX, NULL, 0x0,
+	FT_INT32, BASE_DEC, NULL, 0x0,
       	"In Reply packets this is an error code.  In Request Write packets this is a data offset.", HFILL }},
 
     { &hf_dsi_length,