2 #include INTEL_LICENSE.txt
4 ########################################################################
8 ########################################################################
12 # The Enable_POD function is passed the IP_SUBNET, IP_MASK and HASH and
13 # does all the dirty muching about with syscontrols
17 # May 17, 2003 - Paul Brett <paul.brett@intel.com>
18 # Initial version based on the work of
19 # Robert Adams <robert.adams@intel.com> and EMULAB
24 local SYSCTL=/sbin/sysctl
30 # Grotesque sed/awk converts IP addrs into an integer for sysctl
31 local IPODHOST=`echo $IP_SUBNET | \
32 sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \2 \3 \4/' | \
33 awk '{ printf "%d\n", $1*16777216+$2*65536+$3*256+$4 }'`
34 local IPODMASK=`echo $IP_MASK | \
35 sed -e 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1 \2 \3 \4/' | \
36 awk '{ printf "%d\n", $1*16777216+$2*65536+$3*256+$4 }'`
37 local IPODKEY=`echo $HASH | \
38 sed -e 's/\(.*\)/\1/'`
40 # figure out the version
41 local version=`$SYSCTL net.ipv4.icmp_ipod_version 2>/dev/null`
42 if [[ "$version" == "" ]]
44 $SYSCTL net.ipv4.icmp_ipod_enabled >/dev/null 2>&1
61 $SYSCTL -w net.ipv4.icmp_ipod_host=$IPODHOST >/dev/null
62 $SYSCTL -w net.ipv4.icmp_ipod_enabled=1 >/dev/null
66 $SYSCTL -w net.ipv4.icmp_ipod_host=$IPODHOST >/dev/null
68 $SYSCTL -w net.ipv4.icmp_ipod_mask=$IPODMASK >/dev/null
69 $SYSCTL -w net.ipv4.icmp_ipod_key=$IPODKEY >/dev/null
70 $SYSCTL -w net.ipv4.icmp_ipod_enabled=1 >/dev/null