From: Paul Mackerras Date: Mon, 11 Dec 1995 05:18:59 +0000 (+0000) Subject: Linux mods from Al's version X-Git-Tag: RELEASE_2_3_6~578 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=bfee5a891194098d34e3537de455b832a4c5d36d Linux mods from Al's version --- diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c index 18bb7e6..9863f32 100644 --- a/pppstats/pppstats.c +++ b/pppstats/pppstats.c @@ -37,7 +37,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: pppstats.c,v 1.11 1995/07/11 06:41:45 paulus Exp $"; +static char rcsid[] = "$Id: pppstats.c,v 1.12 1995/12/11 05:18:59 paulus Exp $"; #endif #include @@ -342,6 +342,21 @@ get_ppp_cstats(csp) exit(1); } } + +#ifdef _linux_ + if (creq.stats.c.bytes_out == 0) + creq.stats.c.ratio = 0.0; + else + creq.stats.c.ratio = (double) creq.stats.c.in_count / + (double) creq.stats.c.bytes_out; + + if (creq.stats.d.bytes_out == 0) + creq.stats.d.ratio = 0.0; + else + creq.stats.d.ratio = (double) creq.stats.d.in_count / + (double) creq.stats.d.bytes_out; +#endif + *csp = creq.stats; }