s3:libsmb: move cli_set_message() to source3/libsmb/nmblib.c
authorStefan Metzmacher <metze@samba.org>
Wed, 30 Oct 2019 15:19:40 +0000 (16:19 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 26 Feb 2020 19:45:36 +0000 (19:45 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/clientgen.c
source3/libsmb/nmblib.c
source3/libsmb/nmblib.h
source3/libsmb/proto.h

index 6c946ff17d6c213a0ca35e7145b64e56314bb8bc..d68b86df1c7c2d92da7c794fd10fd6182bdfefcc 100644 (file)
 #include "../librpc/ndr/libndr.h"
 #include "../include/client.h"
 
-/*******************************************************************
- Setup the word count and byte count for a client smb message.
-********************************************************************/
-
-int cli_set_message(char *buf,int num_words,int 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);
-}
-
 /****************************************************************************
  Change the timeout (in milliseconds).
 ****************************************************************************/
index c05fac2bba96bab3d8227347ae15da34a9a68f2e..a5e691a1c86081363752e025459e46cad2983f03 100644 (file)
@@ -1448,3 +1448,18 @@ int name_len(unsigned char *s1, size_t buf_len)
 
        return(len);
 }
+
+/*******************************************************************
+ Setup the word count and byte count for a client smb message.
+********************************************************************/
+
+int cli_set_message(char *buf,int num_words,int 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);
+}
index a0624ed085c0f78296501e4c7f80b51e8a5f3a66..52600a41e575db853906ab6e7c684d6c519c2ac3 100644 (file)
@@ -54,5 +54,6 @@ void sort_query_replies(char *data, int n, struct in_addr ip);
 char *name_mangle(TALLOC_CTX *mem_ctx, const char *In, char name_type);
 int name_extract(unsigned char *buf,size_t buf_len, unsigned int ofs, fstring name);
 int name_len(unsigned char *s1, size_t buf_len);
+int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
 
 #endif /* _LIBSMB_NMBLIB_H_ */
index a7bbb7decd45b3f1ba6a911d890f386a0a61adcb..e44dad13200a58ae3f55476757f5873dfefcf656 100644 (file)
@@ -187,7 +187,6 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
 
 /* The following definitions come from libsmb/clientgen.c  */
 
-int cli_set_message(char *buf,int num_words,int num_bytes,bool zero);
 unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout);
 bool cli_set_backup_intent(struct cli_state *cli, bool flag);
 extern struct GUID cli_state_client_guid;