head	1.3;
access;
symbols
	perseant-exfatfs-base-20250801:1.3
	perseant-exfatfs-base-20240630:1.3
	perseant-exfatfs:1.3.0.48
	perseant-exfatfs-base:1.3
	cjep_sun2x:1.3.0.46
	cjep_sun2x-base:1.3
	cjep_staticlib_x-base1:1.3
	cjep_staticlib_x:1.3.0.44
	cjep_staticlib_x-base:1.3
	phil-wifi-20200421:1.3
	phil-wifi-20200411:1.3
	phil-wifi-20200406:1.3
	pgoyette-compat-merge-20190127:1.3
	pgoyette-compat-20190127:1.3
	pgoyette-compat-20190118:1.3
	pgoyette-compat-1226:1.3
	pgoyette-compat-1126:1.3
	pgoyette-compat-1020:1.3
	pgoyette-compat-0930:1.3
	pgoyette-compat-0906:1.3
	pgoyette-compat-0728:1.3
	pgoyette-compat-0625:1.3
	pgoyette-compat-0521:1.3
	pgoyette-compat-0502:1.3
	pgoyette-compat-0422:1.3
	pgoyette-compat-0415:1.3
	pgoyette-compat-0407:1.3
	pgoyette-compat-0330:1.3
	pgoyette-compat-0322:1.3
	pgoyette-compat-0315:1.3
	pgoyette-compat:1.3.0.42
	pgoyette-compat-base:1.3
	perseant-stdc-iso10646:1.3.0.40
	perseant-stdc-iso10646-base:1.3
	prg-localcount2-base3:1.3
	prg-localcount2-base2:1.3
	prg-localcount2-base1:1.3
	prg-localcount2:1.3.0.38
	prg-localcount2-base:1.3
	pgoyette-localcount-20170426:1.3
	bouyer-socketcan-base1:1.3
	pgoyette-localcount-20170320:1.3
	bouyer-socketcan:1.3.0.36
	bouyer-socketcan-base:1.3
	pgoyette-localcount-20170107:1.3
	pgoyette-localcount-20161104:1.3
	localcount-20160914:1.3
	pgoyette-localcount-20160806:1.3
	pgoyette-localcount-20160726:1.3
	pgoyette-localcount:1.3.0.34
	pgoyette-localcount-base:1.3
	netbsd-5-2-3-RELEASE:1.3
	netbsd-5-1-5-RELEASE:1.3
	yamt-pagecache-base9:1.3
	yamt-pagecache-tag8:1.3
	tls-earlyentropy:1.3.0.30
	tls-earlyentropy-base:1.3
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.3
	riastradh-drm2-base3:1.3
	netbsd-5-2-2-RELEASE:1.3
	netbsd-5-1-4-RELEASE:1.3
	netbsd-5-2-1-RELEASE:1.3
	netbsd-5-1-3-RELEASE:1.3
	agc-symver:1.3.0.32
	agc-symver-base:1.3
	tls-maxphys-base:1.3
	yamt-pagecache-base8:1.3
	netbsd-5-2:1.3.0.28
	yamt-pagecache-base7:1.3
	netbsd-5-2-RELEASE:1.3
	netbsd-5-2-RC1:1.3
	yamt-pagecache-base6:1.3
	yamt-pagecache-base5:1.3
	yamt-pagecache-base4:1.3
	netbsd-5-1-2-RELEASE:1.3
	netbsd-5-1-1-RELEASE:1.3
	yamt-pagecache-base3:1.3
	yamt-pagecache-base2:1.3
	yamt-pagecache:1.3.0.26
	yamt-pagecache-base:1.3
	bouyer-quota2-nbase:1.3
	bouyer-quota2:1.3.0.24
	bouyer-quota2-base:1.3
	matt-nb5-pq3:1.3.0.22
	matt-nb5-pq3-base:1.3
	netbsd-5-1:1.3.0.20
	netbsd-5-1-RELEASE:1.3
	netbsd-5-1-RC4:1.3
	netbsd-5-1-RC3:1.3
	netbsd-5-1-RC2:1.3
	netbsd-5-1-RC1:1.3
	netbsd-5-0-2-RELEASE:1.3
	netbsd-5-0-1-RELEASE:1.3
	jym-xensuspend-nbase:1.3
	netbsd-5-0:1.3.0.18
	netbsd-5-0-RELEASE:1.3
	netbsd-5-0-RC4:1.3
	netbsd-5-0-RC3:1.3
	netbsd-5-0-RC2:1.3
	jym-xensuspend:1.3.0.16
	jym-xensuspend-base:1.3
	netbsd-5-0-RC1:1.3
	netbsd-5:1.3.0.14
	netbsd-5-base:1.3
	yamt-pf42-base4:1.3
	yamt-pf42-base3:1.3
	hpcarm-cleanup-nbase:1.3
	yamt-pf42-base2:1.3
	yamt-pf42:1.3.0.12
	yamt-pf42-base:1.3
	mjf-devfs2:1.3.0.10
	mjf-devfs2-base:1.3
	keiichi-mipv6:1.3.0.8
	keiichi-mipv6-base:1.3
	cube-autoconf:1.3.0.6
	cube-autoconf-base:1.3
	mjf-devfs:1.3.0.4
	mjf-devfs-base:1.3
	hpcarm-cleanup:1.3.0.2
	hpcarm-cleanup-base:1.3
	ipf_3_1_2:1.1.1.1
	AVALON:1.1.1;
