Ethereal-dev: Re: [Ethereal-dev] Patch for mgcp-tap and new gui-tap

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

From: "Ronnie Sahlberg" <ronnie_sahlberg@xxxxxxxxxxxxxx>
Date: Sat, 19 Apr 2003 00:13:44 +1000
Very nice work,

Maybe you would be interested in enhancing the menu handling the way it
should be but
I never got time to finish.

Notice that the function  register_ethereal_tap() takes four parameters.
The first two are used to register the arguments to invoke the tap from the
command line.
The other two are always NULL, since they were never finished.

These two parameters could be used to pass one string and one callback,
like   (void *)"Tools/Statistics/MGCP/RTT",  (void *)gtk_mgcpstat_cb
(this would need to be added to all the other stat menu items as well but
this is trivial)


Then, in gtk/main.c    add two more variables as an extension to the
ethereal_tap_list structure
holding the menu-name "Tools/Statistics..."    and the callback.
Just after the call to register_all_tap_listeners() add some code to
first sort *tap_list according to the menu-name just added to the structure.
When the list is sorted, walk this list and add branches and items
accordingly to the end of the
menu for these entries where the callback is non-NULL.

This would be very useful since it would remove the dependencies for symbols
in main.c from
whatever taps that are used.
It would also allow things like MGCP to avoid disabling/enabling the
menuitem depending on whether
the plugin is available or not.
And also it would allow mgcp_stat.[ch] to live inside the actual plugin and
not in the gtk directory.


I think this would be great if it was implemented for all taps. Interested?




timestats seems a very useful addition.  very good.
the other taps would benefit greatly to be adapted to use it since it would
avoid a lot of code duplication.


it would probably also be very useful to have gtk/stat_table.[ch].
These files would then implement all the table handling which is very
similar and duplicated between
several of the taps.
This would reduce the amount of gtk specific code in ethereal and make life
easier for someone

It would also make it easier to fix problems with the table handling common
to all the rtt statistic taps:
like  :   the table displaying the procedure statistics should have a
scrollbar to the right and the table should
only display as many rows as fits in the window.   Currently the table grows
the window to display every row
making it "difficult" to use for some of the DCERPC stats which have many
procedures.
I think the problem can easily be seen by creating stats for LSA, SAMR or
similar DCE-RPC protocols.

Having all table code in one separate file would allow us to fix the table
size problem above once for all
taps. It would also make porting from gtk to something else easier since
there would be less gtk code
to convert.



Something for someone that knows more about GTK than myself (i know very
little about GTK)
One problem with DCERPC/RTT statis is that we do support many dcerpc
protocols.
The menu we use to select WHICH dcerpc protocol we want the statistics for
is very long
and continues beyond the lower edge of the screen even if i put the dialog
at the top of the screen.
Thus it is impossible to reliably pick some of the protocols, unless you
know how many items down you must step with arrow-down beyond the last item
you can see. :-(
This menu should be changed to show the items in several columns so that all
can be displayed at once,
or it should be made scrollable.
I have no clue on how to do any of these menu changes though. I think it is
possibler though.
Any brave souls out there with GTK knowledge and time to spare?


best regards
    ronnie sahlberg

----- Original Message -----
From: "Lars Roland"
Sent: Wednesday, April 16, 2003 10:49 AM
Subject: [Ethereal-dev] Patch for mgcp-tap and new gui-tap


> Hello,
>
> attached are patches to the the mgcp-plugin and the mgcp-tap, and 4 new
> files.
>
> We have now Response-Time statistics for each known mgcp message-type.
> the patch fixes also a few bugs and cleans the files from trailing
> whitespaces.
> I now use "gdouble" for printing time-values and calculating the average.
> It is easier to use and shouldn't overflow on big trace files like
> "guint32".
>
> I have moved some functions for time statistics into the new file
> timestats.c in the main directory. This code may be useful in the rpc
> and smb rtt-taps as well.
>
> gtk/mgcp_stat.c contains the GTK version of the mgcp-tap.
> the patch for menu.c adds the menu-item and also adds code to disable
> this menu-item, if ethereal cannot find the mgcp-tap, e.g. when
> mgcp-plugin is not present or an old version.
> In such a case, ethereal will exit immediately, if someone clicks on the
> menu-item.
>
> Please check in.
>
> Best Regards,
>
> Lars Roland
>