]> git.ozlabs.org Git - ppp.git/commitdiff
Fix include paths for plugins to use the public API of pppd
authorEivind Næss <eivnaes@yahoo.com>
Tue, 10 Aug 2021 23:38:45 +0000 (16:38 -0700)
committerEivind Næss <eivnaes@yahoo.com>
Fri, 15 Jul 2022 22:25:39 +0000 (15:25 -0700)
This change does a few different things.
 * Projects that needs #include "config.h" should use a config.h.in for the project generated by configure in the project's local directory.
 * All projects will use #include <pppd/pppd.h>, and Makefile will add -I${top_srcdir} to the appropriate *_CPPFLAGS variable.
 * The inclusion of <pppd/pppdconf.h> will set the presidence for all features enabled/disabled in pppd
 * Plugins will now need to use PPPD_VERSION as it conflicts with VERSION from config.h generated by autotools for third party packages

Currently, only pppoe require the use of config.h to correctly set the defines for which header files and so on was detected by configure

Other projects only needed to include <pppd/pppd.h> (and maybe a few other header files), a future change will fixup <pppd/pppd.h> to include features as needed such that it's the only needed include for a plugin. This will avoid littering the code with #ifdef/#endif constructs.

BREAKING CHANGE!

pppd/pppd.h no longer provide VERSION, third party packages are required to switch to use PPPD_VERSION. This is to avoid conflict with a source package's own VERSION as set by autotools / config.h. Also, the use of PPP_VERSION conflicts with public header files from Glibc/Linux kernel.

Example:

   char pppd_version[] = PPPD_VERSION;

pppd will load plugins, and also look for the symbol "pppd_version" to validate that the plugin was built for the current version of pppd.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
28 files changed:
.gitignore
configure.ac
pppd/plugins/Makefile.am
pppd/plugins/minconn.c
pppd/plugins/passprompt.c
pppd/plugins/passwordfd.c
pppd/plugins/pppoatm/Makefile.am
pppd/plugins/pppoatm/pppoatm.c
pppd/plugins/pppoe/Makefile.am
pppd/plugins/pppoe/common.c
pppd/plugins/pppoe/config.h.in [new file with mode: 0644]
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
pppd/plugins/pppol2tp/openl2tp.c
pppd/plugins/pppol2tp/pppol2tp.c
pppd/plugins/radius/Makefile.am
pppd/plugins/radius/includes.h
pppd/plugins/radius/md5.c
pppd/plugins/radius/radattr.c
pppd/plugins/radius/radius.c
pppd/plugins/radius/radiusclient.h
pppd/plugins/radius/radrealms.c
pppd/plugins/winbind.c
pppd/pppdconf.h.in

index 133a3dfea3cdf9a61e0302896bb27c78c10628e4..c80a008c9ea7916e2a7d29a89745a56eb4ac4417 100644 (file)
@@ -35,6 +35,8 @@ autom4te.cache
 /pppd/config.h
 /pppd/config.h.in
 /pppd/pppdconf.h
+/pppd/plugins/pppoe/config.h
+/pppd/plugins/pppoe/stamp-h3
 
 # https://www.gnu.org/software/libtool/
 /libtool
index ae69aa7f45d0de93f2e5d6b74e2bf8a1d57afb60..a6cf82916c4a72751d6e89a8abf58b3975cabe70 100644 (file)
@@ -11,7 +11,7 @@ AM_MAINTAINER_MODE([enable])
 
 AC_LANG(C)
 AC_CONFIG_SRCDIR([pppd/main.c])
-AC_CONFIG_HEADERS([pppd/config.h pppd/pppdconf.h])
+AC_CONFIG_HEADERS([pppd/config.h pppd/pppdconf.h pppd/plugins/pppoe/config.h])
 
 # Checks for programs.
 AC_PROG_CC
@@ -305,6 +305,7 @@ if test "x${with_gtk}" = "xyes"; then
 fi
 AM_CONDITIONAL([WITH_GTK], test "x${with_gtk}" = "xyes")
 
