[pnfs] layoutget patch for draft18

J. Bruce Fields bfields at fieldses.org
Fri Feb 1 18:50:38 EST 2008


On Wed, Jan 30, 2008 at 06:15:03PM +0100, Tigran Mkrtchyan wrote:
> 
> 
> Hi Bruce,
> 
> here two patches which fixing wireshark decoding of layoutget for
> draft-18. It's against repository:
> 
> git://linux-nfs.org/~bfields/wireshark.git
> 
> get devicelist/info still broken, but I will fix them as well.
> Let me know if repository moved and I am fixing outdated code.

It is a little outdated, but that's fine, I'll update and let you know
if there's a problem applying your patches.

I've been neglecting wireshark, and don't have the time to take care of
this now.  If I haven't by early next week, would you mind reminding me?

--b.

> 
> 
> Regards,
> 	Tigran.
> 
> ________________________________________________________________________
> Tigran Mkrtchyan                               DESY, IT,
> tigran.mkrtchyan at desy.de                       Notkestrasse 85,
> Tel: + 49 40 89983946                          Hamburg 22607,
> Fax: + 49 40 89984429                          Germany.

> >From 195201efc6ea5970379e320fab69ce90376a4958 Mon Sep 17 00:00:00 2001
> From: Tigran Mkrtchyan <tigran.mkrtchyan at desy.de>
> Date: Wed, 30 Jan 2008 11:57:36 +0100
> Subject: [PATCH 1/2] fixed layout get decoding:
> added missing stateid
> added missing layout count
> ---
>  epan/dissectors/packet-nfs.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
> index 41e5a2c..2e95b5d 100644
> --- a/epan/dissectors/packet-nfs.c
> +++ b/epan/dissectors/packet-nfs.c
> @@ -351,6 +351,7 @@ static int hf_nfs_r_addr = -1;
>  static int hf_nfs_length4_minlength = -1;
>  static int hf_nfs_layouttype4 = -1;
>  static int hf_nfs_layoutreturn_type4 = -1;
> +static int hf_nfs_layout_count = -1;
>  static int hf_nfs_iomode4 = -1;
>  static int hf_nfs_stripetype4 = -1;
>  static int hf_nfs_mdscommit4 = -1;
> @@ -8594,6 +8595,8 @@ dissect_nfs_resop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
>  		case NFS4_OP_LAYOUTGET:
>  			offset = dissect_rpc_bool(tvb, newftree, hf_nfs_return_on_close4,
>  									  offset);
> +			offset = dissect_nfs_stateid4(tvb, offset, newftree);
> +			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_layout_count, offset);
>  			offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_offset4, offset);
>  			offset = dissect_rpc_uint64(tvb, newftree, hf_nfs_length4, offset);
>  			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_iomode4, offset);
> @@ -10069,6 +10072,10 @@ proto_register_nfs(void)
>  			"layout", "nfs.layout", FT_BYTES, BASE_DEC,
>  			NULL, 0, "layout", HFILL }},
>  
> +        { &hf_nfs_layout_count, {
> +            "layout", "nfs.layoutcount", FT_UINT32, BASE_DEC,
> +            NULL, 0, "layout count", HFILL }},
> +
>  		{ &hf_nfs_stripedevs4, {
>  			"stripe devs", "nfs.stripedevs", FT_UINT32, BASE_DEC,
>  			NULL, 0, "stripe devs", HFILL }},
> -- 
> 1.5.2.4
> 

