1bfb551cf391f6a5e2d20b927b7b497fc6fc920e
[samba.git] / source3 / rpc_client / cli_pipe.h
1 /*
2  *  Unix SMB/CIFS implementation.
3  *
4  *  RPC Pipe client routines
5  *
6  *  Copyright (c) 2005      Jeremy Allison
7  *  Copyright (c) 2010      Simo Sorce
8  *
9  *  This program is free software; you can redistribute it and/or modify
10  *  it under the terms of the GNU General Public License as published by
11  *  the Free Software Foundation; either version 3 of the License, or
12  *  (at your option) any later version.
13  *
14  *  This program is distributed in the hope that it will be useful,
15  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *  GNU General Public License for more details.
18  *
19  *  You should have received a copy of the GNU General Public License
20  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
21  */
22
23 #ifndef _CLI_PIPE_H
24 #define _CLI_PIPE_H
25
26 #include "rpc_client/rpc_client.h"
27
28 /* The following definitions come from rpc_client/cli_pipe.c  */
29
30 struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,
31                                       struct tevent_context *ev,
32                                       struct rpc_pipe_client *cli,
33                                       struct pipe_auth_data *auth);
34
35 NTSTATUS rpc_pipe_bind_recv(struct tevent_req *req);
36
37 NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
38                        struct pipe_auth_data *auth);
39
40 unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
41                                 unsigned int timeout);
42
43 bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli);
44
45 NTSTATUS rpccli_ncalrpc_bind_data(TALLOC_CTX *mem_ctx,
46                                   struct pipe_auth_data **presult);
47
48 NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
49                                struct pipe_auth_data **presult);
50
51 NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx,
52                            const char *host,
53                            const struct sockaddr_storage *ss_addr,
54                            const struct ndr_interface_table *table,
55                            struct rpc_pipe_client **presult);
56
57 NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
58                                const struct ndr_interface_table *table,
59                                struct rpc_pipe_client **presult);
60
61 struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c,
62                                         const struct GUID *object,
63                                         const struct ndr_interface_table *table);
64
65 NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
66                                   const struct ndr_interface_table *table,
67                                   struct rpc_pipe_client **presult);
68
69 NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
70                                             enum dcerpc_transport_t transport,
71                                             const struct ndr_interface_table *table,
72                                             struct rpc_pipe_client **presult);
73
74 NTSTATUS cli_rpc_pipe_open_generic_auth(struct cli_state *cli,
75                                         const struct ndr_interface_table *table,
76                                         enum dcerpc_transport_t transport,
77                                         enum dcerpc_AuthType auth_type,
78                                         enum dcerpc_AuthLevel auth_level,
79                                         const char *server,
80                                         const char *domain,
81                                         const char *username,
82                                         const char *password,
83                                         struct rpc_pipe_client **presult);
84
85 NTSTATUS cli_rpc_pipe_open_spnego(struct cli_state *cli,
86                                   const struct ndr_interface_table *table,
87                                   enum dcerpc_transport_t transport,
88                                   const char *oid,
89                                   enum dcerpc_AuthLevel auth_level,
90                                   const char *server,
91                                   const char *domain,
92                                   const char *username,
93                                   const char *password,
94                                   struct rpc_pipe_client **presult);
95
96 NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
97                                              const struct ndr_interface_table *table,
98                                              enum dcerpc_transport_t transport,
99                                              enum dcerpc_AuthLevel auth_level,
100                                              const char *domain,
101                                              struct netlogon_creds_CredentialState **pdc,
102                                              struct rpc_pipe_client **presult);
103
104 NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
105                                     const struct ndr_interface_table *table,
106                                     enum dcerpc_transport_t transport,
107                                     enum dcerpc_AuthLevel auth_level,
108                                     const char *domain,
109                                     struct rpc_pipe_client **presult);
110
111 NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
112                              struct rpc_pipe_client *cli,
113                              DATA_BLOB *session_key);
114
115 /* The following definitions come from rpc_client/cli_pipe_schannel.c  */
116
117 NTSTATUS get_schannel_session_key(struct cli_state *cli,
118                                   const char *domain,
119                                   uint32 *pneg_flags,
120                                   struct rpc_pipe_client **presult);
121
122 #endif /* _CLI_PIPE_H */
123
124 /* vim: set ts=8 sw=8 noet cindent ft=c.doxygen: */