{ CM_ES_NO_BUFFER_MEMORY_AVAILABLE, "No buffer memory available" },
{ CM_ES_NETWORK_BANDWIDTH_NOT_AVAIL_FOR_DATA, "Network bandwidth not available for data" },
{ CM_ES_NO_CONSUMED_CONN_ID_FILTER_AVAILABLE, "No consumed connection ID filter available" },
- { CM_ES_NOT_CONFIGURED_TO_SEND_SCHEDULED_DATA, "Not confgured to send scheduled priority data" },
+ { CM_ES_NOT_CONFIGURED_TO_SEND_SCHEDULED_DATA, "Not configured to send scheduled priority data" },
{ CM_ES_SCHEDULE_SIGNATURE_MISMATCH, "Schedule signature mismatch" },
{ CM_ES_SCHEDULE_SIGNATURE_VALIDATION_NOT_POSS, "Schedule signature validation not possible" },
{ CM_ES_PORT_NOT_AVAILABLE, "Port not available" },
num_ports = tvb_get_letohs( tvb, offset);
proto_tree_add_item( tree, hf_time_sync_port_state_info_num_ports, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- if (2+num_ports*4 < total_len)
+ if (2+num_ports*4 > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_port_state_info_ports);
return total_len;
num_ports = tvb_get_letohs( tvb, offset);
proto_tree_add_item( tree, hf_time_sync_port_enable_cfg_num_ports, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- if (2+num_ports*4 < total_len)
+ if (2+num_ports*4 > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_port_enable_cfg_ports);
return total_len;
num_ports = tvb_get_letohs( tvb, offset);
proto_tree_add_item( tree, hf_time_sync_port_log_announce_num_ports, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- if (2+num_ports*4 < total_len)
+ if (2+num_ports*4 > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_port_log_announce_ports);
return total_len;
num_ports = tvb_get_letohs( tvb, offset);
proto_tree_add_item( tree, hf_time_sync_port_log_sync_num_ports, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- if (2+num_ports*4 < total_len)
+ if (2+num_ports*4 > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_port_log_sync_ports);
return total_len;
return total_len;
}
- if ((int)(size+4) < total_len)
+ if ((int)(size+4) > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_prod_desc_size);
return total_len;
return total_len;
}
- if ((int)(size+4) < total_len)
+ if ((int)(size+4) > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_revision_data_size);
return total_len;
return total_len;
}
- if ((int)(size+4) < total_len)
+ if ((int)(size+4) > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_user_desc_size);
return total_len;
num_ports = tvb_get_letohs( tvb, offset);
proto_tree_add_item( tree, hf_time_sync_port_profile_id_info_num_ports, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- if (2+num_ports*10 < total_len)
+ if (2+num_ports*10 > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_port_profile_id_info_ports);
return total_len;
num_ports = tvb_get_letohs( tvb, offset);
proto_tree_add_item( tree, hf_time_sync_port_phys_addr_info_num_ports, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- if (2+num_ports*36 < total_len)
+ if (2+num_ports*36 > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_port_phys_addr_info_ports);
return total_len;
num_ports = tvb_get_letohs( tvb, offset);
proto_tree_add_item( tree, hf_time_sync_port_proto_addr_info_num_ports, tvb, offset, 2, ENC_LITTLE_ENDIAN);
- if (2+num_ports*22 < total_len)
+ if (2+num_ports*22 > total_len)
{
expert_add_info(pinfo, item, &ei_mal_time_sync_port_proto_addr_info_ports);
return total_len;
return;
}
- /* Get segement type */
+ /* Get segment type */
segment_type = tvb_get_guint8( tvb, offset + pathpos );
if ( generate )
proto_tree_add_item(safety_tree, hf_cip_seg_safety_reserved, tvb, offset+pathpos+3, 1, ENC_LITTLE_ENDIAN );
proto_tree_add_item(safety_tree, hf_cip_seg_safety_time_correction_conn_id, tvb, offset+pathpos+4, 4, ENC_LITTLE_ENDIAN );
- proto_tree_add_item(safety_tree, hf_cip_seg_safety_ping_eri_multiplier, tvb, offset+pathpos+8, 2, ENC_LITTLE_ENDIAN );
- dissect_net_param16(tvb, offset+pathpos+10, safety_tree,
+ proto_tree_add_item(safety_tree, hf_cip_seg_safety_time_correction_epi, tvb, offset+pathpos+8, 4, ENC_LITTLE_ENDIAN );
+ dissect_net_param16(tvb, offset+pathpos+12, safety_tree,
hf_cip_seg_safety_time_correction_net_params, hf_cip_seg_safety_time_correction_own,
hf_cip_seg_safety_time_correction_typ, hf_cip_seg_safety_time_correction_prio,
hf_cip_seg_safety_time_correction_fixed_var, hf_cip_seg_safety_time_correction_con_size,
{
/* Can't find the attribute, treat the rest of the request as raw data */
proto_tree_add_item(att_tree, hf_cip_sc_set_attr_list_attr_data, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_NA);
+ break;
}
if ((tvb_reported_length_remaining(tvb, offset) < 2) && (i < att_count-1))
prev_offset = serv_offset;
/*
- ** We call our selves again to disect embedded packet
+ ** We call ourselves again to dissect embedded packet
*/
col_append_str( pinfo->cinfo, COL_INFO, ", ");
proto_tree_add_item(mult_serv_tree, hf_cip_sc_mult_serv_pack_offset, tvb, offset+2+(i*2) , 2, ENC_LITTLE_ENDIAN);
/*
- ** We call our selves again to disect embedded packet
+ ** We call ourselves again to dissect embedded packet
*/
col_append_str( pinfo->cinfo, COL_INFO, ", ");
proto_tree_add_item(cmd_data_tree, hf_cip_sc_stop_data, tvb, offset+4+add_stat_size, tvb_reported_length_remaining(tvb, offset+4+add_stat_size), ENC_NA);
break;
case SC_CREATE:
- proto_tree_add_item(cmd_data_tree, hf_cip_sc_create_instance, tvb, offset+4+add_stat_size, tvb_reported_length_remaining(tvb, offset+4+add_stat_size), ENC_LITTLE_ENDIAN);
+ proto_tree_add_item(cmd_data_tree, hf_cip_sc_create_instance, tvb, offset+4+add_stat_size, 2, ENC_LITTLE_ENDIAN);
proto_tree_add_item(cmd_data_tree, hf_cip_sc_create_data, tvb, offset+4+add_stat_size+2, tvb_reported_length_remaining(tvb, offset+4+add_stat_size+2), ENC_NA);
break;
case SC_DELETE:
(preq_info->connInfo->VendorID == VendorID) &&
(preq_info->connInfo->DeviceSerialNumber == DeviceSerialNumber))
{
- /* Update the connection IDs as ForwardOpen reply is allows to update them from
+ /* Update the connection IDs as ForwardOpen reply is allowed to update them from
the ForwardOpen request */
preq_info->connInfo->O2T.connID = O2TConnID;
preq_info->connInfo->T2O.connID = T2OConnID;
temp_tree = proto_tree_add_subtree( cmd_data_tree, tvb, offset+2+req_path_size+4, msg_req_siz, ett_cm_mes_req, NULL, "Message Request" );
/*
- ** We call our selves again to disect embedded packet
+ ** We call ourselves again to dissect embedded packet
*/
col_append_str( pinfo->cinfo, COL_INFO, ": ");
/* See if object dissector wants to override generic service handling */
if(!dissector_try_heuristic(heur_subdissector_service, tvb, pinfo, item_tree, &hdtbl_entry, NULL))
{
+ /* No need to set a custom dissector if this is just a generic service. */
+ if (preq_info)
+ {
+ preq_info->dissector = NULL;
+ }
+
dissect_cip_generic_service_req(tvb, pinfo, cip_tree, &path_info);
}
}
{ 0, "Auto-negotiation in progress" },
{ 1, "Auto-negotiation and speed detection failed" },
{ 2, "Auto-negotiation failed but detected speed" },
- { 3, "Successfully negotiatied speed and duplex" },
+ { 3, "Successfully negotiated speed and duplex" },
{ 4, "Auto-negotiation not attempted. Forced speed and duplex" },
{ 0, NULL }
{ 2, "Active Gateway" },
{ 3, "Gateway Fault" },
{ 4, "Cannot Support Parameters" },
- { 5, "Partitial Network Fault" },
+ { 5, "Partial Network Fault" },
{ 0, NULL }
};
{0x47, FALSE, 13, "Redundant Gateway Config", cip_dissector_func, NULL, dissect_dlr_redundant_gateway_config},
{0x47, FALSE, 14, "Redundant Gateway Status", cip_usint, &hf_dlr_redundant_gateway_status, NULL},
{0x47, FALSE, 15, "Active Gateway Address", cip_dissector_func, NULL, dissect_dlr_active_gateway_address},
- {0x47, FALSE, 16, "Actice Gateway Precedence", cip_usint, &hf_dlr_active_gateway_precedence, NULL},
+ {0x47, FALSE, 16, "Active Gateway Precedence", cip_usint, &hf_dlr_active_gateway_precedence, NULL},
};
g_hash_table_destroy(enip_conn_hashtable);
}
-/* Disssect Common Packet Format */
+/* Dissect Common Packet Format */
static void
dissect_cpf(enip_request_key_t *request_key, int command, tvbuff_t *tvb,
packet_info *pinfo, proto_tree *tree, proto_tree *dissector_tree, int offset, guint32 ifacehndl)
io_length -= 2;
}
- if (((connid_type == ECIDT_O2T) && enip_OTrun_idle) ||
- ((connid_type == ECIDT_T2O) && enip_TOrun_idle))
+ if ((io_length >= 4) &&
+ (((connid_type == ECIDT_O2T) && enip_OTrun_idle) ||
+ ((connid_type == ECIDT_T2O) && enip_TOrun_idle)))
{
io_item = proto_tree_add_item( item_tree, hf_enip_cpf_cdi_32bitheader,
tvb, offset+6+(item_length-io_length), 4, ENC_LITTLE_ENDIAN );
/* Add encapsulation command to info column */
col_append_sep_fstr(pinfo->cinfo, COL_INFO, " | ", "%s (%s)",
- val_to_str(encap_cmd, encap_cmd_vals, "Unknown (0x%04x)"),
+ val_to_str(encap_cmd, encap_cmd_vals, "Unknown Command (0x%04x)"),
pkt_type_str );
/*
/* Append session and command to the protocol tree */
proto_item_append_text( ti, ", Session: 0x%08X, %s", tvb_get_letohl( tvb, 4 ),
- val_to_str( encap_cmd, encap_cmd_vals, "Unknown (0x%04x)" ) );
+ val_to_str( encap_cmd, encap_cmd_vals, "Unknown Command (0x%04x)" ) );
} /* end of tree */
/* Command specific data - create tree */
if ( encap_data_length )
{
- /* The packet have some command specific data, buid a sub tree for it */
+ /* The packet have some command specific data, build a sub tree for it */
csftree = proto_tree_add_subtree( enip_tree, tvb, 24, encap_data_length,
ett_command_tree, NULL, "Command Specific Data");
NULL, HFILL }},
{ &hf_elink_physical_address,
- { "Physical Addresss", "cip.elink.physical_address",
+ { "Physical Address", "cip.elink.physical_address",
FT_ETHER, BASE_NONE, NULL, 0,
NULL, HFILL }},