1N/A * print PPP statistics: 1N/A * pppstats [-a|-d] [-v|-r|-z] [-c count] [-w wait] [interface] 1N/A * -a Show absolute values rather than deltas 1N/A * -d Show data rate (kB/s) rather than bytes 1N/A * -v Show more stats for VJ TCP header compression 1N/A * -r Show compression ratio 1N/A * -z Show compression statistics instead of default display 1N/A * perkins@cps.msu.edu: Added compression statistics and alternate 1N/A * Brad Parker (brad@cayman.com) 6/92 1N/A * from the original "slstats" by Van Jacobson 1N/A * Copyright (c) 2000-2001 by Sun Microsystems, Inc. 1N/A * All rights reserved. 1N/A * Copyright (c) 1989 Regents of the University of California. 1N/A * All rights reserved. 1N/A * Redistribution and use in source and binary forms are permitted 1N/A * provided that the above copyright notice and this paragraph are 1N/A * duplicated in all such forms and that any documentation, 1N/A * advertising materials, and other materials related to such 1N/A * distribution and use acknowledge that the software was developed 1N/A * by the University of California, Berkeley. The name of the 1N/A * University may not be used to endorse or promote products derived 1N/A * from this software without specific prior written permission. 1N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 1N/A * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 1N/A * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/Astatic int aflag;
/* print absolute values, not deltas */ 1N/Astatic int dflag;
/* print data rates, not bytes */ 1N/Astatic int s;
/* socket or /dev/ppp file descriptor */ 1N/A * If PPP_DRV_NAME is not defined, use the legacy "ppp" as the 1N/A#
endif /* !defined(PPP_DRV_NAME) */ 1N/A "Usage: %s [-a|-d] [-v|-r|-z] [-c count] [-w wait] [interface]\n",
1N/A * Called if an interval expires before intpr has completed a loop. 1N/A * Sets a flag to not wait for the alarm. 1N/A perror(
"couldn't get PPP compression stats");
1N/A "strioctl: expected %d bytes, got %d for cmd %x\n",
1N/A perror(
"couldn't get PPP compression statistics");
1N/A#
define MAX0(a) ((
int)(a) > 0? (a): 0)
1N/A#
define RATIO(c, i, u) ((c) == 0?
1.0: (u) / ((
double)(c) + (i)))
1N/A * Print a running summary of interface statistics. 1N/A * Repeat display every interval seconds, showing statistics 1N/A * collected over that interval. Assumes that interval is non-zero. 1N/A * First line printed is cumulative. 1N/A (
void)
printf(
"IN: COMPRESSED INCOMPRESSIBLE COMP | ");
1N/A (
void)
printf(
"OUT: COMPRESSED INCOMPRESSIBLE COMP\n");
1N/A "IN",
"PACK",
"VJCOMP");
1N/A (
void)
printf(
" %6.6s %6.6s",
"VJUNC",
"VJERR");
1N/A (
void)
printf(
" %6.6s %6.6s",
"VJTOSS",
"NON-VJ");
1N/A (
void)
printf(
" %6.6s %6.6s",
"RATIO",
"UBYTE");
1N/A "OUT",
"PACK",
"VJCOMP");
1N/A (
void)
printf(
" %6.6s %6.6s",
"VJUNC",
"NON-VJ");
1N/A (
void)
printf(
" %6.6s %6.6s",
"VJSRCH",
"VJMISS");
1N/A (
void)
printf(
" %6.6s %6.6s",
"RATIO",
"UBYTE");
1N/A (
void)
printf(
" | %8.3f %6u %8.3f %6u %6.2f",