# include "config.h"
#endif
-#include <stdlib.h>
-
#include <glib.h>
#include <epan/packet.h>
guint8 bacnet_rportnum;
guint8 bacnet_pinfolen;
guint8 i;
- guint8 j;
tvbuff_t *next_tvb;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "BACnet-NPDU");
bacnet_rportnum = 0;
bacnet_pinfolen =0;
i = 0;
- j = 0;
/* I don't know the length of the NPDU yet; Setting the length after dissection */
- ti = proto_tree_add_item(tree, proto_bacnet, tvb, 0, -1, FALSE);
+ ti = proto_tree_add_item(tree, proto_bacnet, tvb, 0, -1, ENC_NA);
bacnet_tree = proto_item_add_subtree(ti, ett_bacnet);
offset ++;
if (bacnet_control & BAC_CONTROL_DEST) { /* DNET, DLEN, DADR */
proto_tree_add_item(bacnet_tree, hf_bacnet_dnet,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
bacnet_dlen = tvb_get_guint8(tvb, offset);
/* DLEN = 0 is broadcast on dest.network */
/* Ethernet MAC */
proto_tree_add_item(bacnet_tree,
hf_bacnet_dadr_eth, tvb, offset,
- bacnet_dlen, FALSE);
+ bacnet_dlen, ENC_NA);
offset += bacnet_dlen;
} else if (bacnet_dlen==1) {
proto_tree_add_uint(bacnet_tree, hf_bacnet_dlen,
/* MS/TP or ARCNET MAC */
proto_tree_add_item(bacnet_tree,
hf_bacnet_dadr_mstp, tvb, offset,
- bacnet_dlen, FALSE);
+ bacnet_dlen, ENC_BIG_ENDIAN);
offset += bacnet_dlen;
} else if (bacnet_dlen<7) {
proto_tree_add_uint(bacnet_tree, hf_bacnet_dlen,
/* Other MAC formats should be included here */
proto_tree_add_item(bacnet_tree,
hf_bacnet_dadr_tmp, tvb, offset,
- bacnet_dlen, FALSE);
+ bacnet_dlen, ENC_NA);
offset += bacnet_dlen;
} else {
proto_tree_add_uint_format_value(bacnet_tree,
/* Ethernet MAC */
proto_tree_add_item(bacnet_tree,
hf_bacnet_sadr_eth, tvb, offset,
- bacnet_slen, FALSE);
+ bacnet_slen, ENC_NA);
offset += bacnet_slen;
} else if (bacnet_slen==1) {
/* SLEN */
/* MS/TP or ARCNET MAC */
proto_tree_add_item(bacnet_tree,
hf_bacnet_sadr_mstp, tvb, offset,
- bacnet_slen, FALSE);
+ bacnet_slen, ENC_BIG_ENDIAN);
offset += bacnet_slen;
} else if (bacnet_slen<6) { /* LON MAC */
/* SLEN */
/* Other MAC formats should be included here */
proto_tree_add_item(bacnet_tree,
hf_bacnet_sadr_tmp, tvb, offset,
- bacnet_slen, FALSE);
+ bacnet_slen, ENC_NA);
offset += bacnet_slen;
} else {
proto_tree_add_uint_format_value(bacnet_tree,
}
if (bacnet_control & BAC_CONTROL_DEST) { /* Hopcount */
proto_tree_add_item(bacnet_tree, hf_bacnet_hopc,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
}
/* Network Layer Message Type */
*/
if (bacnet_mesgtyp > 0x7f) {
proto_tree_add_item(bacnet_tree, hf_bacnet_vendor,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
call_dissector(data_handle,
tvb_new_subset_remaining(tvb, offset), pinfo, tree);
/* Performance Index (in I-Could-Be-Router-To-Network) */
if (bacnet_mesgtyp == BAC_NET_ICB_R) {
proto_tree_add_item(bacnet_tree, hf_bacnet_dnet,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(bacnet_tree, hf_bacnet_perf,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
}
/* Reason, DNET (in Reject-Message-To-Network) */
bacnet_rejectreason_name(bacnet_rejectreason));
offset ++;
proto_tree_add_item(bacnet_tree, hf_bacnet_dnet,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
/* N*DNET (in Router-Busy-To-Network,Router-Available-To-Network) */
(bacnet_mesgtyp == BAC_NET_IAM_R) ) {
while(tvb_reported_length_remaining(tvb, offset) > 1 ) {
proto_tree_add_item(bacnet_tree, hf_bacnet_dnet,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
}
for(i=0; i<bacnet_rportnum; i++) {
/* Connected DNET */
proto_tree_add_item(bacnet_tree, hf_bacnet_dnet,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* Port ID */
proto_tree_add_item(bacnet_tree, hf_bacnet_portid,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
/* Port Info Length */
bacnet_pinfolen = tvb_get_guint8(tvb, offset);
/* Establish-Connection-To-Network */
if (bacnet_mesgtyp == BAC_NET_EST_CON) {
proto_tree_add_item(bacnet_tree, hf_bacnet_dnet,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(bacnet_tree, hf_bacnet_term_time_value,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
}
/* Disconnect-Connection-To-Network */
if (bacnet_mesgtyp == BAC_NET_DISC_CON) {
proto_tree_add_item(bacnet_tree, hf_bacnet_dnet,
- tvb, offset, 2, FALSE);
+ tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
}
dissector_handle_t bacnet_handle;
bacnet_handle = find_dissector("bacnet");
- dissector_add("bvlc.function", 0x04, bacnet_handle);
- dissector_add("bvlc.function", 0x09, bacnet_handle);
- dissector_add("bvlc.function", 0x0a, bacnet_handle);
- dissector_add("bvlc.function", 0x0b, bacnet_handle);
- dissector_add("llc.dsap", SAP_BACNET, bacnet_handle);
+ dissector_add_uint("bvlc.function", 0x04, bacnet_handle);
+ dissector_add_uint("bvlc.function", 0x09, bacnet_handle);
+ dissector_add_uint("bvlc.function", 0x0a, bacnet_handle);
+ dissector_add_uint("bvlc.function", 0x0b, bacnet_handle);
+ dissector_add_uint("llc.dsap", SAP_BACNET, bacnet_handle);
bacapp_handle = find_dissector("bacapp");
data_handle = find_dissector("data");
}