summaryrefslogtreecommitdiffstats
path: root/sbin/ipf
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ipf')
-rw-r--r--sbin/ipf/Makefile8
-rw-r--r--sbin/ipf/Makefile.inc24
-rw-r--r--sbin/ipf/ipf/Makefile42
-rw-r--r--sbin/ipf/ipfs/Makefile6
-rw-r--r--sbin/ipf/ipfstat/Makefile11
-rw-r--r--sbin/ipf/ipftest/Makefile97
-rw-r--r--sbin/ipf/ipmon/Makefile34
-rw-r--r--sbin/ipf/ipnat/Makefile36
-rw-r--r--sbin/ipf/ippool/Makefile33
-rw-r--r--sbin/ipf/ipresend/Makefile9
-rw-r--r--sbin/ipf/ipsend/Makefile39
-rw-r--r--sbin/ipf/iptest/Makefile11
-rw-r--r--sbin/ipf/libipf/Makefile46
-rw-r--r--sbin/ipf/rules/Makefile17
14 files changed, 413 insertions, 0 deletions
diff --git a/sbin/ipf/Makefile b/sbin/ipf/Makefile
new file mode 100644
index 0000000..df57c80
--- /dev/null
+++ b/sbin/ipf/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+#.WAIT
+SUBDIR= libipf
+SUBDIR+= ipf ipfs ipfstat ipftest ipmon ipnat ippool ipresend
+#SUBDIR+= ipsend iptest rules
+
+.include <bsd.subdir.mk>
diff --git a/sbin/ipf/Makefile.inc b/sbin/ipf/Makefile.inc
new file mode 100644
index 0000000..b3efd6f
--- /dev/null
+++ b/sbin/ipf/Makefile.inc
@@ -0,0 +1,24 @@
+# $FreeBSD$
+
+WARNS?= 2
+NO_WFORMAT=
+NO_WARRAY_BOUNDS=
+
+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
+
+LIBIPF= ${.OBJDIR}/../libipf/libipf.a
+DPADD+= ${LIBIPF} ${LIBKVM}
+LDADD+= ${LIBIPF} -lkvm
+
+CLEANFILES+= y.tab.c y.tab.h
+
+.PATH: ${.CURDIR}/../../../contrib/ipfilter \
+ ${.CURDIR}/../../../contrib/ipfilter/lib \
+ ${.CURDIR}/../../../contrib/ipfilter/tools \
+ ${.CURDIR}/../../../contrib/ipfilter/man
+
+.include "../Makefile.inc"
diff --git a/sbin/ipf/ipf/Makefile b/sbin/ipf/ipf/Makefile
new file mode 100644
index 0000000..c3938c6
--- /dev/null
+++ b/sbin/ipf/ipf/Makefile
@@ -0,0 +1,42 @@
+# $FreeBSD$
+
+PROG= ipf
+SRCS= ${GENHDRS} ipf.c ipfcomp.c ipf_y.c ipf_l.c bpf_filter.c
+MAN= ipfilter.4 ipfilter.5 ipf.8 ipf.4 ipf.5 ipl.4
+MLINKS= ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5
+CFLAGS+= -I. -DIPFILTER_BPF -DHAS_SYS_MD5_H
+
+GENHDRS= ipf_l.h ipf_y.h
+DPSRCS+= ${GENHDRS}
+
+CLEANFILES+= ${GENHDRS} ipf_y.c ipf_l.c
+
+ipf_y.c: ipf_y.y
+ ${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
+ 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
+ sed -e 's/yy/ipf_yy/g' \
+ ${.ALLSRC} > ${.TARGET}
+
+.if defined(RESCUE)
+LIBIPF_SRCS!= cd ${.CURDIR}/../libipf && ${MAKE} -V SRCS
+SRCS+= ${LIBIPF_SRCS}
+.else
+DPADD+= ${LIBPCAP}
+LDADD+= -lpcap
+.endif
+
+.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipfs/Makefile b/sbin/ipf/ipfs/Makefile
new file mode 100644
index 0000000..a64f805
--- /dev/null
+++ b/sbin/ipf/ipfs/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+PROG= ipfs
+MAN= ipfs.8
+
+.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipfstat/Makefile b/sbin/ipf/ipfstat/Makefile
new file mode 100644
index 0000000..a33c5df
--- /dev/null
+++ b/sbin/ipf/ipfstat/Makefile
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+NOGCCERROR= # defined
+
+PROG= ipfstat
+SRCS= ipfstat.c
+MAN= ipfstat.8
+DPADD+= ${LIBCURSES}
+LDADD+= -lcurses
+
+.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipftest/Makefile b/sbin/ipf/ipftest/Makefile
new file mode 100644
index 0000000..32b074c
--- /dev/null
+++ b/sbin/ipf/ipftest/Makefile
@@ -0,0 +1,97 @@
+# $FreeBSD$
+
+PROG= ipftest
+SRCS= ${GENHDRS} ipftest.c fil.c ip_frag.c ip_state.c ip_nat.c \
+ ip_nat6.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_ipf.c ip_dstlist.c
+MAN= ipftest.1
+
+WARNS?= 0
+CFLAGS+= -DIPFILTER_LOG -DIPFILTER_COMPILED -DIPFILTER_LOOKUP \
+ -DIPFILTER_SYNC -DIPFILTER_CKSUM -DHAS_SYS_MD5_H -I.
+
+# XXX The original tarball does not define IPFILTER_SCAN when building this
+# XXX and other modules. It is believed the reason is it fails to build.
+# XXX It has been removed for now.
+# XXX CFLAGS+= -DIPFILTER_SCAN
+
+
+.PATH: ${.CURDIR}/../../../sys/contrib/ipfilter/netinet
+
+GENHDRS= ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h
+DPSRCS+= ${GENHDRS}
+
+CLEANFILES+= ${GENHDRS}
+CLEANFILES+= ipf_y.c ipf_l.c
+CLEANFILES+= ipf.tab.c ipf.tab.h
+CLEANFILES+= ipnat_y.c ipnat_l.c
+CLEANFILES+= ipnat.tab.c ipnat.tab.h
+CLEANFILES+= ippool_y.c ippool_l.c
+CLEANFILES+= ippool.tab.c ippool.tab.h
+
+ipnat_y.c: ipnat_y.y
+ ${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
+ 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
+ sed -e 's/yy/ipnat_yy/g' \
+ ${.ALLSRC} > ${.TARGET}
+
+ippool_y.c: ippool_y.y
+ ${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
+ 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
+ sed -e 's/yy/ippool_yy/g' \
+ ${.ALLSRC} > ${.TARGET}
+
+ipf_y.c: ipf_y.y
+ ${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
+ 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
+ sed -e 's/yy/ipf_yy/g' \
+ ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipmon/Makefile b/sbin/ipf/ipmon/Makefile
new file mode 100644
index 0000000..3639f87
--- /dev/null
+++ b/sbin/ipf/ipmon/Makefile
@@ -0,0 +1,34 @@
+# $FreeBSD$
+
+PROG= ipmon
+SRCS= ${GENHDRS} ipmon.c ipmon_y.c ipmon_l.c
+MAN= ipmon.8
+
+CFLAGS+= -DLOGFAC=LOG_LOCAL0 -I.
+
+GENHDRS+= ipmon_l.h ipmon_y.h
+DPSRCS+= ${GENHDRS}
+
+CLEANFILES+= ${GENHDRS} ipmon_y.c ipmon_l.c
+
+ipmon_y.c: ipmon_y.y
+ ${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
+ 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
+ sed -e 's/yy/ipmon_yy/g' \
+ ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipnat/Makefile b/sbin/ipf/ipnat/Makefile
new file mode 100644
index 0000000..1c017e1
--- /dev/null
+++ b/sbin/ipf/ipnat/Makefile
@@ -0,0 +1,36 @@
+# $FreeBSD$
+
+PROG= ipnat
+SRCS= ${GENHDRS} ipnat.c ipnat_y.c ipnat_l.c
+MAN= ipnat.8 ipnat.4 ipnat.5
+MLINKS= ipnat.5 ipnat.conf.5
+CFLAGS+= -I.
+
+GENHDRS= ipnat_l.h ipnat_y.h
+DPSRCS+= ${GENHDRS}
+
+CLEANFILES+= ${GENHDRS} ipnat_y.c ipnat_l.c
+
+ipnat_y.c: ipnat_y.y
+ ${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
+ 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
+ sed -e 's/yy/ipnat_yy/g' \
+ ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.prog.mk>
diff --git a/sbin/ipf/ippool/Makefile b/sbin/ipf/ippool/Makefile
new file mode 100644
index 0000000..6e3f85d
--- /dev/null
+++ b/sbin/ipf/ippool/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+PROG= ippool
+SRCS= ${GENHDRS} ippool_y.c ippool_l.c kmem.c ippool.c
+MAN= ippool.5 ippool.8
+CFLAGS+= -I.
+
+GENHDRS= ippool_l.h ippool_y.h
+DPSRCS+= ${GENHDRS}
+
+CLEANFILES+= ${GENHDRS} ippool_y.c ippool_l.c
+
+ippool_y.c: ippool_y.y
+ ${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
+ 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
+ sed -e 's/yy/ippool_yy/g' \
+ ${.ALLSRC} > ${.TARGET}
+
+.include <bsd.prog.mk>
diff --git a/sbin/ipf/ipresend/Makefile b/sbin/ipf/ipresend/Makefile
new file mode 100644
index 0000000..5e0ac15
--- /dev/null
+++ b/sbin/ipf/ipresend/Makefile
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+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>
diff --git a/sbin/ipf/ipsend/Makefile b/sbin/ipf/ipsend/Makefile
new file mode 100644
index 0000000..4ae4c34
--- /dev/null
+++ b/sbin/ipf/ipsend/Makefile
@@ -0,0 +1,39 @@
+# $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
+ ${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>
diff --git a/sbin/ipf/iptest/Makefile b/sbin/ipf/iptest/Makefile
new file mode 100644
index 0000000..647471c
--- /dev/null
+++ b/sbin/ipf/iptest/Makefile
@@ -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>
diff --git a/sbin/ipf/libipf/Makefile b/sbin/ipf/libipf/Makefile
new file mode 100644
index 0000000..077062f
--- /dev/null
+++ b/sbin/ipf/libipf/Makefile
@@ -0,0 +1,46 @@
+# $FreeBSD$
+
+LIB= ipf
+INTERNALLIB=
+
+SRCS= addicmp.c addipopt.c alist_free.c alist_new.c allocmbt.c \
+ assigndefined.c bcopywrap.c \
+ binprint.c buildopts.c checkrev.c connecttcp.c \
+ count4bits.c count6bits.c \
+ debug.c dupmbt.c \
+ facpri.c familyname.c \
+ fill6bits.c findword.c \
+ flags.c freembt.c ftov.c \
+ genmask.c \
+ gethost.c getifname.c geticmptype.c \
+ getnattype.c getport.c getportproto.c getproto.c getsumd.c \
+ hostname.c icmpcode.c icmptypename.c icmptypes.c \
+ initparse.c interror.c ionames.c \
+ ipf_dotuning.c ipf_perror.c ipft_hx.c ipft_pc.c \
+ ipft_tx.c ipoptsec.c kmem.c kmemcpywrap.c \
+ kvatoname.c load_dstlist.c load_dstlistnode.c load_file.c \
+ load_hash.c load_hashnode.c \
+ load_http.c load_pool.c load_poolnode.c load_url.c \
+ mb_hexdump.c msgdsize.c \
+ mutex_emul.c nametokva.c nat_setgroupmap.c ntomask.c \
+ optname.c optprint.c optprintv6.c optvalue.c parsefields.c \
+ parseipfexpr.c parsewhoisline.c poolio.c portname.c \
+ prependmbt.c \
+ print_toif.c printactiveaddr.c printactivenat.c printaddr.c \
+ printaps.c printbuf.c printdstl_live.c printdstlist.c \
+ printdstlistdata.c printdstlistnode.c printdstlistpolicy.c \
+ printfieldhdr.c \
+ printfr.c printfraginfo.c printhash.c printhash_live.c \
+ printhashdata.c printhashnode.c printhost.c printhostmap.c \
+ printhostmask.c printifname.c printip.c printipfexpr.c printiphdr.c printlog.c printlookup.c \
+ printmask.c printnat.c printnataddr.c printnatfield.c printnatside.c printpacket.c printpacket6.c \
+ printpool.c printpool_live.c printpooldata.c printpoolfield.c printpoolnode.c \
+ printportcmp.c printproto.c printsbuf.c printstate.c printstatefields.c \
+ printtcpflags.c \
+ printtqtable.c printtunable.c printunit.c remove_hash.c remove_hashnode.c \
+ remove_pool.c remove_poolnode.c resetlexer.c rwlock_emul.c \
+ save_execute.c save_file.c save_nothing.c save_syslog.c save_v1trap.c save_v2trap.c vtof.c \
+ tcp_flags.c tcpflags.c tcpoptnames.c v6ionames.c v6optvalue.c \
+ var.c verbose.c
+
+.include <bsd.lib.mk>
diff --git a/sbin/ipf/rules/Makefile b/sbin/ipf/rules/Makefile
new file mode 100644
index 0000000..a90907f
--- /dev/null
+++ b/sbin/ipf/rules/Makefile
@@ -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>
OpenPOWER on IntegriCloud