* Routines for BACnet (APDU) dissection
* Copyright 2001, Hartmut Mueller <hartmut@abmlinux.org>, FH Dortmund
*
- * $Id: packet-bacapp.c,v 1.4 2001/06/18 02:17:44 guy Exp $
+ * $Id: packet-bacapp.c,v 1.10 2002/01/24 09:20:47 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
# include "snprintf.h"
#endif
-#include "packet.h"
+#include <epan/packet.h>
static const char*
bacapp_type_name (guint8 bacapp_type){
static gint ett_bacapp = -1;
+static dissector_handle_t data_handle;
+
static void
dissect_bacapp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
guint8 bacapp_type;
tvbuff_t *next_tvb;
- if (check_col(pinfo->fd, COL_PROTOCOL))
- col_set_str(pinfo->fd, COL_PROTOCOL, "BACnet-APDU");
- if (check_col(pinfo->fd, COL_INFO))
- col_add_str(pinfo->fd, COL_INFO, "BACnet APDU ");
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "BACnet-APDU");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_str(pinfo->cinfo, COL_INFO, "BACnet APDU ");
offset = 0;
bacapp_type = (tvb_get_guint8(tvb, offset) >> 4) & 0x0f;
- if (check_col(pinfo->fd, COL_INFO))
- col_append_fstr(pinfo->fd, COL_INFO, "(%s)",
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_append_fstr(pinfo->cinfo, COL_INFO, "(%s)",
bacapp_type_name(bacapp_type));
if (tree) {
- ti = proto_tree_add_item(tree, proto_bacapp, tvb, offset, tvb_length(tvb), FALSE);
+ ti = proto_tree_add_item(tree, proto_bacapp, tvb, offset, -1, FALSE);
bacapp_tree = proto_item_add_subtree(ti, ett_bacapp);
}
next_tvb = tvb_new_subset(tvb,offset,-1,-1);
- dissect_data(next_tvb, 0, pinfo, tree);
+ call_dissector(data_handle,next_tvb, pinfo, tree);
}
"BACapp", "bacapp");
proto_register_field_array(proto_bacapp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+ register_dissector("bacapp", dissect_bacapp, proto_bacapp);
}
+
void
proto_reg_handoff_bacapp(void)
{
- dissector_add("bacnet_control_net", 0, dissect_bacapp, proto_bacapp);
+ data_handle = find_dissector("data");
}
+