2 * Routines for CIP (Common Industrial Protocol) Safety dissection
3 * CIP Safety Home: www.odva.org
6 * Michael Mann <mmann@pyramidsolutions.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: GPL-2.0-or-later
14 #ifndef PACKET_CIPSAFETY_H
15 #define PACKET_CIPSAFETY_H
17 #include "packet-enip.h"
19 /* Classes that have class-specific dissectors */
20 #define CI_CLS_SAFETY_SUPERVISOR 0x39 /* Safety Supervisor */
21 #define CI_CLS_SAFETY_VALIDATOR 0x3A /* Safety Validator */
23 /* Class specific services */
24 /* Safety Supervisor */
25 #define SC_SSUPER_RECOVER 0x4C
26 #define SC_SSUPER_PERFORM_DIAGNOSTICS 0x4E
27 #define SC_SSUPER_CONFIGURE_REQUEST 0x4F
28 #define SC_SSUPER_VALIDATE_CONFIGURATION 0x50
29 #define SC_SSUPER_SET_PASSWORD 0x51
30 #define SC_SSUPER_CONFIGURATION_LOCK 0x52
31 #define SC_SSUPER_MODE_CHANGE 0x53
32 #define SC_SSUPER_SAFETY_RESET 0x54
33 #define SC_SSUPER_RESET_PASSWORD 0x55
34 #define SC_SSUPER_PROPOSE_TUNID 0x56
35 #define SC_SSUPER_APPLY_TUNID 0x57
36 #define SC_SSUPER_PROPOSE_TUNID_LIST 0x58
37 #define SC_SSUPER_APPLY_TUNID_LIST 0x59
39 typedef struct cip_safety_info
{
40 enum enip_connid_type conn_type
;
41 cip_conn_info_t
* eip_conn_info
;
49 extern void dissect_unid(tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, proto_item
*pi
, const char* snn_name
, int hf_snn_timestamp
,
50 int hf_snn_date
, int hf_snn_time
, int hf_macid
, int ett
, int ett_snn
);
51 extern void dissect_cipsafety_snn(proto_tree
*tree
, tvbuff_t
*tvb
, packet_info
*pinfo
, int offset
, int hf_real_datetime
, int hf_date
, int hf_time
);
52 extern void cip_safety_128us_fmt(char *s
, uint32_t value
);
53 extern void add_safety_data_type_to_info_column(packet_info
*pinfo
, enum enip_connid_type conn_type
, const cip_safety_epath_info_t
* safety
);
58 extern const value_string cipsafety_snn_date_vals
[8];
59 extern const attribute_info_t cip_safety_attribute_vals
[51];
60 extern const range_string safety_max_consumer_numbers
[];
62 #endif /* PACKET_CIPSAFETY_H */