2003-04-12 03:32:00 +04:00
/*
Unix SMB / CIFS implementation .
NT QUOTA code constants
Copyright ( C ) Stefan ( metze ) Metzmacher 2003
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-09 23:25:36 +04:00
the Free Software Foundation ; either version 3 of the License , or
2003-04-12 03:32:00 +04:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 04:52:41 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2003-04-12 03:32:00 +04:00
*/
# ifndef _NTQUOTAS_H
# define _NTQUOTAS_H
/*
* details for Quota Flags :
*
* 0x20 Log Limit : log if the user exceeds his Hard Quota
* 0x10 Log Warn : log if the user exceeds his Soft Quota
* 0x02 Deny Disk : deny disk access when the user exceeds his Hard Quota
* 0x01 Enable Quotas : enable quota for this fs
*
*/
# define QUOTAS_ENABLED 0x0001
# define QUOTAS_DENY_DISK 0x0002
# define QUOTAS_LOG_VIOLATIONS 0x0004
# define CONTENT_INDEX_DISABLED 0x0008
# define QUOTAS_LOG_THRESHOLD 0x0010
# define QUOTAS_LOG_LIMIT 0x0020
# define LOG_VOLUME_THRESHOLD 0x0040
# define LOG_VOLUME_LIMIT 0x0080
# define QUOTAS_INCOMPLETE 0x0100
# define QUOTAS_REBUILDING 0x0200
# define QUOTAS_0400 0x0400
# define QUOTAS_0800 0x0800
# define QUOTAS_1000 0x1000
# define QUOTAS_2000 0x2000
# define QUOTAS_4000 0x4000
# define QUOTAS_8000 0x8000
2008-10-14 03:59:36 +04:00
# define SMB_NTQUOTAS_NO_LIMIT ((uint64_t)(-1))
# define SMB_NTQUOTAS_NO_ENTRY ((uint64_t)(-2))
# define SMB_NTQUOTAS_NO_SPACE ((uint64_t)(0))
# define SMB_NTQUOTAS_1_B (uint64_t)0x0000000000000001
# define SMB_NTQUOTAS_1KB (uint64_t)0x0000000000000400
# define SMB_NTQUOTAS_1MB (uint64_t)0x0000000000100000
# define SMB_NTQUOTAS_1GB (uint64_t)0x0000000040000000
# define SMB_NTQUOTAS_1TB (uint64_t)0x0000010000000000
# define SMB_NTQUOTAS_1PB (uint64_t)0x0004000000000000
# define SMB_NTQUOTAS_1EB (uint64_t)0x1000000000000000
2003-04-12 03:32:00 +04:00
enum SMB_QUOTA_TYPE {
SMB_INVALID_QUOTA_TYPE = - 1 ,
SMB_USER_FS_QUOTA_TYPE = 1 ,
SMB_USER_QUOTA_TYPE = 2 ,
SMB_GROUP_FS_QUOTA_TYPE = 3 , /* not used yet */
2016-01-06 14:30:59 +03:00
SMB_GROUP_QUOTA_TYPE = 4 /* used by disk_free queries */
2003-04-12 03:32:00 +04:00
} ;
typedef struct _SMB_NTQUOTA_STRUCT {
enum SMB_QUOTA_TYPE qtype ;
2008-10-14 03:59:36 +04:00
uint64_t usedspace ;
uint64_t softlim ;
uint64_t hardlim ;
2015-05-01 06:16:18 +03:00
uint32_t qflags ;
2010-05-21 05:25:01 +04:00
struct dom_sid sid ;
2003-04-12 03:32:00 +04:00
} SMB_NTQUOTA_STRUCT ;
typedef struct _SMB_NTQUOTA_LIST {
struct _SMB_NTQUOTA_LIST * prev , * next ;
TALLOC_CTX * mem_ctx ;
uid_t uid ;
SMB_NTQUOTA_STRUCT * quotas ;
} SMB_NTQUOTA_LIST ;
typedef struct _SMB_NTQUOTA_HANDLE {
2007-10-19 04:40:25 +04:00
bool valid ;
2003-04-12 03:32:00 +04:00
SMB_NTQUOTA_LIST * quota_list ;
SMB_NTQUOTA_LIST * tmp_list ;
} SMB_NTQUOTA_HANDLE ;
# endif /*_NTQUOTAS_H */