summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-04-26 08:54:34 +0000
committerbrian <brian@FreeBSD.org>1999-04-26 08:54:34 +0000
commit42c76b892b2a251304d2676dc4406866b70ee8c2 (patch)
tree70f19a932d140e44302dcaa278b6b8c44baa30b4 /usr.sbin
parentd1f60b18e9169cfefff4540b6d27ae1e2b181471 (diff)
downloadFreeBSD-src-42c76b892b2a251304d2676dc4406866b70ee8c2.zip
FreeBSD-src-42c76b892b2a251304d2676dc4406866b70ee8c2.tar.gz
Add support for NetBSD
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ppp/alias_cmd.c8
-rw-r--r--usr.sbin/ppp/bundle.c8
-rw-r--r--usr.sbin/ppp/command.c10
-rw-r--r--usr.sbin/ppp/ip.c10
-rw-r--r--usr.sbin/ppp/ipcp.c8
-rw-r--r--usr.sbin/ppp/main.c8
-rw-r--r--usr.sbin/ppp/modem.c4
-rw-r--r--usr.sbin/ppp/nat_cmd.c8
-rw-r--r--usr.sbin/ppp/tun.c26
9 files changed, 57 insertions, 33 deletions
diff --git a/usr.sbin/ppp/alias_cmd.c b/usr.sbin/ppp/alias_cmd.c
index 430ab47..66b6db7 100644
--- a/usr.sbin/ppp/alias_cmd.c
+++ b/usr.sbin/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.21 1999/03/07 18:13:44 brian Exp $
+ * $Id: alias_cmd.c,v 1.22 1999/03/25 23:36:23 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/bundle.c b/usr.sbin/ppp/bundle.c
index efab874..c84828f 100644
--- a/usr.sbin/ppp/bundle.c
+++ b/usr.sbin/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.49 1999/03/07 01:41:40 brian Exp $
+ * $Id: bundle.c,v 1.50 1999/03/25 11:37:51 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/command.c b/usr.sbin/ppp/command.c
index 830e95c..7644978 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/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.189 1999/03/19 00:05:32 brian Exp $
+ * $Id: command.c,v 1.190 1999/03/25 23:36:23 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/19 00:05:32 $";
+const char VersionDate[] = "$Date: 1999/03/25 23:36:23 $";
static int ShowCommand(struct cmdargs const *);
static int TerminalCommand(struct cmdargs const *);
diff --git a/usr.sbin/ppp/ip.c b/usr.sbin/ppp/ip.c
index 79ab1ca..50bbe49 100644
--- a/usr.sbin/ppp/ip.c
+++ b/usr.sbin/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.55 1999/01/28 01:56:32 brian Exp $
+ * $Id: ip.c,v 1.56 1999/03/29 08:21:27 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/ipcp.c b/usr.sbin/ppp/ipcp.c
index e3b2eef..aa981ef 100644
--- a/usr.sbin/ppp/ipcp.c
+++ b/usr.sbin/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.73 1999/03/03 23:00:40 brian Exp $
+ * $Id: ipcp.c,v 1.74 1999/04/26 08:54:24 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/main.c b/usr.sbin/ppp/main.c
index 4eb99d4..6c5f6ff 100644
--- a/usr.sbin/ppp/main.c
+++ b/usr.sbin/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.151 1999/03/07 01:02:38 brian Exp $
+ * $Id: main.c,v 1.152 1999/03/30 00:44:57 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/modem.c b/usr.sbin/ppp/modem.c
index b05465c..7917fd0 100644
--- a/usr.sbin/ppp/modem.c
+++ b/usr.sbin/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.109 1999/04/03 12:01:38 brian Exp $
+ * $Id: modem.c,v 1.110 1999/04/21 08:03:35 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/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c
index 430ab47..66b6db7 100644
--- a/usr.sbin/ppp/nat_cmd.c
+++ b/usr.sbin/ppp/nat_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.21 1999/03/07 18:13:44 brian Exp $
+ * $Id: alias_cmd.c,v 1.22 1999/03/25 23:36:23 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/tun.c b/usr.sbin/ppp/tun.c
index 8d578b4..90a3665 100644
--- a/usr.sbin/ppp/tun.c
+++ b/usr.sbin/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.11 1999/01/28 01:56:34 brian Exp $
+ * $Id: tun.c,v 1.12 1999/04/26 08:54:25 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
}
OpenPOWER on IntegriCloud