locks; strict;
comment	@# @;


1.3
date	97.04.13.02.03.38;	author mrg;	state dead;
branches;
next	1.2;

1.2
date	97.03.29.20.28.17;	author thorpej;	state Exp;
branches;
next	1.1;

1.1
date	97.01.05.13.06.38;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	97.01.05.13.06.38;	author mrg;	state Exp;
branches;
next	;


desc
@@


1.3
log
@move these to usr.sbin/ipf/ipf.
@
text
@#! /bin/sh
#
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $
#
# 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
mkdir -p src/sbin/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/sys/lkm/netinet/if_ipl

### start ipf ###############################
cd $r
echo ipf:
src='ipf.c parse.c opt.c ipf.h'
man='ipf.1 ipf.4 ipf.5 ipl.4'

pax -rvw $src $d/src/sbin/ipf
cd man; pax -rvw $man $d/src/sbin/ipf; cd ..

cd $d/src/sbin/ipf
mv ipf.1 ipf.8

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	ipf
SRCS=	ipf.c parse.c opt.c
MAN=	ipf.8 ipf.4 ipf.5 ipl.4
MLINKS=	ipl.4 ipfilter.4

.include <bsd.prog.mk>
__eof_makefile
### end ipf ###############################

### start ipfstat ###############################
cd $r
echo ipfstat:
src='kmem.c kmem.h fils.c'
man=ipfstat.8

pax -rvw $src $d/src/usr.sbin/ipf/ipfstat
cd man; pax -rvw $man $d/src/usr.sbin/ipf/ipfstat; cd ..

cd $d/src/usr.sbin/ipf/ipfstat

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	ipfstat
SRCS=	kmem.c fils.c opt.c parse.c
MAN=	ipfstat.8
CFLAGS+=-I${.CURDIR}/../../sbin/ipf

.PATH: ${.CURDIR}/../../sbin/ipf
.include <bsd.prog.mk>
__eof_makefile

### end ipfstat ###############################

### start ipftest ###############################
cd $r
echo ipftest:
src='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 ipt.h snoop.h'

pax -rvw $src test $d/src/usr.sbin/ipf/ipftest

cd $d/src/usr.sbin/ipf/ipftest

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	ipftest
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
NOMAN=	yes
CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../../../sbin/ipf -I${.CURDIR}/../../../sys

