Ethereal-dev: Re: [Ethereal-dev] Newbie - Plugin Dissector Only entered with non-zero tree onc
At 10:59 AM -0700 5/1/02, Guy Harris wrote:
On Wed, May 01, 2002 at 07:17:54AM -0700, Harry Goldschmitt wrote:
>If so, is your dissector called with a non-null "tree" argument if you
>click on one of those frames?
No. I've clicked on both frames that aren't my protocol
Then your dissector won't be called, as those are frames for other
protocols.
and the ACKs.
Then your dissector won't be called, as those frames have no data.
Click on a frame that *IS* your protocol and that *DOES* have data. If
you do that, is your dissector called with a non-null "tree" argument?
Sorry, I wasn't clear on that.
I HAVE clicked on many frames that were my protocol, and I don't get
called with a non-null "tree" argument. I clicked on other frames
and then back to my frames just to see if it would make a difference
in the calling sequence. It doesn't. I put a printf right after the
if (tree){
printf( "called with a tree\n");
.
.
}
statement to verify when I was or wasn't called. The line appears in
stdout only once, just as soon as ethereal starts processing the
input file.
I can see that the top level of my protocol sub-tree appears in the
middle pane of the window while the rest of the file is being read
in. As soon as the progress bar for the file I/O disappears, so does
the sub tree.
The summary window contains thousands of lines like:
Protocol Info
EBUS Open Token=....
Generated by my dissector.
During file I/O, "called with a tree" appears on stdout once, while
the first frame of the summary window is highlighted:
+Frame ...
+Ethernet II ...
+Internet Protocol ...
+Transmission Control Protocol ...
+EBus Protocol...
Beginning as soon as the progress bar window closes, without
selecting another frame:
+Frame ...
+Ethernet II ...
+Internet Protocol ...
+Transmission Control Protocol ...
<--- No EBus Protocol sub-tree.
Thereafter selecting frames in the summary window that say EBUS for
the protocol no longer cause a call to my dissector with the tree
non-null, or at least the printf no longer appears in stdout. If I
select a different protocol's frame, it's sub-tree appears in the
middle pane of the window. No matter which EBus protocol frame I
select, the middle pane of the window stops at the TCP sub-tree. The
packet-data dissector is apparently never called, because the data is
never available under the TCP sub-tree. If I delete my plug-in, the
packet-data dissector is called and I can highlight my protocol's raw
data in the packet.