summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-08-14 21:07:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:29:48 -0500
commitc5572072e5c50883a643ebd55295c7fb4d10fe3e (patch)
treea5cd9f7dc16247ac4ce6d0122e65706bedb3c82a /source3
parent90741da80bf99fea22d9ee3a03a0f0994d0da6a3 (diff)
downloadsamba-c5572072e5c50883a643ebd55295c7fb4d10fe3e.tar.gz
samba-c5572072e5c50883a643ebd55295c7fb4d10fe3e.tar.bz2
samba-c5572072e5c50883a643ebd55295c7fb4d10fe3e.zip
r24440: Convert the reply_sendXX functions to the new API
(This used to be commit a64bc31098de8694b79eeafd3a226cf519700707)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/message.c62
-rw-r--r--source3/smbd/process.c8
2 files changed, 35 insertions, 35 deletions
diff --git a/source3/smbd/message.c b/source3/smbd/message.c
index fa4c9e69ef..b044b6f92d 100644
--- a/source3/smbd/message.c
+++ b/source3/smbd/message.c
@@ -114,11 +114,10 @@ static void msg_deliver(void)
conn POINTER CAN BE NULL HERE !
****************************************************************************/
-int reply_sends(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
+void reply_sends(connection_struct *conn, struct smb_request *req)
{
int len;
char *msg;
- int outsize = 0;
char *p;
START_PROFILE(SMBsends);
@@ -126,16 +125,15 @@ int reply_sends(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
msgpos = 0;
if (! (*lp_msg_command())) {
+ reply_doserror(req, ERRSRV, ERRmsgoff);
END_PROFILE(SMBsends);
- return(ERROR_DOS(ERRSRV,ERRmsgoff));
+ return;
}
- outsize = set_message(inbuf,outbuf,0,0,True);
-
- p = smb_buf(inbuf)+1;
- p += srvstr_pull_buf(inbuf, SVAL(inbuf, smb_flg2), msgfrom, p,
+ p = smb_buf(req->inbuf)+1;
+ p += srvstr_pull_buf((char *)req->inbuf, req->flags2, msgfrom, p,
sizeof(msgfrom), STR_ASCII|STR_TERMINATE) + 1;
- p += srvstr_pull_buf(inbuf, SVAL(inbuf, smb_flg2), msgto, p,
+ p += srvstr_pull_buf((char *)req->inbuf, req->flags2, msgto, p,
sizeof(msgto), STR_ASCII|STR_TERMINATE) + 1;
msg = p;
@@ -150,8 +148,10 @@ int reply_sends(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
msg_deliver();
+ reply_outbuf(req, 0, 0);
+
END_PROFILE(SMBsends);
- return(outsize);
+ return;
}
/****************************************************************************
@@ -159,33 +159,33 @@ int reply_sends(connection_struct *conn, char *inbuf,char *outbuf, int dum_size,
conn POINTER CAN BE NULL HERE !
****************************************************************************/
-int reply_sendstrt(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
+void reply_sendstrt(connection_struct *conn, struct smb_request *req)
{
- int outsize = 0;
char *p;
START_PROFILE(SMBsendstrt);
if (! (*lp_msg_command())) {
+ reply_doserror(req, ERRSRV, ERRmsgoff);
END_PROFILE(SMBsendstrt);
- return(ERROR_DOS(ERRSRV,ERRmsgoff));
+ return;
}
- outsize = set_message(inbuf,outbuf,1,0,True);
-
memset(msgbuf,'\0',sizeof(msgbuf));
msgpos = 0;
- p = smb_buf(inbuf)+1;
- p += srvstr_pull_buf(inbuf, SVAL(inbuf, smb_flg2), msgfrom, p,
+ p = smb_buf(req->inbuf)+1;
+ p += srvstr_pull_buf((char *)req->inbuf, req->flags2, msgfrom, p,
sizeof(msgfrom), STR_ASCII|STR_TERMINATE) + 1;
- p += srvstr_pull_buf(inbuf, SVAL(inbuf, smb_flg2), msgto, p,
+ p += srvstr_pull_buf((char *)req->inbuf, req->flags2, msgto, p,
sizeof(msgto), STR_ASCII|STR_TERMINATE) + 1;
DEBUG( 3, ( "SMBsendstrt (from %s to %s)\n", msgfrom, msgto ) );
+ reply_outbuf(req, 0, 0);
+
END_PROFILE(SMBsendstrt);
- return(outsize);
+ return;
}
/****************************************************************************
@@ -193,21 +193,19 @@ int reply_sendstrt(connection_struct *conn, char *inbuf,char *outbuf, int dum_si
conn POINTER CAN BE NULL HERE !
****************************************************************************/
-int reply_sendtxt(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
+void reply_sendtxt(connection_struct *conn, struct smb_request *req)
{
int len;
- int outsize = 0;
char *msg;
START_PROFILE(SMBsendtxt);
if (! (*lp_msg_command())) {
+ reply_doserror(req, ERRSRV, ERRmsgoff);
END_PROFILE(SMBsendtxt);
- return(ERROR_DOS(ERRSRV,ERRmsgoff));
+ return;
}
- outsize = set_message(inbuf,outbuf,0,0,True);
-
- msg = smb_buf(inbuf) + 1;
+ msg = smb_buf(req->inbuf) + 1;
len = SVAL(msg,0);
len = MIN(len,sizeof(msgbuf)-msgpos);
@@ -217,8 +215,10 @@ int reply_sendtxt(connection_struct *conn, char *inbuf,char *outbuf, int dum_siz
DEBUG( 3, ( "SMBsendtxt\n" ) );
+ reply_outbuf(req, 0, 0);
+
END_PROFILE(SMBsendtxt);
- return(outsize);
+ return;
}
/****************************************************************************
@@ -226,22 +226,22 @@ int reply_sendtxt(connection_struct *conn, char *inbuf,char *outbuf, int dum_siz
conn POINTER CAN BE NULL HERE !
****************************************************************************/
-int reply_sendend(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
+void reply_sendend(connection_struct *conn, struct smb_request *req)
{
- int outsize = 0;
START_PROFILE(SMBsendend);
if (! (*lp_msg_command())) {
+ reply_doserror(req, ERRSRV, ERRmsgoff);
END_PROFILE(SMBsendend);
- return(ERROR_DOS(ERRSRV,ERRmsgoff));
+ return;
}
- outsize = set_message(inbuf,outbuf,0,0,True);
-
DEBUG(3,("SMBsendend\n"));
msg_deliver();
+ reply_outbuf(req, 0, 0);
+
END_PROFILE(SMBsendend);
- return(outsize);
+ return;
}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index c198aa7c0c..671b7116fa 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -898,14 +898,14 @@ static const struct smb_message_struct {
/* 0xcd */ { NULL, NULL, NULL, 0 },
/* 0xce */ { NULL, NULL, NULL, 0 },
/* 0xcf */ { NULL, NULL, NULL, 0 },
-/* 0xd0 */ { "SMBsends",reply_sends,NULL,AS_GUEST},
+/* 0xd0 */ { "SMBsends",NULL,reply_sends,AS_GUEST},
/* 0xd1 */ { "SMBsendb",NULL, NULL,AS_GUEST},
/* 0xd2 */ { "SMBfwdname",NULL, NULL,AS_GUEST},
/* 0xd3 */ { "SMBcancelf",NULL, NULL,AS_GUEST},
/* 0xd4 */ { "SMBgetmac",NULL, NULL,AS_GUEST},
-/* 0xd5 */ { "SMBsendstrt",reply_sendstrt,NULL,AS_GUEST},
-/* 0xd6 */ { "SMBsendend",reply_sendend,NULL,AS_GUEST},
-/* 0xd7 */ { "SMBsendtxt",reply_sendtxt,NULL,AS_GUEST},
+/* 0xd5 */ { "SMBsendstrt",NULL,reply_sendstrt,AS_GUEST},
+/* 0xd6 */ { "SMBsendend",NULL,reply_sendend,AS_GUEST},
+/* 0xd7 */ { "SMBsendtxt",NULL,reply_sendtxt,AS_GUEST},
/* 0xd8 */ { NULL, NULL, NULL, 0 },
/* 0xd9 */ { NULL, NULL, NULL, 0 },
/* 0xda */ { NULL, NULL, NULL, 0 },