r23792: convert Samba4 to GPLv3
[kai/samba-autobuild/.git] / source4 / lib / samba3 / samba3.h
index adb7b8973aba8d2b53429e0607805f07691afa47..bc73e8941dab0e3c976975ff25d1e10d2eb16b67 100644 (file)
@@ -5,7 +5,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef _SAMBA3_H /* _SAMBA3_H */
 #define _SAMBA3_H 
 
 #include "librpc/gen_ndr/security.h"
+#include "librpc/gen_ndr/samr.h"
+#include "param/param.h"
 
 struct samba3_samaccount {
        uint32_t logon_time,
@@ -46,31 +47,15 @@ struct samba3_samaccount {
        uint32_t user_rid, group_rid, hours_len, unknown_6;
        uint16_t acct_ctrl, logon_divs;
        uint16_t bad_password_count, logon_count;
-       uint8_t *lm_pw_ptr, *nt_pw_ptr;
+       struct samr_Password lm_pw, nt_pw;
        uint8_t *nt_pw_hist_ptr;
        uint8_t *hours;
 };
 
-/* SID Types */
-enum SID_NAME_USE
-{
-       SID_NAME_USE_NONE = 0,
-       SID_NAME_USER    = 1, /* user */
-       SID_NAME_DOM_GRP,     /* domain group */
-       SID_NAME_DOMAIN,      /* domain sid */
-       SID_NAME_ALIAS,       /* local group */
-       SID_NAME_WKN_GRP,     /* well-known group */
-       SID_NAME_DELETED,     /* deleted account: needed for c2 rating */
-       SID_NAME_INVALID,     /* invalid account */
-       SID_NAME_UNKNOWN,     /* unknown sid type */
-       SID_NAME_COMPUTER     /* sid for a computer */
-};
-
 struct samba3_groupmapping {
-       struct pdb_methods *methods;
        gid_t gid;
        struct dom_sid *sid;
-       enum SID_NAME_USE sid_name_use;
+       int sid_name_use;
        const char *nt_name;
        const char *comment;
 };
@@ -130,17 +115,101 @@ struct samba3_policy
        uint32_t refuse_machine_password_change;
 };
 
+struct samba3_regval {
+       char *name;
+       uint16_t                type;
+       DATA_BLOB               data;
+};
+
+struct samba3_regkey {
+       char *name;
+       
+       uint32_t value_count;
+       struct samba3_regval *values;
+
+       uint32_t subkey_count;
+       char **subkeys;
+};
+
+struct samba3_regdb
+{
+       uint32_t key_count;
+       struct samba3_regkey *keys;
+};
+
+struct samba3_secrets
+{
+       struct cli_credentials *ipc_cred;
+       
+       uint32_t ldappw_count;
+       struct samba3_ldappw 
+       {
+               char *dn;
+               char *password;
+       } *ldappws;
+
+       uint32_t domain_count;
+       struct samba3_domainsecrets 
+       {
+               char *name;
+               struct dom_sid sid;
+               struct GUID guid;
+               char *plaintext_pw;
+               time_t last_change_time;
+               struct {
+                       uint8_t hash[16];
+                       time_t mod_time;
+               } hash_pw;
+               int sec_channel_type;
+       } *domains;
+
+       uint32_t trusted_domain_count;
+       struct samba3_trusted_dom_pass {
+               uint32_t uni_name_len;
+               const char *uni_name[32]; /* unicode domain name */
+               const char *pass;               /* trust relationship's password */
+               time_t mod_time;
+               struct dom_sid domain_sid;      /* remote domain's sid */
+       } *trusted_domains;
+
+       uint32_t afs_keyfile_count;
+
+       struct samba3_afs_keyfile {
+               uint32_t nkeys;
+               struct {
+                       uint32_t kvno;
+                       char key[8];
+               } entry[8];
+               char *cell;
+       } *afs_keyfiles;
+};
+
+struct samba3_share_info {
+       char *name;
+       struct security_descriptor secdesc;
+};
+
 struct samba3 
 {
+       struct param_context *configuration;
+
        uint32_t winsdb_count;
        struct samba3_winsdb_entry *winsdb_entries;
        
        uint32_t samaccount_count;
        struct samba3_samaccount *samaccounts;
 
+       uint32_t share_count;
+       struct samba3_share_info *shares;
+
+       struct samba3_secrets secrets;
        struct samba3_groupdb group;
        struct samba3_idmapdb idmap;
        struct samba3_policy policy;
+       struct samba3_regdb registry;
 };
 
+#include "lib/samba3/samba3_proto.h"
+#include "lib/samba3/samba3_smbpasswd_proto.h"
+
 #endif /* _SAMBA3_H */