summaryrefslogtreecommitdiff
path: root/source3/libsmb/smb2cli_base.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-15 12:46:59 +0200
committerStefan Metzmacher <metze@samba.org>2011-11-24 19:02:30 +0100
commit349977e1a071137ca33b831660e8c65c2e580b5f (patch)
tree2f63a6579b4447e58a452d23c1eb7d406abd6016 /source3/libsmb/smb2cli_base.h
parent84806eceb2d39e2c66d22fd608d47adb51a9c8fb (diff)
downloadsamba-349977e1a071137ca33b831660e8c65c2e580b5f.tar.gz
samba-349977e1a071137ca33b831660e8c65c2e580b5f.tar.bz2
samba-349977e1a071137ca33b831660e8c65c2e580b5f.zip
s3:smb2cli: replace smb2cli_base.c code with the more generic smbXcli_base.c code
metze
Diffstat (limited to 'source3/libsmb/smb2cli_base.h')
-rw-r--r--source3/libsmb/smb2cli_base.h63
1 files changed, 35 insertions, 28 deletions
diff --git a/source3/libsmb/smb2cli_base.h b/source3/libsmb/smb2cli_base.h
index 105f8ebe1c..efef350f5d 100644
--- a/source3/libsmb/smb2cli_base.h
+++ b/source3/libsmb/smb2cli_base.h
@@ -20,45 +20,52 @@
#ifndef __SMB2CLI_BASE_H__
#define __SMB2CLI_BASE_H__
-struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct cli_state *cli,
- uint16_t cmd,
- uint32_t additional_flags,
- uint32_t clear_flags,
- unsigned int timeout,
- uint32_t pid,
- uint32_t tid,
- uint64_t uid,
- const uint8_t *fixed,
- uint16_t fixed_len,
- const uint8_t *dyn,
- uint32_t dyn_len);
-NTSTATUS smb2cli_req_compound_submit(struct tevent_req **reqs,
- int num_reqs);
+#include "../libcli/smb/smbXcli_base.h"
-struct smb2cli_req_expected_response {
- NTSTATUS status;
- uint16_t body_size;
-};
-
-struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
+static inline struct tevent_req *cli_state_smb2cli_req_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
uint16_t cmd,
uint32_t additional_flags,
uint32_t clear_flags,
- unsigned int timeout,
+ uint32_t timeout_msec,
uint32_t pid,
uint32_t tid,
uint64_t uid,
const uint8_t *fixed,
uint16_t fixed_len,
const uint8_t *dyn,
- uint32_t dyn_len);
-NTSTATUS smb2cli_req_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
- struct iovec **piov,
- const struct smb2cli_req_expected_response *expected,
- size_t num_expected);
+ uint32_t dyn_len)
+{
+ if (cli->smb2.conn == NULL) {
+ cli->smb2.conn = smbXcli_conn_create(cli,
+ cli->conn.fd,
+ cli->conn.remote_name,
+ SMB_SIGNING_OFF,
+ 0); /* smb1_capabilities */
+ if (cli->smb2.conn == NULL) {
+ return NULL;
+ }
+ }
+
+ return smb2cli_req_send(mem_ctx, ev,
+ cli->smb2.conn, cmd,
+ additional_flags, clear_flags,
+ timeout_msec,
+ pid, tid, uid,
+ fixed, fixed_len,
+ dyn, dyn_len);
+}
+
+#define smb2cli_req_send(mem_ctx, ev, cli, cmd, \
+ additional_flags, clear_flags, \
+ timeout_msec, \
+ pid, tid, uid, \
+ fixed, fixed_len, dyn, dyn_len) \
+ cli_state_smb2cli_req_send(mem_ctx, ev, cli, cmd, \
+ additional_flags, clear_flags, \
+ timeout_msec, \
+ pid, tid, uid, \
+ fixed, fixed_len, dyn, dyn_len)
#endif