* Routines for smb packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-smb.c,v 1.49 1999/11/30 03:46:46 gram Exp $
+ * $Id: packet-smb.c,v 1.76 2000/12/17 03:48:44 sharpe Exp $
*
* Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@unicom.net>
+ * By Gerald Combs <gerald@zing.org>
* Copyright 1998 Gerald Combs
*
* Copied from packet-pop.c
#include "conversation.h"
#include "smb.h"
#include "alignment.h"
+#include "strutil.h"
+
+guint32 dissect_mailslot_smb(const u_char *, int, frame_data *, proto_tree *, proto_tree *, struct smb_info, int, int, int, int, const u_char *, int, int, int, int);
+
+guint32 dissect_pipe_smb(const u_char *, int, frame_data *, proto_tree *, proto_tree *, struct smb_info, int, int, int, int, const u_char *, int, int, int, int);
+
static int proto_smb = -1;
+static int hf_smb_cmd = -1;
+
static gint ett_smb = -1;
static gint ett_smb_fileattributes = -1;
static gint ett_smb_capabilities = -1;
static gint ett_smb_writemode = -1;
static gint ett_smb_lock_type = -1;
-static int proto_browse = -1;
-
-static gint ett_browse = -1;
-static gint ett_browse_flags = -1;
-static gint ett_browse_election_criteria = -1;
-static gint ett_browse_election_os = -1;
-static gint ett_browse_election_desire = -1;
-static int proto_lanman = -1;
-
-static gint ett_lanman = -1;
-static gint ett_lanman_servers = -1;
-static gint ett_lanman_server = -1;
-static gint ett_lanman_shares = -1;
-static gint ett_lanman_share = -1;
/*
* Struct passed to each SMB decode routine of info it may need
guint16 mid;
};
-struct smb_request_val {
- guint16 last_transact2_command;
- gchar *last_transact_command;
- guint16 mid;
- guint16 last_lanman_cmd;
- gchar *last_param_descrip; /* Keep these descriptors around */
- gchar *last_data_descrip;
- guint16 last_level; /* Last level in request */
-};
-
-struct smb_info {
- int tid, uid, mid, pid; /* Any more? */
- conversation_t *conversation;
- struct smb_request_val *request_val;
- int unicode;
-};
GHashTable *smb_request_hash = NULL;
GMemChunk *smb_request_keys = NULL;
void (*dissect[256])(const u_char *, int, frame_data *, proto_tree *, proto_tree *, struct smb_info si, int, int, int, int);
+static const value_string smb_cmd_vals[] = {
+ { 0x00, "SMBcreatedirectory" },
+ { 0x01, "SMBdeletedirectory" },
+ { 0x02, "SMBopen" },
+ { 0x03, "SMBcreate" },
+ { 0x04, "SMBclose" },
+ { 0x05, "SMBflush" },
+ { 0x06, "SMBunlink" },
+ { 0x07, "SMBmv" },
+ { 0x08, "SMBgetatr" },
+ { 0x09, "SMBsetatr" },
+ { 0x0A, "SMBread" },
+ { 0x0B, "SMBwrite" },
+ { 0x0C, "SMBlock" },
+ { 0x0D, "SMBunlock" },
+ { 0x0E, "SMBctemp" },
+ { 0x0F, "SMBmknew" },
+ { 0x10, "SMBchkpth" },
+ { 0x11, "SMBexit" },
+ { 0x12, "SMBlseek" },
+ { 0x13, "SMBlockread" },
+ { 0x14, "SMBwriteunlock" },
+ { 0x15, "unknown-0x15" },
+ { 0x16, "unknown-0x16" },
+ { 0x17, "unknown-0x17" },
+ { 0x18, "unknown-0x18" },
+ { 0x19, "unknown-0x19" },
+ { 0x1A, "SMBreadBraw" },
+ { 0x1B, "SMBreadBmpx" },
+ { 0x1C, "SMBreadBs" },
+ { 0x1D, "SMBwriteBraw" },
+ { 0x1E, "SMBwriteBmpx" },
+ { 0x1F, "SMBwriteBs" },
+ { 0x20, "SMBwriteC" },
+ { 0x21, "unknown-0x21" },
+ { 0x22, "SMBsetattrE" },
+ { 0x23, "SMBgetattrE" },
+ { 0x24, "SMBlockingX" },
+ { 0x25, "SMBtrans" },
+ { 0x26, "SMBtranss" },
+ { 0x27, "SMBioctl" },
+ { 0x28, "SMBioctls" },
+ { 0x29, "SMBcopy" },
+ { 0x2A, "SMBmove" },
+ { 0x2B, "SMBecho" },
+ { 0x2C, "SMBwriteclose" },
+ { 0x2D, "SMBopenX" },
+ { 0x2E, "SMBreadX" },
+ { 0x2F, "SMBwriteX" },
+ { 0x30, "unknown-0x30" },
+ { 0x31, "SMBcloseandtreedisc" },
+ { 0x32, "SMBtrans2" },
+ { 0x33, "SMBtrans2secondary" },
+ { 0x34, "SMBfindclose2" },
+ { 0x35, "SMBfindnotifyclose" },
+ { 0x36, "unknown-0x36" },
+ { 0x37, "unknown-0x37" },
+ { 0x38, "unknown-0x38" },
+ { 0x39, "unknown-0x39" },
+ { 0x3A, "unknown-0x3A" },
+ { 0x3B, "unknown-0x3B" },
+ { 0x3C, "unknown-0x3C" },
+ { 0x3D, "unknown-0x3D" },
+ { 0x3E, "unknown-0x3E" },
+ { 0x3F, "unknown-0x3F" },
+ { 0x40, "unknown-0x40" },
+ { 0x41, "unknown-0x41" },
+ { 0x42, "unknown-0x42" },
+ { 0x43, "unknown-0x43" },
+ { 0x44, "unknown-0x44" },
+ { 0x45, "unknown-0x45" },
+ { 0x46, "unknown-0x46" },
+ { 0x47, "unknown-0x47" },
+ { 0x48, "unknown-0x48" },
+ { 0x49, "unknown-0x49" },
+ { 0x4A, "unknown-0x4A" },
+ { 0x4B, "unknown-0x4B" },
+ { 0x4C, "unknown-0x4C" },
+ { 0x4D, "unknown-0x4D" },
+ { 0x4E, "unknown-0x4E" },
+ { 0x4F, "unknown-0x4F" },
+ { 0x50, "unknown-0x50" },
+ { 0x51, "unknown-0x51" },
+ { 0x52, "unknown-0x52" },
+ { 0x53, "unknown-0x53" },
+ { 0x54, "unknown-0x54" },
+ { 0x55, "unknown-0x55" },
+ { 0x56, "unknown-0x56" },
+ { 0x57, "unknown-0x57" },
+ { 0x58, "unknown-0x58" },
+ { 0x59, "unknown-0x59" },
+ { 0x5A, "unknown-0x5A" },
+ { 0x5B, "unknown-0x5B" },
+ { 0x5C, "unknown-0x5C" },
+ { 0x5D, "unknown-0x5D" },
+ { 0x5E, "unknown-0x5E" },
+ { 0x5F, "unknown-0x5F" },
+ { 0x60, "unknown-0x60" },
+ { 0x61, "unknown-0x61" },
+ { 0x62, "unknown-0x62" },
+ { 0x63, "unknown-0x63" },
+ { 0x64, "unknown-0x64" },
+ { 0x65, "unknown-0x65" },
+ { 0x66, "unknown-0x66" },
+ { 0x67, "unknown-0x67" },
+ { 0x68, "unknown-0x68" },
+ { 0x69, "unknown-0x69" },
+ { 0x6A, "unknown-0x6A" },
+ { 0x6B, "unknown-0x6B" },
+ { 0x6C, "unknown-0x6C" },
+ { 0x6D, "unknown-0x6D" },
+ { 0x6E, "unknown-0x6E" },
+ { 0x6F, "unknown-0x6F" },
+ { 0x70, "SMBtcon" },
+ { 0x71, "SMBtdis" },
+ { 0x72, "SMBnegprot" },
+ { 0x73, "SMBsesssetupX" },
+ { 0x74, "SMBlogoffX" },
+ { 0x75, "SMBtconX" },
+ { 0x76, "unknown-0x76" },
+ { 0x77, "unknown-0x77" },
+ { 0x78, "unknown-0x78" },
+ { 0x79, "unknown-0x79" },
+ { 0x7A, "unknown-0x7A" },
+ { 0x7B, "unknown-0x7B" },
+ { 0x7C, "unknown-0x7C" },
+ { 0x7D, "unknown-0x7D" },
+ { 0x7E, "unknown-0x7E" },
+ { 0x7F, "unknown-0x7F" },
+ { 0x80, "SMBdskattr" },
+ { 0x81, "SMBsearch" },
+ { 0x82, "SMBffirst" },
+ { 0x83, "SMBfunique" },
+ { 0x84, "SMBfclose" },
+ { 0x85, "unknown-0x85" },
+ { 0x86, "unknown-0x86" },
+ { 0x87, "unknown-0x87" },
+ { 0x88, "unknown-0x88" },
+ { 0x89, "unknown-0x89" },
+ { 0x8A, "unknown-0x8A" },
+ { 0x8B, "unknown-0x8B" },
+ { 0x8C, "unknown-0x8C" },
+ { 0x8D, "unknown-0x8D" },
+ { 0x8E, "unknown-0x8E" },
+ { 0x8F, "unknown-0x8F" },
+ { 0x90, "unknown-0x90" },
+ { 0x91, "unknown-0x91" },
+ { 0x92, "unknown-0x92" },
+ { 0x93, "unknown-0x93" },
+ { 0x94, "unknown-0x94" },
+ { 0x95, "unknown-0x95" },
+ { 0x96, "unknown-0x96" },
+ { 0x97, "unknown-0x97" },
+ { 0x98, "unknown-0x98" },
+ { 0x99, "unknown-0x99" },
+ { 0x9A, "unknown-0x9A" },
+ { 0x9B, "unknown-0x9B" },
+ { 0x9C, "unknown-0x9C" },
+ { 0x9D, "unknown-0x9D" },
+ { 0x9E, "unknown-0x9E" },
+ { 0x9F, "unknown-0x9F" },
+ { 0xA0, "SMBnttransact" },
+ { 0xA1, "SMBnttransactsecondary" },
+ { 0xA2, "SMBntcreateX" },
+ { 0xA3, "unknown-0xA3" },
+ { 0xA4, "SMBntcancel" },
+ { 0xA5, "unknown-0xA5" },
+ { 0xA6, "unknown-0xA6" },
+ { 0xA7, "unknown-0xA7" },
+ { 0xA8, "unknown-0xA8" },
+ { 0xA9, "unknown-0xA9" },
+ { 0xAA, "unknown-0xAA" },
+ { 0xAB, "unknown-0xAB" },
+ { 0xAC, "unknown-0xAC" },
+ { 0xAD, "unknown-0xAD" },
+ { 0xAE, "unknown-0xAE" },
+ { 0xAF, "unknown-0xAF" },
+ { 0xB0, "unknown-0xB0" },
+ { 0xB1, "unknown-0xB1" },
+ { 0xB2, "unknown-0xB2" },
+ { 0xB3, "unknown-0xB3" },
+ { 0xB4, "unknown-0xB4" },
+ { 0xB5, "unknown-0xB5" },
+ { 0xB6, "unknown-0xB6" },
+ { 0xB7, "unknown-0xB7" },
+ { 0xB8, "unknown-0xB8" },
+ { 0xB9, "unknown-0xB9" },
+ { 0xBA, "unknown-0xBA" },
+ { 0xBB, "unknown-0xBB" },
+ { 0xBC, "unknown-0xBC" },
+ { 0xBD, "unknown-0xBD" },
+ { 0xBE, "unknown-0xBE" },
+ { 0xBF, "unknown-0xBF" },
+ { 0xC0, "SMBsplopen" },
+ { 0xC1, "SMBsplwr" },
+ { 0xC2, "SMBsplclose" },
+ { 0xC3, "SMBsplretq" },
+ { 0xC4, "unknown-0xC4" },
+ { 0xC5, "unknown-0xC5" },
+ { 0xC6, "unknown-0xC6" },
+ { 0xC7, "unknown-0xC7" },
+ { 0xC8, "unknown-0xC8" },
+ { 0xC9, "unknown-0xC9" },
+ { 0xCA, "unknown-0xCA" },
+ { 0xCB, "unknown-0xCB" },
+ { 0xCC, "unknown-0xCC" },
+ { 0xCD, "unknown-0xCD" },
+ { 0xCE, "unknown-0xCE" },
+ { 0xCF, "unknown-0xCF" },
+ { 0xD0, "SMBsends" },
+ { 0xD1, "SMBsendb" },
+ { 0xD2, "SMBfwdname" },
+ { 0xD3, "SMBcancelf" },
+ { 0xD4, "SMBgetmac" },
+ { 0xD5, "SMBsendstrt" },
+ { 0xD6, "SMBsendend" },
+ { 0xD7, "SMBsendtxt" },
+ { 0xD8, "SMBreadbulk" },
+ { 0xD9, "SMBwritebulk" },
+ { 0xDA, "SMBwritebulkdata" },
+ { 0xDB, "unknown-0xDB" },
+ { 0xDC, "unknown-0xDC" },
+ { 0xDD, "unknown-0xDD" },
+ { 0xDE, "unknown-0xDE" },
+ { 0xDF, "unknown-0xDF" },
+ { 0xE0, "unknown-0xE0" },
+ { 0xE1, "unknown-0xE1" },
+ { 0xE2, "unknown-0xE2" },
+ { 0xE3, "unknown-0xE3" },
+ { 0xE4, "unknown-0xE4" },
+ { 0xE5, "unknown-0xE5" },
+ { 0xE6, "unknown-0xE6" },
+ { 0xE7, "unknown-0xE7" },
+ { 0xE8, "unknown-0xE8" },
+ { 0xE9, "unknown-0xE9" },
+ { 0xEA, "unknown-0xEA" },
+ { 0xEB, "unknown-0xEB" },
+ { 0xEC, "unknown-0xEC" },
+ { 0xED, "unknown-0xED" },
+ { 0xEE, "unknown-0xEE" },
+ { 0xEF, "unknown-0xEF" },
+ { 0xF0, "unknown-0xF0" },
+ { 0xF1, "unknown-0xF1" },
+ { 0xF2, "unknown-0xF2" },
+ { 0xF3, "unknown-0xF3" },
+ { 0xF4, "unknown-0xF4" },
+ { 0xF5, "unknown-0xF5" },
+ { 0xF6, "unknown-0xF6" },
+ { 0xF7, "unknown-0xF7" },
+ { 0xF8, "unknown-0xF8" },
+ { 0xF9, "unknown-0xF9" },
+ { 0xFA, "unknown-0xFA" },
+ { 0xFB, "unknown-0xFB" },
+ { 0xFC, "unknown-0xFC" },
+ { 0xFD, "unknown-0xFD" },
+ { 0xFE, "SMBinvalid" },
+ { 0xFF, "unknown-0xFF" },
+};
+
char *SMB_names[256] = {
"SMBcreatedirectory",
"SMBdeletedirectory",
if (tree) {
- proto_tree_add_text(tree, offset, END_OF_FRAME, "Data (%u bytes)",
+ proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME, "Data (%u bytes)",
END_OF_FRAME);
}
* Dissect a UNIX like date ...
*/
-struct tm *gtime;
+struct tm *_gtime; /* Add leading underscore ("_") to prevent symbol
+ conflict with /usr/include/time.h on some NetBSD
+ systems */
static char *
dissect_smbu_date(guint16 date, guint16 time)
{
- static char datebuf[4+2+2+2+1];
+ static char datebuf[4+2+2+2+1+10];
time_t ltime = (date << 16) + time;
- gtime = gmtime(<ime);
- sprintf(datebuf, "%04d-%02d-%02d",
- 1900 + (gtime -> tm_year), gtime -> tm_mon, gtime -> tm_mday);
+ _gtime = gmtime(<ime);
+
+ if (_gtime)
+ sprintf(datebuf, "%04d-%02d-%02d",
+ 1900 + (_gtime -> tm_year), 1 + (_gtime -> tm_mon), _gtime -> tm_mday);
+ else
+ sprintf(datebuf, "Bad date format");
return datebuf;
dissect_smbu_time(guint16 date, guint16 time)
{
- static char timebuf[2+2+2+2+1];
+ static char timebuf[2+2+2+2+1+10];
- sprintf(timebuf, "%02d:%02d:%02d",
- gtime -> tm_hour, gtime -> tm_min, gtime -> tm_sec);
+ if (_gtime)
+ sprintf(timebuf, "%02d:%02d:%02d",
+ _gtime -> tm_hour, _gtime -> tm_min, _gtime -> tm_sec);
+ else
+ sprintf(timebuf, "Bad time format");
return timebuf;
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Total Units: %u", TotalUnits);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Units: %u", TotalUnits);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Blocks Per Unit: %u", BlocksPerUnit);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Blocks Per Unit: %u", BlocksPerUnit);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Block Size: %u", BlockSize);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Block Size: %u", BlockSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Free Units: %u", FreeUnits);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Free Units: %u", FreeUnits);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Attributes: 0x%02x", Attributes);
Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x02, 16, "Hidden file", "Not a hidden file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x04, 16, "System file", "Not a system file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x08, 16, " Volume", "Not a volume"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x10, 16, " Directory", "Not a directory"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x20, 16, " Archived", "Not archived"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Time: %u", dissect_dos_time(LastWriteTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Time: %s", dissect_dos_time(LastWriteTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Date: %u", dissect_dos_date(LastWriteDate));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Date: %s", dissect_dos_date(LastWriteDate));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 3: %u", Reserved3);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 3: %u", Reserved3);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 4: %u", Reserved4);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 4: %u", Reserved4);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 5: %u", Reserved5);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 5: %u", Reserved5);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(FileName) + 1, "File Name: %s", FileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(FileName) + 1, "File Name: %s", FileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Remaining: %u", Remaining);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining: %u", Remaining);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
offset += 2; /* Skip Data Length */
+ if (ByteCount > 0 && tree) {
+
+ if(END_OF_FRAME >= ByteCount)
+ proto_tree_add_text(tree, NullTVB, offset, ByteCount, "Data (%u bytes)", ByteCount);
+ else
+ proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME, "Data (first %u bytes)", END_OF_FRAME);
+
+ }
+
}
if (dirn == 0) { /* Response(s) dissect code */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Count: %u", MaxCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Count: %u", MaxCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Min Count: %u", MinCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Min Count: %u", MinCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count: %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count: %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Compaction Mode: %u", DataCompactionMode);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Compaction Mode: %u", DataCompactionMode);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad: %u", Pad);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Pad: %u", Pad);
}
{
guint8 WordCount;
guint8 BufferFormat;
+ guint16 SearchAttributes;
guint16 ByteCount;
const char *FileName;
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
offset += 1; /* Skip Word Count (WCT) */
+ /* Build display for: SearchAttributes */
+
+ SearchAttributes = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Search Attributes: %u", SearchAttributes);
+ }
+
+ offset += 2; /* Skip SearchAttributes */
+
/* Build display for: Byte Count (BCC) */
ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(FileName) + 1, "File Name: %s", FileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(FileName) + 1, "File Name: %s", FileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Creation Date: %u", dissect_dos_date(CreationDate));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Date: %s", dissect_dos_date(CreationDate));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Creation Time: %u", dissect_dos_time(CreationTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Time: %s", dissect_dos_time(CreationTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Access Date: %u", dissect_dos_date(LastAccessDate));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Access Date: %s", dissect_dos_date(LastAccessDate));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Access Time: %u", dissect_dos_time(LastAccessTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Access Time: %s", dissect_dos_time(LastAccessTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Date: %u", dissect_dos_date(LastWriteDate));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Date: %s", dissect_dos_date(LastWriteDate));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Time: %u", dissect_dos_time(LastWriteTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Time: %s", dissect_dos_time(LastWriteTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "File Data Size: %u", FileDataSize);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "File Data Size: %u", FileDataSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "File Allocation Size: %u", FileAllocationSize);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "File Allocation Size: %u", FileAllocationSize);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Attributes: 0x%02x", Attributes);
Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x02, 16, "Hidden file", "Not a hidden file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x04, 16, "System file", "Not a system file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x08, 16, " Volume", "Not a volume"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x10, 16, " Directory", "Not a directory"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x20, 16, " Archived", "Not archived"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "BufferFormat1: %u", BufferFormat1);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "BufferFormat1: %u", BufferFormat1);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(SharePath) + 1, "Share Path: %s", SharePath);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(SharePath) + 1, "Share Path: %s", SharePath);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "BufferFormat2: %u", BufferFormat2);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "BufferFormat2: %u", BufferFormat2);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(Password) + 1, "Password: %s", Password);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(Password) + 1, "Password: %s", Password);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "BufferFormat3: %u", BufferFormat3);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "BufferFormat3: %u", BufferFormat3);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(Service) + 1, "Service: %s", Service);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(Service) + 1, "Service: %s", Service);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Buffer Size: %u", MaxBufferSize);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Buffer Size: %u", MaxBufferSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "TID: %u", TID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "TID: %u", TID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %s",
(AndXCommand == 0xFF ? "No further commands" : decode_smb_name(AndXCommand)));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "MaxBufferSize: %u", MaxBufferSize);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "MaxBufferSize: %u", MaxBufferSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "MaxMpxCount: %u", MaxMpxCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "MaxMpxCount: %u", MaxMpxCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "VcNumber: %u", VcNumber);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "VcNumber: %u", VcNumber);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "SessionKey: %u", SessionKey);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "SessionKey: %u", SessionKey);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "PasswordLen: %u", PasswordLen);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "PasswordLen: %u", PasswordLen);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(Password) + 1, "Password: %s", Password);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(Password) + 1, "Password: %s", Password);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(AccountName) + 1, "AccountName: %s", AccountName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(AccountName) + 1, "AccountName: %s", AccountName);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(PrimaryDomain) + 1, "PrimaryDomain: %s", PrimaryDomain);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(PrimaryDomain) + 1, "PrimaryDomain: %s", PrimaryDomain);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NativeOS) + 1, "Native OS: %s", NativeOS);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(NativeOS) + 1, "Native OS: %s", NativeOS);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NativeLanMan) + 1, "Native Lan Manager: %s", NativeLanMan);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(NativeLanMan) + 1, "Native Lan Manager: %s", NativeLanMan);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %s",
(AndXCommand == 0xFF ? "No further commands" : decode_smb_name(AndXCommand)));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "MaxBufferSize: %u", MaxBufferSize);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "MaxBufferSize: %u", MaxBufferSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "MaxMpxCount: %u", MaxMpxCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "MaxMpxCount: %u", MaxMpxCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "VcNumber: %u", VcNumber);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "VcNumber: %u", VcNumber);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "SessionKey: %u", SessionKey);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "SessionKey: %u", SessionKey);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "ANSI Account Password Length: %u", ANSIAccountPasswordLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "ANSI Account Password Length: %u", ANSIAccountPasswordLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "UNICODE Account Password Length: %u", UNICODEAccountPasswordLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "UNICODE Account Password Length: %u", UNICODEAccountPasswordLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved: %u", Reserved);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 4, "Capabilities: 0x%04x", Capabilities);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 4, "Capabilities: 0x%04x", Capabilities);
Capabilities_tree = proto_item_add_subtree(ti, ett_smb_capabilities);
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0001, 32, " Raw Mode supported", " Raw Mode not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0002, 32, " Raw Mode supported", " MPX Mode not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0004, 32," Unicode supported", " Unicode not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0008, 32, " Large Files supported", " Large Files not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0010, 32, " NT LM 0.12 SMBs supported", " NT LM 0.12 SMBs not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0020, 32, " RPC Remote APIs supported", " RPC Remote APIs not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0040, 32, " NT Status Codes supported", " NT Status Codes not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0080, 32, " Level 2 OpLocks supported", " Level 2 OpLocks not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0100, 32, " Lock&Read supported", " Lock&Read not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x0200, 32, " NT Find supported", " NT Find not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x1000, 32, " DFS supported", " DFS not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x4000, 32, " Large READX supported", " Large READX not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x8000, 32, " Large WRITEX supported", " Large WRITEX not supported"));
- proto_tree_add_text(Capabilities_tree, offset, 4, "%s",
+ proto_tree_add_text(Capabilities_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(Capabilities, 0x80000000, 32, " Extended Security Exchanges supported", " Extended Security Exchanges not supported"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (ByteCount > 0) {
- /* Build display for: ANSI Password */
+ /* Build display for: ANSI Password */
- ANSIPassword = pd + offset;
+ ANSIPassword = pd + offset;
- if (tree) {
+ if (ANSIAccountPasswordLength > 0) {
- proto_tree_add_text(tree, offset, strlen(ANSIPassword) + 1, "ANSI Password: %s", ANSIPassword);
+ if (tree) {
- }
+ proto_tree_add_text(tree, NullTVB, offset, ANSIAccountPasswordLength, "ANSI Password: %s", format_text(ANSIPassword, ANSIAccountPasswordLength));
+
+ }
- offset += ANSIAccountPasswordLength; /* Skip ANSI Password */
- if (ANSIAccountPasswordLength == 0) offset++; /* Add 1 */
+ offset += ANSIAccountPasswordLength; /* Skip ANSI Password */
+ }
/* Build display for: UNICODE Password */
if (tree) {
- proto_tree_add_text(tree, offset, strlen(UNICODEPassword) + 1, "UNICODE Password: %s", UNICODEPassword);
+ proto_tree_add_text(tree, NullTVB, offset, UNICODEAccountPasswordLength, "UNICODE Password: %s", format_text(UNICODEPassword, UNICODEAccountPasswordLength));
}
- offset += strlen(UNICODEPassword) + 1; /* Skip UNICODE Password */
+ offset += UNICODEAccountPasswordLength; /* Skip UNICODE Password */
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(AccountName) + 1, "Account Name: %s", AccountName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(AccountName) + 1, "Account Name: %s", AccountName);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(PrimaryDomain) + 1, "Primary Domain: %s", PrimaryDomain);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(PrimaryDomain) + 1, "Primary Domain: %s", PrimaryDomain);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NativeOS) + 1, "Native OS: %s", NativeOS);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(NativeOS) + 1, "Native OS: %s", NativeOS);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NativeLanManType) + 1, "Native LanMan Type: %s", NativeLanManType);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(NativeLanManType) + 1, "Native LanMan Type: %s", NativeLanManType);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %s",
(AndXCommand == 0xFF ? "No futher commands" : decode_smb_name(AndXCommand)));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Action: %u", Action);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Action: %u", Action);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NativeOS) + 1, "NativeOS: %s", NativeOS);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(NativeOS) + 1, "NativeOS: %s", NativeOS);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NativeLanMan) + 1, "NativeLanMan: %s", NativeLanMan);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(NativeLanMan) + 1, "NativeLanMan: %s", NativeLanMan);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(PrimaryDomain) + 1, "PrimaryDomain: %s", PrimaryDomain);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(PrimaryDomain) + 1, "PrimaryDomain: %s", PrimaryDomain);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Invalid TCON_ANDX format. WCT should be 0, 2, 3, or 4 ..., not %u", wct);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Invalid TCON_ANDX format. WCT should be 0, 2, 3, or 4 ..., not %u", wct);
- proto_tree_add_text(tree, offset, END_OF_FRAME, "Data");
+ proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME, "Data");
return;
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", wct);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", wct);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Next Command: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Next Command: %s",
(andxcmd == 0xFF) ? "No further commands":
decode_smb_name(andxcmd));
- proto_tree_add_text(tree, offset + 1, 1, "Reserved (MBZ): %u", pd[offset+1]);
+ proto_tree_add_text(tree, NullTVB, offset + 1, 1, "Reserved (MBZ): %u", pd[offset+1]);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Offset to next command: %u", andxoffs);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Offset to next command: %u", andxoffs);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", bcc);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Additional Flags: 0x%02x", flags);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Additional Flags: 0x%02x", flags);
flags_tree = proto_item_add_subtree(ti, ett_smb_aflags);
- proto_tree_add_text(flags_tree, offset, 2, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags, 0x01, 16,
"Disconnect TID",
"Don't disconnect TID"));
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Password Length: %u", passwdlen);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Password Length: %u", passwdlen);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", bcc);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(str) + 1, "Password: %s", format_text(str, passwdlen));
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str) + 1, "Password: %s", format_text(str, passwdlen));
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(str) + 1, "Path: %s", str);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str) + 1, "Path: %s", str);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(str) + 1, "Service: %s", str);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str) + 1, "Service: %s", str);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", bcc);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(str) + 1, "Service Type: %s",
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str) + 1, "Service Type: %s",
str);
}
if (tree) { /* Should break out the bits */
- proto_tree_add_text(tree, offset, 2, "Optional Support: 0x%04x",
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Optional Support: 0x%04x",
optionsup);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", bcc);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(str) + 1, "Service: %s", str);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str) + 1, "Service: %s", str);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(str) + 1, "Native File System: %s", str);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str) + 1, "Native File System: %s", str);
}
!((wct == 13) && (dirn == 0)) && !((wct == 17) && (dirn == 0))) {
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Invalid Negotiate Protocol format. WCT should be zero or 1 or 13 or 17 ..., not %u", wct);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Invalid Negotiate Protocol format. WCT should be zero or 1 or 13 or 17 ..., not %u", wct);
- proto_tree_add_text(tree, offset, END_OF_FRAME, "Data");
+ proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME, "Data");
return;
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %d", wct);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %d", wct);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", bcc);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, END_OF_FRAME, "Dialects");
+ ti = proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME, "Dialects");
dialects = proto_item_add_subtree(ti, ett_smb_dialects);
}
if (tree) {
- proto_tree_add_text(dialects, offset, 1, "Dialect Marker: %d", pd[offset]);
+ proto_tree_add_text(dialects, NullTVB, offset, 1, "Dialect Marker: %d", pd[offset]);
}
if (tree) {
- proto_tree_add_text(dialects, offset, strlen(str)+1, "Dialect: %s", str);
+ proto_tree_add_text(dialects, NullTVB, offset, strlen(str)+1, "Dialect: %s", str);
}
if (dialect == 0xFFFF) { /* Server didn't like them dialects */
- proto_tree_add_text(tree, offset, 2, "Supplied dialects not recognized");
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Supplied dialects not recognized");
}
else {
- proto_tree_add_text(tree, offset, 2, "Dialect Index: %u, PC NETWORK PROTGRAM 1.0", dialect);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Dialect Index: %u, PC NETWORK PROTGRAM 1.0", dialect);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", bcc);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Dialect Index: %u, Greater than CORE PROTOCOL and up to LANMAN2.1", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Dialect Index: %u, Greater than CORE PROTOCOL and up to LANMAN2.1", GSHORT(pd, offset));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Security Mode: 0x%04x", mode);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Security Mode: 0x%04x", mode);
mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
- proto_tree_add_text(mode_tree, offset, 2, "%s",
+ proto_tree_add_text(mode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(mode, 0x0001, 16,
"Security = User",
"Security = Share"));
- proto_tree_add_text(mode_tree, offset, 2, "%s",
+ proto_tree_add_text(mode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(mode, 0x0002, 16,
"Passwords = Encrypted",
"Passwords = Plaintext"));
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max buffer size: %u", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max buffer size: %u", GSHORT(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max multiplex count: %u", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max multiplex count: %u", GSHORT(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max vcs: %u", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max vcs: %u", GSHORT(pd, offset));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Raw Mode: 0x%04x", rawmode);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Raw Mode: 0x%04x", rawmode);
rawmode_tree = proto_item_add_subtree(ti, ett_smb_rawmode);
- proto_tree_add_text(rawmode_tree, offset, 2, "%s",
+ proto_tree_add_text(rawmode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(rawmode, 0x01, 16,
"Read Raw supported",
"Read Raw not supported"));
- proto_tree_add_text(rawmode_tree, offset, 2, "%s",
+ proto_tree_add_text(rawmode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(rawmode, 0x02, 16,
"Write Raw supported",
"Write Raw not supported"));
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Session key: %08x", GWORD(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Session key: %08x", GWORD(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Server Time: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Server Time: %s",
dissect_dos_time(GSHORT(pd, offset)));
- proto_tree_add_text(tree, offset + 2, 2, "Server Date: %s",
+ proto_tree_add_text(tree, NullTVB, offset + 2, 2, "Server Date: %s",
dissect_dos_date(GSHORT(pd, offset + 2)));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Server time zone: %i min from UTC",
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Server time zone: %i min from UTC",
(signed)GSSHORT(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Challenge Length: %u", enckeylen);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Challenge Length: %u", enckeylen);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u (MBZ)", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u (MBZ)", GSHORT(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", bcc);
}
if (tree) {
- proto_tree_add_text(tree, offset, enckeylen, "Challenge: %s",
+ proto_tree_add_text(tree, NullTVB, offset, enckeylen, "Challenge: %s",
bytes_to_str(str, enckeylen));
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(str)+1, "Primary Domain: %s", str);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str)+1, "Primary Domain: %s", str);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Dialect Index: %u, Greater than LANMAN2.1", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Dialect Index: %u, Greater than LANMAN2.1", GSHORT(pd, offset));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 1, "Security Mode: 0x%02x", mode);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 1, "Security Mode: 0x%02x", mode);
mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
- proto_tree_add_text(mode_tree, offset, 1, "%s",
+ proto_tree_add_text(mode_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(mode, 0x01, 8,
"Security = User",
"Security = Share"));
- proto_tree_add_text(mode_tree, offset, 1, "%s",
+ proto_tree_add_text(mode_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(mode, 0x02, 8,
"Passwords = Encrypted",
"Passwords = Plaintext"));
- proto_tree_add_text(mode_tree, offset, 1, "%s",
+ proto_tree_add_text(mode_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(mode, 0x04, 8,
"Security signatures enabled",
"Security signatures not enabled"));
- proto_tree_add_text(mode_tree, offset, 1, "%s",
+ proto_tree_add_text(mode_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(mode, 0x08, 8,
"Security signatures required",
"Security signatures not required"));
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max multiplex count: %u", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max multiplex count: %u", GSHORT(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max vcs: %u", GSHORT(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max vcs: %u", GSHORT(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max buffer size: %u", GWORD(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max buffer size: %u", GWORD(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Max raw size: %u", GWORD(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Max raw size: %u", GWORD(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Session key: %08x", GWORD(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Session key: %08x", GWORD(pd, offset));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 4, "Capabilities: 0x%04x", caps);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 4, "Capabilities: 0x%04x", caps);
caps_tree = proto_item_add_subtree(ti, ett_smb_capabilities);
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0001, 32,
"Raw Mode supported",
"Raw Mode not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0002, 32,
"MPX Mode supported",
"MPX Mode not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0004, 32,
"Unicode supported",
"Unicode not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0008, 32,
"Large files supported",
"Large files not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0010, 32,
"NT LM 0.12 SMBs supported",
"NT LM 0.12 SMBs not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0020, 32,
"RPC remote APIs supported",
"RPC remote APIs not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0040, 32,
"NT status codes supported",
"NT status codes not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0080, 32,
"Level 2 OpLocks supported",
"Level 2 OpLocks not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0100, 32,
"Lock&Read supported",
"Lock&Read not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x0200, 32,
"NT Find supported",
"NT Find not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x1000, 32,
"DFS supported",
"DFS not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x4000, 32,
"Large READX supported",
"Large READX not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x8000, 32,
"Large WRITEX supported",
"Large WRITEX not supported"));
- proto_tree_add_text(caps_tree, offset, 4, "%s",
+ proto_tree_add_text(caps_tree, NullTVB, offset, 4, "%s",
decode_boolean_bitfield(caps, 0x80000000, 32,
"Extended security exchanges supported",
"Extended security exchanges not supported"));
if (tree) {
- proto_tree_add_text(tree, offset, 4, "System Time Low: 0x%08x", GWORD(pd, offset));
- proto_tree_add_text(tree, offset + 4, 4, "System Time High: 0x%08x", GWORD(pd, offset + 4));
+ proto_tree_add_text(tree, NullTVB, offset, 4, "System Time Low: 0x%08x", GWORD(pd, offset));
+ proto_tree_add_text(tree, NullTVB, offset + 4, 4, "System Time High: 0x%08x", GWORD(pd, offset + 4));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Server time zone: %i min from UTC",
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Server time zone: %i min from UTC",
(signed)GSSHORT(pd, offset));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Encryption key len: %u", enckeylen);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Encryption key len: %u", enckeylen);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte count (BCC): %u", bcc);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte count (BCC): %u", bcc);
}
if (tree) {
- proto_tree_add_text(tree, offset, enckeylen, "Challenge encryption key: %s",
+ proto_tree_add_text(tree, NullTVB, offset, enckeylen, "Challenge encryption key: %s",
bytes_to_str(str, enckeylen));
}
if (caps & 0x0004) {
ustr = unicode_to_str(str, &ustr_len);
- proto_tree_add_text(tree, offset, ustr_len+2, "OEM domain name: %s", ustr);
+ proto_tree_add_text(tree, NullTVB, offset, ustr_len+2, "OEM domain name: %s", ustr);
} else {
- proto_tree_add_text(tree, offset, strlen(str)+1, "OEM domain name: %s", str);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(str)+1, "OEM domain name: %s", str);
}
}
default: /* Baddd */
if (tree)
- proto_tree_add_text(tree, offset, 1, "Bad format, should never get here");
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Bad format, should never get here");
return;
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
}
+
void
dissect_checkdir_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %s",
(AndXCommand == 0xFF ? "No further commands" : decode_smb_name(AndXCommand)));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Flags: 0x%02x", Flags);
Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x01, 16, "Dont Return Additional Info", "Return Additional Info"));
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x02, 16, "Exclusive OpLock not Requested", "Exclusive OpLock Requested"));
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x04, 16, "Batch OpLock not Requested", "Batch OpLock Requested"));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Desired Access: 0x%02x", DesiredAccess);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Desired Access: 0x%02x", DesiredAccess);
DesiredAccess_tree = proto_item_add_subtree(ti, ett_smb_desiredaccess);
- proto_tree_add_text(DesiredAccess_tree, offset, 2, "%s",
+ proto_tree_add_text(DesiredAccess_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(DesiredAccess, 0x07, 16, DesiredAccess_0x07, "%s"));
- proto_tree_add_text(DesiredAccess_tree, offset, 2, "%s",
+ proto_tree_add_text(DesiredAccess_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(DesiredAccess, 0x70, 16, DesiredAccess_0x70, "%s"));
- proto_tree_add_text(DesiredAccess_tree, offset, 2, "%s",
+ proto_tree_add_text(DesiredAccess_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(DesiredAccess, 0x700, 16, DesiredAccess_0x700, "%s"));
- proto_tree_add_text(DesiredAccess_tree, offset, 2, "%s",
+ proto_tree_add_text(DesiredAccess_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(DesiredAccess, 0x1000, 16, DesiredAccess_0x1000, "%s"));
- proto_tree_add_text(DesiredAccess_tree, offset, 2, "%s",
+ proto_tree_add_text(DesiredAccess_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(DesiredAccess, 0x4000, 16, DesiredAccess_0x4000, "%s"));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Search: 0x%02x", Search);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Search: 0x%02x", Search);
Search_tree = proto_item_add_subtree(ti, ett_smb_search);
- proto_tree_add_text(Search_tree, offset, 2, "%s",
+ proto_tree_add_text(Search_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Search, 0x01, 16, "Read only file", "Not a read only file"));
- proto_tree_add_text(Search_tree, offset, 2, "%s",
+ proto_tree_add_text(Search_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Search, 0x02, 16, "Hidden file", "Not a hidden file"));
- proto_tree_add_text(Search_tree, offset, 2, "%s",
+ proto_tree_add_text(Search_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Search, 0x04, 16, "System file", "Not a system file"));
- proto_tree_add_text(Search_tree, offset, 2, "%s",
+ proto_tree_add_text(Search_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Search, 0x08, 16, " Volume", "Not a volume"));
- proto_tree_add_text(Search_tree, offset, 2, "%s",
+ proto_tree_add_text(Search_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Search, 0x10, 16, " Directory", "Not a directory"));
- proto_tree_add_text(Search_tree, offset, 2, "%s",
+ proto_tree_add_text(Search_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Search, 0x20, 16, "Archive file", "Do not archive file"));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "File: 0x%02x", File);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "File: 0x%02x", File);
File_tree = proto_item_add_subtree(ti, ett_smb_file);
- proto_tree_add_text(File_tree, offset, 2, "%s",
+ proto_tree_add_text(File_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(File, 0x01, 16, "Read only file", "Not a read only file"));
- proto_tree_add_text(File_tree, offset, 2, "%s",
+ proto_tree_add_text(File_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(File, 0x02, 16, "Hidden file", "Not a hidden file"));
- proto_tree_add_text(File_tree, offset, 2, "%s",
+ proto_tree_add_text(File_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(File, 0x04, 16, "System file", "Not a system file"));
- proto_tree_add_text(File_tree, offset, 2, "%s",
+ proto_tree_add_text(File_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(File, 0x08, 16, " Volume", "Not a volume"));
- proto_tree_add_text(File_tree, offset, 2, "%s",
+ proto_tree_add_text(File_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(File, 0x10, 16, " Directory", "Not a directory"));
- proto_tree_add_text(File_tree, offset, 2, "%s",
+ proto_tree_add_text(File_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(File, 0x20, 16, "Archive file", "Do not archive file"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Creation Date: %s", dissect_smbu_date(CreationDate, CreationTime));
- proto_tree_add_text(tree, offset, 2, "Creation Time: %s", dissect_smbu_time(CreationDate, CreationTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Date: %s", dissect_smbu_date(CreationDate, CreationTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Time: %s", dissect_smbu_time(CreationDate, CreationTime));
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Open Function: 0x%02x", OpenFunction);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Open Function: 0x%02x", OpenFunction);
OpenFunction_tree = proto_item_add_subtree(ti, ett_smb_openfunction);
- proto_tree_add_text(OpenFunction_tree, offset, 2, "%s",
+ proto_tree_add_text(OpenFunction_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(OpenFunction, 0x10, 16, OpenFunction_0x10, "%s"));
- proto_tree_add_text(OpenFunction_tree, offset, 2, "%s",
+ proto_tree_add_text(OpenFunction_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(OpenFunction, 0x03, 16, OpenFunction_0x03, "%s"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Allocated Size: %u", AllocatedSize);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Allocated Size: %u", AllocatedSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Reserved1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Reserved2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(FileName) + 1, "File Name: %s", FileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(FileName) + 1, "File Name: %s", FileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %s",
(AndXCommand == 0xFF ? "No further commands" : decode_smb_name(AndXCommand)));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "FileAttributes: 0x%02x", FileAttributes);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "FileAttributes: 0x%02x", FileAttributes);
FileAttributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
- proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
+ proto_tree_add_text(FileAttributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(FileAttributes, 0x01, 16, "Read only file", "Not a read only file"));
- proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
+ proto_tree_add_text(FileAttributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(FileAttributes, 0x02, 16, "Hidden file", "Not a hidden file"));
- proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
+ proto_tree_add_text(FileAttributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(FileAttributes, 0x04, 16, "System file", "Not a system file"));
- proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
+ proto_tree_add_text(FileAttributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(FileAttributes, 0x08, 16, " Volume", "Not a volume"));
- proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
+ proto_tree_add_text(FileAttributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(FileAttributes, 0x10, 16, " Directory", "Not a directory"));
- proto_tree_add_text(FileAttributes_tree, offset, 2, "%s",
+ proto_tree_add_text(FileAttributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(FileAttributes, 0x20, 16, "Archive file", "Do not archive file"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Date: %s", dissect_smbu_date(LastWriteDate, LastWriteTime));
- proto_tree_add_text(tree, offset, 2, "Last Write Time: %s", dissect_smbu_time(LastWriteDate, LastWriteTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Date: %s", dissect_smbu_date(LastWriteDate, LastWriteTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Time: %s", dissect_smbu_time(LastWriteDate, LastWriteTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Data Size: %u", DataSize);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Data Size: %u", DataSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Granted Access: %u", GrantedAccess);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Granted Access: %u", GrantedAccess);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "File Type: 0x%02x", FileType);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "File Type: 0x%02x", FileType);
FileType_tree = proto_item_add_subtree(ti, ett_smb_filetype);
- proto_tree_add_text(FileType_tree, offset, 2, "%s",
+ proto_tree_add_text(FileType_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(FileType, 0xFFFF, 16, FileType_0xFFFF, "%s"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Device State: %u", DeviceState);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Device State: %u", DeviceState);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Action: 0x%02x", Action);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Action: 0x%02x", Action);
Action_tree = proto_item_add_subtree(ti, ett_smb_action);
- proto_tree_add_text(Action_tree, offset, 2, "%s",
+ proto_tree_add_text(Action_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(Action, 0x8000, 16, Action_0x8000, "%s"));
- proto_tree_add_text(Action_tree, offset, 2, "%s",
+ proto_tree_add_text(Action_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(Action, 0x0003, 16, Action_0x0003, "%s"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Server FID: %u", ServerFID);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Server FID: %u", ServerFID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "WriteMode: 0x%02x", WriteMode);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "WriteMode: 0x%02x", WriteMode);
WriteMode_tree = proto_item_add_subtree(ti, ett_smb_writemode);
- proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
+ proto_tree_add_text(WriteMode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x01, 16, "Write through requested", "Write through not requested"));
- proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
+ proto_tree_add_text(WriteMode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x02, 16, "Return Remaining (pipe/dev)", "Dont return Remaining (pipe/dev)"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Reserved 2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved 2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad: %u", Pad);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Pad: %u", Pad);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "WriteMode: 0x%02x", WriteMode);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "WriteMode: 0x%02x", WriteMode);
WriteMode_tree = proto_item_add_subtree(ti, ett_smb_writemode);
- proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
+ proto_tree_add_text(WriteMode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x01, 16, "Write through requested", "Write through not requested"));
- proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
+ proto_tree_add_text(WriteMode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x02, 16, "Return Remaining (pipe/dev)", "Dont return Remaining (pipe/dev)"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Reserved 2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved 2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad: %u", Pad);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Pad: %u", Pad);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Remaining: %u", Remaining);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining: %u", Remaining);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "TID2: %u", TID2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "TID2: %u", TID2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Open Function: %u", OpenFunction);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Open Function: %u", OpenFunction);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Flags: 0x%02x", Flags);
Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(Flags, 0x03, 16, Flags_0x03, "%s"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Error File Format: %u", ErrorFileFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Error File Format: %u", ErrorFileFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(ErrorFileName) + 1, "Error File Name: %s", ErrorFileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(ErrorFileName) + 1, "Error File Name: %s", ErrorFileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Search Attributes: %u", SearchAttributes);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Search Attributes: %u", SearchAttributes);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format 1: %u", BufferFormat1);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format 1: %u", BufferFormat1);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(OldFileName) + 1, "Old File Name: %s", OldFileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(OldFileName) + 1, "Old File Name: %s", OldFileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format 2: %u", BufferFormat2);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format 2: %u", BufferFormat2);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NewFileName) + 1, "New File Name: %s", NewFileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(NewFileName) + 1, "New File Name: %s", NewFileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Setup Length: %u", SetupLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Setup Length: %u", SetupLength);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Mode: 0x%02x", Mode);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Mode: 0x%02x", Mode);
Mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
- proto_tree_add_text(Mode_tree, offset, 2, "%s",
+ proto_tree_add_text(Mode_tree, NullTVB, offset, 2, "%s",
decode_enumerated_bitfield(Mode, 0x03, 16, Mode_0x03, "%s"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(IdentifierString) + 1, "Identifier String: %s", IdentifierString);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(IdentifierString) + 1, "Identifier String: %s", IdentifierString);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count: %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count: %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Count: %u", MaxCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Count: %u", MaxCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Min Count: %u", MinCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Min Count: %u", MinCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Count: %u", MaxCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Count: %u", MaxCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Min Count: %u", MinCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Min Count: %u", MinCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset High: %u", OffsetHigh);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset High: %u", OffsetHigh);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
}
void
-dissect_logoff_andx_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
+dissect_read_andx_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
{
guint8 WordCount;
guint8 AndXCommand = 0xFF;
guint16 ByteCount;
guint16 AndXOffset = 0;
+ guint16 FID;
+ guint16 DataCompactionMode;
+ guint16 DataLength;
+ guint16 DataOffset;
+ guint16 Remaining;
+ guint16 MaxCount;
+ guint16 MinCount;
+ guint16 Reserved;
+ guint32 Offset;
+ guint32 OffsetHigh;
+ int i;
if (dirn == 1) { /* Request(s) dissect code */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %u", AndXCommand);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %u", AndXCommand);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
offset += 2; /* Skip AndXOffset */
- /* Build display for: Byte Count (BCC) */
+ /* Build display for: FID */
- ByteCount = GSHORT(pd, offset);
+ FID = GSHORT(pd, offset);
if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
-
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
+
}
- offset += 2; /* Skip Byte Count (BCC) */
+ offset += 2; /* Skip FID */
+
+ /* Build display for: Offset */
+ Offset = GWORD(pd, offset);
- if (AndXCommand != 0xFF) {
+ if (tree) {
- (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
- }
-
- if (dirn == 0) { /* Response(s) dissect code */
+ offset += 4; /* Skip Offset */
- /* Build display for: Word Count (WCT) */
+ /* Build display for: Max Count */
- WordCount = GBYTE(pd, offset);
+ MaxCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Count: %u", MaxCount);
}
- offset += 1; /* Skip Word Count (WCT) */
+ offset += 2; /* Skip Max Count */
- /* Build display for: AndXCommand */
+ /* Build display for: Min Count */
- AndXCommand = GBYTE(pd, offset);
+ MinCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %u", AndXCommand);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Min Count: %u", MinCount);
}
- offset += 1; /* Skip AndXCommand */
+ offset += 2; /* Skip Min Count */
- /* Build display for: AndXReserved */
+ /* Build display for: Reserved */
- AndXReserved = GBYTE(pd, offset);
+ Reserved = GWORD(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Reserved: %u", Reserved);
}
- offset += 1; /* Skip AndXReserved */
+ offset += 4; /* Skip Reserved */
- /* Build display for: AndXOffset */
+ /* Build display for: Remaining */
- AndXOffset = GSHORT(pd, offset);
+ Remaining = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining: %u", Remaining);
}
- offset += 2; /* Skip AndXOffset */
+ offset += 2; /* Skip Remaining */
+
+ if (WordCount == 12) {
+
+ /* Build display for: Offset High */
+
+ OffsetHigh = GWORD(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset High: %u", OffsetHigh);
+
+ }
+
+ offset += 4; /* Skip Offset High */
+ }
/* Build display for: Byte Count (BCC) */
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
}
-}
-
-void
-dissect_seek_file_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
-
-{
- static const value_string Mode_0x03[] = {
- { 0, "Seek from start of file"},
- { 1, "Seek from current position"},
- { 2, "Seek from end of file"},
- { 0, NULL}
-};
- proto_tree *Mode_tree;
- proto_item *ti;
- guint8 WordCount;
- guint32 Offset;
- guint16 Mode;
- guint16 FID;
- guint16 ByteCount;
-
- if (dirn == 1) { /* Request(s) dissect code */
+ if (dirn == 0) { /* Response(s) dissect code */
/* Build display for: Word Count (WCT) */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
offset += 1; /* Skip Word Count (WCT) */
- /* Build display for: FID */
+ /* Build display for: AndXCommand */
- FID = GSHORT(pd, offset);
+ AndXCommand = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %u", AndXCommand);
}
- offset += 2; /* Skip FID */
+ offset += 1; /* Skip AndXCommand */
- /* Build display for: Mode */
+ /* Build display for: AndXReserved */
- Mode = GSHORT(pd, offset);
+ AndXReserved = GBYTE(pd, offset);
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Mode: 0x%02x", Mode);
- Mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
- proto_tree_add_text(Mode_tree, offset, 2, "%s",
- decode_enumerated_bitfield(Mode, 0x03, 16, Mode_0x03, "%s"));
-
-}
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
- offset += 2; /* Skip Mode */
+ }
- /* Build display for: Offset */
+ offset += 1; /* Skip AndXReserved */
- Offset = GWORD(pd, offset);
+ /* Build display for: AndXOffset */
+
+ AndXOffset = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
- offset += 4; /* Skip Offset */
+ offset += 2; /* Skip AndXOffset */
- /* Build display for: Byte Count (BCC) */
+ /* Build display for: Remaining */
- ByteCount = GSHORT(pd, offset);
+ Remaining = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining: %u", Remaining);
}
- offset += 2; /* Skip Byte Count (BCC) */
+ offset += 2; /* Skip Remaining */
- }
+ /* Build display for: Data Compaction Mode */
- if (dirn == 0) { /* Response(s) dissect code */
+ DataCompactionMode = GSHORT(pd, offset);
- /* Build display for: Word Count (WCT) */
+ if (tree) {
- WordCount = GBYTE(pd, offset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Compaction Mode: %u", DataCompactionMode);
+
+ }
+
+ offset += 2; /* Skip Data Compaction Mode */
+
+ /* Build display for: Reserved */
+
+ Reserved = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
- offset += 1; /* Skip Word Count (WCT) */
+ offset += 2; /* Skip Reserved */
- /* Build display for: Offset */
+ /* Build display for: Data Length */
- Offset = GWORD(pd, offset);
+ DataLength = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
- offset += 4; /* Skip Offset */
+ offset += 2; /* Skip Data Length */
+
+ /* Build display for: Data Offset */
+
+ DataOffset = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
+
+ }
+
+ offset += 2; /* Skip Data Offset */
+
+ /* Build display for: Reserved[5] */
+
+ for(i = 1; i <= 5; ++i) {
+
+ Reserved = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved%u: %u", i, Reserved);
+
+ }
+ offset += 2;
+ }
/* Build display for: Byte Count (BCC) */
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
offset += 2; /* Skip Byte Count (BCC) */
+ /* Build display for data */
+
+ if (tree) {
+
+ offset = SMB_offset + DataOffset;
+ if(END_OF_FRAME >= DataLength)
+ proto_tree_add_text(tree, NullTVB, offset, DataLength, "Data (%u bytes)", DataLength);
+ else
+ proto_tree_add_text(tree, NullTVB, offset, END_OF_FRAME, "Data (first %u bytes)", END_OF_FRAME);
+
+ }
+
+ if (AndXCommand != 0xFF) {
+
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn);
+
+ }
+
}
}
void
-dissect_write_and_unlock_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
+dissect_logoff_andx_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
{
guint8 WordCount;
- guint8 BufferFormat;
- guint32 Offset;
- guint16 Remaining;
- guint16 FID;
- guint16 DataLength;
- guint16 Count;
+ guint8 AndXReserved;
+ guint8 AndXCommand = 0xFF;
guint16 ByteCount;
+ guint16 AndXOffset = 0;
if (dirn == 1) { /* Request(s) dissect code */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
offset += 1; /* Skip Word Count (WCT) */
- /* Build display for: FID */
+ /* Build display for: AndXCommand */
- FID = GSHORT(pd, offset);
+ AndXCommand = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %u", AndXCommand);
}
- offset += 2; /* Skip FID */
+ offset += 1; /* Skip AndXCommand */
- /* Build display for: Count */
+ /* Build display for: AndXReserved */
- Count = GSHORT(pd, offset);
+ AndXReserved = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
- offset += 2; /* Skip Count */
+ offset += 1; /* Skip AndXReserved */
- /* Build display for: Offset */
+ /* Build display for: AndXOffset */
- Offset = GWORD(pd, offset);
+ AndXOffset = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
- offset += 4; /* Skip Offset */
+ offset += 2; /* Skip AndXOffset */
- /* Build display for: Remaining */
+ /* Build display for: Byte Count (BCC) */
- Remaining = GSHORT(pd, offset);
+ ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Remaining: %u", Remaining);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
- offset += 2; /* Skip Remaining */
-
- /* Build display for: Byte Count (BCC) */
+ offset += 2; /* Skip Byte Count (BCC) */
- ByteCount = GSHORT(pd, offset);
- if (tree) {
+ if (AndXCommand != 0xFF) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn);
}
- offset += 2; /* Skip Byte Count (BCC) */
+ }
- /* Build display for: Buffer Format */
+ if (dirn == 0) { /* Response(s) dissect code */
- BufferFormat = GBYTE(pd, offset);
+ /* Build display for: Word Count (WCT) */
+
+ WordCount = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
- offset += 1; /* Skip Buffer Format */
+ offset += 1; /* Skip Word Count (WCT) */
- /* Build display for: Data Length */
+ /* Build display for: AndXCommand */
- DataLength = GSHORT(pd, offset);
+ AndXCommand = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %u", AndXCommand);
}
- offset += 2; /* Skip Data Length */
-
- }
-
- if (dirn == 0) { /* Response(s) dissect code */
+ offset += 1; /* Skip AndXCommand */
- /* Build display for: Word Count (WCT) */
+ /* Build display for: AndXReserved */
- WordCount = GBYTE(pd, offset);
+ AndXReserved = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
- offset += 1; /* Skip Word Count (WCT) */
+ offset += 1; /* Skip AndXReserved */
- /* Build display for: Count */
+ /* Build display for: AndXOffset */
- Count = GSHORT(pd, offset);
+ AndXOffset = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
- offset += 2; /* Skip Count */
+ offset += 2; /* Skip AndXOffset */
/* Build display for: Byte Count (BCC) */
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
offset += 2; /* Skip Byte Count (BCC) */
+
+ if (AndXCommand != 0xFF) {
+
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn);
+
+ }
+
}
}
void
-dissect_set_info2_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
+dissect_seek_file_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
{
+ static const value_string Mode_0x03[] = {
+ { 0, "Seek from start of file"},
+ { 1, "Seek from current position"},
+ { 2, "Seek from end of file"},
+ { 0, NULL}
+};
+ proto_tree *Mode_tree;
+ proto_item *ti;
guint8 WordCount;
- guint16 LastWriteTime;
- guint16 LastWriteDate;
- guint16 LastAccessTime;
- guint16 LastAccessDate;
+ guint32 Offset;
+ guint16 Mode;
guint16 FID;
- guint16 CreationTime;
- guint16 CreationDate;
guint16 ByteCount;
if (dirn == 1) { /* Request(s) dissect code */
- /* Build display for: Word Count */
+ /* Build display for: Word Count (WCT) */
WordCount = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count: %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
- offset += 1; /* Skip Word Count */
+ offset += 1; /* Skip Word Count (WCT) */
/* Build display for: FID */
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
offset += 2; /* Skip FID */
- /* Build display for: Creation Date */
-
- CreationDate = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Creation Date: %u", dissect_dos_date(CreationDate));
-
- }
-
- offset += 2; /* Skip Creation Date */
-
- /* Build display for: Creation Time */
-
- CreationTime = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Creation Time: %u", dissect_dos_time(CreationTime));
-
- }
-
- offset += 2; /* Skip Creation Time */
-
- /* Build display for: Last Access Date */
+ /* Build display for: Mode */
- LastAccessDate = GSHORT(pd, offset);
+ Mode = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Access Date: %u", dissect_dos_date(LastAccessDate));
-
- }
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Mode: 0x%02x", Mode);
+ Mode_tree = proto_item_add_subtree(ti, ett_smb_mode);
+ proto_tree_add_text(Mode_tree, NullTVB, offset, 2, "%s",
+ decode_enumerated_bitfield(Mode, 0x03, 16, Mode_0x03, "%s"));
+
+}
- offset += 2; /* Skip Last Access Date */
+ offset += 2; /* Skip Mode */
- /* Build display for: Last Access Time */
+ /* Build display for: Offset */
- LastAccessTime = GSHORT(pd, offset);
+ Offset = GWORD(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Access Time: %u", dissect_dos_time(LastAccessTime));
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
- offset += 2; /* Skip Last Access Time */
+ offset += 4; /* Skip Offset */
- /* Build display for: Last Write Date */
+ /* Build display for: Byte Count (BCC) */
- LastWriteDate = GSHORT(pd, offset);
+ ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Date: %u", dissect_dos_date(LastWriteDate));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
- offset += 2; /* Skip Last Write Date */
-
- /* Build display for: Last Write Time */
-
- LastWriteTime = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Last Write Time: %u", dissect_dos_time(LastWriteTime));
+ offset += 2; /* Skip Byte Count (BCC) */
- }
+ }
- offset += 2; /* Skip Last Write Time */
+ if (dirn == 0) { /* Response(s) dissect code */
- /* Build display for: Byte Count (BCC) */
+ /* Build display for: Word Count (WCT) */
- ByteCount = GSHORT(pd, offset);
+ WordCount = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
- offset += 2; /* Skip Byte Count (BCC) */
-
- }
-
- if (dirn == 0) { /* Response(s) dissect code */
+ offset += 1; /* Skip Word Count (WCT) */
- /* Build display for: Word Count (WCC) */
+ /* Build display for: Offset */
- WordCount = GBYTE(pd, offset);
+ Offset = GWORD(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCC): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
- offset += 1; /* Skip Word Count (WCC) */
+ offset += 4; /* Skip Offset */
/* Build display for: Byte Count (BCC) */
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
}
void
-dissect_lock_bytes_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
+dissect_write_and_unlock_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
{
guint8 WordCount;
+ guint8 BufferFormat;
guint32 Offset;
- guint32 Count;
+ guint16 Remaining;
guint16 FID;
+ guint16 DataLength;
+ guint16 Count;
guint16 ByteCount;
if (dirn == 1) { /* Request(s) dissect code */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
/* Build display for: Count */
- Count = GWORD(pd, offset);
+ Count = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
- offset += 4; /* Skip Count */
+ offset += 2; /* Skip Count */
/* Build display for: Offset */
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
offset += 4; /* Skip Offset */
+ /* Build display for: Remaining */
+
+ Remaining = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining: %u", Remaining);
+
+ }
+
+ offset += 2; /* Skip Remaining */
+
/* Build display for: Byte Count (BCC) */
ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
offset += 2; /* Skip Byte Count (BCC) */
+ /* Build display for: Buffer Format */
+
+ BufferFormat = GBYTE(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
+
+ }
+
+ offset += 1; /* Skip Buffer Format */
+
+ /* Build display for: Data Length */
+
+ DataLength = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
+
+ }
+
+ offset += 2; /* Skip Data Length */
+
}
if (dirn == 0) { /* Response(s) dissect code */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
offset += 1; /* Skip Word Count (WCT) */
+ /* Build display for: Count */
+
+ Count = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
+
+ }
+
+ offset += 2; /* Skip Count */
+
/* Build display for: Byte Count (BCC) */
ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
}
void
-dissect_get_print_queue_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
+dissect_set_info2_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
{
guint8 WordCount;
- guint8 BufferFormat;
- guint16 StartIndex;
- guint16 RestartIndex;
- guint16 MaxCount;
- guint16 DataLength;
- guint16 Count;
+ guint16 LastWriteTime;
+ guint16 LastWriteDate;
+ guint16 LastAccessTime;
+ guint16 LastAccessDate;
+ guint16 FID;
+ guint16 CreationTime;
+ guint16 CreationDate;
guint16 ByteCount;
if (dirn == 1) { /* Request(s) dissect code */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count: %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count: %u", WordCount);
}
offset += 1; /* Skip Word Count */
- /* Build display for: Max Count */
+ /* Build display for: FID */
- MaxCount = GSHORT(pd, offset);
+ FID = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Count: %u", MaxCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
- offset += 2; /* Skip Max Count */
+ offset += 2; /* Skip FID */
- /* Build display for: Start Index */
+ /* Build display for: Creation Date */
- StartIndex = GSHORT(pd, offset);
+ CreationDate = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Start Index: %u", StartIndex);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Date: %s", dissect_dos_date(CreationDate));
}
- offset += 2; /* Skip Start Index */
+ offset += 2; /* Skip Creation Date */
- /* Build display for: Byte Count (BCC) */
+ /* Build display for: Creation Time */
- ByteCount = GSHORT(pd, offset);
+ CreationTime = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Time: %s", dissect_dos_time(CreationTime));
}
- offset += 2; /* Skip Byte Count (BCC) */
-
- }
-
- if (dirn == 0) { /* Response(s) dissect code */
+ offset += 2; /* Skip Creation Time */
- /* Build display for: Word Count (WCT) */
+ /* Build display for: Last Access Date */
- WordCount = GBYTE(pd, offset);
+ LastAccessDate = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Access Date: %s", dissect_dos_date(LastAccessDate));
}
- offset += 1; /* Skip Word Count (WCT) */
-
- if (WordCount > 0) {
-
- /* Build display for: Count */
+ offset += 2; /* Skip Last Access Date */
- Count = GSHORT(pd, offset);
+ /* Build display for: Last Access Time */
- if (tree) {
+ LastAccessTime = GSHORT(pd, offset);
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ if (tree) {
- }
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Access Time: %s", dissect_dos_time(LastAccessTime));
- offset += 2; /* Skip Count */
+ }
- /* Build display for: Restart Index */
+ offset += 2; /* Skip Last Access Time */
- RestartIndex = GSHORT(pd, offset);
+ /* Build display for: Last Write Date */
- if (tree) {
+ LastWriteDate = GSHORT(pd, offset);
- proto_tree_add_text(tree, offset, 2, "Restart Index: %u", RestartIndex);
+ if (tree) {
- }
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Date: %s", dissect_dos_date(LastWriteDate));
- offset += 2; /* Skip Restart Index */
+ }
- /* Build display for: Byte Count (BCC) */
+ offset += 2; /* Skip Last Write Date */
- }
+ /* Build display for: Last Write Time */
- ByteCount = GSHORT(pd, offset);
+ LastWriteTime = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Time: %s", dissect_dos_time(LastWriteTime));
}
- offset += 2; /* Skip Byte Count (BCC) */
+ offset += 2; /* Skip Last Write Time */
- /* Build display for: Buffer Format */
+ /* Build display for: Byte Count (BCC) */
- BufferFormat = GBYTE(pd, offset);
+ ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
- offset += 1; /* Skip Buffer Format */
+ offset += 2; /* Skip Byte Count (BCC) */
- /* Build display for: Data Length */
+ }
+
+ if (dirn == 0) { /* Response(s) dissect code */
+
+ /* Build display for: Word Count (WCC) */
+
+ WordCount = GBYTE(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCC): %u", WordCount);
+
+ }
+
+ offset += 1; /* Skip Word Count (WCC) */
+
+ /* Build display for: Byte Count (BCC) */
+
+ ByteCount = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
+
+ }
+
+ offset += 2; /* Skip Byte Count (BCC) */
+
+ }
+
+}
+
+void
+dissect_lock_bytes_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
+
+{
+ guint8 WordCount;
+ guint32 Offset;
+ guint32 Count;
+ guint16 FID;
+ guint16 ByteCount;
+
+ if (dirn == 1) { /* Request(s) dissect code */
+
+ /* Build display for: Word Count (WCT) */
+
+ WordCount = GBYTE(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
+
+ }
+
+ offset += 1; /* Skip Word Count (WCT) */
+
+ /* Build display for: FID */
+
+ FID = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
+
+ }
+
+ offset += 2; /* Skip FID */
+
+ /* Build display for: Count */
+
+ Count = GWORD(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Count: %u", Count);
+
+ }
+
+ offset += 4; /* Skip Count */
+
+ /* Build display for: Offset */
+
+ Offset = GWORD(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
+
+ }
+
+ offset += 4; /* Skip Offset */
+
+ /* Build display for: Byte Count (BCC) */
+
+ ByteCount = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
+
+ }
+
+ offset += 2; /* Skip Byte Count (BCC) */
+
+ }
+
+ if (dirn == 0) { /* Response(s) dissect code */
+
+ /* Build display for: Word Count (WCT) */
+
+ WordCount = GBYTE(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
+
+ }
+
+ offset += 1; /* Skip Word Count (WCT) */
+
+ /* Build display for: Byte Count (BCC) */
+
+ ByteCount = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
+
+ }
+
+ offset += 2; /* Skip Byte Count (BCC) */
+
+ }
+
+}
+
+void
+dissect_get_print_queue_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
+
+{
+ guint8 WordCount;
+ guint8 BufferFormat;
+ guint16 StartIndex;
+ guint16 RestartIndex;
+ guint16 MaxCount;
+ guint16 DataLength;
+ guint16 Count;
+ guint16 ByteCount;
+
+ if (dirn == 1) { /* Request(s) dissect code */
+
+ /* Build display for: Word Count */
+
+ WordCount = GBYTE(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count: %u", WordCount);
+
+ }
+
+ offset += 1; /* Skip Word Count */
+
+ /* Build display for: Max Count */
+
+ MaxCount = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Count: %u", MaxCount);
+
+ }
+
+ offset += 2; /* Skip Max Count */
+
+ /* Build display for: Start Index */
+
+ StartIndex = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Start Index: %u", StartIndex);
+
+ }
+
+ offset += 2; /* Skip Start Index */
+
+ /* Build display for: Byte Count (BCC) */
+
+ ByteCount = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
+
+ }
+
+ offset += 2; /* Skip Byte Count (BCC) */
+
+ }
+
+ if (dirn == 0) { /* Response(s) dissect code */
+
+ /* Build display for: Word Count (WCT) */
+
+ WordCount = GBYTE(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
+
+ }
+
+ offset += 1; /* Skip Word Count (WCT) */
+
+ if (WordCount > 0) {
+
+ /* Build display for: Count */
+
+ Count = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
+
+ }
+
+ offset += 2; /* Skip Count */
+
+ /* Build display for: Restart Index */
+
+ RestartIndex = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Restart Index: %u", RestartIndex);
+
+ }
+
+ offset += 2; /* Skip Restart Index */
+
+ /* Build display for: Byte Count (BCC) */
+
+ }
+
+ ByteCount = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
+
+ }
+
+ offset += 2; /* Skip Byte Count (BCC) */
+
+ /* Build display for: Buffer Format */
+
+ BufferFormat = GBYTE(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
+
+ }
+
+ offset += 1; /* Skip Buffer Format */
+
+ /* Build display for: Data Length */
DataLength = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %u", AndXCommand);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %u", AndXCommand);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXOffset: %u", AndXOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXOffset: %u", AndXOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 1, "Lock Type: 0x%01x", LockType);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 1, "Lock Type: 0x%01x", LockType);
LockType_tree = proto_item_add_subtree(ti, ett_smb_lock_type);
- proto_tree_add_text(LockType_tree, offset, 1, "%s",
+ proto_tree_add_text(LockType_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(LockType, 0x01, 16, "Read-only lock", "Not a Read-only lock"));
- proto_tree_add_text(LockType_tree, offset, 1, "%s",
+ proto_tree_add_text(LockType_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(LockType, 0x02, 16, "Oplock break notification", "Not an Oplock break notification"));
- proto_tree_add_text(LockType_tree, offset, 1, "%s",
+ proto_tree_add_text(LockType_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(LockType, 0x04, 16, "Change lock type", "Not a lock type change"));
- proto_tree_add_text(LockType_tree, offset, 1, "%s",
+ proto_tree_add_text(LockType_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(LockType, 0x08, 16, "Cancel outstanding request", "Dont cancel outstanding request"));
- proto_tree_add_text(LockType_tree, offset, 1, "%s",
+ proto_tree_add_text(LockType_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(LockType, 0x10, 16, "Large file locking format", "Not a large file locking format"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "OplockLevel: %u", OplockLevel);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "OplockLevel: %u", OplockLevel);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Number Of Unlocks: %u", NumberOfUnlocks);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Number Of Unlocks: %u", NumberOfUnlocks);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Number of Locks: %u", NumberofLocks);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Number of Locks: %u", NumberofLocks);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXCommand: %s",
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXCommand: %s",
(AndXCommand == 0xFF ? "No further commands" : decode_smb_name(AndXCommand)));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "AndXReserved: %u", AndXReserved);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "AndXReserved: %u", AndXReserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "AndXoffset: %u", AndXoffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "AndXoffset: %u", AndXoffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count: %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count: %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Attributes: 0x%02x", Attributes);
Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x02, 16, "Hidden file", "Not a hidden file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x04, 16, "System file", "Not a system file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x08, 16, " Volume", "Not a volume"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x10, 16, " Directory", "Not a directory"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x20, 16, " Archived", "Not archived"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Creation Time: %u", dissect_dos_time(CreationTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Time: %s", dissect_dos_time(CreationTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(FileName) + 1, "File Name: %s", FileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(FileName) + 1, "File Name: %s", FileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Count: %u", MaxCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Count: %u", MaxCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Search Attributes: %u", SearchAttributes);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Search Attributes: %u", SearchAttributes);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format 1: %u", BufferFormat1);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format 1: %u", BufferFormat1);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(FileName) + 1, "File Name: %s", FileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(FileName) + 1, "File Name: %s", FileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format 2: %u", BufferFormat2);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format 2: %u", BufferFormat2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Resume Key Length: %u", ResumeKeyLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Resume Key Length: %u", ResumeKeyLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved: %u", Reserved);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved: %u", Reserved);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Creation Time: %u", dissect_dos_time(CreationTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Time: %s", dissect_dos_time(CreationTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Creation Date: %u", dissect_dos_date(CreationDate));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Creation Date: %s", dissect_dos_date(CreationDate));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(DirectoryName) + 1, "Directory Name: %s", DirectoryName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(FileName) + 1, "File Name: %s", FileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(FileName) + 1, "File Name: %s", FileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Time: %u", dissect_dos_time(LastWriteTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Time: %s", dissect_dos_time(LastWriteTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Date: %u", dissect_dos_date(LastWriteDate));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Date: %s", dissect_dos_date(LastWriteDate));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Remaining: %u", Remaining);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining: %u", Remaining);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 3: %u", Reserved3);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 3: %u", Reserved3);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 4: %u", Reserved4);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 4: %u", Reserved4);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, strlen(FileName) + 1, "File Name: %s", FileName);
+ proto_tree_add_text(tree, NullTVB, offset, strlen(FileName) + 1, "File Name: %s", FileName);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Attributes: 0x%02x", Attributes);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Attributes: 0x%02x", Attributes);
Attributes_tree = proto_item_add_subtree(ti, ett_smb_fileattributes);
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x01, 16, "Read-only file", "Not a read-only file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x02, 16, "Hidden file", "Not a hidden file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x04, 16, "System file", "Not a system file"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x08, 16, " Volume", "Not a volume"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x10, 16, " Directory", "Not a directory"));
- proto_tree_add_text(Attributes_tree, offset, 2, "%s",
+ proto_tree_add_text(Attributes_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Attributes, 0x20, 16, " Archived", "Not archived"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Last Write Date: %s", dissect_smbu_date(LastWriteDate, LastWriteTime));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Last Write Date: %s", dissect_smbu_date(LastWriteDate, LastWriteTime));
- proto_tree_add_text(tree, offset, 2, "Last Write Time: %s", dissect_smbu_time(LastWriteDate, LastWriteTime));
+ proto_tree_add_text(tree, NullTVB, offset - 2, 2, "Last Write Time: %s", dissect_smbu_time(LastWriteDate, LastWriteTime));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "File Size: %u", FileSize);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "File Size: %u", FileSize);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 3: %u", Reserved3);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 3: %u", Reserved3);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 4: %u", Reserved4);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 4: %u", Reserved4);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 5: %u", Reserved5);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 5: %u", Reserved5);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Offset: %u", Offset);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Offset: %u", Offset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Remaining: %u", Remaining);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Remaining: %u", Remaining);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 3: %u", Reserved3);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 3: %u", Reserved3);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 4: %u", Reserved4);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 4: %u", Reserved4);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Buffer Format: %u", BufferFormat);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Buffer Format: %u", BufferFormat);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Count: %u", Count);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Count: %u", Count);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved 1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved 1: %u", Reserved1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "WriteMode: 0x%02x", WriteMode);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "WriteMode: 0x%02x", WriteMode);
WriteMode_tree = proto_item_add_subtree(ti, ett_smb_writemode);
- proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
+ proto_tree_add_text(WriteMode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x01, 16, "Write through requested", "Write through not requested"));
- proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
+ proto_tree_add_text(WriteMode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x02, 16, "Return Remaining", "Dont return Remaining"));
- proto_tree_add_text(WriteMode_tree, offset, 2, "%s",
+ proto_tree_add_text(WriteMode_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(WriteMode, 0x40, 16, "Connectionless mode requested", "Connectionless mode not requested"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Request Mask: %u", RequestMask);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Request Mask: %u", RequestMask);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Length: %u", DataLength);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Length: %u", DataLength);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad: %u", Pad);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Pad: %u", Pad);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Response Mask: %u", ResponseMask);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Response Mask: %u", ResponseMask);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WTC): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WTC): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "FID: %u", FID);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "FID: %u", FID);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Byte Count (BCC): %u", ByteCount);
}
"TRANS2_FIND_FIRST2",
"TRANS2_FIND_NEXT2",
"TRANS2_QUERY_FS_INFORMATION",
+ "no such command",
"TRANS2_QUERY_PATH_INFORMATION",
"TRANS2_SET_PATH_INFORMATION",
"TRANS2_QUERY_FILE_INFORMATION",
}
-guint32 dissect_mailslot_smb(const u_char *, int, frame_data *, proto_tree *, proto_tree *, struct smb_info, int, int, int, int, const u_char *, int, int);
-
-guint32 dissect_pipe_smb(const u_char *, int, frame_data *, proto_tree *, proto_tree *, struct smb_info, int, int, int, int, const u_char *, int, int, int, int);
void
dissect_transact2_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn)
guint8 SetupCount;
guint8 Reserved3;
guint8 Reserved1;
- guint8 Pad2;
- guint8 Pad1;
guint8 MaxSetupCount;
guint8 Data;
guint32 Timeout;
* packets from B:Y to A:X.
*/
conversation = find_conversation(&pi.src, &pi.dst, pi.ptype,
- pi.srcport, pi.destport);
+ pi.srcport, pi.destport, 0);
if (conversation == NULL) {
/* It's not part of any conversation - create a new one. */
conversation = conversation_new(&pi.src, &pi.dst, pi.ptype,
- pi.srcport, pi.destport, NULL);
+ pi.srcport, pi.destport, NULL, 0);
}
si.conversation = conversation; /* Save this for later */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Total Data Count: %u", TotalDataCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Data Count: %u", TotalDataCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Parameter Count: %u", MaxParameterCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Parameter Count: %u", MaxParameterCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Data Count: %u", MaxDataCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Data Count: %u", MaxDataCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Max Setup Count: %u", MaxSetupCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Max Setup Count: %u", MaxSetupCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Reserved1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Reserved1: %u", Reserved1);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Flags: 0x%02x", Flags);
Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x01, 16, "Also disconnect TID", "Dont disconnect TID"));
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x02, 16, "One way transaction", "Two way transaction"));
}
if (tree) {
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Parameter Count: %u", ParameterCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Count: %u", ParameterCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Parameter Offset: %u", ParameterOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Offset: %u", ParameterOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Count: %u", DataCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Count: %u", DataCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Setup Count: %u", SetupCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Setup Count: %u", SetupCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Reserved3: %u", Reserved3);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Reserved3: %u", Reserved3);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Setup%i: %u", i, Setup1);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Setup%i: %u", i, Setup1);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Transact Name: %s", decode_trans2_name(Setup));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Transact Name: %s", decode_trans2_name(Setup));
}
- if (offset % 2) {
+ if (offset < (SMB_offset + ParameterOffset)) {
- /* Build display for: Pad1 */
+ int pad1Count = SMB_offset + ParameterOffset - offset;
- Pad1 = GBYTE(pd, offset);
+ /* Build display for: Pad1 */
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad1: %u", Pad1);
-
+ proto_tree_add_text(tree, NullTVB, offset, pad1Count, "Pad1: %s", format_text(pd + offset, pad1Count));
}
-
- offset += 1; /* Skip Pad1 */
+
+ offset += pad1Count; /* Skip Pad1 */
}
if (tree) {
- proto_tree_add_text(tree, SMB_offset + ParameterOffset, ParameterCount, "Parameters: %s", format_text(pd + SMB_offset + ParameterOffset, ParameterCount));
+ proto_tree_add_text(tree, NullTVB, SMB_offset + ParameterOffset, ParameterCount, "Parameters: %s", format_text(pd + SMB_offset + ParameterOffset, ParameterCount));
}
}
- if (offset % 2) {
+ if (DataCount > 0 && offset < (SMB_offset + DataOffset)) {
+
+ int pad2Count = SMB_offset + DataOffset - offset;
/* Build display for: Pad2 */
- Pad2 = GBYTE(pd, offset);
-
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad2: %u", Pad2);
+ proto_tree_add_text(tree, NullTVB, offset, pad2Count, "Pad2: %s", format_text(pd + offset, pad2Count));
}
- offset += 1; /* Skip Pad2 */
+ offset += pad2Count; /* Skip Pad2 */
}
if (tree) {
- proto_tree_add_text(tree, SMB_offset + DataOffset, DataCount, "Data: %s", format_text(&pd[offset], DataCount));
+ proto_tree_add_text(tree, NullTVB, SMB_offset + DataOffset, DataCount, "Data: %s", format_text(&pd[offset], DataCount));
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Total Data Count: %u", TotalDataCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Data Count: %u", TotalDataCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Reserved2: %u", Reserved2);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved2: %u", Reserved2);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Parameter Count: %u", ParameterCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Count: %u", ParameterCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Parameter Offset: %u", ParameterOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Offset: %u", ParameterOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Parameter Displacement: %u", ParameterDisplacement);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Displacement: %u", ParameterDisplacement);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Count: %u", DataCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Count: %u", DataCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Data Displacement: %u", DataDisplacement);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Displacement: %u", DataDisplacement);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Setup Count: %u", SetupCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Setup Count: %u", SetupCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Reserved3: %u", Reserved3);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Reserved3: %u", Reserved3);
}
offset += 1; /* Skip Reserved3 */
- /* Build display for: Setup */
+ if (SetupCount > 0) {
- Setup = GSHORT(pd, offset);
+ int i = SetupCount;
- if (tree) {
+ Setup = GSHORT(pd, offset);
- proto_tree_add_text(tree, offset, 2, "Setup: %u", Setup);
+ for (i = 1; i <= SetupCount; i++) {
+
+ Setup = GSHORT(pd, offset);
- }
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Setup%i: %u", i, Setup);
+
+ }
- offset += 2; /* Skip Setup */
+ offset += 2; /* Skip Setup */
+
+ }
+ }
/* Build display for: Byte Count (BCC) */
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
offset += 2; /* Skip Byte Count (BCC) */
- /* Build display for: Pad1 */
+ if (offset < (SMB_offset + ParameterOffset)) {
- Pad1 = GBYTE(pd, offset);
+ int pad1Count = SMB_offset + ParameterOffset - offset;
- if (tree) {
+ /* Build display for: Pad1 */
+
+ if (tree) {
+
+ proto_tree_add_text(tree, NullTVB, offset, pad1Count, "Pad1: %s", format_text(pd + offset, pad1Count));
+ }
- proto_tree_add_text(tree, offset, 1, "Pad1: %u", Pad1);
+ offset += pad1Count; /* Skip Pad1 */
}
- offset += 1; /* Skip Pad1 */
-
/* Build display for: Parameter */
if (ParameterCount > 0) {
if (tree) {
- proto_tree_add_text(tree, offset, ParameterCount, "Parameter: %s", format_text(pd + SMB_offset + ParameterOffset, ParameterCount));
+ proto_tree_add_text(tree, NullTVB, offset, ParameterCount, "Parameter: %s", format_text(pd + SMB_offset + ParameterOffset, ParameterCount));
}
}
- /* Build display for: Pad2 */
+ if (DataCount > 0 && offset < (SMB_offset + DataOffset)) {
- Pad2 = GBYTE(pd, offset);
+ int pad2Count = SMB_offset + DataOffset - offset;
+
+ /* Build display for: Pad2 */
- if (tree) {
+ if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad2: %u", Pad2);
+ proto_tree_add_text(tree, NullTVB, offset, pad2Count, "Pad2: %s", format_text(pd + offset, pad2Count));
- }
+ }
- offset += 1; /* Skip Pad2 */
+ offset += pad2Count; /* Skip Pad2 */
+
+ }
/* Build display for: Data */
if (tree) {
- proto_tree_add_text(tree, offset, DataCount, "Data: %s", format_text(pd + SMB_offset + DataOffset, DataCount));
+ proto_tree_add_text(tree, NullTVB, offset, DataCount, "Data: %s", format_text(pd + SMB_offset + DataOffset, DataCount));
}
}
-char *p_desc = NULL, *d_desc = NULL, *data = NULL, *params = NULL;
-int p_count, d_count, p_offset, d_offset, d_current = 0, p_current = 0;
-int pd_p_current = 0, pd_d_current = 0, in_params = 0, need_data = 0;
-
-/* Initialize the various data structure */
-void
-dissect_transact_engine_init(const u_char *pd, const char *param_desc, const char *data_desc, int ParameterOffset, int ParameterCount, int DataOffset, int DataCount)
-{
-
- d_count = DataCount;
- p_count = ParameterCount;
- d_offset = 0;
- p_offset = 0;
- d_current = 0;
- p_current = 0;
- pd_d_current = DataOffset;
- pd_p_current = ParameterOffset;
- in_params = need_data = 0;
-
- if (p_desc) g_free(p_desc);
- p_desc = g_malloc(strlen(param_desc) + 1);
- strcpy(p_desc, param_desc);
-
- if (d_desc) g_free(d_desc);
- d_desc= g_malloc(strlen(data_desc) + 1);
- strcpy(d_desc, data_desc);
-
- if (params) g_free(params);
- params = g_malloc(p_count);
- memcpy(params, pd + ParameterOffset, ParameterCount);
-
- if (data) g_free(data);
- data = g_malloc(d_count);
- memcpy(data, pd + DataOffset, DataCount);
-
-}
-
-int get_byte_count(const u_char *pd)
-
-{
- int count = 0;
-
- while (pd[pd_p_current] && isdigit(pd[pd_p_current]))
- count += (int)pd[pd_p_current++] - (int)'0';
-
- return count;
-}
-
-/* Dissect the next item, if Name is null, call it by its data type */
-/* We pull out the next item in the appropriate place and display it */
-/* We display the parameters first, then the data, then any auxilliary data */
-
-int dissect_transact_next(u_char *pd, char *Name, int dirn, proto_tree *tree)
-{
- /* guint8 BParam; */
- guint16 WParam = 0;
- guint32 LParam;
- const char /**Bytes,*/ *AsciiZ;
- int bc;
-
- while (1) {
- switch (in_params) {
-
- case 0: /* We are in the params area ... */
-
- switch (params[p_offset++]) {
-
- case 'r':
-
- break; /* Do nothing about the above */
-
- case 'W': /* Word Parameter */
-
- /* Insert a word param */
-
- WParam = GSHORT(pd, pd_p_current);
-
- proto_tree_add_text(tree, pd_p_current, 2, "Word Param: %u", WParam);
-
- pd_p_current += 2;
-
- break;
-
- case 'D': /* Double Word parameter */
-
- LParam = GWORD(pd, pd_p_current);
-
- proto_tree_add_text(tree, pd_p_current, 4, "DWord Param: %u", LParam);
-
- pd_p_current += 2;
-
-
- break;
-
- case 'b': /* A byte or series of bytes */
-
- bc = get_byte_count(pd + pd_p_current); /* This is not clean */
-
- /*Bytes = g_malloc(bc + 1); / * Is this needed ? */
-
- proto_tree_add_text(tree, pd_p_current, bc, "B%u: %s", format_text(pd + pd_p_current, (bc) ? bc : 1));
-
- pd_p_current += (bc) ? bc : 1;
-
- break;
-
- case 'O': /* A null pointer */
-
- proto_tree_add_text(tree, pd_p_current, 0, "Null Pointer");
-
- break;
-
- case 'z': /* An AsciiZ string */
-
- AsciiZ = pd + pd_p_current;
-
- proto_tree_add_text(tree, pd_p_current, strlen(AsciiZ) + 1, "AsciiZ: %s", AsciiZ);
-
- pd_p_current += strlen(AsciiZ) + 1;
-
- break;
-
- case 'F': /* One or more pad bytes */
-
- bc = get_byte_count(pd);
-
- proto_tree_add_text(tree, pd_p_current, bc, "Pad%u: %s", format_text(pd + pd_p_current, bc));
-
- pd_p_current += bc;
-
- break;
-
- case 'L': /* Receive buffer len: Short */
-
- WParam = GSHORT(pd, pd_p_current);
-
- proto_tree_add_text(tree, pd_p_current, 2, "Word: %u", WParam);
-
- pd_p_current += 2;
-
- break;
-
- case 's': /* Send buf ... */
-
- need_data = 1;
-
- break;
-
- case 'T':
-
- break;
-
- default:
-
- break;
-
- }
-
- break;
-
- case 1: /* We are in the data area ... */
-
-
- break;
-
- }
-
- }
- return 0;
-
-}
void
-dissect_transact_params(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, int DataOffset, int DataCount, int ParameterOffset, int ParameterCount, const char *TransactName)
+dissect_transact_params(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, int DataOffset, int DataCount, int ParameterOffset, int ParameterCount, int SetupAreaOffset, int SetupCount, const char *TransactName)
{
char *TransactNameCopy;
char *trans_type = NULL, *trans_cmd, *loc_of_slash = NULL;
int index;
- guint8 Pad2;
const gchar *Data;
- TransactNameCopy = g_malloc(strlen(TransactName) + 1);
+ if (!TransactName)
+ return;
+
+ TransactNameCopy = g_malloc(TransactName ? strlen(TransactName) + 1 : 1);
/* Should check for error here ... */
- strcpy(TransactNameCopy, TransactName);
+ strcpy(TransactNameCopy, TransactName ? TransactName : "");
if (TransactNameCopy[0] == '\\') {
trans_type = TransactNameCopy + 1; /* Skip the slash */
- loc_of_slash = strchr(trans_type, '\\');
+ loc_of_slash = trans_type ? strchr(trans_type, '\\') : NULL;
}
if (loc_of_slash) {
trans_cmd = NULL;
if ((trans_cmd == NULL) ||
- (((strcmp(trans_type, "MAILSLOT") != 0) ||
- !dissect_mailslot_smb(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, trans_cmd, SMB_offset + DataOffset, DataCount)) &&
- ((strcmp(trans_type, "PIPE") != 0) ||
+ (((trans_type == NULL || strcmp(trans_type, "MAILSLOT") != 0) ||
+ !dissect_mailslot_smb(pd, SetupAreaOffset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, trans_cmd, SMB_offset + DataOffset, DataCount, SMB_offset + ParameterOffset, ParameterCount)) &&
+ ((trans_type == NULL || strcmp(trans_type, "PIPE") != 0) ||
!dissect_pipe_smb(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, trans_cmd, DataOffset, DataCount, ParameterOffset, ParameterCount)))) {
if (ParameterCount > 0) {
if (tree) {
- proto_tree_add_text(tree, SMB_offset + ParameterOffset, ParameterCount, "Parameters: %s", format_text(pd + SMB_offset + ParameterOffset, ParameterCount));
+ proto_tree_add_text(tree, NullTVB, SMB_offset + ParameterOffset, ParameterCount, "Parameters: %s", format_text(pd + SMB_offset + ParameterOffset, ParameterCount));
}
}
- if (offset % 2) {
+ if (DataCount > 0 && offset < (SMB_offset + DataOffset)) {
+
+ int pad2Count = SMB_offset + DataOffset - offset;
/* Build display for: Pad2 */
- Pad2 = GBYTE(pd, offset);
-
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Pad2: %u: %u", Pad2, offset);
+ proto_tree_add_text(tree, NullTVB, offset, pad2Count, "Pad2: %s", format_text(pd + offset, pad2Count));
}
- offset += 1; /* Skip Pad2 */
+ offset += pad2Count; /* Skip Pad2 */
}
if (tree) {
- proto_tree_add_text(tree, SMB_offset + DataOffset, DataCount, "Data: %s", format_text(pd + SMB_offset + DataOffset, DataCount));
+ proto_tree_add_text(tree, NullTVB, SMB_offset + DataOffset, DataCount, "Data: %s", format_text(pd + SMB_offset + DataOffset, DataCount));
}
guint8 SetupCount;
guint8 Reserved3;
guint8 Reserved1;
- guint8 Pad1;
guint8 MaxSetupCount;
guint32 Timeout;
guint16 TotalParameterCount;
conversation_t *conversation;
struct smb_request_key request_key, *new_request_key;
struct smb_request_val *request_val;
+
+ guint16 SetupAreaOffset;
+
/*
* Find out what conversation this packet is part of
*/
conversation = find_conversation(&pi.src, &pi.dst, pi.ptype,
- pi.srcport, pi.destport);
+ pi.srcport, pi.destport, 0);
if (conversation == NULL) { /* Create a new conversation */
conversation = conversation_new(&pi.src, &pi.dst, pi.ptype,
- pi.srcport, pi.destport, NULL);
+ pi.srcport, pi.destport, NULL, 0);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Total Data Count: %u", TotalDataCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Data Count: %u", TotalDataCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Parameter Count: %u", MaxParameterCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Parameter Count: %u", MaxParameterCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 2, "Max Data Count: %u", MaxDataCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Max Data Count: %u", MaxDataCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Max Setup Count: %u", MaxSetupCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Max Setup Count: %u", MaxSetupCount);
}
if (tree) {
- proto_tree_add_text(tree, offset, 1, "Reserved1: %u", Reserved1);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Reserved1: %u", Reserved1);
}
if (tree) {
- ti = proto_tree_add_text(tree, offset, 2, "Flags: 0x%02x", Flags);
+ ti = proto_tree_add_text(tree, NullTVB, offset, 2, "Flags: 0x%02x", Flags);
Flags_tree = proto_item_add_subtree(ti, ett_smb_flags);
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x01, 16, "Also disconnect TID", "Dont disconnect TID"));
- proto_tree_add_text(Flags_tree, offset, 2, "%s",
+ proto_tree_add_text(Flags_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(Flags, 0x02, 16, "One way transaction", "Two way transaction"));
}
Timeout = GWORD(pd, offset);
- if (tree) {
-
- proto_tree_add_text(tree, offset, 4, "Timeout: %u", Timeout);
-
- }
-
- offset += 4; /* Skip Timeout */
-
- /* Build display for: Reserved2 */
-
- Reserved2 = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Reserved2: %u", Reserved2);
-
- }
-
- offset += 2; /* Skip Reserved2 */
-
- /* Build display for: Parameter Count */
-
- ParameterCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Parameter Count: %u", ParameterCount);
-
- }
-
- offset += 2; /* Skip Parameter Count */
-
- /* Build display for: Parameter Offset */
-
- ParameterOffset = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Parameter Offset: %u", ParameterOffset);
-
- }
-
- offset += 2; /* Skip Parameter Offset */
-
- /* Build display for: Data Count */
-
- DataCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Data Count: %u", DataCount);
-
- }
-
- offset += 2; /* Skip Data Count */
-
- /* Build display for: Data Offset */
-
- DataOffset = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
-
- }
-
- offset += 2; /* Skip Data Offset */
-
- /* Build display for: Setup Count */
-
- SetupCount = GBYTE(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 1, "Setup Count: %u", SetupCount);
-
- }
-
- offset += 1; /* Skip Setup Count */
-
- /* Build display for: Reserved3 */
-
- Reserved3 = GBYTE(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 1, "Reserved3: %u", Reserved3);
-
- }
-
- offset += 1; /* Skip Reserved3 */
-
- /* Build display for: Setup */
-
- if (SetupCount > 0) {
-
- int i = SetupCount;
-
- Setup = GSHORT(pd, offset);
-
- for (i = 1; i <= SetupCount; i++) {
-
- Setup = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Setup%i: %u", i, Setup);
-
- }
-
- offset += 2; /* Skip Setup */
-
- }
-
- }
-
- /* Build display for: Byte Count (BCC) */
-
- ByteCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
-
- }
-
- offset += 2; /* Skip Byte Count (BCC) */
-
- /* Build display for: Transact Name */
-
- /* Watch out for Unicode names */
-
- if (si.unicode) {
-
- if (offset % 2) offset++; /* Looks like a pad byte there sometimes */
-
- TransactName = unicode_to_str(pd + offset, &TNlen);
- TNlen += 2;
-
- }
- else {
- TransactName = pd + offset;
- TNlen = strlen(TransactName) + 1;
- }
-
- if (request_val -> last_transact_command) g_free(request_val -> last_transact_command);
-
- request_val -> last_transact_command = g_malloc(strlen(TransactName) + 1);
-
- if (request_val -> last_transact_command)
- strcpy(request_val -> last_transact_command, TransactName);
-
- if (check_col(fd, COL_INFO)) {
-
- col_add_fstr(fd, COL_INFO, "%s %s", TransactName, (dirn ? "Request" : "Response"));
-
- }
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, TNlen, "Transact Name: %s", TransactName);
-
- }
-
- offset += TNlen; /* Skip Transact Name */
- if (si.unicode) offset += 2; /* There are two more extraneous bytes there*/
-
- if (offset % 2) {
-
- /* Build display for: Pad1 */
-
- Pad1 = GBYTE(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 1, "Pad1: %u", Pad1);
-
- }
-
- offset += 1; /* Skip Pad1 */
-
- }
-
- /* Let's see if we can decode this */
-
- dissect_transact_params(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, DataOffset, DataCount, ParameterOffset, ParameterCount, TransactName);
-
- }
-
- if (dirn == 0) { /* Response(s) dissect code */
-
- if (check_col(fd, COL_INFO)) {
-
- col_add_fstr(fd, COL_INFO, "%s %s", request_val -> last_transact_command, "Response");
-
- }
-
- /* Build display for: Word Count (WCT) */
-
- WordCount = GBYTE(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 1, "Word Count (WCT): %u", WordCount);
-
- }
-
- offset += 1; /* Skip Word Count (WCT) */
-
- /* Build display for: Total Parameter Count */
-
- TotalParameterCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
-
- }
-
- offset += 2; /* Skip Total Parameter Count */
-
- /* Build display for: Total Data Count */
-
- TotalDataCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Total Data Count: %u", TotalDataCount);
-
- }
-
- offset += 2; /* Skip Total Data Count */
-
- /* Build display for: Reserved2 */
-
- Reserved2 = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Reserved2: %u", Reserved2);
-
- }
-
- offset += 2; /* Skip Reserved2 */
-
- /* Build display for: Parameter Count */
-
- ParameterCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Parameter Count: %u", ParameterCount);
-
- }
-
- offset += 2; /* Skip Parameter Count */
-
- /* Build display for: Parameter Offset */
-
- ParameterOffset = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Parameter Offset: %u", ParameterOffset);
-
- }
-
- offset += 2; /* Skip Parameter Offset */
-
- /* Build display for: Parameter Displacement */
-
- ParameterDisplacement = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Parameter Displacement: %u", ParameterDisplacement);
-
- }
-
- offset += 2; /* Skip Parameter Displacement */
-
- /* Build display for: Data Count */
-
- DataCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Data Count: %u", DataCount);
-
- }
-
- offset += 2; /* Skip Data Count */
-
- /* Build display for: Data Offset */
-
- DataOffset = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Data Offset: %u", DataOffset);
-
- }
-
- offset += 2; /* Skip Data Offset */
-
- /* Build display for: Data Displacement */
-
- DataDisplacement = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Data Displacement: %u", DataDisplacement);
-
- }
-
- offset += 2; /* Skip Data Displacement */
-
- /* Build display for: Setup Count */
-
- SetupCount = GBYTE(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 1, "Setup Count: %u", SetupCount);
-
- }
-
- offset += 1; /* Skip Setup Count */
-
- /* Build display for: Reserved3 */
-
- Reserved3 = GBYTE(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 1, "Reserved3: %u", Reserved3);
-
- }
-
- offset += 1; /* Skip Reserved3 */
-
- /* Build display for: Setup */
-
- if (SetupCount > 0) {
-
- /* Hmmm, should code for all setup words ... */
-
- Setup = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Setup: %u", Setup);
-
- }
-
- offset += 2; /* Skip Setup */
-
- }
-
- /* Build display for: Byte Count (BCC) */
-
- ByteCount = GSHORT(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 2, "Byte Count (BCC): %u", ByteCount);
-
- }
-
- offset += 2; /* Skip Byte Count (BCC) */
-
- /* Build display for: Pad1 */
-
- if (offset % 2) {
-
- Pad1 = GBYTE(pd, offset);
-
- if (tree) {
-
- proto_tree_add_text(tree, offset, 1, "Pad1: %u", Pad1);
-
- }
-
- offset += 1; /* Skip Pad1 */
-
- }
-
- dissect_transact_params(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, DataOffset, DataCount, ParameterOffset, ParameterCount, si.request_val -> last_transact_command);
-
- }
-
-}
-
-/*
- * The routines for mailslot and pipe dissecting should be migrated to another
- * file soon?
- */
-
-#define NETSHAREENUM 0x00 /* 00 */
-#define NETSERVERENUM2 0x68 /* 104 */
-
-void dissect_server_flags(proto_tree *tree, int offset, int length, int flags)
-{
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0001, length*8, "Workstation", "Not Workstation"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0002, length*8, "Server", "Not Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0004, length*8, "SQL Server", "Not SQL Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0008, length*8, "Domain Controller", "Not Domain Controller"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0010, length*8, "Backup Controller", "Not Backup Controller"));
- proto_tree_add_text(tree, offset, 4, "%s",
- decode_boolean_bitfield(flags, 0x0020, length*8, "Time Source", "Not Time Source"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0040, length*8, "Apple Server", "Not Apple Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0080, length*8, "Novell Server", "Not Novell Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0100, length*8, "Domain Member Server", "Not Domain Member Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0200, length*8, "Print Queue Server", "Not Print Queue Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0400, length*8, "Dialin Server", "Not Dialin Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x0800, length*8, "Xenix Server", "Not Xenix Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x1000, length*8, "NT Workstation", "Not NT Workstation"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x2000, length*8, "Windows for Workgroups", "Not Windows for Workgroups"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x8000, length*8, "NT Server", "Not NT Server"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x10000, length*8, "Potential Browser", "Not Potential Browser"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x20000, length*8, "Backup Browser", "Not Backup Browser"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x40000, length*8, "Master Browser", "Not Master Browser"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x80000, length*8, "Domain Master Browser", "Not Domain Master Browser"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x100000, length*8, "OSF", "Not OSF"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x200000, length*8, "VMS", "Not VMS"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x400000, length*8, "Windows 95 or above", "Not Windows 95 or above"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x40000000, length*8, "Local List Only", "Not Local List Only"));
- proto_tree_add_text(tree, offset, length, "%s",
- decode_boolean_bitfield(flags, 0x80000000, length*8, "Domain Enum", "Not Domain Enum"));
-
-}
-
-guint32
-dissect_pipe_lanman(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, const u_char *command, int DataOffset, int DataCount, int ParameterOffset, int ParameterCount)
-{
- guint32 loc_offset = SMB_offset + ParameterOffset;
- guint16 FunctionCode;
- guint16 Level;
- guint16 RecvBufLen;
- guint16 Flags;
- const char *ParameterDescriptor;
- const char *ReturnDescriptor;
- proto_tree *lanman_tree = NULL, *flags_tree = NULL;
- proto_item *ti;
-
- if (check_col(fd, COL_PROTOCOL))
- col_add_fstr(fd, COL_PROTOCOL, "LANMAN");
-
- if (dirn == 1) { /* The request side */
-
- FunctionCode = GSHORT(pd, loc_offset);
-
- si.request_val -> last_lanman_cmd = FunctionCode;
-
- switch (FunctionCode) {
-
- case NETSHAREENUM:
-
- if (check_col(fd, COL_INFO)) {
-
- col_add_fstr(fd, COL_INFO, "NetShareEnum Request");
-
- }
-
- if (tree) {
-
- ti = proto_tree_add_item(parent, proto_lanman, SMB_offset + ParameterOffset, ParameterCount, NULL);
- lanman_tree = proto_item_add_subtree(ti, ett_lanman);
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Function Code: NetShareEnum");
-
- }
-
- loc_offset += 2;
-
- ParameterDescriptor = pd + loc_offset;
-
- if (si.request_val -> last_param_descrip) g_free(si.request_val -> last_param_descrip);
- si.request_val -> last_param_descrip = g_malloc(strlen(ParameterDescriptor) + 1);
- if (si.request_val -> last_param_descrip)
- strcpy(si.request_val -> last_param_descrip, ParameterDescriptor);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, strlen(ParameterDescriptor) + 1, "Parameter Descriptor: %s", ParameterDescriptor);
-
- }
-
- loc_offset += strlen(ParameterDescriptor) + 1;
-
- ReturnDescriptor = pd + loc_offset;
-
- if (si.request_val -> last_data_descrip) g_free(si.request_val -> last_data_descrip);
- si.request_val -> last_data_descrip = g_malloc(strlen(ReturnDescriptor) + 1);
- if (si.request_val -> last_data_descrip)
- strcpy(si.request_val -> last_data_descrip, ReturnDescriptor);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, strlen(ReturnDescriptor) + 1, "Return Descriptor: %s", ReturnDescriptor);
-
- }
-
- loc_offset += strlen(ReturnDescriptor) + 1;
-
- Level = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Detail Level: %u", Level);
-
- }
-
- loc_offset += 2;
-
- RecvBufLen = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Receive Buffer Length: %u", RecvBufLen);
-
- }
-
- loc_offset += 2;
-
- break;
-
- case NETSERVERENUM2: /* Process a NetServerEnum2 */
-
- if (check_col(fd, COL_INFO)) {
-
- col_add_fstr(fd, COL_INFO, "NetServerEnum2 %s", dirn ? "Request" : "Response");
-
- }
-
- if (tree) {
-
- ti = proto_tree_add_item(parent, proto_lanman, SMB_offset + ParameterOffset, ParameterCount, NULL);
- lanman_tree = proto_item_add_subtree(ti, ett_lanman);
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Function Code: NetServerEnum2");
-
- }
-
- loc_offset += 2;
-
- ParameterDescriptor = pd + loc_offset;
-
- /* Now, save these for later */
-
- if (si.request_val -> last_param_descrip) g_free(si.request_val -> last_param_descrip);
- si.request_val -> last_param_descrip = g_malloc(strlen(ParameterDescriptor) + 1);
- if (si.request_val -> last_param_descrip)
- strcpy(si.request_val -> last_param_descrip, ParameterDescriptor);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, strlen(ParameterDescriptor) + 1, "Parameter Descriptor: %s", ParameterDescriptor);
-
- }
-
- loc_offset += strlen(ParameterDescriptor) + 1;
-
- ReturnDescriptor = pd + loc_offset;
-
- if (si.request_val -> last_data_descrip) g_free(si.request_val -> last_data_descrip);
-
- si.request_val -> last_data_descrip = g_malloc(strlen(ReturnDescriptor) + 1);
- if (si.request_val -> last_data_descrip)
- strcpy(si.request_val -> last_data_descrip, ReturnDescriptor);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, strlen(ReturnDescriptor) + 1, "Return Descriptor: %s", ReturnDescriptor);
-
- }
-
- loc_offset += strlen(ReturnDescriptor) + 1;
-
- Level = GSHORT(pd, loc_offset);
- si.request_val -> last_level = Level;
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Info Detail Level: %u", Level);
-
- }
-
- loc_offset += 2;
-
- RecvBufLen = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Receive Buffer Length: %u", RecvBufLen);
-
- }
-
- loc_offset += 2;
-
- Flags = GWORD(pd, loc_offset);
-
- if (tree) {
-
- ti = proto_tree_add_text(lanman_tree, loc_offset, 4, "Server Types Required: 0x%08X", Flags);
- flags_tree = proto_item_add_subtree(ti, ett_browse_flags);
- dissect_server_flags(flags_tree, loc_offset, 4, Flags);
-
- }
-
- loc_offset += 4;
-
- return 1;
- break;
-
- }
- }
- else { /* Dirn == 0, response */
- guint16 Status;
- guint16 Convert;
- guint16 EntCount;
- guint16 AvailCount;
- guint32 loc_offset = 0;
- int i;
- proto_tree *server_tree = NULL, *flags_tree = NULL, *share_tree = NULL;
-
- FunctionCode = si.request_val -> last_lanman_cmd;
-
- switch (FunctionCode) {
-
- case NETSHAREENUM:
-
- if (check_col(fd, COL_INFO)) {
-
- col_add_fstr(fd, COL_INFO, "NetShareEnum Response");
-
- }
-
- if (tree) {
-
- ti = proto_tree_add_item(parent, proto_lanman, SMB_offset + ParameterOffset, END_OF_FRAME, NULL);
- lanman_tree = proto_item_add_subtree(ti, ett_lanman);
-
- proto_tree_add_text(lanman_tree, loc_offset, 0, "Function Code: NetShareEnum");
-
- }
-
- loc_offset = SMB_offset + ParameterOffset;
-
- Status = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Status: %u", Status);
-
- }
-
- loc_offset += 2;
-
- Convert = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Convert: %u", Convert);
-
- }
-
- loc_offset += 2;
-
- EntCount = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Entry Count: %u", EntCount);
-
- }
-
- loc_offset += 2;
-
- AvailCount = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Available Entries: %u", AvailCount);
-
- }
-
- loc_offset += 2;
-
- if (tree) {
-
- ti = proto_tree_add_text(lanman_tree, loc_offset, AvailCount * 20, "Available Shares", NULL);
-
- share_tree = proto_item_add_subtree(ti, ett_lanman_shares);
-
- }
-
- for (i = 1; i <= EntCount; i++) {
- const gchar *Share = pd + loc_offset;
- guint32 Flags;
- const gchar *Comment;
- proto_tree *share = NULL;
- proto_item *ti = NULL;
-
- if (tree) {
-
- ti = proto_tree_add_text(share_tree, loc_offset, 20, "Share %s", Share);
- share = proto_item_add_subtree(ti, ett_lanman_share);
-
-
- }
-
- if (tree) {
-
- proto_tree_add_text(share, loc_offset, strlen(Share) + 1, "Share Name: %s", Share);
-
- }
-
- loc_offset += 13;
-
- loc_offset += 1; /* Skip the pad ... */
-
- Flags = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(share, loc_offset, 2, "Share Type: %u", Flags);
-
- }
-
- loc_offset += 2;
-
- Comment = pd + SMB_offset + DataOffset + GWORD(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(share, loc_offset, 4, "Share Comment: %s", Comment);
-
- }
-
- loc_offset += 4;
-
- }
-
- break;
-
- case NETSERVERENUM2:
-
- if (check_col(fd, COL_INFO)) {
-
- col_add_fstr(fd, COL_INFO, "NetServerEnum2 %s", dirn ? "Request" : "Response");
-
- }
-
- if (tree) {
-
- ti = proto_tree_add_item(parent, proto_lanman, SMB_offset + ParameterOffset, END_OF_FRAME, NULL);
- lanman_tree = proto_item_add_subtree(ti, ett_lanman);
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Function Code: NetServerEnum2");
-
- }
-
- loc_offset = SMB_offset + ParameterOffset;
- Status = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Status: %u", Status);
-
- }
-
- loc_offset += 2;
-
- Convert = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Convert: %u", Convert);
-
- }
-
- loc_offset += 2;
-
- EntCount = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Entry Count: %u", EntCount);
-
- }
-
- loc_offset += 2;
-
- AvailCount = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(lanman_tree, loc_offset, 2, "Available Entries: %u", AvailCount);
-
- }
-
- loc_offset += 2;
-
- if (! BYTES_ARE_IN_FRAME(loc_offset, 26 * EntCount) ) {
- return 1;
- }
-
- if (tree) {
-
- ti = proto_tree_add_text(lanman_tree, loc_offset, 26 * EntCount, "Servers");
- if (ti == NULL) {
-
- printf("Null value returned from proto_tree_add_text\n");
- exit(1);
-
- }
-
- server_tree = proto_item_add_subtree(ti, ett_lanman_servers);
-
- }
-
- for (i = 1; i <= EntCount; i++) {
- const gchar *Server = pd + loc_offset;
- gint8 ServerMajor;
- guint ServerMinor;
- guint32 ServerFlags;
- const gchar *Comment;
- proto_tree *server = NULL;
- proto_item *ti;
+ if (tree) {
- if (tree) {
+ proto_tree_add_text(tree, NullTVB, offset, 4, "Timeout: %u", Timeout);
- ti = proto_tree_add_text(server_tree, loc_offset,
- (si.request_val -> last_level) ? 26 : 16,
- "Server %s", Server);
- server = proto_item_add_subtree(ti, ett_lanman_server);
+ }
+ offset += 4; /* Skip Timeout */
- }
+ /* Build display for: Reserved2 */
- if (tree) {
-
- proto_tree_add_text(server, loc_offset, strlen(Server) + 1, "Server Name: %s", Server);
+ Reserved2 = GSHORT(pd, offset);
- }
+ if (tree) {
- loc_offset += 16;
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved2: %u", Reserved2);
- if (si.request_val -> last_level) { /* Print out the rest of the info */
+ }
- ServerMajor = GBYTE(pd, loc_offset);
+ offset += 2; /* Skip Reserved2 */
- if (tree) {
+ /* Build display for: Parameter Count */
- proto_tree_add_text(server, loc_offset, 1, "Major Version: %u", ServerMajor);
+ ParameterCount = GSHORT(pd, offset);
- }
+ if (tree) {
- loc_offset += 1;
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Count: %u", ParameterCount);
- ServerMinor = GBYTE(pd, loc_offset);
+ }
- if (tree) {
+ offset += 2; /* Skip Parameter Count */
- proto_tree_add_text(server, loc_offset, 1, "Minor Version: %u", ServerMinor);
+ /* Build display for: Parameter Offset */
- }
+ ParameterOffset = GSHORT(pd, offset);
- loc_offset += 1;
+ if (tree) {
- ServerFlags = GWORD(pd, loc_offset);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Offset: %u", ParameterOffset);
- if (tree) {
+ }
- ti = proto_tree_add_text(server, loc_offset, 4, "Server Type: 0x%08X", ServerFlags);
- flags_tree = proto_item_add_subtree(ti, ett_browse_flags);
- dissect_server_flags(flags_tree, loc_offset, 4, ServerFlags);
+ offset += 2; /* Skip Parameter Offset */
- }
+ /* Build display for: Data Count */
- loc_offset += 4;
+ DataCount = GSHORT(pd, offset);
- Comment = pd + SMB_offset + DataOffset + GWORD(pd, loc_offset);
+ if (tree) {
- if (tree) {
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Count: %u", DataCount);
- proto_tree_add_text(server, loc_offset, 4, "Server Comment: %s", Comment);
+ }
- }
+ offset += 2; /* Skip Data Count */
- loc_offset += 4;
+ /* Build display for: Data Offset */
- }
+ DataOffset = GSHORT(pd, offset);
- }
+ if (tree) {
- return 1;
- break;
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
- }
-
- return 0;
-
-}
+ offset += 2; /* Skip Data Offset */
-guint32
-dissect_pipe_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, const u_char *command, int DataOffset, int DataCount, int ParameterOffset, int ParameterCount)
-{
+ /* Build display for: Setup Count */
- if (strcmp(command, "LANMAN") == 0) { /* Try to decode a LANMAN */
+ SetupCount = GBYTE(pd, offset);
- return dissect_pipe_lanman(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, command, DataOffset, DataCount, ParameterOffset, ParameterCount);
+ if (tree) {
- }
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Setup Count: %u", SetupCount);
- return 0;
+ }
-}
+ offset += 1; /* Skip Setup Count */
-char *browse_commands[] =
-{ "Error, No such command!", /* Value 0 */
- "Host Announcement", /* Value 1 */
- "Request Announcement", /* Value 2 */
- "Error, No such command!", /* Value 3 */
- "Error, No such command!", /* Value 4 */
- "Error, No such command!", /* Value 5 */
- "Error, No such command!", /* Value 6 */
- "Error, No such command!", /* Value 7 */
- "Browser Election Request", /* Value 8 */
- "Get Backup List Request", /* Value 9 */
- "Get Backup List Response", /* Value 10 */
- "Become Backup Browser", /* Value 11 */
- "Domain/Workgroup Announcement", /* Value 12 */
- "Master Announcement", /* Value 13 */
- "Error! No such command", /* Value 14 */
- "Local Master Announcement" /* Value 15 */
-};
+ /* Build display for: Reserved3 */
-#define HOST_ANNOUNCE 1
-#define REQUEST_ANNOUNCE 2
-#define BROWSER_ELECTION 8
-#define GETBACKUPLISTREQ 9
-#define GETBACKUPLISTRESP 10
-#define BECOMEBACKUPBROWSER 11
-#define DOMAINANNOUNCEMENT 12
-#define MASTERANNOUNCEMENT 13
-#define LOCALMASTERANNOUNC 15
-
-char *svr_types[32] = {
- "Workstation",
- "Server",
- "SQL Server",
- "Domain Controller",
- "Backup Controller",
- "Time Source",
- "Apple Server",
- "Novell Server",
- "Domain Member Server",
- "Print Queue Server",
- "Dialin Server",
- "Xenix Server",
- "NT Workstation",
- "Windows for Workgroups",
- "Unknown Server - FIXME",
- "NT Server",
- "Potential Browser",
- "Backup Browser",
- "Master Browser",
- "Domain Master Browser",
- "OSF",
- "VMS",
- "Windows 95 or above",
- "Unused",
- "Unused",
- "Unused",
- "Unused",
- "Unused",
- "Unused",
- "Unused",
- "Local List Only",
- "Domain Enum"
-};
+ Reserved3 = GBYTE(pd, offset);
-guint32
-dissect_mailslot_browse(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, const u_char *command, int DataOffset, int DataCount)
-{
- guint8 OpCode;
- guint8 UpdateCount;
- guint8 VersionMajor;
- guint8 VersionMinor;
- guint32 Periodicity;
- guint32 ServerType;
- guint16 SigConstant;
- guint32 Token;
- guint8 BackupServerCount;
- guint8 Flags;
- guint32 MBZ;
- guint8 ElectionVersion;
- guint32 ElectionCriteria;
- guint8 ElectionOS;
- guint8 ElectionDesire;
- guint16 ElectionRevision;
- guint32 ServerUpTime;
- const char *ServerName;
- const char *ServerComment;
- proto_tree *browse_tree = NULL, *flags_tree = NULL,
- *OSflags = NULL, *DesireFlags = NULL;
- proto_item *ti, *ec;
- guint32 loc_offset = DataOffset, count = 0;
- int i;
-
- if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "BROWSER");
-
- if (check_col(fd, COL_INFO)) /* Put in something, and replace it later */
- col_add_str(fd, COL_INFO, "Browse Announcement");
+ if (tree) {
- /*
- * Now, decode the browse request
- */
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Reserved3: %u", Reserved3);
+ }
- OpCode = GBYTE(pd, loc_offset);
+ offset += 1; /* Skip Reserved3 */
+
+ SetupAreaOffset = offset;
- if (check_col(fd, COL_INFO))
- col_add_fstr(fd, COL_INFO, (OpCode > (sizeof(browse_commands)/sizeof(char *))) ? "Error, No Such Command:%u" : browse_commands[OpCode], OpCode);
-
- if (tree) { /* Add the browse tree */
+ /* Build display for: Setup */
- ti = proto_tree_add_item(parent, proto_browse, DataOffset, DataCount, NULL);
- browse_tree = proto_item_add_subtree(ti, ett_browse);
+ if (SetupCount > 0) {
- proto_tree_add_text(browse_tree, loc_offset, 1, "OpCode: %s", (OpCode > (sizeof(browse_commands)/sizeof(char *))) ? "Error, No Such Command" : browse_commands[OpCode]);
+ int i = SetupCount;
- }
+ Setup = GSHORT(pd, offset);
- loc_offset += 1; /* Skip the OpCode */
+ for (i = 1; i <= SetupCount; i++) {
+
+ Setup = GSHORT(pd, offset);
- switch (OpCode) {
+ if (tree) {
- case DOMAINANNOUNCEMENT:
- case LOCALMASTERANNOUNC:
- case HOST_ANNOUNCE:
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Setup%i: %u", i, Setup);
- UpdateCount = GBYTE(pd, loc_offset);
+ }
- if (tree) {
+ offset += 2; /* Skip Setup */
- proto_tree_add_text(browse_tree, loc_offset, 1, "Update Count: %u", UpdateCount);
+ }
}
- loc_offset += 1; /* Skip the Update Count */
+ /* Build display for: Byte Count (BCC) */
- Periodicity = GWORD(pd, loc_offset);
+ ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 4, "Update Periodicity: %u Sec", Periodicity/1000 );
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
- loc_offset += 4;
-
- ServerName = pd + loc_offset;
+ offset += 2; /* Skip Byte Count (BCC) */
- if (check_col(fd, COL_INFO)) {
+ /* Build display for: Transact Name */
- col_append_fstr(fd, COL_INFO, " %s", ServerName);
+ /* Watch out for Unicode names */
- }
+ if (si.unicode) {
- if (tree) {
+ if (offset % 2) offset++; /* Looks like a pad byte there sometimes */
- proto_tree_add_text(browse_tree, loc_offset, 16, (OpCode == DOMAINANNOUNCEMENT) ? "Domain/WorkGroup: %s": "Host Name: %s", ServerName);
+ TransactName = unicode_to_str(pd + offset, &TNlen);
+ TNlen += 2;
}
+ else {
+ TransactName = pd + offset;
+ TNlen = strlen(TransactName) + 1;
+ }
- loc_offset += 16;
-
- VersionMajor = GBYTE(pd, loc_offset);
+ if (request_val -> last_transact_command) g_free(request_val -> last_transact_command);
- if (tree) {
+ request_val -> last_transact_command = g_malloc(strlen(TransactName) + 1);
- proto_tree_add_text(browse_tree, loc_offset, 1, "Major Version: %u", VersionMajor);
+ if (request_val -> last_transact_command)
+ strcpy(request_val -> last_transact_command, TransactName);
- }
+ if (check_col(fd, COL_INFO)) {
- loc_offset += 1;
+ col_add_fstr(fd, COL_INFO, "%s %s", TransactName, (dirn ? "Request" : "Response"));
- VersionMinor = GBYTE(pd, loc_offset);
+ }
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 1, "Minor Version: %u", VersionMinor);
+ proto_tree_add_text(tree, NullTVB, offset, TNlen, "Transact Name: %s", TransactName);
}
- loc_offset += 1;
+ offset += TNlen; /* Skip Transact Name */
+ if (si.unicode) offset += 2; /* There are two more extraneous bytes there*/
- ServerType = GWORD(pd, loc_offset);
+ if (offset < (SMB_offset + ParameterOffset)) {
- if (check_col(fd, COL_INFO)) {
+ int pad1Count = SMB_offset + ParameterOffset - offset;
- /* Append the type(s) of the system to the COL_INFO line ... */
+ /* Build display for: Pad1 */
- for (i = 1; i <= 32; i++) {
+ if (tree) {
- if (ServerType & (1 << (i - 1)) && (strcmp("Unused", svr_types[i]) != 0))
- col_append_fstr(fd, COL_INFO, ", %s", svr_types[i - 1]);
-
+ proto_tree_add_text(tree, NullTVB, offset, pad1Count, "Pad1: %s", format_text(pd + offset, pad1Count));
}
-
- }
- if (tree) {
-
- ti = proto_tree_add_text(browse_tree, loc_offset, 4, "Server Type: 0x%04x", ServerType);
- flags_tree = proto_item_add_subtree(ti, ett_browse_flags);
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0001, 32, "Workstation", "Not Workstation"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0002, 32, "Server", "Not Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0004, 32, "SQL Server", "Not SQL Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0008, 32, "Domain Controller", "Not Domain Controller"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0010, 32, "Backup Controller", "Not Backup Controller"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0020, 32, "Time Source", "Not Time Source"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0040, 32, "Apple Server", "Not Apple Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0080, 32, "Novell Server", "Not Novell Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0100, 32, "Domain Member Server", "Not Domain Member Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0200, 32, "Print Queue Server", "Not Print Queue Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0400, 32, "Dialin Server", "Not Dialin Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x0800, 32, "Xenix Server", "Not Xenix Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x1000, 32, "NT Workstation", "Not NT Workstation"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x2000, 32, "Windows for Workgroups", "Not Windows for Workgroups"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x8000, 32, "NT Server", "Not NT Server"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x10000, 32, "Potential Browser", "Not Potential Browser"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x20000, 32, "Backup Browser", "Not Backup Browser"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x40000, 32, "Master Browser", "Not Master Browser"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x80000, 32, "Domain Master Browser", "Not Domain Master Browser"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x100000, 32, "OSF", "Not OSF"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x200000, 32, "VMS", "Not VMS"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x400000, 32, "Windows 95 or above", "Not Windows 95 or above"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x40000000, 32, "Local List Only", "Not Local List Only"));
- proto_tree_add_text(flags_tree, loc_offset, 4, "%s",
- decode_boolean_bitfield(ServerType, 0x80000000, 32, "Domain Enum", "Not Domain Enum"));
- }
- loc_offset += 4;
-
- ElectionVersion = GSHORT(pd, loc_offset);
-
- if (tree) {
-
- proto_tree_add_text(browse_tree, loc_offset, 2, "Election Version: %u", ElectionVersion);
+ offset += pad1Count; /* Skip Pad1 */
}
- loc_offset += 2;
+ /* Let's see if we can decode this */
- SigConstant = GSHORT(pd, loc_offset);
+ dissect_transact_params(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, DataOffset, DataCount, ParameterOffset, ParameterCount, SetupAreaOffset, SetupCount, TransactName);
- if (tree) {
+ }
+
+ if (dirn == 0) { /* Response(s) dissect code */
- proto_tree_add_text(browse_tree, loc_offset, 2, "Signature: %u (0x%04X)", SigConstant, SigConstant);
+ if (check_col(fd, COL_INFO)) {
+ if ( request_val -> last_transact_command )
+ col_add_fstr(fd, COL_INFO, "%s %s", request_val -> last_transact_command, "Response");
+ else col_add_fstr(fd, COL_INFO, "Response to unknown message");
}
- loc_offset += 2;
+ /* Build display for: Word Count (WCT) */
- ServerComment = pd + loc_offset;
+ WordCount = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, strlen(ServerComment) + 1, "Host Comment: %s", ServerComment);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Word Count (WCT): %u", WordCount);
}
- break;
+ offset += 1; /* Skip Word Count (WCT) */
- case REQUEST_ANNOUNCE:
+ /* Build display for: Total Parameter Count */
- Flags = GBYTE(pd, loc_offset);
+ TotalParameterCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 1, "Unused Flags: %u", Flags);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Parameter Count: %u", TotalParameterCount);
}
- loc_offset += 1;
+ offset += 2; /* Skip Total Parameter Count */
+
+ /* Build display for: Total Data Count */
- ServerName = pd + loc_offset;
+ TotalDataCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, strlen(ServerName) + 1, "Send List To: %s", ServerName);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Total Data Count: %u", TotalDataCount);
}
- break;
+ offset += 2; /* Skip Total Data Count */
- case BROWSER_ELECTION:
+ /* Build display for: Reserved2 */
- ElectionVersion = GBYTE(pd, loc_offset);
+ Reserved2 = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 1, "Election Version = %u", ElectionVersion);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Reserved2: %u", Reserved2);
}
- loc_offset += 1;
-
- ElectionCriteria = GWORD(pd, loc_offset);
- ElectionOS = GBYTE(pd, loc_offset + 3);
- ElectionRevision = GSHORT(pd, loc_offset + 1);
- ElectionDesire = GBYTE(pd, loc_offset);
-
- if (tree) {
-
- ti = proto_tree_add_text(browse_tree, loc_offset, 4, "Election Criteria = %u (0x%08X)", ElectionCriteria, ElectionCriteria);
-
- ec = proto_item_add_subtree(ti, ett_browse_election_criteria);
-
- ti = proto_tree_add_text(ec, loc_offset + 3, 1, "Election OS Summary: %u (0x%02X)", ElectionOS, ElectionOS);
+ offset += 2; /* Skip Reserved2 */
- OSflags = proto_item_add_subtree(ti, ett_browse_election_os);
+ /* Build display for: Parameter Count */
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x01, 8, "Windows for Workgroups", "Not Windows for Workgroups"));
-
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x02, 8, "Unknown", "Not used"));
+ ParameterCount = GSHORT(pd, offset);
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x04, 8, "Unknown", "Not used"));
+ if (tree) {
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x08, 8, "Unknown", "Not used"));
-
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x10, 8, "Windows NT Workstation", "Not Windows NT Workstation"));
-
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x20, 8, "Windows NT Server", "Not Windows NT Server"));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Count: %u", ParameterCount);
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x40, 8, "Unknown", "Not used"));
+ }
- proto_tree_add_text(OSflags, loc_offset + 3, 1, "%s",
- decode_boolean_bitfield(ElectionOS, 0x80, 8, "Unknown", "Not used"));
+ offset += 2; /* Skip Parameter Count */
- proto_tree_add_text(ec, loc_offset + 1, 2, "Election Revision: %u (0x%04X)", ElectionRevision, ElectionRevision);
+ /* Build display for: Parameter Offset */
- ti = proto_tree_add_text(ec, loc_offset, 1, "Election Desire Summary: %u (0x%02X)", ElectionDesire, ElectionDesire);
+ ParameterOffset = GSHORT(pd, offset);
- DesireFlags = proto_item_add_subtree(ti, ett_browse_election_desire);
+ if (tree) {
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x01, 8, "Backup Browse Server", "Not Backup Browse Server"));
-
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x02, 8, "Standby Browse Server", "Not Standby Browse Server"));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Offset: %u", ParameterOffset);
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x04, 8, "Master Browser", "Not Master Browser"));
+ }
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x08, 8, "Domain Master Browse Server", "Not Domain Master Browse Server"));
+ offset += 2; /* Skip Parameter Offset */
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x10, 8, "Unknown", "Not used"));
+ /* Build display for: Parameter Displacement */
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x20, 8, "WINS Client", "Not WINS Client"));
+ ParameterDisplacement = GSHORT(pd, offset);
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x40, 8, "Unknown", "Not used"));
+ if (tree) {
- proto_tree_add_text(DesireFlags, loc_offset, 1, "%s",
- decode_boolean_bitfield(ElectionDesire, 0x80, 8, "Windows NT Advanced Server", "Not Windows NT Advanced Server"));
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Parameter Displacement: %u", ParameterDisplacement);
}
- loc_offset += 4;
+ offset += 2; /* Skip Parameter Displacement */
+
+ /* Build display for: Data Count */
- ServerUpTime = GWORD(pd, loc_offset);
+ DataCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 4, "Server Up Time: %u Sec", ServerUpTime/1000);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Count: %u", DataCount);
}
- loc_offset += 4;
-
- MBZ = GWORD(pd, loc_offset);
+ offset += 2; /* Skip Data Count */
- loc_offset += 4;
+ /* Build display for: Data Offset */
- ServerName = pd + loc_offset;
+ DataOffset = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, strlen(ServerName) + 1, "Election Server Name: %s", ServerName);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Offset: %u", DataOffset);
}
- break;
+ offset += 2; /* Skip Data Offset */
- case GETBACKUPLISTREQ:
+ /* Build display for: Data Displacement */
- BackupServerCount = GBYTE(pd, loc_offset);
+ DataDisplacement = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 1, "Backup List Requested Count: %u", BackupServerCount);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Data Displacement: %u", DataDisplacement);
}
- loc_offset += 1;
+ offset += 2; /* Skip Data Displacement */
+
+ /* Build display for: Setup Count */
- Token = GWORD(pd, loc_offset);
+ SetupCount = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 4, "Backup Request Token: %u", Token);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Setup Count: %u", SetupCount);
}
- break;
+ offset += 1; /* Skip Setup Count */
- case GETBACKUPLISTRESP:
+
+ /* Build display for: Reserved3 */
- BackupServerCount = GBYTE(pd, loc_offset);
+ Reserved3 = GBYTE(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, 1, "Backup Server Count: %u", BackupServerCount);
+ proto_tree_add_text(tree, NullTVB, offset, 1, "Reserved3: %u", Reserved3);
}
- loc_offset += 1;
+
+ offset += 1; /* Skip Reserved3 */
+
+ SetupAreaOffset = offset;
- Token = GWORD(pd, loc_offset);
+ /* Build display for: Setup */
- if (tree) {
+ if (SetupCount > 0) {
- proto_tree_add_text(browse_tree, loc_offset, 4, "Backup Response Token: %u", Token);
+ int i = SetupCount;
- }
+ Setup = GSHORT(pd, offset);
- loc_offset += 4;
+ for (i = 1; i <= SetupCount; i++) {
+
+ Setup = GSHORT(pd, offset);
- ServerName = pd + loc_offset;
+ if (tree) {
- for (count = 1; count <= BackupServerCount; count++) {
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Setup%i: %u", i, Setup);
- if (tree) {
+ }
- proto_tree_add_text(browse_tree, loc_offset, strlen(ServerName) + 1, "Backup Server: %s", ServerName);
+ offset += 2; /* Skip Setup */
}
- loc_offset += strlen(ServerName) + 1;
-
- ServerName = pd + loc_offset;
-
}
- break;
-
- case BECOMEBACKUPBROWSER:
+ /* Build display for: Byte Count (BCC) */
- ServerName = pd + loc_offset;
+ ByteCount = GSHORT(pd, offset);
if (tree) {
- proto_tree_add_text(browse_tree, loc_offset, strlen(ServerName) + 1, "Browser to Promote: %s", ServerName);
+ proto_tree_add_text(tree, NullTVB, offset, 2, "Byte Count (BCC): %u", ByteCount);
}
- break;
+ offset += 2; /* Skip Byte Count (BCC) */
- case MASTERANNOUNCEMENT:
+ /* Build display for: Pad1 */
- ServerName = pd + loc_offset;
+ if (offset < (SMB_offset + ParameterOffset)) {
- if (tree) {
+ int pad1Count = SMB_offset + ParameterOffset - offset;
- proto_tree_add_text(browse_tree, loc_offset, strlen(ServerName) + 1, "Server Name: %s", ServerName);
+ /* Build display for: Pad1 */
- }
+ if (tree) {
- break;
+ proto_tree_add_text(tree, NullTVB, offset, pad1Count, "Pad1: %s", format_text(pd + offset, pad1Count));
+ }
- default:
- break;
- }
-
- return 1; /* Success */
+ offset += pad1Count; /* Skip Pad1 */
-}
+ }
-guint32
-dissect_mailslot_net(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, const u_char *command, int DataOffset, int DataCount)
-{
+ dissect_transact_params(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, DataOffset, DataCount, ParameterOffset, ParameterCount, SetupAreaOffset, SetupCount, si.request_val -> last_transact_command);
- return 0;
+ }
}
-guint32
-dissect_mailslot_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *parent, proto_tree *tree, struct smb_info si, int max_data, int SMB_offset, int errcode, int dirn, const u_char *command, int DataOffset, int DataCount)
-{
-
- if (strcmp(command, "BROWSE") == 0) { /* Decode a browse */
- return dissect_mailslot_browse(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, command, DataOffset, DataCount);
- }
- return 0;
-}
void (*dissect[256])(const u_char *, int, frame_data *, proto_tree *, proto_tree *, struct smb_info, int, int, int, int) = {
- dissect_unknown_smb, /* unknown SMB 0x00 */
- dissect_unknown_smb, /* unknown SMB 0x01 */
+ dissect_createdir_smb, /* unknown SMB 0x00 */
+ dissect_deletedir_smb, /* unknown SMB 0x01 */
dissect_unknown_smb, /* SMBopen open a file */
dissect_create_file_smb, /* SMBcreate create a file */
dissect_close_smb, /* SMBclose close a file */
dissect_unknown_smb, /* SMBecho echo */
dissect_unknown_smb, /* SMBwriteclose write a file and then close it */
dissect_open_andx_smb, /* SMBopenX open and X */
- dissect_unknown_smb, /* SMBreadX read and X */
+ dissect_read_andx_smb, /* SMBreadX read and X */
dissect_unknown_smb, /* SMBwriteX write and X */
dissect_unknown_smb, /* unknown SMB 0x30 */
dissect_unknown_smb, /* unknown SMB 0x31 */
{SMBE_useSTD, "Temporarily unable to use raw mode, use standard mode"},
{SMBE_contMPX, "Resume MPX mode"},
{SMBE_badPW, "Bad Password???"},
- {SMBE_nosupport, "Operation not supported???"},
+ {SMBE_nosupport, "Operation not supported"},
{ 0, 0}
};
{0, 0}
};
-char *decode_smb_error(guint8 errcls, guint8 errcode)
+char *decode_smb_error(guint8 errcls, guint16 errcode)
{
switch (errcls) {
proto_item *ti, *tf;
guint8 cmd, errcls, errcode1, flags;
guint16 flags2, errcode, tid, pid, uid, mid;
+ guint32 status;
int SMB_offset = offset;
struct smb_info si;
+ OLD_CHECK_DISPLAY_AS_DATA(proto_smb, pd, offset, fd, tree);
+
si.unicode = 0;
cmd = pd[offset + SMB_hdr_com_offset];
if (check_col(fd, COL_PROTOCOL))
- col_add_str(fd, COL_PROTOCOL, "SMB");
+ col_set_str(fd, COL_PROTOCOL, "SMB");
/* Hmmm, poor coding here ... Also, should check the type */
if (tree) {
- ti = proto_tree_add_item(tree, proto_smb, offset, END_OF_FRAME, NULL);
+ ti = proto_tree_add_item(tree, proto_smb, NullTVB, offset, END_OF_FRAME, FALSE);
smb_tree = proto_item_add_subtree(ti, ett_smb);
/* 0xFFSMB is actually a 1 byte msg type and 3 byte server
* component ... SMB is only one used
*/
- proto_tree_add_text(smb_tree, offset, 1, "Message Type: 0xFF");
- proto_tree_add_text(smb_tree, offset+1, 3, "Server Component: SMB");
+ proto_tree_add_text(smb_tree, NullTVB, offset, 1, "Message Type: 0xFF");
+ proto_tree_add_text(smb_tree, NullTVB, offset+1, 3, "Server Component: SMB");
}
if (tree) {
- proto_tree_add_text(smb_tree, offset, 1, "Command: %s", decode_smb_name(cmd));
+ proto_tree_add_uint(smb_tree, hf_smb_cmd, NullTVB, offset, 1, cmd);
}
offset += 1;
- /* Next, look at the error class, SMB_RETCLASS */
+ /* Handle error code */
- errcls = pd[offset];
+ if (GSHORT(pd, SMB_offset + 10) & 0x4000) {
- if (tree) {
+ /* handle NT 32 bit error code */
+ errcode = 0; /* better than a random number */
+ status = GWORD(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(smb_tree, NullTVB, offset, 4, "Status: 0x%08x",
+ status);
+
+ }
+
+ offset += 4;
- proto_tree_add_text(smb_tree, offset, 1, "Error Class: %s",
- val_to_str((guint8)pd[offset], errcls_types, "Unknown Error Class (%x)"));
}
+ else {
+ /* handle DOS error code & class */
- offset += 1;
+ /* Next, look at the error class, SMB_RETCLASS */
- /* Error code, SMB_HEINFO ... */
+ errcls = pd[offset];
- errcode1 = pd[offset];
+ if (tree) {
- if (tree) {
+ proto_tree_add_text(smb_tree, NullTVB, offset, 1, "Error Class: %s",
+ val_to_str((guint8)pd[offset], errcls_types, "Unknown Error Class (%x)"));
+ }
- proto_tree_add_text(smb_tree, offset, 1, "Reserved: %i", errcode1);
+ offset += 1;
- }
+ /* Error code, SMB_HEINFO ... */
- offset += 1;
+ errcode1 = pd[offset];
- errcode = GSHORT(pd, offset);
+ if (tree) {
- if (tree) {
+ proto_tree_add_text(smb_tree, NullTVB, offset, 1, "Reserved: %i", errcode1);
- proto_tree_add_text(smb_tree, offset, 2, "Error Code: %s",
- decode_smb_error(errcls, errcode));
+ }
- }
+ offset += 1;
- offset += 2;
+ errcode = GSHORT(pd, offset);
+
+ if (tree) {
+
+ proto_tree_add_text(smb_tree, NullTVB, offset, 2, "Error Code: %s",
+ decode_smb_error(errcls, errcode));
+
+ }
+
+ offset += 2;
+ }
/* Now for the flags: Bit 0 = 0 means cmd, 0 = 1 means resp */
if (tree) {
- tf = proto_tree_add_text(smb_tree, offset, 1, "Flags: 0x%02x", flags);
+ tf = proto_tree_add_text(smb_tree, NullTVB, offset, 1, "Flags: 0x%02x", flags);
flags_tree = proto_item_add_subtree(tf, ett_smb_flags);
- proto_tree_add_text(flags_tree, offset, 1, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x01, 8,
"Lock&Read, Write&Unlock supported",
"Lock&Read, Write&Unlock not supported"));
- proto_tree_add_text(flags_tree, offset, 1, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x02, 8,
"Receive buffer posted",
"Receive buffer not posted"));
- proto_tree_add_text(flags_tree, offset, 1, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x08, 8,
"Path names caseless",
"Path names case sensitive"));
- proto_tree_add_text(flags_tree, offset, 1, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x10, 8,
"Pathnames canonicalized",
"Pathnames not canonicalized"));
- proto_tree_add_text(flags_tree, offset, 1, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x20, 8,
"OpLocks requested/granted",
"OpLocks not requested/granted"));
- proto_tree_add_text(flags_tree, offset, 1, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags, 0x40, 8,
"Notify all",
"Notify open only"));
- proto_tree_add_text(flags_tree, offset, 1, "%s",
+ proto_tree_add_text(flags_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags, SMB_FLAGS_DIRN,
8, "Response to client/redirector", "Request to server"));
if (tree) {
- tf = proto_tree_add_text(smb_tree, offset, 1, "Flags2: 0x%04x", flags2);
+ tf = proto_tree_add_text(smb_tree, NullTVB, offset, 2, "Flags2: 0x%04x", flags2);
flags2_tree = proto_item_add_subtree(tf, ett_smb_flags2);
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags2, 0x0001, 16,
"Long file names supported",
"Long file names not supported"));
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags2, 0x0002, 16,
"Extended attributes supported",
"Extended attributes not supported"));
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 1, "%s",
decode_boolean_bitfield(flags2, 0x0004, 16,
"Security signatures supported",
"Security signatures not supported"));
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags2, 0x0800, 16,
"Extended security negotiation supported",
"Extended security negotiation not supported"));
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags2, 0x1000, 16,
"Resolve pathnames with DFS",
"Don't resolve pathnames with DFS"));
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags2, 0x2000, 16,
"Permit reads if execute-only",
"Don't permit reads if execute-only"));
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags2, 0x4000, 16,
"Error codes are NT error codes",
"Error codes are DOS error codes"));
- proto_tree_add_text(flags2_tree, offset, 1, "%s",
+ proto_tree_add_text(flags2_tree, NullTVB, offset, 2, "%s",
decode_boolean_bitfield(flags2, 0x8000, 16,
"Strings are Unicode",
"Strings are ASCII"));
if (tree) {
- proto_tree_add_text(smb_tree, offset, 12, "Reserved: 6 WORDS");
+ proto_tree_add_text(smb_tree, NullTVB, offset, 12, "Reserved: 6 WORDS");
}
if (tree) {
- proto_tree_add_text(smb_tree, offset, 2, "Network Path/Tree ID (TID): %i (%04x)", tid, tid);
+ proto_tree_add_text(smb_tree, NullTVB, offset, 2, "Network Path/Tree ID (TID): %i (%04x)", tid, tid);
}
if (tree) {
- proto_tree_add_text(smb_tree, offset, 2, "Process ID (PID): %i (%04x)", pid, pid);
+ proto_tree_add_text(smb_tree, NullTVB, offset, 2, "Process ID (PID): %i (%04x)", pid, pid);
}
if (tree) {
- proto_tree_add_text(smb_tree, offset, 2, "User ID (UID): %i (%04x)", uid, uid);
+ proto_tree_add_text(smb_tree, NullTVB, offset, 2, "User ID (UID): %i (%04x)", uid, uid);
}
if (tree) {
- proto_tree_add_text(smb_tree, offset, 2, "Multiplex ID (MID): %i (%04x)", mid, mid);
+ proto_tree_add_text(smb_tree, NullTVB, offset, 2, "Multiplex ID (MID): %i (%04x)", mid, mid);
}
}
+/*** External routines called during the registration process */
+
+extern void register_proto_smb_browse( void);
+extern void register_proto_smb_logon( void);
+extern void register_proto_smb_mailslot( void);
+extern void register_proto_smb_pipe( void);
+extern void register_proto_smb_mailslot( void);
+
+
void
proto_register_smb(void)
{
-/* static hf_register_info hf[] = {
- { &variable,
- { "Name", "smb.abbreviation", TYPE, VALS_POINTER }},
- };*/
+ static hf_register_info hf[] = {
+ { &hf_smb_cmd,
+ { "SMB Command", "smb.cmd",
+ FT_UINT8, BASE_HEX, VALS(smb_cmd_vals), 0x0, "" }}
+
+
+ };
static gint *ett[] = {
&ett_smb,
&ett_smb_fileattributes,
&ett_smb_action,
&ett_smb_writemode,
&ett_smb_lock_type,
- &ett_browse,
- &ett_browse_flags,
- &ett_browse_election_criteria,
- &ett_browse_election_os,
- &ett_browse_election_desire,
- &ett_lanman,
- &ett_lanman_servers,
- &ett_lanman_server,
- &ett_lanman_shares,
- &ett_lanman_share
};
- proto_smb = proto_register_protocol("Server Message Block Protocol", "smb");
- proto_browse = proto_register_protocol("Microsoft Windows Browser Protocol", "browser");
- proto_lanman = proto_register_protocol("Microsoft Windows LanMan Protocol", "lanman");
- /* proto_register_field_array(proto_smb, hf, array_length(hf));*/
+ proto_smb = proto_register_protocol("SMB (Server Message Block Protocol)", "smb");
+
proto_register_subtree_array(ett, array_length(ett));
+ proto_register_field_array(proto_smb, hf, array_length(hf));
register_init_routine(&smb_init_protocol);
+
+ register_proto_smb_browse();
+ register_proto_smb_logon( );
+ register_proto_smb_mailslot();
+ register_proto_smb_pipe();
+
}