1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License as
4 * published by the Free Software Foundation; either version 2 of
5 * the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15 * MA 02111-1307 USA
16 */
17#ifndef _DISK_SHARE_
18#define _DISK_SHARE_
19
20#define ADMIN_ORDER 0
21#define MAX_ACCOUNT_NUM 6
22
23#define SHARE_LAYER MOUNT_LAYER+1
24
25// Support Protocol
26#define PROTOCOL_CIFS "cifs"
27#define PROTOCOL_FTP "ftp"
28#define PROTOCOL_MEDIASERVER "dms"
29#ifdef RTCONFIG_WEBDAV_OLD
30#define PROTOCOL_WEBDAV "webdav"
31#define MAX_PROTOCOL_NUM 4
32#else
33#define MAX_PROTOCOL_NUM 3
34#endif
35
36#define PROTOCOL_CIFS_BIT 0
37#define PROTOCOL_FTP_BIT 1
38#define PROTOCOL_MEDIASERVER_BIT 2
39#ifdef RTCONFIG_WEBDAV_OLD
40#define PROTOCOL_WEBDAV_BIT 3
41#endif
42
43#define DEFAULT_SAMBA_RIGHT 3
44#define DEFAULT_FTP_RIGHT 3
45#define DEFAULT_DMS_RIGHT 1
46#ifdef RTCONFIG_WEBDAV_OLD
47#define DEFAULT_WEBDAV_RIGHT 3
48#endif
49
50extern void set_file_integrity(const char *const file_name);
51extern int check_file_integrity(const char *const file_name);
52
53extern int get_account_list(int *, char ***);
54extern int get_folder_list(const char *const, int *, char ***);
55extern int get_all_folder(const char *const, int *, char ***);
56extern int get_var_file_name(const char *const account, const char *const path, char **file_name);
57extern void free_2_dimension_list(int *, char ***);
58
59extern int initial_folder_list(const char *const);
60extern int initial_var_file(const char *const, const char *const);
61extern int initial_all_var_file(const char *const);
62extern int test_of_var_files(const char *const);
63extern int create_if_no_var_files(const char *const);
64extern int modify_if_exist_new_folder(const char *const, const char *const);
65
66extern int get_permission(const char *const, const char *const, const char *const, const char *const);
67extern int set_permission(const char *const, const char *const, const char *const, const char *const, const int);
68
69extern int add_account(const char *const, const char *const);
70extern int del_account(const char *const);
71extern int mod_account(const char *const, const char *const, const char *const);
72extern int test_if_exist_account(const char *const);
73
74extern int add_folder(const char *const, const char *const, const char *const);
75extern int del_folder(const char *const, const char *const);
76extern int mod_folder(const char *const, const char *const, const char *const);
77extern int test_if_exist_share(const char *const, const char *const);
78
79extern int how_many_layer(const char *const, char **, char **);
80
81#endif // _DISK_SHARE_
82