X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=enable_pod.sh;fp=enable_pod.sh;h=0000000000000000000000000000000000000000;hb=de93115ab4922bad8986ca891a1f71eb7176b2b9;hp=e48c91bd71dc853b347737662118d0ba152d10fb;hpb=b78b4a0b9256d477c3bdb70693a66de3da3865d2;p=pingofdeath.git diff --git a/enable_pod.sh b/enable_pod.sh deleted file mode 100755 index e48c91b..0000000 --- a/enable_pod.sh +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/bash -#include INTEL_LICENSE.txt -# -######################################################################## -# -# Enable Ping Of Death -# -######################################################################## -# -# DESCRIPTION -# -# The Enable_POD function is passed the IP_SUBNET, IP_MASK and HASH and -# does all the dirty muching about with syscontrols -# -# HISTORY -# -# May 17, 2003 - Paul Brett -# Initial version based on the work of -# Robert Adams and EMULAB -# - -function enable_pod() -{ - local SYSCTL=/sbin/sysctl - - local IP_SUBNET=$1 - local IP_MASK=$2 - local IP_HASH=$3 - - # Grotesque sed/awk converts IP addrs into an integer for sysctl - local IPODHOST=`echo $IP_SUBNET | \ - sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \2 \3 \4/' | \ - awk '{ printf "%d\n", $1*16777216+$2*65536+$3*256+$4 }'` - local IPODMASK=`echo $IP_MASK | \ - sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \2 \3 \4/' | \ - awk '{ printf "%d\n", $1*16777216+$2*65536+$3*256+$4 }'` - local IPODKEY=`echo $HASH | \ - sed -e 's/\(.*\)/\1/'` - - # figure out the version - local version=`$SYSCTL net.ipv4.icmp_ipod_version 2>/dev/null` - if [[ "$version" == "" ]] - then - $SYSCTL net.ipv4.icmp_ipod_enabled >/dev/null 2>&1 - case $? in - 0) - version=1 - ;; - *) - version=0 - ;; - esac - fi - - # enable if possible - case $version in - 0) - return 1 - ;; - 1) - $SYSCTL -w net.ipv4.icmp_ipod_host=$IPODHOST >/dev/null - $SYSCTL -w net.ipv4.icmp_ipod_enabled=1 >/dev/null - Success=0 - ;; - *) - $SYSCTL -w net.ipv4.icmp_ipod_host=$IPODHOST >/dev/null - Success=$? - $SYSCTL -w net.ipv4.icmp_ipod_mask=$IPODMASK >/dev/null - $SYSCTL -w net.ipv4.icmp_ipod_key=$IPODKEY >/dev/null - $SYSCTL -w net.ipv4.icmp_ipod_enabled=1 >/dev/null - ;; - esac - return $Success -} - -