#include <netinet/in.h>
#include <arpa/inet.h>
-#include "pppd.h"
+#include "pppd-private.h"
+#include "options.h"
#include "fsm.h"
#include "eui64.h"
#include "ipcp.h"
static int ipv6cp_is_up;
static bool ipv6cp_noremote;
-/* Hook for a plugin to know when IPv6 protocol has come up */
-void (*ipv6_up_hook)(void) = NULL;
-
-/* Hook for a plugin to know when IPv6 protocol has come down */
-void (*ipv6_down_hook)(void) = NULL;
+ipv6_up_hook_fn *ipv6_up_hook = NULL;
+ipv6_down_hook_fn *ipv6_down_hook = NULL;
/* Notifiers for when IPCPv6 goes up and down */
struct notifier *ipv6_up_notifier = NULL;
* Command-line options.
*/
static int setifaceid (char **arg);
-static void printifaceid (option_t *,
+static void printifaceid (struct option *,
void (*)(void *, char *, ...), void *);
-static option_t ipv6cp_option_list[] = {
+static struct option ipv6cp_option_list[] = {
{ "ipv6", o_special, (void *)setifaceid,
"Set interface identifiers for IPV6",
OPT_A2PRINTER, (void *)printifaceid },
*comma = '\0';
if (inet_pton(AF_INET6, arg, &addr) == 0 || !VALIDID(addr)) {
- option_error("Illegal interface identifier (local): %s", arg);
+ ppp_option_error("Illegal interface identifier (local): %s", arg);
return 0;
}
*/
if (*comma != 0 && *++comma != '\0') {
if (inet_pton(AF_INET6, comma, &addr) == 0 || !VALIDID(addr)) {
- option_error("Illegal interface identifier (remote): %s", comma);
+ ppp_option_error("Illegal interface identifier (remote): %s", comma);
return 0;
}
if (option_priority >= prio_remote) {
char *llv6_ntoa(eui64_t ifaceid);
static void
-printifaceid(option_t *opt, void (*printer) (void *, char *, ...), void *arg)
+printifaceid(struct option *opt, void (*printer) (void *, char *, ...), void *arg)
{
ipv6cp_options *wo = &ipv6cp_wantoptions[0];
return;
}
}
- script_setenv("LLLOCAL", llv6_ntoa(go->ourid), 0);
+ ppp_script_setenv("LLLOCAL", llv6_ntoa(go->ourid), 0);
if (!eui64_iszero(ho->hisid))
- script_setenv("LLREMOTE", llv6_ntoa(ho->hisid), 0);
+ ppp_script_setenv("LLREMOTE", llv6_ntoa(ho->hisid), 0);
#ifdef IPV6CP_COMP
/* set tcp compression */
ipv6cp_down(fsm *f)
{
IPV6CPDEBUG(("ipv6cp: down"));
- update_link_stats(f->unit);
+ ppp_get_link_stats(NULL);
notify(ipv6_down_notifier, 0);
if (ipv6_down_hook)
ipv6_down_hook();
static void
ipv6cp_script(char *script)
{
- char strspeed[32], strlocal[32], strremote[32];
+ char strspeed[32], strlocal[64], strremote[64];
char *argv[8];
sprintf(strspeed, "%d", baud_rate);