IEC104: Added Counter integrrogation command qualifier dissection

This commit is contained in:
Jiří Engelthaler 2021-08-27 13:30:07 +02:00 committed by Wireshark GitLab Utility
parent 3cb6403a4c
commit 40aebad079
1 changed files with 56 additions and 0 deletions

View File

@ -620,6 +620,24 @@ static const value_string qoi_r_types[] = {
{ 0, NULL }
};
static const value_string rqt_r_types[] = {
{ 0, "Not specified" },
{ 1, "Group 1 counter interrogation" },
{ 2, "Group 2 counter interrogation" },
{ 3, "Group 3 counter interrogation" },
{ 4, "Group 4 counter interrogation" },
{ 5, "General counter interrogation" },
{ 0, NULL }
};
static const value_string frz_r_types[] = {
{ 0, "Read only (no freeze or reset)" },
{ 1, "Counter freeze without reset (value frozen represents integrated total)" },
{ 2, "Counter freeze with reset (value frozen represents incremental information)" },
{ 3, "Counter reset" },
{ 0, NULL }
};
static const value_string qrp_r_types[] = {
{ 0, "Not used" },
{ 1, "General reset of process" },
@ -717,6 +735,9 @@ static int hf_coi = -1;
static int hf_coi_r = -1;
static int hf_coi_i = -1;
static int hf_qoi = -1;
static int hf_qcc = -1;
static int hf_qcc_rqt = -1;
static int hf_qcc_frz = -1;
static int hf_qrp = -1;
static int hf_bcr_count = -1;
static int hf_bcr_sq = -1;
@ -744,6 +765,7 @@ static gint ett_dco = -1;
static gint ett_rco = -1;
static gint ett_qpm = -1;
static gint ett_coi = -1;
static gint ett_qcc = -1;
static gint ett_cp24time = -1;
static gint ett_cp56time = -1;
@ -1568,6 +1590,23 @@ static void get_QOI(tvbuff_t *tvb, guint8 *offset, proto_tree *iec104_header_tre
(*offset)++;
}
/* ====================================================================
QCC: Qualifier of counter interrogation
==================================================================== */
static void get_QCC(tvbuff_t *tvb, guint8 *offset, proto_tree *iec104_header_tree)
{
proto_item* ti;
proto_tree* qcc_tree;
ti = proto_tree_add_item(iec104_header_tree, hf_qcc, tvb, *offset, 1, ENC_LITTLE_ENDIAN);
qcc_tree = proto_item_add_subtree(ti, ett_qcc);
proto_tree_add_item(qcc_tree, hf_qcc_rqt, tvb, *offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(qcc_tree, hf_qcc_frz, tvb, *offset, 1, ENC_LITTLE_ENDIAN);
(*offset)++;
}
/* ====================================================================
QRP: Qualifier of reset process command
==================================================================== */
@ -1745,6 +1784,7 @@ static int dissect_iec60870_asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
case C_BO_TA_1:
case M_EI_NA_1:
case C_IC_NA_1:
case C_CI_NA_1:
case C_CS_NA_1:
case C_RP_NA_1:
case P_ME_NA_1:
@ -1967,6 +2007,9 @@ static int dissect_iec60870_asdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
case C_IC_NA_1: /* 100 Interrogation command */
get_QOI(tvb, &offset, trSignal);
break;
case C_CI_NA_1: /* 101 Counter interrogation command */
get_QCC(tvb, &offset, trSignal);
break;
case C_CS_NA_1: /* 103 Clock synchronization command */
get_CP56Time(tvb, &offset, trSignal);
break;
@ -2539,6 +2582,18 @@ proto_register_iec60870_asdu(void)
{ "QOI", "iec60870_asdu.qoi", FT_UINT8, BASE_DEC, VALS(qoi_r_types), 0,
NULL, HFILL }},
{ &hf_qcc,
{ "QCC", "iec60870_asdu.qcc", FT_UINT8, BASE_HEX, NULL, 0,
NULL, HFILL } },
{ &hf_qcc_rqt,
{ "RQT", "iec60870_asdu.rqt", FT_UINT8, BASE_DEC, VALS(rqt_r_types), 0x3F,
NULL, HFILL } },
{ &hf_qcc_frz,
{ "FRZ", "iec60870_asdu.frz", FT_UINT8, BASE_DEC, VALS(frz_r_types), 0xC0,
NULL, HFILL } },
{ &hf_qrp,
{ "QRP", "iec60870_asdu.qrp", FT_UINT8, BASE_DEC, VALS(qrp_r_types), 0,
NULL, HFILL }},
@ -2601,6 +2656,7 @@ proto_register_iec60870_asdu(void)
&ett_rco,
&ett_qpm,
&ett_coi,
&ett_qcc,
&ett_cp24time,
&ett_cp56time
};