diff options
author | Uri Simchoni <urisimchoni@gmail.com> | 2016-09-01 23:52:40 +0300 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-09-03 06:43:50 +0000 |
commit | dae5f88339015f061428f3dbdf8936ee1b259e26 (patch) | |
tree | 69d7f042de236e92cfa737d8cc169c46280a5944 /epan/dissectors/packet-smb.c | |
parent | 5846524f0ba9389e3f4f03546db21782c2d22183 (diff) |
SMB: dissect FILE_GET_QUOTA_INFORMATION
Add a function that dissects FILE_GET_QUOTA_INFORMATION
structure ([MS-FSCC] 2.4.33.1)
This structure is used to define a set of SIDs whose quota
is to be fetched.
Change-Id: I81f6bca98fb239935ca593bd8725cebbb2037fbe
Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-on: https://code.wireshark.org/review/17445
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-smb.c')
-rw-r--r-- | epan/dissectors/packet-smb.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index 076992cfc9..dae5abfd09 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -8312,6 +8312,40 @@ dissect_nt_user_quota(tvbuff_t *tvb, proto_tree *tree, int offset, guint16 *bcp) } +int +dissect_nt_get_user_quota(tvbuff_t *tvb, proto_tree *tree, int offset, guint32 *bcp) +{ + int old_offset, old_sid_offset; + guint32 qsize; + + do { + old_offset = offset; + + CHECK_BYTE_COUNT_TRANS_SUBR(4); + qsize = tvb_get_letohl(tvb, offset); + proto_tree_add_uint(tree, hf_smb_user_quota_offset, tvb, offset, 4, qsize); + COUNT_BYTES_TRANS_SUBR(4); + + CHECK_BYTE_COUNT_TRANS_SUBR(4); + /* length of SID */ + proto_tree_add_item(tree, hf_smb_length_of_sid, tvb, offset, 4, ENC_LITTLE_ENDIAN); + COUNT_BYTES_TRANS_SUBR(4); + + /* SID of the user */ + old_sid_offset = offset; + offset = dissect_nt_sid(tvb, offset, tree, "SID", NULL, -1); + *bcp -= (offset-old_sid_offset); + + if (qsize) { + offset = old_offset+qsize; + } + }while (qsize); + + + return offset; +} + + static int dissect_nt_trans_data_request(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *parent_tree, int bc, nt_trans_data *ntd, smb_nt_transact_info_t *nti, smb_info_t *si) { |