I just found a packet with an option e. As the value looked very much
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 9 May 2005 11:21:16 +0000 (11:21 +0000)
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 9 May 2005 11:21:16 +0000 (11:21 +0000)
like the mac-address of the switch, I added decoding of option e as
mac address.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14336 f5534014-38df-0310-8fa8-9805f1628bb7

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;