*/
#ifndef lint
-static char rcsid[] = "$Id: lcp.c,v 1.5 1994/05/24 11:23:13 paulus Exp $";
+static char rcsid[] = "$Id: lcp.c,v 1.11 1994/08/09 06:29:14 paulus Exp $";
#endif
/*
*/
#include <stdio.h>
+#include <string.h>
#include <syslog.h>
#include <assert.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
-
-#include <net/if.h>
-#include <net/if_ppp.h>
#include <netinet/in.h>
-#include <string.h>
-
#include "pppd.h"
#include "ppp.h"
#include "fsm.h"
#include "upap.h"
#include "ipcp.h"
+#ifdef _linux_ /* Needs ppp ioctls */
+#include <linux/ppp.h>
+#endif
+
/* global vars */
fsm lcp_fsm[NPPP]; /* LCP fsm structure (global)*/
lcp_options lcp_wantoptions[NPPP]; /* Options that we want to request */
if (f->state != OPENED) {
*go = try;
if (looped_back && try.numloops % lcp_warnloops == 0)
- LCPDEBUG((LOG_INFO, "The line appears to be looped back."));
+ syslog(LOG_WARNING, "Serial line appears to be looped back.");
}
return 1;
ppp_send_config(f->unit, MIN(ao->mru, (ho->neg_mru? ho->mru: MTU)),
(ho->neg_asyncmap? ho->asyncmap: 0xffffffff),
ho->neg_pcompression, ho->neg_accompression);
+ /*
+ * If the asyncmap hasn't been negotiated, we really should
+ * set the receive asyncmap to ffffffff, but we set it to 0
+ * for backwards contemptibility.
+ */
ppp_recv_config(f->unit, (go->neg_mru? MAX(wo->mru, go->mru): MTU),
- (go->neg_asyncmap? go->asyncmap: 0xffffffff),
+ (go->neg_asyncmap? go->asyncmap: 0x00000000),
go->neg_pcompression, go->neg_accompression);
if (ho->neg_mru)
ChapLowerUp(f->unit); /* Enable CHAP */
upap_lowerup(f->unit); /* Enable UPAP */
ipcp_lowerup(f->unit); /* Enable IPCP */
+ ccp_lowerup(f->unit); /* Enable CCP */
lcp_echo_lowerup(f->unit); /* Enable echo messages */
link_established(f->unit);
fsm *f;
{
lcp_echo_lowerdown(f->unit);
+ ccp_lowerdown(f->unit);
ipcp_lowerdown(f->unit);
ChapLowerDown(f->unit);
upap_lowerdown(f->unit);
{
if (f->state == OPENED) {
syslog (LOG_NOTICE, "Excessive lack of response to LCP echo frames.");
- lcp_lowerdown(f->unit); /* Reset connection */
+ lcp_close(f->unit); /* Reset connection */
}
}