]> git.ozlabs.org Git - ppp.git/commitdiff
added ccp_fatal_error
authorPaul Mackerras <paulus@samba.org>
Fri, 16 Sep 1994 02:18:01 +0000 (02:18 +0000)
committerPaul Mackerras <paulus@samba.org>
Fri, 16 Sep 1994 02:18:01 +0000 (02:18 +0000)
pppd/sys-str.c

index e34d54779c6c5e361334e2b75251534e59bb1996..aed7c8ee47d96844e719a04c9116da883094a4ee 100644 (file)
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+#ifndef lint
+static char rcsid[] = "$Id: sys-str.c,v 1.12 1994/09/16 02:18:01 paulus Exp $";
+#endif
+
 /*
  * TODO:
  */
 /*
  * TODO:
  */
@@ -653,6 +657,24 @@ ccp_flags_set(unit, isopen, isup)
        syslog(LOG_ERR, "ioctl (SIOCSIFCOMP): %m");
 }
 
        syslog(LOG_ERR, "ioctl (SIOCSIFCOMP): %m");
 }
 
+/*
+ * ccp_fatal_error - returns 1 if decompression was disabled as a
+ * result of an error detected after decompression of a packet,
+ * 0 otherwise.  This is necessary because of patent nonsense.
+ */
+int
+ccp_fatal_error(unit)
+    int unit;
+{
+    int x;
+
+    if (ioctl(fd, SIOCGIFCOMP, (caddr_t) &x) < 0) {
+       syslog(LOG_ERR, "ioctl(SIOCGIFCOMP): %m");
+       return 0;
+    }
+    return x & CCP_FATALERROR;
+}
+
 /*
  * sifvjcomp - config tcp header compression
  */
 /*
  * sifvjcomp - config tcp header compression
  */