Merge pull request #366 from pali/rtnetlink-register
[ppp.git] / pppd / pathnames.h
1 /*
2  * pathnames.h - define default paths for pppd
3  *
4  * Copyright (c) 1999-2002 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. The name(s) of the authors of this software must not be used to
14  *    endorse or promote products derived from this software without
15  *    prior written permission.
16  *
17  * 3. Redistributions of any form whatsoever must retain the following
18  *    acknowledgment:
19  *    "This product includes software developed by Paul Mackerras
20  *     <paulus@samba.org>".
21  *
22  * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
23  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
24  * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
25  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
28  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29  */
30
31 /*
32  * Paths are controlled by configure. Typically, one would pass the following options
33  * to configure:
34  *    ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
35  *
36  * Note that if the prefix variable do control all the other directory variables, e.g
37  * sysconfdir is ${prefix}/etc. Setting prefix to /usr, you'll have to override
38  * sysconfdir with /etc to avoid installing config files into /usr/etc.
39  *
40  * In addition, there are three explicit variables that has overrides via configure:
41  * - PPPD_RUNTIME_DIR, set by --with-runtime-dir=<dir>
42  * - PPPD_LOGFILE_DIR, set by --with-logfile-dir=<dir>
43  * - PPPD_PLUGIN_DIR, set by --with-plugin-dir=<dir>
44  */
45 #ifndef PPP_PATHNAMES_H
46 #define PPP_PATHNAMES_H
47
48 #include "pppdconf.h"
49
50 #ifdef HAVE_PATHS_H
51 #include <paths.h>
52 #endif /* HAVE_PATHS_H */
53
54 #ifndef _PATH_DEVNULL
55 #define _PATH_DEVNULL           "/dev/null"
56 #endif
57
58 #define PPP_DEVNULL             _PATH_DEVNULL
59
60 /*
61  * PPPD_RUNTIME_DIR is set by passing --with-runtime-dir=<path> via configure
62  *    the default value set by configure when option is absent is ${localstatedir}/run/pppd
63  */
64 #ifdef PPPD_RUNTIME_DIR
65 #define PPP_PATH_VARRUN         PPPD_RUNTIME_DIR
66 #else
67 #define PPP_PATH_VARRUN         _PATH_VARRUN
68 #endif
69
70 /*
71  * PPPD_LOGFILE_DIR is set by passing --with-logfile-dir=<path> via configure
72  *    the default value set by configure when option is absent is ${localstatedir}/log/ppp
73  */
74 #ifdef PPPD_LOGFILE_DIR
75 #define PPP_PATH_VARLOG         PPPD_LOGFILE_DIR
76 #else
77 #define PPP_PATH_VARLOG         _PATH_VARRUN "/log/ppp"
78 #endif
79
80 /*
81  * PPPD_PLUGIN_DIR is set by passing --with-plugin-dir=<path> via configure
82  *    the default value set by configure when option is absent is ${libdir}/pppd/${version}
83  */
84 #ifdef PPPD_PLUGIN_DIR
85 #define PPP_PATH_PLUGIN         PPPD_PLUGIN_DIR
86 #endif /* PPPD_PLUGIN_DIR */
87
88 #define PPP_PATH_CONFDIR        SYSCONFDIR "/ppp"
89
90 #define PPP_PATH_UPAPFILE       PPP_PATH_CONFDIR "/pap-secrets"
91 #define PPP_PATH_CHAPFILE       PPP_PATH_CONFDIR "/chap-secrets"
92 #define PPP_PATH_SRPFILE        PPP_PATH_CONFDIR "/srp-secrets"
93
94 #ifdef PPP_WITH_EAPTLS
95 #define PPP_PATH_EAPTLSCLIFILE  PPP_PATH_CONFDIR "/eaptls-client"
96 #define PPP_PATH_EAPTLSSERVFILE PPP_PATH_CONFDIR "/eaptls-server"
97 #define PPP_PATH_OPENSSLCONFFILE PPP_PATH_CONFDIR "/openssl.cnf"
98 #endif /* PPP_WITH_EAPTLS */
99
100 #define PPP_PATH_SYSOPTIONS     PPP_PATH_CONFDIR "/options"
101 #define PPP_PATH_IPUP           PPP_PATH_CONFDIR "/ip-up"
102 #define PPP_PATH_IPDOWN         PPP_PATH_CONFDIR "/ip-down"
103 #define PPP_PATH_IPPREUP        PPP_PATH_CONFDIR "/ip-pre-up"
104 #define PPP_PATH_AUTHUP         PPP_PATH_CONFDIR "/auth-up"
105 #define PPP_PATH_AUTHDOWN       PPP_PATH_CONFDIR "/auth-down"
106 #define PPP_PATH_TTYOPT         PPP_PATH_CONFDIR "/options."
107 #define PPP_PATH_PEERFILES      PPP_PATH_CONFDIR "/peers/"
108 #define PPP_PATH_RESOLV         PPP_PATH_CONFDIR "/resolv.conf"
109
110 #define PPP_PATH_CONNERRS       PPP_PATH_VARLOG  "/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        PPP_PATH_VARRUN  "/lock"
124 #else
125 #ifdef SVR4
126 #define PPP_PATH_LOCKDIR        LOCALSTATEDIR "/spool/locks"
127 #else
128 #define PPP_PATH_LOCKDIR        LOCALSTATEDIR "/spool/lock"
129 #endif
130 #endif
131
132
133 #endif /* PPP_PATHNAMES_H */