+AC_DEFINE_UNQUOTED(PPPD_VERSION, "$VERSION", [Version of pppd])
 
 AC_CONFIG_FILES([
     Makefile
index cfc9164bcd27cd2056f73ebd97059bc652e56f18..292daf222e80a7b946d4dc732867ef713afda87d 100644 (file)
@@ -1,7 +1,7 @@
 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_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
 PLUGIN_LDFLAGS = -module -avoid-version
 
 minconn_la_CPPFLAGS = $(PLUGIN_CPPFLAGS)
index 40855ee1673637f565b6b19913bfd8b02f7958ba..82bef4890931ea2ad496e43f50752b5017ecd68d 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"
+#include <pppd/pppd.h>
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 static int minconnect = 0;
 
index 06d9ff2197c9f89a080f4186d2c57c792b67b916..7cd0a2bfe1cbac8a0f29a23b0c2319c1c0080497 100644 (file)
@@ -9,17 +9,13 @@
  *  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>
 #include <syslog.h>
-#include "pppd.h"
+#include <pppd/pppd.h>
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 static char promptprog[PATH_MAX+1];
 static int promptprog_refused = 0;
index 9a0cd822fa96a8a4f80c4a14eb862b89892ac6fd..6f8bc6f0be78265838f8f5733833f4c974fe7e82 100644 (file)
@@ -7,18 +7,14 @@
  *  with pap- and chap-secrets files.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #include <stdio.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
 
-#include "pppd.h"
+#include <pppd/pppd.h>
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 static int passwdfd = -1;
 static char save_passwd[MAXSECRETLEN];
index 66119c95b271aa511fab8d2f23f2c837a848aca7..478aa962e34886f32f736c5b097d4733f1465ea7 100644 (file)
@@ -6,7 +6,7 @@ noinst_HEADERS = \
     atmres.h \
     atmsap.h
 
-pppoatm_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+pppoatm_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
 pppoatm_la_LDFLAGS = -module -avoid-version
 pppoatm_la_SOURCES = pppoatm.c
 
index 09cd0b8bfb0142524d12c15971f8e13844e7e6b0..cb482449fd9ae03686d4d7710b7b021f89d6fc97 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>
-#include "pppd.h"
-#include "pathnames.h"
-#include "fsm.h" /* Needed for lcp.h to include cleanly */
-#include "lcp.h"
 #include <atm.h>
 #include <linux/atmdev.h>
 #include <linux/atmppp.h>
 #include <net/if.h>
 #include <sys/ioctl.h>
 
-const char pppd_version[] = VERSION;
+#include <pppd/pppd.h>
+#include <pppd/pathnames.h>
+#include <pppd/fsm.h> /* Needed for lcp.h to include cleanly */
+#include <pppd/lcp.h>
+
+
+const char pppd_version[] = PPPD_VERSION;
 
 static struct sockaddr_atmpvc pvcaddr;
 static char *qosstr = NULL;
index 0d70380a13893385dafcacc9aa8cd4b70505f62e..ce25cd653777f170cbca4d71555b3c2f7cd8b855 100644 (file)
@@ -6,7 +6,7 @@ dist_man8_MANS = pppoe-discovery.8
 noinst_HEADERS = \
     pppoe.h
 
-pppoe_la_CPPFLAGS = -I${top_srcdir} -I${top_srcdir}/include
+pppoe_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
 pppoe_la_LDFLAGS = -module -avoid-version
 pppoe_la_SOURCES = plugin.c discovery.c if.c common.c
 
index 9ddbcbd47f3202045c01141f9157f422840d77e8..31811f59a9fbf3af05d79ff94f698ed5d7a0d321 100644 (file)
@@ -17,12 +17,12 @@ 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>
+#include "config.h"
 #endif
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
-#include "pppd/pppd.h"
+#include <pppd/pppd.h>
 
 #include <string.h>
 #include <errno.h>
diff --git a/pppd/plugins/pppoe/config.h.in b/pppd/plugins/pppoe/config.h.in
new file mode 100644 (file)
index 0000000..0c4d9da
--- /dev/null
@@ -0,0 +1,56 @@
+/* pppd/config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <asm/types.h> header file. */
+#undef HAVE_ASM_TYPES_H
+
+/* Define to 1 if you have the <linux/if_ether.h> header file. */
+#undef HAVE_LINUX_IF_ETHER_H
+
+/* Define to 1 if you have the <linux/if.h> header file. */
+#undef HAVE_LINUX_IF_H
+
+/* Define to 1 if you have the <linux/if_packet.h> header file. */
+#undef HAVE_LINUX_IF_PACKET_H
+
+/* Define to 1 if you have the <net/if_arp.h> header file. */
+#undef HAVE_NET_IF_ARP_H
+
+/* Define to 1 if you have the <net/if_types.h> header file. */
+#undef HAVE_NET_IF_TYPES_H
+
+/* Define to 1 if you have the <netinet/if_ether.h> header file. */
+#undef HAVE_NETINET_IF_ETHER_H
+
+/* Define to 1 if you have the <netpacket/packet.h> header file. */
+#undef HAVE_NETPACKET_PACKET_H
+
+/* Define to 1 if you have the <net/bpf.h> header file. */
+#undef HAVE_NET_BPF_H
+
+/* Define to 1 if you have the <net/if.h> header file. */
+#undef HAVE_NET_IF_H
+
+/* Define to 1 if you have the <sys/dlpi.h> header file. */
+#undef HAVE_SYS_DLPI_H
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* The size of `unsigned int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_INT
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* The size of `unsigned short', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_SHORT
+
index b32b0c891dcd89c5fb46ebe402adc698f9a0611f..a5c2c62fdc383738edf8d5edb65101a6cc5b3b98 100644 (file)
@@ -12,14 +12,14 @@ 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>
+#include "config.h"
 #endif
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
-#include "pppd/pppd.h"
-#include "pppd/fsm.h"
-#include "pppd/lcp.h"
+#include <pppd/pppd.h>
+#include <pppd/fsm.h>
+#include <pppd/lcp.h>
 
 #include <string.h>
 #include <stdlib.h>
index 3dfea8c0fa20347c0c0a78c35cb386d6989b974b..a3c384815ce2552055a152169293062af073b697 100644 (file)
@@ -17,12 +17,12 @@ 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>
+#include "config.h"
 #endif
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
-#include "pppd/pppd.h"
+#include <pppd/pppd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index c53450752b7c481fda436891622ebdac2cdc9c6b..8443c920584d25be61e6aa5cdcb966c71fd45364 100644 (file)
@@ -26,19 +26,12 @@ 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>
+#include "config.h"
 #endif
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
 
-#include "pppd/pppd.h"
-#include "pppd/fsm.h"
-#include "pppd/lcp.h"
-#include "pppd/ipcp.h"
-#include "pppd/ccp.h"
-/* #include "pppd/pathnames.h" */
-
 #include <linux/types.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
@@ -54,13 +47,20 @@ static char const RCSID[] =
 #include <linux/ppp_defs.h>
 #include <linux/if_pppox.h>
 
+#include <pppd/pppd.h>
+#include <pppd/fsm.h>
+#include <pppd/lcp.h>
+#include <pppd/ipcp.h>
+#include <pppd/ccp.h>
+/* #include <pppd/pathnames.h> ?, see below ... */
+
 #ifndef _ROOT_PATH
 #define _ROOT_PATH ""
 #endif
 
 #define _PATH_ETHOPT         _ROOT_PATH "/etc/ppp/options."
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 /* From sys-linux.c in pppd -- MUST FIX THIS! */
 extern int new_style_driver;
@@ -427,7 +427,7 @@ plugin_init(void)
 
     add_options(Options);
 
-    info("PPPoE plugin from pppd %s", VERSION);
+    info("PPPoE plugin from pppd %s", PPPD_VERSION);
 }
 
 void pppoe_check_options(void)
index 10f51dc975dbd9df1a851ca056f586770e09aa8d..4e2a5f2b7edea8edefd8d3089c11275d222ebf5c 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif
 
 #include <stdarg.h>
@@ -207,7 +207,7 @@ int main(int argc, char *argv[])
                        optarg, strerror(errno));
                exit(1);
            }
