X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoatm%2Fpppoatm.c;h=207e5bf2da167c0cfd35d5ba63e17dbb4be7cb73;hb=ba7f7e053daae846a54a1d08d3d133a5f1266ace;hp=5ac03c8483d66e44f40da04f1ab7f7290b3a72c0;hpb=76016e1b948b7d9675b4e0750d1f943d96d9523b;p=ppp.git diff --git a/pppd/plugins/pppoatm/pppoatm.c b/pppd/plugins/pppoatm/pppoatm.c index 5ac03c8..207e5bf 100644 --- a/pppd/plugins/pppoatm/pppoatm.c +++ b/pppd/plugins/pppoatm/pppoatm.c @@ -24,9 +24,11 @@ #include #include #include +#include +#include #include -#include +#include #include /* Needed for lcp.h to include cleanly */ #include @@ -42,8 +44,9 @@ static int pppoatm_max_mtu, pppoatm_max_mru; static int setdevname_pppoatm(const char *cp, const char **argv, int doit); struct channel pppoa_channel; static int pppoa_fd = -1; +static char devnam[MAXNAMELEN]; -static option_t pppoa_options[] = { +static struct option pppoa_options[] = { { "device name", o_wild, (void *) &setdevname_pppoatm, "ATM service provider IDs: VPI.VCI", OPT_DEVNAM | OPT_PRIVFIX | OPT_NOARG | OPT_A2STRVAL | OPT_STATIC, @@ -90,6 +93,7 @@ static int setdevname_pppoatm(const char *cp, const char **argv, int doit) memcpy(&pvcaddr, &addr, sizeof pvcaddr); strlcpy(devnam, cp, MAXPATHLEN); + ppp_set_devnam(devnam); devstat.st_mode = S_IFSOCK; if (the_channel != &pppoa_channel) { the_channel = &pppoa_channel; @@ -163,7 +167,7 @@ static int connect_pppoatm(void) pppoatm_max_mtu = lcp_allowoptions[0].mru; pppoatm_max_mru = lcp_wantoptions[0].mru; set_line_discipline_pppoatm(fd); - strlcpy(ppp_devnam, devnam, MAXPATHLEN); + ppp_set_pppdevnam(devnam); pppoa_fd = fd; return fd; } @@ -177,13 +181,13 @@ void plugin_init(void) { #ifdef linux extern int new_style_driver; /* From sys-linux.c */ - if (!ppp_available() && !new_style_driver) + if (!ppp_check_kernel_support() && !new_style_driver) fatal("Kernel doesn't support ppp_generic - " "needed for PPPoATM"); #else fatal("No PPPoATM support on this OS"); #endif - add_options(pppoa_options); + ppp_add_options(pppoa_options); } struct channel pppoa_channel = { @@ -192,8 +196,8 @@ struct channel pppoa_channel = { .check_options = NULL, .connect = &connect_pppoatm, .disconnect = &disconnect_pppoatm, - .establish_ppp = &generic_establish_ppp, - .disestablish_ppp = &generic_disestablish_ppp, + .establish_ppp = &ppp_generic_establish, + .disestablish_ppp = &ppp_generic_disestablish, .send_config = NULL, .recv_config = NULL, .close = NULL,