]> git.ozlabs.org Git - ppp.git/commitdiff
fix for freebsd
authorPaul Mackerras <paulus@samba.org>
Tue, 8 Oct 1996 04:38:08 +0000 (04:38 +0000)
committerPaul Mackerras <paulus@samba.org>
Tue, 8 Oct 1996 04:38:08 +0000 (04:38 +0000)
chat/Makefile.bsd
common/zlib.c
configure
freebsd-2.0/if_ppp.c
freebsd-2.0/if_pppvar.h
freebsd-2.0/kinstall.sh
freebsd-2.0/ppp_defs.h [new file with mode: 0644]
netbsd-1.1/ppp-deflate.c
pppd/Makefile.bsd
pppstats/Makefile.bsd

index d299d9a899eef4eb941fe30fc872a2db7873aaba..500633877fe8e4cc7d1735e7da1d734af969714f 100644 (file)
@@ -1,8 +1,8 @@
-#      $Id: Makefile.bsd,v 1.3 1995/04/28 06:21:15 paulus Exp $
+#      $Id: Makefile.bsd,v 1.4 1996/10/08 04:37:59 paulus Exp $
 
 PROG=  chat
 SRCS=  chat.c
 
 PROG=  chat
 SRCS=  chat.c
-MAN8=  chat.0
+MAN8=  chat.8
 MAN=   chat.cat8
 BINDIR=        /usr/sbin
 
 MAN=   chat.cat8
 BINDIR=        /usr/sbin
 
index 4a518e27f10fb5f67733878aa1dda2045b0992bd..e9dc1770c94f667b7001b861d4aa3e416ab979b9 100644 (file)
@@ -11,7 +11,7 @@
  * - added Z_PACKET_FLUSH (see zlib.h for details)
  * - added inflateIncomp
  *
  * - added Z_PACKET_FLUSH (see zlib.h for details)
  * - added inflateIncomp
  *
- * $Id: zlib.c,v 1.3 1996/09/26 06:29:43 paulus Exp $
+ * $Id: zlib.c,v 1.4 1996/10/08 04:38:00 paulus Exp $
  */
 
 /* 
  */
 
 /* 
@@ -88,12 +88,15 @@ extern char *z_errmsg[]; /* indexed by 1-zlib_error */
          /* functions */
 
 #if defined(KERNEL) || defined(_KERNEL)
          /* functions */
 
 #if defined(KERNEL) || defined(_KERNEL)
-/* Assume we're not being compiled under Linux */
 #include <sys/types.h>
 #include <sys/systm.h>
 #  define zmemcpy(d, s, n)     bcopy((s), (d), (n))
 #  define zmemzero             bzero
 
 #include <sys/types.h>
 #include <sys/systm.h>
 #  define zmemcpy(d, s, n)     bcopy((s), (d), (n))
 #  define zmemzero             bzero
 
+#ifdef FreeBSD
+#define inflate        inflate_ppp
+#endif
+
 #else
 #if defined(__KERNEL__)
 /* Assume this is Linux */
 #else
 #if defined(__KERNEL__)
 /* Assume this is Linux */
index 90c76d219f6b06156509bee6b4d5d6ee20525d14..3b2bb809a62c63f58e034282b6a470e7034a6ec2 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# $Id: configure,v 1.11 1996/09/26 06:15:36 paulus Exp $
+# $Id: configure,v 1.12 1996/10/08 04:36:56 paulus Exp $
 
 if [ -d /NextApps ]; then
   system="NeXTStep"
 
 if [ -d /NextApps ]; then
   system="NeXTStep"
@@ -47,8 +47,8 @@ case $system in
     makext="bsd";
     case $release in
       1.*)     state="known"; ksrc="freebsd-old";;
     makext="bsd";
     case $release in
       1.*)     state="known"; ksrc="freebsd-old";;
-      2.0*)    state="known"; ksrc="freebsd-2.0";;
-      2.[1-9]*)        state="late"; ksrc="freebsd-2.0";;
+      2.[01]*) state="known"; ksrc="freebsd-2.0";;
+      2.[2-9]*)        state="late"; ksrc="freebsd-2.0";;
     esac;;
   NeXTStep)
     makext="NeXT";
     esac;;
   NeXTStep)
     makext="NeXT";
