Wireshark-dev: Re: [Wireshark-dev] Filtering using DHCP and SSDP throws error

From: "Didier" <dgautheron@xxxxxxxx>
Date: Sun, 2 Dec 2007 16:49:26 +0100
Hi,
[UTF-8?]On Fri, 30 Nov 2007 16:37:55 +0100, Stig Bj�rlykke wrote
> 2007/11/29, Didier <dgautheron@xxxxxxxx>:
> > The filter value somewhere in the Protocol hierarchy stat would be nice too.
> 
> You should try svn r23686 or later :)
Interesting but it's not what I had in mind:

cf patch attached.

Didier

=== modified file 'gtk/proto_hier_stats_dlg.c'
--- gtk/proto_hier_stats_dlg.c	2007-12-01 02:08:03 +0000
+++ gtk/proto_hier_stats_dlg.c	2007-12-02 11:15:58 +0000
@@ -36,6 +36,10 @@
 #include "compat_macros.h"
 #include "help_dlg.h"
 
+#ifdef NEED_G_ASCII_STRCASECMP_H
+#include "../epan/g_ascii_strcasecmp.h"
+#endif
+
 #if GTK_MAJOR_VERSION < 2
 #define NUM_STAT_COLUMNS 8
 #else
@@ -96,8 +100,13 @@
     }
 
     seconds = ps->last_time - ps->first_time;
-
-    text[0] = (gchar *) (stats->hfinfo->name);
+    if (g_ascii_strcasecmp(stats->hfinfo->name, stats->hfinfo->abbrev)) {
+    	text[0] = g_strdup_printf("%s (%s)", stats->hfinfo->name, stats->hfinfo->abbrev);
+    }	
+    else {
+    	text[0] = g_strdup_printf("%s", stats->hfinfo->name);
+    }
+    	
     text[1] = g_strdup_printf("%6.2f%%",
                               PCT(stats->num_pkts_total, ps->tot_packets));
     text[2] = g_strdup_printf("%u", stats->num_pkts_total);
@@ -136,6 +145,7 @@
                        -1);
 #endif
 
+    g_free(text[0]);
     g_free(text[1]);
     g_free(text[2]);
     g_free(text[3]);