s3-rpc_client: Move client pipe functions to own header.
[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 struct tevent_req *rpc_api_pipe_req_send(TALLOC_CTX *mem_ctx,
27                                          struct event_context *ev,
28                                          struct rpc_pipe_client *cli,
29                                          uint8_t op_num,
30                                          DATA_BLOB *req_data);
31
32 NTSTATUS rpc_api_pipe_req_recv(struct tevent_req *req,
33                                TALLOC_CTX *mem_ctx,
34                                DATA_BLOB *reply_pdu);
35
36 struct tevent_req *rpc_pipe_bind_send(TALLOC_CTX *mem_ctx,
37                                       struct event_context *ev,
38                                       struct rpc_pipe_client *cli,
39                                       struct pipe_auth_data *auth);
40
41 NTSTATUS rpc_pipe_bind_recv(struct tevent_req *req);
42
43 NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
44                        struct pipe_auth_data *auth);
45
46 unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
47                                 unsigned int timeout);
48
49 bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli);
50
51 bool rpccli_get_pwd_hash(struct rpc_pipe_client *cli, uint8_t nt_hash[16]);
52
53 NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
54                                struct pipe_auth_data **presult);
55
56 NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx,
57                                    const char *domain,
58                                    enum dcerpc_AuthLevel auth_level,
59                                    struct netlogon_creds_CredentialState *creds,
60                                    struct pipe_auth_data **presult);
61
62 NTSTATUS rpc_pipe_open_tcp(TALLOC_CTX *mem_ctx,
63                            const char *host,
64                            const struct ndr_syntax_id *abstract_syntax,
65                            struct rpc_pipe_client **presult);
66
67 NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
68                                const struct ndr_syntax_id *abstract_syntax,
69                                struct rpc_pipe_client **presult);
70
71 struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c);
72
73 NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
74                                   const struct ndr_syntax_id *interface,
75                                   struct rpc_pipe_client **presult);
76
77 NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
78                                             enum dcerpc_transport_t transport,
79                                             const struct ndr_syntax_id *interface,
80                                             struct rpc_pipe_client **presult);
81
82 NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
83                                    const struct ndr_syntax_id *interface,
84                                    enum dcerpc_transport_t transport,
85                                    enum dcerpc_AuthLevel auth_level,
86                                    const char *domain,
87                                    const char *username,
88                                    const char *password,
89                                    struct rpc_pipe_client **presult);
90
91 NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
92                                           const struct ndr_syntax_id *interface,
93                                           enum dcerpc_transport_t transport,
94                                           enum dcerpc_AuthLevel auth_level,
95                                           const char *domain,
96                                           const char *username,
97                                           const char *password,
98                                           struct rpc_pipe_client **presult);
99
100 NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
101                                              const struct ndr_syntax_id *interface,
102                                              enum dcerpc_transport_t transport,
103                                              enum dcerpc_AuthLevel auth_level,
104                                              const char *domain,
105                                              struct netlogon_creds_CredentialState **pdc,
106                                              struct rpc_pipe_client **presult);
107
108 NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
109                                                  const struct ndr_syntax_id *interface,
110                                                  enum dcerpc_transport_t transport,
111                                                  enum dcerpc_AuthLevel auth_level,
112                                                  const char *domain,
113                                                  const char *username,
114                                                  const char *password,
115                                                  struct rpc_pipe_client **presult);
116
117 NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
118                                     const struct ndr_syntax_id *interface,
119                                     enum dcerpc_transport_t transport,
120                                     enum dcerpc_AuthLevel auth_level,
121                                     const char *domain,
122                                     struct rpc_pipe_client **presult);
123
124 NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
125                                 const struct ndr_syntax_id *interface,
126                                 enum dcerpc_transport_t transport,
127                                 enum dcerpc_AuthLevel auth_level,
128                                 const char *service_princ,
129                                 const char *username,
130                                 const char *password,
131                                 struct rpc_pipe_client **presult);
132
133 NTSTATUS cli_rpc_pipe_open_spnego_krb5(struct cli_state *cli,
134                                         const struct ndr_syntax_id *interface,
135                                         enum dcerpc_transport_t transport,
136                                         enum dcerpc_AuthLevel auth_level,
137                                         const char *server,
138                                         const char *username,
139                                         const char *password,
140                                         struct rpc_pipe_client **presult);
141
142 NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
143                              struct rpc_pipe_client *cli,
144                              DATA_BLOB *session_key);
145
146 #endif /* _CLI_PIPE_H */
147
148 /* vim: set ts=8 sw=8 noet cindent ft=c.doxygen: */