r23792: convert Samba4 to GPLv3
[jelmer/samba4-debian.git] / source / libnet / libnet_become_dc.h
1 /*
2    Unix SMB/CIFS implementation.
3
4    Copyright (C) Stefan Metzmacher <metze@samba.org> 2006
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 3 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, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _LIBNET_BECOME_DC_H
21 #define _LIBNET_BECOME_DC_H
22
23 #include "librpc/gen_ndr/drsuapi.h"
24
25 struct libnet_BecomeDC_Domain {
26         /* input */
27         const char *dns_name;
28         const char *netbios_name;
29         const struct dom_sid *sid;
30
31         /* constructed */
32         struct GUID guid;
33         const char *dn_str;
34         uint32_t behavior_version;
35         uint32_t w2k3_update_revision;
36 };
37
38 struct libnet_BecomeDC_Forest {
39         /* constructed */
40         const char *dns_name;
41         const char *root_dn_str;
42         const char *config_dn_str;
43         uint32_t crossref_behavior_version;
44         const char *schema_dn_str;
45         uint32_t schema_object_version;
46 };
47
48 struct libnet_BecomeDC_SourceDSA {
49         /* input */
50         const char *address;
51
52         /* constructed */
53         const char *dns_name;
54         const char *netbios_name;
55         const char *site_name;
56         const char *server_dn_str;
57         const char *ntds_dn_str;
58 };
59
60 struct libnet_BecomeDC_CheckOptions {
61         const struct libnet_BecomeDC_Domain *domain;
62         const struct libnet_BecomeDC_Forest *forest;
63         const struct libnet_BecomeDC_SourceDSA *source_dsa;
64 };
65
66 struct libnet_BecomeDC_DestDSA {
67         /* input */
68         const char *netbios_name;
69
70         /* constructed */
71         const char *dns_name;
72         const char *site_name;
73         struct GUID site_guid;
74         const char *computer_dn_str;
75         const char *server_dn_str;
76         const char *ntds_dn_str;
77         struct GUID ntds_guid;
78         struct GUID invocation_id;
79         uint32_t user_account_control;
80 };
81
82 struct libnet_BecomeDC_PrepareDB {
83         const struct libnet_BecomeDC_Domain *domain;
84         const struct libnet_BecomeDC_Forest *forest;
85         const struct libnet_BecomeDC_SourceDSA *source_dsa;
86         const struct libnet_BecomeDC_DestDSA *dest_dsa;
87 };
88
89 struct libnet_BecomeDC_StoreChunk;
90
91 struct libnet_BecomeDC_Partition {
92         struct drsuapi_DsReplicaObjectIdentifier nc;
93         struct GUID destination_dsa_guid;
94         struct GUID source_dsa_guid;
95         struct GUID source_dsa_invocation_id;
96         struct drsuapi_DsReplicaHighWaterMark highwatermark;
97         uint32_t replica_flags;
98
99         NTSTATUS (*store_chunk)(void *private_data,
100                                 const struct libnet_BecomeDC_StoreChunk *info);
101 };
102
103 struct libnet_BecomeDC_StoreChunk {
104         const struct libnet_BecomeDC_Domain *domain;
105         const struct libnet_BecomeDC_Forest *forest;
106         const struct libnet_BecomeDC_SourceDSA *source_dsa;
107         const struct libnet_BecomeDC_DestDSA *dest_dsa;
108         const struct libnet_BecomeDC_Partition *partition;
109         uint32_t ctr_level;
110         const struct drsuapi_DsGetNCChangesCtr1 *ctr1;
111         const struct drsuapi_DsGetNCChangesCtr6 *ctr6;
112         const DATA_BLOB *gensec_skey;
113 };
114
115 struct libnet_BecomeDC_Callbacks {
116         void *private_data;
117         NTSTATUS (*check_options)(void *private_data,
118                                   const struct libnet_BecomeDC_CheckOptions *info);
119         NTSTATUS (*prepare_db)(void *private_data,
120                                const struct libnet_BecomeDC_PrepareDB *info);
121         NTSTATUS (*schema_chunk)(void *private_data,
122                                  const struct libnet_BecomeDC_StoreChunk *info);
123         NTSTATUS (*config_chunk)(void *private_data,
124                                  const struct libnet_BecomeDC_StoreChunk *info);
125         NTSTATUS (*domain_chunk)(void *private_data,
126                                  const struct libnet_BecomeDC_StoreChunk *info);
127 };
128
129 struct libnet_BecomeDC {
130         struct {
131                 const char *domain_dns_name;
132                 const char *domain_netbios_name;
133                 const struct dom_sid *domain_sid;
134                 const char *source_dsa_address;
135                 const char *dest_dsa_netbios_name;
136
137                 struct libnet_BecomeDC_Callbacks callbacks;
138         } in;
139
140         struct {
141                 const char *error_string;
142         } out;
143 };
144
145 #endif /* _LIBNET_BECOME_DC_H */