X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fpathnames.h;h=a33f0466c9d6d7e86e17316e0672477fd31228aa;hp=524d608ce12c5cefed20ceafff035738434e2d31;hb=HEAD;hpb=c58bf2e8023dd846683f09cb00e15d64143dac8c diff --git a/pppd/pathnames.h b/pppd/pathnames.h index 524d608..d08e8ef 100644 --- a/pppd/pathnames.h +++ b/pppd/pathnames.h @@ -1,70 +1,137 @@ /* - * define path names + * pathnames.h - define default paths for pppd + * + * Copyright (c) 1999-2002 Paul Mackerras. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. The name(s) of the authors of this software must not be used to + * endorse or promote products derived from this software without + * prior written permission. + * + * 3. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Paul Mackerras + * ". + * + * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* + * Paths are controlled by configure. Typically, one would pass the following options + * to configure: + * ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var + * + * Note that if the prefix variable do control all the other directory variables, e.g + * sysconfdir is ${prefix}/etc. Setting prefix to /usr, you'll have to override + * sysconfdir with /etc to avoid installing config files into /usr/etc. + * + * In addition, there are three explicit variables that has overrides via configure: + * - PPPD_RUNTIME_DIR, set by --with-runtime-dir= + * - PPPD_LOGFILE_DIR, set by --with-logfile-dir= + * - PPPD_PLUGIN_DIR, set by --with-plugin-dir= + */ +#ifndef PPP_PATHNAMES_H +#define PPP_PATHNAMES_H + +#include "pppdconf.h" + #ifdef HAVE_PATHS_H #include +#endif /* HAVE_PATHS_H */ -#else /* HAVE_PATHS_H */ -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/etc/ppp/" +#ifndef _PATH_DEVNULL +#define _PATH_DEVNULL "/dev/null" #endif -#define _PATH_DEVNULL "/dev/null" -#endif /* HAVE_PATHS_H */ -#ifndef _ROOT_PATH -#define _ROOT_PATH +#define PPP_DEVNULL _PATH_DEVNULL + +/* + * PPPD_RUNTIME_DIR is set by passing --with-runtime-dir= via configure + * the default value set by configure when option is absent is ${localstatedir}/run/pppd + */ +#ifdef PPPD_RUNTIME_DIR +#define PPP_PATH_VARRUN PPPD_RUNTIME_DIR +#else +#define PPP_PATH_VARRUN _PATH_VARRUN +#endif + +/* + * PPPD_LOGFILE_DIR is set by passing --with-logfile-dir= via configure + * the default value set by configure when option is absent is ${localstatedir}/log/ppp + */ +#ifdef PPPD_LOGFILE_DIR +#define PPP_PATH_VARLOG PPPD_LOGFILE_DIR +#else +#define PPP_PATH_VARLOG _PATH_VARRUN "/log/ppp" #endif -#define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets" -#define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets" -#define _PATH_SRPFILE _ROOT_PATH "/etc/ppp/srp-secrets" - -#ifdef USE_EAPTLS -#define _PATH_EAPTLSCLIFILE _ROOT_PATH "/etc/ppp/eaptls-client" -#define _PATH_EAPTLSSERVFILE _ROOT_PATH "/etc/ppp/eaptls-server" -#define _PATH_OPENSSLCONFFILE _ROOT_PATH "/etc/ppp/openssl.cnf" -#endif /* USE_EAPTLS */ - -#define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options" -#define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up" -#define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down" -#define _PATH_IPPREUP _ROOT_PATH "/etc/ppp/ip-pre-up" -#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_PEERFILES _ROOT_PATH "/etc/ppp/peers/" -#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf" - -#define _PATH_USEROPT ".ppprc" -#define _PATH_PSEUDONYM ".ppp_pseudonym" - -#ifdef INET6 -#define _PATH_IPV6UP _ROOT_PATH "/etc/ppp/ipv6-up" -#define _PATH_IPV6DOWN _ROOT_PATH "/etc/ppp/ipv6-down" +/* + * PPPD_PLUGIN_DIR is set by passing --with-plugin-dir= via configure + * the default value set by configure when option is absent is ${libdir}/pppd/${version} + */ +#ifdef PPPD_PLUGIN_DIR +#define PPP_PATH_PLUGIN PPPD_PLUGIN_DIR +#endif /* PPPD_PLUGIN_DIR */ + +#define PPP_PATH_CONFDIR SYSCONFDIR "/ppp" + +#define PPP_PATH_UPAPFILE PPP_PATH_CONFDIR "/pap-secrets" +#define PPP_PATH_CHAPFILE PPP_PATH_CONFDIR "/chap-secrets" +#define PPP_PATH_SRPFILE PPP_PATH_CONFDIR "/srp-secrets" + +#ifdef PPP_WITH_EAPTLS +#define PPP_PATH_EAPTLSCLIFILE PPP_PATH_CONFDIR "/eaptls-client" +#define PPP_PATH_EAPTLSSERVFILE PPP_PATH_CONFDIR "/eaptls-server" +#define PPP_PATH_OPENSSLCONFFILE PPP_PATH_CONFDIR "/openssl.cnf" +#endif /* PPP_WITH_EAPTLS */ + +#define PPP_PATH_SYSOPTIONS PPP_PATH_CONFDIR "/options" +#define PPP_PATH_IPUP PPP_PATH_CONFDIR "/ip-up" +#define PPP_PATH_IPDOWN PPP_PATH_CONFDIR "/ip-down" +#define PPP_PATH_IPPREUP PPP_PATH_CONFDIR "/ip-pre-up" +#define PPP_PATH_AUTHUP PPP_PATH_CONFDIR "/auth-up" +#define PPP_PATH_AUTHDOWN PPP_PATH_CONFDIR "/auth-down" +#define PPP_PATH_TTYOPT PPP_PATH_CONFDIR "/options." +#define PPP_PATH_PEERFILES PPP_PATH_CONFDIR "/peers/" +#define PPP_PATH_RESOLV PPP_PATH_CONFDIR "/resolv.conf" + +#define PPP_PATH_NET_INIT PPP_PATH_CONFDIR "/net-init" +#define PPP_PATH_NET_PREUP PPP_PATH_CONFDIR "/net-pre-up" +#define PPP_PATH_NET_DOWN PPP_PATH_CONFDIR "/net-down" + +#define PPP_PATH_CONNERRS PPP_PATH_VARLOG "/connect-errors" + +#define PPP_PATH_USEROPT ".ppprc" +#define PPP_PATH_PSEUDONYM ".ppp_pseudonym" + +#ifdef PPP_WITH_IPV6CP +#define PPP_PATH_IPV6UP PPP_PATH_CONFDIR "/ipv6-up" +#define PPP_PATH_IPV6DOWN PPP_PATH_CONFDIR "/ipv6-down" #endif -#ifdef IPX_CHANGE -#define _PATH_IPXUP _ROOT_PATH "/etc/ppp/ipx-up" -#define _PATH_IPXDOWN _ROOT_PATH "/etc/ppp/ipx-down" -#endif /* IPX_CHANGE */ +#define PPP_PATH_PPPDB PPP_PATH_VARRUN "/pppd2.tdb" -#ifdef __STDC__ -#define _PATH_PPPDB _ROOT_PATH _PATH_VARRUN "pppd2.tdb" -#else /* __STDC__ */ -#ifdef HAVE_PATHS_H -#define _PATH_PPPDB "/var/run/pppd2.tdb" +#ifdef __linux__ +#define PPP_PATH_LOCKDIR "/var/lock" +#else +#ifdef SVR4 +#define PPP_PATH_LOCKDIR "/var/spool/locks" #else -#define _PATH_PPPDB "/etc/ppp/pppd2.tdb" +#define PPP_PATH_LOCKDIR "/var/spool/lock" +#endif #endif -#endif /* __STDC__ */ -#ifdef PLUGIN -#ifdef __STDC__ -#define _PATH_PLUGIN DESTDIR "/lib/pppd/" VERSION -#else /* __STDC__ */ -#define _PATH_PLUGIN "/usr/lib/pppd" -#endif /* __STDC__ */ -#endif /* PLUGIN */ +#endif /* PPP_PATHNAMES_H */