diff options
author | Michael Mann <mmann78@netscape.net> | 2014-06-26 22:51:11 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-06-28 12:05:43 +0000 |
commit | 7bf6862ecf0d0a508bf097f3b52d07bd19128272 (patch) | |
tree | 08dfcfd08ae0ba90383451f2a2f1d321aba7cb23 /epan/dissectors/packet-hclnfsd.c | |
parent | 929afd23a77b27b28fe3ca17cb063725467d387a (diff) |
convert to proto_tree_add_subtree[_format]
Change-Id: Ia7014003a3cff5181295172978d6c613c3b83b0b
Reviewed-on: https://code.wireshark.org/review/2676
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-hclnfsd.c')
-rw-r--r-- | epan/dissectors/packet-hclnfsd.c | 48 |
1 files changed, 18 insertions, 30 deletions
diff --git a/epan/dissectors/packet-hclnfsd.c b/epan/dissectors/packet-hclnfsd.c index b5052791cb..f03a504b8b 100644 --- a/epan/dissectors/packet-hclnfsd.c +++ b/epan/dissectors/packet-hclnfsd.c @@ -205,51 +205,39 @@ dissect_hclnfsd_authorize_call(tvbuff_t *tvb, int offset, packet_info *pinfo _U_ offset += 4; request_type = tvb_get_ntohl(tvb, offset); - if (tree) - proto_tree_add_uint(tree, hf_hclnfsd_request_type, tvb, offset, + proto_tree_add_uint(tree, hf_hclnfsd_request_type, tvb, offset, 4, request_type); offset += 4; offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_device, offset, NULL); - if (tree) + ident_tree = proto_tree_add_subtree(tree, tvb, offset, -1, + ett_hclnfsd_auth_ident, &ident_item, "Authentication Ident"); + + if (ident_tree) { - ident_item = proto_tree_add_text(tree, tvb, offset, -1, - "Authentication Ident"); + newoffset = dissect_rpc_string(tvb, ident_tree, + hf_hclnfsd_auth_ident_obscure, offset, &ident); - if (ident_item) + if (ident) { - ident_tree = proto_item_add_subtree(ident_item, - ett_hclnfsd_auth_ident); - - if (ident_tree) - { - newoffset = dissect_rpc_string(tvb, ident_tree, - hf_hclnfsd_auth_ident_obscure, offset, &ident); - - if (ident) - { - ident_len = (int)strlen(ident); - - proto_item_set_len(ident_item, ident_len); + ident_len = (int)strlen(ident); - ident_decoded = hclnfsd_decode_obscure(ident, ident_len); + proto_item_set_len(ident_item, ident_len); - username = ident_decoded + 2; - password = username + strlen(username) + 1; + ident_decoded = hclnfsd_decode_obscure(ident, ident_len); - proto_tree_add_text(ident_tree, tvb, offset, ident_len, - "Username: %s", username); + username = ident_decoded + 2; + password = username + strlen(username) + 1; - proto_tree_add_text(ident_tree, tvb, offset, ident_len, - "Password: %s", password); + proto_tree_add_text(ident_tree, tvb, offset, ident_len, + "Username: %s", username); - offset = newoffset; + proto_tree_add_text(ident_tree, tvb, offset, ident_len, + "Password: %s", password); - ident = NULL; - } - } + offset = newoffset; } } |