r21729: Some more tests
[Samba/ekacnet.git] / source4 / param / share.h
blob93b02255b6b1e971f83c91a6ef3a125894ddf52d
1 /*
2 Unix SMB/CIFS implementation.
4 Modular services configuration
6 Copyright (C) Simo Sorce 2006
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #ifndef _SHARE_H
24 #define _SHARE_H
26 struct share_ops;
28 struct share_context {
29 const struct share_ops *ops;
30 void *priv_data;
33 struct share_config {
34 const char *name;
35 struct share_context *ctx;
36 void *opaque;
39 enum share_info_type {
40 SHARE_INFO_STRING,
41 SHARE_INFO_INT,
42 SHARE_INFO_BLOB
45 struct share_info {
46 enum share_info_type type;
47 const char *name;
48 void *value;
51 struct share_ops {
52 const char *name;
53 NTSTATUS (*init)(TALLOC_CTX *, const struct share_ops*, struct share_context **);
54 const char *(*string_option)(struct share_config *, const char *, const char *);
55 int (*int_option)(struct share_config *, const char *, int);
56 BOOL (*bool_option)(struct share_config *, const char *, BOOL);
57 const char **(*string_list_option)(TALLOC_CTX *, struct share_config *, const char *);
58 NTSTATUS (*list_all)(TALLOC_CTX *, struct share_context *, int *, const char ***);
59 NTSTATUS (*get_config)(TALLOC_CTX *, struct share_context *, const char *, struct share_config **);
60 NTSTATUS (*create)(struct share_context *, const char *, struct share_info *, int);
61 NTSTATUS (*set)(struct share_context *, const char *, struct share_info *, int);
62 NTSTATUS (*remove)(struct share_context *, const char *);
65 #include "param/share_proto.h"
67 /* list of shares options */
69 #define SHARE_NAME "name"
70 #define SHARE_PATH "path"
71 #define SHARE_COMMENT "comment"
72 #define SHARE_PASSWORD "password"
73 #define SHARE_HOSTS_ALLOW "hosts-allow"
74 #define SHARE_HOSTS_DENY "hosts-deny"
75 #define SHARE_NTVFS_HANDLER "ntvfs-handler"
76 #define SHARE_TYPE "type"
77 #define SHARE_VOLUME "volume"
78 #define SHARE_CSC_POLICY "csc-policy"
79 #define SHARE_AVAILABLE "available"
80 #define SHARE_BROWSEABLE "browseable"
81 #define SHARE_MAX_CONNECTIONS "max-connections"
83 /* I'd like to see the following options go away
84 * and always use EAs and SECDESCs */
85 #define SHARE_READONLY "readonly"
86 #define SHARE_MAP_SYSTEM "map-system"
87 #define SHARE_MAP_HIDDEN "map-hidden"
88 #define SHARE_MAP_ARCHIVE "map-archive"
90 #define SHARE_STRICT_LOCKING "strict-locking"
91 #define SHARE_STRICT_SYNC "strict-sync"
92 #define SHARE_MSDFS_ROOT "msdfs-root"
93 #define SHARE_CI_FILESYSTEM "ci-filesystem"
95 /* defaults */
97 #define SHARE_HOST_ALLOW_DEFAULT NULL
98 #define SHARE_HOST_DENY_DEFAULT NULL
99 #define SHARE_VOLUME_DEFAULT NULL
100 #define SHARE_TYPE_DEFAULT "DISK"
101 #define SHARE_CSC_POLICY_DEFAULT 0
102 #define SHARE_AVAILABLE_DEFAULT True
103 #define SHARE_BROWSEABLE_DEFAULT True
104 #define SHARE_MAX_CONNECTIONS_DEFAULT 0
106 /* I'd like to see the following options go away
107 * and always use EAs and SECDESCs */
108 #define SHARE_READONLY_DEFAULT True
109 #define SHARE_MAP_SYSTEM_DEFAULT False
110 #define SHARE_MAP_HIDDEN_DEFAULT False
111 #define SHARE_MAP_ARCHIVE_DEFAULT True
113 #define SHARE_STRICT_LOCKING_DEFAULT True
114 #define SHARE_STRICT_SYNC_DEFAULT False
115 #define SHARE_MSDFS_ROOT_DEFAULT False
116 #define SHARE_CI_FILESYSTEM_DEFAULT False
118 #endif /* _SHARE_H */