mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
create a new build heirarchy for ipfilter tools
This commit is contained in:
parent
1033f3c55b
commit
f81bd860b1
@ -1,18 +1,8 @@
|
||||
# $FreeBSD$
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../contrib/ipfilter ${.CURDIR}/../../contrib/ipfilter/man
|
||||
#.WAIT
|
||||
SUBDIR= libipf
|
||||
SUBDIR+= ipf ipfs ipfstat ipftest ipmon ipnat ippool ipresend
|
||||
#SUBDIR+= ipsend iptest rules
|
||||
|
||||
PROG= ipf
|
||||
MAN= ipf.4 ipf.5 ipf.8
|
||||
MLINKS= ipf.5 ipf.conf.5 \
|
||||
ipf.5 ipf6.conf.5
|
||||
SRCS= ipf.c parse.c opt.c facpri.c common.c
|
||||
CFLAGS+=-DUSE_INET6 -DIPL_NAME=\"/dev/ipl\"
|
||||
CFLAGS+=-I${.CURDIR}/../../sys/contrib/ipfilter/netinet
|
||||
CFLAGS+=-I${.CURDIR}/../../sys/contrib/ipfilter
|
||||
CFLAGS+=-I${.CURDIR}/../../contrib/ipfilter
|
||||
WARNS?= 0
|
||||
|
||||
MAINTAINER= darrenr@freebsd.org
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
.include <bsd.subdir.mk>
|
||||
|
24
sbin/ipf/Makefile.inc
Normal file
24
sbin/ipf/Makefile.inc
Normal file
@ -0,0 +1,24 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
CFLAGS+= -I${.CURDIR}/../../../contrib/ipfilter
|
||||
CFLAGS+= -I${.CURDIR}/../../../contrib/ipfilter/tools
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/contrib/ipfilter
|
||||
CFLAGS+= -DSTATETOP -D__UIO_EXPOSE
|
||||
|
||||
IPFOBJDIR= ${.OBJDIR}/../libipf
|
||||
DPADD+= ${IPFOBJDIR}/libipf.a ${LIBKVM}
|
||||
LDADD+= -L${IPFOBJDIR} -lipf -lkvm
|
||||
|
||||
CLEANFILES+= y.tab.c y.tab.h
|
||||
|
||||
.PATH: ${.CURDIR}/../../../contrib/ipfilter \
|
||||
${.CURDIR}/../../../contrib/ipfilter/lib \
|
||||
${.CURDIR}/../../../contrib/ipfilter/tools \
|
||||
${.CURDIR}/../../../contrib/ipfilter/man
|
||||
|
||||
.if exists(${.CURDIR}/../../Makefile.inc)
|
||||
.include "${.CURDIR}/../../Makefile.inc"
|
||||
.endif
|
44
sbin/ipf/ipf/Makefile
Normal file
44
sbin/ipf/ipf/Makefile
Normal file
@ -0,0 +1,44 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <bsd.own.mk> # for MKDYNAMICROOT definition
|
||||
|
||||
PROG= ipf
|
||||
SRCS= ipf.c ipfcomp.c ipf_y.c ipf_l.c
|
||||
MAN= ipf.8 ipf.4 ipf.5 ipl.4
|
||||
MLINKS= ipl.4 ipfilter.4 ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5
|
||||
CFLAGS+= -I.
|
||||
|
||||
DPSRCS+= ipf_l.h ipf_y.h
|
||||
|
||||
CLEANFILES+= ipf_y.c ipf_y.h
|
||||
CLEANFILES+= ipf_l.c ipf_l.h
|
||||
|
||||
ipf_y.c: ipf_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -d ${.ALLSRC}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
-e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
|
||||
y.tab.c > ${.TARGET}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
y.tab.h > ${.TARGET:.c=.h}
|
||||
|
||||
ipf_y.h: ipf_y.c
|
||||
|
||||
ipf_l.c: lexer.c
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
-e 's/y.tab.h/ipf_y.h/' \
|
||||
-e 's/lexer.h/ipf_l.h/' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ipf_l.h: lexer.h
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
BINDIR= /sbin
|
||||
.if defined(NO_DYNAMICROOT)
|
||||
LDSTATIC?= -static
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
6
sbin/ipf/ipfs/Makefile
Normal file
6
sbin/ipf/ipfs/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= ipfs
|
||||
MAN= ipfs.8
|
||||
|
||||
.include <bsd.prog.mk>
|
11
sbin/ipf/ipfstat/Makefile
Normal file
11
sbin/ipf/ipfstat/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
# $FreeBSD$
|
||||
|
||||
NOGCCERROR= # defined
|
||||
|
||||
PROG= ipfstat
|
||||
SRCS= ipfstat.c
|
||||
MAN= ipfstat.8
|
||||
DPADD+= ${LIBCURSES}
|
||||
LDADD+= -lcurses
|
||||
|
||||
.include <bsd.prog.mk>
|
103
sbin/ipf/ipftest/Makefile
Normal file
103
sbin/ipf/ipftest/Makefile
Normal file
@ -0,0 +1,103 @@
|
||||
# $FreeBSD$
|
||||
|
||||
NOGCCERROR= # defined
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= ipftest
|
||||
SRCS= ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \
|
||||
ip_proxy.c ip_auth.c ip_htable.c ip_lookup.c \
|
||||
ip_pool.c ip_scan.c ip_sync.c ip_rules.c \
|
||||
ip_fil.c ip_log.c ippool_y.c ippool_l.c ipf_y.c \
|
||||
ipf_l.c ipnat_y.c ipnat_l.c md5.c radix.c bpf_filter.c
|
||||
MAN= ipftest.1
|
||||
|
||||
CFLAGS+= -DIPFILTER_LOG -DIPFILTER_COMPILED -DIPFILTER_LOOKUP \
|
||||
-DIPFILTER_SCAN -DIPFILTER_SYNC -DIPFILTER_CKSUM -I.
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/sys/netinet
|
||||
|
||||
DPSRCS+= ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h
|
||||
|
||||
CLEANFILES+= ipf_y.c ipf_y.h
|
||||
CLEANFILES+= ipf_l.c ipf_l.h
|
||||
CLEANFILES+= ipf.tab.c ipf.tab.h
|
||||
CLEANFILES+= ipnat_y.c ipnat_y.h
|
||||
CLEANFILES+= ipnat_l.c ipnat_l.h
|
||||
CLEANFILES+= ipnat.tab.c ipnat.tab.h
|
||||
CLEANFILES+= ippool_y.c ippool_y.h
|
||||
CLEANFILES+= ippool_l.c ippool_l.h
|
||||
CLEANFILES+= ippool.tab.c ippool.tab.h
|
||||
|
||||
ipnat_y.c: ipnat_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -b ipnat -d ${.ALLSRC}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
-e 's/y.tab.c/ipnat_y.c/' \
|
||||
-e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
|
||||
ipnat.tab.c > ${.TARGET}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
-e 's/y.tab.h/ipnat_y.h/' \
|
||||
ipnat.tab.h > ${.TARGET:.c=.h}
|
||||
|
||||
ipnat_y.h: ipnat_y.c
|
||||
|
||||
ipnat_l.c: lexer.c
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
-e 's/y.tab.h/ipnat_y.h/' \
|
||||
-e 's/lexer.h/ipnat_l.h/' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ipnat_l.h: lexer.h
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ippool_y.c: ippool_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -b ippool -d ${.ALLSRC}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
-e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \
|
||||
ippool.tab.c > ${.TARGET}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
ippool.tab.h > ${.TARGET:.c=.h}
|
||||
|
||||
ippool_y.h: ippool_y.c
|
||||
|
||||
ippool_l.c: lexer.c
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
-e 's/y.tab.h/ippool_y.h/' \
|
||||
-e 's/lexer.h/ippool_l.h/' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ippool_l.h: lexer.h
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ipf_y.c: ipf_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -b ipf -d ${.ALLSRC}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
-e 's/"ipf_y.y"/"..\/tools\/ipf_y.y"/' \
|
||||
ipf.tab.c > ${.TARGET}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
ipf.tab.h > ${.TARGET:.c=.h}
|
||||
|
||||
ipf_y.h: ipf_y.c
|
||||
|
||||
ipf_l.c: lexer.c
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
-e 's/y.tab.h/ipf_y.h/' \
|
||||
-e 's/lexer.h/ipf_l.h/' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ipf_l.h: lexer.h
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipf_yy/g' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
37
sbin/ipf/ipmon/Makefile
Normal file
37
sbin/ipf/ipmon/Makefile
Normal file
@ -0,0 +1,37 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= ipmon
|
||||
SRCS= ipmon.c ipmon_y.c ipmon_l.c
|
||||
MAN= ipmon.8
|
||||
|
||||
CFLAGS+= -DLOGFAC=LOG_LOCAL0 -I.
|
||||
|
||||
DPSRCS+= ipmon_l.h ipmon_y.h
|
||||
|
||||
CLEANFILES+= ipmon_y.c ipmon_y.h
|
||||
CLEANFILES+= ipmon_l.c ipmon_l.h
|
||||
|
||||
ipmon_y.c: ipmon_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -d ${.ALLSRC}
|
||||
sed -e 's/yy/ipmon_yy/g' \
|
||||
-e 's/"ipmon_y.y"/"..\/tools\/ipmon_y.y"/' \
|
||||
y.tab.c > ${.TARGET}
|
||||
sed -e 's/yy/ipmon_yy/g' \
|
||||
y.tab.h > ${.TARGET:.c=.h}
|
||||
|
||||
ipmon_y.h: ipmon_y.c
|
||||
|
||||
ipmon_l.c: lexer.c
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipmon_yy/g' \
|
||||
-e 's/y.tab.h/ipmon_y.h/' \
|
||||
-e 's/lexer.h/ipmon_l.h/' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ipmon_l.h: lexer.h
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipmon_yy/g' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
39
sbin/ipf/ipnat/Makefile
Normal file
39
sbin/ipf/ipnat/Makefile
Normal file
@ -0,0 +1,39 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= ipnat
|
||||
SRCS= ipnat.c ipnat_y.c ipnat_l.c
|
||||
MAN= ipnat.8 ipnat.4 ipnat.5
|
||||
MLINKS= ipnat.5 ipnat.conf.5
|
||||
CFLAGS+= -I.
|
||||
|
||||
DPSRCS+= ipnat_l.h ipnat_y.h
|
||||
|
||||
CLEANFILES+= ipnat_y.c ipnat_y.h
|
||||
CLEANFILES+= ipnat_l.c ipnat_l.h
|
||||
|
||||
ipnat_y.c: ipnat_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -d ${.ALLSRC}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
-e 's/y.tab.c/ipnat_y.c/' \
|
||||
-e s/\"ipnat_y.y\"/\"..\\/tools\\/ipnat_y.y\"/ \
|
||||
y.tab.c > ${.TARGET}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
-e 's/y.tab.h/ipnat_y.h/' \
|
||||
y.tab.h > ${.TARGET:.c=.h}
|
||||
|
||||
ipnat_y.h: ipnat_y.c
|
||||
|
||||
ipnat_l.c: lexer.c
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
-e 's/y.tab.h/ipnat_y.h/' \
|
||||
-e 's/lexer.h/ipnat_l.h/' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ipnat_l.h: lexer.h
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ipnat_yy/g' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
36
sbin/ipf/ippool/Makefile
Normal file
36
sbin/ipf/ippool/Makefile
Normal file
@ -0,0 +1,36 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= ippool
|
||||
SRCS= ippool_y.c ippool_l.c kmem.c ippool.c
|
||||
MAN= ippool.5 ippool.8
|
||||
CFLAGS+= -I.
|
||||
|
||||
DPSRCS+= ippool_l.h ippool_y.h
|
||||
|
||||
CLEANFILES+= ippool_y.c ippool_y.h
|
||||
CLEANFILES+= ippool_l.c ippool_l.h
|
||||
|
||||
ippool_y.c: ippool_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -d ${.ALLSRC}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
-e 's/"ippool_y.y"/"..\/tools\/ippool_y.y"/' \
|
||||
y.tab.c > ${.TARGET}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
y.tab.h > ${.TARGET:.c=.h}
|
||||
|
||||
ippool_y.h: ippool_y.c
|
||||
|
||||
ippool_l.c: lexer.c
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
-e 's/y.tab.h/ippool_y.h/' \
|
||||
-e 's/lexer.h/ippool_l.h/' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
ippool_l.h: lexer.h
|
||||
${_MKTARGET_CREATE}
|
||||
sed -e 's/yy/ippool_yy/g' \
|
||||
${.ALLSRC} > ${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
11
sbin/ipf/ipresend/Makefile
Normal file
11
sbin/ipf/ipresend/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= ipresend
|
||||
SRCS= ipresend.c ip.c resend.c sbpf.c sock.c 44arp.c
|
||||
MAN= ipresend.1
|
||||
|
||||
.PATH: ${.CURDIR}/../../../contrib/ipfilter/ipsend
|
||||
|
||||
.include <bsd.prog.mk>
|
40
sbin/ipf/ipsend/Makefile
Normal file
40
sbin/ipf/ipsend/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
# $FreeBSD$
|
||||
|
||||
NOGCCERROR= # defined
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= ipsend
|
||||
SRCS= ipsend.c ip.c ipsopt.c iplang_y.c iplang_l.l sbpf.c \
|
||||
sock.c 44arp.c
|
||||
MAN= ipsend.1 ipsend.5
|
||||
DPADD+= ${LIBL}
|
||||
LDADD+= -ll
|
||||
|
||||
CFLAGS+= -I${NETBSDSRCDIR}/dist/ipf/ipsend
|
||||
CFLAGS+= -I${NETBSDSRCDIR}/dist/ipf/iplang
|
||||
CFLAGS+= -I.
|
||||
|
||||
CLEANFILES+= iplang_y.c iplang_y.h
|
||||
|
||||
DPSRCS+= iplang_y.h
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/dist/ipf/ipsend \
|
||||
${NETBSDSRCDIR}/dist/ipf/iplang
|
||||
|
||||
iplang_y.c: iplang_y.y
|
||||
${_MKTARGET_CREATE}
|
||||
${YACC} -d ${.ALLSRC}
|
||||
mv y.tab.c ${.TARGET}
|
||||
mv y.tab.h ${.TARGET:.c=.h}
|
||||
|
||||
iplang_y.h: iplang_y.c
|
||||
|
||||
# XXX
|
||||
# We have a problem with make and linking ipsend
|
||||
# cc -o /home/source/src/usr.sbin/ipf/ipsend/../../../dist/ipf/ipsend .....
|
||||
# isn't correct.
|
||||
# Use .NOPATH as an workaround for that problem
|
||||
.NOPATH: ipsend
|
||||
|
||||
.include <bsd.prog.mk>
|
11
sbin/ipf/iptest/Makefile
Normal file
11
sbin/ipf/iptest/Makefile
Normal file
@ -0,0 +1,11 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= iptest
|
||||
SRCS= iptest.c iptests.c ip.c sbpf.c sock.c 44arp.c
|
||||
MAN= iptest.1
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/dist/ipf/ipsend
|
||||
|
||||
.include <bsd.prog.mk>
|
33
sbin/ipf/libipf/Makefile
Normal file
33
sbin/ipf/libipf/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
# $FreeBSD$
|
||||
|
||||
MKPRIVATELIB= yes
|
||||
USE_SHLIBDIR= yes
|
||||
|
||||
NOGCCERROR= # defined
|
||||
|
||||
LIB= ipf
|
||||
|
||||
SRCS= addicmp.c addipopt.c addkeep.c bcopywrap.c binprint.c \
|
||||
buildopts.c checkrev.c count6bits.c count4bits.c debug.c \
|
||||
extras.c facpri.c flags.c fill6bits.c genmask.c gethost.c \
|
||||
getifname.c getline.c getnattype.c getport.c getportproto.c \
|
||||
getproto.c getsumd.c hexdump.c hostmask.c hostname.c \
|
||||
hostnum.c icmpcode.c initparse.c ionames.c \
|
||||
ipoptsec.c ipf_dotuning.c ipft_ef.c ipft_hx.c ipft_pc.c \
|
||||
ipft_sn.c ipft_td.c ipft_tx.c kmem.c kmemcpywrap.c \
|
||||
kvatoname.c load_hash.c load_hashnode.c load_pool.c \
|
||||
load_poolnode.c loglevel.c make_range.c mutex_emul.c \
|
||||
nametokva.c nat_setgroupmap.c ntomask.c optname.c \
|
||||
optprint.c optprintv6.c optvalue.c portname.c portnum.c \
|
||||
ports.c print_toif.c printactivenat.c printaps.c printbuf.c \
|
||||
printhash.c printhashnode.c printip.c printpool.c \
|
||||
printpoolnode.c printfr.c printfraginfo.c printhostmap.c \
|
||||
printifname.c printhostmask.c printlog.c printmask.c \
|
||||
printnat.c printportcmp.c printpacket.c printpacket6.c \
|
||||
printsbuf.c printstate.c printtunable.c ratoi.c ratoui.c \
|
||||
remove_hash.c remove_hashnode.c remove_pool.c \
|
||||
remove_poolnode.c resetlexer.c rwlock_emul.c tcpflags.c \
|
||||
tcp_flags.c to_interface.c var.c verbose.c v6ionames.c \
|
||||
v6optvalue.c
|
||||
|
||||
.include <bsd.lib.mk>
|
17
sbin/ipf/rules/Makefile
Normal file
17
sbin/ipf/rules/Makefile
Normal file
@ -0,0 +1,17 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
MAN= mkfilters.1
|
||||
.if ${MKSHARE} != "no"
|
||||
FILESDIR= /usr/share/examples/ipf
|
||||
|
||||
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.11 example.12 example.13 example.sr \
|
||||
firewall ftp-proxy ftppxy mediaone nat-setup \
|
||||
nat.eg server tcpstate mkfilters
|
||||
.endif
|
||||
|
||||
.PATH: ${NETBSDSRCDIR}/dist/ipf/rules
|
||||
.include <bsd.prog.mk>
|
Loading…
Reference in New Issue
Block a user