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

Use ip addresses from hosts file

parent b63671b2
...@@ -13,7 +13,7 @@ interval=100000 ...@@ -13,7 +13,7 @@ interval=100000
# Default options # Default options
client_options="-a -p 99 -f eth0" client_options="-a -p 99 -f eth0"
qdisc_options="" qdisc_options=""
ip="192.168.17." ip="10.100.21."
etf_offset=500 etf_offset=500
while getopts "bd:e:o:ghi:ptT:G" opt; do while getopts "bd:e:o:ghi:ptT:G" opt; do
...@@ -66,20 +66,16 @@ done ...@@ -66,20 +66,16 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ -n "$1" ]; then if [ -z "$1" ]; then
if [ "$1" == "emerald" ]; then usage
ip+="3" fi
elif [ "$1" == "slate" ]; then
ip+="2" board_name=$1
elif [ "$1" == "onyx" ]; then
ip+="4" if [ $board_name != "emerald" ] && [ $board_name != "onyx" ] && [ $board_name != "slate" ]; then
else
usage usage
exit 1
fi
else
ip+="25"
fi fi
board_ip=$(cat /etc/hosts | grep $board_name | awk '{print $1}')
if [ -z "${use_etf}" ] && [ -z "${use_pfast}" ]; then if [ -z "${use_etf}" ] && [ -z "${use_pfast}" ]; then
usage usage
...@@ -117,10 +113,10 @@ make client; ...@@ -117,10 +113,10 @@ make client;
cd $script_dir; cd $script_dir;
if [ -z "${use_histogram}" ]; then if [ -z "${use_histogram}" ]; then
echo "client $client_options $ip"; echo "client $client_options $board_ip";
$script_dir/../packet-exchange/build/client $client_options $ip; $script_dir/../packet-exchange/build/client $client_options $board_ip;
else else
echo "client $client_options $ip > $output;mv $output ~/"; echo "client $client_options $board_ip > $output;mv $output ~/";
$script_dir/../packet-exchange/build/client $client_options $ip > $output; $script_dir/../packet-exchange/build/client $client_options $board_ip > $output;
mv $output ~/; mv $output ~/;
fi fi
...@@ -9,14 +9,14 @@ usage() { ...@@ -9,14 +9,14 @@ usage() {
# Default options # Default options
server_options="-a -p 99 -f eth0" server_options="-a -p 99 -f eth0"
ip="192.168.17." ip="10.100.21."
tcpdump_interval=1000000 tcpdump_interval=1000000
while getopts "b:htd:i:g:T:G" opt; do while getopts "b:htd:i:g:T:G" opt; do
case "${opt}" in case "${opt}" in
b ) b )
use_rtt=1 use_rtt=1
board=${OPTARG} board_name=${OPTARG}
;; ;;
d ) d )
use_tcpdump=1 use_tcpdump=1
...@@ -51,18 +51,13 @@ done ...@@ -51,18 +51,13 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
if [ -n "${use_rtt}" ]; then if [ -n "${use_rtt}" ]; then
if [ "$board" == "emerald" ]; then if [ $board_name != "emerald" ] && [ $board_name != "onyx" ] && [ $board_name != "slate" ]; then
ip+="3"
elif [ "$board" == "slate" ]; then
ip+="2"
elif [ "$board" == "onyx" ]; then
ip+="4"
else
usage usage
exit 1
fi fi
server_options+=" -b $ip" board_ip=$(cat /etc/hosts | grep $board_name | awk '{print $1}')
server_options+=" -b $board_ip"
fi fi
if [ -z "${use_histogram}" ]; then 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