Indicate where BACnet MS/TP is specified.

Add a new WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR encapsulation type, for use
by the EyeSDN file reader; unlike the pcap-encapsulated MS/TP, it
includes a direction indicator.  Don't treat WTAP_ENCAP_BACNET_MS_TP as
if it has a direction indicator, as it doesn't; instead, do that for
WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR.

Add some missing entries to encap_table_base for WTAP_ENCAP_ values that
didn't get entries added.

svn path=/trunk/; revision=41969
This commit is contained in:
Guy Harris 2012-04-06 03:42:32 +00:00
parent 1db28ae469
commit 154c0f37dd
5 changed files with 24 additions and 5 deletions

View File

@ -159,7 +159,7 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
case WTAP_ENCAP_ISDN:
case WTAP_ENCAP_V5_EF:
case WTAP_ENCAP_DPNSS:
case WTAP_ENCAP_BACNET_MS_TP:
case WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR:
pinfo->p2p_dir = pinfo->pseudo_header->isdn.uton ?
P2P_DIR_SENT : P2P_DIR_RECV;
break;

View File

@ -2,6 +2,14 @@
* Routines for BACnet MS/TP datalink dissection
* Copyright 2008 Steve Karg <skarg@users.sourceforge.net> Alabama
*
* This is described in Clause 9 of ANSI/ASHRAE Standard 135-2004,
* BACnet - A Data Communication Protocol for Building Automation
* and Contrl Networks; clause 9 "describes a Master-Slave/Token-Passing
* (MS/TP) data link protocol, which provides the same services to the
* network layer as ISO 8802-2 Logical Link Control. It uses services
* provided by the EIA-485 physical layer." See section 9.3 for the
* frame format.
*
* $Id$
*
* Wireshark - Network traffic analyzer
@ -434,6 +442,7 @@ proto_reg_handoff_mstp(void)
mstp_handle = find_dissector("mstp");
dissector_add_uint("wtap_encap", WTAP_ENCAP_BACNET_MS_TP, mstp_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR, mstp_handle);
bacnet_handle = find_dissector("bacnet");
data_handle = find_dissector("data");

View File

@ -354,7 +354,7 @@ parse_eyesdn_rec_hdr(wtap *wth, FILE_T fh,
pseudo_header->isdn.uton = direction & 1;
pseudo_header->isdn.channel = channel;
if(wth) {
wth->phdr.pkt_encap = WTAP_ENCAP_BACNET_MS_TP;
wth->phdr.pkt_encap = WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR;
}
break;
@ -460,7 +460,7 @@ int eyesdn_dump_can_write_encap(int encap)
case WTAP_ENCAP_ATM_PDUS_UNTRUNCATED:
case WTAP_ENCAP_LAPB:
case WTAP_ENCAP_MTP2_WITH_PHDR:
case WTAP_ENCAP_BACNET_MS_TP:
case WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR:
case WTAP_ENCAP_PER_PACKET:
return 0;
@ -524,7 +524,7 @@ static gboolean eyesdn_dump(wtap_dumper *wdh,
protocol=EYESDN_ENCAP_MTP2;
break;
case WTAP_ENCAP_BACNET_MS_TP:
case WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR:
protocol=EYESDN_ENCAP_BACNET;
break;

View File

@ -564,7 +564,16 @@ static struct encap_type_info encap_table_base[] = {
{ "PPP-over-Ethernet session", "pppoes" },
/* WTAP_ENCAP_NFC_LLCP */
{ "LLCP", "llcp" }
{ "NFC LLCP", "nfc-llcp" },
/* WTAP_ENCAP_NFLOG */
{ "NFLOG", "nflog" },
/* WTAP_ENCAP_V5_EF */
{ "V5 Enveope Function", "v5-ef" },
/* WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR */
{ "BACnet MS/TP with Directional Info", "bacnet-ms-tp-with-direction" },
};
gint wtap_num_encap_types = sizeof(encap_table_base) / sizeof(struct encap_type_info);

View File

@ -232,6 +232,7 @@ extern "C" {
#define WTAP_ENCAP_NFC_LLCP 140
#define WTAP_ENCAP_NFLOG 141
#define WTAP_ENCAP_V5_EF 142
#define WTAP_ENCAP_BACNET_MS_TP_WITH_PHDR 143
#define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types()