From cd227634408c54a917d7cb5f8877b373a688eb8e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 19 Oct 2011 13:48:09 +0200 Subject: libcli/smb: add smb_[set]len_[nbt|tcp]() macros metze --- libcli/smb/smb_constants.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libcli') 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 { -- cgit