Commit 64398f3b authored by Joanne Hugé's avatar Joanne Hugé

Use ip addresses from hosts file

parent b63671b2
......@@ -13,7 +13,7 @@ interval=100000
# Default options
client_options="-a -p 99 -f eth0"
qdisc_options=""
ip="192.168.17."
ip="10.100.21."
etf_offset=500
while getopts "bd:e:o:ghi:ptT:G" opt; do
......@@ -66,21 +66,17 @@ done
shift $((OPTIND-1))
if [ -n "$1" ]; then
if [ "$1" == "emerald" ]; then
ip+="3"
elif [ "$1" == "slate" ]; then
ip+="2"
elif [ "$1" == "onyx" ]; then
ip+="4"
else
usage
exit 1
fi
else
ip+="25"
if [ -z "$1" ]; then
usage
fi
board_name=$1
if [ $board_name != "emerald" ] && [ $board_name != "onyx" ] && [ $board_name != "slate" ]; then
usage
fi
board_ip=$(cat /etc/hosts | grep $board_name | awk '{print $1}')
if [ -z "${use_etf}" ] && [ -z "${use_pfast}" ]; then
usage
fi
......@@ -117,10 +113,10 @@ make client;
cd $script_dir;
if [ -z "${use_histogram}" ]; then
echo "client $client_options $ip";
$script_dir/../packet-exchange/build/client $client_options $ip;
echo "client $client_options $board_ip";
$script_dir/../packet-exchange/build/client $client_options $board_ip;
else
echo "client $client_options $ip > $output;mv $output ~/";
$script_dir/../packet-exchange/build/client $client_options $ip > $output;
echo "client $client_options $board_ip > $output;mv $output ~/";
$script_dir/../packet-exchange/build/client $client_options $board_ip > $output;
mv $output ~/;
fi
......@@ -9,14 +9,14 @@ usage() {
# Default options
server_options="-a -p 99 -f eth0"
ip="192.168.17."
ip="10.100.21."
tcpdump_interval=1000000
while getopts "b:htd:i:g:T:G" opt; do
case "${opt}" in
b )
use_rtt=1
board=${OPTARG}
board_name=${OPTARG}
;;
d )
use_tcpdump=1
......@@ -51,18 +51,13 @@ done
shift $((OPTIND-1))
if [ -n "${use_rtt}" ]; then
if [ "$board" == "emerald" ]; then
ip+="3"
elif [ "$board" == "slate" ]; then
ip+="2"
elif [ "$board" == "onyx" ]; then
ip+="4"
else
usage
exit 1
fi
server_options+=" -b $ip"
if [ $board_name != "emerald" ] && [ $board_name != "onyx" ] && [ $board_name != "slate" ]; then
usage
fi
board_ip=$(cat /etc/hosts | grep $board_name | awk '{print $1}')
server_options+=" -b $board_ip"
fi
if [ -z "${use_histogram}" ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment