aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-iec104.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-07-10 05:40:02 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-07-10 05:40:02 +0000
commit889d1f124e7a7da1a1158c994085796cf18a5aed (patch)
tree2594528c9243a64f966adba2909ae71bbc3ada94 /epan/dissectors/packet-iec104.c
parentaec691c11f9e8b000f2f1dabdc2964eabbc04dea (diff)
From Joan Ramio:
IEC 60870-5-104 dissector decodes nothing (new_tvb reported length bug) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3650 svn path=/trunk/; revision=29048
Diffstat (limited to 'epan/dissectors/packet-iec104.c')
-rw-r--r--epan/dissectors/packet-iec104.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-iec104.c b/epan/dissectors/packet-iec104.c
index cd2d103f1f..684398c8fc 100644
--- a/epan/dissectors/packet-iec104.c
+++ b/epan/dissectors/packet-iec104.c
@@ -76,6 +76,8 @@ static int proto_iec104asdu = -1;
/* Protocol constants */
#define APCI_START 0x68
#define APCI_LEN 6
+#define APCI_START_LEN 2
+#define APCI_DATA_LEN (APCI_LEN- APCI_START_LEN)
#define APDU_MIN_LEN 4
#define APDU_MAX_LEN 253
@@ -600,7 +602,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
if (check_col(pinfo->cinfo, COL_INFO)) {
col_add_str(pinfo->cinfo, COL_INFO, res->str);
if(apcih->Type == I_TYPE && Brossa != TcpLen) {
- call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_LEN), pinfo, tree);
+ call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_DATA_LEN), pinfo, tree);
} else {
col_set_fence(pinfo->cinfo, COL_INFO);
}
@@ -619,7 +621,7 @@ static void dissect_iec104apci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
/* Don't call ASDU dissector if it was called before */
if(apcih->Type == I_TYPE && (!check_col(pinfo->cinfo, COL_INFO))){
- call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_LEN), pinfo, tree);
+ call_dissector(iec104asdu_handle, tvb_new_subset(tvb, Off+ APCI_LEN, -1, apcih->ApduLen- APCI_DATA_LEN), pinfo, tree);
}
/* 'Packet Details': TREE */
@@ -675,7 +677,7 @@ proto_register_iec104apci(void)
};
proto_iec104apci = proto_register_protocol(
- "IEC 60870-5-104,Apci",
+ "IEC 60870-5-104-Apci",
"104apci",
"104apci"
);
@@ -736,7 +738,7 @@ proto_register_iec104asdu(void)
};
proto_iec104asdu = proto_register_protocol(
- "IEC 60870-5-104,Asdu",
+ "IEC 60870-5-104-Asdu",
"104asdu",
"104asdu"
);