2 * Unix SMB/CIFS implementation.
4 * RPC Pipe client routines
6 * Copyright (c) 2005 Jeremy Allison
7 * Copyright (c) 2010 Simo Sorce
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.
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.
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/>.
26 #include "rpc_client/rpc_client.h"
27 #include "auth/credentials/credentials.h"
29 /* The following definitions come from rpc_client/cli_pipe.c */
31 struct tevent_req
*rpc_pipe_bind_send(TALLOC_CTX
*mem_ctx
,
32 struct tevent_context
*ev
,
33 struct rpc_pipe_client
*cli
,
34 struct pipe_auth_data
*auth
);
36 NTSTATUS
rpc_pipe_bind_recv(struct tevent_req
*req
);
38 NTSTATUS
rpc_pipe_bind(struct rpc_pipe_client
*cli
,
39 struct pipe_auth_data
*auth
);
41 struct tevent_req
*rpc_pipe_open_np_send(
43 struct tevent_context
*ev
,
44 struct cli_state
*cli
,
45 const struct ndr_interface_table
*table
);
46 NTSTATUS
rpc_pipe_open_np_recv(
47 struct tevent_req
*req
,
49 struct rpc_pipe_client
**_result
);
51 unsigned int rpccli_set_timeout(struct rpc_pipe_client
*cli
,
52 unsigned int timeout
);
54 bool rpccli_is_connected(struct rpc_pipe_client
*rpc_cli
);
56 NTSTATUS
rpccli_ncalrpc_bind_data(TALLOC_CTX
*mem_ctx
,
57 struct pipe_auth_data
**presult
);
59 NTSTATUS
rpccli_anon_bind_data(TALLOC_CTX
*mem_ctx
,
60 struct pipe_auth_data
**presult
);
62 NTSTATUS
rpc_pipe_open_ncalrpc(TALLOC_CTX
*mem_ctx
,
63 const struct ndr_interface_table
*table
,
64 struct rpc_pipe_client
**presult
);
66 NTSTATUS
rpc_pipe_open_local_np(
68 const struct ndr_interface_table
*table
,
69 const char *remote_client_name
,
70 const struct tsocket_address
*remote_client_addr
,
71 const char *local_server_name
,
72 const struct tsocket_address
*local_server_addr
,
73 const struct auth_session_info
*session_info
,
74 struct rpc_pipe_client
**presult
);
76 struct dcerpc_binding_handle
*rpccli_bh_create(struct rpc_pipe_client
*c
,
77 const struct GUID
*object
,
78 const struct ndr_interface_table
*table
);
80 NTSTATUS
cli_rpc_pipe_open_noauth(struct cli_state
*cli
,
81 const struct ndr_interface_table
*table
,
82 struct rpc_pipe_client
**presult
);
84 NTSTATUS
cli_rpc_pipe_client_prepare_alter(struct rpc_pipe_client
*p
,
85 bool new_auth_context
,
86 const struct ndr_interface_table
*table
,
87 bool new_pres_context
);
89 NTSTATUS
cli_rpc_pipe_open_noauth_transport(struct cli_state
*cli
,
90 enum dcerpc_transport_t transport
,
91 const struct ndr_interface_table
*table
,
92 const char *remote_name
,
93 const struct sockaddr_storage
*remote_sockaddr
,
94 struct rpc_pipe_client
**presult
);
96 /****************************************************************************
97 Open a named pipe to an SMB server and bind using the mech specified
99 This routine steals the creds pointer that is passed in
100 ****************************************************************************/
102 NTSTATUS
cli_rpc_pipe_open_with_creds(struct cli_state
*cli
,
103 const struct ndr_interface_table
*table
,
104 enum dcerpc_transport_t transport
,
105 enum dcerpc_AuthType auth_type
,
106 enum dcerpc_AuthLevel auth_level
,
107 const char *target_service
,
108 const char *target_hostname
,
109 const struct sockaddr_storage
*remote_sockaddr
,
110 struct cli_credentials
*creds
,
111 struct rpc_pipe_client
**presult
);
113 NTSTATUS
cli_rpc_pipe_client_auth_schannel(
114 struct rpc_pipe_client
*rpccli
,
115 const struct ndr_interface_table
*table
,
116 struct netlogon_creds_cli_context
*netlogon_creds
);
117 NTSTATUS
cli_rpc_pipe_open_bind_schannel(
118 struct cli_state
*cli
,
119 const struct ndr_interface_table
*table
,
120 enum dcerpc_transport_t transport
,
121 struct netlogon_creds_cli_context
*netlogon_creds
,
122 const char *remote_name
,
123 const struct sockaddr_storage
*remote_sockaddr
,
124 struct rpc_pipe_client
**_rpccli
);
125 NTSTATUS
cli_rpc_pipe_open_schannel_with_creds(struct cli_state
*cli
,
126 const struct ndr_interface_table
*table
,
127 enum dcerpc_transport_t transport
,
128 struct netlogon_creds_cli_context
*netlogon_creds
,
129 const char *remote_name
,
130 const struct sockaddr_storage
*remote_sockaddr
,
131 struct rpc_pipe_client
**_rpccli
);
133 NTSTATUS
cli_rpc_pipe_open_schannel(struct cli_state
*cli
,
134 struct messaging_context
*msg_ctx
,
135 const struct ndr_interface_table
*table
,
136 enum dcerpc_transport_t transport
,
138 const char *remote_name
,
139 const struct sockaddr_storage
*remote_sockaddr
,
140 struct rpc_pipe_client
**presult
,
142 struct netlogon_creds_cli_context
**pcreds
);
144 #endif /* _CLI_PIPE_H */
146 /* vim: set ts=8 sw=8 noet cindent ft=c.doxygen: */