X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-solaris.c;h=2cba082652649376134971423e5c06a607ed8df3;hp=af2ef18b77bb789f628a357ea54badf7163e46d1;hb=392a4f54cb25e48eed9cf5443febeeba7eaf7cbc;hpb=32093f70f0c77ab214e743e8279c0f2ee2a9afc3 diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c index af2ef18..2cba082 100644 --- a/pppd/sys-solaris.c +++ b/pppd/sys-solaris.c @@ -42,7 +42,7 @@ * OR MODIFICATIONS. */ -#define RCSID "$Id: sys-solaris.c,v 1.2 2000/04/21 01:27:57 masputra Exp $" +#define RCSID "$Id: sys-solaris.c,v 1.4 2001/03/12 22:59:00 paulus Exp $" #include #include @@ -875,10 +875,10 @@ any_compressions() } /* - * establish_ppp - Turn the serial port into a ppp interface. + * tty_establish_ppp - Turn the serial port into a ppp interface. */ int -establish_ppp(fd) +tty_establish_ppp(fd) int fd; { int i; @@ -933,21 +933,12 @@ establish_ppp(fd) } /* - * restore_loop - reattach the ppp unit to the loopback. - * This doesn't need to do anything because disestablish_ppp does it. - */ -void -restore_loop() -{ -} - -/* - * disestablish_ppp - Restore the serial port to normal operation. + * tty_disestablish_ppp - Restore the serial port to normal operation. * It attempts to reconstruct the stream with the previously popped * modules. This shouldn't call die() because it's called from die(). */ void -disestablish_ppp(fd) +tty_disestablish_ppp(fd) int fd; { int i; @@ -1460,43 +1451,18 @@ get_loop_output() } /* - * ppp_send_config - configure the transmit characteristics of - * the ppp interface. + * netif_set_mtu - set the MTU on the PPP network interface. */ void -ppp_send_config(unit, mtu, asyncmap, pcomp, accomp) +netif_set_mtu(unit, mtu) int unit, mtu; - u_int32_t asyncmap; - int pcomp, accomp; { - int cf[2]; struct ifreq ifr; #if defined(INET6) && defined(SOL2) struct lifreq lifr; int fd; #endif /* defined(INET6) && defined(SOL2) */ - link_mtu = mtu; - if (strioctl(pppfd, PPPIO_MTU, &mtu, sizeof(mtu), 0) < 0) { - if (hungup && errno == ENXIO) - return; - error("Couldn't set MTU: %m"); - } - if (fdmuxid >= 0) { - if (!sync_serial) { - if (strioctl(pppfd, PPPIO_XACCM, &asyncmap, sizeof(asyncmap), 0) < 0) { - error("Couldn't set transmit ACCM: %m"); - } - } - cf[0] = (pcomp? COMP_PROT: 0) + (accomp? COMP_AC: 0); - cf[1] = COMP_PROT | COMP_AC; - if (any_compressions() && - strioctl(pppfd, PPPIO_CFLAGS, cf, sizeof(cf), sizeof(int)) < 0) { - error("Couldn't set prot/AC compression: %m"); - } - } - - /* set the MTU for IP as well */ memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); ifr.ifr_metric = link_mtu; @@ -1520,12 +1486,44 @@ ppp_send_config(unit, mtu, asyncmap, pcomp, accomp) #endif /* defined(INET6) && defined(SOL2) */ } +/* + * tty_send_config - configure the transmit characteristics of + * the ppp interface. + */ +void +tty_send_config(mtu, asyncmap, pcomp, accomp) + int mtu; + u_int32_t asyncmap; + int pcomp, accomp; +{ + int cf[2]; + + link_mtu = mtu; + if (strioctl(pppfd, PPPIO_MTU, &mtu, sizeof(mtu), 0) < 0) { + if (hungup && errno == ENXIO) + return; + error("Couldn't set MTU: %m"); + } + if (fdmuxid >= 0) { + if (!sync_serial) { + if (strioctl(pppfd, PPPIO_XACCM, &asyncmap, sizeof(asyncmap), 0) < 0) { + error("Couldn't set transmit ACCM: %m"); + } + } + cf[0] = (pcomp? COMP_PROT: 0) + (accomp? COMP_AC: 0); + cf[1] = COMP_PROT | COMP_AC; + if (any_compressions() && + strioctl(pppfd, PPPIO_CFLAGS, cf, sizeof(cf), sizeof(int)) < 0) { + error("Couldn't set prot/AC compression: %m"); + } + } +} + /* * ppp_set_xaccm - set the extended transmit ACCM for the interface. */ void -ppp_set_xaccm(unit, accm) - int unit; +tty_set_xaccm(accm) ext_accm accm; { if (sync_serial) @@ -1543,8 +1541,8 @@ ppp_set_xaccm(unit, accm) * the ppp interface. */ void -ppp_recv_config(unit, mru, asyncmap, pcomp, accomp) - int unit, mru; +tty_recv_config(mru, asyncmap, pcomp, accomp) + int mru; u_int32_t asyncmap; int pcomp, accomp; {