| 1 |
/* |
| 2 |
* pathnames.h - define default paths for pppd |
| 3 |
* |
| 4 |
* Copyright (c) 1999-2024 Paul Mackerras. All rights reserved. |
| 5 |
* |
| 6 |
* Redistribution and use in source and binary forms, with or without |
| 7 |
* modification, are permitted provided that the following conditions |
| 8 |
* are met: |
| 9 |
* |
| 10 |
* 1. Redistributions of source code must retain the above copyright |
| 11 |
* notice, this list of conditions and the following disclaimer. |
| 12 |
* |
| 13 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 14 |
* notice, this list of conditions and the following disclaimer in |
| 15 |
* the documentation and/or other materials provided with the |
| 16 |
* distribution. |
| 17 |
* |
| 18 |
* THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO |
| 19 |
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
| 20 |
* AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY |
| 21 |
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 22 |
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN |
| 23 |
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING |
| 24 |
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 25 |
*/ |
| 26 |
|
| 27 |
/* |
| 28 |
* Paths are controlled by configure. Typically, one would pass the following options |
| 29 |
* to configure: |
| 30 |
* ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var |
| 31 |
* |
| 32 |
* Note that if the prefix variable do control all the other directory variables, e.g |
| 33 |
* sysconfdir is ${prefix}/etc. Setting prefix to /usr, you'll have to override |
| 34 |
* sysconfdir with /etc to avoid installing config files into /usr/etc. |
| 35 |
* |
| 36 |
* In addition, there are three explicit variables that has overrides via configure: |
| 37 |
* - PPPD_RUNTIME_DIR, set by --with-runtime-dir=<dir> |
| 38 |
* - PPPD_LOGFILE_DIR, set by --with-logfile-dir=<dir> |
| 39 |
* - PPPD_PLUGIN_DIR, set by --with-plugin-dir=<dir> |
| 40 |
*/ |
| 41 |
#ifndef PPP_PATHNAMES_H |
| 42 |
#define PPP_PATHNAMES_H |
| 43 |
|
| 44 |
#include "pppdconf.h" |
| 45 |
|
| 46 |
#ifdef HAVE_PATHS_H |
| 47 |
#include <paths.h> |
| 48 |
#endif /* HAVE_PATHS_H */ |
| 49 |
|
| 50 |
#ifndef _PATH_DEVNULL |
| 51 |
#define _PATH_DEVNULL "/dev/null" |
| 52 |
#endif |
| 53 |
|
| 54 |
#define PPP_DEVNULL _PATH_DEVNULL |
| 55 |
|
| 56 |
/* |
| 57 |
* PPPD_RUNTIME_DIR is set by passing --with-runtime-dir=<path> via configure |
| 58 |
* the default value set by configure when option is absent is ${localstatedir}/run/pppd |
| 59 |
*/ |
| 60 |
#ifdef PPPD_RUNTIME_DIR |
| 61 |
#define PPP_PATH_VARRUN PPPD_RUNTIME_DIR |
| 62 |
#else |
| 63 |
#define PPP_PATH_VARRUN _PATH_VARRUN |
| 64 |
#endif |
| 65 |
|
| 66 |
/* |
| 67 |
* PPPD_LOGFILE_DIR is set by passing --with-logfile-dir=<path> via configure |
| 68 |
* the default value set by configure when option is absent is ${localstatedir}/log/ppp |
| 69 |
*/ |
| 70 |
#ifdef PPPD_LOGFILE_DIR |
| 71 |
#define PPP_PATH_VARLOG PPPD_LOGFILE_DIR |
| 72 |
#else |
| 73 |
#define PPP_PATH_VARLOG _PATH_VARRUN "/log/ppp" |
| 74 |
#endif |
| 75 |
|
| 76 |
/* |
| 77 |
* PPPD_PLUGIN_DIR is set by passing --with-plugin-dir=<path> via configure |
| 78 |
* the default value set by configure when option is absent is ${libdir}/pppd/${version} |
| 79 |
*/ |
| 80 |
#ifdef PPPD_PLUGIN_DIR |
| 81 |
#define PPP_PATH_PLUGIN PPPD_PLUGIN_DIR |
| 82 |
#endif /* PPPD_PLUGIN_DIR */ |
| 83 |
|
| 84 |
#define PPP_PATH_CONFDIR SYSCONFDIR "/ppp" |
| 85 |
|
| 86 |
#define PPP_PATH_UPAPFILE PPP_PATH_CONFDIR "/pap-secrets" |
| 87 |
#define PPP_PATH_CHAPFILE PPP_PATH_CONFDIR "/chap-secrets" |
| 88 |
#define PPP_PATH_SRPFILE PPP_PATH_CONFDIR "/srp-secrets" |
| 89 |
|
| 90 |
#ifdef PPP_WITH_EAPTLS |
| 91 |
#define PPP_PATH_EAPTLSCLIFILE PPP_PATH_CONFDIR "/eaptls-client" |
| 92 |
#define PPP_PATH_EAPTLSSERVFILE PPP_PATH_CONFDIR "/eaptls-server" |
| 93 |
#define PPP_PATH_OPENSSLCONFFILE PPP_PATH_CONFDIR "/openssl.cnf" |
| 94 |
#endif /* PPP_WITH_EAPTLS */ |
| 95 |
|
| 96 |
#define PPP_PATH_SYSOPTIONS PPP_PATH_CONFDIR "/options" |
| 97 |
#define PPP_PATH_IPUP PPP_PATH_CONFDIR "/ip-up" |
| 98 |
#define PPP_PATH_IPDOWN PPP_PATH_CONFDIR "/ip-down" |
| 99 |
#define PPP_PATH_IPPREUP PPP_PATH_CONFDIR "/ip-pre-up" |
| 100 |
#define PPP_PATH_AUTHUP PPP_PATH_CONFDIR "/auth-up" |
| 101 |
#define PPP_PATH_AUTHDOWN PPP_PATH_CONFDIR "/auth-down" |
| 102 |
#define PPP_PATH_TTYOPT PPP_PATH_CONFDIR "/options." |
| 103 |
#define PPP_PATH_PEERFILES PPP_PATH_CONFDIR "/peers/" |
| 104 |
#define PPP_PATH_RESOLV PPP_PATH_CONFDIR "/resolv.conf" |
| 105 |
|
| 106 |
#define PPP_PATH_NET_INIT PPP_PATH_CONFDIR "/net-init" |
| 107 |
#define PPP_PATH_NET_PREUP PPP_PATH_CONFDIR "/net-pre-up" |
| 108 |
#define PPP_PATH_NET_DOWN PPP_PATH_CONFDIR "/net-down" |
| 109 |
|
| •110 |
#define PPP_PATH_CONNERRS PPP_PATH_VARLOG "/ppp-connect-errors" |
| 111 |
|
| 112 |
#define PPP_PATH_USEROPT ".ppprc" |
| 113 |
#define PPP_PATH_PSEUDONYM ".ppp_pseudonym" |
| 114 |
|
| 115 |
#ifdef PPP_WITH_IPV6CP |
| 116 |
#define PPP_PATH_IPV6UP PPP_PATH_CONFDIR "/ipv6-up" |
| 117 |
#define PPP_PATH_IPV6DOWN PPP_PATH_CONFDIR "/ipv6-down" |
| 118 |
#endif |
| 119 |
|
| 120 |
#define PPP_PATH_PPPDB PPP_PATH_VARRUN "/pppd2.tdb" |
| 121 |
|
| 122 |
#ifdef __linux__ |
| 123 |
#define PPP_PATH_LOCKDIR "/var/lock" |
| 124 |
#else |
| 125 |
#ifdef SVR4 |
| 126 |
#define PPP_PATH_LOCKDIR "/var/spool/locks" |
| 127 |
#else |
| 128 |
#define PPP_PATH_LOCKDIR "/var/spool/lock" |
| 129 |
#endif |
| 130 |
#endif |
| 131 |
|
| 132 |
|
| 133 |
#endif /* PPP_PATHNAMES_H */ |