s3:libsmb: get rid of cli_smb_req_*,cli_smb_wct_ofs,cli_smb_chain_send
authorLuk Claes <luk@debian.org>
Sat, 26 May 2012 09:58:34 +0000 (11:58 +0200)
committerStefan Metzmacher <metze@samba.org>
Sun, 3 Jun 2012 21:37:02 +0000 (23:37 +0200)
Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jun  3 23:37:02 CEST 2012 on sn-devel-104

source3/include/async_smb.h
source3/libsmb/async_smb.c
source3/libsmb/cliconnect.c
source3/libsmb/clifile.c
source3/libsmb/clioplock.c
source3/libsmb/clireadwrite.c
source3/torture/test_chain3.c
source3/torture/torture.c

index 121a6ec326b6b0012e24bcc0dd7389c1a25459fa..00c2313b697506e963dc7e9bf03ddef52bc60e9a 100644 (file)
@@ -30,13 +30,6 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
                                      uint8_t wct, uint16_t *vwv,
                                      int iov_count,
                                      struct iovec *bytes_iov);
-NTSTATUS cli_smb_req_send(struct tevent_req *req);
-size_t cli_smb_wct_ofs(struct tevent_req **reqs, int num_reqs);
-NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs);
-uint16_t cli_smb_req_mid(struct tevent_req *req);
-void cli_smb_req_set_mid(struct tevent_req *req, uint16_t mid);
-uint32_t cli_smb_req_seqnum(struct tevent_req *req);
-void cli_smb_req_set_seqnum(struct tevent_req *req, uint32_t seqnum);
 struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                                struct cli_state *cli,
                                uint8_t smb_command, uint8_t additional_flags,
index 62aaa5646c8ab8d98e3a32df8e364ad25eb70f4d..e30435a225bc4228fd26ed967105b9f59d342744 100644 (file)
 #include "async_smb.h"
 #include "../libcli/smb/smbXcli_base.h"
 
-/*
- * Fetch a smb request's mid. Only valid after the request has been sent by
- * cli_smb_req_send().
- */
-uint16_t cli_smb_req_mid(struct tevent_req *req)
-{
-       return smb1cli_req_mid(req);
-}
-
-void cli_smb_req_set_mid(struct tevent_req *req, uint16_t mid)
-{
-       smb1cli_req_set_mid(req, mid);
-}
-
-uint32_t cli_smb_req_seqnum(struct tevent_req *req)
-{
-       return smb1cli_req_seqnum(req);
-}
-
-void cli_smb_req_set_seqnum(struct tevent_req *req, uint32_t seqnum)
-{
-       smb1cli_req_set_seqnum(req, seqnum);
-}
-
 struct cli_smb_req_state {
        struct cli_state *cli;
        uint8_t smb_command;
@@ -131,11 +107,6 @@ struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
        return state->req;
 }
 
-NTSTATUS cli_smb_req_send(struct tevent_req *req)
-{
-       return smb1cli_req_chain_submit(&req, 1);
-}
-
 struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx,
                                struct tevent_context *ev,
                                struct cli_state *cli,
@@ -308,13 +279,3 @@ NTSTATUS cli_smb_recv(struct tevent_req *req,
 
        return status;
 }
