diff options
-rw-r--r-- | epan/dissectors/packet-smb.c | 34 | ||||
-rw-r--r-- | epan/dissectors/packet-smb.h | 1 |
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); |