From: Stefan Metzmacher Date: Thu, 20 Oct 2011 07:44:02 +0000 (+0200) Subject: s3:include: make smb_setlen() a macro X-Git-Url: http://git.samba.org/?p=rusty%2Fsamba.git;a=commitdiff_plain;h=6d2aaef787791fbcea9dcc6bca9e8f10d65dc746 s3:include: make smb_setlen() a macro metze --- diff --git a/source3/include/proto.h b/source3/include/proto.h index fdeabefec29..3002fc33dae 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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); diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index bed463d136b..79d2f6833d0 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -134,6 +134,7 @@ #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) diff --git a/source3/lib/util.c b/source3/lib/util.c index df82733bc1f..8157c0ffd0d 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -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. ********************************************************************/