s3:include: make smb_setlen() a macro
authorStefan Metzmacher <metze@samba.org>
Thu, 20 Oct 2011 07:44:02 +0000 (09:44 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Oct 2011 06:43:00 +0000 (08:43 +0200)
metze

source3/include/proto.h
source3/include/smb_macros.h
source3/lib/util.c

index fdeabefec29e87326fd10c63ab54fdd503da4af8..3002fc33daeb0b25da0f6693de4d35d77972c7bb 100644 (file)
@@ -489,7 +489,6 @@ bool socket_exist(const char *fname);
 uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf);
 SMB_OFF_T get_file_size(char *file_name);
 void show_msg(const char *buf);
-void smb_setlen(char *buf,int len);
 int set_message_bcc(char *buf,int num_bytes);
 ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob);
 char *unix_clean_name(TALLOC_CTX *ctx, const char *s);
index bed463d136bafd6eeeddcaa571f4f16baa91d6ca..79d2f6833d07a8a45f5b82d07dc6399ffdd4fbf8 100644 (file)
 
 #define smb_len(buf) smb_len_nbt(buf)
 #define _smb_setlen(buf, len) _smb_setlen_nbt(buf, len)
+#define smb_setlen(buf, len) smb_setlen_nbt(buf, len)
 
 #define smb_len_large(buf) smb_len_tcp(buf)
 #define _smb_setlen_large(buf, len) _smb_setlen_tcp(buf, len)
index df82733bc1f94a9d903b755ebf61c0d091e3cffd..8157c0ffd0d2c6005bde8f3d6d050931d8fc206b 100644 (file)
@@ -183,20 +183,6 @@ void show_msg(const char *buf)
        dump_data(10, (const uint8 *)smb_buf_const(buf), bcc);
 }
 
-/*******************************************************************
- Set the length and marker of an smb packet.
-********************************************************************/
-
-void smb_setlen(char *buf,int len)
-{
-       _smb_setlen(buf,len);
-
-       SCVAL(buf,4,0xFF);
-       SCVAL(buf,5,'S');
-       SCVAL(buf,6,'M');
-       SCVAL(buf,7,'B');
-}
-
 /*******************************************************************
  Setup only the byte count for a smb message.
 ********************************************************************/