diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-09-26 01:13:04 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2002-09-26 01:13:04 +0000 |
commit | c7b512c343969d68af3a45829c99febe5ab8cebe (patch) | |
tree | 24a360f039a50c597e2f4ac4d3516a2374ea0701 /tethereal.c | |
parent | 82b3850853d39431263ec584d1085e55c27d1605 (diff) |
Updated RPCSTAT for tethereal. The command now takes a filter string as an optional extra parameter.
This makes it possible to generate any types of stats based on user defined subsets of the capture.
Try -z rpc,rtt,100003,3,nfs.fh.hash==0x12345678
NFS rtt statistics for a specific file.
svn path=/trunk/; revision=6337
Diffstat (limited to 'tethereal.c')
-rw-r--r-- | tethereal.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tethereal.c b/tethereal.c index bfcb03e14c..4e64b96344 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.157 2002/09/06 22:45:40 sahlberg Exp $ + * $Id: tethereal.c,v 1.158 2002/09/26 01:13:02 sahlberg Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -634,10 +634,15 @@ main(int argc, char *argv[]) if(!strncmp(optarg,"rpc,",4)){ if(!strncmp(optarg,"rpc,rtt,",8)){ int rpcprogram, rpcversion; - if(sscanf(optarg,"rpc,rtt,%d,%d",&rpcprogram,&rpcversion)==2){ - rpcstat_init(rpcprogram,rpcversion); + int pos=0; + if(sscanf(optarg,"rpc,rtt,%d,%d,%n",&rpcprogram,&rpcversion,&pos)==2){ + if(pos){ + rpcstat_init(rpcprogram,rpcversion,optarg+pos); + } else { + rpcstat_init(rpcprogram,rpcversion,NULL); + } } else { - fprintf(stderr, "tethereal: invalid \"-z rpc,rtt,<program>,<version>\" argument\n"); + fprintf(stderr, "tethereal: invalid \"-z rpc,rtt,<program>,<version>[,<filterstring>]\" argument\n"); exit(1); } } else if(!strncmp(optarg,"rpc,programs",12)){ |