HACK: pinfo->private_data points to smb_info again
[wireshark-wip.git] / epan / dissectors / packet-ncs.c
blob2064c3d9c6e6f998f7b705d3928fd8a98604f49f
1 /* packet-ncs.c
2 * Routines for Novell Cluster Services
3 * Greg Morris <gmorris@novell.com>
4 * Copyright (c) Novell, Inc. 2002-2005
6 * $Id$
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 #include "config.h"
30 #include <epan/packet.h>
31 #include <epan/ipproto.h>
33 static gint ett_ncs = -1;
35 static int proto_ncs = -1;
37 static int hf_panning_id = -1;
38 static int hf_incarnation = -1;
40 static void
41 dissect_ncs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
43 proto_tree *ncs_tree = NULL;
44 proto_item *ti;
46 if (tree) {
47 ti = proto_tree_add_item(tree, proto_ncs, tvb, 0, -1, ENC_NA);
48 ncs_tree = proto_item_add_subtree(ti, ett_ncs);
52 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NCS");
53 col_set_str(pinfo->cinfo, COL_INFO, "Novell Cluster Services Heartbeat");
55 proto_tree_add_item(ncs_tree, hf_panning_id, tvb, 4, 4, ENC_BIG_ENDIAN);
56 proto_tree_add_item(ncs_tree, hf_incarnation, tvb, 8, 4, ENC_BIG_ENDIAN);
59 void
60 proto_register_ncs(void)
62 static hf_register_info hf[] = {
64 { &hf_panning_id,
65 { "Panning ID", "ncs.pan_id", FT_UINT32, BASE_HEX, NULL, 0x0,
66 NULL, HFILL }},
68 { &hf_incarnation,
69 { "Incarnation", "ncs.incarnation", FT_UINT32, BASE_HEX, NULL, 0x0,
70 NULL, HFILL }},
73 static gint *ett[] = {
74 &ett_ncs,
77 proto_ncs = proto_register_protocol("Novell Cluster Services",
78 "NCS", "ncs");
79 proto_register_field_array(proto_ncs, hf, array_length(hf));
80 proto_register_subtree_array(ett, array_length(ett));
85 void
86 proto_reg_handoff_ncs(void)
88 dissector_handle_t ncs_handle;
90 ncs_handle = create_dissector_handle(dissect_ncs, proto_ncs);
91 dissector_add_uint("ip.proto", IP_PROTO_NCS_HEARTBEAT, ncs_handle);