> >From d4782913952e863d5d5b2f58904b968cad41e48d Mon Sep 17 00:00:00 2001
> From: Tigran Mkrtchyan <tigran.mkrtchyan at desy.de>
> Date: Wed, 30 Jan 2008 15:35:30 +0100
> Subject: [PATCH 2/2] fixed layoutget layout decoding:
> added missing nfl_pattern_offset
> ---
>  epan/dissectors/packet-nfs.c |   24 +++++++++++++++++++-----
>  1 files changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
> index 2e95b5d..10f359e 100644
> --- a/epan/dissectors/packet-nfs.c
> +++ b/epan/dissectors/packet-nfs.c
> @@ -404,6 +404,7 @@ static int hf_nfs_create_session_flags4 = -1;
>  static int hf_nfs_cachethis4 = -1;
>  static int hf_nfs_util4 = -1;
>  static int hf_nfs_first_stripe_idx4 = -1;
> +static int hf_nfs_pattern_offset = -1;
>  
>  /* Hidden field for v2, v3, and v4 status */
>  int hf_nfs_nfsstat = -1;
> @@ -7762,7 +7763,10 @@ dissect_nfs_devicelist4(tvbuff_t *tvb, int offset, proto_tree *tree)
>  	offset = dissect_rpc_uint32(tvb, tree, hf_nfs_devicenum4, offset);
>  	for (i = 0; i < count; i++) {
>  		int opaque_devs, dev_limit;
> -		offset = dissect_rpc_uint32(tvb, tree, hf_nfs_deviceid4, offset);
> +        offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL,
> +                                             hf_nfs_deviceid4, TRUE, 16,
> +                                             FALSE, NULL, NULL);
> +
>  
>  		offset = dissect_rpc_uint32(tvb, tree, hf_nfs_layouttype4, offset);
>  
> @@ -7910,9 +7914,13 @@ dissect_nfs_layout(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tr
>  		guint num;
>  		guint i;
>  		offset += 4; /* Skip past opaque count */
> -		offset = dissect_rpc_uint32(tvb, tree, hf_nfs_deviceid4, offset);
> +        offset = dissect_rpc_opaque_data(tvb, offset, tree, NULL,
> +                                             hf_nfs_deviceid4, TRUE, 16,
> +                                             FALSE, NULL, NULL);
> +
>  		offset = dissect_rpc_uint32(tvb, tree, hf_nfs_util4, offset);
>  		offset = dissect_rpc_uint32(tvb, tree, hf_nfs_first_stripe_idx4, offset);
> +		offset = dissect_rpc_uint64(tvb, tree, hf_nfs_pattern_offset, offset);
>  
>  		num = tvb_get_ntohl(tvb, offset); /* Len of dev list */
>  		offset += 4;
> @@ -8285,8 +8293,10 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo,
>  			break;
>  
>  		case NFS4_OP_GETDEVINFO:
> -			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_deviceid4,
> -										offset);
> +            offset = dissect_rpc_opaque_data(tvb, offset, newftree, NULL,
> +                                             hf_nfs_deviceid4, TRUE, 16,
> +                                             FALSE, NULL, NULL);
> +
>  			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_layouttype4,
>  										offset);
>  			offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_count4_maxcount,
> @@ -10032,6 +10042,10 @@ proto_register_nfs(void)
>  			"first stripe index", "nfs.stripeindex", FT_UINT32, BASE_DEC,
>  			NULL, 0, "first stripe index", HFILL }},
>  
> +        { &hf_nfs_pattern_offset, {
> +            "first stripe index", "nfs.patternoffset", FT_UINT64, BASE_DEC,
> +            NULL, 0, "layout pattern offset", HFILL }},
> +
>  		{ &hf_nfs_newtime4, {
>  			"new time?", "nfs.newtime", FT_BOOLEAN,
>  			BASE_NONE, &yesno, 0, "nfs.newtime", HFILL }},
> @@ -10057,7 +10071,7 @@ proto_register_nfs(void)
>  			NULL, 0, "layout update", HFILL }},
>  
>  		{ &hf_nfs_deviceid4, {
> -			"device ID", "nfs.deviceid", FT_UINT32, BASE_DEC,
> +			"device ID", "nfs.deviceid", FT_BYTES, BASE_HEX,
>  			NULL, 0, "device ID", HFILL }},
>  
>  		{ &hf_nfs_devicenum4, {
> -- 
> 1.5.2.4
> 



More information about the pNFS mailing list