summaryrefslogtreecommitdiff
path: root/libcli/smb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-10-19 13:48:09 +0200
committerStefan Metzmacher <metze@samba.org>2011-10-19 15:44:29 +0200
commitcd227634408c54a917d7cb5f8877b373a688eb8e (patch)
tree133b108e37fa5f5e6139abe6af45bb14fd5130c3 /libcli/smb
parent5e6c477ef8b7f4799e281ed87a3d4c1eda5dc92f (diff)
downloadsamba-cd227634408c54a917d7cb5f8877b373a688eb8e.tar.gz
samba-cd227634408c54a917d7cb5f8877b373a688eb8e.tar.bz2
samba-cd227634408c54a917d7cb5f8877b373a688eb8e.zip
libcli/smb: add smb_[set]len_[nbt|tcp]() macros
metze
Diffstat (limited to 'libcli/smb')
-rw-r--r--libcli/smb/smb_constants.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h
index b480001f69..91330ddbae 100644
--- a/libcli/smb/smb_constants.h
+++ b/libcli/smb/smb_constants.h
@@ -32,6 +32,12 @@
#define NBSSretarget 0x84 /* retarget session response */
#define NBSSkeepalive 0x85 /* keepalive */
+#define smb_len_nbt(buf) (RIVAL(buf, 0) & 0x1FFFF)
+#define _smb_setlen_nbt(buf,len) RSIVAL(buf, 0, (len) & 0x1FFFF)
+
+#define smb_len_tcp(buf) (RIVAL(buf, 0) & 0xFFFFFF)
+#define _smb_setlen_tcp(buf,len) RSIVAL(buf, 0, (len) & 0xFFFFFF)
+
/* protocol types. It assumes that higher protocols include lower protocols
as subsets. */
enum protocol_types {