summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/lcp.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-11-16 22:15:11 +0000
committerbrian <brian@FreeBSD.org>1997-11-16 22:15:11 +0000
commit5696a07f36cde36ef7955344c7b33fc5c7c57248 (patch)
tree766aa7f660926161982f1e79a01aa4827f8022d9 /usr.sbin/ppp/lcp.c
parent0f428e70f1f534b0936e0af7a36d1ad2f7e76775 (diff)
downloadFreeBSD-src-5696a07f36cde36ef7955344c7b33fc5c7c57248.zip
FreeBSD-src-5696a07f36cde36ef7955344c7b33fc5c7c57248.tar.gz
Abstract data read from and written to the tun device,
allowing for a possible header on the front of all packets. In OpenBSD, there's a structure containing the address family here. If we're building under OpenBSD, set up the ``flags'' part of struct tuninfo (not there under FreeBSD) so that we config the interface as POINTOPOINT. Prefix prototypes with ``extern'' in os.c for consistency. These changes are cosmetic under FreeBSD, but allow ppp to build & work under OpenBSD (bar the srandomdev() stuff, the inclusing of <net/if_var.h> and some Makefile symantecs).
Diffstat (limited to 'usr.sbin/ppp/lcp.c')
-rw-r--r--usr.sbin/ppp/lcp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/ppp/lcp.c b/usr.sbin/ppp/lcp.c
index 33646c7..c23c8dd 100644
--- a/usr.sbin/ppp/lcp.c
+++ b/usr.sbin/ppp/lcp.c
@@ -17,15 +17,21 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: lcp.c,v 1.44 1997/11/11 13:08:12 brian Exp $
+ * $Id: lcp.c,v 1.45 1997/11/14 15:39:15 brian Exp $
*
* TODO:
* o Validate magic number received from peer.
* o Limit data field length by MRU
*/
#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/select.h>
+#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <net/if.h>
+#include <net/if_var.h>
+#include <net/if_tun.h>
#include <signal.h>
#include <stdio.h>
@@ -58,6 +64,7 @@
#include "main.h"
#include "ip.h"
#include "modem.h"
+#include "tun.h"
struct lcpstate LcpInfo;
@@ -350,7 +357,7 @@ static void
LcpLayerUp(struct fsm * fp)
{
LogPrintf(LogLCP, "LcpLayerUp\n");
- OsSetInterfaceParams(23, LcpInfo.his_mru, ModemSpeed());
+ tun_configure(LcpInfo.his_mru, ModemSpeed());
SetLinkParams(&LcpInfo);
NewPhase(PHASE_AUTHENTICATE);
OpenPOWER on IntegriCloud