Ethereal-dev: Re: [Ethereal-dev] patch to docs and to mgcp-stat

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Mon, 28 Apr 2003 22:25:51 -0700
On Mon, Apr 28, 2003 at 06:27:57PM +0200, Lars Roland wrote:
> there is a problem at least on WinXP with creating the GtkWidget and
> GtkCList within this function. The values or even the whole table
> won't be displayed in the window!

"Won't be displayed", or "aren't being displayed"?

I don't see a reason why they wouldn't be displayed - in particular:

> May be the GtkClist, the returned pointer is refering to, is not valid 
> any more, after "create_stat_table()" returned.

If a pointer returned by a GTK+ routine ceases to be valid after the
routine that called that GTK+ routine returns, we, and many other GTK+
applications, have some very serious problems. :-)

Is Ethereal actually dissecting any MGCP packets?  When I tried using
the current CVS version, the statistics code showed the titles for the
columns, but showed no data - but it also showed MGCP packets as UDP
packets, not dissecting anything.

The problem was (as per another recent mail from me) that the MGCP
dissector assumes that the "maxlength" argument to "tvb_get_nstringz0()"
is the number of bytes of non-'\0' bytes to copy - i.e., it's not the
size of the buffer handed to "tvb_get_nstringz0()", it's 1 less than
that size, but a recent change to "tvb_get_nstringz0()" means that the
argument is now assumed to be the size of the buffer.  As a result, only
the first 3 bytes of an MGCP verb, and the first 2 bytes of an MGCP
reply code, are copied, so "is_mgcp_verb()" and "is_mgcp_rspcode()" both
fail.

If Ethereal isn't dissecting any MGCP packets, try checking out version
1.41 of "epan/tvbuff.c" and rebuilding; I'll do that on my Windows
partition (I first noticed the "tvb_get_nstringz0()" on my Windows
build, but it happened on FreeBSD as well) and see whether the table
shows up.