/src/wireshark/epan/dissectors/packet-ncs.c
Line | Count | Source |
1 | | /* packet-ncs.c |
2 | | * Routines for Novell Cluster Services |
3 | | * Greg Morris <gmorris@novell.com> |
4 | | * Copyright (c) Novell, Inc. 2002-2005 |
5 | | * |
6 | | * Wireshark - Network traffic analyzer |
7 | | * By Gerald Combs <gerald@wireshark.org> |
8 | | * Copyright 1998 Gerald Combs |
9 | | * |
10 | | * SPDX-License-Identifier: GPL-2.0-or-later |
11 | | */ |
12 | | |
13 | | |
14 | | #include "config.h" |
15 | | |
16 | | #include <epan/packet.h> |
17 | | #include <epan/iana-info.h> |
18 | | |
19 | | void proto_register_ncs(void); |
20 | | void proto_reg_handoff_ncs(void); |
21 | | |
22 | | static dissector_handle_t ncs_handle; |
23 | | |
24 | | static int ett_ncs; |
25 | | |
26 | | static int proto_ncs; |
27 | | |
28 | | static int hf_panning_id; |
29 | | static int hf_incarnation; |
30 | | |
31 | | static int |
32 | | dissect_ncs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) |
33 | 5 | { |
34 | 5 | proto_tree *ncs_tree; |
35 | 5 | proto_item *ti; |
36 | | |
37 | 5 | ti = proto_tree_add_item(tree, proto_ncs, tvb, 0, -1, ENC_NA); |
38 | 5 | ncs_tree = proto_item_add_subtree(ti, ett_ncs); |
39 | | |
40 | 5 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "NCS"); |
41 | 5 | col_set_str(pinfo->cinfo, COL_INFO, "Novell Cluster Services Heartbeat"); |
42 | | |
43 | 5 | proto_tree_add_item(ncs_tree, hf_panning_id, tvb, 4, 4, ENC_BIG_ENDIAN); |
44 | 5 | proto_tree_add_item(ncs_tree, hf_incarnation, tvb, 8, 4, ENC_BIG_ENDIAN); |
45 | 5 | return tvb_captured_length(tvb); |
46 | 5 | } |
47 | | |
48 | | void |
49 | | proto_register_ncs(void) |
50 | 16 | { |
51 | 16 | static hf_register_info hf[] = { |
52 | | |
53 | 16 | { &hf_panning_id, |
54 | 16 | { "Panning ID", "ncs.pan_id", FT_UINT32, BASE_HEX, NULL, 0x0, |
55 | 16 | NULL, HFILL }}, |
56 | | |
57 | 16 | { &hf_incarnation, |
58 | 16 | { "Incarnation", "ncs.incarnation", FT_UINT32, BASE_HEX, NULL, 0x0, |
59 | 16 | NULL, HFILL }}, |
60 | | |
61 | 16 | }; |
62 | 16 | static int *ett[] = { |
63 | 16 | &ett_ncs, |
64 | 16 | }; |
65 | | |
66 | 16 | proto_ncs = proto_register_protocol("Novell Cluster Services", |
67 | 16 | "NCS", "ncs"); |
68 | 16 | proto_register_field_array(proto_ncs, hf, array_length(hf)); |
69 | 16 | proto_register_subtree_array(ett, array_length(ett)); |
70 | | |
71 | 16 | ncs_handle = register_dissector("ncs", dissect_ncs, proto_ncs); |
72 | 16 | } |
73 | | |
74 | | |
75 | | |
76 | | void |
77 | | proto_reg_handoff_ncs(void) |
78 | 16 | { |
79 | 16 | #define IP_PROTO_NCS_HEARTBEAT 224 /* Novell NCS Heartbeat - http://support.novell.com/cgi-bin/search/searchtid.cgi?/10071158.htm */ |
80 | | |
81 | 16 | dissector_add_uint("ip.proto", IP_PROTO_NCS_HEARTBEAT, ncs_handle); |
82 | 16 | } |
83 | | |
84 | | /* |
85 | | * Editor modelines - https://www.wireshark.org/tools/modelines.html |
86 | | * |
87 | | * Local Variables: |
88 | | * c-basic-offset: 2 |
89 | | * tab-width: 8 |
90 | | * indent-tabs-mode: nil |
91 | | * End: |
92 | | * |
93 | | * ex: set shiftwidth=2 tabstop=8 expandtab: |
94 | | * :indentSize=2:tabSize=8:noTabs=true: |
95 | | */ |