Support more keywords.
[jelmer/libpolicy.git] / generic.h
1 /* 
2    Unix SMB/CIFS implementation.
3    Client-side (group) policy management library.
4    
5    Copyright (C) Wilco Baan Hofman <wilco@baanhofman.nl> 2008
6    Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
7    
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 3 of the License, or
11    (at your option) any later version.
12    
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.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <http://www.gnu.org/licenses/>.
20 */
21
22 #ifndef _GENERIC_H_
23 #define _GENERIC_H_
24
25 /** Generic Policy API */
26
27 struct policy_context {
28         union { 
29                 struct group_policy_context *group_pol_ctx;
30                 struct nt4_policy_context *nt4_pol_ctx;
31         };
32 };
33
34
35 /*
36   Create GPO (Group Policy Object?)
37 * create groupPolicyContainer
38
39 Create GPT (Group Policy Template)
40 * create empty tree on SYSVOL
41 * generate GPT.INI
42
43 Consistent generation of Security Descriptors and Version number in GPO and GPT
44
45 apply policy should have some of the samba3 internals?
46
47 API should be so nicely abstracted, that samba3 can plugin its own CSEs.
48 */
49
50 enum pol_apply_target {
51         POL_APPLY_USER,
52         POL_APPLY_MACHINE,
53         POL_APPLY_BOTH,
54 };
55 enum pol_apply_source {
56         POL_SRC_AD,
57         POL_SRC_NT4,
58         POL_SRC_9x,
59 };
60
61 WERROR pol_apply_policy(struct registry_context *reg, struct dom_sid domain_sid, 
62                 enum pol_apply_target, struct dom_sid user_sid,
63                 struct dom_sid machine_sid, const char *username, 
64                 const char *machinename, enum pol_apply_source);
65
66
67
68
69 /* Apply policy (registry context, domain?, USER/MACHINE/BOTH, user (sid?), machine(sid?), LOAD_NT4/LOAD_AD)
70 - Get list of (relevant) GPO objects
71 - Apply GPO objects to registry context
72 - Call Client side extensions function
73
74 Create policy ()
75 In case of NT4:
76 - Create empty NTConfig.pol
77 In case of AD:
78 - Create GPO
79 - Create GPT
80
81 Set group policy for DN ()
82 - Add LDAP attributes to the DN
83
84 Open policy (domain?, UUID?)
85 - Open a GPO/NTConfig.pol
86
87 Set policy setting (policy fd)
88 - Set a setting in the policy file 
89
90 List policy settings(policy fd)
91 - Get list of all settings in the opened policy file
92
93 */
94
95 #endif /* _GENERIC_H_ */