3 * Author: Thomas Wiens, 2014 (th.wiens@gmx.de)
4 * Description: Wireshark dissector for S7-Communication
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __PACKET_S7COMM_H__
13 #define __PACKET_S7COMM_H__
15 /**************************************************************************
16 * Returnvalues of an item response
18 #define S7COMM_ITEM_RETVAL_RESERVED 0x00
19 #define S7COMM_ITEM_RETVAL_DATA_HW_FAULT 0x01
20 #define S7COMM_ITEM_RETVAL_DATA_ACCESS_FAULT 0x03
21 #define S7COMM_ITEM_RETVAL_DATA_OUTOFRANGE 0x05 /* the desired address is beyond limit for this PLC */
22 #define S7COMM_ITEM_RETVAL_DATA_NOT_SUP 0x06 /* Type is not supported */
23 #define S7COMM_ITEM_RETVAL_DATA_SIZEMISMATCH 0x07 /* Data type inconsistent */
24 #define S7COMM_ITEM_RETVAL_DATA_ERR 0x0a /* the desired item is not available in the PLC, e.g. when trying to read a non existing DB*/
25 #define S7COMM_ITEM_RETVAL_DATA_OK 0xff
27 /**************************************************************************
28 * Names of userdata subfunctions in group 4 (CPU functions)
30 #define S7COMM_UD_SUBF_CPU_READSZL 0x01
31 #define S7COMM_UD_SUBF_CPU_MSGS 0x02
32 #define S7COMM_UD_SUBF_CPU_DIAGMSG 0x03
33 #define S7COMM_UD_SUBF_CPU_ALARM8_IND 0x05
34 #define S7COMM_UD_SUBF_CPU_NOTIFY_IND 0x06
35 #define S7COMM_UD_SUBF_CPU_ALARM8LOCK 0x07
36 #define S7COMM_UD_SUBF_CPU_ALARM8UNLOCK 0x08
37 #define S7COMM_UD_SUBF_CPU_ALARMACK 0x0b
38 #define S7COMM_UD_SUBF_CPU_ALARMACK_IND 0x0c
39 #define S7COMM_UD_SUBF_CPU_ALARM8LOCK_IND 0x0d
40 #define S7COMM_UD_SUBF_CPU_ALARM8UNLOCK_IND 0x0e
41 #define S7COMM_UD_SUBF_CPU_ALARMSQ_IND 0x11
42 #define S7COMM_UD_SUBF_CPU_ALARMS_IND 0x12
43 #define S7COMM_UD_SUBF_CPU_ALARMQUERY 0x13
44 #define S7COMM_UD_SUBF_CPU_NOTIFY8_IND 0x16
46 /**************************************************************************
47 * Names of types in userdata parameter part
49 #define S7COMM_UD_TYPE_IND 0x0
50 #define S7COMM_UD_TYPE_REQ 0x1
51 #define S7COMM_UD_TYPE_RES 0x2
53 extern const value_string s7comm_item_return_valuenames
[];
55 uint32_t s7comm_decode_ud_cpu_diagnostic_message(tvbuff_t
*tvb
, packet_info
*pinfo
, bool add_info_to_col
, proto_tree
*data_tree
, uint32_t offset
);
60 * Editor modelines - https://www.wireshark.org/tools/modelines.html
65 * indent-tabs-mode: nil
68 * vi: set shiftwidth=4 tabstop=8 expandtab:
69 * :indentSize=4:tabSize=8:noTabs=true: