This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
*/
static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
if (smb->dead) {
return;
NTSTATUS status;
state = talloc_get_type(req->async.private, struct smb_read_state);
- smb = talloc_get_type(state->c->transport.private, struct smb_private);
+ smb = talloc_get_type(state->c->transport.private_data, struct smb_private);
io = state->io;
status = smb_raw_read_recv(state->req, io);
*/
static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLOB *blob)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
union smb_read *io;
struct smb_read_state *state;
struct smbcli_request *req;
*/
static NTSTATUS send_read_request(struct dcerpc_connection *c)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
if (smb->dead) {
return NT_STATUS_CONNECTION_DISCONNECTED;
*/
static NTSTATUS smb_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *blob)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
struct smb_trans2 *trans;
uint16_t setup[2];
struct smb_trans_state *state;
*/
static NTSTATUS smb_send_request(struct dcerpc_connection *c, DATA_BLOB *blob, BOOL trigger_read)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
union smb_write io;
struct smbcli_request *req;
*/
static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
union smb_close io;
struct smbcli_request *req;
*/
static const char *smb_peer_name(struct dcerpc_connection *c)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
return smb->server_name;
}
*/
static const char *smb_target_hostname(struct dcerpc_connection *c)
{
- struct smb_private *smb = talloc_get_type(c->transport.private, struct smb_private);
+ struct smb_private *smb = talloc_get_type(c->transport.private_data, struct smb_private);
return smb->tree->session->transport->socket->hostname;
}
*/
static NTSTATUS smb_session_key(struct dcerpc_connection *c, DATA_BLOB *session_key)
{
- struct smb_private *smb = c->transport.private;
+ struct smb_private *smb = c->transport.private_data;
if (smb->tree->session->user_session_key.data) {
*session_key = smb->tree->session->user_session_key;
fill in the transport methods
*/
c->transport.transport = NCACN_NP;
- c->transport.private = NULL;
+ c->transport.private_data = NULL;
c->transport.shutdown_pipe = smb_shutdown_pipe;
c->transport.peer_name = smb_peer_name;
c->transport.target_hostname = smb_target_hostname;
if (composite_nomem(smb->server_name, ctx)) return;
smb->dead = false;
- c->transport.private = smb;
+ c->transport.private_data = smb;
composite_done(ctx);
}
if (c->transport.transport != NCACN_NP) return NULL;
- smb = talloc_get_type(c->transport.private, struct smb_private);
+ smb = talloc_get_type(c->transport.private_data, struct smb_private);
if (!smb) return NULL;
return smb->tree;
}
+
+/*
+ return the SMB fnum used for a dcerpc over SMB pipe (hack for torture operations)
+*/
+uint16_t dcerpc_smb_fnum(struct dcerpc_connection *c)
+{
+ struct smb_private *smb;
+
+ if (c->transport.transport != NCACN_NP) return 0;
+
+ smb = talloc_get_type(c->transport.private_data, struct smb_private);
+ if (!smb) return 0;
+
+ return smb->fnum;
+}