Ethereal-dev: [Ethereal-dev] [patch] The real packet-hclnfsd.c patch...

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

From: Mike Frisch <mfrisch@xxxxxxxxxx>
Date: Mon, 1 Apr 2002 17:20:28 -0500
Please disregard the last one, I am new...

Mike.
Index: packet-hclnfsd.c
===================================================================
RCS file: /cvsroot/ethereal/packet-hclnfsd.c,v
retrieving revision 1.8
diff -r1.8 packet-hclnfsd.c
77a78
> static int hf_hclnfsd_auth_ident_obscure = -1;
86c87
< 
---
> static gint ett_hclnfsd_auth_ident = -1;
151a153,166
> void
> hclnfsd_decode_obscure(char *ident, int ident_len)
> {
> 	int j, x, y;
> 
> 	for (x = -1, j = 0; j < ident_len; j++)
> 	{
> 		y = *ident;
> 		x ^= *ident;
> 		*ident++ = x;
> 		x = y;
> 	}
> }
> 
157a173,180
> 	char *ident = NULL;
> 	char *username = NULL;
> 	char *password = NULL;
> 	int ident_len = 0;
> 	int newoffset;
> 	char *p;
> 	proto_item *ident_item = NULL;
> 	proto_tree *ident_tree = NULL;
160c183,186
< 	ip=((ip&0x000000ff)<<24)|((ip&0x0000ff00)<<8)|((ip&0x00ff0000)>>8)|((ip&0xff000000)>>24);
---
> 	ip = ((ip & 0x000000ff) << 24) | 
> 		((ip & 0x0000ff00) << 8) | 
> 		((ip & 0x00ff0000) >> 8) | 
> 		((ip & 0xff000000) >> 24);
170c196,220
< 	offset = dissect_rpc_string(tvb, pinfo, tree, hf_hclnfsd_device, offset, NULL);
---
> 	offset = dissect_rpc_string(tvb, pinfo, tree, hf_hclnfsd_device, offset, 
> 		NULL);
> 
> 	if (tree)
> 	{
> 		ident_item = proto_tree_add_text(tree, tvb, offset, -1,
> 			"Authentication Ident");
> 
> 		if (ident_item)
> 		{
> 			ident_tree = proto_item_add_subtree(ident_item,
> 				ett_hclnfsd_auth_ident);
> 
> 			if (ident_tree)
> 			{
> 				newoffset = dissect_rpc_string(tvb, pinfo, ident_tree,
> 					hf_hclnfsd_auth_ident_obscure, offset, &ident);
> 
> 				proto_item_set_len(ident_item, newoffset - offset);
> 
> 				if (ident)
> 				{
> 					ident_len = newoffset - offset;
> 
> 					hclnfsd_decode_obscure(ident, ident_len);
172c222,238
< 	offset = dissect_rpc_string(tvb, pinfo, tree, hf_hclnfsd_login, offset, NULL);
---
> 					username = ident + 2;
> 					password = username + strlen(username) + 1;
> 
> 					proto_tree_add_text(ident_tree, tvb, offset, ident_len,
> 						"Username: %s", username);
> 
> 					proto_tree_add_text(ident_tree, tvb, offset, ident_len,
> 						"Password: %s", password);
> 
> 					offset = newoffset;
> 
> 					g_free(ident);
> 					ident = NULL;
> 				}
> 			}
> 		}
> 	}
232,254c298,299
< 	guint32 ngrpnames, ngrpnames_i;
< 	proto_tree *grptree = NULL;
< 	proto_item *grpitem = NULL;
< 
< 	ngrpnames = tvb_get_ntohl(tvb, offset);
< 	if (tree)
< 	{
< 		grpitem = proto_tree_add_text(tree, tvb, offset, 4, "Groups: %d",
< 			ngrpnames);
< 
< 		if (grpitem)
< 			grptree = proto_item_add_subtree(grpitem, ett_hclnfsd_groups);
< 	}
< 	offset += 4;
< 
< 	if (!grptree)
< 		return offset;
< 
< 	for (ngrpnames_i = 0; ngrpnames_i < ngrpnames ; ngrpnames_i++)
< 		offset = dissect_rpc_string(tvb, pinfo, grptree, 
< 			hf_hclnfsd_grpname, offset, NULL);
< 	
< 	return offset;
---
> 	return dissect_rpc_string(tvb, pinfo, tree, hf_hclnfsd_grpname, offset, 
> 		NULL);
659,663d703
< #if 0
< 	static struct true_false_string okfailed = { "Ok", "Failed" };
< 	static struct true_false_string yesno = { "Yes", "No" };
< #endif
< 		
799a840,843
> 
> 		{ &hf_hclnfsd_auth_ident_obscure, {
> 			"Obscure Ident", "hclnfsd.authorize.ident.obscure", FT_STRING,
> 			BASE_DEC	, NULL, 0, "Authentication Obscure Ident", HFILL }},
808a853
> 		&ett_hclnfsd_auth_ident