-# ===============================================================
-# ipcalc rewrite
-# ===============================================================
-
-gen_ipt_string() {
-eval `echo $1 | awk -F\/ '{printf "IP=%s; CIDRMASK=%s; \n", $1, $2}'`
-
-MASK_FULL_OCTETS=$(($CIDRMASK/8))
-MASK_PART_OCTETS=$(($CIDRMASK%8))
-for i in `seq 0 3`; do
- if [ "$i" -lt "$MASK_FULL_OCTETS" ]; then
- MASK+="255"
- elif [ "$i" -eq "$MASK_FULL_OCTETS" ]; then
- MASK+=$((256 - 2**(8-$MASK_PART_OCTETS)))
- else
- MASK+="0"
- fi
- [ "$i" -lt "3" ] && MASK+="."
-done
-
-eval `echo $IP | awk -F\. '{printf "IPBYTE1=%s; IPBYTE2=%s; IPBYTE3=%s; IPBYTE4=%s; \n", $1, $2, $3, $4}'`
-eval `echo $MASK | awk -F\. '{printf "MASKBYTE1=%s; MASKBYTE2=%s; MASKBYTE3=%s; MASKBYTE4=%s; \n", $1, $2, $3, $4}'`
-
-IPT_STRING="$(($IPBYTE1 & $MASKBYTE1))_$(($IPBYTE2 & $MASKBYTE2))_$(($IPBYTE3 & $MASKBYTE3))_$(($IPBYTE4 & $MASKBYTE4))_$CIDRMASK"
-echo $IPT_STRING
-}
-