diff options
-rw-r--r-- | tap-afpstat.c | 1 | ||||
-rw-r--r-- | tap-ansi_astat.c | 1 | ||||
-rw-r--r-- | tap-bootpstat.c | 27 | ||||
-rw-r--r-- | tap-camelcounter.c | 11 | ||||
-rw-r--r-- | tap-camelsrt.c | 51 | ||||
-rw-r--r-- | tap-comparestat.c | 29 | ||||
-rw-r--r-- | tap-dcerpcstat.c | 13 | ||||
-rw-r--r-- | tap-diameter-avp.c | 1 | ||||
-rw-r--r-- | tap-gsm_astat.c | 1 | ||||
-rw-r--r-- | tap-h225counter.c | 1 | ||||
-rw-r--r-- | tap-h225rassrt.c | 1 | ||||
-rw-r--r-- | tap-httpstat.c | 55 | ||||
-rw-r--r-- | tap-iostat.c | 1 | ||||
-rw-r--r-- | tap-iousers.c | 1 | ||||
-rw-r--r-- | tap-megaco-common.c | 15 | ||||
-rw-r--r-- | tap-megacostat.c | 5 | ||||
-rw-r--r-- | tap-mgcpstat.c | 1 | ||||
-rw-r--r-- | tap-protocolinfo.c | 7 | ||||
-rw-r--r-- | tap-protohierstat.c | 1 | ||||
-rw-r--r-- | tap-radiusstat.c | 1 | ||||
-rw-r--r-- | tap-rpcprogs.c | 11 | ||||
-rw-r--r-- | tap-rpcstat.c | 23 | ||||
-rw-r--r-- | tap-rtp-common.c | 1 | ||||
-rw-r--r-- | tap-rtp.c | 27 | ||||
-rw-r--r-- | tap-sctpchunkstat.c | 3 | ||||
-rw-r--r-- | tap-sipstat.c | 9 | ||||
-rw-r--r-- | tap-smbsids.c | 3 | ||||
-rw-r--r-- | tap-smbstat.c | 1 | ||||
-rw-r--r-- | tap-sv.c | 1 | ||||
-rw-r--r-- | tap-wspstat.c | 37 |
30 files changed, 155 insertions, 185 deletions
diff --git a/tap-afpstat.c b/tap-afpstat.c index 54974c0a6e..5505e11fd6 100644 --- a/tap-afpstat.c +++ b/tap-afpstat.c @@ -39,7 +39,6 @@ #include <epan/stat_cmd_args.h> #include <epan/value_string.h> #include <epan/dissectors/packet-afp.h> -#include "register.h" #include "timestats.h" /* used to keep track of the statistics for an entire program interface */ diff --git a/tap-ansi_astat.c b/tap-ansi_astat.c index 0d23895674..ee368abb74 100644 --- a/tap-ansi_astat.c +++ b/tap-ansi_astat.c @@ -45,7 +45,6 @@ #include <epan/stat_cmd_args.h> #include <epan/dissectors/packet-bssap.h> #include <epan/dissectors/packet-ansi_a.h> -#include "register.h" typedef struct _ansi_a_stat_t { diff --git a/tap-bootpstat.c b/tap-bootpstat.c index 60f044edd9..041364955d 100644 --- a/tap-bootpstat.c +++ b/tap-bootpstat.c @@ -6,17 +6,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -32,7 +32,6 @@ #include "epan/packet_info.h" #include <epan/tap.h> #include <epan/stat_cmd_args.h> -#include "register.h" typedef const char* bootp_info_value_t; @@ -61,8 +60,8 @@ dhcp_free_hash( gpointer key _U_ , gpointer value, gpointer user_data _U_ ) */ static void -dhcp_reset_hash(gchar *key _U_ , dhcp_message_type_t *data, gpointer ptr _U_ ) -{ +dhcp_reset_hash(gchar *key _U_ , dhcp_message_type_t *data, gpointer ptr _U_ ) +{ data->packets = 0; } @@ -80,7 +79,7 @@ static void dhcpstat_reset(void *psp) { dhcpstat_t *sp=psp; - g_hash_table_foreach( sp->hash, (GHFunc)dhcp_reset_hash, NULL); + g_hash_table_foreach( sp->hash, (GHFunc)dhcp_reset_hash, NULL); } static int dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) @@ -91,8 +90,8 @@ dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons if (sp==NULL) return 0; - sc = g_hash_table_lookup( - sp->hash, + sc = g_hash_table_lookup( + sp->hash, value); if (!sc) { sc = g_malloc( sizeof(dhcp_message_type_t) ); @@ -119,7 +118,7 @@ dhcpstat_draw(void *psp) printf("\n"); printf("===================================================================\n"); - if (sp->filter==NULL) + if (sp->filter==NULL) printf("BOOTP Statistics\n"); else printf("BOOTP Statistics with filter %s\n", sp->filter); @@ -128,7 +127,7 @@ dhcpstat_draw(void *psp) g_hash_table_foreach( sp->hash, (GHFunc) dhcp_draw_message_type, "%23s %-9d\n" ); printf("===================================================================\n"); - + } @@ -142,13 +141,13 @@ dhcpstat_init(const char *optarg, void* userdata _U_) dhcpstat_t *sp; const char *filter=NULL; GString *error_string; - + if (!strncmp (optarg, "bootp,stat,", 11)){ filter=optarg+11; } else { filter=NULL; } - + sp = g_malloc( sizeof(dhcpstat_t) ); sp->hash = g_hash_table_new( g_str_hash, g_str_equal); if(filter){ @@ -158,7 +157,7 @@ dhcpstat_init(const char *optarg, void* userdata _U_) } sp->index = 0; /* Nothing to display yet */ - error_string = register_tap_listener( + error_string = register_tap_listener( "bootp", sp, filter, diff --git a/tap-camelcounter.c b/tap-camelcounter.c index 18df797130..c922f19860 100644 --- a/tap-camelcounter.c +++ b/tap-camelcounter.c @@ -40,7 +40,6 @@ #include "epan/packet_info.h" #include "epan/tap.h" #include "epan/value_string.h" -#include "register.h" #include "epan/stat_cmd_args.h" #include "epan/asn1.h" #include "epan/camel-persistentdata.h" @@ -49,7 +48,7 @@ void register_tap_listener_camelcounter(void); /* used to keep track of the statistics for an entire program interface */ struct camelcounter_t { - char *filter; + char *filter; guint32 camel_msg[camel_MAX_NUM_OPR_CODES]; }; @@ -62,14 +61,14 @@ static void camelcounter_reset(void *phs) static int camelcounter_packet(void *phs, packet_info *pinfo _U_, - epan_dissect_t *edt _U_, + epan_dissect_t *edt _U_, const void *phi) { struct camelcounter_t * p_counter =(struct camelcounter_t *)phs; const struct camelsrt_info_t * pi=phi; if (pi->opcode != 255) p_counter->camel_msg[pi->opcode]++; - + return 1; } @@ -87,7 +86,7 @@ static void camelcounter_draw(void *phs) if(p_counter->camel_msg[i]!=0) { printf("%30s ", val_to_str(i,camel_opr_code_strings,"Unknown message ")); printf("%6d\n", p_counter->camel_msg[i]); - } + } } /* Message Type */ printf("------------------------------------------\n"); } @@ -103,7 +102,7 @@ static void camelcounter_init(const char *optarg, void* userdata _U_) } else { p_camelcounter->filter=NULL; } - + camelcounter_reset(p_camelcounter); error_string=register_tap_listener("CAMEL", diff --git a/tap-camelsrt.c b/tap-camelsrt.c index ec575f4a15..34d5b16dcd 100644 --- a/tap-camelsrt.c +++ b/tap-camelsrt.c @@ -38,7 +38,6 @@ #include "epan/packet_info.h" #include <epan/tap.h> #include "epan/value_string.h" -#include "register.h" #include "epan/asn1.h" #include "epan/dissectors/packet-camel.h" #include "epan/camel-persistentdata.h" @@ -72,8 +71,8 @@ static void camelsrt_reset(void *phs) } -static int camelsrt_packet(void *phs, - packet_info *pinfo _U_, +static int camelsrt_packet(void *phs, + packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi) { @@ -83,16 +82,16 @@ static int camelsrt_packet(void *phs, for (i=0; i<NB_CAMELSRT_CATEGORY; i++) { if (pi->bool_msginfo[i] && - pi->msginfo[i].is_delta_time + pi->msginfo[i].is_delta_time && pi->msginfo[i].request_available && !pi->msginfo[i].is_duplicate ) { - + time_stat_update(&(hs->stats[i]), &(pi->msginfo[i].delta_time), pinfo); - + if (hs->count[i] < NUM_RAS_STATS) { - hs->delta_time[i][hs->count[i]++] + hs->delta_time[i][hs->count[i]++] = pi->msginfo[i].delta_time; } } @@ -117,7 +116,7 @@ static void camelsrt_draw(void *phs) printf("=================================================================================================\n"); printf("| Category | Measure | Min SRT | Max SRT | Avg SRT | Min frame | Max frame |\n"); printf("|-------------------------|---------|-----------|-----------|-----------|-----------|-----------|\n"); - + j=1; printf("|%24s |%8u |%8.2f s |%8.2f s |%8.2f s |%10u |%10u |\n", val_to_str(j,camelSRTtype_naming,"Unknown Message 0x%02x"), @@ -125,27 +124,27 @@ static void camelsrt_draw(void *phs) nstime_to_sec(&(hs->stats[j].min)), nstime_to_sec(&(hs->stats[j].max)), get_average(&(hs->stats[j].tot),hs->stats[j].num)/1000.0, - hs->stats[j].min_num, + hs->stats[j].min_num, hs->stats[j].max_num ); - for(j=2; j<NB_CAMELSRT_CATEGORY; j++) { - if(hs->stats[j].num==0){ + for(j=2; j<NB_CAMELSRT_CATEGORY; j++) { + if(hs->stats[j].num==0){ printf("|%24s |%8u |%8.2f ms|%8.2f ms|%8.2f ms|%10u |%10u |\n", val_to_str(j,camelSRTtype_naming,"Unknown Message 0x%02x"), 0, 0.0, 0.0, 0.0, 0, 0); continue; } - + printf("|%24s |%8u |%8.2f ms|%8.2f ms|%8.2f ms|%10u |%10u |\n", val_to_str(j,camelSRTtype_naming,"Unknown Message 0x%02x"), hs->stats[j].num, MIN(9999,nstime_to_msec(&(hs->stats[j].min))), MIN(9999,nstime_to_msec(&(hs->stats[j].max))), MIN(9999,get_average(&(hs->stats[j].tot),hs->stats[j].num)), - hs->stats[j].min_num, + hs->stats[j].min_num, hs->stats[j].max_num ); - } /* j category */ + } /* j category */ printf("=================================================================================================\n"); /* @@ -161,10 +160,10 @@ static void camelsrt_draw(void *phs) printf("\n"); /* calculate the delay max to have a given number of messages (in percentage) */ for(j=2;j<NB_CAMELSRT_CATEGORY;j++) { - + rtd_temp = &(hs->stats[j]); - - if (hs->count[j]>0) { + + if (hs->count[j]>0) { /* Calculate the delay to answer to p% of the MS */ for(z=0; z<NB_CRITERIA; z++) { iteration=0; @@ -175,9 +174,9 @@ static void camelsrt_draw(void *phs) while( (delta > 0.001) && (iteration < 10000) ) { somme=0; iteration++; - + for(li=0;li<hs->count[j];li++) { - x=hs->delta_time[j][li].secs*1000 + x=hs->delta_time[j][li].secs*1000 + (double)hs->delta_time[j][li].nsecs/1000000; if (x <= delay) somme++; } @@ -197,12 +196,12 @@ static void camelsrt_draw(void *phs) printf("X%24s |", val_to_str(j, camelSRTtype_naming, "Unknown") ); for(z=0; z<NB_CRITERIA; z++) printf("%8.2f |", MIN(9999,delay_criteria[z])); printf("\n"); - } else { /* count */ + } else { /* count */ printf("X%24s |", val_to_str(j, camelSRTtype_naming, "Unknown") ); for(z=0; z<NB_CRITERIA; z++) printf("%8.2f |", 0.0); printf("\n"); - } /* count */ - }/* j category */ + } /* count */ + }/* j category */ printf("==========================="); for(z=0; z<NB_CRITERIA; z++) printf("=========="); printf("\n"); @@ -220,7 +219,7 @@ static void camelsrt_init(const char *optarg, void* userdata _U_) p_camelsrt->filter=NULL; } camelsrt_reset(p_camelsrt); - + error_string=register_tap_listener("CAMEL", p_camelsrt, p_camelsrt->filter, @@ -228,12 +227,12 @@ static void camelsrt_init(const char *optarg, void* userdata _U_) NULL, camelsrt_packet, camelsrt_draw); - + if(error_string){ /* error, we failed to attach to the tap. clean up */ g_free(p_camelsrt->filter); g_free(p_camelsrt); - + fprintf(stderr, "tshark: Couldn't register camel,srt tap: %s\n", error_string->str); g_string_free(error_string, TRUE); @@ -245,7 +244,7 @@ static void camelsrt_init(const char *optarg, void* userdata _U_) * As the frame are proceeded in the chronological order, we do not need persistent stats * Whereas, with wireshark, it is not possible to have the correct display, if the stats are * not saved along the analyze - */ + */ gtcap_StatSRT=TRUE; gcamel_StatSRT=TRUE; } diff --git a/tap-comparestat.c b/tap-comparestat.c index c990d523d5..7e123a326f 100644 --- a/tap-comparestat.c +++ b/tap-comparestat.c @@ -1,24 +1,24 @@ /* tap-comparestat.c * Compare two capture files * Copyright 2008 Vincenzo Condoleo, Christophe Dirac, Reto Ruoss - * supported by HSR (Hochschule Rapperswil) + * supported by HSR (Hochschule Rapperswil) * * $Id$ * * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -51,7 +51,6 @@ #include <epan/timestamp.h> #include <epan/stat_cmd_args.h> #include <epan/dissectors/packet-ip.h> -#include "register.h" #include "timestats.h" @@ -121,7 +120,7 @@ comparestat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const frame_info *fInfo; vec_t cksum_vec[3]; guint16 computed_cksum=0; - + /* so this get filled, usually with the first frame */ if(cs->eth_dst.len==0) { cs->eth_dst=pinfo->dl_dst; @@ -173,7 +172,7 @@ call_foreach_count_ip_id(gpointer value, gpointer arg) packet_info *pinfo=(packet_info*)ep_alloc(sizeof(packet_info)); pinfo->fd=(frame_data*)ep_alloc(sizeof(frame_data)); pinfo->fd->num = fInfo->num; - + fInfoTemp=se_tree_lookup32(cs->ip_id_tree, fInfo->id); if(fInfoTemp==NULL){ /* Detect ongoing package loss */ @@ -270,7 +269,7 @@ call_foreach_new_order(gpointer value, gpointer arg) fInfo->zebra_time=cs->zebra_time; cs->zebra_time.nsecs++; } - + } } else { if(TTL_method==FALSE){ @@ -285,9 +284,9 @@ call_foreach_new_order(gpointer value, gpointer arg) } else { fInfo->zebra_time.nsecs=fInfoTemp->zebra_time.nsecs+1; } - } + } } - + /* count packets of file */ if(fmod(fInfo->zebra_time.nsecs, MERGED_FILES)){ cs->first_file_amount++; @@ -299,7 +298,7 @@ call_foreach_new_order(gpointer value, gpointer arg) if(!nstime_is_unset(&cs->current_time)){ fInfo->fp->predecessor_time.nsecs=cs->current_time.nsecs; } - + cs->current_time.nsecs=fInfo->zebra_time.nsecs; return FALSE; @@ -403,7 +402,7 @@ call_foreach_print_ip_tree(gpointer value, gpointer user_data) } if(fInfo->fp->count > MERGED_FILES){ printf("Packet id :%i, count:%i Problem:", fInfo->id, fInfo->fp->count); - printf("More than two packets\n"); + printf("More than two packets\n"); if(fInfo->fp->cksum == WRONG_CHKSUM){ printf("Checksum error over IP header\n"); } @@ -427,7 +426,7 @@ call_foreach_print_ip_tree(gpointer value, gpointer user_data) } else if((nstime_cmp(&fInfo->fp->predecessor_time, &fInfo->zebra_time)>0||nstime_cmp(&fInfo->fp->partner->fp->predecessor_time, &fInfo->fp->partner->zebra_time)>0) && fInfo->zebra_time.nsecs != MERGED_FILES && ON_method){ printf("Packet id :%i, count:%i Problem:", fInfo->id, fInfo->fp->count); printf("Not correct order\n"); - } + } } } return FALSE; @@ -439,7 +438,7 @@ call_foreach_print_ip_tree(gpointer value, gpointer user_data) * stdout. * TShark will only call this callback once, which is when tshark has * finished reading all packets and exists. - * If used with wireshark this may be called any time, perhaps once every 3 + * If used with wireshark this may be called any time, perhaps once every 3 * seconds or so. * This function may even be called in parallell with (*reset) or (*draw) * so make sure there are no races. The data in the rpcstat_t can thus change @@ -557,7 +556,7 @@ comparestat_init(const char *optarg, void* userdata _U_) } else { cs->filter=NULL; } - + /* create a Hash to count the packets with the same ip.id */ cs->packet_tree=se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "Packet_info_tree"); diff --git a/tap-dcerpcstat.c b/tap-dcerpcstat.c index 7c3cd16931..1ed0ce6eb2 100644 --- a/tap-dcerpcstat.c +++ b/tap-dcerpcstat.c @@ -6,17 +6,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -37,7 +37,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include <epan/dissectors/packet-dcerpc.h> -#include "register.h" /* used to keep track of statistics for a specific procedure */ typedef struct _rpc_procedure_t { @@ -129,7 +128,7 @@ dcerpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const rp->max.secs=delta.secs; rp->max.nsecs=delta.nsecs; } - + rp->tot.secs += delta.secs; rp->tot.nsecs += delta.nsecs; if(rp->tot.nsecs>1000000000){ @@ -189,7 +188,7 @@ dcerpcstat_init(const char *optarg, void* userdata _U_) int pos=0; const char *filter=NULL; GString *error_string; - + /* * XXX - DCE RPC statistics are maintained only by major version, * not by major and minor version, so the minor version number is @@ -269,7 +268,7 @@ dcerpcstat_init(const char *optarg, void* userdata _U_) rs->procedures[i].proc=procs[j].name; } } - rs->procedures[i].num=0; + rs->procedures[i].num=0; rs->procedures[i].min.secs=0; rs->procedures[i].min.nsecs=0; rs->procedures[i].max.secs=0; diff --git a/tap-diameter-avp.c b/tap-diameter-avp.c index b65f108877..2ea574dc29 100644 --- a/tap-diameter-avp.c +++ b/tap-diameter-avp.c @@ -54,7 +54,6 @@ #include "epan/value_string.h" #include "epan/nstime.h" #include "epan/ftypes/ftypes.h" -#include "register.h" #include "epan/to_str.h" #include "epan/dissectors/packet-diameter.h" diff --git a/tap-gsm_astat.c b/tap-gsm_astat.c index 0185790fde..cd523aff67 100644 --- a/tap-gsm_astat.c +++ b/tap-gsm_astat.c @@ -45,7 +45,6 @@ #include <epan/stat_cmd_args.h> #include <epan/dissectors/packet-bssap.h> #include <epan/dissectors/packet-gsm_a_common.h> -#include "register.h" typedef struct _gsm_a_stat_t { diff --git a/tap-h225counter.c b/tap-h225counter.c index 16e89b5b75..5368f65ff0 100644 --- a/tap-h225counter.c +++ b/tap-h225counter.c @@ -39,7 +39,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" -#include "register.h" #include <epan/dissectors/packet-h225.h> /* following values represent the size of their valuestring arrays */ diff --git a/tap-h225rassrt.c b/tap-h225rassrt.c index 59b32d6792..a0c6d8e37e 100644 --- a/tap-h225rassrt.c +++ b/tap-h225rassrt.c @@ -39,7 +39,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" -#include "register.h" #include <epan/dissectors/packet-h225.h> #include "timestats.h" diff --git a/tap-httpstat.c b/tap-httpstat.c index b2f5a1676c..fc12fcd9b2 100644 --- a/tap-httpstat.c +++ b/tap-httpstat.c @@ -6,17 +6,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -33,10 +33,9 @@ #include "epan/value_string.h" #include <epan/tap.h> #include <epan/stat_cmd_args.h> -#include "register.h" #include <epan/dissectors/packet-http.h> - + /* used to keep track of the statictics for an entire program interface */ typedef struct _http_stats_t { char *filter; @@ -101,7 +100,7 @@ static const value_string vals_status_code[] = { { 414, "Request-URI Too Large"}, { 415, "Unsupported Media Type"}, { 499, "Client Error - Others"}, - + { 500, "Internal Server Error"}, { 501, "Not Implemented"}, { 502, "Bad Gateway"}, @@ -119,8 +118,8 @@ http_init_hash( httpstat_t *sp) { int i; - sp->hash_responses = g_hash_table_new( g_int_hash, g_int_equal); - + sp->hash_responses = g_hash_table_new( g_int_hash, g_int_equal); + for (i=0 ; vals_status_code[i].strptr ; i++ ) { gint *key = g_malloc (sizeof(gint)); @@ -139,7 +138,7 @@ http_draw_hash_requests( gchar *key _U_ , http_request_methode_t *data, gchar * { if (data->packets==0) return; - printf( format, data->response, data->packets); + printf( format, data->response, data->packets); } static void @@ -154,9 +153,9 @@ http_draw_hash_responses( gint * key _U_ , http_response_code_t *data, char * fo /* " HTTP %3d %-35s %9d packets", */ printf(format, data->response_code, data->name, data->packets ); } - - + + /* NOT USED at this moment */ /* static void @@ -167,13 +166,13 @@ http_free_hash( gpointer key, gpointer value, gpointer user_data _U_ ) } */ static void -http_reset_hash_responses(gchar *key _U_ , http_response_code_t *data, gpointer ptr _U_ ) -{ +http_reset_hash_responses(gchar *key _U_ , http_response_code_t *data, gpointer ptr _U_ ) +{ data->packets = 0; } static void -http_reset_hash_requests(gchar *key _U_ , http_request_methode_t *data, gpointer ptr _U_ ) -{ +http_reset_hash_requests(gchar *key _U_ , http_request_methode_t *data, gpointer ptr _U_ ) +{ data->packets = 0; } @@ -198,10 +197,10 @@ httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con if (value->response_code!=0) { guint *key=g_malloc( sizeof(guint) ); http_response_code_t *sc; - + *key=value->response_code; - sc = g_hash_table_lookup( - sp->hash_responses, + sc = g_hash_table_lookup( + sp->hash_responses, key); if (sc==NULL){ /* non standard status code ; we classify it as others @@ -226,19 +225,19 @@ httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con else{ *key=599; } - sc = g_hash_table_lookup( - sp->hash_responses, + sc = g_hash_table_lookup( + sp->hash_responses, key); if (sc==NULL) return 0; } sc->packets++; - } + } else if (value->request_method){ http_request_methode_t *sc; - sc = g_hash_table_lookup( - sp->hash_requests, + sc = g_hash_table_lookup( + sp->hash_requests, value->request_method); if (sc==NULL){ sc=g_malloc( sizeof(http_request_methode_t) ); @@ -268,10 +267,10 @@ httpstat_draw(void *psp ) printf("HTTP Statistics with filter %s\n", sp->filter); printf( "* HTTP Status Codes in reply packets\n"); - g_hash_table_foreach( sp->hash_responses, (GHFunc)http_draw_hash_responses, + g_hash_table_foreach( sp->hash_responses, (GHFunc)http_draw_hash_responses, " HTTP %3d %s\n"); printf("* List of HTTP Request methods\n"); - g_hash_table_foreach( sp->hash_requests, (GHFunc)http_draw_hash_requests, + g_hash_table_foreach( sp->hash_requests, (GHFunc)http_draw_hash_requests, " %9s %d \n"); printf("===================================================================\n"); } @@ -286,13 +285,13 @@ gtk_httpstat_init(const char *optarg,void* userdata _U_) httpstat_t *sp; const char *filter=NULL; GString *error_string; - + if (!strncmp (optarg, "http,stat,", 10)){ filter=optarg+10; } else { filter=NULL; } - + sp = g_malloc( sizeof(httpstat_t) ); if(filter){ sp->filter=g_strdup(filter); @@ -302,7 +301,7 @@ gtk_httpstat_init(const char *optarg,void* userdata _U_) /*g_hash_table_foreach( http_status, (GHFunc)http_reset_hash_responses, NULL);*/ - error_string = register_tap_listener( + error_string = register_tap_listener( "http", sp, filter, diff --git a/tap-iostat.c b/tap-iostat.c index d517a7f9bb..c6838a4e57 100644 --- a/tap-iostat.c +++ b/tap-iostat.c @@ -38,7 +38,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include <epan/strutil.h> -#include "register.h" typedef struct _io_stat_t { diff --git a/tap-iousers.c b/tap-iousers.c index 1cfe1c1385..1c8b124583 100644 --- a/tap-iousers.c +++ b/tap-iousers.c @@ -39,7 +39,6 @@ #include <epan/tap.h> #include <epan/conversation.h> #include <epan/stat_cmd_args.h> -#include "register.h" #include <epan/dissectors/packet-ip.h> #include <epan/dissectors/packet-ipv6.h> #include <epan/dissectors/packet-ipx.h> diff --git a/tap-megaco-common.c b/tap-megaco-common.c index 882ecba0d7..55bc5338ab 100644 --- a/tap-megaco-common.c +++ b/tap-megaco-common.c @@ -41,7 +41,6 @@ #include <epan/tap.h> #include "epan/gcp.h" -#include "../register.h" #include "../timestats.h" #include "../simple_dialog.h" #include "../file.h" @@ -64,7 +63,7 @@ megacostat_is_duplicate_reply(const gcp_cmd_t* cmd) if (cmd_msg->cmd->type == cmd->type) return TRUE; } - + return FALSE; } break; @@ -73,7 +72,7 @@ megacostat_is_duplicate_reply(const gcp_cmd_t* cmd) break; } - + } static gboolean @@ -87,7 +86,7 @@ megacostat_had_request(const gcp_cmd_t* cmd) /* cycle through commands to find a request in the transaction */ for (cmd_msg = cmd->trx->cmds; cmd_msg->cmd->msg->framenum != cmd->msg->framenum && cmd_msg != NULL; cmd_msg = cmd_msg->next) { - + switch (cmd_msg->cmd->type) { GCP_CMD_REQ_CASE @@ -98,7 +97,7 @@ megacostat_had_request(const gcp_cmd_t* cmd) break; } } - + return FALSE; } break; @@ -120,11 +119,11 @@ megacostat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const GCP_CMD_REQ_CASE if(!mi->trx->initial) { - /* Track Context is probably disabled, we cannot + /* Track Context is probably disabled, we cannot * measure service response time */ return 0; } - + else if(mi->trx->initial->framenum != mi->msg->framenum){ /* Duplicate is ignored */ ms->req_dup_num++; @@ -149,7 +148,7 @@ megacostat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const nstime_delta(&delta, &pinfo->fd->abs_ts, &mi->trx->initial->time); switch(mi->type) { - + case GCP_CMD_ADD_REPLY: time_stat_update(&(ms->rtd[0]),&delta, pinfo); break; diff --git a/tap-megacostat.c b/tap-megacostat.c index 5e2b3c5d36..d4316daba7 100644 --- a/tap-megacostat.c +++ b/tap-megacostat.c @@ -39,7 +39,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" -#include "register.h" #include "epan/gcp.h" #include "timestats.h" #include <epan/prefs-int.h> @@ -85,7 +84,7 @@ megacostat_init(const char *optarg, void* userdata _U_) int i; GString *error_string; pref_t *megaco_ctx_track,*h248_ctx_track; - + megaco_ctx_track = prefs_find_preference(prefs_find_module("megaco"),"ctx_info"); h248_ctx_track = prefs_find_preference(prefs_find_module("h248"),"ctx_info"); if (!*megaco_ctx_track->varp.boolp || !*h248_ctx_track->varp.boolp) { @@ -93,7 +92,7 @@ megacostat_init(const char *optarg, void* userdata _U_) printf("has to be set to true to enable measurement of service response times.\n"); exit(1); } - + ms=g_malloc(sizeof(megacostat_t)); if(!strncmp(optarg,"megaco,rtd,",11)){ ms->filter=g_strdup(optarg+11); diff --git a/tap-mgcpstat.c b/tap-mgcpstat.c index f4a71d181c..f5b0b1ee79 100644 --- a/tap-mgcpstat.c +++ b/tap-mgcpstat.c @@ -37,7 +37,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" -#include "register.h" #include "epan/dissectors/packet-mgcp.h" #include "timestats.h" diff --git a/tap-protocolinfo.c b/tap-protocolinfo.c index 588f8fb775..a3f2b37666 100644 --- a/tap-protocolinfo.c +++ b/tap-protocolinfo.c @@ -6,17 +6,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -41,7 +41,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include <epan/strutil.h> -#include "register.h" typedef struct _pci_t { char *filter; diff --git a/tap-protohierstat.c b/tap-protohierstat.c index 407ae57a26..b8db44fc39 100644 --- a/tap-protohierstat.c +++ b/tap-protohierstat.c @@ -40,7 +40,6 @@ #include "epan/proto.h" #include <epan/tap.h> #include <epan/stat_cmd_args.h> -#include "register.h" typedef struct _phs_t { struct _phs_t *sibling; diff --git a/tap-radiusstat.c b/tap-radiusstat.c index 278e62a05f..9faf97b6ab 100644 --- a/tap-radiusstat.c +++ b/tap-radiusstat.c @@ -37,7 +37,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" -#include "register.h" #include <epan/dissectors/packet-radius.h> #include "timestats.h" diff --git a/tap-rpcprogs.c b/tap-rpcprogs.c index ecf4901688..295932bec0 100644 --- a/tap-rpcprogs.c +++ b/tap-rpcprogs.c @@ -6,17 +6,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -41,7 +41,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include <epan/dissectors/packet-rpc.h> -#include "register.h" /* used to keep track of statistics for a specific program/version */ typedef struct _rpc_program_t { @@ -128,7 +127,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c } } - + /* we are only interested in reply packets */ if(ri->request || !rp){ return 0; @@ -162,7 +161,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c rp->max.secs=delta.secs; rp->max.nsecs=delta.nsecs; } - + rp->tot.secs += delta.secs; rp->tot.nsecs += delta.nsecs; if(rp->tot.nsecs>1000000000){ diff --git a/tap-rpcstat.c b/tap-rpcstat.c index 1f43ad74a7..580121ec10 100644 --- a/tap-rpcstat.c +++ b/tap-rpcstat.c @@ -6,17 +6,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -43,7 +43,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include <epan/dissectors/packet-rpc.h> -#include "register.h" /* used to keep track of statistics for a specific procedure */ typedef struct _rpc_procedure_t { @@ -83,7 +82,7 @@ rpcstat_reset(void *prs) guint32 i; for(i=0;i<rs->num_procedures;i++){ - rs->procedures[i].num=0; + rs->procedures[i].num=0; rs->procedures[i].min.secs=0; rs->procedures[i].min.nsecs=0; rs->procedures[i].max.secs=0; @@ -106,7 +105,7 @@ rpcstat_reset(void *prs) * possible into (*draw) instead since that function executes asynchronously * and does not affect the main threads performance. * - * If it is possible, try to do all "filtering" explicitely as we do below in + * If it is possible, try to do all "filtering" explicitely as we do below in * this example since you will get MUCH better performance than applying * a similar display-filter in the register call. * @@ -118,7 +117,7 @@ rpcstat_reset(void *prs) * we were called for the proper program and version. We didnt apply a filter * when we registered so we will be called for ALL rpc packets and not just * the ones we are collecting stats for. - * + * * * function returns : * 0: no updates, no need to call (*draw) later @@ -173,7 +172,7 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const voi rp->max.secs=delta.secs; rp->max.nsecs=delta.nsecs; } - + rp->tot.secs += delta.secs; rp->tot.nsecs += delta.nsecs; if(rp->tot.nsecs>1000000000){ @@ -191,7 +190,7 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const voi * stdout. * TShark will only call this callback once, which is when tshark has * finished reading all packets and exists. - * If used with wireshark this may be called any time, perhaps once every 3 + * If used with wireshark this may be called any time, perhaps once every 3 * seconds or so. * This function may even be called in parallell with (*reset) or (*draw) * so make sure there are no races. The data in the rpcstat_t can thus change @@ -313,7 +312,7 @@ rpcstat_init(const char *optarg, void* userdata _U_) rs->procedures=g_malloc(sizeof(rpc_procedure_t)*(rs->num_procedures+1)); for(i=0;i<rs->num_procedures;i++){ rs->procedures[i].proc=rpc_proc_name(program, version, i); - rs->procedures[i].num=0; + rs->procedures[i].num=0; rs->procedures[i].min.secs=0; rs->procedures[i].min.nsecs=0; rs->procedures[i].max.secs=0; @@ -325,8 +324,8 @@ rpcstat_init(const char *optarg, void* userdata _U_) /* It is possible to create a filter and attach it to the callbacks. Then the * callbacks would only be invoked if the filter matched. * Evaluating filters is expensive and if we can avoid it and not use them - * we gain performance. - * In this case we do the filtering for protocol and version inside the + * we gain performance. + * In this case we do the filtering for protocol and version inside the * callback itself but use whatever filter the user provided. * (Perhaps the user only want the stats for nis+ traffic for certain objects?) * diff --git a/tap-rtp-common.c b/tap-rtp-common.c index 0ef5008f02..d3364d5d2f 100644 --- a/tap-rtp-common.c +++ b/tap-rtp-common.c @@ -38,7 +38,6 @@ #include "globals.h" #include <epan/tap.h> -#include "register.h" #include <string.h> #include <epan/rtp_pt.h> #include <epan/addr_resolv.h> @@ -2,7 +2,7 @@ * RTP TAP for tshark * * $Id$ - * + * * Copyright 2008, Ericsson AB * By Balint Reczey <balint.reczey@ericsson.com> * @@ -51,19 +51,18 @@ #include <epan/rtp_pt.h> #include <epan/stat_cmd_args.h> #include <epan/addr_resolv.h> -#include "register.h" #include "tap-rtp-common.h" /* The one and only global rtpstream_tapinfo_t structure for tshark and wireshark. - */ -static rtpstream_tapinfo_t the_tapinfo_struct = - {0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, 0, FALSE}; + */ +static rtpstream_tapinfo_t the_tapinfo_struct = + {0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, 0, FALSE}; static void rtp_streams_stat_draw(void *arg _U_) { - - + + GList *list; rtp_stream_info_t* strinfo; gchar *payload_type; @@ -71,18 +70,18 @@ rtp_streams_stat_draw(void *arg _U_) gint32 lost; double perc; char *savelocale; - + printf("========================= RTP Streams ========================\n"); printf("%15s %5s %15s %5s %10s %16s %5s %12s %15s %15s %15s %s\n","Src IP addr", "Port", "Dest IP addr", "Port", "SSRC", "Payload", "Pkts", "Lost", "Max Delta(ms)", "Max Jitter(ms)", "Mean Jitter(ms)", "Problems?"); - + /* save the current locale */ savelocale = setlocale(LC_NUMERIC, NULL); /* switch to "C" locale to avoid problems with localized decimal separators in g_snprintf("%f") functions */ setlocale(LC_NUMERIC, "C"); - + list = the_tapinfo_struct.strinfo_list; - + list = g_list_first(list); while (list) { @@ -100,7 +99,7 @@ rtp_streams_stat_draw(void *arg _U_) payload_type = g_strdup(val_to_str(strinfo->pt, rtp_payload_type_vals, "Unknown (%u)")); } - + /* packet count, lost packets */ expected = (strinfo->rtp_stats.stop_seq_nr + strinfo->rtp_stats.cycles*65536) - strinfo->rtp_stats.start_seq_nr + 1; @@ -110,7 +109,7 @@ rtp_streams_stat_draw(void *arg _U_) } else { perc = 0; } - + printf("%15s %5u %15s %5u 0x%08X %16s %5u %5d (%.1f%%) %15.2f %15.2f %15.2f %s\n", get_addr_name(&(strinfo->src_addr)), strinfo->src_port, @@ -124,7 +123,7 @@ rtp_streams_stat_draw(void *arg _U_) strinfo->rtp_stats.max_jitter, strinfo->rtp_stats.mean_jitter, (strinfo->problem)?"X":""); - + list = g_list_next(list); diff --git a/tap-sctpchunkstat.c b/tap-sctpchunkstat.c index 5730395d0a..fcb8285240 100644 --- a/tap-sctpchunkstat.c +++ b/tap-sctpchunkstat.c @@ -39,7 +39,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" -#include "register.h" #include <epan/dissectors/packet-sctp.h> #include <epan/to_str.h> @@ -105,7 +104,7 @@ sctpstat_reset(void *phs) } -static sctp_ep_t* +static sctp_ep_t* alloc_sctp_ep(const struct _sctp_info *si) { sctp_ep_t* ep; diff --git a/tap-sipstat.c b/tap-sipstat.c index 6d3c9a30cf..5d545b66f1 100644 --- a/tap-sipstat.c +++ b/tap-sipstat.c @@ -38,7 +38,6 @@ #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" -#include "register.h" #include <epan/dissectors/packet-sip.h> /* used to keep track of the statictics for an entire program interface */ @@ -247,7 +246,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const { const sip_info_value_t *value=pri; sipstat_t *sp = (sipstat_t *)psp; - + /* Total number of packets, including continuation packets */ sp->packets++; @@ -269,17 +268,17 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const sp->min_setup_time = value->setup_time; } /* Calculate average */ - sp->average_setup_time = (guint32)(sp->total_setup_time / sp->no_of_completed_calls); + sp->average_setup_time = (guint32)(sp->total_setup_time / sp->no_of_completed_calls); } } - + /* Update resent count if flag set */ if (value->resend) { sp->resent_packets++; } - + /* Looking at both requests and responses */ if (value->response_code != 0) { diff --git a/tap-smbsids.c b/tap-smbsids.c index 0a43eed399..2955bcfbed 100644 --- a/tap-smbsids.c +++ b/tap-smbsids.c @@ -35,7 +35,6 @@ #include <string.h> #include "epan/packet_info.h" #include <epan/dissectors/packet-smb-sidsnooping.h> -#include "register.h" #include <epan/tap.h> #include <epan/stat_cmd_args.h> #include "epan/value_string.h" @@ -48,7 +47,7 @@ smbsids_packet(void *pss _U_, packet_info *pinfo _U_, epan_dissect_t *edt _U_, c return 1; } -static void +static void enum_sids(gpointer key _U_, gpointer value, gpointer userdata _U_) { sid_name *sn=(sid_name *)value; diff --git a/tap-smbstat.c b/tap-smbstat.c index eae8b27a21..cab82f3892 100644 --- a/tap-smbstat.c +++ b/tap-smbstat.c @@ -38,7 +38,6 @@ #include <epan/stat_cmd_args.h> #include "epan/value_string.h" #include <epan/dissectors/packet-smb.h> -#include "register.h" #include "timestats.h" /* used to keep track of the statistics for an entire program interface */ @@ -40,7 +40,6 @@ #include <epan/stat_cmd_args.h> #include <epan/nstime.h> #include <epan/dissectors/packet-sv.h> -#include "register.h" static int sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) diff --git a/tap-wspstat.c b/tap-wspstat.c index b5c285443c..49e7e59add 100644 --- a/tap-wspstat.c +++ b/tap-wspstat.c @@ -6,17 +6,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -41,7 +41,6 @@ #include "epan/packet_info.h" #include <epan/tap.h> #include <epan/stat_cmd_args.h> -#include "register.h" #include "epan/value_string.h" #include <epan/dissectors/packet-wsp.h> @@ -62,10 +61,10 @@ typedef struct _wsp_stats_t { guint32 num_pdus; GHashTable *hash; } wspstat_t; - + static void -wsp_reset_hash(gchar *key _U_ , wsp_status_code_t *data, gpointer ptr _U_ ) -{ +wsp_reset_hash(gchar *key _U_ , wsp_status_code_t *data, gpointer ptr _U_ ) +{ data->packets = 0; } static void @@ -105,7 +104,7 @@ wspstat_reset(void *psp) * ALL packets and not just the ones we are collecting stats for. * */ -static gint +static gint pdut2index(gint pdut) { if (pdut<=0x09) return pdut; @@ -141,8 +140,8 @@ wspstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const gint *key=g_malloc( sizeof(gint) ); wsp_status_code_t *sc; *key=value->status_code ; - sc = g_hash_table_lookup( - sp->hash, + sc = g_hash_table_lookup( + sp->hash, key); if (!sc) { sc = g_malloc( sizeof(wsp_status_code_t) ); @@ -158,7 +157,7 @@ wspstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const retour=1; } - + if (idx!=0) { sp->pdu_stats[ idx ].packets++; @@ -173,7 +172,7 @@ wspstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const * stdout. * TShark will only call this callback once, which is when tshark has * finished reading all packets and exists. - * If used with wireshark this may be called any time, perhaps once every 3 + * If used with wireshark this may be called any time, perhaps once every 3 * seconds or so. * This function may even be called in parallell with (*reset) or (*draw) * so make sure there are no races. The data in the rpcstat_t can thus change @@ -196,12 +195,12 @@ wspstat_draw(void *psp) printf(" || "); if (ii< (sp->num_pdus) ) printf("%-23s %9d\n", sp->pdu_stats[ii].type, sp->pdu_stats[ii].packets); - else + else printf("\n"); } printf("\nStatus code in reply packets\n"); printf( "Status Code Packets Description\n"); - g_hash_table_foreach( sp->hash, (GHFunc) wsp_print_statuscode, + g_hash_table_foreach( sp->hash, (GHFunc) wsp_print_statuscode, " 0x%02X %9d %s\n" ) ; printf("===================================================================\n"); } @@ -221,14 +220,14 @@ wspstat_init(const char *optarg, void* userdata _U_) guint32 i; GString *error_string; wsp_status_code_t *sc; - + if (!strncmp (optarg, "wsp,stat," , 9)){ filter=optarg+9; } else { filter=NULL; } - - + + sp = g_malloc( sizeof(wspstat_t) ); sp->hash = g_hash_table_new( g_int_hash, g_int_equal); for (i=0 ; vals_status[i].strptr ; i++ ) @@ -257,7 +256,7 @@ wspstat_init(const char *optarg, void* userdata _U_) sp->pdu_stats[i].type = match_strval( index2pdut( i ), vals_pdu_type) ; } - error_string = register_tap_listener( + error_string = register_tap_listener( "wsp", sp, filter, @@ -278,7 +277,7 @@ wspstat_init(const char *optarg, void* userdata _U_) exit(1); } } -void +void register_tap_listener_wspstat(void) { register_stat_cmd_arg("wsp,stat,", wspstat_init,NULL); |