summaryrefslogtreecommitdiff
path: root/pppd
diff options
context:
space:
mode:
authorEivind Næss <eivnaes@yahoo.com>2021-06-24 16:07:26 -0700
committerEivind Næss <eivnaes@yahoo.com>2021-07-20 08:24:08 -0700
commit2883dd07101bf851e2ea368f0c04c91aea85cff2 (patch)
tree3e870a8563c504ee725b23ec179e5682c1657154 /pppd
parent9c7ba0d42dee5e3f84ecb6e4fcdbefc6c1cd965c (diff)
downloadppp-2883dd07101bf851e2ea368f0c04c91aea85cff2.tar.gz
Use autoconf/automake to configure and make ppp
This change brings in autoconf/automake scripts to configure the ppp project. Current change doesn't eliminate the previous build system, but the new script autogen.sh will overwrite configure, and generate the basic Makefile.in and Makefile files. Features can now be enabled by command line: * Microsoft Extensions, - MSCHAP - MPPE - MS LAN Manager support * IPXCP protocol * CBCP protocol * PAM support * EAP-TLS support * EAP-SRP support * Max session lifetime by byte count * Plugins * Packet activity filter support * Multilink * IPv6 support Control linkage with * OpenSSL (-lssl -lcrypto) * systemd (-lsystemd) * libatm (-latm) * libsrp (-lsrp) * pam (-lpam) Also, the configure script is made sensitive to features of OpenSSL. Like the presence or absence of DES, SHA, MD4 and MD5 crypto support. In the cases where either of these are missing, the support will be directly compiled into pppd and plugins. In addition, package maintainers can now control the installation paths with standard --prefix=, or --localstatedir=, or --sysconfdir= to configure. On top of that, they can now control the following directories: * runtime directory w/--with-runtime-dir * logfile directory w/--with-logfile-dir * plugin directory w/--with-plugin-dir In the case where automake isn't the right solution, namely: SunOS kernel module build, the original Makefile infrastructure is preserved and reused. Care was taken to only cosmetically touchup the source files in this change. This means: * Insert HAVE_CONFIG_H and include config.h in all .c files. * Change HAS_SHADOW to HAVE_SHADOW_H * Change HAVE_LOGWTMP to HAVE_UTMP_H * Introduce HAVE_CRYPT_H into the source code where appropriate * Added ifdef MPPE where appropriate * USE_SRP required a few changes as it didn't compile * Touchup some compile warning in pppstats directory on SunOS Introduced a new pppdconf.h file that exports the appropriate defines to a module that wants to provide a module that pppd can dynamically load. This will define/undef features like MPPE, CHAPMS such that the project doesn't have to guess what features pppd is compiled with. Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
Diffstat (limited to 'pppd')
-rw-r--r--pppd/Makefile.am165
-rw-r--r--pppd/Makefile.linux4
-rw-r--r--pppd/Makefile.sol22
-rw-r--r--pppd/auth.c14
-rw-r--r--pppd/cbcp.c3
-rw-r--r--pppd/cbcp.h2
-rw-r--r--pppd/ccp.c4
-rw-r--r--pppd/ccp.h1
-rw-r--r--pppd/chap-md5.c4
-rw-r--r--pppd/chap-md5.h1
-rw-r--r--pppd/chap-new.c4
-rw-r--r--pppd/chap-new.h2
-rw-r--r--pppd/chap_ms.c4
-rw-r--r--pppd/chap_ms.h2
-rw-r--r--pppd/demand.c4
-rw-r--r--pppd/eap-tls.c6
-rw-r--r--pppd/eap-tls.h2
-rw-r--r--pppd/eap.c15
-rw-r--r--pppd/eap.h2
-rw-r--r--pppd/ecp.c4
-rw-r--r--pppd/ecp.h1
-rw-r--r--pppd/eui64.c4
-rw-r--r--pppd/eui64.h2
-rw-r--r--pppd/fsm.c4
-rw-r--r--pppd/fsm.h2
-rw-r--r--pppd/ipcp.c4
-rw-r--r--pppd/ipcp.h1
-rw-r--r--pppd/ipv6cp.c4
-rw-r--r--pppd/ipv6cp.h1
-rw-r--r--pppd/ipxcp.c4
-rw-r--r--pppd/ipxcp.h1
-rw-r--r--pppd/lcp.c4
-rw-r--r--pppd/lcp.h1
-rw-r--r--pppd/magic.c4
-rw-r--r--pppd/magic.h1
-rw-r--r--pppd/main.c4
-rw-r--r--pppd/md4.c3
-rw-r--r--pppd/md4.h12
-rw-r--r--pppd/md5.c4
-rw-r--r--pppd/md5.h7
-rw-r--r--pppd/mppe.c5
-rw-r--r--pppd/mppe.h2
-rw-r--r--pppd/multilink.c5
-rw-r--r--pppd/options.c4
-rw-r--r--pppd/patchlevel.h1
-rw-r--r--pppd/pathnames.h45
-rw-r--r--pppd/plugins/Makefile.am25
-rw-r--r--pppd/plugins/minconn.c4
-rw-r--r--pppd/plugins/passprompt.c5
-rw-r--r--pppd/plugins/passwordfd.c4
-rw-r--r--pppd/plugins/pppoatm/Makefile.am18
-rw-r--r--pppd/plugins/pppoatm/pppoatm.c4
-rw-r--r--pppd/plugins/pppoe/Makefile.am25
-rw-r--r--pppd/plugins/pppoe/common.c4
-rw-r--r--pppd/plugins/pppoe/config.h129
-rw-r--r--pppd/plugins/pppoe/debug.c4
-rw-r--r--pppd/plugins/pppoe/discovery.c4
-rw-r--r--pppd/plugins/pppoe/if.c4
-rw-r--r--pppd/plugins/pppoe/plugin.c4
-rw-r--r--pppd/plugins/pppoe/pppoe-discovery.c4
-rw-r--r--pppd/plugins/pppoe/pppoe.h2
-rw-r--r--pppd/plugins/pppol2tp/Makefile.am13
-rw-r--r--pppd/plugins/pppol2tp/openl2tp.c4
-rw-r--r--pppd/plugins/pppol2tp/pppol2tp.c4
-rw-r--r--pppd/plugins/radius/Makefile.am65
-rw-r--r--pppd/plugins/radius/radattr.c4
-rw-r--r--pppd/plugins/radius/radius.c4
-rw-r--r--pppd/plugins/radius/radrealms.c4
-rw-r--r--pppd/plugins/winbind.c8
-rw-r--r--pppd/pppcrypt.c5
-rw-r--r--pppd/pppcrypt.h1
-rw-r--r--pppd/pppd.h2
-rw-r--r--pppd/pppd.pc.in10
-rw-r--r--pppd/pppdconf.h.in61
-rw-r--r--pppd/session.c21
-rw-r--r--pppd/session.h1
-rw-r--r--pppd/sha1.c4
-rw-r--r--pppd/sha1.h18
-rw-r--r--pppd/spinlock.c5
-rw-r--r--pppd/spinlock.h6
-rw-r--r--pppd/srp-entry.c4
-rw-r--r--pppd/sys-linux.c6
-rw-r--r--pppd/sys-solaris.c10
-rw-r--r--pppd/tdb.c4
-rw-r--r--pppd/tdb.h2
-rw-r--r--pppd/tty.c4
-rw-r--r--pppd/upap.c4
-rw-r--r--pppd/upap.h2
-rw-r--r--pppd/utils.c4
89 files changed, 717 insertions, 178 deletions
diff --git a/pppd/Makefile.am b/pppd/Makefile.am
new file mode 100644
index 0000000..fc70b0e
--- /dev/null
+++ b/pppd/Makefile.am
@@ -0,0 +1,165 @@
+sbin_PROGRAMS = pppd
+man8_MANS = pppd.8 srp-entry.8
+if WITH_SRP
+sbin_PROGRAMS += srp-entry
+endif
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = pppd.pc
+
+pppd_includedir = $(includedir)/pppd
+pppd_include_HEADERS = \
+ cbcp.h \
+ ccp.h \
+ chap-md5.h \
+ chap_ms.h \
+ chap-new.h \
+ eap.h \
+ eap-tls.h \
+ ecp.h \
+ eui64.h \
+ fsm.h \
+ ipcp.h \
+ ipv6cp.h \
+ ipxcp.h \
+ lcp.h \
+ magic.h \
+ md4.h \
+ md5.h \
+ mppe.h \
+ pppdconf.h \
+ patchlevel.h \
+ pathnames.h \
+ pppcrypt.h \
+ pppd.h \
+ session.h \
+ sha1.h \
+ spinlock.h \
+ tdb.h \
+ upap.h
+
+pppd_SOURCES = \
+ auth.c \
+ ccp.c \
+ chap-md5.c \
+ chap-new.c \
+ demand.c \
+ eap.c \
+ ecp.c \
+ fsm.c \
+ ipcp.c \
+ lcp.c \
+ magic.c \
+ main.c \
+ options.c \
+ session.c \
+ tty.c \
+ upap.c \
+ utils.c
+
+pppd_CFLAGS = -I${top_srcdir}/include -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
+pppd_LDFLAGS =
+pppd_LIBS =
+
+if LINUX
+pppd_SOURCES += sys-linux.c
+pppd_LIBS += @CRYPT_LIBS@ @UTIL_LIBS@
+endif
+
+if SUNOS
+pppd_SOURCES += sys-solaris.c
+pppd_LIBS += -lsocket -lnsl
+endif
+
+if WITH_CHAPMS
+pppd_SOURCES += chap_ms.c
+pppd_SOURCES += pppcrypt.c
+else
+if WITH_SRP
+pppd_SOURCES += pppcrypt.c
+endif
+endif
+
+if WITH_CBCP
+pppd_SOURCES += cbcp.c
+endif
+
+if WITH_IPXCP
+pppd_SOURCES += ipxcp.c
+endif
+
+if WITH_MPPE
+pppd_SOURCES += mppe.c
+endif
+
+if WITH_PCAP
+pppd_CFLAGS += @PCAP_CFLAGS@
+pppd_LDFLAGS += @PCAP_LDFLAGS@
+pppd_LIBS += @PCAP_LIBS@
+endif
+
+if WITH_PLUGINS
+pppd_CFLAGS += -DPPPD_PLUGIN_DIR='"@PPPD_PLUGIN_DIR@"'
+pppd_LIBS += -ldl
+if LINUX
+pppd_LDFLAGS += -Wl,-E
+endif
+endif
+
+if WITH_MULTILINK
+pppd_SOURCES += multilink.c
+endif
+
+if WITH_TDB
+pppd_SOURCES += tdb.c spinlock.c
+endif
+
+if WITH_INET6
+pppd_SOURCES += ipv6cp.c eui64.c
+endif
+
+if WITH_PAM
+pppd_LIBS += -lpam -ldl
+endif
+
+if WITH_EAPTLS
+pppd_SOURCES += eap-tls.c
+endif
+
+if !WITH_OPENSSL
+pppd_SOURCES += md5.c md4.c sha1.c
+else
+pppd_CFLAGS += @OPENSSL_INCLUDES@
+pppd_LDFLAGS += @OPENSSL_LDFLAGS@
+pppd_LIBS += @OPENSSL_LIBS@
+if !OPENSSL_HAVE_SHA
+pppd_SOURCES += sha1.c
+endif
+if !OPENSSL_HAVE_MD4
+pppd_SOURCES += md4.c
+endif
+if !OPENSSL_HAVE_MD5
+pppd_SOURCES += md5.c
+endif
+endif
+
+if WITH_SYSTEMD
+pppd_LIBS += -lsystemd
+endif
+
+if WITH_SRP
+srp_entry_SOURCES = srp-entry.c
+srp_entry_CFLAGS = @OPENSSL_INCLUDES@ @SRP_CFLAGS@
+srp_entry_LDADD = @SRP_LIBS@ @OPENSSL_LIBS@
+srp_entry_LDFLAGS = @OPENSSL_LDFLAGS@ @SRP_LDFLAGS@
+
+pppd_CFLAGS += @SRP_CFLAGS@
+pppd_LDFLAGS += @SRP_LDFLAGS@
+pppd_LIBS += @SRP_LIBS@
+endif
+
+pppd_LDADD = $(pppd_LIBS)
+
+EXTRA_DIST = \
+ $(man8_MANS) \
+ ppp.pam
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
index 852945e..f5e5848 100644
--- a/pppd/Makefile.linux
+++ b/pppd/Makefile.linux
@@ -145,7 +145,7 @@ PPPDOBJS += eap-tls.o
endif
ifdef HAS_SHADOW
-CFLAGS += -DHAS_SHADOW
+CFLAGS += -DHAVE_SHADOW_H
#LIBS += -lshadow $(LIBS)
endif
@@ -156,7 +156,7 @@ LIBS += -lcrypt
endif
ifdef USE_LIBUTIL
-CFLAGS += -DHAVE_LOGWTMP=1
+CFLAGS += -DHAVE_UTMP_H=1
LIBS += -lutil
endif
diff --git a/pppd/Makefile.sol2 b/pppd/Makefile.sol2
index 3a8681c..db2b99c 100644
--- a/pppd/Makefile.sol2
+++ b/pppd/Makefile.sol2
@@ -13,7 +13,7 @@ OBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \
chap-md5.o session.o
# Solaris uses shadow passwords
-CFLAGS += -DHAS_SHADOW
+CFLAGS += -DHAVE_SHADOW_H
#
# Comment the following out to disable plugins
diff --git a/pppd/auth.c b/pppd/auth.c
index 0a49f53..013561a 100644
--- a/pppd/auth.c
+++ b/pppd/auth.c
@@ -70,6 +70,10 @@
#define RCSID "$Id: auth.c,v 1.117 2008/07/01 12:27:56 paulus Exp $"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
@@ -93,7 +97,7 @@
#include <arpa/inet.h>
-#ifdef HAS_SHADOW
+#ifdef HAVE_SHADOW_H
#include <shadow.h>
#ifndef PW_PPP
#define PW_PPP PW_LOGIN
@@ -101,6 +105,10 @@
#endif
#include <time.h>
+#ifdef HAVE_CRYPT_H
+#include <crypt.h>
+#endif
+
#ifdef SYSTEMD
#include <systemd/sd-daemon.h>
#endif
@@ -266,8 +274,6 @@ bool need_peer_eap = 0; /* Require peer to authenticate us */
static char *uafname; /* name of most recent +ua file */
-extern char *crypt (const char *, const char *);
-
/* Prototypes for procedures local to this file. */
static void network_phase (int);
@@ -1517,8 +1523,10 @@ check_passwd(int unit,
if (secret[0] != 0 && !login_secret) {
/* password given in pap-secrets - must match */
if (cryptpap || strcmp(passwd, secret) != 0) {
+#ifdef HAVE_CRYPT_H
char *cbuf = crypt(passwd, secret);
if (!cbuf || strcmp(cbuf, secret) != 0)
+#endif
ret = UPAP_AUTHNAK;
}
}
diff --git a/pppd/cbcp.c b/pppd/cbcp.c
index e356633..87bf9c0 100644
--- a/pppd/cbcp.c
+++ b/pppd/cbcp.c
@@ -32,6 +32,9 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <stdio.h>
#include <string.h>
diff --git a/pppd/cbcp.h b/pppd/cbcp.h
index c2ab3f6..c74b5f8 100644
--- a/pppd/cbcp.h
+++ b/pppd/cbcp.h
@@ -1,6 +1,8 @@
#ifndef CBCP_H
#define CBCP_H
+#include "pppdconf.h"
+
typedef struct cbcp_state {
int us_unit; /* Interface unit number */
u_char us_id; /* Current id */
diff --git a/pppd/ccp.c b/pppd/ccp.c
index 387b571..644a9d1 100644
--- a/pppd/ccp.c
+++ b/pppd/ccp.c
@@ -28,6 +28,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#define RCSID "$Id: ccp.c,v 1.50 2005/06/26 19:34:41 carlsonj Exp $"
#include <stdlib.h>
diff --git a/pppd/ccp.h b/pppd/ccp.h
index 76446db..35961b9 100644
--- a/pppd/ccp.h
+++ b/pppd/ccp.h
@@ -29,6 +29,7 @@
*
* $Id: ccp.h,v 1.12 2004/11/04 10:02:26 paulus Exp $
*/
+#include "pppdconf.h"
typedef struct ccp_options {
bool bsd_compress; /* do BSD Compress? */
diff --git a/pppd/chap-md5.c b/pppd/chap-md5.c
index 77dd4ec..000f880 100644
--- a/pppd/chap-md5.c
+++ b/pppd/chap-md5.c
@@ -30,6 +30,10 @@
#define RCSID "$Id: chap-md5.c,v 1.4 2004/11/09 22:39:25 paulus Exp $"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <string.h>
#include "pppd.h"
diff --git a/pppd/chap-md5.h b/pppd/chap-md5.h
index 30d0658..4dbbfd1 100644
--- a/pppd/chap-md5.h
+++ b/pppd/chap-md5.h
@@ -27,5 +27,6 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
extern void chap_md5_init(void);
diff --git a/pppd/chap-new.c b/pppd/chap-new.c
index 10e4507..ab4302b 100644
--- a/pppd/chap-new.c
+++ b/pppd/chap-new.c
@@ -30,6 +30,10 @@
#define RCSID "$Id: chap-new.c,v 1.9 2007/06/19 02:08:35 carlsonj Exp $"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <string.h>
#include "pppd.h"
diff --git a/pppd/chap-new.h b/pppd/chap-new.h
index e5330da..b4b0ee2 100644
--- a/pppd/chap-new.h
+++ b/pppd/chap-new.h
@@ -28,6 +28,8 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
+
/*
* CHAP packets begin with a standard header with code, id, len (2 bytes).
*/
diff --git a/pppd/chap_ms.c b/pppd/chap_ms.c
index d315ab4..52d4890 100644
--- a/pppd/chap_ms.c
+++ b/pppd/chap_ms.c
@@ -76,6 +76,10 @@
#define RCSID "$Id: chap_ms.c,v 1.38 2007/12/01 20:10:51 carlsonj Exp $"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef CHAPMS
#include <stdio.h>
diff --git a/pppd/chap_ms.h b/pppd/chap_ms.h
index 4e6a621..c1c5ed8 100644
--- a/pppd/chap_ms.h
+++ b/pppd/chap_ms.h
@@ -30,6 +30,8 @@
* $Id: chap_ms.h,v 1.13 2004/11/15 22:13:26 paulus Exp $
*/
+#include "pppdconf.h"
+
#ifndef __CHAPMS_INCLUDE__
#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */
diff --git a/pppd/demand.c b/pppd/demand.c
index 289c9f8..0943e8a 100644
--- a/pppd/demand.c
+++ b/pppd/demand.c
@@ -30,6 +30,10 @@
#define RCSID "$Id: demand.c,v 1.20 2005/08/25 12:14:18 paulus Exp $"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/pppd/eap-tls.c b/pppd/eap-tls.c
index b130821..265f6d5 100644
--- a/pppd/eap-tls.c
+++ b/pppd/eap-tls.c
@@ -29,6 +29,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <strings.h>
#include <unistd.h>
@@ -37,7 +41,9 @@
#include <fcntl.h>
#include <openssl/conf.h>
+#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
+#endif
#include <openssl/hmac.h>
#include <openssl/err.h>
#include <openssl/ui.h>
diff --git a/pppd/eap-tls.h b/pppd/eap-tls.h
index b19a905..d0c80b6 100644
--- a/pppd/eap-tls.h
+++ b/pppd/eap-tls.h
@@ -30,6 +30,8 @@
*
*/
+#include "pppdconf.h"
+
#ifndef __EAP_TLS_H__
#define __EAP_TLS_H__
diff --git a/pppd/eap.c b/pppd/eap.c
index 342d91f..9773ae2 100644
--- a/pppd/eap.c
+++ b/pppd/eap.c
@@ -48,6 +48,10 @@
* Implemented EAP-TLS authentication
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -65,6 +69,9 @@
#include "eap.h"
#ifdef USE_SRP
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
#include <t_pwd.h>
#include <t_server.h>
#include <t_client.h>
@@ -552,7 +559,7 @@ eap_figure_next_state(eap_state *esp, int status)
tpw.pebuf.name = esp->es_server.ea_peer;
tpw.pebuf.password.len = t_fromb64((char *)tpw.pwbuf,
cp);
- tpw.pebuf.password.data = tpw.pwbuf;
+ tpw.pebuf.password.data = (char*) tpw.pwbuf;
tpw.pebuf.salt.len = t_fromb64((char *)tpw.saltbuf,
cp2);
tpw.pebuf.salt.data = tpw.saltbuf;
@@ -2253,8 +2260,6 @@ eap_response(eap_state *esp, u_char *inp, int id, int len)
struct t_num A;
SHA1_CTX ctxt;
u_char dig[SHA_DIGESTSIZE];
- SHA1_CTX ctxt;
- u_char dig[SHA_DIGESTSIZE];
#endif /* USE_SRP */
#ifdef USE_EAPTLS
@@ -3021,6 +3026,7 @@ eap_printpkt(u_char *inp, int inlen,
break;
#endif /* USE_EAPTLS */
+#ifdef USE_SRP
case EAPT_SRP:
if (len < 3)
goto truncated;
@@ -3108,6 +3114,7 @@ eap_printpkt(u_char *inp, int inlen,
break;
}
break;
+#endif /* USE_SRP */
}
break;
@@ -3233,6 +3240,7 @@ eap_printpkt(u_char *inp, int inlen,
break;
#endif /* CHAPMS */
+#ifdef USE_SRP
case EAPT_SRP:
if (len < 1)
goto truncated;
@@ -3277,6 +3285,7 @@ eap_printpkt(u_char *inp, int inlen,
break;
}
break;
+#endif /* USE_SRP */
}
break;
diff --git a/pppd/eap.h b/pppd/eap.h
index 046eb1c..956b2ea 100644
--- a/pppd/eap.h
+++ b/pppd/eap.h
@@ -20,6 +20,8 @@
* $Id: eap.h,v 1.2 2003/06/11 23:56:26 paulus Exp $
*/
+#include "pppdconf.h"
+
#ifndef PPP_EAP_H
#define PPP_EAP_H
diff --git a/pppd/ecp.c b/pppd/ecp.c
index 1ecd7be..9570f38 100644
--- a/pppd/ecp.c
+++ b/pppd/ecp.c
@@ -57,6 +57,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include "pppd.h"
diff --git a/pppd/ecp.h b/pppd/ecp.h
index df6e3ca..162dace 100644
--- a/pppd/ecp.h
+++ b/pppd/ecp.h
@@ -30,6 +30,7 @@
*
* $Id: ecp.h,v 1.2 2003/01/10 07:12:36 fcusack Exp $
*/
+#include "pppdconf.h"
typedef struct ecp_options {
bool required; /* Is ECP required? */
diff --git a/pppd/eui64.c b/pppd/eui64.c
index 98caf94..7978c06 100644
--- a/pppd/eui64.c
+++ b/pppd/eui64.c
@@ -34,6 +34,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "pppd.h"
diff --git a/pppd/eui64.h b/pppd/eui64.h
index c48d689..aa83e1a 100644
--- a/pppd/eui64.h
+++ b/pppd/eui64.h
@@ -34,6 +34,8 @@
*
*/
+#include "pppdconf.h"
+
#ifndef __EUI64_H__
#define __EUI64_H__
diff --git a/pppd/fsm.c b/pppd/fsm.c
index 96d20e8..17cb76f 100644
--- a/pppd/fsm.c
+++ b/pppd/fsm.c
@@ -40,6 +40,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*
* TODO:
* Randomize fsm id on link/init.
diff --git a/pppd/fsm.h b/pppd/fsm.h
index 75a36d5..d23725c 100644
--- a/pppd/fsm.h
+++ b/pppd/fsm.h
@@ -42,6 +42,8 @@
* $Id: fsm.h,v 1.10 2004/11/13 02:28:15 paulus Exp $
*/
+#include "pppdconf.h"
+
/*
* Packet header = Code, id, length.
*/
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
index d17dbd2..6bcdf74 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -40,6 +40,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*
* TODO:
*/
diff --git a/pppd/ipcp.h b/pppd/ipcp.h
index 9c4f68d..52d2b22 100644
--- a/pppd/ipcp.h
+++ b/pppd/ipcp.h
@@ -39,6 +39,7 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
/*
* Options.
diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c
index ef03e10..8ab440a 100644
--- a/pppd/ipv6cp.c
+++ b/pppd/ipv6cp.c
@@ -146,6 +146,10 @@
* since SVR4 && (SNI || __USLC__) didn't work properly)
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/pppd/ipv6cp.h b/pppd/ipv6cp.h
index 19bc013..5e1db6b 100644
--- a/pppd/ipv6cp.h
+++ b/pppd/ipv6cp.h
@@ -33,6 +33,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
+#include "pppdconf.h"
/* Original version, based on RFC2023 :
diff --git a/pppd/ipxcp.c b/pppd/ipxcp.c
index d39b14c..000608d 100644
--- a/pppd/ipxcp.c
+++ b/pppd/ipxcp.c
@@ -40,6 +40,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef IPX_CHANGE
/*
diff --git a/pppd/ipxcp.h b/pppd/ipxcp.h
index 8a69232..6112e75 100644
--- a/pppd/ipxcp.h
+++ b/pppd/ipxcp.h
@@ -39,6 +39,7 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
/*
* Options.
diff --git a/pppd/lcp.c b/pppd/lcp.c
index ac5d5ce..8a18e95 100644
--- a/pppd/lcp.c
+++ b/pppd/lcp.c
@@ -40,6 +40,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/pppd/lcp.h b/pppd/lcp.h
index 984f868..768442d 100644
--- a/pppd/lcp.h
+++ b/pppd/lcp.h
@@ -39,6 +39,7 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
/*
* Options.
diff --git a/pppd/magic.c b/pppd/magic.c
index 8e08e47..6a5a7eb 100644
--- a/pppd/magic.c
+++ b/pppd/magic.c
@@ -40,6 +40,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/pppd/magic.h b/pppd/magic.h
index d6094db..b864b7b 100644
--- a/pppd/magic.h
+++ b/pppd/magic.h
@@ -39,6 +39,7 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
void magic_init (void); /* Initialize the magic number generator */
u_int32_t magic (void); /* Returns the next magic number */
diff --git a/pppd/main.c b/pppd/main.c
index 87a5d29..db0aa97 100644
--- a/pppd/main.c
+++ b/pppd/main.c
@@ -66,6 +66,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/pppd/md4.c b/pppd/md4.c
index 42a9b2e..88f3413 100644
--- a/pppd/md4.c
+++ b/pppd/md4.c
@@ -30,6 +30,9 @@
/* Implementation notes:
** This implementation assumes that ints are 32-bit quantities.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define TRUE 1
#define FALSE 0
diff --git a/pppd/md4.h b/pppd/md4.h
index b6fc3f5..d67daeb 100644
--- a/pppd/md4.h
+++ b/pppd/md4.h
@@ -7,6 +7,16 @@
** (C) 1990 RSA Data Security, Inc. **
** ********************************************************************
*/
+#include "pppdconf.h"
+
+#ifndef __MD4_INCLUDE__
+#define __MD4_INCLUDE__
+#ifndef USE_MD4
+#include <openssl/md4.h>
+#define MD4Init MD4_Init
+#define MD4Update MD4_Update
+#define MD4Final MD4_Final
+#else
/* MDstruct is the data structure for a message digest computation.
*/
@@ -53,3 +63,5 @@ extern void MD4Final(unsigned char *, MD4_CTX *);
/*
** End of md4.h
****************************(cut)***********************************/
+#endif /* USE_MD4 */
+#endif /* __MD4_INCLUDE__ */
diff --git a/pppd/md5.c b/pppd/md5.c
index f7988e6..9fb3397 100644
--- a/pppd/md5.c
+++ b/pppd/md5.c
@@ -33,6 +33,10 @@
***********************************************************************
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include "md5.h"
diff --git a/pppd/md5.h b/pppd/md5.h
index 71e8b00..662eb41 100644
--- a/pppd/md5.h
+++ b/pppd/md5.h
@@ -36,8 +36,13 @@
** documentation and/or software. **
***********************************************************************
*/
+#include "pppdconf.h"
#ifndef __MD5_INCLUDE__
+#define __MD5_INCLUDE__
+#ifndef USE_MD5
+#include <openssl/md5.h>
+#else
/* typedef a 32-bit type */
#ifdef _LP64
@@ -61,5 +66,5 @@ void MD5_Init (MD5_CTX *mdContext);
void MD5_Update (MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen);
void MD5_Final (unsigned char hash[], MD5_CTX *mdContext);
-#define __MD5_INCLUDE__
+#endif /* USE_MD5 */
#endif /* __MD5_INCLUDE__ */
diff --git a/pppd/mppe.c b/pppd/mppe.c
index 4f3d131..d2ba0eb 100644
--- a/pppd/mppe.c
+++ b/pppd/mppe.c
@@ -29,8 +29,13 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
+
#include "pppd.h"
#include "fsm.h"
#include "md4.h"
diff --git a/pppd/mppe.h b/pppd/mppe.h
index 98a89d3..2684a7f 100644
--- a/pppd/mppe.h
+++ b/pppd/mppe.h
@@ -32,6 +32,8 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
+
#ifndef __MPPE_H__
#define __MPPE_H__
diff --git a/pppd/multilink.c b/pppd/multilink.c
index ddd848c..6f17cf8 100644
--- a/pppd/multilink.c
+++ b/pppd/multilink.c
@@ -27,6 +27,11 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/pppd/options.c b/pppd/options.c
index f8d6c00..0c76a6b 100644
--- a/pppd/options.c
+++ b/pppd/options.c
@@ -40,6 +40,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
diff --git a/pppd/patchlevel.h b/pppd/patchlevel.h
index 30df079..1ecdb82 100644
--- a/pppd/patchlevel.h
+++ b/pppd/patchlevel.h
@@ -1,2 +1 @@
-#define VERSION "2.4.9"
#define DATE "5 January 2021"
diff --git a/pppd/pathnames.h b/pppd/pathnames.h
index 524d608..e68d91a 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -1,16 +1,35 @@
/*
* define path names
*/
+#include "pppdconf.h"
#ifdef HAVE_PATHS_H
#include <paths.h>
+#endif /* HAVE_PATHS_H */
-#else /* HAVE_PATHS_H */
-#ifndef _PATH_VARRUN
-#define _PATH_VARRUN "/etc/ppp/"
-#endif
+#ifndef _PATH_DEVNULL
#define _PATH_DEVNULL "/dev/null"
-#endif /* HAVE_PATHS_H */
+#endif
+
+#ifdef PPPD_RUNTIME_DIR
+#undef _PATH_VARRUN
+#define _PATH_VARRUN PPPD_RUNTIME_DIR "/"
+#endif
+
+#ifdef PPPD_LOGFILE_DIR
+#undef _PATH_VARLOG
+#define _PATH_VARLOG PPPD_LOGFILE_DIR
+#endif
+
+#ifdef PPPD_PLUGIN_DIR
+#define _PATH_PLUGIN PPPD_PLUGIN_DIR
+#else
+#ifdef __STDC__
+#define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION
+#else /* __STDC__ */
+#define _PATH_PLUGIN "/usr/lib/pppd"
+#endif /* __STDC__ */
+#endif /* PPPD_PLUGIN_DIR */
#ifndef _ROOT_PATH
#define _ROOT_PATH
@@ -33,7 +52,7 @@
#define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up"
#define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down"
#define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options."
-#define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors"
+#define _PATH_CONNERRS _ROOT_PATH _PATH_VARLOG "/connect-errors"
#define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/"
#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf"
@@ -53,18 +72,6 @@
#ifdef __STDC__
#define _PATH_PPPDB _ROOT_PATH _PATH_VARRUN "pppd2.tdb"
#else /* __STDC__ */
-#ifdef HAVE_PATHS_H
-#define _PATH_PPPDB "/var/run/pppd2.tdb"
-#else
-#define _PATH_PPPDB "/etc/ppp/pppd2.tdb"
-#endif
-#endif /* __STDC__ */
-
-#ifdef PLUGIN
-#ifdef __STDC__
-#define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION
-#else /* __STDC__ */
-#define _PATH_PLUGIN "/usr/lib/pppd"
+#define _PATH_PPPDB _PPP_VARRUN "pppd2.tdb"
#endif /* __STDC__ */
-#endif /* PLUGIN */
diff --git a/pppd/plugins/Makefile.am b/pppd/plugins/Makefile.am
new file mode 100644
index 0000000..b08d4a2
--- /dev/null
+++ b/pppd/plugins/Makefile.am
@@ -0,0 +1,25 @@
+pppd_plugin_LTLIBRARIES = minconn.la passprompt.la passwordfd.la winbind.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+PLUGIN_CFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+PLUGIN_LDFLAGS = -module -avoid-version
+
+minconn_la_CFLAGS = $(PLUGIN_CFLAGS)
+minconn_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+minconn_la_SOURCES = minconn.c
+
+passprompt_la_CFLAGS = $(PLUGIN_CFLAGS)
+passprompt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+passprompt_la_SOURCES = passprompt.c
+
+passwordfd_la_CFLAGS = $(PLUGIN_CFLAGS)
+passwordfd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+passwordfd_la_SOURCES = passwordfd.c
+
+winbind_la_CFLAGS = $(PLUGIN_CFLAGS)
+winbind_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+winbind_la_SOURCES = winbind.c
+
+if !SUNOS
+SUBDIRS = pppoe pppoatm pppol2tp radius
+endif
diff --git a/pppd/plugins/minconn.c b/pppd/plugins/minconn.c
index c12216a..40855ee 100644
--- a/pppd/plugins/minconn.c
+++ b/pppd/plugins/minconn.c
@@ -32,6 +32,10 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stddef.h>
#include <time.h>
#include "pppd.h"
diff --git a/pppd/plugins/passprompt.c b/pppd/plugins/passprompt.c
index ab9f390..dae3268 100644
--- a/pppd/plugins/passprompt.c
+++ b/pppd/plugins/passprompt.c
@@ -8,6 +8,11 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <errno.h>
#include <unistd.h>
#include <sys/wait.h>
diff --git a/pppd/plugins/passwordfd.c b/pppd/plugins/passwordfd.c
index c3f9793..84fd72e 100644
--- a/pppd/plugins/passwordfd.c
+++ b/pppd/plugins/passwordfd.c
@@ -7,6 +7,10 @@
* with pap- and chap-secrets files.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <errno.h>
#include <string.h>
diff --git a/pppd/plugins/pppoatm/Makefile.am b/pppd/plugins/pppoatm/Makefile.am
new file mode 100644
index 0000000..a13baea
--- /dev/null
+++ b/pppd/plugins/pppoatm/Makefile.am
@@ -0,0 +1,18 @@
+pppd_plugin_LTLIBRARIES = pppoatm.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+noinst_HEADERS = \
+ atm.h \
+ atmres.h \
+ atmsap.h
+
+pppoatm_la_CFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+pppoatm_la_LDFLAGS = -module -avoid-version
+pppoatm_la_SOURCES = pppoatm.c
+
+if WITH_LIBATM
+pppoatm_la_LIBADD = -latm
+else
+pppoatm_la_SOURCES += text2qos.c text2atm.c misc.c ans.c
+pppoatm_la_LIBADD = -lresolv
+endif
diff --git a/pppd/plugins/pppoatm/pppoatm.c b/pppd/plugins/pppoatm/pppoatm.c
index 5a3ecd6..dc82508 100644
--- a/pppd/plugins/pppoatm/pppoatm.c
+++ b/pppd/plugins/pppoatm/pppoatm.c
@@ -13,6 +13,10 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
diff --git a/pppd/plugins/pppoe/Makefile.am b/pppd/plugins/pppoe/Makefile.am
new file mode 100644
index 0000000..d0c89c5
--- /dev/null
+++ b/pppd/plugins/pppoe/Makefile.am
@@ -0,0 +1,25 @@
+pppd_plugin_LTLIBRARIES = pppoe.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+sbin_PROGRAMS = pppoe-discovery
+man8_MANS = pppoe-discovery.8
+
+noinst_HEADERS = \
+ pppoe.h
+
+pppoe_la_CFLAGS = -I${top_srcdir} -I${top_srcdir}/include
+pppoe_la_LDFLAGS = -module -avoid-version
+pppoe_la_SOURCES = plugin.c discovery.c if.c common.c
+
+pppoe_discovery_CFLAGS = -I${top_srcdir} -I${top_srcdir}/include
+pppoe_discovery_SOURCES = pppoe-discovery.c debug.c
+
+EXTRA_DIST = \
+ $(man8_MANS)
+
+install-exec-hook:
+ (mkdir -p $(DESTDIR)/$(pppd_plugindir); \
+ cd $(DESTDIR)$(pppd_plugindir); \
+ $(LN_S) -f pppoe.so rp-pppoe.so)
+
+uninstall-hook:
+ (cd $(DESTDIR)$(pppd_plugindir); rm -f rp-pppoe.so)
diff --git a/pppd/plugins/pppoe/common.c b/pppd/plugins/pppoe/common.c
index 9ea7fd6..6382821 100644
--- a/pppd/plugins/pppoe/common.c
+++ b/pppd/plugins/pppoe/common.c
@@ -16,6 +16,10 @@
static char const RCSID[] =
"$Id: common.c,v 1.3 2008/06/09 08:34:23 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#define _GNU_SOURCE 1
#include "pppoe.h"
#include "pppd/pppd.h"
diff --git a/pppd/plugins/pppoe/config.h b/pppd/plugins/pppoe/config.h
deleted file mode 100644
index a708859..0000000
--- a/pppd/plugins/pppoe/config.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/* config.h. Generated automatically by configure. */
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define to empty if the keyword does not work. */
-/* #undef const */
-
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-#define HAVE_SYS_WAIT_H 1
-
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef pid_t */
-
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
-
-/* Define if the setvbuf function takes the buffering type as its second
- argument and the buffer pointer as the third, as on System V
- before release 3. */
-/* #undef SETVBUF_REVERSED */
-
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
-
-/* Define if your <sys/time.h> declares struct tm. */
-/* #undef TM_IN_SYS_TIME */
-
-#define HAVE_STRUCT_SOCKADDR_LL 1
-
-/* The number of bytes in a unsigned int. */
-#define SIZEOF_UNSIGNED_INT 4
-
-/* The number of bytes in a unsigned long. */
-#define SIZEOF_UNSIGNED_LONG 4
-
-/* The number of bytes in a unsigned short. */
-#define SIZEOF_UNSIGNED_SHORT 2
-
-/* Define if you have the select function. */
-#define HAVE_SELECT 1
-
-/* Define if you have the socket function. */
-#define HAVE_SOCKET 1
-
-/* Define if you have the strerror function. */
-#define HAVE_STRERROR 1
-
-/* Define if you have the strtol function. */
-#define HAVE_STRTOL 1
-
-/* Define if you have the <asm/types.h> header file. */
-#define HAVE_ASM_TYPES_H 1
-
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define if you have the <getopt.h> header file. */
-#define HAVE_GETOPT_H 1
-
-/* Define if you have the <linux/if_ether.h> header file. */
-#define HAVE_LINUX_IF_ETHER_H 1
-
-/* Define if you have kernel-mode PPPoE in Linux file. */
-#define HAVE_LINUX_KERNEL_PPPOE 1
-
-/* Define if you have the <linux/if_packet.h> header file. */
-#define HAVE_LINUX_IF_PACKET_H 1
-
-/* Define if you have the <linux/if_pppox.h> header file. */
-#define HAVE_LINUX_IF_PPPOX_H 1
-
-/* Define if you have the <net/bpf.h> header file. */
-#define HAVE_NET_BPF_H 1
-
-/* Define if you have the <net/if_arp.h> header file. */
-#define HAVE_NET_IF_ARP_H 1
-
-/* Define if you have the <net/ethernet.h> header file. */
-#define HAVE_NET_ETHERNET_H 1
-
-/* Define if you have the <net/if.h> header file. */
-#define HAVE_NET_IF_H 1
-
-/* Define if you have the <linux/if.h> header file. */
-#define HAVE_LINUX_IF_H 1
-
-/* Define if you have the <net/if_dl.h> header file. */
-/* #undef HAVE_NET_IF_DL_H */
-
-/* Define if you have the <net/if_ether.h> header file. */
-/* #undef HAVE_NET_IF_ETHER_H */
-
-/* Define if you have the <net/if_types.h> header file. */
-/* #undef HAVE_NET_IF_TYPES_H */
-
-/* Define if you have the <netinet/if_ether.h> header file. */
-#define HAVE_NETINET_IF_ETHER_H 1
-
-/* Define if you have the <netpacket/packet.h> header file. */
-#define HAVE_NETPACKET_PACKET_H 1
-
-/* Define if you have the <sys/dlpi.h> header file. */
-/* #undef HAVE_SYS_DLPI_H */
-
-/* Define if you have the <sys/ioctl.h> header file. */
-#define HAVE_SYS_IOCTL_H 1
-
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
-
-/* Define if you have the <sys/socket.h> header file. */
-#define HAVE_SYS_SOCKET_H 1
-
-/* Define if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
-/* Define if you have the <sys/uio.h> header file. */
-#define HAVE_SYS_UIO_H 1
-
-/* Define if you have the <syslog.h> header file. */
-#define HAVE_SYSLOG_H 1
-
-/* Define if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define if you have the N_HDLC line discipline in linux/termios.h */
-#define HAVE_N_HDLC 1
diff --git a/pppd/plugins/pppoe/debug.c b/pppd/plugins/pppoe/debug.c
index a6e6981..3478b5f 100644
--- a/pppd/plugins/pppoe/debug.c
+++ b/pppd/plugins/pppoe/debug.c
@@ -16,6 +16,10 @@
static char const RCSID[] =
"$Id: debug.c,v 1.2 2008/06/09 08:34:23 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "pppoe.h"
#include <sys/time.h>
#include <time.h>
diff --git a/pppd/plugins/pppoe/discovery.c b/pppd/plugins/pppoe/discovery.c
index 23089df..bd281bd 100644
--- a/pppd/plugins/pppoe/discovery.c
+++ b/pppd/plugins/pppoe/discovery.c
@@ -11,6 +11,10 @@
static char const RCSID[] =
"$Id: discovery.c,v 1.6 2008/06/15 04:35:50 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#define _GNU_SOURCE 1
#include "pppoe.h"
#include "pppd/pppd.h"
diff --git a/pppd/plugins/pppoe/if.c b/pppd/plugins/pppoe/if.c
index 225dd56..3dfea8c 100644
--- a/pppd/plugins/pppoe/if.c
+++ b/pppd/plugins/pppoe/if.c
@@ -16,6 +16,10 @@
static char const RCSID[] =
"$Id: if.c,v 1.2 2008/06/09 08:34:23 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#define _GNU_SOURCE 1
#include "pppoe.h"
#include "pppd/pppd.h"
diff --git a/pppd/plugins/pppoe/plugin.c b/pppd/plugins/pppoe/plugin.c
index de9b816..8bcd1f8 100644
--- a/pppd/plugins/pppoe/plugin.c
+++ b/pppd/plugins/pppoe/plugin.c
@@ -25,6 +25,10 @@
static char const RCSID[] =
"$Id: plugin.c,v 1.17 2008/06/15 04:35:50 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#define _GNU_SOURCE 1
#include "pppoe.h"
diff --git a/pppd/plugins/pppoe/pppoe-discovery.c b/pppd/plugins/pppoe/pppoe-discovery.c
index e41d286..96d6333 100644
--- a/pppd/plugins/pppoe/pppoe-discovery.c
+++ b/pppd/plugins/pppoe/pppoe-discovery.c
@@ -9,6 +9,10 @@
*
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/pppd/plugins/pppoe/pppoe.h b/pppd/plugins/pppoe/pppoe.h
index 4e19720..5d96f0c 100644
--- a/pppd/plugins/pppoe/pppoe.h
+++ b/pppd/plugins/pppoe/pppoe.h
@@ -13,8 +13,6 @@
*
***********************************************************************/
-#include "config.h"
-
#include <stdio.h> /* For FILE */
#include <sys/types.h> /* For pid_t */
#include <ctype.h>
diff --git a/pppd/plugins/pppol2tp/Makefile.am b/pppd/plugins/pppol2tp/Makefile.am
new file mode 100644
index 0000000..3422e4e
--- /dev/null
+++ b/pppd/plugins/pppol2tp/Makefile.am
@@ -0,0 +1,13 @@
+pppd_plugin_LTLIBRARIES = pppol2tp.la openl2tp.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+noinst_HEADERS = \
+ l2tp_event.h
+
+pppol2tp_la_CFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+pppol2tp_la_LDFLAGS = -module -avoid-version
+pppol2tp_la_SOURCES = pppol2tp.c
+
+openl2tp_la_CFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+openl2tp_la_LDFLAGS = -module -avoid-version
+openl2tp_la_SOURCES = openl2tp.c
diff --git a/pppd/plugins/pppol2tp/openl2tp.c b/pppd/plugins/pppol2tp/openl2tp.c
index 85ff0b5..0f9db6d 100644
--- a/pppd/plugins/pppol2tp/openl2tp.c
+++ b/pppd/plugins/pppol2tp/openl2tp.c
@@ -19,6 +19,10 @@
/* pppd plugin for interfacing to openl2tpd */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
diff --git a/pppd/plugins/pppol2tp/pppol2tp.c b/pppd/plugins/pppol2tp/pppol2tp.c
index 1be0ad2..94b2f1f 100644
--- a/pppd/plugins/pppol2tp/pppol2tp.c
+++ b/pppd/plugins/pppol2tp/pppol2tp.c
@@ -20,6 +20,10 @@
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
diff --git a/pppd/plugins/radius/Makefile.am b/pppd/plugins/radius/Makefile.am
new file mode 100644
index 0000000..5655ad5
--- /dev/null
+++ b/pppd/plugins/radius/Makefile.am
@@ -0,0 +1,65 @@
+pppd_plugin_LTLIBRARIES = radius.la radattr.la radrealms.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+noinst_LTLIBRARIES = libradiusclient.la
+man8_MANS = pppd-radius.8 pppd-radattr.8
+noinst_HEADERS = \
+ includes.h \
+ options.h \
+ pathnames.h \
+ radiusclient.h
+
+EXTRA_FILES = \
+ COPYRIGHT
+
+EXTRA_ETC = \
+ etc/dictionary \
+ etc/dictionary.ascend \
+ etc/dictionary.compat \
+ etc/dictionary.merit \
+ etc/dictionary.microsoft \
+ etc/issue \
+ etc/port-id-map \
+ etc/radiusclient.conf \
+ etc/radiusclient.conf.in \
+ etc/realms \
+ etc/servers
+
+RADIUS_CFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd -DRC_LOG_FACILITY=LOG_DAEMON
+RADIUS_LDFLAGS = -module -avoid-version @LDFLAGS@
+
+radius_la_CFLAGS = $(RADIUS_CFLAGS)
+radius_la_LDFLAGS = $(RADIUS_LDFLAGS)
+radius_la_SOURCES = radius.c
+radius_la_LIBADD = libradiusclient.la
+if WITH_OPENSSL
+radius_la_LIBADD += @OPENSSL_LIBS@
+endif
+
+radattr_la_CFLAGS = $(RADIUS_CFLAGS)
+radattr_la_LDFLAGS = $(RADIUS_LDFLAGS)
+radattr_la_SOURCES = radattr.c
+
+radrealms_la_CFLAGS = $(RADIUS_CFLAGS)
+radrealms_la_LDFLAGS = $(RADIUS_LDFLAGS)
+radrealms_la_SOURCES = radrealms.c
+
+libradiusclient_la_SOURCES = \
+ avpair.c buildreq.c config.c dict.c ip_util.c \
+ clientid.c sendserver.c lock.c util.c
+libradiusclient_la_CFLAGS = $(RADIUS_CFLAGS)
+
+if !WITH_OPENSSL
+libradiusclient_la_SOURCES += md5.c
+else
+if OPENSSL_HAVE_MD5
+libradiusclient_la_SOURCES += md5.c
+else
+libradiusclient_la_CFLAGS += @OPENSSL_INCLUDES@
+endif
+endif
+
+EXTRA_DIST = \
+ $(man8_MANS) \
+ $(EXTRA_FILES) \
+ $(EXTRA_ETC)
diff --git a/pppd/plugins/radius/radattr.c b/pppd/plugins/radius/radattr.c
index 1fe7daa..1dee313 100644
--- a/pppd/plugins/radius/radattr.c
+++ b/pppd/plugins/radius/radattr.c
@@ -17,6 +17,10 @@
static char const RCSID[] =
"$Id: radattr.c,v 1.2 2004/10/28 00:24:40 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "pppd.h"
#include "radiusclient.h"
#include <stdio.h>
diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c
index cf4c0f2..6ddd853 100644
--- a/pppd/plugins/radius/radius.c
+++ b/pppd/plugins/radius/radius.c
@@ -26,6 +26,10 @@
static char const RCSID[] =
"$Id: radius.c,v 1.32 2008/05/26 09:18:08 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "pppd.h"
#include "chap-new.h"
#ifdef CHAPMS
diff --git a/pppd/plugins/radius/radrealms.c b/pppd/plugins/radius/radrealms.c
index cd006fd..a3b9a51 100644
--- a/pppd/plugins/radius/radrealms.c
+++ b/pppd/plugins/radius/radrealms.c
@@ -17,6 +17,10 @@
static char const RCSID[] =
"$Id: radrealms.c,v 1.2 2004/11/14 07:26:26 paulus Exp $";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "pppd.h"
#include "radiusclient.h"
#include <stdio.h>
diff --git a/pppd/plugins/winbind.c b/pppd/plugins/winbind.c
index 67c72f6..8c98e2a 100644
--- a/pppd/plugins/winbind.c
+++ b/pppd/plugins/winbind.c
@@ -34,6 +34,10 @@
*
***********************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include "pppd.h"
#include "chap-new.h"
#include "chap_ms.h"
@@ -581,7 +585,9 @@ winbind_chap_verify(char *user, char *ourname, int id,
nt_response, nt_response_size,
session_key,
&error_string) == AUTHENTICATED) {
+#ifdef MPPE
mppe_set_chapv1(challenge, session_key);
+#endif
slprintf(message, message_space, "Access granted");
return AUTHENTICATED;
@@ -626,8 +632,10 @@ winbind_chap_verify(char *user, char *ourname, int id,
&response[MS_CHAP2_NTRESP],
&response[MS_CHAP2_PEER_CHALLENGE],
challenge, user, saresponse);
+#ifdef MPPE
mppe_set_chapv2(session_key, &response[MS_CHAP2_NTRESP],
MS_CHAP2_AUTHENTICATOR);
+#endif
if (response[MS_CHAP2_FLAGS]) {
slprintf(message, message_space, "S=%s", saresponse);
} else {
diff --git a/pppd/pppcrypt.c b/pppd/pppcrypt.c
index 193f8fd..a954d62 100644
--- a/pppd/pppcrypt.c
+++ b/pppd/pppcrypt.c
@@ -30,7 +30,12 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <errno.h>
+
#include "pppd.h"
#include "pppcrypt.h"
diff --git a/pppd/pppcrypt.h b/pppd/pppcrypt.h
index 0f71bb3..79676ca 100644
--- a/pppd/pppcrypt.h
+++ b/pppd/pppcrypt.h
@@ -29,6 +29,7 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
#ifndef PPPCRYPT_H
#define PPPCRYPT_H
diff --git a/pppd/pppd.h b/pppd/pppd.h
index 6a19091..465c1bf 100644
--- a/pppd/pppd.h
+++ b/pppd/pppd.h
@@ -42,6 +42,8 @@
* $Id: pppd.h,v 1.96 2008/06/23 11:47:18 paulus Exp $
*/
+#include "pppdconf.h"
+
/*
* TODO:
*/
diff --git a/pppd/pppd.pc.in b/pppd/pppd.pc.in
new file mode 100644
index 0000000..20ef104
--- /dev/null
+++ b/pppd/pppd.pc.in
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+plugindir=@PPPD_PLUGIN_DIR@
+
+Name: pppd
+Description: Point-to-Point Protocol (PPP) daemon
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
diff --git a/pppd/pppdconf.h.in b/pppd/pppdconf.h.in
new file mode 100644
index 0000000..a1eea0e
--- /dev/null
+++ b/pppd/pppdconf.h.in
@@ -0,0 +1,61 @@
+/*
+ * This file is generated by configure and sets the features enabled
+ * in pppd when configured.
+ */
+
+/* "Have Microsoft CHAP support" */
+#undef CHAPMS
+
+/* "Have Microsoft MPPE support" */
+#undef MPPE
+
+/* "Have multilink support" */
+#undef HAVE_MULTILINK
+
+/* "Have IPX Control Protocol" */
+#undef IPX_CHANGE
+
+/* "Have packet activity filter support" */
+#undef PPP_FILTER
+
+/* "Have support for loadable plugins" */
+#undef PLUGIN
+
+/* "Limit sessions by maximum number of octets" */
+#undef MAXOCTETS
+
+/* Have Microsoft Callback Protocol support */
+#undef CBCP_SUPPORT
+
+/* "Include Trivial Database support" */
+#undef USE_TDB
+
+/* "Have IPv6 support" */
+#undef INET6
+
+/* "Support for Pluggable Authentication Modules" */
+#undef USE_PAM
+
+/* "Have EAP-SRP authentication support" */
+#undef USE_SRP
+
+/* "Have EAP-TLS authentication support" */
+#undef USE_EAPTLS
+
+/* "Have PEAP authentication support" */
+#undef USE_PEAP
+
+/* Use included des included with pppd */
+#undef USE_CRYPT
+
+/* Use included md4 included with pppd */
+#undef USE_MD4
+
+/* Use included md5 included with pppd */
+#undef USE_MD5
+
+/* Use included sha included with pppd */
+#undef USE_SHA
+
+/* Version number of package */
+#undef VERSION
diff --git a/pppd/session.c b/pppd/session.c
index 2f1c83e..3d1fb6d 100644
--- a/pppd/session.c
+++ b/pppd/session.c
@@ -68,14 +68,23 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
+
+#ifdef HAVE_CRYPT_H
#include <crypt.h>
-#ifdef HAS_SHADOW
+#endif
+
+#ifdef HAVE_SHADOW_H
#include <shadow.h>
#endif
+
#include <time.h>
#include <utmp.h>
#include <fcntl.h>
@@ -171,11 +180,11 @@ session_start(const int flags, const char *user, const char *passwd, const char
#else /* #ifdef USE_PAM */
struct passwd *pw;
char *cbuf;
-#ifdef HAS_SHADOW
+#ifdef HAVE_SHADOW_H
struct spwd *spwd;
struct spwd *getspnam();
long now = 0;
-#endif /* #ifdef HAS_SHADOW */
+#endif /* #ifdef HAVE_SHADOW_H */
#endif /* #ifdef USE_PAM */
SET_MSG(msg, SUCCESS_MSG);
@@ -305,7 +314,7 @@ session_start(const int flags, const char *user, const char *passwd, const char
if (pw == NULL)
return SESSION_FAILED;
-#ifdef HAS_SHADOW
+#ifdef HAVE_SHADOW_H
spwd = getspnam(user);
endspent();
@@ -336,15 +345,17 @@ session_start(const int flags, const char *user, const char *passwd, const char
/* We have a valid shadow entry, keep the password */
pw->pw_passwd = spwd->sp_pwdp;
-#endif /* #ifdef HAS_SHADOW */
+#endif /* #ifdef HAVE_SHADOW_H */
/*
* If no passwd, don't let them login if we're authenticating.
*/
if (pw->pw_passwd == NULL || strlen(pw->pw_passwd) < 2)
return SESSION_FAILED;
+#ifdef HAVE_CRYPT_H
cbuf = crypt(passwd, pw->pw_passwd);
if (!cbuf || strcmp(cbuf, pw->pw_passwd) != 0)
+#endif
return SESSION_FAILED;
}
diff --git a/pppd/session.h b/pppd/session.h
index bee8c41..0047db6 100644
--- a/pppd/session.h
+++ b/pppd/session.h
@@ -27,6 +27,7 @@
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "pppdconf.h"
#ifndef __SESSION_H
#define __SESSION_H
diff --git a/pppd/sha1.c b/pppd/sha1.c
index 4e51cee..efb37be 100644
--- a/pppd/sha1.c
+++ b/pppd/sha1.c
@@ -14,6 +14,10 @@
* 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/* #define SHA1HANDSOFF * Copies data before messing with it. */
#include <string.h>
diff --git a/pppd/sha1.h b/pppd/sha1.h
index 83f64df..e7e5573 100644
--- a/pppd/sha1.h
+++ b/pppd/sha1.h
@@ -1,12 +1,17 @@
/* sha1.h */
-/* If OpenSSL is in use, then use that version of SHA-1 */
-#ifdef OPENSSL
-#include <t_sha.h>
-#define __SHA1_INCLUDE_
-#endif
+#include "pppdconf.h"
#ifndef __SHA1_INCLUDE_
+#define __SHA1_INCLUDE_
+
+#ifndef USE_SHA
+#include <openssl/sha.h>
+
+#define SHA1_CTX SHA_CTX
+#define SHA1_SIGNATURE_SIZE SHA_DIGEST_LENGTH
+
+#else
#ifndef SHA1_SIGNATURE_SIZE
#ifdef SHA_DIGESTSIZE
@@ -26,6 +31,5 @@ extern void SHA1_Init(SHA1_CTX *);
extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int);
extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *);
-#define __SHA1_INCLUDE_
+#endif /* USE_SHA */
#endif /* __SHA1_INCLUDE_ */
-
diff --git a/pppd/spinlock.c b/pppd/spinlock.c
index 4df7e47..56abae4 100644
--- a/pppd/spinlock.c
+++ b/pppd/spinlock.c
@@ -23,6 +23,11 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/pppd/spinlock.h b/pppd/spinlock.h
index 967fe37..38e7bcc 100644
--- a/pppd/spinlock.h
+++ b/pppd/spinlock.h
@@ -1,10 +1,8 @@
+#include "pppdconf.h"
+
#ifndef __SPINLOCK_H__
#define __SPINLOCK_H__
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "tdb.h"
#ifdef USE_SPINLOCKS
diff --git a/pppd/srp-entry.c b/pppd/srp-entry.c
index 8c0e297..d59c1d3 100644
--- a/pppd/srp-entry.c
+++ b/pppd/srp-entry.c
@@ -29,6 +29,10 @@
* The default modulus/generator can be requested as index 0.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c
index 2ede95f..8d6eee9 100644
--- a/pppd/sys-linux.c
+++ b/pppd/sys-linux.c
@@ -69,6 +69,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -85,7 +89,9 @@
#include <string.h>
#include <time.h>
#include <memory.h>
+#ifdef HAVE_UTMP_H
#include <utmp.h>
+#endif
#include <mntent.h>
#include <signal.h>
#include <fcntl.h>
diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c
index 58ad21a..a0b1e3a 100644
--- a/pppd/sys-solaris.c
+++ b/pppd/sys-solaris.c
@@ -85,6 +85,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <limits.h>
#include <stdio.h>
#include <stddef.h>
@@ -127,6 +131,10 @@
#include <sys/ethernet.h>
#endif
+#ifdef PPP_FILTER
+#include <pcap.h>
+#endif
+
#include "pppd.h"
#include "fsm.h"
#include "lcp.h"
@@ -1636,7 +1644,7 @@ get_ppp_stats(int u, struct pppd_stats *stats)
return 1;
}
-#if 0
+#ifdef PPP_FILTER
/*
* set_filters - transfer the pass and active filters to the kernel.
*/
diff --git a/pppd/tdb.c b/pppd/tdb.c
index bdc5828..8a563f8 100644
--- a/pppd/tdb.c
+++ b/pppd/tdb.c
@@ -46,6 +46,10 @@
* right time. Probably too hard -- the process just doesn't know.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
diff --git a/pppd/tdb.h b/pppd/tdb.h
index 153b6e9..418bd8d 100644
--- a/pppd/tdb.h
+++ b/pppd/tdb.h
@@ -1,3 +1,5 @@
+#include "pppdconf.h"
+
#ifndef __TDB_H__
#define __TDB_H__
diff --git a/pppd/tty.c b/pppd/tty.c
index 852cee7..41328fb 100644
--- a/pppd/tty.c
+++ b/pppd/tty.c
@@ -68,6 +68,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/pppd/upap.c b/pppd/upap.c
index 0ae0288..1fcff09 100644
--- a/pppd/upap.c
+++ b/pppd/upap.c
@@ -40,6 +40,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*
* TODO:
*/
diff --git a/pppd/upap.h b/pppd/upap.h
index 99b007f..709cd62 100644
--- a/pppd/upap.h
+++ b/pppd/upap.h
@@ -1,3 +1,5 @@
+#include "pppdconf.h"
+
/*
* upap.h - User/Password Authentication Protocol definitions.
*
diff --git a/pppd/utils.c b/pppd/utils.c
index f81c8cf..d66df1f 100644
--- a/pppd/utils.c
+++ b/pppd/utils.c
@@ -28,6 +28,10 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>