+ sprintf(req.ifr_name, "ppp%d", unit);
+ sprintf(creq.ifr_name, "ppp%d", unit);
+ while (1) {
+ if (ioctl(s, SIOCGPPPSTATS, &req) < 0) {
+ if (errno == ENOTTY)
+ fprintf(stderr, "pppstats: kernel support missing\n");
+ else
+ perror("ioctl(SIOCGPPPSTATS)");
+ exit(1);
+ }
+ if ((cflag || rflag) && 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);
+ }
+ }
+ (void)signal(SIGALRM, catchalarm);
+ signalled = 0;
+ (void)alarm(interval);
+
+ if ((line % 20) == 0) {
+ if (line > 0)
+ putchar('\n');
+ if (cflag) {
+
+ printf("%6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s",
+ "ubyte", "upack", "cbyte", "cpack", "ibyte", "ipack", "ratio");
+ printf(" | %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s %6.6s",
+ "ubyte", "upack", "cbyte", "cpack", "ibyte", "ipack", "ratio");
+ putchar('\n');
+ } else {