* Routines for SMB net logon packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-smb-logon.c,v 1.32 2003/05/01 18:11:20 guy Exp $
+ * $Id: packet-smb-logon.c,v 1.36 2003/11/19 03:53:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
*/
#include "packet-smb-common.h"
-#include "packet-smb-logon.h"
static int proto_smb_logon = -1;
static int hf_command = -1;
static int
dissect_smb_pdc_query(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset)
{
- char *name = NULL;
+ char *name;
/*** 0x07 Query for Primary PDC ***/
/* computer name */
offset = display_ms_string(tvb, tree, offset, hf_computer_name, &name);
- if (name && check_col(pinfo->cinfo, COL_INFO)) {
+ if (check_col(pinfo->cinfo, COL_INFO))
col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", name);
- g_free(name);
- name = NULL;
- }
+
+ g_free(name);
/* mailslot name */
offset = display_ms_string(tvb, tree, offset, hf_mailslot_name, NULL);
/* Domain SID */
offset = dissect_nt_sid(
- tvb, offset, tree, "Domain", NULL);
+ tvb, offset, tree, "Domain", NULL, -1);
}
/* NT version */
offset = ((offset + 3)/4)*4;
/* Domain SID */
- offset = dissect_nt_sid(tvb, offset, tree, "Domain", NULL);
+ offset = dissect_nt_sid(tvb, offset, tree, "Domain", NULL, -1);
}
/* NT version */
};
-gboolean
+static void
dissect_smb_logon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
proto_tree *smb_logon_tree = NULL;
proto_item *item = NULL;
- if (!proto_is_protocol_enabled(proto_smb_logon))
- return FALSE;
-
- pinfo->current_proto = "NETLOGON";
-
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "NETLOGON");
if (check_col(pinfo->cinfo, COL_INFO))
offset = dissect_smb_unknown(tvb, pinfo, smb_logon_tree,
offset);
}
-
- return TRUE;
}
void
proto_register_field_array(proto_smb_logon, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ register_dissector("netlogon", dissect_smb_logon, proto_smb_logon);
}