mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
smbd: Move srv_set_message to smb2_process.c
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
08aa1619c6
commit
e287f7c27b
@ -281,24 +281,6 @@ out:
|
||||
return (ret > 0);
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Setup the word count and byte count for a smb message.
|
||||
********************************************************************/
|
||||
|
||||
size_t srv_set_message(char *buf,
|
||||
size_t num_words,
|
||||
size_t num_bytes,
|
||||
bool zero)
|
||||
{
|
||||
if (zero && (num_words || num_bytes)) {
|
||||
memset(buf + smb_size,'\0',num_words*2 + num_bytes);
|
||||
}
|
||||
SCVAL(buf,smb_wct,num_words);
|
||||
SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes);
|
||||
smb_setlen(buf,(smb_size + num_words*2 + num_bytes - 4));
|
||||
return (smb_size + num_words*2 + num_bytes);
|
||||
}
|
||||
|
||||
static bool valid_smb_header(const uint8_t *inbuf)
|
||||
{
|
||||
if (is_encrypted_packet(inbuf)) {
|
||||
|
@ -852,10 +852,6 @@ bool smb1_srv_send(struct smbXsrv_connection *xconn, char *buffer,
|
||||
bool do_signing, uint32_t seqnum,
|
||||
bool do_encrypt,
|
||||
struct smb_perfcount_data *pcd);
|
||||
size_t srv_set_message(char *buf,
|
||||
size_t num_words,
|
||||
size_t num_bytes,
|
||||
bool zero);
|
||||
void remove_deferred_open_message_smb(struct smbXsrv_connection *xconn,
|
||||
uint64_t mid);
|
||||
bool schedule_deferred_open_message_smb(struct smbXsrv_connection *xconn,
|
||||
@ -900,6 +896,10 @@ bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer,
|
||||
bool no_signing, uint32_t seqnum,
|
||||
bool do_encrypt,
|
||||
struct smb_perfcount_data *pcd);
|
||||
size_t srv_set_message(char *buf,
|
||||
size_t num_words,
|
||||
size_t num_bytes,
|
||||
bool zero);
|
||||
|
||||
/* The following definitions come from smbd/quotas.c */
|
||||
|
||||
|
@ -107,3 +107,21 @@ bool srv_send_smb(struct smbXsrv_connection *xconn, char *buffer,
|
||||
do_encrypt, pcd);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
Setup the word count and byte count for a smb message.
|
||||
********************************************************************/
|
||||
|
||||
size_t srv_set_message(char *buf,
|
||||
size_t num_words,
|
||||
size_t num_bytes,
|
||||
bool zero)
|
||||
{
|
||||
if (zero && (num_words || num_bytes)) {
|
||||
memset(buf + smb_size,'\0',num_words*2 + num_bytes);
|
||||
}
|
||||
SCVAL(buf,smb_wct,num_words);
|
||||
SSVAL(buf,smb_vwv + num_words*SIZEOFWORD,num_bytes);
|
||||
smb_setlen(buf,(smb_size + num_words*2 + num_bytes - 4));
|
||||
return (smb_size + num_words*2 + num_bytes);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user