mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
applying David Lee's climessage patch to make sending messages more extendable
This commit is contained in:
parent
73aca1443a
commit
a5240adc49
@ -26,12 +26,11 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
start a message sequence
|
start a message sequence
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
|
int cli_message_start_build(struct cli_state *cli, char *host, char *username)
|
||||||
int *grp)
|
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
/* send a SMBsendstrt command */
|
/* construct a SMBsendstrt command */
|
||||||
memset(cli->outbuf,'\0',smb_size);
|
memset(cli->outbuf,'\0',smb_size);
|
||||||
set_message(cli->outbuf,0,0,True);
|
set_message(cli->outbuf,0,0,True);
|
||||||
SCVAL(cli->outbuf,smb_com,SMBsendstrt);
|
SCVAL(cli->outbuf,smb_com,SMBsendstrt);
|
||||||
@ -46,6 +45,14 @@ BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
|
|||||||
|
|
||||||
cli_setup_bcc(cli, p);
|
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);
|
cli_send_smb(cli);
|
||||||
|
|
||||||
if (!cli_receive_smb(cli)) {
|
if (!cli_receive_smb(cli)) {
|
||||||
@ -63,7 +70,7 @@ BOOL cli_message_start(struct cli_state *cli, char *host, char *username,
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
send a message
|
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;
|
char *msgdos;
|
||||||
int lendos;
|
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);
|
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);
|
cli_send_smb(cli);
|
||||||
|
|
||||||
if (!cli_receive_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
|
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);
|
memset(cli->outbuf,'\0',smb_size);
|
||||||
set_message(cli->outbuf,1,0,True);
|
set_message(cli->outbuf,1,0,True);
|
||||||
SCVAL(cli->outbuf,smb_com,SMBsendend);
|
SCVAL(cli->outbuf,smb_com,SMBsendend);
|
||||||
@ -118,6 +135,15 @@ BOOL cli_message_end(struct cli_state *cli, int grp)
|
|||||||
|
|
||||||
cli_setup_packet(cli);
|
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);
|
cli_send_smb(cli);
|
||||||
|
|
||||||
if (!cli_receive_smb(cli)) {
|
if (!cli_receive_smb(cli)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user