index f540a9b132dd3ac253382fa49fe3db9362f11e93..4388646c63373b9d6ae24fb89cae95e53c8241fd 100644 (file)
@@ -69,7 +69,7 @@
  * Paul Mackerras (paulus@cs.anu.edu.au).
  */
 
  * Paul Mackerras (paulus@cs.anu.edu.au).
  */
 
-/* $Id: if_ppp.c,v 1.9 1996/09/26 06:24:39 paulus Exp $ */
+/* $Id: if_ppp.c,v 1.10 1996/10/08 04:38:03 paulus Exp $ */
 /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
 /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
 
 /* from if_sl.c,v 1.11 84/10/04 12:54:47 rick Exp */
 /* from NetBSD: if_ppp.c,v 1.15.2.2 1994/07/28 05:17:58 cgd Exp */
 
@@ -234,7 +234,7 @@ pppalloc(pid)
     sc->sc_relinq = NULL;
     bzero((char *)&sc->sc_stats, sizeof(sc->sc_stats));
 #ifdef VJC
     sc->sc_relinq = NULL;
     bzero((char *)&sc->sc_stats, sizeof(sc->sc_stats));
 #ifdef VJC
-    MALLOC(sc->sc_comp, struct slcompress *, sizeof(struct slcompress),
+    MALLOC(sc->sc_comp, struct vjcompress *, sizeof(struct vjcompress),
           M_DEVBUF, M_NOWAIT);
     if (sc->sc_comp)
        vj_compress_init(sc->sc_comp, -1);
           M_DEVBUF, M_NOWAIT);
     if (sc->sc_comp)
        vj_compress_init(sc->sc_comp, -1);
index 4673334b5c10e3e19723a4435d84ed4e0270be51..22a5e4cc6417a7490a91438a221e389bf4b86533 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: if_pppvar.h,v 1.2 1996/07/01 01:00:28 paulus Exp $ */
+/*     $Id: if_pppvar.h,v 1.3 1996/10/08 04:38:03 paulus Exp $ */
 /*
  * if_pppvar.h - private structures and declarations for PPP.
  *
 /*
  * if_pppvar.h - private structures and declarations for PPP.
  *
@@ -76,7 +76,7 @@ struct ppp_softc {
        time_t  sc_last_sent;           /* time (secs) last NP pkt sent */
        time_t  sc_last_recv;           /* time (secs) last NP pkt rcvd */
 #ifdef VJC
        time_t  sc_last_sent;           /* time (secs) last NP pkt sent */
        time_t  sc_last_recv;           /* time (secs) last NP pkt rcvd */
 #ifdef VJC
-       struct  slcompress *sc_comp;    /* vjc control buffer */
+       struct  vjcompress *sc_comp;    /* vjc control buffer */
 #endif
 
        /* Device-dependent part for async lines. */
 #endif
 
        /* Device-dependent part for async lines. */
index bb0d88a9e424567be363c9b720fce557e03e6e24..ae90a05b714810472cc6f01c82434695caae583f 100755 (executable)
@@ -16,7 +16,7 @@ CONFIG=config
 
 # Copy new versions of files into /sys/net
 
 
 # Copy new versions of files into /sys/net
 
-for f in net/if_ppp.h net/ppp-comp.h net/ppp_defs.h $SRC/bsd-comp.c \
+for f in net/if_ppp.h net/ppp-comp.h $SRC/ppp_defs.h $SRC/bsd-comp.c \
         $SRC/ppp-deflate.c $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \
         $SRC/pppcompress.c $SRC/pppcompress.h common/zlib.c common/zlib.h; do
   dest=$SYS/net/$(basename $f)
         $SRC/ppp-deflate.c $SRC/if_ppp.c $SRC/if_pppvar.h $SRC/ppp_tty.c \
         $SRC/pppcompress.c $SRC/pppcompress.h common/zlib.c common/zlib.h; do
   dest=$SYS/net/$(basename $f)
