aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorUri Simchoni <urisimchoni@gmail.com>2016-09-01 23:52:40 +0300
committerAnders Broman <a.broman58@gmail.com>2016-09-03 06:43:50 +0000
commitdae5f88339015f061428f3dbdf8936ee1b259e26 (patch)
tree69d7f042de236e92cfa737d8cc169c46280a5944 /epan/dissectors
parent5846524f0ba9389e3f4f03546db21782c2d22183 (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')
-rw-r--r--epan/dissectors/packet-smb.c34
-rw-r--r--epan/dissectors/packet-smb.h1
2 files changed, 35 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)
{
diff --git a/epan/dissectors/packet-smb.h b/epan/dissectors/packet-smb.h
index 146065503c..7616582d61 100644
--- a/epan/dissectors/packet-smb.h
+++ b/epan/dissectors/packet-smb.h
@@ -363,6 +363,7 @@ extern int dissect_qfsi_FS_DEVICE_INFO(tvbuff_t * tvb, packet_info * pinfo, prot
extern int dissect_qfsi_FS_ATTRIBUTE_INFO(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int offset, guint16 *bcp, int unicode);
extern int dissect_nt_quota(tvbuff_t *tvb, proto_tree *tree, int offset, guint16 *bcp);
extern int dissect_nt_user_quota(tvbuff_t *tvb, proto_tree *tree, int offset, guint16 *bcp);
+extern int dissect_nt_get_user_quota(tvbuff_t *tvb, proto_tree *tree, int offset, guint32 *bcp);
extern int dissect_qfsi_FS_OBJECTID_INFO(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int offset, guint16 *bcp);
extern int dissect_qfsi_FS_FULL_SIZE_INFO(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int offset, guint16 *bcp);
extern int dissect_qfi_SMB_FILE_EA_INFO(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint16 *bcp, gboolean *trunc);