]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/sys-NeXT.c
remove a couple of ansi-C-isms.
[ppp.git] / pppd / sys-NeXT.c
index 0a6645e4d75186b7e3d997b796acb3f0bca1a5e4..7db81d4a43038954cccde98426018319232680b6 100644 (file)
@@ -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.16 1999/03/19 04:23:46 paulus Exp $";
 #endif
 
 #include <stdio.h>
@@ -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,26 @@ 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 ppp_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 = req.stats;
+    return 1;
+}
+
 
 /*
  * get_loop_output - read characters from the loopback, form them