2 * Unix SMB/CIFS implementation.
3 * test program for rpc_pipe_open_tcp().
5 * Copyright (C) Michael Adam 2008
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/>.
22 #include "rpc_client/cli_pipe.h"
23 #include "librpc/gen_ndr/ndr_dfs.h"
24 #include "librpc/gen_ndr/ndr_drsuapi.h"
25 #include "librpc/gen_ndr/ndr_dssetup.h"
26 #include "librpc/gen_ndr/ndr_echo.h"
27 #include "librpc/gen_ndr/ndr_epmapper.h"
28 #include "librpc/gen_ndr/ndr_eventlog.h"
29 #include "librpc/gen_ndr/ndr_initshutdown.h"
30 #include "librpc/gen_ndr/ndr_lsa.h"
31 #include "librpc/gen_ndr/ndr_netlogon.h"
32 #include "librpc/gen_ndr/ndr_ntsvcs.h"
33 #include "librpc/gen_ndr/ndr_samr.h"
34 #include "librpc/gen_ndr/ndr_srvsvc.h"
35 #include "librpc/gen_ndr/ndr_svcctl.h"
36 #include "librpc/gen_ndr/ndr_winreg.h"
37 #include "librpc/gen_ndr/ndr_wkssvc.h"
39 extern const struct ndr_interface_table ndr_table_netdfs;
40 extern const struct ndr_interface_table ndr_table_drsuapi;
41 extern const struct ndr_interface_table ndr_table_dssetup;
42 extern const struct ndr_interface_table ndr_table_rpcecho;
43 extern const struct ndr_interface_table ndr_table_epmapper;
44 extern const struct ndr_interface_table ndr_table_eventlog;
45 extern const struct ndr_interface_table ndr_table_initshutdown;
46 extern const struct ndr_interface_table ndr_table_lsarpc;
47 extern const struct ndr_interface_table ndr_table_netlogon;
48 extern const struct ndr_interface_table ndr_table_ntsvcs;
49 extern const struct ndr_interface_table ndr_table_samr;
50 extern const struct ndr_interface_table ndr_table_srvsvc;
51 extern const struct ndr_interface_table ndr_table_svcctl;
52 extern const struct ndr_interface_table ndr_table_winreg;
53 extern const struct ndr_interface_table ndr_table_wkssvc;
55 const struct ndr_interface_table *tables[] = {
62 &ndr_table_initshutdown,
74 int main(int argc, const char **argv)
76 const struct ndr_interface_table **table;
78 struct rpc_pipe_client *rpc_pipe = NULL;
79 TALLOC_CTX *mem_ctx = talloc_stackframe();
82 d_printf("USAGE: %s interface host\n", argv[0]);
86 for (table = tables; *table != NULL; table++) {
87 if (strequal((*table)->name, argv[1])) {
93 d_printf("ERROR: unknown interface '%s' given\n", argv[1]);
97 status = rpc_pipe_open_tcp(mem_ctx, argv[2], &((*table)->syntax_id),
99 if (!NT_STATUS_IS_OK(status)) {
100 d_printf("ERROR calling rpc_pipe_open_tcp(): %s\n",
105 TALLOC_FREE(mem_ctx);