-           fprintf(debugFile, "pppoe-discovery from pppd %s\n", VERSION);
+           fprintf(debugFile, "pppoe-discovery from pppd %s\n", PPPD_VERSION);
            break;
        case 'I':
            conn->ifName = xstrdup(optarg);
@@ -269,5 +269,5 @@ usage(void)
            "   -U             -- Use Host-Unique to allow multiple PPPoE sessions.\n"
            "   -W hexvalue    -- Set the Host-Unique to the supplied hex string.\n"
            "   -h             -- Print usage information.\n");
-    fprintf(stderr, "\npppoe-discovery from pppd " VERSION "\n");
+    fprintf(stderr, "\npppoe-discovery from pppd " PPPD_VERSION "\n");
 }
index 26e14f5d9f4fade2857887b4ee600e39abce00fa..1517e34f61ba07870113beff724885e654ef4d60 100644 (file)
@@ -18,7 +18,7 @@
 #include <ctype.h>
 #include <string.h>
 
-#include "pppd/pppd.h"         /* For error */
+#include <pppd/pppd.h>         /* For error */
 
 /* How do we access raw Ethernet devices? */
 #undef USE_LINUX_PACKET
index 999f35b3b1881454e9d56f38703351679b6fcf79..c109d22e52f59217908aa0b20f750b36a857c162 100644 (file)
@@ -4,10 +4,10 @@ pppd_plugindir = $(PPPD_PLUGIN_DIR)
 noinst_HEADERS = \
     l2tp_event.h
 
