1#ifndef _CONSTANT_H_
2#define _CONSTANT_H_
3
4#define	LINE_SIZE				256
5
6#define	FSH_MaxUser				100
7#define	FSH_MaxGroup			100
8#define	FSH_MaxShare			100
9
10#define	FSH_MaxUserLen			20
11#define	FSH_MaxShareLen			12
12#define	FSH_MaxGroupLen			20
13#define	FSH_MaxCommentLen		48
14#define	FSH_MaxDirLen			256
15#define	FSH_MaxPassLen			15
16#define	FSH_MaxIPLen			16
17#define	FSH_MaxWorkGroupLen		16
18#define	FSH_MaxZoneLen			32
19#define	FSH_MaxPrinterLen		12
20#define	FSH_MaxEnableLen		4			//"yes","no"
21#define	FSH_DefaultCodePage		437
22#define	FSH_ADMINISTRATOR_GID	500
23#define	FSH_EVERYONE_GID		501
24
25#define	FSH_ADMIN_UID			500
26#define	FSH_GUEST_UID			501
27#define	FSH_ADMINISTRATOR_UID	502
28
29#define	FSH_ILLEGAL_ZONE_CHAR			"\\]/\">[<.:;,|=+?`'"
30#define	FSH_ILLEGAL_WG_CHAR				"\"/\\[]:;|=.,+*?<>"
31#define	FSH_ILLEGAL_PRINTER_CHAR		"/\\[]:;|=., +*?<>'`\""
32#define	FSH_SPECIAL_CHAR				"\"$\\`"
33
34#define	FSH_DISK_GROUP_INFO		"/etc/usrgrp.info"
35
36#define FSH_MNTHD_CONF			"/share/hdd/conf"
37#define FSH_MNTHD_SHARE_CONF		"/share/hdd/conf/share/share.info"
38#define FSH_MNTHD_SMB_CONF		"/share/hdd/conf/share/smb.conf"
39#define FSH_MNTHD			"/share/hdd/data"
40#define FSH_MNTFD			"/share/flash/data"
41#define FSH_MNTFD_CONF			"/share/flash/conf"
42#define FSH_MNTFD_SHARE_CONF		"/share/flash/conf/share/share.info"
43#define FSH_MNTFD_SMB_CONF		"/share/flash/conf/share/smb.info"
44#define FSH_SMB_CONF			"/etc/samba/smb.conf"
45#define FSH_USER_SMB_CONF			"/etc/samba/user_smb.conf"
46#define FSH_SHARE_CONF			"/etc/share.info"
47#define	FSH_WIN_SHARE_CONF			"/etc/win_share.info"
48#define FSH_SHARE_CONF_NAME		"share.info"
49#define	FSH_NETWORK_SEC			"network"
50#define	FSH_SYS_PASSWD			"/etc/passwd"
51#define	FSH_SMB_PASSWD			"/etc/samba/smbpasswd"
52#define	FSH_WEB_PASSWD			"/home/httpd/html/Management/.htpasswd"
53#define	FSH_SYS_GROUP			"/etc/group"
54#define	FSH_DS_CONF_FILE		"/etc/CGI_ds.conf"
55#define	FSH_DEF_DS_CONF_FILE		"/usr/local/CGI_ds.conf"
56#define	FSH_QUOTA_TMPFILE		"/tmp/edquota.tmp"
57#define	FSH_XINETD_FTP_CONF		"/usr/local/xinetd.d/ftp"
58#define	FSH_PASSWD_SALT			"sc"
59#define	FSH_EVERYONE_GRP		"everyone"
60#define TMPFILE_MODE			"/share/hdd/conf/tmp/tmpfile.XXXXXX"
61#define	TMPDIR				"/share/hdd/conf/tmp"
62
63#define	FSH_FLASH_SHARE_DIR		"/share/flash/data"
64#define	FSH_ADMIN_GRP			"administrators"
65#define	FSH_ADMINISTRATOR_USER	"admin"
66#define	FSH_GUEST_USER			"guest"
67#define FSH_HDD_SHARE			"ADMIN"
68#define FSH_PUBLIC_SHARE		"DISK"
69
70#define FSH_FLASH_SHARE			"FLASH"
71#define FSH_HARD_SHARE			"HDD"
72
73#define	FSH_DEFAULT_PASS		"zGf8Ikl50e3aPM"
74
75//Backup file flag
76#define	fPass			1					//passwd
77#define	fGrp			2					//group
78#define	fShare			4					//share.info
79#define	fUser			8					//usrgrp.info
80#define	fSmb			0x10				//smb.conf
81#define	fSmbPass		0x20				//smbpasswd
82#define	fWebPass		0x40				//.htpasswd
83#define	fGroups			(fGrp|fUser|fShare|fSmb)
84#define	fUsers			(fPass|fGrp|fUser|fSmbPass)
85#define	fShares			(fSmb|fShare)
86
87#define	UID_Start       2000
88#define	GID_Start       2000
89
90
91#define	FSH_GET_GROUP_ID_ERR			-5			// Fail to get id of the group.
92#define	FSH_DEL_KEY_ITEM_ERR			-4			// Fail to delete one item related to one key from one file.
93#define	FSH_GET_SHARENUM_ERR			-3			// Fail to get the number of shares in server
94#define	FSH_GET_GRPNUM_ERR				-2 			// Fail to get the number of groups in server
95#define	FSH_GET_USERNUM_ERR				-1 			// Fail to get the number of users in server
96#define	FSH_OK							0			//Succeed
97//Samba Error
98#define	FSH_DOMAIN_NAME_ERR				1			//Illegal character or characters in domain name.
99#define	FSH_MSN_VALUE_ERR				2			//The value of MSN is invalid.
100#define	FSH_WINS_VALUE_ERR				3			//The value of WINS is invalid.
101#define	FSH_WINS_BLANK_ERR				4			//The WINS Server is enabled but  its IP Address  is blank.
102#define	FSH_WINS_IP_ERR					5			//The WINS Server Address is invalid.
103#define	FSH_WG_DBCS_ERR					6			//DBCS in workgroup name.
104#define	FSH_ILLEGAL_WG_CHAR_ERR			7			//Illegal character or characters in workgroup name.
105#define	FSH_WG_BLANK_ERR				8			//The MSN is enabled but  workgroup  is blank.
106#define	FSH_ILLEGAL_PRINTER_CHAR_ERR	9 			//Illegal character or characters in printer name.
107#define	FSH_PRINTER_DBCS_ERR			10			//DBCS in printer name.
108#define	FSH_READ_SMB_CONF_ERR			11			//Fail to read samba configuration info
109#define	FSH_SAVE_SMB_CONF_ERR			12			//Fail to save samba configuration info.
110#define	FSH_RESET_SMB_ERR				13
111//AppleTalk Error
112#define	FSH_APPLE_VALUE_ERR				14			//The value of AppleTalk is invalid
113#define	FSH_ZONE_BLANK_ERR				15			//The AppleTalk is enabled but  zone name  is blank.
114#define	FSH_ZONE_DBCS_ERR				16			//DBCS in zone name.
115#define	FSH_ILLEGAL_ZONE_CHAR_ERR		17			//Illegal character or characters in zone name.
116#define	FSH_READ_APPLE_CONF_ERR			18			//Fail to read AppleTalk configuration info
117#define	FSH_SAVE_APPLE_CONF_ERR			19			//Fail to save AppleTalk configuration info.
118//Common Error
119#define	FSH_INPUTPARM_ERR				20		// Inputed parameter is wrong.
120#define	FSH_FILE_OPEN_ERR				21		// Fail to open file.
121#define	FSH_CREATE_TMPFILE_ERR			22    		// Fail to create one temp file
122#define	FSH_ALLOCATE_MEM_ERR			23 		// Fail to allocate memory.
123#define	FSH_FILE_FORMAT_ERR				24 		// Format of file is wong.
124#define	FSH_READ_FILE_ERR				25		// Fail to read content from file.
125//User Error
126#define	FSH_USER_DUP_ERR				26		// The user has been existing already.
127#define	FSH_RESERVE_USER_ERR			27		// Cannot delete default users.
128#define	FSH_DEL_USER_ERR				28		// Fail to delete the user.
129#define	FSH_GET_ALLUSER_ERR				29		// Fail to get all users' info.
130#define	FSH_MOD_USER_ERR				30		// Fail to update the user's info.
131#define	FSH_ADD_USER_ERR				31		// Fail to add the user.
132#define	FSH_SET_USER_QUOTA_ERR			32		// Fail to set the user's disk quota.
133#define	FSH_GET_USERINFO_ERR			33		// Fail to get the user's info.
134#define	FSH_ADD_GRP_MEMB_ERR			34		// Fail to add user  to group.
135#define	FSH_DEL_GRP_MEMB_ERR			35		// Fail to delete user from group.
136#define	FSH_RESET_FTP_ERR				36		// Fail to reset FTP Server.
137
138//Group Error
139#define FSH_ADD_GROUP_ERR				37		// Fail to add the group.
140#define FSH_DEL_GROUP_ERR				38		// Fail to delete the group.
141#define FSH_MOD_GROUP_ERR				39		// Fail to update the group.
142#define FSH_DEL_GRP_FROM_SH_ERR			40		// Fail to delete group from share.
143#define FSH_GRP_TOOMANYGRP_ERR			41		// Groups are too many.
144#define FSH_GRP_RESERVE_ERR				42		// Cannot delete default groups.
145#define FSH_GRP_EXIST_ERR				43		// The group has been existing.
146//Share Error
147#define FSH_DEL_SHARE_ERR				44		// Fail to delete the share.
148#define FSH_WRITE_SMB_CONF_ERR			45		// Fail to write file smb.conf
149#define FSH_GET_ALL_SHARE_ERR			46		// Fail to get all share info
150#define FSH_GET_SHARE_GRP_ERR			47		// Fail to get the share's groups
151#define	FSH_SHARE_DUP_ERR				48		// The share has been existing.
152#define	FSH_SHARE_NOT_EXIST_ERR			49		// The share does not exist.
153#define	FSH_ADD_SHARE_ERR				50		// The share does not exist.
154#define FSH_DIRSHARED_ERR               56
155
156#define 	FSH_ADD_GRP_SHARE_ERR		51
157#define 	FSH_DEL_GRP_SHARE_ERR		52
158#define		FSH_UPDATE_USER_ERR			53
159#define 	FSH_USER_EXISTEDIN_GROUP_ERR	54
160#define		FSH_GROUP_ACCESSED_SHARE_ERR	55
161
162#define	FSH_RESET_GUEST_ERR				56
163#define	FSH_RESET_PRINTER_ERR			57
164#endif
165
166