From 7bd2e232a9994756ba0f97d4d93ce64fe885e7df Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 16 Nov 2003 23:17:27 +0000 Subject: Export "protocol_t" as an opaque type. Make "proto_is_protocol_enabled()" and "proto_get_protocol_short_name()" take a "protocol_t *" as an argument, so they don't have to look up the "protocol_t" - this will probably speed them up considerably, and they're called on almost every dissector handoff. Get rid of a number of "proto_is_protocol_enabled()" calls that aren't necessary (dissectors called through handles, including those called through dissector tables, or called as heuristic dissectors, aren't even called if their protocol isn't enabled). Change some direct dissector calls to go through handles. svn path=/trunk/; revision=8979 --- packet-smb-logon.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'packet-smb-logon.c') diff --git a/packet-smb-logon.c b/packet-smb-logon.c index a927de74f7..b995af6eab 100644 --- a/packet-smb-logon.c +++ b/packet-smb-logon.c @@ -2,7 +2,7 @@ * Routines for SMB net logon packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-smb-logon.c,v 1.34 2003/06/12 08:33:30 guy Exp $ + * $Id: packet-smb-logon.c,v 1.35 2003/11/16 23:17:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -26,7 +26,6 @@ */ #include "packet-smb-common.h" -#include "packet-smb-logon.h" static int proto_smb_logon = -1; static int hf_command = -1; @@ -815,7 +814,7 @@ static int (*dissect_smb_logon_cmds[])(tvbuff_t *tvb, packet_info *pinfo, proto_ }; -gboolean +static gboolean dissect_smb_logon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { int offset = 0; @@ -823,11 +822,6 @@ dissect_smb_logon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) 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)) @@ -1035,4 +1029,6 @@ proto_register_smb_logon( void) proto_register_field_array(proto_smb_logon, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + new_register_dissector("netlogon", dissect_smb_logon, proto_smb_logon); } -- cgit v1.2.3