r9789: Patch from Volker that fixes the build on AIX.
[sfrench/samba-autobuild/.git] / source4 / lib / samba3 / samba3.h
1 /* 
2    Unix SMB/CIFS implementation.
3    Samba3 interfaces
4    Copyright (C) Jelmer Vernooij                        2005.
5    
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10    
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15    
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #ifndef _SAMBA3_H /* _SAMBA3_H */
22 #define _SAMBA3_H 
23
24 #include "librpc/gen_ndr/security.h"
25 #include "librpc/gen_ndr/samr.h"
26
27 struct samba3_samaccount {
28         uint32_t logon_time,
29                 logoff_time,
30                 kickoff_time,
31                 bad_password_time,
32                 pass_last_set_time,
33                 pass_can_change_time,
34                 pass_must_change_time;
35         char *username;
36         char *domain;
37         char *nt_username;
38         char *dir_drive;
39         char *unknown_str;
40         char *munged_dial;
41         char *fullname;
42         char *homedir;
43         char *logon_script;
44         char *profile_path;
45         char *acct_desc;
46         char *workstations;
47         uid_t uid;
48         uint32_t user_rid, group_rid, hours_len, unknown_6;
49         uint16_t acct_ctrl, logon_divs;
50         uint16_t bad_password_count, logon_count;
51         struct samr_Password lm_pw, nt_pw;
52         uint8_t *nt_pw_hist_ptr;
53         uint8_t *hours;
54 };
55
56 struct samba3_groupmapping {
57         gid_t gid;
58         struct dom_sid *sid;
59         int sid_name_use;
60         const char *nt_name;
61         const char *comment;
62 };
63
64 struct samba3_alias {
65         struct dom_sid *sid;
66         uint32_t member_count;
67         struct dom_sid **members;
68 };
69
70 struct samba3_groupdb {
71         uint32_t groupmap_count;
72         struct samba3_groupmapping *groupmappings;
73
74         uint32_t alias_count;
75         struct samba3_alias *aliases;
76 };
77
78 struct samba3_idmap_mapping
79 {
80         enum { IDMAP_GROUP, IDMAP_USER } type;
81         uint32_t unix_id;
82         struct dom_sid *sid;
83 };
84
85 struct samba3_idmapdb
86 {
87         /* High water marks */
88         uint32_t user_hwm;
89         uint32_t group_hwm;
90
91         uint32_t mapping_count;
92         struct samba3_idmap_mapping *mappings;
93 };
94
95 struct samba3_winsdb_entry 
96 {
97         char *name;
98         int nb_flags;
99         int type;
100         time_t ttl;
101         uint32_t ip_count;
102         struct ipv4_addr *ips;
103 };
104
105 struct samba3_policy
106 {
107         uint32_t min_password_length;
108         uint32_t password_history;
109         uint32_t user_must_logon_to_change_password;
110         uint32_t maximum_password_age;
111         uint32_t minimum_password_age;
112         uint32_t lockout_duration;
113         uint32_t reset_count_minutes;
114         uint32_t bad_lockout_minutes;
115         uint32_t disconnect_time;
116         uint32_t refuse_machine_password_change;
117 };
118
119 struct samba3_regval {
120         char *name;
121         uint16_t                type;
122         DATA_BLOB               data;
123 };
124
125 struct samba3_regkey {
126         char *name;
127         
128         uint32_t value_count;
129         struct samba3_regval *values;
130
131         uint32_t subkey_count;
132         char **subkeys;
133 };
134
135 struct samba3_regdb
136 {
137         uint32_t key_count;
138         struct samba3_regkey *keys;
139 };
140
141 struct samba3_secrets
142 {
143         struct cli_credentials *ipc_cred;
144         
145         uint32_t ldappw_count;
146         struct samba3_ldappw 
147         {
148                 char *dn;
149                 char *password;
150         } *ldappws;
151
152         uint32_t domain_count;
153         struct samba3_domainsecrets 
154         {
155                 char *name;
156                 struct dom_sid sid;
157                 struct GUID guid;
158                 char *plaintext_pw;
159                 time_t last_change_time;
160                 struct {
161                         uint8_t hash[16];
162                         time_t mod_time;
163                 } hash_pw;
164                 int sec_channel_type;
165         } *domains;
166
167         uint32_t trusted_domain_count;
168         struct samba3_trusted_dom_pass {
169                 uint32_t uni_name_len;
170                 const char *uni_name[32]; /* unicode domain name */
171                 const char *pass;               /* trust relationship's password */
172                 time_t mod_time;
173                 struct dom_sid domain_sid;      /* remote domain's sid */
174         } *trusted_domains;
175
176         uint32_t afs_keyfile_count;
177
178         struct samba3_afs_keyfile {
179                 uint32_t nkeys;
180                 struct {
181                         uint32_t kvno;
182                         char key[8];
183                 } entry[8];
184                 char *cell;
185         } *afs_keyfiles;
186 };
187
188 struct samba3_parameter {
189         char *name;
190         char *value;
191 };
192
193 struct samba3_share_info {
194         char *name;
195         struct security_descriptor secdesc;
196
197         uint32_t parameter_count;
198         struct samba3_parameter *parameters;
199 };
200
201 struct samba3 
202 {
203         uint32_t winsdb_count;
204         struct samba3_winsdb_entry *winsdb_entries;
205         
206         uint32_t samaccount_count;
207         struct samba3_samaccount *samaccounts;
208
209         uint32_t share_count;
210         struct samba3_share_info *shares;
211
212         struct samba3_secrets secrets;
213         struct samba3_groupdb group;
214         struct samba3_idmapdb idmap;
215         struct samba3_policy policy;
216         struct samba3_regdb registry;
217 };
218
219 #endif /* _SAMBA3_H */