diff options
author | Guy Harris <guy@alum.mit.edu> | 2009-06-05 22:42:47 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2009-06-05 22:42:47 +0000 |
commit | cf91fdf16b2d961024ea062503ce5fb91af28186 (patch) | |
tree | 2654abe47f378933a5d325856a7b3f877338dd19 /tap-iostat.c | |
parent | f84499059642f102c7272e72f74d7a986f51b520 (diff) |
Have tap listeners specify whether the "packet" routine requires
a protocol tree;
the column values.
This includes stats-tree listeners.
Have the routines to build the packet list, and to retap packets, honor
those requirements. This means that cf_retap_packets() no longer needs
an argument to specify whether to construct the column values or not, so
get rid of that argument.
This also means that there's no need for a tap to have a fake filter
to ensure that the protocol tree will be built, so don't set up a fake
"frame" filter.
While we're at it, clean up some cases where "no filter" was represented
as a null string rather than a null pointer.
Have a routine to return an indication of the number of tap listeners
with filters; use that rather than the global num_tap_filters.
Clean up some indentation and some gboolean vs. gint items.
svn path=/trunk/; revision=28645
Diffstat (limited to 'tap-iostat.c')
-rw-r--r-- | tap-iostat.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tap-iostat.c b/tap-iostat.c index df4a1a1490..bb1180479b 100644 --- a/tap-iostat.c +++ b/tap-iostat.c @@ -69,7 +69,7 @@ typedef struct _io_stat_item_t { static int -iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_) +iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_) { io_stat_item_t *mit = arg; io_stat_item_t *it; @@ -488,14 +488,12 @@ register_io_tap(io_stat_t *io, int i, const char *filter) io->filters[i]=filter; flt=filter; - if(!filter){ - filter=""; - } field=NULL; hfi=NULL; for(j=0; calc_type_table[j].func_name; j++){ namelen=strlen(calc_type_table[j].func_name); - if(strncmp(filter, calc_type_table[j].func_name, namelen) == 0 + if(filter + && strncmp(filter, calc_type_table[j].func_name, namelen) == 0 && *(filter+namelen)=='('){ io->items[i].calc_type=calc_type_table[j].calc_type; @@ -600,7 +598,7 @@ CALC_TYPE_MAX 4 CALC_TYPE_AVG 5 */ - error_string=register_tap_listener("frame", &io->items[i], flt, NULL, iostat_packet, i?NULL:iostat_draw); + error_string=register_tap_listener("frame", &io->items[i], flt, TL_REQUIRES_PROTO_TREE, NULL, iostat_packet, i?NULL:iostat_draw); if(error_string){ g_free(io->items); g_free(io); |