2 * Routines for the disassembly of the Cisco Group Management Protocol
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
13 #include <epan/packet.h>
14 #include <epan/cisco_pid.h>
19 * http://www.barnett.sk/software/bbooks/cisco_multicasting_routing/chap04.html
21 * for some information on CGMP.
23 void proto_register_cgmp(void);
24 void proto_reg_handoff_cgmp(void);
26 static dissector_handle_t cgmp_handle
;
28 static int proto_cgmp
;
29 static int hf_cgmp_version
;
30 static int hf_cgmp_type
;
31 static int hf_cgmp_reserved
;
32 static int hf_cgmp_count
;
33 static int hf_cgmp_gda
;
34 static int hf_cgmp_usa
;
38 static const value_string type_vals
[] = {
45 dissect_cgmp(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
, void* data _U_
)
48 proto_tree
*cgmp_tree
= NULL
;
52 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, "CGMP");
53 col_set_str(pinfo
->cinfo
, COL_INFO
, "Cisco Group Management Protocol");
56 ti
= proto_tree_add_item(tree
, proto_cgmp
, tvb
, offset
, -1,
58 cgmp_tree
= proto_item_add_subtree(ti
, ett_cgmp
);
60 proto_tree_add_item(cgmp_tree
, hf_cgmp_version
, tvb
, offset
, 1,
62 proto_tree_add_item(cgmp_tree
, hf_cgmp_type
, tvb
, offset
, 1,
66 proto_tree_add_item(cgmp_tree
, hf_cgmp_reserved
, tvb
, offset
, 2,
70 count
= tvb_get_uint8(tvb
, offset
);
71 proto_tree_add_uint(cgmp_tree
, hf_cgmp_count
, tvb
, offset
, 1,
76 proto_tree_add_item(cgmp_tree
, hf_cgmp_gda
, tvb
, offset
, 6,
80 proto_tree_add_item(cgmp_tree
, hf_cgmp_usa
, tvb
, offset
, 6,
87 return tvb_captured_length(tvb
);
91 proto_register_cgmp(void)
93 static hf_register_info hf
[] = {
95 { "Version", "cgmp.version", FT_UINT8
, BASE_DEC
, NULL
, 0xF0,
99 { "Type", "cgmp.type", FT_UINT8
, BASE_DEC
, VALS(type_vals
), 0x0F,
103 { "Reserved", "cgmp.reserved", FT_UINT16
, BASE_HEX
, NULL
, 0x0,
107 { "Count", "cgmp.count", FT_UINT8
, BASE_DEC
, NULL
, 0x0,
111 { "Group Destination Address", "cgmp.gda", FT_ETHER
, BASE_NONE
, NULL
, 0x0,
115 { "Unicast Source Address", "cgmp.usa", FT_ETHER
, BASE_NONE
, NULL
, 0x0,
118 static int *ett
[] = {
122 proto_cgmp
= proto_register_protocol("Cisco Group Management Protocol",
124 proto_register_field_array(proto_cgmp
, hf
, array_length(hf
));
125 proto_register_subtree_array(ett
, array_length(ett
));
127 cgmp_handle
= register_dissector("cgmp", dissect_cgmp
, proto_cgmp
);
131 proto_reg_handoff_cgmp(void)
133 dissector_add_uint("llc.cisco_pid", CISCO_PID_CGMP
, cgmp_handle
);
134 dissector_add_uint("ethertype", 0x2001, cgmp_handle
);
138 * Editor modelines - https://www.wireshark.org/tools/modelines.html
143 * indent-tabs-mode: t
146 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
147 * :indentSize=8:tabSize=8:noTabs=false: