* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+#ifndef lint
+static char rcsid[] = "$Id: sys-str.c,v 1.14 1994/09/21 06:47:37 paulus Exp $";
+#endif
+
/*
* TODO:
*/
#include <sys/stropts.h>
#include <net/if.h>
+#include <net/ppp_defs.h>
+#include <net/ppp_str.h>
#include <net/route.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include "pppd.h"
-#include "ppp.h"
-#include <net/ppp_str.h>
#ifndef ifr_mtu
#define ifr_mtu ifr_metric
if (!restore_term)
inittermios = tios;
- tios.c_cflag &= ~(CSIZE | CSTOPB | PARENB | CLOCAL | CRTSCTS);
- if (crtscts == 1)
+ tios.c_cflag &= ~(CSIZE | CSTOPB | PARENB | CLOCAL);
+ if (crtscts > 0)
tios.c_cflag |= CRTSCTS;
+ else if (crtscts < 0)
+ tios.c_cflag &= ~CRTSCTS;
tios.c_cflag |= CS8 | CREAD | HUPCL;
if (local || !modem)
int len, i;
unsigned char ctlbuf[16];
- str.maxlen = MTU+DLLHEADERLEN;
+ str.maxlen = PPP_MTU + PPP_HDRLEN;
str.buf = (caddr_t) buf;
ctl.maxlen = sizeof(ctlbuf);
ctl.buf = (caddr_t) ctlbuf;
void
ppp_send_config(unit, mtu, asyncmap, pcomp, accomp)
int unit, mtu;
- uint32 asyncmap;
+ u_int32_t asyncmap;
int pcomp, accomp;
{
char c;
void
ppp_recv_config(unit, mru, asyncmap, pcomp, accomp)
int unit, mru;
- uint32 asyncmap;
+ u_int32_t asyncmap;
int pcomp, accomp;
{
char c;
syslog(LOG_ERR, "ioctl (SIOCSIFCOMP): %m");
}
+/*
+ * ccp_fatal_error - returns 1 if decompression was disabled as a
+ * result of an error detected after decompression of a packet,
+ * 0 otherwise. This is necessary because of patent nonsense.
+ */
+int
+ccp_fatal_error(unit)
+ int unit;
+{
+ int x;
+
+ if (ioctl(fd, SIOCGIFCOMP, (caddr_t) &x) < 0) {
+ syslog(LOG_ERR, "ioctl(SIOCGIFCOMP): %m");
+ return 0;
+ }
+ return x & CCP_FATALERROR;
+}
+
/*
* sifvjcomp - config tcp header compression
*/
int
sifaddr(u, o, h, m)
int u;
- uint32 o, h, m;
+ u_int32_t o, h, m;
{
int ret;
struct ifreq ifr;
int
cifaddr(u, o, h)
int u;
- uint32 o, h;
+ u_int32_t o, h;
{
struct rtentry rt;
int
sifdefaultroute(u, g)
int u;
- uint32 g;
+ u_int32_t g;
{
struct rtentry rt;
int
cifdefaultroute(u, g)
int u;
- uint32 g;
+ u_int32_t g;
{
struct rtentry rt;
int
sifproxyarp(unit, hisaddr)
int unit;
- uint32 hisaddr;
+ u_int32_t hisaddr;
{
struct arpreq arpreq;
int
cifproxyarp(unit, hisaddr)
int unit;
- uint32 hisaddr;
+ u_int32_t hisaddr;
{
struct arpreq arpreq;
int
get_ether_addr(ipaddr, hwaddr)
- uint32 ipaddr;
+ u_int32_t ipaddr;
struct sockaddr *hwaddr;
{
register kvm_t *kd;
struct in_ifaddr in;
} ifaddr;
#endif
- uint32 addr, mask;
+ u_int32_t addr, mask;
/* Open kernel memory for reading */
kd = kvm_open(0, 0, 0, O_RDONLY, NULL);
syslog(LOG_ERR, "error reading ifnet addr");
return 0;
}
- for ( ; addr; addr = (uint32)ifp->if_next) {
+ for ( ; addr; addr = (u_int32_t)ifp->if_next) {
if (kvm_read(kd, addr, (char *)ac, sizeof(*ac)) != sizeof(*ac)) {
syslog(LOG_ERR, "error reading ifnet");
return 0;
/* Get interface ip address */
#ifdef SUNOS4
- if (kvm_read(kd, (uint32)ifp->if_addrlist, (char *)&ifaddr,
+ if (kvm_read(kd, (u_int32_t)ifp->if_addrlist, (char *)&ifaddr,
sizeof(ifaddr)) != sizeof(ifaddr)) {
syslog(LOG_ERR, "error reading ifaddr");
return 0;