]> git.ozlabs.org Git - ppp.git/commitdiff
Merge pull request #296 from enaess/ppp-autotools
authorPaul Mackerras <paulus@ozlabs.org>
Sat, 24 Jul 2021 03:07:30 +0000 (13:07 +1000)
committerGitHub <noreply@github.com>
Sat, 24 Jul 2021 03:07:30 +0000 (13:07 +1000)
Use autoconf/automake to configure and make ppp

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
134 files changed:
.github/workflows/buildroot.yaml
.github/workflows/solaris.yaml
.github/workflows/ubuntu.yaml [new file with mode: 0644]
.gitignore
AUTHORS [new file with mode: 0644]
COPYING [new file with mode: 0644]
ChangeLog [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
NEWS [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
chat/Makefile.am [new file with mode: 0644]
chat/Makefile.linux [deleted file]
chat/Makefile.sol2 [deleted file]
common/Makefile.am [new file with mode: 0644]
configure [deleted file]
configure.ac [new file with mode: 0644]
contrib/Makefile.am [new file with mode: 0644]
contrib/pppgetpass/.gitignore [new file with mode: 0644]
contrib/pppgetpass/Makefile.am [new file with mode: 0644]
contrib/pppgetpass/Makefile.linux [deleted file]
include/Makefile.am [new file with mode: 0644]
linux/Makefile.top [deleted file]
linux/pppd.pc.in [deleted file]
m4/ax_check_atm.m4 [new file with mode: 0644]
m4/ax_check_openssl.m4 [new file with mode: 0644]
m4/ax_check_openssl_func.m4 [new file with mode: 0644]
m4/ax_check_pam.m4 [new file with mode: 0644]
m4/ax_check_pcap.m4 [new file with mode: 0644]
m4/ax_check_srp.m4 [new file with mode: 0644]
m4/pkg.m4 [new file with mode: 0644]
modules/Makefile.am [new file with mode: 0644]
pppd/Makefile.am [new file with mode: 0644]
pppd/Makefile.linux [deleted file]
pppd/Makefile.sol2 [deleted file]
pppd/auth.c
pppd/cbcp.c
pppd/cbcp.h
pppd/ccp.c
pppd/ccp.h
pppd/chap-md5.c
pppd/chap-md5.h
pppd/chap-new.c
pppd/chap-new.h
pppd/chap_ms.c
pppd/chap_ms.h
pppd/demand.c
pppd/eap-tls.c
pppd/eap-tls.h
pppd/eap.c
pppd/eap.h
pppd/ecp.c
pppd/ecp.h
pppd/eui64.c
pppd/eui64.h
pppd/fsm.c
pppd/fsm.h
pppd/ipcp.c
pppd/ipcp.h
pppd/ipv6cp.c
pppd/ipv6cp.h
pppd/ipxcp.c
pppd/ipxcp.h
pppd/lcp.c
pppd/lcp.h
pppd/magic.c
pppd/magic.h
pppd/main.c
pppd/md4.c
pppd/md4.h
pppd/md5.c
pppd/md5.h
pppd/mppe.c
pppd/mppe.h
pppd/multilink.c
pppd/options.c
pppd/patchlevel.h
pppd/pathnames.h
pppd/plugins/Makefile.am [new file with mode: 0644]
pppd/plugins/Makefile.linux [deleted file]
pppd/plugins/Makefile.sol2 [deleted file]
pppd/plugins/minconn.c
pppd/plugins/passprompt.c
pppd/plugins/passwordfd.c
pppd/plugins/pppoatm/Makefile.am [new file with mode: 0644]
pppd/plugins/pppoatm/Makefile.linux [deleted file]
pppd/plugins/pppoatm/pppoatm.c
pppd/plugins/pppoe/Makefile.am [new file with mode: 0644]
pppd/plugins/pppoe/Makefile.linux [deleted file]
pppd/plugins/pppoe/common.c
pppd/plugins/pppoe/config.h [deleted file]
pppd/plugins/pppoe/debug.c
pppd/plugins/pppoe/discovery.c
pppd/plugins/pppoe/if.c
pppd/plugins/pppoe/plugin.c
pppd/plugins/pppoe/pppoe-discovery.c
pppd/plugins/pppoe/pppoe.h
pppd/plugins/pppol2tp/Makefile.am [new file with mode: 0644]
pppd/plugins/pppol2tp/Makefile.linux [deleted file]
pppd/plugins/pppol2tp/openl2tp.c
pppd/plugins/pppol2tp/pppol2tp.c
pppd/plugins/radius/Makefile.am [new file with mode: 0644]
pppd/plugins/radius/Makefile.linux [deleted file]
pppd/plugins/radius/radattr.c
pppd/plugins/radius/radius.c
pppd/plugins/radius/radrealms.c
pppd/plugins/winbind.c
pppd/pppcrypt.c
pppd/pppcrypt.h
pppd/pppd.h
pppd/pppd.pc.in [new file with mode: 0644]
pppd/pppdconf.h.in [new file with mode: 0644]
pppd/session.c
pppd/session.h
pppd/sha1.c
pppd/sha1.h
pppd/spinlock.c
pppd/spinlock.h
pppd/srp-entry.c
pppd/sys-linux.c
pppd/sys-solaris.c
pppd/tdb.c
pppd/tdb.h
pppd/tty.c
pppd/upap.c
pppd/upap.h
pppd/utils.c
pppdump/Makefile.am [new file with mode: 0644]
pppdump/Makefile.linux [deleted file]
pppdump/Makefile.sol2 [deleted file]
pppstats/Makefile.am [new file with mode: 0644]
pppstats/Makefile.linux [deleted file]
pppstats/Makefile.sol2 [deleted file]
pppstats/pppstats.c
scripts/Makefile.am [new file with mode: 0644]

index 4da78dddd0a400069dbdbdd8d09373c838ee5145..3429d1764e28056c269be55898f85a48256f2718 100644 (file)
@@ -10,7 +10,7 @@ jobs:
         libc_name: [glibc, uclibc, musl]
     steps:
       - name: Checkout Buildroot sources
-        run: git clone --depth=1 --branch=2020.11.1 https://git.busybox.net/buildroot
+        run: git clone --depth=1 --branch=2021.02.3 https://git.busybox.net/buildroot
       - name: Select latest PPP version
         working-directory: buildroot/package/pppd
         run: |
@@ -24,10 +24,26 @@ jobs:
           rm -f 0001-pppd-Fix-bounds-check.patch
           # Get package sources from head of master branch
           sed -i "/PPPD_VERSION =/c\\PPPD_VERSION = ${GITHUB_SHA}" pppd.mk
-          sed -i '/PPPD_SITE =/c\\PPPD_SITE = https://github.com/paulusmack/ppp' pppd.mk
+          sed -i '/PPPD_SITE =/c\\PPPD_SITE = https://github.com/ppp-project/ppp' pppd.mk
           sed -i '9iPPPD_SITE_METHOD = git' pppd.mk
-          # Plugin rp-pppoe has been renamed in "pppoe"
-          sed -i 's/rp-pppoe/pppoe/g' pppd.mk
+          # Tell Buildroot to run autoreconf.sh
+          sed -i '16iPPPD_AUTORECONF = YES' pppd.mk
+          # Filters feature needs libpcap
+          sed -i '17iPPPD_DEPENDENCIES = libpcap openssl' pppd.mk
+          # Enable verbose build commands and force OpenSSL directory, otherwise the host system one might be used instead of Buildroot one
+          sed -i '18iPPPD_CONF_OPTS = --disable-silent-rules --with-openssl="$(STAGING_DIR)/usr"' pppd.mk
+          # Do not install build artifacts to staging directory
+          sed -i 's/PPPD_INSTALL_STAGING = YES/PPPD_INSTALL_STAGING = NO/' pppd.mk
+          # Delete custom configuration tool, it is now automatically handled by Buildroot
+          sed -i '/PPPD_CONFIGURE_CMDS/,+4d' pppd.mk
+          # Delete custom build rule, it is now generated by Autotools
+          sed -i '/define PPPD_BUILD_CMDS/,+4d' pppd.mk
+          # Delete custom installation to target rule, it is now generated by Autotools
+          sed -i '/define PPPD_INSTALL_TARGET_CMDS/,+27d' pppd.mk
+          # Delete custom staging installation rule as PPP does not need to be installed to staging in this CI
+          sed -i '/define PPPD_INSTALL_STAGING_CMDS/,+3d' pppd.mk
+          # Tell Buildroot that this package uses Autotools
+          sed -i 's/$(eval $(generic-package))/$(eval $(autotools-package))/' pppd.mk
       - name: Enable PPP build
         working-directory: buildroot
         run: |
index 32ef9094d55e6fa29e785fde5a71ff2546ae4feb..10178137861e623661c462b2eb07767b9cbaacd8 100644 (file)
@@ -12,6 +12,6 @@ jobs:
       with:
         run: |
           pkg update
-          pkg install gcc
-          ./configure
+          pkg install gcc automake autoconf libtool
+          ./autogen.sh CFLAGS="-Wno-deprecated-declarations"
           make
diff --git a/.github/workflows/ubuntu.yaml b/.github/workflows/ubuntu.yaml
new file mode 100644 (file)
index 0000000..8117d51
--- /dev/null
@@ -0,0 +1,24 @@
+name: Build and Test
+on: [push, pull_request]
+
+jobs:
+  build_and_test:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+
+    - name: install required packages
+      run: sudo DEBIAN_FRONTEND=noninteractive apt-get -y -qq install build-essential autoconf automake pkg-config libtool m4 autoconf-archive libssl-dev libatm1-dev libpcap-dev
+
+    - name: configure
+      run: ./autogen.sh --enable-multilink --enable-ipxcp
+
+    - name: build
+      run: make V=1 CFLAGS="-O2 -g -Wno-unused-result"
+
+    - name: check
+      run: make check
+
+    - name: distcheck
+      run: make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-multilink --enable-ipxcp"
index c7445be5e0366d4812e089f9ab51f9d6ca478a53..052d5fd6ee19bcff34cd9f2c47e7568fbe4b8587 100644 (file)
@@ -5,4 +5,50 @@
 *.a
 *.pc
 *.cat8
+*.lo
+*.la
+*.swp
+.deps
+.libs
+
+
+# http://www.gnu.org/software/autoconf
+autom4te.cache
+/autoscan.log
+/autoscan-*.log
+/aclocal.m4
+/compile
+/config.cache
+/config.guess
+/config.log
+/config.status
+/config.sub
+/configure
+/configure.scan
+/depcomp
+/install-sh
+/missing
+/INSTALL
+/pppd/stamp-h1
+/pppd/stamp-h2
+/pppd/config.h
+/pppd/config.h.in
+/pppd/pppdconf.h
+
+# https://www.gnu.org/software/libtool/
+/libtool
+/ltmain.sh
+
+# http://www.gnu.org/software/m4/
+m4/libtool.m4
+m4/ltoptions.m4
+m4/ltsugar.m4
+m4/ltversion.m4
+m4/lt~obsolete.m4
+
+# Generated Makefile
 Makefile
+Makefile.in
+
+# Distfiles
+/ppp-*.tar.gz
diff --git a/AUTHORS b/AUTHORS
new file mode 100644 (file)
index 0000000..ff1a48f
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,7 @@
+The pppd Project
+https://github.com/ppp-project/ppp
+
+Primary Author of this package:
+Linux                  Paul Mackerras <paulus@samba.org>
+Solaris                        James Carlson <carlson@workingcode.com>
+
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..b3846c7
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,7 @@
+Copyrights:
+***********
+
+All of the code can be freely used and redistributed.  The individual
+source files each have their own copyright and permission notice.
+Pppd, pppstats and pppdump are under BSD-style notices.  Some of the
+pppd plugins are GPL'd.  Chat is public domain.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644 (file)
index 0000000..f9fadce
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,4 @@
+2021-07-11  Eivind Naess <eivnaes@yahoo.com>
+
+       Introduction of Autotools to pppd project
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..15b2d09
--- /dev/null
@@ -0,0 +1,80 @@
+ACLOCAL_AMFLAGS="-Im4"
+
+SUBDIRS = chat contrib pppd pppstats pppdump
+
+if WITH_PLUGINS
+SUBDIRS += pppd/plugins
+endif
+
+DIST_SUBDIRS = $(SUBDIRS) common include modules scripts
+
+#
+# *HACK*
+#   This is to work around the kernel module for PPP on Sun Solaris
+if SUNOS
+all-am:
+       (cd solaris ; $(MAKE) -f Makefile)
+
+clean-generic:
+       (cd solaris ; $(MAKE) -f Makefile clean)
+
+install-am:
+       (cd solaris ; $(MAKE) -f Makefile install)
+endif
+
+install-data-hook:
+       (cd $(DESTDIR)/$(sysconfdir)/$(PACKAGE) ; \
+        chmod 600 chap-secrets pap-secrets eaptls-server eaptls-client)
+
+sampledir = $(sysconfdir)/$(PACKAGE)
+sample_DATA = \
+    etc.ppp/options \
+    etc.ppp/chap-secrets \
+    etc.ppp/pap-secrets \
+    etc.ppp/eaptls-server \
+    etc.ppp/eaptls-client \
+    etc.ppp/openssl.cnf
+
+EXTRA_README = \
+    Changes-2.3 \
+    FAQ \
+    README \
+    README.cbcp \
+    README.eap-srp \
+    README.eap-tls \
+    README.linux \
+    README.MPPE \
+    README.MSCHAP80 \
+    README.MSCHAP81 \
+    README.pppoe \
+    README.pppol2tp \
+    README.pwfd \
+    README.sol2 \
+    PLUGINS \
+    SETUP \
+    Submitting-patches.md
+
+EXTRA_SOLARIS = \
+    solaris/Makedefs \
+    solaris/Makedefs.gcc \
+    solaris/Makedefs.sol2 \
+    solaris/Makefile.sol2 \
+    solaris/Makefile.sol2-64 \
+    solaris/Makefile.sol2-64x \
+    solaris/Makefile.sol2gcc \
+    solaris/Makefile.sol2gcc-64 \
+    solaris/Makefile.sol2gcc-64x \
+    solaris/Makefile.top \
+    solaris/ppp_ahdlc.c \
+    solaris/ppp_ahdlc_mod.c \
+    solaris/ppp.c \
+    solaris/ppp_comp.c \
+    solaris/ppp_comp_mod.c \
+    solaris/ppp.conf \
+    solaris/ppp_mod.c \
+    solaris/ppp_mod.h
+
+EXTRA_DIST= \
+    $(sample_DATA) \
+    $(EXTRA_README) \
+    $(EXTRA_SOLARIS)
diff --git a/NEWS b/NEWS
new file mode 100644 (file)
index 0000000..9d6c7fb
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,278 @@
+What's new in ppp-2.4.9.
+************************
+
+* Support for new EAP (Extensible Authentication Protocol) methods:
+  - Support for EAP-TLS, from Jan Just Keijser and others
+  - Support for EAP-MSCHAPv2, from Eivind Næss, Thomas Omerzu, Tijs
+    Van Buggenhout and others
+
+* New pppd options:
+  - chap-timeout
+  - chapms-strip-domain
+  - replacedefaultroute
+  - noreplacedefaultroute
+  - ipv6cp-accept-remote
+  - lcp-echo-adaptive
+  - ip-up-script
+  - ip-down-script
+  - ca
+  - capath
+  - cert
+  - key
+  - crl-dir
+  - crl
+  - max-tls-version
+  - need-peer-eap
+
+* Fixes for CVE-2020-8597 and CVE-2015-3310.
+
+* libpcap is now required when compiling on Linux (previously, if
+  libpcap was not present, pppd would be compiled without packet
+  filtering support).
+
+* The rp-pppoe plugin has been renamed to pppoe, to distinguish it
+  from the upstream rp-pppoe code.  Its options have changed names,
+  but the old names are kept as aliases.
+
+* The configure script now supports cross-compilation.
+
+* Many bug fixes and cleanups.
+  
+
+What was new in ppp-2.4.8.
+**************************
+
+* New pppd options have been added:
+  - ifname, to set the name for the PPP interface device
+  - defaultroute-metric, to set the metric for the default route
+  - defaultroute6, to add an IPv6 default route (with nodefaultroute6
+    to prevent adding an IPv6 default route)
+  - up_sdnotify, to have pppd notify systemd when the link is up.
+
+* The rp-pppoe plugin has new options:
+  - host-uniq, to set the Host-Uniq value to send
+  - pppoe-padi-timeout, to set the timeout for discovery packets
+  - pppoe-padi-attempts, to set the number of discovery attempts.
+
+* Added the CLASS attribute in radius packets.
+
+* Sundry bug fixes.
+
+* Fixed warnings and issues found by static analysis.
+
+* Added Submitting-patches.md.
+
+
+What was new in ppp-2.4.7.
+**************************
+
+* Fixed a potential security issue in parsing option files (CVE-2014-3158).
+
+* There is a new "stop-bits" option, which takes an argument of 1 or 2,
+  indicating the number of stop bits to use for async serial ports.
+
+* Various bug fixes.
+
+
+What was new in ppp-2.4.6.
+**************************
+
+* Man page updates.
+
+* Several bug fixes.
+
+* Options files can now set and unset environment variables for
+  scripts.
+
+* The timeout for chat scripts can now be taken from an environment
+  variable.
+
+* There is a new option, master_detach, which allows pppd to detach
+  from the controlling terminal when it is the multilink bundle master
+  but its own link has terminated, even if the nodetach option has
+  been given.
+
+
+What was new in ppp-2.4.5.
+**************************
+
+* Under Linux, pppd can now operate in a mode where it doesn't request
+  the peer's IP address, as some peers refuse to supply an IP address.
+  Since Linux supports device routes as well as gateway routes, it's
+  possible to have no remote IP address assigned to the ppp interface
+  and still route traffic over it.
+
+* Pppd now works better with 3G modems that do strange things such as
+  sending IPCP Configure-Naks with the same values over and over again.
+
+* The PPP over L2TP plugin is included, which works with the pppol2tp
+  PPP channel code in the Linux kernel.  This allows pppd to be used
+  to set up tunnels using the Layer 2 Tunneling Protocol.
+
+* A new 'enable-session' option has been added, which enables session
+  accounting via PAM or wtwp/wtmpx, as appropriate.  See the pppd man
+  page for details.
+
+* Several bugs have been fixed.
+
+
+What was new in ppp-2.4.4.
+**************************
+
+* Pppd will now run /etc/ppp/ip-pre-up, if it exists, after creating
+  the ppp interface and configuring its IP addresses but before
+  bringing it up.  This can be used, for example, for adding firewall
+  rules for the interface.
+
+* Lots of bugs fixed, particularly in the area of demand-dialled and
+  persistent connections.
+
+* The rp-pppoe plugin now accepts any interface name (that isn't an
+  existing pppd option name) without putting "nic-" on the front of
+  it, not just eth*, nas*, tap* and br*.
+
+
+What was new in ppp-2.4.3.
+**************************
+
+* The configure script now accepts --prefix and --sysconfdir options.
+  These default to /usr/local and /etc.  If you want pppd put in
+  /usr/sbin as before, use ./configure --prefix=/usr.
+
+* Doing `make install' no longer puts example configuration files in
+  /etc/ppp.  Use `make install-etcppp' if you want that.
+
+* The code has been updated to work with version 0.8.3 of libpcap.
+  Unfortunately the libpcap maintainers removed support for the
+  "inbound" and "outbound" keywords on PPP links, meaning that if you
+  link pppd with libpcap-0.8.3, you can't use those keywords in the
+  active-filter and pass-filter expressions.  The support has been
+  reinstated in the CVS version and should be in future libpcap
+  releases.  If you need the in/outbound keywords, use a later release
+  than 0.8.3, or get the CVS version from http://www.tcpdump.org.
+
+* There is a new option, child-timeout, which sets the length of time
+  that pppd will wait for child processes (such as the command
+  specified with the pty option) to exit before exiting itself.  It
+  defaults to 5 seconds.  After the timeout, pppd will send a SIGTERM
+  to any remaining child processes and exit.  A value of 0 means no
+  timeout.
+
+* Various bugs have been fixed, including some CBCP packet parsing
+  bugs that could lead to the peer being able to crash pppd if CBCP
+  support is enabled.
+
+* Various fixes and enhancements to the radius and rp-pppoe plugins
+  have been added.
+
+* There is a new winbind plugin, from Andrew Bartlet of the Samba
+  team, which provides the ability to authenticate the peer against an
+  NT domain controller using MS-CHAP or MS-CHAPV2.
+
+* There is a new pppoatm plugin, by various authors, sent in by David
+  Woodhouse.
+
+* The multilink code has been substantially reworked.  The first pppd
+  for a bundle still controls the ppp interface, but it doesn't exit
+  until all the links in the bundle have terminated.  If the first
+  pppd is signalled to exit, it signals all the other pppds
+  controlling links in the bundle.
+
+* The TDB code has been updated to the latest version.  This should
+  eliminate the problem that some people have seen where the database
+  file (/var/run/pppd.tdb) keeps on growing.  Unfortunately, however,
+  the new code uses an incompatible database format.  For this reason,
+  pppd now uses /var/run/pppd2.tdb as the database filename.
+
+
+What was new in ppp-2.4.2.
+**************************
+
+* The CHAP code has been rewritten.  Pppd now has support for MS-CHAP
+  V1 and V2 authentication, both as server and client.  The new CHAP
+  code is cleaner than the old code and avoids some copyright problems
+  that existed in the old code.
+
+* MPPE (Microsoft Point-to-Point Encryption) support has been added,
+  although the current implementation shouldn't be considered
+  completely secure.  (There is no assurance that the current code
+  won't ever transmit an unencrypted packet.)
+
+* James Carlson's implementation of the Extensible Authentication
+  Protocol (EAP) has been added.
+
+* Support for the Encryption Control Protocol (ECP) has been added.
+
+* Some new plug-ins have been included:
+  - A plug-in for kernel-mode PPPoE (PPP over Ethernet)
+  - A plug-in for supplying the PAP password over a pipe from another
+    process
+  - A plug-in for authenticating using a Radius server.
+
+* Updates and bug-fixes for the Solaris port.
+
+* The CBCP (Call Back Control Protocol) code has been updated.  There
+  are new options `remotenumber' and `allow-number'.
+
+* Extra hooks for plugins to use have been added.
+
+* There is now a `maxoctets' option, which causes pppd to terminate
+  the link once the number of bytes passed on the link exceeds a given
+  value.
+
+* There are now options to control whether pppd can use the IPCP
+  IP-Address and IP-Addresses options: `ipcp-no-address' and
+  `ipcp-no-addresses'.
+
+* Fixed several bugs, including potential buffer overflows in chat.
+
+
+What was new in ppp-2.4.1.
+**************************
+
+* Pppd can now print out the set of options that are in effect.  The
+  new `dump' option causes pppd to print out the option values after
+  option parsing is complete.  The `dryrun' option causes pppd to
+  print the options and then exit.
+
+* The option parsing code has been fixed so that options in the
+  per-tty options file are parsed correctly, and don't override values
+  from the command line in most cases.
+
+* The plugin option now looks in /usr/lib/pppd/<pppd-version> (for
+  example, /usr/lib/pppd/2.4.1b1) for shared objects for plugins if
+  there is no slash in the plugin name.
+
+* When loading a plugin, pppd will now check the version of pppd for
+  which the plugin was compiled, and refuse to load it if it is
+  different to pppd's version string.  To enable this, the plugin
+  source needs to #include "pppd.h" and have a line saying:
+       char pppd_version[] = VERSION;
+
+* There is a bug in zlib, discovered by James Carlson, which can cause
+  kernel memory corruption if Deflate is used with the lowest setting,
+  8.  As a workaround pppd will now insist on using at least 9.
+
+* Pppd should compile on Solaris and SunOS again.
+
+* Pppd should now set the MTU correctly on demand-dialled interfaces.
+
+
+What was new in ppp-2.4.0.
+**************************
+
+* Multilink: this package now allows you to combine multiple serial
+  links into one logical link or `bundle', for increased bandwidth and
+  reduced latency.  This is currently only supported under the
+  2.4.x and later Linux kernels.
+
+* All the pppd processes running on a system now write information
+  into a common database.  I used the `tdb' code from samba for this.
+
+* New hooks have been added.
+
+For a list of the changes made during the 2.3 series releases of this
+package, see the Changes-2.3 file.
+
+
+
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..e27d631
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+REQUIRED_AUTOMAKE_VERSION=1.9
+PKG_NAME=pppd
+
+(test -f $srcdir/configure.ac \
+  && test -f $srcdir/pppd/main.c) || {
+      echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+      echo " top-level $PKG_NAME directory"
+      exit 1
+  }
+
+(cd $srcdir;
+ autoreconf --install --symlink &&
+ autoreconf &&
+ ./configure --enable-maintainer-mode $@
+)
+
diff --git a/chat/Makefile.am b/chat/Makefile.am
new file mode 100644 (file)
index 0000000..0a29869
--- /dev/null
@@ -0,0 +1,5 @@
+sbin_PROGRAMS = chat
+dist_man8_MANS = chat.8
+
+chat_SOURCES = chat.c
+chat_CPPFLAGS = -DTERMIOS -DSIGTYPE=void -UNO_SLEEP -DFNDELAY=O_NDELAY
diff --git a/chat/Makefile.linux b/chat/Makefile.linux
deleted file mode 100644 (file)
index 2cd1f3f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-
-CDEF1= -DTERMIOS                       # Use the termios structure
-CDEF2= -DSIGTYPE=void                  # Standard definition
-CDEF3= -UNO_SLEEP                      # Use the usleep function
-CDEF4= -DFNDELAY=O_NDELAY              # Old name value
-CDEFS= $(CDEF1) $(CDEF2) $(CDEF3) $(CDEF4)
-
-CFLAGS=        $(COPTS) $(CDEFS)
-
-INSTALL= install
-
-all:   chat
-
-chat:  chat.o
-       $(CC) $(LDFLAGS) -o chat chat.o
-
-chat.o:        chat.c
-       $(CC) -c $(CFLAGS) -o chat.o chat.c
-
-install: chat
-       mkdir -p $(BINDIR) $(MANDIR)
-       $(INSTALL) -c chat $(BINDIR)
-       $(INSTALL) -c -m 644 chat.8 $(MANDIR)
-
-clean:
-       rm -f chat.o chat *~
diff --git a/chat/Makefile.sol2 b/chat/Makefile.sol2
deleted file mode 100644 (file)
index 10d3314..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Makefile for chat on Solaris 2
-#
-
-include ../Makedefs.com
-
-CFLAGS = $(COPTS) -DNO_USLEEP -DSOL2
-
-all:   chat
-
-chat: chat.o
-       $(CC) -o chat chat.o
-
-install: chat
-       $(INSTALL) -f $(BINDIR) chat
-       $(INSTALL) -m 444 -f $(MANDIR)/man8 chat.8
-
-clean:
-       rm -f *~ *.o chat
diff --git a/common/Makefile.am b/common/Makefile.am
new file mode 100644 (file)
index 0000000..27169d5
--- /dev/null
@@ -0,0 +1,6 @@
+EXTRA_ZLIB = \
+    zlib.c \
+    zlib.h
+
+EXTRA_DIST = \
+    $(EXTRA_ZLIB)
diff --git a/configure b/configure
deleted file mode 100755 (executable)
index d854679..0000000
--- a/configure
+++ /dev/null
@@ -1,166 +0,0 @@
-#!/bin/sh
-# $Id: configure,v 1.38 2008/06/15 07:08:49 paulus Exp $
-
-# Where to install stuff by default
-DESTDIR=/usr/local
-SYSCONF=/etc
-LIBDIR='${PREFIX}'/lib
-INCDIR='${PREFIX}'/include
-
-VERSION=$(awk -F '"' '/VERSION/ { print $2; }' pppd/patchlevel.h)
-
-# Compile defaults
-CROSS_COMPILE=
-CC=cc
-CFLAGS=
-
-system=`uname -s`
-release=`uname -r`
-arch=`uname -m`
-state="unknown"
-
-case $system in
-  Linux)
-    makext="linux";
-    ksrc="linux";
-    state="known";
-    CFLAGS="-O2 -g -pipe";;
-  SunOS)
-    karch=`/usr/bin/isainfo -k`
-    case $release in
-      5.[7-9]*|5.[1-9][0-9]*)  state="known"; ksrc="solaris"; makext="sol2";
-              case "$karch" in
-               amd64)          archvariant='-64x';;
-               sparcv9)        archvariant='-64';;
-               *)      ;;
-             esac;;
-      5.[1-6]*)        state="known"; ksrc="solaris"; makext="sol2";;
-    esac
-    if [ "$1" = gcc ]; then
-       shift
-       usegcc=gcc
-    fi
-    if [ "$1" = 32 ]; then
-       shift
-       archvariant=
-    fi
-    if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
-       /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
-      if [ "$archvariant" = "-64x" ]; then
-        ( cd /tmp; echo "int x;" > ppp$$.c
-         /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
-           echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
-           echo "them.  Consider upgrading cc on this machine."
-           rm -f ppp$$.c
-           exit 1
-         ) || exit 1
-         rm -f ppp$$.c ppp$$.o
-        ) || exit 1
-      fi
-    elif gcc --version >/dev/null 2>&1; then
-      archvariant=gcc$archvariant
-      compiletype=.gcc
-      if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
-        ( cd /tmp; touch ppp$$.c
-         gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
-           echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
-           echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
-           rm -f ppp$$.c
-           exit 1
-         ) || exit 1
-         rm -f ppp$$.c ppp$$.o
-        ) || exit 1
-      fi
-    else
-      echo "C compiler not found; hoping for the best."
-    fi;;
-  NetBSD|FreeBSD|ULTRIX|OSF1|NeXTStep|SINIX-?|UNIX_SV|UNIX_System_V)
-    state="notincluded";;
-esac
-
-if [ -d "$ksrc" ]; then :; else
-  state="notincluded"
-  unset ksrc
-fi
-
-case $state in
-  unknown)
-    echo "This software has not been ported to $system.  Sorry.";;
-  notincluded)
-    echo "Support for $system has not been included"
-    echo "in this distribution.  Sorry.";;
-  known)
-    echo "Configuring for $system";;
-esac
-
-# Parse arguments
-while [ $# -gt 0 ]; do
-    arg=$1
-    val=
-    shift
-    case $arg in
-       *=*)
-           val=`expr "x$arg" : 'x[^=]*=\(.*\)'`
-           arg=`expr "x$arg" : 'x\([^=]*\)=.*'`
-           ;;
-       --prefix|--sysconf|--libdir|--includedir)
-           if [ $# -eq 0 ]; then
-               echo "error: the $arg argument requires a value" 1>&2
-               exit 1
-           fi
-           val=$1
-           shift
-           ;;
-    esac
-    case $arg in
-       --prefix)        DESTDIR=$val ;;
-       --sysconfdir)    SYSCONF=$val ;;
-       --libdir)        LIBDIR=$val ; HAVE_LIBDIR_PARAM=1 ;;
-       --includedir)    INCDIR=$val ; HAVE_INCDIR_PARAM=1 ;;
-       --cross_compile) CROSS_COMPILE=$val ;;
-       --cc)            CC=$val ;;
-       --cflags)        CFLAGS=$val ;;
-    esac
-done
-
-mkmkf() {
-    rm -f $2
-    if [ -f $1 ]; then
-       echo "  $2 <= $1"
-       sed -e "s,@DESTDIR@,$DESTDIR,g" \
-           -e "s,@SYSCONF@,$SYSCONF,g" \
-           -e "s,@LIBDIR@,$LIBDIR,g" \
-           -e "s,@INCDIR@,$INCDIR,g" \
-           -e "s,@CROSS_COMPILE@,$CROSS_COMPILE,g" \
-           -e "s,@CC@,$CC,g" \
-           -e "s|@CFLAGS@|$CFLAGS|g" \
-           -e "s,@VERSION@,$VERSION,g" $1 >$2
-    fi
-}
-
-if [ -d "$ksrc" ]; then
-    echo "Creating Makefiles."
-    mkmkf $ksrc/Makefile.top Makefile
-    mkmkf $ksrc/Makedefs$compiletype Makedefs.com
-    for dir in pppd pppstats chat pppdump pppd/plugins pppd/plugins/pppoe \
-              pppd/plugins/radius pppd/plugins/pppoatm \
-              pppd/plugins/pppol2tp; do
-       mkmkf $dir/Makefile.$makext $dir/Makefile
-    done
-    if [ -f $ksrc/Makefile.$makext$archvariant ]; then
-       mkmkf $ksrc/Makefile.$makext$archvariant $ksrc/Makefile
-    fi
-    if [ -f "$ksrc/pppd.pc.in" ] ; then
-       echo "Creating pkg-config file"
-       if [ ${HAVE_LIBDIR_PARAM:-0} -ne 1 ] ; then
-           LIBDIR='${prefix}'/lib
-       fi
-       if [ ${HAVE_INCDIR_PARAM:-0} -ne 1 ] ; then
-           INCDIR='${prefix}'/include
-       fi
-       mkmkf $ksrc/pppd.pc.in pppd/pppd.pc
-    fi
-else
-  echo "Unable to locate kernel source $ksrc"
-  exit 1
-fi
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..8dc3ca1
--- /dev/null
@@ -0,0 +1,417 @@
+AC_PREREQ([2.69])
+AC_INIT([ppp],
+        [2.4.10-dev],
+        [https://github.com/ppp-project/ppp])
+
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE
+AM_MAINTAINER_MODE([enable])
+
+AC_LANG(C)
+AC_CONFIG_SRCDIR([pppd/main.c])
+AC_CONFIG_HEADERS([pppd/config.h pppd/pppdconf.h])
+
+# Checks for programs.
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+AC_PROG_LN_S
+
+PKG_PROG_PKG_CONFIG
+
+AC_CANONICAL_HOST
+build_linux=no
+build_sunos=no
+
+case "${host_os}" in
+    linux*)
+       build_linux=yes
+       ;;
+    solaris2*)
+       build_sunos=yes
+       ;;
+    *)
+       AC_MSG_ERROR(["OS ${host_os} not supported"])
+       ;;
+esac
+
+AM_CONDITIONAL([LINUX], [test "${build_linux}" = "yes" ])
+AM_CONDITIONAL([SUNOS], [test "${build_sunos}" = "yes" ])
+AM_COND_IF([SUNOS],
+      CFLAGS="$CFLAGS -DSOL2 -DSRV4")
+
+#
+# Checks for header files, these will set the HAVE_[FILE]_H macros in config.h
+AC_HEADER_STDBOOL
+AC_CHECK_HEADERS([  \
+    asm/types.h     \
+    crypt.h         \
+    paths.h         \
+    shadow.h        \
+    sys/dlpi.h      \
+    sys/ioctl.h     \
+    sys/socket.h    \
+    sys/time.h      \
+    sys/uio.h       \
+    time.h          \
+    unistd.h        \
+    utmp.h])
+
+#
+# Check for linux specific headers, required by pppoe, or pppol2tp
+AM_COND_IF([LINUX], [
+    AC_CHECK_HEADERS([          \
+        net/bpf.h               \
+        net/if.h                \
+        net/if_types.h          \
+        net/if_arp.h            \
+        linux/if.h              \
+        linux/if_ether.h        \
+        linux/if_packet.h       \
+        netinet/if_ether.h      \
+        netpacket/packet.h])])
+
+AC_CHECK_SIZEOF(unsigned int)
+AC_CHECK_SIZEOF(unsigned long)
+AC_CHECK_SIZEOF(unsigned short)
+
+# Checks for library functions.
+AC_CHECK_FUNCS([    \
+    mmap            \
+    logwtmp         \
+    strerror])
+
+#
+# If libc doesn't provide logwtmp, check if libutil provides logwtmp(), and if so link to it.
+AS_IF([test "x${ac_cv_func_logwtmp}" != "xyes"], [
+    AC_CHECK_LIB([util], [logwtmp], [
+        AC_DEFINE(HAVE_LOGWTMP, 1, ["System provides the logwtmp() function"])
+        AC_SUBST([UTIL_LIBS], ["-lutil"])
+    ])
+])
+
+#
+# Check if libcrypt have crypt() function
+AC_CHECK_LIB([crypt], [crypt],
+    AC_SUBST([CRYPT_LIBS], ["-lcrypt"]))
+
+#
+# Should pppd link with -lsystemd (Linux only)
+AC_ARG_ENABLE([systemd],
+    AS_HELP_STRING([--enable-systemd], [Enable support for systemd notification]))
+AM_CONDITIONAL(WITH_SYSTEMD, test "x${enable_systemd}" = "xyes")
+AM_COND_IF([WITH_SYSTEMD],
+    AC_DEFINE([SYSTEMD], 1, [Enable support for systemd notifications]))
+
+#
+# Enable Callback Protocol Support, disabled by default
+AC_ARG_ENABLE([cbcp],
+    AS_HELP_STRING([--enable-cbcp], [Enable Callback Protocol]))
+AM_CONDITIONAL(WITH_CBCP, test "x${enable_cbcp}" = "xyes")
+AM_COND_IF([WITH_CBCP],
+    AC_DEFINE([CBCP_SUPPORT], 1, [Have Callback Protocol support]))
+
+#
+# Disable support for IPX control protocol
+AC_ARG_ENABLE([ipxcp],
+    AS_HELP_STRING([--enable-ipxcp], [Enable IPX Control Protocol support]))
+AM_CONDITIONAL(WITH_IPXCP, test "x${enable_ipxcp}" = "xyes")
+AM_COND_IF(WITH_IPXCP,
+    AC_DEFINE([IPX_CHANGE], 1, ["Have IPX Control Protocol"]))
+AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_ipxcp}" = "xyes"],
+    [AC_MSG_ERROR([IPXCP is not supported on SunOS, disable using --disable-ipxcp])])
+
+#
+# Disable support for limiting session duration by maximum octets
+AC_ARG_ENABLE([maxoctets],
+    AS_HELP_STRING([--disable-maxoctets], [Disable support for limiting session by maximum octets]))
+AS_IF([test "x$enable_maxoctets" != "xno"],
+    AC_DEFINE([MAXOCTETS], 1, ["Limit sessions by maximum number of octets"]))
+
+#
+# Disable Microsoft extensions will remove CHAP and MPPE support
+AC_ARG_ENABLE([microsoft-extensions],
+    AS_HELP_STRING([--disable-microsoft-extensions], [Disable Microsoft CHAP / MPPE extensions]))
+
+AM_CONDITIONAL(WITH_CHAPMS, test "x${enable_microsoft_extensions}" != "xno")
+AM_COND_IF([WITH_CHAPMS],
+    AC_DEFINE([CHAPMS], 1, ["Have Microsoft CHAP support"]))
+
+AM_CONDITIONAL(WITH_MPPE, test "x${enable_microsoft_extensions}" != "xno")
+AM_COND_IF([WITH_MPPE],
+    AC_DEFINE([MPPE], 1, ["Have Microsoft MPPE support"]))
+
+#
+# Enable Microsoft LAN Manager support, depends on Microsoft Extensions
+AC_ARG_ENABLE([mslanman],
+    AS_HELP_STRING([--enable-mslanman], [Enable Microsoft LAN Manager support]))
+AS_IF([test "x${enable_mslanman}" = "xyes" && test "x${enable_microsoft_extensions}" != "xno"],
+    AC_DEFINE([MSLANMAN], 1, ["Have Microsoft LAN Manager support"]))
+
+#
+# Disable IPv6 support
+AC_ARG_ENABLE([ipv6-support],
+    AS_HELP_STRING([--disable-ipv6-support], [Disable IPv6 support]))
+AM_CONDITIONAL(WITH_INET6, test "x${enable_ipv6_support}" != "xno")
+AM_COND_IF([WITH_INET6],
+    AC_DEFINE(INET6, 1, ["Have IPv6 support"]))
+
+#
+# Disable Multilink support
+AC_ARG_ENABLE([multilink],
+    AS_HELP_STRING([--enable-multilink], [Enable multilink support]))
+AM_CONDITIONAL(WITH_MULTILINK, test "x${enable_multilink}" = "xyes")
+AM_COND_IF([WITH_MULTILINK],
+    AC_DEFINE([HAVE_MULTILINK], 1, ["Have multilink support"]))
+AS_IF([test "x${build_sunos}" = "xyes" && test "x${enable_multilink}" = "xyes"],
+    [AC_MSG_ERROR([Multilink is not supported on SunOS])])
+
+#
+# Multilink require Trivial Database Support
+AM_CONDITIONAL(WITH_TDB, test "x${enable_multilink}" = "xyes")
+AM_COND_IF([WITH_TDB],
+    AC_DEFINE([USE_TDB], 1, ["Include TDB support"]))
+
+#
+# Enable support for loadable plugins
+AC_ARG_ENABLE([plugins],
+    AS_HELP_STRING([--disable-plugins], [Disable support for loadable plugins]))
+AS_IF([test "x$enable_plugins" != "xno"],
+    AC_DEFINE([PLUGIN], 1, ["Have support for loadable plugins"]))
+AM_CONDITIONAL(WITH_PLUGINS, test "${enable_plugins}" != "no")
+
+#
+# Disable EAP-TLS support
+AC_ARG_ENABLE([eaptls],
+    AS_HELP_STRING([--disable-eaptls], [Disable EAP-TLS authentication support]))
+AS_IF([test "x$enable_eaptls" != "xno"],
+    AC_DEFINE([USE_EAPTLS], 1, ["Have EAP-TLS authentication support"]))
+AM_CONDITIONAL(WITH_EAPTLS, test "${enable_eaptls}" != "no")
+
+#
+# Disable OpenSSL engine support
+AC_ARG_ENABLE([openssl-engine],
+    AS_HELP_STRING([--disable-openssl-engine], [Disable OpenSSL engine support]))
+AS_IF([test "x$enable_openssl_engine" != "xno"], [],
+    AC_DEFINE([OPENSSL_NO_ENGINE], 1, ["OpenSSL engine support"]))
+
+#
+# Specify runtime directory
+AC_ARG_ENABLE([plugin-dir],
+       AC_HELP_STRING([--with-plugin-dir=DIR], [Specify the plugin directory for pppd]))
+AS_IF([test -n "$with_plugin_dir"],
+       [PPPD_PLUGIN_DIR="$with_plugin_dir"],
+       [PPPD_PLUGIN_DIR="${libdir}/pppd/$VERSION"])
+AC_SUBST(PPPD_PLUGIN_DIR, "$PPPD_PLUGIN_DIR", [The pppd plugin directory])
+
+#
+# Specify runtime directory
+AC_ARG_ENABLE([runtime-dir],
+       AC_HELP_STRING([--with-runtime-dir=DIR], [Specify the runtime directory for pppd]))
+AS_IF([test -n "$with_runtime_dir"],
+       [PPPD_RUNTIME_DIR="$with_runtime_dir"],
+       [PPPD_RUNTIME_DIR="${localstatedir}/run/pppd"])
+AC_SUBST(PPPD_RUNTIME_DIR)
+
+#
+# Specify runtime directory
+AC_ARG_ENABLE([logfile-dir],
+       AC_HELP_STRING([--with-logfile-dir=DIR], [Specify the log directory for pppd]))
+AS_IF([test -n "$with_logfile_dir"],
+       [PPPD_LOGFILE_DIR="$with_logfile_dir"],
+       [PPPD_LOGFILE_DIR="${localstatedir}/log/pppd"])
+AC_SUBST(PPPD_LOGFILE_DIR)
+
+#
+# Check for OpenSSL
+AX_CHECK_OPENSSL
+AM_CONDITIONAL(WITH_OPENSSL, test "${with_openssl}" != "no")
+
+#
+# Check if OpenSSL has compiled in support for various ciphers
+AS_IF([test "${with_openssl}" != "no" ], [
+    AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD4], [md4])
+    AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_MD5], [md5])
+    AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_DES], [des])
+    AX_CHECK_OPENSSL_DEFINE([OPENSSL_NO_SHA], [sha])
+], [
+    AS_IF([test "x$enable_eaptls" != "xno"],
+        [AC_MSG_ERROR([OpenSSL not found, and if this is your intention then run configure --disable-eaptls])])
+])
+
+AM_CONDITIONAL([OPENSSL_HAVE_MD4], test "x${ac_cv_openssl_md4}" != "xno")
+AM_COND_IF([OPENSSL_HAVE_MD4],,
+    AC_DEFINE([USE_MD4], 1, [Use included md4 included with pppd]))
+
+AM_CONDITIONAL([OPENSSL_HAVE_MD5], test "x${ac_cv_openssl_md5}" != "xno")
+AM_COND_IF([OPENSSL_HAVE_MD5],,
+    AC_DEFINE([USE_MD5], 1, [Use included md5 included with pppd]))
+
+AM_CONDITIONAL([OPENSSL_HAVE_SHA], test "x${ac_cv_openssl_sha}" != "xno")
+AM_COND_IF([OPENSSL_HAVE_SHA],,
+    AC_DEFINE([USE_SHA], 1, [Use included sha included with pppd]))
+
+AM_CONDITIONAL([OPENSSL_HAVE_DES], test "x${ac_cv_openssl_des}" != "xno")
+AM_COND_IF([OPENSSL_HAVE_DES],,
+    AC_DEFINE([USE_CRYPT], 1, [Use included des included with pppd]))
+
+#
+# If OpenSSL doesn't support DES, then use the one from libcrypt (glibc dropped support for this in 2.27).
+AS_IF([test "${ac_cv_openssl_des}" = "no" ], [
+    AC_CHECK_LIB([crypt], [encrypt],
+        [LIBS="$LIBS -lcrypt"],
+        [AC_MSG_ERROR([OpenSSL not found or does not support DES, and libcrypt also doesn't support encrypt])]
+    )
+])
+
+#
+# With libsrp support
+AX_CHECK_SRP
+
+#
+# With libatm support
+AX_CHECK_ATM
+
+#
+# With libpam support
+AX_CHECK_PAM(AC_DEFINE([USE_PAM], 1, ["Support for Pluggable Authentication Modules"]))
+AM_CONDITIONAL(WITH_PAM, test "x${with_pam}" = "xyes")
+
+#
+# With libpcap support, activate pppd on network activity
+AX_CHECK_PCAP
+
+#
+# SunOS provides a version of libpcap that would work, but SunOS has no support for activity filter
+AM_CONDITIONAL([WITH_FILTER], [ test "x${with_pcap}" = "xyes" && test "x${build_sunos}" != "xyes" ])
+AM_COND_IF([WITH_FILTER], [
+    AC_DEFINE([PPP_FILTER], 1, ["Have packet activity filter support"])], [
+    AS_IF([test "x${build_sunos}" = "xyes"], [
+        AC_MSG_WARN([Packet activity filter not supported on SunOS])
+        with_pcap="no"
+        ])
+    ])
+
+#
+# Some contributions require GTK/GLIB
+AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [Build contributions with the GTK+ interface]))
+if test "x${with_gtk}" = "xyes"; then
+    PKG_CHECK_MODULES([GTK], [gtk+-2.0])
+    PKG_CHECK_MODULES([GLIB], [glib-2.0])
+fi
+AM_CONDITIONAL([WITH_GTK], test "x${with_gtk}" = "xyes")
+
+
+AC_CONFIG_FILES([
+    Makefile
+    chat/Makefile
+    contrib/Makefile
+    contrib/pppgetpass/Makefile
+    common/Makefile
+    include/Makefile
+    modules/Makefile
+    pppd/Makefile
+    pppd/pppd.pc
+    pppd/plugins/Makefile
+    pppd/plugins/pppoe/Makefile
+    pppd/plugins/pppoatm/Makefile
+    pppd/plugins/pppol2tp/Makefile
+    pppd/plugins/radius/Makefile
+    pppdump/Makefile
+    pppstats/Makefile
+    scripts/Makefile
+    ])
+AC_OUTPUT
+
+
+AS_IF([test "x${build_sunos}" = "xyes" ], [[
+    echo "
+Setting up SunOS kernel module(s)"
+    mkmkf() {
+        rm -f $2
+        if [ -f $1 ]; then
+            echo "  $2 <= $1"
+            sed -e "s,@DESTDIR@,$prefix,g" \
+                -e "s,@SYSCONF@,$sysconfdir,g" \
+                -e "s,@CC@,$CC,g" \
+                -e "s|@CFLAGS@|$CFLAGS|g" $1 > $2
+        fi
+    }
+
+    release=`uname -r`
+    karch=`/usr/bin/isainfo -k`
+    makext="sol2"
+    archvariant=
+
+    case "$karch" in
+        amd64)
+            archvariant='-64x'
+            ;;
+        sparcv9)
+            archvariant='-64'
+            ;;
+        *)
+            ;;
+    esac
+
+    usegcc=$CC
+    if [ -x /opt/SUNWspro/bin/cc -a "$usegcc" != gcc ] &&
+       /opt/SUNWspro/bin/cc -flags >/dev/null 2>&1; then
+      if [ "$archvariant" = "-64x" ]; then
+        ( cd /tmp; echo "int x;" > ppp$$.c
+         /opt/SUNWspro/bin/cc -c -errwarn -xchip=opteron -m64 ppp$$.c >/dev/null 2>&1 || (
+           echo "WorkShop C is unable to make 64 bit modules, and your $karch system needs"
+           echo "them.  Consider upgrading cc on this machine."
+           rm -f ppp$$.c
+           exit 1
+         ) || exit 1
+         rm -f ppp$$.c ppp$$.o
+        ) || exit 1
+      fi
+    elif gcc --version >/dev/null 2>&1; then
+      archvariant=gcc$archvariant
+      compiletype=.gcc
+      if [ "$archvariant" = "gcc-64" -o"$archvariant" = "gcc-64x" ]; then
+        ( cd /tmp; touch ppp$$.c
+         gcc -c -m64 ppp$$.c >/dev/null 2>&1 || (
+           echo "gcc is unable to make 64 bit modules, and your $karch system needs them."
+           echo "Consider upgrading gcc on this machine, or switching to Sun WorkShop."
+           rm -f ppp$$.c
+           exit 1
+         ) || exit 1
+         rm -f ppp$$.c ppp$$.o
+        ) || exit 1
+      fi
+    else
+      echo "C compiler not found; hoping for the best."
+    fi
+
+    mkmkf solaris/Makedefs$compiletype Makedefs.com
+    mkmkf solaris/Makefile.sol2$archvariant solaris/Makefile
+]])
+
+echo "
+$PACKAGE_NAME version $PACKAGE_VERSION
+    Prefix...............: $prefix
+    Runtime Dir..........: $PPPD_RUNTIME_DIR
+    Logfile Dir..........: $PPPD_LOGFILE_DIR
+    Plugin Dir...........: $PPPD_PLUGIN_DIR
+    With OpenSSL.........: ${with_openssl:-yes}
+    With libatm..........: ${with_atm:-no}
+    With libpam..........: ${with_pam:-no}
+    With libpcap.........: ${with_pcap:-no}
+    With libsrp..........: ${with_srp:-no}
+    C Compiler...........: $CC $CFLAGS
+    Linker...............: $LD $LDFLAGS $LIBS
+
+Features enabled
+    Microsoft Extensions.: ${enable_microsoft_extensions:-yes}
+    Multilink............: ${enable_multilink:-no}
+    Plugins..............: ${enable_plugins:-yes}
+    CBCP.................: ${enable_cbcp:-no}
+    IPXCP................: ${enable_ipxcp:-no}
+    EAP-TLS..............: ${enable_eaptls:-yes}
+"
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644 (file)
index 0000000..fb9a390
--- /dev/null
@@ -0,0 +1 @@
+SUBDIRS = pppgetpass
diff --git a/contrib/pppgetpass/.gitignore b/contrib/pppgetpass/.gitignore
new file mode 100644 (file)
index 0000000..1b8a1c8
--- /dev/null
@@ -0,0 +1,2 @@
+pppgetpass.vt
+pppgetpass.gtk
diff --git a/contrib/pppgetpass/Makefile.am b/contrib/pppgetpass/Makefile.am
new file mode 100644 (file)
index 0000000..530e82f
--- /dev/null
@@ -0,0 +1,17 @@
+noinst_PROGRAMS = pppgetpass.vt
+noinst_man8_MANS = pppgetpass.8
+
+pppgetpass_vt_SOURCES = pppgetpass.vt.c
+pppgetpass_vt_CPPFLAGS = -Wno-unused-result
+
+if WITH_GTK
+noinst_PROGRAMS += pppgetpass.gtk
+
+pppgetpass_gtk_SOURCES = pppgetpass.gtk.c
+pppgetpass_gtk_CPPFLAGS = -Wno-deprecated-declarations -Wno-discarded-qualifiers
+pppgetpass_gtk_CPPFLAGS += $(GLIB_CFLAGS) $(GTK_CFLAGS)
+pppgetpass_gtk_LDADD = $(GLIB_LIBS) $(GTK_LIBS)
+endif
+
+EXTRA_DIST = \
+    pppgetpass.sh
diff --git a/contrib/pppgetpass/Makefile.linux b/contrib/pppgetpass/Makefile.linux
deleted file mode 100644 (file)
index eb16f5b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-all: pppgetpass.vt pppgetpass.gtk
-
-pppgetpass.vt: pppgetpass.vt.o
-
-pppgetpass.gtk: pppgetpass.gtk.o
-       $(CC) $(LDFLAGS) pppgetpass.gtk.o -o pppgetpass.gtk `pkg-config --libs glib-2.0 gtk+-2.0`
-pppgetpass.gtk.o: pppgetpass.gtk.c
-       $(CC) $(CFLAGS) -c pppgetpass.gtk.c `pkg-config --cflags glib-2.0 gtk+-2.0`
-
-install: all
-       install -m 755 pppgetpass.sh /usr/bin/pppgetpass
-       install -m 4755 -o root -g root pppgetpass.vt /usr/bin/
-       install -m 755 -o root -g root pppgetpass.gtk /usr/X11/bin/
-
-clean:
-       rm -f *.o pppgetpass.gtk pppgetpass.vt core
diff --git a/include/Makefile.am b/include/Makefile.am
new file mode 100644 (file)
index 0000000..2a576c1
--- /dev/null
@@ -0,0 +1,13 @@
+EXTRA_HEADERS = \
+    linux/if_ppp.h \
+    linux/ppp-comp.h \
+    linux/ppp_defs.h \
+    net/if_ppp.h \
+    net/ppp-comp.h \
+    net/ppp_defs.h \
+    net/pppio.h \
+    net/slcompress.h \
+    net/vjcompress.h
+
+EXTRA_DIST = \
+    $(EXTRA_HEADERS)
diff --git a/linux/Makefile.top b/linux/Makefile.top
deleted file mode 100644 (file)
index 894f8f3..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# PPP top-level Makefile for Linux.
-
-DESTDIR = $(INSTROOT)@DESTDIR@
-BINDIR = $(DESTDIR)/sbin
-INCDIR = $(DESTDIR)/include
-MANDIR = $(DESTDIR)/share/man
-ETCDIR = $(INSTROOT)@SYSCONF@/ppp
-
-# uid 0 = root
-INSTALL= install
-
-all:
-       cd chat; $(MAKE) $(MFLAGS) all
-       cd pppd/plugins; $(MAKE) $(MFLAGS) all
-       cd pppd; $(MAKE) $(MFLAGS) all
-       cd pppstats; $(MAKE) $(MFLAGS) all
-       cd pppdump; $(MAKE) $(MFLAGS) all
-
-install: $(BINDIR) $(MANDIR)/man8 install-progs install-devel
-
-install-progs:
-       cd chat; $(MAKE) $(MFLAGS) install
-       cd pppd/plugins; $(MAKE) $(MFLAGS) install
-       cd pppd; $(MAKE) $(MFLAGS) install
-       cd pppstats; $(MAKE) $(MFLAGS) install
-       cd pppdump; $(MAKE) $(MFLAGS) install
-
-install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \
-       $(ETCDIR)/chap-secrets $(ETCDIR)/eaptls-server $(ETCDIR)/eaptls-client
-
-install-devel:
-       cd pppd; $(MAKE) $(MFLAGS) install-devel
-
-$(ETCDIR)/options:
-       $(INSTALL) -c -m 644 etc.ppp/options $@
-$(ETCDIR)/pap-secrets:
-       $(INSTALL) -c -m 600 etc.ppp/pap-secrets $@
-$(ETCDIR)/chap-secrets:
-       $(INSTALL) -c -m 600 etc.ppp/chap-secrets $@
-$(ETCDIR)/eaptls-server:
-       $(INSTALL) -c -m 600 etc.ppp/eaptls-server $@
-$(ETCDIR)/eaptls-client:
-       $(INSTALL) -c -m 600 etc.ppp/eaptls-client $@
-
-$(BINDIR):
-       $(INSTALL) -d -m 755 $@
-$(MANDIR)/man8:
-       $(INSTALL) -d -m 755 $@
-$(ETCDIR):
-       $(INSTALL) -d -m 755 $@
-
-clean:
-       rm -f `find . -name '*.[oas]' -print`
-       rm -f `find . -name 'core' -print`
-       rm -f `find . -name '*~' -print`
-       cd chat; $(MAKE) clean
-       cd pppd/plugins; $(MAKE) clean
-       cd pppd; $(MAKE) clean
-       cd pppstats; $(MAKE) clean
-       cd pppdump; $(MAKE) clean
-
-dist-clean:    clean
-       rm -f Makefile `find . -name Makefile -print`
-
-#kernel:
-#      cd linux; ./kinstall.sh
-
-# no tests yet, one day...
-installcheck:
-       true
diff --git a/linux/pppd.pc.in b/linux/pppd.pc.in
deleted file mode 100644 (file)
index bb44595..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@DESTDIR@
-exec_prefix=@DESTDIR@
-libdir=@LIBDIR@
-includedir=@INCDIR@
-version=@VERSION@
-plugindir=@LIBDIR@/pppd/${version}
-
-Name: pppd
-Description: Point-to-Point Protocol (PPP) daemon
-Version: @VERSION@
-Cflags: -I${includedir}
diff --git a/m4/ax_check_atm.m4 b/m4/ax_check_atm.m4
new file mode 100644 (file)
index 0000000..004fe9f
--- /dev/null
@@ -0,0 +1,93 @@
+# SYNOPSIS
+#
+#   AX_CHECK_ATM([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+#   Look for libatm in a number of default locations, or in a provided location
+#   (via --with-atm=). Sets
+#       ATM_CFLAGS
+#       ATM_LDFLAGS
+#       ATM_LIBS
+#
+#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# LICENSE
+#
+#   Copyright (c) 2021 Eivind Naess <eivnaes@yahoo.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_CHECK_ATM], [
+    AC_ARG_WITH([atm],
+        [AS_HELP_STRING([--with-atm=DIR],
+            [With libatm support, see http://linux-atm.sourceforge.net])],
+        [
+            case "$withval" in
+            "" | y | ye | yes)
+                atmdirs="/usr/local /usr/lib /usr"  
+              ;;
+            n | no)
+                with_atm="no"
+              ;;
+            *)
+                atmdirs="$withval"
+              ;;
+            esac
+        ])
+    
+    if [ test "x${with_atm}" != "xno" ] ; then
+        ATM_LIBS="-latm"
+        for atmdir in $atmdirs; do
+            AC_MSG_CHECKING([for atm.h in $atmdir])
+            if test -f "$atmdir/include/atm.h"; then
+                ATM_CFLAGS="-I$atmdir/include"
+                ATM_LDFLAGS="-L$atmdir/lib"
+                AC_MSG_RESULT([yes])
+                break
+            else
+                AC_MSG_RESULT([no])
+            fi
+        done
+
+        # try the preprocessor and linker with our new flags,
+        # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+        AC_MSG_CHECKING([if compiling and linking against libatm works])
+
+        save_LIBS="$LIBS"
+        save_LDFLAGS="$LDFLAGS"
+        save_CPPFLAGS="$CPPFLAGS"
+        LDFLAGS="$LDFLAGS $ATM_LDFLAGS"
+        LIBS="$ATM_LIBS $LIBS"
+        CPPFLAGS="$ATM_CFLAGS $CPPFLAGS"
+        AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+                [#include <atm.h>
+                 #include <stddef.h>], 
+                [text2atm(NULL,NULL,0,0);])],
+            [
+                AC_MSG_RESULT([yes])
+                with_atm=yes
+                $1
+            ], [
+                AC_MSG_RESULT([no])
+                with_atm=""
+                $2
+            ])
+        CPPFLAGS="$save_CPPFLAGS"
+        LDFLAGS="$save_LDFLAGS"
+        LIBS="$save_LIBS"
+
+        AC_SUBST([ATM_CFLAGS])
+        AC_SUBST([ATM_LIBS])
+        AC_SUBST([ATM_LDFLAGS])
+    fi
+    AM_CONDITIONAL(WITH_LIBATM, test -n "${with_atm}")
+])
+
diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4
new file mode 100644 (file)
index 0000000..8ae39ca
--- /dev/null
@@ -0,0 +1,119 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+#   Look for OpenSSL in a number of default spots, or in a user-selected
+#   spot (via --with-openssl).  Sets
+#
+#     OPENSSL_INCLUDES to the include directives required
+#     OPENSSL_LIBS to the -l directives required
+#     OPENSSL_LDFLAGS to the -L or -R flags required
+#
+#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+#   This macro sets OPENSSL_INCLUDES such that source files should use the
+#   openssl/ directory in include directives:
+#
+#     #include <openssl/hmac.h>
+#
+# LICENSE
+#
+#   Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
+#   Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 9
+
+AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
+AC_DEFUN([AX_CHECK_OPENSSL], [
+    found=false
+    AC_ARG_WITH([openssl],
+        [AS_HELP_STRING([--with-openssl=DIR],
+            [With openssl support, see http://www.openssl.org])],
+        [
+            case "$withval" in
+            "" | y | ye | yes )
+                ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+              ;;
+            n | no )
+              ;;
+            *) ssldirs="$withval"
+              ;;
+            esac
+        ], [
+            ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+        ])
+
+    AS_IF([test "${with_openssl}" != "no"], [
+        OPENSSL_INCLUDES=
+        for ssldir in $ssldirs; do
+            AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
+            AS_IF([ test -f "$ssldir/include/openssl/ssl.h" ], [
+                OPENSSL_INCLUDES="-I$ssldir/include"
+                OPENSSL_LDFLAGS="-L$ssldir/lib"
+                OPENSSL_LIBS="-lssl -lcrypto"
+                found=true
+                AC_MSG_RESULT([yes])
+                break
+            ], [
+                AC_MSG_RESULT([no])
+            ])
+        done])
+     
+    AS_IF([test "${with_openssl}" != "no" && test ! ${found}], [ 
+        # if pkg-config is installed and openssl has installed a .pc file,
+        # then use that information and don't search ssldirs
+        AC_PATH_PROG([PKG_CONFIG], [pkg-config])
+        if test x"$PKG_CONFIG" != x""; then
+            OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
+            if test $? = 0; then
+                OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
+                OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
+                found=true
+            fi
+        fi
+    ])
+
+    AS_IF([test "${with_openssl}" != "no" && test ${found}], [
+
+        # try the preprocessor and linker with our new flags,
+        # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+        AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
+        echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
+            "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
+
+        save_LIBS="$LIBS"
+        save_LDFLAGS="$LDFLAGS"
+        save_CPPFLAGS="$CPPFLAGS"
+        LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+        LIBS="$OPENSSL_LIBS $LIBS"
+        CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
+        AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
+            [
+                AC_MSG_RESULT([yes])
+                $1
+            ], [
+                AC_MSG_RESULT([no])
+                $2
+            ])
+        CPPFLAGS="$save_CPPFLAGS"
+        LDFLAGS="$save_LDFLAGS"
+        LIBS="$save_LIBS"
+
+        AC_SUBST([OPENSSL_INCLUDES])
+        AC_SUBST([OPENSSL_LIBS])
+        AC_SUBST([OPENSSL_LDFLAGS])
+    ], [ $2 ])
+])
diff --git a/m4/ax_check_openssl_func.m4 b/m4/ax_check_openssl_func.m4
new file mode 100644 (file)
index 0000000..d269af8
--- /dev/null
@@ -0,0 +1,44 @@
+# SYNOPSIS
+#
+#   AX_CHECK_OPENSSL_DEFINE([DEFINE], [VAR][, action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+#   Check if OpenSSL has a define set in it's features provided, i.e. OPENSSL_NO_MD4.
+#   If so, the var argument ac_cv_openssl_[VAR] is set to yes, and action-is-found is
+#   run, else action-if-not-found is executed.
+#
+#   This module require AX_CHECK_OPENSSL
+#
+# LICENSE
+#
+#   Copyright (c) 2021 Eivind Naess <eivnaes@yahoo.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_CHECK_OPENSSL_DEFINE], [
+    AC_REQUIRE([AX_CHECK_OPENSSL])
+    AC_MSG_CHECKING([for $2 support in openssl])
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
+    AC_PREPROC_IFELSE([
+        AC_LANG_PROGRAM(
+            [[@%:@include <openssl/opensslconf.h>]],
+            [[#ifdef $1
+              #error "No support for $1"
+              #endif]])],
+        AC_MSG_RESULT([yes])
+        [ac_cv_openssl_$2=yes]
+        $3,
+        AC_MSG_RESULT([no])
+        [ac_cv_openssl_$2=no]
+        $4
+    )
+    CPPFLAGS="$save_CPPFLAGS"
+])
+
diff --git a/m4/ax_check_pam.m4 b/m4/ax_check_pam.m4
new file mode 100644 (file)
index 0000000..edb30e3
--- /dev/null
@@ -0,0 +1,93 @@
+# SYNOPSIS
+#
+#   AX_CHECK_PAM([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+#   Look for libpam in a number of default locations, or in a provided location
+#   (via --with-pam=). Sets
+#       PAM_CFLAGS
+#       PAM_LDFLAGS
+#       PAM_LIBS
+#
+#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# LICENSE
+#
+#   Copyright (c) 2021 Eivind Naess <eivnaes@yahoo.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_CHECK_PAM], [
+    AC_ARG_WITH([pam],
+        [AS_HELP_STRING([--with-pam=DIR],
+            [With libpam support, see ftp.redhat.com:/pub/pam])],
+        [
+            case "$withval" in
+            "" | y | ye | yes)
+                pamdirs="/usr/local /usr/lib /usr"  
+              ;;
+            n | no)
+                with_pam="no"
+              ;;
+            *)
+                pamdirs="$withval"
+              ;;
+            esac
+        ])
+    
+    if [ test "x${with_pam}" != "xno" ] ; then
+        PAM_LIBS="-lpam"
+        for pamdir in $pamdirs; do
+            AC_MSG_CHECKING([for pam_appl.h in $pamdir])
+            if test -f "$pamdir/include/security/pam_appl.h"; then
+                PAM_CFLAGS="-I$pamdir/include"
+                PAM_LDFLAGS="-L$pamdir/lib"
+                AC_MSG_RESULT([yes])
+                break
+            else
+                AC_MSG_RESULT([no])
+            fi
+        done
+
+        # try the preprocessor and linker with our new flags,
+        # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+        AC_MSG_CHECKING([if compiling and linking against libpam works])
+
+        save_LIBS="$LIBS"
+        save_LDFLAGS="$LDFLAGS"
+        save_CPPFLAGS="$CPPFLAGS"
+        LDFLAGS="$LDFLAGS $PAM_LDFLAGS"
+        LIBS="$PAM_LIBS $LIBS"
+        CPPFLAGS="$PAM_CFLAGS $CPPFLAGS"
+        AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+                [#include <security/pam_appl.h>
+                 #include <stddef.h>], 
+                [pam_authenticate(NULL, 0);])],
+            [
+                AC_MSG_RESULT([yes])
+                with_pam=yes
+                $1
+            ], [
+                AC_MSG_RESULT([no])
+                with_pam=""
+                $2
+            ])
+        CPPFLAGS="$save_CPPFLAGS"
+        LDFLAGS="$save_LDFLAGS"
+        LIBS="$save_LIBS"
+
+        AC_SUBST([PAM_CFLAGS])
+        AC_SUBST([PAM_LIBS])
+        AC_SUBST([PAM_LDFLAGS])
+    fi
+    AM_CONDITIONAL(WITH_LIBPAM, test -n "${with_pam}")
+])
+
diff --git a/m4/ax_check_pcap.m4 b/m4/ax_check_pcap.m4
new file mode 100644 (file)
index 0000000..6d70ec1
--- /dev/null
@@ -0,0 +1,93 @@
+# SYNOPSIS
+#
+#   AX_CHECK_PCAP([action-if-found[, action-if-not-found]]
+#
+# DESCRIPTION
+#
+#   Look for libpcap in a number of default locations, or in a provided location
+#   (via --with-pcap=). Sets
+#       PCAP_CFLAGS
+#       PCAP_LDFLAGS
+#       PCAP_LIBS
+#
+#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# LICENSE
+#
+#   Copyright (c) 2021 Eivind Naess <eivnaes@yahoo.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_CHECK_PCAP], [
+    AC_ARG_WITH([pcap],
+        [AS_HELP_STRING([--with-pcap=DIR],
+            [With libpcap support, see https://www.tcpdump.org])],
+        [
+            case "$withval" in
+            "" | y | ye | yes)
+                pcapdirs="/usr/local /usr/lib /usr"  
+              ;;
+            n | no)
+                with_pcap="no"
+              ;;
+            *)
+                pcapdirs="$withval"
+              ;;
+            esac
+        ])
+    
+    if [ test "x${with_pcap}" != "xno" ] ; then
+        PCAP_LIBS="-lpcap"
+        for pcapdir in $pcapdirs; do
+            AC_MSG_CHECKING([for pcap.h in $pcapdir])
+            if test -f "$pcapdir/include/pcap.h"; then
+                PCAP_CFLAGS="-I$pcapdir/include"
+                PCAP_LDFLAGS="-L$pcapdir/lib"
+                AC_MSG_RESULT([yes])
+                break
+            else
+                AC_MSG_RESULT([no])
+            fi
+        done
+
+        # try the preprocessor and linker with our new flags,
+        # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+        AC_MSG_CHECKING([if compiling and linking against libpcap works])
+
+        save_LIBS="$LIBS"
+        save_LDFLAGS="$LDFLAGS"
+        save_CPPFLAGS="$CPPFLAGS"
+        LDFLAGS="$PCAP_LDFLAGS $LDFLAGS"
+        LIBS="$PCAP_LIBS $LIBS"
+        CPPFLAGS="$PCAP_CFLAGS $CPPFLAGS"
+        AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+                [@%:@include <pcap.h>],
+                [pcap_create(0,0);])],
+            [
+                AC_MSG_RESULT([yes])
+                with_pcap=yes
+                $1
+            ], [
+                AC_MSG_RESULT([no])
+                with_pcap=""
+                $2
+            ])
+        CPPFLAGS="$save_CPPFLAGS"
+        LDFLAGS="$save_LDFLAGS"
+        LIBS="$save_LIBS"
+
+        AC_SUBST([PCAP_CFLAGS])
+        AC_SUBST([PCAP_LIBS])
+        AC_SUBST([PCAP_LDFLAGS])
+    fi
+
+    AM_CONDITIONAL(WITH_PCAP, test -n "${with_pcap}")
+])
+
diff --git a/m4/ax_check_srp.m4 b/m4/ax_check_srp.m4
new file mode 100644 (file)
index 0000000..631341d
--- /dev/null
@@ -0,0 +1,94 @@
+# SYNOPSIS
+#
+#   AX_CHECK_SRP([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+#   Look for libsrp in a number of default locations, or in a provided location
+#   (via --with-srp=). Sets
+#       SRP_CFLAGS
+#       SRP_LDFLAGS
+#       SRP_LIBS
+#
+#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# LICENSE
+#
+#   Copyright (c) 2021 Eivind Naess <eivnaes@yahoo.com>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+
+AC_DEFUN([AX_CHECK_SRP], [
+    AC_ARG_WITH([srp],
+        [AS_HELP_STRING([--with-srp=DIR],
+            [With libsrp support, see http://srp.stanford.edu])],
+        [
+            case "$withval" in
+            "" | y | ye | yes)
+                srpdirs="/usr/local /usr/lib /usr"  
+              ;;
+            n | no)
+                with_srp="no"
+              ;;
+            *)
+                srpdirs="$withval"
+              ;;
+            esac
+        ])
+    
+    if [ test "x${with_srp}" != "xno" ] ; then
+        SRP_LIBS="-lsrp"
+        for srpdir in $srpdirs; do
+            AC_MSG_CHECKING([for srp.h in $srpdir])
+            if test -f "$srpdir/include/srp.h"; then
+                SRP_CFLAGS="-I$srpdir/include"
+                SRP_LDFLAGS="-L$srpdir/lib"
+                AC_MSG_RESULT([yes])
+                break
+            else
+                AC_MSG_RESULT([no])
+            fi
+        done
+
+        # try the preprocessor and linker with our new flags,
+        # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+        AC_MSG_CHECKING([if compiling and linking against libsrp works])
+
+        save_LIBS="$LIBS"
+        save_LDFLAGS="$LDFLAGS"
+        save_CPPFLAGS="$CPPFLAGS"
+        LDFLAGS="$SRP_LDFLAGS $OPENSSL_LDFLAGS $LDFLAGS"
+        LIBS="$SRP_LIBS $OPENSSL_LIBS $LIBS"
+        CPPFLAGS="$SRP_CFLAGS $OPENSSL_INCLUDES $CPPFLAGS"
+        AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+                [#include <srp.h>
+                 #include <stddef.h>], 
+                [SRP_use_engine(NULL);])],
+            [
+                AC_MSG_RESULT([yes])
+                with_srp=yes
+                $1
+            ], [
+                AC_MSG_RESULT([no])
+                with_srp=""
+                $2
+            ])
+        CPPFLAGS="$save_CPPFLAGS"
+        LDFLAGS="$save_LDFLAGS"
+        LIBS="$save_LIBS"
+
+        AC_SUBST([SRP_CFLAGS])
+        AC_SUBST([SRP_LIBS])
+        AC_SUBST([SRP_LDFLAGS])
+    fi
+
+    AM_CONDITIONAL(WITH_SRP, test -n "${with_srp}")
+])
+
diff --git a/m4/pkg.m4 b/m4/pkg.m4
new file mode 100644 (file)
index 0000000..13a8890
--- /dev/null
+++ b/m4/pkg.m4
@@ -0,0 +1,275 @@
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
+dnl Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright Â© 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.2])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=m4_default([$1], [0.9.0])
+       AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               AC_MSG_RESULT([yes])
+       else
+               AC_MSG_RESULT([no])
+               PKG_CONFIG=""
+       fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+  m4_default([$2], [:])
+m4_ifvaln([$3], [else
+  $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+    pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+    PKG_CHECK_EXISTS([$3],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes ],
+                    [pkg_failed=yes])
+ else
+    pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $2])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+        AC_MSG_RESULT([no])
+        _PKG_SHORT_ERRORS_SUPPORTED
+        if test $_pkg_short_errors_supported = yes; then
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+        else
+               $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+       m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+        ])
+elif test $pkg_failed = untried; then
+        AC_MSG_RESULT([no])
+       m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+        ])
+else
+       $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+       $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+        AC_MSG_RESULT([yes])
+       $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
diff --git a/modules/Makefile.am b/modules/Makefile.am
new file mode 100644 (file)
index 0000000..ddd53bc
--- /dev/null
@@ -0,0 +1,12 @@
+EXTRA_MODULE = \
+    bsd-comp.c \
+    deflate.c \
+    if_ppp.c \
+    ppp_ahdlc.c \
+    ppp.c \
+    ppp_comp.c \
+    ppp_mod.h \
+    vjcompress.c
+
+EXTRA_DIST = \
+    $(EXTRA_MODULE)
diff --git a/pppd/Makefile.am b/pppd/Makefile.am
new file mode 100644 (file)
index 0000000..c15ea2e
--- /dev/null
@@ -0,0 +1,165 @@
+sbin_PROGRAMS = pppd
+dist_man8_MANS = pppd.8
+if WITH_SRP
+sbin_PROGRAMS += srp-entry
+dist_man8_MANS += srp-entry.8
+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_CPPFLAGS = -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_FILTER
+pppd_CPPFLAGS += $(PCAP_CFLAGS)
+pppd_LDFLAGS += $(PCAP_LDFLAGS)
+pppd_LIBS += $(PCAP_LIBS)
+endif
+
+if WITH_PLUGINS
+pppd_CPPFLAGS += -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_CPPFLAGS += $(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_CPPFLAGS = $(OPENSSL_INCLUDES) $(SRP_CFLAGS)
+srp_entry_LDADD = $(SRP_LIBS) $(OPENSSL_LIBS)
+srp_entry_LDFLAGS = $(OPENSSL_LDFLAGS) $(SRP_LDFLAGS)
+
+pppd_CPPFLAGS += $(SRP_CFLAGS)
+pppd_LDFLAGS += $(SRP_LDFLAGS)
+pppd_LIBS += $(SRP_LIBS)
+endif
+
+pppd_LDADD = $(pppd_LIBS)
+
+EXTRA_DIST = \
+    ppp.pam
diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
deleted file mode 100644 (file)
index 852945e..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-#
-# pppd makefile for Linux
-# Processed by configure to produce pppd/Makefile
-#
-
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-# Default installation locations
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-INCDIR = $(INSTROOT)@INCDIR@
-LIBDIR = $(INSTROOT)@LIBDIR@
-PKGCONFDIR = $(LIBDIR)/pkgconfig
-
-TARGETS = pppd
-
-PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \
-          ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \
-          demand.c utils.c tty.c eap.c chap-md5.c session.c
-
-HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \
-       ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
-       upap.h eap.h
-
-MANPAGES = pppd.8
-PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \
-          ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \
-          eap.o chap-md5.o session.o
-
-#
-# include dependencies if present
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif
-
-LIBS = -lrt
-
-# Uncomment the next line to include support for Microsoft's
-# MS-CHAP authentication protocol.  Also, edit plugins/radius/Makefile.linux.
-CHAPMS=y
-#USE_CRYPT=y
-# Don't use MSLANMAN unless you really know what you're doing.
-#MSLANMAN=y
-# Uncomment the next line to include support for MPPE.  CHAPMS (above) must
-# also be enabled.  Also, edit plugins/radius/Makefile.linux.
-MPPE=y
-
-# Uncomment the next line to include support for PPP packet filtering.
-# This requires that the libpcap library and headers be installed
-# and that the kernel driver support PPP packet filtering.
-FILTER=y
-
-# Uncomment the next line to enable multilink PPP (enabled by default)
-# Linux distributions: Please leave multilink ENABLED in your builds
-# of pppd!
-HAVE_MULTILINK=y
-
-# Uncomment the next line to enable the TDB database (enabled by default.)
-# If you enable multilink, then TDB is automatically enabled also.
-# Linux distributions: Please leave TDB ENABLED in your builds.
-USE_TDB=y
-
-# Uncomment the next line to enable Type=notify services in systemd
-# If enabled, and the user sets the up_sdnotify option, then
-# pppd will not detach and will notify systemd when up.
-#SYSTEMD=y
-
-HAS_SHADOW=y
-#USE_PAM=y
-HAVE_INET6=y
-
-# Enable plugins
-PLUGIN=y
-
-# Enable Microsoft proprietary Callback Control Protocol
-#CBCP=y
-
-# Enable EAP SRP-SHA1 authentication (requires libsrp)
-#USE_SRP=y
-
-# Use libutil; test if logwtmp is declared in <utmp.h> to detect
-UTMPHEADER = "\#include <utmp.h>"
-ifeq ($(shell echo $(UTMPHEADER) | $(CC) -E - 2>/dev/null | grep -q logwtmp && echo yes),yes)
-USE_LIBUTIL=y
-endif
-
-# Enable EAP-TLS authentication (requires MPPE support, libssl and libcrypto)
-USE_EAPTLS=y
-
-MAXOCTETS=y
-
-INCLUDE_DIRS= -I../include
-
-COMPILE_FLAGS= -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -pipe
-
-CFLAGS= $(COPTS) $(COMPILE_FLAGS) $(INCLUDE_DIRS) '-DDESTDIR="@DESTDIR@"'
-
-ifdef CHAPMS
-CFLAGS   += -DCHAPMS=1
-NEEDDES=y
-PPPDOBJS += md4.o chap_ms.o
-HEADERS        += md4.h chap_ms.h
-ifdef MSLANMAN
-CFLAGS   += -DMSLANMAN=1
-endif
-ifdef MPPE
-CFLAGS   += -DMPPE=1
-PPPDOBJS += mppe.o
-PPPDSRC  += mppe.c
-HEADERS  += mppe.h
-endif
-endif
-
-# EAP SRP-SHA1
-ifdef USE_SRP
-CFLAGS += -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
-LIBS   += -lsrp -L/usr/local/ssl/lib
-NEEDCRYPTOLIB = y
-TARGETS        += srp-entry
-EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
-MANPAGES += srp-entry.8
-EXTRACLEAN += srp-entry.o
-NEEDDES=y
-else
-# OpenSSL has an integrated version of SHA-1, and its implementation
-# is incompatible with this local SHA-1 implementation.  We must use
-# one or the other, not both.
-PPPDSRCS += sha1.c
-HEADERS += sha1.h
-PPPDOBJS += sha1.o
-endif
-
-# EAP-TLS
-ifdef USE_EAPTLS
-CFLAGS += -DUSE_EAPTLS=1
-LIBS += -lssl
-NEEDCRYPTOLIB = y
-PPPDSRC += eap-tls.c
-HEADERS += eap-tls.h
-PPPDOBJS += eap-tls.o
-endif
-
-ifdef HAS_SHADOW
-CFLAGS   += -DHAS_SHADOW
-#LIBS     += -lshadow $(LIBS)
-endif
-
-CRYPTHEADER = "\#include <crypt.h>"
-ifeq ($(shell echo $(CRYPTHEADER) | $(CC) -E - >/dev/null 2>&1 && echo yes),yes)
-CFLAGS  += -DHAVE_CRYPT_H=1
-LIBS   += -lcrypt
-endif
-
-ifdef USE_LIBUTIL
-CFLAGS += -DHAVE_LOGWTMP=1
-LIBS   += -lutil
-endif
-
-ifdef NEEDDES
-ifndef USE_CRYPT
-NEEDCRYPTOLIB = y
-else
-CFLAGS   += -DUSE_CRYPT=1
-endif
-PPPDOBJS += pppcrypt.o
-HEADERS += pppcrypt.h
-endif
-
-ifdef NEEDCRYPTOLIB
-LIBS     += -lcrypto
-endif
-
-# For "Pluggable Authentication Modules", see ftp.redhat.com:/pub/pam/.
-ifdef USE_PAM
-CFLAGS   += -DUSE_PAM
-LIBS     += -lpam -ldl
-endif
-
-# Multi-linnk
-ifdef HAVE_MULTILINK
-       # Multilink implies the use of TDB
-       USE_TDB=y
-
-       CFLAGS += -DHAVE_MULTILINK
-       PPPDSRCS += multilink.c
-       PPPDOBJS += multilink.o
-endif
-
-# TDB
-ifdef USE_TDB
-       CFLAGS += -DUSE_TDB=1
-       PPPDSRCS += tdb.c spinlock.c
-       PPPDOBJS += tdb.o spinlock.o
-       HEADERS += tdb.h spinlock.h
-endif
-
-# Lock library binary for Linux is included in 'linux' subdirectory.
-ifdef LOCKLIB
-LIBS     += -llock
-CFLAGS   += -DLOCKLIB=1
-endif
-
-ifdef SYSTEMD
-LIBS += -lsystemd
-CFLAGS   += -DSYSTEMD=1
-endif
-
-ifdef PLUGIN
-CFLAGS += -DPLUGIN
-LDFLAGS_PLUGIN += -Wl,-E
-LIBS   += -ldl
-endif
-
-ifdef FILTER
-LIBS    += -lpcap
-CFLAGS  += -DPPP_FILTER
-endif
-
-ifdef HAVE_INET6
-     PPPDSRCS += ipv6cp.c eui64.c
-     HEADERS  += ipv6cp.h eui64.h
-     PPPDOBJS += ipv6cp.o eui64.o
-     CFLAGS   += -DINET6=1
-endif
-
-ifdef CBCP
-     PPPDSRCS += cbcp.c
-     PPPDOBJS += cbcp.o
-     CFLAGS += -DCBCP_SUPPORT
-     HEADERS += cbcp.h
-endif
-
-ifdef MAXOCTETS
-     CFLAGS += -DMAXOCTETS
-endif
-
-INSTALL= install
-
-all: $(TARGETS)
-
-install: pppd
-       $(INSTALL) -d $(BINDIR)
-       $(INSTALL) -d $(MANDIR)
-       $(INSTALL) -d $(PKGCONFDIR)
-       $(EXTRAINSTALL)
-       $(INSTALL) -c -m 755 pppd $(BINDIR)/pppd
-       if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
-         chmod o-rx,u+s $(BINDIR)/pppd; fi
-       $(INSTALL) -c -m 644 pppd.pc $(PKGCONFDIR)
-       $(INSTALL) -c -m 644 pppd.8 $(MANDIR)
-
-pppd: $(PPPDOBJS)
-       $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_PLUGIN) -o pppd $(PPPDOBJS) $(LIBS)
-
-srp-entry:     srp-entry.c
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ srp-entry.c $(LIBS)
-
-install-devel:
-       mkdir -p $(INCDIR)/pppd
-       $(INSTALL) -c -m 644 $(HEADERS) $(INCDIR)/pppd
-
-clean:
-       rm -f $(PPPDOBJS) $(EXTRACLEAN) $(TARGETS) *~ #* core
-
-depend:
-       $(CPP) -M $(CFLAGS) $(PPPDSRCS) >.depend
diff --git a/pppd/Makefile.sol2 b/pppd/Makefile.sol2
deleted file mode 100644 (file)
index 3a8681c..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Makefile for pppd under Solaris 2.
-# $Id: Makefile.sol2,v 1.30 2008/01/30 14:26:52 carlsonj Exp $
-#
-
-include ../Makedefs.com
-
-CFLAGS =  -I../include -DSVR4 -DSOL2 $(COPTS) '-DDESTDIR="@DESTDIR@"'
-LIBS   = -lsocket -lnsl
-
-OBJS   =  main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o eap.o md5.o \
-       tty.o ccp.o ecp.o auth.o options.o demand.o utils.o sys-solaris.o \
-       chap-md5.o session.o
-
-# Solaris uses shadow passwords
-CFLAGS += -DHAS_SHADOW
-
-#
-# Comment the following out to disable plugins
-#
-CFLAGS += -DPLUGIN
-LIBS   += -ldl
-
-#
-# Solaris 8 and above accomodates /var/run, so uncomment the
-# following to place pppd process IDs on that location
-#
-#CFLAGS += -D_PATH_VARRUN='"/var/run/"'
-
-#
-# uncomment the following to enable IPv6
-#
-# Solaris 8 and on includes support for IPv6
-#
-CFLAGS += -DINET6
-OBJS   += ipv6cp.o eui64.o
-
-# Uncomment to enable MS-CHAP
-CFLAGS += -DUSE_CRYPT -DCHAPMS -DMSLANMAN -DHAVE_CRYPT_H
-OBJS += chap_ms.o pppcrypt.o md4.o sha1.o mppe.o
-
-# Uncomment to enable MPPE (in both CHAP and EAP-TLS)
-CFLAGS += -DMPPE
-
-# Uncomment to enable EAP-TLS
-CFLAGS += -DUSE_EAPTLS
-LIBS += -lcrypto -lssl
-OBJS += eap-tls.o
-
-# Uncomment for CBCP
-#CFLAGS += -DCBCP_SUPPORT
-#OBJS += cbcp.o
-
-# Uncomment for PAM
-#CFLAGS += -DUSE_PAM
-#LIBS += -lpam
-
-#
-# Make targets
-#
-all: pppd
-
-pppd:  $(OBJS)
-       $(CC) -o pppd $(OBJS) $(LIBS)
-
-install:
-       $(INSTALL) -f $(BINDIR) -m 4755 -u root pppd
-       $(INSTALL) -f $(MANDIR)/man8 -m 444 pppd.8
-
-clean:
-       rm -f $(OBJS) pppd *~ core y.tab.c y.tab.h
index 0a49f53e9f3711ef481856b6fbdffeae29ba496c..013561ae66bb95053753fc6473d9628cea671faa 100644 (file)
 
 #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
 #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;
                }
            }
index e3566336982709115b1b121e56f3f5526401598c..87bf9c002c0c72c3600216936a3edb4fe3519c4d 100644 (file)
@@ -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>
index c2ab3f68991f189b6ebd93ae45dbdb21725072f5..c74b5f8c8a2daef6f70ddb8851f9fd5f21f5eaa9 100644 (file)
@@ -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 */
index 387b571d3db8cf4deec012a8888d51eab80891b9..644a9d1128ad65691fb72f748d0b3a916f546bd6 100644 (file)
  * 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>
index 76446db007c00604120f7044cc67be520ad3650c..35961b9b75a46ea0eee7625d6958b24c7e52a11d 100644 (file)
@@ -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? */
index 77dd4ecc705984bad999cb51fb6b8889f5b82f48..000f880e89e3d0859698b018689437acb120023e 100644 (file)
 
 #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"
index 30d06588ee51dace373bf8699a67be31b5d78866..4dbbfd1ed590b6dac3dfbfa1645a95c7e7799fc2 100644 (file)
@@ -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);
index 10e4507386e277fbdb6413e46bdd80f61a0b783f..ab4302b96a207313d81a1cfaf24897d19d63743a 100644 (file)
 
 #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"
index e5330da57630c7365ac3aea5981836411d9761e8..b4b0ee23eb6d5bf6121e842d236a1e2214a745bb 100644 (file)
@@ -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).
  */
index d315ab4acd0182258fb25bee21f472e2d021f42b..52d48905f03b3890c3bd76d0bc3f0f44558ec8b2 100644 (file)
 
 #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>
index 4e6a62113c5be3573432fb018c044cd01459a010..c1c5ed846f5f5004f086de610a32ede41dc5a121 100644 (file)
@@ -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 */
index 289c9f8fdd57959588e65835d16cc3adf7950c6a..0943e8a381ad5ce8ee2b12b3438708357f0c63d1 100644 (file)
 
 #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>
index b13082117232ef1973c6cb8f053f772f33a6289f..b15d801565f54807165435a6a09a585f1c5cd665 100644 (file)
  *
  */
 
+#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>
@@ -279,6 +285,23 @@ ENGINE *eaptls_ssl_load_engine( char *engine_name )
 #endif
 
 
+#ifndef OPENSSL_NO_ENGINE
+static int eaptls_UI_writer(UI *ui, UI_STRING *uis)
+{
+    PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui);
+    UI_set_result(ui, uis, cb_data->password);
+    return 1;
+}
+
+static int eaptls_UI_stub(UI* ui) {
+    return 1;
+}
+
+static int eaptls_UI_reader(UI *ui, UI_STRING *uis) {
+    return 1;
+}
+#endif
+
 /*
  * Initialize the SSL stacks and tests if certificates, key and crl
  * for client or server use can be loaded.
@@ -572,20 +595,11 @@ SSL_CTX *eaptls_init_ssl(int init_server, char *cacertfile, char *capath,
         {
             UI_METHOD* transfer_pin = UI_create_method("transfer_pin");
 
-            int writer (UI *ui, UI_STRING *uis)
-            {
-                PW_CB_DATA* cb_data = (PW_CB_DATA*)UI_get0_user_data(ui);
-                UI_set_result(ui, uis, cb_data->password);
-                return 1;
-            };
-            int stub (UI* ui) {return 1;};
-            int stub_reader (UI *ui, UI_STRING *uis) {return 1;};
-
-            UI_method_set_writer(transfer_pin,  writer);
-            UI_method_set_opener(transfer_pin,  stub);
-            UI_method_set_closer(transfer_pin,  stub);
-            UI_method_set_flusher(transfer_pin, stub);
-            UI_method_set_reader(transfer_pin,  stub_reader);
+            UI_method_set_writer(transfer_pin,  eaptls_UI_writer);
+            UI_method_set_opener(transfer_pin,  eaptls_UI_stub);
+            UI_method_set_closer(transfer_pin,  eaptls_UI_stub);
+            UI_method_set_flusher(transfer_pin, eaptls_UI_stub);
+            UI_method_set_reader(transfer_pin,  eaptls_UI_reader);
 
             dbglog( "Using our private key URI: '%s' in engine", privkeyfile );
             pkey = ENGINE_load_private_key(pkey_engine, privkeyfile, transfer_pin, &cb_data);
index b19a90575db9b0672fb1304e61497956cfbdcf74..d0c80b6030ff240b82c1467b73795d2a5975393a 100644 (file)
@@ -30,6 +30,8 @@
  *
  */
 
+#include "pppdconf.h"
+
 #ifndef __EAP_TLS_H__
 #define __EAP_TLS_H__
 
index 342d91f0897d341c4ddf6132c507cac2f67b1d97..9773ae2add5ac114803487bc88c5d0dd3e9d4439 100644 (file)
  * 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;
 
index 046eb1cf8436b3c91a77340c7dd25ea0d2f6b819..956b2ea895c850ab3667c20d955742a3db6a3809 100644 (file)
@@ -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
 
index 1ecd7be0d79e64007085e51763bee6b3c3f7fa6d..9570f389561ffc7daec9d0df7c8872baff8199ab 100644 (file)
  * 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"
index df6e3ca1abf2b46804999eaad19addddf6d0f8ed..162dace7e07915c62cc39198eb56be2b146dfe03 100644 (file)
@@ -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? */
index 98caf9447408d6ea4741d49f3c4e065852373bf6..7978c06c204d887e6bdce9a7ea8cb2f5fcca68ee 100644 (file)
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "pppd.h"
 
 
index c48d689eda7b0dcf40df2e0bd83c7199d66705b0..aa83e1a092b8abf28a31eb14fd85c1e5dba3eea5 100644 (file)
@@ -34,6 +34,8 @@
  *
  */
 
+#include "pppdconf.h"
+
 #ifndef __EUI64_H__
 #define __EUI64_H__
 
index 96d20e86e98db3160de9eda59033d578d8c4b6fe..17cb76f8fd11e2cd53943ff598c57e0273419dd3 100644 (file)
  * 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.
index 75a36d52fe94e9172a0578ef5491a06e2fb26344..d23725c9e7eccb31620870c2063fd3896e83ac12 100644 (file)
@@ -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.
  */
index d17dbd28a04d225cd5d5d43dc40547c3e358eb3e..6bcdf74e9410295b5353a6c144ab7b2fbf84c308 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 /*
  * TODO:
  */
index 9c4f68df2b862d8d0a28c17aa5bd741515f8dba8..52d2b22e9e6e4cdd78dbe820ef9377bc918926ba 100644 (file)
@@ -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.
index ef03e1015503220db596ef2e3045ae5eb65af0df..8ab440a95f683015bcc2226c8a759173369c203c 100644 (file)
  *   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>
index 19bc01362f8b9a69d032ffb1be15cac89abca4e7..5e1db6ba510f65d6eb6dae0bb130de5927c0cadc 100644 (file)
@@ -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 :
 
index d39b14c4848106ca26840fa58dc6b1f2c63f387a..000608deda07bb0878d51a8d3ea613a8a4bf43af 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #ifdef IPX_CHANGE
 
 /*
index 8a69232a8b06f658d3e90566391ee4fc8e007567..6112e757e9fc93ff7f1968fe9bdb5c4176c82d35 100644 (file)
@@ -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.
index ac5d5ce6488416afefde82633d969c7bc352a502..8a18e9516e0e121f019dc184fd6adabbb2b690c5 100644 (file)
  * 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>
index 984f86892fdd0f1969fae60f4bda78c861a5c731..768442d17464d7f33f53c1eca2b403fbec13d972 100644 (file)
@@ -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.
index 8e08e47ef5bb0ed528fe3fcfb269069e596af8f4..6a5a7eb28ee67cac69db337c3f833b5c0d42c45f 100644 (file)
  * 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>
index d6094db867b1e3c93c2b8cb035d290576ea024fa..b864b7bc8ddb8b4dab7eb86eea7ab4d63d01920f 100644 (file)
@@ -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 */
index 87a5d29217bb48103440c3af6e467f75854e49dd..db0aa97230c1f25cca4a6134dc2b402939cf0b94 100644 (file)
  * 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>
index 42a9b2e75d6ee09764e83e6fc99dc5f161e86ea5..88f3413c544951e77e9e60f587320c59ca52032e 100644 (file)
@@ -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
index b6fc3f561faa670f0ac1087e49242dfc832dba8a..d67daeb820b3982fbaee9aae7cc95fae07b77e60 100644 (file)
@@ -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__ */
index f7988e64141aa42b7f635cea9624967ef2f988c2..9fb3397b6fb98c32a980cb35b2847b5a4de17bf4 100644 (file)
  ***********************************************************************
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <string.h>
 #include "md5.h"
 
index 71e8b00e2dde9e481384b43866c9b0e091ac3408..662eb4126085c6f48ada54d41cea54ba7b2fd3e9 100644 (file)
  ** 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__ */
index 4f3d1313cf20abd2bff5e6396cf7c5bb7740a08a..d2ba0eba8fbd6969eacc13924b679130907e7d9f 100644 (file)
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <string.h>
 
+
 #include "pppd.h"
 #include "fsm.h"
 #include "md4.h"
index 98a89d3043e77463adc3140ee0ca48c47a661998..2684a7f6fe85801b44eb978faa5a88567a040ba5 100644 (file)
@@ -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__
 
index ddd848c3270bcba9c8dbeda4c6324fbc2151989d..6f17cf87eeb10df66e68430cab87b476c1bf6c25 100644 (file)
  * 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>
index f8d6c001e195d5b64d671b535f58e2f9be7d3cb5..0c76a6b5e1422186af9c742d3d80d2850f98f8a1 100644 (file)
  * 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>
index 30df079b0aafd733e01c9040a4c9e80b3f389122..1ecdb82b80b1de7bc6085016dbd3bcc0f3e3fd01 100644 (file)
@@ -1,2 +1 @@
-#define VERSION                "2.4.9"
 #define DATE           "5 January 2021"
index 524d608ce12c5cefed20ceafff035738434e2d31..e68d91a15f067385d215764feb233f34adab0b6f 100644 (file)
@@ -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"
 
 #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 (file)
index 0000000..cfc9164
--- /dev/null
@@ -0,0 +1,25 @@
+pppd_plugin_LTLIBRARIES = minconn.la passprompt.la passwordfd.la winbind.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+PLUGIN_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+PLUGIN_LDFLAGS = -module -avoid-version
+
+minconn_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+minconn_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+minconn_la_SOURCES = minconn.c
+
+passprompt_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+passprompt_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+passprompt_la_SOURCES = passprompt.c
+
+passwordfd_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+passwordfd_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+passwordfd_la_SOURCES = passwordfd.c
+
+winbind_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
+winbind_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+winbind_la_SOURCES = winbind.c
+
+if !SUNOS
+SUBDIRS = pppoe pppoatm pppol2tp radius
+endif
diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
deleted file mode 100644 (file)
index 0230da1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-LIBDIR = $(INSTROOT)@LIBDIR@
-INCDIR = $(INSTROOT)@INCDIR@
-VERSION = @VERSION@
-PLUGINDIR = $(LIBDIR)/pppd/$(VERSION)
-
-CFLAGS = $(COPTS) -I.. -I../../include -fPIC
-LDFLAGS_SHARED = -shared
-INSTALL        = install
-
-# EAP-TLS
-CFLAGS += -DUSE_EAPTLS=1
-
-SUBDIRS := pppoe pppoatm pppol2tp
-# Uncomment the next line to include the radius authentication plugin
-SUBDIRS += radius
-PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so
-
-# This setting should match the one in ../Makefile.linux
-MPPE=y
-
-ifdef MPPE
-CFLAGS   += -DMPPE=1
-endif
-
-# include dependencies if present
-ifeq (.depend,$(wildcard .depend))
-include .depend
-endif
-
-all:   $(PLUGINS)
-       for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
-
-%.so: %.c
-       $(CC) -o $@ $(LDFLAGS) $(LDFLAGS_SHARED) $(CFLAGS) $^
-
-install: $(PLUGINS)
-       $(INSTALL) -d $(PLUGINDIR)
-       $(INSTALL) $? $(PLUGINDIR)
-       for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install || exit $$?; done
-
-clean:
-       rm -f *.o *.so *.a
-       for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean || exit $$?; done
-
-depend:
-       $(CPP) -M $(CFLAGS) *.c >.depend
-       for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend || exit $$?; done
diff --git a/pppd/plugins/Makefile.sol2 b/pppd/plugins/Makefile.sol2
deleted file mode 100644 (file)
index bc7d85d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Makefile for plugins on Solaris 2
-#
-# $Id: Makefile.sol2,v 1.3 2002/09/07 05:15:25 carlsonj Exp $
-#
-
-include ../../Makedefs.com
-
-CFLAGS = -c -O -I.. -I../../include $(COPTS)
-LDFLAGS        = -G 
-
-all:   minconn.so
-
-minconn.so: minconn.o
-       ld -o $@ $(LDFLAGS) -h $@ minconn.o
-
-minconn.o: minconn.c
-       $(CC) $(CFLAGS) -c $? 
-
-passprompt.so: passprompt.o
-       ld -o $@ $(LDFLAGS) -h $@ passprompt.o
-
-passprompt.o: passprompt.c
-       $(CC) $(CFLAGS) -c $?
-
-clean:
-       rm -f *.o *.so
index c12216a0a7d81d55a86e424b74a3756682cbf194..40855ee1673637f565b6b19913bfd8b02f7958ba 100644 (file)
  * 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"
index ab9f390c2d1c968c8054b60e1e5da7cc81eb5e00..dae326867fcdea9b2f6190d6e01fd24fff056352 100644 (file)
@@ -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>
index c3f9793e41a01b141da91d7a5370e04dec51af83..84fd72e3b9b6994a43d112410de3312744cdf3bc 100644 (file)
@@ -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 (file)
index 0000000..66119c9
--- /dev/null
@@ -0,0 +1,18 @@
+pppd_plugin_LTLIBRARIES = pppoatm.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+noinst_HEADERS = \
+    atm.h \
+    atmres.h \
+    atmsap.h
+
+pppoatm_la_CPPFLAGS = -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/Makefile.linux b/pppd/plugins/pppoatm/Makefile.linux
deleted file mode 100644 (file)
index d333026..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#***********************************************************************
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-LIBDIR = $(INSTROOT)@LIBDIR@
-VERSION = @VERSION@
-PLUGINDIR = $(LIBDIR)/pppd/$(VERSION)
-
-CFLAGS = $(COPTS) -I../.. -I../../../include -fPIC
-LDFLAGS_SHARED = -shared
-INSTALL        = install
-
-PLUGIN := pppoatm.so
-PLUGIN_OBJS := pppoatm.o 
-
-#*******
-# Do we have the ATM libraries installed? Set HAVE_LIBATM to use them,
-# or leave it unset to build the few routines we actually _use_ into
-# the plugin directly.
-#
-#HAVE_LIBATM=yes
-
-ifdef HAVE_LIBATM
-LIBS := -latm
-else
-CFLAGS += -I.
-PLUGIN_OBJS += text2qos.o text2atm.o misc.o ans.o
-LIBS := -lresolv
-endif
-
-#*********
-all: $(PLUGIN)
-
-$(PLUGIN): $(PLUGIN_OBJS)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $^ $(LIBS)
-
-install: all
-       $(INSTALL) -d -m 755 $(PLUGINDIR)
-       $(INSTALL) -c -m 755 $(PLUGIN) $(PLUGINDIR)
-
-clean:
-       rm -f *.o *.so
-
-%.o: %.c
-       $(CC) $(CFLAGS) -c -o $@ $<
index 5a3ecd61b6a2c278781ad94151c6e92458b4f77b..dc825084fe2aa2066f4cc4f76ce292990bfc5ae5 100644 (file)
  *  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 (file)
index 0000000..9c0f0fe
--- /dev/null
@@ -0,0 +1,22 @@
+pppd_plugin_LTLIBRARIES = pppoe.la 
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+sbin_PROGRAMS = pppoe-discovery
+dist_man8_MANS = pppoe-discovery.8
+
+noinst_HEADERS = \
+    pppoe.h
+
+pppoe_la_CPPFLAGS = -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_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/include
+pppoe_discovery_SOURCES = pppoe-discovery.c debug.c
+
+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/Makefile.linux b/pppd/plugins/pppoe/Makefile.linux
deleted file mode 100644 (file)
index 3011302..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-#***********************************************************************
-#
-# Makefile
-#
-# Makefile for Roaring Penguin's Linux PPPoE plugin.
-# Modified for integration with pppd sources by Paul Mackerras.
-#
-# Copyright (C) 2001 Roaring Penguin Software Inc.
-#
-# This program may be distributed according to the terms of the GNU
-# General Public License, version 2 or (at your option) any later version.
-#
-#***********************************************************************
-
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-LIBDIR = $(INSTROOT)@LIBDIR@
-VERSION = @VERSION@
-PLUGINDIR= $(LIBDIR)/pppd/$(VERSION)
-
-INSTALL        = install
-LN_S   = ln -sf
-
-CFLAGS=$(COPTS) -I../../../include
-all: pppoe.so pppoe-discovery
-
-pppoe-discovery: pppoe-discovery.o debug.o
-       $(CC) $(LDFLAGS) -o pppoe-discovery pppoe-discovery.o debug.o
-
-pppoe-discovery.o: pppoe-discovery.c
-       $(CC) $(CFLAGS) -I../../.. -c -o pppoe-discovery.o pppoe-discovery.c
-
-debug.o: debug.c
-       $(CC) $(CFLAGS) -I../../.. -c -o debug.o debug.c
-
-pppoe.so: plugin.o discovery.o if.o common.o
-       $(CC) $(LDFLAGS) -o pppoe.so -shared plugin.o discovery.o if.o common.o
-
-install: all
-       $(INSTALL) -d -m 755 $(PLUGINDIR)
-       $(INSTALL) -c -m 755 pppoe.so $(PLUGINDIR)
-       # Symlink for backward compatibility
-       $(LN_S) pppoe.so $(PLUGINDIR)/rp-pppoe.so
-       $(INSTALL) -d -m 755 $(BINDIR)
-       $(INSTALL) -c -m 755 pppoe-discovery $(BINDIR)
-       $(INSTALL) -c -m 644 pppoe-discovery.8 $(MANDIR)
-
-clean:
-       rm -f *.o *.so pppoe-discovery
-
-plugin.o: plugin.c
-       $(CC) $(CFLAGS) -I../../.. -c -o plugin.o -fPIC plugin.c
-
-discovery.o: discovery.c
-       $(CC) $(CFLAGS) -I../../.. -c -o discovery.o -fPIC discovery.c
-
-if.o: if.c
-       $(CC) $(CFLAGS) -I../../.. -c -o if.o -fPIC if.c
-
-common.o: common.c
-       $(CC) $(CFLAGS) -I../../.. -c -o common.o -fPIC common.c
-
index 9ea7fd609c8774aafbaf2cbe9bb6a6d86679b516..638282184e4fb8e19b1ccbed6e0fb14bba4c518b 100644 (file)
 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 (file)
index a708859..0000000
+++ /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
index a6e698161a8189b1b644ce244294fdd35e6fff49..3478b5f81e27cd210283cbaa0bc89f0dadd6f270 100644 (file)
 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>
index 23089df550771f2a795c1e54b8d197b6bdc5e492..bd281bdb863b1a6be44e6c9530f99e7b6f05997e 100644 (file)
 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"
index 225dd567c2e7486c5ef3998c108ac5e8bb18afce..3dfea8c0fa20347c0c0a78c35cb386d6989b974b 100644 (file)
 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"
index de9b8166ce7bb1e982aaaacdf5f1049c3d225471..8bcd1f8d0306d372997647d0e5c9221836057919 100644 (file)
 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"
 
index e41d2863cb9bafe0e85eb321f8bd7421ad91c758..96d6333edddfd451d710dcbf78d42ecc2ee5a7e8 100644 (file)
@@ -9,6 +9,10 @@
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
index 4e1972002ed80e17d5790c0f07c1d82bb2fb1d85..5d96f0cf0c88ee197cc8732d90dce4186cf87b52 100644 (file)
@@ -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 (file)
index 0000000..999f35b
--- /dev/null
@@ -0,0 +1,13 @@
+pppd_plugin_LTLIBRARIES = pppol2tp.la openl2tp.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+noinst_HEADERS = \
+    l2tp_event.h
+
+pppol2tp_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+pppol2tp_la_LDFLAGS = -module -avoid-version
+pppol2tp_la_SOURCES = pppol2tp.c
+
+openl2tp_la_CPPFLAGS = -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/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
deleted file mode 100644 (file)
index 0aa2858..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#***********************************************************************
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-LIBDIR = $(INSTROOT)@LIBDIR@
-VERSION = @VERSION@
-PLUGINDIR = $(LIBDIR)/pppd/$(VERSION)
-
-CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC
-LDFLAGS_SHARED = -shared
-INSTALL        = install
-
-PLUGINS := pppol2tp.so openl2tp.so
-
-all: $(PLUGINS)
-
-%.so: %.o
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(LDFLAGS_SHARED) $^ $(LIBS)
-
-install: all
-       $(INSTALL) -d -m 755 $(PLUGINDIR)
-       $(INSTALL) -c -m 755 $(PLUGINS) $(PLUGINDIR)
-
-clean:
-       rm -f *.o *.so
-
-%.o: %.c
-       $(CC) $(CFLAGS) -c -o $@ $<
index 85ff0b56cdc5b839382a2f970034419c6bcb7756..0f9db6d5ecc34e268206d1b55d4205881172b0fa 100644 (file)
 
 /* pppd plugin for interfacing to openl2tpd */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
index 1be0ad25b67cb1e0dca3a6ce4832c766ecd996fe..94b2f1f947896b35422bf49b8941ae3e85c6e840 100644 (file)
  *  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 (file)
index 0000000..c3cff23
--- /dev/null
@@ -0,0 +1,64 @@
+pppd_plugin_LTLIBRARIES = radius.la radattr.la radrealms.la
+pppd_plugindir = $(PPPD_PLUGIN_DIR)
+
+noinst_LTLIBRARIES = libradiusclient.la
+dist_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_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd -DRC_LOG_FACILITY=LOG_DAEMON
+RADIUS_LDFLAGS = -module -avoid-version $(LDFLAGS)
+
+radius_la_CPPFLAGS = $(RADIUS_CPPFLAGS)
+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_CPPFLAGS = $(RADIUS_CPPFLAGS)
+radattr_la_LDFLAGS = $(RADIUS_LDFLAGS)
+radattr_la_SOURCES = radattr.c
+
+radrealms_la_CPPFLAGS = $(RADIUS_CPPFLAGS)
+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_CPPFLAGS = $(RADIUS_CPPFLAGS)
+
+if !WITH_OPENSSL
+libradiusclient_la_SOURCES += md5.c
+else
+if OPENSSL_HAVE_MD5
+libradiusclient_la_SOURCES += md5.c
+else
+libradiusclient_la_CPPFLAGS += $(OPENSSL_INCLUDES)
+endif
+endif
+
+EXTRA_DIST = \
+    $(EXTRA_FILES) \
+    $(EXTRA_ETC)
diff --git a/pppd/plugins/radius/Makefile.linux b/pppd/plugins/radius/Makefile.linux
deleted file mode 100644 (file)
index 26bacec..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# Makefile for RADIUS plugin
-#
-# Copyright 2002 Roaring Penguin Software Inc.
-#
-
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-MANDIR = $(DESTDIR)/share/man/man8
-LIBDIR = $(INSTROOT)@LIBDIR@
-VERSION = @VERSION@
-PLUGINDIR = $(LIBDIR)/pppd/$(VERSION)
-
-INSTALL        = install
-
-PLUGIN=radius.so radattr.so radrealms.so
-CFLAGS = $(COPTS) -I. -I../.. -I../../../include -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
-
-# Uncomment the next line to include support for Microsoft's
-# MS-CHAP authentication protocol.
-CHAPMS=y
-# Uncomment the next line to include support for MPPE.
-MPPE=y
-# Uncomment the next lint to include support for traffic limiting
-MAXOCTETS=y
-
-ifdef CHAPMS
-CFLAGS += -DCHAPMS=1
-ifdef MPPE
-CFLAGS += -DMPPE=1
-endif
-endif
-ifdef MAXOCTETS
-CFLAGS += -DMAXOCTETS=1
-endif
-
-all: $(PLUGIN)
-
-install: all
-       $(INSTALL) -d -m 755 $(PLUGINDIR)
-       $(INSTALL) -c -m 755 radius.so $(PLUGINDIR)
-       $(INSTALL) -c -m 755 radattr.so $(PLUGINDIR)
-       $(INSTALL) -c -m 755 radrealms.so $(PLUGINDIR)
-       $(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
-       $(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
-
-radius.so: radius.o libradiusclient.a
-       $(CC) $(LDFLAGS) -o radius.so -shared radius.o libradiusclient.a
-
-radattr.so: radattr.o
-       $(CC) $(LDFLAGS) -o radattr.so -shared radattr.o
-
-radrealms.so: radrealms.o
-       $(CC) $(LDFLAGS) -o radrealms.so -shared radrealms.o
-
-CLIENTOBJS = avpair.o buildreq.o config.o dict.o ip_util.o \
-       clientid.o sendserver.o lock.o util.o md5.o
-libradiusclient.a: $(CLIENTOBJS)
-       $(AR) rv $@ $?
-
-clean:
-       rm -f *.o *.so *.a
-
-distclean:
-       rm -f *.o *.so *.a
-
-dist-clean: distclean
index 1fe7daa551613049a783135beaabf8147b60e035..1dee313bc1cb04a84b46e4f09d86ec6735a3518e 100644 (file)
 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>
index cf4c0f2adf395d24a6f2bd72d48fb600886802e5..6ddd853db6784ae1ace9c6057830a70336b94208 100644 (file)
 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
index cd006fd0894cae2cae87ec303daf1256839cbe87..a3b9a513bb53ab93a59e25e7d01e4b4930d3cf99 100644 (file)
 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>
index 67c72f65ef3f0533e5a648bb8dda7647401f44ce..8c98e2a82972797219be4ab6c9de814caadb3e14 100644 (file)
 *
 ***********************************************************************/
 
+#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 {
index 193f8fdf5528f78feba38dd41a5bc674ae0b01db..a954d62516b94569490814227307e2564c8b2cd1 100644 (file)
  * 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"
 
index 0f71bb357b9ad9d78b483fb1d53160f4dbd06ad9..79676ca902342c7b07bb92231ef2f6ab21a19ec5 100644 (file)
@@ -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
index 6a19091c04c73fa7d2d782565f5706c7261730dd..465c1bf8617a5964c29ba68aaaa7e94e4295a043 100644 (file)
@@ -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 (file)
index 0000000..20ef104
--- /dev/null
@@ -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 (file)
index 0000000..a1eea0e
--- /dev/null
@@ -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
index 2f1c83e5552cd3afd59813e82d6b8bdf3de6294b..3d1fb6d7ccc1f912e1454eacdd10e20f2a22626d 100644 (file)
  * 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;
     }
 
index bee8c4124eafb425fd85ec01c485a92ec6504ba0..0047db6646ffe5042b7ab9389211e65db58d12c2 100644 (file)
@@ -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
index 4e51cee506c237ce2385ad3ed94003e31c9f1914..efb37bec40fe5b3ba0f0c456028cc887532f47eb 100644 (file)
  * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 /* #define SHA1HANDSOFF * Copies data before messing with it. */
 
 #include <string.h>
index 83f64df25843ac6f8bbd1bfe686a00c09ff8716a..e7e557308ee8e1f446c4295cc09d1c84bfda5e75 100644 (file)
@@ -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_ */
-
index 4df7e47592542cc126dbbda6437150e6835ddeae..56abae4fc19f7c95b359290d92f5568e7e48c84a 100644 (file)
    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>
index 967fe37457fb9a69b754c3ef50fc860d729a7963..38e7bcc6cdc3b2be41b312881bd746420acf5d97 100644 (file)
@@ -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
index 8c0e297e856084417fe488825c4a7edfb79a60bb..d59c1d3a3d267d9264555c10de86fbd94f144865 100644 (file)
  * 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>
index 2ede95f7566906a31f748e74d7021a12a7329005..8d6eee93550622d5cbe0b9803fe714c11d65b713 100644 (file)
  * 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>
index 58ad21afca7337050ab42b6eeb7c6e5c08fa792b..809b506a3640d34879fd8d9be303912bc81b5caa 100644 (file)
  * 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>
 #include <sys/ethernet.h>
 #endif
 
+#ifdef PPP_FILTER
+#include <pcap.h>
+#endif
+
 #include "pppd.h"
 #include "fsm.h"
 #include "lcp.h"
@@ -1636,33 +1644,6 @@ get_ppp_stats(int u, struct pppd_stats *stats)
     return 1;
 }
 
-#if 0
-/*
- * set_filters - transfer the pass and active filters to the kernel.
- */
-int
-set_filters(struct bpf_program *pass, struct bpf_program *active)
-{
-    int ret = 1;
-
-    if (pass->bf_len > 0) {
-       if (strioctl(pppfd, PPPIO_PASSFILT, pass,
-                    sizeof(struct bpf_program), 0) < 0) {
-           error("Couldn't set pass-filter in kernel: %m");
-           ret = 0;
-       }
-    }
-    if (active->bf_len > 0) {
-       if (strioctl(pppfd, PPPIO_ACTIVEFILT, active,
-                    sizeof(struct bpf_program), 0) < 0) {
-           error("Couldn't set active-filter in kernel: %m");
-           ret = 0;
-       }
-    }
-    return ret;
-}
-#endif
-
 /*
  * ccp_fatal_error - returns 1 if decompression was disabled as a
  * result of an error detected after decompression of a packet,
index bdc58288da023b489983b994b1cc53b126de6e97..8a563f88b9a62b8aedc2ea504f8f8b22afdddb95 100644 (file)
  * 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>
index 153b6e99232b32f08d0b6f2deabecfc150e57620..418bd8d9d3496d4b4ef90223e908f98abf463eba 100644 (file)
@@ -1,3 +1,5 @@
+#include "pppdconf.h"
+
 #ifndef __TDB_H__
 #define __TDB_H__
 
index 852cee700ac2d6811a9dfad81665defd1566238d..41328fbaacdbb202c68a80a4f75b1e8887a85506 100644 (file)
  * 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>
index 0ae02888281d9eb069763442a862def2025e6b93..1fcff0904b1d9961814db0a8341b4940e8001201 100644 (file)
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 /*
  * TODO:
  */
index 99b007fe816abb547842479716078b3984991080..709cd6294ffd2bf216799da3284518bea0238a2c 100644 (file)
@@ -1,3 +1,5 @@
+#include "pppdconf.h"
+
 /*
  * upap.h - User/Password Authentication Protocol definitions.
  *
index f81c8cf7a118470d9bac799561d31af6b740836c..d66df1ff5bf88f7c04d1333b039c35b906033b6b 100644 (file)
  * 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>
diff --git a/pppdump/Makefile.am b/pppdump/Makefile.am
new file mode 100644 (file)
index 0000000..2df7e0e
--- /dev/null
@@ -0,0 +1,9 @@
+sbin_PROGRAMS = pppdump
+dist_man8_MANS = pppdump.8
+
+pppdump_SOURCES = pppdump.c bsd-comp.c deflate.c zlib.c
+pppdump_CFLAGS = -I${top_srcdir}/include/net
+
+noinst_HEADERS = \
+    ppp-comp.h \
+    zlib.h
diff --git a/pppdump/Makefile.linux b/pppdump/Makefile.linux
deleted file mode 100644 (file)
index 1c58151..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-
-CFLAGS = $(COPTS) -I../include/net
-OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
-
-INSTALL= install
-
-all:   pppdump
-
-pppdump: $(OBJS)
-       $(CC) $(LDFLAGS) -o pppdump $(OBJS)
-
-clean:
-       rm -f pppdump $(OBJS) *~
-
-install:
-       mkdir -p $(BINDIR) $(MANDIR)
-       $(INSTALL) -c pppdump $(BINDIR)
-       $(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
diff --git a/pppdump/Makefile.sol2 b/pppdump/Makefile.sol2
deleted file mode 100644 (file)
index e9196f6..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# pppdump Makefile for SVR4 systems
-# $Id: Makefile.sol2,v 1.4 2002/09/07 05:15:25 carlsonj Exp $
-#
-
-include ../Makedefs.com
-
-CFLAGS= $(COPTS) -I../include/net
-OBJS = pppdump.o bsd-comp.o deflate.o zlib.o
-
-all:   pppdump
-
-pppdump: $(OBJS)
-       $(CC) -o pppdump $(OBJS)
-
-clean:
-       rm -f $(OBJS) pppdump *~
-
-install:
-       $(INSTALL) -f $(BINDIR) pppdump
-       $(INSTALL) -m 444 -f $(MANDIR)/man8 pppdump.8
diff --git a/pppstats/Makefile.am b/pppstats/Makefile.am
new file mode 100644 (file)
index 0000000..d7d74e0
--- /dev/null
@@ -0,0 +1,14 @@
+sbin_PROGRAMS = pppstats
+dist_man8_MANS = pppstats.8
+
+pppstats_SOURCES = pppstats.c
+pppstats_CFLAGS =
+pppstats_CPPFLAGS =
+
+if LINUX
+pppstats_CFLAGS += -I${top_srcdir}/include
+endif
+
+if SUNOS
+pppstats_CPPFLAGS += -DSTREAMS
+endif
diff --git a/pppstats/Makefile.linux b/pppstats/Makefile.linux
deleted file mode 100644 (file)
index 743ffaf..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# pppstats makefile
-#
-CROSS_COMPILE=@CROSS_COMPILE@
-CC=$(CROSS_COMPILE)@CC@
-COPTS=@CFLAGS@
-
-PREFIX = @DESTDIR@
-DESTDIR = $(INSTROOT)$(PREFIX)
-BINDIR = $(DESTDIR)/sbin
-MANDIR = $(DESTDIR)/share/man/man8
-
-PPPSTATSRCS = pppstats.c
-PPPSTATOBJS = pppstats.o
-
-COMPILE_FLAGS = -I../include
-LIBS =
-
-INSTALL= install
-
-CFLAGS = $(COPTS) $(COMPILE_FLAGS)
-
-all: pppstats
-
-install: pppstats
-       -mkdir -p $(MANDIR)
-       $(INSTALL) -c pppstats $(BINDIR)
-       $(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
-
-pppstats: $(PPPSTATSRCS)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o pppstats pppstats.c $(LIBS)
-
-clean:
-       rm -f pppstats *~ #* core
-
-depend:
-       cpp -M $(CFLAGS) $(PPPSTATSRCS) >.depend
-#      makedepend $(CFLAGS) $(PPPSTATSRCS)
diff --git a/pppstats/Makefile.sol2 b/pppstats/Makefile.sol2
deleted file mode 100644 (file)
index e0093a5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# pppstats Makefile for SVR4 systems
-# $Id: Makefile.sol2,v 1.10 2002/09/07 05:15:25 carlsonj Exp $
-#
-
-include ../Makedefs.com
-
-CFLAGS = -DSTREAMS -I../include $(COPTS)
-
-all: pppstats
-
-pppstats: pppstats.c
-       $(CC) $(CFLAGS) -o pppstats pppstats.c
-
-install: pppstats
-       $(INSTALL) -f $(BINDIR) pppstats
-       $(INSTALL) -m 444 -f $(MANDIR)/man8 pppstats.8
-
-clean:
-       rm -f pppstats *~ core
index 92ebc2a4e007284f2a050f5b007cf5ac378a7dd8..cbea00b6d71268a1838ffd11428618c217a19cdc 100644 (file)
@@ -235,7 +235,7 @@ strioctl(int fd, int cmd, char *ptr, int ilen, int olen)
 static void
 get_ppp_stats(struct ppp_stats *curp)
 {
-    if (strioctl(s, PPPIO_GETSTAT, curp, 0, sizeof(*curp)) < 0) {
+    if (strioctl(s, PPPIO_GETSTAT, (char*) curp, 0, sizeof(*curp)) < 0) {
        fprintf(stderr, "%s: ", progname);
        if (errno == EINVAL)
            fprintf(stderr, "kernel support missing\n");
@@ -248,7 +248,7 @@ get_ppp_stats(struct ppp_stats *curp)
 static void
 get_ppp_cstats(struct ppp_comp_stats *csp)
 {
-    if (strioctl(s, PPPIO_GETCSTAT, csp, 0, sizeof(*csp)) < 0) {
+    if (strioctl(s, PPPIO_GETCSTAT, (char*) csp, 0, sizeof(*csp)) < 0) {
        fprintf(stderr, "%s: ", progname);
        if (errno == ENOTTY) {
            fprintf(stderr, "no kernel compression support\n");
@@ -539,7 +539,7 @@ main(int argc, char *argv[])
        perror(dev);
        exit(1);
     }
-    if (strioctl(s, PPPIO_ATTACH, &unit, sizeof(int), 0) < 0) {
+    if (strioctl(s, PPPIO_ATTACH, (char*) &unit, sizeof(int), 0) < 0) {
        fprintf(stderr, "%s: ppp%d is not available\n", progname, unit);
        exit(1);
     }
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644 (file)
index 0000000..0fadd48
--- /dev/null
@@ -0,0 +1,32 @@
+EXTRA_CHATCHAT = \
+    chatchat/chatchat.c \
+    chatchat/README
+
+EXTRA_SCRIPTS = \
+    autopppd \
+    callback \
+    chatchat \
+    ip-down.local.add \
+    ip-up.local.add \
+    ipv6-down.sample \
+    ipv6-up.sample \
+    options-rsh-loc \
+    options-rsh-rem \
+    options-ssh-loc \
+    options-ssh-rem \
+    plog \
+    poff \
+    pon \
+    pon.1 \
+    ppp-off \
+    ppp-on \
+    ppp-on-dialer \
+    ppp-on-rsh \
+    ppp-on-ssh \
+    README \
+    redialer \
+    secure-card
+
+EXTRA_DIST= \
+    $(EXTRA_CHATCHAT) \
+    $(EXTRA_SCRIPTS)