aboutsummaryrefslogtreecommitdiffstats
path: root/packet-bacnet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-12-08 06:41:48 +0000
committerGuy Harris <guy@alum.mit.edu>2001-12-08 06:41:48 +0000
commit75cc056222900115ffab82bd5e976cd359582dea (patch)
tree2553b2a2b59a716626785e76b2f2782370b8199a /packet-bacnet.c
parent421e391953575a91959ba2323a735958b45d80fe (diff)
Attach a descriptive name field type and base to dissector tables; that
specifies how the selector values used as keys in those tables are to be displayed, and the title to use when displaying the table. Use that information in the code to display the initial and current entries of various dissector tables. Have the dissector for BACnet APDUs register itself by name, and have the BACnet NPDU dissector call it iff the BAC_CONTROL_NET bit isn't set, rather than doing it with a dissector table. svn path=/trunk/; revision=4358
Diffstat (limited to 'packet-bacnet.c')
-rw-r--r--packet-bacnet.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/packet-bacnet.c b/packet-bacnet.c
index 5cc99c2ba1..6403636e95 100644
--- a/packet-bacnet.c
+++ b/packet-bacnet.c
@@ -2,7 +2,7 @@
* Routines for BACnet (NPDU) dissection
* Copyright 2001, Hartmut Mueller <hartmut@abmlinux.org>, FH Dortmund
*
- * $Id: packet-bacnet.c,v 1.6 2001/12/03 03:59:33 guy Exp $
+ * $Id: packet-bacnet.c,v 1.7 2001/12/08 06:41:41 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -49,7 +49,7 @@
#include "packet.h"
-static dissector_table_t bacnet_dissector_table;
+static dissector_handle_t bacapp_handle;
static dissector_handle_t data_handle;
static const char*
@@ -187,7 +187,6 @@ dissect_bacnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
gint offset;
guint8 bacnet_version;
guint8 bacnet_control;
- guint8 bacnet_control_net;
guint8 bacnet_dlen;
guint8 bacnet_slen;
guint8 bacnet_mesgtyp;
@@ -207,7 +206,6 @@ dissect_bacnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset = 0;
bacnet_version = tvb_get_guint8(tvb, offset);
bacnet_control = tvb_get_guint8(tvb, offset+1);
- bacnet_control_net = tvb_get_guint8(tvb, offset+1) & BAC_CONTROL_NET;
bacnet_dlen = 0;
bacnet_slen = 0;
bacnet_mesgtyp = 0;
@@ -424,11 +422,12 @@ dissect_bacnet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* dissect BACnet APDU
*/
next_tvb = tvb_new_subset(tvb,offset,-1,-1);
- /* Code from Guy Harris */
- if (!dissector_try_port(bacnet_dissector_table,
- bacnet_control_net, next_tvb, pinfo, tree)) {
+ if (bacnet_control & BAC_CONTROL_NET) {
/* Unknown function - dissect the payload as data */
- call_dissector(data_handle,next_tvb, pinfo, tree);
+ call_dissector(data_handle, next_tvb, pinfo, tree);
+ } else {
+ /* APDU - call the APDU dissector */
+ call_dissector(bacapp_handle, next_tvb, pinfo, tree);
}
}
@@ -593,7 +592,6 @@ proto_register_bacnet(void)
proto_register_subtree_array(ett, array_length(ett));
register_dissector("bacnet", dissect_bacnet, proto_bacnet);
- bacnet_dissector_table = register_dissector_table("bacnet_control_net");
}
void
@@ -606,5 +604,6 @@ proto_reg_handoff_bacnet(void)
dissector_add("bvlc.function", 0x09, bacnet_handle);
dissector_add("bvlc.function", 0x0a, bacnet_handle);
dissector_add("bvlc.function", 0x0b, bacnet_handle);
+ bacapp_handle = find_dissector("bacapp");
data_handle = find_dissector("data");
}