diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:53 +0000 |
commit | a86c5f7cae7ec9a3398300555a0b644689d946a1 (patch) | |
tree | 39fe4b107c71174fd1e8a8ceb9a4d2aa14116248 /epan/dissectors/packet-idn.c | |
parent | Releasing progress-linux version 4.2.6-1~progress7.99u1. (diff) | |
download | wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.tar.xz wireshark-a86c5f7cae7ec9a3398300555a0b644689d946a1.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-idn.c')
-rw-r--r-- | epan/dissectors/packet-idn.c | 732 |
1 files changed, 367 insertions, 365 deletions
diff --git a/epan/dissectors/packet-idn.c b/epan/dissectors/packet-idn.c index d7638b66..ffacce07 100644 --- a/epan/dissectors/packet-idn.c +++ b/epan/dissectors/packet-idn.c @@ -21,6 +21,8 @@ #include <epan/packet.h> #include <epan/conversation.h> +#include <wsutil/array.h> + #define IDN_PORT 7255 #define MAX_CHANNELS 512 @@ -93,16 +95,16 @@ #define IDNO_VOID_AREA 0xF typedef struct { - gboolean has_config_header; - gboolean is_dmx; - guint16 total_size; - guint8 channel_id; - guint8 chunk_type; + bool has_config_header; + bool is_dmx; + uint16_t total_size; + uint8_t channel_id; + uint8_t chunk_type; } message_info; typedef struct { - guint8 word_count; - guint8 sdm; + uint8_t word_count; + uint8_t sdm; char *dic_precision; char *sample_column_string; int sample_size; @@ -115,126 +117,126 @@ void proto_reg_handoff_idn(void); static dissector_handle_t idn_handle; -static int proto_idn = -1; - -static gint ett_idn = -1; -static gint ett_idn_header_tree = -1; -static gint ett_idn_scanreply_header_tree = -1; -static gint ett_idn_channel_message_header_tree = -1; -static gint ett_protocol_version = -1; -static gint ett_status = -1; -static gint ett_idn_cnl = -1; -static gint ett_configuration_header = -1; -static gint ett_chunk_header_tree = -1; -static gint ett_chunk_header_flags = -1; -static gint ett_cfl = -1; -static gint ett_dic = -1; -static gint ett_dic_tree = -1; -static gint ett_data = -1; -static gint ett_subdata = -1; -static gint ett_dmx_subtree = -1; +static int proto_idn; + +static int ett_idn; +static int ett_idn_header_tree; +static int ett_idn_scanreply_header_tree; +static int ett_idn_channel_message_header_tree; +static int ett_protocol_version; +static int ett_status; +static int ett_idn_cnl; +static int ett_configuration_header; +static int ett_chunk_header_tree; +static int ett_chunk_header_flags; +static int ett_cfl; +static int ett_dic; +static int ett_dic_tree; +static int ett_data; +static int ett_subdata; +static int ett_dmx_subtree; /* IDN-Header */ -static int idn_command = -1; -static int idn_flags = -1; -static int idn_sequence = -1; -static int idn_total_size = -1; +static int hf_idn_command; +static int hf_idn_flags; +static int hf_idn_sequence; +static int hf_idn_total_size; /* Scanreply Header */ -static int idn_struct_size = -1; -static int idn_protocol_version = -1; -static int idn_protocol_version_major = -1; -static int idn_protocol_version_minor = -1; -static int idn_status = -1; -static int idn_malfn = -1; -static int idn_offline = -1; -static int idn_xcld = -1; -static int idn_ocpd = -1; -static int idn_rt = -1; -static int idn_reserved8 = -1; -static int idn_unit_id = -1; -static int idn_name = -1; +static int hf_idn_struct_size; +static int hf_idn_protocol_version; +static int hf_idn_protocol_version_major; +static int hf_idn_protocol_version_minor; +static int hf_idn_status; +static int hf_idn_malfn; +static int hf_idn_offline; +static int hf_idn_xcld; +static int hf_idn_ocpd; +static int hf_idn_rt; +static int hf_idn_reserved8; +static int hf_idn_unit_id; +static int hf_idn_name; /* Service Map Response */ -static int idn_entry_size = -1; -static int idn_relay_count = -1; -static int idn_service_count = -1; -static int idn_relay_number = -1; +static int hf_idn_entry_size; +static int hf_idn_relay_count; +static int hf_idn_service_count; +static int hf_idn_relay_number; /* Channel Message Header */ -static int idn_cnl = -1; -static int idn_most_significant_bit_cnl = -1; -static int idn_cclf = -1; -static int idn_channel_id = -1; -static int idn_chunk_type = -1; -static int idn_timestamp = -1; +static int hf_idn_cnl; +static int hf_idn_most_significant_bit_cnl; +static int hf_idn_cclf; +static int hf_idn_channel_id; +static int hf_idn_chunk_type; +static int hf_idn_timestamp; /* Configuration Header */ -static int idn_scwc = -1; -static int idn_cfl = -1; -static int idn_sdm = -1; -static int idn_close = -1; -static int idn_routing = -1; -static int idn_service_id = -1; -static int idn_service_mode = -1; +static int hf_idn_scwc; +static int hf_idn_cfl; +static int hf_idn_sdm; +static int hf_idn_close; +static int hf_idn_routing; +static int hf_idn_service_id; +static int hf_idn_service_mode; /* Chunk Header */ -static int idn_chunk_header_flags = -1; -static int idn_two_bits_reserved_1 = -1; -static int idn_two_bits_reserved_2 = -1; -static int idn_three_bits_reserved = -1; -static int idn_four_bits_reserved = -1; -static int idn_scm = -1; -static int idn_once = -1; -static int idn_duration = -1; -static int idn_chunk_data_sequence = -1; -static int idn_offset = -1; -static int idn_dlim = -1; -static int idn_reserved = -1; +static int hf_idn_chunk_header_flags; +static int hf_idn_two_bits_reserved_1; +static int hf_idn_two_bits_reserved_2; +static int hf_idn_three_bits_reserved; +static int hf_idn_four_bits_reserved; +static int hf_idn_scm; +static int hf_idn_once; +static int hf_idn_duration; +static int hf_idn_chunk_data_sequence; +static int hf_idn_offset; +static int hf_idn_dlim; +static int hf_idn_reserved; /* Tags */ -static int idn_gts = -1; -static int idn_gts_void = -1; -static int idn_boundary = -1; -static int idn_gts_word = -1; -static int idn_gts_break = -1; -static int idn_gts_space_modifier = -1; -static int idn_gts_hint = -1; -static int idn_gts_category = -1; -static int idn_gts_subcategory = -1; -static int idn_gts_identifier = -1; -static int idn_gts_parameter = -1; -static int idn_gts_glin = -1; -static int idn_gts_clin = -1; -static int idn_gts_cbal = -1; -static int idn_gts_ctim = -1; -static int idn_gts_nop = -1; -static int idn_gts_precision = -1; -static int idn_gts_cscl = -1; -static int idn_gts_iscl = -1; -static int idn_gts_sht = -1; -static int idn_gts_u4 = -1; -static int idn_gts_x = -1; -static int idn_gts_y = -1; -static int idn_gts_z = -1; -static int idn_gts_color = -1; -static int idn_gts_wavelength_prefix = -1; -static int idn_gts_intensity = -1; -static int idn_gts_beam_brush = -1; -static int idn_gts_sample = -1; -static int idn_dmx_octet = -1; -static int idn_dmx_identifier = -1; -static int idn_dmx_parameter = -1; -static int idn_dmx_void = -1; -static int idn_octet = -1; -static int idn_dmx_base = -1; -static int idn_dmx_count = -1; -static int idn_dmx_dls = -1; -static int idn_dmx_unknown = -1; +static int hf_idn_gts; +static int hf_idn_gts_void; +static int hf_idn_boundary; +static int hf_idn_gts_word; +static int hf_idn_gts_break; +static int hf_idn_gts_space_modifier; +static int hf_idn_gts_hint; +static int hf_idn_gts_category; +static int hf_idn_gts_subcategory; +static int hf_idn_gts_identifier; +static int hf_idn_gts_parameter; +static int hf_idn_gts_glin; +static int hf_idn_gts_clin; +static int hf_idn_gts_cbal; +static int hf_idn_gts_ctim; +static int hf_idn_gts_nop; +static int hf_idn_gts_precision; +static int hf_idn_gts_cscl; +static int hf_idn_gts_iscl; +static int hf_idn_gts_sht; +static int hf_idn_gts_u4; +static int hf_idn_gts_x; +static int hf_idn_gts_y; +static int hf_idn_gts_z; +static int hf_idn_gts_color; +static int hf_idn_gts_wavelength_prefix; +static int hf_idn_gts_intensity; +static int hf_idn_gts_beam_brush; +static int hf_idn_gts_sample; +static int hf_idn_dmx_octet; +static int hf_idn_dmx_identifier; +static int hf_idn_dmx_parameter; +static int hf_idn_dmx_void; +static int hf_idn_octet; +static int hf_idn_dmx_base; +static int hf_idn_dmx_count; +static int hf_idn_dmx_dls; +static int hf_idn_dmx_unknown; /* Acknowledgement */ -static int idn_result_code = -1; -static int idn_event_flags = -1; +static int hf_idn_result_code; +static int hf_idn_event_flags; static const value_string command_code[] = { { IDNCMD_VOID, "VOID" }, @@ -325,7 +327,7 @@ static const value_string result_code[] = { { 0, NULL} }; -static int get_service_match(guint8 flags) { +static int get_service_match(uint8_t flags) { return flags >> 4; } @@ -368,7 +370,7 @@ static void determine_message_type(packet_info *pinfo, message_info *minfo) { } } -static void determine_color(guint16 catsub, configuration_info *config) { +static void determine_color(uint16_t catsub, configuration_info *config) { char *column_str = config->sample_column_string; const int l = (const int)strlen(column_str); switch(catsub) { @@ -397,11 +399,11 @@ static void determine_color(guint16 catsub, configuration_info *config) { static int dissect_idn_message_acknowledgement(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { proto_tree *idn_message_acknowledgement_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_idn_header_tree, NULL, "Message Acknowledgement"); - proto_tree_add_item(idn_message_acknowledgement_tree, idn_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_message_acknowledgement_tree, hf_idn_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_message_acknowledgement_tree, idn_result_code, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_message_acknowledgement_tree, hf_idn_result_code, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_message_acknowledgement_tree, idn_event_flags, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_message_acknowledgement_tree, hf_idn_event_flags, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } @@ -435,7 +437,7 @@ static configuration_info *get_configuration_info(packet_info *pinfo, int channe return config; } -static int dissect_idn_dmx_sample_values(tvbuff_t *tvb, int offset, proto_tree *idn_dmx_subtree, guint16 data_size, int base) { +static int dissect_idn_dmx_sample_values(tvbuff_t *tvb, int offset, proto_tree *idn_dmx_subtree, uint16_t data_size, int base) { int i, j, l; short int rest; char values[MAX_BUFFER]; @@ -443,18 +445,18 @@ static int dissect_idn_dmx_sample_values(tvbuff_t *tvb, int offset, proto_tree * for(i=0; i+16<=data_size; i+=16) { l = 0; for(j=1; j<16; j++){ - l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_guint8(tvb, offset+j)); + l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_uint8(tvb, offset+j)); } - proto_tree_add_int_format(idn_dmx_subtree, idn_gts_sample, tvb, offset, 16, 16, "%3d: %s", base+i, values); + proto_tree_add_int_format(idn_dmx_subtree, hf_idn_gts_sample, tvb, offset, 16, 16, "%3d: %s", base+i, values); offset += 16; } rest = data_size - i; if(rest > 0) { l = 0; for(j=0; j<rest; j++){ - l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_guint8(tvb, offset+j)); + l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_uint8(tvb, offset+j)); } - proto_tree_add_int_format(idn_dmx_subtree, idn_gts_sample, tvb, offset, rest, rest, "%3d: %s", base+i, values); + proto_tree_add_int_format(idn_dmx_subtree, hf_idn_gts_sample, tvb, offset, rest, rest, "%3d: %s", base+i, values); offset += rest; } return offset; @@ -465,18 +467,18 @@ static void set_laser_sample_values_string(tvbuff_t *tvb, int offset, configurat int l = 0; if((config->dic_precision)[2] == 1) - l += snprintf(values, MAX_BUFFER, "%5d", tvb_get_guint16(tvb, offset, 2)); + l += snprintf(values, MAX_BUFFER, "%5d", tvb_get_uint16(tvb, offset, 2)); else - l += snprintf(values, MAX_BUFFER, "%5d", tvb_get_guint8(tvb, offset)); + l += snprintf(values, MAX_BUFFER, "%5d", tvb_get_uint8(tvb, offset)); for(i=1; i<config->sample_size && (l < MAX_BUFFER-100); i++){ if((config->dic_precision)[i+1] == 1) { //do nothing }else if((config->dic_precision)[i+2] == 1) { - l += snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_guint16(tvb, offset+i, 2)); + l += snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_uint16(tvb, offset+i, 2)); i++; }else { - l += snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_guint8(tvb, offset+i)); + l += snprintf(values+l, MAX_BUFFER-l, " %5d", tvb_get_uint8(tvb, offset+i)); } } } @@ -492,18 +494,18 @@ static int dissect_idn_octet_segment(tvbuff_t *tvb, int offset, proto_tree *idn_ for(i=0; i+16<=data_size; i+=16) { l = 0; for(j=0; j<16 && (l < MAX_BUFFER-100); j++){ - l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_gint8(tvb, offset+j)); + l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_int8(tvb, offset+j)); } - proto_tree_add_int_format(idn_samples_tree, idn_gts_sample, tvb, offset, 16, 16, "%s", values); + proto_tree_add_int_format(idn_samples_tree, hf_idn_gts_sample, tvb, offset, 16, 16, "%s", values); offset += 16; } rest = data_size - i; if(rest > 0) { l = 0; for(j=0; j<rest && (l < MAX_BUFFER-100); j++){ - l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_gint8(tvb, offset+j)); + l += snprintf(values+l, MAX_BUFFER-l, " %3d", tvb_get_int8(tvb, offset+j)); } - proto_tree_add_int_format(idn_samples_tree, idn_gts_sample, tvb, offset, rest, rest, "%s", values); + proto_tree_add_int_format(idn_samples_tree, hf_idn_gts_sample, tvb, offset, rest, rest, "%s", values); offset += rest; } return offset; @@ -514,7 +516,7 @@ static int dissect_idn_dmx_data(tvbuff_t *tvb, packet_info *pinfo, int offset, p int *count = config->count; int *base = config->base; int base_value; - guint16 data_size = tvb_reported_length_remaining(tvb, offset); + uint16_t data_size = tvb_reported_length_remaining(tvb, offset); proto_tree *idn_samples_tree = proto_tree_add_subtree(idn_tree, tvb, offset, data_size, ett_data, NULL, "Channels"); proto_tree *idn_dmx_subtree; @@ -567,7 +569,7 @@ static int dissect_idn_laser_data(tvbuff_t *tvb, int offset, proto_tree *idn_tre idn_samples_subtree = proto_tree_add_subtree_format(idn_samples_tree, tvb, offset, config->sample_size*10, ett_subdata, NULL, "Samples %3d - %3d", i, i+9); } set_laser_sample_values_string(tvb, offset, config, values); - proto_tree_add_int_format(idn_samples_subtree, idn_gts_sample, tvb, offset, config->sample_size, config->sample_size, "Sample %3d: %s", i, values); + proto_tree_add_int_format(idn_samples_subtree, hf_idn_gts_sample, tvb, offset, config->sample_size, config->sample_size, "Sample %3d: %s", i, values); offset += config->sample_size; } return offset; @@ -575,87 +577,87 @@ static int dissect_idn_laser_data(tvbuff_t *tvb, int offset, proto_tree *idn_tre static int dissect_idn_dimmer_levels_chunk_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { static int * const dimmer_levels_chunk_flags[] = { - &idn_two_bits_reserved_1, - &idn_scm, - &idn_four_bits_reserved, + &hf_idn_two_bits_reserved_1, + &hf_idn_scm, + &hf_idn_four_bits_reserved, NULL }; proto_tree *chunk_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_chunk_header_tree, NULL, "Dimmer Levels Chunk Header"); - proto_tree_add_bitmask(chunk_header_tree, tvb, offset, idn_chunk_header_flags, ett_chunk_header_flags, dimmer_levels_chunk_flags, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(chunk_header_tree, tvb, offset, hf_idn_chunk_header_flags, ett_chunk_header_flags, dimmer_levels_chunk_flags, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static int dissect_idn_octet_string_chunk_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { static int * const octet_string_chunk_flags[] = { - &idn_two_bits_reserved_1, - &idn_scm, - &idn_four_bits_reserved, + &hf_idn_two_bits_reserved_1, + &hf_idn_scm, + &hf_idn_four_bits_reserved, NULL }; proto_tree *chunk_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_chunk_header_tree, NULL, "Octet String Chunk Header"); - proto_tree_add_bitmask(chunk_header_tree, tvb, offset, idn_chunk_header_flags, ett_chunk_header_flags, octet_string_chunk_flags, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(chunk_header_tree, tvb, offset, hf_idn_chunk_header_flags, ett_chunk_header_flags, octet_string_chunk_flags, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static int dissect_idn_octet_segment_chunk_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { static int * const octet_segment_chunk_flags[] = { - &idn_two_bits_reserved_1, - &idn_scm, - &idn_three_bits_reserved, - &idn_dlim, + &hf_idn_two_bits_reserved_1, + &hf_idn_scm, + &hf_idn_three_bits_reserved, + &hf_idn_dlim, NULL }; proto_tree *chunk_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_chunk_header_tree, NULL, "Octet Segment Chunk Header"); - proto_tree_add_bitmask(chunk_header_tree, tvb, offset, idn_chunk_header_flags, ett_chunk_header_flags, octet_segment_chunk_flags, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(chunk_header_tree, tvb, offset, hf_idn_chunk_header_flags, ett_chunk_header_flags, octet_segment_chunk_flags, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_chunk_data_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_chunk_data_sequence, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_offset, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_offset, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; return offset; } static int dissect_idn_frame_chunk_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { static int * const frame_sample_chunk_flags[] = { - &idn_two_bits_reserved_1, - &idn_scm, - &idn_three_bits_reserved, - &idn_once, + &hf_idn_two_bits_reserved_1, + &hf_idn_scm, + &hf_idn_three_bits_reserved, + &hf_idn_once, NULL }; proto_tree *chunk_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_chunk_header_tree, NULL, "Frame Sample Chunk Header"); - proto_tree_add_bitmask(chunk_header_tree, tvb, offset, idn_chunk_header_flags, ett_chunk_header_flags, frame_sample_chunk_flags, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(chunk_header_tree, tvb, offset, hf_idn_chunk_header_flags, ett_chunk_header_flags, frame_sample_chunk_flags, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_duration, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_duration, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; return offset; } static int dissect_idn_wave_chunk_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { static int * const wave_sample_chunk_flags[] = { - &idn_two_bits_reserved_1, - &idn_scm, - &idn_four_bits_reserved, + &hf_idn_two_bits_reserved_1, + &hf_idn_scm, + &hf_idn_four_bits_reserved, NULL }; proto_tree *chunk_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_chunk_header_tree, NULL, "Wave Sample Chunk Header"); - proto_tree_add_bitmask(chunk_header_tree, tvb, offset, idn_chunk_header_flags, ett_chunk_header_flags, wave_sample_chunk_flags, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(chunk_header_tree, tvb, offset, hf_idn_chunk_header_flags, ett_chunk_header_flags, wave_sample_chunk_flags, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(chunk_header_tree, idn_duration, tvb, offset, 3, ENC_BIG_ENDIAN); + proto_tree_add_item(chunk_header_tree, hf_idn_duration, tvb, offset, 3, ENC_BIG_ENDIAN); offset += 3; return offset; } @@ -688,8 +690,8 @@ static int dissect_idn_chunk_header(tvbuff_t *tvb, int offset, proto_tree *idn_t static int dissect_idn_dmx_gts(tvbuff_t *tvb, int offset, proto_tree *gts_tree, const int hf_hdr, int *dictionary_size) { static int * const gts[] = { - &idn_dmx_identifier, - &idn_dmx_parameter, + &hf_idn_dmx_identifier, + &hf_idn_dmx_parameter, NULL }; proto_tree_add_bitmask(gts_tree, tvb, offset, hf_hdr, ett_dic, gts, ENC_BIG_ENDIAN); @@ -701,17 +703,17 @@ static int dissect_idn_dmx_gts(tvbuff_t *tvb, int offset, proto_tree *gts_tree, } static int dissect_idn_dimmer_level_subset(tvbuff_t *tvb, int offset, proto_tree *gts_tree, configuration_info *config, int i, int *dictionary_size) { - guint8 dls = tvb_get_guint8(tvb, offset); - offset = dissect_idn_dmx_gts(tvb, offset, gts_tree, idn_dmx_dls, dictionary_size); + uint8_t dls = tvb_get_uint8(tvb, offset); + offset = dissect_idn_dmx_gts(tvb, offset, gts_tree, hf_idn_dmx_dls, dictionary_size); if(dls & 2) { - proto_tree_add_item(gts_tree, idn_dmx_base, tvb, offset, 2, ENC_BIG_ENDIAN); - config->base[i-1] = tvb_get_guint16(tvb, offset, 2); + proto_tree_add_item(gts_tree, hf_idn_dmx_base, tvb, offset, 2, ENC_BIG_ENDIAN); + config->base[i-1] = tvb_get_uint16(tvb, offset, 2); offset += 2; (*dictionary_size) += 2; if(dls & 1) { - proto_tree_add_item(gts_tree, idn_dmx_count, tvb, offset, 1, ENC_BIG_ENDIAN); - config->count[i-1] = tvb_get_guint8(tvb, offset); + proto_tree_add_item(gts_tree, hf_idn_dmx_count, tvb, offset, 1, ENC_BIG_ENDIAN); + config->count[i-1] = tvb_get_uint8(tvb, offset); offset++; (*dictionary_size)++; }else { @@ -724,25 +726,25 @@ static int dissect_idn_dimmer_level_subset(tvbuff_t *tvb, int offset, proto_tree static int dissect_idn_dmx_dictionary(tvbuff_t *tvb, int offset, proto_tree *idn_tree, configuration_info *config) { int i, j, curr_size; - gboolean words_found = 0; + bool words_found = 0; int dictionary_size = 0; - guint8 idepar; /* idetifier + parameter */ + uint8_t idepar; /* idetifier + parameter */ proto_tree *gts_tree = proto_tree_add_subtree(idn_tree, tvb, offset, -1, ett_dic_tree, NULL, "Dictionary"); for(i=1; i<=config->word_count; i++) { - idepar = tvb_get_guint8(tvb, offset); + idepar = tvb_get_uint8(tvb, offset); if(idepar <= IDNO_VOID_AREA) { if(idepar == 0) { - proto_tree_add_item(gts_tree, idn_dmx_void, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(gts_tree, hf_idn_dmx_void, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; dictionary_size += 1; if(!words_found) i -= 1; }else { - offset = dissect_idn_dmx_gts(tvb, offset, gts_tree, idn_dmx_unknown, NULL); + offset = dissect_idn_dmx_gts(tvb, offset, gts_tree, hf_idn_dmx_unknown, NULL); for(j=1; j<=idepar; j++) { - proto_tree_add_item(gts_tree, idn_octet, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(gts_tree, hf_idn_octet, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; dictionary_size += 1; if(words_found) @@ -754,7 +756,7 @@ static int dissect_idn_dmx_dictionary(tvbuff_t *tvb, int offset, proto_tree *idn }else if(idepar >= IDNTAG_DIMMER_START && idepar <= IDNTAG_DIMMER_END) { offset = dissect_idn_dimmer_level_subset(tvb, offset, gts_tree, config, i, &dictionary_size); }else { - offset = dissect_idn_dmx_gts(tvb, offset, gts_tree, idn_dmx_unknown, &dictionary_size); + offset = dissect_idn_dmx_gts(tvb, offset, gts_tree, hf_idn_dmx_unknown, &dictionary_size); } if(i == config->word_count && !words_found) { @@ -771,12 +773,12 @@ static int dissect_idn_dmx_dictionary(tvbuff_t *tvb, int offset, proto_tree *idn return offset; } -static int dissect_idn_laser_gts(tvbuff_t *tvb, int offset, proto_tree *gts_tree, const int hf_hdr, int *dictionary_size, configuration_info *config, gboolean is_sample) { +static int dissect_idn_laser_gts(tvbuff_t *tvb, int offset, proto_tree *gts_tree, const int hf_hdr, int *dictionary_size, configuration_info *config, bool is_sample) { static int * const gts[] = { - &idn_gts_category, - &idn_gts_subcategory, - &idn_gts_identifier, - &idn_gts_parameter, + &hf_idn_gts_category, + &hf_idn_gts_subcategory, + &hf_idn_gts_identifier, + &hf_idn_gts_parameter, NULL }; @@ -790,15 +792,15 @@ static int dissect_idn_laser_gts(tvbuff_t *tvb, int offset, proto_tree *gts_tree return offset + 2; } -static int dissect_idn_x_area(tvbuff_t *tvb, int offset, proto_tree *gts_tree, guint16 catsub, int *dictionary_size, configuration_info *config) { +static int dissect_idn_x_area(tvbuff_t *tvb, int offset, proto_tree *gts_tree, uint16_t catsub, int *dictionary_size, configuration_info *config) { char *column_str = config->sample_column_string; const int l = (const int)strlen(column_str); if(catsub == IDNTAG_OPTIONAL_U4) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_u4, dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_u4, dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " U4"); }else { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_x, dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_x, dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " X"); } @@ -809,56 +811,56 @@ static int dissect_idn_laser_dictionary(tvbuff_t *tvb, int offset, proto_tree *i int i, j; int dictionary_size = 0; char *column_str = config->sample_column_string; - guint16 catsub; /* category + subcategory */ + uint16_t catsub; /* category + subcategory */ proto_tree *gts_tree = proto_tree_add_subtree(idn_tree, tvb, offset, -1, ett_dic_tree, NULL, "Dictionary"); snprintf(column_str, MAX_BUFFER, "("); for(i=1; i<=config->word_count*2; i++) { - catsub = tvb_get_guint16(tvb, offset, 2); + catsub = tvb_get_uint16(tvb, offset, 2); const int l = (const int)strlen(column_str); if(catsub <= IDNO_VOID_AREA) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_void, &dictionary_size, config, 0); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_void, &dictionary_size, config, 0); if(catsub > 0) { for(j=0; j<catsub; j++) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_void, &dictionary_size, config, 0); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_void, &dictionary_size, config, 0); } } }else if(catsub == IDNTAG_PRECISION) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_precision, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_precision, &dictionary_size, config, 1); (config->dic_precision)[i] = 1; }else if(catsub >= IDNTAG_BREAK_START && catsub <= IDNTAG_BREAK_END) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_break, &dictionary_size, config, 0); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_break, &dictionary_size, config, 0); }else if(catsub >= IDNTAG_SPACE_MOD_START && catsub <= IDNTAG_SPACE_MOD_END) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_space_modifier, &dictionary_size, config, 0); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_space_modifier, &dictionary_size, config, 0); }else if(catsub == IDNTAG_NOP) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_nop, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_nop, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " NOP"); }else if(catsub >= IDNTAG_HINT0 && catsub <= IDNTAG_HINT1) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_hint, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_hint, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " H"); }else if(catsub >= IDNTAG_COORD_X && catsub <= IDNTAG_COORD_X_END) { offset = dissect_idn_x_area(tvb, offset, gts_tree, catsub, &dictionary_size, config); }else if(catsub >= IDNTAG_COORD_Y && catsub <= IDNTAG_COORD_Y_END) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_y, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_y, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " Y"); }else if(catsub >= IDNTAG_COORD_Z && catsub <= IDNTAG_COORD_Z_END) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_z, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_z, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " Z"); }else if(catsub >= IDNTAG_COLOR_START && catsub <= IDNTAG_COLOR_END) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_color, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_color, &dictionary_size, config, 1); determine_color(catsub, config); }else if(catsub == IDNTAG_WAVELENGTH_PREFIX) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_wavelength_prefix, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_wavelength_prefix, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " WP"); }else if(catsub == IDNTAG_INTENSITY) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_intensity, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_intensity, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " I"); }else if(catsub == IDNTAG_BEAM_BRUSH) { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts_beam_brush, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts_beam_brush, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " BB"); }else { - offset = dissect_idn_laser_gts(tvb, offset, gts_tree, idn_gts, &dictionary_size, config, 1); + offset = dissect_idn_laser_gts(tvb, offset, gts_tree, hf_idn_gts, &dictionary_size, config, 1); snprintf(column_str+l, MAX_BUFFER-l, " U/R"); } } @@ -871,28 +873,28 @@ static int dissect_idn_laser_dictionary(tvbuff_t *tvb, int offset, proto_tree *i static int dissect_idn_channel_configuration_header(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *idn_tree, int channel_id, configuration_info **config_p) { conversation_t *conv; - guint8 word_count; - guint8 sdm; + uint8_t word_count; + uint8_t sdm; static int * const channel_and_service_configuration_flags[] = { - &idn_two_bits_reserved_1, - &idn_sdm, - &idn_two_bits_reserved_2, - &idn_close, - &idn_routing, + &hf_idn_two_bits_reserved_1, + &hf_idn_sdm, + &hf_idn_two_bits_reserved_2, + &hf_idn_close, + &hf_idn_routing, NULL }; col_append_str(pinfo->cinfo, COL_INFO, " (Configuration Header)"); proto_tree *configuration_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_configuration_header, NULL, "Channel Configuration Header"); - proto_tree_add_item(configuration_header_tree, idn_scwc, tvb, offset, 1, ENC_BIG_ENDIAN); - word_count = tvb_get_guint8(tvb, offset); + proto_tree_add_item(configuration_header_tree, hf_idn_scwc, tvb, offset, 1, ENC_BIG_ENDIAN); + word_count = tvb_get_uint8(tvb, offset); offset += 1; - proto_tree_add_bitmask(configuration_header_tree, tvb, offset, idn_cfl, ett_cfl, channel_and_service_configuration_flags, ENC_BIG_ENDIAN); - sdm = get_service_match(tvb_get_guint8(tvb, offset)); + proto_tree_add_bitmask(configuration_header_tree, tvb, offset, hf_idn_cfl, ett_cfl, channel_and_service_configuration_flags, ENC_BIG_ENDIAN); + sdm = get_service_match(tvb_get_uint8(tvb, offset)); offset += 1; - proto_tree_add_item(configuration_header_tree, idn_service_id, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(configuration_header_tree, hf_idn_service_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(configuration_header_tree, idn_service_mode, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(configuration_header_tree, hf_idn_service_mode, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; @@ -967,29 +969,29 @@ static int dissect_idn_channel_configuration(tvbuff_t *tvb, packet_info *pinfo, } static int dissect_idn_message_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree, message_info *minfo) { - guint8 cnl; + uint8_t cnl; static int * const cnl_data[] = { - &idn_most_significant_bit_cnl, - &idn_cclf, - &idn_channel_id, + &hf_idn_most_significant_bit_cnl, + &hf_idn_cclf, + &hf_idn_channel_id, NULL }; proto_tree *idn_channel_message_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 8, ett_idn_channel_message_header_tree, NULL, "Channel Message Header"); - proto_tree_add_item(idn_channel_message_header_tree, idn_total_size, tvb, offset, 2, ENC_BIG_ENDIAN); - minfo->total_size = tvb_get_guint16(tvb, offset, 2); + proto_tree_add_item(idn_channel_message_header_tree, hf_idn_total_size, tvb, offset, 2, ENC_BIG_ENDIAN); + minfo->total_size = tvb_get_uint16(tvb, offset, 2); offset += 2; - proto_tree_add_bitmask(idn_channel_message_header_tree, tvb, offset, idn_cnl, ett_idn_cnl, cnl_data, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(idn_channel_message_header_tree, tvb, offset, hf_idn_cnl, ett_idn_cnl, cnl_data, ENC_BIG_ENDIAN); - cnl = tvb_get_guint8(tvb, offset); + cnl = tvb_get_uint8(tvb, offset); minfo->has_config_header = cnl & 0x40; minfo->channel_id = cnl & 0x3f; offset += 1; - proto_tree_add_item(idn_channel_message_header_tree, idn_chunk_type, tvb, offset, 1, ENC_BIG_ENDIAN); - minfo->chunk_type = tvb_get_guint8(tvb, offset); + proto_tree_add_item(idn_channel_message_header_tree, hf_idn_chunk_type, tvb, offset, 1, ENC_BIG_ENDIAN); + minfo->chunk_type = tvb_get_uint8(tvb, offset); offset += 1; - proto_tree_add_item(idn_channel_message_header_tree, idn_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_channel_message_header_tree, hf_idn_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; return offset; @@ -1018,7 +1020,7 @@ static int dissect_idn_message(tvbuff_t *tvb, packet_info *pinfo, int offset, pr } if(minfo->chunk_type != IDNCT_VOID && minfo->chunk_type != IDNCT_LP_FRAME_SF) { - scm = get_service_match(tvb_get_guint8(tvb, offset)); + scm = get_service_match(tvb_get_uint8(tvb, offset)); offset = dissect_idn_chunk_header(tvb, offset, idn_tree, minfo); @@ -1042,9 +1044,9 @@ static int dissect_idn_message(tvbuff_t *tvb, packet_info *pinfo, int offset, pr } static int dissect_idn_servicemap_entry(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { - guint8 service_id = tvb_get_guint8(tvb, offset); + uint8_t service_id = tvb_get_uint8(tvb, offset); proto_tree *idn_servicemap_entry_tree = NULL; - gchar *name = (gchar *)tvb_get_string_enc(wmem_file_scope(), tvb, offset+4, 20, ENC_ASCII); + char *name = (char *)tvb_get_string_enc(wmem_file_scope(), tvb, offset+4, 20, ENC_ASCII); char tree_title[MAX_BUFFER]; if(service_id == 0) { @@ -1055,37 +1057,37 @@ static int dissect_idn_servicemap_entry(tvbuff_t *tvb, int offset, proto_tree *i idn_servicemap_entry_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 24, ett_idn_header_tree, NULL, tree_title); } - proto_tree_add_item(idn_servicemap_entry_tree, idn_service_id, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_servicemap_entry_tree, hf_idn_service_id, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_servicemap_entry_tree, idn_service_mode, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_servicemap_entry_tree, hf_idn_service_mode, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_servicemap_entry_tree, idn_flags, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_servicemap_entry_tree, hf_idn_flags, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_servicemap_entry_tree, idn_relay_number, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_servicemap_entry_tree, hf_idn_relay_number, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_servicemap_entry_tree, idn_name, tvb, offset, 20, ENC_ASCII); + proto_tree_add_item(idn_servicemap_entry_tree, hf_idn_name, tvb, offset, 20, ENC_ASCII); offset += 20; return offset; } -static int dissect_idn_servicemap_response_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree, guint8 *relay_count, guint8 *service_count) { +static int dissect_idn_servicemap_response_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree, uint8_t *relay_count, uint8_t *service_count) { proto_tree *idn_servicemap_response_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 4, ett_idn_header_tree, NULL, "Service Map Response Header"); - proto_tree_add_item(idn_servicemap_response_header_tree, idn_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_servicemap_response_header_tree, hf_idn_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_servicemap_response_header_tree, idn_entry_size, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_servicemap_response_header_tree, hf_idn_entry_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - *relay_count = tvb_get_guint8(tvb, offset); - proto_tree_add_item(idn_servicemap_response_header_tree, idn_relay_count, tvb, offset, 1, ENC_BIG_ENDIAN); + *relay_count = tvb_get_uint8(tvb, offset); + proto_tree_add_item(idn_servicemap_response_header_tree, hf_idn_relay_count, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - *service_count = tvb_get_guint8(tvb, offset); - proto_tree_add_item(idn_servicemap_response_header_tree, idn_service_count, tvb, offset, 1, ENC_BIG_ENDIAN); + *service_count = tvb_get_uint8(tvb, offset); + proto_tree_add_item(idn_servicemap_response_header_tree, hf_idn_service_count, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; return offset; } static int dissect_idn_servicemap_response(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { - guint8 relay_count, service_count; - guint16 map_entries_size; + uint8_t relay_count, service_count; + uint16_t map_entries_size; offset = dissect_idn_servicemap_response_header(tvb, offset, idn_tree, &relay_count, &service_count); map_entries_size = relay_count + service_count; @@ -1098,55 +1100,55 @@ static int dissect_idn_servicemap_response(tvbuff_t *tvb, int offset, proto_tree static int dissect_idn_scan_response(tvbuff_t *tvb, int offset, proto_tree *idn_tree) { static int * const protocol_version[] = { - &idn_protocol_version_major, - &idn_protocol_version_minor, + &hf_idn_protocol_version_major, + &hf_idn_protocol_version_minor, NULL }; static int * const status[] = { - &idn_malfn, - &idn_offline, - &idn_xcld, - &idn_ocpd, - &idn_three_bits_reserved, - &idn_rt, + &hf_idn_malfn, + &hf_idn_offline, + &hf_idn_xcld, + &hf_idn_ocpd, + &hf_idn_three_bits_reserved, + &hf_idn_rt, NULL }; proto_tree *idn_scanreply_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, 40, ett_idn_header_tree, NULL, "Scan Response"); - proto_tree_add_item(idn_scanreply_header_tree, idn_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_scanreply_header_tree, hf_idn_struct_size, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_bitmask(idn_scanreply_header_tree, tvb, offset, idn_protocol_version, ett_protocol_version, protocol_version, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(idn_scanreply_header_tree, tvb, offset, hf_idn_protocol_version, ett_protocol_version, protocol_version, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_bitmask(idn_scanreply_header_tree, tvb, offset, idn_status, ett_status, status, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(idn_scanreply_header_tree, tvb, offset, hf_idn_status, ett_status, status, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_scanreply_header_tree, idn_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_scanreply_header_tree, hf_idn_reserved8, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_scanreply_header_tree, idn_unit_id, tvb, offset, 16, ENC_NA); + proto_tree_add_item(idn_scanreply_header_tree, hf_idn_unit_id, tvb, offset, 16, ENC_NA); offset += 16; - proto_tree_add_item(idn_scanreply_header_tree, idn_name, tvb, offset, 20, ENC_ASCII); + proto_tree_add_item(idn_scanreply_header_tree, hf_idn_name, tvb, offset, 20, ENC_ASCII); offset += 20; return offset; } -static int dissect_idn_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree, guint8 packet_type) { +static int dissect_idn_header(tvbuff_t *tvb, int offset, proto_tree *idn_tree, uint8_t packet_type) { proto_tree *idn_header_tree = proto_tree_add_subtree(idn_tree, tvb, offset, -1, ett_idn_header_tree, NULL, "IDN Header"); - proto_tree_add_item(idn_header_tree, idn_command, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_header_tree, hf_idn_command, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; if(packet_type == IDNCMD_VOID || packet_type == IDNCMD_PING_RESPONSE) { proto_item_set_len(idn_header_tree, offset); return offset; } - proto_tree_add_item(idn_header_tree, idn_flags, tvb, offset, 1, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_header_tree, hf_idn_flags, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(idn_header_tree, idn_sequence, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(idn_header_tree, hf_idn_sequence, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; proto_item_set_len(idn_header_tree, offset); return offset; } static int dissect_idn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - gint offset = 0; - guint8 packet_type = tvb_get_guint8(tvb, 0); + int offset = 0; + uint8_t packet_type = tvb_get_uint8(tvb, 0); proto_item *ti = proto_tree_add_item(tree, proto_idn, tvb, 0, -1, ENC_NA); proto_tree *idn_tree = proto_item_add_subtree(ti, ett_idn); @@ -1181,517 +1183,517 @@ static int dissect_idn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void void proto_register_idn(void) { static hf_register_info hf[] = { - { &idn_command, + { &hf_idn_command, { "Command code", "idn.command", FT_UINT8, BASE_HEX, VALS(command_code), 0x0, NULL, HFILL } }, - { &idn_flags, + { &hf_idn_flags, { "Flags", "idn.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_sequence, + { &hf_idn_sequence, { "Sequence counter", "idn.sequence", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_total_size, + { &hf_idn_total_size, { "Total Size", "idn.total_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_struct_size, + { &hf_idn_struct_size, { "Struct Size", "idn.struct_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_protocol_version, + { &hf_idn_protocol_version, { "Protocol Version", "idn.protocol_version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_protocol_version_major, + { &hf_idn_protocol_version_major, { "Major", "idn.protocol_version_major", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, - { &idn_protocol_version_minor, - { "Minor", "idn.idn_protocol_version_minor", + { &hf_idn_protocol_version_minor, + { "Minor", "idn.protocol_version_minor", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL } }, - { &idn_status, + { &hf_idn_status, { "Status", "idn.status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_malfn, + { &hf_idn_malfn, { "Malfunction", "idn.status_malfn", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL } }, - { &idn_offline, + { &hf_idn_offline, { "Offline", "idn.offline", FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL } }, - { &idn_xcld, + { &hf_idn_xcld, { "Excluded", "idn.xcld", FT_UINT8, BASE_DEC, NULL, 0x20, NULL, HFILL } }, - { &idn_ocpd, + { &hf_idn_ocpd, { "Occupied", "idn.ocpd", FT_UINT8, BASE_DEC, NULL, 0x10, NULL, HFILL } }, - { &idn_rt, + { &hf_idn_rt, { "Realtime", "idn.rt", FT_UINT8, BASE_DEC, NULL, 0x1, NULL, HFILL } }, - { &idn_reserved8, + { &hf_idn_reserved8, { "Reserved", "idn.reserved8", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_unit_id, + { &hf_idn_unit_id, { "Unit ID", "idn.unit_id", FT_BYTES, SEP_SPACE, NULL, 0x0, NULL, HFILL } }, - { &idn_name, + { &hf_idn_name, { "Name", "idn.name", - FT_STRING, ENC_ASCII, + FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, - { &idn_entry_size, + { &hf_idn_entry_size, { "Entry Size", "idn.entry_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_relay_count, + { &hf_idn_relay_count, { "Relay Count", "idn.relay_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_service_count, + { &hf_idn_service_count, { "Service Count", "idn.service_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_cnl, + { &hf_idn_cnl, { "Channel configuration and routing information (CNL)", "idn.cnl", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_most_significant_bit_cnl, + { &hf_idn_most_significant_bit_cnl, { "Most significant bit (always 1)", "idn.most_significant_bit_cnl", FT_UINT8, BASE_DEC, NULL, 0x80, NULL, HFILL } }, - { &idn_cclf, + { &hf_idn_cclf, { "Channel Configuration and Last Fragment bit (CCLF)", "idn.cclf", FT_UINT8, BASE_DEC, NULL, 0x40, NULL, HFILL } }, - { &idn_channel_id, + { &hf_idn_channel_id, { "Channel ID (opened Channels)", "idn.channel_id", FT_UINT8, BASE_DEC, NULL, 0x3F, NULL, HFILL } }, - { &idn_chunk_type, + { &hf_idn_chunk_type, { "Chunk Type", "idn.chunk_type", FT_UINT8, BASE_HEX, VALS(chunk_type), 0x0, NULL, HFILL } }, - { &idn_timestamp, + { &hf_idn_timestamp, { "Timestamp", "idn.timestamp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_scwc, + { &hf_idn_scwc, { "Service Configuration Word Count (SCWC)", "idn.scwc", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_cfl, + { &hf_idn_cfl, { "Channel and service configuration Flags (CFL)", "idn.cfl", FT_UINT8, BASE_HEX, VALS(cfl_string), 0x0, NULL, HFILL } }, - { &idn_sdm, + { &hf_idn_sdm, { "Service Data Match (SDM)", "idn.sdm", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, - { &idn_close, + { &hf_idn_close, { "Close", "idn.close", FT_UINT8, BASE_DEC, NULL, 0x2, NULL, HFILL } }, - { &idn_routing, + { &hf_idn_routing, { "Routing", "idn.routing", FT_UINT8, BASE_DEC, NULL, 0x1, NULL, HFILL } }, - { &idn_service_id, + { &hf_idn_service_id, { "Service ID", "idn.service_id", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_relay_number, + { &hf_idn_relay_number, { "Relay Number", "idn.relay_number", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_service_mode, + { &hf_idn_service_mode, { "Service Mode", "idn.service_mode", FT_UINT8, BASE_HEX, VALS(service_mode_string), 0x0, NULL, HFILL } }, - { &idn_chunk_header_flags, + { &hf_idn_chunk_header_flags, { "Chunk Header Flags", "idn.chunk_header_flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_two_bits_reserved_1, + { &hf_idn_two_bits_reserved_1, { "Reserved", "idn.zero_zero", FT_UINT8, BASE_DEC, NULL, 0xC0, NULL, HFILL } }, - { &idn_two_bits_reserved_2, + { &hf_idn_two_bits_reserved_2, { "Reserved", "idn.zero_zero", FT_UINT8, BASE_DEC, NULL, 0xC, NULL, HFILL } }, - { &idn_scm, + { &hf_idn_scm, { "Service configuration match (SCM)", "idn.scm", FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL } }, - { &idn_three_bits_reserved, + { &hf_idn_three_bits_reserved, { "Reserved", "idn.three_bit_reserved", FT_UINT8, BASE_DEC, NULL, 0xE, NULL, HFILL } }, - { &idn_four_bits_reserved, + { &hf_idn_four_bits_reserved, { "Reserved", "idn.three_bit_reserved", FT_UINT8, BASE_DEC, NULL, 0xF, NULL, HFILL } }, - { &idn_once, + { &hf_idn_once, { "Once", "idn.once", FT_UINT8, BASE_DEC, NULL, 0x1, NULL, HFILL } }, - { &idn_dlim, + { &hf_idn_dlim, { "Delimiter (DLIM)", "idn.dlim", FT_UINT8, BASE_DEC, NULL, 0x1, NULL, HFILL } }, - { &idn_duration, + { &hf_idn_duration, { "Duration", "idn.frame_sample_duration", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_chunk_data_sequence, + { &hf_idn_chunk_data_sequence, { "Sequence", "idn.octet_segment_sequence", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_offset, - { "Offset", "idn.octet_segment_sequence", + { &hf_idn_offset, + { "Offset", "idn.offset", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_reserved, + { &hf_idn_reserved, { "Reserved", "idn.reserved", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts, + { &hf_idn_gts, { "Unknown", "idn.unknown", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_void, + { &hf_idn_gts_void, { "Void", "idn.gts_void", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_boundary, + { &hf_idn_boundary, { "Void (32-bit boundary)", "idn.gts_boundary", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_word, + { &hf_idn_gts_word, { "16-bit word", "idn.gts_word", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_break, + { &hf_idn_gts_break, { "Break", "idn.gts_break", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_space_modifier, + { &hf_idn_gts_space_modifier, { "Space Modifier", "idn.gts_space_modifier", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_hint, + { &hf_idn_gts_hint, { "Hint", "idn.gts_hint", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_category, + { &hf_idn_gts_category, { "Category", "idn.gts_category", FT_UINT16, BASE_DEC, NULL, 0xF000, NULL, HFILL } }, - { &idn_gts_subcategory, + { &hf_idn_gts_subcategory, { "Subcategory", "idn.gts_subcategory", FT_UINT16, BASE_DEC, - NULL, 0xF00, + NULL, 0x0F00, NULL, HFILL } }, - { &idn_gts_identifier, + { &hf_idn_gts_identifier, { "Identifier", "idn.gts_identifier", FT_UINT16, BASE_DEC, - NULL, 0xF0, + NULL, 0x00F0, NULL, HFILL } }, - { &idn_gts_parameter, + { &hf_idn_gts_parameter, { "Parameter", "idn.gts_parameter", FT_UINT16, BASE_DEC, - NULL, 0xF, + NULL, 0x000F, NULL, HFILL } }, - { &idn_gts_glin, + { &hf_idn_gts_glin, { "Graphic Space Linearity (GLIN)", "idn.gts_glin", FT_UINT16, BASE_DEC, - VALS(gts_glin), 0xC0, + VALS(gts_glin), 0x00C0, NULL, HFILL } }, - { &idn_gts_clin, + { &hf_idn_gts_clin, { "Color Space Linearity (CLIN)", "idn.gts_clin", FT_UINT16, BASE_DEC, - VALS(gts_clin), 0x30, + VALS(gts_clin), 0x0030, NULL, HFILL } }, - { &idn_gts_cbal, + { &hf_idn_gts_cbal, { "Color Balance (CBAL)", "idn.gts_cbal", FT_UINT16, BASE_DEC, - VALS(gts_cbal), 0xC, + VALS(gts_cbal), 0x000C, NULL, HFILL } }, - { &idn_gts_ctim, + { &hf_idn_gts_ctim, { "Color Timing (CTIM)", "idn.gts_ctim", FT_UINT16, BASE_DEC, - VALS(gts_ctim), 0x3, + VALS(gts_ctim), 0x0003, NULL, HFILL } }, - { &idn_gts_nop, + { &hf_idn_gts_nop, { "No Operation (NOP)", "idn.gts_nop", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_precision, + { &hf_idn_gts_precision, { "Precision", "idn.gts_precision", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_cscl, + { &hf_idn_gts_cscl, { "Color scale (CSCL)", "idn.gts_cscl", FT_UINT16, BASE_DEC, - NULL, 0xC0, + NULL, 0x00C0, NULL, HFILL } }, - { &idn_gts_iscl, + { &hf_idn_gts_iscl, { "Intensity scale (ISCL)", "idn.gts_iscl", FT_UINT16, BASE_DEC, - NULL, 0x30, + NULL, 0x0030, NULL, HFILL } }, - { &idn_gts_sht, + { &hf_idn_gts_sht, { "Shutter (SHT)", "idn.gts_sht", FT_UINT16, BASE_DEC, - NULL, 0xF, + NULL, 0x000F, NULL, HFILL } }, - { &idn_gts_u4, + { &hf_idn_gts_u4, { "Optional(U4), used as X-prime", "idn.gts_u4", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_x, + { &hf_idn_gts_x, { "X", "idn.gts_x", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_y, + { &hf_idn_gts_y, { "Y", "idn.gts_y", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_z, + { &hf_idn_gts_z, { "Z", "idn.gts_z", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_color, + { &hf_idn_gts_color, { "Color", "idn.gts_color", FT_UINT16, BASE_DEC, - VALS(idn_color), 0x3FF, + VALS(idn_color), 0x03FF, NULL, HFILL } }, - { &idn_gts_wavelength_prefix, + { &hf_idn_gts_wavelength_prefix, { "Wavelength Prefix", "idn.gts_wavelength_prefix", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_intensity, + { &hf_idn_gts_intensity, { "Intensity/blanking", "idn.gts_intensity", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_beam_brush, + { &hf_idn_gts_beam_brush, { "Beam-Brush", "idn.gts_beam_brush", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_gts_sample, + { &hf_idn_gts_sample, { "Sample", "idn.gts_sample", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_dmx_octet, + { &hf_idn_dmx_octet, { "Octet", "idn.gts_octet", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_dmx_identifier, + { &hf_idn_dmx_identifier, { "Identifier", "idn.gts_dmx_identifier", FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL } }, - { &idn_dmx_parameter, + { &hf_idn_dmx_parameter, { "Parameter", "idn.gts_dmx_parameter", FT_UINT8, BASE_DEC, - NULL, 0xF, + NULL, 0x0F, NULL, HFILL } }, - { &idn_dmx_void, + { &hf_idn_dmx_void, { "Void", "idn.gts_dmx_void", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_octet, + { &hf_idn_octet, { "Octet", "idn.gts_dmx_octet", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_dmx_dls, + { &hf_idn_dmx_dls, { "Dimmer Level Subset", "idn.dmx_dls", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_dmx_base, + { &hf_idn_dmx_base, { "Base", "idn.dmx_base", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_dmx_count, + { &hf_idn_dmx_count, { "Count", "idn.dmx_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, - { &idn_dmx_unknown, + { &hf_idn_dmx_unknown, { "Unknown", "idn.dmx_unknown", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, - { &idn_result_code, + { &hf_idn_result_code, { "Result Code", "idn.result_code", FT_UINT8, BASE_DEC, VALS(result_code), 0x0, NULL, HFILL } }, - { &idn_event_flags, + { &hf_idn_event_flags, { "Event Flags", "idn.event_flags", FT_UINT16, BASE_HEX, NULL, 0x0, @@ -1699,7 +1701,7 @@ void proto_register_idn(void) { } }; - static gint *ett[] = { + static int *ett[] = { &ett_idn, &ett_idn_header_tree, &ett_idn_scanreply_header_tree, |