+ int arg;
+{
+ signalled = 1;
+}
+
+#ifndef __svr4__
+get_ppp_stats(curp)
+ struct ppp_stats *curp;
+{
+ struct ifpppstatsreq req;
+
+#ifdef _linux_
+ req.stats_ptr = &req.stats;
+#undef ifr_name
+#define ifr_name ifr__name
+#endif
+
+ sprintf(req.ifr_name, "ppp%d", unit);
+ if (ioctl(s, SIOCGPPPSTATS, &req) < 0) {
+ if (errno == ENOTTY)
+ fprintf(stderr, "pppstats: kernel support missing\n");
+ else
+ perror("ioctl(SIOCGPPPSTATS)");
+ exit(1);
+ }
+ *curp = req.stats;
+}
+
+get_ppp_cstats(csp)
+ struct ppp_comp_stats *csp;
+{
+ struct ifpppcstatsreq creq;
+
+#ifdef _linux_
+ creq.stats_ptr = &creq.stats;
+#undef ifr_name
+#define ifr_name ifr__name
+#endif
+
+ sprintf(creq.ifr_name, "ppp%d", unit);
+ if (ioctl(s, SIOCGPPPCSTATS, &creq) < 0) {
+ if (errno == ENOTTY) {
+ fprintf(stderr, "pppstats: no kernel compression support\n");
+ if (cflag)
+ exit(1);
+ rflag = 0;
+ } else {
+ perror("ioctl(SIOCGPPPCSTATS)");
+ exit(1);
+ }
+ }
+ *csp = creq.stats;
+}
+
+#else /* __svr4__ */
+get_ppp_stats(curp)
+ struct ppp_stats *curp;
+{
+ if (strioctl(s, PPPIO_GETSTAT, curp, 0, sizeof(*curp)) < 0) {
+ if (errno == EINVAL)
+ fprintf(stderr, "pppstats: kernel support missing\n");
+ else
+ perror("pppstats: Couldn't get statistics");
+ exit(1);
+ }
+}
+
+get_ppp_cstats(csp)
+ struct ppp_comp_stats *csp;