summaryrefslogtreecommitdiff
path: root/pppstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>1995-12-11 05:18:59 +0000
committerPaul Mackerras <paulus@samba.org>1995-12-11 05:18:59 +0000
commitbfee5a891194098d34e3537de455b832a4c5d36d (patch)
tree22a9f9bee3d5e2de240cb9e3949b9c8151a32a4e /pppstats
parentdee72905271845128ad26cff5cf770c433f3f4a7 (diff)
Linux mods from Al's version
Diffstat (limited to 'pppstats')
-rw-r--r--pppstats/pppstats.c17
1 files changed, 16 insertions, 1 deletions
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 <ctype.h>
@@ -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;
}