2006-09-19 01:27:20 +00:00
/*
* Unix SMB / CIFS implementation .
* client auto - generated by pidl . DO NOT MODIFY !
*/
# include "includes.h"
2008-12-16 16:32:18 +01:00
# include "../librpc/gen_ndr/cli_netlogon.h"
2006-09-19 01:27:20 +00:00
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonUasLogon_state {
struct netr_LogonUasLogon orig ;
struct netr_LogonUasLogon tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonUasLogon_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonUasLogon_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
const char * _workstation /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_UasInfo * * _info /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonUasLogon_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonUasLogon_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . workstation = _workstation ;
/* Out parameters */
state - > orig . out . info = _info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonUasLogon_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONUASLOGON ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonUasLogon_done , req ) ;
return req ;
}
static void rpccli_netr_LogonUasLogon_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonUasLogon_state * state = tevent_req_data (
req , struct rpccli_netr_LogonUasLogon_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . info = * state - > tmp . out . info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonUasLogon_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_LogonUasLogon_state * state = tevent_req_data (
req , struct rpccli_netr_LogonUasLogon_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_LogonUasLogon ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
const char * workstation /* [in] [ref,charset(UTF16)] */ ,
2008-10-29 02:44:59 +01:00
struct netr_UasInfo * * info /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
struct netr_LogonUasLogon r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . workstation = workstation ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_LOGONUASLOGON ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* info = * r . out . info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonUasLogoff_state {
struct netr_LogonUasLogoff orig ;
struct netr_LogonUasLogoff tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonUasLogoff_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonUasLogoff_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
const char * _workstation /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_UasLogoffInfo * _info /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonUasLogoff_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonUasLogoff_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . workstation = _workstation ;
/* Out parameters */
state - > orig . out . info = _info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonUasLogoff_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONUASLOGOFF ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonUasLogoff_done , req ) ;
return req ;
}
static void rpccli_netr_LogonUasLogoff_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonUasLogoff_state * state = tevent_req_data (
req , struct rpccli_netr_LogonUasLogoff_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . info = * state - > tmp . out . info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonUasLogoff_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_LogonUasLogoff_state * state = tevent_req_data (
req , struct rpccli_netr_LogonUasLogoff_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_LogonUasLogoff ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
const char * workstation /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
struct netr_UasLogoffInfo * info /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
struct netr_LogonUasLogoff r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . workstation = workstation ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_LOGONUASLOGOFF ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
* info = * r . out . info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonSamLogon_state {
struct netr_LogonSamLogon orig ;
struct netr_LogonSamLogon tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonSamLogon_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonSamLogon_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * _credential /* [in] [unique] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [unique] */ ,
enum netr_LogonInfoClass _logon_level /* [in] */ ,
union netr_LogonLevel * _logon /* [in] [ref,switch_is(logon_level)] */ ,
uint16_t _validation_level /* [in] */ ,
union netr_Validation * _validation /* [out] [ref,switch_is(validation_level)] */ ,
uint8_t * _authoritative /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonSamLogon_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonSamLogon_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . logon_level = _logon_level ;
state - > orig . in . logon = _logon ;
state - > orig . in . validation_level = _validation_level ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . validation = _validation ;
state - > orig . out . authoritative = _authoritative ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonSamLogon_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONSAMLOGON ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonSamLogon_done , req ) ;
return req ;
}
static void rpccli_netr_LogonSamLogon_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonSamLogon_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogon_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
if ( state - > orig . out . return_authenticator & & state - > tmp . out . return_authenticator ) {
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
}
* state - > orig . out . validation = * state - > tmp . out . validation ;
* state - > orig . out . authoritative = * state - > tmp . out . authoritative ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonSamLogon_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_LogonSamLogon_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogon_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_LogonSamLogon ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * credential /* [in] [unique] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [unique] */ ,
2008-10-15 16:13:40 +02:00
enum netr_LogonInfoClass logon_level /* [in] */ ,
union netr_LogonLevel * logon /* [in] [ref,switch_is(logon_level)] */ ,
2008-03-25 17:52:33 +01:00
uint16_t validation_level /* [in] */ ,
union netr_Validation * validation /* [out] [ref,switch_is(validation_level)] */ ,
uint8_t * authoritative /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
struct netr_LogonSamLogon r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
2007-01-16 15:42:03 +00:00
r . in . return_authenticator = return_authenticator ;
2006-09-19 01:27:20 +00:00
r . in . logon_level = logon_level ;
r . in . logon = logon ;
r . in . validation_level = validation_level ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_LOGONSAMLOGON ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2007-10-17 10:35:51 +02:00
if ( return_authenticator & & r . out . return_authenticator ) {
2007-01-16 15:42:03 +00:00
* return_authenticator = * r . out . return_authenticator ;
}
2006-09-19 01:27:20 +00:00
* validation = * r . out . validation ;
* authoritative = * r . out . authoritative ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonSamLogoff_state {
struct netr_LogonSamLogoff orig ;
struct netr_LogonSamLogoff tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonSamLogoff_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonSamLogoff_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * _credential /* [in] [unique] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [unique] */ ,
enum netr_LogonInfoClass _logon_level /* [in] */ ,
union netr_LogonLevel _logon /* [in] [switch_is(logon_level)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonSamLogoff_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonSamLogoff_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . logon_level = _logon_level ;
state - > orig . in . logon = _logon ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonSamLogoff_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONSAMLOGOFF ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonSamLogoff_done , req ) ;
return req ;
}
static void rpccli_netr_LogonSamLogoff_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonSamLogoff_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogoff_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
if ( state - > orig . out . return_authenticator & & state - > tmp . out . return_authenticator ) {
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
}
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonSamLogoff_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_LogonSamLogoff_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogoff_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_LogonSamLogoff ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * credential /* [in] [unique] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [unique] */ ,
2008-10-15 16:13:40 +02:00
enum netr_LogonInfoClass logon_level /* [in] */ ,
union netr_LogonLevel logon /* [in] [switch_is(logon_level)] */ )
2006-09-19 01:27:20 +00:00
{
struct netr_LogonSamLogoff r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
2007-01-16 15:42:03 +00:00
r . in . return_authenticator = return_authenticator ;
2006-09-19 01:27:20 +00:00
r . in . logon_level = logon_level ;
r . in . logon = logon ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_LOGONSAMLOGOFF ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2007-10-17 10:35:51 +02:00
if ( return_authenticator & & r . out . return_authenticator ) {
2007-01-16 15:42:03 +00:00
* return_authenticator = * r . out . return_authenticator ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_ServerReqChallenge_state {
struct netr_ServerReqChallenge orig ;
struct netr_ServerReqChallenge tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerReqChallenge_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerReqChallenge_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Credential * _credentials /* [in] [ref] */ ,
struct netr_Credential * _return_credentials /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_ServerReqChallenge_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerReqChallenge_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . server_name = _server_name ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credentials = _credentials ;
/* Out parameters */
state - > orig . out . return_credentials = _return_credentials ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerReqChallenge_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERREQCHALLENGE ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerReqChallenge_done , req ) ;
return req ;
}
static void rpccli_netr_ServerReqChallenge_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerReqChallenge_state * state = tevent_req_data (
req , struct rpccli_netr_ServerReqChallenge_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . return_credentials = * state - > tmp . out . return_credentials ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerReqChallenge_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerReqChallenge_state * state = tevent_req_data (
req , struct rpccli_netr_ServerReqChallenge_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_ServerReqChallenge ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
struct netr_Credential * credentials /* [in] [ref] */ ,
struct netr_Credential * return_credentials /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_ServerReqChallenge r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . computer_name = computer_name ;
r . in . credentials = credentials ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERREQCHALLENGE ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-02-15 23:32:02 +01:00
* return_credentials = * r . out . return_credentials ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_ServerAuthenticate_state {
struct netr_ServerAuthenticate orig ;
struct netr_ServerAuthenticate tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerAuthenticate_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerAuthenticate_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType _secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Credential * _credentials /* [in] [ref] */ ,
struct netr_Credential * _return_credentials /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_ServerAuthenticate_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerAuthenticate_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credentials = _credentials ;
/* Out parameters */
state - > orig . out . return_credentials = _return_credentials ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerAuthenticate_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERAUTHENTICATE ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerAuthenticate_done , req ) ;
return req ;
}
static void rpccli_netr_ServerAuthenticate_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerAuthenticate_state * state = tevent_req_data (
req , struct rpccli_netr_ServerAuthenticate_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_credentials = * state - > tmp . out . return_credentials ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerAuthenticate_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerAuthenticate_state * state = tevent_req_data (
req , struct rpccli_netr_ServerAuthenticate_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_ServerAuthenticate ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Credential * credentials /* [in] [ref] */ ,
struct netr_Credential * return_credentials /* [out] [ref] */ )
{
struct netr_ServerAuthenticate r ;
NTSTATUS status ;
/* In parameters */
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
r . in . credentials = credentials ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERAUTHENTICATE ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_credentials = * r . out . return_credentials ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_ServerPasswordSet_state {
struct netr_ServerPasswordSet orig ;
struct netr_ServerPasswordSet tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerPasswordSet_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerPasswordSet_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType _secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [out] [ref] */ ,
struct samr_Password * _new_password /* [in] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_ServerPasswordSet_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerPasswordSet_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
state - > orig . in . new_password = _new_password ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerPasswordSet_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERPASSWORDSET ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerPasswordSet_done , req ) ;
return req ;
}
static void rpccli_netr_ServerPasswordSet_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerPasswordSet_state * state = tevent_req_data (
req , struct rpccli_netr_ServerPasswordSet_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerPasswordSet_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerPasswordSet_state * state = tevent_req_data (
req , struct rpccli_netr_ServerPasswordSet_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_ServerPasswordSet ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [out] [ref] */ ,
struct samr_Password * new_password /* [in] [ref] */ )
{
struct netr_ServerPasswordSet r ;
NTSTATUS status ;
/* In parameters */
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
r . in . new_password = new_password ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERPASSWORDSET ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_DatabaseDeltas_state {
struct netr_DatabaseDeltas orig ;
struct netr_DatabaseDeltas tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DatabaseDeltas_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DatabaseDeltas_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
2009-08-03 09:51:44 +02:00
const char * _logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * _computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
enum netr_SamDatabaseID _database_id /* [in] */ ,
uint64_t * _sequence_num /* [in,out] [ref] */ ,
struct netr_DELTA_ENUM_ARRAY * * _delta_enum_array /* [out] [ref] */ ,
uint32_t _preferredmaximumlength /* [in] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DatabaseDeltas_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DatabaseDeltas_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . computername = _computername ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . database_id = _database_id ;
state - > orig . in . sequence_num = _sequence_num ;
state - > orig . in . preferredmaximumlength = _preferredmaximumlength ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . sequence_num = _sequence_num ;
state - > orig . out . delta_enum_array = _delta_enum_array ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DatabaseDeltas_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASEDELTAS ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DatabaseDeltas_done , req ) ;
return req ;
}
static void rpccli_netr_DatabaseDeltas_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DatabaseDeltas_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseDeltas_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . sequence_num = * state - > tmp . out . sequence_num ;
* state - > orig . out . delta_enum_array = * state - > tmp . out . delta_enum_array ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DatabaseDeltas_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_DatabaseDeltas_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseDeltas_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_DatabaseDeltas ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2009-08-03 09:51:44 +02:00
const char * logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
enum netr_SamDatabaseID database_id /* [in] */ ,
uint64_t * sequence_num /* [in,out] [ref] */ ,
struct netr_DELTA_ENUM_ARRAY * * delta_enum_array /* [out] [ref] */ ,
uint32_t preferredmaximumlength /* [in] */ )
{
struct netr_DatabaseDeltas r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . computername = computername ;
r . in . credential = credential ;
r . in . return_authenticator = return_authenticator ;
r . in . database_id = database_id ;
r . in . sequence_num = sequence_num ;
r . in . preferredmaximumlength = preferredmaximumlength ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASEDELTAS ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
* sequence_num = * r . out . sequence_num ;
* delta_enum_array = * r . out . delta_enum_array ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_DatabaseSync_state {
struct netr_DatabaseSync orig ;
struct netr_DatabaseSync tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DatabaseSync_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DatabaseSync_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
2009-08-03 09:51:44 +02:00
const char * _logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * _computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
enum netr_SamDatabaseID _database_id /* [in] */ ,
uint32_t * _sync_context /* [in,out] [ref] */ ,
struct netr_DELTA_ENUM_ARRAY * * _delta_enum_array /* [out] [ref] */ ,
uint32_t _preferredmaximumlength /* [in] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DatabaseSync_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DatabaseSync_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . computername = _computername ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . database_id = _database_id ;
state - > orig . in . sync_context = _sync_context ;
state - > orig . in . preferredmaximumlength = _preferredmaximumlength ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . sync_context = _sync_context ;
state - > orig . out . delta_enum_array = _delta_enum_array ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DatabaseSync_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASESYNC ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DatabaseSync_done , req ) ;
return req ;
}
static void rpccli_netr_DatabaseSync_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DatabaseSync_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseSync_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . sync_context = * state - > tmp . out . sync_context ;
* state - > orig . out . delta_enum_array = * state - > tmp . out . delta_enum_array ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DatabaseSync_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_DatabaseSync_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseSync_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_DatabaseSync ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2009-08-03 09:51:44 +02:00
const char * logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
enum netr_SamDatabaseID database_id /* [in] */ ,
uint32_t * sync_context /* [in,out] [ref] */ ,
struct netr_DELTA_ENUM_ARRAY * * delta_enum_array /* [out] [ref] */ ,
uint32_t preferredmaximumlength /* [in] */ )
{
struct netr_DatabaseSync r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . computername = computername ;
r . in . credential = credential ;
r . in . return_authenticator = return_authenticator ;
r . in . database_id = database_id ;
r . in . sync_context = sync_context ;
r . in . preferredmaximumlength = preferredmaximumlength ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASESYNC ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
* sync_context = * r . out . sync_context ;
* delta_enum_array = * r . out . delta_enum_array ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_AccountDeltas_state {
struct netr_AccountDeltas orig ;
struct netr_AccountDeltas tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_AccountDeltas_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_AccountDeltas_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _logon_server /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator _credential /* [in] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
struct netr_UAS_INFO_0 _uas /* [in] */ ,
uint32_t _count /* [in] */ ,
uint32_t _level /* [in] */ ,
uint32_t _buffersize /* [in] */ ,
struct netr_AccountBuffer * _buffer /* [out] [ref,subcontext(4)] */ ,
uint32_t * _count_returned /* [out] [ref] */ ,
uint32_t * _total_entries /* [out] [ref] */ ,
struct netr_UAS_INFO_0 * _recordid /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_AccountDeltas_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_AccountDeltas_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . computername = _computername ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . uas = _uas ;
state - > orig . in . count = _count ;
state - > orig . in . level = _level ;
state - > orig . in . buffersize = _buffersize ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . buffer = _buffer ;
state - > orig . out . count_returned = _count_returned ;
state - > orig . out . total_entries = _total_entries ;
state - > orig . out . recordid = _recordid ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_AccountDeltas_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_ACCOUNTDELTAS ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_AccountDeltas_done , req ) ;
return req ;
}
static void rpccli_netr_AccountDeltas_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_AccountDeltas_state * state = tevent_req_data (
req , struct rpccli_netr_AccountDeltas_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . buffer = * state - > tmp . out . buffer ;
* state - > orig . out . count_returned = * state - > tmp . out . count_returned ;
* state - > orig . out . total_entries = * state - > tmp . out . total_entries ;
* state - > orig . out . recordid = * state - > tmp . out . recordid ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_AccountDeltas_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_AccountDeltas_state * state = tevent_req_data (
req , struct rpccli_netr_AccountDeltas_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_AccountDeltas ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * logon_server /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator credential /* [in] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
struct netr_UAS_INFO_0 uas /* [in] */ ,
uint32_t count /* [in] */ ,
uint32_t level /* [in] */ ,
uint32_t buffersize /* [in] */ ,
struct netr_AccountBuffer * buffer /* [out] [ref,subcontext(4)] */ ,
uint32_t * count_returned /* [out] [ref] */ ,
uint32_t * total_entries /* [out] [ref] */ ,
struct netr_UAS_INFO_0 * recordid /* [out] [ref] */ )
{
struct netr_AccountDeltas r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . computername = computername ;
r . in . credential = credential ;
r . in . return_authenticator = return_authenticator ;
r . in . uas = uas ;
r . in . count = count ;
r . in . level = level ;
r . in . buffersize = buffersize ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_ACCOUNTDELTAS ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
* buffer = * r . out . buffer ;
* count_returned = * r . out . count_returned ;
* total_entries = * r . out . total_entries ;
* recordid = * r . out . recordid ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_AccountSync_state {
struct netr_AccountSync orig ;
struct netr_AccountSync tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_AccountSync_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_AccountSync_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _logon_server /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator _credential /* [in] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
uint32_t _reference /* [in] */ ,
uint32_t _level /* [in] */ ,
uint32_t _buffersize /* [in] */ ,
struct netr_AccountBuffer * _buffer /* [out] [ref,subcontext(4)] */ ,
uint32_t * _count_returned /* [out] [ref] */ ,
uint32_t * _total_entries /* [out] [ref] */ ,
uint32_t * _next_reference /* [out] [ref] */ ,
struct netr_UAS_INFO_0 * _recordid /* [in,out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_AccountSync_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_AccountSync_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . computername = _computername ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . reference = _reference ;
state - > orig . in . level = _level ;
state - > orig . in . buffersize = _buffersize ;
state - > orig . in . recordid = _recordid ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . buffer = _buffer ;
state - > orig . out . count_returned = _count_returned ;
state - > orig . out . total_entries = _total_entries ;
state - > orig . out . next_reference = _next_reference ;
state - > orig . out . recordid = _recordid ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_AccountSync_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_ACCOUNTSYNC ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_AccountSync_done , req ) ;
return req ;
}
static void rpccli_netr_AccountSync_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_AccountSync_state * state = tevent_req_data (
req , struct rpccli_netr_AccountSync_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . buffer = * state - > tmp . out . buffer ;
* state - > orig . out . count_returned = * state - > tmp . out . count_returned ;
* state - > orig . out . total_entries = * state - > tmp . out . total_entries ;
* state - > orig . out . next_reference = * state - > tmp . out . next_reference ;
* state - > orig . out . recordid = * state - > tmp . out . recordid ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_AccountSync_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_AccountSync_state * state = tevent_req_data (
req , struct rpccli_netr_AccountSync_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_AccountSync ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * logon_server /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator credential /* [in] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
uint32_t reference /* [in] */ ,
uint32_t level /* [in] */ ,
uint32_t buffersize /* [in] */ ,
struct netr_AccountBuffer * buffer /* [out] [ref,subcontext(4)] */ ,
uint32_t * count_returned /* [out] [ref] */ ,
uint32_t * total_entries /* [out] [ref] */ ,
uint32_t * next_reference /* [out] [ref] */ ,
struct netr_UAS_INFO_0 * recordid /* [in,out] [ref] */ )
{
struct netr_AccountSync r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . computername = computername ;
r . in . credential = credential ;
r . in . return_authenticator = return_authenticator ;
r . in . reference = reference ;
r . in . level = level ;
r . in . buffersize = buffersize ;
r . in . recordid = recordid ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_ACCOUNTSYNC ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
* buffer = * r . out . buffer ;
* count_returned = * r . out . count_returned ;
* total_entries = * r . out . total_entries ;
* next_reference = * r . out . next_reference ;
* recordid = * r . out . recordid ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_GetDcName_state {
struct netr_GetDcName orig ;
struct netr_GetDcName tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_GetDcName_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_GetDcName_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
2009-08-03 09:51:44 +02:00
const char * _logon_server /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
const char * _domainname /* [in] [unique,charset(UTF16)] */ ,
const char * * _dcname /* [out] [ref,charset(UTF16)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_GetDcName_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_GetDcName_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . domainname = _domainname ;
/* Out parameters */
state - > orig . out . dcname = _dcname ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_GetDcName_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_GETDCNAME ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_GetDcName_done , req ) ;
return req ;
}
static void rpccli_netr_GetDcName_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_GetDcName_state * state = tevent_req_data (
req , struct rpccli_netr_GetDcName_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . dcname = * state - > tmp . out . dcname ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_GetDcName_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_GetDcName_state * state = tevent_req_data (
req , struct rpccli_netr_GetDcName_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_GetDcName ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2009-08-03 09:51:44 +02:00
const char * logon_server /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
const char * domainname /* [in] [unique,charset(UTF16)] */ ,
const char * * dcname /* [out] [ref,charset(UTF16)] */ ,
WERROR * werror )
{
struct netr_GetDcName r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . domainname = domainname ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_GETDCNAME ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* dcname = * r . out . dcname ;
/* Return result */
if ( werror ) {
* werror = r . out . result ;
}
return werror_to_ntstatus ( r . out . result ) ;
}
struct rpccli_netr_LogonControl_state {
struct netr_LogonControl orig ;
struct netr_LogonControl tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonControl_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonControl_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _logon_server /* [in] [unique,charset(UTF16)] */ ,
enum netr_LogonControlCode _function_code /* [in] */ ,
uint32_t _level /* [in] */ ,
union netr_CONTROL_QUERY_INFORMATION * _query /* [out] [ref,switch_is(level)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonControl_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonControl_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . function_code = _function_code ;
state - > orig . in . level = _level ;
/* Out parameters */
state - > orig . out . query = _query ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonControl_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONCONTROL ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonControl_done , req ) ;
return req ;
}
static void rpccli_netr_LogonControl_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonControl_state * state = tevent_req_data (
req , struct rpccli_netr_LogonControl_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . query = * state - > tmp . out . query ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonControl_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_LogonControl_state * state = tevent_req_data (
req , struct rpccli_netr_LogonControl_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_LogonControl ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * logon_server /* [in] [unique,charset(UTF16)] */ ,
enum netr_LogonControlCode function_code /* [in] */ ,
uint32_t level /* [in] */ ,
union netr_CONTROL_QUERY_INFORMATION * query /* [out] [ref,switch_is(level)] */ ,
WERROR * werror )
{
struct netr_LogonControl r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . function_code = function_code ;
r . in . level = level ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONCONTROL ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* query = * r . out . query ;
/* Return result */
if ( werror ) {
* werror = r . out . result ;
}
return werror_to_ntstatus ( r . out . result ) ;
}
struct rpccli_netr_GetAnyDCName_state {
struct netr_GetAnyDCName orig ;
struct netr_GetAnyDCName tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_GetAnyDCName_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_GetAnyDCName_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _logon_server /* [in] [unique,charset(UTF16)] */ ,
const char * _domainname /* [in] [unique,charset(UTF16)] */ ,
const char * * _dcname /* [out] [ref,charset(UTF16)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_GetAnyDCName_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_GetAnyDCName_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . domainname = _domainname ;
/* Out parameters */
state - > orig . out . dcname = _dcname ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_GetAnyDCName_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_GETANYDCNAME ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_GetAnyDCName_done , req ) ;
return req ;
}
static void rpccli_netr_GetAnyDCName_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_GetAnyDCName_state * state = tevent_req_data (
req , struct rpccli_netr_GetAnyDCName_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . dcname = * state - > tmp . out . dcname ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_GetAnyDCName_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_GetAnyDCName_state * state = tevent_req_data (
req , struct rpccli_netr_GetAnyDCName_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_GetAnyDCName ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * logon_server /* [in] [unique,charset(UTF16)] */ ,
const char * domainname /* [in] [unique,charset(UTF16)] */ ,
const char * * dcname /* [out] [ref,charset(UTF16)] */ ,
WERROR * werror )
{
struct netr_GetAnyDCName r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . domainname = domainname ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_GETANYDCNAME ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* dcname = * r . out . dcname ;
/* Return result */
if ( werror ) {
* werror = r . out . result ;
}
return werror_to_ntstatus ( r . out . result ) ;
}
struct rpccli_netr_LogonControl2_state {
struct netr_LogonControl2 orig ;
struct netr_LogonControl2 tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonControl2_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonControl2_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _logon_server /* [in] [unique,charset(UTF16)] */ ,
enum netr_LogonControlCode _function_code /* [in] */ ,
uint32_t _level /* [in] */ ,
union netr_CONTROL_DATA_INFORMATION * _data /* [in] [ref,switch_is(function_code)] */ ,
union netr_CONTROL_QUERY_INFORMATION * _query /* [out] [ref,switch_is(level)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonControl2_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonControl2_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . function_code = _function_code ;
state - > orig . in . level = _level ;
state - > orig . in . data = _data ;
/* Out parameters */
state - > orig . out . query = _query ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonControl2_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONCONTROL2 ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonControl2_done , req ) ;
return req ;
}
static void rpccli_netr_LogonControl2_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonControl2_state * state = tevent_req_data (
req , struct rpccli_netr_LogonControl2_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . query = * state - > tmp . out . query ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonControl2_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_LogonControl2_state * state = tevent_req_data (
req , struct rpccli_netr_LogonControl2_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_LogonControl2 ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * logon_server /* [in] [unique,charset(UTF16)] */ ,
enum netr_LogonControlCode function_code /* [in] */ ,
uint32_t level /* [in] */ ,
union netr_CONTROL_DATA_INFORMATION * data /* [in] [ref,switch_is(function_code)] */ ,
union netr_CONTROL_QUERY_INFORMATION * query /* [out] [ref,switch_is(level)] */ ,
WERROR * werror )
{
struct netr_LogonControl2 r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . function_code = function_code ;
r . in . level = level ;
r . in . data = data ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONCONTROL2 ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* query = * r . out . query ;
/* Return result */
if ( werror ) {
* werror = r . out . result ;
}
return werror_to_ntstatus ( r . out . result ) ;
}
struct rpccli_netr_ServerAuthenticate2_state {
struct netr_ServerAuthenticate2 orig ;
struct netr_ServerAuthenticate2 tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerAuthenticate2_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerAuthenticate2_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType _secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Credential * _credentials /* [in] [ref] */ ,
struct netr_Credential * _return_credentials /* [out] [ref] */ ,
uint32_t * _negotiate_flags /* [in,out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_ServerAuthenticate2_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerAuthenticate2_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credentials = _credentials ;
state - > orig . in . negotiate_flags = _negotiate_flags ;
/* Out parameters */
state - > orig . out . return_credentials = _return_credentials ;
state - > orig . out . negotiate_flags = _negotiate_flags ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerAuthenticate2_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERAUTHENTICATE2 ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerAuthenticate2_done , req ) ;
return req ;
}
static void rpccli_netr_ServerAuthenticate2_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerAuthenticate2_state * state = tevent_req_data (
req , struct rpccli_netr_ServerAuthenticate2_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_credentials = * state - > tmp . out . return_credentials ;
* state - > orig . out . negotiate_flags = * state - > tmp . out . negotiate_flags ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerAuthenticate2_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerAuthenticate2_state * state = tevent_req_data (
req , struct rpccli_netr_ServerAuthenticate2_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_ServerAuthenticate2 ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Credential * credentials /* [in] [ref] */ ,
struct netr_Credential * return_credentials /* [out] [ref] */ ,
uint32_t * negotiate_flags /* [in,out] [ref] */ )
{
struct netr_ServerAuthenticate2 r ;
NTSTATUS status ;
/* In parameters */
r . in . server_name = server_name ;
r . in . account_name = account_name ;
2006-09-19 01:27:20 +00:00
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
2009-07-30 18:56:42 +02:00
r . in . credentials = credentials ;
r . in . negotiate_flags = negotiate_flags ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERAUTHENTICATE2 ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_credentials = * r . out . return_credentials ;
* negotiate_flags = * r . out . negotiate_flags ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_DatabaseSync2_state {
struct netr_DatabaseSync2 orig ;
struct netr_DatabaseSync2 tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DatabaseSync2_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DatabaseSync2_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
2009-08-03 09:51:44 +02:00
const char * _logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * _computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
enum netr_SamDatabaseID _database_id /* [in] */ ,
enum SyncStateEnum _restart_state /* [in] */ ,
uint32_t * _sync_context /* [in,out] [ref] */ ,
struct netr_DELTA_ENUM_ARRAY * * _delta_enum_array /* [out] [ref] */ ,
uint32_t _preferredmaximumlength /* [in] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DatabaseSync2_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DatabaseSync2_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . computername = _computername ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . database_id = _database_id ;
state - > orig . in . restart_state = _restart_state ;
state - > orig . in . sync_context = _sync_context ;
state - > orig . in . preferredmaximumlength = _preferredmaximumlength ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . sync_context = _sync_context ;
state - > orig . out . delta_enum_array = _delta_enum_array ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DatabaseSync2_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASESYNC2 ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DatabaseSync2_done , req ) ;
return req ;
}
static void rpccli_netr_DatabaseSync2_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DatabaseSync2_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseSync2_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . sync_context = * state - > tmp . out . sync_context ;
* state - > orig . out . delta_enum_array = * state - > tmp . out . delta_enum_array ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DatabaseSync2_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_DatabaseSync2_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseSync2_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_DatabaseSync2 ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2009-08-03 09:51:44 +02:00
const char * logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
enum netr_SamDatabaseID database_id /* [in] */ ,
enum SyncStateEnum restart_state /* [in] */ ,
uint32_t * sync_context /* [in,out] [ref] */ ,
struct netr_DELTA_ENUM_ARRAY * * delta_enum_array /* [out] [ref] */ ,
uint32_t preferredmaximumlength /* [in] */ )
{
struct netr_DatabaseSync2 r ;
NTSTATUS status ;
/* In parameters */
r . in . logon_server = logon_server ;
r . in . computername = computername ;
2006-09-19 01:27:20 +00:00
r . in . credential = credential ;
2009-07-30 18:56:42 +02:00
r . in . return_authenticator = return_authenticator ;
r . in . database_id = database_id ;
r . in . restart_state = restart_state ;
r . in . sync_context = sync_context ;
r . in . preferredmaximumlength = preferredmaximumlength ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASESYNC2 ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
2009-07-30 18:56:42 +02:00
* sync_context = * r . out . sync_context ;
* delta_enum_array = * r . out . delta_enum_array ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DatabaseRedo_state {
struct netr_DatabaseRedo orig ;
struct netr_DatabaseRedo tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DatabaseRedo_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DatabaseRedo_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
2009-08-03 09:51:44 +02:00
const char * _logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * _computername /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
2009-11-16 19:41:05 +01:00
struct netr_ChangeLogEntry _change_log_entry /* [in] [subcontext(4)] */ ,
2009-07-30 18:56:42 +02:00
uint32_t _change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */ ,
struct netr_DELTA_ENUM_ARRAY * * _delta_enum_array /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_DatabaseRedo_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DatabaseRedo_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . computername = _computername ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . change_log_entry = _change_log_entry ;
state - > orig . in . change_log_entry_size = _change_log_entry_size ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . delta_enum_array = _delta_enum_array ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DatabaseRedo_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASEREDO ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DatabaseRedo_done , req ) ;
return req ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
static void rpccli_netr_DatabaseRedo_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DatabaseRedo_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseRedo_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . delta_enum_array = * state - > tmp . out . delta_enum_array ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DatabaseRedo_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_DatabaseRedo_state * state = tevent_req_data (
req , struct rpccli_netr_DatabaseRedo_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_DatabaseRedo ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2009-08-03 09:51:44 +02:00
const char * logon_server /* [in] [ref,charset(UTF16)] */ ,
const char * computername /* [in] [ref,charset(UTF16)] */ ,
2008-10-29 02:44:59 +01:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
2008-03-25 17:52:33 +01:00
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
2009-11-16 19:41:05 +01:00
struct netr_ChangeLogEntry change_log_entry /* [in] [subcontext(4)] */ ,
2009-07-30 18:56:42 +02:00
uint32_t change_log_entry_size /* [in] [value(ndr_size_netr_ChangeLogEntry(&change_log_entry,ndr->iconv_convenience,ndr->flags))] */ ,
struct netr_DELTA_ENUM_ARRAY * * delta_enum_array /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_DatabaseRedo r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . logon_server = logon_server ;
r . in . computername = computername ;
r . in . credential = credential ;
r . in . return_authenticator = return_authenticator ;
2009-07-30 18:56:42 +02:00
r . in . change_log_entry = change_log_entry ;
r . in . change_log_entry_size = change_log_entry_size ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DATABASEREDO ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
2008-01-17 10:00:37 +01:00
* delta_enum_array = * r . out . delta_enum_array ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonControl2Ex_state {
struct netr_LogonControl2Ex orig ;
struct netr_LogonControl2Ex tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonControl2Ex_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonControl2Ex_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _logon_server /* [in] [unique,charset(UTF16)] */ ,
enum netr_LogonControlCode _function_code /* [in] */ ,
uint32_t _level /* [in] */ ,
union netr_CONTROL_DATA_INFORMATION * _data /* [in] [ref,switch_is(function_code)] */ ,
union netr_CONTROL_QUERY_INFORMATION * _query /* [out] [ref,switch_is(level)] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_LogonControl2Ex_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonControl2Ex_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . logon_server = _logon_server ;
state - > orig . in . function_code = _function_code ;
state - > orig . in . level = _level ;
state - > orig . in . data = _data ;
/* Out parameters */
state - > orig . out . query = _query ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonControl2Ex_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONCONTROL2EX ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonControl2Ex_done , req ) ;
return req ;
}
static void rpccli_netr_LogonControl2Ex_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonControl2Ex_state * state = tevent_req_data (
req , struct rpccli_netr_LogonControl2Ex_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . query = * state - > tmp . out . query ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonControl2Ex_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_LogonControl2Ex_state * state = tevent_req_data (
req , struct rpccli_netr_LogonControl2Ex_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_LogonControl2Ex ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * logon_server /* [in] [unique,charset(UTF16)] */ ,
enum netr_LogonControlCode function_code /* [in] */ ,
uint32_t level /* [in] */ ,
union netr_CONTROL_DATA_INFORMATION * data /* [in] [ref,switch_is(function_code)] */ ,
union netr_CONTROL_QUERY_INFORMATION * query /* [out] [ref,switch_is(level)] */ ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_LogonControl2Ex r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . logon_server = logon_server ;
2009-07-30 18:56:42 +02:00
r . in . function_code = function_code ;
2006-09-19 01:27:20 +00:00
r . in . level = level ;
2009-07-30 18:56:42 +02:00
r . in . data = data ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONCONTROL2EX ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2009-07-30 18:56:42 +02:00
* query = * r . out . query ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
if ( werror ) {
* werror = r . out . result ;
}
return werror_to_ntstatus ( r . out . result ) ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_NetrEnumerateTrustedDomains_state {
struct netr_NetrEnumerateTrustedDomains orig ;
struct netr_NetrEnumerateTrustedDomains tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_NetrEnumerateTrustedDomains_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_NetrEnumerateTrustedDomains_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Blob * _trusted_domains_blob /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_NetrEnumerateTrustedDomains_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_NetrEnumerateTrustedDomains_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . server_name = _server_name ;
/* Out parameters */
state - > orig . out . trusted_domains_blob = _trusted_domains_blob ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_NetrEnumerateTrustedDomains_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRENUMERATETRUSTEDDOMAINS ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_NetrEnumerateTrustedDomains_done , req ) ;
return req ;
}
static void rpccli_netr_NetrEnumerateTrustedDomains_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_NetrEnumerateTrustedDomains_state * state = tevent_req_data (
req , struct rpccli_netr_NetrEnumerateTrustedDomains_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . trusted_domains_blob = * state - > tmp . out . trusted_domains_blob ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_NetrEnumerateTrustedDomains_state * state = tevent_req_data (
req , struct rpccli_netr_NetrEnumerateTrustedDomains_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
2008-01-31 14:10:22 +01:00
2009-07-30 18:56:42 +02:00
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_NetrEnumerateTrustedDomains ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Blob * trusted_domains_blob /* [out] [ref] */ ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_NetrEnumerateTrustedDomains r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
r . in . server_name = server_name ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRENUMERATETRUSTEDDOMAINS ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2009-07-30 18:56:42 +02:00
* trusted_domains_blob = * r . out . trusted_domains_blob ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsRGetDCName_state {
struct netr_DsRGetDCName orig ;
struct netr_DsRGetDCName tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsRGetDCName_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsRGetDCName_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_unc /* [in] [unique,charset(UTF16)] */ ,
const char * _domain_name /* [in] [unique,charset(UTF16)] */ ,
struct GUID * _domain_guid /* [in] [unique] */ ,
struct GUID * _site_guid /* [in] [unique] */ ,
uint32_t _flags /* [in] */ ,
struct netr_DsRGetDCNameInfo * * _info /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_DsRGetDCName_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsRGetDCName_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . server_unc = _server_unc ;
state - > orig . in . domain_name = _domain_name ;
state - > orig . in . domain_guid = _domain_guid ;
state - > orig . in . site_guid = _site_guid ;
state - > orig . in . flags = _flags ;
/* Out parameters */
state - > orig . out . info = _info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsRGetDCName_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRGETDCNAME ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsRGetDCName_done , req ) ;
return req ;
}
static void rpccli_netr_DsRGetDCName_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsRGetDCName_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetDCName_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . info = * state - > tmp . out . info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsRGetDCName_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsRGetDCName_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetDCName_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_DsRGetDCName ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * server_unc /* [in] [unique,charset(UTF16)] */ ,
const char * domain_name /* [in] [unique,charset(UTF16)] */ ,
struct GUID * domain_guid /* [in] [unique] */ ,
struct GUID * site_guid /* [in] [unique] */ ,
uint32_t flags /* [in] */ ,
struct netr_DsRGetDCNameInfo * * info /* [out] [ref] */ ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_DsRGetDCName r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
r . in . server_unc = server_unc ;
r . in . domain_name = domain_name ;
r . in . domain_guid = domain_guid ;
r . in . site_guid = site_guid ;
r . in . flags = flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRGETDCNAME ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2009-07-30 18:56:42 +02:00
* info = * r . out . info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonGetCapabilities_state {
struct netr_LogonGetCapabilities orig ;
struct netr_LogonGetCapabilities tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonGetCapabilities_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonGetCapabilities_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
2009-08-03 09:51:44 +02:00
const char * _server_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
const char * _computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
uint32_t _query_level /* [in] */ ,
union netr_Capabilities * _capabilities /* [out] [ref,switch_is(query_level)] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_LogonGetCapabilities_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonGetCapabilities_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . server_name = _server_name ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . query_level = _query_level ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . capabilities = _capabilities ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonGetCapabilities_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONGETCAPABILITIES ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonGetCapabilities_done , req ) ;
return req ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
static void rpccli_netr_LogonGetCapabilities_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonGetCapabilities_state * state = tevent_req_data (
req , struct rpccli_netr_LogonGetCapabilities_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . capabilities = * state - > tmp . out . capabilities ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonGetCapabilities_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_LogonGetCapabilities_state * state = tevent_req_data (
req , struct rpccli_netr_LogonGetCapabilities_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_LogonGetCapabilities ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2009-08-03 09:51:44 +02:00
const char * server_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
const char * computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
uint32_t query_level /* [in] */ ,
union netr_Capabilities * capabilities /* [out] [ref,switch_is(query_level)] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_LogonGetCapabilities r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
r . in . server_name = server_name ;
r . in . computer_name = computer_name ;
2006-09-19 01:27:20 +00:00
r . in . credential = credential ;
r . in . return_authenticator = return_authenticator ;
2009-07-30 18:56:42 +02:00
r . in . query_level = query_level ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONGETCAPABILITIES ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
2009-07-30 18:56:42 +02:00
* capabilities = * r . out . capabilities ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_NETRLOGONSETSERVICEBITS_state {
struct netr_NETRLOGONSETSERVICEBITS orig ;
struct netr_NETRLOGONSETSERVICEBITS tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_NETRLOGONSETSERVICEBITS_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_NETRLOGONSETSERVICEBITS_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_NETRLOGONSETSERVICEBITS_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_NETRLOGONSETSERVICEBITS_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
/* Out parameters */
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONSETSERVICEBITS ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_NETRLOGONSETSERVICEBITS_done , req ) ;
return req ;
}
static void rpccli_netr_NETRLOGONSETSERVICEBITS_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_NETRLOGONSETSERVICEBITS_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONSETSERVICEBITS_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_NETRLOGONSETSERVICEBITS_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONSETSERVICEBITS_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_NETRLOGONSETSERVICEBITS ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_NETRLOGONSETSERVICEBITS r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONSETSERVICEBITS ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonGetTrustRid_state {
struct netr_LogonGetTrustRid orig ;
struct netr_LogonGetTrustRid tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonGetTrustRid_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonGetTrustRid_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _domain_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t * _rid /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_LogonGetTrustRid_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonGetTrustRid_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
state - > orig . in . server_name = _server_name ;
state - > orig . in . domain_name = _domain_name ;
/* Out parameters */
state - > orig . out . rid = _rid ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonGetTrustRid_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONGETTRUSTRID ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonGetTrustRid_done , req ) ;
return req ;
}
static void rpccli_netr_LogonGetTrustRid_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonGetTrustRid_state * state = tevent_req_data (
req , struct rpccli_netr_LogonGetTrustRid_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . rid = * state - > tmp . out . rid ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonGetTrustRid_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_LogonGetTrustRid_state * state = tevent_req_data (
req , struct rpccli_netr_LogonGetTrustRid_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_LogonGetTrustRid ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * domain_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t * rid /* [out] [ref] */ ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_LogonGetTrustRid r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
r . in . server_name = server_name ;
2006-09-19 01:27:20 +00:00
r . in . domain_name = domain_name ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONGETTRUSTRID ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2009-07-30 18:56:42 +02:00
* rid = * r . out . rid ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state {
struct netr_NETRLOGONCOMPUTESERVERDIGEST orig ;
struct netr_NETRLOGONCOMPUTESERVERDIGEST tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
/* Out parameters */
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done , req ) ;
return req ;
}
static void rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_NETRLOGONCOMPUTESERVERDIGEST ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_NETRLOGONCOMPUTESERVERDIGEST r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONCOMPUTESERVERDIGEST ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state {
struct netr_NETRLOGONCOMPUTECLIENTDIGEST orig ;
struct netr_NETRLOGONCOMPUTECLIENTDIGEST tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req ;
struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2009-07-30 18:56:42 +02:00
/* Out parameters */
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done , req ) ;
return req ;
}
static void rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
NTSTATUS rpccli_netr_NETRLOGONCOMPUTECLIENTDIGEST ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct netr_NETRLOGONCOMPUTECLIENTDIGEST r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONCOMPUTECLIENTDIGEST ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
return werror_to_ntstatus ( r . out . result ) ;
}
struct rpccli_netr_ServerAuthenticate3_state {
struct netr_ServerAuthenticate3 orig ;
struct netr_ServerAuthenticate3 tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerAuthenticate3_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerAuthenticate3_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType _secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Credential * _credentials /* [in] [ref] */ ,
struct netr_Credential * _return_credentials /* [out] [ref] */ ,
uint32_t * _negotiate_flags /* [in,out] [ref] */ ,
uint32_t * _rid /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_ServerAuthenticate3_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerAuthenticate3_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credentials = _credentials ;
state - > orig . in . negotiate_flags = _negotiate_flags ;
/* Out parameters */
state - > orig . out . return_credentials = _return_credentials ;
state - > orig . out . negotiate_flags = _negotiate_flags ;
state - > orig . out . rid = _rid ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerAuthenticate3_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERAUTHENTICATE3 ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerAuthenticate3_done , req ) ;
return req ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
static void rpccli_netr_ServerAuthenticate3_done ( struct tevent_req * subreq )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerAuthenticate3_state * state = tevent_req_data (
req , struct rpccli_netr_ServerAuthenticate3_state ) ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2009-07-30 18:56:42 +02:00
TALLOC_CTX * mem_ctx ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
2008-01-09 11:59:11 +01:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . return_credentials = * state - > tmp . out . return_credentials ;
* state - > orig . out . negotiate_flags = * state - > tmp . out . negotiate_flags ;
* state - > orig . out . rid = * state - > tmp . out . rid ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerAuthenticate3_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerAuthenticate3_state * state = tevent_req_data (
req , struct rpccli_netr_ServerAuthenticate3_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_ServerAuthenticate3 ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
enum netr_SchannelType secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2008-10-29 02:44:59 +01:00
struct netr_Credential * credentials /* [in] [ref] */ ,
struct netr_Credential * return_credentials /* [out] [ref] */ ,
2008-03-25 17:52:33 +01:00
uint32_t * negotiate_flags /* [in,out] [ref] */ ,
uint32_t * rid /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
struct netr_ServerAuthenticate3 r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
r . in . credentials = credentials ;
r . in . negotiate_flags = negotiate_flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_SERVERAUTHENTICATE3 ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-10-29 02:44:59 +01:00
* return_credentials = * r . out . return_credentials ;
2006-09-19 01:27:20 +00:00
* negotiate_flags = * r . out . negotiate_flags ;
* rid = * r . out . rid ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsRGetDCNameEx_state {
struct netr_DsRGetDCNameEx orig ;
struct netr_DsRGetDCNameEx tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsRGetDCNameEx_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsRGetDCNameEx_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_unc /* [in] [unique,charset(UTF16)] */ ,
const char * _domain_name /* [in] [unique,charset(UTF16)] */ ,
struct GUID * _domain_guid /* [in] [unique] */ ,
const char * _site_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t _flags /* [in] */ ,
struct netr_DsRGetDCNameInfo * * _info /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsRGetDCNameEx_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsRGetDCNameEx_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_unc = _server_unc ;
state - > orig . in . domain_name = _domain_name ;
state - > orig . in . domain_guid = _domain_guid ;
state - > orig . in . site_name = _site_name ;
state - > orig . in . flags = _flags ;
/* Out parameters */
state - > orig . out . info = _info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsRGetDCNameEx_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRGETDCNAMEEX ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsRGetDCNameEx_done , req ) ;
return req ;
}
static void rpccli_netr_DsRGetDCNameEx_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsRGetDCNameEx_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetDCNameEx_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . info = * state - > tmp . out . info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsRGetDCNameEx_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsRGetDCNameEx_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetDCNameEx_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_DsRGetDCNameEx ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_unc /* [in] [unique,charset(UTF16)] */ ,
const char * domain_name /* [in] [unique,charset(UTF16)] */ ,
struct GUID * domain_guid /* [in] [unique] */ ,
const char * site_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t flags /* [in] */ ,
struct netr_DsRGetDCNameInfo * * info /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
struct netr_DsRGetDCNameEx r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_unc = server_unc ;
r . in . domain_name = domain_name ;
r . in . domain_guid = domain_guid ;
r . in . site_name = site_name ;
r . in . flags = flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRGETDCNAMEEX ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* info = * r . out . info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsRGetSiteName_state {
struct netr_DsRGetSiteName orig ;
struct netr_DsRGetSiteName tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsRGetSiteName_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsRGetSiteName_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _computer_name /* [in] [unique,charset(UTF16)] */ ,
const char * * _site /* [out] [ref,charset(UTF16)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsRGetSiteName_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsRGetSiteName_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . computer_name = _computer_name ;
/* Out parameters */
state - > orig . out . site = _site ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsRGetSiteName_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRGETSITENAME ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsRGetSiteName_done , req ) ;
return req ;
}
static void rpccli_netr_DsRGetSiteName_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsRGetSiteName_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetSiteName_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . site = * state - > tmp . out . site ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsRGetSiteName_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsRGetSiteName_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetSiteName_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_DsRGetSiteName ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * computer_name /* [in] [unique,charset(UTF16)] */ ,
const char * * site /* [out] [ref,charset(UTF16)] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
struct netr_DsRGetSiteName r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . computer_name = computer_name ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRGETSITENAME ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
* site = * r . out . site ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonGetDomainInfo_state {
struct netr_LogonGetDomainInfo orig ;
struct netr_LogonGetDomainInfo tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonGetDomainInfo_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonGetDomainInfo_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
2009-08-03 09:51:44 +02:00
const char * _server_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
const char * _computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [ref] */ ,
uint32_t _level /* [in] */ ,
2009-08-03 09:51:44 +02:00
union netr_WorkstationInfo * _query /* [in] [ref,switch_is(level)] */ ,
2009-07-30 18:56:42 +02:00
union netr_DomainInfo * _info /* [out] [ref,switch_is(level)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonGetDomainInfo_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonGetDomainInfo_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . level = _level ;
state - > orig . in . query = _query ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . info = _info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonGetDomainInfo_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONGETDOMAININFO ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonGetDomainInfo_done , req ) ;
return req ;
}
static void rpccli_netr_LogonGetDomainInfo_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonGetDomainInfo_state * state = tevent_req_data (
req , struct rpccli_netr_LogonGetDomainInfo_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . info = * state - > tmp . out . info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonGetDomainInfo_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_LogonGetDomainInfo_state * state = tevent_req_data (
req , struct rpccli_netr_LogonGetDomainInfo_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_LogonGetDomainInfo ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2009-08-03 09:51:44 +02:00
const char * server_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
const char * computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [ref] */ ,
uint32_t level /* [in] */ ,
2009-08-03 09:51:44 +02:00
union netr_WorkstationInfo * query /* [in] [ref,switch_is(level)] */ ,
2008-03-25 17:52:33 +01:00
union netr_DomainInfo * info /* [out] [ref,switch_is(level)] */ )
2006-09-19 01:27:20 +00:00
{
struct netr_LogonGetDomainInfo r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
r . in . return_authenticator = return_authenticator ;
r . in . level = level ;
r . in . query = query ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_LOGONGETDOMAININFO ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
* info = * r . out . info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_ServerPasswordSet2_state {
struct netr_ServerPasswordSet2 orig ;
struct netr_ServerPasswordSet2 tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerPasswordSet2_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerPasswordSet2_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType _secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [out] [ref] */ ,
struct netr_CryptPassword * _new_password /* [in] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_ServerPasswordSet2_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerPasswordSet2_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
state - > orig . in . new_password = _new_password ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerPasswordSet2_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERPASSWORDSET2 ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerPasswordSet2_done , req ) ;
return req ;
}
static void rpccli_netr_ServerPasswordSet2_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerPasswordSet2_state * state = tevent_req_data (
req , struct rpccli_netr_ServerPasswordSet2_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerPasswordSet2_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerPasswordSet2_state * state = tevent_req_data (
req , struct rpccli_netr_ServerPasswordSet2_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_ServerPasswordSet2 ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
enum netr_SchannelType secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2008-08-21 15:02:03 +02:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [out] [ref] */ ,
struct netr_CryptPassword * new_password /* [in] [ref] */ )
2006-09-19 01:27:20 +00:00
{
struct netr_ServerPasswordSet2 r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
r . in . new_password = new_password ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_SERVERPASSWORDSET2 ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* return_authenticator = * r . out . return_authenticator ;
/* Return result */
return r . out . result ;
}
struct rpccli_netr_ServerPasswordGet_state {
struct netr_ServerPasswordGet orig ;
struct netr_ServerPasswordGet tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerPasswordGet_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerPasswordGet_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType _secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [out] [ref] */ ,
struct samr_Password * _password /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_ServerPasswordGet_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerPasswordGet_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . password = _password ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerPasswordGet_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERPASSWORDGET ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerPasswordGet_done , req ) ;
return req ;
}
static void rpccli_netr_ServerPasswordGet_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerPasswordGet_state * state = tevent_req_data (
req , struct rpccli_netr_ServerPasswordGet_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . password = * state - > tmp . out . password ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerPasswordGet_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_ServerPasswordGet_state * state = tevent_req_data (
req , struct rpccli_netr_ServerPasswordGet_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_ServerPasswordGet ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
enum netr_SchannelType secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [out] [ref] */ ,
struct samr_Password * password /* [out] [ref] */ ,
2008-01-17 10:00:37 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_ServerPasswordGet r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-17 10:00:37 +01:00
NDR_NETR_SERVERPASSWORDGET ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* return_authenticator = * r . out . return_authenticator ;
* password = * r . out . password ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_NETRLOGONSENDTOSAM_state {
struct netr_NETRLOGONSENDTOSAM orig ;
struct netr_NETRLOGONSENDTOSAM tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_NETRLOGONSENDTOSAM_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_NETRLOGONSENDTOSAM_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli )
{
struct tevent_req * req ;
struct rpccli_netr_NETRLOGONSENDTOSAM_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_NETRLOGONSENDTOSAM_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
/* Out parameters */
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONSENDTOSAM ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_NETRLOGONSENDTOSAM_done , req ) ;
return req ;
}
static void rpccli_netr_NETRLOGONSENDTOSAM_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_NETRLOGONSENDTOSAM_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONSENDTOSAM_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_NETRLOGONSENDTOSAM_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONSENDTOSAM_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_NETRLOGONSENDTOSAM ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
struct netr_NETRLOGONSENDTOSAM r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_NETRLOGONSENDTOSAM ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsRAddressToSitenamesW_state {
struct netr_DsRAddressToSitenamesW orig ;
struct netr_DsRAddressToSitenamesW tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsRAddressToSitenamesW_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsRAddressToSitenamesW_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t _count /* [in] [range(0,32000)] */ ,
struct netr_DsRAddress * _addresses /* [in] [ref,size_is(count)] */ ,
struct netr_DsRAddressToSitenamesWCtr * * _ctr /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsRAddressToSitenamesW_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsRAddressToSitenamesW_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . count = _count ;
state - > orig . in . addresses = _addresses ;
/* Out parameters */
state - > orig . out . ctr = _ctr ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsRAddressToSitenamesW_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRADDRESSTOSITENAMESW ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsRAddressToSitenamesW_done , req ) ;
return req ;
}
static void rpccli_netr_DsRAddressToSitenamesW_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsRAddressToSitenamesW_state * state = tevent_req_data (
req , struct rpccli_netr_DsRAddressToSitenamesW_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . ctr = * state - > tmp . out . ctr ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsRAddressToSitenamesW_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsRAddressToSitenamesW_state * state = tevent_req_data (
req , struct rpccli_netr_DsRAddressToSitenamesW_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_DsRAddressToSitenamesW ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t count /* [in] [range(0,32000)] */ ,
struct netr_DsRAddress * addresses /* [in] [ref,size_is(count)] */ ,
struct netr_DsRAddressToSitenamesWCtr * * ctr /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_DsRAddressToSitenamesW r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
r . in . count = count ;
r . in . addresses = addresses ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRADDRESSTOSITENAMESW ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* ctr = * r . out . ctr ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsRGetDCNameEx2_state {
struct netr_DsRGetDCNameEx2 orig ;
struct netr_DsRGetDCNameEx2 tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsRGetDCNameEx2_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsRGetDCNameEx2_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_unc /* [in] [unique,charset(UTF16)] */ ,
const char * _client_account /* [in] [unique,charset(UTF16)] */ ,
uint32_t _mask /* [in] */ ,
const char * _domain_name /* [in] [unique,charset(UTF16)] */ ,
struct GUID * _domain_guid /* [in] [unique] */ ,
const char * _site_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t _flags /* [in] */ ,
struct netr_DsRGetDCNameInfo * * _info /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsRGetDCNameEx2_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsRGetDCNameEx2_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_unc = _server_unc ;
state - > orig . in . client_account = _client_account ;
state - > orig . in . mask = _mask ;
state - > orig . in . domain_name = _domain_name ;
state - > orig . in . domain_guid = _domain_guid ;
state - > orig . in . site_name = _site_name ;
state - > orig . in . flags = _flags ;
/* Out parameters */
state - > orig . out . info = _info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsRGetDCNameEx2_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRGETDCNAMEEX2 ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsRGetDCNameEx2_done , req ) ;
return req ;
}
static void rpccli_netr_DsRGetDCNameEx2_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsRGetDCNameEx2_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetDCNameEx2_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . info = * state - > tmp . out . info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsRGetDCNameEx2_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsRGetDCNameEx2_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetDCNameEx2_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_DsRGetDCNameEx2 ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_unc /* [in] [unique,charset(UTF16)] */ ,
const char * client_account /* [in] [unique,charset(UTF16)] */ ,
uint32_t mask /* [in] */ ,
const char * domain_name /* [in] [unique,charset(UTF16)] */ ,
struct GUID * domain_guid /* [in] [unique] */ ,
const char * site_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t flags /* [in] */ ,
struct netr_DsRGetDCNameInfo * * info /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
struct netr_DsRGetDCNameEx2 r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_unc = server_unc ;
r . in . client_account = client_account ;
r . in . mask = mask ;
r . in . domain_name = domain_name ;
r . in . domain_guid = domain_guid ;
r . in . site_name = site_name ;
r . in . flags = flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRGETDCNAMEEX2 ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* info = * r . out . info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state {
struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN orig ;
struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli )
{
struct tevent_req * req ;
struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
/* Out parameters */
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done , req ) ;
return req ;
}
static void rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state * state = tevent_req_data (
req , struct rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
NTSTATUS rpccli_netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
WERROR * werror )
{
struct netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN r ;
NTSTATUS status ;
/* In parameters */
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRLOGONGETTIMESERVICEPARENTDOMAIN ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
/* Return result */
if ( werror ) {
* werror = r . out . result ;
}
return werror_to_ntstatus ( r . out . result ) ;
}
struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state {
struct netr_NetrEnumerateTrustedDomainsEx orig ;
struct netr_NetrEnumerateTrustedDomainsEx tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_NetrEnumerateTrustedDomainsEx_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_NetrEnumerateTrustedDomainsEx_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_DomainTrustList * _dom_trust_list /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
/* Out parameters */
state - > orig . out . dom_trust_list = _dom_trust_list ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_NetrEnumerateTrustedDomainsEx_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_NetrEnumerateTrustedDomainsEx_done , req ) ;
return req ;
}
static void rpccli_netr_NetrEnumerateTrustedDomainsEx_done ( struct tevent_req * subreq )
2006-09-19 01:27:20 +00:00
{
2009-07-30 18:56:42 +02:00
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state * state = tevent_req_data (
req , struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state ) ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2009-07-30 18:56:42 +02:00
TALLOC_CTX * mem_ctx ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
2008-01-09 11:59:11 +01:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
* state - > orig . out . dom_trust_list = * state - > tmp . out . dom_trust_list ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state * state = tevent_req_data (
req , struct rpccli_netr_NetrEnumerateTrustedDomainsEx_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_NetrEnumerateTrustedDomainsEx ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_DomainTrustList * dom_trust_list /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_NetrEnumerateTrustedDomainsEx r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_NETRENUMERATETRUSTEDDOMAINSEX ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* dom_trust_list = * r . out . dom_trust_list ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsRAddressToSitenamesExW_state {
struct netr_DsRAddressToSitenamesExW orig ;
struct netr_DsRAddressToSitenamesExW tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsRAddressToSitenamesExW_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsRAddressToSitenamesExW_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t _count /* [in] [range(0,32000)] */ ,
struct netr_DsRAddress * _addresses /* [in] [ref,size_is(count)] */ ,
struct netr_DsRAddressToSitenamesExWCtr * * _ctr /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsRAddressToSitenamesExW_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsRAddressToSitenamesExW_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . count = _count ;
state - > orig . in . addresses = _addresses ;
/* Out parameters */
state - > orig . out . ctr = _ctr ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsRAddressToSitenamesExW_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRADDRESSTOSITENAMESEXW ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsRAddressToSitenamesExW_done , req ) ;
return req ;
}
static void rpccli_netr_DsRAddressToSitenamesExW_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsRAddressToSitenamesExW_state * state = tevent_req_data (
req , struct rpccli_netr_DsRAddressToSitenamesExW_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . ctr = * state - > tmp . out . ctr ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsRAddressToSitenamesExW_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsRAddressToSitenamesExW_state * state = tevent_req_data (
req , struct rpccli_netr_DsRAddressToSitenamesExW_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_DsRAddressToSitenamesExW ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t count /* [in] [range(0,32000)] */ ,
struct netr_DsRAddress * addresses /* [in] [ref,size_is(count)] */ ,
struct netr_DsRAddressToSitenamesExWCtr * * ctr /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_DsRAddressToSitenamesExW r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
r . in . count = count ;
r . in . addresses = addresses ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRADDRESSTOSITENAMESEXW ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* ctr = * r . out . ctr ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsrGetDcSiteCoverageW_state {
struct netr_DsrGetDcSiteCoverageW orig ;
struct netr_DsrGetDcSiteCoverageW tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsrGetDcSiteCoverageW_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsrGetDcSiteCoverageW_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
struct DcSitesCtr * * _ctr /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsrGetDcSiteCoverageW_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsrGetDcSiteCoverageW_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
/* Out parameters */
state - > orig . out . ctr = _ctr ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsrGetDcSiteCoverageW_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRGETDCSITECOVERAGEW ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsrGetDcSiteCoverageW_done , req ) ;
return req ;
}
static void rpccli_netr_DsrGetDcSiteCoverageW_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsrGetDcSiteCoverageW_state * state = tevent_req_data (
req , struct rpccli_netr_DsrGetDcSiteCoverageW_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . ctr = * state - > tmp . out . ctr ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsrGetDcSiteCoverageW_state * state = tevent_req_data (
req , struct rpccli_netr_DsrGetDcSiteCoverageW_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_DsrGetDcSiteCoverageW ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2008-10-27 14:24:46 +01:00
struct DcSitesCtr * * ctr /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_DsrGetDcSiteCoverageW r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRGETDCSITECOVERAGEW ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* ctr = * r . out . ctr ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonSamLogonEx_state {
struct netr_LogonSamLogonEx orig ;
struct netr_LogonSamLogonEx tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonSamLogonEx_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonSamLogonEx_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _computer_name /* [in] [unique,charset(UTF16)] */ ,
enum netr_LogonInfoClass _logon_level /* [in] */ ,
union netr_LogonLevel * _logon /* [in] [ref,switch_is(logon_level)] */ ,
uint16_t _validation_level /* [in] */ ,
union netr_Validation * _validation /* [out] [ref,switch_is(validation_level)] */ ,
uint8_t * _authoritative /* [out] [ref] */ ,
uint32_t * _flags /* [in,out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonSamLogonEx_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonSamLogonEx_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . logon_level = _logon_level ;
state - > orig . in . logon = _logon ;
state - > orig . in . validation_level = _validation_level ;
state - > orig . in . flags = _flags ;
/* Out parameters */
state - > orig . out . validation = _validation ;
state - > orig . out . authoritative = _authoritative ;
state - > orig . out . flags = _flags ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonSamLogonEx_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONSAMLOGONEX ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonSamLogonEx_done , req ) ;
return req ;
}
static void rpccli_netr_LogonSamLogonEx_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonSamLogonEx_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogonEx_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . validation = * state - > tmp . out . validation ;
* state - > orig . out . authoritative = * state - > tmp . out . authoritative ;
* state - > orig . out . flags = * state - > tmp . out . flags ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonSamLogonEx_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_LogonSamLogonEx_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogonEx_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_LogonSamLogonEx ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * computer_name /* [in] [unique,charset(UTF16)] */ ,
2008-10-15 16:13:40 +02:00
enum netr_LogonInfoClass logon_level /* [in] */ ,
union netr_LogonLevel * logon /* [in] [ref,switch_is(logon_level)] */ ,
2008-03-25 17:52:33 +01:00
uint16_t validation_level /* [in] */ ,
union netr_Validation * validation /* [out] [ref,switch_is(validation_level)] */ ,
uint8_t * authoritative /* [out] [ref] */ ,
uint32_t * flags /* [in,out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
struct netr_LogonSamLogonEx r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . computer_name = computer_name ;
r . in . logon_level = logon_level ;
r . in . logon = logon ;
r . in . validation_level = validation_level ;
r . in . flags = flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_LOGONSAMLOGONEX ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
* validation = * r . out . validation ;
* authoritative = * r . out . authoritative ;
* flags = * r . out . flags ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsrEnumerateDomainTrusts_state {
struct netr_DsrEnumerateDomainTrusts orig ;
struct netr_DsrEnumerateDomainTrusts tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsrEnumerateDomainTrusts_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsrEnumerateDomainTrusts_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t _trust_flags /* [in] */ ,
struct netr_DomainTrustList * _trusts /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsrEnumerateDomainTrusts_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsrEnumerateDomainTrusts_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . trust_flags = _trust_flags ;
/* Out parameters */
state - > orig . out . trusts = _trusts ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsrEnumerateDomainTrusts_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRENUMERATEDOMAINTRUSTS ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsrEnumerateDomainTrusts_done , req ) ;
return req ;
}
static void rpccli_netr_DsrEnumerateDomainTrusts_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsrEnumerateDomainTrusts_state * state = tevent_req_data (
req , struct rpccli_netr_DsrEnumerateDomainTrusts_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . trusts = * state - > tmp . out . trusts ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsrEnumerateDomainTrusts_state * state = tevent_req_data (
req , struct rpccli_netr_DsrEnumerateDomainTrusts_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_DsrEnumerateDomainTrusts ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t trust_flags /* [in] */ ,
struct netr_DomainTrustList * trusts /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
struct netr_DsrEnumerateDomainTrusts r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* In parameters */
r . in . server_name = server_name ;
r . in . trust_flags = trust_flags ;
status = cli - > dispatch ( cli ,
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRENUMERATEDOMAINTRUSTS ,
& r ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
return status ;
}
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
/* Return variables */
* trusts = * r . out . trusts ;
/* Return result */
if ( werror ) {
* werror = r . out . result ;
}
return werror_to_ntstatus ( r . out . result ) ;
}
struct rpccli_netr_DsrDeregisterDNSHostRecords_state {
struct netr_DsrDeregisterDNSHostRecords orig ;
struct netr_DsrDeregisterDNSHostRecords tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsrDeregisterDNSHostRecords_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsrDeregisterDNSHostRecords_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _domain /* [in] [unique,charset(UTF16)] */ ,
struct GUID * _domain_guid /* [in] [unique] */ ,
struct GUID * _dsa_guid /* [in] [unique] */ ,
const char * _dns_host /* [in] [ref,charset(UTF16)] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsrDeregisterDNSHostRecords_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsrDeregisterDNSHostRecords_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . domain = _domain ;
state - > orig . in . domain_guid = _domain_guid ;
state - > orig . in . dsa_guid = _dsa_guid ;
state - > orig . in . dns_host = _dns_host ;
/* Out parameters */
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsrDeregisterDNSHostRecords_done , req ) ;
return req ;
}
static void rpccli_netr_DsrDeregisterDNSHostRecords_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsrDeregisterDNSHostRecords_state * state = tevent_req_data (
req , struct rpccli_netr_DsrDeregisterDNSHostRecords_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2009-07-30 18:56:42 +02:00
tevent_req_nterror ( req , status ) ;
return ;
2006-09-28 21:19:08 +00:00
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Copy out parameters */
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsrDeregisterDNSHostRecords_state * state = tevent_req_data (
req , struct rpccli_netr_DsrDeregisterDNSHostRecords_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
2006-09-19 01:27:20 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2009-07-30 18:56:42 +02:00
* result = state - > orig . out . result ;
2008-01-08 18:07:55 +01:00
2009-07-30 18:56:42 +02:00
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
2006-09-19 01:27:20 +00:00
}
2008-01-25 21:15:36 +01:00
NTSTATUS rpccli_netr_DsrDeregisterDNSHostRecords ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * domain /* [in] [unique,charset(UTF16)] */ ,
struct GUID * domain_guid /* [in] [unique] */ ,
struct GUID * dsa_guid /* [in] [unique] */ ,
const char * dns_host /* [in] [ref,charset(UTF16)] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2008-01-25 21:15:36 +01:00
struct netr_DsrDeregisterDNSHostRecords r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-25 21:15:36 +01:00
r . in . server_name = server_name ;
r . in . domain = domain ;
r . in . domain_guid = domain_guid ;
r . in . dsa_guid = dsa_guid ;
r . in . dns_host = dns_host ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRDEREGISTERDNSHOSTRECORDS ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_ServerTrustPasswordsGet_state {
struct netr_ServerTrustPasswordsGet orig ;
struct netr_ServerTrustPasswordsGet tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerTrustPasswordsGet_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerTrustPasswordsGet_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
enum netr_SchannelType _secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [out] [ref] */ ,
struct samr_Password * _password /* [out] [ref] */ ,
struct samr_Password * _password2 /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_ServerTrustPasswordsGet_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerTrustPasswordsGet_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . password = _password ;
state - > orig . out . password2 = _password2 ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerTrustPasswordsGet_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERTRUSTPASSWORDSGET ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerTrustPasswordsGet_done , req ) ;
return req ;
}
static void rpccli_netr_ServerTrustPasswordsGet_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerTrustPasswordsGet_state * state = tevent_req_data (
req , struct rpccli_netr_ServerTrustPasswordsGet_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . password = * state - > tmp . out . password ;
* state - > orig . out . password2 = * state - > tmp . out . password2 ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerTrustPasswordsGet_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerTrustPasswordsGet_state * state = tevent_req_data (
req , struct rpccli_netr_ServerTrustPasswordsGet_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_ServerTrustPasswordsGet ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2009-08-03 09:51:44 +02:00
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
enum netr_SchannelType secure_channel_type /* [in] */ ,
2009-08-03 09:51:44 +02:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [out] [ref] */ ,
struct samr_Password * password /* [out] [ref] */ ,
struct samr_Password * password2 /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_ServerTrustPasswordsGet r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-17 10:00:37 +01:00
NDR_NETR_SERVERTRUSTPASSWORDSGET ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* return_authenticator = * r . out . return_authenticator ;
* password = * r . out . password ;
* password2 = * r . out . password2 ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2008-01-17 10:00:37 +01:00
return r . out . result ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_DsRGetForestTrustInformation_state {
struct netr_DsRGetForestTrustInformation orig ;
struct netr_DsRGetForestTrustInformation tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_DsRGetForestTrustInformation_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_DsRGetForestTrustInformation_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _trusted_domain_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t _flags /* [in] */ ,
struct lsa_ForestTrustInformation * * _forest_trust_info /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_DsRGetForestTrustInformation_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_DsRGetForestTrustInformation_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . trusted_domain_name = _trusted_domain_name ;
state - > orig . in . flags = _flags ;
/* Out parameters */
state - > orig . out . forest_trust_info = _forest_trust_info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_DsRGetForestTrustInformation_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_DSRGETFORESTTRUSTINFORMATION ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_DsRGetForestTrustInformation_done , req ) ;
return req ;
}
static void rpccli_netr_DsRGetForestTrustInformation_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_DsRGetForestTrustInformation_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetForestTrustInformation_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . forest_trust_info = * state - > tmp . out . forest_trust_info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_DsRGetForestTrustInformation_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
WERROR * result )
{
struct rpccli_netr_DsRGetForestTrustInformation_state * state = tevent_req_data (
req , struct rpccli_netr_DsRGetForestTrustInformation_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_DsRGetForestTrustInformation ( struct rpc_pipe_client * cli ,
2008-01-09 11:59:11 +01:00
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * trusted_domain_name /* [in] [unique,charset(UTF16)] */ ,
uint32_t flags /* [in] */ ,
struct lsa_ForestTrustInformation * * forest_trust_info /* [out] [ref] */ ,
2008-01-09 11:59:11 +01:00
WERROR * werror )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_DsRGetForestTrustInformation r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
r . in . trusted_domain_name = trusted_domain_name ;
r . in . flags = flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_DSRGETFORESTTRUSTINFORMATION ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* forest_trust_info = * r . out . forest_trust_info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2007-12-03 18:19:20 +01:00
if ( werror ) {
* werror = r . out . result ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
return werror_to_ntstatus ( r . out . result ) ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_GetForestTrustInformation_state {
struct netr_GetForestTrustInformation orig ;
struct netr_GetForestTrustInformation tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_GetForestTrustInformation_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_GetForestTrustInformation_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
2010-02-22 13:15:44 -05:00
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
2009-07-30 18:56:42 +02:00
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [out] [ref] */ ,
uint32_t _flags /* [in] */ ,
struct lsa_ForestTrustInformation * * _forest_trust_info /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_GetForestTrustInformation_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_GetForestTrustInformation_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
2010-02-22 13:15:44 -05:00
state - > orig . in . computer_name = _computer_name ;
2009-07-30 18:56:42 +02:00
state - > orig . in . credential = _credential ;
state - > orig . in . flags = _flags ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . forest_trust_info = _forest_trust_info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_GetForestTrustInformation_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_GETFORESTTRUSTINFORMATION ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_GetForestTrustInformation_done , req ) ;
return req ;
}
static void rpccli_netr_GetForestTrustInformation_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_GetForestTrustInformation_state * state = tevent_req_data (
req , struct rpccli_netr_GetForestTrustInformation_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . forest_trust_info = * state - > tmp . out . forest_trust_info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_GetForestTrustInformation_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
2010-02-22 13:15:44 -05:00
NTSTATUS * result )
2009-07-30 18:56:42 +02:00
{
struct rpccli_netr_GetForestTrustInformation_state * state = tevent_req_data (
req , struct rpccli_netr_GetForestTrustInformation_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-17 10:00:37 +01:00
NTSTATUS rpccli_netr_GetForestTrustInformation ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
2010-02-22 13:15:44 -05:00
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
2008-03-25 17:52:33 +01:00
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [out] [ref] */ ,
uint32_t flags /* [in] */ ,
2010-02-22 13:15:44 -05:00
struct lsa_ForestTrustInformation * * forest_trust_info /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2008-01-17 10:00:37 +01:00
struct netr_GetForestTrustInformation r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-01-17 10:00:37 +01:00
r . in . server_name = server_name ;
2010-02-22 13:15:44 -05:00
r . in . computer_name = computer_name ;
2008-01-17 10:00:37 +01:00
r . in . credential = credential ;
r . in . flags = flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-17 10:00:37 +01:00
NDR_NETR_GETFORESTTRUSTINFORMATION ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-01-17 10:00:37 +01:00
* return_authenticator = * r . out . return_authenticator ;
* forest_trust_info = * r . out . forest_trust_info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2010-02-22 13:15:44 -05:00
return r . out . result ;
2006-09-19 01:27:20 +00:00
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_LogonSamLogonWithFlags_state {
struct netr_LogonSamLogonWithFlags orig ;
struct netr_LogonSamLogonWithFlags tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_LogonSamLogonWithFlags_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_LogonSamLogonWithFlags_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * _credential /* [in] [unique] */ ,
struct netr_Authenticator * _return_authenticator /* [in,out] [unique] */ ,
enum netr_LogonInfoClass _logon_level /* [in] */ ,
union netr_LogonLevel * _logon /* [in] [ref,switch_is(logon_level)] */ ,
uint16_t _validation_level /* [in] */ ,
union netr_Validation * _validation /* [out] [ref,switch_is(validation_level)] */ ,
uint8_t * _authoritative /* [out] [ref] */ ,
uint32_t * _flags /* [in,out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_LogonSamLogonWithFlags_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_LogonSamLogonWithFlags_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
state - > orig . in . return_authenticator = _return_authenticator ;
state - > orig . in . logon_level = _logon_level ;
state - > orig . in . logon = _logon ;
state - > orig . in . validation_level = _validation_level ;
state - > orig . in . flags = _flags ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . validation = _validation ;
state - > orig . out . authoritative = _authoritative ;
state - > orig . out . flags = _flags ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_LogonSamLogonWithFlags_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_LOGONSAMLOGONWITHFLAGS ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_LogonSamLogonWithFlags_done , req ) ;
return req ;
}
static void rpccli_netr_LogonSamLogonWithFlags_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_LogonSamLogonWithFlags_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogonWithFlags_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
if ( state - > orig . out . return_authenticator & & state - > tmp . out . return_authenticator ) {
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
}
* state - > orig . out . validation = * state - > tmp . out . validation ;
* state - > orig . out . authoritative = * state - > tmp . out . authoritative ;
* state - > orig . out . flags = * state - > tmp . out . flags ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_LogonSamLogonWithFlags_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_LogonSamLogonWithFlags_state * state = tevent_req_data (
req , struct rpccli_netr_LogonSamLogonWithFlags_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-01-09 11:59:11 +01:00
NTSTATUS rpccli_netr_LogonSamLogonWithFlags ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
2008-03-25 17:52:33 +01:00
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * computer_name /* [in] [unique,charset(UTF16)] */ ,
struct netr_Authenticator * credential /* [in] [unique] */ ,
struct netr_Authenticator * return_authenticator /* [in,out] [unique] */ ,
2008-10-15 16:13:40 +02:00
enum netr_LogonInfoClass logon_level /* [in] */ ,
2008-10-29 02:44:59 +01:00
union netr_LogonLevel * logon /* [in] [ref,switch_is(logon_level)] */ ,
2008-03-25 17:52:33 +01:00
uint16_t validation_level /* [in] */ ,
union netr_Validation * validation /* [out] [ref,switch_is(validation_level)] */ ,
uint8_t * authoritative /* [out] [ref] */ ,
uint32_t * flags /* [in,out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
struct netr_LogonSamLogonWithFlags r ;
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
r . in . server_name = server_name ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
2007-01-16 15:42:03 +00:00
r . in . return_authenticator = return_authenticator ;
2006-09-19 01:27:20 +00:00
r . in . logon_level = logon_level ;
r . in . logon = logon ;
r . in . validation_level = validation_level ;
r . in . flags = flags ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-01-09 11:59:11 +01:00
NDR_NETR_LOGONSAMLOGONWITHFLAGS ,
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2007-10-17 10:35:51 +02:00
if ( return_authenticator & & r . out . return_authenticator ) {
2007-01-16 15:42:03 +00:00
* return_authenticator = * r . out . return_authenticator ;
}
2006-09-19 01:27:20 +00:00
* validation = * r . out . validation ;
* authoritative = * r . out . authoritative ;
* flags = * r . out . flags ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
return r . out . result ;
}
2009-07-30 18:56:42 +02:00
struct rpccli_netr_ServerGetTrustInfo_state {
struct netr_ServerGetTrustInfo orig ;
struct netr_ServerGetTrustInfo tmp ;
TALLOC_CTX * out_mem_ctx ;
NTSTATUS ( * dispatch_recv ) ( struct tevent_req * req , TALLOC_CTX * mem_ctx ) ;
} ;
static void rpccli_netr_ServerGetTrustInfo_done ( struct tevent_req * subreq ) ;
struct tevent_req * rpccli_netr_ServerGetTrustInfo_send ( TALLOC_CTX * mem_ctx ,
struct tevent_context * ev ,
struct rpc_pipe_client * cli ,
const char * _server_name /* [in] [unique,charset(UTF16)] */ ,
const char * _account_name /* [in] [ref,charset(UTF16)] */ ,
enum netr_SchannelType _secure_channel_type /* [in] */ ,
const char * _computer_name /* [in] [ref,charset(UTF16)] */ ,
struct netr_Authenticator * _credential /* [in] [ref] */ ,
struct netr_Authenticator * _return_authenticator /* [out] [ref] */ ,
struct samr_Password * _new_owf_password /* [out] [ref] */ ,
struct samr_Password * _old_owf_password /* [out] [ref] */ ,
struct netr_TrustInfo * * _trust_info /* [out] [ref] */ )
{
struct tevent_req * req ;
struct rpccli_netr_ServerGetTrustInfo_state * state ;
struct tevent_req * subreq ;
req = tevent_req_create ( mem_ctx , & state ,
struct rpccli_netr_ServerGetTrustInfo_state ) ;
if ( req = = NULL ) {
return NULL ;
}
state - > out_mem_ctx = NULL ;
state - > dispatch_recv = cli - > dispatch_recv ;
/* In parameters */
state - > orig . in . server_name = _server_name ;
state - > orig . in . account_name = _account_name ;
state - > orig . in . secure_channel_type = _secure_channel_type ;
state - > orig . in . computer_name = _computer_name ;
state - > orig . in . credential = _credential ;
/* Out parameters */
state - > orig . out . return_authenticator = _return_authenticator ;
state - > orig . out . new_owf_password = _new_owf_password ;
state - > orig . out . old_owf_password = _old_owf_password ;
state - > orig . out . trust_info = _trust_info ;
/* Result */
ZERO_STRUCT ( state - > orig . out . result ) ;
state - > out_mem_ctx = talloc_named_const ( state , 0 ,
" rpccli_netr_ServerGetTrustInfo_out_memory " ) ;
if ( tevent_req_nomem ( state - > out_mem_ctx , req ) ) {
return tevent_req_post ( req , ev ) ;
}
/* make a temporary copy, that we pass to the dispatch function */
state - > tmp = state - > orig ;
subreq = cli - > dispatch_send ( state , ev , cli ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2009-07-30 18:56:42 +02:00
NDR_NETR_SERVERGETTRUSTINFO ,
& state - > tmp ) ;
if ( tevent_req_nomem ( subreq , req ) ) {
return tevent_req_post ( req , ev ) ;
}
tevent_req_set_callback ( subreq , rpccli_netr_ServerGetTrustInfo_done , req ) ;
return req ;
}
static void rpccli_netr_ServerGetTrustInfo_done ( struct tevent_req * subreq )
{
struct tevent_req * req = tevent_req_callback_data (
subreq , struct tevent_req ) ;
struct rpccli_netr_ServerGetTrustInfo_state * state = tevent_req_data (
req , struct rpccli_netr_ServerGetTrustInfo_state ) ;
NTSTATUS status ;
TALLOC_CTX * mem_ctx ;
if ( state - > out_mem_ctx ) {
mem_ctx = state - > out_mem_ctx ;
} else {
mem_ctx = state ;
}
status = state - > dispatch_recv ( subreq , mem_ctx ) ;
TALLOC_FREE ( subreq ) ;
if ( ! NT_STATUS_IS_OK ( status ) ) {
tevent_req_nterror ( req , status ) ;
return ;
}
/* Copy out parameters */
* state - > orig . out . return_authenticator = * state - > tmp . out . return_authenticator ;
* state - > orig . out . new_owf_password = * state - > tmp . out . new_owf_password ;
* state - > orig . out . old_owf_password = * state - > tmp . out . old_owf_password ;
* state - > orig . out . trust_info = * state - > tmp . out . trust_info ;
/* Copy result */
state - > orig . out . result = state - > tmp . out . result ;
/* Reset temporary structure */
ZERO_STRUCT ( state - > tmp ) ;
tevent_req_done ( req ) ;
}
NTSTATUS rpccli_netr_ServerGetTrustInfo_recv ( struct tevent_req * req ,
TALLOC_CTX * mem_ctx ,
NTSTATUS * result )
{
struct rpccli_netr_ServerGetTrustInfo_state * state = tevent_req_data (
req , struct rpccli_netr_ServerGetTrustInfo_state ) ;
NTSTATUS status ;
if ( tevent_req_is_nterror ( req , & status ) ) {
tevent_req_received ( req ) ;
return status ;
}
/* Steal possbile out parameters to the callers context */
talloc_steal ( mem_ctx , state - > out_mem_ctx ) ;
/* Return result */
* result = state - > orig . out . result ;
tevent_req_received ( req ) ;
return NT_STATUS_OK ;
}
2008-12-10 02:53:36 +01:00
NTSTATUS rpccli_netr_ServerGetTrustInfo ( struct rpc_pipe_client * cli ,
TALLOC_CTX * mem_ctx ,
const char * server_name /* [in] [unique,charset(UTF16)] */ ,
const char * account_name /* [in] [ref,charset(UTF16)] */ ,
enum netr_SchannelType secure_channel_type /* [in] */ ,
const char * computer_name /* [in] [ref,charset(UTF16)] */ ,
struct netr_Authenticator * credential /* [in] [ref] */ ,
struct netr_Authenticator * return_authenticator /* [out] [ref] */ ,
struct samr_Password * new_owf_password /* [out] [ref] */ ,
struct samr_Password * old_owf_password /* [out] [ref] */ ,
2008-12-13 00:24:02 +01:00
struct netr_TrustInfo * * trust_info /* [out] [ref] */ )
2006-09-19 01:27:20 +00:00
{
2008-12-10 02:53:36 +01:00
struct netr_ServerGetTrustInfo r ;
2006-09-19 01:27:20 +00:00
NTSTATUS status ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* In parameters */
2008-12-10 02:53:36 +01:00
r . in . server_name = server_name ;
r . in . account_name = account_name ;
r . in . secure_channel_type = secure_channel_type ;
r . in . computer_name = computer_name ;
r . in . credential = credential ;
2008-01-08 18:07:55 +01:00
2009-01-21 13:40:18 +01:00
status = cli - > dispatch ( cli ,
2008-01-09 11:59:11 +01:00
mem_ctx ,
2009-11-08 19:38:01 +01:00
& ndr_table_netlogon ,
2008-12-10 02:53:36 +01:00
NDR_NETR_SERVERGETTRUSTINFO ,
2008-01-09 11:59:11 +01:00
& r ) ;
2008-01-08 18:07:55 +01:00
2007-02-16 14:50:57 +00:00
if ( ! NT_STATUS_IS_OK ( status ) ) {
2006-09-28 21:19:08 +00:00
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
if ( NT_STATUS_IS_ERR ( status ) ) {
return status ;
}
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return variables */
2008-12-10 02:53:36 +01:00
* return_authenticator = * r . out . return_authenticator ;
* new_owf_password = * r . out . new_owf_password ;
* old_owf_password = * r . out . old_owf_password ;
* trust_info = * r . out . trust_info ;
2008-01-08 18:07:55 +01:00
2006-09-19 01:27:20 +00:00
/* Return result */
2008-12-13 00:24:02 +01:00
return r . out . result ;
2006-09-19 01:27:20 +00:00
}