Ethereal-dev: Re: [ethereal-dev] pim(protocol independent multicast)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Wed, 13 Oct 1999 09:51:23 -0500
On Wed, Oct 13, 1999 at 01:09:39AM -0500, itojun@xxxxxxxxxx wrote:
> 
> 
>         Here's decoding code for pim (protocol independent multicast).
>         test data is included.


Our first protocol-within-a-protocol! In packet-pim.c, in line 264,
when you call the next dissector (ipv4 or ipv6), can we pass it
tree instead of pimopt_tree, so that those dissectors put their
protocols at the top level of the protocol tree?

Then in that trace that you sent, we'l' have packets like:

Frame #3:

+ Frame (1124 on wire, 1124 captured)
+ Null/Loopback
+ IPv6
+ PIM
+ IPv6
+ UDP
+ Data

The display filters *should* handle multiple instances of protocols
in the same packet, but probably not as well as users might want.

The proposed patch is attached.

--gilbert
Index: packet-pim.c
===================================================================
RCS file: /usr/local/cvsroot/ethereal/packet-pim.c,v
retrieving revision 1.1
diff -u -r1.1 packet-pim.c
--- packet-pim.c	1999/10/13 06:47:45	1.1
+++ packet-pim.c	1999/10/13 14:37:29
@@ -263,10 +263,10 @@
 	    ip = &pd[flagoff + sizeof(guint32)];
 	    switch((*ip & 0xf0) >> 4) {
 	    case 4:	/* IPv4 */
-		    dissect_ip(pd, ip - pd, fd, pimopt_tree);
+		    dissect_ip(pd, ip - pd, fd, tree);
 		    break;
 	    case 6:	/* IPv6 */
-		    dissect_ipv6(pd, ip - pd, fd, pimopt_tree);
+		    dissect_ipv6(pd, ip - pd, fd, tree);
 		    break;
 	    default:
 		    proto_tree_add_text(pimopt_tree,