X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-ultrix.c;h=f004ba62b556fc5e3ad7aba77ec2e4d0abd31109;hb=52e781b87df66bd5a4eb075791f4d91604016144;hp=e4ed3e7f0ab0b85d0e9bd68267cc80d69e72cc05;hpb=fdc0c58f5a318a320f15e922f4df879b6bd75c71;p=ppp.git diff --git a/pppd/sys-ultrix.c b/pppd/sys-ultrix.c index e4ed3e7..f004ba6 100644 --- a/pppd/sys-ultrix.c +++ b/pppd/sys-ultrix.c @@ -21,7 +21,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-ultrix.c,v 1.28 1999/03/19 01:29:51 paulus Exp $"; +static char rcsid[] = "$Id: sys-ultrix.c,v 1.30 1999/03/22 05:55:40 paulus Exp $"; #endif /* @@ -586,7 +586,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; { FD_SET(fd, &in_fds); if (fd > max_in_fd) @@ -596,7 +597,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; { FD_CLR(fd, &in_fds); } @@ -793,6 +795,27 @@ get_idle_time(u, ip) return ioctl(ppp_fd, PPPIOCGIDLE, ip) >= 0; } +/* + * get_ppp_stats - return statistics for the link. + */ +int +get_ppp_stats(u, stats) + int u; + struct pppd_stats *stats; +{ + struct ifpppstatsreq req; + + memset (&req, 0, sizeof (req)); + strlcpy(req.ifr_name, interface, sizeof(req.ifr_name)); + if (ioctl(sockfd, SIOCGPPPSTATS, &req) < 0) { + error("Couldn't get PPP statistics: %m"); + return 0; + } + stats->bytes_in = req.stats.p.ppp_ibytes; + stats->bytes_out = req.stats.p.ppp_obytes; + return 1; +} + /* * sifvjcomp - config tcp header compression