2006-03-14 15:02:05 +00:00
/*
Unix SMB / CIFS implementation .
SMB torture tester
Copyright ( C ) Andrew Tridgell 1997 - 2003
Copyright ( C ) Jelmer Vernooij 2006
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2006-03-14 15:02:05 +00:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2006-03-14 15:02:05 +00:00
*/
# ifndef __TORTURE_RPC_H__
# define __TORTURE_RPC_H__
2008-11-16 00:58:08 +01:00
# include "lib/torture/torture.h"
2006-03-14 15:02:05 +00:00
# include "auth/credentials/credentials.h"
# include "torture/rpc/drsuapi.h"
# include "libnet/libnet_join.h"
2006-03-18 15:42:57 +00:00
# include "librpc/rpc/dcerpc.h"
2006-07-17 08:05:02 +00:00
# include "libcli/raw/libcliraw.h"
2010-03-04 18:00:15 +02:00
# include "librpc/gen_ndr/ndr_spoolss.h"
2006-03-14 15:02:05 +00:00
# include "torture/rpc/proto.h"
2007-08-31 22:34:52 +00:00
struct torture_rpc_tcase {
struct torture_tcase tcase ;
const struct ndr_interface_table * table ;
const char * machine_name ;
2019-04-16 16:54:21 +02:00
bool ( * setup_fn ) ( struct torture_context * ,
struct dcerpc_pipe * ,
void * ) ;
bool ( * teardown_fn ) ( struct torture_context * ,
struct dcerpc_pipe * ,
void * ) ;
2007-08-31 22:34:52 +00:00
} ;
struct torture_rpc_tcase_data {
struct test_join * join_ctx ;
struct dcerpc_pipe * pipe ;
struct cli_credentials * credentials ;
} ;
2008-04-02 04:53:27 +02:00
NTSTATUS torture_rpc_connection ( struct torture_context * tctx ,
struct dcerpc_pipe * * p ,
const struct ndr_interface_table * table ) ;
2016-10-27 14:12:35 +02:00
NTSTATUS torture_rpc_connection_with_binding ( struct torture_context * tctx ,
struct dcerpc_binding * binding ,
struct dcerpc_pipe * * p ,
const struct ndr_interface_table * table ) ;
2008-04-02 04:53:27 +02:00
struct test_join * torture_join_domain ( struct torture_context * tctx ,
const char * machine_name ,
uint32_t acct_flags ,
struct cli_credentials * * machine_credentials ) ;
const struct dom_sid * torture_join_sid ( struct test_join * join ) ;
2008-06-14 11:24:17 -04:00
void torture_leave_domain ( struct torture_context * tctx , struct test_join * join ) ;
2008-04-02 04:53:27 +02:00
struct torture_rpc_tcase * torture_suite_add_rpc_iface_tcase ( struct torture_suite * suite ,
const char * name ,
const struct ndr_interface_table * table ) ;
2019-04-16 16:54:21 +02:00
struct torture_rpc_tcase * torture_suite_add_rpc_setup_tcase (
struct torture_suite * suite ,
const char * name ,
const struct ndr_interface_table * table ,
bool ( * setup_fn ) ( struct torture_context * ,
struct dcerpc_pipe * ,
void * ) ,
bool ( * teardown_fn ) ( struct torture_context * ,
struct dcerpc_pipe * ,
void * ) ) ;
2008-04-02 04:53:27 +02:00
struct torture_test * torture_rpc_tcase_add_test (
struct torture_rpc_tcase * tcase ,
const char * name ,
bool ( * fn ) ( struct torture_context * , struct dcerpc_pipe * ) ) ;
struct torture_rpc_tcase * torture_suite_add_anon_rpc_iface_tcase ( struct torture_suite * suite ,
const char * name ,
const struct ndr_interface_table * table ) ;
2010-11-02 17:14:55 +11:00
struct torture_test * torture_rpc_tcase_add_test_join (
struct torture_rpc_tcase * tcase ,
const char * name ,
bool ( * fn ) ( struct torture_context * , struct dcerpc_pipe * ,
struct cli_credentials * , struct test_join * ) ) ;
2019-04-16 16:54:21 +02:00
_PUBLIC_ struct torture_test * torture_rpc_tcase_add_test_setup (
struct torture_rpc_tcase * tcase ,
const char * name ,
bool ( * fn ) ( struct torture_context * ,
struct dcerpc_pipe * ,
void * ) ,
void * userdata ) ;
2008-04-02 04:53:27 +02:00
struct torture_test * torture_rpc_tcase_add_test_ex (
struct torture_rpc_tcase * tcase ,
const char * name ,
bool ( * fn ) ( struct torture_context * , struct dcerpc_pipe * ,
void * ) ,
void * userdata ) ;
2009-06-26 16:51:53 +02:00
struct torture_rpc_tcase * torture_suite_add_machine_bdc_rpc_iface_tcase (
struct torture_suite * suite ,
const char * name ,
const struct ndr_interface_table * table ,
const char * machine_name ) ;
struct torture_rpc_tcase * torture_suite_add_machine_workstation_rpc_iface_tcase (
2008-04-02 04:53:27 +02:00
struct torture_suite * suite ,
const char * name ,
const struct ndr_interface_table * table ,
const char * machine_name ) ;
struct torture_test * torture_rpc_tcase_add_test_creds (
struct torture_rpc_tcase * tcase ,
const char * name ,
bool ( * fn ) ( struct torture_context * , struct dcerpc_pipe * , struct cli_credentials * ) ) ;
bool torture_suite_init_rpc_tcase ( struct torture_suite * suite ,
struct torture_rpc_tcase * tcase ,
const char * name ,
const struct ndr_interface_table * table ) ;
2007-08-31 22:34:52 +00:00
2006-03-14 15:02:05 +00:00
# endif /* __TORTURE_RPC_H__ */