Make "epan_init()" take, as additional arguments, pointers to routines
[obnox/wireshark/wip.git] / tap-rpcstat.c
index 70f3b91f30c4a21a9d6ef998e5ed897ab8ff3cf7..761a57d0790d61aa798969374e5cadad31065b85 100644 (file)
@@ -1,7 +1,7 @@
 /* tap-rpcstat.c
  * rpcstat   2002 Ronnie Sahlberg
  *
- * $Id: tap-rpcstat.c,v 1.8 2003/04/23 08:20:02 guy Exp $
+ * $Id: tap-rpcstat.c,v 1.11 2003/11/27 22:15:05 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -154,14 +154,12 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, void *pri
                delta.secs--;
        }
 
-       if((rp->max.secs==0)
-       && (rp->max.nsecs==0) ){
+       if(rp->num==0){
                rp->max.secs=delta.secs;
                rp->max.nsecs=delta.nsecs;
        }
 
-       if((rp->min.secs==0)
-       && (rp->min.nsecs==0) ){
+       if(rp->num==0){
                rp->min.secs=delta.secs;
                rp->min.nsecs=delta.nsecs;
        }
@@ -186,6 +184,7 @@ rpcstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, void *pri
                rp->tot.nsecs-=1000000000;
                rp->tot.secs++;
        }
+
        rp->num++;
 
        return 1;
@@ -273,7 +272,7 @@ rpcstat_find_procs(gpointer *key, gpointer *value _U_, gpointer *user_data _U_)
 /* When called, this function will create a new instance of rpcstat.
  * program and version are whick onc-rpc program/version we want to
  * collect statistics for.
- * This function is called from tethereal when it parses the -Z rpc, arguments
+ * This function is called from tethereal when it parses the -z rpc, arguments
  * and it creates a new instance to store statistics in and registers this
  * new instance for the rpc tap.
  */
@@ -314,7 +313,7 @@ rpcstat_init(char *optarg)
        rpc_max_proc=-1;
        g_hash_table_foreach(rpc_procs, (GHFunc)rpcstat_find_procs, NULL);
        if(rpc_min_proc==-1){
-               fprintf(stderr,"tethereal: Invalid -Z rpc,rrt,%d,%d\n",rpc_program,rpc_version);
+               fprintf(stderr,"tethereal: Invalid -z rpc,rrt,%d,%d\n",rpc_program,rpc_version);
                fprintf(stderr,"   Program:%d version:%d is not supported by tethereal.\n", rpc_program, rpc_version);
                exit(1);
        }