summaryrefslogtreecommitdiff
path: root/source3/libsmb/climessage.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-07-16 05:34:56 +0000
committerGerald Carter <jerry@samba.org>2003-07-16 05:34:56 +0000
commit4a090ba06a54f5da179ac02bb307cc03d08831bf (patch)
treeed652ef36be7f16682c358816334f969a22f1c27 /source3/libsmb/climessage.c
parent95fe82670032a3a43571b46d7bbf2c26bc8cdcd9 (diff)
downloadsamba-4a090ba06a54f5da179ac02bb307cc03d08831bf.tar.gz
samba-4a090ba06a54f5da179ac02bb307cc03d08831bf.tar.bz2
samba-4a090ba06a54f5da179ac02bb307cc03d08831bf.zip
trying to get HEAD building again. If you want the code
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE (This used to be commit adb98e7b7cd0f025b52c570e4034eebf4047b1ad)
Diffstat (limited to 'source3/libsmb/climessage.c')
-rw-r--r--source3/libsmb/climessage.c38
1 files changed, 32 insertions, 6 deletions
diff --git a/source3/libsmb/climessage.c b/source3/libsmb/climessage.c
index 2b1be75089..8ce8416487 100644
--- a/source3/libsmb/climessage.c
+++ b/source3/libsmb/climessage.c
@@ -26,12 +26,11 @@
/****************************************************************************
start a message sequence
****************************************************************************/
-BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
- int *grp)
+int cli_message_start_build(struct cli_state *cli, char *host, char *username)
{
char *p;
- /* send a SMBsendstrt command */
+ /* construct a SMBsendstrt command */
memset(cli->outbuf,'\0',smb_size);
set_message(cli->outbuf,0,0,True);
SCVAL(cli->outbuf,smb_com,SMBsendstrt);
@@ -45,6 +44,14 @@ BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
p += clistr_push(cli, p, host, -1, STR_ASCII|STR_TERMINATE);
cli_setup_bcc(cli, p);
+
+ return(PTR_DIFF(p, cli->outbuf));
+}
+
+BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
+ int *grp)
+{
+ cli_message_start_build(cli, host, username);
cli_send_smb(cli);
@@ -63,7 +70,7 @@ BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
/****************************************************************************
send a message
****************************************************************************/
-BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp)
+int cli_message_text_build(struct cli_state *cli, char *msg, int len, int grp)
{
char *msgdos;
int lendos;
@@ -93,6 +100,14 @@ BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp)
}
cli_setup_bcc(cli, p);
+
+ return(PTR_DIFF(p, cli->outbuf));
+}
+
+BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp)
+{
+ cli_message_text_build(cli, msg, len, grp);
+
cli_send_smb(cli);
if (!cli_receive_smb(cli)) {
@@ -107,8 +122,10 @@ BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp)
/****************************************************************************
end a message
****************************************************************************/
-BOOL cli_message_end(struct cli_state *cli, int grp)
+int cli_message_end_build(struct cli_state *cli, int grp)
{
+ char *p;
+
memset(cli->outbuf,'\0',smb_size);
set_message(cli->outbuf,1,0,True);
SCVAL(cli->outbuf,smb_com,SMBsendend);
@@ -117,7 +134,16 @@ BOOL cli_message_end(struct cli_state *cli, int grp)
SSVAL(cli->outbuf,smb_vwv0,grp);
cli_setup_packet(cli);
-
+
+ p = smb_buf(cli->outbuf);
+
+ return(PTR_DIFF(p, cli->outbuf));
+}
+
+BOOL cli_message_end(struct cli_state *cli, int grp)
+{
+ cli_message_end_build(cli, grp);
+
cli_send_smb(cli);
if (!cli_receive_smb(cli)) {