diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-11-16 23:17:27 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-11-16 23:17:27 +0000 |
commit | 7bd2e232a9994756ba0f97d4d93ce64fe885e7df (patch) | |
tree | 564e732958fa7b21a0ce2aaf6f0123b674ea3a71 /packet-smb-browse.c | |
parent | 21313199e4282797e5cbebb039c417cf8fca739f (diff) |
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
Diffstat (limited to 'packet-smb-browse.c')
-rw-r--r-- | packet-smb-browse.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/packet-smb-browse.c b/packet-smb-browse.c index 9f5f424f3c..2c864f0030 100644 --- a/packet-smb-browse.c +++ b/packet-smb-browse.c @@ -2,7 +2,7 @@ * Routines for SMB Browser packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-smb-browse.c,v 1.32 2003/09/03 20:58:09 guy Exp $ + * $Id: packet-smb-browse.c,v 1.33 2003/11/16 23:17:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -563,7 +563,7 @@ dissect_smb_server_type_flags(tvbuff_t *tvb, int offset, packet_info *pinfo, } -gboolean +static gboolean dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { int offset = 0; @@ -577,12 +577,6 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr int i; guint32 uptime; - if (!proto_is_protocol_enabled(proto_smb_browse)) { - return FALSE; - } - - pinfo->current_proto = "BROWSER"; - if (check_col(pinfo->cinfo, COL_PROTOCOL)) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "BROWSER"); } @@ -820,7 +814,7 @@ dissect_mailslot_browse(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr * * XXX - what other browser packets go out to that mailslot? */ -gboolean +static gboolean dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) { int offset = 0; @@ -831,12 +825,6 @@ dissect_mailslot_lanman(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tr const char *host_name; guint namelen; - if (!proto_is_protocol_enabled(proto_smb_browse)) { - return FALSE; - } - - pinfo->current_proto = "BROWSER"; - if (check_col(pinfo->cinfo, COL_PROTOCOL)) { col_set_str(pinfo->cinfo, COL_PROTOCOL, "BROWSER"); } @@ -1175,4 +1163,9 @@ proto_register_smb_browse(void) proto_register_field_array(proto_smb_browse, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + new_register_dissector("mailslot_browse", dissect_mailslot_browse, + proto_smb_browse); + new_register_dissector("mailslot_lanman", dissect_mailslot_lanman, + proto_smb_browse); } |