diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2012-09-17 15:17:48 +0000 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2012-09-17 15:17:48 +0000 |
commit | 9e5e7b75df1b1d4d1f6e37877a11f9623bf6fd6c (patch) | |
tree | 2a0be2448cf4b61151312e683eb23df22fd06b24 /epan | |
parent | c5826e292ac0d35fcdd132d5f2c9ace54c0fbc33 (diff) |
From me via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7709
Enhance DNS Dissector
Enhance DNS : make MX filtereable
svn path=/trunk/; revision=44942
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-dns.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 45c8295097..d630dc41af 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -112,6 +112,8 @@ static int hf_dns_hinfo_cpu_length = -1; static int hf_dns_hinfo_cpu = -1; static int hf_dns_hinfo_os_length = -1; static int hf_dns_hinfo_os = -1; +static int hf_dns_mx_preference = -1; +static int hf_dns_mx_mail_exchange = -1; static int hf_dns_rr_ns = -1; static int hf_dns_rr_opt = -1; static int hf_dns_rr_opt_code = -1; @@ -1646,7 +1648,7 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset, } break; - case T_MX: + case T_MX: /* Mail Exchange (15) */ { guint16 preference = 0; const guchar *mx_name; @@ -1661,9 +1663,10 @@ dissect_dns_answer(tvbuff_t *tvb, int offsetx, int dns_data_offset, } proto_item_append_text(trr, ", preference %u, mx %s", preference, name_out); - proto_tree_add_text(rr_tree, tvb, cur_offset, 2, "Preference: %u", preference); - proto_tree_add_text(rr_tree, tvb, cur_offset + 2, mx_name_len, "Mail exchange: %s", - name_out); + proto_tree_add_item(rr_tree, hf_dns_mx_preference, tvb, cur_offset, 2, ENC_BIG_ENDIAN); + cur_offset += 2; + proto_tree_add_string(rr_tree, hf_dns_mx_mail_exchange, tvb, cur_offset, mx_name_len, name_out); + /* cur_offset += mx_name_len; */ } break; @@ -4100,6 +4103,16 @@ proto_register_dns(void) FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_dns_mx_preference, + { "Preference", "dns.mx.preference", + FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + { &hf_dns_mx_mail_exchange, + { "Mail Exchange", "dns.mx.mail_exchange", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + { &hf_dns_rr_ns, { "Name Server", "dns.resp.ns", FT_STRING, BASE_NONE, NULL, 0x0, |