diff options
author | Hassan Sultan <sultah@amazon.com> | 2017-07-27 11:43:48 -0700 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2017-08-01 18:04:05 +0000 |
commit | eeab5f48fe6da19f1519149a5ea57b1ab7466e0d (patch) | |
tree | a960864ef2666de35899a497ba11dfda86ea3ae8 /epan | |
parent | 81b8d014567c7957da86e820c2b61fe003aca3b3 (diff) |
SMB2: Move the blob offset & length fields
from under the security blob since they're physically placed before the blob.
Also renamed them to clarify their link to the blob
Change-Id: I896ce8eea3f5f41c1887a685247e7fa168cc9061
Reviewed-on: https://code.wireshark.org/review/22823
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-smb2.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index 0f453b10a7..a13ebc2ac0 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -1472,36 +1472,36 @@ dissect_smb2_olb_buffer(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t *t return; } - /* if we don't want/need a subtree */ - if (olb->hfindex == -1) { - sub_item = parent_tree; - sub_tree = parent_tree; - } else { - if (parent_tree) { - sub_item = proto_tree_add_item(parent_tree, olb->hfindex, tvb, offset, len, ENC_NA); - sub_tree = proto_item_add_subtree(sub_item, ett_smb2_olb); - } - } - switch (olb->offset_size) { case OLB_O_UINT16_S_UINT16: - proto_tree_add_item(sub_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(sub_tree, hf_smb2_olb_length, tvb, olb->len_offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_length, tvb, olb->len_offset, 2, ENC_LITTLE_ENDIAN); break; case OLB_O_UINT16_S_UINT32: - proto_tree_add_item(sub_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(sub_tree, hf_smb2_olb_length, tvb, olb->len_offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_length, tvb, olb->len_offset, 4, ENC_LITTLE_ENDIAN); break; case OLB_O_UINT32_S_UINT32: - proto_tree_add_item(sub_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(sub_tree, hf_smb2_olb_length, tvb, olb->len_offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_length, tvb, olb->len_offset, 4, ENC_LITTLE_ENDIAN); break; case OLB_S_UINT32_O_UINT32: - proto_tree_add_item(sub_tree, hf_smb2_olb_length, tvb, olb->len_offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(sub_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_length, tvb, olb->len_offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(parent_tree, hf_smb2_olb_offset, tvb, olb->off_offset, 4, ENC_LITTLE_ENDIAN); break; } + /* if we don't want/need a subtree */ + if (olb->hfindex == -1) { + sub_item = parent_tree; + sub_tree = parent_tree; + } else { + if (parent_tree) { + sub_item = proto_tree_add_item(parent_tree, olb->hfindex, tvb, offset, len, ENC_NA); + sub_tree = proto_item_add_subtree(sub_item, ett_smb2_olb); + } + } + if (off == 0 || len == 0) { proto_item_append_text(sub_item, ": NO DATA"); return; @@ -10374,12 +10374,12 @@ proto_register_smb2(void) }, { &hf_smb2_olb_length, - { "Length", "smb2.olb.length", FT_UINT32, BASE_DEC, + { "Blob Length", "smb2.olb.length", FT_UINT32, BASE_DEC, NULL, 0, "Length of the buffer", HFILL } }, { &hf_smb2_olb_offset, - { "Offset", "smb2.olb.offset", FT_UINT32, BASE_HEX, + { "Blob Offset", "smb2.olb.offset", FT_UINT32, BASE_HEX, NULL, 0, "Offset to the buffer", HFILL } }, |