27#define SC_GET_ATT_ALL 0x01
28#define SC_SET_ATT_ALL 0x02
29#define SC_GET_ATT_LIST 0x03
30#define SC_SET_ATT_LIST 0x04
36#define SC_MULT_SERV_PACK 0x0A
37#define SC_APPLY_ATTRIBUTES 0x0D
38#define SC_GET_ATT_SINGLE 0x0E
39#define SC_SET_ATT_SINGLE 0x10
40#define SC_FIND_NEXT_OBJ_INST 0x11
44#define SC_GET_MEMBER 0x18
45#define SC_SET_MEMBER 0x19
46#define SC_INSERT_MEMBER 0x1A
47#define SC_REMOVE_MEMBER 0x1B
48#define SC_GROUP_SYNC 0x1C
50#define CIP_SC_MASK 0x7F
51#define CIP_SC_RESPONSE_MASK 0x80
56#define CI_CLS_PCCC 0x67
57#define CI_CLS_MOTION 0x42
59#define CI_CLS_CCO 0xF3
63#define SC_CM_FWD_CLOSE 0x4E
64#define SC_CM_UNCON_SEND 0x52
65#define SC_CM_FWD_OPEN 0x54
66#define SC_CM_GET_CONN_DATA 0x56
67#define SC_CM_SEARCH_CONN_DATA 0x57
68#define SC_CM_LARGE_FWD_OPEN 0x5B
69#define SC_CM_GET_CONN_OWNER 0x5A
70#define SC_CM_CONCURRENT_FWD_OPEN 0x5C
71#define SC_CM_CONCURRENT_FWD_CLOSE 0x5E
74#define SC_PCCC_EXECUTE_PCCC 0x4B
77#define SC_MB_READ_DISCRETE_INPUTS 0x4B
78#define SC_MB_READ_COILS 0x4C
79#define SC_MB_READ_INPUT_REGISTERS 0x4D
80#define SC_MB_READ_HOLDING_REGISTERS 0x4E
81#define SC_MB_WRITE_COILS 0x4F
82#define SC_MB_WRITE_HOLDING_REGISTERS 0x50
83#define SC_MB_PASSTHROUGH 0x51
86#define SC_CCO_KICK_TIMER 0x4B
87#define SC_CCO_OPEN_CONN 0x4C
88#define SC_CCO_CLOSE_CONN 0x4D
89#define SC_CCO_STOP_CONN 0x4E
90#define SC_CCO_CHANGE_START 0x4F
91#define SC_CCO_GET_STATUS 0x50
92#define SC_CCO_CHANGE_COMPLETE 0x51
93#define SC_CCO_AUDIT_CHANGE 0x52
96#define CI_GRC_SUCCESS 0x00
97#define CI_GRC_FAILURE 0x01
98#define CI_GRC_NO_RESOURCE 0x02
99#define CI_GRC_BAD_DATA 0x03
100#define CI_GRC_BAD_PATH 0x04
101#define CI_GRC_BAD_CLASS_INSTANCE 0x05
102#define CI_GRC_PARTIAL_DATA 0x06
103#define CI_GRC_CONN_LOST 0x07
104#define CI_GRC_BAD_SERVICE 0x08
105#define CI_GRC_BAD_ATTR_DATA 0x09
106#define CI_GRC_ATTR_LIST_ERROR 0x0A
107#define CI_GRC_ALREADY_IN_MODE 0x0B
108#define CI_GRC_BAD_OBJ_MODE 0x0C
109#define CI_GRC_OBJ_ALREADY_EXISTS 0x0D
110#define CI_GRC_ATTR_NOT_SETTABLE 0x0E
111#define CI_GRC_PERMISSION_DENIED 0x0F
112#define CI_GRC_DEV_IN_WRONG_STATE 0x10
113#define CI_GRC_REPLY_DATA_TOO_LARGE 0x11
114#define CI_GRC_FRAGMENT_PRIMITIVE 0x12
115#define CI_GRC_CONFIG_TOO_SMALL 0x13
116#define CI_GRC_UNDEFINED_ATTR 0x14
117#define CI_GRC_CONFIG_TOO_BIG 0x15
118#define CI_GRC_OBJ_DOES_NOT_EXIST 0x16
119#define CI_GRC_NO_FRAGMENTATION 0x17
120#define CI_GRC_DATA_NOT_SAVED 0x18
121#define CI_GRC_DATA_WRITE_FAILURE 0x19
122#define CI_GRC_REQUEST_TOO_LARGE 0x1A
123#define CI_GRC_RESPONSE_TOO_LARGE 0x1B
124#define CI_GRC_MISSING_LIST_DATA 0x1C
125#define CI_GRC_INVALID_LIST_STATUS 0x1D
126#define CI_GRC_SERVICE_ERROR 0x1E
127#define CI_GRC_CONN_RELATED_FAILURE 0x1F
128#define CI_GRC_INVALID_PARAMETER 0x20
129#define CI_GRC_WRITE_ONCE_FAILURE 0x21
130#define CI_GRC_INVALID_REPLY 0x22
131#define CI_GRC_BUFFER_OVERFLOW 0x23
132#define CI_GRC_MESSAGE_FORMAT 0x24
133#define CI_GRC_BAD_KEY_IN_PATH 0x25
134#define CI_GRC_BAD_PATH_SIZE 0x26
135#define CI_GRC_UNEXPECTED_ATTR 0x27
136#define CI_GRC_INVALID_MEMBER 0x28
137#define CI_GRC_MEMBER_NOT_SETTABLE 0x29
138#define CI_GRC_G2_SERVER_FAILURE 0x2A
139#define CI_GRC_UNKNOWN_MB_ERROR 0x2B
140#define CI_GRC_ATTRIBUTE_NOT_GET 0x2C
142#define CI_GRC_STILL_PROCESSING 0xFF
146#define PCCC_GS_SUCCESS 0x00
147#define PCCC_GS_ILLEGAL_CMD 0x10
148#define PCCC_GS_HOST_COMMS 0x20
149#define PCCC_GS_MISSING_REMOTE_NODE 0x30
150#define PCCC_GS_HARDWARE_FAULT 0x40
151#define PCCC_GS_ADDRESSING_ERROR 0x50
152#define PCCC_GS_CMD_PROTECTION 0x60
153#define PCCC_GS_PROGRAM_MODE 0x70
154#define PCCC_GS_MISSING_COMPATIBILITY_FILE 0x80
155#define PCCC_GS_BUFFER_FULL_1 0x90
156#define PCCC_GS_WAIT_ACK 0xA0
157#define PCCC_GS_REMOTE_DOWNLOAD_ERROR 0xB0
158#define PCCC_GS_BUFFER_FULL_2 0xC0
159#define PCCC_GS_NOT_USED_1 0xD0
160#define PCCC_GS_NOT_USED_2 0xE0
161#define PCCC_GS_USE_EXTSTS 0xF0
164#define PCCC_ES_ILLEGAL_VALUE 0x01
165#define PCCC_ES_SHORT_ADDRESS 0x02
166#define PCCC_ES_LONG_ADDRESS 0x03
167#define PCCC_ES_NOT_FOUND 0x04
168#define PCCC_ES_BAD_FORMAT 0x05
169#define PCCC_ES_BAD_POINTER 0x06
170#define PCCC_ES_BAD_SIZE 0x07
171#define PCCC_ES_SITUATION_CHANGED 0x08
172#define PCCC_ES_DATA_TOO_LARGE 0x09
173#define PCCC_ES_TRANS_TOO_LARGE 0x0A
174#define PCCC_ES_ACCESS_DENIED 0x0B
175#define PCCC_ES_NOT_AVAILABLE 0x0C
176#define PCCC_ES_ALREADY_EXISTS 0x0D
177#define PCCC_ES_NO_EXECUTION 0x0E
178#define PCCC_ES_HIST_OVERFLOW 0x0F
179#define PCCC_ES_NO_ACCESS 0x10
180#define PCCC_ES_ILLEGAL_DATA_TYPE 0x11
181#define PCCC_ES_INVALID_DATA 0x12
182#define PCCC_ES_BAD_REFERENCE 0x13
183#define PCCC_ES_EXECUTION_FAILURE 0x14
184#define PCCC_ES_CONVERSION_ERROR 0x15
185#define PCCC_ES_NO_COMMS 0x16
186#define PCCC_ES_TYPE_MISMATCH 0x17
187#define PCCC_ES_BAD_RESPONSE 0x18
188#define PCCC_ES_DUP_LABEL 0x19
189#define PCCC_ES_FILE_ALREADY_OPEN 0x1A
190#define PCCC_ES_PROGRAM_ALREADY_OWNED 0x1B
191#define PCCC_ES_RESERVED_1 0x1C
192#define PCCC_ES_RESERVED_2 0x1D
193#define PCCC_ES_PROTECTION_VIOLATION 0x1E
194#define PCCC_ES_TMP_INTERNAL_ERROR 0x1F
195#define PCCC_ES_RACK_FAULT 0x22
196#define PCCC_ES_TIMEOUT 0x23
197#define PCCC_ES_UNKNOWN 0x24
200#define PCCC_CMD_00 0x00
201#define PCCC_CMD_01 0x01
202#define PCCC_CMD_02 0x02
203#define PCCC_CMD_04 0x04
204#define PCCC_CMD_05 0x05
205#define PCCC_CMD_06 0x06
206#define PCCC_CMD_07 0x07
207#define PCCC_CMD_08 0x08
208#define PCCC_CMD_0F 0x0F
211#define PCCC_FNC_06_00 0x00
212#define PCCC_FNC_06_01 0x01
213#define PCCC_FNC_06_02 0x02
214#define PCCC_FNC_06_03 0x03
215#define PCCC_FNC_06_04 0x04
216#define PCCC_FNC_06_05 0x05
217#define PCCC_FNC_06_06 0x06
218#define PCCC_FNC_06_07 0x07
219#define PCCC_FNC_06_08 0x08
220#define PCCC_FNC_06_09 0x09
221#define PCCC_FNC_06_0A 0x0A
223#define PCCC_FNC_07_00 0x00
224#define PCCC_FNC_07_01 0x01
225#define PCCC_FNC_07_03 0x03
226#define PCCC_FNC_07_04 0x04
227#define PCCC_FNC_07_05 0x05
228#define PCCC_FNC_07_06 0x06
230#define PCCC_FNC_0F_00 0x00
231#define PCCC_FNC_0F_01 0x01
232#define PCCC_FNC_0F_02 0x02
233#define PCCC_FNC_0F_03 0x03
234#define PCCC_FNC_0F_04 0x04
235#define PCCC_FNC_0F_05 0x05
236#define PCCC_FNC_0F_06 0x06
237#define PCCC_FNC_0F_07 0x07
238#define PCCC_FNC_0F_08 0x08
239#define PCCC_FNC_0F_09 0x09
240#define PCCC_FNC_0F_0A 0x0A
241#define PCCC_FNC_0F_11 0x11
242#define PCCC_FNC_0F_12 0x12
243#define PCCC_FNC_0F_17 0x17
244#define PCCC_FNC_0F_18 0x18
245#define PCCC_FNC_0F_26 0x26
246#define PCCC_FNC_0F_29 0x29
247#define PCCC_FNC_0F_3A 0x3A
248#define PCCC_FNC_0F_41 0x41
249#define PCCC_FNC_0F_50 0x50
250#define PCCC_FNC_0F_52 0x52
251#define PCCC_FNC_0F_53 0x53
252#define PCCC_FNC_0F_55 0x55
253#define PCCC_FNC_0F_57 0x57
254#define PCCC_FNC_0F_5E 0x5E
255#define PCCC_FNC_0F_67 0x67
256#define PCCC_FNC_0F_68 0x68
257#define PCCC_FNC_0F_79 0x79
258#define PCCC_FNC_0F_80 0x80
259#define PCCC_FNC_0F_81 0x81
260#define PCCC_FNC_0F_82 0x82
261#define PCCC_FNC_0F_88 0x88
262#define PCCC_FNC_0F_8F 0x8F
263#define PCCC_FNC_0F_A1 0xA1
264#define PCCC_FNC_0F_A2 0xA2
265#define PCCC_FNC_0F_A3 0xA3
266#define PCCC_FNC_0F_A7 0xA7
267#define PCCC_FNC_0F_A9 0xA9
268#define PCCC_FNC_0F_AA 0xAA
269#define PCCC_FNC_0F_AB 0xAB
270#define PCCC_FNC_0F_AF 0xAF
273#define PCCC_FILE_TYPE_LOGIC 0x22
274#define PCCC_FILE_TYPE_FUNCTION_CS0_CS2 0x48
275#define PCCC_FILE_TYPE_CHANNEL_CONFIG 0x49
276#define PCCC_FILE_TYPE_FUNCTION_ES1 0x4A
277#define PCCC_FILE_TYPE_ONLINE_EDIT 0x65
278#define PCCC_FILE_TYPE_FUNCTION_IOS 0x6A
279#define PCCC_FILE_TYPE_DATA_OUTPUT 0x82
280#define PCCC_FILE_TYPE_DATA_INPUT 0x83
281#define PCCC_FILE_TYPE_DATA_STATUS 0x84
282#define PCCC_FILE_TYPE_DATA_BINARY 0x85
283#define PCCC_FILE_TYPE_DATA_TIMER 0x86
284#define PCCC_FILE_TYPE_DATA_COUNTER 0x87
285#define PCCC_FILE_TYPE_DATA_CONTROL 0x88
286#define PCCC_FILE_TYPE_DATA_INTEGER 0x89
287#define PCCC_FILE_TYPE_DATA_FLOAT 0x8A
288#define PCCC_FILE_TYPE_FORCE_OUTPUT 0xA1
289#define PCCC_FILE_TYPE_FORCE_INPUT 0xA2
290#define PCCC_FILE_TYPE_FUNCTION_ES0 0xE0
291#define PCCC_FILE_TYPE_FUNCTION_STI 0xE2
292#define PCCC_FILE_TYPE_FUNCTION_EII 0xE3
293#define PCCC_FILE_TYPE_FUNCTION_RTC 0xE4
294#define PCCC_FILE_TYPE_FUNCTION_BHI 0xE5
295#define PCCC_FILE_TYPE_FUNCTION_MMI 0xE6
296#define PCCC_FILE_TYPE_FUNCTION_LCD 0xEC
297#define PCCC_FILE_TYPE_FUNCTION_PTOX 0xED
298#define PCCC_FILE_TYPE_FUNCTION_PWMX 0xEE
301#define PCCC_CPU_3A_PROGRAM 0x01
302#define PCCC_CPU_3A_RUN 0x02
304#define PCCC_CPU_80_PROGRAM 0x01
305#define PCCC_CPU_80_RUN 0x06
306#define PCCC_CPU_80_TEST_CONT 0x07
307#define PCCC_CPU_80_TEST_SINGLE 0x08
308#define PCCC_CPU_80_TEST_DEBUG 0x09
313#define CI_SEGMENT_TYPE_MASK 0xE0
315#define CI_PORT_SEGMENT 0x00
316#define CI_LOGICAL_SEGMENT 0x20
317#define CI_NETWORK_SEGMENT 0x40
318#define CI_SYMBOLIC_SEGMENT 0x60
319#define CI_DATA_SEGMENT 0x80
321#define CI_PORT_SEG_EX_LINK_ADDRESS 0x10
322#define CI_PORT_SEG_PORT_ID_MASK 0x0F
324#define CI_LOGICAL_SEG_TYPE_MASK 0x1C
325#define CI_LOGICAL_SEG_CLASS_ID 0x00
326#define CI_LOGICAL_SEG_INST_ID 0x04
327#define CI_LOGICAL_SEG_MBR_ID 0x08
328#define CI_LOGICAL_SEG_CON_POINT 0x0C
329#define CI_LOGICAL_SEG_ATTR_ID 0x10
330#define CI_LOGICAL_SEG_SPECIAL 0x14
331#define CI_LOGICAL_SEG_SERV_ID 0x18
332#define CI_LOGICAL_SEG_EXT_LOGICAL 0x1C
334#define CI_LOGICAL_SEG_FORMAT_MASK 0x03
335#define CI_LOGICAL_SEG_8_BIT 0x00
336#define CI_LOGICAL_SEG_16_BIT 0x01
337#define CI_LOGICAL_SEG_32_BIT 0x02
338#define CI_LOGICAL_SEG_RES_2 0x03
339#define CI_LOGICAL_SEG_E_KEY 0x00
341#define CI_E_KEY_FORMAT_VAL 0x04
342#define CI_E_SERIAL_NUMBER_KEY_FORMAT_VAL 0x05
344#define CI_DATA_SEG_TYPE_MASK 0x1F
345#define CI_DATA_SEG_SIMPLE 0x00
346#define CI_DATA_SEG_SYMBOL 0x11
348#define CI_NETWORK_SEG_TYPE_MASK 0x1F
349#define CI_NETWORK_SEG_SCHEDULE 0x01
350#define CI_NETWORK_SEG_FIXED_TAG 0x02
351#define CI_NETWORK_SEG_PROD_INHI 0x03
352#define CI_NETWORK_SEG_SAFETY 0x10
353#define CI_NETWORK_SEG_PROD_INHI_US 0x11
354#define CI_NETWORK_SEG_EXTENDED 0x1F
356#define CI_CONCURRENT_EXTENDED_NETWORK_SEG 0x02
358#define CI_SYMBOL_SEG_FORMAT_MASK 0xE0
359#define CI_SYMBOL_SEG_SIZE_MASK 0x1F
360#define CI_SYMBOL_SEG_DOUBLE 0x20
361#define CI_SYMBOL_SEG_TRIPLE 0x40
362#define CI_SYMBOL_SEG_NUMERIC 0xC0
364#define CI_SYMBOL_NUMERIC_USINT 6
365#define CI_SYMBOL_NUMERIC_UINT 7
366#define CI_SYMBOL_NUMERIC_UDINT 8
368#define CI_TRANSPORT_CLASS_MASK 0x0F
369#define CI_PRODUCTION_TRIGGER_MASK 0x70
370#define CI_PRODUCTION_DIR_MASK 0x80
372#define CONN_TYPE_NULL 0
373#define CONN_TYPE_MULTICAST 1
374#define CONN_TYPE_P2P 2
375#define CONN_TYPE_RESERVED 3
377#define ENIP_CIP_INTERFACE 0
379#define CC_CRC_LENGTH 4
382#define GENERIC_SC_LIST \
383 { SC_GET_ATT_ALL, "Get Attributes All" }, \
384 { SC_SET_ATT_ALL, "Set Attributes All" }, \
385 { SC_GET_ATT_LIST, "Get Attribute List" }, \
386 { SC_SET_ATT_LIST, "Set Attribute List" }, \
387 { SC_RESET, "Reset" }, \
388 { SC_START, "Start" }, \
389 { SC_STOP, "Stop" }, \
390 { SC_CREATE, "Create" }, \
391 { SC_DELETE, "Delete" }, \
392 { SC_MULT_SERV_PACK, "Multiple Service Packet" }, \
393 { SC_APPLY_ATTRIBUTES, "Apply Attributes" }, \
394 { SC_GET_ATT_SINGLE, "Get Attribute Single" }, \
395 { SC_SET_ATT_SINGLE, "Set Attribute Single" }, \
396 { SC_FIND_NEXT_OBJ_INST, "Find Next Object Instance" }, \
397 { SC_RESTOR, "Restore" }, \
398 { SC_SAVE, "Save" }, \
399 { SC_NO_OP, "Nop" }, \
400 { SC_GET_MEMBER, "Get Member" }, \
401 { SC_SET_MEMBER, "Set Member" }, \
402 { SC_INSERT_MEMBER, "Insert Member" }, \
403 { SC_REMOVE_MEMBER, "Remove Member" }, \
404 { SC_GROUP_SYNC, "Group Sync" }, \
406#define SEGMENT_VALUE_NOT_SET ((uint32_t)-1)
422 uint32_t iConnPointA;
468 int offset,
int total_len);
470#define CIP_ATTR_CLASS (true)
471#define CIP_ATTR_INSTANCE (false)
480 attribute_dissector_func *pdissect;
486 int offset,
bool request);
490 const char *service_name;
491 service_dissector_func *pdissect;
495#define CIP_CONNECTION_SIZE_TYPE_FIXED (0)
506 uint32_t connection_size;
507 uint32_t connection_size_type;
516enum cip_safety_format_type {CIP_SAFETY_BASE_FORMAT, CIP_SAFETY_EXTENDED_FORMAT};
517enum cip_safety_open_type {CIP_SAFETY_OPEN_UNKNOWN, CIP_SAFETY_OPEN_TYPE1, CIP_SAFETY_OPEN_TYPE2A, CIP_SAFETY_OPEN_TYPE2B};
518enum cip_safety_originator_type {CIP_SAFETY_ORIGINATOR_UNKNOWN, CIP_SAFETY_ORIGINATOR_CONSUMER, CIP_SAFETY_ORIGINATOR_PRODUCER};
521 uint16_t ConnSerialNumber;
523 uint32_t DeviceSerialNumber;
529 enum cip_safety_format_type format;
530 enum cip_safety_open_type safety_open_type;
532 enum cip_safety_originator_type originator_type;
535 uint16_t running_rollover_value;
536 uint16_t running_timestamp_value;
537 bool seen_non_zero_timestamp;
550 uint8_t TransportClass_trigger;
551 uint32_t timeout_multiplier;
553 uint32_t FwdOpenPathLenBytes;
554 void* pFwdOpenPathData;
558 uint32_t open_req_frame;
559 uint32_t open_reply_frame;
560 uint32_t close_frame;
571 bool is_concurrent_connection;
587 unsigned RouteConnectionPathLen;
588 void *pRouteConnectionPath;
602#define DISPLAY_CONNECTION_PATH 1
603#define DISPLAY_REQUEST_PATH 2
610enum cip_elem_data_types {
611 CIP_STRING_TYPE = 0xD0,
612 CIP_SHORT_STRING_TYPE = 0xDA,
613 CIP_STRING2_TYPE = 0xD5
616extern void add_cip_service_to_info_column(
packet_info *pinfo, uint8_t service,
const value_string* service_vals);
617extern const attribute_info_t * cip_get_attribute(
unsigned class_id,
unsigned instance,
unsigned attribute);
619extern void cip_rpi_api_fmt(
char *s, uint32_t value);
623extern void dissect_cip_date_and_time(
proto_tree *tree,
tvbuff_t *tvb,
int offset,
int hf_datetime);
624extern int dissect_cip_utime(
proto_tree* tree,
tvbuff_t* tvb,
int offset,
int hf_datetime);
629extern int dissect_cip_response_status(
proto_tree* tree,
tvbuff_t* tvb,
int offset,
int hf_general_status,
bool have_additional_status);
643 int hf_vendor,
int hf_devtype,
int hf_prodcode,
644 int hf_compatibility,
int hf_comp_bit,
int hf_majrev,
int hf_minrev,
645 bool generate,
unsigned encoding);
646extern int dissect_electronic_key_format(
tvbuff_t* tvb,
int offset,
proto_tree* tree,
bool generate, uint8_t key_format,
unsigned encoding);
648 int offset,
int total_len);
650 int offset,
int total_len);
652 int offset,
int total_len);
654 int offset,
int total_len);
658extern bool should_dissect_cip_response(
tvbuff_t *tvb,
int offset, uint8_t gen_status);
681extern int hf_attr_class_revision;
682extern int hf_attr_class_max_instance;
683extern int hf_attr_class_num_instance;
684extern int hf_attr_class_opt_attr_num;
685extern int hf_attr_class_attr_num;
686extern int hf_attr_class_opt_service_num;
687extern int hf_attr_class_service_code;
688extern int hf_attr_class_num_class_attr;
689extern int hf_attr_class_num_inst_attr;
691#define CLASS_ATTRIBUTE_1_NAME "Revision"
692#define CLASS_ATTRIBUTE_2_NAME "Max Instance"
693#define CLASS_ATTRIBUTE_3_NAME "Number of Instances"
694#define CLASS_ATTRIBUTE_4_NAME "Optional Attribute List"
695#define CLASS_ATTRIBUTE_5_NAME "Optional Service List"
696#define CLASS_ATTRIBUTE_6_NAME "Maximum ID Number Class Attributes"
697#define CLASS_ATTRIBUTE_7_NAME "Maximum ID Number Instance Attributes"
Definition packet_info.h:43
Definition value_string.h:169
Definition value_string.h:25
Definition packet-cip.h:472
Definition packet-cip.h:547
Definition packet-cip.h:496
Definition packet-cip.h:520
Definition packet-cip.h:577
Definition packet-cip.h:526
Definition packet-cip.h:487
Definition packet-cip.h:407
Definition packet-epl-profile-parser.c:83
Definition tvbuff-int.h:35