aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee17221.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-03-23 01:18:06 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-03-23 01:18:06 +0000
commita7f0f546125ad293eb88ed48416ea8acf74b9cb2 (patch)
treeddd282ad197e953349be987cfd8d33b3652ac504 /epan/dissectors/packet-ieee17221.c
parent659d9535aac906c337c2d943aee205a81e54d973 (diff)
From Tom Bottom via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6887 :
Address comments in the bug: fix up some hf issues and use proto_item_set_len() when necessary. Added status field dissection to AEM packets. From me: hf_aem_frequency is an FT_FLOAT and appears to have a length of 4 so use that length (instead of 5). svn path=/trunk/; revision=41742
Diffstat (limited to 'epan/dissectors/packet-ieee17221.c')
-rw-r--r--epan/dissectors/packet-ieee17221.c108
1 files changed, 26 insertions, 82 deletions
diff --git a/epan/dissectors/packet-ieee17221.c b/epan/dissectors/packet-ieee17221.c
index d668505116..3a544e26a1 100644
--- a/epan/dissectors/packet-ieee17221.c
+++ b/epan/dissectors/packet-ieee17221.c
@@ -147,7 +147,7 @@
#define ACMP_CD_OFFSET 0
#define ACMP_VERSION_OFFSET 1
#define ACMP_STATUS_FIELD_OFFSET 2
-#define ACMP_CD_LENGTH_OFFSET 3
+#define ACMP_CD_LENGTH_OFFSET 2
#define ACMP_STREAM_ID_OFFSET 4
#define ACMP_CONTROLLER_GUID_OFFSET 12
#define ACMP_TALKER_GUID_OFFSET 20
@@ -162,9 +162,9 @@
/* Bit Field Masks */
-#define ACMP_MSG_TYPE_MASK 0x0f
-#define ACMP_STATUS_FIELD_MASK 0xf8
-#define ACMP_CD_LENGTH_MASK 0x07ff
+#define ACMP_MSG_TYPE_MASK 0x0F
+#define ACMP_STATUS_FIELD_MASK 0xF8
+#define ACMP_CD_LENGTH_MASK 0x07FF
/* message_type */
@@ -1572,7 +1572,6 @@ static int hf_aecp_control_user_l3 = -1;
static int hf_aecp_control_user_l4 = -1;
static int hf_aecp_controller_guid = -1;
static int hf_aecp_count = -1;
-static int hf_aecp_default_format_valid_flag = -1;
static int hf_aecp_descriptor_id = -1;
static int hf_aecp_descriptor_type = -1;
static int hf_aecp_descriptors = -1;
@@ -1602,12 +1601,10 @@ static int hf_aecp_gtpt_locked_valid = -1;
static int hf_aecp_ipv4_address = -1;
static int hf_aecp_ipv6_address = -1;
static int hf_aecp_key = -1;
-static int hf_aecp_key_count = -1;
static int hf_aecp_key_guid = -1;
static int hf_aecp_key_length = -1;
static int hf_aecp_key_number = -1;
static int hf_aecp_key_part = -1;
-static int hf_aecp_key_permissions = -1;
static int hf_aecp_keychain_id = -1;
static int hf_aecp_keytype = -1;
static int hf_aecp_locked_guid = -1;
@@ -1667,10 +1664,6 @@ static int hf_aecp_seq_num_mismatch_valid = -1;
static int hf_aecp_sequence_id = -1;
static int hf_aecp_signal_id = -1;
static int hf_aecp_signal_type = -1;
-static int hf_aecp_signature = -1;
-static int hf_aecp_signature_id = -1;
-static int hf_aecp_signature_info = -1;
-static int hf_aecp_signature_length = -1;
static int hf_aecp_srp_latency_violations = -1;
static int hf_aecp_srp_latency_violations_valid = -1;
static int hf_aecp_srp_refused = -1;
@@ -1693,7 +1686,6 @@ static int hf_aecp_unsupported_formats = -1;
static int hf_aecp_unsupported_formats_valid = -1;
static int hf_aecp_values = -1;
static int hf_aecp_values_count = -1;
-static int hf_aecp_values_list = -1;
/* ***************************************************************** */
/* AVDECC Entity Model (AEM) */
@@ -1733,7 +1725,6 @@ static int hf_aem_blob_size = -1;
static int hf_aem_block_latency = -1;
static int hf_aem_bpp = -1;
static int hf_aem_channel_count = -1;
-static int hf_aem_channel_format = -1;
static int hf_aem_channels = -1;
static int hf_aem_clock_source_flags = -1;
static int hf_aem_clock_source_id = -1;
@@ -1776,14 +1767,12 @@ static int hf_aem_ctrl_uint64 = -1;
static int hf_aem_ctrl_uint8 = -1;
static int hf_aem_ctrl_vals = -1;
static int hf_aem_current_configuration = -1;
-static int hf_aem_current_format = -1;
static int hf_aem_current_sample_rate = -1;
static int hf_aem_current_signal_id = -1;
static int hf_aem_current_signal_type = -1;
static int hf_aem_dbs = -1;
static int hf_aem_default_signal_id = -1;
static int hf_aem_default_signal_type = -1;
-static int hf_aem_descriptor_counts = -1;
static int hf_aem_descriptor_counts_count = -1;
static int hf_aem_descriptor_counts_offset = -1;
static int hf_aem_div = -1;
@@ -1888,8 +1877,6 @@ static int hf_aem_stream_name = -1;
static int hf_aem_stream_name_string = -1;
static int hf_aem_string = -1;
static int hf_aem_string_ref = -1;
-static int hf_aem_subtype = -1;
-static int hf_aem_supported_sample_rate = -1;
static int hf_aem_target_descriptor_id = -1;
static int hf_aem_target_descriptor_type = -1;
static int hf_aem_unit = -1;
@@ -2340,7 +2327,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
guint32 mr_offset;
guint16 mr_counter;
- gdouble frequency;
+ gfloat frequency;
gint freq_mult;
gint base_freq;
@@ -2549,7 +2536,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
mr_counter = tvb_get_ntohs(tvb, AUDIO_UNIT_OFFSET_SAMPLE_RATES_COUNT);
mr_subtree = proto_item_add_subtree(mr_item, ett_aem_sample_rates);;
mr_offset = AUDIO_UNIT_OFFSET_SAMPLE_RATES;
-
+ proto_item_set_len(mr_item, 4 * mr_counter);
/* loop to get the array values */
for(i = 0; i < mr_counter; ++i) {
proto_tree_add_item(mr_subtree, hf_aem_pull_field, tvb,
@@ -2570,7 +2557,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
freq_mult == 4 ? 54 / 24 : 0;
frequency *= base_freq;
- proto_tree_add_double(mr_subtree, hf_aem_frequency, tvb, mr_offset, 4, frequency);
+ proto_tree_add_float(mr_subtree, hf_aem_frequency, tvb, mr_offset, 4, frequency);
mr_offset += 4;
}
@@ -2681,6 +2668,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
mr_subtree = proto_item_add_subtree(mr_item, ett_aem_stream_formats);
mr_counter = tvb_get_ntohs(tvb, AEM_OFFSET_NUMBER_OF_FORMATS);
mr_offset = AEM_OFFSET_FORMATS;
+ proto_item_set_len(mr_item, mr_counter * 8);
for(i = 0; i < mr_counter; ++i) {
next_tvb = tvb_new_subset(tvb, mr_offset, 8, 8);
@@ -2902,6 +2890,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
mr_subtree = proto_item_add_subtree(mr_item, ett_aem_mappings);
mr_offset = AEM_OFFSET_MAPPINGS;
mr_counter = tvb_get_ntohs(tvb, AEM_OFFSET_NUMBER_OF_MAPPINGS);
+ proto_item_set_len(mr_item, mr_counter * 6);
for(i = 0; i < mr_counter; ++i) {
proto_tree_add_item(mr_subtree, hf_aem_mapping_stream_index, tvb,
@@ -3001,6 +2990,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
mr_subtree = proto_item_add_subtree(mr_item, ett_aem_sources);
mr_counter = tvb_get_ntohs(tvb, AEM_OFFSET_NUMBER_OF_SOURCES_SIGS);
mr_offset = SIGNAL_SELECTOR_OFFSET_SOURCES;
+ proto_item_set_len(mr_item, mr_counter * 4);
for(i = 0; i < mr_counter; ++i) {
proto_tree_add_item(mr_subtree, hf_aem_signal_type, tvb,
@@ -3033,7 +3023,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
proto_tree_add_item(aem_tree, hf_aem_block_latency, tvb,
MIXER_OFFSET_BLOCK_LATENCY, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(aem_tree, hf_aem_control_latency, tvb,
- MIXER_OFFSET_CONTROL_LATENCY, 2, ENC_BIG_ENDIAN);
+ MIXER_OFFSET_CONTROL_LATENCY, 4, ENC_BIG_ENDIAN);
/* set up subtree for sources */
mr_item = proto_tree_add_item(aem_tree, hf_aem_sources, tvb,
@@ -3041,6 +3031,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
mr_subtree = proto_item_add_subtree(mr_item, ett_aem_sources);
mr_counter = tvb_get_ntohs(tvb, AEM_OFFSET_NUMBER_OF_SOURCES_MXR);
mr_offset = MIXER_OFFSET_SOURCES;
+ proto_item_set_len(mr_item, mr_counter * 4);
for(i = 0; i < mr_counter; ++i) {
proto_tree_add_item(mr_subtree, hf_aem_signal_type, tvb,
@@ -3127,6 +3118,7 @@ dissect_17221_aem(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
mr_subtree = proto_item_add_subtree(mr_item, ett_aem_sources);
mr_counter = tvb_get_ntohs(tvb, MATRIX_SIGNAL_OFFSET_SIGNALS_COUNT);
mr_offset = MATRIX_SIGNAL_OFFSET_SIGNALS_OFFSET;
+ proto_item_set_len(mr_item, mr_counter * 4);
for(i = 0; i < mr_counter; ++i) {
proto_tree_add_item(mr_subtree, hf_aem_signal_type, tvb,
@@ -3185,8 +3177,12 @@ dissect_17221_aecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aecp_tree)
/* AEM Common Format Fields */
proto_tree_add_item(aecp_tree, hf_aecp_message_type, tvb,
AECP_VERSION_OFFSET, 1, ENC_BIG_ENDIAN);
+
+ proto_tree_add_item(aecp_tree, hf_acmp_status_field, tvb,
+ ACMP_STATUS_FIELD_OFFSET, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(aecp_tree, hf_aecp_cd_length, tvb,
AECP_CD_LENGTH_OFFSET, 2, ENC_BIG_ENDIAN);
+
proto_tree_add_item(aecp_tree, hf_aecp_target_guid, tvb,
AECP_TARGET_GUID_OFFSET, 8, ENC_BIG_ENDIAN);
proto_tree_add_item(aecp_tree, hf_aecp_controller_guid, tvb,
@@ -3330,7 +3326,7 @@ dissect_17221_aecp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *aecp_tree)
proto_tree_add_item(aecp_tree, hf_aecp_matrix_value_count, tvb,
AECP_MATRIX_VALUE_COUNT_OFFSET, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(aecp_tree, hf_aecp_matrix_item_offset, tvb,
- AECP_MATRIX_ITEM_OFFSET_OFFSET, 3, ENC_BIG_ENDIAN);
+ AECP_MATRIX_ITEM_OFFSET_OFFSET, 2, ENC_BIG_ENDIAN);
if (mess_type == AECP_AEM_RESPONSE_MESSAGE) {
proto_tree_add_item(aecp_tree, hf_aecp_matrix_affected_item_count, tvb,
@@ -3992,7 +3988,7 @@ dissect_17221_acmp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *acmp_tree)
proto_tree_add_item(acmp_tree, hf_acmp_message_type, tvb, ACMP_VERSION_OFFSET, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(acmp_tree, hf_acmp_status_field, tvb, ACMP_STATUS_FIELD_OFFSET, 1, ENC_BIG_ENDIAN);
- proto_tree_add_item(acmp_tree, hf_acmp_cd_length, tvb, ACMP_CD_LENGTH_OFFSET, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(acmp_tree, hf_acmp_cd_length, tvb, ACMP_CD_LENGTH_OFFSET, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(acmp_tree, hf_acmp_stream_id, tvb, ACMP_STREAM_ID_OFFSET, 8, ENC_BIG_ENDIAN);
proto_tree_add_item(acmp_tree, hf_acmp_controller_guid, tvb, ACMP_CONTROLLER_GUID_OFFSET, 8, ENC_BIG_ENDIAN);
proto_tree_add_item(acmp_tree, hf_acmp_talker_guid, tvb, ACMP_TALKER_GUID_OFFSET, 8, ENC_BIG_ENDIAN);
@@ -4419,19 +4415,19 @@ proto_register_17221(void)
/* ACMP Flags Begin */
{ &hf_acmp_flags_class_b,
{ "CLASS_B", "ieee17221.flags.class_b",
- FT_BOOLEAN, 8, NULL, ACMP_FLAG_CLASS_B_BITMASK, NULL, HFILL }
+ FT_BOOLEAN, 16, NULL, ACMP_FLAG_CLASS_B_BITMASK, NULL, HFILL }
},
{ &hf_acmp_flags_fast_connect,
{ "FAST_CONNECT", "ieee17221.flags.fast_connect",
- FT_BOOLEAN, 8, NULL, ACMP_FLAG_FAST_CONNECT_BITMASK, NULL, HFILL }
+ FT_BOOLEAN, 16, NULL, ACMP_FLAG_FAST_CONNECT_BITMASK, NULL, HFILL }
},
{ &hf_acmp_flags_saved_state,
{ "SAVED_STATE", "ieee17221.flags.saved_state",
- FT_BOOLEAN, 8, NULL, ACMP_FLAG_SAVED_STATE_BITMASK, NULL, HFILL }
+ FT_BOOLEAN, 16, NULL, ACMP_FLAG_SAVED_STATE_BITMASK, NULL, HFILL }
},
{ &hf_acmp_flags_streaming_wait,
{ "STREAMING_WAIT", "ieee17221.flags.streaming_wait",
- FT_BOOLEAN, 8, NULL, ACMP_FLAG_STREAMING_WAIT_BITMASK, NULL, HFILL }
+ FT_BOOLEAN, 16, NULL, ACMP_FLAG_STREAMING_WAIT_BITMASK, NULL, HFILL }
},
/* ACMP Flags End */
{ &hf_acmp_default_format,
@@ -4607,10 +4603,6 @@ proto_register_17221(void)
{"Dest MAC Valid Flag", "ieee17221.flags.dest_mac_valid",
FT_BOOLEAN, 32, NULL, AECP_DEST_MAC_VALID_FLAG_MASK, NULL, HFILL }
},
- { &hf_aecp_default_format_valid_flag,
- {"Default Format Valid Flag", "ieee17221.flags.default_format_valid",
- FT_BOOLEAN, 32, NULL, AECP_DEFAULT_FORMAT_VALID_FLAG_MASK, NULL, HFILL }
- },
/* SET_NAME / GET_NAME */
{ &hf_aecp_name_index,
@@ -4654,22 +4646,6 @@ proto_register_17221(void)
{"Key Length", "ieee17221.key_length",
FT_UINT16, BASE_DEC, NULL, AECP_KEY_LENGTH_MASK, NULL, HFILL }
},
- { &hf_aecp_signature_info,
- {"Signature Info", "ieee17221.signature_info",
- FT_UINT8, BASE_HEX, VALS(aecp_keychain_id_type_vals), AECP_SIGNATURE_INFO_MASK, NULL, HFILL }
- },
- { &hf_aecp_signature_id,
- {"Signature ID", "ieee17221.signature_id",
- FT_UINT16, BASE_HEX, NULL, AECP_SIGNATURE_ID_MASK, NULL, HFILL }
- },
- { &hf_aecp_signature_length,
- {"Signature Length", "ieee17221.signature_length",
- FT_UINT16, BASE_DEC, NULL, AECP_SIGNATURE_LENGTH_MASK, NULL, HFILL }
- },
- { &hf_aecp_key_permissions,
- {"Key Permissions", "ieee17221.key_permissions",
- FT_UINT32, BASE_HEX, NULL, 0x00, NULL, HFILL}
- },
{ &hf_aecp_private_key_read_flag,
{"Private Key Read Flag", "ieee17221.flags.private_key_read",
FT_BOOLEAN, 32, NULL, AECP_PRIVATE_KEY_READ_FLAG_MASK, NULL, HFILL }
@@ -4851,10 +4827,6 @@ proto_register_17221(void)
{"Key", "ieee17221.key",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
- { &hf_aecp_signature,
- {"Signature", "ieee17221.signature",
- FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
- },
{ &hf_aecp_auth_token,
{"Auth Token", "ieee17221.auth_token",
FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
@@ -5051,10 +5023,6 @@ proto_register_17221(void)
{"Values Count", "ieee17221.values_count",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
- { &hf_aecp_values_list,
- {"Values List", "ieee17221.values_list",
- FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
- },
/* START_OPERATION */
{ &hf_aecp_operation_id,
@@ -5079,10 +5047,6 @@ proto_register_17221(void)
},
/* AUTH_GET_KEY_COUNT */
- { &hf_aecp_key_count,
- {"Key Count", "ieee17221.key_count",
- FT_UINT16, BASE_DEC, NULL, AECP_KEY_COUNT_MASK, NULL, HFILL }
- },
/* * AVDECC ENTITY MODEL DESCRIPTOR FIELDS * */
@@ -5167,10 +5131,6 @@ proto_register_17221(void)
{"Descriptor Counts Offset", "ieee17221.descriptor_counts_offset",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
- { &hf_aem_descriptor_counts,
- {"Descriptor Counts", "ieee17221.descriptor_counts",
- FT_BYTES, BASE_NONE, NULL, 0x00, NULL, HFILL }
- },
{ &hf_aem_count,
{"Count", "ieee17221.count",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
@@ -5282,10 +5242,6 @@ proto_register_17221(void)
{"Sample Rates Count", "ieee17221.sample_rates_count",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
- { &hf_aem_supported_sample_rate,
- {"Supported Sample Rate", "ieee17221.supported_sample_rate",
- FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }
- },
{ &hf_aem_sample_rates,
{"Sample Rates", "ieee17221.sample_rates",
FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }
@@ -5334,10 +5290,6 @@ proto_register_17221(void)
{"Stream Channels", "ieee17221.stream_channels",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
- { &hf_aem_channel_format,
- {"Channel Format", "ieee17221.channel_format",
- FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL }
- },
{ &hf_aem_formats_offset,
{"Formats Offset", "ieee17221.formats_offset",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
@@ -5414,7 +5366,7 @@ proto_register_17221(void)
},
{ &hf_aem_flags_captive,
{"Captive Flag", "ieee17221.flags.captive",
- FT_BOOLEAN, 32, NULL, AEM_CAPTIVE_FLAG_MASK, NULL, HFILL }
+ FT_BOOLEAN, 16, NULL, AEM_CAPTIVE_FLAG_MASK, NULL, HFILL }
},
{ &hf_aem_jack_type,
{"Jack Type", "ieee17221.jack_type",
@@ -5456,10 +5408,6 @@ proto_register_17221(void)
},
/* VIDEO_PORT_INPUT */
/* VIDEO_PORT_OUTPUT */
- { &hf_aem_current_format,
- {"Current Format", "ieee17221.current_format",
- FT_UINT64, BASE_HEX, NULL, 0x00, NULL, HFILL }
- },
{ & hf_aem_stream_id,
{"Stream Descriptor ID", "ieee17221.stream_descriptor_id",
FT_UINT16, BASE_DEC, NULL, 0x00, NULL, HFILL }
@@ -5826,7 +5774,7 @@ proto_register_17221(void)
},
{ &hf_aem_frequency,
{"Frequency", "ieee17221.frequency",
- FT_DOUBLE, BASE_NONE, NULL, 0x00, NULL, HFILL }
+ FT_FLOAT, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
/* AEM MEDIA FORMAT FIELDS */
@@ -5835,7 +5783,7 @@ proto_register_17221(void)
*/
{ &hf_aem_oui24,
{"OUI-24", "ieee17221.oui24",
- FT_UINT32, BASE_HEX, NULL, AEM_MASK_OUI24, NULL, HFILL }
+ FT_UINT24, BASE_HEX, NULL, 0x00, NULL, HFILL }
},
{ &hf_aem_mfd_type,
{"MFD Type", "ieee17221.mfd_type",
@@ -5910,10 +5858,6 @@ proto_register_17221(void)
{"Version", "ieee17221.sf_version",
FT_UINT8, BASE_HEX, NULL, AEM_MASK_SF_VERSION, NULL, HFILL }
},
- { &hf_aem_subtype,
- {"Subtype", "ieee17221.sf_subtype",
- FT_UINT16, BASE_HEX, VALS(aem_stream_format_subtype_vals), AEM_MASK_SF_SUBTYPE, NULL, HFILL }
- },
{ &hf_aem_sf,
{"SF", "ieee17221.sf",
FT_BOOLEAN, 8, NULL, AEM_MASK_SF, NULL, HFILL }