X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-osf.c;h=94b3dd2576d41902d54aad8c17cfec28dc4cb640;hb=91d19fa519feae5392a359c435790a1a55999fb8;hp=30930b25743cccf6d7c78efe366dc5aac111a751;hpb=fdc0c58f5a318a320f15e922f4df879b6bd75c71;p=ppp.git diff --git a/pppd/sys-osf.c b/pppd/sys-osf.c index 30930b2..94b3dd2 100644 --- a/pppd/sys-osf.c +++ b/pppd/sys-osf.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-osf.c,v 1.21 1999/03/19 01:29:46 paulus Exp $"; +static char rcsid[] = "$Id: sys-osf.c,v 1.23 1999/03/22 05:55:38 paulus Exp $"; #endif #include @@ -754,7 +754,8 @@ wait_input(timo) /* * add_fd - add an fd to the set that wait_input waits for. */ -void add_fd(int fd) +void add_fd(fd) + int fd; { int n; @@ -772,7 +773,8 @@ void add_fd(int fd) /* * remove_fd - remove an fd from the set that wait_input waits for. */ -void remove_fd(int fd) +void remove_fd(fd) + int fd; { int n; @@ -1009,6 +1011,25 @@ get_idle_time(u, ip) return strioctl(pppfd, PPPIO_GIDLE, ip, 0, sizeof(struct ppp_idle)) >= 0; } +/* + * get_ppp_stats - return statistics for the link. + */ +int +get_ppp_stats(u, stats) + int u; + struct pppd_stats *stats; +{ + struct ppp_stats s; + + if (strioctl(pppfd, PPPIO_GETSTAT, &s, 0, sizeof(s)) < 0) { + error("Couldn't get link statistics: %m"); + return 0; + } + stats->bytes_in = s.p.ppp_ibytes; + stats->bytes_out = s.p.ppp_obytes; + return 1; +} + /* * ccp_fatal_error - returns 1 if decompression was disabled as a