X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fipv6cp.c;h=a36b1d942be4d530215078aebba7699156ebc75a;hp=130819dc6f5256c9e5316e51d0f681f613862f50;hb=HEAD;hpb=db3aa5f130886194d00a0c24db1e75261f9f9798 diff --git a/pppd/ipv6cp.c b/pppd/ipv6cp.c index 130819d..a36b1d9 100644 --- a/pppd/ipv6cp.c +++ b/pppd/ipv6cp.c @@ -162,8 +162,10 @@ #include #include -#include "pppd.h" +#include "pppd-private.h" +#include "options.h" #include "fsm.h" +#include "eui64.h" #include "ipcp.h" #include "ipv6cp.h" #include "magic.h" @@ -182,11 +184,8 @@ static int default_route_set[NUM_PPP]; /* Have set up a default route */ 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; @@ -230,10 +229,10 @@ static fsm_callbacks ipv6cp_callbacks = { /* IPV6CP callback routines */ * 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 }, @@ -372,7 +371,7 @@ setifaceid(char **argv) *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; } @@ -389,7 +388,7 @@ setifaceid(char **argv) */ 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) { @@ -407,7 +406,7 @@ setifaceid(char **argv) 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]; @@ -1301,9 +1300,9 @@ ipv6cp_up(fsm *f) 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 */ @@ -1397,7 +1396,7 @@ static void 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(); @@ -1491,7 +1490,7 @@ ipv6cp_script_done(void *arg) 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);