-
-size_t cli_smb_wct_ofs(struct tevent_req **reqs, int num_reqs)
-{
-       return smb1cli_req_wct_ofs(reqs, num_reqs);
-}
-
-NTSTATUS cli_smb_chain_send(struct tevent_req **reqs, int num_reqs)
-{
-       return smb1cli_req_chain_submit(reqs, num_reqs);
-}
index 9481e75e64ca5ec71529e2727a104d1c82db0861..0858be996cb06c9b1f8b287bc4ad51ba353ff86f 100644 (file)
@@ -453,7 +453,7 @@ struct tevent_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       status = cli_smb_req_send(subreq);
+       status = smb1cli_req_chain_submit(&subreq, 1);
        if (NT_STATUS_IS_OK(status)) {
                tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
@@ -2395,7 +2395,7 @@ struct tevent_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx,
        if (subreq == NULL) {
                return req;
        }
-       status = cli_smb_req_send(subreq);
+       status = smb1cli_req_chain_submit(&subreq, 1);
        if (!NT_STATUS_IS_OK(status)) {
                tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
index 3bdb49d6d40c560046ca682dadca3b6ce24b1e76..b762a377c180941e472350fee7bc9012a91b834d 100644 (file)
@@ -2226,7 +2226,7 @@ struct tevent_req *cli_openx_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
                return NULL;
        }
 
-       status = cli_smb_req_send(subreq);
+       status = smb1cli_req_chain_submit(&subreq, 1);
        if (tevent_req_nterror(req, status)) {
                return tevent_req_post(req, ev);
        }
@@ -2472,7 +2472,7 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       status = cli_smb_req_send(subreq);
+       status = smb1cli_req_chain_submit(&subreq, 1);
        if (tevent_req_nterror(req, status)) {
                return tevent_req_post(req, ev);
        }
index e6c20e44e70b4821932a3c2c867a3df3cf3d8ba2..2c5ec0b8b30bd9b74c5d6e4cd154622e3ca10757 100644 (file)
@@ -51,7 +51,7 @@ struct tevent_req *cli_smb_oplock_break_waiter_send(TALLOC_CTX *mem_ctx,
        if (tevent_req_nomem(subreq, req)) {
                return tevent_req_post(req, ev);
        }
-       cli_smb_req_set_mid(subreq, 0xffff);
+       smb1cli_req_set_mid(subreq, 0xffff);
 
        if (!smbXcli_req_set_pending(subreq)) {
                tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
index f2e1dbf0ac85b03b9ec5ad15319d4f364ac8fedb..b7ee7d5911467217a2df77102afae8404cff9486 100644 (file)
@@ -194,7 +194,7 @@ struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       status = cli_smb_req_send(subreq);
+       status = smb1cli_req_chain_submit(&subreq, 1);
        if (tevent_req_nterror(req, status)) {
                return tevent_req_post(req, ev);
        }
@@ -867,7 +867,7 @@ struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx,
        SSVAL(vwv+10, 0, state->size);
 
        SSVAL(vwv+11, 0,
-             cli_smb_wct_ofs(reqs_before, num_reqs_before)
+             smb1cli_req_wct_ofs(reqs_before, num_reqs_before)
              + 1               /* the wct field */
              + wct * 2         /* vwv */
              + 2               /* num_bytes field */
@@ -908,7 +908,7 @@ struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx,
                return NULL;
        }
 
-       status = cli_smb_req_send(subreq);
+       status = smb1cli_req_chain_submit(&subreq, 1);
        if (tevent_req_nterror(req, status)) {
                return tevent_req_post(req, ev);
        }
index 7b9eeb0b7b38bcac20eaea4201040ae382352ec4..a4b30ea94055f5dd0c694a824e97a86d2aeb4edc 100644 (file)
@@ -25,6 +25,7 @@
 #include "async_smb.h"
 #include "lib/util/tevent_ntstatus.h"
 #include "libcli/security/security.h"
+#include "libcli/smb/smbXcli_base.h"
 
 struct chain3_andx_state {
        uint16_t fnum;
@@ -75,7 +76,7 @@ static struct tevent_req *chain3_andx_send(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(subreq, chain3_andx_close_done, req);
 
-       status = cli_smb_chain_send(smbreqs, ARRAY_SIZE(smbreqs));
+       status = smb1cli_req_chain_submit(smbreqs, ARRAY_SIZE(smbreqs));
        if (tevent_req_nterror(req, status)) {
                return tevent_req_post(req, ev);
        }
index 1f463f66729d69649a1f089ee23f4f70a5122662..1fc80fe6a4976e1b1b9f56530fe1e3d9c69a1fc3 100644 (file)
@@ -6540,7 +6540,7 @@ static bool run_chain1(int dummy)
        if (reqs[2] == NULL) return false;
        tevent_req_set_callback(reqs[2], chain1_close_completion, &done);
 
-       status = cli_smb_chain_send(smbreqs, ARRAY_SIZE(smbreqs));
+       status = smb1cli_req_chain_submit(smbreqs, ARRAY_SIZE(smbreqs));
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }
@@ -6596,7 +6596,7 @@ static bool run_chain2(int dummy)
        if (reqs[1] == NULL) return false;
        tevent_req_set_callback(reqs[1], chain2_tcon_completion, &done);
 
-       status = cli_smb_chain_send(smbreqs, ARRAY_SIZE(smbreqs));
+       status = smb1cli_req_chain_submit(smbreqs, ARRAY_SIZE(smbreqs));
        if (!NT_STATUS_IS_OK(status)) {
                return false;
        }