diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-05-25 18:44:01 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2001-05-25 18:44:01 +0000 |
commit | fd1bc4c201f10e877e62119438a4bbe28de7101c (patch) | |
tree | 5e800663b33e1d87a0a487d0e810416e5788a502 /packet-igmp.c | |
parent | 1746b8a42dc7891c238b2b0033c31b5c0bb48a37 (diff) |
Update Gerald's e-mail address.
Use "col_add_fstr()" to set the Info column, rather than "sprintf()"ing
to a buffer and using "col_add_str()".
Add a routine that dissects unknown types of IGMP messages, and use it
for all IGMP messages for which we don't have a dissector.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3452 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-igmp.c')
-rw-r--r-- | packet-igmp.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/packet-igmp.c b/packet-igmp.c index dba06fc064..43ed9d480d 100644 --- a/packet-igmp.c +++ b/packet-igmp.c @@ -2,7 +2,7 @@ * Routines for IGMP packet disassembly * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs * * @@ -187,10 +187,9 @@ static const value_string vs_record_type[] = { #define PRINT_VERSION(version) \ if (check_col(pinfo->fd, COL_INFO)) { \ - char str[256]; \ - sprintf(str,"V%d %s",version,val_to_str(type, commands, \ + col_add_fstr(pinfo->fd, COL_INFO, \ + "V%d %s",version,val_to_str(type, commands, \ "Unknown Type:0x%02x")); \ - col_add_str(pinfo->fd, COL_INFO,str); \ } \ /* version of IGMP protocol */ \ proto_tree_add_uint(tree, hf_version, tvb, 0, 0, version); \ @@ -221,6 +220,29 @@ static void igmp_checksum(proto_tree *tree,tvbuff_t *tvb, int len) } +/* Unknown IGMP message type */ +static int +dissect_igmp_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int type, int offset) +{ + int len; + + if (check_col(pinfo->fd, COL_INFO)) { + col_add_str(pinfo->fd, COL_INFO, + val_to_str(type, commands, "Unknown Type:0x%02x")); + } + + /* type of command */ + proto_tree_add_uint(tree, hf_type, tvb, offset, 1, type); + offset += 1; + + /* Just call the rest of it "data" */ + len = tvb_length_remaining(tvb, offset); + proto_tree_add_text(tree, tvb, offset, len, "Data"); + offset += len; + + return offset; +} + static int dissect_v3_max_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, int offset) { @@ -622,6 +644,10 @@ dissect_igmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree) case IGMP_V3_MEMBERSHIP_REPORT: offset = dissect_igmp_v3_response(tvb, pinfo, tree, type, offset); break; + + default: + offset = dissect_igmp_unknown(tvb, pinfo, tree, type, offset); + break; } |