/epan/dissectors/packet-dnp.c
C | 4190 lines | 3199 code | 570 blank | 421 comment | 160 complexity | 7a6f393440ba0f929e503195337d5919 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
Large files files are truncated, but you can click here to view the full file
- /* packet-dnp.c
- * Routines for DNP dissection
- * Copyright 2003, 2006, 2007, Graham Bloice <graham.bloice@trihedral.com>
- *
- * DNP3.0 Application Layer Object dissection added by Chris Bontje (chrisbontje@shaw.ca)
- * Copyright 2005
- *
- * Major updates: tcp and application layer defragmentation, more object dissections by Graham Bloice
- *
- * $Id$
- *
- * Wireshark - Network traffic analyzer
- * By Gerald Combs <gerald@wireshark.org>
- * Copyright 1998 Gerald Combs
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * 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.
- */
- #include "config.h"
- #include <string.h>
- #include <math.h>
- #include <glib.h>
- #include <epan/packet.h>
- #include <epan/prefs.h>
- #include <epan/reassemble.h>
- #include <epan/emem.h>
- #include <epan/dissectors/packet-tcp.h>
- #include <epan/conversation.h>
- #include <epan/expert.h>
- /*
- * See
- *
- * http://www.dnp.org/
- *
- * although note that you have to join the DNP organization to get to
- * see the protocol specs online - otherwise, you have to buy a
- * dead-tree version.
- *
- * ...Application Layer Notes...
- *
- * Application Layer Decoding based on information available in
- * DNP3 Basic 4 Documentation Set, specifically the document:
- * "DNP V3.00 Application Layer" v0.03 P009-0PD.APP & Technical Bulletins
- *
- * ---------------------------------------------------------------------------
- *
- * Several command codes were missing, causing the dissector to abort decoding
- * on valid packets. Those commands have been added.
- *
- * The semantics of Variation 0 have been cleaned up. Variation 0 is the
- * "Default Variation". It is used only in Master -> Slave read commands
- * to request the data in whatever variation the Slave is configured to use by
- * default. Decoder strings have been added to the Binary Output and
- * Analog Output objects (10 and 40) so that group read commands will
- * decode properly.
- *
- * Roy M. Silvernail <roy@rant-central.com> 01/05/2009
- *
- */
- /***************************************************************************/
- /* DNP 3.0 Constants */
- /***************************************************************************/
- #define DNP_HDR_LEN 10
- #define TCP_PORT_DNP 20000
- #define UDP_PORT_DNP 20000
- /***************************************************************************/
- /* Datalink and Transport Layer Bit-Masks */
- /***************************************************************************/
- #define DNP3_CTL_DIR 0x80
- #define DNP3_CTL_PRM 0x40
- #define DNP3_CTL_FCB 0x20
- #define DNP3_CTL_FCV 0x10
- #define DNP3_CTL_RES 0x20
- #define DNP3_CTL_DFC 0x10
- #define DNP3_CTL_FUNC 0x0f
- #define DNP3_TR_FIR 0x40
- #define DNP3_TR_FIN 0x80
- #define DNP3_TR_SEQ 0x3f
- #define AL_MAX_CHUNK_SIZE 16
- /***************************************************************************/
- /* Data Link Function codes */
- /***************************************************************************/
- /* Primary to Secondary */
- #define DL_FUNC_RESET_LINK 0x00
- #define DL_FUNC_RESET_PROC 0x01
- #define DL_FUNC_TEST_LINK 0x02
- #define DL_FUNC_USER_DATA 0x03
- #define DL_FUNC_UNC_DATA 0x04
- #define DL_FUNC_LINK_STAT 0x09
- /* Secondary to Primary */
- #define DL_FUNC_ACK 0x00
- #define DL_FUNC_NACK 0x01
- #define DL_FUNC_STAT_LINK 0x0B
- #define DL_FUNC_NO_FUNC 0x0E
- #define DL_FUNC_NOT_IMPL 0x0F
- /***************************************************************************/
- /* Application Layer Bit-Masks */
- /***************************************************************************/
- #define DNP3_AL_UNS 0x10
- #define DNP3_AL_CON 0x20
- #define DNP3_AL_FIN 0x40
- #define DNP3_AL_FIR 0x80
- #define DNP3_AL_SEQ 0x0f
- #define DNP3_AL_FUNC 0xff
- /***************************************************************************/
- /* Application Layer Function codes */
- /***************************************************************************/
- #define AL_FUNC_CONFIRM 0x00 /* 00 - Confirm */
- #define AL_FUNC_READ 0x01 /* 01 - Read */
- #define AL_FUNC_WRITE 0x02 /* 02 - Write */
- #define AL_FUNC_SELECT 0x03 /* 03 - Select */
- #define AL_FUNC_OPERATE 0x04 /* 04 - Operate */
- #define AL_FUNC_DIROP 0x05 /* 05 - Direct Operate */
- #define AL_FUNC_DIROPNACK 0x06 /* 06 - Direct Operate No ACK */
- #define AL_FUNC_FRZ 0x07 /* 07 - Immediate Freeze */
- #define AL_FUNC_FRZNACK 0x08 /* 08 - Immediate Freeze No ACK */
- #define AL_FUNC_FRZCLR 0x09 /* 09 - Freeze and Clear */
- #define AL_FUNC_FRZCLRNACK 0x0A /* 10 - Freeze and Clear No ACK */
- #define AL_FUNC_FRZT 0x0B /* 11 - Freeze With Time */
- #define AL_FUNC_FRZTNACK 0x0C /* 12 - Freeze With Time No ACK */
- #define AL_FUNC_COLDRST 0x0D /* 13 - Cold Restart */
- #define AL_FUNC_WARMRST 0x0E /* 14 - Warm Restart */
- #define AL_FUNC_INITDATA 0x0F /* 15 - Initialize Data */
- #define AL_FUNC_INITAPP 0x10 /* 16 - Initialize Application */
- #define AL_FUNC_STARTAPP 0x11 /* 17 - Start Application */
- #define AL_FUNC_STOPAPP 0x12 /* 18 - Stop Application */
- #define AL_FUNC_SAVECFG 0x13 /* 19 - Save Configuration */
- #define AL_FUNC_ENSPMSG 0x14 /* 20 - Enable Spontaneous Msg */
- #define AL_FUNC_DISSPMSG 0x15 /* 21 - Disable Spontaneous Msg */
- #define AL_FUNC_ASSIGNCL 0x16 /* 22 - Assign Classes */
- #define AL_FUNC_DELAYMST 0x17 /* 23 - Delay Measurement */
- #define AL_FUNC_RECCT 0x18 /* 24 - Record Current Time */
- #define AL_FUNC_OPENFILE 0x19 /* 25 - Open File */
- #define AL_FUNC_CLOSEFILE 0x1A /* 26 - Close File */
- #define AL_FUNC_DELETEFILE 0x1B /* 27 - Delete File */
- #define AL_FUNC_GETFILEINF 0x1C /* 28 - Get File Info */
- #define AL_FUNC_AUTHFILE 0x1D /* 29 - Authenticate File */
- #define AL_FUNC_ABORTFILE 0x1E /* 30 - Abort File */
- #define AL_FUNC_ACTCNF 0x1F /* 31 - Activate Config */
- #define AL_FUNC_AUTHREQ 0x20 /* 32 - Authentication Request */
- #define AL_FUNC_AUTHERR 0x21 /* 33 - Authentication Error */
- #define AL_FUNC_RESPON 0x81 /* 129 - Response */
- #define AL_FUNC_UNSOLI 0x82 /* 130 - Unsolicited Response */
- #define AL_FUNC_AUTHRESP 0x83 /* 131 - Authentication Response */
- /***************************************************************************/
- /* Application Layer Internal Indication (IIN) bits */
- /* 2 Bytes, message formatting: [First Octet] | [Second Octet] */
- /***************************************************************************/
- /* Octet 1 */
- #define AL_IIN_BMSG 0x0100 /* Bit 0 - Broadcast message rx'd */
- #define AL_IIN_CLS1D 0x0200 /* Bit 1 - Class 1 Data Available */
- #define AL_IIN_CLS2D 0x0400 /* Bit 2 - Class 2 Data Available */
- #define AL_IIN_CLS3D 0x0800 /* Bit 3 - Class 3 Data Available */
- #define AL_IIN_TSR 0x1000 /* Bit 4 - Time Sync Req'd from Master */
- #define AL_IIN_DOL 0x2000 /* Bit 5 - Outputs in Local Mode */
- #define AL_IIN_DT 0x4000 /* Bit 6 - Device Trouble */
- #define AL_IIN_RST 0x8000 /* Bit 7 - Device Restart */
- /* Octet 2 */
- #define AL_IIN_FCNI 0x0001 /* Bit 0 - Function code not implemented */
- #define AL_IIN_OBJU 0x0002 /* Bit 1 - Requested Objects Unknown */
- #define AL_IIN_PIOOR 0x0004 /* Bit 2 - Parameters Invalid or Out of Range */
- #define AL_IIN_EBO 0x0008 /* Bit 3 - Event Buffer Overflow */
- #define AL_IIN_OAE 0x0010 /* Bit 4 - Operation Already Executing */
- #define AL_IIN_CC 0x0020 /* Bit 5 - Device Configuration Corrupt */
- /* 0x0040 Bit 6 - Reserved */
- /* 0x0080 Bit 7 - Reserved */
- /***************************************************************************/
- /* Application Layer Data Object Qualifier */
- /***************************************************************************/
- /* Bit-Masks */
- #define AL_OBJQ_INDEX 0x70 /* x111xxxx Masks Index from Qualifier */
- #define AL_OBJQ_CODE 0x0F /* xxxx1111 Masks Code from Qualifier */
- /* Index Size (3-bits x111xxxx) */
- /* When Qualifier Code != 11 */
- #define AL_OBJQL_IDX_NI 0x00 /* Objects are Packed with no index */
- #define AL_OBJQL_IDX_1O 0x01 /* Objects are prefixed w/ 1-octet index */
- #define AL_OBJQL_IDX_2O 0x02 /* Objects are prefixed w/ 2-octet index */
- #define AL_OBJQL_IDX_4O 0x03 /* Objects are prefixed w/ 4-octet index */
- #define AL_OBJQL_IDX_1OS 0x04 /* Objects are prefixed w/ 1-octet object size */
- #define AL_OBJQL_IDX_2OS 0x05 /* Objects are prefixed w/ 2-octet object size */
- #define AL_OBJQL_IDX_4OS 0x06 /* Objects are prefixed w/ 4-octet object size */
- /* When Qualifier Code == 11 */
- #define AL_OBJQL_IDX11_1OIS 0x01 /* 1 octet identifier size */
- #define AL_OBJQL_IDX11_2OIS 0x02 /* 2 octet identifier size */
- #define AL_OBJQL_IDX11_4OIS 0x03 /* 4 octet identifier size */
- /* Qualifier Code (4-bits) */
- /* 4-bits ( xxxx1111 ) */
- #define AL_OBJQL_CODE_SSI8 0x00 /* 00 8-bit Start and Stop Indices in Range Field */
- #define AL_OBJQL_CODE_SSI16 0x01 /* 01 16-bit Start and Stop Indices in Range Field */
- #define AL_OBJQL_CODE_SSI32 0x02 /* 02 32-bit Start and Stop Indices in Range Field */
- #define AL_OBJQL_CODE_AA8 0x03 /* 03 8-bit Absolute Address in Range Field */
- #define AL_OBJQL_CODE_AA16 0x04 /* 04 16-bit Absolute Address in Range Field */
- #define AL_OBJQL_CODE_AA32 0x05 /* 05 32-bit Absolute Address in Range Field */
- #define AL_OBJQL_CODE_R0 0x06 /* 06 Length of Range field is 0 (no range field) */
- #define AL_OBJQL_CODE_SF8 0x07 /* 07 8-bit Single Field Quantity */
- #define AL_OBJQL_CODE_SF16 0x08 /* 08 16-bit Single Field Quantity */
- #define AL_OBJQL_CODE_SF32 0x09 /* 09 32-bit Single Field Quantity */
- /* 0x0A 10 Reserved */
- #define AL_OBJQL_CODE_FF 0x0B /* 11 Free-format Qualifier, range field has 1 octet count of objects */
- /* 0x0C 12 Reserved */
- /* 0x0D 13 Reserved */
- /* 0x0E 14 Reserved */
- /* 0x0F 15 Reserved */
- /***************************************************************************/
- /* Application Layer Data Object Definitions */
- /***************************************************************************/
- /* Binary Input Objects */
- #define AL_OBJ_BI_ALL 0x0100 /* 01 00 Binary Input Default Variation */
- #define AL_OBJ_BI_1BIT 0x0101 /* 01 01 Single-bit Binary Input */
- #define AL_OBJ_BI_STAT 0x0102 /* 01 02 Binary Input With Status */
- #define AL_OBJ_BIC_ALL 0x0200 /* 02 00 Binary Input Change Default Variation */
- #define AL_OBJ_BIC_NOTIME 0x0201 /* 02 01 Binary Input Change Without Time */
- #define AL_OBJ_BIC_TIME 0x0202 /* 02 02 Binary Input Change With Time */
- #define AL_OBJ_BIC_RTIME 0x0203 /* 02 03 Binary Input Change With Relative Time */
- /* Double-bit Input Objects */
- #define AL_OBJ_2BI_ALL 0x0300 /* 03 00 Double-bit Input Default Variation */
- #define AL_OBJ_2BI_NF 0x0301 /* 03 01 Double-bit Input No Flags */
- #define AL_OBJ_2BI_STAT 0x0302 /* 03 02 Double-bit Input With Status */
- #define AL_OBJ_2BIC_NOTIME 0x0401 /* 04 01 Double-bit Input Change Without Time */
- #define AL_OBJ_2BIC_TIME 0x0402 /* 04 02 Double-bit Input Change With Time */
- #define AL_OBJ_2BIC_RTIME 0x0403 /* 04 03 Double-bit Input Change With Relative Time */
- /* Binary Input Quality Flags */
- #define AL_OBJ_BI_FLAG0 0x0001 /* Point Online (0=Offline; 1=Online) */
- #define AL_OBJ_BI_FLAG1 0x0002 /* Restart (0=Normal; 1=Restart) */
- #define AL_OBJ_BI_FLAG2 0x0004 /* Comms Lost (0=Normal; 1=Lost) */
- #define AL_OBJ_BI_FLAG3 0x0008 /* Remote Force (0=Normal; 1=Forced) */
- #define AL_OBJ_BI_FLAG4 0x0010 /* Local Force (0=Normal; 1=Forced) */
- #define AL_OBJ_BI_FLAG5 0x0020 /* Chatter Filter (0=Normal; 1=Filter On) */
- #define AL_OBJ_BI_FLAG6 0x0040 /* Double-bit LSB (0=Off; 1=On) */
- #define AL_OBJ_BI_FLAG7 0x0080 /* Point State (0=Off; 1=On) or Double-bit MSB */
- /***************************************************************************/
- /* Binary Output Objects */
- #define AL_OBJ_BO_ALL 0x0A00 /* 10 00 Binary Output Default Variation */
- #define AL_OBJ_BO 0x0A01 /* 10 01 Binary Output */
- #define AL_OBJ_BO_STAT 0x0A02 /* 10 02 Binary Output Status */
- #define AL_OBJ_BOC_ALL 0x0B00 /* 11 00 Binary Output Change Default Variation */
- #define AL_OBJ_BOC_NOTIME 0x0B01 /* 11 01 Binary Output Change Without Time */
- #define AL_OBJ_BOC_TIME 0x0B02 /* 11 02 Binary Output Change With Time */
- #define AL_OBJ_CTLOP_BLK 0x0C01 /* 12 01 Control Relay Output Block */
- /* 0x0C02 12 02 Pattern Control Block */
- /* 0x0C03 12 03 Pattern Mask */
- #define AL_OBJCTLC_CODE 0x0F /* Bit-Mask xxxx1111 for Control Code 'Code' */
- #define AL_OBJCTLC_MISC 0x30 /* Bit-Mask xx11xxxx for Control Code Queue (obsolete) and Clear Fields */
- #define AL_OBJCTLC_TC 0xC0 /* Bit-Mask 11xxxxxx for Control Code 'Trip/Close' */
- #define AL_OBJCTLC_CODE0 0x00 /* xxxx0000 NUL Operation; only process R attribute */
- #define AL_OBJCTLC_CODE1 0x01 /* xxxx0001 Pulse On ^On-Time -> vOff-Time, remain off */
- #define AL_OBJCTLC_CODE2 0x02 /* xxxx0010 Pulse Off vOff-Time -> ^On-Time, remain on */
- #define AL_OBJCTLC_CODE3 0x03 /* xxxx0011 Latch On */
- #define AL_OBJCTLC_CODE4 0x04 /* xxxx0100 Latch Off */
- /* 0x05-0x15 Reserved */
- #define AL_OBJCTLC_NOTSET 0x00 /* xx00xxxx for Control Code, Clear and Queue not set */
- #define AL_OBJCTLC_QUEUE 0x01 /* xxx1xxxx for Control Code, Clear Field 'Queue' */
- #define AL_OBJCTLC_CLEAR 0x02 /* xx1xxxxx for Control Code, Clear Field 'Clear' */
- #define AL_OBJCTLC_BOTHSET 0x03 /* xx11xxxx for Control Code, Clear and Queue both set */
- #define AL_OBJCTLC_TC0 0x00 /* 00xxxxxx NUL */
- #define AL_OBJCTLC_TC1 0x01 /* 01xxxxxx Close */
- #define AL_OBJCTLC_TC2 0x02 /* 10xxxxxx Trip */
- #define AL_OBJCTLC_TC3 0x03 /* 11xxxxxx Reserved */
- #define AL_OBJCTL_STAT0 0x00 /* Request Accepted, Initiated or Queued */
- #define AL_OBJCTL_STAT1 0x01 /* Request Not Accepted; Arm-timer expired */
- #define AL_OBJCTL_STAT2 0x02 /* Request Not Accepted; No 'SELECT' rx'd */
- #define AL_OBJCTL_STAT3 0x03 /* Request Not Accepted; Format errors in ctrl request */
- #define AL_OBJCTL_STAT4 0x04 /* Control Operation Not Supported for this point */
- #define AL_OBJCTL_STAT5 0x05 /* Request Not Accepted; Ctrl Queue full or pt. active */
- #define AL_OBJCTL_STAT6 0x06 /* Request Not Accepted; Ctrl HW Problems */
- #define AL_OBJCTL_STAT7 0x07 /* Request Not Accepted; Local/Remote switch in Local*/
- #define AL_OBJCTL_STAT8 0x08 /* Request Not Accepted; Too many operations requested */
- #define AL_OBJCTL_STAT9 0x09 /* Request Not Accepted; Insufficient authorization */
- #define AL_OBJCTL_STAT10 0x0A /* Request Not Accepted; Local automation proc active */
- /* Binary Output Quality Flags */
- #define AL_OBJ_BO_FLAG0 0x0001 /* Point Online (0=Offline; 1=Online) */
- #define AL_OBJ_BO_FLAG1 0x0002 /* Restart (0=Normal; 1=Restart) */
- #define AL_OBJ_BO_FLAG2 0x0004 /* Comms Lost (0=Normal; 1=Lost) */
- #define AL_OBJ_BO_FLAG3 0x0008 /* Remote Force (0=Normal; 1=Forced) */
- #define AL_OBJ_BO_FLAG4 0x0010 /* Local Force (0=Normal; 1=Forced) */
- #define AL_OBJ_BO_FLAG5 0x0020 /* Reserved */
- #define AL_OBJ_BO_FLAG6 0x0040 /* Reserved */
- #define AL_OBJ_BO_FLAG7 0x0080 /* Point State (0=Off; 1=On) */
- /***************************************************************************/
- /* Counter Objects */
- #define AL_OBJ_CTR_ALL 0x1400 /* 20 00 Binary Counter Default Variation */
- #define AL_OBJ_CTR_32 0x1401 /* 20 01 32-Bit Binary Counter */
- #define AL_OBJ_CTR_16 0x1402 /* 20 02 16-Bit Binary Counter */
- #define AL_OBJ_DCTR_32 0x1403 /* 20 03 32-Bit Delta Counter */
- #define AL_OBJ_DCTR_16 0x1404 /* 20 04 16-Bit Delta Counter */
- #define AL_OBJ_CTR_32NF 0x1405 /* 20 05 32-Bit Binary Counter Without Flag */
- #define AL_OBJ_CTR_16NF 0x1406 /* 20 06 16-Bit Binary Counter Without Flag */
- #define AL_OBJ_DCTR_32NF 0x1407 /* 20 07 32-Bit Delta Counter Without Flag */
- #define AL_OBJ_DCTR_16NF 0x1408 /* 20 08 16-Bit Delta Counter Without Flag */
- #define AL_OBJ_FCTR_ALL 0x1500 /* 21 00 Frozen Binary Counter Default Variation */
- #define AL_OBJ_FCTR_32 0x1501 /* 21 01 32-Bit Frozen Counter */
- #define AL_OBJ_FCTR_16 0x1502 /* 21 02 16-Bit Frozen Counter */
- #define AL_OBJ_FDCTR_32 0x1503 /* 21 03 32-Bit Frozen Delta Counter */
- #define AL_OBJ_FDCTR_16 0x1504 /* 21 04 16-Bit Frozen Delta Counter */
- #define AL_OBJ_FCTR_32T 0x1505 /* 21 05 32-Bit Frozen Counter w/ Time of Freeze */
- #define AL_OBJ_FCTR_16T 0x1506 /* 21 06 16-Bit Frozen Counter w/ Time of Freeze */
- #define AL_OBJ_FDCTR_32T 0x1507 /* 21 07 32-Bit Frozen Delta Counter w/ Time of Freeze */
- #define AL_OBJ_FDCTR_16T 0x1508 /* 21 08 16-Bit Frozen Delta Counter w/ Time of Freeze */
- #define AL_OBJ_FCTR_32NF 0x1509 /* 21 09 32-Bit Frozen Counter Without Flag */
- #define AL_OBJ_FCTR_16NF 0x150A /* 21 10 16-Bit Frozen Counter Without Flag */
- #define AL_OBJ_FDCTR_32NF 0x150B /* 21 11 32-Bit Frozen Delta Counter Without Flag */
- #define AL_OBJ_FDCTR_16NF 0x150C /* 21 12 16-Bit Frozen Delta Counter Without Flag */
- #define AL_OBJ_CTRC_ALL 0x1600 /* 22 00 Counter Change Event Default Variation */
- #define AL_OBJ_CTRC_32 0x1601 /* 22 01 32-Bit Counter Change Event w/o Time */
- #define AL_OBJ_CTRC_16 0x1602 /* 22 02 16-Bit Counter Change Event w/o Time */
- #define AL_OBJ_DCTRC_32 0x1603 /* 22 03 32-Bit Delta Counter Change Event w/o Time */
- #define AL_OBJ_DCTRC_16 0x1604 /* 22 04 16-Bit Delta Counter Change Event w/o Time */
- #define AL_OBJ_CTRC_32T 0x1605 /* 22 05 32-Bit Counter Change Event with Time */
- #define AL_OBJ_CTRC_16T 0x1606 /* 22 06 16-Bit Counter Change Event with Time */
- #define AL_OBJ_DCTRC_32T 0x1607 /* 22 07 32-Bit Delta Counter Change Event with Time */
- #define AL_OBJ_DCTRC_16T 0x1608 /* 22 08 16-Bit Delta Counter Change Event with Time */
- #define AL_OBJ_FCTRC_ALL 0x1700 /* 21 00 Frozen Binary Counter Change Event Default Variation */
- #define AL_OBJ_FCTRC_32 0x1701 /* 21 01 32-Bit Frozen Counter Change Event */
- #define AL_OBJ_FCTRC_16 0x1702 /* 21 02 16-Bit Frozen Counter Change Event */
- #define AL_OBJ_FDCTRC_32 0x1703 /* 21 03 32-Bit Frozen Delta Counter Change Event */
- #define AL_OBJ_FDCTRC_16 0x1704 /* 21 04 16-Bit Frozen Delta Counter Change Event */
- #define AL_OBJ_FCTRC_32T 0x1705 /* 21 05 32-Bit Frozen Counter Change Event w/ Time of Freeze */
- #define AL_OBJ_FCTRC_16T 0x1706 /* 21 06 16-Bit Frozen Counter Change Event w/ Time of Freeze */
- #define AL_OBJ_FDCTRC_32T 0x1707 /* 21 07 32-Bit Frozen Delta Counter Change Event w/ Time of Freeze */
- #define AL_OBJ_FDCTRC_16T 0x1708 /* 21 08 16-Bit Frozen Delta Counter Change Event w/ Time of Freeze */
- /* Counter Quality Flags */
- #define AL_OBJ_CTR_FLAG0 0x0001 /* Point Online (0=Offline; 1=Online) */
- #define AL_OBJ_CTR_FLAG1 0x0002 /* Restart (0=Normal; 1=Restart) */
- #define AL_OBJ_CTR_FLAG2 0x0004 /* Comms Lost (0=Normal; 1=Lost) */
- #define AL_OBJ_CTR_FLAG3 0x0008 /* Remote Force (0=Normal; 1=Forced) */
- #define AL_OBJ_CTR_FLAG4 0x0010 /* Local Force (0=Normal; 1=Forced) */
- #define AL_OBJ_CTR_FLAG5 0x0020 /* Roll-over (0=Normal; 1=Roll-Over) */
- #define AL_OBJ_CTR_FLAG6 0x0040 /* Discontinuity (0=Normal; 1=Discontinuity) */
- #define AL_OBJ_CTR_FLAG7 0x0080 /* Reserved */
- /***************************************************************************/
- /* Analog Input Objects */
- #define AL_OBJ_AI_ALL 0x1E00 /* 30 00 Analog Input Default Variation */
- #define AL_OBJ_AI_32 0x1E01 /* 30 01 32-Bit Analog Input */
- #define AL_OBJ_AI_16 0x1E02 /* 30 02 16-Bit Analog Input */
- #define AL_OBJ_AI_32NF 0x1E03 /* 30 03 32-Bit Analog Input Without Flag */
- #define AL_OBJ_AI_16NF 0x1E04 /* 30 04 16-Bit Analog Input Without Flag */
- #define AL_OBJ_AI_FLT 0x1E05 /* 30 05 32-Bit Floating Point Input */
- #define AL_OBJ_AI_DBL 0x1E06 /* 30 06 64-Bit Floating Point Input */
- /* 0x1F01 31 01 32-Bit Frozen Analog Input */
- /* 0x1F02 31 02 16-Bit Frozen Analog Input */
- /* 0x1F03 31 03 32-Bit Frozen Analog Input w/ Time of Freeze */
- /* 0x1F04 31 04 16-Bit Frozen Analog Input w/ Time of Freeze */
- /* 0x1F05 31 05 32-Bit Frozen Analog Input Without Flag */
- /* 0x1F06 31 06 16-Bit Frozen Analog Input Without Flag */
- #define AL_OBJ_AIF_FLT 0x1F07 /* 31 07 32-Bit Frozen Floating Point Input */
- #define AL_OBJ_AIF_DBL 0x1F08 /* 31 08 64-Bit Frozen Floating Point Input */
- #define AL_OBJ_AIC_ALL 0x2000 /* 32 00 Analog Input Change Default Variation */
- #define AL_OBJ_AIC_32NT 0x2001 /* 32 01 32-Bit Analog Change Event w/o Time */
- #define AL_OBJ_AIC_16NT 0x2002 /* 32 02 16-Bit Analog Change Event w/o Time */
- #define AL_OBJ_AIC_32T 0x2003 /* 32 03 32-Bit Analog Change Event w/ Time */
- #define AL_OBJ_AIC_16T 0x2004 /* 32 04 16-Bit Analog Change Event w/ Time */
- #define AL_OBJ_AIC_FLTNT 0x2005 /* 32 05 32-Bit Floating Point Change Event w/o Time*/
- #define AL_OBJ_AIC_DBLNT 0x2006 /* 32 06 64-Bit Floating Point Change Event w/o Time*/
- #define AL_OBJ_AIC_FLTT 0x2007 /* 32 07 32-Bit Floating Point Change Event w/ Time*/
- #define AL_OBJ_AIC_DBLT 0x2008 /* 32 08 64-Bit Floating Point Change Event w/ Time*/
- /* 0x2101 33 01 32-Bit Frozen Analog Event w/o Time */
- /* 0x2102 33 02 16-Bit Frozen Analog Event w/o Time */
- /* 0x2103 33 03 32-Bit Frozen Analog Event w/ Time */
- /* 0x2104 33 04 16-Bit Frozen Analog Event w/ Time */
- #define AL_OBJ_AIFC_FLTNT 0x2105 /* 33 05 32-Bit Floating Point Frozen Change Event w/o Time*/
- #define AL_OBJ_AIFC_DBLNT 0x2106 /* 33 06 64-Bit Floating Point Frozen Change Event w/o Time*/
- #define AL_OBJ_AIFC_FLTT 0x2107 /* 33 07 32-Bit Floating Point Frozen Change Event w/ Time*/
- #define AL_OBJ_AIFC_DBLT 0x2108 /* 33 08 64-Bit Floating Point Frozen Change Event w/ Time*/
- /* Analog Input Quality Flags */
- #define AL_OBJ_AI_FLAG0 0x0001 /* Point Online (0=Offline; 1=Online) */
- #define AL_OBJ_AI_FLAG1 0x0002 /* Restart (0=Normal; 1=Restart) */
- #define AL_OBJ_AI_FLAG2 0x0004 /* Comms Lost (0=Normal; 1=Lost) */
- #define AL_OBJ_AI_FLAG3 0x0008 /* Remote Force (0=Normal; 1=Forced) */
- #define AL_OBJ_AI_FLAG4 0x0010 /* Local Force (0=Normal; 1=Forced) */
- #define AL_OBJ_AI_FLAG5 0x0020 /* Over-Range (0=Normal; 1=Over-Range) */
- #define AL_OBJ_AI_FLAG6 0x0040 /* Reference Check (0=Normal; 1=Error) */
- #define AL_OBJ_AI_FLAG7 0x0080 /* Reserved */
- #define AL_OBJ_AIDB_ALL 0x2200 /* 34 00 Analog Input Deadband Default Variation */
- #define AL_OBJ_AIDB_16 0x2201 /* 34 01 16-Bit Analog Input Deadband */
- #define AL_OBJ_AIDB_32 0x2202 /* 34 02 32-Bit Analog Input Deadband */
- #define AL_OBJ_AIDB_FLT 0x2203 /* 34 03 Floating Point Analog Input Deadband */
- /***************************************************************************/
- /* Analog Output Objects */
- #define AL_OBJ_AO_ALL 0x2800 /* 40 00 Analog Output Default Variation */
- #define AL_OBJ_AO_32 0x2801 /* 40 01 32-Bit Analog Output Status */
- #define AL_OBJ_AO_16 0x2802 /* 40 02 16-Bit Analog Output Status */
- #define AL_OBJ_AO_FLT 0x2803 /* 40 03 32-Bit Floating Point Output Status */
- #define AL_OBJ_AO_DBL 0x2804 /* 40 04 64-Bit Floating Point Output Status */
- #define AL_OBJ_AO_32OPB 0x2901 /* 41 01 32-Bit Analog Output Block */
- #define AL_OBJ_AO_16OPB 0x2902 /* 41 02 16-Bit Analog Output Block */
- #define AL_OBJ_AO_FLTOPB 0x2903 /* 41 03 32-Bit Floating Point Output Block */
- #define AL_OBJ_AO_DBLOPB 0x2904 /* 41 04 64-Bit Floating Point Output Block */
- #define AL_OBJ_AOC_ALL 0x2A00 /* 42 00 Analog Output Event Default Variation */
- #define AL_OBJ_AOC_32NT 0x2A01 /* 42 01 32-Bit Analog Output Event w/o Time */
- #define AL_OBJ_AOC_16NT 0x2A02 /* 42 02 16-Bit Analog Output Event w/o Time */
- #define AL_OBJ_AOC_32T 0x2A03 /* 42 03 32-Bit Analog Output Event w/ Time */
- #define AL_OBJ_AOC_16T 0x2A04 /* 42 04 16-Bit Analog Output Event w/ Time */
- #define AL_OBJ_AOC_FLTNT 0x2A05 /* 42 05 32-Bit Floating Point Output Event w/o Time*/
- #define AL_OBJ_AOC_DBLNT 0x2A06 /* 42 06 64-Bit Floating Point Output Event w/o Time*/
- #define AL_OBJ_AOC_FLTT 0x2A07 /* 42 07 32-Bit Floating Point Output Event w/ Time*/
- #define AL_OBJ_AOC_DBLT 0x2A08 /* 42 08 64-Bit Floating Point Output Event w/ Time*/
- /* Analog Output Quality Flags */
- #define AL_OBJ_AO_FLAG0 0x0001 /* Point Online (0=Offline; 1=Online) */
- #define AL_OBJ_AO_FLAG1 0x0002 /* Restart (0=Normal; 1=Restart) */
- #define AL_OBJ_AO_FLAG2 0x0004 /* Comms Lost (0=Normal; 1=Lost) */
- #define AL_OBJ_AO_FLAG3 0x0008 /* Remote Force (0=Normal; 1=Forced) */
- #define AL_OBJ_AO_FLAG4 0x0010 /* Local Force (0=Normal; 1=Forced) */
- #define AL_OBJ_AO_FLAG5 0x0020 /* Reserved */
- #define AL_OBJ_AO_FLAG6 0x0040 /* Reserved */
- #define AL_OBJ_AO_FLAG7 0x0080 /* Reserved */
- /***************************************************************************/
- /* Time Objects */
- #define AL_OBJ_TD_ALL 0x3200 /* 50 00 Time and Date Default Variation */
- #define AL_OBJ_TD 0x3201 /* 50 01 Time and Date */
- #define AL_OBJ_TDI 0x3202 /* 50 02 Time and Date w/ Interval */
- #define AL_OBJ_TDR 0x3203 /* 50 03 Last Recorded Time and Date */
- #define AL_OBJ_TDCTO 0x3301 /* 51 01 Time and Date CTO */
- #define AL_OBJ_UTDCTO 0x3302 /* 51 02 Unsynchronized Time and Date CTO */
- #define AL_OBJ_TDELAYC 0x3401 /* 52 01 Time Delay Coarse */
- #define AL_OBJ_TDELAYF 0x3402 /* 52 02 Time Delay Fine */
- /***************************************************************************/
- /* Class Data Objects */
- #define AL_OBJ_CLASS0 0x3C01 /* 60 01 Class 0 Data */
- #define AL_OBJ_CLASS1 0x3C02 /* 60 02 Class 1 Data */
- #define AL_OBJ_CLASS2 0x3C03 /* 60 03 Class 2 Data */
- #define AL_OBJ_CLASS3 0x3C04 /* 60 04 Class 3 Data */
- /***************************************************************************/
- /* File Objects */
- #define AL_OBJ_FILE_CMD 0x4603 /* 70 03 File Control - Command */
- #define AL_OBJ_FILE_STAT 0x4604 /* 70 04 File Control - Status */
- #define AL_OBJ_FILE_TRANS 0x4605 /* 70 05 File Control - Transport */
- #define AL_OBJ_FILE_TRAN_ST 0x4606 /* 70 05 File Control - Transport Status */
- /* File Control Mode flags */
- #define AL_OBJ_FILE_MODE_NULL 0x00 /* NULL */
- #define AL_OBJ_FILE_MODE_READ 0x01 /* READ */
- #define AL_OBJ_FILE_MODE_WRITE 0x02 /* WRITE */
- #define AL_OBJ_FILE_MODE_APPEND 0x03 /* APPEND */
- /***************************************************************************/
- /* Device Objects */
- #define AL_OBJ_IIN 0x5001 /* 80 01 Internal Indications */
- /***************************************************************************/
- /* Octet String Objects */
- #define AL_OBJ_OCT 0x6E00 /* 110 xx Octet string */
- #define AL_OBJ_OCT_EVT 0x6F00 /* 110 xx Octet string event */
- /***************************************************************************/
- /* End of Application Layer Data Object Definitions */
- /***************************************************************************/
- void proto_register_dnp3(void);
- void proto_reg_handoff_dnp3(void);
- /* Initialize the protocol and registered fields */
- static int proto_dnp3 = -1;
- static int hf_dnp3_start = -1;
- static int hf_dnp3_len = -1;
- static int hf_dnp3_ctl = -1;
- static int hf_dnp3_ctl_prifunc = -1;
- static int hf_dnp3_ctl_secfunc = -1;
- static int hf_dnp3_ctl_dir = -1;
- static int hf_dnp3_ctl_prm = -1;
- static int hf_dnp3_ctl_fcb = -1;
- static int hf_dnp3_ctl_fcv = -1;
- static int hf_dnp3_ctl_dfc = -1;
- static int hf_dnp3_dst = -1;
- static int hf_dnp3_src = -1;
- static int hf_dnp_hdr_CRC = -1;
- static int hf_dnp_hdr_CRC_bad = -1;
- static int hf_dnp3_tr_ctl = -1;
- static int hf_dnp3_tr_fin = -1;
- static int hf_dnp3_tr_fir = -1;
- static int hf_dnp3_tr_seq = -1;
- static int hf_dnp3_al_ctl = -1;
- static int hf_dnp3_al_fir = -1;
- static int hf_dnp3_al_fin = -1;
- static int hf_dnp3_al_con = -1;
- static int hf_dnp3_al_uns = -1;
- static int hf_dnp3_al_seq = -1;
- static int hf_dnp3_al_func = -1;
- /* Added for Application Layer Decoding */
- static int hf_dnp3_al_iin = -1;
- static int hf_dnp3_al_iin_bmsg = -1;
- static int hf_dnp3_al_iin_cls1d = -1;
- static int hf_dnp3_al_iin_cls2d = -1;
- static int hf_dnp3_al_iin_cls3d = -1;
- static int hf_dnp3_al_iin_tsr = -1;
- static int hf_dnp3_al_iin_dol = -1;
- static int hf_dnp3_al_iin_dt = -1;
- static int hf_dnp3_al_iin_rst = -1;
- static int hf_dnp3_al_iin_fcni = -1;
- static int hf_dnp3_al_iin_obju = -1;
- static int hf_dnp3_al_iin_pioor = -1;
- static int hf_dnp3_al_iin_ebo = -1;
- static int hf_dnp3_al_iin_oae = -1;
- static int hf_dnp3_al_iin_cc = -1;
- static int hf_dnp3_al_obj = -1;
- static int hf_dnp3_al_objq_index = -1;
- static int hf_dnp3_al_objq_code = -1;
- static int hf_dnp3_al_range_start8 = -1;
- static int hf_dnp3_al_range_stop8 = -1;
- static int hf_dnp3_al_range_start16 = -1;
- static int hf_dnp3_al_range_stop16 = -1;
- static int hf_dnp3_al_range_start32 = -1;
- static int hf_dnp3_al_range_stop32 = -1;
- static int hf_dnp3_al_range_abs8 = -1;
- static int hf_dnp3_al_range_abs16 = -1;
- static int hf_dnp3_al_range_abs32 = -1;
- static int hf_dnp3_al_range_quant8 = -1;
- static int hf_dnp3_al_range_quant16 = -1;
- static int hf_dnp3_al_range_quant32 = -1;
- static int hf_dnp3_al_index8 = -1;
- static int hf_dnp3_al_index16 = -1;
- static int hf_dnp3_al_index32 = -1;
- static int hf_dnp3_al_size8 = -1;
- static int hf_dnp3_al_size16 = -1;
- static int hf_dnp3_al_size32 = -1;
- /*static int hf_dnp3_al_objq = -1;
- static int hf_dnp3_al_nobj = -1; */
- /* XXX - unused
- static int hf_dnp3_al_ptnum = -1; */
- static int hf_dnp3_al_biq_b0 = -1;
- static int hf_dnp3_al_biq_b1 = -1;
- static int hf_dnp3_al_biq_b2 = -1;
- static int hf_dnp3_al_biq_b3 = -1;
- static int hf_dnp3_al_biq_b4 = -1;
- static int hf_dnp3_al_biq_b5 = -1;
- static int hf_dnp3_al_biq_b6 = -1;
- static int hf_dnp3_al_biq_b7 = -1;
- static int hf_dnp3_al_boq_b0 = -1;
- static int hf_dnp3_al_boq_b1 = -1;
- static int hf_dnp3_al_boq_b2 = -1;
- static int hf_dnp3_al_boq_b3 = -1;
- static int hf_dnp3_al_boq_b4 = -1;
- static int hf_dnp3_al_boq_b5 = -1;
- static int hf_dnp3_al_boq_b6 = -1;
- static int hf_dnp3_al_boq_b7 = -1;
- static int hf_dnp3_al_ctrq_b0 = -1;
- static int hf_dnp3_al_ctrq_b1 = -1;
- static int hf_dnp3_al_ctrq_b2 = -1;
- static int hf_dnp3_al_ctrq_b3 = -1;
- static int hf_dnp3_al_ctrq_b4 = -1;
- static int hf_dnp3_al_ctrq_b5 = -1;
- static int hf_dnp3_al_ctrq_b6 = -1;
- static int hf_dnp3_al_ctrq_b7 = -1;
- static int hf_dnp3_al_aiq_b0 = -1;
- static int hf_dnp3_al_aiq_b1 = -1;
- static int hf_dnp3_al_aiq_b2 = -1;
- static int hf_dnp3_al_aiq_b3 = -1;
- static int hf_dnp3_al_aiq_b4 = -1;
- static int hf_dnp3_al_aiq_b5 = -1;
- static int hf_dnp3_al_aiq_b6 = -1;
- static int hf_dnp3_al_aiq_b7 = -1;
- static int hf_dnp3_al_aoq_b0 = -1;
- static int hf_dnp3_al_aoq_b1 = -1;
- static int hf_dnp3_al_aoq_b2 = -1;
- static int hf_dnp3_al_aoq_b3 = -1;
- static int hf_dnp3_al_aoq_b4 = -1;
- static int hf_dnp3_al_aoq_b5 = -1;
- static int hf_dnp3_al_aoq_b6 = -1;
- static int hf_dnp3_al_aoq_b7 = -1;
- static int hf_dnp3_al_timestamp = -1;
- static int hf_dnp3_al_file_perms = -1;
- static int hf_dnp3_al_file_perms_read_owner = -1;
- static int hf_dnp3_al_file_perms_write_owner = -1;
- static int hf_dnp3_al_file_perms_exec_owner = -1;
- static int hf_dnp3_al_file_perms_read_group = -1;
- static int hf_dnp3_al_file_perms_write_group = -1;
- static int hf_dnp3_al_file_perms_exec_group = -1;
- static int hf_dnp3_al_file_perms_read_world = -1;
- static int hf_dnp3_al_file_perms_write_world = -1;
- static int hf_dnp3_al_file_perms_exec_world = -1;
- static int hf_dnp3_al_rel_timestamp = -1;
- static int hf_dnp3_al_ana16 = -1;
- static int hf_dnp3_al_ana32 = -1;
- static int hf_dnp3_al_anaflt = -1;
- static int hf_dnp3_al_anadbl = -1;
- static int hf_dnp3_al_bit = -1;
- static int hf_dnp3_al_2bit = -1;
- static int hf_dnp3_al_cnt16 = -1;
- static int hf_dnp3_al_cnt32 = -1;
- static int hf_dnp3_al_ctrlstatus = -1;
- static int hf_dnp3_al_anaout16 = -1;
- static int hf_dnp3_al_anaout32 = -1;
- static int hf_dnp3_al_anaoutflt = -1;
- static int hf_dnp3_al_anaoutdbl = -1;
- static int hf_dnp3_al_file_mode = -1;
- static int hf_dnp3_al_file_auth = -1;
- static int hf_dnp3_al_file_size = -1;
- static int hf_dnp3_al_file_maxblk = -1;
- static int hf_dnp3_al_file_reqID = -1;
- static int hf_dnp3_al_file_handle = -1;
- static int hf_dnp3_al_file_status = -1;
- static int hf_dnp3_al_file_blocknum = -1;
- static int hf_dnp3_al_file_lastblock = -1;
- static int hf_dnp3_al_file_data = -1;
- static int hf_dnp3_ctlobj_code_c = -1;
- static int hf_dnp3_ctlobj_code_m = -1;
- static int hf_dnp3_ctlobj_code_tc = -1;
- /***************************************************************************/
- /* Value String Look-Ups */
- /***************************************************************************/
- static const value_string dnp3_ctl_func_pri_vals[] = {
- { DL_FUNC_RESET_LINK, "Reset of Remote Link" },
- { DL_FUNC_RESET_PROC, "Reset of User Process" },
- { DL_FUNC_TEST_LINK, "Test Function For Link" },
- { DL_FUNC_USER_DATA, "User Data" },
- { DL_FUNC_UNC_DATA, "Unconfirmed User Data" },
- { DL_FUNC_LINK_STAT, "Request Link Status" },
- { 0, NULL }
- };
- static const value_string dnp3_ctl_func_sec_vals[] = {
- { DL_FUNC_ACK, "ACK" },
- { DL_FUNC_NACK, "NACK" },
- { DL_FUNC_STAT_LINK, "Status of Link" },
- { DL_FUNC_NO_FUNC, "Link Service Not Functioning" },
- { DL_FUNC_NOT_IMPL, "Link Service Not Used or Implemented" },
- { 0, NULL }
- };
- #if 0
- static const value_string dnp3_ctl_flags_pri_vals[] = {
- { DNP3_CTL_DIR, "DIR" },
- { DNP3_CTL_PRM, "PRM" },
- { DNP3_CTL_FCB, "FCB" },
- { DNP3_CTL_FCV, "FCV" },
- { 0, NULL }
- };
- #endif
- #if 0
- static const value_string dnp3_ctl_flags_sec_vals[]= {
- { DNP3_CTL_DIR, "DIR" },
- { DNP3_CTL_PRM, "PRM" },
- { DNP3_CTL_RES, "RES" },
- { DNP3_CTL_DFC, "DFC" },
- { 0, NULL }
- };
- #endif
- #if 0
- static const value_string dnp3_tr_flags_vals[] = {
- { DNP3_TR_FIN, "FIN" },
- { DNP3_TR_FIR, "FIR" },
- { 0, NULL }
- };
- #endif
- #if 0
- static const value_string dnp3_al_flags_vals[] = {
- { DNP3_AL_FIR, "FIR" },
- { DNP3_AL_FIN, "FIN" },
- { DNP3_AL_CON, "CON" },
- { DNP3_AL_UNS, "UNS" },
- { 0, NULL }
- };
- #endif
- /* Application Layer Function Code Values */
- static const value_string dnp3_al_func_vals[] = {
- { AL_FUNC_CONFIRM, "Confirm" },
- { AL_FUNC_READ, "Read" },
- { AL_FUNC_WRITE, "Write" },
- { AL_FUNC_SELECT, "Select" },
- { AL_FUNC_OPERATE, "Operate" },
- { AL_FUNC_DIROP, "Direct Operate" },
- { AL_FUNC_DIROPNACK, "Direct Operate No Ack" },
- { AL_FUNC_FRZ, "Immediate Freeze" },
- { AL_FUNC_FRZNACK, "Immediate Freeze No Ack" },
- { AL_FUNC_FRZCLR, "Freeze and Clear" },
- { AL_FUNC_FRZCLRNACK, "Freeze and Clear No ACK" },
- { AL_FUNC_FRZT, "Freeze With Time" },
- { AL_FUNC_FRZTNACK, "Freeze With Time No ACK" },
- { AL_FUNC_COLDRST, "Cold Restart" },
- { AL_FUNC_WARMRST, "Warm Restart" },
- { AL_FUNC_INITDATA, "Initialize Data" },
- { AL_FUNC_INITAPP, "Initialize Application" },
- { AL_FUNC_STARTAPP, "Start Application" },
- { AL_FUNC_STOPAPP, "Stop Application" },
- { AL_FUNC_SAVECFG, "Save Configuration" },
- { AL_FUNC_ENSPMSG, "Enable Spontaneous Messages" },
- { AL_FUNC_DISSPMSG, "Disable Spontaneous Messages" },
- { AL_FUNC_ASSIGNCL, "Assign Classes" },
- { AL_FUNC_DELAYMST, "Delay Measurement" },
- { AL_FUNC_RECCT, "Record Current Time" },
- { AL_FUNC_OPENFILE, "Open File" },
- { AL_FUNC_CLOSEFILE, "Close File" },
- { AL_FUNC_DELETEFILE, "Delete File" },
- { AL_FUNC_GETFILEINF, "Get File Info" },
- { AL_FUNC_AUTHFILE, "Authenticate File" },
- { AL_FUNC_ABORTFILE, "Abort File" },
- { AL_FUNC_ACTCNF, "Activate Config" },
- { AL_FUNC_AUTHREQ, "Authentication Request" },
- { AL_FUNC_AUTHERR, "Authentication Error" },
- { AL_FUNC_RESPON, "Response" },
- { AL_FUNC_UNSOLI, "Unsolicited Response" },
- { AL_FUNC_AUTHRESP, "Authentication Response" },
- { 0, NULL }
- };
- static value_string_ext dnp3_al_func_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_func_vals);
- #if 0
- /* Application Layer Internal Indication (IIN) bit Values */
- static const value_string dnp3_al_iin_vals[] = {
- { AL_IIN_BMSG, "Broadcast message Rx'd" },
- { AL_IIN_CLS1D, "Class 1 Data Available" },
- { AL_IIN_CLS2D, "Class 2 Data Available" },
- { AL_IIN_CLS3D, "Class 3 Data Available" },
- { AL_IIN_TSR, "Time Sync Required from Master" },
- { AL_IIN_DOL, "Outputs in Local Mode" },
- { AL_IIN_DT, "Device Trouble" },
- { AL_IIN_RST, "Device Restart" },
- { AL_IIN_FCNI, "Function Code not implemented" },
- { AL_IIN_OBJU, "Requested Objects Unknown" },
- { AL_IIN_PIOOR, "Parameters Invalid or Out of Range" },
- { AL_IIN_EBO, "Event Buffer Overflow" },
- { AL_IIN_OAE, "Operation Already Executing" },
- { AL_IIN_CC, "Device Configuration Corrupt" },
- { 0, NULL }
- };
- #endif
- /* Application Layer Object Qualifier Index Values When Qualifier Code != 11 */
- static const value_string dnp3_al_objq_index_vals[] = {
- { AL_OBJQL_IDX_NI, "None" },
- { AL_OBJQL_IDX_1O, "1-Octet Indexing" },
- { AL_OBJQL_IDX_2O, "2-Octet Indexing" },
- { AL_OBJQL_IDX_4O, "4-Octet Indexing" },
- { AL_OBJQL_IDX_1OS, "1-Octet Object Size" },
- { AL_OBJQL_IDX_2OS, "2-Octet Object Size" },
- { AL_OBJQL_IDX_4OS, "4-Octet Object Size" },
- { 0, NULL }
- };
- static value_string_ext dnp3_al_objq_index_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_objq_index_vals);
- /* Application Layer Object Qualifier Code Values */
- static const value_string dnp3_al_objq_code_vals[] = {
- { AL_OBJQL_CODE_SSI8, "8-bit Start and Stop Indices" },
- { AL_OBJQL_CODE_SSI16, "16-bit Start and Stop Indices" },
- { AL_OBJQL_CODE_SSI32, "32-bit Start and Stop Indices" },
- { AL_OBJQL_CODE_AA8, "8-bit Absolute Address in Range Field" },
- { AL_OBJQL_CODE_AA16, "16-bit Absolute Address in Range Field" },
- { AL_OBJQL_CODE_AA32, "32-bit Absolute Address in Range Field" },
- { AL_OBJQL_CODE_R0, "No Range Field" },
- { AL_OBJQL_CODE_SF8, "8-bit Single Field Quantity" },
- { AL_OBJQL_CODE_SF16, "16-bit Single Field Quantity" },
- { AL_OBJQL_CODE_SF32, "32-bit Single Field Quantity" },
- { 10, "Reserved" },
- { AL_OBJQL_CODE_FF, "Free-format Qualifier" },
- { 0, NULL }
- };
- static value_string_ext dnp3_al_objq_code_vals_ext = VALUE_STRING_EXT_INIT(dnp3_al_objq_code_vals);
- /* Application Layer Data Object Values */
- static const value_string dnp3_al_obj_vals[] = {
- { AL_OBJ_BI_ALL, "Binary Input Default Variation (Obj:01, Var:Default)" },
- { AL_OBJ_BI_1BIT, "Single-Bit Binary Input (Obj:01, Var:01)" },
- { AL_OBJ_BI_STAT, "Binary Input With Status (Obj:01, Var:02)" },
- { AL_OBJ_BIC_ALL, "Binary Input Change Default Variation (Obj:02, Var:Default)" },
- { AL_OBJ_BIC_NOTIME, "Binary Input Change Without Time (Obj:02, Var:01)" },
- { AL_OBJ_BIC_TIME, "Binary Input Change With Time (Obj:02, Var:02)" },
- { AL_OBJ_BIC_RTIME, "Binary Input Change With Relative Time (Obj:02, Var:03)" },
- { AL_OBJ_2BI_ALL, "Double-bit Input Default Variation (Obj:03, Var:Default)" },
- { AL_OBJ_2BI_NF, "Double-bit Input No Flags (Obj:03, Var:01)" },
- { AL_OBJ_2BI_STAT, "Double-bit Input With Status (Obj:03, Var:02)" },
- { AL_OBJ_2BIC_NOTIME, "Double-bit Input Change Without Time (Obj:04, Var:01)" },
- { AL_OBJ_2BIC_TIME, "Double-bit Input Change With Time (Obj:04, Var:02)" },
- { AL_OBJ_2BIC_RTIME, "Double-bit Input Change With Relative Time (Obj:04, Var:03)" },
- { AL_OBJ_BO_ALL, "Binary Output Default Variation (Obj:10, Var:Default)" },
- { AL_OBJ_BO, "Binary Output (Obj:10, Var:01)" },
- { AL_OBJ_BO_STAT, "Binary Output Status (Obj:10, Var:02)" },
- { AL_OBJ_BOC_ALL, "Binary Output Change Default Variation (Obj:11, Var:Default)" },
- { AL_OBJ_BOC_NOTIME, "Binary Output Change Without Time (Obj:11, Var:01)" },
- { AL_OBJ_BOC_TIME, "Binary Output Change With Time (Obj:11, Var:02)" },
- { AL_OBJ_CTLOP_BLK, "Control Relay Output Block (Obj:12, Var:01)" },
- { AL_OBJ_CTR_ALL, "Binary Counter Default Variation (Obj:20, Var:Default)" },
- { AL_OBJ_CTR_32, "32-Bit Binary Counter (Obj:20, Var:01)" },
- { AL_OBJ_CTR_16, "16-Bit Binary Counter (Obj:20, Var:02)" },
- { AL_OBJ_DCTR_32, "32-Bit Binary Delta Counter (Obj:20, Var:03)" },
- { AL_OBJ_DCTR_16, "16-Bit Binary Delta Counter (Obj:20, Var:04)" },
- { AL_OBJ_CTR_32NF, "32-Bit Binary Counter Without Flag (Obj:20, Var:05)" },
- { AL_OBJ_CTR_16NF, "16-Bit Binary Counter Without Flag (Obj:20, Var:06)" },
- { AL_OBJ_DCTR_32NF, "32-Bit Binary Delta Counter Without Flag (Obj:20, Var:07)" },
- { AL_OBJ_DCTR_16NF, "16-Bit Binary Delta Counter Without Flag (Obj:20, Var:08)" },
- { AL_OBJ_FCTR_ALL, "Frozen Binary Counter Default Variation (Obj:21, Var:Default)" },
- { AL_OBJ_FCTR_32, "32-Bit Frozen Binary Counter (Obj:21, Var:01)" },
- { AL_OBJ_FCTR_16, "16-Bit Frozen Binary Counter (Obj:21, Var:02)" },
- { AL_OBJ_FDCTR_32, "32-Bit Frozen Binary Delta Counter (Obj:21, Var:03)" },
- { AL_OBJ_FDCTR_16, "16-Bit Frozen Binary Delta Counter (Obj:21, Var:04)" },
- { AL_OBJ_FCTR_32T, "32-Bit Frozen Binary Counter (Obj:21, Var:01)" },
- { AL_OBJ_FCTR_16T, "16-Bit Frozen Binary Counter (Obj:21, Var:02)" },
- { AL_OBJ_FDCTR_32T, "32-Bit Frozen Binary Delta Counter (Obj:21, Var:03)" },
- { AL_OBJ_FDCTR_16T, "16-Bit Frozen Binary Delta Counter (Obj:21, Var:04)" },
- { AL_OBJ_FCTR_32NF, "32-Bit Frozen Binary Counter Without Flag (Obj:21, Var:05)" },
- { AL_OBJ_FCTR_16NF, "16-Bit Frozen Binary Counter Without Flag (Obj:21, Var:06)" },
- { AL_OBJ_FDCTR_32NF, "32-Bit Frozen Binary Delta Counter Without Flag (Obj:21, Var:07)" },
- { AL_OBJ_FDCTR_16NF, "16-Bit Frozen Binary Delta Counter Without Flag (Obj:21, Var:08)" },
- { AL_OBJ_CTRC_ALL, "Binary Counter Change Default Variation (Obj:22, Var:Default)" },
- { AL_OBJ_CTRC_32, "32-Bit Counter Change Event w/o Time (Obj:22, Var:01)" },
- { AL_OBJ_CTRC_16, "16-Bit Counter Change Event w/o Time (Obj:22, Var:02)" },
- { AL_OBJ_DCTRC_32, "32-Bit Delta Counter Change Event w/o Time (Obj:22, Var:03)" },
- { AL_OBJ_DCTRC_16, "16-Bit Delta Counter Change Event w/o Time (Obj:22, Var:04)" },
- { AL_OBJ_CTRC_32T, "32-Bit Counter Change Event with Time (Obj:22, Var:05)" },
- { AL_OBJ_CTRC_16T, "16-Bit Counter Change Event with Time (Obj:22, Var:06)" },
- { AL_OBJ_DCTRC_32T, "32-Bit Delta Counter Change Event with Time (Obj:22, Var:07)" },
- { AL_OBJ_DCTRC_16T, "16-Bit Delta Counter Change Event with Time (Obj:22, Var:08)" },
- { AL_OBJ_FCTRC_ALL, "Frozen Binary Counter Change Default Variation (Obj:23, Var:Default)" },
- { AL_OBJ_FCTRC_32, "32-Bit Frozen Counter Change Event w/o Time (Obj:23, Var:01)" },
- { AL_OBJ_FCTRC_16, "16-Bit Frozen Counter Change Event w/o Time (Obj:23, Var:02)" },
- { AL_OBJ_FDCTRC_32, "32-Bit Frozen Delta Counter Change Event w/o Time (Obj:23, Var:03)" },
- { AL_OBJ_FDCTRC_16, "16-Bit Frozen Delta Counter Change Event w/o Time (Obj:23, Var:04)" },
- { AL_OBJ_FCTRC_32T, "32-Bit Frozen Counter Change Event with Time (Obj:23, Var:05)" },
- { AL_OBJ_FCTRC_16T, "16-Bit Frozen Counter Change Event with Time (Obj:23, Var:06)" },
- { AL_OBJ_FDCTRC_32T, "32-Bit Frozen Delta Counter Change Event with Time (Obj:23, Var:07)" },
- { AL_OBJ_FDCTRC_16T, "16-Bit Frozen Delta Counter Change Event with Time (Obj:23, Var:08)" },
- { AL_OBJ_AI_ALL, "Analog Input Default Variation (Obj:30, Var:Default)" },
- { AL_OBJ_AI_32, "32-Bit Analog Input (Obj:30, Var:01)" },
- { AL_OBJ_AI_16, "16-Bit Analog Input (Obj:30, Var:02)" },
- { AL_OBJ_AI_32NF, "32-Bit Analog Input Without Flag (Obj:30, Var:03)" },
- { AL_OBJ_AI_16NF, "16-Bit Analog Input Without Flag (Obj:30, Var:04)" },
- { AL_OBJ_AI_FLT, "32-Bit Floating Point Input (Obj:30, Var:05)" },
- { AL_OBJ_AI_DBL, "64-Bit Floating Point Input (Obj:30, Var:06)" },
- { AL_OBJ_AIF_FLT, "32-Bit Frozen Floating Point Input (Obj:31, Var:07)" },
- { AL_OBJ_AIF_DBL, "64-Bit Frozen Floating Point Input (Obj:31, Var:08)" },
- { AL_OBJ_AIC_ALL, "Analog Input Change Default Variation (Obj:32, Var:Default)" },
- { AL_OBJ_AIC_32NT, "32-Bit Analog Change Event w/o Time (Obj:32, Var:01)" },
- { AL_OBJ_AIC_16NT, "16-Bit Analog Change Event w/o Time (Obj:32, Var:02)" },
- { AL_OBJ_AIC_32T, "32-Bit Analog Change Event with Time (Obj:32, Var:03)" },
- { AL_OBJ_AIC_16T, "16-Bit Analog Change Event with Time (Obj:32, Var:04)" },
- { AL_OBJ_AIC_FLTNT, "32-Bit Floating Point Change Event w/o Time (Obj:32, Var:05)" },
- { AL_OBJ_AIC_DBLNT, "64-Bit Floating Point Change Event w/o Time (Obj:32, Var:06)" },
- { AL_OBJ_AIC_FLTT, "32-Bit Floating Point Change Event w/ Time (Obj:32, Var:07)" },
- { AL_OBJ_AIC_DBLT, "64-Bit Floating Point Change Event w/ Time (Obj:32, Var:08)" },
- { AL_OBJ_AIFC_FLTNT, "32-Bit Floating Point Frozen Change Event w/o Time (Obj:33, Var:05)" },
- { AL_OBJ_AIFC_DBLNT, "64-Bit Floating Point Frozen Change Event w/o Time (Obj:33, Var:06)" },
- { AL_OBJ_AIFC_FLTT, "32-Bit Floating Point Frozen Change Event w/ Time (Obj:33, Var:07)" },
- { AL_OBJ_AIFC_DBLT, "64-Bit Floating Point Frozen Change Event w/ Time (Obj:33, Var:08)" },
- { AL_OBJ_AIDB_ALL, "Analog Input Deadband Default Variation (Obj:34, Var:Default)" },
- { AL_OBJ_AIDB_16, "16-Bit Analog Input Deadband (Obj:34, Var:01)" },
- { AL_OBJ_AIDB_32, "32-Bit Analog Input Deadband (Obj:34, Var:02)" },
- { AL_OBJ_AIDB_FLT, "32-Bit Floating Point Analog Input Deadband (Obj:34, Var:03)" },
- { AL_OBJ_AO_ALL, "Analog Output Default Variation (Obj:40, Var:Default)" },
- { AL_OBJ_AO_32, "32-Bit Analog Output Status (Obj:40, Var:01)" },
- { AL_OBJ_AO_16, "16-Bit Analog Output Status (Obj:40, Var:02)" },
- { AL_OBJ_AO_FLT, "32-Bit Floating Point Output Status (Obj:40, Var:03)" },
- { AL_OBJ_AO_DBL, "64-Bit Floating Point Output Status (Obj:40, Var:04)" },
- { AL_OBJ_AO_32OPB, "32-Bit Analog Output Block (Obj:41, Var:01)" },
- { AL_OBJ_AO_16OPB, "16-Bit Analog Output Block (Obj:41, Var:02)" },
- { AL_OBJ_AO_FLTOPB, "32-Bit Floating Point Output Block (Obj:41, Var:03)" },
- { AL_OBJ_AO_DBLOPB, "64-Bit Floating Point Output Block (Obj:41, Var:04)" },
- { AL_OBJ_AOC_ALL, "Analog Output Event Default Variation (Obj:42, Var:Default)" },
- { AL_OBJ_AOC_32NT, "32-Bit Analog Output Event w/o Time (Obj:42, Var:01)" },
- { AL_OBJ_AOC_16NT, "16-Bit Analog Output Event w/o Time (Obj:42, Var:02)" },
- { AL_OBJ_AOC_32T, "32-Bit Analog Output Event with Time (Obj:42, Var:03)" },
- { AL_OBJ_AOC_16T, "16-Bit Analog Output Event with Time (Obj:42, Var:04)" },
- { AL_OBJ_AOC_FLTNT, "32-Bit Floating Point Output Event w/o Time (Obj:42, Var:05)" },
- { AL_OBJ_AOC_DBLNT, "64-Bit Floating Point Output Event w/o Time (Obj:42, Var:06)" },
- { AL_OBJ_AOC_FLTT, "32-Bit Floating Point Output Event w/ Time (Obj:42, Var:07)" },
- { AL_OBJ_AOC_DBLT, "64-Bit Floating Point Output Event w/ Time (Obj:42, Var:08)" },
- { AL_OBJ_TD_ALL, "Time and Date Default Variations (Obj:50, Var:Default)" },
- { AL_OBJ_TD, "Time and Date (Obj:50, Var:01)" },
- { AL_OBJ_TDI, "Time and Date w/Interval (Obj:50, Var:02)" },
- { AL_OBJ_TDR, "Last Recorded Time and Date (Obj:50, Var:03)" },
- { AL_OBJ_TDCTO, "Time and Date CTO (Obj:51, Var:01)" },
- { AL_OBJ_TDELAYF, "Time Delay - Fine (Obj:52, Var:02)" },
- { AL_OBJ_CLASS0, "Class 0 Data (Obj:60, Var:01)" },
- { AL_OBJ_CLASS1, "Class 1 Data (Obj:60, Var:02)" },
- { AL_OBJ_CLASS2, "Class 2 Data (Obj:60, Var:03)" },
- { AL_OBJ_CLASS3, "Class 3 Data (Obj:60, Var:04)" },
- { AL_OBJ_FILE_CMD, "File Control - File Command (Obj:70, Var:03)" },
- { AL_OBJ_FILE_STAT, "File Control - File Status (Obj:70, Var:04)" },
- { AL_OBJ_FILE_TRANS, "File Control - File Transport (Obj:70, Var:05)" },
- { AL_OBJ_FILE_TRAN_ST, "File Control - File Transport Status (Obj:70, Var:06)" },
- { AL_OBJ_IIN, "Internal Indications (Obj:80, Var:01)" },
- { AL_OBJ_OCT, "Octet String (Obj:110)" },
- { AL_OBJ_OCT_EVT, "Octet String Event (Obj:111)" },
- { 0, NULL }
- };
- static value_string_ext dnp3_al_obj_vals_ext = …
Large files files are truncated, but you can click here to view the full file