Go to the documentation of this file.
24 #ifndef SURICATA_APP_LAYER_DNP3_H
25 #define SURICATA_APP_LAYER_DNP3_H
28 #if __BYTE_ORDER == __BIG_ENDIAN
33 #define DNP3_APP_FC_CONFIRM 0x00
34 #define DNP3_APP_FC_READ 0x01
35 #define DNP3_APP_FC_WRITE 0x02
36 #define DNP3_APP_FC_SELECT 0x03
37 #define DNP3_APP_FC_OPERATE 0x04
38 #define DNP3_APP_FC_DIR_OPERATE 0x05
39 #define DNP3_APP_FC_DIR_OPERATE_NR 0x06
40 #define DNP3_APP_FC_FREEZE 0x07
41 #define DNP3_APP_FC_FREEZE_NR 0x08
42 #define DNP3_APP_FC_FREEZE_CLEAR 0x09
43 #define DNP3_APP_FC_FREEZE_CLEAR_NR 0x0a
44 #define DNP3_APP_FC_FREEZE_AT_TIME 0x0b
45 #define DNP3_APP_FC_FREEZE_AT_TIME_NR 0x0c
46 #define DNP3_APP_FC_COLD_RESTART 0x0d
47 #define DNP3_APP_FC_WARM_RESTART 0x0e
48 #define DNP3_APP_FC_INITIALIZE_DATA 0x0f
49 #define DNP3_APP_FC_INITIALIZE_APPLICATION 0x10
50 #define DNP3_APP_FC_START_APPLICATION 0x11
51 #define DNP3_APP_FC_STOP_APPLICATION 0x12
52 #define DNP3_APP_FC_SAVE_CONFIGURATION 0x13
53 #define DNP3_APP_FC_ENABLE_UNSOLICITED 0x14
54 #define DNP3_APP_FC_DISABLE_UNSOLICITED 0x15
55 #define DNP3_APP_FC_ASSIGN_CLASS 0x16
56 #define DNP3_APP_FC_DELAY_MEASUREMENT 0x17
57 #define DNP3_APP_FC_RECORD_CURRENT_TIME 0x18
58 #define DNP3_APP_FC_OPEN_TIME 0x19
59 #define DNP3_APP_FC_CLOSE_FILE 0x1a
60 #define DNP3_APP_FC_DELETE_FILE 0x1b
61 #define DNP3_APP_FC_GET_FILE_INFO 0x1c
62 #define DNP3_APP_FC_AUTHENTICATE_FILE 0x1d
63 #define DNP3_APP_FC_ABORT_FILE 0x1e
64 #define DNP3_APP_FC_ACTIVATE_CONFIG 0x1f
65 #define DNP3_APP_FC_AUTH_REQ 0x20
66 #define DNP3_APP_FC_AUTH_REQ_NR 0x21
69 #define DNP3_APP_FC_RESPONSE 0x81
70 #define DNP3_APP_FC_UNSOLICITED_RESP 0x82
71 #define DNP3_APP_FC_AUTH_RESP 0x83
74 #define DNP3_LINK_DIR(control) (control & 0x80)
75 #define DNP3_LINK_PRI(control) (control & 0x40)
76 #define DNP3_LINK_FCB(control) (control & 0x20)
77 #define DNP3_LINK_FCV(control) (control & 0x10)
78 #define DNP3_LINK_FC(control) (control & 0x0f)
81 #define DNP3_TH_FIN(x) (x & 0x80)
82 #define DNP3_TH_FIR(x) (x & 0x40)
83 #define DNP3_TH_SEQ(x) (x & 0x3f)
86 #define DNP3_APP_FIR(x) (x & 0x80)
87 #define DNP3_APP_FIN(x) (x & 0x40)
88 #define DNP3_APP_CON(x) (x & 0x20)
89 #define DNP3_APP_UNS(x) (x & 0x10)
90 #define DNP3_APP_SEQ(x) (x & 0x0f)
94 #if __BYTE_ORDER == __BIG_ENDIAN
95 #define DNP3_SWAP16(x) SCByteSwap16(x)
96 #define DNP3_SWAP32(x) SCByteSwap32(x)
97 #define DNP3_SWAP64(x) SCByteSwap64(x)
98 #elif __BYTE_ORDER == __LITTLE_ENDIAN
99 #define DNP3_SWAP16(x) x
100 #define DNP3_SWAP32(x) x
101 #define DNP3_SWAP64(x) x
224 DNP3ApplicationHeader
ah;
TAILQ_ENTRY(DNP3Transaction_) next
void DNP3ParserRegisterTests(void)
@ DNP3_DECODER_EVENT_MALFORMED
DNP3Buffer response_buffer
struct HtpBodyChunk_ * next
@ DNP3_DECODER_EVENT_FLOODED
Struct to hold the list of decoded objects.
struct DNP3Object_ DNP3Object
Struct to hold the list of decoded objects.
struct DNP3LinkHeader_ __attribute__((__packed__)) DNP3LinkHeader
DNP3 link header.
typedef TAILQ_HEAD(DNP3PointList_, DNP3Point_) DNP3PointList
void RegisterDNP3Parsers(void)
Register the DNP3 application protocol parser.
DNP3Buffer request_buffer
@ DNP3_DECODER_EVENT_UNKNOWN_OBJECT
TAILQ_ENTRY(DNP3Object_) next
DNP3 internal indicators.
struct DNP3State_ DNP3State
Per flow DNP3 state.
TAILQ_HEAD(, DNP3Transaction_) tx_list
struct AppLayerTxData AppLayerTxData
@ DNP3_DECODER_EVENT_BAD_LINK_CRC
struct DNP3Point_ DNP3Point
DNP3 object point.
AppLayerStateData state_data
@ DNP3_DECODER_EVENT_BAD_TRANSPORT_CRC
struct DNP3Transaction_ DNP3Transaction
DNP3 transaction.
struct DNP3Buffer_ DNP3Buffer
A struct used for buffering incoming data prior to reassembly.
TAILQ_ENTRY(DNP3Point_) next
uint8_t DNP3TransportHeader
DNP3 transport header.
int DNP3PrefixIsSize(uint8_t)
Check if the prefix code is a size prefix.
A struct used for buffering incoming data prior to reassembly.
@ DNP3_DECODER_EVENT_LEN_TOO_SMALL