diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-13 08:56:22 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-08-14 04:21:05 +0000 |
commit | d68d0e88b4924a610b5cd2fd3a748b00c9bbab1a (patch) | |
tree | f46c04238502faa689c173f1b8420c8d19d3c51e /epan/dissectors/packet-lwres.c | |
parent | f64421df3f230e89e0d83e327926f4c46fbd70dc (diff) |
Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.
Change-Id: If73a029f564219782c313d4154c24c7ce7458b52
Reviewed-on: https://code.wireshark.org/review/3574
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-lwres.c')
-rw-r--r-- | epan/dissectors/packet-lwres.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/epan/dissectors/packet-lwres.c b/epan/dissectors/packet-lwres.c index 6a37802751..dee7675976 100644 --- a/epan/dissectors/packet-lwres.c +++ b/epan/dissectors/packet-lwres.c @@ -137,11 +137,12 @@ static int hf_realnamelen = -1; static int hf_realname = -1; -/* static int hf_a_record = -1; */ +static int hf_a_record = -1; static int hf_a_rec_len = -1; static int hf_srv_prio = -1; static int hf_srv_weight = -1; static int hf_srv_port = -1; +static int hf_srv_dname = -1; static int hf_adn_flags = -1; static int hf_adn_addrtype = -1; @@ -157,6 +158,7 @@ static int hf_adn_family = -1; static int hf_adn_addr_len = -1; static int hf_adn_addr_addr = -1; +static int hf_ns_dname = -1; static int ett_lwres = -1; static int ett_rdata_req = -1; @@ -470,9 +472,7 @@ static void dissect_a_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int o proto_tree_add_item(addr_tree, hf_a_rec_len, tvb, curr, sizeof(guint16), ENC_BIG_ENDIAN); - proto_tree_add_text(addr_tree, tvb, curr + 2, 4, "Addr: %s", - addrs); - + proto_tree_add_item(addr_tree, hf_a_record, tvb, curr + 2, 4, ENC_BIG_ENDIAN); } } @@ -529,11 +529,12 @@ static void dissect_srv_records(tvbuff_t* tvb, proto_tree* tree,guint32 nrec,int port); - proto_tree_add_text(rec_tree, + proto_tree_add_string(rec_tree, + hf_srv_dname, tvb, curr + 8, dlen, - "DNAME: %s", dname); + dname); curr+=(int)((sizeof(short)*4) + dlen); @@ -576,11 +577,12 @@ static void dissect_mx_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in 2, ENC_BIG_ENDIAN); - proto_tree_add_text(rec_tree, + proto_tree_add_string(rec_tree, + hf_srv_dname, tvb, curr + 4, dlen, - "name: %s", dname); + dname); curr+=(int)((sizeof(short)*2) + dlen); @@ -613,11 +615,12 @@ static void dissect_ns_records(tvbuff_t* tvb, proto_tree* tree, guint32 nrec, in rec_tree = proto_tree_add_subtree_format(ns_rec_tree, tvb, curr,4, ett_ns_rec_item, NULL, "NS record: dname=%s",dname); - proto_tree_add_text(rec_tree, + proto_tree_add_string(rec_tree, + hf_ns_dname, tvb, curr + 2, dlen, - "Name: %s", dname); + dname); curr+=(int)(sizeof(short) + dlen); } @@ -1032,11 +1035,9 @@ proto_register_lwres(void) { "Real doname name", "lwres.realname", FT_STRING, BASE_NONE, NULL, 0x0, "lwres realname", HFILL }}, -#if 0 { &hf_a_record, { "IPv4 Address", "lwres.arecord", FT_UINT32, BASE_DEC, NULL, 0x0, "lwres arecord", HFILL }}, -#endif { &hf_a_rec_len, { "Length", "lwres.areclen", FT_UINT16, BASE_DEC, NULL, 0x0, @@ -1054,6 +1055,10 @@ proto_register_lwres(void) { "Port" , "lwres.srv.port", FT_UINT16, BASE_DEC, NULL, 0x0, "lwres srv port", HFILL }}, + { &hf_srv_dname, + { "DNAME" , "lwres.srv.dname", FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + { &hf_adn_flags, { "Flags", "lwres.adn.flags", FT_UINT32, BASE_HEX, NULL, 0x0, "lwres adn flags", HFILL }}, @@ -1098,6 +1103,10 @@ proto_register_lwres(void) { "IP Address", "lwres.adn.addr.addr", FT_STRING, BASE_NONE, NULL, 0x0, "lwres adn addr addr", HFILL }}, + { &hf_ns_dname, + { "Name" , "lwres.ns.dname", FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + /* Add more fields here */ }; |