Use ntvfs session close to close downstream session
[Samba/vfs_proxy.git] / source4 / torture / rpc / rpc.h
blob9fd64f18b5f17dd32fff274953e85b4561fd18ef
1 /*
2 Unix SMB/CIFS implementation.
3 SMB torture tester
4 Copyright (C) Andrew Tridgell 1997-2003
5 Copyright (C) Jelmer Vernooij 2006
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef __TORTURE_RPC_H__
22 #define __TORTURE_RPC_H__
24 #include "lib/torture/torture.h"
25 #include "auth/credentials/credentials.h"
26 #include "torture/rpc/drsuapi.h"
27 #include "libnet/libnet_join.h"
28 #include "librpc/rpc/dcerpc.h"
29 #include "libcli/raw/libcliraw.h"
30 #include "torture/rpc/proto.h"
32 struct torture_rpc_tcase {
33 struct torture_tcase tcase;
34 const struct ndr_interface_table *table;
35 const char *machine_name;
38 struct torture_rpc_tcase_data {
39 struct test_join *join_ctx;
40 struct dcerpc_pipe *pipe;
41 struct cli_credentials *credentials;
44 NTSTATUS torture_rpc_connection(struct torture_context *tctx,
45 struct dcerpc_pipe **p,
46 const struct ndr_interface_table *table);
48 struct test_join *torture_join_domain(struct torture_context *tctx,
49 const char *machine_name,
50 uint32_t acct_flags,
51 struct cli_credentials **machine_credentials);
52 const struct dom_sid *torture_join_sid(struct test_join *join);
53 void torture_leave_domain(struct torture_context *tctx, struct test_join *join);
54 struct torture_rpc_tcase *torture_suite_add_rpc_iface_tcase(struct torture_suite *suite,
55 const char *name,
56 const struct ndr_interface_table *table);
58 struct torture_test *torture_rpc_tcase_add_test(
59 struct torture_rpc_tcase *tcase,
60 const char *name,
61 bool (*fn) (struct torture_context *, struct dcerpc_pipe *));
62 struct torture_rpc_tcase *torture_suite_add_anon_rpc_iface_tcase(struct torture_suite *suite,
63 const char *name,
64 const struct ndr_interface_table *table);
66 struct torture_test *torture_rpc_tcase_add_test_ex(
67 struct torture_rpc_tcase *tcase,
68 const char *name,
69 bool (*fn) (struct torture_context *, struct dcerpc_pipe *,
70 void *),
71 void *userdata);
72 struct torture_rpc_tcase *torture_suite_add_machine_rpc_iface_tcase(
73 struct torture_suite *suite,
74 const char *name,
75 const struct ndr_interface_table *table,
76 const char *machine_name);
77 struct torture_test *torture_rpc_tcase_add_test_creds(
78 struct torture_rpc_tcase *tcase,
79 const char *name,
80 bool (*fn) (struct torture_context *, struct dcerpc_pipe *, struct cli_credentials *));
81 bool torture_suite_init_rpc_tcase(struct torture_suite *suite,
82 struct torture_rpc_tcase *tcase,
83 const char *name,
84 const struct ndr_interface_table *table);
88 #endif /* __TORTURE_RPC_H__ */