summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorLuk Claes <luk@debian.org>2012-05-10 18:36:47 +0200
committerStefan Metzmacher <metze@samba.org>2012-05-12 00:46:09 +0200
commit5f4a009f4fe366ed13c1c681595ae95554643768 (patch)
tree4e409db82eabd385dca5ec313da171e3b3602f64 /source3/libsmb
parent473363a8078fca8ba7dbbdf310d984167cf92bf4 (diff)
downloadsamba-5f4a009f4fe366ed13c1c681595ae95554643768.tar.gz
samba-5f4a009f4fe366ed13c1c681595ae95554643768.tar.bz2
samba-5f4a009f4fe366ed13c1c681595ae95554643768.zip
s3/libsmb: Generalise cli_state in smb2 ioctl calls
Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cli_np_tstream.c5
-rw-r--r--source3/libsmb/smb2cli.h10
-rw-r--r--source3/libsmb/smb2cli_ioctl.c25
3 files changed, 28 insertions, 12 deletions
diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c
index 612a2c3fb2..9bf5611d96 100644
--- a/source3/libsmb/cli_np_tstream.c
+++ b/source3/libsmb/cli_np_tstream.c
@@ -808,7 +808,10 @@ static void tstream_cli_np_readv_trans_start(struct tevent_req *req)
cli_nps->write.ofs);
subreq = smb2cli_ioctl_send(state, state->ev,
- cli_nps->cli,
+ cli_nps->cli->conn,
+ cli_nps->cli->timeout,
+ cli_nps->cli->smb2.session,
+ cli_nps->cli->smb2.tid,
cli_nps->fid_persistent,
cli_nps->fid_volatile,
FSCTL_NAMED_PIPE_READ_WRITE,
diff --git a/source3/libsmb/smb2cli.h b/source3/libsmb/smb2cli.h
index c20589ef83..121ba3bede 100644
--- a/source3/libsmb/smb2cli.h
+++ b/source3/libsmb/smb2cli.h
@@ -188,7 +188,10 @@ NTSTATUS smb2cli_query_directory(struct cli_state *cli,
struct tevent_req *smb2cli_ioctl_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct cli_state *cli,
+ struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint64_t in_fid_persistent,
uint64_t in_fid_volatile,
uint32_t in_ctl_code,
@@ -201,7 +204,10 @@ NTSTATUS smb2cli_ioctl_recv(struct tevent_req *req,
TALLOC_CTX *mem_ctx,
DATA_BLOB *out_input_buffer,
DATA_BLOB *out_output_buffer);
-NTSTATUS smb2cli_ioctl(struct cli_state *cli,
+NTSTATUS smb2cli_ioctl(struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint64_t in_fid_persistent,
uint64_t in_fid_volatile,
uint32_t in_ctl_code,
diff --git a/source3/libsmb/smb2cli_ioctl.c b/source3/libsmb/smb2cli_ioctl.c
index 58c348d882..4b83355b88 100644
--- a/source3/libsmb/smb2cli_ioctl.c
+++ b/source3/libsmb/smb2cli_ioctl.c
@@ -40,7 +40,10 @@ static void smb2cli_ioctl_done(struct tevent_req *subreq);
struct tevent_req *smb2cli_ioctl_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
- struct cli_state *cli,
+ struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint64_t in_fid_persistent,
uint64_t in_fid_volatile,
uint32_t in_ctl_code,
@@ -132,12 +135,12 @@ struct tevent_req *smb2cli_ioctl_send(TALLOC_CTX *mem_ctx,
dyn_len = sizeof(state->dyn_pad);
}
- subreq = smb2cli_req_send(state, ev, cli->conn, SMB2_OP_IOCTL,
+ subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_IOCTL,
0, 0, /* flags */
- cli->timeout,
- cli->smb2.pid,
- cli->smb2.tid,
- cli->smb2.session,
+ timeout_msec,
+ 0xFEFF, /* pid */
+ tcon_id,
+ session,
state->fixed, sizeof(state->fixed),
dyn, dyn_len);
if (tevent_req_nomem(subreq, req)) {
@@ -277,7 +280,10 @@ NTSTATUS smb2cli_ioctl_recv(struct tevent_req *req,
return NT_STATUS_OK;
}
-NTSTATUS smb2cli_ioctl(struct cli_state *cli,
+NTSTATUS smb2cli_ioctl(struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ uint32_t tcon_id,
uint64_t in_fid_persistent,
uint64_t in_fid_volatile,
uint32_t in_ctl_code,
@@ -295,7 +301,7 @@ NTSTATUS smb2cli_ioctl(struct cli_state *cli,
struct tevent_req *req;
NTSTATUS status = NT_STATUS_NO_MEMORY;
- if (cli_has_async_calls(cli)) {
+ if (smbXcli_conn_has_async_calls(conn)) {
/*
* Can't use sync call while an async call is in flight
*/
@@ -306,7 +312,8 @@ NTSTATUS smb2cli_ioctl(struct cli_state *cli,
if (ev == NULL) {
goto fail;
}
- req = smb2cli_ioctl_send(frame, ev, cli,
+ req = smb2cli_ioctl_send(frame, ev, conn, timeout_msec,
+ session, tcon_id,
in_fid_persistent,
in_fid_volatile,
in_ctl_code,