summaryrefslogtreecommitdiff
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@cvs.openbsd.org>1999-04-26 08:55:02 +0000
committerbrian <brian@cvs.openbsd.org>1999-04-26 08:55:02 +0000
commitbb6b0e9359ac6acd0918501d0150f5c54572a4d4 (patch)
tree21c61dc5b1a53682ffc1d1f625454b3e56163e81 /usr.sbin/ppp
parent5fd7d925e278067edfe930beeef2c61af1a45387 (diff)
Add support for NetBSD
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/ppp/alias_cmd.c8
-rw-r--r--usr.sbin/ppp/ppp/bundle.c8
-rw-r--r--usr.sbin/ppp/ppp/command.c10
-rw-r--r--usr.sbin/ppp/ppp/ip.c10
-rw-r--r--usr.sbin/ppp/ppp/ipcp.c8
-rw-r--r--usr.sbin/ppp/ppp/main.c8
-rw-r--r--usr.sbin/ppp/ppp/modem.c4
-rw-r--r--usr.sbin/ppp/ppp/tun.c26
8 files changed, 53 insertions, 29 deletions
diff --git a/usr.sbin/ppp/ppp/alias_cmd.c b/usr.sbin/ppp/ppp/alias_cmd.c
index 0f5124af21a..2bf71e6e900 100644
--- a/usr.sbin/ppp/ppp/alias_cmd.c
+++ b/usr.sbin/ppp/ppp/alias_cmd.c
@@ -2,7 +2,7 @@
* The code in this file was written by Eivind Eklund <perhaps@yes.no>,
* who places it in the public domain without restriction.
*
- * $Id: alias_cmd.c,v 1.5 1999/03/25 23:36:52 brian Exp $
+ * $Id: alias_cmd.c,v 1.6 1999/04/26 08:55:00 brian Exp $
*/
#include <sys/param.h>
@@ -19,10 +19,10 @@
#include <string.h>
#include <termios.h>
-#ifdef __OpenBSD__
-#include "alias.h"
-#else
+#ifdef __FreeBSD__
#include <alias.h>
+#else
+#include "alias.h"
#endif
#include "defs.h"
#include "command.h"
diff --git a/usr.sbin/ppp/ppp/bundle.c b/usr.sbin/ppp/ppp/bundle.c
index 30dc0696978..66d1c25e30c 100644
--- a/usr.sbin/ppp/ppp/bundle.c
+++ b/usr.sbin/ppp/ppp/bundle.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bundle.c,v 1.13 1999/03/25 11:37:16 brian Exp $
+ * $Id: bundle.c,v 1.14 1999/04/26 08:55:00 brian Exp $
*/
#include <sys/param.h>
@@ -50,10 +50,10 @@
#include <unistd.h>
#ifndef NOALIAS
-#ifdef __OpenBSD__
-#include "alias.h"
-#else
+#ifdef __FreeBSD__
#include <alias.h>
+#else
+#include "alias.h"
#endif
#endif
#include "defs.h"
diff --git a/usr.sbin/ppp/ppp/command.c b/usr.sbin/ppp/ppp/command.c
index af350dd2ad3..3f0d2e84460 100644
--- a/usr.sbin/ppp/ppp/command.c
+++ b/usr.sbin/ppp/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.17 1999/03/25 23:36:52 brian Exp $
+ * $Id: command.c,v 1.18 1999/04/26 08:55:01 brian Exp $
*
*/
#include <sys/param.h>
@@ -42,10 +42,10 @@
#include <unistd.h>
#ifndef NOALIAS
-#ifdef __OpenBSD__
-#include "alias.h"
-#else
+#ifdef __FreeBSD__
#include <alias.h>
+#else
+#include "alias.h"
#endif
#endif
#include "defs.h"
@@ -141,7 +141,7 @@
#define NEG_DNS 52
const char Version[] = "2.11";
-const char VersionDate[] = "$Date: 1999/03/25 23:36:52 $";
+const char VersionDate[] = "$Date: 1999/04/26 08:55:01 $";
static int ShowCommand(struct cmdargs const *);
static int TerminalCommand(struct cmdargs const *);
diff --git a/usr.sbin/ppp/ppp/ip.c b/usr.sbin/ppp/ppp/ip.c
index 75aabb2c016..ce05daf4db9 100644
--- a/usr.sbin/ppp/ppp/ip.c
+++ b/usr.sbin/ppp/ppp/ip.c
@@ -17,14 +17,14 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ip.c,v 1.5 1999/03/29 08:20:32 brian Exp $
+ * $Id: ip.c,v 1.6 1999/04/26 08:55:01 brian Exp $
*
* TODO:
* o Return ICMP message for filterd packet
* and optionaly record it into log.
*/
#include <sys/param.h>
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
#include <sys/socket.h>
#endif
#include <netinet/in.h>
@@ -43,10 +43,10 @@
#include <unistd.h>
#ifndef NOALIAS
-#ifdef __OpenBSD__
-#include "alias.h"
-#else
+#ifdef __FreeBSD__
#include <alias.h>
+#else
+#include "alias.h"
#endif
#endif
#include "mbuf.h"
diff --git a/usr.sbin/ppp/ppp/ipcp.c b/usr.sbin/ppp/ppp/ipcp.c
index 6a01a72a7b2..52219d1053c 100644
--- a/usr.sbin/ppp/ppp/ipcp.c
+++ b/usr.sbin/ppp/ppp/ipcp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: ipcp.c,v 1.10 1999/04/26 08:54:50 brian Exp $
+ * $Id: ipcp.c,v 1.11 1999/04/26 08:55:01 brian Exp $
*
* TODO:
* o More RFC1772 backward compatibility
@@ -41,10 +41,10 @@
#include <unistd.h>
#ifndef NOALIAS
-#ifdef __OpenBSD__
-#include "alias.h"
-#else
+#ifdef __FreeBSD__
#include <alias.h>
+#else
+#include "alias.h"
#endif
#endif
#include "ua.h"
diff --git a/usr.sbin/ppp/ppp/main.c b/usr.sbin/ppp/ppp/main.c
index 77a8c3d42c9..817309aaafb 100644
--- a/usr.sbin/ppp/ppp/main.c
+++ b/usr.sbin/ppp/ppp/main.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: main.c,v 1.10 1999/03/30 00:45:30 brian Exp $
+ * $Id: main.c,v 1.11 1999/04/26 08:55:01 brian Exp $
*
* TODO:
*/
@@ -39,10 +39,10 @@
#include <unistd.h>
#ifndef NOALIAS
-#ifdef __OpenBSD__
-#include "alias.h"
-#else
+#ifdef __FreeBSD__
#include <alias.h>
+#else
+#include "alias.h"
#endif
#endif
#include "probe.h"
diff --git a/usr.sbin/ppp/ppp/modem.c b/usr.sbin/ppp/ppp/modem.c
index cfbeeb09620..0aa79d67526 100644
--- a/usr.sbin/ppp/ppp/modem.c
+++ b/usr.sbin/ppp/ppp/modem.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: modem.c,v 1.11 1999/04/21 08:06:46 brian Exp $
+ * $Id: modem.c,v 1.12 1999/04/26 08:55:01 brian Exp $
*
* TODO:
*/
@@ -40,7 +40,7 @@
#include <sys/uio.h>
#include <sys/wait.h>
#include <unistd.h>
-#ifdef __OpenBSD__
+#if defined(__OpenBSD__) || defined(__NetBSD__)
#include <sys/ioctl.h>
#include <util.h>
#else
diff --git a/usr.sbin/ppp/ppp/tun.c b/usr.sbin/ppp/ppp/tun.c
index ca6d086c87a..004cc2579ee 100644
--- a/usr.sbin/ppp/ppp/tun.c
+++ b/usr.sbin/ppp/ppp/tun.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: tun.c,v 1.4 1999/04/26 08:54:50 brian Exp $
+ * $Id: tun.c,v 1.5 1999/04/26 08:55:01 brian Exp $
*/
#include <sys/param.h>
@@ -39,6 +39,10 @@
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
+#ifdef __NetBSD__
+#include <stdio.h>
+#include <unistd.h>
+#endif
#include "mbuf.h"
#include "log.h"
@@ -66,6 +70,25 @@
void
tun_configure(struct bundle *bundle, int mtu)
{
+#ifdef __NetBSD__
+ struct ifreq ifr;
+ int s;
+
+ s = socket(AF_INET, SOCK_DGRAM, 0);
+
+ if (s < 0) {
+ log_Printf(LogERROR, "tun_configure: socket(): %s\n", strerror(errno));
+ return;
+ }
+
+ sprintf(ifr.ifr_name, "tun%d", bundle->unit);
+ ifr.ifr_mtu = mtu;
+ if (ioctl(s, SIOCSIFMTU, &ifr) < 0)
+ log_Printf(LogERROR, "tun_configure: ioctl(SIOCSIFMTU): %s\n",
+ strerror(errno));
+
+ close(s);
+#else
struct tuninfo info;
memset(&info, '\0', sizeof info);
@@ -86,4 +109,5 @@ tun_configure(struct bundle *bundle, int mtu)
if (ioctl(bundle->dev.fd, TUNSIFINFO, &info) < 0)
log_Printf(LogERROR, "tun_configure: ioctl(TUNSIFINFO): %s\n",
strerror(errno));
+#endif
}