vfs_shadow_copy2: documentation for snapsharepath
[obnox/samba/samba-obnox.git] / libcli / auth / netlogon_creds_cli.h
1 /*
2    Unix SMB/CIFS implementation.
3
4    module to store/fetch session keys for the schannel client
5
6    Copyright (C) Stefan Metzmacher 2013
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 NETLOGON_CREDS_CLI_H
23 #define NETLOGON_CREDS_CLI_H
24
25 #include "librpc/gen_ndr/dcerpc.h"
26 #include "librpc/gen_ndr/schannel.h"
27
28 struct netlogon_creds_cli_context;
29 struct messaging_context;
30 struct dcerpc_binding_handle;
31 struct db_context;
32
33 NTSTATUS netlogon_creds_cli_set_global_db(struct db_context **db);
34 NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx);
35
36 NTSTATUS netlogon_creds_cli_context_global(struct loadparm_context *lp_ctx,
37                                 struct messaging_context *msg_ctx,
38                                 const char *client_account,
39                                 enum netr_SchannelType type,
40                                 const char *server_computer,
41                                 const char *server_netbios_domain,
42                                 TALLOC_CTX *mem_ctx,
43                                 struct netlogon_creds_cli_context **_context);
44 NTSTATUS netlogon_creds_cli_context_tmp(const char *client_computer,
45                                 const char *client_account,
46                                 enum netr_SchannelType type,
47                                 uint32_t proposed_flags,
48                                 uint32_t required_flags,
49                                 enum dcerpc_AuthLevel auth_level,
50                                 const char *server_computer,
51                                 const char *server_netbios_domain,
52                                 TALLOC_CTX *mem_ctx,
53                                 struct netlogon_creds_cli_context **_context);
54
55 enum dcerpc_AuthLevel netlogon_creds_cli_auth_level(
56                 struct netlogon_creds_cli_context *context);
57
58 NTSTATUS netlogon_creds_cli_get(struct netlogon_creds_cli_context *context,
59                                 TALLOC_CTX *mem_ctx,
60                                 struct netlogon_creds_CredentialState **_creds);
61 bool netlogon_creds_cli_validate(struct netlogon_creds_cli_context *context,
62                         const struct netlogon_creds_CredentialState *creds1);
63
64 NTSTATUS netlogon_creds_cli_store(struct netlogon_creds_cli_context *context,
65                                   struct netlogon_creds_CredentialState **_creds);
66 NTSTATUS netlogon_creds_cli_delete(struct netlogon_creds_cli_context *context,
67                                    struct netlogon_creds_CredentialState **_creds);
68
69 struct tevent_req *netlogon_creds_cli_lock_send(TALLOC_CTX *mem_ctx,
70                                 struct tevent_context *ev,
71                                 struct netlogon_creds_cli_context *context);
72 NTSTATUS netlogon_creds_cli_lock_recv(struct tevent_req *req,
73                         TALLOC_CTX *mem_ctx,
74                         struct netlogon_creds_CredentialState **creds);
75 NTSTATUS netlogon_creds_cli_lock(struct netlogon_creds_cli_context *context,
76                         TALLOC_CTX *mem_ctx,
77                         struct netlogon_creds_CredentialState **creds);
78
79 struct tevent_req *netlogon_creds_cli_auth_send(TALLOC_CTX *mem_ctx,
80                                 struct tevent_context *ev,
81                                 struct netlogon_creds_cli_context *context,
82                                 struct dcerpc_binding_handle *b,
83                                 struct samr_Password current_nt_hash,
84                                 const struct samr_Password *previous_nt_hash);
85 NTSTATUS netlogon_creds_cli_auth_recv(struct tevent_req *req);
86 NTSTATUS netlogon_creds_cli_auth(struct netlogon_creds_cli_context *context,
87                                  struct dcerpc_binding_handle *b,
88                                  struct samr_Password current_nt_hash,
89                                  const struct samr_Password *previous_nt_hash);
90
91 struct tevent_req *netlogon_creds_cli_check_send(TALLOC_CTX *mem_ctx,
92                                 struct tevent_context *ev,
93                                 struct netlogon_creds_cli_context *context,
94                                 struct dcerpc_binding_handle *b);
95 NTSTATUS netlogon_creds_cli_check_recv(struct tevent_req *req);
96 NTSTATUS netlogon_creds_cli_check(struct netlogon_creds_cli_context *context,
97                                   struct dcerpc_binding_handle *b);
98
99 struct tevent_req *netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX *mem_ctx,
100                                 struct tevent_context *ev,
101                                 struct netlogon_creds_cli_context *context,
102                                 struct dcerpc_binding_handle *b,
103                                 const char *new_password,
104                                 const uint32_t *new_version);
105 NTSTATUS netlogon_creds_cli_ServerPasswordSet_recv(struct tevent_req *req);
106 NTSTATUS netlogon_creds_cli_ServerPasswordSet(
107                                 struct netlogon_creds_cli_context *context,
108                                 struct dcerpc_binding_handle *b,
109                                 const char *new_password,
110                                 const uint32_t *new_version);
111
112 struct tevent_req *netlogon_creds_cli_LogonSamLogon_send(TALLOC_CTX *mem_ctx,
113                                 struct tevent_context *ev,
114                                 struct netlogon_creds_cli_context *context,
115                                 struct dcerpc_binding_handle *b,
116                                 enum netr_LogonInfoClass logon_level,
117                                 const union netr_LogonLevel *logon,
118                                 uint32_t flags);
119 NTSTATUS netlogon_creds_cli_LogonSamLogon_recv(struct tevent_req *req,
120                                         TALLOC_CTX *mem_ctx,
121                                         uint16_t *validation_level,
122                                         union netr_Validation **validation,
123                                         uint8_t *authoritative,
124                                         uint32_t *flags);
125 NTSTATUS netlogon_creds_cli_LogonSamLogon(
126                                 struct netlogon_creds_cli_context *context,
127                                 struct dcerpc_binding_handle *b,
128                                 enum netr_LogonInfoClass logon_level,
129                                 const union netr_LogonLevel *logon,
130                                 TALLOC_CTX *mem_ctx,
131                                 uint16_t *validation_level,
132                                 union netr_Validation **validation,
133                                 uint8_t *authoritative,
134                                 uint32_t *flags);
135 struct tevent_req *netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_send(TALLOC_CTX *mem_ctx,
136                                                                              struct tevent_context *ev,
137                                                                              struct netlogon_creds_cli_context *context,
138                                                                              struct dcerpc_binding_handle *b,
139                                                                              const char *site_name,
140                                                                              uint32_t dns_ttl,
141                                                                              struct NL_DNS_NAME_INFO_ARRAY *dns_names);
142 NTSTATUS netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_recv(struct tevent_req *req);
143 NTSTATUS netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords(
144                                 struct netlogon_creds_cli_context *context,
145                                 struct dcerpc_binding_handle *b,
146                                 const char *site_name,
147                                 uint32_t dns_ttl,
148                                 struct NL_DNS_NAME_INFO_ARRAY *dns_names);
149
150 struct tevent_req *netlogon_creds_cli_ServerGetTrustInfo_send(TALLOC_CTX *mem_ctx,
151                                         struct tevent_context *ev,
152                                         struct netlogon_creds_cli_context *context,
153                                         struct dcerpc_binding_handle *b);
154 NTSTATUS netlogon_creds_cli_ServerGetTrustInfo_recv(struct tevent_req *req,
155                                         TALLOC_CTX *mem_ctx,
156                                         struct samr_Password *new_owf_password,
157                                         struct samr_Password *old_owf_password,
158                                         struct netr_TrustInfo **trust_info);
159 NTSTATUS netlogon_creds_cli_ServerGetTrustInfo(
160                                 struct netlogon_creds_cli_context *context,
161                                 struct dcerpc_binding_handle *b,
162                                 TALLOC_CTX *mem_ctx,
163                                 struct samr_Password *new_owf_password,
164                                 struct samr_Password *old_owf_password,
165                                 struct netr_TrustInfo **trust_info);
166
167 struct tevent_req *netlogon_creds_cli_GetForestTrustInformation_send(TALLOC_CTX *mem_ctx,
168                                         struct tevent_context *ev,
169                                         struct netlogon_creds_cli_context *context,
170                                         struct dcerpc_binding_handle *b);
171 NTSTATUS netlogon_creds_cli_GetForestTrustInformation_recv(struct tevent_req *req,
172                         TALLOC_CTX *mem_ctx,
173                         struct lsa_ForestTrustInformation **forest_trust_info);
174 NTSTATUS netlogon_creds_cli_GetForestTrustInformation(
175                         struct netlogon_creds_cli_context *context,
176                         struct dcerpc_binding_handle *b,
177                         TALLOC_CTX *mem_ctx,
178                         struct lsa_ForestTrustInformation **forest_trust_info);
179
180 #endif /* NETLOGON_CREDS_CLI_H */