]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Move srv_set_message to smb2_process.c
authorDavid Mulder <dmulder@suse.com>
Thu, 17 Mar 2022 21:23:33 +0000 (15:23 -0600)
committerJeremy Allison <jra@samba.org>
Thu, 7 Apr 2022 17:37:29 +0000 (17:37 +0000)
Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/process.c
source3/smbd/proto.h
source3/smbd/smb2_process.c

index 93afe531856bf47bd2bb525d454196defc7a00ef..c6001b7eca9290b72495460f94d6673e430651d9 100644 (file)
@@ -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)) {
index cc4efe52672ad2235f5e8537d1704655af06fc4c..2181c1fcd98a847dee5a5246fe48dc9bf2577845 100644 (file)
@@ -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  */
 
index 030b61459036e4a55f4199753a9be7293da22722..0207c60267d9e18019d64493aa1788815a03bdc2 100644 (file)
@@ -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);
+}