diff options
author | cy <cy@FreeBSD.org> | 2013-09-21 14:23:20 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2013-09-21 14:23:20 +0000 |
commit | 1f79bda80fc99a9bea37dc83f80019be39c33c5a (patch) | |
tree | 3915c70585141494037a8c4fd909db7ea85a2aac /contrib/ipfilter/BSD/kupgrade | |
parent | b3f0452e3485d31d295010234a8951b1129a6f0b (diff) | |
download | FreeBSD-src-1f79bda80fc99a9bea37dc83f80019be39c33c5a.zip FreeBSD-src-1f79bda80fc99a9bea37dc83f80019be39c33c5a.tar.gz |
Remove redundant files.
Approved by: glebius (mentor)
Approved by: re (blanket)
Diffstat (limited to 'contrib/ipfilter/BSD/kupgrade')
-rw-r--r-- | contrib/ipfilter/BSD/kupgrade | 312 |
1 files changed, 0 insertions, 312 deletions
diff --git a/contrib/ipfilter/BSD/kupgrade b/contrib/ipfilter/BSD/kupgrade deleted file mode 100644 index 30df454..0000000 --- a/contrib/ipfilter/BSD/kupgrade +++ /dev/null @@ -1,312 +0,0 @@ -#!/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 -mkdir -m 755 -p $ipfdir/../net -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 "Trying to build ip_rules.c and ip_rules.h" - make ip_rules.c - 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 -fi - -echo -n "Installing into $ipfdir" -for j in auth frag nat proxy scan state sync pool dstlist htable lookup rules \ - dstlist; 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 -echo -n " net/radix_ipf.h" -cp radix_ipf.h $ipfdir -chmod 644 $ipfdir/radix_ipf.h -echo -n " radix_ipf.c -> $ipfdir/radix_ipf.c" -cp radix_ipf.c $ipfdir/radix_ipf.c -chmod 644 $ipfdir/radix_ipf.c - -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_nat6.c ip_fil.h fil.c ip_log.c ip_compat.h ipl.h ip_*_pxy.c \ - ip_fil_compat.c ipf_rb.h; 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 dstlist \ - 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 ipf_rb.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 dstlist 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_fil_compat.c files >/dev/null 2>&1 - if [ $? -ne 0 ] ; then - echo 'contrib/ipfilter/netinet/ip_fil_compat.c optional ipfilter inet ipfilter_compat' >> files - fi - grep ip_sync.c files >/dev/null 2>&1 - if [ $? -ne 0 ] ; then - echo 'contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet' >> 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 - if [ -f /sys/netinet/files.ipfilter ] ; then - if ! grep -q ip_fil_compat.c /sys/netinet/files.ipfilter; then - echo 'file dist/ipf/netinet/ip_fil_compat.c ipfilter & ipfilter_compat' >> /sys/netinet/files.ipfilter - echo 'defflag opt_ipfilter.h IPFILTER_COMPAT' >> /sys/netinet/files.ipfilter - fi - fi - 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 dstlist 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' >> 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 dstlist 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_fil_compat.c files >/dev/null 2>&1 - if [ $? -ne 0 ] ; then - echo 'file netinet/ip_fil_compat.c ipfilter & ipfilter_compat' >> files - fi - if [ $? -ne 0 ] ; then - echo 'file netinet/ip_sync.c ipfilter' >> 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_nat6.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_dstlist.c ip_htable.c \\ -! ip_sync.c ip_scan.c ip_rules.c ip_fil_compat.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 - -CONF=/sys/netinet/files.ipfilter -if [ -f $CONF -a $os = NetBSD ] ; then - for i in ip_nat6.c ip_dstlist.c radix_ipf.c; do - echo "Checking for $i in $CONF" - grep $i $CONF >/dev/null 2>&1 - if [ $? -ne 0 ] ; then - echo "Adding $i to $CONF" - sed -n -e /ip_nat.c/s/ip_nat.c/$i/p $CONF >> $CONF - fi - done -fi - -CONF=/sys/conf/files -if [ -f $CONF -a $os = FreeBSD ] ; then - for i in ip_nat6.c ip_dstlist.c radix_ipf.c; do - echo "Checking for $i in $CONF" - grep $i $CONF >/dev/null 2>&1 - if [ $? -ne 0 ] ; then - echo "Adding $i to $CONF" - sed -n -e /ip_nat.c/,/NORMAL/p $CONF | \ - sed -e s/ip_nat.c/$i/p >> $CONF - fi - done -fi -exit 0 |