summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-hartip.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:14:33 +0000
commit9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch)
tree2784370cda9bbf2da9114d70f05399c0b229d28c /epan/dissectors/packet-hartip.c
parentAdding debian version 4.2.6-1. (diff)
downloadwireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz
wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-hartip.c')
-rw-r--r--epan/dissectors/packet-hartip.c656
1 files changed, 328 insertions, 328 deletions
diff --git a/epan/dissectors/packet-hartip.c b/epan/dissectors/packet-hartip.c
index faef1f81..0d86ff16 100644
--- a/epan/dissectors/packet-hartip.c
+++ b/epan/dissectors/packet-hartip.c
@@ -25,231 +25,231 @@ void proto_reg_handoff_hartip(void);
static dissector_handle_t hartip_tcp_handle;
static dissector_handle_t hartip_udp_handle;
-static gboolean hartip_desegment = TRUE;
-
-static int proto_hartip = -1;
-static int hf_hartip_hdr_version = -1;
-static int hf_hartip_hdr_message_id = -1;
-static int hf_hartip_hdr_message_type = -1;
-static int hf_hartip_hdr_status = -1;
-static int hf_hartip_hdr_transaction_id = -1;
-static int hf_hartip_hdr_msg_length = -1;
-
-static int hf_hartip_data = -1;
-static int hf_hartip_master_type = -1;
-static int hf_hartip_inactivity_close_timer = -1;
-static int hf_hartip_error_code = -1;
-
-static int hf_hartip_pt_preambles = -1;
-static int hf_hartip_pt_delimiter = -1;
-static int hf_hartip_pt_delimiter_frame_type = -1;
-static int hf_hartip_pt_delimiter_physical_layer_type = -1;
-static int hf_hartip_pt_delimiter_number_of_expansion_bytes = -1;
-static int hf_hartip_pt_delimiter_address_type = -1;
-static int hf_hartip_pt_short_addr = -1;
-static int hf_hartip_pt_long_addr = -1;
-static int hf_hartip_pt_expansion_bytes = -1;
-static int hf_hartip_pt_command = -1;
-static int hf_hartip_pt_length = -1;
-static int hf_hartip_pt_response_code = -1;
-static int hf_hartip_pt_device_status = -1;
-static int hf_hartip_pt_payload = -1;
-static int hf_hartip_pt_checksum = -1;
-
-static gint ett_hartip = -1;
-static gint ett_hartip_hdr = -1;
-static gint ett_hartip_body = -1;
-static gint ett_hartip_pt_delimiter = -1;
-
-static expert_field ei_hartip_data_none = EI_INIT;
-static expert_field ei_hartip_data_unexpected = EI_INIT;
+static bool hartip_desegment = true;
+
+static int proto_hartip;
+static int hf_hartip_hdr_version;
+static int hf_hartip_hdr_message_id;
+static int hf_hartip_hdr_message_type;
+static int hf_hartip_hdr_status;
+static int hf_hartip_hdr_transaction_id;
+static int hf_hartip_hdr_msg_length;
+
+static int hf_hartip_data;
+static int hf_hartip_master_type;
+static int hf_hartip_inactivity_close_timer;
+static int hf_hartip_error_code;
+
+static int hf_hartip_pt_preambles;
+static int hf_hartip_pt_delimiter;
+static int hf_hartip_pt_delimiter_frame_type;
+static int hf_hartip_pt_delimiter_physical_layer_type;
+static int hf_hartip_pt_delimiter_number_of_expansion_bytes;
+static int hf_hartip_pt_delimiter_address_type;
+static int hf_hartip_pt_short_addr;
+static int hf_hartip_pt_long_addr;
+static int hf_hartip_pt_expansion_bytes;
+static int hf_hartip_pt_command;
+static int hf_hartip_pt_length;
+static int hf_hartip_pt_response_code;
+static int hf_hartip_pt_device_status;
+static int hf_hartip_pt_payload;
+static int hf_hartip_pt_checksum;
+
+static int ett_hartip;
+static int ett_hartip_hdr;
+static int ett_hartip_body;
+static int ett_hartip_pt_delimiter;
+
+static expert_field ei_hartip_data_none;
+static expert_field ei_hartip_data_unexpected;
/* Command 0 response */
-static int hf_hartip_pt_rsp_expansion_code = -1;
-static int hf_hartip_pt_rsp_expanded_device_type = -1;
-static int hf_hartip_pt_rsp_req_min_preambles = -1;
-static int hf_hartip_pt_rsp_hart_protocol_major_rev = -1;
-static int hf_hartip_pt_rsp_device_rev = -1;
-static int hf_hartip_pt_rsp_software_rev = -1;
-static int hf_hartip_pt_rsp_hardware_rev_physical_signal = -1;
-static int hf_hartip_pt_rsp_flage = -1;
-static int hf_hartip_pt_rsp_device_id = -1;
-static int hf_hartip_pt_rsp_rsp_min_preambles = -1;
-static int hf_hartip_pt_rsp_max_device_variables = -1;
-static int hf_hartip_pt_rsp_configuration_change_counter = -1;
-static int hf_hartip_pt_rsp_extended_device_status = -1;
-static int hf_hartip_pt_rsp_manufacturer_Identification_code = -1;
-static int hf_hartip_pt_rsp_private_label = -1;
-static int hf_hartip_pt_rsp_device_profile = -1;
+static int hf_hartip_pt_rsp_expansion_code;
+static int hf_hartip_pt_rsp_expanded_device_type;
+static int hf_hartip_pt_rsp_req_min_preambles;
+static int hf_hartip_pt_rsp_hart_protocol_major_rev;
+static int hf_hartip_pt_rsp_device_rev;
+static int hf_hartip_pt_rsp_software_rev;
+static int hf_hartip_pt_rsp_hardware_rev_physical_signal;
+static int hf_hartip_pt_rsp_flage;
+static int hf_hartip_pt_rsp_device_id;
+static int hf_hartip_pt_rsp_rsp_min_preambles;
+static int hf_hartip_pt_rsp_max_device_variables;
+static int hf_hartip_pt_rsp_configuration_change_counter;
+static int hf_hartip_pt_rsp_extended_device_status;
+static int hf_hartip_pt_rsp_manufacturer_Identification_code;
+static int hf_hartip_pt_rsp_private_label;
+static int hf_hartip_pt_rsp_device_profile;
/* Command 2 response */
-static int hf_hartip_pt_rsp_pv_percent_range = -1;
+static int hf_hartip_pt_rsp_pv_percent_range;
/* Command 3 response */
-static int hf_hartip_pt_rsp_pv_loop_current = -1;
-static int hf_hartip_pt_rsp_pv_units = -1;
-static int hf_hartip_pt_rsp_pv = -1;
-static int hf_hartip_pt_rsp_sv_units = -1;
-static int hf_hartip_pt_rsp_sv = -1;
-static int hf_hartip_pt_rsp_tv_units = -1;
-static int hf_hartip_pt_rsp_tv = -1;
-static int hf_hartip_pt_rsp_qv_units = -1;
-static int hf_hartip_pt_rsp_qv = -1;
+static int hf_hartip_pt_rsp_pv_loop_current;
+static int hf_hartip_pt_rsp_pv_units;
+static int hf_hartip_pt_rsp_pv;
+static int hf_hartip_pt_rsp_sv_units;
+static int hf_hartip_pt_rsp_sv;
+static int hf_hartip_pt_rsp_tv_units;
+static int hf_hartip_pt_rsp_tv;
+static int hf_hartip_pt_rsp_qv_units;
+static int hf_hartip_pt_rsp_qv;
/* Command 7 response*/
-static int hf_hartip_pt_rsp_loop_current_mode = -1;
+static int hf_hartip_pt_rsp_loop_current_mode;
/* Command 8 response*/
-static int hf_hartip_pt_rsp_primary_var_classify = -1;
-static int hf_hartip_pt_rsp_secondary_var_classify = -1;
-static int hf_hartip_pt_rsp_tertiary_var_classify = -1;
-static int hf_hartip_pt_rsp_quaternary_var_classify = -1;
+static int hf_hartip_pt_rsp_primary_var_classify;
+static int hf_hartip_pt_rsp_secondary_var_classify;
+static int hf_hartip_pt_rsp_tertiary_var_classify;
+static int hf_hartip_pt_rsp_quaternary_var_classify;
/* Command 9 response */
-static int hf_hartip_pt_rsp_slot0_device_var = -1;
-static int hf_hartip_pt_rsp_slot0_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot0_units = -1;
-static int hf_hartip_pt_rsp_slot0_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot0_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot1_device_var = -1;
-static int hf_hartip_pt_rsp_slot1_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot1_units = -1;
-static int hf_hartip_pt_rsp_slot1_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot1_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot2_device_var = -1;
-static int hf_hartip_pt_rsp_slot2_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot2_units = -1;
-static int hf_hartip_pt_rsp_slot2_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot2_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot3_device_var = -1;
-static int hf_hartip_pt_rsp_slot3_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot3_units = -1;
-static int hf_hartip_pt_rsp_slot3_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot3_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot4_device_var = -1;
-static int hf_hartip_pt_rsp_slot4_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot4_units = -1;
-static int hf_hartip_pt_rsp_slot4_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot4_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot5_device_var = -1;
-static int hf_hartip_pt_rsp_slot5_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot5_units = -1;
-static int hf_hartip_pt_rsp_slot5_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot5_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot6_device_var = -1;
-static int hf_hartip_pt_rsp_slot6_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot6_units = -1;
-static int hf_hartip_pt_rsp_slot6_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot6_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot7_device_var = -1;
-static int hf_hartip_pt_rsp_slot7_device_var_classify = -1;
-static int hf_hartip_pt_rsp_slot7_units = -1;
-static int hf_hartip_pt_rsp_slot7_device_var_value = -1;
-static int hf_hartip_pt_rsp_slot7_device_var_status = -1;
-
-static int hf_hartip_pt_rsp_slot0_timestamp = -1;
+static int hf_hartip_pt_rsp_slot0_device_var;
+static int hf_hartip_pt_rsp_slot0_device_var_classify;
+static int hf_hartip_pt_rsp_slot0_units;
+static int hf_hartip_pt_rsp_slot0_device_var_value;
+static int hf_hartip_pt_rsp_slot0_device_var_status;
+
+static int hf_hartip_pt_rsp_slot1_device_var;
+static int hf_hartip_pt_rsp_slot1_device_var_classify;
+static int hf_hartip_pt_rsp_slot1_units;
+static int hf_hartip_pt_rsp_slot1_device_var_value;
+static int hf_hartip_pt_rsp_slot1_device_var_status;
+
+static int hf_hartip_pt_rsp_slot2_device_var;
+static int hf_hartip_pt_rsp_slot2_device_var_classify;
+static int hf_hartip_pt_rsp_slot2_units;
+static int hf_hartip_pt_rsp_slot2_device_var_value;
+static int hf_hartip_pt_rsp_slot2_device_var_status;
+
+static int hf_hartip_pt_rsp_slot3_device_var;
+static int hf_hartip_pt_rsp_slot3_device_var_classify;
+static int hf_hartip_pt_rsp_slot3_units;
+static int hf_hartip_pt_rsp_slot3_device_var_value;
+static int hf_hartip_pt_rsp_slot3_device_var_status;
+
+static int hf_hartip_pt_rsp_slot4_device_var;
+static int hf_hartip_pt_rsp_slot4_device_var_classify;
+static int hf_hartip_pt_rsp_slot4_units;
+static int hf_hartip_pt_rsp_slot4_device_var_value;
+static int hf_hartip_pt_rsp_slot4_device_var_status;
+
+static int hf_hartip_pt_rsp_slot5_device_var;
+static int hf_hartip_pt_rsp_slot5_device_var_classify;
+static int hf_hartip_pt_rsp_slot5_units;
+static int hf_hartip_pt_rsp_slot5_device_var_value;
+static int hf_hartip_pt_rsp_slot5_device_var_status;
+
+static int hf_hartip_pt_rsp_slot6_device_var;
+static int hf_hartip_pt_rsp_slot6_device_var_classify;
+static int hf_hartip_pt_rsp_slot6_units;
+static int hf_hartip_pt_rsp_slot6_device_var_value;
+static int hf_hartip_pt_rsp_slot6_device_var_status;
+
+static int hf_hartip_pt_rsp_slot7_device_var;
+static int hf_hartip_pt_rsp_slot7_device_var_classify;
+static int hf_hartip_pt_rsp_slot7_units;
+static int hf_hartip_pt_rsp_slot7_device_var_value;
+static int hf_hartip_pt_rsp_slot7_device_var_status;
+
+static int hf_hartip_pt_rsp_slot0_timestamp;
/* Command 13 response */
-static int hf_hartip_pt_rsp_packed_descriptor = -1;
-static int hf_hartip_pt_rsp_day = -1;
-static int hf_hartip_pt_rsp_month = -1;
-static int hf_hartip_pt_rsp_year = -1;
+static int hf_hartip_pt_rsp_packed_descriptor;
+static int hf_hartip_pt_rsp_day;
+static int hf_hartip_pt_rsp_month;
+static int hf_hartip_pt_rsp_year;
/* Command 14 response */
-static int hf_hartip_pt_rsp_transducer_serial_number = -1;
-static int hf_hartip_pt_rsp_transducer_limit_min_span_units = -1;
-static int hf_hartip_pt_rsp_upper_transducer_limit = -1;
-static int hf_hartip_pt_rsp_lower_transducer_limit = -1;
-static int hf_hartip_pt_rsp_minimum_span = -1;
+static int hf_hartip_pt_rsp_transducer_serial_number;
+static int hf_hartip_pt_rsp_transducer_limit_min_span_units;
+static int hf_hartip_pt_rsp_upper_transducer_limit;
+static int hf_hartip_pt_rsp_lower_transducer_limit;
+static int hf_hartip_pt_rsp_minimum_span;
/* Command 15 response */
-static int hf_hartip_pt_rsp_pv_alarm_selection_code = -1;
-static int hf_hartip_pt_rsp_pv_transfer_function_code = -1;
-static int hf_hartip_pt_rsp_pv_upper_and_lower_range_values_units = -1;
-static int hf_hartip_pt_rsp_pv_upper_range_value = -1;
-static int hf_hartip_pt_rsp_pv_lower_range_value = -1;
-static int hf_hartip_pt_rsp_pv_damping_value = -1;
-static int hf_hartip_pt_rsp_write_protect_code = -1;
-static int hf_hartip_pt_rsp_reserved = -1;
-static int hf_hartip_pt_rsp_pv_analog_channel_flags = -1;
+static int hf_hartip_pt_rsp_pv_alarm_selection_code;
+static int hf_hartip_pt_rsp_pv_transfer_function_code;
+static int hf_hartip_pt_rsp_pv_upper_and_lower_range_values_units;
+static int hf_hartip_pt_rsp_pv_upper_range_value;
+static int hf_hartip_pt_rsp_pv_lower_range_value;
+static int hf_hartip_pt_rsp_pv_damping_value;
+static int hf_hartip_pt_rsp_write_protect_code;
+static int hf_hartip_pt_rsp_reserved;
+static int hf_hartip_pt_rsp_pv_analog_channel_flags;
/* Command 16 and 19 response */
-static int hf_hartip_pt_rsp_final_assembly_number = -1;
+static int hf_hartip_pt_rsp_final_assembly_number;
/* response Tag */
-static int hf_hartip_pt_rsp_tag = -1;
+static int hf_hartip_pt_rsp_tag;
/* response Message */
-static int hf_hartip_pt_rsp_message = -1;
+static int hf_hartip_pt_rsp_message;
/* Command 48 response */
-static int hf_hartip_pt_rsp_device_sp_status = -1;
-static int hf_hartip_pt_rsp_device_op_mode = -1;
-static int hf_hartip_pt_rsp_standardized_status_0 = -1;
-static int hf_hartip_pt_rsp_standardized_status_1 = -1;
-static int hf_hartip_pt_rsp_analog_channel_saturated = -1;
-static int hf_hartip_pt_rsp_standardized_status_2 = -1;
-static int hf_hartip_pt_rsp_standardized_status_3 = -1;
-static int hf_hartip_pt_rsp_analog_channel_fixed = -1;
+static int hf_hartip_pt_rsp_device_sp_status;
+static int hf_hartip_pt_rsp_device_op_mode;
+static int hf_hartip_pt_rsp_standardized_status_0;
+static int hf_hartip_pt_rsp_standardized_status_1;
+static int hf_hartip_pt_rsp_analog_channel_saturated;
+static int hf_hartip_pt_rsp_standardized_status_2;
+static int hf_hartip_pt_rsp_standardized_status_3;
+static int hf_hartip_pt_rsp_analog_channel_fixed;
/* Command 77 response */
-static int hf_hartip_pt_rsp_io_card = -1;
-static int hf_hartip_pt_rsp_channel = -1;
-static int hf_hartip_pt_req_tx_preamble_count = -1;
-static int hf_hartip_pt_rsp_embedded_cmd_delimiter = -1;
-static int hf_hartip_pt_rsp_poll_address = -1;
-static int hf_hartip_pt_rsp_unique_id = -1;
-static int hf_hartip_pt_rsp_embedded_cmd = -1;
+static int hf_hartip_pt_rsp_io_card;
+static int hf_hartip_pt_rsp_channel;
+static int hf_hartip_pt_req_tx_preamble_count;
+static int hf_hartip_pt_rsp_embedded_cmd_delimiter;
+static int hf_hartip_pt_rsp_poll_address;
+static int hf_hartip_pt_rsp_unique_id;
+static int hf_hartip_pt_rsp_embedded_cmd;
/* Command 31 and 178 response */
-static int hf_hartip_pt_rsp_number_of_commands = -1;
-static int hf_hartip_pt_rsp_command_number = -1;
-static int hf_hartip_pt_rsp_command_byte_count = -1;
+static int hf_hartip_pt_rsp_number_of_commands;
+static int hf_hartip_pt_rsp_command_number;
+static int hf_hartip_pt_rsp_command_byte_count;
/* Command 31, 77 and 178 response */
-static int hf_hartip_pt_rsp_data = -1;
+static int hf_hartip_pt_rsp_data;
/*Command 203 response*/
-static int hf_hartip_pt_rsp_index_of_first_discrete_var = -1;
-static int hf_hartip_pt_rsp_number_of_discrete_vars = -1;
-static int hf_hartip_pt_rsp_timestamp_for_most_recent_discrete_change = -1;
+static int hf_hartip_pt_rsp_index_of_first_discrete_var;
+static int hf_hartip_pt_rsp_number_of_discrete_vars;
+static int hf_hartip_pt_rsp_timestamp_for_most_recent_discrete_change;
-static int hf_hartip_pt_rsp_slot0_discrete_var_state = -1;
-static int hf_hartip_pt_rsp_slot0_discrete_var_status = -1;
+static int hf_hartip_pt_rsp_slot0_discrete_var_state;
+static int hf_hartip_pt_rsp_slot0_discrete_var_status;
-static int hf_hartip_pt_rsp_slot1_discrete_var_state = -1;
-static int hf_hartip_pt_rsp_slot1_discrete_var_status = -1;
+static int hf_hartip_pt_rsp_slot1_discrete_var_state;
+static int hf_hartip_pt_rsp_slot1_discrete_var_status;
-static int hf_hartip_pt_rsp_slot2_discrete_var_state = -1;
-static int hf_hartip_pt_rsp_slot2_discrete_var_status = -1;
+static int hf_hartip_pt_rsp_slot2_discrete_var_state;
+static int hf_hartip_pt_rsp_slot2_discrete_var_status;
-static int hf_hartip_pt_rsp_slot3_discrete_var_state = -1;
-static int hf_hartip_pt_rsp_slot3_discrete_var_status = -1;
+static int hf_hartip_pt_rsp_slot3_discrete_var_state;
+static int hf_hartip_pt_rsp_slot3_discrete_var_status;
-static int hf_hartip_pt_rsp_slot4_discrete_var_state = -1;
-static int hf_hartip_pt_rsp_slot4_discrete_var_status = -1;
+static int hf_hartip_pt_rsp_slot4_discrete_var_state;
+static int hf_hartip_pt_rsp_slot4_discrete_var_status;
-static int hf_hartip_pt_rsp_slot5_discrete_var_state = -1;
-static int hf_hartip_pt_rsp_slot5_discrete_var_status = -1;
+static int hf_hartip_pt_rsp_slot5_discrete_var_state;
+static int hf_hartip_pt_rsp_slot5_discrete_var_status;
#define HARTIP_HEADER_LENGTH 8
#define HARTIP_PORT 5094
/* HARTIP header */
typedef struct _hartip_hdr {
- guint8 version;
- guint8 message_type;
- guint8 message_id;
- guint8 status;
- guint16 transaction_id;
- guint16 length;
+ uint8_t version;
+ uint8_t message_type;
+ uint8_t message_id;
+ uint8_t status;
+ uint16_t transaction_id;
+ uint16_t length;
} hartip_hdr;
/* Message IDs */
@@ -324,20 +324,20 @@ static const value_string hartip_pt_delimiter_address_type_values[] = {
};
/* Handle for statistics tap. */
-static int hartip_tap = -1;
+static int hartip_tap;
/* Structure used for passing data for statistics processing. */
typedef struct _hartip_tap_info {
- gint8 message_type;
- gint8 message_id;
+ int8_t message_type;
+ int8_t message_id;
} hartip_tap_info;
/* Names of items in statistics tree. */
-static const gchar* st_str_packets = "Total HART_IP Packets";
-static const gchar* st_str_requests = "Request Packets";
-static const gchar* st_str_responses = "Response Packets";
-static const gchar* st_str_publish = "Publish Packets";
-static const gchar* st_str_errors = "Error Packets";
+static const char* st_str_packets = "Total HART_IP Packets";
+static const char* st_str_requests = "Request Packets";
+static const char* st_str_responses = "Response Packets";
+static const char* st_str_publish = "Publish Packets";
+static const char* st_str_errors = "Error Packets";
/* Handles of items in statistics tree. */
static int st_node_packets = -1;
@@ -352,11 +352,11 @@ static int st_node_errors = -1;
static void
hartip_stats_tree_init(stats_tree* st)
{
- st_node_packets = stats_tree_create_node(st, st_str_packets, 0, STAT_DT_INT, TRUE);
+ st_node_packets = stats_tree_create_node(st, st_str_packets, 0, STAT_DT_INT, true);
st_node_requests = stats_tree_create_pivot(st, st_str_requests, st_node_packets);
- st_node_responses = stats_tree_create_node(st, st_str_responses, st_node_packets, STAT_DT_INT, TRUE);
- st_node_publish = stats_tree_create_node(st, st_str_publish, st_node_packets, STAT_DT_INT, TRUE);
- st_node_errors = stats_tree_create_node(st, st_str_errors, st_node_packets, STAT_DT_INT, TRUE);
+ st_node_responses = stats_tree_create_node(st, st_str_responses, st_node_packets, STAT_DT_INT, true);
+ st_node_publish = stats_tree_create_node(st, st_str_publish, st_node_packets, STAT_DT_INT, true);
+ st_node_errors = stats_tree_create_node(st, st_str_errors, st_node_packets, STAT_DT_INT, true);
}
static tap_packet_status
@@ -364,7 +364,7 @@ hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_,
epan_dissect_t* edt _U_, const void* p, tap_flags_t flags _U_)
{
const hartip_tap_info *tapinfo = (const hartip_tap_info *)p;
- const gchar *message_type_node_str, *message_id_node_str;
+ const char *message_type_node_str, *message_id_node_str;
int message_type_node;
switch (tapinfo->message_type) {
@@ -393,16 +393,16 @@ hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_,
hartip_message_id_values,
"Unknown message %d");
- tick_stat_node(st, st_str_packets, 0, FALSE);
- tick_stat_node(st, message_type_node_str, st_node_packets, FALSE);
- tick_stat_node(st, message_id_node_str, message_type_node, FALSE);
+ tick_stat_node(st, st_str_packets, 0, false);
+ tick_stat_node(st, message_type_node_str, st_node_packets, false);
+ tick_stat_node(st, message_id_node_str, message_type_node, false);
return TAP_PACKET_REDRAW;
}
-static gint
+static int
dissect_empty_body(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
- gint offset, gint bodylen)
+ int offset, int bodylen)
{
proto_item *ti;
@@ -415,9 +415,9 @@ dissect_empty_body(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
return bodylen;
}
-static gint
-dissect_session_init(proto_tree *body_tree, tvbuff_t *tvb, gint offset,
- gint bodylen)
+static int
+dissect_session_init(proto_tree *body_tree, tvbuff_t *tvb, int offset,
+ int bodylen)
{
if (bodylen == 5) {
proto_tree_add_item(body_tree, hf_hartip_master_type, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -431,8 +431,8 @@ dissect_session_init(proto_tree *body_tree, tvbuff_t *tvb, gint offset,
return bodylen;
}
-static gint
-dissect_error(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_error(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen == 1) {
proto_tree_add_item(body_tree, hf_hartip_error_code, tvb, offset, 1, ENC_BIG_ENDIAN);
@@ -443,79 +443,79 @@ dissect_error(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return bodylen;
}
-static gint
+static int
dissect_session_close(proto_tree *body_tree, packet_info* pinfo, tvbuff_t *tvb,
- gint offset, gint bodylen)
+ int offset, int bodylen)
{
return dissect_empty_body(body_tree, pinfo, tvb, offset, bodylen);
}
-static gint
+static int
dissect_keep_alive(proto_tree *body_tree, packet_info* pinfo, tvbuff_t *tvb,
- gint offset, gint bodylen)
+ int offset, int bodylen)
{
return dissect_empty_body(body_tree, pinfo, tvb, offset, bodylen);
}
-static gint
-dissect_byte(proto_tree *tree, int hf, tvbuff_t *tvb, gint offset)
+static int
+dissect_byte(proto_tree *tree, int hf, tvbuff_t *tvb, int offset)
{
proto_tree_add_item(tree, hf, tvb, offset, 1, ENC_BIG_ENDIAN);
return 1;
}
-static gint
-dissect_short(proto_tree *tree, int hf, tvbuff_t *tvb, gint offset)
+static int
+dissect_short(proto_tree *tree, int hf, tvbuff_t *tvb, int offset)
{
proto_tree_add_item(tree, hf, tvb, offset, 2, ENC_BIG_ENDIAN);
return 2;
}
-static gint
-dissect_float(proto_tree *tree, int hf, tvbuff_t *tvb, gint offset)
+static int
+dissect_float(proto_tree *tree, int hf, tvbuff_t *tvb, int offset)
{
proto_tree_add_item(tree, hf, tvb, offset, 4, ENC_BIG_ENDIAN);
return 4;
}
-static gint
-dissect_packAscii(proto_tree *tree, int hf, tvbuff_t *tvb, gint offset, int len)
+static int
+dissect_packAscii(proto_tree *tree, int hf, tvbuff_t *tvb, int offset, int len)
{
- gushort usIdx;
- gushort usGroupCnt;
- gushort usMaxGroups; /* Number of 4 byte groups to pack. */
- gushort usMask;
- gint iIndex;
- gint i = 0;
- gushort buf[4];
- guint8 *tmp;
+ uint16_t usIdx;
+ uint16_t usGroupCnt;
+ uint16_t usMaxGroups; /* Number of 4 byte groups to pack. */
+ uint16_t usMask;
+ int iIndex;
+ int i = 0;
+ uint16_t buf[4];
+ uint8_t *tmp;
char *str = NULL;
- tmp = (guint8 *)wmem_alloc0(wmem_packet_scope(), len);
+ tmp = (uint8_t *)wmem_alloc0(wmem_packet_scope(), len);
tvb_memcpy(tvb, tmp, offset, len);
/* Maximum possible unpacked length = (len / 3) * 4 */
str = (char *)wmem_alloc(wmem_packet_scope(), ((len / 3) * 4)+1);
iIndex = 0;
- usMaxGroups = (gushort)(len / 3);
+ usMaxGroups = (uint16_t)(len / 3);
for (usGroupCnt = 0; usGroupCnt < usMaxGroups; usGroupCnt++) {
/*
* First unpack 3 bytes into a group of 4 bytes, clearing bits 6 & 7.
*/
- buf[0] = (gushort)(tmp[iIndex] >> 2);
- buf[1] = (gushort)(((tmp[iIndex] << 4) & 0x30) | (tmp[iIndex + 1] >> 4));
- buf[2] = (gushort)(((tmp[iIndex + 1] << 2) & 0x3C) | (tmp[iIndex + 2] >> 6));
- buf[3] = (gushort)(tmp[iIndex + 2] & 0x3F);
+ buf[0] = (uint16_t)(tmp[iIndex] >> 2);
+ buf[1] = (uint16_t)(((tmp[iIndex] << 4) & 0x30) | (tmp[iIndex + 1] >> 4));
+ buf[2] = (uint16_t)(((tmp[iIndex + 1] << 2) & 0x3C) | (tmp[iIndex + 2] >> 6));
+ buf[3] = (uint16_t)(tmp[iIndex + 2] & 0x3F);
iIndex += 3;
/*
* Now transfer to unpacked area, setting bit 6 to complement of bit 5.
*/
for (usIdx = 0; usIdx < 4; usIdx++) {
- usMask = (gushort)(((buf[usIdx] & 0x20) << 1) ^ 0x40);
+ usMask = (uint16_t)(((buf[usIdx] & 0x20) << 1) ^ 0x40);
DISSECTOR_ASSERT(i < 256);
- str[i++] = (gchar)(buf[usIdx] | usMask);
+ str[i++] = (char)(buf[usIdx] | usMask);
}
}
str[i] = '\0';
@@ -525,16 +525,16 @@ dissect_packAscii(proto_tree *tree, int hf, tvbuff_t *tvb, gint offset, int len)
return len;
}
-static gint
+static int
dissect_timestamp(proto_tree *tree, int hf, const char *name, int len,
- tvbuff_t *tvb, gint offset)
+ tvbuff_t *tvb, int offset)
{
proto_item *ti;
- guint32 t;
- guint32 hrs = 0;
- guint32 mins = 0;
- guint32 secs = 0;
- guint32 ms = 0;
+ uint32_t t;
+ uint32_t hrs = 0;
+ uint32_t mins = 0;
+ uint32_t secs = 0;
+ uint32_t ms = 0;
ti = proto_tree_add_item(tree, hf, tvb, offset, len, ENC_NA);
t = tvb_get_ntohl(tvb, offset);
@@ -546,15 +546,15 @@ dissect_timestamp(proto_tree *tree, int hf, const char *name, int len,
secs = t % 60;
t /= 60;
mins = t % 60;
- hrs = (guint)(t / 60);
+ hrs = (unsigned)(t / 60);
}
proto_item_set_text(ti, "%s: %02d:%02d:%02d.%03d", name, hrs, mins, secs, ms);
return len;
}
-static gint
-dissect_cmd0(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd0(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 12) {
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_expansion_code, tvb, offset);
@@ -590,8 +590,8 @@ dissect_cmd0(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd1(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd1(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 5) {
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_pv_units, tvb, offset);
@@ -602,8 +602,8 @@ dissect_cmd1(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd2(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd2(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 8) {
offset += dissect_float(body_tree, hf_hartip_pt_rsp_pv_loop_current, tvb, offset);
@@ -614,8 +614,8 @@ dissect_cmd2(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd3(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd3(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 24) {
offset += dissect_float(body_tree, hf_hartip_pt_rsp_pv_loop_current, tvb, offset);
@@ -634,8 +634,8 @@ dissect_cmd3(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd7(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd7(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 2) {
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_poll_address, tvb, offset);
@@ -646,8 +646,8 @@ dissect_cmd7(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd8(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd8(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 4) {
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_primary_var_classify, tvb, offset);
@@ -660,8 +660,8 @@ dissect_cmd8(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd9(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd9(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 13) {
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_extended_device_status, tvb, offset);
@@ -735,8 +735,8 @@ dissect_cmd9(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd13(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd13(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 21) {
offset += dissect_packAscii(body_tree, hf_hartip_pt_rsp_tag, tvb, offset, 6);
@@ -751,8 +751,8 @@ dissect_cmd13(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd14(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd14(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 16) {
proto_tree_add_item(body_tree, hf_hartip_pt_rsp_transducer_serial_number, tvb, offset, 3, ENC_NA);
@@ -768,8 +768,8 @@ dissect_cmd14(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd15(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd15(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 18) {
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_pv_alarm_selection_code, tvb, offset);
@@ -788,8 +788,8 @@ dissect_cmd15(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd16(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd16(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 3) {
proto_tree_add_item(body_tree, hf_hartip_pt_rsp_final_assembly_number, tvb, offset, 3, ENC_NA);
@@ -800,8 +800,8 @@ dissect_cmd16(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd33(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd33(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 6) {
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_slot0_device_var, tvb, offset);
@@ -832,8 +832,8 @@ dissect_cmd33(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd38(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd38(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 2) {
dissect_short(body_tree, hf_hartip_pt_rsp_configuration_change_counter, tvb, offset);
@@ -844,8 +844,8 @@ dissect_cmd38(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd48(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd48(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 6) {
proto_tree_add_item(body_tree, hf_hartip_pt_rsp_device_sp_status, tvb, offset, 6, ENC_NA);
@@ -878,14 +878,14 @@ dissect_cmd48(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd77(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen, gint flags)
+static int
+dissect_cmd77(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen, int flags)
{
- guint8 byte_count;
- gint length = bodylen;
+ uint8_t byte_count;
+ int length = bodylen;
if (length >= 6) {
- guint8 delimiter;
+ uint8_t delimiter;
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_io_card, tvb, offset);
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_channel, tvb, offset);
@@ -893,12 +893,12 @@ dissect_cmd77(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen, g
offset += dissect_byte(body_tree, hf_hartip_pt_req_tx_preamble_count, tvb, offset);
}
- delimiter = tvb_get_guint8(tvb, offset);
+ delimiter = tvb_get_uint8(tvb, offset);
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_embedded_cmd_delimiter, tvb, offset);
if ((delimiter & 0x80) == 0) {
- guint8 short_addr;
- short_addr = tvb_get_guint8(tvb, offset);
+ uint8_t short_addr;
+ short_addr = tvb_get_uint8(tvb, offset);
short_addr &= 0x3F;
proto_tree_add_uint(body_tree, hf_hartip_pt_rsp_poll_address, tvb, offset, 1, short_addr);
offset += 1;
@@ -910,7 +910,7 @@ dissect_cmd77(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen, g
offset += dissect_byte(body_tree, hf_hartip_pt_rsp_embedded_cmd, tvb, offset);
- byte_count = tvb_get_guint8(tvb, offset);
+ byte_count = tvb_get_uint8(tvb, offset);
proto_tree_add_item(body_tree, hf_hartip_pt_rsp_command_byte_count, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
length -= 6;
@@ -933,18 +933,18 @@ dissect_cmd77(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen, g
return 0;
}
-static gint
-dissect_cmd178(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd178(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
- guint16 cmd;
- guint8 number_of_cmds;
- guint8 cmd_byte_count;
- gint length = bodylen;
- gint8 i;
- gint result;
+ uint16_t cmd;
+ uint8_t number_of_cmds;
+ uint8_t cmd_byte_count;
+ int length = bodylen;
+ int8_t i;
+ int result;
if (length >= 5) {
- number_of_cmds = tvb_get_guint8(tvb, offset);
+ number_of_cmds = tvb_get_uint8(tvb, offset);
proto_tree_add_uint(body_tree, hf_hartip_pt_rsp_number_of_commands, tvb, offset, 1, number_of_cmds);
offset += 1;
length -= 1;
@@ -958,7 +958,7 @@ dissect_cmd178(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
offset += 2;
length -= 2;
- cmd_byte_count = tvb_get_guint8(tvb, offset);
+ cmd_byte_count = tvb_get_uint8(tvb, offset);
proto_tree_add_item(body_tree, hf_hartip_pt_rsp_command_byte_count, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
length -= 1;
@@ -1004,8 +1004,8 @@ dissect_cmd178(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd203(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd203(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
if (bodylen >= 8) {
offset += dissect_short(body_tree, hf_hartip_pt_rsp_index_of_first_discrete_var, tvb, offset);
@@ -1057,12 +1057,12 @@ dissect_cmd203(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_cmd31(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
+static int
+dissect_cmd31(proto_tree *body_tree, tvbuff_t *tvb, int offset, int bodylen)
{
- gint length = bodylen;
- gint result = 0;
- guint16 cmd;
+ int length = bodylen;
+ int result = 0;
+ uint16_t cmd;
if (length >= 2) {
cmd = tvb_get_ntohs(tvb, offset);
@@ -1090,9 +1090,9 @@ dissect_cmd31(proto_tree *body_tree, tvbuff_t *tvb, gint offset, gint bodylen)
return 0;
}
-static gint
-dissect_parse_hart_cmds(proto_tree *body_tree, tvbuff_t *tvb, guint8 cmd,
- gint offset, gint bodylen, gint flags)
+static int
+dissect_parse_hart_cmds(proto_tree *body_tree, tvbuff_t *tvb, uint8_t cmd,
+ int offset, int bodylen, int flags)
{
switch(cmd)
{
@@ -1155,23 +1155,23 @@ dissect_parse_hart_cmds(proto_tree *body_tree, tvbuff_t *tvb, guint8 cmd,
return 0;
}
-static gint
-dissect_pass_through(proto_tree *body_tree, tvbuff_t *tvb, gint offset,
- gint bodylen)
+static int
+dissect_pass_through(proto_tree *body_tree, tvbuff_t *tvb, int offset,
+ int bodylen)
{
- guint8 delimiter;
- guint8 cmd = 0;
- gint length = bodylen;
- gint is_short = 0;
- gint is_rsp = 0;
- gint num_preambles = 0;
- gint result;
- guint8 short_addr;
- guint8 bytes = 0;
+ uint8_t delimiter;
+ uint8_t cmd = 0;
+ int length = bodylen;
+ int is_short = 0;
+ int is_rsp = 0;
+ int num_preambles = 0;
+ int result;
+ uint8_t short_addr;
+ uint8_t bytes = 0;
/* find number of preambles */
while (length > num_preambles) {
- delimiter = tvb_get_guint8(tvb, offset + num_preambles);
+ delimiter = tvb_get_uint8(tvb, offset + num_preambles);
if (delimiter != 0xFF)
break;
@@ -1186,7 +1186,7 @@ dissect_pass_through(proto_tree *body_tree, tvbuff_t *tvb, gint offset,
}
if (length > 0) {
- delimiter = tvb_get_guint8(tvb, offset);
+ delimiter = tvb_get_uint8(tvb, offset);
static int * const hartip_pt_delimiter_flag[] = {
&hf_hartip_pt_delimiter_frame_type,
@@ -1216,7 +1216,7 @@ dissect_pass_through(proto_tree *body_tree, tvbuff_t *tvb, gint offset,
if (is_short == 1) {
if (length > 0) {
- short_addr = tvb_get_guint8(tvb, offset);
+ short_addr = tvb_get_uint8(tvb, offset);
short_addr = short_addr & 0x3F;
proto_tree_add_uint(body_tree, hf_hartip_pt_short_addr, tvb, offset, 1,
short_addr);
@@ -1241,7 +1241,7 @@ dissect_pass_through(proto_tree *body_tree, tvbuff_t *tvb, gint offset,
}
if (length > 0) {
- cmd = tvb_get_guint8(tvb, offset);
+ cmd = tvb_get_uint8(tvb, offset);
proto_tree_add_item(body_tree, hf_hartip_pt_command, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
length -= 1;
@@ -1266,7 +1266,7 @@ dissect_pass_through(proto_tree *body_tree, tvbuff_t *tvb, gint offset,
}
if (length > 1) {
- gint flags = 0;
+ int flags = 0;
if ( is_rsp ) {
flags |= HARTIP_PT_IS_RSP;
}
@@ -1317,13 +1317,13 @@ hartip_set_conversation(packet_info *pinfo)
static int
dissect_hartip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- gint offset)
+ int offset)
{
proto_tree *hartip_tree, *hdr_tree, *body_tree;
proto_item *hart_item;
- gint bodylen;
- guint8 message_type, message_id;
- guint16 transaction_id, length;
+ int bodylen;
+ uint8_t message_type, message_id;
+ uint16_t transaction_id, length;
const char *msg_id_str, *msg_type_str;
hartip_tap_info *tapinfo;
@@ -1341,12 +1341,12 @@ dissect_hartip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_item(hdr_tree, hf_hartip_hdr_version, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- message_type = tvb_get_guint8(tvb, offset);
+ message_type = tvb_get_uint8(tvb, offset);
msg_type_str = val_to_str(message_type, hartip_message_type_values, "Unknown message type %d");
proto_tree_add_item(hdr_tree, hf_hartip_hdr_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
- message_id = tvb_get_guint8(tvb, offset);
+ message_id = tvb_get_uint8(tvb, offset);
msg_id_str = val_to_str(message_id, hartip_message_id_values, "Unknown message %d");
proto_tree_add_item(hdr_tree, hf_hartip_hdr_message_id, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
@@ -1416,7 +1416,7 @@ dissect_hartip_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
return offset;
}
-static guint
+static unsigned
get_dissect_hartip_len(packet_info *pinfo _U_, tvbuff_t *tvb,
int offset, void *data _U_)
{
@@ -1433,13 +1433,13 @@ static int
dissect_hartip_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
void *data)
{
- /* Simple hueristic check*/
- const gchar * msg_str = try_val_to_str(tvb_get_guint8(tvb, 1), hartip_message_type_values);
+ /* Simple heuristic check*/
+ const char * msg_str = try_val_to_str(tvb_get_uint8(tvb, 1), hartip_message_type_values);
if (!msg_str) {
return 0;
}
- msg_str = try_val_to_str(tvb_get_guint8(tvb, 2), hartip_message_id_values);
+ msg_str = try_val_to_str(tvb_get_uint8(tvb, 2), hartip_message_id_values);
if (!msg_str) {
return 0;
}
@@ -1453,15 +1453,15 @@ static int
dissect_hartip_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
void *data _U_)
{
- gint offset = 0;
+ int offset = 0;
- /* Simple hueristic check*/
- const gchar * msg_str = try_val_to_str(tvb_get_guint8(tvb, 1), hartip_message_type_values);
+ /* Simple heuristic check*/
+ const char * msg_str = try_val_to_str(tvb_get_uint8(tvb, 1), hartip_message_type_values);
if (!msg_str) {
return 0;
}
- msg_str = try_val_to_str(tvb_get_guint8(tvb, 2), hartip_message_id_values);
+ msg_str = try_val_to_str(tvb_get_uint8(tvb, 2), hartip_message_id_values);
if (!msg_str) {
return 0;
}
@@ -2004,7 +2004,7 @@ proto_register_hartip(void)
/* command 14 */
{ &hf_hartip_pt_rsp_transducer_serial_number,
- { "Transducer Serail Number", "hart_ip.pt.rsp.transducer_serail_number",
+ { "Transducer Serial Number", "hart_ip.pt.rsp.transducer_serial_number",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
@@ -2278,7 +2278,7 @@ proto_register_hartip(void)
}
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_hartip,
&ett_hartip_hdr,
&ett_hartip_body,