Set the right properties on the new files.
[obnox/wireshark/wip.git] / tap-rpcprogs.c
index 9fec2448f0a32b5395018489e8959bfa9d86cc9e..fcad0f54f9ccc807bda9319cbe298ee13cf2636d 100644 (file)
@@ -3,8 +3,8 @@
  *
  * $Id$
  *
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * 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
@@ -22,8 +22,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-/* This module provides rpc call/reply SRT statistics to tethereal.
- * It is only used by tethereal and not ethereal
+/* This module provides rpc call/reply SRT statistics to tshark.
+ * It is only used by tshark and not wireshark
  */
 
 #ifdef HAVE_CONFIG_H
@@ -39,7 +39,7 @@
 #include <string.h>
 #include "epan/packet_info.h"
 #include <epan/tap.h>
-#include <epan/stat.h>
+#include <epan/stat_cmd_args.h>
 #include <epan/dissectors/packet-rpc.h>
 #include "register.h"
 
@@ -135,12 +135,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
        }
 
        /* calculate time delta between request and reply */
-       delta.secs=pinfo->fd->abs_secs-ri->req_time.secs;
-       delta.nsecs=pinfo->fd->abs_usecs*1000-ri->req_time.nsecs;
-       if(delta.nsecs<0){
-               delta.nsecs+=1000000000;
-               delta.secs--;
-       }
+       nstime_delta(&delta, &pinfo->fd->abs_ts, &ri->req_time);
 
        if((rp->max.secs==0)
        && (rp->max.nsecs==0) ){
@@ -221,7 +216,7 @@ rpcprogs_draw(void *dummy _U_)
 
 
 static void
-rpcprogs_init(const char *optarg _U_)
+rpcprogs_init(const char *optarg _U_, void* userdata _U_)
 {
        GString *error_string;
 
@@ -232,7 +227,7 @@ rpcprogs_init(const char *optarg _U_)
 
        error_string=register_tap_listener("rpc", NULL, NULL, NULL, rpcprogs_packet, rpcprogs_draw);
        if(error_string){
-               fprintf(stderr,"tethereal: Couldn't register rpc,programs tap: %s\n",
+               fprintf(stderr,"tshark: Couldn't register rpc,programs tap: %s\n",
                    error_string->str);
                g_string_free(error_string, TRUE);
                exit(1);
@@ -243,7 +238,7 @@ rpcprogs_init(const char *optarg _U_)
 void
 register_tap_listener_rpcprogs(void)
 {
-       register_stat_cmd_arg("rpc,programs", rpcprogs_init);
+       register_stat_cmd_arg("rpc,programs", rpcprogs_init, NULL);
 }