torture: convert torture_comment() -> torture_result() so we can knownfail flapping...
[Samba/wip.git] / libcli / auth / netlogon_creds_cli.h
bloba910259a88bbdc9799205a675ba20bcc571c4a93
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 messaging_context;
30 struct dcerpc_binding_handle;
31 struct db_context;
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);
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 enum dcerpc_AuthLevel auth_level,
48 uint32_t proposed_flags,
49 uint32_t required_flags,
50 const char *server_computer,
51 const char *server_netbios_domain,
52 TALLOC_CTX *mem_ctx,
53 struct netlogon_creds_cli_context **_context);
55 enum dcerpc_AuthLevel netlogon_creds_cli_auth_level(
56 struct netlogon_creds_cli_context *context);
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);
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);
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);
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);
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);
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);
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);
150 #endif /* NETLOGON_CREDS_CLI_H */