aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dhcpv6.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-20 12:20:56 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-20 12:20:56 +0000
commitfe8bef7b2cddcac01b096e6e6de9cf14a36130eb (patch)
treecb1fbf4fb96f1b23987d9c1be9398e6a6ee82d2d /epan/dissectors/packet-dhcpv6.c
parente464dc3d1524b66c07a2533e517924a8ff3d34c2 (diff)
prettify the HW type and address printouts slightly.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14969 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-dhcpv6.c')
-rw-r--r--epan/dissectors/packet-dhcpv6.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/epan/dissectors/packet-dhcpv6.c b/epan/dissectors/packet-dhcpv6.c
index e99f01a604..edaaef6410 100644
--- a/epan/dissectors/packet-dhcpv6.c
+++ b/epan/dissectors/packet-dhcpv6.c
@@ -48,6 +48,7 @@
#include <glib.h>
#include <epan/packet.h>
#include <epan/ipv6-utils.h>
+#include "packet-arp.h"
static int proto_dhcpv6 = -1;
static int hf_dhcpv6_msgtype = -1;
@@ -292,6 +293,7 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
guint8 *buf;
guint16 opttype;
guint16 optlen;
+ guint16 hwtype;
guint16 temp_optlen = 0;
proto_item *ti;
proto_tree *subtree;
@@ -344,15 +346,18 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
optlen, "DUID: malformed option");
break;
}
- /* XXX seconds since Jan 1 2000 */
+ hwtype=tvb_get_ntohs(tvb, off + 2);
proto_tree_add_text(subtree, tvb, off + 2, 2,
- "Hardware type: %u",
- tvb_get_ntohs(tvb, off + 2));
+ "Hardware type: %s (%u)",
+ arphrdtype_to_str(hwtype, "Unknown"),
+ hwtype);
+ /* XXX seconds since Jan 1 2000 */
proto_tree_add_text(subtree, tvb, off + 4, 4,
"Time: %u", tvb_get_ntohl(tvb, off + 4));
if (optlen > 8) {
proto_tree_add_text(subtree, tvb, off + 8,
- optlen - 8, "Link-layer address");
+ optlen - 8, "Link-layer address: %s",
+ arphrdaddr_to_str(tvb_get_ptr(tvb, off+8, optlen-8), optlen-8, hwtype));
}
break;
case DUID_EN:
@@ -375,12 +380,15 @@ dhcpv6_option(tvbuff_t *tvb, packet_info *pinfo, proto_tree *bp_tree,
optlen, "DUID: malformed option");
break;
}
+ hwtype=tvb_get_ntohs(tvb, off + 2);
proto_tree_add_text(subtree, tvb, off + 2, 2,
- "Hardware type: %u",
- tvb_get_ntohs(tvb, off + 2));
+ "Hardware type: %s (%u)",
+ arphrdtype_to_str(hwtype, "Unknown"),
+ hwtype);
if (optlen > 4) {
proto_tree_add_text(subtree, tvb, off + 4,
- optlen - 4, "Link-layer address");
+ optlen - 4, "Link-layer address: %s",
+ arphrdaddr_to_str(tvb_get_ptr(tvb, off+4, optlen-4), optlen-4, hwtype));
}
break;
}