# include "config.h"
#endif
-#include <stdio.h>
#include <string.h>
#include <glib.h>
};
#define PRINT_IGMP_VERSION(version) \
- if (check_col(pinfo->cinfo, COL_INFO)) { \
- col_add_fstr(pinfo->cinfo, COL_INFO, \
- "V%d %s",version,val_to_str(type, commands, \
- "Unknown Type:0x%02x")); \
- } \
- /* version of IGMP protocol */ \
- proto_tree_add_uint(tree, hf_version, tvb, 0, 0, version); \
- /* type of command */ \
- proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type); \
- offset += 1;
+ do { \
+ proto_item *ti; \
+ if (check_col(pinfo->cinfo, COL_INFO)) { \
+ col_add_fstr(pinfo->cinfo, COL_INFO, \
+ "V%d %s",version,val_to_str(type, commands, \
+ "Unknown Type:0x%02x")); \
+ } \
+ /* version of IGMP protocol */ \
+ ti = proto_tree_add_uint(tree, hf_version, tvb, 0, 0, version); \
+ PROTO_ITEM_SET_GENERATED(ti); \
+ /* type of command */ \
+ proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type);\
+ offset += 1; \
+ } while (0);
void igmp_checksum(proto_tree *tree, tvbuff_t *tvb, int hf_index,
int hf_index_bad, packet_info *pinfo, guint len)
tree = proto_item_add_subtree(item, ett_igmp);
- if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "IGMP");
- }
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_clear(pinfo->cinfo, COL_INFO);
- }
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "IGMP");
+ col_clear(pinfo->cinfo, COL_INFO);
type = tvb_get_guint8(tvb, offset);
{ &hf_version,
{ "IGMP Version", "igmp.version", FT_UINT8, BASE_DEC,
- NULL, 0, "IGMP Version", HFILL }},
+ NULL, 0, NULL, HFILL }},
{ &hf_group_type,
{ "Type Of Group", "igmp.group_type", FT_UINT8, BASE_DEC,
{ &hf_checksum_bad,
{ "Bad Checksum", "igmp.checksum_bad", FT_BOOLEAN, BASE_NONE,
- NULL, 0, "Bad IGMP Checksum", HFILL }},
+ NULL, 0x0, "Bad IGMP Checksum", HFILL }},
{ &hf_identifier,
{ "Identifier", "igmp.identifier", FT_UINT32, BASE_DEC,
NULL, 0, "IGMP V0 Identifier", HFILL }},
{ &hf_access_key,
- { "Access Key", "igmp.access_key", FT_BYTES, BASE_HEX,
+ { "Access Key", "igmp.access_key", FT_BYTES, BASE_NONE,
NULL, 0, "IGMP V0 Access Key", HFILL }},
{ &hf_max_resp,
{ &hf_saddr,
{ "Source Address", "igmp.saddr", FT_IPv4, BASE_NONE,
- NULL, 0, "Source Address", HFILL }},
+ NULL, 0, NULL, HFILL }},
{ &hf_num_grp_recs,
{ "Num Group Records", "igmp.num_grp_recs", FT_UINT16, BASE_DEC,
{ &hf_record_type,
{ "Record Type", "igmp.record_type", FT_UINT8, BASE_DEC,
- VALS(vs_record_type), 0, "Record Type", HFILL }},
+ VALS(vs_record_type), 0, NULL, HFILL }},
{ &hf_aux_data_len,
{ "Aux Data Len", "igmp.aux_data_len", FT_UINT8, BASE_DEC,
{ &hf_maddr,
{ "Multicast Address", "igmp.maddr", FT_IPv4, BASE_NONE,
- NULL, 0, "Multicast Address", HFILL }},
+ NULL, 0, NULL, HFILL }},
{ &hf_aux_data,
- { "Aux Data", "igmp.aux_data", FT_BYTES, BASE_HEX,
+ { "Aux Data", "igmp.aux_data", FT_BYTES, BASE_NONE,
NULL, 0, "IGMP V3 Auxiliary Data", HFILL }},
{ &hf_max_resp_exp,
{ &hf_mtrace_q_rtg_proto,
{ "Rtg Protocol", "igmp.mtrace.q_rtg_proto", FT_UINT8, BASE_DEC,
- VALS(&mtrace_rtg_vals), 0, "Routing protocol between this and previous hop rtr", HFILL }},
+ VALS(mtrace_rtg_vals), 0, "Routing protocol between this and previous hop rtr", HFILL }},
{ &hf_mtrace_q_fwd_ttl,
{ "FwdTTL", "igmp.mtrace.q_fwd_ttl", FT_UINT8, BASE_DEC,
{ &hf_mtrace_q_fwd_code,
{ "Forwarding Code", "igmp.mtrace.q_fwd_code", FT_UINT8, BASE_HEX,
- VALS(&mtrace_fwd_code_vals), 0, "Forwarding information/error code", HFILL }},
+ VALS(mtrace_fwd_code_vals), 0, "Forwarding information/error code", HFILL }},
};
static gint *ett[] = {
dissector_handle_t igmp_handle;
igmp_handle = create_dissector_handle(dissect_igmp, proto_igmp);
- dissector_add("ip.proto", IP_PROTO_IGMP, igmp_handle);
+ dissector_add_uint("ip.proto", IP_PROTO_IGMP, igmp_handle);
}