*
* $Id$
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include <glib.h>
#include <epan/packet.h>
-#include "etypes.h"
+#include <epan/etypes.h>
#include "packet-hpext.h"
#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" },
{ HPFOO_FIELD_8, "Field 8" },
{ HPFOO_FIELD_9, "Field 9" },
{ HPFOO_FIELD_10, "Field 10" },
+ { HPFOO_MAC_ADDR, "MAC Addr" },
{ 0x00, NULL }
};
}
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;
VALS(hpsw_tlv_type_vals), 0x0, "", HFILL }},
{ &hf_hpsw_tlvlength,
{ "Length", "hpsw.tlv_len", FT_UINT8, BASE_DEC,
- NULL, 0x0, "", HFILL }},
+ NULL, 0x0, "", HFILL }}
};
static gint *ett[] = {
&ett_hpsw,
- &ett_hpsw_tlv,
+ &ett_hpsw_tlv
};
proto_hpsw = proto_register_protocol( "HP Switch Protocol", "HPSW", "hpsw");
hpsw_handle = find_dissector("hpsw");
- dissector_add("hpext.dxsap", 0x0623, hpsw_handle);
+ dissector_add("hpext.dxsap", HPEXT_HPSW, hpsw_handle);
}