aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-selfm.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-07-06 00:01:59 +0000
committerEvan Huus <eapache@gmail.com>2013-07-06 00:01:59 +0000
commit599d9949385d60fd20b83180e61f7fdcfe971eea (patch)
treefb6bef94f271a5dd528a55d58a68a8e4cf7fecb0 /epan/dissectors/packet-selfm.c
parent880e19ac3d8e1b14448c3729af2ca2c62879a25f (diff)
From Chris Bontje via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8860
Numerous changes and fixes to the selfm dissector. Too many to bother listing here, see the bug for full details. svn path=/trunk/; revision=50394
Diffstat (limited to 'epan/dissectors/packet-selfm.c')
-rw-r--r--epan/dissectors/packet-selfm.c2139
1 files changed, 1312 insertions, 827 deletions
diff --git a/epan/dissectors/packet-selfm.c b/epan/dissectors/packet-selfm.c
index c500de5828..9e12e5ffa9 100644
--- a/epan/dissectors/packet-selfm.c
+++ b/epan/dissectors/packet-selfm.c
@@ -4,46 +4,7 @@
* Copyright Nov/Dec 2012,
*
* $Id$
- *
- * Schweitzer Engineering Labs manufactures and sells digital protective relay equipment for
- * use in industrial high-voltage installations. SEL FM protocol evolved over time as a
- * (semi)proprietary method for auto-configuration of connected SEL devices for retrieval of
- * analog and digital status data. The protocol itself supports embedded binary messages
- * (which are what this dissector looks for) slip-streamed in the data stream with normal
- * ASCII text data. A combination of both are used for full auto-configuration of devices,
- * but a wealth of information can be extracted from the binary messages alone.
- *
- * Documentation on Fast Meter and Fast SER messages available from www.selinc.com in
- * SEL Application Guides AG95-10_20091109.pdf and AG_200214.pdf
- ************************************************************************************************
- * Dissector Notes:
- *
- * 1) SEL Fast Message protocol over TCP is normally tunneled via a Telnet connection. As Telnet
- * has special handling for the 0xFF character ("IAC"), normally a pair of 0xFF's are inserted
- * to represent an actual payload byte of 0xFF. A function from the packet-telnet.c dissector has
- * been borrowed to automatically pre-process any Ethernet-based packet and remove these 'extra'
- * 0xFF bytes. Wireshark Notes on Telnet 0xFF doubling are discussed here:
- * http://www.wireshark.org/lists/wireshark-bugs/201204/msg00198.html
- *
- * 2) As the presence of 0xFF pad bytes can render the "length" byte of a response message inaccurate
- * (as the 'length' does not compensate for these extra bytes) it can be difficult to accurately determine
- * the proper length of a message when attempting to do TCP reassembly. The get_selfm_len function
- * does a best-guess, based on evidence observed from multiple packet captures from different devices.
- * What would be ideal would be to:
- * a) Attempt initial PDU re-assembly based on length byte
- * b) Detect if a 0xFF pair is found in the payload and add 1 byte to the PDU length
- * c) Continue re-assembly based on revised length.
- * d) Once full re-assembly of (actual length) TCP data is done, pass off full frame to selfm
- * dissector to have 0xFF pairs stripped and the protocol dissected as per normal.
- * I'm not sure if tcp_dissect_pdus already supports this functionality, but I didn't see any examples?
- *
- * 3) Generally, the auto-configuration process itself will exchange several "configuration" messages
- * that describe various data regions (METER, DEMAND, PEAK, etc) that will later have corresponding
- * "data" messages. This dissector code will currently save and accurately retrieve one set of these
- * exchanges (0xA5C1, 0xA5D1, "METER" region) using the GArray and conversation functions built into
- * Wireshark. That said, a future modification would be nice to capture and retrieve multiple sets
- * of configuration messages to be able to decode all the different "data" messages encountered in
- * future exchanges.
+
*
************************************************************************************************
* Wireshark - Network traffic analyzer
@@ -63,6 +24,37 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ ************************************************************************************************
+ * Schweitzer Engineering Labs ("SEL") manufactures and sells digital protective relay equipment
+ * for use in industrial high-voltage installations. SEL FM protocol evolved over time as a
+ * (semi)proprietary method for auto-configuration of connected SEL devices for retrieval of
+ * analog and digital status data. The protocol itself supports embedded binary messages
+ * (which are what this dissector looks for) slip-streamed in the data stream with normal
+ * ASCII text data. A combination of both are used for full auto-configuration of devices,
+ * but a wealth of information can be extracted from the binary messages alone.
+ *
+ * Documentation on Fast Meter and Fast SER messages available from www.selinc.com in
+ * SEL Application Guides AG95-10_20091109.pdf and AG_200214.pdf
+ ************************************************************************************************
+ * Dissector Notes:
+ *
+ * 1) SEL Fast Message protocol over TCP is normally tunneled via a Telnet connection. As Telnet
+ * has special handling for the 0xFF character ("IAC"), normally a pair of 0xFF's are inserted
+ * to represent an actual payload byte of 0xFF. A function from the packet-telnet.c dissector has
+ * been borrowed to automatically pre-process any Ethernet-based packet and remove these 'extra'
+ * 0xFF bytes. Wireshark Notes on Telnet 0xFF doubling are discussed here:
+ * http://www.wireshark.org/lists/wireshark-bugs/201204/msg00198.html
+ *
+ * 2) The auto-configuration process itself will exchange several "configuration" messages that
+ * describe various data regions (METER, DEMAND, PEAK, etc) that will later have corresponding
+ * "data" messages. This dissector code will currently save and accurately retrieve the 3 sets
+ * of these exchanges:
+ * 0xA5C1, 0xA5D1, "METER" region
+ * 0xA5C2, 0xA5D2, "DEMAND" region
+ * 0xA5C3, 0xA5D3, "PEAK" region
+ * The configuration messages are stored in structs that are managed using the wmem library and
+ * the Wireshark conversation functionality.
*/
#include "config.h"
@@ -70,103 +62,142 @@
#include <epan/packet.h>
#include "packet-tcp.h"
#include <epan/prefs.h>
+#include <epan/reassemble.h>
#include <epan/expert.h>
#include <epan/conversation.h>
#include <epan/wmem/wmem.h>
/* Initialize the protocol and registered fields */
-static int proto_selfm = -1;
-static int hf_selfm_msgtype = -1;
-static int hf_selfm_relaydef_len = -1;
-static int hf_selfm_relaydef_numproto = -1;
-static int hf_selfm_relaydef_numfm = -1;
-static int hf_selfm_relaydef_numflags = -1;
-static int hf_selfm_relaydef_fmcfg_cmd = -1;
-static int hf_selfm_relaydef_fmdata_cmd = -1;
-static int hf_selfm_relaydef_statbit = -1;
-static int hf_selfm_relaydef_statbit_cmd = -1;
-static int hf_selfm_relaydef_proto = -1;
-static int hf_selfm_fmconfig_len = -1;
-static int hf_selfm_fmconfig_numflags = -1;
-static int hf_selfm_fmconfig_loc_sf = -1;
-static int hf_selfm_fmconfig_num_sf = -1;
-static int hf_selfm_fmconfig_num_ai = -1;
-static int hf_selfm_fmconfig_num_samp = -1;
-static int hf_selfm_fmconfig_num_dig = -1;
-static int hf_selfm_fmconfig_num_calc = -1;
-static int hf_selfm_fmconfig_ofs_ai = -1;
-static int hf_selfm_fmconfig_ofs_ts = -1;
-static int hf_selfm_fmconfig_ofs_dig = -1;
-static int hf_selfm_fmconfig_ai_type = -1;
-static int hf_selfm_fmconfig_ai_sf_type = -1;
-static int hf_selfm_fmconfig_ai_sf_ofs = -1;
-static int hf_selfm_fmdata_len = -1;
-static int hf_selfm_fmdata_flagbyte = -1;
-static int hf_selfm_fmdata_dig_b0 = -1;
-static int hf_selfm_fmdata_dig_b1 = -1;
-static int hf_selfm_fmdata_dig_b2 = -1;
-static int hf_selfm_fmdata_dig_b3 = -1;
-static int hf_selfm_fmdata_dig_b4 = -1;
-static int hf_selfm_fmdata_dig_b5 = -1;
-static int hf_selfm_fmdata_dig_b6 = -1;
-static int hf_selfm_fmdata_dig_b7 = -1;
-static int hf_selfm_fmdata_ai_sf_fp = -1;
-static int hf_selfm_foconfig_len = -1;
-static int hf_selfm_foconfig_num_brkr = -1;
-static int hf_selfm_foconfig_num_rb = -1;
-static int hf_selfm_foconfig_prb_supp = -1;
-static int hf_selfm_foconfig_reserved = -1;
-static int hf_selfm_foconfig_brkr_open = -1;
-static int hf_selfm_foconfig_brkr_close = -1;
-static int hf_selfm_foconfig_rb_cmd = -1;
-static int hf_selfm_fastop_len = -1;
-static int hf_selfm_fastop_rb_code = -1;
-static int hf_selfm_fastop_br_code = -1;
-static int hf_selfm_fastop_valid = -1;
-
-static int hf_selfm_fastser_len = -1;
-static int hf_selfm_fastser_routing_addr = -1;
-static int hf_selfm_fastser_status = -1;
-static int hf_selfm_fastser_funccode = -1;
-static int hf_selfm_fastser_seq = -1;
-static int hf_selfm_fastser_seq_fir = -1;
-static int hf_selfm_fastser_seq_fin = -1;
-static int hf_selfm_fastser_seq_cnt = -1;
-static int hf_selfm_fastser_resp_num = -1;
-static int hf_selfm_fastser_crc16 = -1;
-static int hf_selfm_fastser_def_route_sup = -1;
-static int hf_selfm_fastser_def_rx_stat = -1;
-static int hf_selfm_fastser_def_tx_stat = -1;
-static int hf_selfm_fastser_def_rx_maxfr = -1;
-static int hf_selfm_fastser_def_tx_maxfr = -1;
-static int hf_selfm_fastser_def_rx_num_fc = -1;
-static int hf_selfm_fastser_def_rx_fc = -1;
-static int hf_selfm_fastser_def_tx_num_fc = -1;
-static int hf_selfm_fastser_def_tx_fc = -1;
-static int hf_selfm_fastser_uns_en_fc = -1;
-static int hf_selfm_fastser_uns_en_fc_data = -1;
-static int hf_selfm_fastser_uns_dis_fc = -1;
-static int hf_selfm_fastser_uns_dis_fc_data = -1;
-static int hf_selfm_fastser_read_baseaddr = -1;
-static int hf_selfm_fastser_read_numaddr = -1;
-static int hf_selfm_fastser_datafmt_resp_num_tag = -1;
-static int hf_selfm_fastser_datafmt_resp_tag_qty = -1;
-static int hf_selfm_fastser_datafmt_resp_tag_type = -1;
-static int hf_selfm_fastser_devdesc_num_reg = -1;
-static int hf_selfm_fastser_unsresp_orig = -1;
-static int hf_selfm_fastser_unsresp_doy = -1;
-static int hf_selfm_fastser_unsresp_year = -1;
-static int hf_selfm_fastser_unsresp_todms = -1;
-static int hf_selfm_fastser_unsresp_num_elmt = -1;
-static int hf_selfm_fastser_unsresp_elmt_idx = -1;
-static int hf_selfm_fastser_unsresp_elmt_ts_ofs = -1;
-static int hf_selfm_fastser_unsresp_elmt_status = -1;
-static int hf_selfm_fastser_unsresp_eor = -1;
-static int hf_selfm_fastser_unsresp_elmt_statword = -1;
-static int hf_selfm_fastser_unswrite_addr1 = -1;
-static int hf_selfm_fastser_unswrite_addr2 = -1;
-static int hf_selfm_fastser_unswrite_num_reg = -1;
-static int hf_selfm_fastser_unswrite_reg_val = -1;
+static int proto_selfm = -1;
+static int hf_selfm_msgtype = -1;
+static int hf_selfm_relaydef_len = -1;
+static int hf_selfm_relaydef_numproto = -1;
+static int hf_selfm_relaydef_numfm = -1;
+static int hf_selfm_relaydef_numflags = -1;
+static int hf_selfm_relaydef_fmcfg_cmd = -1;
+static int hf_selfm_relaydef_fmdata_cmd = -1;
+static int hf_selfm_relaydef_statbit = -1;
+static int hf_selfm_relaydef_statbit_cmd = -1;
+static int hf_selfm_relaydef_proto = -1;
+static int hf_selfm_fmconfig_len = -1;
+static int hf_selfm_fmconfig_numflags = -1;
+static int hf_selfm_fmconfig_loc_sf = -1;
+static int hf_selfm_fmconfig_num_sf = -1;
+static int hf_selfm_fmconfig_num_ai = -1;
+static int hf_selfm_fmconfig_num_samp = -1;
+static int hf_selfm_fmconfig_num_dig = -1;
+static int hf_selfm_fmconfig_num_calc = -1;
+static int hf_selfm_fmconfig_ofs_ai = -1;
+static int hf_selfm_fmconfig_ofs_ts = -1;
+static int hf_selfm_fmconfig_ofs_dig = -1;
+static int hf_selfm_fmconfig_ai_type = -1;
+static int hf_selfm_fmconfig_ai_sf_type = -1;
+static int hf_selfm_fmconfig_ai_sf_ofs = -1;
+static int hf_selfm_fmconfig_cblk_rot = -1;
+static int hf_selfm_fmconfig_cblk_vconn = -1;
+static int hf_selfm_fmconfig_cblk_iconn = -1;
+static int hf_selfm_fmconfig_cblk_ctype = -1;
+static int hf_selfm_fmconfig_cblk_deskew_ofs = -1;
+static int hf_selfm_fmconfig_cblk_rs_ofs = -1;
+static int hf_selfm_fmconfig_cblk_xs_ofs = -1;
+static int hf_selfm_fmconfig_cblk_ia_idx = -1;
+static int hf_selfm_fmconfig_cblk_ib_idx = -1;
+static int hf_selfm_fmconfig_cblk_ic_idx = -1;
+static int hf_selfm_fmconfig_cblk_va_idx = -1;
+static int hf_selfm_fmconfig_cblk_vb_idx = -1;
+static int hf_selfm_fmconfig_cblk_vc_idx = -1;
+static int hf_selfm_fmdata_len = -1;
+static int hf_selfm_fmdata_flagbyte = -1;
+static int hf_selfm_fmdata_dig_b0 = -1;
+static int hf_selfm_fmdata_dig_b1 = -1;
+static int hf_selfm_fmdata_dig_b2 = -1;
+static int hf_selfm_fmdata_dig_b3 = -1;
+static int hf_selfm_fmdata_dig_b4 = -1;
+static int hf_selfm_fmdata_dig_b5 = -1;
+static int hf_selfm_fmdata_dig_b6 = -1;
+static int hf_selfm_fmdata_dig_b7 = -1;
+static int hf_selfm_fmdata_ai_sf_fp = -1;
+static int hf_selfm_foconfig_len = -1;
+static int hf_selfm_foconfig_num_brkr = -1;
+static int hf_selfm_foconfig_num_rb = -1;
+static int hf_selfm_foconfig_prb_supp = -1;
+static int hf_selfm_foconfig_reserved = -1;
+static int hf_selfm_foconfig_brkr_open = -1;
+static int hf_selfm_foconfig_brkr_close = -1;
+static int hf_selfm_foconfig_rb_cmd = -1;
+static int hf_selfm_fastop_len = -1;
+static int hf_selfm_fastop_rb_code = -1;
+static int hf_selfm_fastop_br_code = -1;
+static int hf_selfm_fastop_valid = -1;
+static int hf_selfm_alt_foconfig_len = -1;
+static int hf_selfm_alt_foconfig_num_ports = -1;
+static int hf_selfm_alt_foconfig_num_brkr = -1;
+static int hf_selfm_alt_foconfig_num_rb = -1;
+static int hf_selfm_alt_foconfig_funccode = -1;
+static int hf_selfm_alt_fastop_len = -1;
+static int hf_selfm_alt_fastop_code = -1;
+static int hf_selfm_alt_fastop_valid = -1;
+
+static int hf_selfm_fastser_len = -1;
+static int hf_selfm_fastser_routing_addr = -1;
+static int hf_selfm_fastser_status = -1;
+static int hf_selfm_fastser_funccode = -1;
+static int hf_selfm_fastser_seq = -1;
+static int hf_selfm_fastser_seq_fir = -1;
+static int hf_selfm_fastser_seq_fin = -1;
+static int hf_selfm_fastser_seq_cnt = -1;
+static int hf_selfm_fastser_resp_num = -1;
+static int hf_selfm_fastser_crc16 = -1;
+static int hf_selfm_fastser_def_route_sup = -1;
+static int hf_selfm_fastser_def_rx_stat = -1;
+static int hf_selfm_fastser_def_tx_stat = -1;
+static int hf_selfm_fastser_def_rx_maxfr = -1;
+static int hf_selfm_fastser_def_tx_maxfr = -1;
+static int hf_selfm_fastser_def_rx_num_fc = -1;
+static int hf_selfm_fastser_def_rx_fc = -1;
+static int hf_selfm_fastser_def_tx_num_fc = -1;
+static int hf_selfm_fastser_def_tx_fc = -1;
+static int hf_selfm_fastser_uns_en_fc = -1;
+static int hf_selfm_fastser_uns_en_fc_data = -1;
+static int hf_selfm_fastser_uns_dis_fc = -1;
+static int hf_selfm_fastser_uns_dis_fc_data = -1;
+static int hf_selfm_fastser_baseaddr = -1;
+static int hf_selfm_fastser_numwords = -1;
+static int hf_selfm_fastser_flags = -1;
+static int hf_selfm_fastser_datafmt_resp_numitem = -1;
+static int hf_selfm_fastser_dataitem_qty = -1;
+static int hf_selfm_fastser_dataitem_type = -1;
+static int hf_selfm_fastser_dataitem_uint16 = -1;
+static int hf_selfm_fastser_dataitem_int16 = -1;
+static int hf_selfm_fastser_dataitem_uint32 = -1;
+static int hf_selfm_fastser_dataitem_int32 = -1;
+static int hf_selfm_fastser_dataitem_float = -1;
+static int hf_selfm_fastser_devdesc_num_region = -1;
+static int hf_selfm_fastser_devdesc_num_ctrl = -1;
+static int hf_selfm_fastser_unsresp_orig = -1;
+static int hf_selfm_fastser_unsresp_doy = -1;
+static int hf_selfm_fastser_unsresp_year = -1;
+static int hf_selfm_fastser_unsresp_todms = -1;
+static int hf_selfm_fastser_unsresp_num_elmt = -1;
+static int hf_selfm_fastser_unsresp_elmt_idx = -1;
+static int hf_selfm_fastser_unsresp_elmt_ts_ofs = -1;
+static int hf_selfm_fastser_unsresp_elmt_status = -1;
+static int hf_selfm_fastser_unsresp_eor = -1;
+static int hf_selfm_fastser_unsresp_elmt_statword = -1;
+static int hf_selfm_fastser_unswrite_addr1 = -1;
+static int hf_selfm_fastser_unswrite_addr2 = -1;
+static int hf_selfm_fastser_unswrite_num_reg = -1;
+static int hf_selfm_fastser_unswrite_reg_val = -1;
+static int hf_selfm_fastser_soe_req_orig = -1;
+static int hf_selfm_fastser_soe_resp_numblks = -1;
+static int hf_selfm_fastser_soe_resp_orig = -1;
+static int hf_selfm_fastser_soe_resp_numbits = -1;
+static int hf_selfm_fastser_soe_resp_pad = -1;
+static int hf_selfm_fastser_soe_resp_doy = -1;
+static int hf_selfm_fastser_soe_resp_year = -1;
+static int hf_selfm_fastser_soe_resp_tod = -1;
+/* static int hf_selfm_fastser_soe_resp_data = -1; */
+
/* Initialize the subtree pointers */
static gint ett_selfm = -1;
@@ -176,6 +207,7 @@ static gint ett_selfm_relaydef_proto = -1;
static gint ett_selfm_relaydef_flags = -1;
static gint ett_selfm_fmconfig = -1;
static gint ett_selfm_fmconfig_ai = -1;
+static gint ett_selfm_fmconfig_calc = -1;
static gint ett_selfm_foconfig = -1;
static gint ett_selfm_foconfig_brkr = -1;
static gint ett_selfm_foconfig_rb = -1;
@@ -203,39 +235,26 @@ static gint ett_selfm_fastser_element = -1;
#define CMD_PDFM_CONFIG 0xA5C3
#define CMD_FASTOP_RESETDEF 0xA5CD
#define CMD_FASTOP_CONFIG 0xA5CE
-#define CMD_FASTOP_CONFIG_ALT 0xA5CF
+#define CMD_ALT_FASTOP_CONFIG 0xA5CF
#define CMD_FM_DATA 0xA5D1
#define CMD_DFM_DATA 0xA5D2
#define CMD_PDFM_DATA 0xA5D3
#define CMD_FASTOP_RB_CTRL 0xA5E0
#define CMD_FASTOP_BR_CTRL 0xA5E3
+#define CMD_ALT_FASTOP_OPEN 0xA5E5
+#define CMD_ALT_FASTOP_CLOSE 0xA5E6
+#define CMD_ALT_FASTOP_SET 0xA5E7
+#define CMD_ALT_FASTOP_CLEAR 0xA5E8
+#define CMD_ALT_FASTOP_PULSE 0xA5E9
#define CMD_FASTOP_RESET 0xA5ED
-#define RELAYDEF_PROTO_SEL 0x0000
-#define RELAYDEF_PROTO_SEL_FO 0x0100
-#define RELAYDEF_PROTO_SEL_FM 0x0200
-#define RELAYDEF_PROTO_SEL_FO_FM 0x0300
-#define RELAYDEF_PROTO_LMD 0x0001
-#define RELAYDEF_PROTO_LMD_FO 0x0101
-#define RELAYDEF_PROTO_LMD_FO_FM 0x0301
-#define RELAYDEF_PROTO_MODBUS 0x0002
-#define RELAYDEF_PROTO_SYMAX 0x0003
-#define RELAYDEF_PROTO_R2R 0x0004
-#define RELAYDEF_PROTO_DNP3 0x0005
-#define RELAYDEF_PROTO_MB 0x0006
-#define RELAYDEF_PROTO_C37_118 0x0007
-#define RELAYDEF_PROTO_61850 0x0008
-
#define FM_CONFIG_SF_LOC_FM 0
#define FM_CONFIG_SF_LOC_CFG 1
#define FM_CONFIG_ANA_CHNAME_LEN 6
#define FM_CONFIG_ANA_CHTYPE_INT16 0x00
-#define FM_CONFIG_ANA_CHTYPE_INT16_LEN 2
#define FM_CONFIG_ANA_CHTYPE_FP 0x01
-#define FM_CONFIG_ANA_CHTYPE_FP_LEN 4
#define FM_CONFIG_ANA_CHTYPE_FPD 0x02
-#define FM_CONFIG_ANA_CHTYPE_FPD_LEN 8
#define FM_CONFIG_ANA_CHTYPE_TS 0x03
#define FM_CONFIG_ANA_CHTYPE_TS_LEN 8
@@ -245,177 +264,52 @@ static gint ett_selfm_fastser_element = -1;
#define FM_CONFIG_ANA_SFTYPE_TS 0x03
#define FM_CONFIG_ANA_SFTYPE_NONE 0xFF
-#define FO_CONFIG_PRB_SUPP_NO 0
-#define FO_CONFIG_PRB_SUPP_YES 1
/* Fast SER Function Codes, "response" or "ACK" messages are the same as the request, but have the MSB set */
#define FAST_SER_MESSAGE_DEF 0x00
-#define FAST_SER_MESSAGE_DEF_ACK 0x80
#define FAST_SER_EN_UNS_DATA 0x01
-#define FAST_SER_EN_UNS_DATA_ACK 0x81
#define FAST_SER_DIS_UNS_DATA 0x02
-#define FAST_SER_DIS_UNS_DATA_ACK 0x82
#define FAST_SER_PING 0x05
-#define FAST_SER_PING_ACK 0x85
-#define FAST_SER_READ_REQ 0x10 /* Limited Public Documentation... */
-#define FAST_SER_READ_RESP 0x90 /* Limited Public Documentation... */
-#define FAST_SER_GEN_UNS_DATA 0x12 /* Limited Public Documentation... */
-#define FAST_SER_SOE_STATE_REQ 0x16 /* Limited Public Documentation... */
-#define FAST_SER_SOE_STATE_RESP 0x96 /* Limited Public Documentation... */
+#define FAST_SER_READ_REQ 0x10
+#define FAST_SER_GEN_UNS_DATA 0x12
+#define FAST_SER_SOE_STATE_REQ 0x16
#define FAST_SER_UNS_RESP 0x18
-#define FAST_SER_UNS_RESP_ACK 0x98
#define FAST_SER_UNS_WRITE 0x20
-#define FAST_SER_UNS_WRITE_REQ 0x21 /* Limited Public Documentation... */
-#define FAST_SER_DEVDESC_REQ 0x30 /* Limited Public Documentation... */
-#define FAST_SER_DEVDESC_RESP 0xB0 /* Limited Public Documentation... */
-#define FAST_SER_DATAFMT_REQ 0x31 /* Limited Public Documentation... */
-#define FAST_SER_DATAFMT_RESP 0xB1 /* Limited Public Documentation... */
-#define FAST_SER_UNS_DATAFMT_RESP 0x32 /* Limited Public Documentation... */
-#define FAST_SER_BITLABEL_REQ 0x33 /* Limited Public Documentation... */
-#define FAST_SER_BITLABEL_RESP 0xB3 /* Limited Public Documentation... */
-#define FAST_SER_MGMT_REQ 0x40 /* Limited Public Documentation... */
-
-/* Fast SER Sequence Byte Masks
- Observation suggests a similar format to the DNP3 Transport Layer byte */
+#define FAST_SER_UNS_WRITE_REQ 0x21
+#define FAST_SER_DEVDESC_REQ 0x30
+#define FAST_SER_DATAFMT_REQ 0x31
+#define FAST_SER_UNS_DATAFMT_RESP 0x32
+#define FAST_SER_BITLABEL_REQ 0x33
+#define FAST_SER_MGMT_REQ 0x40
+#define FAST_SER_MESSAGE_DEF_ACK 0x80
+#define FAST_SER_EN_UNS_DATA_ACK 0x81
+#define FAST_SER_DIS_UNS_DATA_ACK 0x82
+#define FAST_SER_PING_ACK 0x85
+#define FAST_SER_READ_RESP 0x90
+#define FAST_SER_SOE_STATE_RESP 0x96
+#define FAST_SER_UNS_RESP_ACK 0x98
+#define FAST_SER_DEVDESC_RESP 0xB0
+#define FAST_SER_DATAFMT_RESP 0xB1
+#define FAST_SER_BITLABEL_RESP 0xB3
+
+
+/* Fast SER Sequence Byte Masks */
#define FAST_SER_SEQ_FIR 0x80
#define FAST_SER_SEQ_FIN 0x40
#define FAST_SER_SEQ_CNT 0x3f
-/* Fast SER Tag Data Types, unknown exact formatting but observation suggests the following */
-/* 32-bit Float 01 00 41 */
-/* 2 x 32-bit Float 02 00 41 */
-/* 32-bit Integer 01 00 34 */
-/* 16-bit Integer 01 00 32 */
-/* 22-byte string 0B 00 12 */
-/* 4-byte string 02 00 12 */
-/* TARGETS 80 00 21 , address 0x3004 -> 0x3183 , 384 rows */
-#define FAST_SER_TAGTYPE_FLOAT 0x41
-#define FAST_SER_TAGTYPE_INT32 0x34
-#define FAST_SER_TAGTYPE_INT16 0x32
-#define FAST_SER_TAGTYPE_DIGWORD 0x21
-#define FAST_SER_TAGTYPE_CHAR16 0x12
-
-#define FAST_SER_UNSWRITE_COM01 0x0100
-#define FAST_SER_UNSWRITE_COM02 0x0200
-#define FAST_SER_UNSWRITE_COM03 0x0300
-#define FAST_SER_UNSWRITE_COM04 0x0400
-#define FAST_SER_UNSWRITE_COM05 0x0500
-#define FAST_SER_UNSWRITE_COM06 0x0600
-#define FAST_SER_UNSWRITE_COM07 0x0700
-#define FAST_SER_UNSWRITE_COM08 0x0800
-#define FAST_SER_UNSWRITE_COM09 0x0900
-#define FAST_SER_UNSWRITE_COM10 0x0A00
-#define FAST_SER_UNSWRITE_COM11 0x0B00
-#define FAST_SER_UNSWRITE_COM12 0x0C00
-#define FAST_SER_UNSWRITE_COM13 0x0D00
-#define FAST_SER_UNSWRITE_COM14 0x0E00
-#define FAST_SER_UNSWRITE_COM15 0x0F00
-
-#define FASTOP_BR1_OPEN 0x31
-#define FASTOP_BR1_CLOSE 0x11
-#define FASTOP_BR2_OPEN 0x32
-#define FASTOP_BR2_CLOSE 0x12
-#define FASTOP_BR3_OPEN 0x33
-#define FASTOP_BR3_CLOSE 0x13
-#define FASTOP_BR4_OPEN 0x34
-#define FASTOP_BR4_CLOSE 0x14
-
-#define FASTOP_RB01_CLEAR 0x00
-#define FASTOP_RB01_SET 0x20
-#define FASTOP_RB01_PULSE 0x40
-#define FASTOP_RB02_CLEAR 0x01
-#define FASTOP_RB02_SET 0x21
-#define FASTOP_RB02_PULSE 0x41
-#define FASTOP_RB03_CLEAR 0x02
-#define FASTOP_RB03_SET 0x22
-#define FASTOP_RB03_PULSE 0x42
-#define FASTOP_RB04_CLEAR 0x03
-#define FASTOP_RB04_SET 0x23
-#define FASTOP_RB04_PULSE 0x43
-#define FASTOP_RB05_CLEAR 0x04
-#define FASTOP_RB05_SET 0x24
-#define FASTOP_RB05_PULSE 0x44
-#define FASTOP_RB06_CLEAR 0x05
-#define FASTOP_RB06_SET 0x25
-#define FASTOP_RB06_PULSE 0x45
-#define FASTOP_RB07_CLEAR 0x06
-#define FASTOP_RB07_SET 0x26
-#define FASTOP_RB07_PULSE 0x46
-#define FASTOP_RB08_CLEAR 0x07
-#define FASTOP_RB08_SET 0x27
-#define FASTOP_RB08_PULSE 0x47
-#define FASTOP_RB09_CLEAR 0x08
-#define FASTOP_RB09_SET 0x28
-#define FASTOP_RB09_PULSE 0x48
-#define FASTOP_RB10_CLEAR 0x09
-#define FASTOP_RB10_SET 0x29
-#define FASTOP_RB10_PULSE 0x49
-#define FASTOP_RB11_CLEAR 0x0A
-#define FASTOP_RB11_SET 0x2A
-#define FASTOP_RB11_PULSE 0x4A
-#define FASTOP_RB12_CLEAR 0x0B
-#define FASTOP_RB12_SET 0x2B
-#define FASTOP_RB12_PULSE 0x4B
-#define FASTOP_RB13_CLEAR 0x0C
-#define FASTOP_RB13_SET 0x2C
-#define FASTOP_RB13_PULSE 0x4C
-#define FASTOP_RB14_CLEAR 0x0D
-#define FASTOP_RB14_SET 0x2D
-#define FASTOP_RB14_PULSE 0x4D
-#define FASTOP_RB15_CLEAR 0x0E
-#define FASTOP_RB15_SET 0x2E
-#define FASTOP_RB15_PULSE 0x4E
-#define FASTOP_RB16_CLEAR 0x0F
-#define FASTOP_RB16_SET 0x2F
-#define FASTOP_RB16_PULSE 0x4F
-#define FASTOP_RB17_CLEAR 0x10
-#define FASTOP_RB17_SET 0x30
-#define FASTOP_RB17_PULSE 0x50
-#define FASTOP_RB18_CLEAR 0x11
-#define FASTOP_RB18_SET 0x31
-#define FASTOP_RB18_PULSE 0x51
-#define FASTOP_RB19_CLEAR 0x12
-#define FASTOP_RB19_SET 0x32
-#define FASTOP_RB19_PULSE 0x52
-#define FASTOP_RB20_CLEAR 0x13
-#define FASTOP_RB20_SET 0x33
-#define FASTOP_RB20_PULSE 0x53
-#define FASTOP_RB21_CLEAR 0x14
-#define FASTOP_RB21_SET 0x34
-#define FASTOP_RB21_PULSE 0x54
-#define FASTOP_RB22_CLEAR 0x15
-#define FASTOP_RB22_SET 0x35
-#define FASTOP_RB22_PULSE 0x55
-#define FASTOP_RB23_CLEAR 0x16
-#define FASTOP_RB23_SET 0x36
-#define FASTOP_RB23_PULSE 0x56
-#define FASTOP_RB24_CLEAR 0x17
-#define FASTOP_RB24_SET 0x37
-#define FASTOP_RB24_PULSE 0x57
-#define FASTOP_RB25_CLEAR 0x18
-#define FASTOP_RB25_SET 0x38
-#define FASTOP_RB25_PULSE 0x58
-#define FASTOP_RB26_CLEAR 0x19
-#define FASTOP_RB26_SET 0x39
-#define FASTOP_RB26_PULSE 0x59
-#define FASTOP_RB27_CLEAR 0x1A
-#define FASTOP_RB27_SET 0x3A
-#define FASTOP_RB27_PULSE 0x5A
-#define FASTOP_RB28_CLEAR 0x1B
-#define FASTOP_RB28_SET 0x3B
-#define FASTOP_RB28_PULSE 0x5B
-#define FASTOP_RB29_CLEAR 0x1C
-#define FASTOP_RB29_SET 0x3C
-#define FASTOP_RB29_PULSE 0x5C
-#define FASTOP_RB30_CLEAR 0x1D
-#define FASTOP_RB30_SET 0x3D
-#define FASTOP_RB30_PULSE 0x5D
-#define FASTOP_RB31_CLEAR 0x1E
-#define FASTOP_RB31_SET 0x3E
-#define FASTOP_RB31_PULSE 0x5E
-#define FASTOP_RB32_CLEAR 0x1F
-#define FASTOP_RB32_SET 0x3F
-#define FASTOP_RB32_PULSE 0x5F
+/* Fast SER Tag Data Types */
+#define FAST_SER_TAGTYPE_CHAR8 0x0011 /* 1 x 8-bit character per item */
+#define FAST_SER_TAGTYPE_CHAR16 0x0012 /* 2 x 8-bit characters per item */
+#define FAST_SER_TAGTYPE_DIGWORD8_BL 0x0021 /* 8-bit binary item, with labels */
+#define FAST_SER_TAGTYPE_DIGWORD8 0x0022 /* 8-bit binary item, without labels */
+#define FAST_SER_TAGTYPE_DIGWORD16_BL 0x0023 /* 16-bit binary item, with labels */
+#define FAST_SER_TAGTYPE_DIGWORD16 0x0024 /* 16-bit binary item, without labels */
+#define FAST_SER_TAGTYPE_INT16 0x0031 /* 16-bit signed integer */
+#define FAST_SER_TAGTYPE_UINT16 0x0032 /* 16-bit unsigned integer */
+#define FAST_SER_TAGTYPE_INT32 0x0033 /* 32-bit signed integer */
+#define FAST_SER_TAGTYPE_UINT32 0x0034 /* 32-bit unsigned integer */
+#define FAST_SER_TAGTYPE_FLOAT 0x0041 /* 32-bit floating point */
/* Globals for SEL Protocol Preferences */
@@ -429,9 +323,9 @@ static guint global_selfm_tcp_port = PORT_SELFM; /* Port 0, by default */
/* Holds Configuration Information required to decode a Fast Meter analog value */
typedef struct {
gchar name[FM_CONFIG_ANA_CHNAME_LEN+1]; /* Name of Analog Channel, 6 char + a null */
- guint8 type; /* Analog Channel Type, Int, FP, etc */
- guint8 sf_type; /* Analog Scale Factor Type, none, etc */
- guint16 sf_offset; /* Analog Scale Factor Offset */
+ guint8 type; /* Analog Channel Type, Int, FP, etc */
+ guint8 sf_type; /* Analog Scale Factor Type, none, etc */
+ guint16 sf_offset; /* Analog Scale Factor Offset */
} fm_analog_info;
/* Holds Information from a single "Fast Meter Configuration" frame. Required to dissect subsequent "Data" frames. */
@@ -450,72 +344,68 @@ typedef struct {
} fm_config_frame;
typedef struct {
- wmem_slist_t *fm_config_frames; /* Contains a fm_config_data struct for the information in the Fast Meter configuration frame */
+ wmem_slist_t *fm_config_frames; /* List contains a fm_config_data struct for each Fast Meter configuration frame */
+ wmem_slist_t *fastser_dataitems; /* List contains a fastser_dataitem struct for each Fast SER Data Item */
} fm_conversation;
/**************************************************************************************/
-/* Fast SER Message structs */
+/* Fast SER Message Data Item struct */
/**************************************************************************************/
-/* Holds Configuration Information required to decode a Fast SER Data Tag */
+/* Holds Configuration Information required to decode a Fast SER Data Item */
/* Each data region format is returned as a sequential list of tags, w/o reference to */
-/* an absolute address. We can determine an address based on the sequence byte count */
-/* when the tag was encountered and the index position within the data format message */
-typedef struct {
- gchar name[11]; /* Name of Data Tag, 11 chars, null-terminated */
- guint8 seq_count; /* Sequence count of data format message (0,1,2,3,4,etc) */
- guint8 index_pos; /* Index Offset Position within data format message (1-16) */
- guint8 quantity; /* Quantity of values within tag */
- guint8 type; /* Data Tag Type, Int, FP, etc */
-} fastser_tag;
-
-/* Holds Configuration Information required to decode a Fast SER Data Region */
+/* an absolute address. The format information will consist of a name, a data type */
+/* and a quantity of values contained within the data item. We will retrieve this */
+/* format information later while attempting to dissect Read Response frames */
typedef struct {
- gchar name[12]; /* Name of Data Region, 12 chars, null-terminated */
- guint8 base_addr; /* Base address offset of region (0x3000, etc) */
- guint8 qty_addr; /* Quantity of 16-bit addresses within region */
- GArray *tags; /* Array of fastser_tags */
-} fastser_region;
+ guint32 fnum; /* frame number */
+ guint32 base_address; /* Base address of Data Item Region */
+ guint8 index_pos; /* Index Offset Position within data format message (1-16) */
+ gchar name[10+1]; /* Name of Data Item, 10 chars, null-terminated */
+ guint16 quantity; /* Quantity of values within Data Item */
+ guint16 data_type; /* Data Item Type, Char, Int, FP, etc */
+} fastser_dataitem;
-typedef struct {
- guint32 fnum; /* frame number */
- GArray *fastser_region_blocks; /* Contains a fastser_region struct for the information in the Fast SER configuration frame */
-} fastser_config_frame;
static const value_string selfm_msgtype_vals[] = {
- { CMD_CLEAR_STATBIT, "Clear Status Bits Command" },
- { CMD_FAST_SER, "Fast SER Block" },
- { CMD_FASTOP_BR_CTRL, "Fast Operate Breaker Bit Control" },
- { CMD_FASTOP_RB_CTRL, "Fast Operate Remote Bit Control" },
- { CMD_FASTOP_CONFIG, "Fast Operate Configuration" },
- { CMD_FASTOP_CONFIG_ALT, "Fast Operate Configuration (alt)" },
- { CMD_FASTOP_RESET, "Fast Operate Reset" },
- { CMD_FASTOP_RESETDEF, "Fast Operate Reset Definition" },
- { CMD_RELAY_DEF, "Relay Definition Block" },
- { CMD_FM_CONFIG, "Fast Meter Configuration Block" },
- { CMD_FM_DATA, "Fast Meter Data Block" },
- { CMD_DFM_CONFIG, "Demand Fast Meter Configuration Block" },
- { CMD_DFM_DATA, "Demand Fast Meter Data Block" },
- { CMD_PDFM_CONFIG, "Peak Demand Fast Meter Configuration Block" },
- { CMD_PDFM_DATA, "Peak Demand Fast Meter Data Block" },
+ { CMD_FAST_SER, "Fast SER Block" }, /* 0xA546 */
+ { CMD_CLEAR_STATBIT, "Clear Status Bits Command" }, /* 0xA5B9 */
+ { CMD_RELAY_DEF, "Relay Definition Block" }, /* 0xA5C0 */
+ { CMD_FM_CONFIG, "Fast Meter Configuration Block" }, /* 0xA5C1 */
+ { CMD_DFM_CONFIG, "Demand Fast Meter Configuration Block" }, /* 0xA5C2 */
+ { CMD_PDFM_CONFIG, "Peak Demand Fast Meter Configuration Block" }, /* 0xA5C3 */
+ { CMD_FASTOP_RESETDEF, "Fast Operate Reset Definition" }, /* 0xA5CD */
+ { CMD_FASTOP_CONFIG, "Fast Operate Configuration" }, /* 0xA5CE */
+ { CMD_ALT_FASTOP_CONFIG, "Alternate Fast Operate Configuration" }, /* 0xA5CF */
+ { CMD_FM_DATA, "Fast Meter Data Block" }, /* 0xA5D1 */
+ { CMD_DFM_DATA, "Demand Fast Meter Data Block" }, /* 0xA5D2 */
+ { CMD_PDFM_DATA, "Peak Demand Fast Meter Data Block" }, /* 0xA5D3 */
+ { CMD_FASTOP_RB_CTRL, "Fast Operate Remote Bit Control" }, /* 0xA5E0 */
+ { CMD_FASTOP_BR_CTRL, "Fast Operate Breaker Bit Control" }, /* 0xA5E3 */
+ { CMD_ALT_FASTOP_OPEN, "Alternate Fast Operate Open Breaker Control" }, /* 0xA5E5 */
+ { CMD_ALT_FASTOP_CLOSE, "Alternate Fast Operate Close Breaker Control" }, /* 0xA5E6 */
+ { CMD_ALT_FASTOP_SET, "Alternate Fast Operate Set Remote Bit Control" }, /* 0xA5E7 */
+ { CMD_ALT_FASTOP_CLEAR, "Alternate Fast Operate Clear Remote Bit Control" }, /* 0xA5E8 */
+ { CMD_ALT_FASTOP_PULSE, "Alternate Fast Operate Pulse Remote Bit Control" }, /* 0xA5E9 */
+ { CMD_FASTOP_RESET, "Fast Operate Reset" }, /* 0xA5ED */
{ 0, NULL }
};
static value_string_ext selfm_msgtype_vals_ext = VALUE_STRING_EXT_INIT(selfm_msgtype_vals);
static const value_string selfm_relaydef_proto_vals[] = {
- { RELAYDEF_PROTO_SEL, "SEL Fast Meter" },
- { RELAYDEF_PROTO_SEL_FO, "SEL Fast Meter w/ Fast Operate" },
- { RELAYDEF_PROTO_SEL_FM, "SEL Fast Meter w/ Fast SER" },
- { RELAYDEF_PROTO_SEL_FO_FM, "SEL Fast Meter w/ Fast Operate and Fast SER" },
- { RELAYDEF_PROTO_LMD, "SEL Limited Multidrop (LMD)" },
- { RELAYDEF_PROTO_LMD_FO, "SEL Limited Multidrop (LMD) w/ Fast Operate" },
- { RELAYDEF_PROTO_LMD_FO_FM, "SEL Limited Multidrop (LMD) w/ Fast Operate and Fast SER" },
- { RELAYDEF_PROTO_MODBUS, "Modbus" },
- { RELAYDEF_PROTO_SYMAX, "SY/MAX" },
- { RELAYDEF_PROTO_R2R, "SEL Relay-to-Relay" },
- { RELAYDEF_PROTO_DNP3, "DNP 3.0" },
- { RELAYDEF_PROTO_MB, "SEL Mirrored Bits" },
- { RELAYDEF_PROTO_C37_118, "IEEE 37.118 Synchrophasors" },
- { RELAYDEF_PROTO_61850, "IEC 61850" },
+ { 0x0000, "SEL Fast Meter" },
+ { 0x0001, "SEL Limited Multidrop (LMD)" },
+ { 0x0002, "Modbus" },
+ { 0x0003, "SY/MAX" },
+ { 0x0004, "SEL Relay-to-Relay" },
+ { 0x0005, "DNP 3.0" },
+ { 0x0006, "SEL Mirrored Bits" },
+ { 0x0007, "IEEE 37.118 Synchrophasors" },
+ { 0x0008, "IEC 61850" },
+ { 0x0100, "SEL Fast Meter w/ Fast Operate" },
+ { 0x0101, "SEL Limited Multidrop (LMD) w/ Fast Operate" },
+ { 0x0200, "SEL Fast Meter w/ Fast SER" },
+ { 0x0300, "SEL Fast Meter w/ Fast Operate and Fast SER" },
+ { 0x0301, "SEL Limited Multidrop (LMD) w/ Fast Operate and Fast SER" },
{ 0, NULL }
};
static value_string_ext selfm_relaydef_proto_vals_ext = VALUE_STRING_EXT_INIT(selfm_relaydef_proto_vals);
@@ -563,133 +453,206 @@ static const value_string selfm_fmconfig_numsamples4_vals[] = {
{ 0, NULL }
};
+/* Calculation Block lookup values */
+static const value_string selfm_fmconfig_cblk_rot_vals[] = {
+ { 0x00, "ABC Rotation" },
+ { 0x01, "ACB Rotation" },
+ { 0, NULL }
+};
+
+static const value_string selfm_fmconfig_cblk_vconn_vals[] = {
+ { 0x00, "Y-Connected" },
+ { 0x01, "Delta-Connected (in seq. Vab, Vbc, Vca)" },
+ { 0x02, "Delta-Connected (in seq. Vac, Vba, Vcb)" },
+ { 0, NULL }
+};
+
+static const value_string selfm_fmconfig_cblk_iconn_vals[] = {
+ { 0x00, "Y-Connected" },
+ { 0x01, "Delta-Connected (in seq. Iab, Ibc, Ica)" },
+ { 0x02, "Delta-Connected (in seq. Iac, Iba, Icb)" },
+ { 0, NULL }
+};
+
+static const value_string selfm_fmconfig_cblk_ctype_vals[] = {
+ { 0, "Standard Power Calculations" },
+ { 1, "2-1/2 Element Delta Power Calculation" },
+ { 2, "Voltages-Only" },
+ { 3, "Currents-Only" },
+ { 4, "Single-Phase Ia and Va Only" },
+ { 5, "Standard Power Calcs with 2 sets of Currents" },
+ { 6, "2-1/2 Element Delta Power Calcs with 2 sets of Currents" },
+ { 0, NULL }
+};
+/* Fast Operate Remote Bit 'Pulse Supported' Lookup */
static const value_string selfm_foconfig_prb_supp_vals[] = {
- { FO_CONFIG_PRB_SUPP_NO, "No" },
- { FO_CONFIG_PRB_SUPP_YES, "Yes" },
+ { 0x00, "No" },
+ { 0x01, "Yes" },
{ 0, NULL }
};
+/* SER Status Value Lookup */
static const value_string selfm_ser_status_vals[] = {
- { 0, "Deasserted" },
- { 1, "Asserted" },
+ { 0x00, "Deasserted" },
+ { 0x01, "Asserted" },
{ 0, NULL }
};
-
+/* Fast Operate Remote Bit Lookup */
static const value_string selfm_fo_rb_vals[] = {
- { FASTOP_RB01_CLEAR, "RB01 Clear" },
- { FASTOP_RB01_SET, "RB01 Set" },
- { FASTOP_RB01_PULSE, "RB01 Pulse" },
- { FASTOP_RB02_CLEAR, "RB02 Clear" },
- { FASTOP_RB02_SET, "RB02 Set" },
- { FASTOP_RB02_PULSE, "RB02 Pulse" },
- { FASTOP_RB03_CLEAR, "RB03 Clear" },
- { FASTOP_RB03_SET, "RB03 Set" },
- { FASTOP_RB03_PULSE, "RB03 Pulse" },
- { FASTOP_RB04_CLEAR, "RB04 Clear" },
- { FASTOP_RB04_SET, "RB04 Set" },
- { FASTOP_RB04_PULSE, "RB04 Pulse" },
- { FASTOP_RB05_CLEAR, "RB05 Clear" },
- { FASTOP_RB05_SET, "RB05 Set" },
- { FASTOP_RB05_PULSE, "RB05 Pulse" },
- { FASTOP_RB06_CLEAR, "RB06 Clear" },
- { FASTOP_RB06_SET, "RB06 Set" },
- { FASTOP_RB06_PULSE, "RB06 Pulse" },
- { FASTOP_RB07_CLEAR, "RB07 Clear" },
- { FASTOP_RB07_SET, "RB07 Set" },
- { FASTOP_RB07_PULSE, "RB07 Pulse" },
- { FASTOP_RB08_CLEAR, "RB08 Clear" },
- { FASTOP_RB08_SET, "RB08 Set" },
- { FASTOP_RB08_PULSE, "RB08 Pulse" },
- { FASTOP_RB09_CLEAR, "RB09 Clear" },
- { FASTOP_RB09_SET, "RB09 Set" },
- { FASTOP_RB09_PULSE, "RB09 Pulse" },
- { FASTOP_RB10_CLEAR, "RB10 Clear" },
- { FASTOP_RB10_SET, "RB10 Set" },
- { FASTOP_RB10_PULSE, "RB10 Pulse" },
- { FASTOP_RB11_CLEAR, "RB11 Clear" },
- { FASTOP_RB11_SET, "RB11 Set" },
- { FASTOP_RB11_PULSE, "RB11 Pulse" },
- { FASTOP_RB12_CLEAR, "RB12 Clear" },
- { FASTOP_RB12_SET, "RB12 Set" },
- { FASTOP_RB12_PULSE, "RB12 Pulse" },
- { FASTOP_RB13_CLEAR, "RB13 Clear" },
- { FASTOP_RB13_SET, "RB13 Set" },
- { FASTOP_RB13_PULSE, "RB13 Pulse" },
- { FASTOP_RB14_CLEAR, "RB14 Clear" },
- { FASTOP_RB14_SET, "RB14 Set" },
- { FASTOP_RB14_PULSE, "RB14 Pulse" },
- { FASTOP_RB15_CLEAR, "RB15 Clear" },
- { FASTOP_RB15_SET, "RB15 Set" },
- { FASTOP_RB15_PULSE, "RB15 Pulse" },
- { FASTOP_RB16_CLEAR, "RB16 Clear" },
- { FASTOP_RB16_SET, "RB16 Set" },
- { FASTOP_RB16_PULSE, "RB16 Pulse" },
- { FASTOP_RB17_CLEAR, "RB17 Clear" },
- { FASTOP_RB17_SET, "RB17 Set" },
- { FASTOP_RB17_PULSE, "RB17 Pulse" },
- { FASTOP_RB18_CLEAR, "RB18 Clear" },
- { FASTOP_RB18_SET, "RB18 Set" },
- { FASTOP_RB18_PULSE, "RB18 Pulse" },
- { FASTOP_RB19_CLEAR, "RB19 Clear" },
- { FASTOP_RB19_SET, "RB19 Set" },
- { FASTOP_RB19_PULSE, "RB19 Pulse" },
- { FASTOP_RB20_CLEAR, "RB20 Clear" },
- { FASTOP_RB20_SET, "RB20 Set" },
- { FASTOP_RB20_PULSE, "RB20 Pulse" },
- { FASTOP_RB21_CLEAR, "RB21 Clear" },
- { FASTOP_RB21_SET, "RB21 Set" },
- { FASTOP_RB21_PULSE, "RB21 Pulse" },
- { FASTOP_RB22_CLEAR, "RB22 Clear" },
- { FASTOP_RB22_SET, "RB22 Set" },
- { FASTOP_RB22_PULSE, "RB22 Pulse" },
- { FASTOP_RB23_CLEAR, "RB23 Clear" },
- { FASTOP_RB23_SET, "RB23 Set" },
- { FASTOP_RB23_PULSE, "RB23 Pulse" },
- { FASTOP_RB24_CLEAR, "RB24 Clear" },
- { FASTOP_RB24_SET, "RB24 Set" },
- { FASTOP_RB24_PULSE, "RB24 Pulse" },
- { FASTOP_RB25_CLEAR, "RB25 Clear" },
- { FASTOP_RB25_SET, "RB25 Set" },
- { FASTOP_RB25_PULSE, "RB25 Pulse" },
- { FASTOP_RB26_CLEAR, "RB26 Clear" },
- { FASTOP_RB26_SET, "RB26 Set" },
- { FASTOP_RB26_PULSE, "RB26 Pulse" },
- { FASTOP_RB27_CLEAR, "RB27 Clear" },
- { FASTOP_RB27_SET, "RB27 Set" },
- { FASTOP_RB27_PULSE, "RB27 Pulse" },
- { FASTOP_RB28_CLEAR, "RB28 Clear" },
- { FASTOP_RB28_SET, "RB28 Set" },
- { FASTOP_RB28_PULSE, "RB28 Pulse" },
- { FASTOP_RB29_CLEAR, "RB29 Clear" },
- { FASTOP_RB29_SET, "RB29 Set" },
- { FASTOP_RB29_PULSE, "RB29 Pulse" },
- { FASTOP_RB30_CLEAR, "RB30 Clear" },
- { FASTOP_RB30_SET, "RB30 Set" },
- { FASTOP_RB30_PULSE, "RB30 Pulse" },
- { FASTOP_RB31_CLEAR, "RB31 Clear" },
- { FASTOP_RB31_SET, "RB31 Set" },
- { FASTOP_RB31_PULSE, "RB31 Pulse" },
- { FASTOP_RB32_CLEAR, "RB32 Clear" },
- { FASTOP_RB32_SET, "RB32 Set" },
- { FASTOP_RB32_PULSE, "RB32 Pulse" },
- { 0, NULL }
+ { 0x00, "RB01 Clear" },
+ { 0x20, "RB01 Set" },
+ { 0x40, "RB01 Pulse" },
+ { 0x01, "RB02 Clear" },
+ { 0x21, "RB02 Set" },
+ { 0x41, "RB02 Pulse" },
+ { 0x02, "RB03 Clear" },
+ { 0x22, "RB03 Set" },
+ { 0x42, "RB03 Pulse" },
+ { 0x03, "RB04 Clear" },
+ { 0x23, "RB04 Set" },
+ { 0x43, "RB04 Pulse" },
+ { 0x04, "RB05 Clear" },
+ { 0x24, "RB05 Set" },
+ { 0x44, "RB05 Pulse" },
+ { 0x05, "RB06 Clear" },
+ { 0x25, "RB06 Set" },
+ { 0x45, "RB06 Pulse" },
+ { 0x06, "RB07 Clear" },
+ { 0x26, "RB07 Set" },
+ { 0x46, "RB07 Pulse" },
+ { 0x07, "RB08 Clear" },
+ { 0x27, "RB08 Set" },
+ { 0x47, "RB08 Pulse" },
+ { 0x08, "RB09 Clear" },
+ { 0x28, "RB09 Set" },
+ { 0x48, "RB09 Pulse" },
+ { 0x09, "RB10 Clear" },
+ { 0x29, "RB10 Set" },
+ { 0x49, "RB10 Pulse" },
+ { 0x0A, "RB11 Clear" },
+ { 0x2A, "RB11 Set" },
+ { 0x4A, "RB11 Pulse" },
+ { 0x0B, "RB12 Clear" },
+ { 0x2B, "RB12 Set" },
+ { 0x4B, "RB12 Pulse" },
+ { 0x0C, "RB13 Clear" },
+ { 0x2C, "RB13 Set" },
+ { 0x4C, "RB13 Pulse" },
+ { 0x0D, "RB14 Clear" },
+ { 0x2D, "RB14 Set" },
+ { 0x4D, "RB14 Pulse" },
+ { 0x0E, "RB15 Clear" },
+ { 0x2E, "RB15 Set" },
+ { 0x4E, "RB15 Pulse" },
+ { 0x0F, "RB16 Clear" },
+ { 0x2F, "RB16 Set" },
+ { 0x4F, "RB16 Pulse" },
+ { 0x10, "RB17 Clear" },
+ { 0x30, "RB17 Set" },
+ { 0x50, "RB17 Pulse" },
+ { 0x11, "RB18 Clear" },
+ { 0x31, "RB18 Set" },
+ { 0x51, "RB18 Pulse" },
+ { 0x12, "RB19 Clear" },
+ { 0x32, "RB19 Set" },
+ { 0x52, "RB19 Pulse" },
+ { 0x13, "RB20 Clear" },
+ { 0x33, "RB20 Set" },
+ { 0x53, "RB20 Pulse" },
+ { 0x14, "RB21 Clear" },
+ { 0x34, "RB21 Set" },
+ { 0x54, "RB21 Pulse" },
+ { 0x15, "RB22 Clear" },
+ { 0x35, "RB22 Set" },
+ { 0x55, "RB22 Pulse" },
+ { 0x16, "RB23 Clear" },
+ { 0x36, "RB23 Set" },
+ { 0x56, "RB23 Pulse" },
+ { 0x17, "RB24 Clear" },
+ { 0x37, "RB24 Set" },
+ { 0x57, "RB24 Pulse" },
+ { 0x18, "RB25 Clear" },
+ { 0x38, "RB25 Set" },
+ { 0x58, "RB25 Pulse" },
+ { 0x19, "RB26 Clear" },
+ { 0x39, "RB26 Set" },
+ { 0x59, "RB26 Pulse" },
+ { 0x1A, "RB27 Clear" },
+ { 0x3A, "RB27 Set" },
+ { 0x5A, "RB27 Pulse" },
+ { 0x1B, "RB28 Clear" },
+ { 0x3B, "RB28 Set" },
+ { 0x5B, "RB28 Pulse" },
+ { 0x1C, "RB29 Clear" },
+ { 0x3C, "RB29 Set" },
+ { 0x5C, "RB29 Pulse" },
+ { 0x1D, "RB30 Clear" },
+ { 0x3D, "RB30 Set" },
+ { 0x5D, "RB30 Pulse" },
+ { 0x1E, "RB31 Clear" },
+ { 0x3E, "RB31 Set" },
+ { 0x5E, "RB31 Pulse" },
+ { 0x1F, "RB32 Clear" },
+ { 0x3F, "RB32 Set" },
+ { 0x5F, "RB32 Pulse" },
+ { 0, NULL }
};
+/* Fast Operate Breaker Bit Lookup */
static const value_string selfm_fo_br_vals[] = {
- { FASTOP_BR1_OPEN, "Breaker Bit 1 Open (OC/OC1)" },
- { FASTOP_BR1_CLOSE, "Breaker Bit 1 Close (CC/CC1)" },
- { FASTOP_BR2_OPEN, "Breaker Bit 2 Open (OC2)" },
- { FASTOP_BR2_CLOSE, "Breaker Bit 2 Close (CC2)" },
- { FASTOP_BR3_OPEN, "Breaker Bit 3 Open (OC3)" },
- { FASTOP_BR3_CLOSE, "Breaker Bit 3 Close (CC3)" },
- { FASTOP_BR4_OPEN, "Breaker Bit 4 Open (OC4)" },
- { FASTOP_BR4_CLOSE, "Breaker Bit 4 Close (CC4)" },
+ { 0x31, "Breaker Bit 1 Open (OC/OC1)" },
+ { 0x11, "Breaker Bit 1 Close (CC/CC1)" },
+ { 0x32, "Breaker Bit 2 Open (OC2)" },
+ { 0x12, "Breaker Bit 2 Close (CC2)" },
+ { 0x33, "Breaker Bit 3 Open (OC3)" },
+ { 0x13, "Breaker Bit 3 Close (CC3)" },
+ { 0x34, "Breaker Bit 4 Open (OC4)" },
+ { 0x14, "Breaker Bit 4 Close (CC4)" },
+ { 0x35, "Breaker Bit 5 Open (OC5)" },
+ { 0x15, "Breaker Bit 5 Close (CC5)" },
+ { 0x36, "Breaker Bit 6 Open (OC6)" },
+ { 0x16, "Breaker Bit 6 Close (CC6)" },
+ { 0x37, "Breaker Bit 7 Open (OC7)" },
+ { 0x17, "Breaker Bit 7 Close (CC7)" },
+ { 0x38, "Breaker Bit 8 Open (OC8)" },
+ { 0x18, "Breaker Bit 8 Close (CC8)" },
+ { 0x39, "Breaker Bit 9 Open (OC9)" },
+ { 0x19, "Breaker Bit 9 Close (CC9)" },
+ { 0x3A, "Breaker Bit 10 Open (OC10)" },
+ { 0x1A, "Breaker Bit 10 Close (CC10)" },
+ { 0x3B, "Breaker Bit 11 Open (OC11)" },
+ { 0x1B, "Breaker Bit 11 Close (CC11)" },
+ { 0x3C, "Breaker Bit 12 Open (OC12)" },
+ { 0x1C, "Breaker Bit 12 Close (CC12)" },
+ { 0x3D, "Breaker Bit 13 Open (OC13)" },
+ { 0x1D, "Breaker Bit 13 Close (CC13)" },
+ { 0x3E, "Breaker Bit 14 Open (OC14)" },
+ { 0x1E, "Breaker Bit 14 Close (CC14)" },
+ { 0x3F, "Breaker Bit 15 Open (OC15)" },
+ { 0x1F, "Breaker Bit 15 Close (CC15)" },
+ { 0x40, "Breaker Bit 16 Open (OC16)" },
+ { 0x20, "Breaker Bit 16 Close (CC16)" },
+ { 0x41, "Breaker Bit 17 Open (OC17)" },
+ { 0x21, "Breaker Bit 17 Close (CC17)" },
+ { 0x42, "Breaker Bit 18 Open (OC18)" },
+ { 0x22, "Breaker Bit 18 Close (CC18)" },
{ 0, NULL }
};
+/* Alternate Fast Operate Function Code Lookup */
+static const value_string selfm_foconfig_alt_funccode_vals[] = {
+ { 0xE5, "Open Breaker Bit" },
+ { 0xE6, "Close Breaker Bit" },
+ { 0xE7, "Set Remote Bit" },
+ { 0xE8, "Clear Remote Bit" },
+ { 0xE9, "Pulse Remote Bit" },
+ { 0x00, "Unsupported" },
+ { 0, NULL }
+};
+/* Fast SER Message Function Codes */
static const value_string selfm_fastser_func_code_vals[] = {
{ FAST_SER_MESSAGE_DEF, "Fast SER Message Definition Block" },
{ FAST_SER_MESSAGE_DEF_ACK, "Fast SER Message Definition Block ACK" },
@@ -726,33 +689,78 @@ static const value_string selfm_fastser_seq_vals[] = {
};
static const value_string selfm_fastser_tagtype_vals[] = {
- { FAST_SER_TAGTYPE_FLOAT, "IEEE Floating Point" },
- { FAST_SER_TAGTYPE_INT32, "32-bit Integer" },
- { FAST_SER_TAGTYPE_INT16, "16-bit Integer" },
- { FAST_SER_TAGTYPE_DIGWORD, "Digital Word" },
- { FAST_SER_TAGTYPE_CHAR16, "16-bit Character Array" },
+ { FAST_SER_TAGTYPE_CHAR8, "1 x 8-bit character per item" },
+ { FAST_SER_TAGTYPE_CHAR16, "2 x 8-bit characters per item" },
+ { FAST_SER_TAGTYPE_DIGWORD8_BL, "8-bit binary item, with labels" },
+ { FAST_SER_TAGTYPE_DIGWORD8, "8-bit binary item, without labels" },
+ { FAST_SER_TAGTYPE_DIGWORD16_BL, "16-bit binary item, with labels" },
+ { FAST_SER_TAGTYPE_DIGWORD16, "16-bit binary item, without labels" },
+ { FAST_SER_TAGTYPE_INT16, "16-bit Signed Integer" },
+ { FAST_SER_TAGTYPE_UINT16, "16-bit Unsigned Integer" },
+ { FAST_SER_TAGTYPE_INT32, "32-bit Signed Integer" },
+ { FAST_SER_TAGTYPE_UINT32, "32-bit Unsigned Integer" },
+ { FAST_SER_TAGTYPE_FLOAT, "IEEE Floating Point" },
{ 0, NULL }
};
+
+/* Fast Message Unsolicited Write COM Port Codes */
static const value_string selfm_fastser_unswrite_com_vals[] = {
- { FAST_SER_UNSWRITE_COM01, "COM01" },
- { FAST_SER_UNSWRITE_COM02, "COM02" },
- { FAST_SER_UNSWRITE_COM03, "COM03" },
- { FAST_SER_UNSWRITE_COM04, "COM04" },
- { FAST_SER_UNSWRITE_COM05, "COM05" },
- { FAST_SER_UNSWRITE_COM06, "COM06" },
- { FAST_SER_UNSWRITE_COM07, "COM07" },
- { FAST_SER_UNSWRITE_COM08, "COM08" },
- { FAST_SER_UNSWRITE_COM09, "COM09" },
- { FAST_SER_UNSWRITE_COM10, "COM10" },
- { FAST_SER_UNSWRITE_COM11, "COM11" },
- { FAST_SER_UNSWRITE_COM12, "COM12" },
- { FAST_SER_UNSWRITE_COM13, "COM13" },
- { FAST_SER_UNSWRITE_COM14, "COM14" },
- { FAST_SER_UNSWRITE_COM15, "COM15" },
+ { 0x0100, "COM01" },
+ { 0x0200, "COM02" },
+ { 0x0300, "COM03" },
+ { 0x0400, "COM04" },
+ { 0x0500, "COM05" },
+ { 0x0600, "COM06" },
+ { 0x0700, "COM07" },
+ { 0x0800, "COM08" },
+ { 0x0900, "COM09" },
+ { 0x0A00, "COM10" },
+ { 0x0B00, "COM11" },
+ { 0x0C00, "COM12" },
+ { 0x0D00, "COM13" },
+ { 0x0E00, "COM14" },
+ { 0x0F00, "COM15" },
{ 0, NULL }
};
+/* Tables for reassembly of fragments. */
+static reassembly_table selfm_reassembly_table;
+
+/* ************************************************************************* */
+/* Header values for reassembly */
+/* ************************************************************************* */
+static int hf_selfm_fragment = -1;
+static int hf_selfm_fragments = -1;
+static int hf_selfm_fragment_overlap = -1;
+static int hf_selfm_fragment_overlap_conflict = -1;
+static int hf_selfm_fragment_multiple_tails = -1;
+static int hf_selfm_fragment_too_long_fragment = -1;
+static int hf_selfm_fragment_error = -1;
+static int hf_selfm_fragment_count = -1;
+static int hf_selfm_fragment_reassembled_in = -1;
+static int hf_selfm_fragment_reassembled_length = -1;
+static gint ett_selfm_fragment = -1;
+static gint ett_selfm_fragments = -1;
+
+static const fragment_items selfm_frag_items = {
+ &ett_selfm_fragment,
+ &ett_selfm_fragments,
+ &hf_selfm_fragments,
+ &hf_selfm_fragment,
+ &hf_selfm_fragment_overlap,
+ &hf_selfm_fragment_overlap_conflict,
+ &hf_selfm_fragment_multiple_tails,
+ &hf_selfm_fragment_too_long_fragment,
+ &hf_selfm_fragment_error,
+ &hf_selfm_fragment_count,
+ &hf_selfm_fragment_reassembled_in,
+ &hf_selfm_fragment_reassembled_length,
+ /* Reassembled data field */
+ NULL,
+ "SEL Fast Message fragments"
+};
+
/**********************************************************************************************************/
/* Clean all instances of 0xFFFF from Telnet payload to compensate for IAC control code (replace w/ 0xFF) */
/* Function Duplicated from packet-telnet.c (unescape_and_tvbuffify_telnet_option) */
@@ -764,25 +772,32 @@ clean_telnet_iac(packet_info *pinfo, tvbuff_t *tvb, int offset, int len)
guint8 *buf;
const guint8 *spos;
guint8 *dpos;
- int skip, l;
+ int skip_byte, len_remaining;
spos=tvb_get_ptr(tvb, offset, len);
buf=(guint8 *)g_malloc(len);
dpos=buf;
- skip=0;
- l=len;
- while(l>0){
- if((spos[0]==0xff) && (spos[1]==0xff)){
- skip++;
- l-=2;
- *(dpos++)=0xff;
- spos+=2;
- continue;
+ skip_byte = 0;
+ len_remaining = len;
+ while(len_remaining > 0){
+
+ /* Only analyze two sequential bytes of source tvb if we have at least two bytes left */
+ if (len_remaining > 1) {
+ /* If two sequential 0xFF's exist, increment skip_byte counter, decrement */
+ /* len_remaining by 2 and copy a single 0xFF to dest tvb. */
+ if((spos[0]==0xff) && (spos[1]==0xff)){
+ skip_byte++;
+ len_remaining -= 2;
+ *(dpos++)=0xff;
+ spos+=2;
+ continue;
+ }
}
+ /* If we only have a single byte left, or there were no sequential 0xFF's, copy byte from src tvb to dest tvb */
*(dpos++)=*(spos++);
- l--;
+ len_remaining--;
}
- telnet_tvb = tvb_new_child_real_data(tvb, buf, len-skip, len-skip);
+ telnet_tvb = tvb_new_child_real_data(tvb, buf, len-skip_byte, len-skip_byte);
tvb_set_free_cb(telnet_tvb, g_free);
add_new_data_source(pinfo, telnet_tvb, "Processed Telnet Data");
@@ -790,7 +805,7 @@ clean_telnet_iac(packet_info *pinfo, tvbuff_t *tvb, int offset, int len)
}
/******************************************************************************************************/
-/* Execute dissection of Fast Meter configuration rames independent of any GUI access of said frames */
+/* Execute dissection of Fast Meter configuration frames independent of any GUI access of said frames */
/* Load configuration information into fm_config_frame struct */
/******************************************************************************************************/
static fm_config_frame* fmconfig_frame_fast(tvbuff_t *tvb)
@@ -843,6 +858,30 @@ static fm_config_frame* fmconfig_frame_fast(tvbuff_t *tvb)
}
/******************************************************************************************************/
+/* Execute dissection of Data Item definition info before loading GUI tree */
+/* Load configuration information into fastser_dataitem struct */
+/******************************************************************************************************/
+static fastser_dataitem* fastser_dataitem_save(tvbuff_t *tvb, int offset)
+{
+ /* Set up structures needed to add the protocol subtree and manage it */
+ fastser_dataitem *dataitem;
+
+ /* get a new dataitem and initialize it */
+ dataitem = (fastser_dataitem *)wmem_alloc(wmem_file_scope(), sizeof(fastser_dataitem));
+
+ /* retrieve data item name and terminate with a null */
+ tvb_memcpy(tvb, dataitem->name, offset, 10);
+ dataitem->name[10] = '\0'; /* Put a terminating null onto the end of the string */
+
+ /* retrieve data item quantity and type */
+ dataitem->quantity = tvb_get_ntohs(tvb, offset+10);
+ dataitem->data_type = tvb_get_ntohs(tvb, offset+12);
+
+ return dataitem;
+
+}
+
+/******************************************************************************************************/
/* Code to Dissect Relay Definition Frames */
/******************************************************************************************************/
static int
@@ -912,10 +951,10 @@ static int
dissect_fmconfig_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
{
/* Set up structures needed to add the protocol subtree and manage it */
- proto_item *fmconfig_item, *fmconfig_ai_item=NULL;
- proto_tree *fmconfig_tree, *fmconfig_ai_tree=NULL;
+ proto_item *fmconfig_item, *fmconfig_ai_item=NULL, *fmconfig_calc_item=NULL;
+ proto_tree *fmconfig_tree, *fmconfig_ai_tree=NULL, *fmconfig_calc_tree=NULL;
guint count;
- guint8 len, num_ai;
+ guint8 len, num_ai, num_calc;
gchar ai_name[FM_CONFIG_ANA_CHNAME_LEN+1]; /* 6 Characters + a Null */
len = tvb_get_guint8(tvb, offset);
@@ -925,7 +964,7 @@ dissect_fmconfig_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
num_ai = tvb_get_guint8(tvb, offset+4);
/* skip num_samp, position offset+5 */
/* skip num_dig, position offset+6 */
- /* skip num_calc, position offset+7 */
+ num_calc = tvb_get_guint8(tvb, offset+7);
fmconfig_item = proto_tree_add_text(tree, tvb, offset, len, "Fast Meter Configuration Details");
fmconfig_tree = proto_item_add_subtree(fmconfig_item, ett_selfm_fmconfig);
@@ -969,7 +1008,28 @@ dissect_fmconfig_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
offset += 10;
}
- /* XXX - Need to decode any Calculation block instances here in a future version, based on num_calc */
+ /* 14-byte Calculation block instances based on num_calc */
+ for (count = 0; count < num_calc; count++) {
+ fmconfig_calc_item = proto_tree_add_text(fmconfig_tree, tvb, offset, 14, "Calculation Block: %d", count+1);
+ fmconfig_calc_tree = proto_item_add_subtree(fmconfig_calc_item, ett_selfm_fmconfig_calc);
+
+ /* Rotation, Voltage Connection and Current Connection are all bit-masked on the same byte */
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_rot, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_vconn, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_iconn, tvb, offset, 1, ENC_BIG_ENDIAN);
+
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ctype, tvb, offset+1, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_deskew_ofs, tvb, offset+2, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_rs_ofs, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_xs_ofs, tvb, offset+6, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ia_idx, tvb, offset+8, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ib_idx, tvb, offset+9, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_ic_idx, tvb, offset+10, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_va_idx, tvb, offset+11, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_vb_idx, tvb, offset+12, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmconfig_calc_tree, hf_selfm_fmconfig_cblk_vc_idx, tvb, offset+13, 1, ENC_BIG_ENDIAN);
+ }
+
return tvb_length(tvb);
@@ -1034,7 +1094,7 @@ dissect_fmdata_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int of
cnt = cfg_data->num_ai; /* actual number of analog values to available to dissect */
- /* Update our current tvb offset to the actual AI offset saved the Configuration message */
+ /* Update our current tvb offset to the actual AI offset saved from the Configuration message */
offset = cfg_data->offset_ai;
/* Check that we actually have analog data to dissect */
@@ -1071,13 +1131,13 @@ dissect_fmdata_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int of
/* Channel size (in bytes) determined by data type */
switch (ai->type) {
case FM_CONFIG_ANA_CHTYPE_INT16:
- ch_size = FM_CONFIG_ANA_CHTYPE_INT16_LEN; /* 2 bytes */
+ ch_size = 2; /* 2 bytes */
break;
case FM_CONFIG_ANA_CHTYPE_FP:
- ch_size = FM_CONFIG_ANA_CHTYPE_FP_LEN; /* 4 bytes */
+ ch_size = 4; /* 4 bytes */
break;
case FM_CONFIG_ANA_CHTYPE_FPD:
- ch_size = FM_CONFIG_ANA_CHTYPE_FPD_LEN; /* 8 bytes */
+ ch_size = 8; /* 8 bytes */
break;
default:
break;
@@ -1261,6 +1321,47 @@ dissect_foconfig_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
}
/******************************************************************************************************/
+/* Code to Dissect Alternate Fast Operate (AFO) Configuration Frames */
+/******************************************************************************************************/
+static int
+dissect_alt_fastop_config_frame(tvbuff_t *tvb, proto_tree *tree, int offset)
+{
+/* Set up structures needed to add the protocol subtree and manage it */
+ proto_item *foconfig_item=NULL;
+ proto_tree *foconfig_tree=NULL;
+ guint8 len;
+
+ len = tvb_get_guint8(tvb, offset);
+
+ foconfig_item = proto_tree_add_text(tree, tvb, offset, len-2, "Alternate Fast Operate Configuration Details");
+ foconfig_tree = proto_item_add_subtree(foconfig_item, ett_selfm_foconfig);
+
+ /* Add items to protocol tree specific to Fast Operate Configuration Block */
+
+ /* Reported length */
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_len, tvb, offset, 1, ENC_BIG_ENDIAN);
+
+ /* Number of Ports */
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_num_ports, tvb, offset+1, 1, ENC_BIG_ENDIAN);
+
+ /* Number of Breaker Bits */
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_num_brkr, tvb, offset+2, 1, ENC_BIG_ENDIAN);
+
+ /* Number of Remote Bits */
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_num_rb, tvb, offset+3, 1, ENC_BIG_ENDIAN);
+
+ /* Function Code(s) Supported */
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+5, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+6, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+7, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(foconfig_tree, hf_selfm_alt_foconfig_funccode, tvb, offset+8, 1, ENC_BIG_ENDIAN);
+
+ return tvb_length(tvb);
+
+}
+
+/******************************************************************************************************/
/* Code to Dissect Fast Operate (Remote Bit or Breaker Bit) Frames */
/******************************************************************************************************/
static int
@@ -1308,8 +1409,281 @@ dissect_fastop_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int of
}
/******************************************************************************************************/
+/* Code to Dissect Alternate Fast Operate (AFO) Command Frames */
+/******************************************************************************************************/
+static int
+dissect_alt_fastop_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
+{
+/* Set up structures needed to add the protocol subtree and manage it */
+ proto_item *fastop_item;
+ proto_tree *fastop_tree;
+ guint8 len;
+ guint16 opcode;
+
+ len = tvb_get_guint8(tvb, offset);
+
+ fastop_item = proto_tree_add_text(tree, tvb, offset, len-2, "Alternate Fast Operate Details");
+ fastop_tree = proto_item_add_subtree(fastop_item, ett_selfm_fastop);
+
+ /* Add Reported length to tree */
+ proto_tree_add_item(fastop_tree, hf_selfm_alt_fastop_len, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset += 1;
+
+ /* Operate Code */
+ opcode = tvb_get_ntohs(tvb, offset);
+
+ /* Append Column Info w/ Control Code Code */
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", opcode);
+
+ proto_tree_add_item(fastop_tree, hf_selfm_alt_fastop_code, tvb, offset, 2, ENC_BIG_ENDIAN);
+
+ offset += 2;
+
+ /* Operate Code Validation */
+ proto_tree_add_item(fastop_tree, hf_selfm_alt_fastop_valid, tvb, offset, 2, ENC_BIG_ENDIAN);
+
+ return tvb_length(tvb);
+
+}
+
+/**************************************************************************************************************************/
+/* Code to dissect Fast SER Read Response Messages */
+/**************************************************************************************************************************/
+/* Each Read Response frame can have a maximum data size of 117 x 16-bit words (or 234 bytes) - this is due to the 20 */
+/* the 20 bytes of overhead and 254 max frame size. In the event of a larger data payload than 234 bytes, the FIR and FIN */
+/* bits will be used to indicate either the first frame, last frame, or a neither/middle frame. */
+/* We can use the FIN bit to attempt a reassembly of the data payload since all messages will arrive sequentially. */
+/**************************************************************************************************************************/
+
+static int
+dissect_fastser_readresp_frame(tvbuff_t *tvb, proto_tree *fastser_tree, packet_info *pinfo, int offset, guint8 seq_byte)
+{
+ /* Set up structures needed to add the protocol subtree and manage it */
+ proto_item *fastser_tag_item=NULL, *fastser_tag_value_item=NULL, *fmdata_dig_item=NULL;
+ proto_item *pi_fnum=NULL, *pi_type=NULL, *pi_qty=NULL;
+ proto_tree *fastser_tag_tree=NULL, *fmdata_dig_tree=NULL;
+ guint32 base_addr;
+ guint16 data_size, num_addr, cnt;
+ guint8 *item_val_str_ptr;
+ guint8 seq_cnt;
+ gboolean seq_fir, seq_fin, save_fragmented;
+ int payload_offset=0;
+ fm_conversation *conv;
+ fastser_dataitem *dataitem;
+ tvbuff_t *data_tvb, *payload_tvb;
+
+ /* Decode sequence byte components */
+ seq_cnt = seq_byte & FAST_SER_SEQ_CNT;
+ seq_fir = ((seq_byte & FAST_SER_SEQ_FIR) >> 7);
+ seq_fin = ((seq_byte & FAST_SER_SEQ_FIN) >> 6);
+
+ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */
+ num_addr = tvb_get_ntohs(tvb, offset+4); /* 16-bit field with number of 16-bit addresses to read */
+
+ /* Append Column Info w/ Base Address */
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
+
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_numwords, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ offset += 6;
+
+ /* Setup a new tvb representing just the data payload of this particular message */
+ data_tvb = tvb_new_subset( tvb, offset, (tvb_reported_length_remaining(tvb, offset)-2), (tvb_reported_length_remaining(tvb, offset)-2));
+
+ save_fragmented = pinfo->fragmented;
+
+ /* Check for fragmented packet by looking at the FIR and FIN bits */
+ if (! (seq_fir && seq_fin)) {
+ fragment_data *frag_msg;
+
+ /* This is a fragmented packet, mark it as such */
+ pinfo->fragmented = TRUE;
+
+ frag_msg = fragment_add_seq_next(&selfm_reassembly_table,
+ data_tvb, 0, pinfo, 0, NULL,
+ tvb_reported_length(data_tvb),
+ !seq_fin);
+
+ payload_tvb = process_reassembled_data(data_tvb, 0, pinfo,
+ "Reassembled Data Response Payload", frag_msg, &selfm_frag_items,
+ NULL, fastser_tree);
+
+ if (payload_tvb) { /* Reassembled */
+ /* We have the complete payload */
+ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Reassembled Data Response");
+ }
+ else
+ {
+ /* We don't have the complete reassembled payload. */
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Response Data Fragment %u" , seq_cnt);
+ }
+
+ }
+
+ /* No re-assembly required, setup the payload_tvb based on the single-frame data payload tvb */
+ else {
+ payload_tvb = data_tvb;
+ add_new_data_source(pinfo, payload_tvb, "Data Response Payload");
+ }
+
+ pinfo->fragmented = save_fragmented;
+
+ /* If we had no need to re-assemble or this is the final packet of a reassembly, let's attempt to dissect the */
+ /* data payload using any previously-captured data format information */
+ if (payload_tvb) {
+
+ /* Search for previously-encountered data format reference information to dissect the frame */
+ conv = (fm_conversation *)p_get_proto_data(pinfo->fd, proto_selfm, 0);
+
+ if (conv) {
+ /* Start at front of list and cycle through possible instances of multiple fastser_dataitem frames, looking for match */
+ wmem_slist_frame_t *frame = wmem_slist_front(conv->fastser_dataitems);
+
+ while (frame) {
+ dataitem = (fastser_dataitem *)wmem_slist_frame_data(frame);
+
+ /* If the stored base address of the current data item matches the current base address of this response frame */
+ /* mark that the config data was found and attempt further dissection */
+ if (dataitem->base_address == base_addr) {
+
+ /* Data Item size (in bytes) determined by data type and quantity within item */
+ switch (dataitem->data_type) {
+ case FAST_SER_TAGTYPE_CHAR8:
+ case FAST_SER_TAGTYPE_DIGWORD8_BL:
+ case FAST_SER_TAGTYPE_DIGWORD8:
+ data_size = 1 * dataitem->quantity; /* 1 byte per qty */
+ break;
+ case FAST_SER_TAGTYPE_CHAR16:
+ case FAST_SER_TAGTYPE_DIGWORD16_BL:
+ case FAST_SER_TAGTYPE_DIGWORD16:
+ case FAST_SER_TAGTYPE_INT16:
+ case FAST_SER_TAGTYPE_UINT16:
+ data_size = 2 * dataitem->quantity; /* 2 bytes per qty */
+ break;
+ case FAST_SER_TAGTYPE_INT32:
+ case FAST_SER_TAGTYPE_UINT32:
+ case FAST_SER_TAGTYPE_FLOAT:
+ data_size = 4 * dataitem->quantity; /* 4 bytes per qty */
+ break;
+
+ default:
+ data_size = 0;
+ break;
+ }
+
+ fastser_tag_item = proto_tree_add_text(fastser_tree, payload_tvb, payload_offset, data_size, "Data Item Name: %s", dataitem->name);
+ fastser_tag_tree = proto_item_add_subtree(fastser_tag_item, ett_selfm_fastser_tag);
+
+ /* Load some information from the stored Data Format Response message into the tree for reference */
+ pi_fnum = proto_tree_add_text(fastser_tag_tree, payload_tvb, payload_offset, data_size, "Using frame number %d (Index Pos: %d) as Data Format Reference",dataitem->fnum, dataitem->index_pos );
+ pi_type = proto_tree_add_text(fastser_tag_tree, payload_tvb, payload_offset, data_size, "Data_Type: %s (%#x)",
+ val_to_str_const(dataitem->data_type, selfm_fastser_tagtype_vals, "Unknown Data Type"), dataitem->data_type);
+ pi_qty = proto_tree_add_text(fastser_tag_tree, payload_tvb, payload_offset, data_size, "Quantity: %d",dataitem->quantity );
+
+ PROTO_ITEM_SET_GENERATED(pi_fnum);
+ PROTO_ITEM_SET_GENERATED(pi_type);
+ PROTO_ITEM_SET_GENERATED(pi_qty);
+
+ /* Data Item Type determines how to decode */
+ switch (dataitem->data_type) {
+
+ case FAST_SER_TAGTYPE_DIGWORD8_BL:
+ case FAST_SER_TAGTYPE_DIGWORD8:
+
+ fmdata_dig_tree = proto_item_add_subtree(fmdata_dig_item, ett_selfm_fmdata_dig);
+
+ for (cnt=1; cnt <= dataitem->quantity; cnt++) {
+
+ fmdata_dig_item = proto_tree_add_text(fastser_tag_tree, payload_tvb, payload_offset, 1, "8-bit Binary Items (Row: %d)", cnt);
+ fmdata_dig_tree = proto_item_add_subtree(fmdata_dig_item, ett_selfm_fmdata_dig);
+
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b0, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b1, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b2, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b3, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b4, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b5, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b6, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fmdata_dig_tree, hf_selfm_fmdata_dig_b7, payload_tvb, payload_offset, 1, ENC_BIG_ENDIAN);
+
+ payload_offset += 1;
+
+ }
+
+ break;
+
+ case FAST_SER_TAGTYPE_CHAR8:
+ case FAST_SER_TAGTYPE_CHAR16:
+ item_val_str_ptr = tvb_get_ephemeral_string(payload_tvb, payload_offset, data_size);
+ proto_tree_add_text(fastser_tag_tree, payload_tvb, payload_offset, data_size, "Value: %s", item_val_str_ptr);
+ payload_offset += data_size;
+ break;
+
+ case FAST_SER_TAGTYPE_INT16:
+ for (cnt=1; cnt <= dataitem->quantity; cnt++) {
+ fastser_tag_value_item = proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_dataitem_int16, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN);
+ proto_item_prepend_text(fastser_tag_value_item, "Value %d ", cnt);
+ payload_offset += data_size/dataitem->quantity;
+ }
+ break;
+
+ case FAST_SER_TAGTYPE_UINT16:
+ for (cnt=1; cnt <= dataitem->quantity; cnt++) {
+ fastser_tag_value_item = proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_dataitem_uint16, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN);
+ proto_item_prepend_text(fastser_tag_value_item, "Value %d ", cnt);
+ payload_offset += data_size/dataitem->quantity;
+ }
+ break;
+
+ case FAST_SER_TAGTYPE_INT32:
+ for (cnt=1; cnt <= dataitem->quantity; cnt++) {
+ fastser_tag_value_item = proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_dataitem_int32, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN);
+ proto_item_prepend_text(fastser_tag_value_item, "Value %d ", cnt);
+ payload_offset += data_size/dataitem->quantity;
+ }
+ break;
+
+ case FAST_SER_TAGTYPE_UINT32:
+ for (cnt=1; cnt <= dataitem->quantity; cnt++) {
+ fastser_tag_value_item = proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_dataitem_uint32, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN);
+ proto_item_prepend_text(fastser_tag_value_item, "Value %d ", cnt);
+ payload_offset += data_size/dataitem->quantity;
+ }
+ break;
+
+ case FAST_SER_TAGTYPE_FLOAT:
+ for (cnt=1; cnt <= dataitem->quantity; cnt++) {
+ fastser_tag_value_item = proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_dataitem_float, payload_tvb, payload_offset, data_size/dataitem->quantity, ENC_BIG_ENDIAN);
+ proto_item_prepend_text(fastser_tag_value_item, "Value %d ", cnt);
+ payload_offset += data_size/dataitem->quantity;
+ }
+ break;
+
+ default:
+ break;
+ } /* data item type switch */
+
+ } /* base address is correct */
+
+ /* After processing this frame/data item, proceed to the next */
+ frame = wmem_slist_frame_next(frame);
+
+ } /* while (frame) */
+
+ } /* if (conv) found */
+
+ } /* if payload_tvb */
+
+ /* Update the offset field before we leave this frame */
+ offset += num_addr*2;
+
+ return offset;
+
+}
+
+
+/******************************************************************************************************/
/* Code to dissect Fast SER Frames */
-/* Some protocol structure is guessed at */
/******************************************************************************************************/
static int
dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset)
@@ -1319,7 +1693,7 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
proto_item *fastser_element_item=NULL, *fastser_datareg_item=NULL, *fastser_tag_item=NULL;
proto_tree *fastser_tree, *fastser_def_fc_tree=NULL, *fastser_seq_tree=NULL, *fastser_elementlist_tree=NULL;
proto_tree *fastser_element_tree=NULL, *fastser_datareg_tree=NULL, *fastser_tag_tree=NULL;
- gint cnt, num_elements, elmt_status32_ofs=0, elmt_status;
+ gint cnt, num_elements, elmt_status32_ofs=0, elmt_status, null_offset;
guint8 len, funccode, seq, rx_num_fc, tx_num_fc;
guint8 seq_cnt, seq_fir, seq_fin, elmt_idx, fc_enable;
guint8 *fid_str_ptr, *rid_str_ptr, *region_name_ptr, *tag_name_ptr;
@@ -1353,40 +1727,6 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
offset += 1;
/* Get Sequence Byte, add to Tree */
- /* Some more decoding may be required here, format of this byte for multi-frame messages is guessed */
- /* based on observations from communications */
- /* 0x80 - First Message */
- /* 0x40 - Final Message */
- /* 0x3f - Sequence Count */
- /* Sequence Byte(s): */
- /* SEL-2411 */
- /* 0xC0 (11000000) - single frame req message m->r or r->m */
- /* 0x80 (10000000) - multi-frame message r->m */
- /* 0xC1 (11000001) - next scan after multi-frame message response m->r */
- /* 0x41 (01000001) - final response of multi-frame message r->m */
- /* SEL-735 */
- /* 0xC0 (11000000) - single frame req message m->r or r->m */
- /* 0x80 (10000000) - multi-frame message r->m */
- /* 0xC1 (11000001) - next scan after multi-frame message response m->r */
- /* 0x01 (00000001) - continued response of multi-frame message r->m */
- /* 0xC2 (11000010) - next scan after multi-frame message response m->r */
- /* 0x02 (00000010) - continued response of multi-frame message r->m */
- /* 0xC3 (11000011) - next scan after multi-frame message response m->r */
- /* 0x43 (01000011) - final response of multi-frame message r->m */
- /* SEL-421 */
- /* 0xC0 (11000000) - single frame req message m->r or r->m */
- /* 0x80 (10000000) - multi-frame message r->m */
- /* 0xC1 (11000001) - next scan after multi-frame message response m->r */
- /* 0x01 (00000001) - continued response of multi-frame message r->m */
- /* 0xC2 (11000010) - next scan after multi-frame message response m->r */
- /* 0x02 (00000010) - continued response of multi-frame message r->m */
- /* 0xC3 (11000011) - next scan after multi-frame message response m->r */
- /* 0x03 (00000011) - continued response of multi-frame message r->m */
- /* 0xC4 (11000100) - next scan after multi-frame message response m->r */
- /* 0x04 (00000100) - continued response of multi-frame message r->m */
- /* 0xC5 (11000100) - next scan after multi-frame message response m->r */
- /* 0x45 (01000101) - final response of multi-frame message r->m */
-
seq = tvb_get_guint8(tvb, offset);
seq_cnt = seq & FAST_SER_SEQ_CNT;
seq_fir = seq & FAST_SER_SEQ_FIR;
@@ -1409,114 +1749,70 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
/* Depending on Function Code used, remaining section of packet will be handled differently. */
switch (funccode) {
- case FAST_SER_MESSAGE_DEF_ACK: /* 0x80 (resp to 0x00) - Fast SER Message Definition Acknowledge */
-
- /* Routing Support */
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_route_sup, tvb, offset, 1, ENC_BIG_ENDIAN);
- offset += 1;
-
- /* RX / TX Status */
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_rx_stat, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_tx_stat, tvb, offset+1, 1, ENC_BIG_ENDIAN);
- offset += 2;
-
- /* Max Frames RX/TX */
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_rx_maxfr, tvb, offset, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_tx_maxfr, tvb, offset+1, 1, ENC_BIG_ENDIAN);
- offset += 2;
-
- /* 6 bytes of reserved space */
- offset += 6;
-
- /* Number of Supported RX Function Codes */
- rx_num_fc = tvb_get_guint8(tvb, offset);
- fastser_def_fc_item = proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_rx_num_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
- fastser_def_fc_tree = proto_item_add_subtree(fastser_def_fc_item, ett_selfm_fastser_def_fc);
- offset += 1;
-
- /* Add Supported RX Function Codes to tree */
- for (cnt=0; cnt<rx_num_fc; cnt++) {
- proto_tree_add_item(fastser_def_fc_tree, hf_selfm_fastser_def_rx_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
- offset += 2;
- }
-
- /* Number of Supported TX Function Codes */
- tx_num_fc = tvb_get_guint8(tvb, offset);
- fastser_def_fc_item = proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_tx_num_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
- fastser_def_fc_tree = proto_item_add_subtree(fastser_def_fc_item, ett_selfm_fastser_def_fc);
- offset += 1;
-
- /* Add Supported TX Function Codes to tree */
- for (cnt=0; cnt<tx_num_fc; cnt++) {
- proto_tree_add_item(fastser_def_fc_tree, hf_selfm_fastser_def_tx_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
- offset += 2;
- }
-
- break;
case FAST_SER_EN_UNS_DATA: /* 0x01 - Enabled Unsolicited Data Transfers */
- /* Function code to enable */
- fc_enable = tvb_get_guint8(tvb, offset);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_en_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
+ /* Function code to enable */
+ fc_enable = tvb_get_guint8(tvb, offset);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_en_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
- /* Append Column Info w/ "Enable" Function Code */
- col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Function to Enable (%#x)", fc_enable);
+ /* Append Column Info w/ "Enable" Function Code */
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Function to Enable (%#x)", fc_enable);
- /* 3-byte Function Code data */
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_en_fc_data, tvb, offset+1, 3, ENC_NA);
+ /* 3-byte Function Code data */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_en_fc_data, tvb, offset+1, 3, ENC_NA);
- offset += 4;
+ offset += 4;
- break;
+ break;
case FAST_SER_DIS_UNS_DATA: /* 0x02 - Disable Unsolicited Data Transfers */
- /* Function code to disable */
- fc_enable = tvb_get_guint8(tvb, offset);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_dis_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
+ /* Function code to disable */
+ fc_enable = tvb_get_guint8(tvb, offset);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_dis_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
- /* Append Column Info w/ "Disable" Function Code */
- col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Function to Disable (%#x)", fc_enable);
+ /* Append Column Info w/ "Disable" Function Code */
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "Function to Disable (%#x)", fc_enable);
- /* 1-byte Function Code data */
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_dis_fc_data, tvb, offset+1, 1, ENC_NA);
+ /* 1-byte Function Code data */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_uns_dis_fc_data, tvb, offset+1, 1, ENC_NA);
- offset += 2;
-
- break;
+ offset += 2;
+ break;
- case FAST_SER_READ_REQ: /* 0x10 - Read Request - unknown full structure */
- offset += 2; /* 2 unknown bytes */
+ case FAST_SER_READ_REQ: /* 0x10 - Read Request */
- base_addr = tvb_get_ntohs(tvb, offset); /* unknown - 16-bit field with base address to read? */
+ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */
/* Append Column Info w/ Base Address */
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_read_baseaddr, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_read_numaddr, tvb, offset+2, 2, ENC_BIG_ENDIAN);
- offset += 4;
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_numwords, tvb, offset+4, 2, ENC_BIG_ENDIAN);
+ offset += 6;
break;
- case FAST_SER_READ_RESP: /* 0x90 (resp to 0x10) - Read Response - unknown full structure */
+ case FAST_SER_GEN_UNS_DATA: /* 0x12 - Generic Unsolicited Data */
- offset += 2; /* 2 unknown bytes */
+ num_addr = len - 14; /* 12 header bytes + 2-byte CRC, whatever is left is the data portion of this message */
+ num_reg = num_addr / 2;
- base_addr = tvb_get_ntohs(tvb, offset); /* unknown - 16-bit field with base address to read? */
- num_addr = tvb_get_ntohs(tvb, offset+2); /* unknown - 16-bit field with number of 16-bit addresses to read? */
+ /* For the number of registers, step through and retrieve/print each 16-bit component */
+ for (cnt=0; cnt < num_reg; cnt++) {
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_unswrite_reg_val, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+ }
- /* Append Column Info w/ Base Address */
- col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
+ break;
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_read_baseaddr, tvb, offset, 2, ENC_BIG_ENDIAN);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_read_numaddr, tvb, offset+2, 2, ENC_BIG_ENDIAN);
- offset += 4;
+ case FAST_SER_SOE_STATE_REQ: /* 0x16 - SOE Present State Request */
- /* Skip over read response data, we'll be able to format and decode this later once specifications are out */
- offset += num_addr*2;
+ /* 4 bytes - "Origination Path" */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_req_orig, tvb, offset, 4, ENC_NA);
+ offset += 4;
break;
@@ -1616,7 +1912,101 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
break;
- case FAST_SER_DEVDESC_RESP: /* 0xB0 - Device Description Response - unknown full structure */
+ case FAST_SER_DATAFMT_REQ: /* 0x31 - Data Format Request */
+
+ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ /* Append Column Info w/ Base Address */
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
+
+ break;
+
+ case FAST_SER_BITLABEL_REQ: /* 0x33 - Bit Label Request */
+
+ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
+
+ /* Append Column Info w/ Base Address */
+ col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
+
+ break;
+
+
+ case FAST_SER_MESSAGE_DEF_ACK: /* 0x80 (resp to 0x00) - Fast SER Message Definition Acknowledge */
+
+ /* Routing Support */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_route_sup, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset += 1;
+
+ /* RX / TX Status */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_rx_stat, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_tx_stat, tvb, offset+1, 1, ENC_BIG_ENDIAN);
+ offset += 2;
+
+ /* Max Frames RX/TX */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_rx_maxfr, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_tx_maxfr, tvb, offset+1, 1, ENC_BIG_ENDIAN);
+ offset += 2;
+
+ /* 6 bytes of reserved space */
+ offset += 6;
+
+ /* Number of Supported RX Function Codes */
+ rx_num_fc = tvb_get_guint8(tvb, offset);
+ fastser_def_fc_item = proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_rx_num_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
+ fastser_def_fc_tree = proto_item_add_subtree(fastser_def_fc_item, ett_selfm_fastser_def_fc);
+ offset += 1;
+
+ /* Add Supported RX Function Codes to tree */
+ for (cnt=0; cnt<rx_num_fc; cnt++) {
+ proto_tree_add_item(fastser_def_fc_tree, hf_selfm_fastser_def_rx_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset += 2;
+ }
+
+ /* Number of Supported TX Function Codes */
+ tx_num_fc = tvb_get_guint8(tvb, offset);
+ fastser_def_fc_item = proto_tree_add_item(fastser_tree, hf_selfm_fastser_def_tx_num_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
+ fastser_def_fc_tree = proto_item_add_subtree(fastser_def_fc_item, ett_selfm_fastser_def_fc);
+ offset += 1;
+
+ /* Add Supported TX Function Codes to tree */
+ for (cnt=0; cnt<tx_num_fc; cnt++) {
+ proto_tree_add_item(fastser_def_fc_tree, hf_selfm_fastser_def_tx_fc, tvb, offset, 1, ENC_BIG_ENDIAN);
+ offset += 2;
+ }
+
+ break;
+
+ case FAST_SER_READ_RESP: /* 0x90 (resp to 0x10) - Read Response */
+
+ offset = dissect_fastser_readresp_frame( tvb, fastser_tree, pinfo, offset, seq);
+
+ break;
+
+ case FAST_SER_SOE_STATE_RESP: /* 0x96 - (resp to 0x16) SOE Present State Response */
+
+
+ /* 16-bit field with number of blocks of present state data */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_numblks, tvb, offset, 2, ENC_BIG_ENDIAN);
+ offset += 2;
+
+ /* XXX - With examples, need to loop through each one of these items based on the num_blocks */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_orig, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_numbits, tvb, offset+4, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_pad, tvb, offset+5, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_doy, tvb, offset+6, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_year, tvb, offset+8, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_tod, tvb, offset+10, 4, ENC_BIG_ENDIAN);
+ /* proto_tree_add_item(fastser_tree, hf_selfm_fastser_soe_resp_data, tvb, offset+14, 2, ENC_BIG_ENDIAN); */
+
+ offset += 14;
+
+ break;
+
+ case FAST_SER_DEVDESC_RESP: /* 0xB0 (resp to 0x30) - Device Description Response */
fid_str_ptr = tvb_get_ephemeral_string(tvb, offset, 50); /* Add FID / RID ASCII data to tree */
rid_str_ptr = tvb_get_ephemeral_string(tvb, offset+50, 40);
@@ -1624,110 +2014,105 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
proto_tree_add_text(fastser_tree, tvb, offset+50, 40, "RID: %s", rid_str_ptr);
offset += 90;
- /* unknown - 16-bit field with number of data regions? */
+ /* 16-bit field with number of data areas */
num_reg = tvb_get_ntohs(tvb, offset);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_devdesc_num_reg, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_devdesc_num_region, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- /* 2 unknown bytes */
+ /* Maximum size of 7 regions per message, check the seq_cnt to determine if we have stepped into
+ the next sequential message where the remaining regions would be described */
+ if ((num_reg >= 8) && (seq_cnt == 0)) {
+ num_reg = 7;
+ }
+ else{
+ num_reg = num_reg - (seq_cnt * 7);
+ }
+
+ /* 16-bit field with number of control areas */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_devdesc_num_ctrl, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- /* exact arrangement of these regions are unknown, but I think believe we have a 12 byte region name,
- followed by 16-bit base and address count fields */
+ /* Each 18-byte data area description has a 10 byte region name, followed by 32-bit base, */
+ /* 16-bit message word count and 16-bit flag field */
for (cnt=0; cnt<num_reg; cnt++) {
fastser_datareg_item = proto_tree_add_text(fastser_tree, tvb, offset, 18, "Fast SER Data Region #%d", cnt+1);
fastser_datareg_tree = proto_item_add_subtree(fastser_datareg_item, ett_selfm_fastser_datareg);
- region_name_ptr = tvb_get_ephemeral_string(tvb, offset, 12);
- proto_tree_add_text(fastser_datareg_tree, tvb, offset, 12, "Data Region Name: %s", region_name_ptr);
- offset += 12;
+ /* 10-Byte Region description */
+ region_name_ptr = tvb_get_ephemeral_string(tvb, offset, 10);
+ proto_tree_add_text(fastser_datareg_tree, tvb, offset, 10, "Data Region Name: %s", region_name_ptr);
+ offset += 10;
- /* unknown - 16-bit field with base address of data region? */
- proto_tree_add_item(fastser_datareg_tree, hf_selfm_fastser_read_baseaddr, tvb, offset, 2, ENC_BIG_ENDIAN);
- offset += 2;
+ /* 32-bit field with base address of data region */
+ proto_tree_add_item(fastser_datareg_tree, hf_selfm_fastser_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
- /* unknown - 16-bit field with number of addresses in data region? */
- proto_tree_add_item(fastser_datareg_tree, hf_selfm_fastser_read_numaddr, tvb, offset, 2, ENC_BIG_ENDIAN);
+ /* 16-bit field with number of 16-bit words in region */
+ proto_tree_add_item(fastser_datareg_tree, hf_selfm_fastser_numwords, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
- /* 2 unknown bytes */
+ /* 16-bit flag field */
+ proto_tree_add_item(fastser_datareg_tree, hf_selfm_fastser_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
}
- break;
- case FAST_SER_DATAFMT_REQ: /* 0x31 - Data Format Request - unknown full structure */
-
- /* 2 unknown bytes */
- offset += 2;
-
- /* unknown - 16-bit field with base address to read? */
- base_addr = tvb_get_ntohs(tvb, offset);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_read_baseaddr, tvb, offset, 2, ENC_BIG_ENDIAN);
- offset += 2;
+ /* Some relays (4xx) don't follow the standard here and include an 8-byte sequence of all 0x00's to represent */
+ /* 'reserved' space for the control regions. Detect these and skip if they are present */
+ for (cnt = offset; cnt < len; cnt++) {
- /* Append Column Info w/ Base Address */
- col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
+ if (tvb_memeql(tvb, cnt, "\x00\x00\x00\x00\x00\x00\x00\x00", 8) == 0) {
+ offset = cnt+8;
+ }
+ }
break;
- case FAST_SER_DATAFMT_RESP: /* 0xB1 - Data Format Response - unknown full structure */
-
- /* 2 unknown bytes */
- offset += 2;
+ case FAST_SER_DATAFMT_RESP: /* 0xB1 (resp to 0x31) - Data Format Response */
- /* unknown - 16-bit field with base address to read? */
- base_addr = tvb_get_ntohs(tvb, offset);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_read_baseaddr, tvb, offset, 2, ENC_BIG_ENDIAN);
- offset += 2;
+ base_addr = tvb_get_ntohl(tvb, offset); /* 32-bit field with base address to read */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_baseaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
+ offset += 4;
/* Append Column Info w/ Base Address */
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
- /* unknown - 16-bit field with number of tags to follow? */
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_datafmt_resp_num_tag, tvb, offset, 2, ENC_BIG_ENDIAN);
+ /* 16-bit field with number of data items to follow */
+ proto_tree_add_item(fastser_tree, hf_selfm_fastser_datafmt_resp_numitem, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
while ((tvb_reported_length_remaining(tvb, offset)) > 2) {
- tag_name_ptr = tvb_get_ephemeral_string(tvb, offset, 11); /* unknown field - Tag name 11 bytes? */
- fastser_tag_item = proto_tree_add_text(fastser_tree, tvb, offset, 14, "Tag Name: %s", tag_name_ptr);
+ tag_name_ptr = tvb_get_ephemeral_string(tvb, offset, 10); /* Data Item record name 10 bytes */
+ fastser_tag_item = proto_tree_add_text(fastser_tree, tvb, offset, 14, "Data Item Record Name: %s", tag_name_ptr);
fastser_tag_tree = proto_item_add_subtree(fastser_tag_item, ett_selfm_fastser_tag);
- /* Unknown 3 bytes that follow */
- /* 01 - Quantity of Values within Tag */
- /* 02 - Unused ??? */
- /* 03 - Data Type of Tag */
- proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_datafmt_resp_tag_qty, tvb, offset+11, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_datafmt_resp_tag_type, tvb, offset+13, 1, ENC_BIG_ENDIAN);
+ /* Data item qty and type */
+ proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_dataitem_qty, tvb, offset+10, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(fastser_tag_tree, hf_selfm_fastser_dataitem_type, tvb, offset+12, 2, ENC_BIG_ENDIAN);
offset += 14;
}
break;
- case FAST_SER_BITLABEL_REQ: /* 0x33 - Bit Label Request - unknown full structure */
+ case FAST_SER_BITLABEL_RESP: /* 0xB3 (resp to 0x33) - Bit Label Response */
- /* 2 unknown bytes */
- offset += 2;
+ /* The data in this response is a variable length string containing the names of 8 digital bits. */
+ /* Each name is max 8 chars and each is null-seperated */
+ cnt=1;
- /* unknown - 16-bit field with base address to read? */
- base_addr = tvb_get_ntohs(tvb, offset);
- proto_tree_add_item(fastser_tree, hf_selfm_fastser_read_baseaddr, tvb, offset, 2, ENC_BIG_ENDIAN);
- offset += 2;
+ /* find the null separators and add the bit label text strings to the tree */
+ for (null_offset = offset; null_offset < len; null_offset++) {
+ if ((tvb_memeql(tvb, null_offset, "\x00", 1) == 0) && (tvb_reported_length_remaining(tvb, offset) > 2)) {
+ proto_tree_add_text(fastser_tree, tvb, offset, (null_offset-offset), "Bit Label #%d Name: %s", cnt,
+ tvb_format_text(tvb, offset, (null_offset-offset)));
+ offset = null_offset+1; /* skip the null */
+ cnt++;
+ }
+ }
- /* Append Column Info w/ Base Address */
- col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%#x", base_addr);
break;
- case FAST_SER_BITLABEL_RESP: /* 0xB3 - Bit Label Response - unknown full structure */
-
- /* Variable length string containing the names of 8 digital bits. Each name is max 8 chars and each is null-seperated */
- proto_tree_add_text(fastser_tree, tvb, offset, (tvb_reported_length_remaining(tvb, offset)-2), "Bit Label Data %s",
- tvb_format_text(tvb, offset, (tvb_reported_length_remaining(tvb, offset)-2)));
-
- /* Skip over variable-length string */
- offset += (tvb_reported_length_remaining(tvb, offset)-2);
-
default:
break;
} /* func_code */
@@ -1745,69 +2130,114 @@ dissect_fastser_frame(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int o
/* Will call other sub-dissectors, as needed */
/******************************************************************************************************/
static void
-dissect_selfm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+dissect_selfm(tvbuff_t *selfm_tvb, packet_info *pinfo, proto_tree *tree)
{
/* Set up structures needed to add the protocol subtree and manage it */
proto_item *selfm_item=NULL;
proto_tree *selfm_tree=NULL;
- int offset=0;
- guint16 msg_type, len;
- tvbuff_t *selfm_tvb;
+ int offset=0, cnt=0;
+ guint32 base_addr;
+ guint16 msg_type, len, num_items;
+ guint8 seq, seq_cnt;
/* Make entries in Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SEL Fast Msg");
col_clear(pinfo->cinfo, COL_INFO);
- len = tvb_length(tvb);
-
- /* If this is a Telnet-encapsulated Ethernet, let's clean out the IAC 0xFF instances */
- if ((pinfo->srcport) && selfm_telnet_clean) {
- selfm_tvb=clean_telnet_iac(pinfo, tvb, offset, len);
- }
- else {
- selfm_tvb = tvb_new_subset( tvb, offset, len, len);
- }
+ len = tvb_length(selfm_tvb);
msg_type = tvb_get_ntohs(selfm_tvb, offset);
- /* Configuration (0xA5C1, 0xA5C2, 0xA5C3) and corresponding data frames (0xA5D1, 0xA5D2, 0xA5D3)
- * need special treatment during the first run:
- * For Fast Meter Configuration frames (0xA5C1), a 'fm_config_frame' struct is created to hold the
- * information necessary to decode subsequent Fast Meter Data frames (0xA5D1). A pointer to this
- * struct is saved in the conversation and is copied to the per-packet information if a
- * Fast Meter Data frame is dissected.
- */
+ /* On first pass through the packets we have 3 tasks to complete */
if (!pinfo->fd->flags.visited) {
- conversation_t *conversation;
- fm_conversation *conv_data;
+ conversation_t *conversation;
+ fm_conversation *fm_conv_data;
/* Find a conversation, create a new if no one exists */
conversation = find_or_create_conversation(pinfo);
- conv_data = (fm_conversation *)conversation_get_proto_data(conversation, proto_selfm);
+ fm_conv_data = (fm_conversation *)conversation_get_proto_data(conversation, proto_selfm);
- if (conv_data == NULL) {
- conv_data = (fm_conversation *)wmem_alloc(wmem_file_scope(), sizeof(fm_conversation));
- conv_data->fm_config_frames = wmem_slist_new(wmem_file_scope());
- conversation_add_proto_data(conversation, proto_selfm, (void *)conv_data);
+ if (fm_conv_data == NULL) {
+ fm_conv_data = (fm_conversation *)wmem_alloc(wmem_file_scope(), sizeof(fm_conversation));
+ fm_conv_data->fm_config_frames = wmem_slist_new(wmem_file_scope());
+ fm_conv_data->fastser_dataitems = wmem_slist_new(wmem_file_scope());
+ conversation_add_proto_data(conversation, proto_selfm, (void *)fm_conv_data);
}
- p_add_proto_data(pinfo->fd, proto_selfm, 0, conv_data);
+ p_add_proto_data(pinfo->fd, proto_selfm, 0, fm_conv_data);
+ /* 1. Configuration frames (0xA5C1, 0xA5C2, 0xA5C3) need special treatment during the first run */
+ /* For each Fast Meter Configuration frame (0xA5Cx), a 'fm_config_frame' struct is created to hold the */
+ /* information necessary to decode subsequent matching Fast Meter Data frames (0xA5Dx). A pointer to */
+ /* this struct is saved in the conversation and is copied to the per-packet information if a */
+ /* Fast Meter Data frame is dissected. */
if ((CMD_FM_CONFIG == msg_type) || (CMD_DFM_CONFIG == msg_type) || (CMD_PDFM_CONFIG == msg_type)) {
/* Fill the fm_config_frame */
fm_config_frame *frame_ptr = fmconfig_frame_fast(selfm_tvb);
frame_ptr->fnum = pinfo->fd->num;
- wmem_slist_prepend(conv_data->fm_config_frames, frame_ptr);
+ wmem_slist_prepend(fm_conv_data->fm_config_frames, frame_ptr);
}
- } /* if (!visited) */
+ /* 2. Fill conversation data array with Fast SER Data Item data from Data Format Response Messages. */
+ /* These format definitions will later be retrieved to decode Read Response messages. */
+ if ((CMD_FAST_SER == msg_type) && (tvb_get_guint8(selfm_tvb, offset+9) == FAST_SER_DATAFMT_RESP)) {
+
+ seq = tvb_get_guint8(selfm_tvb, offset+10);
+ seq_cnt = seq & FAST_SER_SEQ_CNT;
+
+ base_addr = tvb_get_ntohl(selfm_tvb, offset+12); /* 32-bit field with base address to read */
+ num_items = tvb_get_ntohs(selfm_tvb, offset+16);
+
+ /* When dealing with Data Format Response messages, there are a maximum of 16 items per frame */
+ /* Use the sequence count if we have more 16 items to determine how many to expect in each frame */
+ if ((num_items > 16) && (seq_cnt == 0)) {
+ num_items = 16;
+ }
+ else {
+ num_items = num_items - (seq_cnt * 16);
+ }
+
+ /* Set offset to start of data items */
+ offset = 18;
+
+ /* Enter the single frame multiple times, retrieving a single dataitem per entry */
+ for (cnt = 1; (cnt <= num_items); cnt++) {
+ fastser_dataitem *dataitem_ptr = fastser_dataitem_save(selfm_tvb, offset);
+ dataitem_ptr->fnum = pinfo->fd->num;
+ dataitem_ptr->base_address = base_addr;
+ dataitem_ptr->index_pos = cnt;
+
+ /* Store the data item configuration info in the fastser_dataitems slist */
+ wmem_slist_append(fm_conv_data->fastser_dataitems, dataitem_ptr);
+ offset = offset + 14;
+ }
+ }
+
+ /* 3. Attempt re-assembly during first pass with Read Response Messages data payloads that span multiple */
+ /* packets. The final data payload will be assembled on the packet with the seq_fin bit set. */
+ if ((CMD_FAST_SER == msg_type) && (tvb_get_guint8(selfm_tvb, offset+9) == FAST_SER_READ_RESP)) {
+
+ seq = tvb_get_guint8(selfm_tvb, offset+10);
+
+ /* Set offset to where the dissect_fastser_readresp_frame function would normally be called, */
+ /* right before base address & num_items */
+ offset = 12;
+
+ /* Call the same read response function that will be called during GUI dissection */
+ offset = dissect_fastser_readresp_frame( selfm_tvb, tree, pinfo, offset, seq);
+
+ }
+
+
+ } /* if (!visited) */
if (tree) {
selfm_item = proto_tree_add_protocol_format(tree, proto_selfm, selfm_tvb, 0, len, "SEL Fast Message");
selfm_tree = proto_item_add_subtree(selfm_item, ett_selfm);
+ /* Set INFO column with SEL Protocol Message Type */
col_clear(pinfo->cinfo, COL_INFO); /* clear out stuff in the info column */
col_add_fstr(pinfo->cinfo, COL_INFO, "%s", val_to_str_const(msg_type, selfm_msgtype_vals, "Unknown Message Type"));
@@ -1845,6 +2275,16 @@ dissect_selfm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case CMD_FASTOP_BR_CTRL:
dissect_fastop_frame(selfm_tvb, selfm_tree, pinfo, offset);
break;
+ case CMD_ALT_FASTOP_CONFIG:
+ dissect_alt_fastop_config_frame(selfm_tvb, selfm_tree, offset);
+ break;
+ case CMD_ALT_FASTOP_OPEN:
+ case CMD_ALT_FASTOP_CLOSE:
+ case CMD_ALT_FASTOP_SET:
+ case CMD_ALT_FASTOP_CLEAR:
+ case CMD_ALT_FASTOP_PULSE:
+ dissect_alt_fastop_frame(selfm_tvb, selfm_tree, pinfo, offset);
+ break;
default:
break;
} /* msg_type */
@@ -1856,100 +2296,18 @@ dissect_selfm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/******************************************************************************************************/
/* Return length of SEL Protocol over TCP message (used for re-assembly) */
/* SEL Protocol "Scan" messages are generally 2-bytes in length and only include a 16-bit message type */
-/* SEL Protocol "Response" messages include a "length" byte in each response message but an issue */
-/* is that the "length" byte does not always line up with the actual length of the data packet due to */
-/* Telnet 0xFF pad bytes (as documented elsewhere). Make a best-guess "total size" effort here. */
+/* SEL Protocol "Response" messages include a "length" byte in offset 2 of each response message */
/******************************************************************************************************/
static guint
get_selfm_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset _U_)
{
guint message_len=0; /* message length, inclusive of header, data, crc */
- guint16 msg_type;
+ /* Get length byte from message */
if (tvb_length(tvb) > 2) {
- msg_type = tvb_get_ntohs(tvb, 0);
-
- switch (msg_type) {
- case CMD_FM_CONFIG:
- /* 0xA5C1 messages have reported lengths, but extra 0xFF pad bytes strewn about in 'Telnet' mode */
- /* Attempt to guess the length by using the num_ai (normal size 10 bytes) and num_calc (normal size 15 bytes) block fields */
- /* If the number of scale factors is 0 (offset 5) then there will be 1 extra 0xFFs per num_ai (offset 6) */
- /* Number of calculation blocks (offset 9) will typically produce a minimum of 20 bytes including padding */
- /* 18 bytes of hardcoded data are: hdr(2), len, flag, sf_loc, sf_num, ai_num, samp_num,
- dig_num, num_calc, ai_ofs(2), ts_ofs(2), dig_ofs(2), pad, crc */
-
- /* Only attempt to retrieve bytes that we know will exist */
- if (tvb_length(tvb) > 10) {
- if (tvb_get_guint8(tvb, 5) != 0) {
- message_len = ((tvb_get_guint8(tvb, 6) * 10) + (tvb_get_guint8(tvb, 9) * 20) + 18);
- }
- else {
- message_len = ((tvb_get_guint8(tvb, 6) * 11) + (tvb_get_guint8(tvb, 9) * 20) + 18);
- }
- }
- /* Otherwise we can fall back on the length byte */
- else {
- message_len = tvb_get_guint8(tvb, 2);
- }
-
- /* After calculating theoretical length, check if actual length of tvb is longer. In that case, use the tvb length */
- if (message_len < tvb_length(tvb)) {
- message_len = tvb_length(tvb);
- }
-
- break;
-
- case CMD_DFM_CONFIG:
- case CMD_PDFM_CONFIG:
- /* 0xA5C2/C2 messages have reported lengths, but typically extra 0xFF pad bytes strewn about in Telnet mode */
- /* Attempt to guess the length by using the num_ai (normal size 11 bytes) and harcoded fields */
- /* 20 bytes of hardcoded data are: hdr(2), len, flag, sf_loc, sf_num, ai_num, samp_num,
- dig_num, num_calc, ai_ofs(2), ts_ofs(2), dig_ofs(4), pad, crc */
-
- /* Only attempt to retrieve bytes that we know will exist */
- if (tvb_length(tvb) > 7) {
- message_len = ((tvb_get_guint8(tvb, 6) * 11) + 20);
- }
- /* Otherwise we can fall back on the length byte */
- else {
- message_len = tvb_get_guint8(tvb, 2);
- }
-
- /* After calculating theoretical length, check if actual length of tvb is longer. In that case, use the tvb length */
- if (message_len < tvb_length(tvb)) {
- message_len = tvb_length(tvb);
- }
-
- break;
-
- case CMD_RELAY_DEF:
- case CMD_FM_DATA:
- case CMD_DFM_DATA:
- case CMD_PDFM_DATA:
- case CMD_FAST_SER:
- /* Theses messages include length byte and don't generally contain 0xFF data */
- message_len = tvb_get_guint8(tvb, 2);
-
- /* After processing length byte, check if actual length of tvb is longer. In that case, use the tvb length */
- if (message_len < tvb_length(tvb)) {
- message_len = tvb_length(tvb);
- }
-
- break;
-
- default:
- /* For remaining packet types, fall back whatever length is greater, len byte from packet or tvb length */
- if (tvb_get_guint8(tvb, 2) > tvb_length(tvb)) {
- message_len = tvb_get_guint8(tvb, 2);
- }
- else {
- message_len = tvb_length(tvb);
- }
- break;
- }
-
+ message_len = tvb_get_guint8(tvb, 2);
}
- /* for 2-byte poll messages, manually set the length to 2 */
+ /* for 2-byte poll messages, set the length to 2 */
else if (tvb_length(tvb) == 2) {
message_len = 2;
}
@@ -1964,6 +2322,7 @@ static gboolean
dissect_selfm_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
+ tvbuff_t *selfm_tvb;
gint length = tvb_length(tvb);
/* Check for a SEL FM packet. It should begin with 0xA5 */
@@ -1972,7 +2331,17 @@ dissect_selfm_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat
return FALSE;
}
- tcp_dissect_pdus(tvb, pinfo, tree, selfm_desegment, 2,
+ /* If this is a Telnet-encapsulated Ethernet, let's clean out the IAC 0xFF instances */
+ /* before we attempt any kind of re-assembly of the message */
+ if ((pinfo->srcport) && selfm_telnet_clean) {
+ selfm_tvb = clean_telnet_iac(pinfo, tvb, 0, length);
+ }
+ else {
+ selfm_tvb = tvb_new_subset( tvb, 0, length, length);
+ }
+
+
+ tcp_dissect_pdus(selfm_tvb, pinfo, tree, selfm_desegment, 2,
get_selfm_len, dissect_selfm);
return TRUE;
@@ -1998,6 +2367,17 @@ dissect_selfm_simple(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *
}
/******************************************************************************************************/
+/* SEL Fast Message Dissector initialization */
+/******************************************************************************************************/
+static void
+selfm_init(void)
+{
+
+ reassembly_table_init(&selfm_reassembly_table,
+ &addresses_reassembly_table_functions);
+}
+
+/******************************************************************************************************/
/* Register the protocol with Wireshark */
/******************************************************************************************************/
void proto_reg_handoff_selfm(void);
@@ -2057,6 +2437,32 @@ proto_register_selfm(void)
{ "Analog Channel Scale Factor Type", "selfm.fmconfig.ai_sf_type", FT_UINT8, BASE_DEC, VALS(selfm_fmconfig_ai_sftype_vals), 0x0, NULL, HFILL }},
{ &hf_selfm_fmconfig_ai_sf_ofs,
{ "Analog Channel Scale Factor Offset", "selfm.fmconfig.ai_sf_ofs", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_rot,
+ { "Rotation", "selfm.fmconfig.cblk_rot", FT_UINT8, BASE_HEX, VALS(selfm_fmconfig_cblk_rot_vals), 0x01, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_vconn,
+ { "Voltage Connection", "selfm.fmconfig.cblk_vconn", FT_UINT8, BASE_HEX, VALS(selfm_fmconfig_cblk_vconn_vals), 0x06, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_iconn,
+ { "Current Connection", "selfm.fmconfig.cblk_iconn", FT_UINT8, BASE_HEX, VALS(selfm_fmconfig_cblk_iconn_vals), 0x18, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_ctype,
+ { "Calculation Type", "selfm.fmconfig.cblk_ctype", FT_UINT8, BASE_DEC, VALS(selfm_fmconfig_cblk_ctype_vals), 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_deskew_ofs,
+ { "Skew Correction Offset", "selfm.fmconfig.cblk_deskew_ofs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_rs_ofs,
+ { "Rs Offset", "selfm.fmconfig.cblk_rs_ofs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_xs_ofs,
+ { "Xs Offset", "selfm.fmconfig.cblk_xs_ofs", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_ia_idx,
+ { "Analog Record Ia Index Position", "selfm.fmconfig.cblk_ia_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_ib_idx,
+ { "Analog Record Ib Index Position", "selfm.fmconfig.cblk_ib_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_ic_idx,
+ { "Analog Record Ic Index Position", "selfm.fmconfig.cblk_ic_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_va_idx,
+ { "Analog Record Va/Vab Index Position", "selfm.fmconfig.cblk_va_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_vb_idx,
+ { "Analog Record Vb/Vbc Index Position", "selfm.fmconfig.cblk_vb_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fmconfig_cblk_vc_idx,
+ { "Analog Record Vc/Vca Index Position", "selfm.fmconfig.cblk_vc_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
/* "Fast Meter Data" specific fields */
{ &hf_selfm_fmdata_len,
{ "Length", "selfm.fmdata.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
@@ -2097,7 +2503,18 @@ proto_register_selfm(void)
{ "Breaker Bit Close Command", "selfm.foconfig.brkr_close", FT_UINT8, BASE_HEX, VALS(selfm_fo_br_vals), 0x0, NULL, HFILL }},
{ &hf_selfm_foconfig_rb_cmd,
{ "Remote Bit Command", "selfm.foconfig.rb_cmd", FT_UINT8, BASE_HEX, VALS(selfm_fo_rb_vals), 0x0, NULL, HFILL }},
- /* "Fast Operate" specific fields */
+ /* "Alternate Fast Operate Configuration" specific fields */
+ { &hf_selfm_alt_foconfig_len,
+ { "Length", "selfm.alt_foconfig.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_alt_foconfig_num_ports,
+ { "Number of Ports Available", "selfm.alt_foconfig.num_ports", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_alt_foconfig_num_brkr,
+ { "Number of Breaker Bits per Port", "selfm.alt_foconfig.num_brkr", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_alt_foconfig_num_rb,
+ { "Number of Remote Bits per Port", "selfm.alt_foconfig.num_rb", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_alt_foconfig_funccode,
+ { "Supported Function Code", "selfm.alt_foconfig.funccode", FT_UINT8, BASE_HEX, VALS(selfm_foconfig_alt_funccode_vals), 0x0, NULL, HFILL }},
+ /* "Fast Operate Command" specific fields */
{ &hf_selfm_fastop_len,
{ "Length", "selfm.fastop.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_selfm_fastop_rb_code,
@@ -2106,6 +2523,13 @@ proto_register_selfm(void)
{ "Breaker Bit Operate Code", "selfm.fastop.br_code", FT_UINT8, BASE_HEX, VALS(selfm_fo_br_vals), 0x0, NULL, HFILL }},
{ &hf_selfm_fastop_valid,
{ "Operate Code Validation", "selfm.fastop.valid", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ /* "Alternate Fast Operate Command" specific fields */
+ { &hf_selfm_alt_fastop_len,
+ { "Length", "selfm.alt_fastop.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_alt_fastop_code,
+ { "Operate Code", "selfm.alt_fastop.code", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_alt_fastop_valid,
+ { "Operate Code Validation", "selfm.alt_fastop.valid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
/* "Fast SER Message" specific fields */
{ &hf_selfm_fastser_len,
{ "Length", "selfm.fastser.len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
@@ -2181,19 +2605,73 @@ proto_register_selfm(void)
{ "Number of Registers", "selfm.fastser.unswrite_num_reg", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_selfm_fastser_unswrite_reg_val,
{ "Register Value", "selfm.fastser.unswrite_reg_val", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_selfm_fastser_read_baseaddr,
- { "Base Address", "selfm.fastser.read_baseaddr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
- { &hf_selfm_fastser_read_numaddr,
- { "Number of Addresses", "selfm.fastser.read_numaddr", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_selfm_fastser_datafmt_resp_num_tag,
- { "Number of Tags", "selfm.fastser.datafmt_resp_numtag", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_selfm_fastser_datafmt_resp_tag_qty,
- { "Quantity of Values within Tag", "selfm.fastser.datafmt_resp_tagqty", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_selfm_fastser_datafmt_resp_tag_type,
- { "Tag Data Type", "selfm.fastser.datafmt_resp_tagtype", FT_UINT8, BASE_HEX, VALS(selfm_fastser_tagtype_vals), 0x0, NULL, HFILL }},
- { &hf_selfm_fastser_devdesc_num_reg,
- { "Number of Data Regions", "selfm.fastser.devdesc_num_reg", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
-
+ { &hf_selfm_fastser_baseaddr,
+ { "Base Address", "selfm.fastser.baseaddr", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_numwords,
+ { "Number of 16-bit Words", "selfm.fastser.numwords", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_flags,
+ { "Flag Word", "selfm.fastser.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_datafmt_resp_numitem,
+ { "Number of Data Items Records", "selfm.fastser.datafmt_resp_numitem", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_dataitem_qty,
+ { "Data Item Quantity", "selfm.fastser.dataitem_qty", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_dataitem_type,
+ { "Data Item Type", "selfm.fastser.dataitem_type", FT_UINT16, BASE_HEX, VALS(selfm_fastser_tagtype_vals), 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_dataitem_uint16,
+ { "(uint16)", "selfm.fastser.dataitem_uint16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_dataitem_int16,
+ { "(int16)", "selfm.fastser.dataitem_int16", FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_dataitem_uint32,
+ { "(uint32)", "selfm.fastser.dataitem_uint32", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_dataitem_int32,
+ { "(int32)", "selfm.fastser.dataitem_int32", FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_dataitem_float,
+ { "(float)", "selfm.fastser.dataitem_float", FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_devdesc_num_region,
+ { "Number of Data Regions", "selfm.fastser.devdesc_num_region", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_devdesc_num_ctrl,
+ { "Number of Control Regions", "selfm.fastser.devdesc_num_ctrl", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_req_orig,
+ { "Origination path", "selfm.fastser.soe_req_orig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_resp_numblks,
+ { "Number of Blocks", "selfm.fastser.soe_resp_numblks", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_resp_orig,
+ { "Origination path", "selfm.fastser.soe_resp_orig", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_resp_numbits,
+ { "Number of Bits", "selfm.fastser.soe_resp_numbits", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_resp_pad,
+ { "Pad Byte", "selfm.fastser.soe_resp_pad", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_resp_doy,
+ { "Day of Year", "selfm.fastser.soe_resp_doy", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_resp_year,
+ { "Year", "selfm.fastser.soe_resp_year", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fastser_soe_resp_tod,
+ { "Time of Day (ms)", "selfm.fastser.soe_resp_tod", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ /* { &hf_selfm_fastser_soe_resp_data,
+ { "Packed Binary State Data", "selfm.fastser.soe_resp_data", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, */
+
+ /* "Fast SER Message" Re-assembly header fields */
+ { &hf_selfm_fragment,
+ { "SEL Fast Msg Response Data Fragment", "selfm.respdata.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "SEL Fast Message Response Data Fragment", HFILL }},
+ { &hf_selfm_fragments,
+ { "SEL Fast Msg Response Data Fragments", "selfm.respdata.fragments", FT_NONE, BASE_NONE, NULL, 0x0, "SEL Fast Message Response Data Fragments", HFILL }},
+ { &hf_selfm_fragment_overlap,
+ { "Fragment overlap", "selfm.respdata.fragment.overlap", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment overlaps with other fragments", HFILL }},
+ { &hf_selfm_fragment_overlap_conflict,
+ { "Conflicting data in fragment overlap", "selfm.respdata.fragment.overlap.conflict", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Overlapping fragments contained conflicting data", HFILL }},
+ { &hf_selfm_fragment_multiple_tails,
+ { "Multiple tail fragments found", "selfm.respdata.fragment.multipletails", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Several tails were found when defragmenting the packet", HFILL }},
+ { &hf_selfm_fragment_too_long_fragment,
+ { "Fragment too long", "selfm.respdata.fragment.toolongfragment", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Fragment contained data past end of packet", HFILL }},
+ { &hf_selfm_fragment_error,
+ { "Defragmentation error", "selfm.respdata.fragment.error", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "Defragmentation error due to illegal fragments", HFILL }},
+ { &hf_selfm_fragment_count,
+ { "Fragment count", "selfm.respdata.fragment.count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
+ { &hf_selfm_fragment_reassembled_in,
+ { "Reassembled PDU In Frame", "selfm.respdata.fragment.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This PDU is reassembled in this frame", HFILL }},
+ { &hf_selfm_fragment_reassembled_length,
+ { "Reassembled SEL Fast Msg length", "selfm.respdata.fragment.reassembled.length", FT_UINT32, BASE_DEC, NULL, 0x0, "The total length of the reassembled payload", HFILL }
+ }
};
/* Setup protocol subtree array */
@@ -2205,6 +2683,7 @@ proto_register_selfm(void)
&ett_selfm_relaydef_flags,
&ett_selfm_fmconfig,
&ett_selfm_fmconfig_ai,
+ &ett_selfm_fmconfig_calc,
&ett_selfm_foconfig,
&ett_selfm_foconfig_brkr,
&ett_selfm_foconfig_rb,
@@ -2221,10 +2700,16 @@ proto_register_selfm(void)
&ett_selfm_fastser_element_list,
&ett_selfm_fastser_element,
&ett_selfm_fastser_datareg,
+ &ett_selfm_fragment,
+ &ett_selfm_fragments
+
};
module_t *selfm_module;
+ /* Register protocol init routine */
+ register_init_routine(&selfm_init);
+
/* Register the protocol name and description */
proto_selfm = proto_register_protocol("SEL Fast Message", "SEL Fast Message", "selfm");