Xcode 4 isn't available on DVD, but is available for download from
[obnox/wireshark/wip.git] / tap-afpstat.c
index 704b1716ab7eaeb63f3c684c5f410a8cfb5082b5..e1960f474daf664110914f92565a077b23d5ac14 100644 (file)
@@ -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 */
@@ -82,9 +81,9 @@ afpstat_draw(void *pss)
        guint64 td;
        printf("\n");
        printf("===================================================================\n");
-       printf("AFP RTT Statistics:\n");
+       printf("AFP SRT Statistics:\n");
        printf("Filter: %s\n",ss->filter?ss->filter:"");
-       printf("Commands                   Calls   Min RTT   Max RTT   Avg RTT\n");
+       printf("Commands                   Calls   Min SRT   Max SRT   Avg SRT\n");
        for(i=0;i<256;i++){
                /* nothing seen, nothing to do */
                if(ss->proc[i].num==0){
@@ -100,8 +99,8 @@ afpstat_draw(void *pss)
                        td=0;
                }
 
-               printf("%-25s %6d %3d.%05d %3d.%05d %3" PRIu64 ".%05" PRIu64 "\n",
-                       val_to_str(i, CommandCode_vals, "Unknown (%u)"),
+               printf("%-25s %6d %3d.%05d %3d.%05d %3" G_GINT64_MODIFIER "u.%05" G_GINT64_MODIFIER "u\n",
+                       val_to_str_ext(i, &CommandCode_vals_ext, "Unknown (%u)"),
                        ss->proc[i].num,
                        (int)ss->proc[i].min.secs,ss->proc[i].min.nsecs/10000,
                        (int)ss->proc[i].max.secs,ss->proc[i].max.nsecs/10000,
@@ -120,7 +119,7 @@ afpstat_init(const char *optarg, void* userdata _U_)
        const char *filter=NULL;
        GString *error_string;
 
-       if(!strncmp(optarg,"afp,rtt,",8)){
+       if(!strncmp(optarg,"afp,srt,",8)){
                filter=optarg+8;
        } else {
                filter=NULL;
@@ -128,8 +127,7 @@ afpstat_init(const char *optarg, void* userdata _U_)
 
        ss=g_malloc(sizeof(afpstat_t));
        if(filter){
-               ss->filter=g_malloc(strlen(filter)+1);
-               strcpy(ss->filter, filter);
+               ss->filter=g_strdup(filter);
        } else {
                ss->filter=NULL;
        }
@@ -146,13 +144,13 @@ afpstat_init(const char *optarg, void* userdata _U_)
                ss->proc[i].tot.nsecs=0;
        }
 
-       error_string=register_tap_listener("afp", ss, filter, NULL, afpstat_packet, afpstat_draw);
+       error_string=register_tap_listener("afp", ss, filter, 0, NULL, afpstat_packet, afpstat_draw);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */
                g_free(ss->filter);
                g_free(ss);
 
-               fprintf(stderr, "tshark: Couldn't register afp,rtt tap: %s\n",
+               fprintf(stderr, "tshark: Couldn't register afp,srt tap: %s\n",
                    error_string->str);
                g_string_free(error_string, TRUE);
                exit(1);
@@ -162,5 +160,5 @@ afpstat_init(const char *optarg, void* userdata _U_)
 void
 register_tap_listener_afpstat(void)
 {
-       register_stat_cmd_arg("afp,rtt", afpstat_init,NULL);
+       register_stat_cmd_arg("afp,srt", afpstat_init,NULL);
 }