-pppol2tp_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+pppol2tp_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
 pppol2tp_la_LDFLAGS = -module -avoid-version
 pppol2tp_la_SOURCES = pppol2tp.c
 
-openl2tp_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd
+openl2tp_la_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}
 openl2tp_la_LDFLAGS = -module -avoid-version
 openl2tp_la_SOURCES = openl2tp.c
index 0f9db6d5ecc34e268206d1b55d4205881172b0fa..2ba870716f62a3908f3b9098bdff4ac104e7c656 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>
 #include <errno.h>
-#include "pppd.h"
-#include "pathnames.h"
-#include "fsm.h"
-#include "lcp.h"
-#include "ccp.h"
-#include "ipcp.h"
+
 #include <sys/stat.h>
 #include <net/if.h>
 #include <sys/ioctl.h>
 #include <linux/version.h>
 #include <linux/sockios.h>
 
+#include <pppd/pppd.h>
+#include <pppd/pathnames.h>
+#include <pppd/fsm.h>
+#include <pppd/lcp.h>
+#include <pppd/ccp.h>
+#include <pppd/ipcp.h>
+
+
 #ifndef aligned_u64
 /* should be defined in sys/types.h */
 #define aligned_u64 unsigned long long __attribute__((aligned(8)))
@@ -63,7 +62,7 @@ extern void (*pppol2tp_send_accm_hook)(int tunnel_id, int session_id,
                                       uint32_t send_accm, uint32_t recv_accm);
 extern void (*pppol2tp_ip_updown_hook)(int tunnel_id, int session_id, int up);
 
-const char pppd_version[] = VERSION;
+const char pppd_version[] = PPPD_VERSION;
 
 static int openl2tp_fd = -1;
 
index c9902afed2f8e24f79cb3c688ad495b01d989876..c1eaa9afeb88e23df5ecdc52fd51ca21cb1e0aa9 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>
 #include <errno.h>
-#include "pppd.h"
-#include "pathnames.h"
-#include "fsm.h"
-#include "lcp.h"
-#include "ccp.h"
-#include "ipcp.h"
 #include <sys/stat.h>
 #include <net/if.h>
 #include <sys/ioctl.h>
 #include <signal.h>
 #include <linux/version.h>
 #include <linux/sockios.h>
+
 #ifndef aligned_u64
 /* should be defined in sys/types.h */
 #define aligned_u64 unsigned long long __attribute__((aligned(8)))
 #endif
+
 #include <linux/types.h>
 #include <linux/if_ether.h>
 #include <linux/ppp_defs.h>
 #include <linux/if_pppox.h>
 #include <linux/if_pppol2tp.h>
 
+#include <pppd/pppd.h>
+#include <pppd/pathnames.h>
+#include <pppd/fsm.h>
+#include <pppd/lcp.h>
+#include <pppd/ccp.h>
+#include <pppd/ipcp.h>
+
+
 /* should be added to system's socket.h... */
 #ifndef SOL_PPPOL2TP
 #define SOL_PPPOL2TP   273
 #endif
 
-const char pppd_version[] = VERSION;
+const char pppd_version[] = PPPD_VERSION;
 
 static int setdevname_pppol2tp(char **argv);
 
index c3cff2347b4d77e157c37fc5ecc7a521c8f47580..b9f9e146804a593a1c48c9fec0c7ca41a3af0e41 100644 (file)
@@ -25,7 +25,7 @@ EXTRA_ETC = \
     etc/realms \
     etc/servers
 
-RADIUS_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir}/pppd -DRC_LOG_FACILITY=LOG_DAEMON
+RADIUS_CPPFLAGS = -I${top_srcdir}/include -I${top_srcdir} -DRC_LOG_FACILITY=LOG_DAEMON
 RADIUS_LDFLAGS = -module -avoid-version $(LDFLAGS)
 
 radius_la_CPPFLAGS = $(RADIUS_CPPFLAGS)
index f48d9b741e133c506bc5d1e46d0999ac47f264a2..1e6d87a9173086202eb9fb32b6ea678e8abe3f09 100644 (file)
@@ -47,7 +47,7 @@
 
 #include <time.h>
 
-#include "magic.h"
+#include <pppd/magic.h>
 
 /* rlib/lock.c */
 int do_lock_exclusive(int);
index 8af03aa3713e922302a7c9e289e093a82a669f51..8acfb38c49a3a9e791f87ceccb9eedcabd067cbc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $Id: md5.c,v 1.1 2004/11/14 07:26:26 paulus Exp $
  */
