package config;
require Exporter;
@ISA = qw(Exporter);
@EXPORT =
    qw($DISABLE_SYSTEM $useraccount
       $LIBRA_PATH $LIBRA_GNPMONITOR $LIBRA_SOLARISHOST
       $ANETD_BIN $ANETD_ARGLIST @abonenodes
       $hostCTRL $hostSLPDA $hostVGW $hostCMUmovie $hostDANCEmovie
       $hostHHproxy 
       $hostNoMulticastVIC $hostCMUESMproxy
       $hostNTP $hostOverlayMonitor
       $portOverlayMonitor $expDurationInMin
       $viewerArgList $proxyArgList
       GetTokenAfter);

#$DISABLE_SYSTEM = 1; 

$useraccount = "pach";
$LIBRA_PATH = "/usr/tmp/libra-demo";
#$LIBRA_PATH = "/afs/cs.cmu.edu/project/cmcl-darwin-2/libra-demo";
$LIBRA_GNPMONITOR = "206.117.27.29";
$LIBRA_SOLARISHOST = "128.2.211.69";

# ABone binaries
$ANETD_BIN = "$LIBRA_PATH/abone/sc.linux";
$ANETD_ARGLIST = "-f anee2";

@abonenodes = ( "eye.isi.edu", "volga.usc.edu" );

$hostCTRL = "206.117.27.28";
$hostSLPDA = "206.117.27.28";
$hostVGW = "206.117.27.29";
$hostCMUmovie = "128.2.209.185";
$hostDANCEmovie = "206.117.27.33";
$hostHHproxy = "206.117.27.28";
$hostNoMulticastVIC = "206.117.27.31";
$hostCMUESMproxy = "128.2.198.100";

$hostNTP = "clock-1.cs.cmu.edu";
$hostOverlayMonitor = "206.117.27.29";

$portOverlayMonitor = 7020;
#$portMulticastData = 7560;  # not used
$expDurationInMin = 300;  # ESM will run for 5 hours

$viewerArgList = "-t $hostNTP -m $hostOverlayMonitor -p $portOverlayMonitor";

$proxyArgList = "-S $expDurationInMin -v 1 -y 7556:1 -y 7557:1 -y 7558:2 -y 7559:2 -y 7560:3 -y 7561:3 -y 7562:4 -y 7563:4 -y 7564:5 -x 7560:7558 -r 400";

#$proxyArgList = "-r 1000 -S $expDurationInMin -v 1 -y 7556:1 -y 7557:1 -y 7558:2 -y 7559:2 -y 7560:3 -y 7561:3 -y 7562:4 -y 7563:4 -y 7564 -x 7560:7558:7556";
#$proxyArgList = "-S $expDurationInMin -v 1 -y 7556:1 -y 7557:1 -y 7558:2 -y 7559:2 -y 7560:3 -y 7561:3 -y 7562:4 -y 7563:4 -y 7564:5";



sub GetTokenAfter {
  my ($key, $line) = @_;

  my ($start, $end)=split(/$key/, $line);
  my ($ret, $ret2, $junk)=split(/\ /, $end, 3);
  if ($ret eq "") { $ret = $ret2;}
  
  # print "GetTokenAfter $key -- $ret \n($junk)\n(+$start+)\n(+$end+)\n(+$line+)\n";
  if (! defined($ret)) {$ret = "";}
  return $ret;
}