.PATH: ${.CURDIR}/../../../sbin/ipf ${.CURDIR}/../../../sys/netinet
.include <bsd.prog.mk>
__eof_makefile
### end ipftest ###############################

### start ipmon ###############################
cd $r
echo ipmon:
src=ipmon.c
man=ipmon.8

pax -rvw $src $d/src/usr.sbin/ipf/ipmon
cd man; pax -rvw $man $d/src/usr.sbin/ipmon; cd ..

cd $d/src/usr.sbin/ipf/ipmon

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	ipmon
MAN=	ipmon.8
CFLAGS+=-DLOGFAC=LOG_LOCAL0 -I${.CURDIR}/../../sbin/ipf

.PATH: .${CURDIR}/../../sbin/ipf
.include <bsd.prog.mk>
__eof_makefile
### end ipmon ###############################

### start ipnat ###############################
cd $r
echo ipnat:
src=ipnat.c
man='ipnat.1 ipnat.4 ipnat.5'

pax -rvw $src $d/src/usr.sbin/ipf/ipnat
cd man; pax -rvw $man $d/src/usr.sbin/ipnat; cd ..

cd $d/src/usr.sbin/ipf/ipnat
mv ipnat.1 ipnat.8

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	ipnat
SRCS=	kmem.c ipnat.c
MAN=	ipnat.8 ipnat.4 ipnat.5
CFLAGS+=-I${.CURDIR}/../../sbin/ipf -I${.CURDIR}/../ipfstat

.PATH: ${.CURDIR}/../../sbin/ipf ${.CURDIR}/../ipfstat
.include <bsd.prog.mk>
__eof_makefile
### end ipnat ###############################

### start of ipresend ##############################
cd $r
echo ipresend:
src='ipresend.c resend.c'

pax -rvw $src $d/src/usr.sbin/ipf/ipresend

cd $d/src/usr.sbin/ipf/ipresend

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	ipresend
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
NOMAN=	yes
CFLAGS+=-I${.CURDIR}/../ipfstat -I${.CURDIR}/../ipsend -I${.CURDIR}/../ipftest -I${.CURDIR}/../../../sbin/ipf

.PATH: ${.CURDIR}/../../../sbin/ipf ${.CURDIR}/../ipfstat ${.CURDIR}/../ipsend ${.CURDIR}/../ipftest
.include <bsd.prog.mk>
__eof_makefile
### end of ipresend ###############################

### start of ipsend ##############################
cd $r
echo ipsend:
src='44arp.c ip.c ip_compat.h ipsend.c ipsopt.c sbpf.c'

pax -rvw $src $d/src/usr.sbin/ipf/ipsend

cd $d/src/usr.sbin/ipf/ipsend

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	ipsend
SRCS=	ipsend.c ip.c ipsopt.c 44arp.c sbpf.c
NOMAN=	yes
CFLAGS+=-I${.CURDIR}/../ipftest -I${.CURDIR}/../../../sbin/ipf

.PATH: ${.CURDIR}/../../../sbin/ipf
.include <bsd.prog.mk>
__eof_makefile
### end of ipsend ###############################

### start of iptest ##############################
cd $r
echo iptest:
src='iptest.c iptests.c sock.c'

pax -rvw $src $d/src/usr.sbin/ipf/iptest

cd $d/src/usr.sbin/ipf/iptest

echo creating Makefile
cat > Makefile<<'__eof_makefile'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

PROG=	iptest
SRCS=	iptest.c iptests.c ip.c sbpf.c 44arp.c sock.c
NOMAN=	yes
CFLAGS+=-I${.CURDIR}/../ipsend -I${.CURDIR}/../ipftest -I${.CURDIR}/../../../sbin/ipf

.PATH: ${.CURDIR}/../../../sbin/ipf ${.CURDIR}/../ipsend
.include <bsd.prog.mk>
__eof_makefile
### end of iptest ###############################

### start ipfilter in kernel #######################
cd $r
echo kernel modules:
src='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'

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'
#	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $

