summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-03-29 12:44:42 +0000
committerAndrew Tridgell <tridge@samba.org>2003-03-29 12:44:42 +0000
commitdfcf1634bc84ff00f8241c326084a705989fb099 (patch)
treead6e47855b406d7ea7d019b5f436e459b9c9117f /source3/libsmb
parenta6fad1ca7220160774148c1caeece45629d87ca6 (diff)
downloadsamba-dfcf1634bc84ff00f8241c326084a705989fb099.tar.gz
samba-dfcf1634bc84ff00f8241c326084a705989fb099.tar.bz2
samba-dfcf1634bc84ff00f8241c326084a705989fb099.zip
added a simple test for the old SMBtcon interface
(This used to be commit c95ae394c5dfe5e0fcc658119213b17bcb95fab5)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 763878f9b3..75dcd62c2f 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -750,7 +750,6 @@ BOOL cli_ulogoff(struct cli_state *cli)
/****************************************************************************
Send a tconX.
****************************************************************************/
-
BOOL cli_send_tconX(struct cli_state *cli,
const char *share, const char *dev, const char *pass, int passlen)
{
@@ -1343,3 +1342,45 @@ name *SMBSERVER with error %s\n", desthost, cli_errstr(cli) ));
return True;
}
+
+
+
+
+
+/****************************************************************************
+ Send an old style tcon.
+****************************************************************************/
+NTSTATUS cli_raw_tcon(struct cli_state *cli,
+ const char *service, const char *pass, const char *dev,
+ uint16 *max_xmit, uint16 *tid)
+{
+ char *p;
+
+ memset(cli->outbuf,'\0',smb_size);
+ memset(cli->inbuf,'\0',smb_size);
+
+ set_message(cli->outbuf, 0, 0, True);
+ SCVAL(cli->outbuf,smb_com,SMBtcon);
+ cli_setup_packet(cli);
+
+ p = smb_buf(cli->outbuf);
+ *p++ = 4; p += clistr_push(cli, p, service, -1, STR_TERMINATE | STR_NOALIGN);
+ *p++ = 4; p += clistr_push(cli, p, pass, -1, STR_TERMINATE | STR_NOALIGN);
+ *p++ = 4; p += clistr_push(cli, p, dev, -1, STR_TERMINATE | STR_NOALIGN);
+
+ cli_setup_bcc(cli, p);
+
+ cli_send_smb(cli);
+ if (!cli_receive_smb(cli)) {
+ return NT_STATUS_UNEXPECTED_NETWORK_ERROR;
+ }
+
+ if (cli_is_error(cli)) {
+ return cli_nt_error(cli);
+ }
+
+ *max_xmit = SVAL(cli->inbuf, smb_vwv0);
+ *tid = SVAL(cli->inbuf, smb_vwv1);
+
+ return NT_STATUS_OK;
+}