summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-10-30 16:19:40 +0100
committerJeremy Allison <jra@samba.org>2020-02-26 19:45:36 +0000
commitb1ebfec39ee53dd42715e8ce6b3b0ab9872aa542 (patch)
tree12e75ba8cf2c7f20aec7fad91988684ce895dd0e
parent03562cf12821ab038040aa569a8883ab93ebd3b5 (diff)
downloadsamba-b1ebfec39ee53dd42715e8ce6b3b0ab9872aa542.tar.gz
s3:libsmb: move cli_set_message() to source3/libsmb/nmblib.c
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/libsmb/clientgen.c15
-rw-r--r--source3/libsmb/nmblib.c15
-rw-r--r--source3/libsmb/nmblib.h1
-rw-r--r--source3/libsmb/proto.h1
4 files changed, 16 insertions, 16 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 6c946ff17d6..d68b86df1c7 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -28,21 +28,6 @@
#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).
****************************************************************************/
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index c05fac2bba9..a5e691a1c86 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -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);
+}
diff --git a/source3/libsmb/nmblib.h b/source3/libsmb/nmblib.h
index a0624ed085c..52600a41e57 100644
--- a/source3/libsmb/nmblib.h
+++ b/source3/libsmb/nmblib.h
@@ -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_ */
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index a7bbb7decd4..e44dad13200 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -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;