diff options
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-3g-a11.c | 65 | ||||
-rw-r--r-- | epan/dissectors/packet-acn.c | 88 | ||||
-rw-r--r-- | epan/dissectors/packet-adwin-config.c | 92 | ||||
-rw-r--r-- | epan/dissectors/packet-adwin.c | 61 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-admin.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-chat.c | 17 | ||||
-rw-r--r-- | epan/dissectors/packet-aim-generic.c | 93 | ||||
-rw-r--r-- | epan/dissectors/packet-amr.c | 62 | ||||
-rw-r--r-- | epan/dissectors/packet-arp.c | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-atalk.c | 74 | ||||
-rw-r--r-- | epan/dissectors/packet-beep.c | 8 |
11 files changed, 342 insertions, 240 deletions
diff --git a/epan/dissectors/packet-3g-a11.c b/epan/dissectors/packet-3g-a11.c index 393115fe19..8617372ff8 100644 --- a/epan/dissectors/packet-3g-a11.c +++ b/epan/dissectors/packet-3g-a11.c @@ -98,6 +98,7 @@ static int hf_a11_vse_panid = -1; static int hf_a11_vse_srvopt = -1; static int hf_a11_vse_qosmode = -1; static int hf_a11_vse_pdit = -1; +static int hf_a11_vse_session_parameter = -1; static int hf_a11_vse_code = -1; static int hf_a11_vse_dormant = -1; static int hf_a11_vse_ehrpd_mode = -1; @@ -220,6 +221,10 @@ static gint ett_a11_aut_flow_profile_ids = -1; static gint ett_a11_bcmcs_entry = -1; static expert_field ei_a11_sub_type_length_not2 = EI_INIT; +static expert_field ei_a11_sse_too_short = EI_INIT; +static expert_field ei_a11_bcmcs_too_short = EI_INIT; +static expert_field ei_a11_entry_data_not_dissected = EI_INIT; +static expert_field ei_a11_session_data_not_dissected = EI_INIT; /* Port used for Mobile IP based Tunneling Protocol (A11) */ #define UDP_PORT_3GA11 699 @@ -545,7 +550,7 @@ static const value_string a11_ses_msid_type_vals[] = }; static void -decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) +decode_sse(proto_tree *ext_tree, packet_info *pinfo, tvbuff_t *tvb, int offset, guint ext_len, proto_item *ext_len_item) { guint8 msid_len; guint8 msid_start_offset; @@ -557,7 +562,7 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) /* Decode Protocol Type */ if (ext_len < 2) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_sse_too_short, "Cannot decode Protocol Type - SSE too short"); return; } @@ -567,7 +572,7 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) /* Decode Session Key */ if (ext_len < 4) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_sse_too_short, "Cannot decode Session Key - SSE too short"); return; } @@ -578,7 +583,7 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) /* Decode Session Id Version */ if (ext_len < 2) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_sse_too_short, "Cannot decode Session Id Version - SSE too short"); return; } @@ -589,7 +594,7 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) /* Decode SRID */ if (ext_len < 2) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_sse_too_short, "Cannot decode SRID - SSE too short"); return; } @@ -599,7 +604,7 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) /* MSID Type */ if (ext_len < 2) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_sse_too_short, "Cannot decode MSID Type - SSE too short"); return; } @@ -610,7 +615,7 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) /* MSID Len */ if (ext_len < 1) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_sse_too_short, "Cannot decode MSID Length - SSE too short"); return; } @@ -621,7 +626,7 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) /* Decode MSID */ if (ext_len < msid_len) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_sse_too_short, "Cannot decode MSID - SSE too short"); return; } @@ -656,22 +661,18 @@ decode_sse(proto_tree *ext_tree, tvbuff_t *tvb, int offset, guint ext_len) p_msid = msid_digits + 1; } - - proto_tree_add_string - (ext_tree, hf_a11_ses_msid, tvb, msid_start_offset, msid_len, p_msid); - - return; + proto_tree_add_string(ext_tree, hf_a11_ses_msid, tvb, msid_start_offset, msid_len, p_msid); } static void -decode_bcmcs(proto_tree* ext_tree, tvbuff_t* tvb, int offset, guint ext_len) +decode_bcmcs(proto_tree* ext_tree, packet_info *pinfo, tvbuff_t* tvb, int offset, guint ext_len, proto_item *ext_len_item) { guint8 bc_stype, entry_len; /* Decode Protocol Type */ if (ext_len < 2) { - proto_tree_add_text(ext_tree, tvb, offset, 0, + expert_add_info_format(pinfo, ext_len_item, &ei_a11_bcmcs_too_short, "Cannot decode Protocol Type - BCMCS too short"); return; } @@ -699,13 +700,13 @@ decode_bcmcs(proto_tree* ext_tree, tvbuff_t* tvb, int offset, guint ext_len) ett_a11_bcmcs_entry, NULL, "BCMCS Information Entry %u", i); proto_tree_add_item(entry_tree, hf_a11_bcmcs_entry_len, tvb, offset, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(ext_tree, tvb, offset, entry_len -1, "Entry Data, Not dissected yet"); + proto_tree_add_expert(ext_tree, pinfo, &ei_a11_entry_data_not_dissected, tvb, offset, entry_len -1); offset = offset+entry_len; } } break; default: - proto_tree_add_text(ext_tree, tvb, offset, -1, "Session Data Type %u Not dissected yet",bc_stype); + proto_tree_add_expert_format(ext_tree, pinfo, &ei_a11_session_data_not_dissected, tvb, offset, -1, "Session Data Type %u Not dissected yet", bc_stype); return; break; } @@ -1038,8 +1039,6 @@ dissect_fwd_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) proto_tree *exts_tree1 = proto_tree_add_subtree(flow_tree, tvb, offset+clen,requested_qos_len, ett_a11_fqi_requestedqos, NULL, "Forward Requested QoS "); - proto_tree_add_text(exts_tree1, tvb, offset+clen, requested_qos_len, "Forward Requested QoS Sub Blob"); - /* Flow Priority */ proto_tree_add_item(exts_tree1, hf_a11_fqi_flow_priority, tvb,offset+clen , 1, ENC_BIG_ENDIAN); @@ -1079,8 +1078,6 @@ dissect_fwd_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) exts_tree3 = proto_tree_add_subtree(flow_tree, tvb, offset+clen, granted_qos_len, ett_a11_fqi_grantedqos, NULL, "Forward Granted QoS "); - proto_tree_add_text(exts_tree3, tvb, offset+clen, granted_qos_len, "Forward Granted QoS Sub Blob"); - /* QoS attribute setid */ proto_tree_add_item(exts_tree3, hf_a11_fqi_qos_granted_attribute_setid, tvb, offset+clen, 1, ENC_BIG_ENDIAN); clen++; @@ -1141,8 +1138,6 @@ dissect_rev_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) exts_tree1 = proto_tree_add_subtree(flow_tree, tvb, offset+clen,requested_qos_len, ett_a11_rqi_requestedqos, NULL, "Reverse Requested QoS "); - proto_tree_add_text(exts_tree1, tvb, offset+clen, requested_qos_len, "Reverse Requested QoS Sub Blob"); - /* Flow Priority */ proto_tree_add_item(exts_tree1, hf_a11_rqi_flow_priority, tvb,offset+clen , 1, ENC_BIG_ENDIAN); @@ -1181,8 +1176,6 @@ dissect_rev_qosinfo(tvbuff_t *tvb, int offset, proto_tree *ext_tree) exts_tree3 = proto_tree_add_subtree(flow_tree, tvb, offset+clen,granted_qos_len, ett_a11_rqi_grantedqos, NULL, "Reverse Granted QoS "); - proto_tree_add_text(exts_tree3, tvb, offset+clen, granted_qos_len, "Reverse Granted QoS Sub Blob"); - /* QoS attribute setid */ proto_tree_add_item(exts_tree3, hf_a11_rqi_qos_granted_attribute_setid, tvb, offset+clen, 1, ENC_BIG_ENDIAN); clen++; @@ -1302,6 +1295,7 @@ dissect_a11_extensions( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tre { proto_tree *exts_tree; proto_tree *ext_tree; + proto_item *ext_len_item = NULL; guint ext_len; guint8 ext_type; guint8 ext_subtype = 0; @@ -1343,23 +1337,23 @@ dissect_a11_extensions( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tre offset += 1; if (ext_type == SS_EXT) { - proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len); + ext_len_item = proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len); offset += 1; } else if ((ext_type == CVSE_EXT) || (ext_type == OLD_CVSE_EXT)) { offset += 1; - proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len); + ext_len_item = proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 2, ext_len); offset += 2; } else if (ext_type != GEN_AUTH_EXT) { /* Another nasty hack since GEN_AUTH_EXT broke everything */ - proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len); + ext_len_item = proto_tree_add_uint(ext_tree, hf_a11_ext_len, tvb, offset, 1, ext_len); offset += 1; } switch (ext_type) { case SS_EXT: - decode_sse(ext_tree, tvb, offset, ext_len); + decode_sse(ext_tree, pinfo, tvb, offset, ext_len, ext_len_item); offset += ext_len; ext_len = 0; break; @@ -1491,7 +1485,7 @@ dissect_a11_extensions( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tre proto_tree_add_item(ext_tree, hf_a11_vse_pdit, tvb, offset, 1, ENC_BIG_ENDIAN); break; case 0x0802: - proto_tree_add_text(ext_tree, tvb, offset, -1, "Session Parameter - Always On"); + proto_tree_add_item(ext_tree, hf_a11_vse_session_parameter, tvb, offset, -1, ENC_NA); break; case 0x0803: proto_tree_add_item(ext_tree, hf_a11_vse_qosmode, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -1523,7 +1517,7 @@ dissect_a11_extensions( tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tre break; case BCMCS_EXT: - decode_bcmcs(ext_tree, tvb, offset, ext_len); + decode_bcmcs(ext_tree, pinfo, tvb, offset, ext_len, ext_len_item); offset += ext_len; ext_len = 0; break; @@ -2277,6 +2271,11 @@ proto_register_a11(void) FT_UINT8, BASE_HEX, VALS(a11_ext_nvose_pdsn_code), 0, NULL, HFILL } }, + { &hf_a11_vse_session_parameter, + { "Session Parameter - Always On", "a11.ext.session_parameter", + FT_NONE, BASE_NONE, NULL, 0, + NULL, HFILL } + }, { &hf_a11_vse_srvopt, { "Service Option", "a11.ext.srvopt", FT_UINT16, BASE_HEX, VALS(a11_ext_nvose_srvopt), 0, @@ -2727,6 +2726,10 @@ proto_register_a11(void) static ei_register_info ei[] = { { &ei_a11_sub_type_length_not2, { "a11.sub_type_length.bad", PI_PROTOCOL, PI_WARN, "Sub-Type Length should be at least 2", EXPFILL }}, + { &ei_a11_sse_too_short, { "a11.sse_too_short", PI_MALFORMED, PI_ERROR, "SSE too short", EXPFILL }}, + { &ei_a11_bcmcs_too_short, { "a11.bcmcs_too_short", PI_MALFORMED, PI_ERROR, "BCMCS too short", EXPFILL }}, + { &ei_a11_entry_data_not_dissected, { "a11.entry_data_not_dissected", PI_UNDECODED, PI_WARN, "Entry Data, Not dissected yet", EXPFILL }}, + { &ei_a11_session_data_not_dissected, { "a11.session_data_not_dissected", PI_UNDECODED, PI_WARN, "Session Data Type Not dissected yet", EXPFILL }}, }; expert_module_t* expert_a11; diff --git a/epan/dissectors/packet-acn.c b/epan/dissectors/packet-acn.c index d4a2183ded..f2893deab7 100644 --- a/epan/dissectors/packet-acn.c +++ b/epan/dissectors/packet-acn.c @@ -244,6 +244,10 @@ static int hf_acn_dmp_adt_d = -1; static int hf_acn_dmp_adt_x = -1; static int hf_acn_dmp_reason_code = -1; static int hf_acn_dmp_vector = -1; +static int hf_acn_dmp_actual_address = -1; +static int hf_acn_dmp_virtual_address = -1; +static int hf_acn_dmp_actual_address_first = -1; +static int hf_acn_dmp_virtual_address_first = -1; static int hf_acn_expiry = -1; static int hf_acn_first_memeber_to_ack = -1; static int hf_acn_first_missed_sequence = -1; @@ -275,6 +279,7 @@ static int hf_acn_reason_code = -1; static int hf_acn_reciprocal_channel = -1; static int hf_acn_refuse_code = -1; static int hf_acn_reliable_sequence_number = -1; +static int hf_acn_adhoc_expiry = -1; /* static int hf_acn_sdt_pdu = -1; */ static int hf_acn_sdt_vector = -1; static int hf_acn_dmx_vector = -1; @@ -294,6 +299,7 @@ static int hf_acn_dmx_2_first_property_address = -1; static int hf_acn_dmx_increment = -1; static int hf_acn_dmx_count = -1; static int hf_acn_dmx_2_start_code = -1; +static int hf_acn_dmx_data = -1; /* static int hf_acn_dmx_dmp_vector = -1; */ @@ -554,9 +560,9 @@ acn_add_channel_member_info_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree /******************************************************************************/ /* Add labeled expiry */ static guint32 -acn_add_expiry(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, const char *label) +acn_add_expiry(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int hf) { - proto_tree_add_text(tree, tvb, offset, 2, "%s %d", label, tvb_get_guint8(tvb, offset)); + proto_tree_add_item(tree, hf, tvb, offset, 2, ENC_NA); offset += 1; return offset; } @@ -725,9 +731,9 @@ acn_add_dmp_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int } /* of switch (A) */ if (adt->flags & ACN_DMP_ADT_FLAG_V) { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, "Virtual Address: 0x%X", adt->address); + proto_tree_add_uint(tree, hf_acn_dmp_virtual_address, tvb, start_offset, bytes_used, adt->address); } else { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, "Actual Address: 0x%X", adt->address); + proto_tree_add_uint(tree, hf_acn_dmp_actual_address, tvb, start_offset, bytes_used, adt->address); } break; @@ -765,12 +771,12 @@ acn_add_dmp_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int } /* of switch (A) */ if (adt->flags & ACN_DMP_ADT_FLAG_V) { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, - "Virtual Address first: 0x%X, inc: %d, count: %d", + proto_tree_add_uint_format_value(tree, hf_acn_dmp_virtual_address_first, tvb, start_offset, bytes_used, + adt->address, "0x%X, inc: %d, count: %d", adt->address, adt->increment, adt->count); } else { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, - "Actual Address first: 0x%X, inc: %d, count: %d", + proto_tree_add_uint_format_value(tree, hf_acn_dmp_actual_address_first, tvb, start_offset, bytes_used, + adt->address, "0x%X, inc: %d, count: %d", adt->address, adt->increment, adt->count); } break; @@ -809,12 +815,12 @@ acn_add_dmp_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int } /* of switch (A) */ if (adt->flags & ACN_DMP_ADT_FLAG_V) { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, - "Virtual Address first: 0x%X, inc: %d, count: %d", + proto_tree_add_uint_format_value(tree, hf_acn_dmp_virtual_address_first, tvb, start_offset, bytes_used, + adt->address, "0x%X, inc: %d, count: %d", adt->address, adt->increment, adt->count); } else { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, - "Actual Address first: 0x%X, inc: %d, count: %d", + proto_tree_add_uint_format_value(tree, hf_acn_dmp_actual_address_first, tvb, start_offset, bytes_used, + adt->address, "0x%X, inc: %d, count: %d", adt->address, adt->increment, adt->count); } break; @@ -853,12 +859,12 @@ acn_add_dmp_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int } /* of switch (A) */ if (adt->flags & ACN_DMP_ADT_FLAG_V) { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, - "Virtual Address first: 0x%X, inc: %d, count: %d", + proto_tree_add_uint_format_value(tree, hf_acn_dmp_virtual_address_first, tvb, start_offset, bytes_used, + adt->address, "0x%X, inc: %d, count: %d", adt->address, adt->increment, adt->count); } else { - proto_tree_add_text(tree, tvb, start_offset, bytes_used, - "Actual Address first: 0x%X, inc: %d, count: %d", + proto_tree_add_uint_format_value(tree, hf_acn_dmp_actual_address_first, tvb, start_offset, bytes_used, + adt->address, "0x%X, inc: %d, count: %d", adt->address, adt->increment, adt->count); } break; @@ -1623,7 +1629,7 @@ dissect_acn_sdt_wrapped_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree case ACN_SDT_VECTOR_CHANNEL_PARAMS: data_offset = acn_add_channel_parameter(tvb, pinfo, pdu_tree, data_offset); data_offset = acn_add_address(tvb, pinfo, pdu_tree, data_offset, "Ad-hoc Address:"); - /*data_offset =*/ acn_add_expiry(tvb, pinfo, pdu_tree, data_offset, "Ad-hoc Expiry:"); + /*data_offset =*/ acn_add_expiry(tvb, pinfo, pdu_tree, data_offset, hf_acn_adhoc_expiry); break; case ACN_SDT_VECTOR_LEAVE: /* nothing more */ @@ -1939,7 +1945,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, pdu_tree = proto_item_add_subtree(ti, ett_acn_dmx_data_pdu); /* Add flag item and tree */ - pi = proto_tree_add_uint(pdu_tree, hf_acn_pdu_flags, tvb, pdu_start, 1, pdu_flags); + pi = proto_tree_add_uint(pdu_tree, hf_acn_pdu_flags, tvb, pdu_start, 1, pdu_flags); flag_tree = proto_item_add_subtree(pi, ett_acn_pdu_flags); proto_tree_add_item(flag_tree, hf_acn_pdu_flag_l, tvb, pdu_start, 1, ENC_BIG_ENDIAN); proto_tree_add_item(flag_tree, hf_acn_pdu_flag_v, tvb, pdu_start, 1, ENC_BIG_ENDIAN); @@ -2064,9 +2070,6 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, tvb_get_guint8(tvb, data_offset+5)); /* add a header line */ - g_snprintf(buffer, BUFFER_SIZE, "%-10s: ", "Data..."); - - buf_ptr += 9; for (x=0; x<perline; x++) { buf_ptr = ltos((guint8)(x+1), buf_ptr, 10, ' ', min_char, FALSE); if ((x+1)==halfline) { @@ -2075,7 +2078,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, } } *buf_ptr = '\0'; - proto_tree_add_text(pdu_tree, tvb, data_offset, dmx_count, "%s", buffer); + proto_tree_add_string(pdu_tree, hf_acn_dmx_data, tvb, data_offset, dmx_count, buffer); /* start our line */ g_snprintf(buffer, BUFFER_SIZE, "001-%03d: ", perline); @@ -2098,7 +2101,7 @@ dissect_acn_dmx_data_pdu(guint32 protocol_id, tvbuff_t *tvb, packet_info *pinfo, if (item_cnt == perline || x == (end_offset-1)) { /* add leader... */ - proto_tree_add_text(pdu_tree, tvb, data_offset, item_cnt, "%s", buffer); + proto_tree_add_string_format(pdu_tree, hf_acn_dmx_data, tvb, data_offset, item_cnt, buffer, "%s", buffer); data_offset += perline; g_snprintf(buffer, BUFFER_SIZE, "%03d-%03d: ",total_cnt, total_cnt+perline); buf_ptr = buffer + 9; @@ -2436,7 +2439,7 @@ dissect_acn_sdt_base_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, in data_offset += 4; data_offset = acn_add_address(tvb, pinfo, pdu_tree, data_offset, "Destination Address:"); data_offset = acn_add_channel_parameter(tvb, pinfo, pdu_tree, data_offset); - /*data_offset =*/ acn_add_expiry(tvb, pinfo, pdu_tree, data_offset, "Ad-hoc Expiry:"); + /*data_offset =*/ acn_add_expiry(tvb, pinfo, pdu_tree, data_offset, hf_acn_adhoc_expiry); break; case ACN_SDT_VECTOR_JOIN_REFUSE: pi = proto_tree_add_item(pdu_tree, hf_acn_cid, tvb, data_offset, 16, ENC_BIG_ENDIAN); @@ -2874,6 +2877,31 @@ proto_register_acn(void) FT_UINT8, BASE_DEC, VALS(acn_dmp_vector_vals), 0x0, NULL, HFILL } }, + + { &hf_acn_dmp_actual_address, + { "Actual Address", "acn.dmp_actual_address", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + + { &hf_acn_dmp_virtual_address, + { "Virtual Address", "acn.dmp_virtual_address", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + + { &hf_acn_dmp_actual_address_first, + { "Actual Address First", "acn.dmp_actual_address_first", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + + { &hf_acn_dmp_virtual_address_first, + { "Virtual Address First", "acn.dmp_virtual_address_first", + FT_UINT32, BASE_HEX, NULL, 0x0, + NULL, HFILL } + }, + /* Expiry */ { &hf_acn_expiry, { "Expiry", "acn.expiry", @@ -3050,6 +3078,12 @@ proto_register_acn(void) FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL } }, + /* Ad-hoc Expiry */ + { &hf_acn_adhoc_expiry, + { "Ad-hoc Expiry", "acn.adhoc_expiry", + FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, /* SDT Vector */ { &hf_acn_sdt_vector, { "STD Vector", "acn.sdt_vector", @@ -3152,6 +3186,12 @@ proto_register_acn(void) "DMX Start Code", HFILL } }, + { &hf_acn_dmx_data, + { "Data", "acn.dmx.data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + /* Session Count */ #if 0 { &hf_acn_session_count, diff --git a/epan/dissectors/packet-adwin-config.c b/epan/dissectors/packet-adwin-config.c index a070dec911..8decb96b01 100644 --- a/epan/dissectors/packet-adwin-config.c +++ b/epan/dissectors/packet-adwin-config.c @@ -98,6 +98,8 @@ static int hf_adwin_config_description = -1; static int hf_adwin_config_dhcp = -1; static int hf_adwin_config_filename = -1; static int hf_adwin_config_filesize = -1; +static int hf_adwin_config_filetime = -1; +static int hf_adwin_config_updatetime = -1; static int hf_adwin_config_gateway = -1; static int hf_adwin_config_mac = -1; static int hf_adwin_config_netmask_count = -1; @@ -111,6 +113,8 @@ static int hf_adwin_config_reboot = -1; static int hf_adwin_config_scan_id = -1; static int hf_adwin_config_reply_broadcast = -1; static int hf_adwin_config_revision = -1; +static int hf_adwin_config_processor_type_raw = -1; +static int hf_adwin_config_system_type_raw = -1; static int hf_adwin_config_processor_type = -1; static int hf_adwin_config_system_type = -1; static int hf_adwin_config_server_ip = -1; @@ -127,6 +131,7 @@ static int hf_adwin_config_status_bootloader_receive = -1; static int hf_adwin_config_status_bootloader_reprogramming_done = -1; static int hf_adwin_config_status_eeprom_support = -1; static int hf_adwin_config_stream_length = -1; +static int hf_adwin_config_eeprom_support = -1; static int hf_adwin_config_timeout = -1; static int hf_adwin_config_timerresets = -1; static int hf_adwin_config_disk_free = -1; @@ -143,9 +148,20 @@ static gint ett_adwin_config_debug = -1; static void dissect_UDPStatus(tvbuff_t *tvb, proto_tree *adwin_tree) { - proto_tree *status_tree; proto_tree *debug_tree; - proto_item *st, *dt; + proto_item *dt; + + static const int * status_flags[] = { + &hf_adwin_config_status_bootloader, + &hf_adwin_config_status_reprogrammable, + &hf_adwin_config_status_configurable, + &hf_adwin_config_status_bootloader_boots, + &hf_adwin_config_status_bootloader_reprogrammable, + &hf_adwin_config_status_bootloader_receive, + &hf_adwin_config_status_bootloader_reprogramming_done, + &hf_adwin_config_status_eeprom_support, + NULL + }; if (! adwin_tree) return; @@ -157,16 +173,7 @@ dissect_UDPStatus(tvbuff_t *tvb, proto_tree *adwin_tree) proto_tree_add_item(adwin_tree, hf_adwin_config_pattern, tvb, 0, 4, ENC_BIG_ENDIAN); proto_tree_add_item(adwin_tree, hf_adwin_config_version, tvb, 4, 4, ENC_BIG_ENDIAN); - st = proto_tree_add_item(adwin_tree, hf_adwin_config_status, tvb, 8, 4, ENC_BIG_ENDIAN); - status_tree = proto_item_add_subtree(st, ett_adwin_config_status); - proto_tree_add_item(status_tree, hf_adwin_config_status_bootloader, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(status_tree, hf_adwin_config_status_reprogrammable, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(status_tree, hf_adwin_config_status_configurable, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(status_tree, hf_adwin_config_status_bootloader_boots, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(status_tree, hf_adwin_config_status_bootloader_reprogrammable, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(status_tree, hf_adwin_config_status_bootloader_receive, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(status_tree, hf_adwin_config_status_bootloader_reprogramming_done, tvb, 8, 4, ENC_BIG_ENDIAN); - proto_tree_add_item(status_tree, hf_adwin_config_status_eeprom_support, tvb, 8, 4, ENC_BIG_ENDIAN); + proto_tree_add_bitmask(adwin_tree, tvb, 8, hf_adwin_config_status, ett_adwin_config_status, status_flags, ENC_BIG_ENDIAN); proto_tree_add_item(adwin_tree, hf_adwin_config_server_version_beta, tvb, 12, 2, ENC_BIG_ENDIAN); proto_tree_add_item(adwin_tree, hf_adwin_config_server_version, tvb, 14, 2, ENC_BIG_ENDIAN); @@ -203,17 +210,17 @@ dissect_UDPExtStatus(tvbuff_t *tvb, proto_tree *adwin_tree) proto_tree_add_item(adwin_tree, hf_adwin_config_revision, tvb, 56, 8, ENC_ASCII|ENC_NA); /* add the processor type raw values to the tree, to allow filtering */ - proto_tree_add_item(adwin_tree, hf_adwin_config_processor_type, tvb, 64, 2, ENC_ASCII|ENC_NA); + proto_tree_add_item(adwin_tree, hf_adwin_config_processor_type_raw, tvb, 64, 2, ENC_ASCII|ENC_NA); /* add the processor type as a pretty printed string */ processor_type = tvb_get_string_enc(wmem_packet_scope(), tvb, 64, 2, ENC_ASCII|ENC_NA); processor_type = str_to_str(processor_type, processor_type_mapping, "Unknown (%s)"); - proto_tree_add_text(adwin_tree, tvb, 64, 2, "Processor Type: %s", processor_type); + proto_tree_add_string(adwin_tree, hf_adwin_config_processor_type, tvb, 64, 2, processor_type); /* add system type as raw value and pretty printed string */ - proto_tree_add_item(adwin_tree, hf_adwin_config_system_type, tvb, 66, 2, ENC_ASCII|ENC_NA); + proto_tree_add_item(adwin_tree, hf_adwin_config_system_type_raw, tvb, 66, 2, ENC_ASCII|ENC_NA); system_type = tvb_get_string_enc(wmem_packet_scope(), tvb, 66, 2, ENC_ASCII|ENC_NA); system_type = str_to_str(system_type, system_type_mapping, "Unknown (%s)"); - proto_tree_add_text(adwin_tree, tvb, 66, 2, "System Type: %s", system_type); + proto_tree_add_string(adwin_tree, hf_adwin_config_system_type, tvb, 66, 2, system_type); proto_tree_add_item(adwin_tree, hf_adwin_config_unused, tvb, 68, 364, ENC_NA); } @@ -246,17 +253,17 @@ dissect_UDPMessage(tvbuff_t *tvb, proto_tree *adwin_tree) proto_tree_add_item(adwin_tree, hf_adwin_config_revision, tvb, 88, 8, ENC_ASCII|ENC_NA); /* add the processor type raw values to the tree, to allow filtering */ - proto_tree_add_item(adwin_tree, hf_adwin_config_processor_type, tvb, 96, 2, ENC_ASCII|ENC_NA); + proto_tree_add_item(adwin_tree, hf_adwin_config_processor_type_raw, tvb, 96, 2, ENC_ASCII|ENC_NA); /* add the processor type as a pretty printed string */ processor_type = tvb_get_string_enc(wmem_packet_scope(), tvb, 96, 2, ENC_ASCII|ENC_NA); processor_type = str_to_str(processor_type, processor_type_mapping, "Unknown"); - proto_tree_add_text(adwin_tree, tvb, 96, 2, "Processor Type: %s", processor_type); + proto_tree_add_string(adwin_tree, hf_adwin_config_processor_type, tvb, 96, 2, processor_type); /* add system type as raw value and pretty printed string */ - proto_tree_add_item(adwin_tree, hf_adwin_config_system_type, tvb, 98, 2, ENC_ASCII|ENC_NA); + proto_tree_add_item(adwin_tree, hf_adwin_config_system_type_raw, tvb, 98, 2, ENC_ASCII|ENC_NA); system_type = tvb_get_string_enc(wmem_packet_scope(), tvb, 98, 2, ENC_ASCII|ENC_NA); system_type = str_to_str(system_type, system_type_mapping, "Unknown"); - proto_tree_add_text(adwin_tree, tvb, 98, 2, "System Type: %s", system_type); + proto_tree_add_string(adwin_tree, hf_adwin_config_system_type, tvb, 98, 2, system_type); } static void @@ -336,13 +343,11 @@ dissect_TCPFlashUpdate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, length = tvb_strnlen(tvb, offset, -1) + 1; filename = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII|ENC_NA); if (strncmp(filename, "eeprom_on", length) == 0) { - proto_tree_add_text(adwin_tree, tvb, offset, length, - "Enable EEPROM Support"); + proto_tree_add_boolean(adwin_tree, hf_adwin_config_eeprom_support, tvb, offset, length, TRUE); return offset+length; } if (strncmp(filename, "eeprom_off", length) == 0) { - proto_tree_add_text(adwin_tree, tvb, offset, length, - "Disable EEPROM Support"); + proto_tree_add_boolean(adwin_tree, hf_adwin_config_eeprom_support, tvb, offset, length, FALSE); return offset+length; } proto_tree_add_item(adwin_tree, hf_adwin_config_filename, tvb, 4, length, ENC_ASCII|ENC_NA); @@ -353,12 +358,10 @@ dissect_TCPFlashUpdate(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_tree_add_item(adwin_tree, hf_adwin_config_filesize, tvb, offset, 4, ENC_BIG_ENDIAN); offset += 4; tmp_time.secs = tvb_get_ntohl(tvb, offset); - proto_tree_add_text(adwin_tree, tvb, offset, 4, - "File time: %s", abs_time_to_str(wmem_packet_scope(), &tmp_time, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_tree_add_time(adwin_tree, hf_adwin_config_filetime, tvb, offset, 4, &tmp_time); offset += 4; tmp_time.secs = tvb_get_ntohl(tvb, offset); - proto_tree_add_text(adwin_tree, tvb, offset, 4, - "Update time: %s", abs_time_to_str(wmem_packet_scope(), &tmp_time, ABSOLUTE_TIME_LOCAL, TRUE)); + proto_tree_add_time(adwin_tree, hf_adwin_config_updatetime, tvb, offset, 4, &tmp_time); offset += 4; proto_tree_add_item(adwin_tree, hf_adwin_config_unused, tvb, offset, 128, ENC_NA); offset += 128; @@ -543,6 +546,16 @@ proto_register_adwin_config(void) FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_adwin_config_filetime, + { "File time", "adwin_config.filetime", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, + NULL, HFILL } + }, + { &hf_adwin_config_updatetime, + { "Update time", "adwin_config.updatetime", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0, + NULL, HFILL } + }, { &hf_adwin_config_gateway, { "Gateway IP", "adwin_config.gateway", FT_IPv4, BASE_NONE, NULL, 0x0, @@ -608,16 +621,26 @@ proto_register_adwin_config(void) FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } }, - { &hf_adwin_config_processor_type, - { "Processor Type (Raw value)", "adwin_config.processor_type", + { &hf_adwin_config_processor_type_raw, + { "Processor Type (Raw value)", "adwin_config.processor_type_raw", FT_STRING, BASE_NONE, NULL, 0x0, "The DSP processor type of the ADwin system, e.g. T9, T10 or T11.", HFILL } }, - { &hf_adwin_config_system_type, - { "System Type (Raw value)", "adwin_config.system_type", + { &hf_adwin_config_system_type_raw, + { "System Type (Raw value)", "adwin_config.system_type_raw", FT_STRING, BASE_NONE, NULL, 0x0, "The system type of the ADwin system, e.g. Gold, Pro or Light.", HFILL } }, + { &hf_adwin_config_processor_type, + { "Processor Type", "adwin_config.processor_type", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_adwin_config_system_type, + { "System Type", "adwin_config.system_type", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_adwin_config_server_ip, { "Server IP", "adwin_config.server_ip", FT_IPv4, BASE_NONE, NULL, 0x0, @@ -694,6 +717,11 @@ proto_register_adwin_config(void) FT_INT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_adwin_config_eeprom_support, + { "EEPROM Support", "adwin_config.eeprom_support", + FT_BOOLEAN, BASE_NONE, TFS(&tfs_enabled_disabled), 0x0, + NULL, HFILL } + }, { &hf_adwin_config_timeout, { "Timeout", "adwin_config.timeout", FT_UINT32, BASE_DEC, NULL, 0x0, diff --git a/epan/dissectors/packet-adwin.c b/epan/dissectors/packet-adwin.c index 7bb06b3429..239996adc9 100644 --- a/epan/dissectors/packet-adwin.c +++ b/epan/dissectors/packet-adwin.c @@ -454,6 +454,7 @@ static int hf_adwin_binfilesize = -1; static int hf_adwin_blocksize = -1; static int hf_adwin_count = -1; static int hf_adwin_complete_packets = -1; +static int hf_adwin_data = -1; static int hf_adwin_data_int = -1; static int hf_adwin_data_float = -1; static int hf_adwin_data_hex = -1; @@ -475,6 +476,7 @@ static int hf_adwin_packet_index = -1; static int hf_adwin_packet_no = -1; static int hf_adwin_packet_start = -1; static int hf_adwin_packet_end = -1; +static int hf_adwin_gdsh_status = -1; static int hf_adwin_packet_type = -1; static int hf_adwin_parameter = -1; static int hf_adwin_password = -1; @@ -499,6 +501,8 @@ static int hf_adwin_val4 = -1; static gint ett_adwin = -1; static gint ett_adwin_debug = -1; +static dissector_handle_t data_handle; + /* response/request tracking */ typedef struct _adwin_transaction_t { guint32 req_frame; @@ -852,7 +856,7 @@ dissect_UDPR2(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item(adwin_tree, hf_adwin_packet_index, tvb, 4, 4, ENC_LITTLE_ENDIAN); if (! global_adwin_dissect_data) { - proto_tree_add_text(adwin_debug_tree, tvb, 8, 250 * 4, "Data"); + call_dissector(data_handle, tvb_new_subset_length(tvb, 8, 250*4), pinfo, adwin_debug_tree); return; } @@ -861,7 +865,7 @@ dissect_UDPR2(tvbuff_t *tvb, packet_info *pinfo, guint32 offset = 8 + i * (int)sizeof(guint32); gint32 value = tvb_get_letohl(tvb, offset); void * fvalue = &value; - proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, + proto_tree_add_none_format(adwin_debug_tree, hf_adwin_data, tvb, offset, 4, "Data[%3d]: %10d - %10f - 0x%08x", i, value, *(float*)fvalue, value); item = proto_tree_add_item(adwin_debug_tree, hf_adwin_data_int, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -891,7 +895,7 @@ dissect_UDPR3(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item(adwin_tree, hf_adwin_packet_no, tvb, 4, 4, ENC_LITTLE_ENDIAN); if (! global_adwin_dissect_data) { - proto_tree_add_text(adwin_debug_tree, tvb, 8, 350 * 4, "Data"); + call_dissector(data_handle, tvb_new_subset_length(tvb, 8, 350*4), pinfo, adwin_debug_tree); return; } @@ -900,7 +904,7 @@ dissect_UDPR3(tvbuff_t *tvb, packet_info *pinfo, guint32 offset = 8 + i * (int)sizeof(guint32); gint32 value = tvb_get_letohl(tvb, offset); void * fvalue = &value; - proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, + proto_tree_add_none_format(adwin_debug_tree, hf_adwin_data, tvb, offset, 4, "Data[%3d]: %10d - %10f - 0x%08x", i, value, *(float*)fvalue, value); item = proto_tree_add_item(adwin_debug_tree, hf_adwin_data_int, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -943,7 +947,7 @@ dissect_UDPR4(tvbuff_t *tvb, packet_info *pinfo, data_type = tvb_get_letohl(tvb, 1412); if (! global_adwin_dissect_data) { - proto_tree_add_text(adwin_debug_tree, tvb, 8, 350 * 4, "Data"); + call_dissector(data_handle, tvb_new_subset_length(tvb, 8, 350*4), pinfo, adwin_debug_tree); return; } @@ -956,7 +960,7 @@ dissect_UDPR4(tvbuff_t *tvb, packet_info *pinfo, case 2: case 3: case 4: /* some kind of int, usually int/long */ - proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, + proto_tree_add_none_format(adwin_debug_tree, hf_adwin_data, tvb, offset, 4, "Data[%3d]: %10d - 0x%08x", i, value, value); item = proto_tree_add_item(adwin_debug_tree, hf_adwin_data_int, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -965,7 +969,7 @@ dissect_UDPR4(tvbuff_t *tvb, packet_info *pinfo, PROTO_ITEM_SET_HIDDEN(item); break; case 5: /* float */ - proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, + proto_tree_add_none_format(adwin_debug_tree, hf_adwin_data, tvb, offset, 4, "Data[%3d]: %10f - 0x%08x", i, *(float*)fvalue, value); item = proto_tree_add_item(adwin_debug_tree, hf_adwin_data_float, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -974,7 +978,7 @@ dissect_UDPR4(tvbuff_t *tvb, packet_info *pinfo, PROTO_ITEM_SET_HIDDEN(item); break; default: /* string, double, variant, something funny... */ - proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, + proto_tree_add_none_format(adwin_debug_tree, hf_adwin_data, tvb, offset, 4, "Data[%3d]: 0x%08x", i, value); item = proto_tree_add_item(adwin_debug_tree, hf_adwin_data_hex, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -1002,7 +1006,7 @@ dissect_GDSHP(tvbuff_t *tvb, packet_info *pinfo, proto_tree_add_item(adwin_tree, hf_adwin_unused, tvb, 8, 4, ENC_NA); if (! global_adwin_dissect_data) { - proto_tree_add_text(adwin_debug_tree, tvb, 12, 336 * 4, "Data"); + call_dissector(data_handle, tvb_new_subset_length(tvb, 12, 336*4), pinfo, adwin_debug_tree); return; } @@ -1011,7 +1015,7 @@ dissect_GDSHP(tvbuff_t *tvb, packet_info *pinfo, guint32 offset = 12 + i * (int)sizeof(guint32); gint32 value = tvb_get_letohl(tvb, offset); void * fvalue = &value; - proto_tree_add_text(adwin_debug_tree, tvb, offset, 4, + proto_tree_add_none_format(adwin_debug_tree, hf_adwin_data, tvb, offset, 4, "Data[%3d]: %10d - %10f - 0x%08x", i, value, *(float*)fvalue, value); item = proto_tree_add_item(adwin_debug_tree, hf_adwin_data_int, tvb, offset, 4, ENC_LITTLE_ENDIAN); @@ -1028,6 +1032,7 @@ dissect_GDSHR(tvbuff_t *tvb, packet_info *pinfo, proto_tree *adwin_tree, proto_tree *adwin_debug_tree) { guint32 is_range, packet_start, packet_end, seq_num; + proto_item *ti; /* Get the transaction identifier */ seq_num = tvb_get_ntohl(tvb, 0); @@ -1048,23 +1053,26 @@ dissect_GDSHR(tvbuff_t *tvb, packet_info *pinfo, packet_start = tvb_get_ntohl(tvb, 16); switch(is_range) { - case 0: proto_tree_add_text(adwin_tree, tvb, 12, 12, - "GDSH status: get single packet no %d", - packet_start); + case 0: + ti = proto_tree_add_uint_format_value(adwin_tree, hf_adwin_gdsh_status, tvb, 12, 4, + is_range, "get single packet no %d", packet_start); break; - case 1: packet_end = tvb_get_ntohl(tvb, 20); - proto_tree_add_text(adwin_tree, tvb, 12, 12, - "GDSH status: get packets %d - %d", + case 1: + packet_end = tvb_get_ntohl(tvb, 20); + ti = proto_tree_add_uint_format_value(adwin_tree, hf_adwin_gdsh_status, tvb, 12, 4, + is_range, "get packets %d - %d", packet_start, packet_end); break; - case 2: proto_tree_add_text(adwin_tree, tvb, 12, 12, - "GDSH status: finished"); + case 2: + ti = proto_tree_add_uint_format_value(adwin_tree, hf_adwin_gdsh_status, tvb, 12, 4, + is_range, "finished"); break; default: /* should not happen */ - proto_tree_add_text(adwin_tree, tvb, 12, 12, - "GDSH status: unknown code %d", is_range); + ti = proto_tree_add_uint_format_value(adwin_tree, hf_adwin_gdsh_status, tvb, 12, 4, + is_range, "unknown code %d", is_range); } - proto_tree_add_item(adwin_debug_tree, hf_adwin_unused, tvb, 24, 40, ENC_NA); + proto_item_set_len(ti, 12); + proto_tree_add_item(adwin_debug_tree, hf_adwin_unused, tvb, 24, 40, ENC_NA); } /* here we determine which type of packet is sent by looking at its @@ -1164,6 +1172,7 @@ proto_reg_handoff_adwin(void) if (! adwin_prefs_initialized) { adwin_handle = new_create_dissector_handle(dissect_adwin, proto_adwin); + data_handle = find_dissector("data"); adwin_prefs_initialized = TRUE; } else { dissector_delete_uint("udp.port", udp_port, adwin_handle); @@ -1207,6 +1216,11 @@ proto_register_adwin(void) FT_UINT32, BASE_DEC, NULL, 0x0, "Number of longs", HFILL } }, + { &hf_adwin_data, + { "Data", "adwin.data", + FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_adwin_data_int, { "Data element int", "adwin.data_int", FT_INT32, BASE_DEC, NULL, 0x0, @@ -1297,6 +1311,11 @@ proto_register_adwin(void) FT_UINT32, BASE_DEC, NULL, 0x0, "GDSH: End Packet", HFILL } }, + { &hf_adwin_gdsh_status, + { "GDSH status", "adwin.gdsh_status", + FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL } + }, { &hf_adwin_packet_index, { "Packet index", "adwin.packet_index", FT_UINT32, BASE_DEC, NULL, 0x0, diff --git a/epan/dissectors/packet-aim-admin.c b/epan/dissectors/packet-aim-admin.c index 04743766cc..30c6a182c1 100644 --- a/epan/dissectors/packet-aim-admin.c +++ b/epan/dissectors/packet-aim-admin.c @@ -48,6 +48,7 @@ static const value_string confirm_statusses[] = { /* Initialize the protocol and registered fields */ static int proto_aim_admin = -1; static int hf_admin_acctinfo_code = -1; +static int hf_admin_acctinfo_unknown = -1; static int hf_admin_acctinfo_permissions = -1; static int hf_admin_confirm_status = -1; @@ -56,15 +57,16 @@ static gint ett_aim_admin = -1; static int dissect_aim_admin_accnt_info_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *admin_tree) { - proto_tree_add_item(admin_tree, hf_admin_acctinfo_code, tvb, 0, 2, tvb_get_ntohs(tvb, 0)); - proto_tree_add_text(admin_tree, tvb, 2, 2, "Unknown"); + proto_tree_add_item(admin_tree, hf_admin_acctinfo_code, tvb, 0, 2, ENC_BIG_ENDIAN); + proto_tree_add_item(admin_tree, hf_admin_acctinfo_unknown, tvb, 2, 2, ENC_BIG_ENDIAN); return 4; } static int dissect_aim_admin_accnt_info_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *admin_tree) { int offset = 0; - proto_tree_add_uint(admin_tree, hf_admin_acctinfo_permissions, tvb, offset, 2, tvb_get_ntohs(tvb, offset)); offset+=2; + proto_tree_add_item(admin_tree, hf_admin_acctinfo_permissions, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; return dissect_aim_tlv_list(tvb, pinfo, offset, admin_tree, aim_client_tlvs); } @@ -76,7 +78,8 @@ static int dissect_aim_admin_info_change_req(tvbuff_t *tvb, packet_info *pinfo, static int dissect_aim_admin_cfrm_repl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *admin_tree) { int offset = 0; - proto_tree_add_uint(admin_tree, hf_admin_confirm_status, tvb, offset, 2, tvb_get_ntohs(tvb, offset)); offset+=2; + proto_tree_add_item(admin_tree, hf_admin_confirm_status, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; return dissect_aim_tlv_sequence(tvb, pinfo, offset, admin_tree, aim_client_tlvs); } @@ -101,6 +104,9 @@ proto_register_aim_admin(void) { &hf_admin_acctinfo_code, { "Account Information Request Code", "aim_admin.acctinfo.code", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, + { &hf_admin_acctinfo_unknown, + { "Unknown", "aim_admin.acctinfo.unknown", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, + }, { &hf_admin_acctinfo_permissions, { "Account Permissions", "aim_admin.acctinfo.permissions", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, diff --git a/epan/dissectors/packet-aim-chat.c b/epan/dissectors/packet-aim-chat.c index a0ff6e592f..b6870613b4 100644 --- a/epan/dissectors/packet-aim-chat.c +++ b/epan/dissectors/packet-aim-chat.c @@ -67,6 +67,8 @@ static const aim_tlv aim_chat_tlvs[] _U_ = { /* Initialize the protocol and registered fields */ static int proto_aim_chat = -1; +static int hf_aim_chat_screen_name = -1; + /* Initialize the subtree pointers */ static gint ett_aim_chat = -1; @@ -114,11 +116,8 @@ static int dissect_aim_chat_incoming_msg(tvbuff_t *tvb, packet_info *pinfo, prot col_append_fstr(pinfo->cinfo, COL_INFO, "from: %s", buddyname); col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", msg); - if(chat_tree) { - proto_tree_add_text(chat_tree, tvb, 31, buddyname_length, - "Screen Name: %s", - format_text(buddyname, buddyname_length)); - } + proto_tree_add_string(chat_tree, hf_aim_chat_screen_name, tvb, 31, buddyname_length, buddyname); + return tvb_length(tvb); } @@ -140,10 +139,11 @@ proto_register_aim_chat(void) { /* Setup list of header fields */ -#if 0 /* FIXME */ static hf_register_info hf[] = { + { &hf_aim_chat_screen_name, + { "Screen Name", "aim_chat.screen_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }, + }, }; -#endif /* Setup protocol subtree array */ static gint *ett[] = { @@ -154,8 +154,7 @@ proto_register_aim_chat(void) proto_aim_chat = proto_register_protocol("AIM Chat Service", "AIM Chat", "aim_chat"); /* Required function calls to register the header fields and subtrees used */ -/*FIXME - proto_register_field_array(proto_aim_chat, hf, array_length(hf));*/ + proto_register_field_array(proto_aim_chat, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } diff --git a/epan/dissectors/packet-aim-generic.c b/epan/dissectors/packet-aim-generic.c index b7799fde0e..1f6cf27fd9 100644 --- a/epan/dissectors/packet-aim-generic.c +++ b/epan/dissectors/packet-aim-generic.c @@ -101,6 +101,9 @@ static const value_string ext_status_flags[] = { /* Initialize the protocol and registered fields */ static int proto_aim_generic = -1; static int hf_generic_motd_motdtype = -1; +static int hf_generic_family = -1; +static int hf_generic_version = -1; +static int hf_generic_dll_version = -1; static int hf_generic_servicereq_service = -1; static int hf_generic_rateinfo_numclasses = -1; static int hf_generic_rateinfo_windowsize = -1; @@ -145,16 +148,16 @@ static gint ett_generic_rateinfo_group = -1; static int dissect_rate_class(tvbuff_t *tvb, packet_info *pinfo _U_, int offset, proto_tree *class_tree) { - proto_tree_add_uint(class_tree, hf_generic_rateinfo_classid, tvb, offset, 2, tvb_get_ntohs(tvb, offset));offset+=2; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_windowsize, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_clearlevel, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_alertlevel, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_limitlevel, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_disconnectlevel, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_currentlevel, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_maxlevel, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_lasttime, tvb, offset, 4, tvb_get_ntohl(tvb, offset));offset+=4; - proto_tree_add_uint(class_tree, hf_generic_rateinfo_curstate, tvb, offset, 1, tvb_get_guint8(tvb, offset));offset+=1; + proto_tree_add_item(class_tree, hf_generic_rateinfo_classid, tvb, offset, 2, ENC_BIG_ENDIAN);offset+=2; + proto_tree_add_item(class_tree, hf_generic_rateinfo_windowsize, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_clearlevel, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_alertlevel, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_limitlevel, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_disconnectlevel, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_currentlevel, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_maxlevel, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_lasttime, tvb, offset, 4, ENC_BIG_ENDIAN);offset+=4; + proto_tree_add_item(class_tree, hf_generic_rateinfo_curstate, tvb, offset, 1, ENC_NA);offset+=1; return offset; } @@ -199,13 +202,15 @@ static int dissect_generic_rateinfo(tvbuff_t *tvb, packet_info *pinfo _U_, proto guint16 subtype_id; const aim_family *family; const aim_subtype *subtype; - family_id = tvb_get_ntohs(tvb, offset); offset+=2; - subtype_id = tvb_get_ntohs(tvb, offset); offset+=2; + family_id = tvb_get_ntohs(tvb, offset); + subtype_id = tvb_get_ntohs(tvb, offset+2); family = aim_get_family(family_id); subtype = aim_get_subtype(family_id, subtype_id); - proto_tree_add_text(group_tree, tvb, offset-4, 4, "Family: %s (0x%04x), Subtype: %s (0x%04x)", family?family->name:"Unknown", family_id, subtype?subtype->name:"Unknown", subtype_id); + proto_tree_add_uint_format_value(group_tree, hf_generic_family, tvb, offset, 4, family_id, + "%s (0x%04x), Subtype: %s (0x%04x)", family?family->name:"Unknown", family_id, subtype?subtype->name:"Unknown", subtype_id); + offset+=4; } } @@ -218,16 +223,19 @@ static int dissect_aim_generic_clientready(tvbuff_t *tvb, packet_info *pinfo _U_ proto_tree *entry = proto_tree_add_subtree(gen_tree, tvb, 0, -1, ett_generic_clientready, NULL, "Supported services"); while(tvb_length_remaining(tvb, offset) > 0) { - guint16 famnum = tvb_get_ntohs(tvb, offset); - const aim_family *family = aim_get_family(famnum); + proto_item *ti; + proto_tree *subtree; - proto_tree *subentry; - subentry = proto_tree_add_subtree_format(entry, tvb, offset, 2, ett_generic_clientready_item, NULL, - "%s (0x%x)", family?family->name:"Unknown Family", famnum); + ti = proto_tree_add_item(entry, hf_generic_family, tvb, offset, 2, ENC_BIG_ENDIAN); + subtree = proto_item_add_subtree(ti, ett_generic_clientready_item); offset+=2; - proto_tree_add_text(subentry, tvb, offset, 2, "Version: %d", tvb_get_ntohs(tvb, offset) ); offset += 2; - proto_tree_add_text(subentry, tvb, offset, 4, "DLL Version: %u", tvb_get_ntoh24(tvb, offset) ); offset += 4; + proto_tree_add_item(subtree, hf_generic_version, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; + proto_tree_add_item(subtree, hf_generic_dll_version, tvb, offset, 3, ENC_BIG_ENDIAN); + /* Padding byte? */ + offset += 4; + proto_item_set_len(ti, 8); } return offset; } @@ -239,9 +247,7 @@ static int dissect_aim_generic_serverready(tvbuff_t *tvb, packet_info *pinfo _U_ proto_tree *entry = proto_tree_add_subtree(gen_tree, tvb, offset, -1, ett_generic_clientready, NULL, "Supported services"); while(tvb_length_remaining(tvb, offset) > 0) { - guint16 famnum = tvb_get_ntohs(tvb, offset); - const aim_family *family = aim_get_family(famnum); - proto_tree_add_text(entry, tvb, offset, 2, "%s (0x%x)", family?family->name:"Unknown Family", famnum); + proto_tree_add_item(entry, hf_generic_family, tvb, offset, 2, ENC_BIG_ENDIAN); offset+=2; } return offset; @@ -269,10 +275,10 @@ static int dissect_aim_generic_capabilities(tvbuff_t *tvb, packet_info *pinfo _U proto_tree *entry = proto_tree_add_subtree(gen_tree, tvb, offset, -1, ett_generic_clientready, NULL, "Requested services"); while(tvb_length_remaining(tvb, offset) > 0) { - guint16 famnum = tvb_get_ntohs(tvb, offset); - const aim_family *family = aim_get_family(famnum); - proto_tree_add_text(entry, tvb, offset, 4, "%s (0x%x), Version: %d", family?family->name:"Unknown Family", famnum, tvb_get_ntohs(tvb, offset+2)); - offset += 4; + proto_tree_add_item(entry, hf_generic_family, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + proto_tree_add_item(entry, hf_generic_version, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; } return offset; } @@ -283,10 +289,10 @@ static int dissect_aim_generic_capack(tvbuff_t *tvb, packet_info *pinfo _U_, pro proto_tree *entry = proto_tree_add_subtree(gen_tree, tvb, offset, -1, ett_generic_clientready, NULL, "Accepted requested services"); while(tvb_length_remaining(tvb, offset) > 0) { - guint16 famnum = tvb_get_ntohs(tvb, offset); - const aim_family *family = aim_get_family(famnum); - proto_tree_add_text(entry, tvb, offset, 4, "%s (0x%x), Version: %d", family?family->name:"Unknown Family", famnum, tvb_get_ntohs(tvb, offset+2)); - offset += 4; + proto_tree_add_item(entry, hf_generic_family, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; + proto_tree_add_item(entry, hf_generic_version, tvb, offset, 2, ENC_BIG_ENDIAN); + offset+=2; } return offset; } @@ -324,9 +330,7 @@ static int dissect_aim_generic_clientpauseack(tvbuff_t *tvb, packet_info *pinfo { int offset = 0; while(tvb_length_remaining(tvb, offset) > 0) { - guint16 famnum = tvb_get_ntohs(tvb, offset); - const aim_family *family = aim_get_family(famnum); - proto_tree_add_text(gen_tree, tvb, offset, 4, "Family: %s (0x%x)", family?family->name:"Unknown Family", famnum); + proto_tree_add_item(gen_tree, hf_generic_family, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } return offset; @@ -343,9 +347,7 @@ static int dissect_aim_generic_migration_req(tvbuff_t *tvb, packet_info *pinfo, entry = proto_tree_add_subtree(gen_tree, tvb, offset, 2 * n, ett_generic_migratefamilies, NULL, "Families to migrate"); for(i = 0; i < n; i++) { - guint16 famnum = tvb_get_ntohs(tvb, offset); - const aim_family *family = aim_get_family(famnum); - proto_tree_add_text(entry, tvb, offset, 4, "Family: %s (0x%x)", family?family->name:"Unknown Family", famnum); + proto_tree_add_item(entry, hf_generic_family, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; } @@ -419,6 +421,14 @@ static int dissect_aim_generic_ext_status_repl(tvbuff_t *tvb, packet_info *pinfo return offset; } +static void +aim_generic_family( gchar *result, guint32 famnum ) +{ + const aim_family *family = aim_get_family(famnum); + + g_snprintf( result, ITEM_LABEL_LENGTH, "%s (0x%x)", family?family->name:"Unknown", famnum); +} + static const aim_subtype aim_fnac_family_generic[] = { { 0x0001, "Error", dissect_aim_snac_error }, { 0x0002, "Client Ready", dissect_aim_generic_clientready }, @@ -466,6 +476,15 @@ proto_register_aim_generic(void) { "MOTD Type", "aim_generic.motd.motdtype", FT_UINT16, BASE_HEX, VALS(aim_snac_generic_motd_motdtypes), 0x0, NULL, HFILL }, }, + { &hf_generic_family, + { "Family", "aim_generic.family", FT_UINT16, BASE_CUSTOM, aim_generic_family, 0x0, NULL, HFILL }, + }, + { &hf_generic_version, + { "Version", "aim_generic.version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, + }, + { &hf_generic_dll_version, + { "DLL Version", "aim_generic.dll_version", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }, + }, { &hf_generic_rateinfo_numclasses, { "Number of Rateinfo Classes", "aim_generic.rateinfo.numclasses", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }, }, diff --git a/epan/dissectors/packet-amr.c b/epan/dissectors/packet-amr.c index a3bfcac3ac..900f42a05b 100644 --- a/epan/dissectors/packet-amr.c +++ b/epan/dissectors/packet-amr.c @@ -53,12 +53,15 @@ static dissector_handle_t amr_wb_handle; static int proto_amr = -1; static int hf_amr_nb_cmr = -1; static int hf_amr_wb_cmr = -1; +static int hf_amr_payload_decoded_as = -1; static int hf_amr_reserved = -1; static int hf_amr_toc_f = -1; static int hf_amr_nb_toc_ft = -1; static int hf_amr_wb_toc_ft = -1; static int hf_amr_toc_q = -1; +static int hf_amr_speech_data = -1; +static int hf_amr_frame_data = -1; static int hf_amr_nb_if1_ft = -1; static int hf_amr_wb_if1_ft = -1; static int hf_amr_if1_fqi = -1; @@ -85,6 +88,8 @@ static expert_field ei_amr_spare_bit_not0 = EI_INIT; static expert_field ei_amr_not_enough_data_for_frames = EI_INIT; static expert_field ei_amr_superfluous_data = EI_INIT; static expert_field ei_amr_padding_bits_not0 = EI_INIT; +static expert_field ei_amr_padding_bits_correct = EI_INIT; +static expert_field ei_amr_reserved = EI_INIT; /* The dynamic payload type which will be dissected as AMR */ @@ -232,7 +237,7 @@ dissect_amr_nb_if1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { ti = proto_tree_add_item(tree, hf_amr_nb_if1_mode_req, tvb, offset+1, 1, ENC_BIG_ENDIAN); if (tvb_get_guint8(tvb,offset+1) & 0x1f) expert_add_info(pinfo, ti, &ei_amr_spare_bit_not0); - proto_tree_add_text(tree, tvb, offset+2, 5, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset+2, 5, ENC_NA); proto_tree_add_item(tree, hf_amr_if1_sti, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_amr_nb_if1_sti_mode_ind, tvb, offset+7, 1, ENC_BIG_ENDIAN); return; @@ -244,7 +249,7 @@ dissect_amr_nb_if1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (tvb_get_guint8(tvb,offset) & 0x1f) expert_add_info(pinfo, ti, &ei_amr_spare_bit_not0); offset += 1; - proto_tree_add_text(tree, tvb, offset, -1, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset, -1, ENC_NA); } /* See 3GPP TS 26.201 for AMR-WB */ @@ -261,7 +266,7 @@ dissect_amr_wb_if1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { octet = (tvb_get_guint8(tvb,offset) & 0xf0) >> 4; if (octet == AMR_WB_SID) { proto_tree_add_item(tree, hf_amr_wb_if1_mode_req, tvb, offset+1, 1, ENC_BIG_ENDIAN); - proto_tree_add_text(tree, tvb, offset+2, 4, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset+2, 4, ENC_NA); proto_tree_add_item(tree, hf_amr_if1_sti, tvb, offset+7, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_amr_wb_if1_sti_mode_ind, tvb, offset+7, 1, ENC_BIG_ENDIAN); return; @@ -271,7 +276,7 @@ dissect_amr_wb_if1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_item(tree, hf_amr_wb_if1_mode_ind, tvb, offset, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_amr_wb_if1_mode_req, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_text(tree, tvb, offset, -1, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset, -1, ENC_NA); } static void @@ -283,14 +288,14 @@ dissect_amr_nb_if2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { octet = tvb_get_guint8(tvb,offset) & 0x0f; if (octet == AMR_NB_SID) { - proto_tree_add_text(tree, tvb, offset+1, 3, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset+1, 3, ENC_NA); proto_tree_add_item(tree, hf_amr_if2_sti, tvb, offset+4, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_amr_nb_if2_sti_mode_ind, tvb, offset+5, 1, ENC_BIG_ENDIAN); return; } if (octet == AMR_NO_TRANS) return; - proto_tree_add_text(tree, tvb, offset+1, -1, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset+1, -1, ENC_NA); col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_ext(octet, &amr_nb_codec_mode_request_vals_ext, "Unknown (%d)" )); @@ -305,14 +310,14 @@ dissect_amr_wb_if2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { octet = (tvb_get_guint8(tvb,offset) & 0xf0) >> 4; if (octet == AMR_WB_SID) { - proto_tree_add_text(tree, tvb, offset+1, 4, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset+1, 4, ENC_NA); proto_tree_add_item(tree, hf_amr_if2_sti, tvb, offset+5, 1, ENC_BIG_ENDIAN); proto_tree_add_item(tree, hf_amr_wb_if2_sti_mode_ind, tvb, offset+5, 1, ENC_BIG_ENDIAN); return; } if (octet == AMR_NO_TRANS) return; - proto_tree_add_text(tree, tvb, offset+1, -1, "Speech data"); + proto_tree_add_item(tree, hf_amr_speech_data, tvb, offset+1, -1, ENC_NA); col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_ext(octet, &amr_wb_codec_mode_request_vals_ext, "Unknown (%d)" )); @@ -399,28 +404,26 @@ dissect_amr_be(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, gint amr /* Check if we have enough data available for our frames */ if (tvb_reported_length_remaining(tvb, bitcount/8) < bytes_needed_for_frames) { - item = proto_tree_add_text(tree, tvb, bitcount/8, bytes_needed_for_frames, + proto_tree_add_expert_format(tree, pinfo, &ei_amr_not_enough_data_for_frames, + tvb, bitcount/8, bytes_needed_for_frames, "Error: %d Bytes available, %d would be needed!", tvb_reported_length_remaining(tvb, bitcount/8), bytes_needed_for_frames); - expert_add_info(pinfo, item, &ei_amr_not_enough_data_for_frames); } else { - item = proto_tree_add_text(tree, tvb, bitcount/8, bytes_needed_for_frames, "Frame Data"); - proto_item_append_text(item, " (%d Bytes)",bytes_needed_for_frames); + proto_tree_add_item(tree, hf_amr_frame_data, tvb, bitcount/8, bytes_needed_for_frames, ENC_NA); } bitcount += bits_used_for_frames; if (tvb_reported_length_remaining(tvb, (bitcount+8)/8) > 0) { - item = proto_tree_add_text(tree, tvb, bitcount/8, tvb_reported_length_remaining(tvb, bitcount/8), + proto_tree_add_expert_format(tree, pinfo, &ei_amr_superfluous_data, tvb, bitcount/8, tvb_reported_length_remaining(tvb, bitcount/8), "Error: %d Bytes remaining - should be 0!",tvb_reported_length_remaining(tvb, (bitcount+8)/8)); - expert_add_info(pinfo, item, &ei_amr_superfluous_data); /* Now check the paddings */ if (bitcount%8 != 0) { if ( (1 << (8 -(bitcount%8)-1)) & tvb_get_guint8(tvb,bitcount/8) ) - proto_tree_add_text(tree, tvb, bitcount/8, 1, "Padding bits correct"); + proto_tree_add_expert(tree, pinfo, &ei_amr_padding_bits_correct, tvb, bitcount/8, 1); else { proto_tree_add_expert(tree, pinfo, &ei_amr_padding_bits_not0, tvb, bitcount/8, 1); @@ -446,8 +449,9 @@ dissect_amr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint amr ti = proto_tree_add_item(tree, proto_amr, tvb, 0, -1, ENC_NA); amr_tree = proto_item_add_subtree(ti, ett_amr); - proto_tree_add_text(amr_tree, tvb, offset, -1, "Payload decoded as %s", - val_to_str_const(amr_encoding_type, amr_encoding_type_value, "Unknown value - Error")); + item = proto_tree_add_uint(amr_tree, hf_amr_payload_decoded_as, tvb, offset, 4, amr_encoding_type); + proto_item_set_len(item, tvb_reported_length(tvb)); + PROTO_ITEM_SET_GENERATED(item); switch (amr_encoding_type) { case 0: /* RFC 3267 Byte aligned */ @@ -478,16 +482,13 @@ dissect_amr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint amr bit_offset += 4; octet = tvb_get_guint8(tvb,offset) & 0x0f; + item = proto_tree_add_item(amr_tree, hf_amr_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); if ( octet != 0 ) { - item = proto_tree_add_text(amr_tree, tvb, offset, -1, - "Reserved != 0, wrongly encoded or not octet aligned." - " Decoding as bandwidth-efficient mode"); + expert_add_info(pinfo, item, &ei_amr_reserved); PROTO_ITEM_SET_GENERATED(item); return; } - - proto_tree_add_item(amr_tree, hf_amr_reserved, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; bit_offset += 4; /* @@ -639,6 +640,11 @@ proto_register_amr(void) FT_UINT8, BASE_DEC, NULL, 0x0f, "Reserved bits", HFILL } }, + { &hf_amr_payload_decoded_as, + { "Payload decoded as", "amr.payload_decoded_as", + FT_UINT32, BASE_DEC, VALS(amr_encoding_type_value), 0x0, + "Value of decoding preference", HFILL } + }, { &hf_amr_toc_f, { "F bit", "amr.toc.f", FT_BOOLEAN, BASE_NONE, TFS(&toc_f_bit_vals), 0x0, @@ -659,6 +665,16 @@ proto_register_amr(void) FT_BOOLEAN, BASE_NONE, TFS(&toc_q_bit_vals), 0x0, "Frame quality indicator bit", HFILL } }, + { &hf_amr_speech_data, + { "Speech data", "amr.speech_data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, + { &hf_amr_frame_data, + { "Frame Data", "amr.frame_data", + FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL } + }, { &hf_amr_nb_if1_ft, { "Frame Type", "amr.nb.if1.ft", FT_UINT8, BASE_DEC|BASE_EXT_STRING, &amr_nb_codec_mode_vals_ext, 0xf0, @@ -747,6 +763,8 @@ proto_register_amr(void) { &ei_amr_not_enough_data_for_frames, { "amr.not_enough_data_for_frames", PI_MALFORMED, PI_ERROR, "Not enough data for the frames according to TOC", EXPFILL }}, { &ei_amr_superfluous_data, { "amr.superfluous_data", PI_MALFORMED, PI_ERROR, "Superfluous data remaining", EXPFILL }}, { &ei_amr_padding_bits_not0, { "amr.padding_bits_not0", PI_MALFORMED, PI_ERROR, "Padding bits error - MUST be 0", EXPFILL }}, + { &ei_amr_padding_bits_correct, { "amr.padding_bits_correct", PI_PROTOCOL, PI_NOTE, "Padding bits correct", EXPFILL }}, + { &ei_amr_reserved, { "amr.reserved.not_zero", PI_PROTOCOL, PI_WARN, "Reserved != 0, wrongly encoded or not octet aligned. Decoding as bandwidth-efficient mode", EXPFILL }}, }; static const enum_val_t encoding_types[] = { diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c index 16b99a0be7..e76ae6a2dc 100644 --- a/epan/dissectors/packet-arp.c +++ b/epan/dissectors/packet-arp.c @@ -805,13 +805,7 @@ check_for_storm_count(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (report_storm) { /* Report storm and reset counter */ - proto_item *ti = proto_tree_add_text(tree, tvb, 0, 0, - "Packet storm detected (%u packets in < %u ms)", - global_arp_detect_request_storm_packets, - global_arp_detect_request_storm_period); - PROTO_ITEM_SET_GENERATED(ti); - expert_add_info_format(pinfo, ti, - &ei_seq_arp_storm, + proto_tree_add_expert_format(tree, pinfo, &ei_seq_arp_storm, tvb, 0, 0, "ARP packet storm detected (%u packets in < %u ms)", global_arp_detect_request_storm_packets, global_arp_detect_request_storm_period); diff --git a/epan/dissectors/packet-atalk.c b/epan/dissectors/packet-atalk.c index 3120c6ffca..9ace99968b 100644 --- a/epan/dissectors/packet-atalk.c +++ b/epan/dissectors/packet-atalk.c @@ -150,8 +150,7 @@ static int hf_zip_network = -1; static int hf_zip_network_start = -1; static int hf_zip_network_end = -1; -/* static int hf_zip_flags = -1; */ - +static int hf_zip_flags = -1; static int hf_zip_flags_zone_invalid = -1; static int hf_zip_flags_use_broadcast = -1; static int hf_zip_flags_only_one_zone = -1; @@ -510,40 +509,18 @@ static const value_string asp_error_vals[] = { value_string_ext asp_error_vals_ext = VALUE_STRING_EXT_INIT(asp_error_vals); /* - * XXX - do this with an FT_UINT_STRING? - * Unfortunately, you can't extract from an FT_UINT_STRING the string, - * which we'd want to do in order to put it into the "Data:" portion. - * + * hf_index must be a FT_UINT_STRING type * Are these always in the Mac extended character set? */ static int dissect_pascal_string(tvbuff_t *tvb, int offset, proto_tree *tree, int hf_index) { int len; - char *tmp; len = tvb_get_guint8(tvb, offset); - offset++; - - if ( tree ) - { - proto_tree *item; - proto_tree *subtree; - - /* - * XXX - if we could do this inside the protocol tree - * code, we could perhaps avoid allocating and freeing - * this string buffer. - */ - tmp = (gchar*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII); - item = proto_tree_add_string(tree, hf_index, tvb, offset-1, len+1, tmp); + proto_tree_add_item(tree, hf_index, tvb, offset, 1, ENC_ASCII|ENC_NA); - subtree = proto_item_add_subtree(item, ett_pstring); - proto_tree_add_text(subtree, tvb, offset-1, 1, "Length: %d", len); - proto_tree_add_text(subtree, tvb, offset, len, "Data: %s", tmp); - - } - offset += len; + offset += (len+1); return offset; } @@ -828,8 +805,8 @@ dissect_atp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_item(atp_info_tree, hf_atp_treltimer, tvb, offset, 1, ENC_BIG_ENDIAN); } if (query) { - proto_tree_add_text(atp_tree, tvb, offset +1, 1, - "Bitmap: 0x%02x %u packet(s) max", bitmap, nbe); + proto_tree_add_uint_format_value(atp_tree, hf_atp_bitmap, tvb, offset +1, 1, + bitmap, "0x%02x %u packet(s) max", bitmap, nbe); } else { proto_tree_add_item(atp_tree, hf_atp_bitmap, tvb, offset +1, 1, ENC_BIG_ENDIAN); @@ -1279,7 +1256,6 @@ dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint8 fn; guint8 len; gint offset = 0; - proto_tree *flag_tree; proto_tree *sub_tree; proto_tree *net_tree; guint8 flag; @@ -1287,6 +1263,13 @@ dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint i; guint count; + static const int * zip_flags[] = { + &hf_zip_flags_zone_invalid, + &hf_zip_flags_use_broadcast, + &hf_zip_flags_only_one_zone, + NULL + }; + col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZIP"); col_clear(pinfo->cinfo, COL_INFO); @@ -1315,12 +1298,7 @@ dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } break; case 7: /* Notify */ - flag = tvb_get_guint8(tvb, offset); - ti = proto_tree_add_text(zip_tree, tvb, offset , 1,"Flags : 0x%02x", flag); - flag_tree = proto_item_add_subtree(ti, ett_zip_flags); - proto_tree_add_item(flag_tree, hf_zip_flags_zone_invalid, tvb, offset, 1,ENC_BIG_ENDIAN); - proto_tree_add_item(flag_tree, hf_zip_flags_use_broadcast,tvb, offset, 1,ENC_BIG_ENDIAN); - proto_tree_add_item(flag_tree, hf_zip_flags_only_one_zone,tvb, offset, 1,ENC_BIG_ENDIAN); + proto_tree_add_bitmask(zip_tree, tvb, offset, hf_zip_flags, ett_zip_flags, zip_flags, ENC_NA); offset++; proto_tree_add_item(zip_tree, hf_zip_zero_value, tvb, offset, 4, ENC_NA); @@ -1347,13 +1325,13 @@ dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) sub_tree = proto_item_add_subtree(ti, ett_zip_network_list); for (i = 0; i < count; i++) { net = tvb_get_ntohs(tvb, offset); - ti = proto_tree_add_text(sub_tree, tvb, offset , 2, "Zone for network : %u", net); - net_tree = proto_item_add_subtree(ti, ett_zip_network_list); + net_tree = proto_tree_add_subtree_format(sub_tree, tvb, offset, 2, ett_zip_network_list, &ti, "Zone for network: %u", net); proto_tree_add_item(net_tree, hf_zip_network, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; len = tvb_get_guint8(tvb, offset); proto_tree_add_item(net_tree, hf_zip_zone_name, tvb, offset, 1,ENC_ASCII|ENC_NA); offset += len +1; + proto_item_set_len(ti, len+3); } break; @@ -1367,11 +1345,7 @@ dissect_ddp_zip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) case 6 : /* GetNetInfo reply */ flag = tvb_get_guint8(tvb, offset); - ti = proto_tree_add_text(zip_tree, tvb, offset , 1,"Flags : 0x%02x", flag); - flag_tree = proto_item_add_subtree(ti, ett_zip_flags); - proto_tree_add_item(flag_tree, hf_zip_flags_zone_invalid, tvb, offset, 1,ENC_BIG_ENDIAN); - proto_tree_add_item(flag_tree, hf_zip_flags_use_broadcast,tvb, offset, 1,ENC_BIG_ENDIAN); - proto_tree_add_item(flag_tree, hf_zip_flags_only_one_zone,tvb, offset, 1,ENC_BIG_ENDIAN); + proto_tree_add_bitmask(zip_tree, tvb, offset, hf_zip_flags, ett_zip_flags, zip_flags, ENC_NA); offset++; proto_tree_add_item(zip_tree, hf_zip_network_start, tvb, offset, 2, ENC_BIG_ENDIAN); @@ -1714,13 +1688,13 @@ proto_register_atalk(void) { "Enumerator", "nbp.enum", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, { &hf_nbp_node_object, - { "Object", "nbp.object", FT_STRING, BASE_NONE, + { "Object", "nbp.object", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_nbp_node_type, - { "Type", "nbp.type", FT_STRING, BASE_NONE, + { "Type", "nbp.type", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_nbp_node_zone, - { "Zone", "nbp.zone", FT_STRING, BASE_NONE, + { "Zone", "nbp.zone", FT_UINT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_nbp_tid, { "Transaction ID", "nbp.tid", FT_UINT8, BASE_DEC, @@ -1911,12 +1885,9 @@ proto_register_atalk(void) { "Network end", "zip.network_end", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, -#if 0 { &hf_zip_flags, - { "Flags", "zip.flags", FT_BOOLEAN, 8, NULL, 0xC0, + { "Flags", "zip.flags", FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL }}, -#endif - { &hf_zip_last_flag, { "Last Flag", "zip.last_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "Non zero if contains last zone name in the zone list", HFILL }}, @@ -1981,7 +1952,7 @@ proto_register_atalk(void) "Sequence number", HFILL }}, { &hf_pap_status, - { "Status", "prap.status", FT_STRING, BASE_NONE, NULL, 0x0, + { "Status", "prap.status", FT_UINT_STRING, BASE_NONE, NULL, 0x0, "Printer status", HFILL }}, { &hf_pap_eof, @@ -2073,6 +2044,7 @@ proto_reg_handoff_atalk(void) nbp_handle = create_dissector_handle(dissect_nbp, proto_nbp); dissector_add_uint("ddp.type", DDP_NBP, nbp_handle); + dissector_add_for_decode_as("udp.port", nbp_handle); atp_handle = create_dissector_handle(dissect_atp, proto_atp); dissector_add_uint("ddp.type", DDP_ATP, atp_handle); diff --git a/epan/dissectors/packet-beep.c b/epan/dissectors/packet-beep.c index 2da36c62ba..99088bc5cd 100644 --- a/epan/dissectors/packet-beep.c +++ b/epan/dissectors/packet-beep.c @@ -69,6 +69,7 @@ static int hf_beep_ackno = -1; static int hf_beep_window = -1; static int hf_beep_payload = -1; static int hf_beep_payload_undissected = -1; +static int hf_beep_crlf_terminator = -1; #if 0 static const value_string beep_status_vals[] = { @@ -282,7 +283,7 @@ check_term(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tree) if ((tvb_get_guint8(tvb, offset) == 0x0d && tvb_get_guint8(tvb, offset + 1) == 0x0a)){ /* Correct terminator */ - proto_tree_add_text(tree, tvb, offset, 2, "Terminator: CRLF"); + proto_tree_add_item(tree, hf_beep_crlf_terminator, tvb, offset, 2, ENC_NA); return 2; } @@ -351,7 +352,7 @@ dissect_beep_mime_header(tvbuff_t *tvb, packet_info *pinfo, int offset, if (mime_length == 0) { /* Default header */ if (tree) { - proto_tree_add_text(mime_tree, tvb, offset, 0, "Default values"); + proto_tree_add_string_format(mime_tree, hf_beep_header, tvb, offset, 0, "", "Default values"); } if ((cc = check_term(tvb, pinfo, offset, mime_tree)) <= 0) { @@ -964,6 +965,9 @@ proto_register_beep(void) { &hf_beep_payload_undissected, { "Undissected Payload", "beep.payload_undissected", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + + { &hf_beep_crlf_terminator, + { "Terminator: CRLF", "beep.crlf_terminator", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, }; static gint *ett[] = { &ett_beep, |