git.samba.org
/
rusty
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
32938ce
)
libcli/smb: add smb_setlen_[nbt|tcp] macros
author
Stefan Metzmacher
<metze@samba.org>
Thu, 20 Oct 2011 07:42:10 +0000
(09:42 +0200)
committer
Stefan Metzmacher
<metze@samba.org>
Fri, 21 Oct 2011 06:42:59 +0000
(08:42 +0200)
metze
libcli/smb/smb_constants.h
patch
|
blob
|
history
diff --git
a/libcli/smb/smb_constants.h
b/libcli/smb/smb_constants.h
index 886e35884f2324510bfcee36aaf1f5ac731bcbc6..3bedf2593bba012fd6b1312274c17f6004e0ccb4 100644
(file)
--- a/
libcli/smb/smb_constants.h
+++ b/
libcli/smb/smb_constants.h
@@
-61,9
+61,17
@@
#define smb_len_nbt(buf) (RIVAL(buf, 0) & 0x1FFFF)
#define _smb_setlen_nbt(buf,len) RSIVAL(buf, 0, (len) & 0x1FFFF)
#define smb_len_nbt(buf) (RIVAL(buf, 0) & 0x1FFFF)
#define _smb_setlen_nbt(buf,len) RSIVAL(buf, 0, (len) & 0x1FFFF)
+#define smb_setlen_nbt(buf, len) do { \
+ _smb_setlen_nbt(buf, len); \
+ SIVAL(buf, 4, SMB_MAGIC); \
+} while (0)
#define smb_len_tcp(buf) (RIVAL(buf, 0) & 0xFFFFFF)
#define _smb_setlen_tcp(buf,len) RSIVAL(buf, 0, (len) & 0xFFFFFF)
#define smb_len_tcp(buf) (RIVAL(buf, 0) & 0xFFFFFF)
#define _smb_setlen_tcp(buf,len) RSIVAL(buf, 0, (len) & 0xFFFFFF)
+#define smb_setlen_tcp(buf, len) do { \
+ _smb_setlen_tcp(buf, len); \
+ SIVAL(buf, 4, SMB_MAGIC); \
+} while (0)
/* protocol types. It assumes that higher protocols include lower protocols
as subsets. */
/* protocol types. It assumes that higher protocols include lower protocols
as subsets. */