-#include "md5.h"
+#include <pppd/md5.h>
 
 void rc_md5_calc (unsigned char *output, unsigned char *input, unsigned int inlen)
 {
index f6a787424afc4fc304f605fb02467b4d055d9700..16f7fba0f1b1680bf986971ee9818291dd50367c 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>
-#include <sys/types.h>
 #include <sys/stat.h>
+#include <pppd/pppd.h>
+
+#include "radiusclient.h"
 
 extern void (*radius_attributes_hook)(VALUE_PAIR *);
 static void print_attributes(VALUE_PAIR *);
 static void cleanup(void *opaque, int arg);
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 /**********************************************************************
 * %FUNCTION: plugin_init
index 968cf4422e4c1e74d9c89bc9de7f60099c84408c..d89fdd1e8c8c9b498ea5d25cca7e3187f6f8f4d7 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 PPP_WITH_CHAPMS
-#include "chap_ms.h"
-#ifdef PPP_WITH_MPPE
-#include "mppe.h"
-#include "md5.h"
-#endif
-#endif
-#include "radiusclient.h"
-#include "fsm.h"
-#include "ipcp.h"
 #include <syslog.h>
 #include <sys/types.h>
 #include <sys/time.h>
@@ -49,6 +33,20 @@ static char const RCSID[] =
 #include <netinet/in.h>
 #include <stdlib.h>
 
+#include <pppd/pppd.h>
+#include <pppd/chap-new.h>
+#ifdef PPP_WITH_CHAPMS
+#include <pppd/chap_ms.h>
+#ifdef PPP_WITH_MPPE
+#include <pppd/mppe.h>
+#include <pppd/md5.h>
+#endif
+#endif
+#include <pppd/fsm.h>
+#include <pppd/ipcp.h>
+
+#include "radiusclient.h"
+
 #define BUF_LEN 1024
 
 #define MD5_HASH_SIZE  16
@@ -140,7 +138,7 @@ void (*radius_pre_auth_hook)(char const *user,
 
 static struct radius_state rstate;
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 /**********************************************************************
 * %FUNCTION: plugin_init
index 87e6e0a3c8d22ede405570375ca9520f1d43b54c..96449be22cab468abb3ba695fe9f2f93296e8adb 100644 (file)
 #ifndef RADIUSCLIENT_H
 #define RADIUSCLIENT_H
 
-#include       <sys/types.h>
-#include       <stdio.h>
-#include       <time.h>
-#include "pppd.h"
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+#include <pppd/pppd.h>
 
 #ifndef _UINT4_T
 /* This works for all machines that Linux runs on... */
index a3b9a513bb53ab93a59e25e7d01e4b4930d3cf99..493af0322f7d412ed67170174492e782fe94002e 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>
 #include <string.h>
 #include <stdlib.h>
+#include <pppd/pppd.h>
+
+#include "radiusclient.h"
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 char radrealms_config[MAXPATHLEN] = "/etc/radiusclient/realms";
 
index 59ab9bd82152b283fd1cfb77851c7f96ee5cc883..71c0d038fbaa4e852ddfd90a3c7d0fae72e5c54f 100644 (file)
 *
 ***********************************************************************/
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "pppd.h"
-#include "chap-new.h"
-#include "chap_ms.h"
-#include "fsm.h"
-#include "ipcp.h"
-#include "mppe.h"
 #include <syslog.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <ctype.h>
 
+#include <pppd/pppd.h>
+#include <pppd/chap-new.h>
+#include <pppd/chap_ms.h>
+#include <pppd/fsm.h>
+#include <pppd/ipcp.h>
+#include <pppd/mppe.h>
+
 #define BUF_LEN 1024
 
 #define NOT_AUTHENTICATED 0
@@ -104,7 +101,7 @@ static int winbind_chap_verify(char *user, char *ourname, int id,
                               char *message, int message_space);
 static int winbind_allowed_address(u_int32_t addr); 
 
-char pppd_version[] = VERSION;
+char pppd_version[] = PPPD_VERSION;
 
 /**********************************************************************
 * %FUNCTION: plugin_init
index bb3a58c09a443bf6e88d271a229fd874e82ed593..5cdcf5b366f0c9884a771f885b0207dd7b3af084 100644 (file)
@@ -57,5 +57,5 @@
 /* Use included sha included with pppd */
 #undef USE_SHA
 
-/* Version number of package */
-#undef VERSION
+/* The pppd version */
+#undef PPPD_VERSION