aboutsummaryrefslogtreecommitdiffstats
path: root/packet-atalk.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2003-11-16 23:17:27 +0000
committerGuy Harris <guy@alum.mit.edu>2003-11-16 23:17:27 +0000
commit7bd2e232a9994756ba0f97d4d93ce64fe885e7df (patch)
tree564e732958fa7b21a0ce2aaf6f0123b674ea3a71 /packet-atalk.c
parent21313199e4282797e5cbebb039c417cf8fca739f (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-atalk.c')
-rw-r--r--packet-atalk.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/packet-atalk.c b/packet-atalk.c
index 05d9a317d4..6ede79e757 100644
--- a/packet-atalk.c
+++ b/packet-atalk.c
@@ -2,7 +2,7 @@
* Routines for AppleTalk packet disassembly: LLAP, DDP, NBP, ATP, ASP,
* RTMP.
*
- * $Id: packet-atalk.c,v 1.90 2003/09/21 20:05:59 gerald Exp $
+ * $Id: packet-atalk.c,v 1.91 2003/11/16 23:17:16 guy Exp $
*
* Simon Wilkinson <sxw@dcs.ed.ac.uk>
*
@@ -73,6 +73,7 @@ static int hf_ddp_dst_socket = -1;
static int hf_ddp_src_socket = -1;
static int hf_ddp_type = -1;
+static dissector_handle_t ddp_handle;
/* --------------------------------------
* ATP protocol parameters
@@ -1691,18 +1692,18 @@ dissect_llap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
new_tvb = tvb_new_subset(tvb, 3, -1, -1);
- if (proto_is_protocol_enabled(proto_ddp)) {
- pinfo->current_proto = "DDP";
- switch (type) {
+ switch (type) {
- case 0x01:
+ case 0x01:
+ if (proto_is_protocol_enabled(find_protocol_by_id(proto_ddp))) {
+ pinfo->current_proto = "DDP";
dissect_ddp_short(new_tvb, pinfo, dnode, snode, tree);
return;
+ }
- case 0x02:
- dissect_ddp(new_tvb, pinfo, tree);
+ case 0x02:
+ if (call_dissector(ddp_handle, new_tvb, pinfo, tree))
return;
- }
}
call_dissector(data_handle,new_tvb, pinfo, tree);
}
@@ -2254,7 +2255,7 @@ proto_register_atalk(void)
void
proto_reg_handoff_atalk(void)
{
- dissector_handle_t ddp_handle, nbp_handle, rtmp_request_handle;
+ dissector_handle_t nbp_handle, rtmp_request_handle;
dissector_handle_t atp_handle;
dissector_handle_t zip_ddp_handle;
dissector_handle_t rtmp_data_handle, llap_handle;