Ethereal-dev: [Ethereal-dev] (no subject)
Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.
From: Hannes Gredler <hannes@xxxxxxxxxxx>
Date: Thu, 11 Dec 2003 21:34:09 +0100
hi ethereal developers, find attached a patch that corrects some bugs in the PIMv2 dissector; for the commit log: --- display the PIM hello option values in brackets LAN prune delay option dissector register the options dissector at the pim options tree rather than the pim main tree calculate the correct lan prune delay and display it in unit of milliseconds calculate the correct override interval and display it in unit of milliseconds fix the offset and length calculation --- /hannes
Index: packet-pim.c =================================================================== RCS file: /cvsroot/ethereal/packet-pim.c,v retrieving revision 1.46 diff -u -r1.46 packet-pim.c --- packet-pim.c 16 Nov 2003 23:17:20 -0000 1.46 +++ packet-pim.c 11 Dec 2003 20:26:31 -0000 @@ -761,37 +761,46 @@ case 1: /* holdtime */ holdtime = opt_value; proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len, - "Holdtime: %u%s", holdtime, + "Holdtime (%u): %us %s", hello_opt, holdtime, holdtime == 0xffff ? " (infty)" : ""); break; - case 2: /* LAN prune delay */ + case 2: /* LAN prune delay + * + * 0 1 2 3 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * | Type = 2 | Length = 4 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + * |T| LAN Prune Delay | Override Interval | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ { proto_tree *sub_tree = NULL; proto_item *landelay_option; - landelay_option = proto_tree_add_text(pim_tree, tvb, offset, -1, - "LAN Prune Delay"); + landelay_option = proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len, + "LAN Prune Delay (%u)", hello_opt); sub_tree = proto_item_add_subtree(landelay_option, ett_pim); - lan_delay = (opt_value & 0x7f00) >> 8; - override_interval = opt_value & 0xff; - proto_tree_add_text(sub_tree, tvb, offset, 4 + opt_len, + lan_delay = (opt_value & 0x7fff0000) >> 16; + override_interval = opt_value & 0x0000ffff; + proto_tree_add_text(sub_tree, tvb, offset + 4, 1, "T bit is %s", opt_value & 0x8000 ? "set" : "not set"); - proto_tree_add_text(sub_tree, tvb, offset, 4 + opt_len, - "LAN Delay: %u", lan_delay); - proto_tree_add_text(sub_tree, tvb, offset, 4 + opt_len, - "Override Interval: %u", override_interval); + proto_tree_add_text(sub_tree, tvb, offset + 4, 2, + "LAN Delay: %ums", lan_delay); + proto_tree_add_text(sub_tree, tvb, offset + 6, 2, + "Override Interval: %ums", override_interval); break; } case 19: /* priority */ priority = opt_value; proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len, - "DR Priority: %u", priority); + "DR Priority (%u): %u", hello_opt, priority); break; case 20: /* generation ID */ proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len, - "Generation ID: %d", opt_value); + "Generation ID (%u): %d", hello_opt, opt_value); break; case 24: /* address list */ @@ -799,8 +808,9 @@ { int i; proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len, - "%sAddress List", - hello_opt == 65001 ? "old " : ""); + "%sAddress List (%u)", + hello_opt == 65001 ? "old " : "", + hello_opt); for (i = offset + 4; i < offset + 4 + opt_len; ) { int advance; const char *s; @@ -815,7 +825,7 @@ } default: proto_tree_add_text(pimopt_tree, tvb, offset, 4 + opt_len, - "Unknown option: %d len: %d value: 0x%x", + "Unknown option (%u), length: %u, value: 0x%x", hello_opt, opt_len, opt_value); break; }
- Prev by Date: [Ethereal-dev] MSVC warnings
- Next by Date: [Ethereal-dev] Ethereal: PIMv2 bugfix
- Previous by thread: Re: [Ethereal-dev] Ethereal optimizations (proposals)
- Next by thread: Re: [Ethereal-dev] Mobile IPv6 fixes
- Index(es):