2 * Routines for the disassembly of the Cisco Group Management Protocol
4 * $Id: packet-cgmp.c,v 1.2 2000/05/11 08:15:04 gram Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
8 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #ifdef HAVE_SYS_TYPES_H
29 #include <sys/types.h>
41 * http://www.barnett.sk/software/bbooks/cisco_multicasting_routing/chap04.html
43 * for some information on CGMP.
46 static int proto_cgmp = -1;
47 static int hf_cgmp_version = -1;
48 static int hf_cgmp_type = -1;
49 static int hf_cgmp_count = -1;
50 static int hf_cgmp_gda = -1;
51 static int hf_cgmp_usa = -1;
53 static gint ett_cgmp = -1;
55 static const value_string type_vals[] = {
62 dissect_cgmp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
65 proto_tree *cgmp_tree = NULL;
68 if (check_col(fd, COL_PROTOCOL))
69 col_add_str(fd, COL_PROTOCOL, "CGMP");
70 if (check_col(fd, COL_INFO))
71 col_add_str(fd, COL_INFO, "Cisco Group Management Protocol");
74 ti = proto_tree_add_item(tree, proto_cgmp, NullTVB, offset, END_OF_FRAME, NULL);
75 cgmp_tree = proto_item_add_subtree(ti, ett_cgmp);
77 proto_tree_add_item(cgmp_tree, hf_cgmp_version, NullTVB, offset, 1,
79 proto_tree_add_item(cgmp_tree, hf_cgmp_type, NullTVB, offset, 1,
83 offset += 2; /* skip reserved field */
86 proto_tree_add_item(cgmp_tree, hf_cgmp_count, NullTVB, offset, 1,
91 if (!BYTES_ARE_IN_FRAME(offset, 6))
93 proto_tree_add_item(cgmp_tree, hf_cgmp_gda, NullTVB, offset, 6,
97 if (!BYTES_ARE_IN_FRAME(offset, 6))
99 proto_tree_add_item(cgmp_tree, hf_cgmp_usa, NullTVB, offset, 6,
109 proto_register_cgmp(void)
111 static hf_register_info hf[] = {
113 { "Version", "cgmp.version", FT_UINT8, BASE_DEC, NULL, 0xF0,
117 { "Type", "cgmp.type", FT_UINT8, BASE_DEC, VALS(type_vals), 0x0F,
121 { "Count", "cgmp.count", FT_UINT8, BASE_DEC, NULL, 0x0,
125 { "Group Destination Address", "cgmp.gda", FT_ETHER, BASE_NONE, NULL, 0x0,
126 "Group Destination Address" }},
129 { "Unicast Source Address", "cgmp.usa", FT_ETHER, BASE_NONE, NULL, 0x0,
130 "Unicast Source Address" }},
132 static gint *ett[] = {
136 proto_cgmp = proto_register_protocol("Cisco Group Management Protocol", "cgmp");
137 proto_register_field_array(proto_cgmp, hf, array_length(hf));
138 proto_register_subtree_array(ett, array_length(ett));