1997-01-05 16:06:38 +03:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-01-05 16:06:38 +03:00
|
|
|
#
|
|
|
|
# Copyright (c) 1996 Matthew R. Green
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
# 3. All advertising materials mentioning features or use of this software
|
|
|
|
# must display the following acknowledgement:
|
|
|
|
# This product includes software developed by Matthew R. Green for
|
|
|
|
# the NetBSD Project.
|
|
|
|
# 4. The name of the author may not be used to endorse or promote products
|
|
|
|
# derived from this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
# SUCH DAMAGE.
|
|
|
|
|
|
|
|
# ipfilter2netbsd: convert a ipfilter source tree into a
|
|
|
|
# netbsd ipfilter source tree, under src/sys, src/usr.sbin,
|
|
|
|
# etc., ready for importing.
|
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then echo "ipfilter2netbsd src dest"; exit 1; fi
|
|
|
|
|
|
|
|
r=$1
|
|
|
|
d=$2/ipfilter
|
|
|
|
|
|
|
|
case "$d" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
d=`/bin/pwd`/$d
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case "$r" in
|
|
|
|
/*)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
r=`/bin/pwd`/$r
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo preparing directory $d
|
|
|
|
rm -rf $d
|
|
|
|
mkdir -p $d; cd $d
|
1998-05-17 20:05:39 +04:00
|
|
|
mkdir -p src/usr.sbin/ipf/ipf src/sys/netinet src/usr.sbin/ipf/ipfstat src/usr.sbin/ipf/ipftest src/usr.sbin/ipf/ipmon src/usr.sbin/ipf/ipnat src/usr.sbin/ipf/ipresend src/usr.sbin/ipf/ipsend src/usr.sbin/ipf/iptest src/usr.sbin/ipf/rules src/sys/lkm/netinet/if_ipl
|
1997-09-21 20:34:31 +04:00
|
|
|
|
|
|
|
### start Makefile ###############################
|
|
|
|
cd $d/src/usr.sbin/ipf
|
|
|
|
|
|
|
|
echo creating main Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-09-21 20:34:31 +04:00
|
|
|
|
1997-11-24 02:20:08 +03:00
|
|
|
SUBDIR= ipf ipfstat ipftest ipmon ipnat ipresend ipsend iptest rules
|
1997-09-21 20:34:31 +04:00
|
|
|
|
|
|
|
.include <bsd.subdir.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end Makefile ###############################
|
|
|
|
|
|
|
|
### start Makefile.inc ###############################
|
|
|
|
cd $d/src/usr.sbin/ipf
|
|
|
|
|
|
|
|
echo creating main Makefile.inc
|
|
|
|
cat > Makefile.inc<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-09-21 20:34:31 +04:00
|
|
|
|
|
|
|
WARNS?= 1
|
|
|
|
|
1998-05-17 20:05:39 +04:00
|
|
|
.if exists(${.CURDIR}/../../Makefile.inc)
|
1997-09-21 20:34:31 +04:00
|
|
|
.include "${.CURDIR}/../../Makefile.inc"
|
1998-05-17 20:05:39 +04:00
|
|
|
.endif
|
1997-09-21 20:34:31 +04:00
|
|
|
__eof_makefile
|
|
|
|
### end Makefile.inc ###############################
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
### start ipf ###############################
|
|
|
|
cd $r
|
|
|
|
echo ipf:
|
|
|
|
src='ipf.c parse.c opt.c ipf.h'
|
1997-10-30 19:08:54 +03:00
|
|
|
man='ipf.8 ipf.4 ipf.5 ipl.4'
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-04-13 03:51:04 +04:00
|
|
|
pax -rvw $src $d/src/usr.sbin/ipf/ipf
|
|
|
|
cd man; pax -rvw $man $d/src/usr.sbin/ipf/ipf; cd ..
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-04-13 03:51:04 +04:00
|
|
|
cd $d/src/usr.sbin/ipf/ipf
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1998-03-03 22:24:27 +03:00
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
PROG= ipf
|
|
|
|
SRCS= ipf.c parse.c opt.c
|
|
|
|
MAN= ipf.8 ipf.4 ipf.5 ipl.4
|
1997-09-16 06:06:41 +04:00
|
|
|
MLINKS= ipl.4 ipfilter.4 ipf.5 ipf.conf.5
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1998-03-03 22:23:16 +03:00
|
|
|
BINDIR= /sbin
|
1998-03-03 22:24:27 +03:00
|
|
|
LDSTATIC?= -static
|
1998-03-03 22:23:16 +03:00
|
|
|
|
1997-01-05 16:06:38 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end ipf ###############################
|
|
|
|
|
|
|
|
### start ipfstat ###############################
|
|
|
|
cd $r
|
|
|
|
echo ipfstat:
|
|
|
|
src='kmem.c kmem.h fils.c'
|
|
|
|
man=ipfstat.8
|
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
pax -rvw $src $d/src/usr.sbin/ipf/ipfstat
|
|
|
|
cd man; pax -rvw $man $d/src/usr.sbin/ipf/ipfstat; cd ..
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
cd $d/src/usr.sbin/ipf/ipfstat
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
PROG= ipfstat
|
|
|
|
SRCS= kmem.c fils.c opt.c parse.c
|
|
|
|
MAN= ipfstat.8
|
1997-10-25 10:57:53 +04:00
|
|
|
CPPFLAGS+=-I${.CURDIR}/../ipf
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-04-13 18:49:38 +04:00
|
|
|
.PATH: ${.CURDIR}/../ipf
|
1997-01-05 16:06:38 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
|
|
|
|
|
|
|
### end ipfstat ###############################
|
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
### start ipftest ###############################
|
|
|
|
cd $r
|
|
|
|
echo ipftest:
|
1997-05-28 02:24:25 +04:00
|
|
|
src='ipt.c ipft_sn.c ipft_ef.c ipft_td.c ipft_pc.c ipft_tx.c misc.c ipft_hx.c ipt.h snoop.h pcap.h'
|
1997-11-11 13:07:31 +03:00
|
|
|
man=ipftest.1
|
1997-03-29 23:28:17 +03:00
|
|
|
|
|
|
|
pax -rvw $src test $d/src/usr.sbin/ipf/ipftest
|
1997-11-11 13:07:31 +03:00
|
|
|
cd man; pax -rvw $man $d/src/usr.sbin/ipf/ipftest; cd ..
|
1997-03-29 23:28:17 +03:00
|
|
|
|
|
|
|
cd $d/src/usr.sbin/ipf/ipftest
|
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-03-29 23:28:17 +03:00
|
|
|
|
|
|
|
PROG= ipftest
|
1997-07-07 02:33:46 +04:00
|
|
|
SRCS= ipt.c ipft_sn.c ipft_ef.c ipft_td.c ipft_pc.c opt.c ipft_tx.c misc.c ip_frag.c ip_state.c ip_nat.c ipft_hx.c ip_fil.c fil.c parse.c ip_proxy.c ip_auth.c
|
1997-11-11 13:07:31 +03:00
|
|
|
MAN= ipftest.1
|
1997-10-25 10:57:53 +04:00
|
|
|
CPPFLAGS+=-I${.CURDIR} -I${.CURDIR}/../ipf
|
1997-03-29 23:28:17 +03:00
|
|
|
|
1997-04-13 18:49:38 +04:00
|
|
|
.PATH: ${.CURDIR}/../ipf ${.CURDIR}/../../../sys/netinet
|
1997-03-29 23:28:17 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end ipftest ###############################
|
|
|
|
|
1997-01-05 16:06:38 +03:00
|
|
|
### start ipmon ###############################
|
|
|
|
cd $r
|
|
|
|
echo ipmon:
|
|
|
|
src=ipmon.c
|
|
|
|
man=ipmon.8
|
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
pax -rvw $src $d/src/usr.sbin/ipf/ipmon
|
1997-05-28 02:24:25 +04:00
|
|
|
cd man; pax -rvw $man $d/src/usr.sbin/ipf/ipmon; cd ..
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
cd $d/src/usr.sbin/ipf/ipmon
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
PROG= ipmon
|
|
|
|
MAN= ipmon.8
|
1997-10-25 10:57:53 +04:00
|
|
|
CPPFLAGS+=-DLOGFAC=LOG_LOCAL0 -I${.CURDIR}/../ipf
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-05-07 17:20:40 +04:00
|
|
|
.PATH: ${.CURDIR}/../ipf
|
1997-01-05 16:06:38 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end ipmon ###############################
|
|
|
|
|
|
|
|
### start ipnat ###############################
|
|
|
|
cd $r
|
|
|
|
echo ipnat:
|
|
|
|
src=ipnat.c
|
|
|
|
man='ipnat.1 ipnat.4 ipnat.5'
|
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
pax -rvw $src $d/src/usr.sbin/ipf/ipnat
|
1997-05-28 02:24:25 +04:00
|
|
|
cd man; pax -rvw $man $d/src/usr.sbin/ipf/ipnat; cd ..
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
cd $d/src/usr.sbin/ipf/ipnat
|
1997-01-05 16:06:38 +03:00
|
|
|
mv ipnat.1 ipnat.8
|
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
PROG= ipnat
|
|
|
|
SRCS= kmem.c ipnat.c
|
|
|
|
MAN= ipnat.8 ipnat.4 ipnat.5
|
1997-09-21 20:34:31 +04:00
|
|
|
MLINKS= ipnat.5 ipnat.conf.5
|
1997-10-25 10:57:53 +04:00
|
|
|
CPPFLAGS+=-I${.CURDIR}/../ipf -I${.CURDIR}/../ipfstat
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-04-13 18:49:38 +04:00
|
|
|
.PATH: ${.CURDIR}/../ipf ${.CURDIR}/../ipfstat
|
1997-01-05 16:06:38 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end ipnat ###############################
|
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
### start of ipresend ##############################
|
1997-01-05 16:06:38 +03:00
|
|
|
cd $r
|
1997-03-29 23:28:17 +03:00
|
|
|
echo ipresend:
|
|
|
|
src='ipresend.c resend.c'
|
1997-09-21 20:34:31 +04:00
|
|
|
man=ipresend.1
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-09-21 20:34:31 +04:00
|
|
|
cd ipsend; pax -rvw $src $man $d/src/usr.sbin/ipf/ipresend
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
cd $d/src/usr.sbin/ipf/ipresend
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-03-29 23:28:17 +03:00
|
|
|
PROG= ipresend
|
1997-11-24 02:20:08 +03:00
|
|
|
SRCS= ipresend.c ip.c resend.c opt.c ipft_ef.c ipft_hx.c ipft_sn.c ipft_td.c ipft_tx.c sbpf.c 44arp.c ipft_pc.c
|
1997-09-21 20:34:31 +04:00
|
|
|
MAN= ipresend.1
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1998-05-17 20:05:39 +04:00
|
|
|
CPPFLAGS+=-I${.CURDIR}/../ipf -I${.CURDIR}/../ipfstat
|
|
|
|
CPPFLAGS+=-I${.CURDIR}/../ipsend -I${.CURDIR}/../ipftest
|
|
|
|
|
|
|
|
.PATH: ${.CURDIR}/../ipf ${.CURDIR}/../ipfstat
|
|
|
|
.PATH: ${.CURDIR}/../ipsend ${.CURDIR}/../ipftest
|
|
|
|
|
1997-01-05 16:06:38 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
1997-03-29 23:28:17 +03:00
|
|
|
### end of ipresend ###############################
|
|
|
|
|
|
|
|
### start of ipsend ##############################
|
|
|
|
cd $r
|
|
|
|
echo ipsend:
|
1997-09-21 20:34:31 +04:00
|
|
|
src='44arp.c ip.c ipsend.c ipsend.h ipsopt.c sbpf.c tcpip.h'
|
|
|
|
src2='iplang_l.l iplang_y.y iplang.tst iplang.h'
|
|
|
|
man='ipsend.1 ipsend.5'
|
1997-03-29 23:28:17 +03:00
|
|
|
|
1997-09-21 20:34:31 +04:00
|
|
|
cd ipsend; pax -rvw $src $man $d/src/usr.sbin/ipf/ipsend
|
|
|
|
cd $r
|
|
|
|
cd iplang; pax -rvw $src2 $d/src/usr.sbin/ipf/ipsend
|
1997-03-29 23:28:17 +03:00
|
|
|
|
|
|
|
cd $d/src/usr.sbin/ipf/ipsend
|
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-03-29 23:28:17 +03:00
|
|
|
|
|
|
|
PROG= ipsend
|
1997-09-21 20:34:31 +04:00
|
|
|
SRCS= ipsend.c ip.c ipsopt.c 44arp.c sbpf.c iplang_l.l iplang_y.y
|
1997-10-25 10:57:53 +04:00
|
|
|
CPPFLAGS+=-I${.CURDIR}/../ipftest -I${.CURDIR}/../ipf -I.
|
1998-04-09 04:32:31 +04:00
|
|
|
YHEADER=1
|
1997-09-21 20:34:31 +04:00
|
|
|
LDADD= -ll
|
|
|
|
DPADD= ${LIBL}
|
|
|
|
|
|
|
|
MAN= ipsend.1 ipsend.5
|
1997-03-29 23:28:17 +03:00
|
|
|
|
1997-04-13 18:49:38 +04:00
|
|
|
.PATH: ${.CURDIR}/../ipf
|
1997-03-29 23:28:17 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end of ipsend ###############################
|
|
|
|
|
|
|
|
### start of iptest ##############################
|
|
|
|
cd $r
|
|
|
|
echo iptest:
|
|
|
|
src='iptest.c iptests.c sock.c'
|
1997-09-21 20:34:31 +04:00
|
|
|
man=iptest.1
|
1997-03-29 23:28:17 +03:00
|
|
|
|
1997-09-21 20:34:31 +04:00
|
|
|
cd ipsend; pax -rvw $src $man $d/src/usr.sbin/ipf/iptest
|
1997-03-29 23:28:17 +03:00
|
|
|
|
|
|
|
cd $d/src/usr.sbin/ipf/iptest
|
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-03-29 23:28:17 +03:00
|
|
|
|
|
|
|
PROG= iptest
|
|
|
|
SRCS= iptest.c iptests.c ip.c sbpf.c 44arp.c sock.c
|
1997-09-21 20:34:31 +04:00
|
|
|
MAN= iptest.1
|
1997-10-25 10:57:53 +04:00
|
|
|
CPPFLAGS+=-I${.CURDIR}/../ipsend -I${.CURDIR}/../ipftest -I${.CURDIR}/../ipf
|
1997-03-29 23:28:17 +03:00
|
|
|
|
1997-04-13 18:49:38 +04:00
|
|
|
.PATH: ${.CURDIR}/../ipf ${.CURDIR}/../ipsend
|
1997-03-29 23:28:17 +03:00
|
|
|
.include <bsd.prog.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end of iptest ###############################
|
1997-01-05 16:06:38 +03:00
|
|
|
|
1997-09-21 20:34:31 +04:00
|
|
|
### start of rules ##############################
|
|
|
|
cd $r
|
|
|
|
echo rules:
|
1997-11-23 23:59:42 +03:00
|
|
|
file=mkfilters
|
|
|
|
man=mkfilters.1
|
1997-09-21 20:34:31 +04:00
|
|
|
|
|
|
|
pax -rvw rules $d/src/usr.sbin/ipf
|
1997-11-23 23:59:42 +03:00
|
|
|
pax -rvw $file $d/src/usr.sbin/ipf/rules
|
|
|
|
cd man; pax -rvw $man $d/src/usr.sbin/ipf/rules
|
1997-09-21 20:34:31 +04:00
|
|
|
|
|
|
|
cd $d/src/usr.sbin/ipf/rules
|
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-09-21 20:34:31 +04:00
|
|
|
|
1998-09-29 10:59:53 +04:00
|
|
|
.if !defined(NOSHARE)
|
1997-11-13 12:46:41 +03:00
|
|
|
FILESDIR= /usr/share/examples/ipf
|
1997-11-23 23:59:42 +03:00
|
|
|
MAN= mkfilters.1
|
1997-09-21 20:34:31 +04:00
|
|
|
|
1997-11-13 12:46:41 +03:00
|
|
|
FILES= BASIC.NAT BASIC_1.FW BASIC_2.FW example.1 example.2 example.3 \
|
|
|
|
example.4 example.5 example.6 example.7 example.8 example.9 \
|
|
|
|
example.10 example.sr firewall ftp-proxy ftppxy nat-setup \
|
1997-11-23 23:59:42 +03:00
|
|
|
nat.eg server tcpstate mkfilters
|
1998-09-29 10:59:53 +04:00
|
|
|
.endif
|
1997-09-21 20:34:31 +04:00
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
1997-11-23 23:59:42 +03:00
|
|
|
.include <bsd.man.mk>
|
1997-09-21 20:34:31 +04:00
|
|
|
.include <bsd.files.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end of rules ###############################
|
|
|
|
|
1997-01-05 16:06:38 +03:00
|
|
|
### start ipfilter in kernel #######################
|
|
|
|
cd $r
|
|
|
|
echo kernel modules:
|
1997-09-21 20:34:31 +04:00
|
|
|
src='ip_auth.c ip_auth.h ip_fil.c fil.c ip_nat.c ip_frag.c ip_state.c ip_fil.h ip_compat.h ip_frag.h ip_nat.h ip_state.h ip_proxy.c ip_proxy.h ip_ftp_pxy.c ip_log.c'
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
pax -rvw $src $d/src/sys/netinet
|
|
|
|
### end ipfilter in kernel #######################
|
|
|
|
|
|
|
|
### start ip_fil lkm #######################
|
|
|
|
cd $r
|
|
|
|
echo loadable kernel modules:
|
|
|
|
src='mln_ipl.c ipl.h'
|
|
|
|
|
|
|
|
pax -rvw $src $d/src/sys/lkm/netinet/if_ipl
|
|
|
|
|
|
|
|
cd $d/src/sys/lkm/netinet/if_ipl
|
|
|
|
|
|
|
|
echo creating Makefile
|
|
|
|
cat > Makefile<<'__eof_makefile'
|
1998-09-29 10:59:53 +04:00
|
|
|
# $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
.include "../Makefile.inc"
|
|
|
|
|
|
|
|
.PATH: $S/netinet
|
|
|
|
|
1998-02-06 09:44:47 +03:00
|
|
|
CPPFLAGS+= -DIPFILTER_LOG
|
1997-01-05 16:06:38 +03:00
|
|
|
KMOD= if_ipl
|
1997-09-21 20:34:31 +04:00
|
|
|
SRCS= ip_fil.c fil.c mln_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c \
|
|
|
|
ip_auth.c ip_log.c
|
1997-01-05 16:06:38 +03:00
|
|
|
NOMAN= yes
|
|
|
|
|
|
|
|
.include <bsd.kmod.mk>
|
|
|
|
__eof_makefile
|
|
|
|
### end ip_fil lkm #######################
|
|
|
|
|
1997-09-21 20:34:31 +04:00
|
|
|
find $d -name '*.[chly]' -print | while read c; do
|
1997-01-05 16:06:38 +03:00
|
|
|
sed -e 's/"ip_fil.h"/<netinet\/ip_fil.h>/
|
|
|
|
s/"ip_compat.h"/<netinet\/ip_compat.h>/
|
|
|
|
s/"ip_nat.h"/<netinet\/ip_nat.h>/
|
|
|
|
s/"ip_frag.h"/<netinet\/ip_frag.h>/
|
|
|
|
s/"ip_state.h"/<netinet\/ip_state.h>/
|
1997-05-28 02:24:25 +04:00
|
|
|
s/"ip_proxy.h"/<netinet\/ip_proxy.h>/
|
1997-07-06 09:09:04 +04:00
|
|
|
s/"ip_auth.h"/<netinet\/ip_auth.h>/
|
1997-05-27 11:16:24 +04:00
|
|
|
s/\$\(Id.*\)\$/\1/' \
|
1997-01-05 16:06:38 +03:00
|
|
|
< $c > /tmp/ipf2n$$ && mv /tmp/ipf2n$$ $c && echo transformed $c
|
1998-07-12 18:39:11 +04:00
|
|
|
sed 1q < $c | grep -q '\$NetBSD' || (
|
|
|
|
cat <<'__eof_header' > /tmp/ipf3n$$
|
1998-09-29 10:59:53 +04:00
|
|
|
/* $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $ */
|
1997-01-05 16:06:38 +03:00
|
|
|
|
|
|
|
__eof_header
|
1998-07-12 18:39:11 +04:00
|
|
|
cat $c >> /tmp/ipf3n$$
|
|
|
|
mv /tmp/ipf3n$$ $c && echo added RCS tag to $c
|
|
|
|
)
|
1997-01-05 16:06:38 +03:00
|
|
|
done
|
|
|
|
|
1998-07-12 18:45:10 +04:00
|
|
|
find $d -name '*.[0-9]' -a \! -name 'example.*' -print | while read m; do
|
|
|
|
sed 1q < $m | grep -q '\$NetBSD' || (
|
|
|
|
cat <<'__eof_header' > /tmp/ipf3n$$
|
1998-09-29 10:59:53 +04:00
|
|
|
.\" $NetBSD: ipfilter2netbsd,v 1.26 1998/09/29 07:00:43 lukem Exp $
|
1998-07-12 18:45:10 +04:00
|
|
|
.\"
|
|
|
|
__eof_header
|
|
|
|
cat $m >> /tmp/ipf3n$$
|
|
|
|
mv /tmp/ipf3n$$ $m && echo added RCS tag to $m
|
|
|
|
)
|
|
|
|
done
|
1998-07-12 18:39:11 +04:00
|
|
|
|
1997-05-28 02:24:25 +04:00
|
|
|
echo done
|
|
|
|
|
1997-09-21 20:34:31 +04:00
|
|
|
# Clean up any CVS directories that might be around.
|
|
|
|
echo "cleaning up CVS residue."
|
1997-05-28 02:24:25 +04:00
|
|
|
(
|
1997-09-21 20:34:31 +04:00
|
|
|
cd $d
|
|
|
|
find . -type d -name "CVS" -print | xargs rm -r
|
1997-05-28 02:24:25 +04:00
|
|
|
)
|
|
|
|
echo done
|
|
|
|
|
1997-09-21 20:34:31 +04:00
|
|
|
# Fixing file and directory permissions.
|
|
|
|
echo "Fixing file/directory permissions."
|
1997-05-28 02:24:25 +04:00
|
|
|
(
|
|
|
|
cd $d
|
1997-09-21 20:34:31 +04:00
|
|
|
find . -type f -print | xargs chmod u+rw,go+r
|
|
|
|
find . -type d -print | xargs chmod u+rwx,go+rx
|
1997-05-28 02:24:25 +04:00
|
|
|
)
|
1997-01-05 16:06:38 +03:00
|
|
|
echo done
|
1997-09-21 20:34:31 +04:00
|
|
|
|
1997-01-05 16:06:38 +03:00
|
|
|
exit 0
|