2005-12-22 01:26:04 +00:00
|
|
|
/* packet-msnlb.c
|
|
|
|
* Routines for MS NLB dissection
|
|
|
|
*
|
|
|
|
* $Id$
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2005-12-22 01:26:04 +00:00
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gmodule.h>
|
|
|
|
#include <epan/packet.h>
|
|
|
|
#include <epan/proto.h>
|
|
|
|
#include <epan/etypes.h>
|
|
|
|
#include "packet-smb-common.h"
|
|
|
|
|
|
|
|
/* Initialize the protocol and registered fields */
|
|
|
|
static int proto_msnlb = -1;
|
|
|
|
|
|
|
|
static int hf_msnlb_unknown = -1;
|
2006-01-24 11:54:27 +00:00
|
|
|
static int hf_msnlb_hpn = -1;
|
2005-12-22 01:26:04 +00:00
|
|
|
static int hf_msnlb_cls_virt_ip = -1;
|
|
|
|
static int hf_msnlb_host_ip = -1;
|
2006-01-24 11:54:27 +00:00
|
|
|
static int hf_msnlb_count = -1;
|
2005-12-22 01:26:04 +00:00
|
|
|
static int hf_msnlb_host_name = -1;
|
|
|
|
|
|
|
|
/* Initialize the subtree pointers */
|
|
|
|
static gint ett_msnlb = -1;
|
|
|
|
|
|
|
|
/* Code to actually dissect the packets */
|
|
|
|
static void
|
|
|
|
dissect_msnlb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|
|
|
{
|
|
|
|
proto_item *ti;
|
|
|
|
proto_tree *msnlb_tree;
|
|
|
|
guint16 offset = 0;
|
|
|
|
|
|
|
|
guint8 type = 0; /* Blatent assumption of name and size */
|
|
|
|
|
2009-08-09 06:26:46 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MS NLB");
|
2005-12-22 01:26:04 +00:00
|
|
|
|
2010-01-13 20:25:10 +00:00
|
|
|
col_set_str(pinfo->cinfo, COL_INFO, "MS NLB heartbeat");
|
2005-12-22 01:26:04 +00:00
|
|
|
|
|
|
|
if (tree) {
|
|
|
|
ti = proto_tree_add_item(tree, proto_msnlb, tvb, 0, -1, FALSE);
|
|
|
|
msnlb_tree = proto_item_add_subtree(ti, ett_msnlb);
|
|
|
|
|
|
|
|
type = tvb_get_guint8(tvb, offset);
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
2006-01-24 11:54:27 +00:00
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_hpn, tvb, offset, 4, TRUE);
|
2005-12-22 01:26:04 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_cls_virt_ip, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_host_ip, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case 0xc0:
|
|
|
|
offset = display_unicode_string(tvb, msnlb_tree, offset, hf_msnlb_host_name, NULL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 0xbf:
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
2006-01-24 11:54:27 +00:00
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_count, tvb, offset, 4, TRUE);
|
2005-12-22 01:26:04 +00:00
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, 4, FALSE);
|
|
|
|
offset += 4;
|
|
|
|
|
|
|
|
default:
|
|
|
|
proto_tree_add_item(msnlb_tree, hf_msnlb_unknown, tvb, offset, tvb_length_remaining(tvb, offset), FALSE);
|
|
|
|
offset += 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_register_msnlb(void)
|
|
|
|
{
|
|
|
|
static hf_register_info hf[] = {
|
|
|
|
{ &hf_msnlb_unknown,
|
|
|
|
{ "Unknown", "msnlb.unknown",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_BYTES, BASE_NONE,
|
2005-12-22 01:26:04 +00:00
|
|
|
NULL, 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2005-12-22 01:26:04 +00:00
|
|
|
},
|
2006-01-24 11:54:27 +00:00
|
|
|
{ &hf_msnlb_hpn,
|
|
|
|
{ "Host Priority Number", "msnlb.hpn",
|
|
|
|
FT_UINT32, BASE_DEC,
|
|
|
|
NULL, 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-01-24 11:54:27 +00:00
|
|
|
},
|
2005-12-22 01:26:04 +00:00
|
|
|
{ &hf_msnlb_host_ip,
|
|
|
|
{ "Host IP", "msnlb.host_ip",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_IPv4, BASE_NONE,
|
2005-12-22 01:26:04 +00:00
|
|
|
NULL, 0,
|
|
|
|
"Host IP address", HFILL }
|
|
|
|
},
|
|
|
|
{ &hf_msnlb_cls_virt_ip,
|
|
|
|
{ "Cluster Virtual IP", "msnlb.cluster_virtual_ip",
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
FT_IPv4, BASE_NONE,
|
2005-12-22 01:26:04 +00:00
|
|
|
NULL, 0,
|
|
|
|
"Cluster Virtual IP address", HFILL }
|
|
|
|
},
|
2006-01-24 11:54:27 +00:00
|
|
|
{ &hf_msnlb_count,
|
|
|
|
{ "Count", "msnlb.count",
|
|
|
|
FT_UINT32, BASE_HEX,
|
|
|
|
NULL, 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2006-01-24 11:54:27 +00:00
|
|
|
},
|
2005-12-22 01:26:04 +00:00
|
|
|
{ &hf_msnlb_host_name,
|
|
|
|
{ "Host name", "msnlb.host_name",
|
|
|
|
FT_STRING, BASE_NONE,
|
|
|
|
NULL, 0,
|
From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero
svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
|
|
|
NULL, HFILL }
|
2005-12-22 01:26:04 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static gint *ett[] = {
|
|
|
|
&ett_msnlb
|
|
|
|
};
|
|
|
|
|
|
|
|
proto_msnlb = proto_register_protocol("MS Network Load Balancing", "MS NLB", "msnlb");
|
|
|
|
proto_register_field_array(proto_msnlb, hf, array_length(hf));
|
|
|
|
proto_register_subtree_array(ett, array_length(ett));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
proto_reg_handoff_msnlb(void)
|
|
|
|
{
|
|
|
|
dissector_handle_t msnlb_handle;
|
|
|
|
|
|
|
|
msnlb_handle = create_dissector_handle(dissect_msnlb, proto_msnlb);
|
|
|
|
dissector_add("ethertype", ETHERTYPE_MS_NLB_HEARTBEAT, msnlb_handle);
|
|
|
|
}
|