diff --git a/contrib/ipfilter/BSD/Makefile b/contrib/ipfilter/BSD/Makefile index 72086a016cdb..9a2158bcf47a 100644 --- a/contrib/ipfilter/BSD/Makefile +++ b/contrib/ipfilter/BSD/Makefile @@ -1,510 +1,523 @@ # # Copyright (C) 1993-1998 by Darren Reed. # # See the IPFILTER.LICENCE file for details on licencing. # BINDEST=/usr/sbin SBINDEST=/sbin MANDIR=/usr/share/man SEARCHDIRS!=echo $(BINDEST) $(SBINDEST) /bin /usr/bin /sbin /usr/sbin /usr/local/bin /usr/local/sbin | awk '{for(i=1;i&1 | sed -n 's/.*devfs.*/-DDEVFS/p' CPU!=uname -m INC=-I/usr/include -I/sys -I/sys/sys -I/sys/arch DEF=-D$(CPU) -D__$(CPU)__ -DINET -DKERNEL -D_KERNEL $(INC) $(DEVFS) IPDEF=$(DEF) -DGATEWAY -DDIRECTED_BROADCAST VNODESHDIR=/sys/kern MLD=$(ML) ML=mln_ipl.c LKM=if_ipl.o LKMR=ipfrule.o DLKM= OBJ=. DEST=$(OBJ) MFLAGS="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \ 'CFLAGS=$(CFLAGS) $(SOLARIS2)' "IPFLKM=$(IPFLKM)" \ "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \ "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \ "CPUDIR=$(CPUDIR)" "LOOKUP=$(LOOKUP)" "SYNC=$(SYNC)" LIBS=-L. -lipf $(LIBBPF) # ########## ########## ########## ########## ########## ########## ########## # CP=/bin/cp RM=/bin/rm CHMOD=/bin/chmod INSTALL=install # MODOBJS=ip_fil.o fil.o ml_ipl.o ip_nat.o ip_frag.o ip_state.o ip_proxy.o \ ip_auth.o ip_log.o ip_pool.o ip_htable.o ip_lookup.o ip_rules.o \ ip_scan.o ip_sync.o # ip_trafcon.o DFLAGS=$(IPFLKM) $(IPFLOG) $(LOOKUP) $(SYNC) $(DEF) $(DLKM) $(IPFBPF) -IPF=ipf.o ipfcomp.o ipf_y.o ipf_l.o +IPF=ipf.o ipfcomp.o ipf_y.o ipf_l.o bpf_filter_u.o IPT=ipftest.o fil_u.o ip_frag_u.o ip_state_u.o ip_nat_u.o \ ip_proxy_u.o ip_auth_u.o ip_htable_u.o ip_lookup_u.o ip_pool_u.o \ ip_scan_u.o ip_sync_u.o ip_rules_u.o ip_fil_u.o ip_log_u.o \ ippool_y.o ippool_l.o ipf_y.o ipf_l.o ipnat_y.o ipnat_l.o \ md5_u.o radix_u.o bpf_filter_u.o # ip_syn_u.o #ip_trafcon_u.o TOOL=$(TOP)/tools IPNAT=ipnat.o ipnat_y.o ipnat_l.o IPMON=ipmon.o ipmon_y.o ipmon_l.o IPPOOL=ippool_y.o ippool_l.o kmem.o ippool.o IPTRAFCON=iptrafcon.o PROXYLIST=$(TOP)/ip_ftp_pxy.c $(TOP)/ip_ipsec_pxy.c $(TOP)/ip_irc_pxy.c \ $(TOP)/ip_netbios_pxy.c $(TOP)/ip_raudio_pxy.c $(TOP)/ip_rcmd_pxy.c \ $(TOP)/ip_rpcb_pxy.c $(TOP)/ip_pptp_pxy.c FILS=ipfstat.o LIBSRC=$(TOP)/lib RANLIB=ranlib AROPTS=cq HERE!=pwd -CCARGS=-I. $(DEBUG) $(CFLAGS) +CCARGS=-I. $(DEBUG) $(CFLAGS) $(UFLAGS) +KCARGS=-I. $(DEBUG) $(CFLAGS) # # Extra is option kernel things we always want in user space. # EXTRA=$(ALLOPTS) include $(TOP)/lib/Makefile build all: machine $(OBJ)/libipf.a ipf ipfs ipfstat ipftest ipmon ipnat \ ippool ipscan ipsyncm ipsyncs $(LKM) $(LKMR) -sh -c 'for i in ipf ipftest ipmon ippool ipnat ipscan ipsyncm ipsyncs; do /bin/rm -f $(TOP)/$$i; ln -s `pwd`/$$i $(TOP); done' + -/bin/rm -f ../tools ./tools + -ln -s ../tools . + -ln -s ../tools .. machine: Makefile.kmod if [ -f Makefile.kmod ] ; then \ make -f Makefile.kmod depend MKUPDATE=no; \ fi Makefile.kmod: if [ -f /usr/share/mk/bsd.kmod.mk -a "`uname -s`" = "NetBSD" ] ; then \ rm -f Makefile.kmod; \ ln -s /usr/share/mk/bsd.kmod.mk Makefile.kmod; \ fi ipfstat: $(FILS) $(OBJ)/libipf.a $(CC) $(CCARGS) $(STATETOP_CFLAGS) $(STATETOP_INC) $(FILS) \ -o $@ $(LIBS) $(STATETOP_LIB) -lkvm ipf: $(IPF) $(OBJ)/libipf.a $(CC) $(CCARGS) $(IPF) -o $@ $(LIBS) -ll $(LIBBPF) ipftest: $(IPT) $(OBJ)/libipf.a $(CC) $(CCARGS) $(IPT) -o $@ $(LIBS) -ll $(LIBBPF) ipnat: $(IPNAT) $(OBJ)/libipf.a $(CC) $(CCARGS) $(IPNAT) -o $@ $(LIBS) -lkvm -ll ipfs: ipfs.o $(CC) $(CCARGS) ipfs.o -o $@ ipsyncm: ipsyncm.o $(OBJ)/libipf.a $(CC) $(CCARGS) ipsyncm.o -o $@ $(LIBS) ipsyncs: ipsyncs.o $(OBJ)/libipf.a $(CC) $(CCARGS) ipsyncs.o -o $@ $(LIBS) ipsyncm.o: $(TOOL)/ipsyncm.c $(TOP)/ip_sync.h $(CC) $(CCARGS) -c $(TOOL)/ipsyncm.c -o $@ ipsyncs.o: $(TOOL)/ipsyncs.c $(TOP)/ip_sync.h $(CC) $(CCARGS) -c $(TOOL)/ipsyncs.c -o $@ tests: (cd test; make ) ipfstat.o: $(TOOL)/ipfstat.c $(TOP)/ip_fil.h $(TOP)/ipf.h $(TOP)/ip_frag.h \ $(TOP)/ip_compat.h $(TOP)/ip_state.h $(TOP)/ip_nat.h $(TOP)/opts.h $(CC) $(CCARGS) $(STATETOP_CFLAGS) $(STATETOP_INC) \ -c $(TOOL)/ipfstat.c -o $@ ipfs.o: $(TOOL)/ipfs.c $(TOP)/ip_fil.h $(TOP)/ipf.h $(TOP)/ip_state.h \ $(TOP)/ip_nat.h $(TOP)/opts.h $(CC) $(CCARGS) -c $(TOOL)/ipfs.c -o $@ fil_u.o: $(TOP)/fil.c $(TOP)/ip_fil.h $(TOP)/ipf.h $(TOP)/ip_compat.h \ $(TOP)/opts.h $(TOP)/ip_rules.h $(CC) $(CCARGS) $(EXTRA) $(IPFBPF) -D_RADIX_H_ -c $(TOP)/fil.c -o $@ fil.o: $(TOP)/fil.c $(TOP)/ip_fil.h $(TOP)/ip_compat.h $(TOP)/ipl.h \ $(TOP)/ip_rules.h - $(CC) $(CCARGS) $(POLICY) $(DFLAGS) $(IPFBPF) $(COMPIPF) \ + $(CC) $(KCARGS) $(POLICY) $(DFLAGS) $(IPFBPF) $(COMPIPF) \ -c $(TOP)/fil.c -o $@ ipf.o: $(TOOL)/ipf.c $(TOP)/ip_fil.h $(TOP)/ipf.h $(TOP)/opts.h $(CC) $(CCARGS) -c $(TOOL)/ipf.c -o $@ ipfcomp.o: $(TOOL)/ipfcomp.c $(TOP)/ip_fil.h $(TOP)/ipf.h $(TOP)/opts.h $(CC) $(CCARGS) -c $(TOOL)/ipfcomp.c -o $@ ipftest.o: $(TOOL)/ipftest.c $(TOP)/ip_fil.h $(TOP)/ipt.h $(TOP)/ipf.h \ $(TOP)/opts.h $(CC) $(CCARGS) -c $(TOOL)/ipftest.c -o $@ ipnat.o: $(TOOL)/ipnat.c $(TOP)/ip_fil.h $(TOP)/ipf.h $(TOP)/ip_nat.h \ $(TOP)/opts.h $(CC) $(CCARGS) -c $(TOOL)/ipnat.c -o $@ ipnat_y.o: ipnat_y.c ipnat_y.h ipnat_l.h $(CC) $(CCARGS) -c ipnat_y.c -o $@ ipnat_l.o: ipnat_l.c ipnat_y.h $(CC) $(CCARGS) -I. -c ipnat_l.c -o $@ ipnat_y.c: $(TOOL)/ipnat_y.y (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipnat_y.h: ipnat_y.c ipnat_l.c: $(TOOL)/lexer.c $(TOP)/ip_nat.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipnat_l.h: $(TOOL)/lexer.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ip_nat_u.o: $(TOP)/ip_nat.c $(TOP)/ip_nat.h $(TOP)/ip_compat.h $(TOP)/ip_fil.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_nat.c -o $@ ip_proxy_u.o: $(TOP)/ip_proxy.c $(TOP)/ip_proxy.h $(TOP)/ip_compat.h \ $(TOP)/ip_fil.h $(PROXYLIST) $(TOP)/ip_nat.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_proxy.c -o $@ ip_frag_u.o: $(TOP)/ip_frag.c $(TOP)/ip_frag.h $(TOP)/ip_compat.h \ $(TOP)/ip_fil.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_frag.c -o $@ ip_state_u.o: $(TOP)/ip_state.c $(TOP)/ip_state.h $(TOP)/ip_compat.h \ $(TOP)/ip_fil.h $(TOP)/ip_nat.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_state.c -o $@ ip_auth_u.o: $(TOP)/ip_auth.c $(TOP)/ip_auth.h $(TOP)/ip_compat.h \ $(TOP)/ip_fil.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_auth.c -o $@ ip_fil_u.o: $(TOP)/ip_fil.c $(TOP)/ip_fil.h $(TOP)/ip_compat.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_fil.c -o $@ ip_rules_u.o: ip_rules.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_rules.h $(CC) $(CCARGS) $(EXTRA) -c ip_rules.c -o $@ ip_scan_u.o: $(TOP)/ip_scan.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_scan.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_scan.c -o $@ ip_sync_u.o: $(TOP)/ip_sync.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_sync.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_sync.c -o $@ ip_pool_u.o: $(TOP)/ip_pool.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_pool.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_pool.c -o $@ ip_htable_u.o: $(TOP)/ip_htable.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_htable.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_htable.c -o $@ ip_lookup_u.o: $(TOP)/ip_lookup.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_lookup.h $(TOP)/ip_pool.h $(TOP)/ip_htable.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_lookup.c -o $@ ip_trafcon_u.o: $(TOP)/ip_trafcon.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_trafcon.h $(CC) $(CCARGS) -c $(TOP)/ip_trafcon.c -o $@ ip_log_u.o: $(TOP)/ip_log.c $(TOP)/ip_fil.h $(TOP)/ip_compat.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/ip_log.c -o $@ md5_u.o: $(TOP)/md5.c $(TOP)/md5.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/md5.c -o $@ radix_u.o: $(TOP)/md5.c $(TOP)/radix_ipf.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/radix.c -o $@ bpf_filter_u.o: $(TOP)/bpf_filter.c $(TOP)/pcap-ipf.h $(CC) $(CCARGS) $(EXTRA) -c $(TOP)/bpf_filter.c -o $@ if_ipl.o: $(MODOBJS) ld -r $(MODOBJS) -o $(LKM) ${RM} -f if_ipl ipfrule.ko.5: ip_rulesx.o $(MLR) ld -warn-common -r -d -o $(.TARGET:S/.ko/.kld/) ip_rulesx.o $(MLR) ld -Bshareable -d -warn-common -o $(LKMR:S/.5$//) $(.TARGET:S/.ko/.kld/) ipfrule.ko: ip_rulesx.o $(MLR) gensetdefs ip_rulesx.o $(MLR) - $(CC) $(CCARGS) -c setdef0.c - $(CC) $(CCARGS) -c setdef1.c + $(CC) $(KCARGS) -c setdef0.c + $(CC) $(KCARGS) -c setdef1.c ld -Bshareable -o $@ setdef0.o ip_rulesx.o $(MLR) setdef1.o ipf.ko.5 ipl.ko.5: $(MODOBJS) ld -warn-common -r -d -o $(.TARGET:S/.ko/.kld/) $(MODOBJS) ld -Bshareable -d -warn-common -o $(LKM:S/.5$//) $(.TARGET:S/.ko/.kld/) ipf.ko ipl.ko: $(MODOBJS) gensetdefs $(MODOBJS) - $(CC) $(CCARGS) -c setdef0.c - $(CC) $(CCARGS) -c setdef1.c + $(CC) $(KCARGS) -c setdef0.c + $(CC) $(KCARGS) -c setdef1.c ld -Bshareable -o $@ setdef0.o $(MODOBJS) setdef1.o ip_nat.o: $(TOP)/ip_nat.c $(TOP)/ip_nat.h $(TOP)/ip_compat.h $(TOP)/ip_fil.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_nat.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_nat.c -o $@ ip_frag.o: $(TOP)/ip_frag.c $(TOP)/ip_frag.h $(TOP)/ip_compat.h $(TOP)/ip_fil.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_frag.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_frag.c -o $@ ip_state.o: $(TOP)/ip_state.c $(TOP)/ip_state.h $(TOP)/ip_compat.h \ $(TOP)/ip_fil.h $(TOP)/ip_nat.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_state.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_state.c -o $@ ip_proxy.o: $(TOP)/ip_proxy.c $(TOP)/ip_proxy.h $(TOP)/ip_compat.h \ $(TOP)/ip_fil.h $(PROXYLIST) $(TOP)/ip_nat.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_proxy.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_proxy.c -o $@ ip_auth.o: $(TOP)/ip_auth.c $(TOP)/ip_auth.h $(TOP)/ip_compat.h \ $(TOP)/ip_fil.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_auth.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_auth.c -o $@ ip_fil.c: /bin/rm -f ip_fil.c ln -s $(TOP)/ip_fil_`uname -s|tr A-Z a-z`.c ip_fil.c ip_fil.o: ip_fil.c $(TOP)/ip_fil.h $(TOP)/ip_compat.h $(TOP)/ip_nat.h - $(CC) $(CCARGS) $(DFLAGS) $(COMPIPF) -c ip_fil.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) $(COMPIPF) -c ip_fil.c -o $@ ip_log.o: $(TOP)/ip_log.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_log.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_log.c -o $@ ip_scan.o: $(TOP)/ip_scan.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h $(TOP)/ip_scan.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_scan.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_scan.c -o $@ ip_sync.o: $(TOP)/ip_sync.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h $(TOP)/ip_sync.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_sync.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_sync.c -o $@ ip_pool.o: $(TOP)/ip_pool.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_lookup.h $(TOP)/ip_pool.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_pool.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_pool.c -o $@ ip_htable.o: $(TOP)/ip_htable.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_lookup.h $(TOP)/ip_htable.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_htable.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_htable.c -o $@ ip_lookup.o: $(TOP)/ip_lookup.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_pool.h $(TOP)/ip_htable.h $(TOP)/ip_lookup.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_lookup.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_lookup.c -o $@ ip_trafcon.o: $(TOP)/ip_trafcon.c $(TOP)/ip_compat.h $(TOP)/ip_fil.h \ $(TOP)/ip_trafcon.h - $(CC) $(CCARGS) $(DFLAGS) -c $(TOP)/ip_trafcon.c -o $@ + $(CC) $(KCARGS) $(DFLAGS) -c $(TOP)/ip_trafcon.c -o $@ vnode_if.h: $(VNODESHDIR)/vnode_if.src mkdir -p ../sys if [ -f $(VNODESHDIR)/vnode_if.sh ] ; then \ sh $(VNODESHDIR)/vnode_if.sh $(VNODESHDIR)/vnode_if.src; \ fi if [ -f $(VNODESHDIR)/vnode_if.pl ] ; then \ perl $(VNODESHDIR)/vnode_if.pl $(VNODESHDIR)/vnode_if.src; \ fi if [ -f ../sys/vnode_if.h ] ; then mv ../sys/vnode_if.h .; fi rmdir ../sys ml_ipl.o: vnode_if.h $(TOP)/$(MLD) $(TOP)/ipl.h -/bin/rm -f vnode_if.c $(CC) -I. $(CFLAGS) $(DFLAGS) -c $(TOP)/$(ML) -o $@ ip_rules.o: ip_rules.c $(TOP)/ip_rules.h $(CC) -I. $(CFLAGS) $(DFLAGS) $(COMPIPF) -c ip_rules.c -o $@ ip_rules.c: $(TOP)/rules/ip_rules $(TOP)/tools/ipfcomp.c ipf ./ipf -cc -nf $(TOP)/rules/ip_rules $(TOP)/ip_rules.h: ip_rules.c if [ ! -f $(TOP)/ip_rules.h ] ; then \ /bin/mv -f ip_rules.h $(TOP); \ else \ touch $(TOP)/ip_rules.h; \ fi ip_rulesx.o: ip_rules.c $(TOP)/ip_rules.h $(CC) -I. $(CFLAGS) $(DFLAGS) -DIPFILTER_COMPILED -c ip_rules.c -o $@ mlf_rule.o: $(TOP)/mlf_rule.c $(TOP)/ip_rules.h $(CC) -I. $(CFLAGS) $(DFLAGS) -c $(TOP)/mlf_rule.c -o $@ mln_rule.o: $(TOP)/mln_rule.c $(TOP)/ip_rules.h $(CC) -I. $(CFLAGS) $(DFLAGS) -c $(TOP)/mln_rule.c -o $@ mlo_rule.o: $(TOP)/mlo_rule.c $(TOP)/ip_rules.h $(CC) -I. $(CFLAGS) $(DFLAGS) -c $(TOP)/mlo_rule.c -o $@ mlfk_rule.o: $(TOP)/mlfk_rule.c $(TOP)/ip_rules.h $(CC) -I. $(CFLAGS) $(DFLAGS) -c $(TOP)/mlfk_rule.c -o $@ ipf_y.o: ipf_y.c ipf_y.h $(TOP)/ipf.h ipf_l.h $(TOP)/opts.h $(CC) $(CCARGS) $(IPFBPF) -c ipf_y.c -o $@ ipf_l.o: ipf_l.c ipf_y.h $(TOP)/ipf.h ipf_l.h $(TOP)/opts.h $(CC) $(CCARGS) -I. -c ipf_l.c -o $@ ipf_y.c: $(TOOL)/ipf_y.y $(TOP)/ipf.h $(TOP)/opts.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipf_y.h: ipf_y.c ipf_l.c: $(TOOL)/lexer.c $(TOP)/ipf.h $(TOP)/opts.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipf_l.h: $(TOOL)/lexer.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipmon: $(IPMON) $(OBJ)/libipf.a $(CC) $(CCARGS) $(IPMON) -o $@ $(LIBS) -ll ipmon.o: $(TOOL)/ipmon.c $(TOP)/ipmon.h $(CC) $(CCARGS) $(LOGFAC) -c $(TOOL)/ipmon.c -o $@ ipmon_y.o: ipmon_y.c ipmon_y.h $(TOP)/ipmon.h ipmon_l.h $(CC) $(CCARGS) -c ipmon_y.c -o $@ ipmon_l.o: ipmon_l.c ipmon_y.h $(TOP)/ipmon.h $(CC) $(CCARGS) -I. -c ipmon_l.c -o $@ ipmon_y.c: $(TOOL)/ipmon_y.y $(TOP)/ipmon.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipmon_y.h: ipmon_y.c ipmon_l.c: $(TOOL)/lexer.c $(TOP)/ipmon.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipmon_l.h: $(TOOL)/lexer.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipscan: ipscan_y.o ipscan_l.o $(CC) $(DEBUG) ipscan_y.o ipscan_l.o -o $@ -ll $(LIBS) -lkvm ipscan_y.o: ipscan_y.c ipscan_y.h $(TOP)/ip_scan.h ipscan_l.h $(CC) $(CCARGS) -c ipscan_y.c -o $@ ipscan_l.o: ipscan_l.c ipscan_y.h $(TOP)/ip_scan.h $(CC) $(CCARGS) -I. -c ipscan_l.c -o $@ ipscan_y.c: $(TOOL)/ipscan_y.y $(TOP)/ip_scan.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ipscan_y.h: ipscan_y.c ipscan_l.c ipscan_l.h: $(TOOL)/lexer.c $(TOP)/ip_scan.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ippool: $(IPPOOL) $(OBJ)/libipf.a $(CC) $(DEBUG) -I. $(CFLAGS) $(IPPOOL) -o $@ -ll -lkvm -L. -lipf ippool.o: $(TOOL)/ippool.c $(TOP)/ip_pool.h $(CC) $(CCARGS) -c $(TOOL)/ippool.c -o $@ ippool_y.o: ippool_y.c ippool_y.h $(TOP)/ip_pool.h ippool_l.h $(CC) $(CCARGS) -c ippool_y.c -o $@ ippool_l.o: ippool_l.c ippool_y.h $(TOP)/ip_pool.h $(CC) $(CCARGS) -I. -c ippool_l.c -o $@ ippool_y.c: $(TOOL)/ippool_y.y $(TOP)/ip_pool.h ippool_l.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ippool_y.h: ippool_y.c ippool_l.c: $(TOOL)/lexer.c $(TOP)/ip_pool.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) ippool_l.h: $(TOOL)/lexer.h (cd $(TOOL); make "DEST=$(HERE)" $(HERE)/$@) iptrafcon.o: $(TOP)/iptrafcon.c $(CC) $(CCARGS) -c $< -o $@ iptrafcon: $(IPTRAFCON) $(OBJ)/libipf.a $(CC) $(CCARGS) $(IPTRAFCON) -o $@ $(LIBS) .y.c: .l.c: clean: ${RM} -f ../ipf ../ipnat ../ipmon ../ippool ../ipftest ${RM} -f ../ipscan ../ipsyncm ../ipsyncs ${RM} -f *.core *.o *.a ipt ipfstat ipf ipfstat ipftest ipmon ${RM} -f if_ipl ipnat ipfrule.ko* ipf.kld* ${RM} -f vnode_if.h $(LKM) ioconf.h *.ko setdef1.c setdef0.c setdefs.h ${RM} -f ip_fil.c ipf_l.c ipf_y.c ipf_y.h ipf_l.h ${RM} -f ipscan ipscan_y.c ipscan_y.h ipscan_l.c ipscan_l.h ${RM} -f ippool ippool_y.c ippool_y.h ippool_l.c ippool_l.h ${RM} -f ipnat_y.c ipnat_y.h ipnat_l.c ipnat_l.h ${RM} -f ipmon_y.c ipmon_y.h ipmon_l.c ipmon_l.h ${RM} -f ipsyncm ipsyncs ipfs ip_rules.c ip_rules.h + ${RM} -f *.da *.gcov *.bb *.bbg tools ${MAKE} -f Makefile.ipsend ${MFLAGS} clean if [ -f Makefile.kmod ] ; then \ ${MAKE} -f Makefile.kmod ${MFLAGS} clean; \ fi -(for i in *; do \ if [ -d $${i} -a -f $${i}/Makefile ] ; then \ cd $${i}; (make TOP=../.. clean); cd ..; \ /bin/rm -f $${i}/Makefile $${i}/Makefile.ipsend; \ /bin/rm -f $${i}/Makefile.kmod; \ rmdir $${i}; \ fi \ done) install: for i in ip_compat.h ip_fil.h ip_nat.h ip_state.h ip_proxy.h \ ip_frag.h ip_auth.h; do \ /bin/cp $(TOP)/$$i /usr/include/netinet/; \ $(CHMOD) 444 /usr/include/netinet/$$i; \ done -if [ -d /lkm -a -f if_ipl.o ] ; then \ cp if_ipl.o /lkm; \ fi -if [ -d /modules -a -f ipf.ko ] ; then \ cp ipf.ko /modules; \ fi -if [ -d /modules -a -f ipfrule.ko ] ; then \ cp ipfrule.ko /modules; \ fi -if [ -d /boot/kernel -a -f ipf.ko ] ; then \ cp ipf.ko /boot/kernel; \ fi -if [ -d /boot/kernel -a -f ipfrule.ko ] ; then \ cp ipfrule.ko /boot/kernel; \ fi -if [ -d /usr/lkm -a -f if_ipl.o ] ; then \ cp if_ipl.o /usr/lkm; \ fi -$(INSTALL) -cs -g wheel -m 755 -o root ipscan $(SBINDEST) (cd $(TOP)/man; make INSTALL=$(INSTALL) MANDIR=$(MANDIR) install; cd $(TOP)) @for i in ipf:$(SBINDEST) ipfs:$(SBINDEST) ipnat:$(SBINDEST) \ ippool:$(BINDEST) ipsyncm:$(BINDEST) ipsyncs:$(BINDEST) \ ipfstat:$(SBINDEST) ipftest:$(SBINDEST) ipmon:$(BINDEST); do \ def="`expr $$i : '[^:]*:\(.*\)'`"; \ p="`expr $$i : '\([^:]*\):.*'`"; \ dd=; \ for d in $(SEARCHDIRS); do \ if [ -f $$d/$$p ] ; then \ echo "$(INSTALL) -cs -g wheel -m 755 -o root $$p $$d"; \ $(INSTALL) -cs -g wheel -m 755 -o root $$p $$d; \ dd=XXX; \ fi; \ done; \ if [ -z "$$dd" ] ; then \ echo $(INSTALL) -cs -g wheel -m 755 -o root $$p $$def; \ $(INSTALL) -cs -g wheel -m 755 -o root $$p $$def; \ fi \ done (cd $(TOP)/man; make INSTALL=$(INSTALL) MANDIR=$(MANDIR) install; cd $(TOP)) + +coverage: + ksh -c 'for i in *.da; do j=$${i%%.da}.c; gcov $$j 2>&1 | egrep -v "y.tab.c|Could|Creating|_l\.c|\.h"; done' | sort -n > report + sort -n report | perl -e 'while(<>) { next if (/^0.00/); s/\%//g; @F=split;$$lc+=$$F[2];$$t += $$F[0]/100*$$F[2];} printf "%d of %d = %d%%\n", $$t, $$lc,$$t/$$lc*100;' >> report + +clean-coverage: + /bin/rm -f *.gcov *.da diff --git a/contrib/ipfilter/BSD/Makefile.ipsend b/contrib/ipfilter/BSD/Makefile.ipsend index 410ea67c14fa..a83de1c6a92c 100644 --- a/contrib/ipfilter/BSD/Makefile.ipsend +++ b/contrib/ipfilter/BSD/Makefile.ipsend @@ -1,108 +1,108 @@ # -# Id: Makefile.ipsend,v 2.8 2002/05/22 16:15:36 darrenr Exp +# $Id: Makefile.ipsend,v 2.8 2002/05/22 16:15:36 darrenr Exp $ # BINDEST=/usr/sbin SBINDEST=/sbin MANDIR=/usr/share/man OBJS=ipsend.o ip.o ipsopt.o iplang_y.o iplang_l.o IPFTO=ipft_ef.o ipft_hx.o ipft_pc.o ipft_sn.o ipft_td.o ipft_tx.o ROBJS=ipresend.o ip.o resend.o TOBJS=iptest.o iptests.o ip.o UNIXOBJS=sbpf.o sock.o 44arp.o OBJ=. LIBS=-L$(OBJ) -lipf CC=gcc -Wuninitialized -Wstrict-prototypes -O CFLAGS=-g -I$(TOP) # MFLAGS="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \ 'CFLAGS=$(CFLAGS) $(SOLARIS2)' "IPFLKM=$(IPFLKM)" \ "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \ "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \ "CPUDIR=$(CPUDIR)" "LOOKUP=$(LOOKUP)" # all build bsd-bpf : ipsend ipresend iptest iplang_y.o: $(TOP)/iplang/iplang_y.y (cd $(TOP)/iplang; $(MAKE) ../BSD/$(CPUDIR)/$@ $(MFLAGS) 'DESTDIR=../BSD/$(CPUDIR)' ) iplang_l.o: $(TOP)/iplang/iplang_l.l (cd $(TOP)/iplang; $(MAKE) ../BSD/$(CPUDIR)/$@ $(MFLAGS) 'DESTDIR=../BSD/$(CPUDIR)' ) .c.o: $(CC) $(DEBUG) $(CFLAGS) -c $< -o $@ ipsend: $(OBJS) $(UNIXOBJS) $(CC) $(DEBUG) $(OBJS) $(UNIXOBJS) -o $@ $(LIBS) -ll ipresend: $(ROBJS) $(UNIXOBJS) $(CC) $(DEBUG) $(ROBJS) $(UNIXOBJS) -o $@ $(LIBS) iptest: $(TOBJS) $(UNIXOBJS) $(CC) $(DEBUG) $(TOBJS) $(UNIXOBJS) -o $@ $(LIBS) clean: rm -rf *.o core a.out ipsend ipresend iptest iplang_y.* iplang_l.* ipsend.o: $(TOP)/ipsend/ipsend.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/ipsend.c -o $@ ipsopt.o: $(TOP)/ipsend/ipsopt.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/ipsopt.c -o $@ ipresend.o: $(TOP)/ipsend/ipresend.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/ipresend.c -o $@ ip.o: $(TOP)/ipsend/ip.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/ip.c -o $@ resend.o: $(TOP)/ipsend/resend.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/resend.c -o $@ ipft_sn.o: $(TOP)/ipft_sn.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipft_sn.c -o $@ ipft_pc.o: $(TOP)/ipft_pc.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipft_pc.c -o $@ iptest.o: $(TOP)/ipsend/iptest.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/iptest.c -o $@ iptests.o: $(TOP)/ipsend/iptests.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/iptests.c -o $@ sbpf.o: $(TOP)/ipsend/sbpf.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/sbpf.c -o $@ snit.o: $(TOP)/ipsend/snit.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/snit.c -o $@ sock.o: $(TOP)/ipsend/sock.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/sock.c -o $@ arp.o: $(TOP)/ipsend/arp.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/arp.c -o $@ 44arp.o: $(TOP)/ipsend/44arp.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/44arp.c -o $@ lsock.o: $(TOP)/ipsend/lsock.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/lsock.c -o $@ slinux.o: $(TOP)/ipsend/slinux.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/slinux.c -o $@ larp.o: $(TOP)/ipsend/larp.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/larp.c -o $@ dlcommon.o: $(TOP)/ipsend/dlcommon.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/dlcommon.c -o $@ sdlpi.o: $(TOP)/ipsend/sdlpi.c $(CC) $(DEBUG) $(CFLAGS) -c $(TOP)/ipsend/sdlpi.c -o $@ install: -$(INSTALL) -cs -g wheel -m 755 -o root ipsend ipresend iptest $(BINDEST) diff --git a/contrib/ipfilter/BSD/kupgrade b/contrib/ipfilter/BSD/kupgrade index 91f32daab43b..77a6ba1f534e 100644 --- a/contrib/ipfilter/BSD/kupgrade +++ b/contrib/ipfilter/BSD/kupgrade @@ -1,252 +1,260 @@ #!/bin/sh # PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH argv0=`basename $0` os=`uname -s` rev=`uname -r` maj=`expr $rev : '\([0-9]*\)\.'` min=`expr $rev : '[0-9]*\.\([0-9]*\)'` sub=`expr $rev : '[0-9]*\.[0-9]*\.\([0-9]*\)'` # try to bomb out fast if anything fails.... set -e fullrev=`printf '%02d%02d%02d' $maj $min $sub` dir=`pwd` karch=`uname -m` archdir="/sys/arch/$karch" ipfdir=/sys/netinet if [ -d /sys/contrib/ipfilter ] ; then ipfdir=/sys/contrib/ipfilter/netinet fi if [ -d /sys/dist/ipf ] ; then ipfdir=/sys/dist/ipf/netinet fi confdir="$archdir/conf" if [ -f /dev/ipnat ] ; then major=`ls -l /dev/ipnat | sed -e 's/.* \([0-9]*\),.*/\1/'` echo "Major number for IP Filter is $major" else major=x fi +if [ ! -f ip_rules.c -o ! -f ip_rules.h ] ; then + echo "Please do a build of ipfilter and then run the following" + echo "command to build extra files:" + echo + echo "make ip_rules.c" + exit 1 +fi + echo -n "Installing " for j in auth frag nat proxy scan state sync pool htable lookup rules; do for i in ip_$j.[ch]; do if [ -f "$i" ] ; then echo -n " $i" cp $i $ipfdir chmod 644 $ipfdir/$i fi done done case $os in SunOS) case `uname -r` in 5.*) filc=ip_fil_solaris.c ;; 4.*) filc=ip_fil_sunos.c ;; esac ;; *BSD) filc=ip_fil_`echo $os | tr A-Z a-z`.c case $os in FreeBSD) cp mlfk_ipl.c $ipfdir/ ;; *) ;; esac ;; esac if [ -f $ipfdir/$filc ] ; then echo -n "$filc -> $ipfdir/$filc " cp $filc $ipfdir/$filc chmod 644 $ipfdir/$filc fi if [ -f $ipfdir/ip_fil.c ] ; then echo -n "$filc -> $ipfdir/ip_fil.c " cp $filc $ipfdir/ip_fil.c chmod 644 $ipfdir/ip_fil.c fi for i in ip_fil.h fil.c ip_log.c ip_compat.h ipl.h ip_*_pxy.c; do echo -n " $i" cp $i $ipfdir chmod 644 $ipfdir/$i done echo "" echo -n "Installing into /usr/include/netinet" for j in auth compat fil frag nat proxy scan state sync pool htable lookup; do i=ip_$j.h if [ -f "$i" ] ; then echo -n " $i" cp $i /usr/include/netinet/$i chmod 644 /usr/include/netinet/$i fi done for j in ipl.h; do if [ -f "$j" ] ; then echo -n " $j" cp $j /usr/include/netinet/$j chmod 644 /usr/include/netinet/$j fi done echo if [ -f /sys/netinet/ip_fil_compat.h ] ; then echo "Linking /sys/netinet/ip_compat.h to /sys/netinet/ip_fil_compat.h" rm /sys/netinet/ip_fil_compat.h ln -s /sys/netinet/ip_compat.h /sys/netinet/ip_fil_compat.h fi if [ $major != x ] ; then if [ ! -e /dev/ipsync ] ; then echo "Creating /dev/ipsync" mknod /dev/ipsync c $major 4 fi if [ ! -e /dev/ipsync ] ; then echo "Creating /dev/ipscan" mknod /dev/ipsync c $major 5 fi if [ ! -e /dev/iplookup ] ; then echo "Creating /dev/iplookup" mknod /dev/iplookup c $major 6 fi fi set +e os=`uname -s` if [ $os = FreeBSD -a -f /sys/conf/files ] ; then cd /sys/conf if [ -f options ] ; then if [ ! -f options.preipf4 ] ; then mv options options.preipf4 cp -p options.preipf4 options fi for i in SCAN SYNC LOOKUP COMPILED; do grep IPFILTER_$i options >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo >> options echo "# extra option for IP Filter" >> options echo "IPFILTER_$i opt_ipfilter.h" >> options fi done fi if [ ! -f files.preipf4 ] ; then mv files files.preipf4 cp -p files.preipf4 files fi for i in htable pool lookup; do grep ip_$i.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo "contrib/ipfilter/netinet/ip_$i.c optional ipfilter inet ipfilter_lookup" >> files fi done grep ip_sync.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet ipfilter_sync' >> files fi grep ip_scan.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'contrib/ipfilter/netinet/ip_scan.c optional ipfilter inet ipfilter_scan' >> files fi grep ip_rules.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'contrib/ipfilter/netinet/ip_rules.c optional ipfilter inet ipfilter_compiled' >> files fi fi if [ $os = NetBSD -a -f /sys/conf/files ] ; then cd /sys/conf if [ ! -f files.preipf4 ] ; then mv files files.preipf4 cp -p files.preipf4 files fi if [ $fullrev -ge 010600 -a $fullrev -lt 020000 ] ; then for i in htable pool lookup; do grep ip_$i.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo "file netinet/ip_$i.c ipfilter & ipfilter_lookup" >> files fi done grep ip_sync.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'file netinet/ip_sync.c ipfilter & ipfilter_sync' >> files fi grep ip_scan.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'file netinet/ip_scan.c ipfilter & ipfilter_scan' >> files fi grep ip_rules.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'file netinet/ip_rules.c ipfilter & ipfilter_compiled' >> files fi fi fi if [ $os = OpenBSD -a -f /sys/conf/files ] ; then cd /sys/conf if [ ! -f files.preipf4 ] ; then mv files files.preipf4 cp -p files.preipf4 files fi if [ $fullrev -ge 030400 ] ; then for i in htable pool lookup; do grep ip_$i.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo "file netinet/ip_$i.c ipfilter & ipfilter_lookup" >> files fi done grep ip_sync.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'file netinet/ip_sync.c ipfilter & ipfilter_sync' >> files fi grep ip_scan.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'file netinet/ip_scan.c ipfilter & ipfilter_scan' >> files fi grep ip_rules.c files >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo 'file netinet/ip_rules.c ipfilter & ipfilter_compiled' >> files fi fi fi if [ -f /usr/src/sys/modules/ipfilter/Makefile -a \ ! -f /usr/src/sys/modules/ipfilter/Makefile.orig ] ; then cat | (cd /usr/src/sys/modules/ipfilter; patch) <<__EOF__ *** Makefile.orig Mon Mar 28 09:10:11 2005 --- Makefile Mon Mar 28 09:12:51 2005 *************** *** 5,13 **** KMOD= ipl SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c ip_auth.c \\ ! ip_log.c ip_fil.c fil.c .if !defined(NOINET6) CFLAGS+= -DUSE_INET6 .endif CFLAGS+= -I$${.CURDIR}/../../contrib/ipfilter ! CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DPFIL_HOOKS --- 5,15 ---- KMOD= ipl SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c ip_auth.c \\ ! ip_log.c ip_fil.c fil.c ip_lookup.c ip_pool.c ip_htable.c \\ ! ip_sync.c ip_scan.c ip_rules.c .if !defined(NOINET6) CFLAGS+= -DUSE_INET6 .endif CFLAGS+= -I$${.CURDIR}/../../contrib/ipfilter ! CFLAGS+= -DIPFILTER=1 -DIPFILTER_LKM -DIPFILTER_LOG -DPFIL_HOOKS \\ ! -DIPFILTER_LOOKUP -DIPFILTER_COMPILED __EOF__ fi exit 0 diff --git a/contrib/ipfilter/HISTORY b/contrib/ipfilter/HISTORY index 9b93e8309cab..32daed422bb3 100644 --- a/contrib/ipfilter/HISTORY +++ b/contrib/ipfilter/HISTORY @@ -1,1885 +1,1964 @@ # # NOTE: Quite a few patches and suggestions come from other sources, to whom # I'm greatly indebted, even if no names are mentioned. # # Thanks to the Coombs Computing Unit at the ANU for their continued support # in providing a very available location for the IP Filter home page and # distribution center. # # Thanks also to all those who have contributed patches and other code, # and especially those who have found the time to port IP Filter to new # platforms. # +4.1.10 - Released 6 December 2005 + +Expand regression testing to cover more features + +Add "coverage" build target for BSD + +Fix building 64bit sparc target for Solaris + +Add IPv6 mobility header to list of accepted keywords for V6 headers + +Resolve locking problems on Solaris when sending RST/icmp packets + +#ifdef's for IPFILTER_BPF need to check if words are defined before +using them in comparisons + +Add checking for SACK permitted option in TCP SYN packets + +Fix loading anonymous pools from inline rule configuration groups + +Add -C command line option to ipftest + +Include extra "const" from NetBSD + +Don't require SIOCKSTLCK for SIOCSTPUT + +Fix some use of "sticky" on NAT rules + +Fix statistical counting of deleting state for TCP connections + +Fix compile problems caused by changes to is_opt/is_optmsk in ip_sync.c + +Fix TCP out-of-window (OOW) problems: +- window scaling turned off if one chose for its scale factor +- Microsoft Windows TCP sends the "next packet" to the right of the window + when using SACK and filling in a hole + +4.1.9 - Released 13 August 2005 + +make ipfilter fix IPv4 header checksums for outgoing packets if BRIDGE_IPF +is defined when compiled. + +move the definition of SIOCPROXY from ip_nat.h to ip_proxy.h + +make the BSD/upgrade script more instructive about the requiements for +ip_rules.[ch] when it is run + +register for interface events on FreeBSD (>5.2.1) and NetBSD so that +"ipf -y" is not not requried to tell ipfilter about interface changes. + +for "quick" rules that do "keep state", move the state adding into the rule +evaluation so that we can detect it failing as rules are evaluated and +continue on to the next rather than wait until we're done and it's too late +to recover for more rule processing. + +mark ICMP packets advertising an MTU that's too small as being bad + +rework ipv6 header parsing to get better code reuse and fix logic errors +in dealing with ipv6 packets containing fragment headers. Also, where a +protocol handler was doing both v4 & v6, make a seperate function for each. + +build for both amd64 and i86pc (32bit) on Solaris10 and later, if possible + +include start of work to get IPFilter working on AIX 5.3 + +Use FI_ICMPERR flag rather than try to compute its equivalent all the time + +Rewrork IPv6 extension header parsing to get better code reuse + +Add missing timeout on Linux + +Fix for locking when reading from ipsync (Frank Volf) + +Fix insertion/appending of rules that use a collection number + +Somehow turning up the spl knob to splnet disappeared on platforms that still +use the spl interface. + +fix problems with "ipf -T" not listing multiple variables properly + 4.1.8 - Released 29 March 2005 include path from Phil Dibowitz for sorting ipfstat -t output by source or destination port. fix a bug in printing rules where interface names could not be printed, even if they're in the rule structure. fix BSD/kupgrade to correctly change ipfilter lkm Makefile for FreeBSD add 2 new features to SIOCGNATL: - if IPN_FINDFORWARD is set, check if the respective MAP is already present in the outbound table - if IPN_IN is set, search for a matching MAP entry instead of RDR (Peter Potsma) turn off function inlining for freebsd 5.3+ UDP doesn't pullup enough data which can sometimes cause a panic. Fix other protocols, as required, where a similar problem may exist. overhaul the timeout queue management, especially that for user defined queues which are now only freed in an orderly manner. 4.1.7 - Released 13 March 2005 Using the GRE call field is almost impossible because it is unbalanced and both call fields are not present in each v1 header. Fix a problem where it was possible to load duplicate rules into ipf patch from John Wehle to address problems with fastroute on solaris Copying data out for ipf -z failed because it tried to copy out to an address that is a kernel pointer in user space. add "ip" timeout for both NAT & state that's for non-TCP/UDP/ICMP synch up with NetBSD's changes fix problems parsing long lines of text in the ftp proxy where they would not be parsed properly and stop the session from working enhance the PPTP proxy so that it tries to decode messages in the TCP stream so it knows when to create and destroy the state/nat sessions for GRE. There are also 4 new regression tests for it, testing map/rdr rules. impose some limits on the size of data that can be moved with SIOCSTPUT in the NAT code and also prevent a duplicate session entry from being created using this method. add a new flag (IPN_FINDFORWARD) to NAT code that can be used with SIOCGNATL to check if it is possible to create an outgoing transparent NAT mapping to compliment the redirect being investigated. Linux requires that the checksums in the IP header get adjusted only resolve unknown interfaces in fr_stinsert, and nuke all interface pointers in SIOCSTPUT to prevent bad data being loaded from userspace. make the byte counting for state correct (was counting data from ICMP packet twice) print out the keyword "frag-body" if the flag is set. fix ipfs loading/restoring NAT sessions patch from Frank to correctly format IP addresses in ipfstat -t output parsing port numbers in ipf/ipnat was confusing as the port number was returned in an int that was also overloaded to be the suceess/failure. instead, change the port using pass by reference and only use the return value for indicating success or failure. 4.1.6 - Released 19 February 2005 add a new timeout number to NAT (fr_defnatipage) that is used for all non-TCP/UDP/ICMP protocols - default 60 seconds. buffer leak with bad nat - David Gueluy fix memory leak with state entries created by proxies eliminate copying too much data into a scan buffer allow a trailing protocol name for map rules as well as rdr ones fix bug in parsing of <= and > for NAT rules (two were crossed over) FreeBSD's iplwrite hasn't kept pace with iplread's prototype expand documention on the karma of using "auto" in ipnat map rules add matching on IP protocol to ipnat map rules allow ippool definitions to contain no addresses to start with Linux NAT needs to modify the IP header checksum as it gets called after it has been computed by IP. UDP was missing a pullup for packet header information before examining the header 4.1.5 - Released 9 January 2005 all rules were being converted into "dup-to" rules in the kernel fix two ftp proxy problems: 1st, buffer needs to be bigger for fitting in complete RETR/CWD commands, 2nd is () use in 227 messages isn't copied over correctly. response to CWDs revert ip_off back to network byte order in the ICMP error packet that gets generated. 4.1.4 - Released 9 January 2005 force NAT rules to only match ipv4 NAT rules (which all are, currently, by default) include state synchronisation fixes from Frank Volf make the maximum log size for internally buffered log entries accessible via "ipf -T" redesign start of fr_check() to avoid putting duplicate information in ipfilter about how much data needs to be pulled up for a protocol to be properly filtered. tidy up sending ICMP error messages - some bad inputs could result in data not being freed and/or no error returned. make the maximum size of the log buffer run-time tunable fix bug in parsing TCP header when looking for MSS option that could make the system hang change pool lookups that fail to find a match to return "no match" rather than fail. add run-time tunable debugging for proxy support code and FTP proxy. fix state table updates for entries where the first packet as an ICMPv6 multicast message fix hang when flushing state for v4/v6 and other (v6/v4) entries are present too attaching filtering to ipv6 pfil hook wasn't present for solaris don't allow rules with "keep state" and "with oow" move a bunch of userland only code from fil.c to ip_fil.c make fr_coalesce() more resiliant to bad input, just returning an error instead of crashing, making calling it easier in many places When m_pulldown doesn't return NULL, it doesn't necessarily return a pointer to the same mbuf passed in as the first arg. remove fr_unreach and use ENETUNREACH by default. printing out of tag data in ipf rules doesn't match input syntax ipftest(1) man page update ipfs command line option parsing still rejects some valid syntaxes SIGHUP handling by ipmon was not as safe as it could be fix various parsing regressions, including "", "tcpudp", ordering of "keep" options patches from Frank Volk: add udp_acktimeout to sysctl list for FreeBSD, ICMP packet length not calculated correctly in send_icmp_err, reply-to not printed by ipfstat, keep state with icmp passing (mtrr) patches for return-rst and return-icmp from Attila Fueloep (lichtscheu@gesindel.org) 4.1.3 - Released 18 July 2004 do some more fine tuning on NAT checksum adjustments correct IP address byte order in proxy setup for ipsec/pptp man page updates fix numerous problems with ipfs operation complete new syntax for ipmon.conf in its parser and update the sample file assign error value consistantly in fastroute code rewrite allocation of mbufs in send_reset/send_icmp_err to better use mbuf clusters and size calculations resolve problem with linux panic'ing because the wrong flag was being passed to skb_clone/skb_alloc enable use of shared/exclusive locks on freebsd5 and above do not rely on m_pkthdr.len to be valid all the time for mbufs on modern BSD and so use mbufchainlen to get the mbuf length instead replace lots of COPYIN/COPYOUT with BCOPYIN/BCOPYOUT where the data is going to be on the stack and not in userland packet buffer pointers were not refreshed & used properly in fr_check() include extra bits for OpenBSD 3.4 & 3.5. fix ipf/ipnat parsing regression problems with v3.4 4.1.2 - RELEASED - 27 May 2004 add state top for ipv6 fix numerous parsing regressions change sample proxies to use SIOCGNATL with the new API allow macro names to contain underscores (_) split the parser into a collection of dictionaries so that keywords do not interfere with resolving hostnames and portnames fix ipfrule LKM loading on freebsd support mapping a fixed range of ports to a single port fix timeout queue use by proxies with private queues handle space-led ftp server replies properly fix timeout queue management fix fastroute, generation of RST & ICMP packets and operation with to/fastroute resolve further linux compatibility problems replace the use of COPYIN with BCOPYIN for platforms that provide ioctl args on the stack allow flushing of ipv6 rules independant of ipv4 rules correct internal ipv6 checksum calculations if a 'keep state' rule fails to create state, block the packet rather than let it through correct all checksums in regression tests and correct NAT code to adjust checksums correctly. fix ipfs -R/-W 4.1.1 - RELEASED - 24 March 2004 allow new connections with the same port numbers as an existing one in the state table if the creating packet is a SYN timeout values have drifted, incorrectly, from what they were in 3.4 FreeBSD - compatibility changes for 5.2 don't match on sequence number (as well) for ICMO ECHO/REPLY, just the ICMP Id. field as otherwise thre is a state/NAT entry per packet pair rather than per "flow" fr_cksum() returned the wrong answer for ICMP Linux: - get return-rst and return-icmp working - treat the interface name the same as if_xname on BSD adjust expectations for TCP urgent bits based on observed traffic in the wild openbsd3.4 has ip_len/ip_off in network byte order when ipfilter is called fix flushing of hash pool gorups (ippool -F) as well as displaying them (ippool -l) passing of pointers to interface structures wrong for HP-UX/Solaris with return-* rules. Make the solaris boot script able to run on 2.5.1 ippool related files missing from Solaris packages The name /dev/ippool should be /dev/iplookup add regression testing for parsing long interface names in nat rules, along with mssclamp and tags. Also add test for mssclamp operation. ttl displayed for "ipfstat -t" is wrong because ttl is not computed. parse logical interface names (Sun) unloading LKMs was only working if they were enabled. sync'ing up NAT sessions when NICs change should cause NAT rules to re-lookup name->pointer mappings not all of the ippool ioctl's are IOWR and they should be because they use the ipfobj_t for passing information in/out of the kernel. leave the old values defined and handle them, for compatibility. pool stats wrong: ippoolstate used where ipoolstat should be, hash table statistics not reported at all fr_running not set correctly for OpenBSD when compiled into the kernel Allow SIOCGETFF while disabled Fix mssclamp with NAT (pasing and printing of the word, plus wrong bytes altered. How do you say "untested" ?) 4.1 - RELEASED - 12 February 2004 4.0-BETA1 20 August 2003 support 0/32 and 0/0 on the RHS in redirect rules where LHS and RHS netmasks are the same size for redirect, do 1:1 mapping for bimap rules. allow NAT rule to match 'all' interfaces with * as interface name do mapping of ICMP sequence id#'s in pings allow default age for NAT entries to be set per NAT rule provide round robin selection of destination addresses for redirect ipmon can load a configuration file with instructions on actions to take when a matching log entry is received now requires pfil to work on Solaris & HP-UX supports mapping outbound connections to a specific address/port support toggling of logging per ipfilter 'device' use queues to expire data rather than lists add MSN RPC proxy add IRC proxy support rules with dynamic ip addresses add ability to define a pool of addresses & networks which can then be placed in a single rule support passing entire packet back to user program for authentication support master/slave for state information sharing reorganise generic code into a lib directory and make libipf.a user programs enforce version matching with the kernel supports window scaling if seen at TCP session setup generates C code from filter rules to compile in or load as native machine code. supports loading rules comprised of BPF bytecode statements HP-UX 11 port completed and packets-per-second filtering add numerical tags to rules for filtering and display in ipmon output 3.4.4 23/05/2000 - Released don't add TCP state if it is an RST packet and (attempt) to send out RST/ICMP packets in a manner that bypasses IP Filter. add patch to work with 4.0_STABLE delayed checksums 3.4.3 20/05/2000 - Released fix ipmon -F don't truncate IPv6 packets on Solaris fix keep state for ICMP ECHO add some NAT stats and use def_nat_age rather than DEF_NAT_AGE don't make ftp proxy drop packets use MCLISREFERENCED() in tandem with M_EXT to check if IP fields need to be swapped back. fix up RST generation for non-Solaris get "short" flag right for IPv6 3.4.2 - 10/5/2000 - Released Fix bug in dealing with "hlen == 1 and opt > 1" - Itojun ignore previous NAT mappings for 0/0 and 0/32 rules bring in a completely new ftp proxy allow NAT to cause packets to be dropped. add NetBSD callout support for 1.4-current 3.4.1 - 30/4/2000 - Released add ratoui() and fix parsing of group numbers to allow 0 - UINT_MAX don't include opt_inet6.h for FreeBSD if KLD_MODULE is defined Solaris must use copyin() for all types of ioctl() args fix up screen/tty when leaving "top mode" of ipfstat linked list for maptable not setup correctly in nat_hostmap() check for maptable rather than nat_table[1] to see if malloc for maptable succeeded in nat_init fix handling of map NAT rules with "from/to" host specs fix printout out of source address when using "from/to" with map rules convert ip_len back to network byte order, not plen, for solaris as ip_len may have been changed by NAT and plen won't reflect this 3.4 - 27/4/2000 - Released source address spoofing can be turned on (fr_chksrc) without using filter rules group numbers are now 32bits in size, up from 16bits IPv6 filtering available add frank volf's state-top patches add load splitting and round-robin attribute to redirect rules FreeBSD-4.0 support (including KLD) add top-style operation mode for ipfstat (-t) add save/restore of IP Filter state/NAT information (ipfs) further ftp proxy security checks support for adding and removing proxies at runtime 3.3.13 26/04/2000 - Released Fix parsing of "range" with "portmap" Relax checking of ftp replies, slightly. Fix NAT timeouts for ICMP packets SunOS4 patches for ICMP redirects from Jurgen Keil (jk@tools.de) 3.3.12 16/03/2000 - Released tighten up ftp proxy behaviour. sigh. yuck. hate. fix bug in range check for NAT where the last IP# was not used. fix problem with icmp codes > 127 in filter rules caused bad things to happen and in particular, where #18 caused the rule to be printed erroneously. fix bug with the spl level not being reset when returning EIO from iplioctl due to ipfilter not being initialized yet. 3.3.11 04/03/2000 - Released make "or-block" work with lines that start with "log" fix up parsing and printing of rules with syslog levels in them fix from Cy Schubert for calling of apr_fini only if non-null 3.3.10 24/02/2000 - Released * fix back from guido for state tracking interfaces * update for NetBSD pfil interface changes * if attaching fails and we can abort, then cleanup when doing so. julian@computer.org: * solaris.c (fr_precheck): After calling freemsg on mt, set it point to *mp. * ipf.c (packetlogon): use flag to store the return value from get_flags. * ipmon.c (init_tabs): General cleanup so we do not have to cast an int s->s_port to u_int port and try to check if the u_int port is less than zero. 3.3.9 15/02/2000 - Released fix scheduling of bad locking in fr_addstate() used when we attach onto a filter rule. fix up ip_statesync() with storing interface names in ipstate_t fix fr_running for LKM's - Eugene Polovnikov junk using pullupmsg() for solaris - it's next to useless for what we need to do here anyway - and implement what we require. don't call fr_delstate() in fr_checkstate(), when compiled for a user program, early but when we're finished with it (got fr & pass) ipnat(5) fix from Guido on solaris2, copy message and use that with filter if there is another copy if it being used (db_ref > 1). bad for performance, but better than causing a crash. patch for solaris8-fcs compile from Casper Dik 3.3.8 01/02/2000 - Released fix state handling of SYN packets. add parsing recognition of extra icmp types/codes and fix handling of icmp time stamps and mask requests - Frank volf 3.3.7 25/01/2000 - Released sync on state information as well as NAT information when required record nat protocol in all nat log records don't reuse the IP# from an active NAT session if the IP# in the rule has changed dynamically. lookup the protocol for NAT log information in ipmon and pass that to portname. fix the bug with changing the outbound interface of a packet where it would lead to a panic. use fr_running instead of ipl_inited. (sysctl name change on freebsd) return EIO if someone attempts an ioctl on state/nat if ipfilter is not enabled. fix rule insertion bug make state flushing clean anything that's not fully established (4/4) call fr_state_flush() after we've released ipf_state so we don't generate a recursive mutex acquisition panic fix parsing of icmp code after return-icmp/return-icmp-as-dest and add some patches to enhance parsing strength 3.3.6 28/12/1999 - Released add in missing rwlock release in fr_checkicmpmatchingstate() and fix check for ICMP_ECHO to only be for packet, not state entry which we don't have yet. handle SIOCIPFFB in nat_ioctl() and fr_state_ioctl() fix size of friostat for SunOS4 fix bug in running off the end of a buffer in real audio proxy 3.3.5 11/12/1999 - Released fix parsing of "log level" and printing it back out too is only present on Solaris2.6/7/8 use send_icmp_err rather than icmp_error to send back a frag-needed error when doing PMTU do not use -b with add_drv on Solaris unless $BASEDIR is set. fix problem where source address in icmp replies is reversed fix yet another problem with real audio. 3.3.4 4/12/1999 - Released fix up the real audio proxy to properly setup state information and NAT entries, thanks to Laine Stump for testing/advice/fixes. fix ipfr_fastroute to set dst->sin_addr (Sean Farley - appears to prevent FreeBSD 3.3 from panic'ing) as this had been removed in prior hacks to this routine. fix kinstall for BSDI support ICMP errors being allowed through for ICMP packets going out with keep state enabled support hardware checksumming (gigabit ethernet cards) on Solaris thanks to Tel.Net Media for providing hardware for testing. patched from Frank Volf for ipmon (ICMP & fragmented packets) and allowing ICMP responses to ICMP packets in the keep state table. add in patches for hardware checksumming under solaris Solaris install scripts now use $BASEDIR as appropriate. add Solaris8 support fix "ipf -y" on solaris so that it rescans rules also for changes in interface pointers let ipmon become a daemon with -D if it is using syslog fix parsing of return-icmp-as-dest(foo) add reference to ipfstat -g to ipfstat.8 ipf_mutex needs to be declared for irix in ip_fil.c 3.3.3 22/10/1999 - Released add -g command line option to ipfstat to show groups still define. fix problem with fragment table not recording rule pointer when called from state functions (fin_fr not set). fixup fastroute problems with keep state rules. load rules into inactive set first, so we don't disable things like NIS lookups half way through processing - found by Kevin Littlejohn fix handling of unaligned ip pointer for solaris patch for fr_newauth from Rudi Sluijtman fixed htons() bug in fr_tcpsum() where ip_p wasn't cast to u_short 3.3.2 23/09/1999 - Released patches from Scott Presnell to fix rcmd proxy patches from Greg to fix Solaris detachment of interfaces add openbsd compatibility fixes fix free'ing already freed memory in ipfr_slowtimer() fix for deferencing invalid memory in cleaning up after a device disappears 3.3.1 14/8/1999 - Released remove include file sys/user.h for irix prevent people from running buildsunos directly fix up some problems with the saving of rule pointers so that NAT saves that information in case it should need to call fr_addstate() from a proxy. fix up scanning for the end of FTP messages don't remove /etc/opt/ipf in postremove attempt to prevent people running buildsolaris script without doing a "make solaris" fix timeout losing on freebsd3 3.3 7/8/1999 - Released NAT: information (rules, mappings) are stored in hash tables; setup some basic NAT regression testing. display version name of installed kernel code when initializing. add -V command line option to ipf, showing version (program and kernel module) as well as the run-status of the kernel code. fix problem with "log" rules actually affecting result of filtering. automatically use SUNWspro if available and on a 64bit Solaris system for compiling. add kernel proxies for rcmd(3) and RealAudio (PNA) use timeout/untimeout on SunOS4/BSD platforms too rather than hijacking ip_slowtimo fix IP headers generated through parsing of text information fix NAT rules to be in the correct order again. make keep-state work with to/fastroute keywords and enforce usage of those interfaces. update keep-state code with new algorithm from Guido add FreeBSD-3 support add return-icmp-as-dest option to retrun an ICMP packet using the original destination as the source rather than a local IP address add "level [facility.]" option to filter language add changes from Guido to state code. add code to return EPERM if the device is opened for writing and we're in securelevel 2 or greater. authentication code patches from Guido fix real audio proxy fix ipmon rule printing of interfaces and add IN/OUT to the end of ipmon log output. fix bimap rules with hash tables update addresses used in NAT mappings for 0/32 rules for any protocol but TCP if it changes on the interface - check every ip_natexpire() add redirect regression test count buckets used in the state hash table. fix sending of RST's with return-rst to use the ack number provided in the packet being replied to in addition to the sequence number. fix to compile as a 64bit application on solaris7-64bit add NAT IP mapping to ranges of IP addresses that aren't CIDR specified fix calculation of in_space parameter for NAT fix `wrapping' when incrementing the next ip address for use in NAT fix free'ing of kernel memory in ip_natunload on solaris fix -l/-U command line options from interfering with each other fix fastroute under solaris2 and cleanup compilation for solaris7 add install scripts and compile cleanly on BSD/OS 4.0 safely open files in /tmp for writing device output when testing. fix uninitialized pointer bug in NAT fix SIOCZRLST (zero list rule stats) bug with groups change some usage of u_short to u_int in function calling fix compilation for Solaris7 (SUNWspro) change solaris makefiles to build for either sparc or i386 rather than per-cpu (sun4u, etc). fixed bug in ipllog add patches from George Michaelson for FreeBSD 3.0 add patch from Guido to provide ICMP checking for known state in the same manner as is done for NAT. enable FTP PASV proxying and enable wildcarding in NAT/state code for ports for better PORT/PASV support with FTP. bring into main tree static nat features: map-block and "auto" portmapping. add in source host filtering for redirects (alan jones) 3.2.10 22/11/98 - Released 3.2.10beta9 17/11/98 - Released fix fr_tcpsum problems in handling mbufs with an odd number of bytes and/or split across an mbuf boundary fix NAT list entry comparisons and allow multiple entries for the same proxy (but on different ports). don't create duplicate NAT entries for repeated PORT commands. 3.2.10beta8 14/11/98 - Released always exit an rwlock before expecting to enter it again on solaris fix loop in nat_new for pre-existing nat don't setup state for an ftp connection if creating nat fails. 3.2.10beta7 05/11/98 - Released set fake window in ipft_tx.c to ensure code passes tests. cleaned up/enhanced ipnat -l/ipnat -lv output fixed NAT handling of non-TCP/UDP packets, esp. for ICMP errors returned. Solaris recusive mutex on icmp-error/tcp-reset - requires rwlock's rather than mutexes. 3.2.10beta6 03/11/98 - Released fix mixed use of krwlock_t and kmutex_t on Solaris2 fix FTP proxy back up, splitting pasv code out of port code. 3.2.10beta5 02/11/98 - Released fixed port translation in ICMP reply handling 3.2.10beta4 01/11/98 - Released increase useful statistic collection on solaris filter DL_UNITDATA_REQ as well as DL_UNITDATA_IND on solaris disable PASV reply translation for now fail with an error if we try to load a NAT rule with a non-existant proxy name - Guido fix portmap usage with 0/0 and 0/32 map rules remove ap_unload/ap_expire - automatically done when NAT is cleaned up print "STATE:CLOSED" from ipmon if the connection progresses past established rather than "STATE:EXPIRED" 3.2.10beta3 26/10/98 - Released fixed traceroute/nat problem rewrote nat/proxy interface ipnat now lists associated proxy sessions for each NAT where applicable 3.2.10beta2 13/10/98 - Released use KRWLOCK_T in place of krwlock_t for solaris as well as irix disable use of read-write lock acquisition by default add in mb_t for linux, non-kernel some changes to progress compilation on linux with glibc change PASV as well as PORT when passed through kernel ftp proxy. don't allow window to become 0 in tcp state code make ipmon compile cleaner irix patches 3.2.10beta 11/09/98 - Released stop fr_tcpsum() thinking it has run out of data when it hasn't. stop solaris panics due to fin_dp being something wild. revisit usage of ATOMIC_*() log closing state of TCP connection in "keep state" fix fake-arp table code for ipsend. ipmon now writes pid to a file. fix "ipmon -a" to actually activate all logging devices. add patches for BSDOS4. perl scripts for log analysis donated. 3.2.9 22/06/98 - Released fix byte order for ICMP packets generated on Solaris fix some locking problems. fix malloc bug in NAT (introduced in 3.2.8). patch from guido for state connections that get fragmented 3.2.8 08/06/98 - Released use readers/writers locks in Solaris2 in place of some mutexes. Solaris2 installation enhancements - Martin Forssen (maf@carlstedt.se) 3.2.7 24/05/98 - Released u_long -> u_32_t conversions patches from Bernd Ernesti for NetBSD fixup ipmon to actually handle HUP's. Linux fixes from Michael H. Warfield (mhw@wittsend.com) update for keep state patch (not security related) - Guido dumphex() uses stdout rather than log 3.2.6 18/05/98 - Released fix potential security loop hole in keep state code. update examples. 3.2.5 09/05/98 - Released BSD/OS 3.1 .o files added for the kernel. fix sequence # skew vs window size check. fix minimum ICMP header size check. remove references to Cybersource. fix my email address. remove ntohl in ipnat - Thomas Tornblom 3.2.4 09/04/98 - Released add script to make devices for /dev on BSD boxes fixup building into the kernel for FreeBSD 2.2.5 add -D command line option to ipmon to make it a daemon and SIGHUP causes it to close and reopen the logfile fixup make clean and make package for SunOS5 - Marc Boucher postinstall keeps adding "minor=ipf ipl" - George Ross protected by IP Filter gif - Sergey Solyanik 3.2.3 10/11/97 - Released fix some iplang bugs fix tcp checksum data overrun, sgi #define changes, avoid infinite loop when nat'ing to single IP# - Marc Boucher fixup DEVFS usage for FreeBSD fix sunos5 "make clean" cleaning up too much 3.2.2 28/11/97 - Released change packet matching to return actual error, if bad packet, to facilitate ECONNRESET for TCP. allow ip:netmask in grammar too now - Guido assume IRIX has u_int32_t in sys/types.h (needed for R10000) rewrite parts of command line options for ipmon fix TCP urgent packet & offset testing and add LAND attack test for iptest fix grammar error in yacc grammar for iplang redirect (rdr) destination port bytes-wapped when it shouldn't be. general: fr_check now returns error code, such as EHOSTUNREACH or ECONNRESET (attempt to make ECONNRESET work for locally outbound packets). linux: enable return-rst, need to filter tcp retransmits which are sent separately from normal packets memory leak plugged in ip_proxy.c BSDI compatibility patches from Guido tcp checksum fix - Marc Boucher recursive mutex and ioctl param fix - Marc Boucher 3.2.1 12/11/97 - Released port to BSD/OS 3.0 port to Linux 2.0.31 patches to make "map a/m -> 0/0" work with ftp proxying properly - Marc Boucher add "ipf -F s" and "ipf -F S" to flush state table entries. announce if logging is on or off when ip filter initializes. "ipf -F a" doesn't flush groups properly for Solaris. 3.2 30/10/97 - Released ipnat doesn't successfully remove proxy mappings with "-rf" - Alexander Romanyu use K&R C function style for solaris kernel code use m_adj() to decrease packet size in ftp proxy use mbufchainlen rather than msgdsize, IRIX update - Marc Boucher fix NetBSD modunload bug (pfil_add_hook done twice) patches for OpenBSD 2.1 - Craig Bevins 3.2beta10 24/10/97 - Released fix fragment table entries allocated for NAT. fix tcp checksum calculations over mbuf/mblk boundaries fix panic for blen < 0 in ftp kernel proxy - marc boucher fix flushing of rules which have been grouped. 3.2beta9 20/10/97 - Released some nit picking on solaris2 with SUNWspro - Michael Lyle ftp kernel proxy patches from Marc Boucher 3.2beta8 13/10/97 - Released add support for passing ICMP errors back through NAT. IRIX port update - Marc Boucher calculate correct MIN size of packet to log for UDP - Marc Boucher need htons(ETHERTYPE_x) on little endian BSD boxes - Dave Huang copyright header fixups 3.2beta7 23/09/97 - Released fickup problems introduced by prior merges & changes. 3.2beta6 23/09/97 - Released patch for spin-reading race condition - Marc Boucher. IRIX port by Marc Boucher. compatibility updates for Linux to ipsend 3.2beta5 13/09/97 - Released patches from Bernd Ernesti for NetBSD integration (mostly prototyping and compiler warning things) ipf -y will resync IP#'s allocated with 0/32 in NAT to match interface if it changes. update manual pages and other documentation updates. 3.2beta4 27/8/97 - Released enable setting IP and TCP options for iplang/ Solaris2 patches from Marc Boucher. add groups for filter rules. 3.2beta3 21/8/97 - Released patches for Solaris2 (interface panic solution ?): fix FIONREAD and replacing q_qinfo points - Marc Boucher change ipsend/* and ipsd/* copyright notices to be the same as ip filter's patch for SYN-ACK skew testing fix from Eric V. Smith 3.2beta2 6/8/97 - Released make it load on Solaris 2.3 rewrote logging to remove solaris errors, introduced checking to see if the same packet is logged successively. fix filter cache to work when there are no rules loaded. add "raw" option to ipresend to send entire ethernet frames. nat list corruption bug - NetBSD - Klaus Klein 3.2beta1 5/7/97 - Released patches from Jason Thorpe fixing: UNSIGNED_CHAR lossage, off_t being 64bits lossage, and other NetBSD bits. NetBSD 1.2G update. fixup fwtk patches and add protocol field for SIOCGNATL. rdr bugs reported by Alexander Romanyu (alexr@aix.krid.crimea.ua), with fixes: * rdr matched all packets of a given protocol (ignored ports). * severe bug in nat_delete which caused system crash/freeze. change Makefile so that CC isn't passed on for FreeBSD/NetBSD (will use the default CC - cc, not gcc) 3.2alpha9 16/6/97 - Released added "skip" keyword. implement preauthentication of packets, as outlined by Guido. Make it compile as cleanly as possible with -Wall & general code cleanup getopt returns int, not char. Bernd Ernesti 3.2alpha8 13/6/97 - Released code added to support "auth" rules which require a user program to allow them through. First revision and much of the code came from Guido. hex output from ipmon doesn't goto syslog when recovering from out of sync error. Luke Mewburn (lukem@connect.com.au) fix solaris2.6 lookup of destination ire's. ipnat doesn't throw away unused bits (after masking), causing it to behave incorrectly. Carson Gaspar NAT code doesn't include inteface name when matching - Alexey Mavrin replace old SunOS tcpip.h with new tcpip.h (from 4.4BSD) - Jason Thorpe. update install procedures to include ip_proxy.c mask out unused bits in NAT/RDR rules. use a generic type (u_32_t) for 32bit variables, rather than rely on u_long being such - Jason Thorpe. create a local "netinet" directory and include from ~netinet/*" rather than just "*" to make keeping the code working on ports easier. add an m_copydata and m_copyback for SunOS4 (based on 4.4BSD-Lite versions) documentation updates. NetBSD update from Jason Thorpe allow RST's through with a matching SEQ # and 0 ACK. Guido Van Rooij ipmon uses excessive amounts of CPU on Solaris2 - Reinhard Bertram 3.2alpha7 25/5/97 - Released add strlen for pre-2.2 kernels - Doug Kite setup bits and pieces for compiling into a FreeBSD-2.2 kernel. split up "bsd" targets. Now a separate netbsd/freebsd/bsd target. mln_ipl.c has been split up into itself and mlf_ipl.c (for freebsd). fix (negative) host matching in filtering. add sysctl interface for some variables when compiled into FreeBSD-2.2 kernels or later. make all the candidates for kernel compiling include "netinet/..." and build a subdirectory "netinet" when compiling and symlink all .h files into this. add install make target to Makefile.ipsend 3.2alpha6 8/5/97 - Released Add "!" (not) to hostname/ip matching. Automatically add packet info to the fragment cache if it is a fragment and we're translating addreses for. Automatically add packet info to the fragment cache if it is a fragment and we're "keeping state" for the packet. Solaris2 patches - Anthony Baxter (arb@connect.com.au) change install procedure for FreeBSD 2.2 to allow building to a kernel which is different to the running kernel. add FIONREAD for Solaris2! when expiring NAT table entries, if we would set a time to fr_tcpclosed (which is 1), make it fr_tcplaskack(20) so that the state tables have a chance to clear up. 3.2alpha5 add proxying skeleton support and sample ftp transparent proxy code. add printfs at startup to tell user what is happening. add packets & bytes for EXPIRE NAT log records. fix the "install-bsd" target in the root Makefile. Chris Williams Fixes for FreeBSD 2.2 (and later revs) to prevent panics. Julian Assange. 3.2alpha4 2/4/97 - Released Some compiler warnings cleaned up. FreeBSD-2.2 patches for LKM completed. 3.2alpha3 31/3/97 - Released ipmon changes: -N for reading NAT logfile, -S for reading state logfile. -a for reading all. -n now toggles hostname resolution. Add logging of new state entries and expiration of old state entries. count log successes and failures. Add logging of new NAT entries and expiration of old NAT entries. count log successes and failures. Use u_quad_t for records of bytes & packets where kept (IP Accounting: fr_hits, fr_bytes; IP state: is_pkts, is_bytes). Fixup use of CPU and DCPU in Makefiles. Fix broken 0/32 NAT mapping. Carl Makin 3.2alpha2 Implement mapping to 0/32 as being an alias for automatically using the interface's first IP address. Implement separate minor devices for both NAT and IP state code. Fully prototype all functions. Fix Makefile problem due to attempt to fix Sun compiling problems. 3.1.10 23/3/97 - Released ipfstat -a requires a -i or -o command line option too. Print an error when not present rather than attempt to do something. patch updates for SunOS4 for kernel compiling. patch for ipmon -s (flush's syslog file which isn't good). Andrew J. Schorr too many people hit their heads hard when compiling code into the kernel that doesn't let any packets through. (fil.c - IPF_NOMATCH) icmp-type parsing doesn't return any errors when it isn't constructed correctly. Neil Readwin Using "-conf" with modload on SunOS4 doesn't work. Timothy Demarest Need to define ARCH in makefile for SunOS4 building. "make sunos4" in INSTALL.SunOS is incorrect. James R Grinter [all SunOS targets now run buildsunos] NAT lookups are still incorrect, matching non-TCP/UDP with TCP/UDP information. ArkanoiD Need to check for __FreeBSD_version being 199511 rather than 199607 in mln_ipl.c. Eric Feillant 3.1.9 8/3/97 - Released fixed incorrect lookup of active NAT entries. patch for ip_deq() wrong for pre 2.1.6 FreeBSD. fyeung@fyeung8.netific.com (Francis Yeung) check for out with return-rst/return-icmp at wrong place - Erkki Ritoniemi (erkki@vlsi.fi) text_readip returns the interface pointer pointing to text on stack - Neil Readwin fix from Pradeep Krishnan for printout rules "with not opt sec". 3.1.8 18/2/97 - Released Diffs for ip_output.c and ip_input.c updated to fix bug with fastroute and compiling warnings about reuse of m0. prevent use of return-rst and return-icmp with rules blocking packets going out, preventing panics in certain situations. loop forms in frag cache table - Yury Pshenychny should use SPLNET/SPLX around expire routines in NAT/frag/state code. redeclared malloc in 44arp.c - 3.1.7 8/2/97 - Released Macros used for ntohs/htons supplied with gcc don't always work very well when the assignment is the same variable being converted. Filter matching doesn't not match rule which checks tcp flags on packets which are fragments - David Wilson 3.1.7beta 30/1/97 - Released Fix up NAT bugs introduced in last major change (now tested), including nat_delete(), nat_lookupredir(), checksum changes, etc. 3.1.7alpha 30/1/97 - Released Many changes to NAT code, including contributions from Laurent Joncheray Use "NO_SLEEP" when allocating memory under SunOS. Make kernel printf's nicer for BSD/SunOS4 Always do a checksum for packets being filtered going out and being processed by fastroute. Leave kernel to play with cdevsw on *BSD systems with LKM's. ipnat.1 man page fixes. 3.1.6 21/1/97 - Released Allow NAT to work on BSD systems in conjunction with "pass .. to ifname" Memory leak introduced in 3.1.3 in NAT lists, clearing of NAT table tried to free memory twice. NAT recalculates IP header checksum based on difference between IP#'s and port numbers - should be just IP#'s (Solaris2 only) 3.1.5 13/1/97 - Released fixed setting of NAT timeouts and use different timeouts for concurrent TCP sessions using the same IP# mapping (when port mapping isn't used) multiple loading/unloading of LKM's doesn't clean up cdevsw properly for *BSD systems. 3.1.4 10/1/97 - Released add command line options -C and -F to ipnat to flush NAT list and table ipnat -l loops on output - Neil Readwin (nreadwin@nysales.micrognosis.com) NetBSD/FreeBSD kernel malloc changes - Daniel Carosone 3.1.3 10/1/97 - Released NAT chains not constructed correctly in hash tables - Antony Y.R Lu (antony@hawk.ee.ncku.edu.tw) Updated INSTALL.NetBSD, INSTALL.FreeBSD and INSTALL.Sol2 man page update (ipf.5) from Daniel Carosone (dan@geek.com.au) ICMP header checksum update now included in NAT. Solaris2 needs to modify IP header checksums in ip_natin and ip_natout. 3.1.2 4/12/96 - Released ipmon doesn't use syslog all the time when given -s option fixed mclput panic in ip_input.c and replace ntohs() with NTOHS() macro check the results of hostname resolution in ipnat "make *install" fixed for subdirectories. problems with "ARCH:=" and gnu make resolved parser reports an error for lines with whitespaces only rather than skipping them. D.Carosone@abm.com.au (Daniel Carosone) patches for integration into NetBSD-current (post 1.2). add an option to allow non-IP packets going up/down the stream on Solaris2 to be dropped. John Bass. 3.1.2beta 21/11/96 - Released make ipsend compile on Linux 2.0.24 changes to TCP kept state algorithm, making it watch state on TCP connections in both directions. Also use the same algorithm for NAT TCP. -Wall cleanup - Bernd Ernesti added "or-block" for "pass .. log or-block" after a suggestion from David Oppenheim (davido@optimation.com.au) added subdirectories for building IP Filter in SunOS5/BSD for different cpu architecures Solaris2 fixes to logging and pre-filtering packet processing - 3.1.1p2 mbuf logging not using mtod(), remove iplbusy - 3.1.1p1 1/11/96 3.1.1 28/10/96 - Released Installation script fixes and deinstall scripts for IP Filter on: SunOS4/FreeBSD/NetBSD Man page fixes - Paul Dubois (dubois@primate.wisc.edu) Fix use of SOLARIS macro in ipmon, rewrote ipllog() (again!) parsing isn't completely case insensitive - David Wilson (davidw@optimation.com.au) Release ipl_mutex across uiomove() calls print entire rule entries out for "ipf -z" when zero'ing per-rule stats. ipfstat returns same output for "hits" in "ipfstat -aio" - Terletsky Slavik (ts@polynet.lviv.ua) New algorithm for setting timeouts for TCP connection (more closely follow TCP FSM) - Pradeep Krishnan (pkrishna@netcom.com) Track both window sizes for TCP connections through "keep state". Solaris2 doesn't like _KERNEL defined in stdargs.h - Jos van Wezel (wezel@bio.vu.nl) 3.1.1-beta2 6/10/96 - Released Solaris2 fastroute/dup-to/to now works ipmon `record' reading rewritten Added post-NetBSD1.2 packet filter patches - Mathew Green (mrg@eterna.com.au) Attempt to use in_proto.c.diff, not "..diffs" for SunOS4 - David Wilson (davidw@optimation.com.au) Michael Ryan (mike@NetworX.ie) reports the following: * The Trumpet WinSock under Windows always sends its SYN packet with an ACK value of 1, unlike any other implementation I've seen, which would set it to zero. The "keep state" feature of IP Filter doesn't work when receiving non-zero ACK values on new connection requests. * */Makefile install rule doesn't install all the binaries/man pages * Make ipnat use "tcp/udp" instead of "tcpudp" * Print out "tcp/udp" properly * ipnat "portmap tcp" matches "portmap udp" when adding/removing * NAT dest. ip# increased by one on mask of 0xffffffff when it shouldn't 3.1.1-beta 1/9/96 - Released add better detection of TCP connections closing to TCP state monitoring. fr_addstate() not called correctly for fragments. "keep state" and "keep frag" code don't work together 100% - Songqing Cai (songqing_cai@sterling.com) call to fr_addstate() incorrect for adding state in combination with keeping fragment information - Songqing Cai (songqing_cai@sterling.com) KFREE() passed fp (incorrect) and not fr (correct) in ip_frag.c - John Hood (cgull@smoke.marlboro.vt.us) make ipf parser recognise '\\' as a `continued line' marker - Dima Ruban (dima@best.net) 3.1.1-alpha 23/8/96 - Released kernel panic's when ICMP packets go through NAT code stats aren't zero'd properly with ipf -Z ipnat doesn't show port numbers correctly all the time and also add the protocol (tcp/udp/tcpudp) to rdr output - Carson Gaspar (carson@lehman.com) fast checksum fixing not 100% - backout patch - Bill Dorsey (dorsey@lila.com) NetBSD-1.2 patches from - VaX#n8 Usage() call error in fils.c - Ajay Shekhawat (ajay@cedar.buffalo.edu) ip_optcopy() staticly defined in ip_output.c in SunOS4 - Nick Hall (nrh@tardis.ed.ac.uk) 3.1.0 7/7/96 - Released Reformatted ipnat output to be compatible with it's input, so that "ipnat -l | ipnat -rf -" is possible. 3.1.0beta 30/6/96 - Released NetBSD-1.2 patches from Greg Woods (woods@most.weird.com) kernel module must not be installed stripped (Solaris2), as created by "make package" for Solaris2 - Peter Heimann (peter@i3.informatik.rwth-aachen.de) 3.1.0alpha 5/6/96 - Released include examples in package for solaris2 patches for removing an extra ip header checksum (FreeBSD/NetBSD/SunOS) removed trailing space from printouts of rules in ipf. ipresend supports the same range of inputs that ipftest does. sending a duplicate copy of a packet to another network devices is now supported. ("dup-to") sending a packet to an arbitary interface is now supported, irrespective of its actual route, with no ttl decrement. Can also be routed without the ttl being decremented. ("to" and "fastroute"). "call" option added to support calling a generic function if a packet is matched. show all (upto 4) recorded bytes from the interface name in logging from ipmon. support for using unix file permissions for read/write access on the device is now in place. recursive mutex in nat_new() for Solaris 2.x - Per L. Hagen ipftest doesn't call initparse() for THISHOST - Catherine Allen (cla@connect.com.au) Man page corrections from Rex Bona (rex@pengo.comsmiths.com.au) 3.0.4 10/4/96 - Released looop in `parsing' IP packets with optlen 0 for ip options. rule number not initialized and resulted in unexpected results for state maching. option parsing and printing bugs - Pradeep Krishnan 3.0.4beta 25/3/96 - Released wouldn't parse "keep flags keep state" correctly. SunOS4.1.x ip_input.c doesn't recognise all 1s broadcast address - Nigel Verdon patches for BSDI's BSD/OS 2.1 and libpcap reader on little endian systems from Thorsten Lockert b* functions in fil.c on Solaris 2.4 3.0.3 17/3/96 - Released added patches to support IP Filter initialisation when compiled into the kernel. added -x option to ipmon to display hex dumps of logged packets. added -H option to ipftest to allow ascii-hex formatted input to specify arbitary IP packets. Sending TCP RSTs as a response now work for Solaris2 x86 add patches to make IP Filter compile into NetBSD kernels properly. patch to stop SunOS 4.1.x kernels panicing with "data traps". ipfboot script unloads and reloads ipf module on Solaris2 if it is already loaded into the kernel. Installation of IP Filter as a Solaris2 package is now supported. Man pages for ipnat.4, ipnat.5 added. added some more regression tests and fixed up IP Filter to pass the new tests (previous versions failed some of the tests in set 12). IP option filter processing has changed so that saying "with opt lsrr" will check only for that one, but not mask out other options, so a packet with strict source routing, along with loose source routing will match all of "with opt lsrr", "with opt ssrr" and "with opt lsrr,ssrr". IPL_NAME needed in ipnat.c - Kelly (kelly@count04.mry.scruznet.com) patches for clean NetBSD compilation from Bernd Ernesti (bernd@arresum.inka.de) make install is incorrect - Julian Briggs (julian@lightwork.co.uk) strtol() returns 0x7fffffff for all negative numbers, printfr() generates incorrect output for "opt sec-class *", handling of "not opt xxx opt yyy" incorrect. - Minh Tonthat (minht@sbei.com)/Pradeep Krishnan (pradeepk@sbei.com) m_pullup() called only for input and not output; caused problems with filtering icmp - Nigel Verdon (verdenn@gb.swissbank.com) parsing problem for "port 1" and NetBSD patches incorrect - Andreas Gustafsson (gson@guava.araneus.fi) 3.0.2 4/2/96 - Released Corrected bug where NAT recalculates checksums for fragments. make NAT recalculate UDP checksums (rather than setting them to 0), if they're non-zero. DNS patches - Real Page (Real.Page@Matrox.com) alteration of checksum recalculations in NAT code and addition of redirection with NAT - Mike Neuman core dump, if tcp/udp is used with a port number and not service name, in ipf - Mike Neuman (mcn@engarde.com) initparse() call, missing to prime "" hook - Craig Bishop 3.0.1 14/1/96 - Released miscellaneous patches for Solaris2 3.0 14/1/96 - Released Patch included for FDDI, from Richard Ohnemus (Richard_Ohnemus@dallas.csd.sterling.com) Code cleanup for release. 3.0beta4 10/1/96 recursive mutex in ipfr_slowtimer fixed, reported by Craig Bishop recursive mutex in sending TCP RSTs fixed, reported by Tony Becker 3.0beta3 9/1/96 FIxup for Solaris2.5 install and interface name bug in ipftest from Julian Briggs (julian@lightwork.co.uk) Byte order patches for ipmon from Tony Becker (tony@mcrsys.com) 3.0beta2 7/1/96 Added the (somewhat warped) IP accounting as it exists in ipfw on FreeBSD. Note, this isn't really what one would call IP account, when compared to process accounting, sigh. Split up ipresend into iptest/ipresend/ipsend Added another m_pullup() inside fr_check() for BSD style kernels and added some checks to ipllog() to not log more than is present (for short packets). Fixed bug where failed hostname/netname resolution goes undetecte and becomes 0.0.0.0 (any) (reported Guido van Rooij) 3.0beta 11/11/95 - Released Rewrote the way rule testing is done, reducing the number of files needed and generated. SIOCIPFFL was incorrectly affected by IPFILTER_LOG (Mathew Green) Patches from Guido van Rooij to fix sending back TCP RSTs on Net-2/Net-3 BSD based Unixes (panic'd) Patches for FreeBSD/i86 ipmon from Riku Kalinen (I think someone else already told me about these but they got lost :-/) Changed Makefile structure to build object files for different operating systems in separate directories by default. BSDI has ef0 for first ethernet interface Allow for a "not" operator before optional keywords. The "rule number" was being incorrectly incremented every time it went through the loop rather than when it matched a rule. 2.8.2 24/10/95 - Released Fixed up problems with "textip" for doing lots of testing. Fixed bug in detection of "short" tcp/ip packets (all reported as being short). Solaris 2.4 port now works 100%. Man page errors reported and fixed. Removed duplicate entry in etc/services for login on port 49 (Craig Bishop). Fixed ipmon output to put a space after the log-letter. Patch from Guido van Rooij to fix parsing problem. 2.8.1 15/10/95 - Released Added ttl and tos filtering. Patches for fixing up compilation and port problems (little endian) from Guido van Rooij . Man page problems reported and fixed by Carson Gaspar . ipsend doesn't compile properly on Solaris2.4 Lots of work done for Solaris2.4 to make it MT/MP safe and work. 2.8 15/9/95 - Released ipmon can now send messages to syslogd (-s) and use names instead of numbers (-N). IP packets are now "compiled" into a structure only containing filterable bits. Added regression testing in the test/ subdirectory, using a new option (-b) with the ipftest program. Added "nomatch" return to filter results. These are counted and show up in reports from ipfstat. Moved filter code out of ip_fil.c and into fil.c - there is now only one instance of it in the package. Added Solaris 2.4 support. Added IPSO basic security option filtering. Added name support for filtering on all 19 named IP options. Patches from Ivan Brawley to log packet contents as well as packet headers. Update for sun/conf.c.diff from Ivan Brawley Added patches for FreeBSD 1, and added two new switches (-E, -D) to ipf, along with a new ioctl, SIOCFRENB. From: Dieter Dworkin Muller 2.7.3 31/7.95 - Released Didn't compile cleanly without IPFILTER_LOG defined (Mathew Green). ipftest now deals with tcpdump3 binary output files (from libpcap) with -P. Brought ipftest program upto date with actual filter code. Filter would cause a match to occur when it wasn't meant to if the packet had short headers and was missing portions that should have been there. Err, it would rightly not match on them, but their absence caused a match when it shouldn't have been. 2.7.2 26/7/95 - Released Problem with filtering just SYN flagged packets reported by Dieter Dworkin Muller . To solve this problem, added support for masking TCP flags for comparison "flags X/Y". 2.7.1 9/7/95 - Released Added ip_dirbroadcast support for Sun ip_input.c Fixed up the install scripts for FreeBSD/NetBSD to recognise where they are better. 2.7 7/7/95 - Released Added "return-rst" to return TCP RST's to TCP packets. Actually ported it to FreeBSD-i386 2.0.0, so it works there properly now. Added insertion of filter rules. Use "@<#>" at the beginning of a filter to insert a rule at row #. Filter keeps track of how many times each rule is matched. Changed compile time things to match kernel option (IPFILTER_LKM & IPFILTER_LOG). Updated ip_input.c and ip_output.c with paches for 3.5 Multicast IP. (No change required for 3.6) Now includes TCP fragments which start inside the TCP header as being short. Added counting the number of times each rule is matched. 2.6 11/5/95 - Released Added -n option to ipf: when supplied, no changes are made to the kernel. Added installation scripts for SunOS 4.1.x and NetBSD/FreeBSD/BSDI. Rewrote filtering to use a more generic mask & match procedure for checking if a packet matches a rule. 2.5.2 27/4/95 - Released "tcp/udp" and a non-initialised pointer caused the "proto" to become a `random' value; added "ip#/dotted.mask" notation to the BNF. From Adam W. Feigin 2.5.1 22/3/95 - Released "tcp/udp" had a strange effect (undesired) on getserv*() functions, causing protocol/service lookups to fail. Reported by Matthew Green. 2.5 17/3/95 - Released Added a new keyword "all" to BNF and parsing of tcpdump/etherfind/snoop output through the ipftest program. Suggestions from: Michael Ciavarella (mikec@phyto.apana.org.au) Conflicts occur when "general" filter rules are used for ports and the lack of a "proto" when used with "port" matches other packets when only TCP/UDP are implied. Reported Matthew Green (mrg@fulcom.com.au); reported & fixed 6-8/3/95 Added filtering of short TCP packets using "with short" 28/2/95 (These can possibly slip by checks for the various flags). Short UDP or ICMP are dropped to the floor and logged. Added filtering of fragmented packets using "with frag" 24/2/95 Port to NetBSD-current completed 20/2/95, using LKM. Added logging of the rule # which caused the logging to happen and the interface on which the packet is currently as suggested by Andreas Greulich (greulich@math-stat.unibe.ch) 10/2/95 2.4 9/2/95 - Released Fixed saving of IP headers in ICMP packets. 2.3 29/1/95 Added ipf -F [in|out|all] to flush filter rule sets (SIOCIPFFL). Fixed iplread() and iplsave() with help from Marc Huber. 2.2 7/1/95 - Released Added code from Marc Huber to allow it to allocate its own major char number dynamically when modload'ing. Fixed up use of <, >, <=, >= and >< for ports. 2.1 21/12/94 - Released repackaged to include the correct ip_output.c and ip_input.c *goof* 2.0 18/12/94 - Released added code to check for port ranges - complete. rewrote to work as a loadable kernel module - complete. 1.1 added code for ouput filtering as well as input filtering and added support for logging to a simple character device of packet headers. 1.0 22/04/93 - Released First release cut. diff --git a/contrib/ipfilter/l4check/http.ok b/contrib/ipfilter/l4check/http.ok index 0e7dd90187e0..2b5d2c15266d 100644 --- a/contrib/ipfilter/l4check/http.ok +++ b/contrib/ipfilter/l4check/http.ok @@ -1 +1 @@ - + \ No newline at end of file diff --git a/contrib/ipfilter/lib/Makefile b/contrib/ipfilter/lib/Makefile index d448ba0f4c1c..a6e9cc47842d 100644 --- a/contrib/ipfilter/lib/Makefile +++ b/contrib/ipfilter/lib/Makefile @@ -1,309 +1,312 @@ INCDEP=$(TOP)/ip_compat.h $(TOP)/ip_fil.h $(TOP)/ipf.h LIBOBJS=$(DEST)/addicmp.o \ $(DEST)/addipopt.o \ $(DEST)/addkeep.o \ $(DEST)/bcopywrap.o \ $(DEST)/binprint.o \ $(DEST)/buildopts.o \ $(DEST)/checkrev.o \ $(DEST)/count6bits.o \ $(DEST)/count4bits.o \ $(DEST)/debug.o \ $(DEST)/extras.o \ $(DEST)/facpri.o \ $(DEST)/flags.o \ $(DEST)/fill6bits.o \ $(DEST)/genmask.o \ $(DEST)/gethost.o \ $(DEST)/getifname.o \ $(DEST)/getline.o \ $(DEST)/getnattype.o \ $(DEST)/getport.o \ $(DEST)/getportproto.o \ $(DEST)/getproto.o \ $(DEST)/getsumd.o \ $(DEST)/hexdump.o \ $(DEST)/hostmask.o \ $(DEST)/hostname.o \ $(DEST)/hostnum.o \ $(DEST)/icmpcode.o \ $(DEST)/inet_addr.o \ $(DEST)/initparse.o \ $(DEST)/ionames.o \ $(DEST)/ipoptsec.o \ $(DEST)/ipf_dotuning.o \ $(DEST)/ipft_ef.o \ $(DEST)/ipft_hx.o \ $(DEST)/ipft_pc.o \ $(DEST)/ipft_sn.o \ $(DEST)/ipft_td.o \ $(DEST)/ipft_tx.o \ $(DEST)/kmem.o \ $(DEST)/kmemcpywrap.o \ $(DEST)/kvatoname.o \ $(DEST)/load_hash.o \ $(DEST)/load_hashnode.o \ $(DEST)/load_pool.o \ $(DEST)/load_poolnode.o \ $(DEST)/loglevel.o \ $(DEST)/make_range.o \ $(DEST)/mutex_emul.o \ $(DEST)/nametokva.o \ $(DEST)/nat_setgroupmap.o \ $(DEST)/ntomask.o \ $(DEST)/optname.o \ $(DEST)/optprint.o \ $(DEST)/optprintv6.o \ $(DEST)/optvalue.o \ $(DEST)/portname.o \ $(DEST)/portnum.o \ $(DEST)/ports.o \ $(DEST)/print_toif.o \ $(DEST)/printactivenat.o \ $(DEST)/printaps.o \ $(DEST)/printbuf.o \ $(DEST)/printhash.o \ $(DEST)/printhashnode.o \ $(DEST)/printip.o \ $(DEST)/printpool.o \ $(DEST)/printpoolnode.o \ + $(DEST)/printproto.o \ $(DEST)/printfr.o \ $(DEST)/printfraginfo.o \ $(DEST)/printhostmap.o \ $(DEST)/printifname.o \ $(DEST)/printhostmask.o \ $(DEST)/printlog.o \ $(DEST)/printmask.o \ $(DEST)/printnat.o \ $(DEST)/printportcmp.o \ $(DEST)/printpacket.o \ $(DEST)/printpacket6.o \ $(DEST)/printsbuf.o \ $(DEST)/printstate.o \ $(DEST)/printtunable.o \ $(DEST)/ratoi.o \ $(DEST)/ratoui.o \ $(DEST)/remove_hash.o \ $(DEST)/remove_hashnode.o \ $(DEST)/remove_pool.o \ $(DEST)/remove_poolnode.o \ $(DEST)/resetlexer.o \ $(DEST)/rwlock_emul.o \ $(DEST)/tcpflags.o \ $(DEST)/tcp_flags.o \ $(DEST)/to_interface.o \ $(DEST)/var.o \ $(DEST)/verbose.o \ $(DEST)/v6ionames.o \ $(DEST)/v6optvalue.o $(DEST)/libipf.a: $(LIBOBJS) /bin/rm -f $@ ar $(AROPTS) $@ $(LIBOBJS) $(RANLIB) $@ $(DEST)/addicmp.o: $(LIBSRC)/addicmp.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/addicmp.c -o $@ $(DEST)/addipopt.o: $(LIBSRC)/addipopt.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/addipopt.c -o $@ $(DEST)/addkeep.o: $(LIBSRC)/addkeep.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/addkeep.c -o $@ $(DEST)/bcopywrap.o: $(LIBSRC)/bcopywrap.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/bcopywrap.c -o $@ $(DEST)/binprint.o: $(LIBSRC)/binprint.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/binprint.c -o $@ $(DEST)/buildopts.o: $(LIBSRC)/buildopts.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/buildopts.c -o $@ $(DEST)/count6bits.o: $(LIBSRC)/count6bits.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/count6bits.c -o $@ $(DEST)/checkrev.o: $(LIBSRC)/checkrev.c $(INCDEP) $(TOP)/ipl.h $(CC) $(CCARGS) -c $(LIBSRC)/checkrev.c -o $@ $(DEST)/count4bits.o: $(LIBSRC)/count4bits.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/count4bits.c -o $@ $(DEST)/debug.o: $(LIBSRC)/debug.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/debug.c -o $@ $(DEST)/extras.o: $(LIBSRC)/extras.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/extras.c -o $@ $(DEST)/facpri.o: $(LIBSRC)/facpri.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/facpri.c -o $@ $(DEST)/fill6bits.o: $(LIBSRC)/fill6bits.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/fill6bits.c -o $@ $(DEST)/flags.o: $(LIBSRC)/flags.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/flags.c -o $@ $(DEST)/genmask.o: $(LIBSRC)/genmask.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/genmask.c -o $@ $(DEST)/getline.o: $(LIBSRC)/getline.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/getline.c -o $@ $(DEST)/gethost.o: $(LIBSRC)/gethost.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/gethost.c -o $@ $(DEST)/getifname.o: $(LIBSRC)/getifname.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/getifname.c -o $@ $(DEST)/getnattype.o: $(LIBSRC)/getnattype.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/getnattype.c -o $@ $(DEST)/getport.o: $(LIBSRC)/getport.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/getport.c -o $@ $(DEST)/getportproto.o: $(LIBSRC)/getportproto.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/getportproto.c -o $@ $(DEST)/getproto.o: $(LIBSRC)/getproto.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/getproto.c -o $@ $(DEST)/getsumd.o: $(LIBSRC)/getsumd.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/getsumd.c -o $@ $(DEST)/hexdump.o: $(LIBSRC)/hexdump.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/hexdump.c -o $@ $(DEST)/hostmask.o: $(LIBSRC)/hostmask.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/hostmask.c -o $@ $(DEST)/hostname.o: $(LIBSRC)/hostname.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/hostname.c -o $@ $(DEST)/hostnum.o: $(LIBSRC)/hostnum.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/hostnum.c -o $@ $(DEST)/icmpcode.o: $(LIBSRC)/icmpcode.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/icmpcode.c -o $@ $(DEST)/ipoptsec.o: $(LIBSRC)/ipoptsec.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ipoptsec.c -o $@ $(DEST)/inet_addr.o: $(LIBSRC)/inet_addr.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/inet_addr.c -o $@ $(DEST)/initparse.o: $(LIBSRC)/initparse.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/initparse.c -o $@ $(DEST)/ionames.o: $(LIBSRC)/ionames.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ionames.c -o $@ $(DEST)/ipf_dotuning.o: $(LIBSRC)/ipf_dotuning.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ipf_dotuning.c -o $@ $(DEST)/ipft_ef.o: $(LIBSRC)/ipft_ef.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ipft_ef.c -o $@ $(DEST)/ipft_hx.o: $(LIBSRC)/ipft_hx.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ipft_hx.c -o $@ $(DEST)/ipft_pc.o: $(LIBSRC)/ipft_pc.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ipft_pc.c -o $@ $(DEST)/ipft_sn.o: $(LIBSRC)/ipft_sn.c $(TOP)/snoop.h $(CC) $(CCARGS) -c $(LIBSRC)/ipft_sn.c -o $@ $(DEST)/ipft_td.o: $(LIBSRC)/ipft_td.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ipft_td.c -o $@ $(DEST)/ipft_tx.o: $(LIBSRC)/ipft_tx.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ipft_tx.c -o $@ $(DEST)/kmem.o: $(LIBSRC)/kmem.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/kmem.c -o $@ $(DEST)/kmemcpywrap.o: $(LIBSRC)/kmemcpywrap.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/kmemcpywrap.c -o $@ $(DEST)/kvatoname.o: $(LIBSRC)/kvatoname.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/kvatoname.c -o $@ $(DEST)/load_hash.o: $(LIBSRC)/load_hash.c $(INCDEP) $(TOP)/ip_htable.h $(CC) $(CCARGS) -c $(LIBSRC)/load_hash.c -o $@ $(DEST)/load_hashnode.o: $(LIBSRC)/load_hashnode.c $(INCDEP) $(TOP)/ip_htable.h $(CC) $(CCARGS) -c $(LIBSRC)/load_hashnode.c -o $@ $(DEST)/load_pool.o: $(LIBSRC)/load_pool.c $(INCDEP) $(TOP)/ip_pool.h $(CC) $(CCARGS) -c $(LIBSRC)/load_pool.c -o $@ $(DEST)/load_poolnode.o: $(LIBSRC)/load_poolnode.c $(INCDEP) $(TOP)/ip_pool.h $(CC) $(CCARGS) -c $(LIBSRC)/load_poolnode.c -o $@ $(DEST)/make_range.o: $(LIBSRC)/make_range.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/make_range.c -o $@ $(DEST)/mutex_emul.o: $(LIBSRC)/mutex_emul.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/mutex_emul.c -o $@ $(DEST)/nametokva.o: $(LIBSRC)/nametokva.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/nametokva.c -o $@ $(DEST)/nat_setgroupmap.o: $(LIBSRC)/nat_setgroupmap.c $(TOP)/ip_compat.h \ $(TOP)/ipf.h $(TOP)/ip_nat.h $(CC) $(CCARGS) -c $(LIBSRC)/nat_setgroupmap.c -o $@ $(DEST)/ntomask.o: $(LIBSRC)/ntomask.c $(TOP)/ip_compat.h $(CC) $(CCARGS) -c $(LIBSRC)/ntomask.c -o $@ $(DEST)/loglevel.o: $(LIBSRC)/loglevel.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/loglevel.c -o $@ $(DEST)/optname.o: $(LIBSRC)/optname.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/optname.c -o $@ $(DEST)/optprint.o: $(LIBSRC)/optprint.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/optprint.c -o $@ $(DEST)/optprintv6.o: $(LIBSRC)/optprintv6.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/optprintv6.c -o $@ $(DEST)/optvalue.o: $(LIBSRC)/optvalue.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/optvalue.c -o $@ $(DEST)/portname.o: $(LIBSRC)/portname.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/portname.c -o $@ $(DEST)/portnum.o: $(LIBSRC)/portnum.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/portnum.c -o $@ $(DEST)/ports.o: $(LIBSRC)/ports.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ports.c -o $@ $(DEST)/print_toif.o: $(LIBSRC)/print_toif.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/print_toif.c -o $@ $(DEST)/printactivenat.o: $(LIBSRC)/printactivenat.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printactivenat.c -o $@ $(DEST)/printaps.o: $(LIBSRC)/printaps.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printaps.c -o $@ $(DEST)/printbuf.o: $(LIBSRC)/printbuf.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printbuf.c -o $@ $(DEST)/printfr.o: $(LIBSRC)/printfr.c $(TOP)/ip_fil.h $(CC) $(CCARGS) -c $(LIBSRC)/printfr.c -o $@ $(DEST)/printfraginfo.o: $(LIBSRC)/printfraginfo.c $(TOP)/ip_fil.h $(CC) $(CCARGS) -c $(LIBSRC)/printfraginfo.c -o $@ $(DEST)/printhash.o: $(LIBSRC)/printhash.c $(TOP)/ip_fil.h $(TOP)/ip_htable.h $(CC) $(CCARGS) -c $(LIBSRC)/printhash.c -o $@ $(DEST)/printhashnode.o: $(LIBSRC)/printhashnode.c $(TOP)/ip_fil.h \ $(TOP)/ip_htable.h $(TOP)/ip_lookup.h $(CC) $(CCARGS) -c $(LIBSRC)/printhashnode.c -o $@ $(DEST)/printip.o: $(LIBSRC)/printip.c $(TOP)/ip_fil.h $(CC) $(CCARGS) -c $(LIBSRC)/printip.c -o $@ $(DEST)/printpool.o: $(LIBSRC)/printpool.c $(TOP)/ip_fil.h $(TOP)/ip_pool.h $(CC) $(CCARGS) -c $(LIBSRC)/printpool.c -o $@ $(DEST)/printpoolnode.o: $(LIBSRC)/printpoolnode.c $(TOP)/ip_fil.h \ $(TOP)/ip_pool.h $(TOP)/ip_lookup.h $(CC) $(CCARGS) -c $(LIBSRC)/printpoolnode.c -o $@ +$(DEST)/printproto.o: $(LIBSRC)/printproto.c $(TOP)/ip_fil.h + $(CC) $(CCARGS) -c $(LIBSRC)/printproto.c -o $@ $(DEST)/printhostmap.o: $(LIBSRC)/printhostmap.c $(TOP)/ip_fil.h $(CC) $(CCARGS) -c $(LIBSRC)/printhostmap.c -o $@ $(DEST)/printifname.o: $(LIBSRC)/printifname.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printifname.c -o $@ $(DEST)/printmask.o: $(LIBSRC)/printmask.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printmask.c -o $@ $(DEST)/printnat.o: $(LIBSRC)/printnat.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printnat.c -o $@ $(DEST)/printhostmask.o: $(LIBSRC)/printhostmask.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printhostmask.c -o $@ $(DEST)/printlog.o: $(LIBSRC)/printlog.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printlog.c -o $@ $(DEST)/printpacket.o: $(LIBSRC)/printpacket.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printpacket.c -o $@ $(DEST)/printpacket6.o: $(LIBSRC)/printpacket6.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printpacket6.c -o $@ $(DEST)/printportcmp.o: $(LIBSRC)/printportcmp.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printportcmp.c -o $@ $(DEST)/printsbuf.o: $(LIBSRC)/printsbuf.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printsbuf.c -o $@ $(DEST)/printstate.o: $(LIBSRC)/printstate.c $(INCDEP) $(TOP)/ip_state.h $(CC) $(CCARGS) -c $(LIBSRC)/printstate.c -o $@ $(DEST)/printtunable.o: $(LIBSRC)/printtunable.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/printtunable.c -o $@ $(DEST)/ratoi.o: $(LIBSRC)/ratoi.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ratoi.c -o $@ $(DEST)/ratoui.o: $(LIBSRC)/ratoui.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/ratoui.c -o $@ $(DEST)/remove_hash.o: $(LIBSRC)/remove_hash.c $(INCDEP) \ $(TOP)/ip_htable.h $(CC) $(CCARGS) -c $(LIBSRC)/remove_hash.c -o $@ $(DEST)/remove_hashnode.o: $(LIBSRC)/remove_hashnode.c $(INCDEP) \ $(TOP)/ip_htable.h $(CC) $(CCARGS) -c $(LIBSRC)/remove_hashnode.c -o $@ $(DEST)/remove_pool.o: $(LIBSRC)/remove_pool.c $(INCDEP) \ $(TOP)/ip_htable.h $(CC) $(CCARGS) -c $(LIBSRC)/remove_pool.c -o $@ $(DEST)/remove_poolnode.o: $(LIBSRC)/remove_poolnode.c $(INCDEP) \ $(TOP)/ip_htable.h $(CC) $(CCARGS) -c $(LIBSRC)/remove_poolnode.c -o $@ $(DEST)/resetlexer.o: $(LIBSRC)/resetlexer.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/resetlexer.c -o $@ $(DEST)/rwlock_emul.o: $(LIBSRC)/rwlock_emul.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/rwlock_emul.c -o $@ $(DEST)/to_interface.o: $(LIBSRC)/to_interface.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/to_interface.c -o $@ $(DEST)/tcpflags.o: $(LIBSRC)/tcpflags.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/tcpflags.c -o $@ $(DEST)/tcp_flags.o: $(LIBSRC)/tcp_flags.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/tcp_flags.c -o $@ $(DEST)/var.o: $(LIBSRC)/var.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/var.c -o $@ $(DEST)/verbose.o: $(LIBSRC)/verbose.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/verbose.c -o $@ $(DEST)/v6ionames.o: $(LIBSRC)/v6ionames.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/v6ionames.c -o $@ $(DEST)/v6optvalue.o: $(LIBSRC)/v6optvalue.c $(INCDEP) $(CC) $(CCARGS) -c $(LIBSRC)/v6optvalue.c -o $@ clean-lib: /bin/rm -f ${LIBOBJS} ${LIB} diff --git a/contrib/ipfilter/lib/printproto.c b/contrib/ipfilter/lib/printproto.c new file mode 100644 index 000000000000..dd0ce39ca57e --- /dev/null +++ b/contrib/ipfilter/lib/printproto.c @@ -0,0 +1,51 @@ +/* + * Copyright (C) 1993-2005 by Darren Reed. + * + * See the IPFILTER.LICENCE file for details on licencing. + */ + +#include "ipf.h" + + +#if !defined(lint) +static const char rcsid[] = "@(#)$Id: printproto.c,v 1.1.2.1 2005/06/12 07:21:53 darrenr Exp $"; +#endif + + +void printproto(pr, p, np) +struct protoent *pr; +int p; +ipnat_t *np; +{ + if (np != NULL) { + if ((np->in_flags & IPN_TCPUDP) == IPN_TCPUDP) + printf("tcp/udp"); + else if (np->in_flags & IPN_TCP) + printf("tcp"); + else if (np->in_flags & IPN_UDP) + printf("udp"); + else if (np->in_flags & IPN_ICMPQUERY) + printf("icmp"); +#ifdef _AIX51 + /* + * To make up for "ip = 252" and "hopopt = 0" in /etc/protocols + */ + else if (np->in_p == 0) + printf("ip"); +#endif + else if (pr != NULL) + printf("%s", pr->p_name); + else + printf("%d", np->in_p); + } else { +#ifdef _AIX51 + if (p == 0) + printf("ip"); + else +#endif + if (pr != NULL) + printf("%s", pr->p_name); + else + printf("%d", p); + } +} diff --git a/contrib/ipfilter/perl/ipf-mrtg.pl b/contrib/ipfilter/perl/ipf-mrtg.pl index a96a7cddb2b3..cce30ab09c5b 100644 --- a/contrib/ipfilter/perl/ipf-mrtg.pl +++ b/contrib/ipfilter/perl/ipf-mrtg.pl @@ -1,22 +1,22 @@ #!/usr/local/bin/perl # reads stats and uptime for ip-filter for mrtg # ron@rosie.18james.com, 2 Jan 2000 my $firewall = "IP Filter v3.3.3"; my($in_pkts,$out_pkts) = (0,0); open(FW, "/sbin/ipfstat -hi|") || die "cannot open ipfstat -hi\n"; while () { $in_pkts += $1 if (/^(\d+)\s+pass\s+in\s+quick.*group\s+1\d0/); } close(FW); open(FW, "/sbin/ipfstat -ho|") || die "cannot open ipfstat -ho\n"; while () { $out_pkts += $1 if (/^(\d+)\s+pass\s+out\s+quick.*group\s+1\d0/); } print "$in_pkts\n", "$out_pkts\n"; my $uptime = `/usr/bin/uptime`; $uptime =~ /^\s+(\d{1,2}:\d{2}..)\s+up\s+(\d+)\s+(......),/; print "$2 $3\n", - "$firewall\n"; + "$firewall\n"; \ No newline at end of file diff --git a/contrib/ipfilter/perl/logfilter.pl b/contrib/ipfilter/perl/logfilter.pl index a75eafd72e9c..6ebe401ab4ee 100644 --- a/contrib/ipfilter/perl/logfilter.pl +++ b/contrib/ipfilter/perl/logfilter.pl @@ -1,181 +1,181 @@ #!perl.exe # Author: Chris Grant # Copyright 1999, Codetalker Communications, Inc. # # This script takes a firewall log and breaks it into several # different files. Each file is named based on the service that # runs on the port that was recognized in log line. After # this script has run, you should end up with several files. # Of course you will have the original log file and then files # such as web.log, telnet.log, pop3.log, imap.log, backorifice.log, # netbus.log, and unknown.log. # # The number of entries in unknown.log should be minimal. The # mappings of the port numbers and file names are stored in the bottom # of this file in the data section. Simply look at the ports being hit, # find out what these ports do, and add them to the data section. # # You may be wondering why I haven't simply parsed RFC1700 to come up # with a list of port numbers and files. The reason is that I don't # believe reading firewall logs should be all that automated. You # should be familiar with what probes are hitting your system. By # manually adding entries to the data section this ensures that I # have at least educated myself about what this protocol is, what # the potential exposure is, and why you might be seeing this traffic. %icmp = (); %udp = (); %tcp = (); %openfiles = (); $TIDBITSFILE = "unknown.log"; # Read the ports data from the end of this file and build the three hashes while () { chomp; # trim the newline s/#.*//; # no comments s/^\s+//; # no leading white s/\s+$//; # no trailing white next unless length; # anything left? $_ = lc; # switch to lowercase ($proto, $identifier, $filename) = m/(\S+)\s+(\S+)\s+(\S+)/; SWITCH: { if ($proto =~ m/^icmp$/) { $icmp{$identifier} = $filename; last SWITCH; }; if ($proto =~ m/^udp$/) { $udp{$identifier} = $filename; last SWITCH; }; if ($proto =~ m/^tcp$/) { $tcp{$identifier} = $filename; last SWITCH; }; die "An unknown protocol listed in the proto defs\n$_\n"; } } $filename = shift; unless (defined($filename)) { die "Usage: logfilter.pl \n"; } open(LOGFILE, $filename) || die "Could not open the firewall log file.\n"; $openfiles{$filename} = "LOGFILE"; $linenum = 0; while($line = ) { chomp($line); $linenum++; # determine the protocol - send to unknown.log if not found SWITCH: { ($line =~ m /\sicmp\s/) && do { # # ICMP Protocol # # Extract the icmp packet information specifying the type. # # Note: Must check for ICMP first because this may be an ICMP reply # to a TCP or UDP connection (eg Port Unreachable). ($icmptype) = $line =~ m/icmp (\d+)\/\d+/; $filename = $TIDBITSFILE; $filename = $icmp{$icmptype} if (defined($icmp{$icmptype})); last SWITCH; }; ($line =~ m /\stcp\s/) && do { # # TCP Protocol # # extract the source and destination ports and compare them to # known ports in the tcp hash. For the first match, place this # line in the file specified by the tcp hash. Ignore one of the # port matches if both ports happen to be known services. ($sport, $dport) = $line =~ m/\d+\.\d+\.\d+\.\d+,(\d+) -> \d+\.\d+\.\d+\.\d+,(\d+)/; #print "$line\n" unless (defined($sport) && defined($dport)); $filename = $TIDBITSFILE; $filename = $tcp{$sport} if (defined($tcp{$sport})); $filename = $tcp{$dport} if (defined($tcp{$dport})); last SWITCH; }; ($line =~ m /\sudp\s/) && do { # # UDP Protocol - same procedure as with TCP, different hash # ($sport, $dport) = $line =~ m/\d+\.\d+\.\d+\.\d+,(\d+) -> \d+\.\d+\.\d+\.\d+,(\d+)/; $filename = $TIDBITSFILE; $filename = $udp{$sport} if (defined($udp{$sport})); $filename = $udp{$dport} if (defined($udp{$dport})); last SWITCH; }; # # The default case is that the protocol was unknown # $filename = $TIDBITSFILE; } # # write the line to the appropriate file as determined above # # check for filename in the openfiles hash. if it exists then write # to the given handle. otherwise open a handle to the file and add # it to the hash of open files. if (defined($openfiles{$filename})) { $handle = $openfiles{$filename}; } else { $handle = "HANDLE" . keys %openfiles; open ($handle, ">>".$filename) || die "Couldn't open|create the file $filename"; $openfiles{$filename} = $handle; } print $handle "#$linenum\t $line\n"; } # close all open file handles foreach $key (keys %openfiles) { close($openfiles{$key}); } close(LOGFILE); __DATA__ icmp 3 destunreach.log icmp 8 ping.log icmp 9 router.log icmp 10 router.log icmp 11 ttl.log tcp 23 telnet.log tcp 25 smtp.log udp 25 smtp.log udp 53 dns.log tcp 80 http.log tcp 110 pop3.log tcp 111 rpc.log udp 111 rpc.log tcp 137 netbios.log udp 137 netbios.log tcp 143 imap.log udp 161 snmp.log udp 370 backweb.log udp 371 backweb.log tcp 443 https.log udp 443 https.log udp 512 syslog.log tcp 635 nfs.log # NFS mount services udp 635 nfs.log # NFS mount services tcp 1080 socks.log udp 1080 socks.log tcp 6112 games.log # Battle net tcp 6667 irc.log tcp 7070 realaudio.log tcp 8080 http.log tcp 12345 netbus.log -udp 31337 backorifice.log +udp 31337 backorifice.log \ No newline at end of file diff --git a/contrib/ipfilter/rules/example.1 b/contrib/ipfilter/rules/example.1 index 3da9f3ccab5c..ff93f492cafe 100644 --- a/contrib/ipfilter/rules/example.1 +++ b/contrib/ipfilter/rules/example.1 @@ -1,5 +1,4 @@ -# $FreeBSD$ # # block all incoming TCP packets on le0 from host 10.1.1.1 to any destination. # block in on le0 proto tcp from 10.1.1.1/32 to any diff --git a/contrib/ipfilter/rules/example.10 b/contrib/ipfilter/rules/example.10 index f7a0b011e144..560d1e670f61 100644 --- a/contrib/ipfilter/rules/example.10 +++ b/contrib/ipfilter/rules/example.10 @@ -1,13 +1,12 @@ -# $FreeBSD$ # # pass ack packets (ie established connection) # pass in proto tcp from 10.1.0.0/16 port = 23 to 10.2.0.0/16 flags A/A pass out proto tcp from 10.1.0.0/16 port = 23 to 10.2.0.0/16 flags A/A # # block incoming connection requests to my internal network from the big bad # internet. # block in on le0 proto tcp from any to 10.1.0.0/16 flags S/SA # to block the replies: block out on le0 proto tcp from 10.1.0.0 to any flags SA/SA diff --git a/contrib/ipfilter/rules/example.11 b/contrib/ipfilter/rules/example.11 index 1cefa9a3b35d..c6b4e7ff0d73 100644 --- a/contrib/ipfilter/rules/example.11 +++ b/contrib/ipfilter/rules/example.11 @@ -1,27 +1,26 @@ -# $FreeBSD$ # # allow any TCP packets from the same subnet as foo is on through to host # 10.1.1.2 if they are destined for port 6667. # pass in proto tcp from 10.2.2.2/24 to 10.1.1.2/32 port = 6667 # # allow in UDP packets which are NOT from port 53 and are destined for # localhost # pass in proto udp from 10.2.2.2 port != 53 to localhost # # block anything trying to get to X terminal ports, X:0 to X:9 # block in proto tcp from any to any port 5999 >< 6010 # # allow any connections to be made, except to BSD print/r-services # this will also protect syslog. # block in proto tcp/udp all pass in proto tcp/udp from any to any port 512 <> 515 # # allow any connections to be made, except to BSD print/r-services # this will also protect syslog. # pass in proto tcp/udp all block in proto tcp/udp from any to any port 511 >< 516 diff --git a/contrib/ipfilter/rules/example.12 b/contrib/ipfilter/rules/example.12 index 6dbaef58c561..c0ba1d3cdda1 100644 --- a/contrib/ipfilter/rules/example.12 +++ b/contrib/ipfilter/rules/example.12 @@ -1,18 +1,17 @@ -# $FreeBSD$ # # get rid of all short IP fragments (too small for valid comparison) # block in proto tcp all with short # # drop and log any IP packets with options set in them. # block in log all with ipopts # # log packets with BOTH ssrr and lsrr set # log in all with opt lsrr,ssrr # # drop any source routing options # block in quick all with opt lsrr block in quick all with opt ssrr diff --git a/contrib/ipfilter/rules/example.13 b/contrib/ipfilter/rules/example.13 index ca741148931e..854f07f1694f 100644 --- a/contrib/ipfilter/rules/example.13 +++ b/contrib/ipfilter/rules/example.13 @@ -1,18 +1,17 @@ -# $FreeBSD$ # # Log all short TCP packets to qe3, with 10.3.3.3 as the intended # destination for the packet. # block in on qe0 to qe3:10.3.3.3 proto tcp all with short # # Log all connection attempts for TCP # pass in on le0 dup-to le1:10.3.3.3 proto tcp all flags S/SA # # Route all UDP packets through transparently. # pass in on ppp0 fastroute proto udp all # # Route all ICMP packets to network 10 out through le1, to 10.3.3.1 # pass in on le0 to le1:10.3.3.1 proto icmp all diff --git a/contrib/ipfilter/rules/example.2 b/contrib/ipfilter/rules/example.2 index 81e7d25c7c71..4f81725eeb0c 100644 --- a/contrib/ipfilter/rules/example.2 +++ b/contrib/ipfilter/rules/example.2 @@ -1,6 +1,5 @@ -# $FreeBSD$ # # block all outgoing TCP packets on le0 from any host to port 23 of # host 10.1.1.2 # block out on le0 proto tcp from any to 10.1.1.3/32 port = 23 diff --git a/contrib/ipfilter/rules/example.3 b/contrib/ipfilter/rules/example.3 index c5b4344f91ce..cd31f73e7c2b 100644 --- a/contrib/ipfilter/rules/example.3 +++ b/contrib/ipfilter/rules/example.3 @@ -1,41 +1,40 @@ -# $FreeBSD$ # # block all inbound packets. # block in from any to any # # pass through packets to and from localhost. # pass in from 127.0.0.1/32 to 127.0.0.1/32 # # allow a variety of individual hosts to send any type of IP packet to any # other host. # pass in from 10.1.3.1/32 to any pass in from 10.1.3.2/32 to any pass in from 10.1.3.3/32 to any pass in from 10.1.3.4/32 to any pass in from 10.1.3.5/32 to any pass in from 10.1.0.13/32 to any pass in from 10.1.1.1/32 to any pass in from 10.1.2.1/32 to any # # # block all outbound packets. # block out from any to any # # allow any packets destined for localhost out. # pass out from any to 127.0.0.1/32 # # allow any host to send any IP packet out to a limited number of hosts. # pass out from any to 10.1.3.1/32 pass out from any to 10.1.3.2/32 pass out from any to 10.1.3.3/32 pass out from any to 10.1.3.4/32 pass out from any to 10.1.3.5/32 pass out from any to 10.1.0.13/32 pass out from any to 10.1.1.1/32 pass out from any to 10.1.2.1/32 diff --git a/contrib/ipfilter/rules/example.4 b/contrib/ipfilter/rules/example.4 index f18dcdd0cd27..7918ec2fbd99 100644 --- a/contrib/ipfilter/rules/example.4 +++ b/contrib/ipfilter/rules/example.4 @@ -1,5 +1,4 @@ -# $FreeBSD$ # # block all ICMP packets. # block in proto icmp from any to any diff --git a/contrib/ipfilter/rules/example.5 b/contrib/ipfilter/rules/example.5 index 959dfb836371..6d688b5eab80 100644 --- a/contrib/ipfilter/rules/example.5 +++ b/contrib/ipfilter/rules/example.5 @@ -1,26 +1,25 @@ -# $FreeBSD$ # # test ruleset # # allow packets coming from foo to bar through. # pass in from 10.1.1.2 to 10.2.1.1 # # allow any TCP packets from the same subnet as foo is on through to host # 10.1.1.2 if they are destined for port 6667. # pass in proto tcp from 10.2.2.2/24 to 10.1.1.2/32 port = 6667 # # allow in UDP packets which are NOT from port 53 and are destined for # localhost # pass in proto udp from 10.2.2.2 port != 53 to localhost # # block all ICMP unreachables. # block in proto icmp from any to any icmp-type unreach # # allow packets through which have a non-standard IP header length (ie there # are IP options such as source-routing present). # pass in from any to any with ipopts diff --git a/contrib/ipfilter/rules/example.6 b/contrib/ipfilter/rules/example.6 index e9ce23ac27e6..d40f0f3d2a18 100644 --- a/contrib/ipfilter/rules/example.6 +++ b/contrib/ipfilter/rules/example.6 @@ -1,6 +1,5 @@ -# $FreeBSD$ # # block all TCP packets with only the SYN flag set (this is the first # packet sent to establish a connection) out of the SYN-ACK pair. # block in proto tcp from any to any flags S/SA diff --git a/contrib/ipfilter/rules/example.7 b/contrib/ipfilter/rules/example.7 index 0ddd7f77628b..062de9811935 100644 --- a/contrib/ipfilter/rules/example.7 +++ b/contrib/ipfilter/rules/example.7 @@ -1,13 +1,12 @@ -# $FreeBSD$ # block all ICMP packets. # block in proto icmp all # # allow in ICMP echos and echo-replies. # pass in on le1 proto icmp from any to any icmp-type echo pass in on le1 proto icmp from any to any icmp-type echorep # # block all ICMP destination unreachable packets which are port-unreachables # block in on le1 proto icmp from any to any icmp-type unreach code 3 diff --git a/contrib/ipfilter/rules/example.8 b/contrib/ipfilter/rules/example.8 index 2276b525b17d..baa02581256e 100644 --- a/contrib/ipfilter/rules/example.8 +++ b/contrib/ipfilter/rules/example.8 @@ -1,11 +1,10 @@ -# $FreeBSD$ # # block all incoming TCP connections but send back a TCP-RST for ones to # the ident port # block in proto tcp from any to any flags S/SA block return-rst in quick proto tcp from any to any port = 113 flags S/SA # # block all inbound UDP packets and send back an ICMP error. # block return-icmp in proto udp from any to any diff --git a/contrib/ipfilter/rules/example.9 b/contrib/ipfilter/rules/example.9 index 50bb46a672d8..daff2031db8e 100644 --- a/contrib/ipfilter/rules/example.9 +++ b/contrib/ipfilter/rules/example.9 @@ -1,13 +1,12 @@ -# $FreeBSD$ # # drop all packets without IP security options # block in all pass in all with opt sec # # only allow packets in and out on le1 which are top secret # block out on le1 all pass out on le1 all with opt sec-class topsecret block in on le1 all pass in on le1 all with opt sec-class topsecret diff --git a/contrib/ipfilter/rules/example.sr b/contrib/ipfilter/rules/example.sr index 46fb6f14aaf6..c4c1994030ba 100644 --- a/contrib/ipfilter/rules/example.sr +++ b/contrib/ipfilter/rules/example.sr @@ -1,62 +1,61 @@ -# $FreeBSD$ # # log all inbound packet on le0 which has IP options present # log in on le0 from any to any with ipopts # # block any inbound packets on le0 which are fragmented and "too short" to # do any meaningful comparison on. This actually only applies to TCP # packets which can be missing the flags/ports (depending on which part # of the fragment you see). # block in log quick on le0 from any to any with short frag # # log all inbound TCP packets with the SYN flag (only) set # (NOTE: if it were an inbound TCP packet with the SYN flag set and it # had IP options present, this rule and the above would cause it # to be logged twice). # log in on le0 proto tcp from any to any flags S/SA # # block and log any inbound ICMP unreachables # block in log on le0 proto icmp from any to any icmp-type unreach # # block and log any inbound UDP packets on le0 which are going to port 2049 # (the NFS port). # block in log on le0 proto udp from any to any port = 2049 # # quickly allow any packets to/from a particular pair of hosts # pass in quick from any to 10.1.3.2/32 pass in quick from any to 10.1.0.13/32 pass in quick from 10.1.3.2/32 to any pass in quick from 10.1.0.13/32 to any # # block (and stop matching) any packet with IP options present. # block in quick on le0 from any to any with ipopts # # allow any packet through # pass in from any to any # # block any inbound UDP packets destined for these subnets. # block in on le0 proto udp from any to 10.1.3.0/24 block in on le0 proto udp from any to 10.1.1.0/24 block in on le0 proto udp from any to 10.1.2.0/24 # # block any inbound TCP packets with only the SYN flag set that are # destined for these subnets. # block in on le0 proto tcp from any to 10.1.3.0/24 flags S/SA block in on le0 proto tcp from any to 10.1.2.0/24 flags S/SA block in on le0 proto tcp from any to 10.1.1.0/24 flags S/SA # # block any inbound ICMP packets destined for these subnets. # block in on le0 proto icmp from any to 10.1.3.0/24 block in on le0 proto icmp from any to 10.1.1.0/24 block in on le0 proto icmp from any to 10.1.2.0/24 diff --git a/contrib/ipfilter/samples/ipfilter-pb.gif b/contrib/ipfilter/samples/ipfilter-pb.gif index f729ab1365da..afaefa866541 100644 Binary files a/contrib/ipfilter/samples/ipfilter-pb.gif and b/contrib/ipfilter/samples/ipfilter-pb.gif differ diff --git a/contrib/ipfilter/test/Makefile b/contrib/ipfilter/test/Makefile index 7f17241b3f23..16535bf265ee 100644 --- a/contrib/ipfilter/test/Makefile +++ b/contrib/ipfilter/test/Makefile @@ -1,93 +1,94 @@ # # (C)opyright 1993-1996 by Darren Reed. # # See the IPFILTER.LICENCE file for details on licencing. # BINDEST=/usr/local/bin SBINDEST=/sbin MANDIR=/usr/share/man all: results tests results: mkdir -p results -tests: ipf nat logtests ipv6 pools +tests: ipf nat logtests ipv6 pools bpf ipf: ftests ptests nat: ntests nitests intests first: -mkdir -p results # Filtering tests -ftests: f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 +ftests: f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 # Rule parsing tests -ptests: i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 +ptests: i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 \ + i20 i21 -ntests: n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 +ntests: n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 nitests: ni1 ni2 ni3 ni4 ni5 ni6 ni7 ni8 ni9 ni10 ni11 ni12 ni13 ni14 ni15 ni16 intests: in1 in2 in3 in4 in5 in6 logtests: l1 pools: p1 p2 p3 ip1 ipv6: ipv6.1 ipv6.2 ipv6.3 bpf: bpf1 bpf-f1 -f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14: +f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f19: @/bin/sh ./dotest `awk "/^$@ / { print; } " test.format` -f15 f16 f17: +f15 f16 f17 f18: @/bin/sh ./mtest `awk "/^$@ / { print; } " test.format` -i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 bpf1: +i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 bpf1: @/bin/sh ./itest `awk "/^$@ / { print; } " test.format` -n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12: +n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14: @/bin/sh ./nattest `awk "/^$@ / { print; } " test.format` ni1 ni2 ni3 ni4 ni5 ni7 ni8 ni9 ni10 ni11 ni12 ni13 ni14 ni15 ni16: @/bin/sh ./natipftest single `awk "/^$@ / { print; } " test.format` ni6: @/bin/sh ./natipftest multi `awk "/^$@ / { print; } " test.format` in1 in2 in3 in4 in5 in6: @/bin/sh ./intest `awk "/^$@ / { print; } " test.format` l1: @/bin/sh ./logtest `awk "/^$@ / { print; } " test.format` ipv6.1 ipv6.2 ipv6.3: @/bin/sh ./dotest6 `awk "/^$@ / { print; } " test.format` p1 p2 p3: @/bin/sh ./ptest `awk "/^$@ / { print; } " test.format` ip1: @/bin/sh ./iptest `awk "/^$@ / { print; } " test.format` bpf-f1: /bin/sh ./bpftest `awk "/^$@ / { print; } " test.format` clean: - /bin/rm -f f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 - /bin/rm -f i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 - /bin/rm -f n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 + /bin/rm -f f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 + /bin/rm -f i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 + /bin/rm -f n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13 n14 /bin/rm -f ni1 ni2 ni3 ni4 ni5 ni6 ni7 ni8 ni9 /bin/rm -f ni10 ni11 ni12 ni13 ni14 ni15 ni16 /bin/rm -f in1 in2 in3 in4 in5 in6 /bin/rm -f p1 p2 p3 ip1 /bin/rm -f l1 /bin/rm -f ipv6.1 ipv6.2 ipv6.3 /bin/rm -f bpf1 bpf-f1 /bin/rm -f results/* logout diffs: -cd expected; for i in *; do if [ -f $$i -a ! -f ../$$i -a -f ../results/$$i ] ; then diff -c $$i ../results/$$i >> ../diff.out; fi done diff --git a/contrib/ipfilter/test/dotest b/contrib/ipfilter/test/dotest index 71c8cceefc9f..72853d4eb0b3 100644 --- a/contrib/ipfilter/test/dotest +++ b/contrib/ipfilter/test/dotest @@ -1,28 +1,34 @@ #!/bin/sh +thistest=$1 format=$2 +output=$3 +tuning=$4 if [ -f /usr/ucb/touch ] ; then TOUCH=/usr/ucb/touch else if [ -f /usr/bin/touch ] ; then TOUCH=/usr/bin/touch else if [ -f /bin/touch ] ; then TOUCH=/bin/touch fi fi fi -echo "$1..."; -/bin/cp /dev/null results/$1 +if [ "$tuning" != "" ] ; then + tuning="-T $tuning" +fi +echo "${thistest}..."; +/bin/cp /dev/null results/${thistest} ( while read rule; do - echo "$rule" | ../ipftest -F $format -Rbr - -i input/$1 >> results/$1; + echo "$rule" | ../ipftest -F $format -Rbr - -i input/${thistest} $tuning>> results/${thistest}; if [ $? -ne 0 ] ; then exit 1; fi - echo "--------" >> results/$1 -done ) < regress/$1 -cmp expected/$1 results/$1 + echo "--------" >> results/${thistest} +done ) < regress/${thistest} +cmp expected/${thistest} results/${thistest} status=$? if [ $status = 0 ] ; then - $TOUCH $1 + $TOUCH ${thistest} fi exit $status diff --git a/contrib/ipfilter/test/expected/bpf1 b/contrib/ipfilter/test/expected/bpf1 index 9d0ad1b06b92..76381a748f60 100644 --- a/contrib/ipfilter/test/expected/bpf1 +++ b/contrib/ipfilter/test/expected/bpf1 @@ -1,4 +1,4 @@ -pass in bpf { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } -pass out bpf { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } -pass in bpf { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } -pass out bpf { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } +pass in bpf-v4 { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } +pass out bpf-v4 { "0 0 0 0 0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x1 0x6 0 0 0" } +pass in bpf-v4 { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } +pass out bpf-v4 { "0 0 0 0 0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x1 0x6 0 0 0" } diff --git a/contrib/ipfilter/test/expected/f13 b/contrib/ipfilter/test/expected/f13 index b3c7e54bf362..2a0195b078ad 100644 --- a/contrib/ipfilter/test/expected/f13 +++ b/contrib/ipfilter/test/expected/f13 @@ -1,84 +1,160 @@ pass nomatch nomatch +pass +nomatch +nomatch +nomatch +nomatch +nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch -------- block nomatch nomatch +block +nomatch +nomatch +nomatch +nomatch +nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch nomatch pass pass nomatch nomatch nomatch pass +pass +pass +nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch nomatch block block nomatch nomatch nomatch block +block +block +nomatch +nomatch +nomatch +nomatch -------- -pass +block nomatch nomatch pass nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +pass +nomatch +pass +pass -------- block nomatch nomatch block nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +block +nomatch +block +block +-------- +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +pass +pass +nomatch +nomatch +nomatch +nomatch +pass +pass +nomatch +nomatch +nomatch +nomatch +-------- +block +block +nomatch +pass +block +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +pass +nomatch +nomatch +pass -------- diff --git a/contrib/ipfilter/test/expected/f17 b/contrib/ipfilter/test/expected/f17 index 4fe3acf5764d..c586e5b59a2c 100644 --- a/contrib/ipfilter/test/expected/f17 +++ b/contrib/ipfilter/test/expected/f17 @@ -1,6 +1,7 @@ pass block return-rst pass pass pass +pass -------- diff --git a/contrib/ipfilter/test/expected/f17 b/contrib/ipfilter/test/expected/f18 similarity index 63% copy from contrib/ipfilter/test/expected/f17 copy to contrib/ipfilter/test/expected/f18 index 4fe3acf5764d..801abd369426 100644 --- a/contrib/ipfilter/test/expected/f17 +++ b/contrib/ipfilter/test/expected/f18 @@ -1,6 +1,5 @@ pass -block return-rst pass pass pass -------- diff --git a/contrib/ipfilter/test/expected/f19 b/contrib/ipfilter/test/expected/f19 new file mode 100644 index 000000000000..5ee2e9d692a1 --- /dev/null +++ b/contrib/ipfilter/test/expected/f19 @@ -0,0 +1,10 @@ +pass +pass +pass +nomatch +-------- +pass +nomatch +nomatch +nomatch +-------- diff --git a/contrib/ipfilter/test/expected/f7 b/contrib/ipfilter/test/expected/f7 index 6aa7951f3e6b..7a4daedd93e8 100644 --- a/contrib/ipfilter/test/expected/f7 +++ b/contrib/ipfilter/test/expected/f7 @@ -1,60 +1,144 @@ block block block nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch -------- pass pass pass nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch block nomatch nomatch nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch pass nomatch nomatch nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch block block block +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +-------- +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +pass +pass +pass +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch +pass +pass +nomatch +nomatch +nomatch +nomatch +-------- +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +pass pass +nomatch +nomatch +-------- +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch +nomatch pass pass -------- diff --git a/contrib/ipfilter/test/expected/f9 b/contrib/ipfilter/test/expected/f9 index 709744d62871..cc5be688cd2d 100644 --- a/contrib/ipfilter/test/expected/f9 +++ b/contrib/ipfilter/test/expected/f9 @@ -1,126 +1,180 @@ block block block block block block +block +block +block -------- nomatch nomatch nomatch +nomatch +nomatch +nomatch pass pass nomatch -------- nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch block nomatch -------- nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch pass nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch +nomatch block nomatch nomatch nomatch nomatch +nomatch +nomatch -------- nomatch +nomatch pass nomatch nomatch nomatch nomatch +nomatch +nomatch -------- pass pass pass pass pass pass +pass +pass +pass -------- block block +block +nomatch +nomatch nomatch nomatch nomatch nomatch -------- pass pass +pass +nomatch +nomatch nomatch nomatch nomatch nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch nomatch nomatch nomatch +nomatch +nomatch +nomatch -------- nomatch nomatch nomatch +nomatch +nomatch +nomatch block block nomatch -------- diff --git a/contrib/ipfilter/test/expected/i1 b/contrib/ipfilter/test/expected/i1 index 93530f9f575a..c012af8b711b 100644 --- a/contrib/ipfilter/test/expected/i1 +++ b/contrib/ipfilter/test/expected/i1 @@ -1,15 +1,17 @@ pass in all block out all log in all log body in all count in from any to any pass in from !any to any block in from any to !any pass in on ed0(!) from 127.0.0.1/32 to 127.0.0.1/32 +pass in on ed0(!),vx0(!) from 127.0.0.1/32 to 127.0.0.1/32 block in log first on lo0(!) from any to any pass in log body quick from any to any block return-rst in quick on le0(!) proto tcp from any to any block return-icmp in on qe0(!) from any to any block return-icmp(host-unr) in on qe0(!) from any to any +block return-icmp-as-dest in on le0(!) from any to any block return-icmp-as-dest(port-unr) in on qe0(!) from any to any pass out on longNICname0(!) from 254.220.186.152/32 to 254.220.186.152/32 diff --git a/contrib/ipfilter/test/expected/i11 b/contrib/ipfilter/test/expected/i11 index 058d03ac01cb..26b8b78fade9 100644 --- a/contrib/ipfilter/test/expected/i11 +++ b/contrib/ipfilter/test/expected/i11 @@ -1,8 +1,10 @@ pass in on ed0(!) proto tcp from 127.0.0.1/32 to 127.0.0.1/32 port = 23 keep state -block in log first on lo0(!) proto tcp/udp from any to any keep state +block in log first on lo0(!) proto tcp/udp from any to any port = 7 keep state pass in proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 20499 keep frags +pass in proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 2049 keep frags (strict) pass in proto udp from 127.0.0.1/32 to 127.0.0.1/32 port = 53 keep state keep frags pass in on ed0(!) out-via vx0(!) proto udp from any to any keep state pass out on ppp0(!) in-via le0(!) proto tcp from any to any keep state +pass in on ed0(!),vx0(!) out-via vx0(!),ed0(!) proto udp from any to any keep state pass in proto tcp from any port > 1024 to 127.0.0.1/32 port = 1024 keep state pass in proto tcp from any to any flags S/FSRPAU keep state (limit 101,strict,newisn,no-icmp-err) diff --git a/contrib/ipfilter/test/expected/i12 b/contrib/ipfilter/test/expected/i12 index 22a348871bf6..e21724c7a259 100644 --- a/contrib/ipfilter/test/expected/i12 +++ b/contrib/ipfilter/test/expected/i12 @@ -1,34 +1,39 @@ pass in from 1.1.1.1/32 to 2.2.2.2/32 pass in from 2.2.2.0/24 to 4.4.4.4/32 pass in from 3.3.3.3/32 to 4.4.4.4/32 pass in from 2.2.2.0/24 to 5.5.5.5/32 pass in from 3.3.3.3/32 to 5.5.5.5/32 pass in from 2.2.2.0/24 to 6.6.6.6/32 pass in from 3.3.3.3/32 to 6.6.6.6/32 pass in from 2.2.2.0/24 to 5.5.5.5/32 port = 22 pass in from 3.3.3.3/32 to 5.5.5.5/32 port = 22 pass in from 2.2.2.0/24 to 6.6.6.6/32 port = 22 pass in from 3.3.3.3/32 to 6.6.6.6/32 port = 22 pass in from 2.2.2.0/24 to 5.5.5.5/32 port = 25 pass in from 3.3.3.3/32 to 5.5.5.5/32 port = 25 pass in from 2.2.2.0/24 to 6.6.6.6/32 port = 25 pass in from 3.3.3.3/32 to 6.6.6.6/32 port = 25 -pass in proto tcp from 2.2.2.0/24 to 5.5.5.5/32 port = 53 -pass in proto tcp from 3.3.3.3/32 to 5.5.5.5/32 port = 53 -pass in proto tcp from 2.2.2.0/24 to 6.6.6.6/32 port = 53 -pass in proto tcp from 3.3.3.3/32 to 6.6.6.6/32 port = 53 -pass in proto tcp from 2.2.2.0/24 to 5.5.5.5/32 port = 9 -pass in proto tcp from 3.3.3.3/32 to 5.5.5.5/32 port = 9 -pass in proto tcp from 2.2.2.0/24 to 6.6.6.6/32 port = 9 -pass in proto tcp from 3.3.3.3/32 to 6.6.6.6/32 port = 9 +pass in proto tcp from 2.2.2.0/24 port = 53 to 5.5.5.5/32 +pass in proto tcp from 3.3.3.3/32 port = 53 to 5.5.5.5/32 +pass in proto tcp from 2.2.2.0/24 port = 9 to 5.5.5.5/32 +pass in proto tcp from 3.3.3.3/32 port = 9 to 5.5.5.5/32 +pass in proto tcp from 2.2.2.0/24 port = 53 to 6.6.6.6/32 +pass in proto tcp from 3.3.3.3/32 port = 53 to 6.6.6.6/32 +pass in proto tcp from 2.2.2.0/24 port = 9 to 6.6.6.6/32 +pass in proto tcp from 3.3.3.3/32 port = 9 to 6.6.6.6/32 pass in proto udp from 2.2.2.0/24 to 5.5.5.5/32 port = 53 pass in proto udp from 3.3.3.3/32 to 5.5.5.5/32 port = 53 pass in proto udp from 2.2.2.0/24 to 6.6.6.6/32 port = 53 pass in proto udp from 3.3.3.3/32 to 6.6.6.6/32 port = 53 pass in proto udp from 2.2.2.0/24 to 5.5.5.5/32 port = 9 pass in proto udp from 3.3.3.3/32 to 5.5.5.5/32 port = 9 pass in proto udp from 2.2.2.0/24 to 6.6.6.6/32 port = 9 pass in proto udp from 3.3.3.3/32 to 6.6.6.6/32 port = 9 pass in from 10.10.10.10/32 to 11.11.11.11/32 pass in from pool/101(!) to hash/202(!) pass in from hash/303(!) to pool/404(!) +table role = ipf type = tree number = + { ! 1.1.1.1/32; 2.2.2.2/32; ! 2.2.0.0/16; }; +table role = ipf type = tree number = + { 1.1.0.0/16; }; +pass in from pool/0(!) to pool/0(!) diff --git a/contrib/ipfilter/test/expected/i14 b/contrib/ipfilter/test/expected/i14 index 5a10155b784f..08ba19ad5588 100644 --- a/contrib/ipfilter/test/expected/i14 +++ b/contrib/ipfilter/test/expected/i14 @@ -1,8 +1,10 @@ block in on eri0(!) all head 1 pass in on eri0(!) proto icmp from any to any group 1 pass out on ed0(!) all head 1000000 block out on ed0(!) proto udp from any to any group 1000000 block in on vm0(!) proto tcp/udp from any to any head 101 pass in proto tcp/udp from 1.1.1.1/32 to 2.2.2.2/32 group 101 pass in proto tcp from 1.0.0.1/32 to 2.0.0.2/32 group 101 pass in proto udp from 2.0.0.2/32 to 3.0.0.3/32 group 101 +block in on vm0(!) proto tcp/udp from any to any head vm0-group +pass in proto tcp/udp from 1.1.1.1/32 to 2.2.2.2/32 group vm0-group diff --git a/contrib/ipfilter/test/expected/i16 b/contrib/ipfilter/test/expected/i16 new file mode 100644 index 000000000000..c5b3cf3f6738 --- /dev/null +++ b/contrib/ipfilter/test/expected/i16 @@ -0,0 +1,3 @@ +block out all +100 pass in all +10101 pass out proto tcp from any to any diff --git a/contrib/ipfilter/test/expected/p1 b/contrib/ipfilter/test/expected/i17 similarity index 55% copy from contrib/ipfilter/test/expected/p1 copy to contrib/ipfilter/test/expected/i17 index c3f7afa66f55..bcc4d2d544a5 100644 --- a/contrib/ipfilter/test/expected/p1 +++ b/contrib/ipfilter/test/expected/i17 @@ -1,19 +1,10 @@ -nomatch -pass -nomatch -nomatch -nomatch -pass -nomatch -nomatch List of active MAP/Redirect filters: List of active sessions: + +Hostmap table: List of active state sessions: List of configured pools -table role = ipf type = tree number = 100 - { 1.1.1.1/32; ! 2.2.0.0/16; 2.2.2.0/24; }; List of configured hash tables List of groups configured (set 0) List of groups configured (set 1) -------------------------------- diff --git a/contrib/ipfilter/test/expected/i18 b/contrib/ipfilter/test/expected/i18 new file mode 100644 index 000000000000..1aaa04f1c84f --- /dev/null +++ b/contrib/ipfilter/test/expected/i18 @@ -0,0 +1,10 @@ +pass in tos 0x50 from any to any +pass in tos 0x80 from any to any +pass in tos 0x28 from any to any +block in ttl 0 from any to any +block in ttl 1 from any to any +block in ttl 2 from any to any +block in ttl 3 from any to any +block in ttl 4 from any to any +block in ttl 5 from any to any +block in ttl 6 from any to any diff --git a/contrib/ipfilter/test/expected/i19 b/contrib/ipfilter/test/expected/i19 new file mode 100644 index 000000000000..4ca19b5138fa --- /dev/null +++ b/contrib/ipfilter/test/expected/i19 @@ -0,0 +1,22 @@ +block in log level user.debug quick proto icmp from any to any +block in log level mail.info quick proto icmp from any to any +block in log level daemon.notice quick proto icmp from any to any +block in log level auth.warn quick proto icmp from any to any +block in log level syslog.err quick proto icmp from any to any +block in log level lpr.crit quick proto icmp from any to any +block in log level news.alert quick proto icmp from any to any +block in log level uucp.emerg quick proto icmp from any to any +block in log level cron.debug quick proto icmp from any to any +block in log level ftp.info quick proto icmp from any to any +block in log level authpriv.notice quick proto icmp from any to any +block in log level !!!.warn quick proto icmp from any to any +block in log level local0.err quick proto icmp from any to any +block in log level local1.crit quick proto icmp from any to any +block in log level local2.alert quick proto icmp from any to any +block in log level local3.emerg quick proto icmp from any to any +block in log level local4.debug quick proto icmp from any to any +block in log level local5.info quick proto icmp from any to any +block in log level local6.notice quick proto icmp from any to any +block in log level local7.warn quick proto icmp from any to any +block in log level kern.err quick proto icmp from any to any +block in log level !!!.emerg quick proto icmp from any to any diff --git a/contrib/ipfilter/test/expected/i2 b/contrib/ipfilter/test/expected/i2 index 37ec9c485b50..5ff18f4f924c 100644 --- a/contrib/ipfilter/test/expected/i2 +++ b/contrib/ipfilter/test/expected/i2 @@ -1,7 +1,8 @@ log in proto tcp from any to any pass in proto tcp from any to any pass in proto udp from 127.0.0.1/32 to 127.0.0.1/32 block in proto ipv6 from any to any block in proto udp from any to any block in proto 250 from any to any pass in proto tcp/udp from any to any +block in proto tcp/udp from any to any diff --git a/contrib/ipfilter/test/expected/i20 b/contrib/ipfilter/test/expected/i20 new file mode 100644 index 000000000000..77eabdb55f0b --- /dev/null +++ b/contrib/ipfilter/test/expected/i20 @@ -0,0 +1,4 @@ +pass in on ppp0(!) from ppp0/peer to ppp0/32 +block in on hme0(!) from any to hme0/bcast +pass in on bge0(!) from bge0/net to bge0/32 +block in on eri0(!) from any to eri0/netmasked diff --git a/contrib/ipfilter/test/expected/i21 b/contrib/ipfilter/test/expected/i21 new file mode 100644 index 000000000000..a5f55b36d6f5 --- /dev/null +++ b/contrib/ipfilter/test/expected/i21 @@ -0,0 +1,10 @@ +pass in from any port = 10101 to any +pass out from any to any port != 22 +block in from any port 20:21 to any +block out from any to any port 10 <> 100 +pass out from any to any port = 3 +pass out from any to any port = 5 +pass out from any to any port = 7 +pass out from any to any port = 9 +block in from any port = 20 to any +block in from any port = 25 to any diff --git a/contrib/ipfilter/test/expected/i4 b/contrib/ipfilter/test/expected/i4 index 89c0995f6e4d..639dae88aca5 100644 --- a/contrib/ipfilter/test/expected/i4 +++ b/contrib/ipfilter/test/expected/i4 @@ -1,8 +1,9 @@ log in proto tcp from any port > 0 to any log in proto tcp from any to any port > 0 pass in proto tcp from any port != 0 to any port 0 >< 65535 pass in proto udp from 127.0.0.1/32 port > 32000 to 127.0.0.1/32 port < 29000 block in proto udp from any port != 123 to any port < 7 block in proto tcp from any port = 25 to any port > 25 pass in proto tcp/udp from any port 1 >< 3 to any port 1 <> 3 +pass in proto tcp/udp from any port 2:2 to any port 10:20 pass in log first quick proto tcp from any port > 1023 to any port = 1723 flags S/FSRPAU keep state diff --git a/contrib/ipfilter/test/expected/i6 b/contrib/ipfilter/test/expected/i6 index 40fe1857398b..e4b14c328cbf 100644 --- a/contrib/ipfilter/test/expected/i6 +++ b/contrib/ipfilter/test/expected/i6 @@ -1,10 +1,12 @@ pass in on lo0(!) fastroute from any to any pass in on lo0(!) to qe0(!) from 127.0.0.1/32 to 127.0.0.1/32 pass in on le0(!) to qe0(!):127.0.0.1 from 127.0.0.1/32 to 127.0.0.1/32 pass in on lo0(!) dup-to qe0(!) from 127.0.0.1/32 to 127.0.0.1/32 pass in on le0(!) dup-to qe0(!):127.0.0.1 from 127.0.0.1/32 to 127.0.0.1/32 pass in on le0(!) dup-to qe0(!):127.0.0.1 to hme0(!):10.1.1.1 from 127.0.0.1/32 to 127.0.0.1/32 block in quick on qe0(!) to qe1(!) from any to any block in quick to qe1(!) from any to any pass out quick dup-to hme0(!) from any to any +pass out quick on hme0(!) reply-to hme1(!) from any to any +pass in on le0(!) dup-to qe0(!):127.0.0.1 reply-to hme1(!):10.10.10.10 all pass in quick fastroute all diff --git a/contrib/ipfilter/test/expected/i7 b/contrib/ipfilter/test/expected/i7 index c46364b558b1..309cd28691b1 100644 --- a/contrib/ipfilter/test/expected/i7 +++ b/contrib/ipfilter/test/expected/i7 @@ -1,4 +1,9 @@ pass in on ed0(!) proto tcp from 127.0.0.1/32 to 127.0.0.1/32 port = 23 flags S/SA block in on lo0(!) proto tcp from any to any flags A/FSRPAU pass in on lo0(!) proto tcp from any to any flags /SPA block in on lo0(!) proto tcp from any to any flags C/A +pass in on lo0(!) proto tcp from any to any flags S/SA +block in on lo0(!) proto tcp from any to any flags S/SA +pass in on lo0(!) proto tcp from any to any flags S/FSRPAU +block in on lo0(!) proto tcp from any to any flags /A +pass in on lo0(!) proto tcp from any to any flags S/SA diff --git a/contrib/ipfilter/test/expected/i8 b/contrib/ipfilter/test/expected/i8 index 77dc1775763e..5533a7dceff3 100644 --- a/contrib/ipfilter/test/expected/i8 +++ b/contrib/ipfilter/test/expected/i8 @@ -1,2 +1,33 @@ pass in proto icmp from 127.0.0.1/32 to 127.0.0.1/32 icmp-type timest block in proto icmp from any to any icmp-type unreach code 1 +pass in proto icmp from any to any icmp-type unreach code 15 +pass in proto icmp from any to any icmp-type unreach code 13 +pass in proto icmp from any to any icmp-type unreach code 8 +pass in proto icmp from any to any icmp-type unreach code 4 +pass in proto icmp from any to any icmp-type unreach code 9 +pass in proto icmp from any to any icmp-type unreach code 11 +pass in proto icmp from any to any icmp-type unreach code 14 +pass in proto icmp from any to any icmp-type unreach code 10 +pass in proto icmp from any to any icmp-type unreach code 12 +pass in proto icmp from any to any icmp-type unreach code 7 +pass in proto icmp from any to any icmp-type unreach code 1 +pass in proto icmp from any to any icmp-type unreach code 6 +pass in proto icmp from any to any icmp-type unreach code 0 +pass in proto icmp from any to any icmp-type unreach code 3 +pass in proto icmp from any to any icmp-type unreach code 2 +pass in proto icmp from any to any icmp-type unreach code 5 +pass in proto icmp from any to any icmp-type echo +pass in proto icmp from any to any icmp-type echorep +pass in proto icmp from any to any icmp-type inforeq +pass in proto icmp from any to any icmp-type inforep +pass in proto icmp from any to any icmp-type maskrep +pass in proto icmp from any to any icmp-type maskreq +pass in proto icmp from any to any icmp-type paramprob +pass in proto icmp from any to any icmp-type redir +pass in proto icmp from any to any icmp-type unreach +pass in proto icmp from any to any icmp-type routerad +pass in proto icmp from any to any icmp-type routersol +pass in proto icmp from any to any icmp-type squench +pass in proto icmp from any to any icmp-type timest +pass in proto icmp from any to any icmp-type timestrep +pass in proto icmp from any to any icmp-type timex diff --git a/contrib/ipfilter/test/expected/i9 b/contrib/ipfilter/test/expected/i9 index bae7c9bcce10..bb4e54f703ff 100644 --- a/contrib/ipfilter/test/expected/i9 +++ b/contrib/ipfilter/test/expected/i9 @@ -1,7 +1,12 @@ pass in from 127.0.0.1/32 to 127.0.0.1/32 with short,frag block in from any to any with ipopts pass in from any to any with opt nop,rr,zsu pass in from any to any with opt nop,rr,zsu not opt lsrr,ssrr pass in from 127.0.0.1/32 to 127.0.0.1/32 with not frag +pass in from 127.0.0.1/32 to 127.0.0.1/32 with frag,frag-body pass in proto tcp from any to any flags S/FSRPAU with not oow keep state pass in proto tcp from any to any flags S/FSRPAU with not bad,bad-src,bad-nat +block in quick from any to any with not nat +block in quick from any to any with not lowttl +pass in from any to any with mbcast,not bcast,mcast,not state +pass in from any to any with opt mtup,mtur,encode,ts,tr,sec,e-sec,cipso,satid,ssrr,addext,visa,imitd,eip,finn,dps,sdb,nsapa,rtralrt,ump diff --git a/contrib/ipfilter/test/expected/in1 b/contrib/ipfilter/test/expected/in1 index ce5a61003ec3..8c47a929e540 100644 --- a/contrib/ipfilter/test/expected/in1 +++ b/contrib/ipfilter/test/expected/in1 @@ -1,27 +1,30 @@ map le0 0.0.0.0/0 -> 0.0.0.0/32 map le0 0.0.0.1/32 -> 0.0.0.1/32 map le0 128.0.0.0/1 -> 0.0.0.0/0 map le0 10.0.0.0/8 -> 1.2.3.0/24 map le0 10.0.0.0/8 -> 1.2.3.0/24 +map le0 10.0.0.0/8 -> 1.2.3.0/24 +map le0 0.0.0.5/0.0.0.255 -> 1.2.3.0/24 map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp 10000:19999 map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap udp 20000:29999 map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp/udp 30000:39999 map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp auto map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap udp auto map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp/udp auto map ppp0 192.168.0.0/16 -> 0.0.0.0/32 proxy port 21 ftp/tcp map ppp0 192.168.0.0/16 -> 0.0.0.0/32 proxy port 1010 ftp/tcp map le0 0.0.0.0/0 -> 0.0.0.0/32 frag map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp 10000:19999 frag map ppp0 192.168.0.0/16 -> 0.0.0.0/32 proxy port 21 ftp/tcp frag map le0 0.0.0.0/0 -> 0.0.0.0/32 age 10/10 map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 age 10/20 map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp 10000:19999 age 30/30 map le0 0.0.0.0/0 -> 0.0.0.0/32 frag age 10/10 map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag age 10/20 map ppp0 192.168.0.0/16 -> 0.0.0.0/32 portmap tcp 10000:19999 frag age 30/30 map fxp0 from 192.168.0.0/18 to any port = 21 -> 1.2.3.4/32 proxy port 21 ftp/tcp map thisisalonginte 0.0.0.0/0 -> 0.0.0.0/32 mssclamp 1452 tag freddyliveshere map bar0 0.0.0.0/0 -> 0.0.0.0/32 icmpidmap icmp 1000:2000 +map ppp0,adsl0 0.0.0.0/0 -> 0.0.0.0/32 diff --git a/contrib/ipfilter/test/expected/in2 b/contrib/ipfilter/test/expected/in2 index 61c0d1854dd5..1dc7b68dd783 100644 --- a/contrib/ipfilter/test/expected/in2 +++ b/contrib/ipfilter/test/expected/in2 @@ -1,67 +1,71 @@ rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 tcp rdr le0 9.8.7.6/32 -> 1.1.1.1 ip rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp rdr le0 9.8.7.6/32 -> 1.1.1.1 ip +rdr le0 9.0.0.0/8 -> 1.1.1.1 ip +rdr le0 9.8.0.0/16 -> 1.1.1.1 ip rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp +rdr le0 9.8.7.6/32 port 80 -> 0.0.0.0/0 port 80 tcp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 udp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp/udp rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag -rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag +rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp/udp frag rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/10 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/20 rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag age 10/10 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30/30 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/10 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/20 rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag age 10/10 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20 sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30/30 sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40 sticky rdr le0 9.8.7.6/32 -> 1.1.1.1 ip mssclamp 1000 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip mssclamp 1000 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag mssclamp 1000 rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/10 mssclamp 1000 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/20 mssclamp 1000 rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag age 10/10 mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30/30 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40 sticky mssclamp 1000 rdr le0 9.8.7.6/32 -> 1.1.1.1 ip tag nattagcacheline rdr le0 9.8.7.6/32 -> 1.1.1.1 ip mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 -> 1.1.1.1 ip mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/10 mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/20 mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 -> 1.1.1.1 icmp frag age 10/10 mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20/20 sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30/30 sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40/40 sticky mssclamp 1000 tag nattagcacheline rdr ge0 9.8.7.6/32 port 21 -> 1.1.1.1 port 21 tcp proxy ftp rdr ge0 9.8.7.6/32 port 21 -> 1.1.1.1 port 21 tcp proxy ftp rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1 port 5555 tcp rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1 port = 5555 tcp rdr le0 0.0.0.0/0 -> 254.220.186.152 ip rdr le0 0.0.0.0/0 -> 254.220.186.152,254.220.186.152 ip +rdr adsl0,ppp0 0.0.0.0/0 port 25 -> 127.0.0.1 port 25 tcp diff --git a/contrib/ipfilter/test/expected/in5 b/contrib/ipfilter/test/expected/in5 index 7b3120a7c553..f371b358eece 100644 --- a/contrib/ipfilter/test/expected/in5 +++ b/contrib/ipfilter/test/expected/in5 @@ -1,22 +1,23 @@ +map le0 from 9.8.7.6/32 port > 1024 to any -> 1.1.1.1/32 portmap tcp 10000:20000 rdr le0 from any to 9.8.7.6/32 port = 0 -> 1.1.1.1 port 0 tcp rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 ip rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 ip rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 udp rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp/udp rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 icmp rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 ip frag rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 icmp frag rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin frag rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/10 rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 ip frag age 10/20 rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 icmp frag age 10/10 rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag age 20/20 rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin frag age 30/30 rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag age 40/40 diff --git a/contrib/ipfilter/test/expected/in6 b/contrib/ipfilter/test/expected/in6 index 08bbff061c74..338bd808f57f 100644 --- a/contrib/ipfilter/test/expected/in6 +++ b/contrib/ipfilter/test/expected/in6 @@ -1,3 +1,7 @@ map foo0 from any port = 1 to any port != 0 -> 0.0.0.0/32 udp +map foo0 from any port = 1 to any port != 0 -> 0.0.0.0/32 udp +map foo0 from any port < 1 to any port > 0 -> 0.0.0.0/32 tcp map foo0 from any port < 1 to any port > 0 -> 0.0.0.0/32 tcp map foo0 from any port <= 1 to any port >= 0 -> 0.0.0.0/32 tcp/udp +map foo0 from any port <= 1 to any port >= 0 -> 0.0.0.0/32 tcp/udp +map foo0 from any port 1 >< 20 to any port 20 <> 40 -> 0.0.0.0/32 tcp/udp diff --git a/contrib/ipfilter/test/expected/n1 b/contrib/ipfilter/test/expected/n1 index 0f87034649b8..537f9bb65503 100644 --- a/contrib/ipfilter/test/expected/n1 +++ b/contrib/ipfilter/test/expected/n1 @@ -1,105 +1,105 @@ -ip 20(20) 255 10.1.1.0 > 10.1.1.2 -ip 20(20) 255 10.2.2.2 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 -ip 48(20) 1 10.2.2.2 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.1.1.1 -ip 48(20) 1 10.4.3.2 > 10.3.4.1 -ip 48(20) 1 10.4.3.2 > 10.3.4.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.4 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.1.1.2 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.1.1.2 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.1.1.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.1.1.3 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 255 10.2.2.2 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 +ip #0 48(20) 1 10.2.2.2 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.1.1.1 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.1 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.4 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 ------------------------------- -ip 20(20) 255 10.3.4.5 > 10.1.1.2 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.3.4.5 > 10.1.1.1 -ip 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.0 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 48(20) 1 10.3.4.5 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.2.2.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.1 -ip 48(20) 1 10.4.3.2 > 10.3.4.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.4 -ip 48(20) 1 10.4.3.2 > 10.1.1.1 -ip 20(20) 34 10.3.4.5 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.3.4.5 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.1.1.2 -ip 20(20) 34 10.1.1.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.3.4.5 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 20(20) 255 10.3.4.5 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.3.4.5 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.0 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 48(20) 1 10.3.4.5 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.2.2.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.1 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.4 +ip #0 48(20) 1 10.4.3.2 > 10.1.1.1 +ip #0 20(20) 34 10.3.4.5 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.3.4.5 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.1.1.2 +ip #0 20(20) 34 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.3.4.5 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 ------------------------------- -ip 20(20) 255 10.3.4.1 > 10.1.1.2 -ip 20(20) 255 10.3.4.2 > 10.1.1.2 -ip 20(20) 255 10.3.4.3 > 10.1.1.1 -ip 40(20) 6 10.3.4.3,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.3,1026 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 -ip 48(20) 1 10.3.4.3 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.2.2.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.1 -ip 48(20) 1 10.4.3.2 > 10.3.4.2 -ip 48(20) 1 10.4.3.2 > 10.1.1.1 -ip 48(20) 1 10.4.3.2 > 10.3.4.4 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.3.4.3 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.3.4.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.3.4.4 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.3.4.4 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 20(20) 255 10.3.4.1 > 10.1.1.2 +ip #0 20(20) 255 10.3.4.2 > 10.1.1.2 +ip #0 20(20) 255 10.3.4.3 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.3,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.3,1026 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 +ip #0 48(20) 1 10.3.4.3 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.2.2.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.1 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.2 +ip #0 48(20) 1 10.4.3.2 > 10.1.1.1 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.4 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.3.4.3 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.3.4.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.3.4.4 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.3.4.4 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 ------------------------------- diff --git a/contrib/ipfilter/test/expected/n11 b/contrib/ipfilter/test/expected/n11 index 3732709e6727..5257a64a1f08 100644 --- a/contrib/ipfilter/test/expected/n11 +++ b/contrib/ipfilter/test/expected/n11 @@ -1,51 +1,51 @@ -ip 20(20) 255 10.1.1.0 > 10.1.1.2 -ip 20(20) 255 1.6.7.8 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 255 1.6.7.8 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 ------------------------------- -ip 20(20) 255 10.2.2.2 > 10.1.1.2 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.2.2.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.1.1.0 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.0 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 20(20) 255 10.2.2.2 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.2.2.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.1.1.0 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.0 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 ------------------------------- -ip 20(20) 255 10.3.4.0 > 10.1.1.2 -ip 20(20) 255 10.3.4.1 > 10.1.1.2 -ip 20(20) 255 10.3.4.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.1.1.5 -ip 20(20) 255 10.1.1.1 > 10.1.1.5 -ip 20(20) 255 10.1.1.2 > 10.1.1.5 +ip #0 20(20) 255 10.3.4.0 > 10.1.1.2 +ip #0 20(20) 255 10.3.4.1 > 10.1.1.2 +ip #0 20(20) 255 10.3.4.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.5 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.5 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.5 ------------------------------- diff --git a/contrib/ipfilter/test/expected/n13 b/contrib/ipfilter/test/expected/n13 new file mode 100644 index 000000000000..bfe201886528 --- /dev/null +++ b/contrib/ipfilter/test/expected/n13 @@ -0,0 +1,5 @@ +ip #0 20(20) 0 203.1.1.23 > 150.1.1.1 +ip #0 20(20) 0 203.1.1.23 > 150.1.1.2 +ip #0 20(20) 0 203.1.1.24 > 150.1.1.2 +ip #0 20(20) 0 203.1.1.25 > 150.1.1.1 +------------------------------- diff --git a/contrib/ipfilter/test/expected/n14 b/contrib/ipfilter/test/expected/n14 new file mode 100644 index 000000000000..46693001a444 --- /dev/null +++ b/contrib/ipfilter/test/expected/n14 @@ -0,0 +1,5 @@ +ip #0 40(20) 6 10.2.2.5,2000 > 10.1.1.254,80 +ip #0 40(20) 6 10.2.2.6,2000 > 10.1.1.253,80 +ip #0 40(20) 6 10.2.2.7,2000 > 10.1.1.254,80 +ip #0 40(20) 6 10.2.2.5,2001 > 10.1.1.254,80 +------------------------------- diff --git a/contrib/ipfilter/test/expected/n2 b/contrib/ipfilter/test/expected/n2 index dc70138398d3..827272e91031 100644 --- a/contrib/ipfilter/test/expected/n2 +++ b/contrib/ipfilter/test/expected/n2 @@ -1,80 +1,80 @@ -ip 40(20) 6 10.2.2.2,10000 > 10.1.1.1,1025 -ip 40(20) 6 10.2.2.2,10001 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 -ip 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 -ip 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 -ip 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.2.2.2,10000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.2.2.2,10001 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 +ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 +ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 +ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 28(20) 17 10.3.4.5,10000 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 -ip 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 -ip 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 -ip 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 28(20) 17 10.3.4.5,10000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 +ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 +ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 +ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10001 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10003 > 10.1.1.1,1025 -ip 28(20) 17 10.3.4.1,10004 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10005 > 10.1.2.1,80 -ip 40(20) 6 10.3.4.1,10006 > 10.1.3.1,80 -ip 40(20) 6 10.3.4.1,10007 > 10.1.4.1,80 -ip 40(20) 6 10.3.4.1,10008 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10001 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10003 > 10.1.1.1,1025 +ip #0 28(20) 17 10.3.4.1,10004 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10005 > 10.1.2.1,80 +ip #0 40(20) 6 10.3.4.1,10006 > 10.1.3.1,80 +ip #0 40(20) 6 10.3.4.1,10007 > 10.1.4.1,80 +ip #0 40(20) 6 10.3.4.1,10008 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40001 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 28(20) 17 10.3.4.5,40000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40001 > 10.1.2.1,80 -ip 40(20) 6 10.3.4.5,40000 > 10.1.3.1,80 -ip 40(20) 6 10.3.4.5,40001 > 10.1.4.1,80 -ip 40(20) 6 10.3.4.5,40000 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.1.1.3,2000 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 28(20) 17 10.3.4.5,40000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.2.1,80 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.3.1,80 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.4.1,80 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.1.1.3,2000 ------------------------------- diff --git a/contrib/ipfilter/test/expected/n3 b/contrib/ipfilter/test/expected/n3 index 03c071797106..0e019aefb2ba 100644 --- a/contrib/ipfilter/test/expected/n3 +++ b/contrib/ipfilter/test/expected/n3 @@ -1,12 +1,12 @@ -ip 40(20) 6 192.168.2.1,1488 > 203.1.1.1,80 -ip 40(20) 6 192.168.2.1,1276 > 203.1.1.1,80 -ip 40(20) 6 192.168.2.1,1032 > 203.1.1.1,80 -ip 28(20) 17 192.168.2.1,1032 > 203.1.1.1,80 -ip 40(20) 6 192.168.2.1,65299 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.2.1,1488 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.2.1,1276 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.2.1,1032 > 203.1.1.1,80 +ip #0 28(20) 17 192.168.2.1,1032 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.2.1,65299 > 203.1.1.1,80 ------------------------------- -ip 40(20) 6 192.168.1.1,1488 > 203.1.1.1,80 -ip 40(20) 6 192.168.1.1,1276 > 203.1.1.1,80 -ip 40(20) 6 192.168.1.0,1032 > 203.1.1.1,80 -ip 28(20) 17 192.168.1.0,1032 > 203.1.1.1,80 -ip 40(20) 6 192.168.1.255,65299 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.1.1,1488 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.1.1,1276 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.1.0,1032 > 203.1.1.1,80 +ip #0 28(20) 17 192.168.1.0,1032 > 203.1.1.1,80 +ip #0 40(20) 6 192.168.1.255,65299 > 203.1.1.1,80 ------------------------------- diff --git a/contrib/ipfilter/test/expected/n4 b/contrib/ipfilter/test/expected/n4 index 8cdf78c31843..9349542396c1 100644 --- a/contrib/ipfilter/test/expected/n4 +++ b/contrib/ipfilter/test/expected/n4 @@ -1,66 +1,66 @@ -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 ------------------------------- -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 ------------------------------- -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12346 > 10.2.2.1,10023 -ip 40(20) 6 10.1.0.0,23 > 10.3.3.3,12346 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.1.1.1,23 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12346 > 10.2.2.1,10023 +ip #0 40(20) 6 10.1.0.0,23 > 10.3.3.3,12346 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 ------------------------------- -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 -ip 28(20) 17 10.3.3.3,12345 > 10.2.2.1,10053 -ip 28(20) 17 10.1.1.0,53 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 +ip #0 28(20) 17 10.3.3.3,12345 > 10.2.2.1,10053 +ip #0 28(20) 17 10.1.1.0,53 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.1,53 > 10.3.3.3,12345 ------------------------------- -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 -ip 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 -ip 40(20) 6 10.1.1.0,53 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 +ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 +ip #0 40(20) 6 10.1.1.0,53 > 10.3.3.3,12345 ------------------------------- -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 -ip 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 -ip 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 -ip 28(20) 17 10.3.3.3,12345 > 10.2.2.1,53 -ip 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 -ip 40(20) 6 10.1.1.0,53 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 +ip #0 40(20) 6 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12346 > 10.1.0.0,23 +ip #0 40(20) 6 10.2.2.1,10023 > 10.3.3.3,12346 +ip #0 28(20) 17 10.3.3.3,12345 > 10.2.2.1,53 +ip #0 28(20) 17 10.2.2.1,10053 > 10.3.3.3,12345 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,53 +ip #0 40(20) 6 10.1.1.0,53 > 10.3.3.3,12345 ------------------------------- diff --git a/contrib/ipfilter/test/expected/n5 b/contrib/ipfilter/test/expected/n5 index 521c7376ef45..0e578b64bcfc 100644 --- a/contrib/ipfilter/test/expected/n5 +++ b/contrib/ipfilter/test/expected/n5 @@ -1,330 +1,330 @@ -ip 20(20) 255 10.1.1.0 > 10.1.1.2 -ip 20(20) 255 10.2.2.2 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 -ip 48(20) 1 10.2.2.2 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.1.1.1 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.1.1.2 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.1.1.2 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.1.1.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.1.1.3 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 -ip 40(20) 6 10.2.2.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.2.2.2,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.2.2.2 > 10.1.2.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 -ip 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 -ip 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 -ip 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.2.2.2,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.2.2.2,1025 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 255 10.2.2.2 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 +ip #0 48(20) 1 10.2.2.2 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.1.1.1 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 40(20) 6 10.2.2.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.2.2.2,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.2.2.2 > 10.1.2.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 +ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 +ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 +ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.2.2.2,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.2.2.2,1025 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 20(20) 255 10.3.4.5 > 10.1.1.2 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.3.4.5 > 10.1.1.1 -ip 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.0 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 48(20) 1 10.1.1.1 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.2.2.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.1.1.2 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.1.1.2 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.1.1.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.1.1.3 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.3.4.5 > 10.1.1.2 -ip 20(20) 0 10.3.4.5 > 10.1.2.1 -ip 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025 -ip 28(20) 17 10.3.4.5,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,2000 > 10.1.2.1,80 -ip 40(20) 6 10.3.4.5,2001 > 10.1.3.1,80 -ip 40(20) 6 10.3.4.5,2002 > 10.1.4.1,80 -ip 40(20) 6 10.3.4.5,2003 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 20(20) 255 10.3.4.5 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.3.4.5 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.0 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 48(20) 1 10.1.1.1 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.2.2.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.3.4.5 > 10.1.1.2 +ip #0 20(20) 0 10.3.4.5 > 10.1.2.1 +ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,1026 > 10.1.1.1,1025 +ip #0 28(20) 17 10.3.4.5,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,2000 > 10.1.2.1,80 +ip #0 40(20) 6 10.3.4.5,2001 > 10.1.3.1,80 +ip #0 40(20) 6 10.3.4.5,2002 > 10.1.4.1,80 +ip #0 40(20) 6 10.3.4.5,2003 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 20(20) 255 10.1.1.0 > 10.1.1.2 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 -ip 48(20) 1 10.3.4.1 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.2.2.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.3.4.1 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.3.4.1 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.3.4.2 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.3.4.2 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 -ip 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 -ip 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 -ip 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.3.4.3,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.3.4.3,1025 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.3.4.3,1025 > 10.3.4.5,40001 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 +ip #0 48(20) 1 10.3.4.1 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.2.2.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.3.4.1 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.3.4.1 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.3.4.2 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.3.4.2 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 28(20) 17 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 +ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 +ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 +ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.3,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.3.4.3,1025 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.3.4.3,1025 > 10.3.4.5,40001 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 20(20) 255 10.1.1.0 > 10.1.1.2 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 -ip 48(20) 1 10.1.1.1 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.2.2.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.1.1.2 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.1.1.2 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.1.1.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.1.1.3 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 -ip 28(20) 17 10.3.4.5,10000 > 10.1.1.1,1025 -ip 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 -ip 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 -ip 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 -ip 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.3.4.5,10001 > 10.3.4.5,40001 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 +ip #0 48(20) 1 10.1.1.1 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.2.2.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.2,1026 > 10.1.1.1,1025 +ip #0 28(20) 17 10.3.4.5,10000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.1.1.3,2000 > 10.1.2.1,80 +ip #0 40(20) 6 10.1.1.3,2001 > 10.1.3.1,80 +ip #0 40(20) 6 10.1.1.3,2002 > 10.1.4.1,80 +ip #0 40(20) 6 10.1.1.3,2003 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.3.4.5,10001 > 10.3.4.5,40001 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 20(20) 255 10.1.1.0 > 10.1.1.2 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10001 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 -ip 48(20) 1 10.1.1.1 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.2.2.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.1.1.2 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.1.1.2 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.1.1.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.1.1.3 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 -ip 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10003 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10001 > 10.1.1.1,1025 -ip 28(20) 17 10.3.4.1,10004 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.1,10005 > 10.1.2.1,80 -ip 40(20) 6 10.3.4.1,10006 > 10.1.3.1,80 -ip 40(20) 6 10.3.4.1,10007 > 10.1.4.1,80 -ip 40(20) 6 10.3.4.1,10008 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.3.4.1,10009 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.3.4.1,10010 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 -ip 28(20) 17 10.3.4.1,10011 > 10.3.4.5,40001 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.3.4.1,10012 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10001 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 +ip #0 48(20) 1 10.1.1.1 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.2.2.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 40(20) 6 10.3.4.1,10002 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10003 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10001 > 10.1.1.1,1025 +ip #0 28(20) 17 10.3.4.1,10004 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.1,10005 > 10.1.2.1,80 +ip #0 40(20) 6 10.3.4.1,10006 > 10.1.3.1,80 +ip #0 40(20) 6 10.3.4.1,10007 > 10.1.4.1,80 +ip #0 40(20) 6 10.3.4.1,10008 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.1,10009 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.3.4.1,10010 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,40000 +ip #0 28(20) 17 10.3.4.1,10011 > 10.3.4.5,40001 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.3.4.1,10012 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- -ip 20(20) 255 10.1.1.0 > 10.1.1.2 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 -ip 20(20) 255 10.2.2.1 > 10.1.2.1 -ip 20(20) 255 10.2.2.2 > 10.1.2.1 -ip 20(20) 255 10.1.1.1 > 10.1.1.2 -ip 20(20) 255 10.1.1.2 > 10.1.1.1 -ip 20(20) 255 10.2.2.1 > 10.2.1.1 -ip 20(20) 255 10.2.2.2 > 10.2.1.1 -ip 20(20) 255 10.2.2.3 > 10.1.1.1 -ip 20(20) 255 10.2.3.4 > 10.2.2.2 -ip 20(20) 255 10.1.1.1 > 10.2.2.2 -ip 20(20) 255 10.1.1.2 > 10.2.2.2 -ip 20(20) 255 10.1.1.0 > 10.3.4.5 -ip 20(20) 255 10.1.1.1 > 10.3.4.5 -ip 20(20) 255 10.1.1.2 > 10.3.4.5 -ip 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 -ip 48(20) 1 10.1.1.1 > 10.4.3.2 -ip 48(20) 1 10.4.3.2 > 10.2.2.2 -ip 48(20) 1 10.4.3.2 > 10.3.4.3 -ip 48(20) 1 10.4.3.2 > 10.3.4.5 -ip 20(20) 34 10.1.1.2 > 10.4.3.2 -ip 20(20) 34 10.4.3.2 > 10.3.4.4 -ip 20(20) 34 10.1.1.2 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.5 -ip 20(20) 34 10.1.1.3 > 10.4.3.4 -ip 20(20) 34 10.4.3.4 > 10.3.4.6 -ip 20(20) 35 10.1.1.3 > 10.4.3.4 -ip 20(20) 35 10.4.3.4 > 10.3.4.7 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40000 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.0 > 10.1.1.2 -ip 20(20) 0 10.1.1.1 > 10.1.2.1 -ip 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 -ip 28(20) 17 10.3.4.5,40001 > 10.1.1.1,1025 -ip 40(20) 6 10.3.4.5,40000 > 10.1.2.1,80 -ip 40(20) 6 10.3.4.5,40001 > 10.1.3.1,80 -ip 40(20) 6 10.3.4.5,40000 > 10.1.4.1,80 -ip 40(20) 6 10.3.4.5,40001 > 10.1.4.1,80 -ip 20(20) 0 10.1.1.1 > 10.1.1.2 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 20(20) 0 10.1.1.2 > 10.1.1.1 -ip 40(20) 6 10.3.4.5,40000 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 -ip 40(20) 6 10.3.4.5,40001 > 10.3.4.5,40000 -ip 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 -ip 28(20) 17 10.3.4.5,40000 > 10.3.4.5,40001 -ip 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 -ip 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 20(20) 255 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 +ip #0 20(20) 255 10.2.2.1 > 10.1.2.1 +ip #0 20(20) 255 10.2.2.2 > 10.1.2.1 +ip #0 20(20) 255 10.1.1.1 > 10.1.1.2 +ip #0 20(20) 255 10.1.1.2 > 10.1.1.1 +ip #0 20(20) 255 10.2.2.1 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.2 > 10.2.1.1 +ip #0 20(20) 255 10.2.2.3 > 10.1.1.1 +ip #0 20(20) 255 10.2.3.4 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.1 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.2 > 10.2.2.2 +ip #0 20(20) 255 10.1.1.0 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.1 > 10.3.4.5 +ip #0 20(20) 255 10.1.1.2 > 10.3.4.5 +ip #0 40(20) 6 10.1.1.1,1025 > 10.3.4.5,1025 +ip #0 48(20) 1 10.1.1.1 > 10.4.3.2 +ip #0 48(20) 1 10.4.3.2 > 10.2.2.2 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.3 +ip #0 48(20) 1 10.4.3.2 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.2 +ip #0 20(20) 34 10.4.3.2 > 10.3.4.4 +ip #0 20(20) 34 10.1.1.2 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.5 +ip #0 20(20) 34 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 34 10.4.3.4 > 10.3.4.6 +ip #0 20(20) 35 10.1.1.3 > 10.4.3.4 +ip #0 20(20) 35 10.4.3.4 > 10.3.4.7 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.0 > 10.1.1.2 +ip #0 20(20) 0 10.1.1.1 > 10.1.2.1 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.1.1,1025 +ip #0 28(20) 17 10.3.4.5,40001 > 10.1.1.1,1025 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.2.1,80 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.3.1,80 +ip #0 40(20) 6 10.3.4.5,40000 > 10.1.4.1,80 +ip #0 40(20) 6 10.3.4.5,40001 > 10.1.4.1,80 +ip #0 20(20) 0 10.1.1.1 > 10.1.1.2 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 20(20) 0 10.1.1.2 > 10.1.1.1 +ip #0 40(20) 6 10.3.4.5,40000 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1026 > 10.3.4.5,40000 +ip #0 40(20) 6 10.3.4.5,40001 > 10.3.4.5,40000 +ip #0 40(20) 6 10.1.1.1,1025 > 10.1.1.2,1025 +ip #0 28(20) 17 10.3.4.5,40000 > 10.3.4.5,40001 +ip #0 28(20) 17 10.1.1.2,1025 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 +ip #0 40(20) 6 10.1.2.1,80 > 10.3.4.5,40001 ------------------------------- diff --git a/contrib/ipfilter/test/expected/n6 b/contrib/ipfilter/test/expected/n6 index d28d4f1ee4d7..2b2c37fe7a90 100644 --- a/contrib/ipfilter/test/expected/n6 +++ b/contrib/ipfilter/test/expected/n6 @@ -1,70 +1,70 @@ -ip 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23 -ip 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 -ip 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 -ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 -ip 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23 +ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 +ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 +ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 ------------------------------- -ip 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 -ip 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 -ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 -ip 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 +ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 +ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 ------------------------------- -ip 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 -ip 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 -ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 -ip 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.2.2,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 +ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 +ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 ------------------------------- -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.1,23 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23 -ip 40(20) 6 10.3.0.1,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 -ip 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 -ip 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 -ip 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,23 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23 +ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.2.2.1,10023 +ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 ------------------------------- -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.1,23 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23 -ip 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 -ip 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 -ip 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 -ip 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 -ip 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 -ip 28(20) 17 10.3.3.3,12345 > 10.2.2.1,10053 -ip 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 -ip 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,23 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.2,23 +ip #0 40(20) 6 10.3.0.1,12345 > 10.1.2.2,23 +ip #0 40(20) 6 10.3.0.1,12345 > 10.2.2.2,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,23 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.1,53 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.0.0,23 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.0.0,23 +ip #0 28(20) 17 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 28(20) 17 10.3.3.3,12345 > 10.2.2.1,10053 +ip #0 40(20) 6 10.2.2.2,12345 > 10.1.1.0,53 +ip #0 40(20) 6 10.3.3.3,12345 > 10.1.1.0,53 ------------------------------- diff --git a/contrib/ipfilter/test/expected/n7 b/contrib/ipfilter/test/expected/n7 index db8bb5078018..eb23534d0b30 100644 --- a/contrib/ipfilter/test/expected/n7 +++ b/contrib/ipfilter/test/expected/n7 @@ -1,30 +1,30 @@ -ip 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22 -ip 40(20) 6 10.2.3.1,1231 > 10.2.2.1,10023 -ip 40(20) 6 10.2.3.1,1232 > 10.2.2.1,10050 -ip 40(20) 6 10.2.3.1,1233 > 10.2.2.1,10079 -ip 40(20) 6 10.2.3.1,1234 > 10.1.1.1,80 -ip 40(20) 6 10.2.3.1,1235 > 10.1.1.2,80 -ip 40(20) 6 10.2.3.1,1236 > 10.1.1.3,80 -ip 40(20) 6 10.2.3.1,1237 > 10.1.1.4,80 -ip 40(20) 6 10.2.3.1,1238 > 10.1.1.4,80 +ip #0 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22 +ip #0 40(20) 6 10.2.3.1,1231 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.3.1,1232 > 10.2.2.1,10050 +ip #0 40(20) 6 10.2.3.1,1233 > 10.2.2.1,10079 +ip #0 40(20) 6 10.2.3.1,1234 > 10.1.1.1,80 +ip #0 40(20) 6 10.2.3.1,1235 > 10.1.1.2,80 +ip #0 40(20) 6 10.2.3.1,1236 > 10.1.1.3,80 +ip #0 40(20) 6 10.2.3.1,1237 > 10.1.1.4,80 +ip #0 40(20) 6 10.2.3.1,1238 > 10.1.1.4,80 ------------------------------- -ip 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22 -ip 40(20) 6 10.2.3.1,1231 > 10.2.2.1,10023 -ip 40(20) 6 10.2.3.1,1232 > 10.2.2.1,10023 -ip 40(20) 6 10.2.3.1,1233 > 10.2.2.1,10023 -ip 40(20) 6 10.2.3.1,1234 > 10.1.1.1,80 -ip 40(20) 6 10.2.3.1,1235 > 10.1.1.2,80 -ip 40(20) 6 10.2.3.1,1236 > 10.1.1.3,80 -ip 40(20) 6 10.2.3.1,1237 > 10.1.1.4,80 -ip 40(20) 6 10.2.3.1,1238 > 10.1.1.4,80 +ip #0 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22 +ip #0 40(20) 6 10.2.3.1,1231 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.3.1,1232 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.3.1,1233 > 10.2.2.1,10023 +ip #0 40(20) 6 10.2.3.1,1234 > 10.1.1.1,80 +ip #0 40(20) 6 10.2.3.1,1235 > 10.1.1.2,80 +ip #0 40(20) 6 10.2.3.1,1236 > 10.1.1.3,80 +ip #0 40(20) 6 10.2.3.1,1237 > 10.1.1.4,80 +ip #0 40(20) 6 10.2.3.1,1238 > 10.1.1.4,80 ------------------------------- -ip 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22 -ip 40(20) 6 10.2.3.1,1231 > 10.1.1.1,23 -ip 40(20) 6 10.2.3.1,1232 > 10.1.1.1,50 -ip 40(20) 6 10.2.3.1,1233 > 10.1.1.1,79 -ip 40(20) 6 10.2.3.1,1234 > 10.2.2.1,3128 -ip 40(20) 6 10.2.3.1,1235 > 1.2.2.129,3128 -ip 40(20) 6 10.2.3.1,1236 > 10.2.2.1,3128 -ip 40(20) 6 10.2.3.1,1237 > 1.2.2.129,3128 -ip 40(20) 6 10.2.3.1,1238 > 10.2.2.1,3128 +ip #0 40(20) 6 10.2.3.1,1230 > 10.1.1.1,22 +ip #0 40(20) 6 10.2.3.1,1231 > 10.1.1.1,23 +ip #0 40(20) 6 10.2.3.1,1232 > 10.1.1.1,50 +ip #0 40(20) 6 10.2.3.1,1233 > 10.1.1.1,79 +ip #0 40(20) 6 10.2.3.1,1234 > 10.2.2.1,3128 +ip #0 40(20) 6 10.2.3.1,1235 > 1.2.2.129,3128 +ip #0 40(20) 6 10.2.3.1,1236 > 10.2.2.1,3128 +ip #0 40(20) 6 10.2.3.1,1237 > 1.2.2.129,3128 +ip #0 40(20) 6 10.2.3.1,1238 > 10.2.2.1,3128 ------------------------------- diff --git a/contrib/ipfilter/test/expected/p1 b/contrib/ipfilter/test/expected/p1 index c3f7afa66f55..9f02804439e8 100644 --- a/contrib/ipfilter/test/expected/p1 +++ b/contrib/ipfilter/test/expected/p1 @@ -1,19 +1,21 @@ nomatch pass nomatch nomatch nomatch pass nomatch nomatch List of active MAP/Redirect filters: List of active sessions: + +Hostmap table: List of active state sessions: List of configured pools table role = ipf type = tree number = 100 { 1.1.1.1/32; ! 2.2.0.0/16; 2.2.2.0/24; }; List of configured hash tables List of groups configured (set 0) List of groups configured (set 1) ------------------------------- diff --git a/contrib/ipfilter/test/expected/p2 b/contrib/ipfilter/test/expected/p2 index bb15bdf7b146..2f330c26f8b9 100644 --- a/contrib/ipfilter/test/expected/p2 +++ b/contrib/ipfilter/test/expected/p2 @@ -1,20 +1,25 @@ -nomatch +block nomatch pass nomatch nomatch nomatch nomatch pass List of active MAP/Redirect filters: List of active sessions: + +Hostmap table: List of active state sessions: List of configured pools List of configured hash tables # 'anonymous' table +table role = ipf type = hash number = 2147483650 size = 3 + { 4.4.0.0/16; 127.0.0.1/32; }; +# 'anonymous' table table role = ipf type = hash number = 2147483649 size = 3 { 4.4.0.0/16; 127.0.0.1/32; }; List of groups configured (set 0) List of groups configured (set 1) ------------------------------- diff --git a/contrib/ipfilter/test/expected/p3 b/contrib/ipfilter/test/expected/p3 index 136543f82291..94fde9e701af 100644 --- a/contrib/ipfilter/test/expected/p3 +++ b/contrib/ipfilter/test/expected/p3 @@ -1,33 +1,35 @@ pass nomatch nomatch nomatch nomatch pass block nomatch nomatch pass nomatch block List of active MAP/Redirect filters: List of active sessions: + +Hostmap table: List of active state sessions: List of configured pools List of configured hash tables group-map out role = ipf number = 2010 size = 5 { 5.0.0.0/8, group = 2040; 4.4.0.0/16, group = 2020; 2.2.2.2/32, group = 2020; }; group-map in role = ipf number = 1010 size = 3 { 3.3.0.0/16, group = 1030; 1.1.1.1/32, group = 1020; }; List of groups configured (set 0) Dev.0. Group 1020 Ref 1 Flags 0x8000 2 pass in all group 1020 Dev.0. Group 1030 Ref 1 Flags 0x8000 2 block in all group 1030 Dev.0. Group 2020 Ref 2 Flags 0x4000 4 pass out all group 2020 Dev.0. Group 2040 Ref 1 Flags 0x4000 2 block out all group 2040 List of groups configured (set 1) ------------------------------- diff --git a/contrib/ipfilter/test/input/f13 b/contrib/ipfilter/test/input/f13 index 0ca607ea17e1..d7b07249ace4 100644 --- a/contrib/ipfilter/test/input/f13 +++ b/contrib/ipfilter/test/input/f13 @@ -1,51 +1,94 @@ -# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF,MF,FO=0 SYN +# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF,FO=0 SYN +[in] 4500 0028 0001 4000 3f06 36cc 0101 0101 0201 0101 -0401 0019 0000 0000 0000 0000 50 02 2000 86c5 0000 +0401 0019 0000 0000 0000 0000 50 02 2000 86bb 0000 # 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP MF ACK +[in] 4500 0024 0002 2000 3f06 56cf 0101 0101 0201 0101 0401 0019 0000 0000 0000 0000 5010 2000 # 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP FO=2 ACK +[in] 4500 002c 0002 0002 3f06 76c5 0101 0101 0201 0101 0000 0000 0001 0203 0405 0607 0809 0a0b 0c0d 0e0f 1011 1213 -# 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF MF FO=0 SYN +# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF MF FO=0 SYN +[in] 4500 0028 0003 6000 3f06 16ca 0101 0101 0201 0101 -0401 0019 0000 0000 0000 0000 5010 2000 0000 0000 +0400 0019 7000 0000 0000 0000 5002 2000 0000 0000 # 1.1.1.1,1025 -> 2.1.1.1,25 TTL=63 TCP DF FO=0 +[in] 4500 001c 0004 6000 3f06 16d5 0101 0101 0201 0101 0401 0019 0000 0000 # 1.1.1.1 -> 2.1.1.1 TTL=63 TCP DF FO=1 SYN +[in] 4500 001c 0005 6001 3f06 16d3 0101 0101 0201 0101 0000 0000 5010 2000 # 1.1.1.1 -> 2.1.1.1 TTL=63 UDP DF MF FO=0 +[in] 4500 0014 0006 6000 3f11 16d0 0101 0101 0201 0101 # 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0 +[in] 4500 0018 0007 2000 3f11 56cb 0101 0101 0201 0101 0035 0035 # 1.1.1.1,53 -> 2.1.1.1,53 TTL=63 UDP MF FO=0 +[in] 4500 001c 0008 2000 3f11 56c6 0101 0101 0201 0101 0035 0035 0004 0000 # 1.1.1.1,53 -> 2.1.1.1,54 TTL=63 UDP MF FO=0 (short) +[in] 4500 0018 0008 2000 3f11 56ca 0101 0101 0201 0101 0035 0036 # 1.1.1.1,21 -> 2.1.1.1,54 TTL=63 UDP MF FO=0 +[in] 4500 001c 0008 2000 3f11 56c6 0101 0101 0201 0101 0015 0036 0004 0000 # 1.1.1.1,21 -> 2.1.1.1,54 TTL=63 TCP MF FO=0 +[in] 4500 001c 0008 2000 3f06 56d1 0101 0101 0201 0101 0015 0036 0000 0000 0000 0000 50 02 2000 0000 0000 +# 1.1.1.1 -> 2.1.1.1 TTL=63 UDP FO=3 +[in] +4500 001c 0008 0003 3f11 76c3 0101 0101 0201 0101 +0000 0000 0000 0000 + # 1.1.1.1 -> 2.1.1.1 TTL=63 UDP FO=1 +[in] 4500 001c 0008 0001 3f11 76c5 0101 0101 0201 0101 0000 0000 0000 0000 +# 2.1.1.1,53 -> 1.1.1.1,53 TTL=63 UDP +[out] +4500 001c 0008 0000 3f11 76c6 0201 0101 0101 0101 +0035 0035 0004 0000 + +# 2.1.1.1,25 -> 1.1.1.1,1014 TTL=63 TCP DF SYN-ACK +[out] +4500 0028 0003 4000 3f06 36ca 0201 0101 0101 0101 +0019 0400 0000 0001 7000 0001 5012 2000 16b4 0000 + +# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF ACK (OOW) +[in] +4500 0028 0003 4000 3f06 36ca 0101 0101 0201 0101 +0400 0019 0040 0000 0000 0000 5010 2000 8678 0000 + +# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF ACK +[in] +4500 0028 0003 4000 3f06 36ca 0101 0101 0201 0101 +0400 0019 7000 0004 0000 0002 5010 2000 16b2 0000 + +# 1.1.1.1,1024 -> 2.1.1.1,25 TTL=63 TCP DF ACK +[in] +4500 0028 0003 4000 3f06 36ca 0101 0101 0201 0101 +0400 0019 7000 0001 0000 0002 5010 2000 16b5 0000 + diff --git a/contrib/ipfilter/test/input/f17 b/contrib/ipfilter/test/input/f17 index 18af566af32e..a0d44d7db58d 100644 --- a/contrib/ipfilter/test/input/f17 +++ b/contrib/ipfilter/test/input/f17 @@ -1,28 +1,39 @@ +# TCP 1.1.1.1,54076 -> 2.2.2.2,27 SYN [out,ppp0] 4500 003c 8262 0000 4006 f254 0101 0101 0202 0202 d33c 0019 bfd0 8989 0000 0000 a002 4000 cfcd 0000 0204 05b4 0103 0300 0101 080a 008e 17f7 0000 0000 +# TCP 2.2.2.2,27 -> 1.1.1.1,54076 ACK [in,ppp0] 4500 003c 8262 0000 1106 2155 0202 0202 0101 0101 0019 d33c 4020 3436 bfdf cbc9 5010 4000 694a 0000 0204 0584 0103 0300 0101 080a 008e 17f7 0000 0000 +# TCP 1.1.1.1,54076 -> 2.2.2.2,27 SYN [out,ppp0] 4500 003c 8265 0000 4006 f251 0101 0101 0202 0202 d33c 0019 bfd0 8989 0000 0000 a002 4000 cfc2 0000 0204 05b4 0103 0300 0101 080a 008e 1802 0000 0000 +# TCP 2.2.2.2,27 -> 1.1.1.1,54076 SYN-ACK [in,ppp0] 4500 002c 7442 4000 2906 d784 0202 0202 0101 0101 0019 d33c ed67 4d4e bfd0 898a 6012 2118 19c2 0000 0204 0584 +# TCP 1.1.1.1,54076 -> 2.2.2.2,27 ACK [out,ppp0] -4500 002c 8262 0000 4006 f264 0101 0101 +4500 0028 8262 0000 4006 f268 0101 0101 0202 0202 d33c 0019 bfd0 898a ed67 4d4e -5010 4000 0ce0 0000 0000 +5010 4000 1268 0000 + +# TCP 2.2.2.2,27 -> 1.1.1.1,54076 ACK+data +[in,ppp0] +4500 002a 7442 4000 2906 d786 0202 0202 +0101 0101 0019 d33c ed67 4d4e bfd0 8990 +5012 2118 2f43 0000 0203 diff --git a/contrib/ipfilter/test/input/f18 b/contrib/ipfilter/test/input/f18 new file mode 100644 index 000000000000..9ecbb7f59a23 --- /dev/null +++ b/contrib/ipfilter/test/input/f18 @@ -0,0 +1,4 @@ +in on le1 1.1.1.1 3.3.3.3 +in on le1 1.1.1.1 5.5.5.5 +out on le1 2.2.2.2 4.4.4.4 +out on le1 2.2.2.2 6.6.6.6 diff --git a/contrib/ipfilter/test/input/f19 b/contrib/ipfilter/test/input/f19 new file mode 100644 index 000000000000..6cab988e400b --- /dev/null +++ b/contrib/ipfilter/test/input/f19 @@ -0,0 +1,4 @@ +in tcp 127.0.0.1,1 127.0.0.1,21 S +in tcp 127.0.0.1,2 127.0.0.1,21 S +in tcp 127.0.0.1,3 127.0.0.1,21 S +in tcp 127.0.0.1,4 127.0.0.1,21 S diff --git a/contrib/ipfilter/test/input/f7 b/contrib/ipfilter/test/input/f7 index 2721af2fb71e..dbc9e33e80ac 100644 --- a/contrib/ipfilter/test/input/f7 +++ b/contrib/ipfilter/test/input/f7 @@ -1,9 +1,15 @@ in icmp 1.1.1.1 2.1.1.1 echo in icmp 1.1.1.1 2.1.1.1 echo,1 in icmp 1.1.1.1 2.1.1.1 echo,3 in icmp 1.1.1.1 2.1.1.1 unreach in icmp 1.1.1.1 2.1.1.1 unreach,1 in icmp 1.1.1.1 2.1.1.1 unreach,3 in icmp 1.1.1.1 2.1.1.1 echorep in icmp 1.1.1.1 2.1.1.1 echorep,1 in icmp 1.1.1.1 2.1.1.1 echorep,3 +in icmp 2.2.2.2 3.3.3.3 maskreq +out icmp 3.3.3.3 2.2.2.2 maskrep +in icmp 4.4.4.4 5.5.5.5 timest +out icmp 5.5.5.5 4.4.4.4 timestrep +in icmp 6.6.6.6 7.7.7.7 inforeq +out icmp 7.7.7.7 6.6.6.6 inforep diff --git a/contrib/ipfilter/test/input/f9 b/contrib/ipfilter/test/input/f9 index 33f3be392a7d..e64e299fc0e5 100644 --- a/contrib/ipfilter/test/input/f9 +++ b/contrib/ipfilter/test/input/f9 @@ -1,6 +1,9 @@ in 1.1.1.1 2.1.1.1 opt lsrr +in 1.1.1.1 2.1.1.1 opt lsrr=1.1.1.1 in 1.1.1.1 2.1.1.1 opt lsrr,ssrr in 1.1.1.1 2.1.1.1 opt ts +in 1.1.1.1 2.1.1.1 opt satid +in 1.1.1.1 2.1.1.1 opt satid=234 in 1.1.1.1 2.1.1.1 opt sec-class=topsecret in 1.1.1.1 2.1.1.1 opt ssrr,sec-class=topsecret in 1.1.1.1 2.1.1.1 opt sec diff --git a/contrib/ipfilter/test/input/n13 b/contrib/ipfilter/test/input/n13 new file mode 100644 index 000000000000..ac7bbbda24a8 --- /dev/null +++ b/contrib/ipfilter/test/input/n13 @@ -0,0 +1,4 @@ +out on le0 192.168.1.1 150.1.1.1 +out on le0 192.168.1.1 150.1.1.2 +out on le0 192.168.1.2 150.1.1.2 +out on le0 192.168.1.3 150.1.1.1 diff --git a/contrib/ipfilter/test/input/n14 b/contrib/ipfilter/test/input/n14 new file mode 100644 index 000000000000..969eb1c21466 --- /dev/null +++ b/contrib/ipfilter/test/input/n14 @@ -0,0 +1,4 @@ +in on gre0 tcp 10.2.2.5,2000 203.1.1.1,80 +in on gre0 tcp 10.2.2.6,2000 203.1.1.1,80 +in on gre0 tcp 10.2.2.7,2000 203.1.1.1,80 +in on gre0 tcp 10.2.2.5,2001 203.1.1.1,80 diff --git a/contrib/ipfilter/test/input/ni17 b/contrib/ipfilter/test/input/ni17 new file mode 100644 index 000000000000..f9dec945524d --- /dev/null +++ b/contrib/ipfilter/test/input/ni17 @@ -0,0 +1,6 @@ +in on le0 tcp 10.2.2.5,2000 203.1.1.1,80 +in on le0 tcp 10.2.2.6,2000 203.1.1.1,80 +in on le0 tcp 10.2.2.7,2000 203.1.1.1,80 +in on le0 tcp 10.2.2.7,2001 203.1.1.1,80 +in on le0 tcp 10.2.2.8,2000 203.1.1.1,80 +in on le0 tcp 10.2.2.9,2000 203.1.1.1,80 diff --git a/contrib/ipfilter/test/itest b/contrib/ipfilter/test/itest index 333afde75f27..8fefc634bfb9 100644 --- a/contrib/ipfilter/test/itest +++ b/contrib/ipfilter/test/itest @@ -1,22 +1,29 @@ #!/bin/sh mkdir -p results if [ -f /usr/ucb/touch ] ; then TOUCH=/usr/ucb/touch else if [ -f /usr/bin/touch ] ; then TOUCH=/usr/bin/touch else if [ -f /bin/touch ] ; then TOUCH=/bin/touch fi fi fi echo "$1..."; /bin/cp /dev/null results/$1 -../ipf -Rnvf regress/$1 2>/dev/null > results/$1 +case $3 in +ipf) + ../ipf -Rnvf regress/$1 2>/dev/null > results/$1 + ;; +ipftest) + ../ipftest -D -r regress/$1 -i /dev/null > results/$1 + ;; +esac cmp expected/$1 results/$1 status=$? if [ $status = 0 ] ; then $TOUCH $1 fi exit $status diff --git a/contrib/ipfilter/test/natipftest b/contrib/ipfilter/test/natipftest index f5cfdb8b2439..abdc7603b002 100755 --- a/contrib/ipfilter/test/natipftest +++ b/contrib/ipfilter/test/natipftest @@ -1,59 +1,59 @@ #!/bin/sh mode=$1 shift if [ $3 = hex ] ; then format="-xF $2" else format="-F $2" fi if [ "$4" != "" ] ; then format="-T $4 $format" fi mkdir -p results if [ -f /usr/ucb/touch ] ; then TOUCH=/usr/ucb/touch else if [ -f /usr/bin/touch ] ; then TOUCH=/usr/bin/touch else if [ -f /bin/touch ] ; then TOUCH=/bin/touch fi fi fi case $mode in single) echo "$1..."; /bin/cp /dev/null results/$1 ( while read rule; do - echo "$rule" | ../ipftest -R $format -bx -r regress/$1.ipf -N - -i input/$1 >> \ + echo "$rule" | ../ipftest -R $format -b -r regress/$1.ipf -N - -i input/$1 >> \ results/$1; if [ $? -ne 0 ] ; then exit 1; fi echo "-------------------------------" >> results/$1 done ) < regress/$1.nat cmp expected/$1 results/$1 status=$? if [ $status = 0 ] ; then $TOUCH $1 fi ;; multi) echo "$1..."; /bin/cp /dev/null results/$1 - ../ipftest -R $format -bx -r regress/$1.ipf -N regress/$1.nat \ + ../ipftest -R $format -b -r regress/$1.ipf -N regress/$1.nat \ -i input/$1 >> results/$1; if [ $? -ne 0 ] ; then exit 2; fi echo "-------------------------------" >> results/$1 cmp expected/$1 results/$1 status=$? if [ $status = 0 ] ; then $TOUCH $1 fi ;; esac exit $status diff --git a/contrib/ipfilter/test/regress/bpf1 b/contrib/ipfilter/test/regress/bpf1 index 2c8028311a7e..5d83b77ed3ce 100644 --- a/contrib/ipfilter/test/regress/bpf1 +++ b/contrib/ipfilter/test/regress/bpf1 @@ -1,4 +1,4 @@ pass in bpf-v4 { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } -pass out bpf-v4 { "0x20 0 0 0xc 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } +pass out bpf-v4 { "src host 1.1.1.1" } pass in bpf-v4 { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } -pass out bpf-v4 { "0x20 0 0 0x10 0x15 0 0x1 0x1010101 0x6 0 0 0x60 0x6 0 0 0" } +pass out bpf-v4 { "dst host 1.1.1.1" } diff --git a/contrib/ipfilter/test/regress/f13 b/contrib/ipfilter/test/regress/f13 index f123e4781c86..8106419f3e08 100644 --- a/contrib/ipfilter/test/regress/f13 +++ b/contrib/ipfilter/test/regress/f13 @@ -1,6 +1,8 @@ pass in proto tcp from any to any port = 25 flags S/SA keep frags block in proto tcp from any to any port = 25 flags S/SA keep frags pass in proto udp from any to any port = 53 keep frags block in proto udp from any to any port = 53 keep frags pass in proto tcp from any to any port = 25 flags S/SA keep state keep frags block in proto tcp from any to any port = 25 flags S/SA keep state keep frags +pass in proto udp from any to any port = 53 keep frags(strict) +pass in proto tcp from any to any port = 25 keep state(strict) diff --git a/contrib/ipfilter/test/regress/f18 b/contrib/ipfilter/test/regress/f18 new file mode 100644 index 000000000000..acba2b33a813 --- /dev/null +++ b/contrib/ipfilter/test/regress/f18 @@ -0,0 +1,4 @@ +pass in from 1.1.1.1 to any +pass out from 2.2.2.2 to any +count in from 1.1.1.1 to 3.3.3.3 +count out from 2.2.2.2 to 4.4.4.4 diff --git a/contrib/ipfilter/test/regress/f19 b/contrib/ipfilter/test/regress/f19 new file mode 100644 index 000000000000..d7770b8a43e8 --- /dev/null +++ b/contrib/ipfilter/test/regress/f19 @@ -0,0 +1,2 @@ +pass in quick proto tcp all flags S keep state +pass in quick proto tcp all flags S keep state(limit 1) diff --git a/contrib/ipfilter/test/regress/f7 b/contrib/ipfilter/test/regress/f7 index 6848a688a374..be1b969c8ec2 100644 --- a/contrib/ipfilter/test/regress/f7 +++ b/contrib/ipfilter/test/regress/f7 @@ -1,6 +1,9 @@ block in proto icmp from any to any icmp-type echo pass in proto icmp from any to any icmp-type echo block in proto icmp from any to any icmp-type unreach code 3 pass in proto icmp from any to any icmp-type unreach code 3 block in proto icmp from any to any icmp-type echorep pass in proto icmp from any to any icmp-type echorep +pass in proto icmp all icmp-type maskreq keep state +pass in proto icmp all icmp-type timest keep state +pass in proto icmp all icmp-type inforeq keep state diff --git a/contrib/ipfilter/test/regress/i1 b/contrib/ipfilter/test/regress/i1 index df60d2beb5b0..c86c3208eded 100644 --- a/contrib/ipfilter/test/regress/i1 +++ b/contrib/ipfilter/test/regress/i1 @@ -1,16 +1,18 @@ pass in all block out \ all log in all log body in all count in from any to any pass in from !any to any block in from any to !any pass in on ed0 from localhost to localhost +pass in on ed0,vx0 from localhost to localhost block in log first on lo0 from any to any pass in log body quick from any to any block return-rst in quick on le0 proto tcp from any to any block return-icmp in on qe0 from any to any block return-icmp(1) in on qe0 from any to any +block return-icmp-as-dest in on le0 from any to any block return-icmp-as-dest(port-unr) in on qe0 from any to any pass out on longNICname0 from test.host.dots to test\.host.dots diff --git a/contrib/ipfilter/test/regress/i11 b/contrib/ipfilter/test/regress/i11 index 2999a8588b75..89b35898594b 100644 --- a/contrib/ipfilter/test/regress/i11 +++ b/contrib/ipfilter/test/regress/i11 @@ -1,8 +1,10 @@ pass in on ed0 proto tcp from localhost to localhost port = telnet keep state -block in log first on lo0 proto tcp/udp from any to any keep state +block in log first on lo0 proto tcp/udp from any to any port = echo keep state pass in proto udp from localhost to localhost port = 20499 keep frag +pass in proto udp from localhost to localhost port = 2049 keep frag(strict) pass in proto udp from localhost to localhost port = 53 keep state keep frags pass in on ed0 out-via vx0 proto udp from any to any keep state pass out on ppp0 in-via le0 proto tcp from any to any keep state +pass in on ed0,vx0 out-via vx0,ed0 proto udp from any to any keep state pass in proto tcp from any port gt 1024 to localhost port eq 1024 keep state pass in proto tcp all flags S keep state(strict,newisn,no-icmp-err,limit 101) diff --git a/contrib/ipfilter/test/regress/i12 b/contrib/ipfilter/test/regress/i12 index b8b2f3ea418e..5342702353e4 100644 --- a/contrib/ipfilter/test/regress/i12 +++ b/contrib/ipfilter/test/regress/i12 @@ -1,9 +1,10 @@ pass in from 1.1.1.1/32 to 2.2.2.2/32 pass in from (2.2.2.2/24,3.3.3.3/32) to 4.4.4.4/32 pass in from (2.2.2.2/24,3.3.3.3/32) to (5.5.5.5/32,6.6.6.6/32) pass in from (2.2.2.2/24,3.3.3.3/32) to (5.5.5.5/32,6.6.6.6/32) port = (22,25) -pass in proto tcp from (2.2.2.2/24,3.3.3.3/32) to (5.5.5.5/32,6.6.6.6/32) port = (53,9) +pass in proto tcp from (2.2.2.2/24,3.3.3.3/32) port = (53,9) to (5.5.5.5/32,6.6.6.6/32) pass in proto udp from (2.2.2.2/24,3.3.3.3/32) to (5.5.5.5/32,6.6.6.6/32) port = (53,9) pass in from 10.10.10.10 to 11.11.11.11 pass in from pool/101 to hash/202 pass in from hash/303 to pool/404 +pass in from pool=(!1.1.1.1,2.2.2.2,!2.2.0.0/16) to pool = ( 1.1.0.0/16 ) diff --git a/contrib/ipfilter/test/regress/i14 b/contrib/ipfilter/test/regress/i14 index 3c9d7b81d283..2cd26130640a 100644 --- a/contrib/ipfilter/test/regress/i14 +++ b/contrib/ipfilter/test/regress/i14 @@ -1,8 +1,10 @@ block in on eri0 all head 1 pass in on eri0 proto icmp all group 1 pass out on ed0 all head 1000000 block out on ed0 proto udp all group 1000000 block in on vm0 proto tcp/udp all head 101 pass in from 1.1.1.1 to 2.2.2.2 group 101 pass in proto tcp from 1.0.0.1 to 2.0.0.2 group 101 pass in proto udp from 2.0.0.2 to 3.0.0.3 group 101 +block in on vm0 proto tcp/udp all head vm0-group +pass in from 1.1.1.1 to 2.2.2.2 group vm0-group diff --git a/contrib/ipfilter/test/regress/i16 b/contrib/ipfilter/test/regress/i16 new file mode 100644 index 000000000000..5c9144a99257 --- /dev/null +++ b/contrib/ipfilter/test/regress/i16 @@ -0,0 +1,3 @@ +0 block out all +100 pass in all +10101 pass out proto tcp all diff --git a/contrib/ipfilter/test/regress/i17 b/contrib/ipfilter/test/regress/i17 new file mode 100644 index 000000000000..a995ae59f860 --- /dev/null +++ b/contrib/ipfilter/test/regress/i17 @@ -0,0 +1,11 @@ +100 pass in all +200 pass in proto tcp all +110 pass in proto udp all +110 pass in from localhost to any +pass in all +pass in from localhost to any +@0 100 pass in from localhost to any +@1 pass in from any to localhost +@0 pass in from 1.1.1.1 to any +@1 110 pass in from 2.2.2.2 to any +@2 pass in from 3.3.3.3 to any diff --git a/contrib/ipfilter/test/regress/i18 b/contrib/ipfilter/test/regress/i18 new file mode 100644 index 000000000000..c2845d1d6c2d --- /dev/null +++ b/contrib/ipfilter/test/regress/i18 @@ -0,0 +1,2 @@ +pass in tos (80,0x80,40) all +block in ttl (0,1,2,3,4,5,6) all diff --git a/contrib/ipfilter/test/regress/i19 b/contrib/ipfilter/test/regress/i19 new file mode 100644 index 000000000000..a09fd56c5104 --- /dev/null +++ b/contrib/ipfilter/test/regress/i19 @@ -0,0 +1,22 @@ +block in quick log level user.debug proto icmp all +block in quick log level mail.info proto icmp all +block in quick log level daemon.notice proto icmp all +block in quick log level auth.warn proto icmp all +block in quick log level syslog.err proto icmp all +block in quick log level lpr.crit proto icmp all +block in quick log level news.alert proto icmp all +block in quick log level uucp.emerg proto icmp all +block in quick log level cron.debug proto icmp all +block in quick log level ftp.info proto icmp all +block in quick log level authpriv.notice proto icmp all +block in quick log level logalert.warn proto icmp all +block in quick log level local0.err proto icmp all +block in quick log level local1.crit proto icmp all +block in quick log level local2.alert proto icmp all +block in quick log level local3.emerg proto icmp all +block in quick log level local4.debug proto icmp all +block in quick log level local5.info proto icmp all +block in quick log level local6.notice proto icmp all +block in quick log level local7.warn proto icmp all +block in quick log level kern.err proto icmp all +block in quick log level security.emerg proto icmp all diff --git a/contrib/ipfilter/test/regress/i2 b/contrib/ipfilter/test/regress/i2 index a3b9cd8ac522..50f610750bc2 100644 --- a/contrib/ipfilter/test/regress/i2 +++ b/contrib/ipfilter/test/regress/i2 @@ -1,7 +1,8 @@ log in proto tcp all pass in proto 6 from any to any pass in proto udp from localhost to localhost block in proto ipv6 from any to any block in proto 17 from any to any block in proto 250 from any to any pass in proto tcp/udp from any to any +block in proto tcp-udp from any to any diff --git a/contrib/ipfilter/test/regress/i20 b/contrib/ipfilter/test/regress/i20 new file mode 100644 index 000000000000..99039eeaf04c --- /dev/null +++ b/contrib/ipfilter/test/regress/i20 @@ -0,0 +1,4 @@ +pass in on ppp0 from ppp0/peer to ppp0/32 +block in on hme0 from any to hme0/broadcast +pass in on bge0 from bge0/network to bge0/32 +block in on eri0 from any to eri0/netmasked diff --git a/contrib/ipfilter/test/regress/i21 b/contrib/ipfilter/test/regress/i21 new file mode 100644 index 000000000000..bf797f953b70 --- /dev/null +++ b/contrib/ipfilter/test/regress/i21 @@ -0,0 +1,6 @@ +pass in from port = 10101 +pass out from any to port != 22 +block in from port 20:21 +block out from any to port 10 <> 100 +pass out from any to port = (3,5,7,9) +block in from port = (20,25) diff --git a/contrib/ipfilter/test/regress/i4 b/contrib/ipfilter/test/regress/i4 index 7170dc266e09..8551f7644915 100644 --- a/contrib/ipfilter/test/regress/i4 +++ b/contrib/ipfilter/test/regress/i4 @@ -1,8 +1,9 @@ log in proto tcp from any port > 0 to any log in proto tcp from any to any port > 0 pass in proto 6 from any port != 0 to any port 0 >< 65535 pass in proto 17 from localhost port > 32000 to localhost port < 29000 block in proto udp from any port != \ntp to any port < echo block in proto tcp from any port = smtp to any port > 25 pass in proto tcp/udp from any port 1 >< 3 to any port 1 <> 3 +pass in proto tcp/udp from any port 2:2 to any port 10:20 pass in log first quick proto tcp from any port > 1023 to any port = 1723 flags S keep state diff --git a/contrib/ipfilter/test/regress/i6 b/contrib/ipfilter/test/regress/i6 index 1a5308920a24..0b371bd3e761 100644 --- a/contrib/ipfilter/test/regress/i6 +++ b/contrib/ipfilter/test/regress/i6 @@ -1,10 +1,12 @@ pass in on lo0 fastroute from any to any pass in on lo0 to qe0 from localhost to localhost pass in on le0 to qe0:127.0.0.1 from localhost to localhost pass in on lo0 dup-to qe0 from localhost to localhost pass in on le0 dup-to qe0:127.0.0.1 from localhost to localhost pass in on le0 to hme0:10.1.1.1 dup-to qe0:127.0.0.1 from localhost to localhost block in quick on qe0 to qe1 from any to any block in quick to qe1 from any to any pass out quick dup-to hme0 from any to any +pass out quick on hme0 reply-to hme1 from any to any +pass in on le0 dup-to qe0:127.0.0.1 reply-to hme1:10.10.10.10 all pass in quick fastroute all diff --git a/contrib/ipfilter/test/regress/i7 b/contrib/ipfilter/test/regress/i7 index 4f3328d06a50..1a82940c6c86 100644 --- a/contrib/ipfilter/test/regress/i7 +++ b/contrib/ipfilter/test/regress/i7 @@ -1,4 +1,9 @@ pass in on ed0 proto tcp from localhost to localhost port = 23 flags S/SA block in on lo0 proto tcp from any to any flags A pass in on lo0 proto tcp from any to any flags /SAP block in on lo0 proto tcp from any to any flags 0x80/A +pass in on lo0 proto tcp from any to any flags S/18 +block in on lo0 proto tcp from any to any flags 2/18 +pass in on lo0 proto tcp from any to any flags 2 +block in on lo0 proto tcp from any to any flags /16 +pass in on lo0 proto tcp from any to any flags 2/SA diff --git a/contrib/ipfilter/test/regress/i8 b/contrib/ipfilter/test/regress/i8 index bde6ed52900e..cc984b275cd2 100644 --- a/contrib/ipfilter/test/regress/i8 +++ b/contrib/ipfilter/test/regress/i8 @@ -1,2 +1,31 @@ pass in proto icmp from localhost to localhost icmp-type timest block in proto icmp from any to any icmp-type unreach code 1 +pass in proto icmp all icmp-type unreach code cutoff-preced +pass in proto icmp all icmp-type unreach code filter-prohib +pass in proto icmp all icmp-type unreach code isolate +pass in proto icmp all icmp-type unreach code needfrag +pass in proto icmp all icmp-type unreach code net-prohib +pass in proto icmp all icmp-type unreach code net-tos +pass in proto icmp all icmp-type unreach code host-preced +pass in proto icmp all icmp-type unreach code host-prohib +pass in proto icmp all icmp-type unreach code host-tos +pass in proto icmp all icmp-type unreach code host-unk +pass in proto icmp all icmp-type unreach code host-unr +pass in proto icmp all icmp-type unreach code (net-unk,net-unr) +pass in proto icmp all icmp-type unreach code port-unr +pass in proto icmp all icmp-type unreach code proto-unr +pass in proto icmp all icmp-type unreach code srcfail +pass in proto icmp all icmp-type (echo,echorep) +pass in proto icmp all icmp-type inforeq +pass in proto icmp all icmp-type inforep +pass in proto icmp all icmp-type maskrep +pass in proto icmp all icmp-type maskreq +pass in proto icmp all icmp-type paramprob +pass in proto icmp all icmp-type redir +pass in proto icmp all icmp-type unreach +pass in proto icmp all icmp-type routerad +pass in proto icmp all icmp-type routersol +pass in proto icmp all icmp-type squench +pass in proto icmp all icmp-type timest +pass in proto icmp all icmp-type timestrep +pass in proto icmp all icmp-type timex diff --git a/contrib/ipfilter/test/regress/i9 b/contrib/ipfilter/test/regress/i9 index 2b8fb103324a..a966bed72f8a 100644 --- a/contrib/ipfilter/test/regress/i9 +++ b/contrib/ipfilter/test/regress/i9 @@ -1,7 +1,12 @@ pass in from localhost to localhost with short,frags block in from any to any with ipopts pass in from any to any with opt nop,rr,zsu pass in from any to any with opt nop,rr,zsu not opt ssrr,lsrr -pass in from localhost to localhost with not frag +pass in from localhost to localhost and not frag +pass in from localhost to localhost with frags,frag-body pass in proto tcp all flags S with not oow keep state pass in proto tcp all flags S with not bad,bad-src,bad-nat +block in quick all with not nat +block in quick all with not lowttl +pass in all with mbcast,not bcast,multicast,not state +pass in from any to any with opt mtur,mtup,encode,ts,tr,sec,cipso,satid,ssrr,visa,imitd,eip,finn,dps,sdb,nsapa,rtralrt,ump,addext,e-sec diff --git a/contrib/ipfilter/test/regress/in1 b/contrib/ipfilter/test/regress/in1 index 145e3d038861..163d834fb1c1 100644 --- a/contrib/ipfilter/test/regress/in1 +++ b/contrib/ipfilter/test/regress/in1 @@ -1,27 +1,30 @@ map le0 0/0 -> 0/32 map le0 1/32 -> 1/32 map le0 128.0.0.0/1 -> 0/0 map le0 10.0.0.0/8 -> 1.2.3.0/24 map le0 10.0.0.5/8 -> 1.2.3.4/24 +map le0 10.0.0.5/0xff000000 -> 1.2.3.4/24 +map le0 10.0.0.5/0xff -> 1.2.3.4/24 map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 map ppp0 192.168.0.0/16 -> 0/32 portmap udp 20000:29999 map ppp0 192.168.0.0/16 -> 0/32 portmap tcp/udp 30000:39999 map ppp0 192.168.0.0/16 -> 0/32 portmap tcp auto map ppp0 192.168.0.0/16 -> 0/32 portmap udp auto -map ppp0 192.168.0.0/16 -> 0/32 portmap tcp/udp auto -map ppp0 192.168.0.0/16 -> 0/32 proxy port ftp ftp/tcp +map ppp0 192.168.0.0/16 -> 0/32 portmap tcpudp auto +map ppp0 192.168.0.0/16 -> 0/32 proxy port ftp ftp/6 map ppp0 192.168.0.0/16 -> 0/32 proxy port 1010 ftp/tcp map le0 0/0 -> 0/32 frag map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 frag map ppp0 192.168.0.0/16 -> 0/32 proxy port ftp ftp/tcp frag map le0 0/0 -> 0/32 age 10 map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 age 10/20 map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 age 30 map le0 0/0 -> 0/32 frag age 10 map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 frag age 10/20 map ppp0 192.168.0.0/16 -> 0/32 portmap tcp 10000:19999 frag age 30 map fxp0 from 192.168.0.0/18 to 0/0 port = 21 -> 1.2.3.4/32 proxy port 21 ftp/tcp map thisisalonginte 0/0 -> 0/32 mssclamp 1452 tag freddyliveshere map bar0 0/0 -> 0/32 icmpidmap icmp 1000:2000 +map ppp0,adsl0 0/0 -> 0/32 diff --git a/contrib/ipfilter/test/regress/in2 b/contrib/ipfilter/test/regress/in2 index 222a28cfeca8..4a86de736ce4 100644 --- a/contrib/ipfilter/test/regress/in2 +++ b/contrib/ipfilter/test/regress/in2 @@ -1,67 +1,71 @@ rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 tcp rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp rdr le0 9.8.7.6/32 -> 1.1.1.1 ip +rdr le0 9.8.7.6/0xff000000 -> 1.1.1.1 ip +rdr le0 9.8.7.6/0xffff0000 -> 1.1.1.1 ip rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp +rdr le0 9.8.7.6/32 port 80 -> 0/0 port 80 tcp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 udp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp/udp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag -rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag +rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcpudp frag rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag rdr le0 9.8.7.6/32 -> 1.1.1.1 ip frag age 10 rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40 rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip sticky rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10 sticky rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20 sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10 sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20 sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30 sticky rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40 sticky rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip mssclamp 1000 rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40 sticky mssclamp 1000 rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip tag nattagcacheline rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10 sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 0 -> 1.1.1.1 port 0 ip frag age 10/20 sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 icmp frag age 10 sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp frag age 20 sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1 port 80 tcp round-robin frag age 30 sticky mssclamp 1000 tag nattagcacheline rdr le0 9.8.7.6/32 port 80 -> 1.1.1.1,1.1.1.2 port 80 tcp round-robin frag age 40 sticky mssclamp 1000 tag nattagcacheline rdr ge0 9.8.7.6/32 -> 1.1.1.1 proxy port 21 ftp/tcp rdr ge0 9.8.7.6/32 port 21 -> 1.1.1.1 port 21 tcp proxy ftp rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1 port 5555 tcp rdr le0 9.8.7.6/32 port 1000-2000 -> 1.1.1.1 port = 5555 tcp rdr le0 0/0 -> test.host.dots rdr le0 0/0 -> test.host.dots,test.host.dots +rdr adsl0,ppp0 0/0 port 25 -> 127.0.0.1 port 25 diff --git a/contrib/ipfilter/test/regress/in5 b/contrib/ipfilter/test/regress/in5 index d0a115c8b327..c539b03f3e5d 100644 --- a/contrib/ipfilter/test/regress/in5 +++ b/contrib/ipfilter/test/regress/in5 @@ -1,22 +1,23 @@ +map le0 from 9.8.7.6/32 port > 1024 to any -> 1.1.1.1 portmap 10000:20000 tcp rdr le0 from any to 9.8.7.6/32 port = 0 -> 1.1.1.1 port 0 tcp -rdr le0 from any to 9.8.7.6/32 port = 0 -> 1.1.1.1 port 0 ip -rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp -rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 ip -rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp -rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 udp +rdr le0 from any to 9.8.7.6/0xffffffff port = 0 -> 1.1.1.1 port 0 ip +rdr le0 from any to 9.8.7.6 port = 8888 -> 1.1.1.1 port 888 tcp +rdr le0 from any to 9.8.7.6/255.255.255.255 port = 8888 -> 1.1.1.1 port 888 ip +rdr le0 from any to 9.8.7.6 mask 0xffffffff port = 8888 -> 1.1.1.1 port 888 tcp +rdr le0 from any to 9.8.7.6 mask 255.255.255.255 port = 8888 -> 1.1.1.1 port 888 udp rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp/udp rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 port 888 icmp rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 port 0 ip frag rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 icmp frag rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin frag rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag rdr le0 from any to 9.8.7.6/32 -> 1.1.1.1 port 0 ip frag age 10 rdr le0 from any to 9.8.7.6/32 port = 0 -> 1.1.1.1 port 0 ip frag age 10/20 rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 icmp frag age 10 rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp frag age 20 rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1 port 888 tcp round-robin frag age 30 rdr le0 from any to 9.8.7.6/32 port = 8888 -> 1.1.1.1,1.1.1.2 port 888 tcp round-robin frag age 40 diff --git a/contrib/ipfilter/test/regress/in6 b/contrib/ipfilter/test/regress/in6 index 694879945f04..932df9b23676 100644 --- a/contrib/ipfilter/test/regress/in6 +++ b/contrib/ipfilter/test/regress/in6 @@ -1,3 +1,7 @@ map foo0 from any port = 1 to any port != 0 -> 0/32 udp +map foo0 from any port eq 1 to any port ne 0 -> 0/32 udp map foo0 from any port < 1 to any port > 0 -> 0/32 tcp +map foo0 from any port lt 1 to any port gt 0 -> 0/32 tcp map foo0 from any port <= 1 to any port >= 0 -> 0/32 tcp/udp +map foo0 from any port le 1 to any port ge 0 -> 0/32 tcp/udp +map foo0 from any port 1 >< 20 to any port 20 <> 40 -> 0/32 tcp/udp diff --git a/contrib/ipfilter/test/regress/n13 b/contrib/ipfilter/test/regress/n13 new file mode 100644 index 000000000000..804793004050 --- /dev/null +++ b/contrib/ipfilter/test/regress/n13 @@ -0,0 +1 @@ +map le0 192.168.0.0/16 -> range 203.1.1.23-203.1.3.45 diff --git a/contrib/ipfilter/test/regress/n14 b/contrib/ipfilter/test/regress/n14 new file mode 100644 index 000000000000..6f5d571d606e --- /dev/null +++ b/contrib/ipfilter/test/regress/n14 @@ -0,0 +1 @@ +rdr gre0 0/0 port 80 -> 10.1.1.254,10.1.1.253 port 80 tcp sticky diff --git a/contrib/ipfilter/test/regress/ni17.nat b/contrib/ipfilter/test/regress/ni17.nat new file mode 100644 index 000000000000..3da63383a7b8 --- /dev/null +++ b/contrib/ipfilter/test/regress/ni17.nat @@ -0,0 +1,4 @@ +rdr le0 0/0 port 80 -> 10.1.1.252 port 3128 tcp round-robin +rdr le0 0/0 port 80 -> 10.1.2.252 port 3128 tcp round-robin +rdr le0 0/0 port 80 -> 10.1.3.252 port 3128 tcp round-robin sticky +rdr le0 0/0 port 80 -> 10.1.1.253,10.1.2.253 port 3128 tcp round-robin sticky diff --git a/contrib/ipfilter/test/regress/p2.ipf b/contrib/ipfilter/test/regress/p2.ipf index 5b58647eab5b..4cfb388e82d6 100644 --- a/contrib/ipfilter/test/regress/p2.ipf +++ b/contrib/ipfilter/test/regress/p2.ipf @@ -1 +1,2 @@ pass out from hash=(127.0.0.1,4.4.0.0/16) to any +block in from hash=(127.0.0.1,4.4.0.0/16) to any diff --git a/contrib/ipfilter/test/test.format b/contrib/ipfilter/test/test.format index 090c8a983d0a..f284542201e6 100644 --- a/contrib/ipfilter/test/test.format +++ b/contrib/ipfilter/test/test.format @@ -1,77 +1,87 @@ #test input-format output-format bpf-f1 text text -bpf1 text text +bpf1 text ipf f1 text text f2 text text f3 text text f4 text text f5 text text f6 text text f7 text text f8 text text f9 text text f10 text text f11 text text f12 hex hex f13 hex hex f14 text text f15 text text f16 text text f17 hex hex -i1 text text -i2 text text -i3 text text -i4 text text -i5 text text -i6 text text -i7 text text -i8 text text -i9 text text -i10 text text -i11 text text -i12 text text -i13 text text -i14 text text -i15 text text +f18 text text +f19 text text fr_statemax=3 +i1 text ipf +i2 text ipf +i3 text ipf +i4 text ipf +i5 text ipf +i6 text ipf +i7 text ipf +i8 text ipf +i9 text ipf +i10 text ipf +i11 text ipf +i12 text ipf +i13 text ipf +i14 text ipf +i15 text ipf +i16 text ipf +i17 text ipftest +i18 text ipf +i19 text ipf +i20 text ipf +i21 text ipf in1 text text in2 text text in3 text text in4 text text in5 text text in6 text text ip1 text text ipv6.1 hex hex ipv6.2 hex hex ipv6.3 hex hex l1 hex hex n1 text text n2 text text n3 text text n4 text text n5 text text n6 text text n7 text text n8 hex hex fr_update_ipid=0 n9 hex hex fr_update_ipid=0 n10 hex hex fr_update_ipid=0 n11 text text n12 hex hex fr_update_ipid=0 +n13 text text +n14 text text ni1 hex hex fr_update_ipid=1 ni2 hex hex fr_update_ipid=1 ni3 hex hex fr_update_ipid=1 ni4 hex hex fr_update_ipid=1 ni5 hex hex fr_update_ipid=1 ni6 hex hex fr_update_ipid=1 ni7 hex hex fr_update_ipid=1 ni8 hex hex fr_update_ipid=1 ni9 hex hex fr_update_ipid=1 ni10 hex hex fr_update_ipid=1 ni11 hex hex fr_update_ipid=1 ni12 hex hex fr_update_ipid=1 ni13 hex hex fr_update_ipid=1 ni14 hex hex fr_update_ipid=1 ni15 hex hex fr_update_ipid=1 ni16 hex hex fr_update_ipid=1 p1 text text p2 text text p3 text text diff --git a/contrib/ipfilter/test/vfycksum.pl b/contrib/ipfilter/test/vfycksum.pl index 9cb47f651d6f..d23c88430f5a 100755 --- a/contrib/ipfilter/test/vfycksum.pl +++ b/contrib/ipfilter/test/vfycksum.pl @@ -1,289 +1,298 @@ # # validate the IPv4 header checksum. # $bytes[] is an array of 16bit values, with $cnt elements in the array. # +sub dump { + print "\n"; + for ($i = 0; $i < $#bytes; $i++) { + printf "%04x ", $bytes[$i]; + } + print "\n"; +} + sub dosum { local($seed) = $_[0]; local($start) = $_[1]; local($max) = $_[2]; local($idx) = $start; local($lsum) = $seed; for ($idx = $start, $lsum = $seed; $idx < $max; $idx++) { $lsum += $bytes[$idx]; } while ($lsum > 65535) { $lsum = ($lsum & 0xffff) + ($lsum >> 16); } $lsum = ~$lsum & 0xffff; return $lsum; } sub ipv4check { local($base) = $_[0]; $hl = $bytes[$base] / 256; return if (($hl >> 4) != 4); # IPv4 ? $hl &= 0xf; $hl <<= 1; # get the header length in 16bit words $hs = &dosum(0, $base, $base + $hl); $osum = $bytes[$base + 5]; if ($hs != 0) { $bytes[$base + 5] = 0; $hs2 = &dosum($base, 0, $base + $hl); $bytes[$base + 5] = $osum; printf " IP: (%x) %x != %x", $hs, $osum, $hs2; } else { print " IP($base): ok "; } # # Recognise TCP & UDP and calculate checksums for each of these. # if (($bytes[$base + 4] & 0xff) == 6) { &tcpcheck($base); } if (($bytes[$base + 4] & 0xff) == 17) { &udpcheck($base); } if (($bytes[$base + 4] & 0xff) == 1) { &icmpcheck($base); } if ($base == 0) { print "\n"; } } sub tcpcheck { local($base) = $_[0]; local($hl) = $bytes[$base] / 256; return if (($hl >> 4) != 4); return if ($bytes[$base + 3] & 0x1fff); $hl &= 0xf; $hl <<= 1; local($hs2); local($hs) = 6; # TCP local($len) = $bytes[$base + 1] - ($hl << 1); $hs += $len; $hs += $bytes[$base + 6]; # source address $hs += $bytes[$base + 7]; $hs += $bytes[$base + 8]; # destination address $hs += $bytes[$base + 9]; local($tcpsum) = $hs; local($thl) = $bytes[$base + $hl + 6] >> 8; $thl &= 0xf0; $thl >>= 2; $x = $bytes[$base + 1]; $y = ($cnt - $base) * 2; $z = 0; if ($bytes[$base + 1] > ($cnt - $base) * 2) { print "[cnt=$cnt base=$base]"; $x = $bytes[$base + 1]; $y = ($cnt - $base) * 2; $z = 1; } elsif (($cnt - $base) * 2 < $hl + 20) { $x = ($cnt - $base) * 2; $y = $hl + 20; $z = 2; } elsif (($cnt - $base) * 2 < $hl + $thl) { $x = ($cnt - $base) * 2; $y = $hl + $thl; $z = 3; } if ($z) { - print " TCP: missing data($x $y $z)"; + print " TCP: missing data($x $y $z) $hl"; +# &dump(); return; } local($tcpat) = $base + $hl; $hs = &dosum($tcpsum, $tcpat, $cnt); if ($hs != 0) { local($osum) = $bytes[$tcpat + 8]; $bytes[$base + $hl + 8] = 0; $hs2 = &dosum($tcpsum, $tcpat, $cnt); $bytes[$tcpat + 8] = $osum; printf " TCP: (%x) %x != %x", $hs, $osum, $hs2; } else { print " TCP: ok ($x $y)"; } } sub udpcheck { local($base) = $_[0]; local($hl) = $bytes[0] / 256; return if (($hl >> 4) != 4); return if ($bytes[3] & 0x1fff); $hl &= 0xf; $hl <<= 1; local($hs2); local($hs) = 17; # UDP local($len) = $bytes[$base + 1] - ($hl << 1); $hs += $len; $hs += $bytes[$base + 6]; # source address $hs += $bytes[$base + 7]; $hs += $bytes[$base + 8]; # destination address $hs += $bytes[$base + 9]; local($udpsum) = $hs; if ($bytes[$base + 1] > ($cnt - $base) * 2) { print " UDP: missing data(1)"; return; } elsif ($bytes[$base + 1] < ($hl << 1) + 8) { print " UDP: missing data(2)"; return; } elsif (($cnt - $base) * 2 < ($hl << 1) + 8) { print " UDP: missing data(3)"; return; } local($udpat) = $base + $hl; $hs = &dosum($udpsum, $udpat, $cnt); local($osum) = $bytes[$udpat + 3]; # # It is valid for UDP packets to have a 0 checksum field. # If it is 0, then display what it would otherwise be. # if ($osum == 0) { printf " UDP: => %x", $hs; } elsif ($hs != 0) { $bytes[$udpat + 3] = 0; $hs2 = &dosum($udpsum, $udpat, $cnt); $bytes[$udpat + 3] = $osum; printf " UDP: (%x) %x != %x", $hs, $osum, $hs2; } else { print " UDP: ok"; } } sub icmpcheck { local($base) = $_[0]; local($hl) = $bytes[$base + 0] / 256; return if (($hl >> 4) != 4); return if ($bytes[3] & 0x1fff); $hl &= 0xf; $hl <<= 1; local($hs); local($hs2); local($len) = $bytes[$base + 1] - ($hl << 1); if ($bytes[$base + 1] > ($cnt - $base) * 2) { print " ICMP: missing data(1)"; return; } elsif ($bytes[$base + 1] < ($hl << 1) + 8) { print " ICMP: missing data(2)"; return; } elsif (($cnt - $base) * 2 < ($hl << 1) + 8) { print " ICMP: missing data(3)"; return; } local($osum) = $bytes[$base + $hl + 1]; $bytes[$hl + 1] = 0; for ($i = $base + $hl, $hs2 = 0; $i < $cnt; $i++) { $hs2 += $bytes[$i]; } $hs = $hs2 + $osum; while ($hs2 > 65535) { $hs2 = ($hs2 & 0xffff) + ($hs2 >> 16); } while ($hs > 65535) { $hs = ($hs & 0xffff) + ($hs >> 16); } $hs2 = ~$hs2 & 0xffff; $hs = ~$hs & 0xffff; if ($osum != $hs2) { printf " ICMP: (%x) %x != %x", $hs, $osum, $hs2; } else { print " ICMP: ok"; } if ($base == 0) { $type = $bytes[$hl] >> 8; if ($type == 3 || $type == 4 || $type == 5 || $type == 11 || $type == 12) { &ipv4check($hl + 4); } } } while ($#ARGV >= 0) { open(I, "$ARGV[0]") || die $!; print "--- $ARGV[0] ---\n"; $multi = 0; while () { chop; s/#.*//g; # # If the first non-comment, non-empty line of input starts # with a '[', then allow the input to be a multi-line hex # string, otherwise it has to be all on one line. # if (/^\[/) { $multi=1; s/^\[[^]]*\]//g; } s/^ *//g; if (length == 0) { next if ($cnt == 0); &ipv4check(0); $cnt = 0; $multi = 0; next; } # # look for 16 bits, represented with leading 0's as required, # in hex. # s/\t/ /g; while (/^[0-9a-fA-F][0-9a-fA-F] [0-9a-fA-F][0-9a-fA-F] .*/) { s/^([0-9a-fA-F][0-9a-fA-F]) ([0-9a-fA-F][0-9a-fA-F]) (.*)/$1$2 $3/; } while (/.* [0-9a-fA-F][0-9a-fA-F] [0-9a-fA-F][0-9a-fA-F] .*/) { $b=$_; s/(.*?) ([0-9a-fA-F][0-9a-fA-F]) ([0-9a-fA-F][0-9a-fA-F]) (.*)/$1 $2$3 $4/g; } while (/^[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F].*/) { $x = $_; $x =~ s/([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]).*/$1/; $x =~ s/ *//g; $y = hex $x; s/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F] *(.*)/$1/; $bytes[$cnt] = $y; #print "bytes[$cnt] = $x\n"; $cnt++; } # # Pick up stragler bytes. # if (/^[0-9a-fA-F][0-9a-fA-F]/) { $y = hex $_; $bytes[$cnt++] = $y * 256; } if ($multi == 0 && $cnt > 0) { &ipv4check(0); $cnt = 0; } } if ($cnt > 0) { &ipv4check(0); } close(I); shift(@ARGV); }