* Routines for smb packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-smb.c,v 1.34 1999/10/27 19:30:23 gram Exp $
+ * $Id: packet-smb.c,v 1.35 1999/11/11 13:56:58 sharpe Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
guint16 MaxMpxCount;
guint16 MaxBufferSize;
guint16 ByteCount;
- guint16 AndXOffset;
+ guint16 AndXOffset = 0;
guint16 Action;
guint16 ANSIAccountPasswordLength;
const char *UNICODEPassword;
+ const char *Password;
const char *PrimaryDomain;
const char *NativeOS;
const char *NativeLanManType;
if (ByteCount > 0) {
+ /* Build displat for: Password */
+
+ Password = pd + offset;
+
+ if (tree) {
+
+ proto_tree_add_text(tree, offset, strlen(Password) + 1, "Password: %s", Password);
+
+ }
+
+ offset += PasswordLen;
+
/* Build display for: AccountName */
AccountName = pd + offset;
if (tree) {
- proto_tree_add_text(tree, offset, strlen(NativeOS) + 1, "NativeOS: %s", NativeOS);
+ proto_tree_add_text(tree, offset, strlen(NativeOS) + 1, "Native OS: %s", NativeOS);
}
offset += strlen(NativeOS) + 1; /* Skip NativeOS */
+ /* Build display for: NativeLanMan */
+
+ NativeLanMan = pd + offset;
+
+ if (tree) {
+
+ proto_tree_add_text(tree, offset, strlen(NativeLanMan) + 1, "Native Lan Manager: %s", NativeLanMan);
+
+ }
+
+ offset += strlen(NativeLanMan) + 1; /* Skip NativeLanMan */
+
}
break;
}
offset += ANSIAccountPasswordLength; /* Skip ANSI Password */
+ if (ANSIAccountPasswordLength == 0) offset++; /* Add 1 */
/* Build display for: UNICODE Password */
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}
{
guint8 wct, andxcmd = 0xFF;
- guint16 andxoffs, flags, passwdlen, bcc, optionsup;
+ guint16 andxoffs = 0, flags, passwdlen, bcc, optionsup;
const char *str;
proto_tree *flags_tree;
proto_item *ti;
if (andxcmd != 0xFF) /* Process that next command ... ??? */
- (dissect[andxcmd])(pd, offset, fd, tree, si, max_data - offset, SMB_offset, errcode, dirn);
+ (dissect[andxcmd])(pd, SMB_offset + andxoffs, fd, tree, si, max_data - offset, SMB_offset, errcode, dirn);
}
guint16 CreationTime;
guint16 CreationDate;
guint16 ByteCount;
- guint16 AndXOffset;
+ guint16 AndXOffset = 0;
guint16 Action;
const char *FileName;
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}
guint8 AndXReserved;
guint8 AndXCommand = 0xFF;
guint16 ByteCount;
- guint16 AndXOffset;
+ guint16 AndXOffset = 0;
if (dirn == 1) { /* Request(s) dissect code */
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}
{
proto_tree *LockType_tree;
proto_item *ti;
- guint8 LockType;
+ guint8 LockType;
guint8 WordCount;
guint8 OplockLevel;
guint8 AndXReserved;
guint16 FID;
guint16 ByteCount;
guint16 AndXoffset;
- guint16 AndXOffset;
+ guint16 AndXOffset = 0;
if (dirn == 1) { /* Request(s) dissect code */
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}
if (AndXCommand != 0xFF) {
- (dissect[AndXCommand])(pd, offset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
+ (dissect[AndXCommand])(pd, SMB_offset + AndXOffset, fd, tree, si, max_data, SMB_offset, errcode, dirn);
}