I just found a packet with an option e. As the value looked very much
[obnox/wireshark/wip.git] / epan / dissectors / packet-hpsw.c
index 1c3ad4df716979ed0129b9dd5e34640cd8fe75be..f05c8f97466044df0d182653de4730ee87f939cc 100644 (file)
@@ -57,6 +57,7 @@ static gint ett_hpsw_tlv = -1;
 #define HPFOO_FIELD_8 0x8
 #define HPFOO_FIELD_9 0x9
 #define HPFOO_FIELD_10 0xa
+#define HPFOO_MAC_ADDR 0xe
 
 static const value_string hpsw_tlv_type_vals[] = {
        { HPFOO_DEVICE_NAME,       "Device Name" },
@@ -67,6 +68,7 @@ static const value_string hpsw_tlv_type_vals[] = {
        { HPFOO_FIELD_8,     "Field 8" },
        { HPFOO_FIELD_9,     "Field 9" },
        { HPFOO_FIELD_10,     "Field 10" },
+       { HPFOO_MAC_ADDR,     "MAC Addr" },
        { 0x00,               NULL }
 };
 
@@ -220,6 +222,17 @@ dissect_hpsw_tlv(tvbuff_t *tvb, int offset, int length,
         }
         break;
 
+    case HPFOO_MAC_ADDR:
+        if (length == 6) {
+            const guint8 *macptr=tvb_get_ptr(tvb,offset,length);
+            proto_item_set_text(ti, "MAC Addr: %s", ether_to_str(macptr));
+            proto_tree_add_text(tree, tvb, offset, length, "MAC Addr: %s", ether_to_str(macptr));
+        } else {
+            proto_item_set_text(ti, "MAC Addr: Bad length %u", length);
+            proto_tree_add_text(tree, tvb, offset, length, "MAC Addr: Bad length %u", length);
+        }
+        break;
+
     default:
         proto_tree_add_text(tree, tvb, offset, length, "Data");
         break;