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>
This commit is contained in:
Uri Simchoni 2016-09-01 23:52:40 +03:00 committed by Anders Broman
parent 5846524f0b
commit dae5f88339
2 changed files with 35 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);