s3-libnet: avoid using lp_dns_hostname() in join code
[samba4-gss.git] / libcli / auth / netlogon_creds_cli.h
blob136760edaebfe72b3707d9ba45adb14a04151eab
1 /*
2 Unix SMB/CIFS implementation.
4 module to store/fetch session keys for the schannel client
6 Copyright (C) Stefan Metzmacher 2013
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.
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, see <http://www.gnu.org/licenses/>.
22 #ifndef NETLOGON_CREDS_CLI_H
23 #define NETLOGON_CREDS_CLI_H
25 #include "librpc/gen_ndr/dcerpc.h"
26 #include "librpc/gen_ndr/schannel.h"
28 struct netlogon_creds_cli_context;
29 struct cli_credentials;
30 struct messaging_context;
31 struct dcerpc_binding_handle;
32 struct db_context;
34 NTSTATUS netlogon_creds_cli_set_global_db(struct loadparm_context *lp_ctx, struct db_context **db);
35 NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx);
36 void netlogon_creds_cli_close_global_db(void);
38 void netlogon_creds_cli_warn_options(struct loadparm_context *lp_ctx);
40 NTSTATUS netlogon_creds_cli_context_global(struct loadparm_context *lp_ctx,
41 struct messaging_context *msg_ctx,
42 const char *client_account,
43 enum netr_SchannelType type,
44 const char *server_computer,
45 const char *server_netbios_domain,
46 const char *server_dns_domain,
47 TALLOC_CTX *mem_ctx,
48 struct netlogon_creds_cli_context **_context);
49 NTSTATUS netlogon_creds_bind_cli_credentials(
50 struct netlogon_creds_cli_context *context, TALLOC_CTX *mem_ctx,
51 struct cli_credentials **pcli_creds);
53 char *netlogon_creds_cli_debug_string(
54 const struct netlogon_creds_cli_context *context,
55 TALLOC_CTX *mem_ctx);
57 void netlogon_creds_cli_use_kerberos(
58 struct netlogon_creds_cli_context *context,
59 bool *client_use_krb5_netlogon,
60 bool *reject_aes_servers);
62 enum dcerpc_AuthLevel netlogon_creds_cli_auth_level(
63 struct netlogon_creds_cli_context *context);
65 NTSTATUS netlogon_creds_cli_get(struct netlogon_creds_cli_context *context,
66 TALLOC_CTX *mem_ctx,
67 struct netlogon_creds_CredentialState **_creds);
68 bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context *context,
69 const struct netlogon_creds_CredentialState *creds1);
71 NTSTATUS netlogon_creds_cli_store(struct netlogon_creds_cli_context *context,
72 struct netlogon_creds_CredentialState *creds);
73 NTSTATUS netlogon_creds_cli_delete(struct netlogon_creds_cli_context *context,
74 struct netlogon_creds_CredentialState *creds);
75 NTSTATUS netlogon_creds_cli_delete_lck(
76 struct netlogon_creds_cli_context *context);
78 struct tevent_req *netlogon_creds_cli_lock_send(TALLOC_CTX *mem_ctx,
79 struct tevent_context *ev,
80 struct netlogon_creds_cli_context *context);
81 NTSTATUS netlogon_creds_cli_lock_recv(struct tevent_req *req,
82 TALLOC_CTX *mem_ctx,
83 struct netlogon_creds_CredentialState **creds);
84 NTSTATUS netlogon_creds_cli_lock(struct netlogon_creds_cli_context *context,
85 TALLOC_CTX *mem_ctx,
86 struct netlogon_creds_CredentialState **creds);
88 struct netlogon_creds_cli_lck;
90 enum netlogon_creds_cli_lck_type {
91 NETLOGON_CREDS_CLI_LCK_NONE,
92 NETLOGON_CREDS_CLI_LCK_SHARED,
93 NETLOGON_CREDS_CLI_LCK_EXCLUSIVE,
96 struct tevent_req *netlogon_creds_cli_lck_send(
97 TALLOC_CTX *mem_ctx, struct tevent_context *ev,
98 struct netlogon_creds_cli_context *context,
99 enum netlogon_creds_cli_lck_type type);
100 NTSTATUS netlogon_creds_cli_lck_recv(
101 struct tevent_req *req, TALLOC_CTX *mem_ctx,
102 struct netlogon_creds_cli_lck **lck);
103 NTSTATUS netlogon_creds_cli_lck(
104 struct netlogon_creds_cli_context *context,
105 enum netlogon_creds_cli_lck_type type,
106 TALLOC_CTX *mem_ctx, struct netlogon_creds_cli_lck **lck);
108 struct tevent_req *netlogon_creds_cli_auth_send(TALLOC_CTX *mem_ctx,
109 struct tevent_context *ev,
110 struct netlogon_creds_cli_context *context,
111 struct dcerpc_binding_handle *b,
112 uint8_t num_nt_hashes,
113 const struct samr_Password * const *nt_hashes);
114 NTSTATUS netlogon_creds_cli_auth_recv(struct tevent_req *req,
115 uint8_t *idx_nt_hashes);
116 NTSTATUS netlogon_creds_cli_auth(struct netlogon_creds_cli_context *context,
117 struct dcerpc_binding_handle *b,
118 uint8_t num_nt_hashes,
119 const struct samr_Password * const *nt_hashes,
120 uint8_t *idx_nt_hashes);
122 struct tevent_req *netlogon_creds_cli_check_send(TALLOC_CTX *mem_ctx,
123 struct tevent_context *ev,
124 struct netlogon_creds_cli_context *context,
125 struct dcerpc_binding_handle *b);
126 NTSTATUS netlogon_creds_cli_check_recv(struct tevent_req *req,
127 union netr_Capabilities *capabilities);
128 NTSTATUS netlogon_creds_cli_check(struct netlogon_creds_cli_context *context,
129 struct dcerpc_binding_handle *b,
130 union netr_Capabilities *capabilities);
132 struct tevent_req *netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX *mem_ctx,
133 struct tevent_context *ev,
134 struct netlogon_creds_cli_context *context,
135 struct dcerpc_binding_handle *b,
136 const DATA_BLOB *new_password,
137 const uint32_t *new_version);
138 NTSTATUS netlogon_creds_cli_ServerPasswordSet_recv(struct tevent_req *req);
139 NTSTATUS netlogon_creds_cli_ServerPasswordSet(
140 struct netlogon_creds_cli_context *context,
141 struct dcerpc_binding_handle *b,
142 const DATA_BLOB *new_password,
143 const uint32_t *new_version);
145 struct tevent_req *netlogon_creds_cli_LogonSamLogon_send(TALLOC_CTX *mem_ctx,
146 struct tevent_context *ev,
147 struct netlogon_creds_cli_context *context,
148 struct dcerpc_binding_handle *b,
149 enum netr_LogonInfoClass logon_level,
150 const union netr_LogonLevel *logon,
151 uint32_t flags);
152 NTSTATUS netlogon_creds_cli_LogonSamLogon_recv(struct tevent_req *req,
153 TALLOC_CTX *mem_ctx,
154 uint16_t *validation_level,
155 union netr_Validation **validation,
156 uint8_t *authoritative,
157 uint32_t *flags);
158 NTSTATUS netlogon_creds_cli_LogonSamLogon(
159 struct netlogon_creds_cli_context *context,
160 struct dcerpc_binding_handle *b,
161 enum netr_LogonInfoClass logon_level,
162 const union netr_LogonLevel *logon,
163 TALLOC_CTX *mem_ctx,
164 uint16_t *validation_level,
165 union netr_Validation **validation,
166 uint8_t *authoritative,
167 uint32_t *flags);
168 struct tevent_req *netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_send(TALLOC_CTX *mem_ctx,
169 struct tevent_context *ev,
170 struct netlogon_creds_cli_context *context,
171 struct dcerpc_binding_handle *b,
172 const char *site_name,
173 uint32_t dns_ttl,
174 struct NL_DNS_NAME_INFO_ARRAY *dns_names);
175 NTSTATUS netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_recv(struct tevent_req *req);
176 NTSTATUS netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords(
177 struct netlogon_creds_cli_context *context,
178 struct dcerpc_binding_handle *b,
179 const char *site_name,
180 uint32_t dns_ttl,
181 struct NL_DNS_NAME_INFO_ARRAY *dns_names);
183 struct tevent_req *netlogon_creds_cli_ServerGetTrustInfo_send(TALLOC_CTX *mem_ctx,
184 struct tevent_context *ev,
185 struct netlogon_creds_cli_context *context,
186 struct dcerpc_binding_handle *b);
187 NTSTATUS netlogon_creds_cli_ServerGetTrustInfo_recv(struct tevent_req *req,
188 TALLOC_CTX *mem_ctx,
189 struct samr_Password *new_owf_password,
190 struct samr_Password *old_owf_password,
191 struct netr_TrustInfo **trust_info);
192 NTSTATUS netlogon_creds_cli_ServerGetTrustInfo(
193 struct netlogon_creds_cli_context *context,
194 struct dcerpc_binding_handle *b,
195 TALLOC_CTX *mem_ctx,
196 struct samr_Password *new_owf_password,
197 struct samr_Password *old_owf_password,
198 struct netr_TrustInfo **trust_info);
200 struct tevent_req *netlogon_creds_cli_GetForestTrustInformation_send(TALLOC_CTX *mem_ctx,
201 struct tevent_context *ev,
202 struct netlogon_creds_cli_context *context,
203 struct dcerpc_binding_handle *b);
204 NTSTATUS netlogon_creds_cli_GetForestTrustInformation_recv(struct tevent_req *req,
205 TALLOC_CTX *mem_ctx,
206 struct lsa_ForestTrustInformation **forest_trust_info);
207 NTSTATUS netlogon_creds_cli_GetForestTrustInformation(
208 struct netlogon_creds_cli_context *context,
209 struct dcerpc_binding_handle *b,
210 TALLOC_CTX *mem_ctx,
211 struct lsa_ForestTrustInformation **forest_trust_info);
213 struct tevent_req *netlogon_creds_cli_SendToSam_send(TALLOC_CTX *mem_ctx,
214 struct tevent_context *ev,
215 struct netlogon_creds_cli_context *context,
216 struct dcerpc_binding_handle *b,
217 struct netr_SendToSamBase *message);
218 NTSTATUS netlogon_creds_cli_SendToSam_recv(struct tevent_req *req);
219 NTSTATUS netlogon_creds_cli_SendToSam(
220 struct netlogon_creds_cli_context *context,
221 struct dcerpc_binding_handle *b,
222 struct netr_SendToSamBase *message);
224 struct tevent_req *netlogon_creds_cli_LogonGetDomainInfo_send(TALLOC_CTX *mem_ctx,
225 struct tevent_context *ev,
226 struct netlogon_creds_cli_context *context,
227 struct dcerpc_binding_handle *b,
228 uint32_t level,
229 union netr_WorkstationInfo *query);
230 NTSTATUS netlogon_creds_cli_LogonGetDomainInfo_recv(struct tevent_req *req,
231 TALLOC_CTX *mem_ctx,
232 union netr_DomainInfo **info);
233 NTSTATUS netlogon_creds_cli_LogonGetDomainInfo(
234 struct netlogon_creds_cli_context *context,
235 struct dcerpc_binding_handle *b,
236 TALLOC_CTX *mem_ctx,
237 uint32_t level,
238 union netr_WorkstationInfo *query,
239 union netr_DomainInfo **info);
241 #endif /* NETLOGON_CREDS_CLI_H */