diff options
author | Paul Mackerras <paulus@samba.org> | 2001-03-08 05:14:26 +0000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2001-03-08 05:14:26 +0000 |
commit | cffe80dd87a8ba3fba8f56fda45d2c0cfd62ba4d (patch) | |
tree | c9e9696e6996f2544e861de7ca9805acf1786e87 /pppd/sys-solaris.c | |
parent | 37a8acc7ee2527693d0c8ba82b2eaea249abde34 (diff) | |
download | ppp-cffe80dd87a8ba3fba8f56fda45d2c0cfd62ba4d.tar.gz |
Separate out the setting of the interface MTU from the setting of
lower level things like the asyncmap and proto/AC compression.
Renamed ppp_send/recv_config to tty_send/recv_config.
At this point we have a structure of channel operations and a pointer
to the currently set (the_channel) which a plugin can override if
desired.
Diffstat (limited to 'pppd/sys-solaris.c')
-rw-r--r-- | pppd/sys-solaris.c | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/pppd/sys-solaris.c b/pppd/sys-solaris.c index af2ef18..859cd2a 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.3 2001/03/08 05:14:26 paulus Exp $" #include <limits.h> #include <stdio.h> @@ -1460,43 +1460,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; @@ -1521,11 +1496,43 @@ ppp_send_config(unit, mtu, asyncmap, pcomp, accomp) } /* + * 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 +1550,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; { |