diff --git a/freebsd-2.0/ppp_defs.h b/freebsd-2.0/ppp_defs.h
new file mode 100644 (file)
index 0000000..41d7e86
--- /dev/null
@@ -0,0 +1,150 @@
+/*     $Id: ppp_defs.h,v 1.1 1996/10/08 04:38:04 paulus Exp $  */
+
+/*
+ * ppp_defs.h - PPP definitions.
+ *
+ * Copyright (c) 1994 The Australian National University.
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation is hereby granted, provided that the above copyright
+ * notice appears in all copies.  This software is provided without any
+ * warranty, express or implied. The Australian National University
+ * makes no representations about the suitability of this software for
+ * any purpose.
+ *
+ * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY
+ * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+ * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ *
+ * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
+ * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
+ * OR MODIFICATIONS.
+ */
+
+#ifndef _PPP_DEFS_H_
+#define _PPP_DEFS_H_
+
+/*
+ * The basic PPP frame.
+ */
+#define PPP_HDRLEN     4       /* octets for standard ppp header */
+#define PPP_FCSLEN     2       /* octets for FCS */
+#define PPP_MRU                1500    /* default MRU = max length of info field */
+
+#define PPP_ADDRESS(p) (((u_char *)(p))[0])
+#define PPP_CONTROL(p) (((u_char *)(p))[1])
+#define PPP_PROTOCOL(p)        ((((u_char *)(p))[2] << 8) + ((u_char *)(p))[3])
+
+/*
+ * Significant octet values.
+ */
+#define        PPP_ALLSTATIONS 0xff    /* All-Stations broadcast address */
+#define        PPP_UI          0x03    /* Unnumbered Information */
+#define        PPP_FLAG        0x7e    /* Flag Sequence */
+#define        PPP_ESCAPE      0x7d    /* Asynchronous Control Escape */
+#define        PPP_TRANS       0x20    /* Asynchronous transparency modifier */
+
+/*
+ * Protocol field values.
+ */
+#define PPP_IP         0x21    /* Internet Protocol */
+#define        PPP_VJC_COMP    0x2d    /* VJ compressed TCP */
+#define        PPP_VJC_UNCOMP  0x2f    /* VJ uncompressed TCP */
+#define PPP_COMP       0xfd    /* compressed packet */
+#define PPP_IPCP       0x8021  /* IP Control Protocol */
+#define PPP_CCP                0x80fd  /* Compression Control Protocol */
+#define PPP_LCP                0xc021  /* Link Control Protocol */
+#define PPP_PAP                0xc023  /* Password Authentication Protocol */
+#define PPP_LQR                0xc025  /* Link Quality Report protocol */
+#define PPP_CHAP       0xc223  /* Cryptographic Handshake Auth. Protocol */
+#define PPP_CBCP       0xc029  /* Callback Control Protocol */
+
+/*
+ * Values for FCS calculations.
+ */
+#define PPP_INITFCS    0xffff  /* Initial FCS value */
+#define PPP_GOODFCS    0xf0b8  /* Good final FCS value */
+#define PPP_FCS(fcs, c)        (((fcs) >> 8) ^ fcstab[((fcs) ^ (c)) & 0xff])
+
+/*
+ * Extended asyncmap - allows any character to be escaped.
+ */
+typedef u_int32_t      ext_accm[8];
+
+/*
+ * What to do with network protocol (NP) packets.
+ */
+enum NPmode {
+    NPMODE_PASS,               /* pass the packet through */
+    NPMODE_DROP,               /* silently drop the packet */
+    NPMODE_ERROR,              /* return an error */
+    NPMODE_QUEUE               /* save it up for later. */
+};
+
+/*
+ * Statistics.
+ */
+struct pppstat {
+    unsigned int ppp_ibytes;   /* bytes received */
+    unsigned int ppp_ipackets; /* packets received */
+    unsigned int ppp_ierrors;  /* receive errors */
+    unsigned int ppp_obytes;   /* bytes sent */
+    unsigned int ppp_opackets; /* packets sent */
+    unsigned int ppp_oerrors;  /* transmit errors */
+};
+
+struct vjstat {
+    unsigned int vjs_packets;  /* outbound packets */
+    unsigned int vjs_compressed; /* outbound compressed packets */
+    unsigned int vjs_searches; /* searches for connection state */
+    unsigned int vjs_misses;   /* times couldn't find conn. state */
+    unsigned int vjs_uncompressedin; /* inbound uncompressed packets */
+    unsigned int vjs_compressedin; /* inbound compressed packets */
+    unsigned int vjs_errorin;  /* inbound unknown type packets */
+    unsigned int vjs_tossed;   /* inbound packets tossed because of error */
+};
+
+struct ppp_stats {
+    struct pppstat p;          /* basic PPP statistics */
+    struct vjstat vj;          /* VJ header compression statistics */
+};
+
+struct compstat {
+    unsigned int unc_bytes;    /* total uncompressed bytes */
+    unsigned int unc_packets;  /* total uncompressed packets */
+    unsigned int comp_bytes;   /* compressed bytes */
+    unsigned int comp_packets; /* compressed packets */
+    unsigned int inc_bytes;    /* incompressible bytes */
+    unsigned int inc_packets;  /* incompressible packets */
+    unsigned int ratio;                /* recent compression ratio << 8 */
+};
+
+struct ppp_comp_stats {
+    struct compstat c;         /* packet compression statistics */
+    struct compstat d;         /* packet decompression statistics */
+};
+
+/*
+ * The following structure records the time in seconds since
+ * the last NP packet was sent or received.
+ */
+struct ppp_idle {
+    time_t xmit_idle;          /* time since last NP packet sent */
+    time_t recv_idle;          /* time since last NP packet received */
+};
+
+#ifndef __P
+#ifdef __STDC__
+#define __P(x) x
+#else
+#define __P(x) ()
+#endif
+#endif
+
+#endif /* _PPP_DEFS_H_ */
index 5092e9ac79e215141059c957f10ed06ba8d697f7..6470235a9c803e67572f0c9b80f79bb8dd1c006b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: ppp-deflate.c,v 1.3 1996/08/28 06:37:09 paulus Exp $       */
+/*     $Id: ppp-deflate.c,v 1.4 1996/10/08 04:38:06 paulus Exp $       */
 
 /*
  * ppp_deflate.c - interface the zlib procedures for Deflate compression
 
 /*
  * ppp_deflate.c - interface the zlib procedures for Deflate compression
 
 #if DO_DEFLATE
 
 
 #if DO_DEFLATE
 
+#ifdef FreeBSD
+#define inflate        inflate_ppp     /* FreeBSD already has an inflate :-( */
+#endif
+
 #define DEFLATE_DEBUG  1
 
 /*
 #define DEFLATE_DEBUG  1
 
 /*
index a1aab1f4d94cbcd058b6460effc4f5f71be44960..a1f6b849d0d69f907cfbb455ab7612cf9ff02b3b 100644 (file)
@@ -1,4 +1,4 @@
-#      $Id: Makefile.bsd,v 1.12 1996/08/28 06:37:41 paulus Exp $
+#      $Id: Makefile.bsd,v 1.13 1996/10/08 04:33:33 paulus Exp $
 
 BINDIR?= /usr/sbin
 # -D_BITYPES is for FreeBSD, which doesn't define anything to
 
 BINDIR?= /usr/sbin
 # -D_BITYPES is for FreeBSD, which doesn't define anything to
@@ -10,8 +10,7 @@ PROG= pppd
 SRCS=  main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
        demand.c auth.c options.c sys-bsd.c
 MAN=   pppd.cat8
 SRCS=  main.c magic.c fsm.c lcp.c ipcp.c upap.c chap.c md5.c ccp.c \
        demand.c auth.c options.c sys-bsd.c
 MAN=   pppd.cat8
-# The next line is for NetBSD-1.0 and other older *BSD systems.
-MAN8=  pppd.0
+MAN8=  pppd.8
 BINMODE=4555
 BINOWN=        root
 
 BINMODE=4555
 BINOWN=        root
 
index e1fe4a237e26fb1b845d918b00090d18b514661e..ef6136402c68bcafd03d9320b7dd3d163e938796 100644 (file)
@@ -1,9 +1,9 @@
-#      $Id: Makefile.bsd,v 1.4 1995/04/28 06:23:18 paulus Exp $
+#      $Id: Makefile.bsd,v 1.5 1996/10/08 04:38:08 paulus Exp $
 
 PROG=  pppstats
 SRCS=  pppstats.c
 
 PROG=  pppstats
 SRCS=  pppstats.c
-CFLAGS+=-I..
-MAN8=  pppstats.0
+CFLAGS+=-I.. -D_BITYPES
+MAN8=  pppstats.8
 MAN=   pppstats.cat8
 BINDIR=        /usr/sbin
 
 MAN=   pppstats.cat8
 BINDIR=        /usr/sbin