X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-NeXT.c;h=d498c4bfe7909e068cd3f87a19014e58b88a7db3;hb=ade32d2243161da94d757258cd0929a975a6a74c;hp=0a6645e4d75186b7e3d997b796acb3f0bca1a5e4;hpb=fdc0c58f5a318a320f15e922f4df879b6bd75c71;p=ppp.git diff --git a/pppd/sys-NeXT.c b/pppd/sys-NeXT.c index 0a6645e..d498c4b 100644 --- a/pppd/sys-NeXT.c +++ b/pppd/sys-NeXT.c @@ -20,7 +20,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: sys-NeXT.c,v 1.15 1999/03/19 01:29:40 paulus Exp $"; +static char rcsid[] = "$Id: sys-NeXT.c,v 1.17 1999/03/22 05:55:36 paulus Exp $"; #endif #include @@ -541,7 +541,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) @@ -551,7 +552,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); } @@ -1447,6 +1449,27 @@ get_idle_time(u, ip) return (ioctl(ttyfd, 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; +} + /* * get_loop_output - read characters from the loopback, form them