1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

Add support for NetBSD

This commit is contained in:
Brian Somers 1999-04-26 08:54:34 +00:00
parent 119386a38b
commit 7884358fdd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46086
9 changed files with 57 additions and 33 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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 *);

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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
}