.include "../Makefile.inc"

.PATH: $S/netinet

KMOD=	if_ipl
SRCS=	ip_fil.c fil.c mln_ipl.c ip_nat.c ip_frag.c ip_state.c
NOMAN=	yes

.include <bsd.kmod.mk>
__eof_makefile
### end ip_fil lkm #######################

find $d -name '*.[ch]' -print | while read c; do
	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>/
		s/<sys\/ip_fil.h>/<netinet\/ip_fil.h>/' \
	< $c > /tmp/ipf2n$$ && mv /tmp/ipf2n$$ $c && echo transformed $c
	sed 1q < $c | grep '\$NetBSD' || (
cat <<'__eof_header'
/*	$NetBSD: ipfilter2netbsd,v 1.2 1997/03/29 20:28:17 thorpej Exp $	*/

__eof_header
cat $c
	) > /tmp/ipf3n$$ && cp /tmp/ipf3n$$ $c && echo added RCS tags to $c
done

echo done
exit 0
@


1.2
log
@Bring this in touch with reality.
@
text
@d3 1
a3 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d79 1
a79 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d103 1
a103 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d127 1
a127 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d152 1
a152 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d177 1
a177 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d200 1
a200 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d223 1
a223 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d246 1
a246 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d277 1
a277 1
#	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $
d301 1
a301 1
/*	$NetBSD: ipfilter2netbsd,v 1.1.1.1 1997/01/05 13:06:38 mrg Exp $	*/
@


1.1
log
@Initial revision
@
text
@d3 1
a3 1
#	$NetBSD$
d63 1
a63 1
mkdir -p src/sbin/ipf src/sys/netinet src/usr.sbin/ipfstat src/usr.sbin/ipmon src/usr.sbin/ipftest src/usr.sbin/ipnat src/sys/lkm/netinet/if_ipl
d79 1
a79 1
#	$NetBSD$
d84 1
d96 2
a97 2
pax -rvw $src $d/src/usr.sbin/ipfstat
cd man; pax -rvw $man $d/src/usr.sbin/ipfstat; cd ..
d99 1
a99 1
cd $d/src/usr.sbin/ipfstat
d103 1
a103 1
#	$NetBSD$
d108 1
a108 1
CFLAGS+=        -I${.CURDIR}/../../sbin/ipf
d116 23
d145 1
a145 1
pax -rvw $src $d/src/usr.sbin/ipmon
d148 1
a148 1
cd $d/src/usr.sbin/ipmon
d152 1
a152 1
#	$NetBSD$
d156 1
a156 1
CFLAGS+=        -DLOGFAC=LOG_LOCAL0 -I${.CURDIR}/../../sbin/ipf
d169 1
a169 1
pax -rvw $src $d/src/usr.sbin/ipnat
d172 1
a172 1
cd $d/src/usr.sbin/ipnat
d177 1
a177 1
#	$NetBSD$
d182 1
a182 1
CFLAGS+=	-I${.CURDIR}/../../sbin/ipf -I${.CURDIR}/../ipfstat
d189 47
a235 1
### start ipftest ###############################
d237 2
a238 2
echo ipftest:
src='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 ipt.h snoop.h'
d240 1
a240 1
pax -rvw $src test $d/src/usr.sbin/ipftest
d242 1
a242 1
cd $d/src/usr.sbin/ipftest
d246 1
a246 1
#	$NetBSD$
d248 2
a249 2
PROG=	ipftest
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
d251 1
a251 1
CFLAGS+=	-I${.CURDIR}/../../sbin/ipf
d253 1
a253 1
.PATH: ${.CURDIR}/../../sbin/ipf
d256 1
a256 1
### end ipftest ###############################
d277 1
a277 1
#	$NetBSD$
d301 1
a301 1
/*	$NetBSD$	*/
@


1.1.1.1
log
@initial import of darren reed's ip-filter, version 3.1.2.
@
text
@@
