2009-06-23 21:05:47 +00:00
|
|
|
/* packet-hpteam.c
|
|
|
|
* Routines for HP Teaming heartbeat dissection
|
|
|
|
* Copyright 2009, Nathan Hartwell <nhartwell@gmail.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
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
|
|
|
* USA.
|
|
|
|
*/
|
|
|
|
|
2012-09-20 02:03:38 +00:00
|
|
|
#include "config.h"
|
2009-06-23 21:05:47 +00:00
|
|
|
|
|
|
|
#include <epan/packet.h>
|
2013-11-09 13:41:10 +00:00
|
|
|
#include <epan/to_str.h>
|
2009-06-23 21:05:47 +00:00
|
|
|
#include <epan/oui.h>
|
2014-12-20 21:23:59 +00:00
|
|
|
#include "packet-llc.h"
|
2009-06-23 21:05:47 +00:00
|
|
|
|
2013-12-15 23:44:12 +00:00
|
|
|
void proto_register_hpteam(void);
|
|
|
|
void proto_reg_handoff_hpteam(void);
|
2009-06-23 21:05:47 +00:00
|
|
|
|
|
|
|
static int proto_hpteam = -1;
|
|
|
|
|
|
|
|
/* Known HP NIC teaming PID values */
|
|
|
|
static const value_string hpteam_pid_vals[] = {
|
2011-12-14 02:55:26 +00:00
|
|
|
{ 0x0002, "HP Teaming heartbeat" },
|
2009-06-23 21:05:47 +00:00
|
|
|
{ 0, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static gint hf_hpteam = -1;
|
|
|
|
static gint hf_llc_hpteam_pid = -1;
|
|
|
|
|
|
|
|
/* These are the ids of the subtrees that we may be creating */
|
|
|
|
static gint ett_hpteam = -1;
|
|
|
|
|
2016-12-17 01:06:11 +00:00
|
|
|
static dissector_handle_t hpteam_handle;
|
|
|
|
|
2011-12-14 02:55:26 +00:00
|
|
|
/*
|
|
|
|
* According to the HP document at
|
|
|
|
*
|
|
|
|
* http://www.hp.com/sbso/bus_protect/teaming.pdf
|
|
|
|
*
|
|
|
|
* the heartbeats are sent to 03-00-C7-00-00-EE in SNAP frames
|
|
|
|
* in unnumbered TEST frames. It says that the LLC header is
|
|
|
|
* followed by 63 bytes of "Insignificant data" and the FCS.
|
|
|
|
* This means that the SNAP header is part of the "Insignificant
|
|
|
|
* data".
|
|
|
|
*
|
|
|
|
* The SNAP specification (section 10.3 "Subnetwork Access Protocol"
|
|
|
|
* of IEEE Std 802-2001) says that *all* SNAP PDUs have an LLC
|
|
|
|
* payload that starts with the 5-octet Protocol Identification
|
|
|
|
* field, i.e. the OUI and PID.
|
|
|
|
*
|
|
|
|
* At least some Teaming heartbeat packets have an OUI of 00-80-5F,
|
|
|
|
* which belongs to HP, and a protocol ID of 0x0002.
|
|
|
|
*
|
|
|
|
* If all heartbeat packets have that OUI/PID combination, and no other
|
|
|
|
* packets have it, the right way to recognize them is by registering
|
|
|
|
* the PID of 0x0002 in the dissector table for that OUI; there is no
|
|
|
|
* need to check the destination MAC address.
|
|
|
|
*
|
|
|
|
* If not all heartbeat packets have that OUI/PID combination and/or other
|
|
|
|
* packets have it, the only way to recognize them would be to add
|
|
|
|
* support for heuristic dissectors to the SNAP dissector, register this
|
|
|
|
* as a heuristic dissector for that table, and have it compare pinfo->dl_dst
|
|
|
|
* against an address structure with a type of AT_ETHER, a length of 6,
|
|
|
|
* and data of 03-00-C7-00-00-EE. It is *not* sufficient to just check
|
|
|
|
* pinfo->dl_dst.data, as there is no guarantee that it will be a MAC
|
|
|
|
* address - SNAP frames can also be captured with "Linux cooked mode"
|
|
|
|
* headers, e.g. on the "any" device, and those only have a destination
|
|
|
|
* address for packets sent by the machine capturing the traffic, not for
|
|
|
|
* packets received by the machine.
|
|
|
|
*/
|
|
|
|
|
2015-11-14 01:18:34 +00:00
|
|
|
static int
|
|
|
|
dissect_hpteam(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
2009-06-23 21:05:47 +00:00
|
|
|
{
|
|
|
|
|
2011-12-14 02:55:26 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "HP NIC Team");
|
2011-12-14 05:23:57 +00:00
|
|
|
col_add_fstr(pinfo->cinfo, COL_INFO, "HP NIC Teaming Heartbeat; Port MAC = %s",
|
2014-06-19 19:05:00 +00:00
|
|
|
address_to_str(wmem_packet_scope(), &pinfo->dl_src));
|
2009-06-23 21:05:47 +00:00
|
|
|
|
2011-12-14 02:55:26 +00:00
|
|
|
if (tree) { /* we are being asked for details */
|
2012-05-17 20:13:22 +00:00
|
|
|
proto_item *hpteam_item;
|
|
|
|
proto_tree *hpteam_tree;
|
2011-12-14 02:55:26 +00:00
|
|
|
hpteam_item = proto_tree_add_item(tree, proto_hpteam, tvb, 0, -1, ENC_NA);
|
|
|
|
hpteam_tree = proto_item_add_subtree(hpteam_item, ett_hpteam);
|
2012-05-17 20:13:22 +00:00
|
|
|
proto_tree_add_item(hpteam_tree, hf_hpteam, tvb, 0, -1, ENC_NA);
|
2009-06-23 21:05:47 +00:00
|
|
|
}
|
2015-11-14 01:18:34 +00:00
|
|
|
return tvb_captured_length(tvb);
|
2009-06-23 21:05:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void proto_register_hpteam(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf_pid = {
|
|
|
|
&hf_llc_hpteam_pid,
|
2012-05-17 20:13:22 +00:00
|
|
|
{ "PID", "llc.hpteam_pid",
|
|
|
|
FT_UINT16, BASE_HEX, VALS(hpteam_pid_vals),
|
|
|
|
0x0, NULL, HFILL }
|
2009-06-23 21:05:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static hf_register_info hf_data[] = {
|
|
|
|
{&hf_hpteam,
|
2012-05-17 20:13:22 +00:00
|
|
|
{ "Proprietary Data", "hpteam.data",
|
|
|
|
FT_BYTES, BASE_NONE, NULL, 0x0,
|
|
|
|
NULL, HFILL }
|
|
|
|
}
|
2009-06-23 21:05:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_hpteam
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_hpteam = proto_register_protocol ("HP NIC Teaming Heartbeat", "HPTEAM", "hpteam");
|
|
|
|
|
2011-10-21 02:10:19 +00:00
|
|
|
/*Tied into the LLC dissector so register the OUI with LLC*/
|
2016-03-13 11:51:45 +00:00
|
|
|
llc_add_oui(OUI_HP_2, "llc.hpteam_pid", "LLC Hewlett Packard OUI PID", &hf_pid, proto_hpteam);
|
2009-06-23 21:05:47 +00:00
|
|
|
proto_register_field_array(proto_hpteam, hf_data, array_length(hf_data));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
2016-12-17 01:06:11 +00:00
|
|
|
hpteam_handle = register_dissector("hpteam", dissect_hpteam, proto_hpteam);
|
2009-06-23 21:05:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void proto_reg_handoff_hpteam(void)
|
|
|
|
{
|
2009-06-24 00:29:54 +00:00
|
|
|
/* Register dissector to key off of known PID / OUI combination */
|
2010-12-20 05:35:29 +00:00
|
|
|
dissector_add_uint("llc.hpteam_pid", 0x0002, hpteam_handle);
|
2009-06-23 21:05:47 +00:00
|
|
|
}
|
2014-09-30 23:12:26 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 8
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
|
|
|
|
* :indentSize=8:tabSize=8:noTabs=false:
|
|
|
|
*/
|