#include <systemd/sd-daemon.h>
#endif
-#include "pppd.h"
+#include "pppd-private.h"
+#include "options.h"
#include "fsm.h"
#include "lcp.h"
#include "ccp.h"
#include "ecp.h"
#include "ipcp.h"
#include "upap.h"
-#include "chap-new.h"
+#include "chap.h"
#include "eap.h"
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
#include "eap-tls.h"
#endif
-#ifdef CBCP_SUPPORT
+#ifdef PPP_WITH_CBCP
#include "cbcp.h"
#endif
+#include "multilink.h"
#include "pathnames.h"
#include "session.h"
int (*idle_time_hook)(struct ppp_idle *) = NULL;
/* Hook for a plugin to say whether we can possibly authenticate any peer */
-int (*pap_check_hook)(void) = NULL;
+pap_check_hook_fn *pap_check_hook = NULL;
/* Hook for a plugin to check the PAP user and password */
-int (*pap_auth_hook)(char *user, char *passwd, char **msgp,
- struct wordlist **paddrs,
- struct wordlist **popts) = NULL;
+pap_auth_hook_fn *pap_auth_hook = NULL;
/* Hook for a plugin to know about the PAP user logout */
-void (*pap_logout_hook)(void) = NULL;
+pap_logout_hook_fn *pap_logout_hook = NULL;
/* Hook for a plugin to get the PAP password for authenticating us */
-int (*pap_passwd_hook)(char *user, char *passwd) = NULL;
+pap_passwd_hook_fn *pap_passwd_hook = NULL;
/* Hook for a plugin to say if we can possibly authenticate a peer using CHAP */
-int (*chap_check_hook)(void) = NULL;
+chap_check_hook_fn *chap_check_hook = NULL;
/* Hook for a plugin to get the CHAP password for authenticating us */
-int (*chap_passwd_hook)(char *user, char *passwd) = NULL;
+chap_passwd_hook_fn *chap_passwd_hook = NULL;
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
/* Hook for a plugin to get the EAP-TLS password for authenticating us */
-int (*eaptls_passwd_hook)(char *user, char *passwd) = NULL;
+eaptls_passwd_hook_fn *eaptls_passwd_hook = NULL;
#endif
/* Hook for a plugin to say whether it is OK if the peer
int (*allowed_address_hook)(u_int32_t addr) = NULL;
-#ifdef HAVE_MULTILINK
-/* Hook for plugin to hear when an interface joins a multilink bundle */
-void (*multilink_join_hook)(void) = NULL;
-#endif
-
/* A notifier for when the peer has authenticated itself,
and we are proceeding to the network phase. */
struct notifier *auth_up_notifier = NULL;
bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */
bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */
bool refuse_eap = 0; /* Don't wanna auth. ourselves with EAP */
-#ifdef CHAPMS
+#ifdef PPP_WITH_CHAPMS
bool refuse_mschap = 0; /* Don't wanna auth. ourselves with MS-CHAP */
bool refuse_mschap_v2 = 0; /* Don't wanna auth. ourselves with MS-CHAPv2 */
#else
bool explicit_passwd = 0; /* Set if "password" option supplied */
char remote_name[MAXNAMELEN]; /* Peer's name for authentication */
-#if defined(USE_EAPTLS) || defined(USE_PEAP)
+#if defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP)
char *cacert_file = NULL; /* CA certificate file (pem format) */
char *ca_path = NULL; /* Directory with CA certificates */
char *crl_dir = NULL; /* Directory containing CRL files */
bool tls_verify_key_usage = 0; /* Verify peer certificate key usage */
#endif
-#if defined(USE_EAPTLS)
+#if defined(PPP_WITH_EAPTLS)
char *cert_file = NULL; /* Client certificate file (pem format) */
char *privkey_file = NULL; /* Client private key file (pem format) */
char *pkcs12_file = NULL; /* Client private key envelope file (pkcs12 format) */
static int have_srp_secret(char *client, char *server, int need_ip,
int *lacks_ipp);
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
static int have_eaptls_secret_server
(char *client, char *server, int need_ip, int *lacks_ipp);
static int have_eaptls_secret_client (char *client, char *server);
static int set_permitted_number (char **);
static void check_access (FILE *, char *);
static int wordlist_count (struct wordlist *);
-
-#ifdef MAXOCTETS
static void check_maxoctets (void *);
-#endif
/*
* Authentication-related options.
*/
-option_t auth_options[] = {
+struct option auth_options[] = {
{ "auth", o_bool, &auth_required,
"Require authentication from peer", OPT_PRIO | 1 },
{ "noauth", o_bool, &auth_required,
"Require CHAP authentication from peer",
OPT_ALIAS | OPT_PRIOSUB | OPT_A2OR | MDTYPE_MD5,
&lcp_wantoptions[0].chap_mdtype },
-#ifdef CHAPMS
+#ifdef PPP_WITH_CHAPMS
{ "require-mschap", o_bool, &auth_required,
"Require MS-CHAP authentication from peer",
OPT_PRIOSUB | OPT_A2OR | MDTYPE_MICROSOFT,
"Don't allow CHAP authentication with peer",
OPT_ALIAS | OPT_A2CLRB | MDTYPE_MD5,
&lcp_allowoptions[0].chap_mdtype },
-#ifdef CHAPMS
+#ifdef PPP_WITH_CHAPMS
{ "refuse-mschap", o_bool, &refuse_mschap,
"Don't agree to auth to peer with MS-CHAP",
OPT_A2CLRB | MDTYPE_MICROSOFT,
"Set telephone number(s) which are allowed to connect",
OPT_PRIV | OPT_A2LIST },
-#if defined(USE_EAPTLS) || defined(USE_PEAP)
+#if defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP)
{ "ca", o_string, &cacert_file, "CA certificate in PEM format" },
{ "capath", o_string, &ca_path, "TLS CA certificate directory" },
{ "crl-dir", o_string, &crl_dir, "Use CRLs in directory" },
"Verify peer by method (none|subject|name|suffix)" },
#endif
-#if defined(USE_EAPTLS)
+#if defined(PPP_WITH_EAPTLS)
{ "cert", o_string, &cert_file, "client certificate in PEM format" },
{ "key", o_string, &privkey_file, "client private key in PEM format" },
{ "pkcs12", o_string, &pkcs12_file, "EAP-TLS client credentials in PKCS12 format" },
{ "need-peer-eap", o_bool, &need_peer_eap,
"Require the peer to authenticate us", 1 },
-#endif
+#endif /* PPP_WITH_EAPTLS */
{ NULL }
};
+const char *
+ppp_remote_name()
+{
+ return remote_name;
+}
+
+const char *
+ppp_get_remote_number(void)
+{
+ return remote_number;
+}
+
+void
+ppp_set_remote_number(const char *buf)
+{
+ if (buf) {
+ strlcpy(remote_number, buf, sizeof(remote_number));
+ }
+}
+
+const char *
+ppp_peer_authname(char *buf, size_t bufsz)
+{
+ if (buf && bufsz > 0) {
+ strlcpy(buf, peer_authname, bufsz);
+ return buf;
+ }
+ return peer_authname;
+}
+
/*
* setupapfile - specifies UPAP info for authenticating with peer.
*/
novm("+ua file name");
euid = geteuid();
if (seteuid(getuid()) == -1) {
- option_error("unable to reset uid before opening %s: %m", fname);
+ ppp_option_error("unable to reset uid before opening %s: %m", fname);
free(fname);
return 0;
}
if (seteuid(euid) == -1)
fatal("unable to regain privileges: %m");
if (ufile == NULL) {
- option_error("unable to open user login data file %s", fname);
+ ppp_option_error("unable to open user login data file %s", fname);
free(fname);
return 0;
}
if (fgets(u, MAXNAMELEN - 1, ufile) == NULL
|| fgets(p, MAXSECRETLEN - 1, ufile) == NULL) {
fclose(ufile);
- option_error("unable to read user login data file %s", fname);
+ ppp_option_error("unable to read user login data file %s", fname);
free(fname);
return 0;
}
g = getgrnam(*argv);
if (g == 0) {
- option_error("group %s is unknown", *argv);
+ ppp_option_error("group %s is unknown", *argv);
return 0;
}
for (i = 0; i < ngroups; ++i) {
*/
void start_link(int unit)
{
- status = EXIT_CONNECT_FAILED;
+ ppp_set_status(EXIT_CONNECT_FAILED);
new_phase(PHASE_SERIALCONN);
hungup = 0;
*/
fd_ppp = the_channel->establish_ppp(devfd);
if (fd_ppp < 0) {
- status = EXIT_FATAL_ERROR;
+ ppp_set_status(EXIT_FATAL_ERROR);
goto disconnect;
}
* incoming events (reply, timeout, etc.).
*/
if (ifunit >= 0)
- notice("Connect: %s <--> %s", ifname, ppp_devnam);
+ notice("Connect: %s <--> %s", ifname, ppp_devname);
else
- notice("Starting negotiation on %s", ppp_devnam);
+ notice("Starting negotiation on %s", ppp_devname);
add_fd(fd_ppp);
- status = EXIT_NEGOTIATION_FAILED;
+ ppp_set_status(EXIT_NEGOTIATION_FAILED);
new_phase(PHASE_ESTABLISH);
lcp_lowerup(0);
void
link_terminated(int unit)
{
- if (phase == PHASE_DEAD || phase == PHASE_MASTER)
+ if (in_phase(PHASE_DEAD) || in_phase(PHASE_MASTER))
return;
new_phase(PHASE_DISCONNECT);
}
session_end(devnam);
- if (!doing_multilink) {
+ if (!mp_on()) {
notice("Connection terminated.");
print_link_stats();
} else
* can happen that another pppd gets the same unit and then
* we delete its pid file.
*/
- if (!doing_multilink && !demand)
+ if (!demand && !mp_on())
remove_pidfiles();
-
/*
* If we may want to bring the link up again, transfer
* the ppp unit back to the loopback. Set the
remove_fd(fd_ppp);
clean_check();
the_channel->disestablish_ppp(devfd);
- if (doing_multilink)
+ if (mp_on())
mp_exit_bundle();
fd_ppp = -1;
}
if (!hungup)
lcp_lowerdown(0);
- if (!doing_multilink && !demand)
- script_unsetenv("IFNAME");
+ if (!mp_on() && !demand)
+ ppp_script_unsetenv("IFNAME");
/*
* Run disconnector script, if requested.
if (the_channel->cleanup)
(*the_channel->cleanup)();
- if (doing_multilink && multilink_master) {
+ if (mp_on() && mp_master()) {
if (!bundle_terminating) {
new_phase(PHASE_MASTER);
if (master_detach && !detached)
notify(link_down_notifier, 0);
auth_state = s_down;
if (auth_script_state == s_up && auth_script_pid == 0) {
- update_link_stats(unit);
+ ppp_get_link_stats(NULL);
auth_script_state = s_down;
- auth_script(_PATH_AUTHDOWN);
+ auth_script(PPP_PATH_AUTHDOWN);
}
}
- if (!doing_multilink) {
+ if (!mp_on())
+ {
upper_layers_down(unit);
- if (phase != PHASE_DEAD && phase != PHASE_MASTER)
+ if (!in_phase(PHASE_DEAD) && !in_phase(PHASE_MASTER))
new_phase(PHASE_ESTABLISH);
}
/* XXX if doing_multilink, should do something to stop
lcp_options *wo = &lcp_wantoptions[unit];
lcp_options *go = &lcp_gotoptions[unit];
lcp_options *ho = &lcp_hisoptions[unit];
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
lcp_options *ao = &lcp_allowoptions[unit];
#endif
int i;
/*
* Tell higher-level protocols that LCP is up.
*/
- if (!doing_multilink) {
+ if (!mp_on())
for (i = 0; (protp = protocols[i]) != NULL; ++i)
if (protp->protocol != PPP_LCP && protp->enabled_flag
&& protp->lowerup != NULL)
(*protp->lowerup)(unit);
- }
-
if (!auth_required && noauth_addrs != NULL)
set_allowed_addrs(unit, NULL, NULL);
set_allowed_addrs(unit, NULL, NULL);
} else if (!wo->neg_upap || uselogin || !null_login(unit)) {
warn("peer refused to authenticate: terminating link");
- status = EXIT_PEER_AUTH_FAILED;
+ ppp_set_status(EXIT_PEER_AUTH_FAILED);
lcp_close(unit, "peer refused to authenticate");
return;
}
}
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
if (need_peer_eap && !ao->neg_eap) {
warn("eap required to authenticate us but no suitable secrets");
lcp_close(unit, "couldn't negotiate eap");
- status = EXIT_AUTH_TOPEER_FAILED;
+ ppp_set_status(EXIT_AUTH_TOPEER_FAILED);
return;
}
if (need_peer_eap && !ho->neg_eap) {
warn("peer doesn't want to authenticate us with eap");
lcp_close(unit, "couldn't negotiate eap");
- status = EXIT_PEER_AUTH_FAILED;
+ ppp_set_status(EXIT_PEER_AUTH_FAILED);
return;
}
#endif
auth_state = s_up;
if (auth_script_state == s_down && auth_script_pid == 0) {
auth_script_state = s_up;
- auth_script(_PATH_AUTHUP);
+ auth_script(PPP_PATH_AUTHUP);
}
}
-#ifdef CBCP_SUPPORT
+#ifdef PPP_WITH_CBCP
/*
* If we negotiated callback, do it now.
*/
new_phase(PHASE_NETWORK);
-#ifdef HAVE_MULTILINK
+#ifdef PPP_WITH_MULTILINK
if (multilink) {
if (mp_join_bundle()) {
if (multilink_join_hook)
return;
}
}
-#endif /* HAVE_MULTILINK */
+#endif /* PPP_WITH_MULTILINK */
-#ifdef PPP_FILTER
+#ifdef PPP_WITH_FILTER
if (!demand)
set_filters(&pass_filter, &active_filter);
#endif
/*
* Authentication failure: take the link down
*/
- status = EXIT_PEER_AUTH_FAILED;
+ ppp_set_status(EXIT_PEER_AUTH_FAILED);
lcp_close(unit, "Authentication failed");
}
case CHAP_MD5:
bit |= CHAP_MD5_PEER;
break;
-#ifdef CHAPMS
+#ifdef PPP_WITH_CHAPMS
case CHAP_MICROSOFT:
bit |= CHAP_MS_PEER;
break;
namelen = sizeof(peer_authname) - 1;
BCOPY(name, peer_authname, namelen);
peer_authname[namelen] = 0;
- script_setenv("PEERNAME", peer_authname, 0);
+ ppp_script_setenv("PEERNAME", peer_authname, 0);
/* Save the authentication method for later. */
auth_done[unit] |= bit;
* is no point in persisting without any way to get updated
* authentication secrets.
*/
- status = EXIT_AUTH_TOPEER_FAILED;
+ ppp_set_status(EXIT_AUTH_TOPEER_FAILED);
lcp_close(unit, "Failed to authenticate ourselves to peer");
}
case CHAP_MD5:
bit |= CHAP_MD5_WITHPEER;
break;
-#ifdef CHAPMS
+#ifdef PPP_WITH_CHAPMS
case CHAP_MICROSOFT:
bit |= CHAP_MS_WITHPEER;
break;
/*
* At this point we consider that the link has come up successfully.
*/
- status = EXIT_OK;
+ ppp_set_status(EXIT_OK);
unsuccess = 0;
new_phase(PHASE_RUNNING);
if (idle_time_hook != 0)
tlim = (*idle_time_hook)(NULL);
else
- tlim = idle_time_limit;
+ tlim = ppp_get_max_idle_time();
if (tlim > 0)
TIMEOUT(check_idle, NULL, tlim);
* Set a timeout to close the connection once the maximum
* connect time has expired.
*/
- if (maxconnect > 0)
- TIMEOUT(connect_time_expired, 0, maxconnect);
+ if (ppp_get_max_connect_time() > 0)
+ TIMEOUT(connect_time_expired, 0, ppp_get_max_connect_time());
-#ifdef MAXOCTETS
+ /*
+ * Configure a check to see if session has outlived it's limit
+ * in terms of octets
+ */
if (maxoctets > 0)
TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
-#endif
/*
* Detach now, if the updetach option was given.
if (--num_np_up == 0) {
UNTIMEOUT(check_idle, NULL);
UNTIMEOUT(connect_time_expired, NULL);
-#ifdef MAXOCTETS
UNTIMEOUT(check_maxoctets, NULL);
-#endif
new_phase(PHASE_NETWORK);
}
}
}
}
-#ifdef MAXOCTETS
+/*
+ * Periodic callback to check if session has reached its limit. The period defaults
+ * to 1 second and is configurable by setting "mo-timeout" in configuration
+ */
static void
check_maxoctets(void *arg)
{
- unsigned int used;
-
- update_link_stats(ifunit);
- link_stats_valid=0;
-
- switch(maxoctets_dir) {
- case PPP_OCTETS_DIRECTION_IN:
- used = link_stats.bytes_in;
- break;
- case PPP_OCTETS_DIRECTION_OUT:
- used = link_stats.bytes_out;
- break;
- case PPP_OCTETS_DIRECTION_MAXOVERAL:
- case PPP_OCTETS_DIRECTION_MAXSESSION:
- used = (link_stats.bytes_in > link_stats.bytes_out) ? link_stats.bytes_in : link_stats.bytes_out;
- break;
- default:
- used = link_stats.bytes_in+link_stats.bytes_out;
- break;
+ unsigned int used = 0;
+ ppp_link_stats_st stats;
+
+ if (ppp_get_link_stats(&stats)) {
+ switch(maxoctets_dir) {
+ case PPP_OCTETS_DIRECTION_IN:
+ used = stats.bytes_in;
+ break;
+ case PPP_OCTETS_DIRECTION_OUT:
+ used = stats.bytes_out;
+ break;
+ case PPP_OCTETS_DIRECTION_MAXOVERAL:
+ case PPP_OCTETS_DIRECTION_MAXSESSION:
+ used = (stats.bytes_in > stats.bytes_out)
+ ? stats.bytes_in
+ : stats.bytes_out;
+ break;
+ default:
+ used = stats.bytes_in+stats.bytes_out;
+ break;
+ }
}
+
if (used > maxoctets) {
notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used);
- status = EXIT_TRAFFIC_LIMIT;
+ ppp_set_status(EXIT_TRAFFIC_LIMIT);
lcp_close(0, "Traffic limit");
+ link_stats_print = 0;
need_holdoff = 0;
} else {
TIMEOUT(check_maxoctets, NULL, maxoctets_timeout);
}
}
-#endif
/*
* check_idle - check whether the link has been idle for long
tlim = idle_time_hook(&idle);
} else {
itime = MIN(idle.xmit_idle, idle.recv_idle);
- tlim = idle_time_limit - itime;
+ tlim = ppp_get_max_idle_time() - itime;
}
if (tlim <= 0) {
/* link is idle: shut it down. */
notice("Terminating connection due to lack of activity.");
- status = EXIT_IDLE_TIMEOUT;
+ ppp_set_status(EXIT_IDLE_TIMEOUT);
lcp_close(0, "Link inactive");
need_holdoff = 0;
} else {
connect_time_expired(void *arg)
{
info("Connect time expired");
- status = EXIT_CONNECT_TIME;
+ ppp_set_status(EXIT_CONNECT_TIME);
lcp_close(0, "Connect time expired"); /* Close connection */
}
/* Default our_name to hostname, and user to our_name */
if (our_name[0] == 0 || usehostname)
- strlcpy(our_name, hostname, sizeof(our_name));
+ strlcpy(our_name, hostname, sizeof(our_name));
+
/* If a blank username was explicitly given as an option, trust
the user and don't use our_name */
if (user[0] == 0 && !explicit_user)
strlcpy(user, our_name, sizeof(user));
+#if defined(SYSTEM_CA_PATH) && (defined(PPP_WITH_EAPTLS) || defined(PPP_WITH_PEAP))
+ /* Use system default for CA Path if not specified */
+ if (!ca_path) {
+ ca_path = SYSTEM_CA_PATH;
+ }
+#endif
+
/*
* If we have a default route, require the peer to authenticate
* unless the noauth option was given or the real user is root.
our_name, 1, &lacks_ip);
}
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
if (!can_auth && wo->neg_eap) {
can_auth =
have_eaptls_secret_server((explicit_remote ? remote_name :
if (auth_required && !can_auth && noauth_addrs == NULL) {
if (default_auth) {
- option_error(
+ ppp_option_error(
"By default the remote system is required to authenticate itself");
- option_error(
+ ppp_option_error(
"(because this system has a default route to the internet)");
} else if (explicit_remote)
- option_error(
+ ppp_option_error(
"The remote system (%s) is required to authenticate itself",
remote_name);
else
- option_error(
+ ppp_option_error(
"The remote system is required to authenticate itself");
- option_error(
+ ppp_option_error(
"but I couldn't find any suitable secret (password) for it to use to do so.");
if (lacks_ip)
- option_error(
+ ppp_option_error(
"(None of the available passwords would let it use an IP address.)");
exit(1);
(hadchap == 1 || (hadchap == -1 && have_chap_secret(user,
(explicit_remote? remote_name: NULL), 0, NULL))) ||
have_srp_secret(user, (explicit_remote? remote_name: NULL), 0, NULL)
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
|| have_eaptls_secret_client(user, (explicit_remote? remote_name: NULL))
#endif
);
1, NULL))) &&
!have_srp_secret((explicit_remote? remote_name: NULL), our_name, 1,
NULL)
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
&& !have_eaptls_secret_server((explicit_remote? remote_name: NULL),
our_name, 1, NULL)
#endif
* Open the file of pap secrets and scan for a suitable secret
* for authenticating this user.
*/
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
addrs = opts = NULL;
ret = UPAP_AUTHNAK;
f = fopen(filename, "r");
* Open the file of pap secrets and scan for a suitable secret.
*/
if (ret <= 0) {
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
addrs = NULL;
f = fopen(filename, "r");
if (f == NULL)
return ret;
}
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
return ret;
}
- filename = _PATH_UPAPFILE;
+ filename = PPP_PATH_UPAPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
}
}
- filename = _PATH_CHAPFILE;
+ filename = PPP_PATH_CHAPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
char *filename;
struct wordlist *addrs;
- filename = _PATH_SRPFILE;
+ filename = PPP_PATH_SRPFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
return 0;
}
} else {
- filename = _PATH_CHAPFILE;
+ filename = PPP_PATH_CHAPFILE;
addrs = NULL;
secbuf[0] = 0;
if (!am_server && passwd[0] != '\0') {
strlcpy(secret, passwd, MAXWORDLEN);
} else {
- filename = _PATH_SRPFILE;
+ filename = PPP_PATH_SRPFILE;
addrs = NULL;
fp = fopen(filename, "r");
int ok;
/* don't allow loopback or multicast address */
- if (bad_ip_adrs(addr))
+ if (ppp_bad_ip_addr(addr))
return 0;
if (allowed_address_hook) {
}
/*
- * bad_ip_adrs - return 1 if the IP address is one we don't want
- * to use, such as an address in the loopback net or a multicast address.
- * addr is in network byte order.
+ * Check if given addr in network byte order is in the looback network, or a multicast address.
*/
-int
-bad_ip_adrs(u_int32_t addr)
+bool
+ppp_bad_ip_addr(u_int32_t addr)
{
addr = ntohl(addr);
return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET
case s_up:
if (auth_state == s_down) {
auth_script_state = s_down;
- auth_script(_PATH_AUTHDOWN);
+ auth_script(PPP_PATH_AUTHDOWN);
}
break;
case s_down:
if (auth_state == s_up) {
auth_script_state = s_up;
- auth_script(_PATH_AUTHUP);
+ auth_script(PPP_PATH_AUTHUP);
}
break;
}
argv[3] = user_name;
argv[4] = devnam;
argv[5] = strspeed;
- argv[6] = NULL;
+ argv[6] = ipparam;
+ argv[7] = NULL;
auth_script_pid = run_program(script, argv, 0, auth_script_done, NULL, 0);
}
-#ifdef USE_EAPTLS
+#ifdef PPP_WITH_EAPTLS
static int
have_eaptls_secret_server(char *client, char *server,
int need_ip, int *lacks_ipp)
char cacertfile[MAXWORDLEN];
char pkfile[MAXWORDLEN];
- filename = _PATH_EAPTLSSERVFILE;
+ filename = PPP_PATH_EAPTLSSERVFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
if (pkcs12_file)
return 1;
- filename = _PATH_EAPTLSCLIFILE;
+ filename = PPP_PATH_EAPTLSCLIFILE;
f = fopen(filename, "r");
if (f == NULL)
return 0;
}
else
{
- filename = (am_server ? _PATH_EAPTLSSERVFILE : _PATH_EAPTLSCLIFILE);
+ filename = (am_server ? PPP_PATH_EAPTLSSERVFILE : PPP_PATH_EAPTLSCLIFILE);
addrs = NULL;
fp = fopen(filename, "r");