Commit 5a3e106a authored by Kirk Webb's avatar Kirk Webb

Merge branch 'win7devel'

parents 02283879 92ee859b
VERSION export-subst VERSION export-subst
# Files that already had DOS-style line endings and those # Files that already had DOS-style line endings and those
# that require them should be added to the list below. # that require them should be added to the list below.
clientside/sensors/slothd/idlemon.vbs -crlf
clientside/tmcc/cygwinseven/SetupComplete.cmd -crlf
clientside/tmcc/cygwinseven/unattend-x86.xml -crlf
clientside/tmcc/cygwinxp/cygwin-tcsh.bat -crlf
clientside/tmcc/cygwinxp/resolv.conf -crlf
clientside/tmcc/cygwinxp/site-lisp/cygwin-mount.el -crlf
clientside/tmcc/cygwinxp/site-lisp/site-start.el -crlf
clientside/tmcc/cygwinxp/sysprep.inf -crlf
delay/linux/iptables_mods/iptables-1.3.6-imq.diff -crlf delay/linux/iptables_mods/iptables-1.3.6-imq.diff -crlf
hyperviewer/hv.dsp -crlf hyperviewer/hv.dsp -crlf
hyperviewer/hv.dsw -crlf hyperviewer/hv.dsw -crlf
...@@ -64,16 +72,10 @@ protogeni/demo/src/RequestSliverStart.as -crlf ...@@ -64,16 +72,10 @@ protogeni/demo/src/RequestSliverStart.as -crlf
protogeni/demo/src/RequestSliverUpdate.as -crlf protogeni/demo/src/RequestSliverUpdate.as -crlf
protogeni/demo/src/SimpleNodeClip.as -crlf protogeni/demo/src/SimpleNodeClip.as -crlf
protogeni/demo/src/SliceWait.as -crlf protogeni/demo/src/SliceWait.as -crlf
sensors/slothd/idlemon.vbs -crlf
tbsetup/ipassign/dre/prepass/pistream.h -crlf tbsetup/ipassign/dre/prepass/pistream.h -crlf
tbsetup/ipassign/dre/prepass/postream.h -crlf tbsetup/ipassign/dre/prepass/postream.h -crlf
tbsetup/ipassign/etc/autocheck.conf -crlf tbsetup/ipassign/etc/autocheck.conf -crlf
tbsetup/plab/libdslice/xmlrpcserver.py -crlf tbsetup/plab/libdslice/xmlrpcserver.py -crlf
tmcd/cygwinxp/cygwin-tcsh.bat -crlf
tmcd/cygwinxp/resolv.conf -crlf
tmcd/cygwinxp/site-lisp/cygwin-mount.el -crlf
tmcd/cygwinxp/site-lisp/site-start.el -crlf
tmcd/cygwinxp/sysprep.inf -crlf
www/csshover.htc -crlf www/csshover.htc -crlf
www/cssmenu.css -crlf www/cssmenu.css -crlf
www/cssmenu-new.css -crlf www/cssmenu-new.css -crlf
......
...@@ -242,7 +242,7 @@ outfiles="Makeconf GNUmakefile \ ...@@ -242,7 +242,7 @@ outfiles="Makeconf GNUmakefile \
tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \ tmcc/freebsd10/GNUmakefile tmcc/freebsd10/netif-emulab \
tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \ tmcc/cygwinxp/GNUmakefile tmcc/dp/GNUmakefile \
tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \ tmcc/openbsd/GNUmakefile tmcc/ron/GNUmakefile \
tmcc/plab/GNUmakefile \ tmcc/plab/GNUmakefile tmcc/cygwinseven/GNUmakefile \
os/GNUmakefile os/syncd/GNUmakefile \ os/GNUmakefile os/syncd/GNUmakefile \
os/dijkstra/GNUmakefile os/genhostsfile/GNUmakefile \ os/dijkstra/GNUmakefile os/genhostsfile/GNUmakefile \
os/frisbee.redux/GNUmakefile \ os/frisbee.redux/GNUmakefile \
......
...@@ -77,6 +77,7 @@ use constant LIMIT_BW_MED => 10000000; ...@@ -77,6 +77,7 @@ use constant LIMIT_BW_MED => 10000000;
use constant LIMIT_BW_LO => 1000000; use constant LIMIT_BW_LO => 1000000;
use constant LIMIT_BW_MIN => 64000; use constant LIMIT_BW_MIN => 64000;
use constant LIMIT_BW_LOSS => 0.20; use constant LIMIT_BW_LOSS => 0.20;
use constant LIMIT_BW_HI_Windows => 40000000;
# Make sure that we dont get bogged down in being too accurate! # Make sure that we dont get bogged down in being too accurate!
# Make sure the error is a certain significance before we start reporting it. # Make sure the error is a certain significance before we start reporting it.
...@@ -335,6 +336,7 @@ my $PATH_SCHEDFILE = "$VARDIR/logs/linktest.sched"; ...@@ -335,6 +336,7 @@ my $PATH_SCHEDFILE = "$VARDIR/logs/linktest.sched";
my $PATH_SYNCSERVER = "$VARDIR/boot/syncserver"; my $PATH_SYNCSERVER = "$VARDIR/boot/syncserver";
my $PATH_TOPOFILE = "$VARDIR/boot/ltmap"; my $PATH_TOPOFILE = "$VARDIR/boot/ltmap";
my $PATH_PTOPOFILE = "$VARDIR/boot/ltpmap"; my $PATH_PTOPOFILE = "$VARDIR/boot/ltpmap";
my $PATH_WINPING = "/cygdrive/c/windows/system32/ping.exe";
my $schedfile = $PATH_SCHEDFILE; my $schedfile = $PATH_SCHEDFILE;
if ($printsched) { if ($printsched) {
...@@ -491,8 +493,9 @@ if (!exists($hostmap{$hostname})) { ...@@ -491,8 +493,9 @@ if (!exists($hostmap{$hostname})) {
# Determine if we can run at high priority. # Determine if we can run at high priority.
# #
my $high_priority = 1; my $high_priority = 1;
if ($platform eq LINUX && $hostmap{$hostname}->isvnode) { if (($platform eq LINUX && $hostmap{$hostname}->isvnode) || $platform =~ /CYGWIN/ ) {
# XXX Linux vnodes (openvz) cannot change their priority # XXX Linux vnodes (openvz) cannot change their priority
# ... Windows can't either...
$high_priority = 0; $high_priority = 0;
} }
...@@ -1185,6 +1188,28 @@ sub loss_test { ...@@ -1185,6 +1188,28 @@ sub loss_test {
# Latency Test Functions # Latency Test Functions
############################################################################## ##############################################################################
# Explicit calculation of ping statistics (average and stddev)
# @param[0] := reference to array of samples.
# @return := (average, stddev)
sub ping_stats {
my $measurements = shift;
my @rv = undef;
if (defined($measurements) and @$measurements) {
my $avg = 0;
map { $avg += $_ } @$measurements;
$avg /= scalar(@$measurements);
my $std = 0;
map { $std += ($avg - $_) ** 2 } @$measurements;
$std = ($std / scalar(@$measurements)) ** 0.5;
@rv = ($avg, $std);
}
return @rv;
}
# returns whether the link latency is in a valid test range. # returns whether the link latency is in a valid test range.
sub valid_latency { sub valid_latency {
return TRUE; return TRUE;
...@@ -1231,31 +1256,50 @@ sub ping_node { ...@@ -1231,31 +1256,50 @@ sub ping_node {
} elsif($platform =~ /CYGWIN/) { } elsif($platform =~ /CYGWIN/) {
# Neither Windows nor Cygwin ping has either send rate or timeout. # Neither Windows nor Cygwin ping has either send rate or timeout.
# Windows ping doesn't have -q, but it does have TTL, so use it. # Windows ping doesn't have -q, but it does have TTL, so use it.
$cmd = "/cygdrive/c/WINDOWS/system32/ping.exe -n $send_count $ttlarg $host"; # The first ping is always wildly off under Windows due to arp
# and possibly other startup costs, so we grab an
# additional sample in anticipation of throwing out the first.
$send_count++;
$cmd = "$PATH_WINPING -n $send_count $ttlarg $host";
} }
# note backticks passes SIGINT to child procs # note backticks passes SIGINT to child procs
my @args = split(/\s+/,$cmd); my @args = split(/\s+/,$cmd);
my @results = &my_tick(@args); my @results = &my_tick(@args);
my @wintimes = (); # For Windows.
my $reslt_cnt = @results; my $reslt_cnt = @results;
my $result = $results[$reslt_cnt-2]; my $result = $results[$reslt_cnt-2];
if($platform eq BSD && $result =~ /(\d+) packets received/) { if($platform eq BSD && $result =~ /(\d+) packets received/) {
$count = $1; $count = $1;
} elsif($platform eq LINUX && $result =~ /(\d+) received/) { } elsif($platform eq LINUX && $result =~ /(\d+) received/) {
$count = $1; $count = $1;
} elsif($platform =~ /CYGWIN/ && } elsif($platform =~ /CYGWIN/) {
$results[$reslt_cnt-3] =~ /Received = (\d+)/) { # The first ping under windows is often way off so we gather up
$count = $1; # the time measurements ourseleves and throw out the first sample.
# These measurements will be used below to calculate the mean
# and stddev of the latency.
foreach my $rline (@results) {
if ($rline =~ /Reply from (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}): bytes=(\d+) time(=|<)(\d+)ms TTL=(\d+)/) {
my $op = $3;
# Windows ping doesn't measure below 1 ms.
my $time = $op eq "<" ? 0 : $4;
push @wintimes, $time;
}
}
# throw out the first sample.
shift @wintimes;
$count = scalar(@wintimes);
} }
if($count) { if($count) {
$result = $results[$reslt_cnt-1]; if ($platform =~ /CYGWIN/) {
if($result=~ /\d+\.\d+\/(\d+\.\d+)\/\d+\.\d+\/(\d+\.\d+)/) { ($avg_latency, $stddev) = &ping_stats(\@wintimes);
$avg_latency = $1; } else {
$stddev = $2; $result = $results[$reslt_cnt-1];
} elsif($result=~ /Average = (\d+)ms/) { if($result=~ /\d+\.\d+\/(\d+\.\d+)\/\d+\.\d+\/(\d+\.\d+)/) {
$avg_latency = $1; $avg_latency = $1;
$stddev = 0.03; # Stddev is not reported on Windows. $stddev = $2;
}
} }
} }
return ($count, $avg_latency, $stddev); return ($count, $avg_latency, $stddev);
...@@ -1618,6 +1662,8 @@ sub bw_test { ...@@ -1618,6 +1662,8 @@ sub bw_test {
my $bw_error_low = (($platform =~ /CYGWIN/) ? my $bw_error_low = (($platform =~ /CYGWIN/) ?
INSIGNIFICANT_BW_ERROR_LO_Windows : INSIGNIFICANT_BW_ERROR_LO_Windows :
INSIGNIFICANT_BW_ERROR_LO); INSIGNIFICANT_BW_ERROR_LO);
my $bw_limit_hi = LIMIT_BW_HI;
# #
# all nodes will execute the same reductions on the edge list # all nodes will execute the same reductions on the edge list
...@@ -1659,7 +1705,7 @@ sub bw_test { ...@@ -1659,7 +1705,7 @@ sub bw_test {
&print_link($edge) . "\n"); &print_link($edge) . "\n");
&info("*** Bandwidth is out of range ". &info("*** Bandwidth is out of range ".
"(" . LIMIT_BW_LO . " <= BW <= " . "(" . LIMIT_BW_LO . " <= BW <= " .
LIMIT_BW_HI .") ". "or loss is too high (> " . $bw_limit_hi .") ". "or loss is too high (> " .
LIMIT_BW_LOSS . ").\n"); LIMIT_BW_LOSS . ").\n");
} }
} }
...@@ -1686,7 +1732,7 @@ sub bw_test { ...@@ -1686,7 +1732,7 @@ sub bw_test {
&print_link($redge) . "\n"); &print_link($redge) . "\n");
&info("*** Bandwidth is out of range ". &info("*** Bandwidth is out of range ".
"(" . LIMIT_BW_LO . " <= BW <= " . "(" . LIMIT_BW_LO . " <= BW <= " .
LIMIT_BW_HI .") ". "or loss is too high (> " . $bw_limit_hi .") ". "or loss is too high (> " .
LIMIT_BW_LOSS . ").\n"); LIMIT_BW_LOSS . ").\n");
} }
} }
......
...@@ -62,8 +62,8 @@ YCFLAGS += -I. -I$(TGSRCDIR) -DUSEEVENTS -DFREEBSD ...@@ -62,8 +62,8 @@ YCFLAGS += -I. -I$(TGSRCDIR) -DUSEEVENTS -DFREEBSD
LIBS += -ll -lcompat LIBS += -ll -lcompat
endif endif
ifeq ($(SYSTEM),CYGWIN_NT-5.1) ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
# Cygwin on Windows XP (a.k.a. NT 5.1) - resembles the Linux case. # Cygwin on Windows XP/7 - resembles the Linux case.
CFLAGS += -DCYGWIN -DLINUX CFLAGS += -DCYGWIN -DLINUX
YCFLAGS += -I. -I$(TGSRCDIR) -DUSEEVENTS -DCYGWIN -DLINUX YCFLAGS += -I. -I$(TGSRCDIR) -DUSEEVENTS -DCYGWIN -DLINUX
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
#define TPM_CERTFILE "tpm.cert" #define TPM_CERTFILE "tpm.cert"
#define TPM_KEYFILE "tpm.key" #define TPM_KEYFILE "tpm.key"
#ifdef linux #if defined(linux) || defined(__CYGWIN__)
#define EAUTH EPERM #define EAUTH EPERM
#endif #endif
......
...@@ -42,25 +42,9 @@ int usetpm; ...@@ -42,25 +42,9 @@ int usetpm;
#define READ tmcd_sslread #define READ tmcd_sslread
#define CLOSE tmcd_sslclose #define CLOSE tmcd_sslclose
#else #else
#ifdef _WIN32
inline int win_send(SOCKET s, const char FAR* buf, int len)
{
return send(s,buf,len,0);
}
inline int win_recv(SOCKET s, char FAR* buf, int len)
{
return recv(s,buf,len,0);
}
#define ACCEPT tmcd_accept
#define CONNECT connect
#define WRITE win_send
#define READ win_recv
#define CLOSE close
#else
#define ACCEPT tmcd_accept #define ACCEPT tmcd_accept
#define CONNECT connect #define CONNECT connect
#define WRITE write #define WRITE write
#define READ read #define READ read
#define CLOSE close #define CLOSE close
#endif /*_WIN32*/
#endif /*WITHSSL*/ #endif /*WITHSSL*/
...@@ -17,6 +17,12 @@ SUBDIRS = syncd dijkstra genhostsfile imagezip frisbee.redux ...@@ -17,6 +17,12 @@ SUBDIRS = syncd dijkstra genhostsfile imagezip frisbee.redux
ifeq ($(SYSTEM),FreeBSD) ifeq ($(SYSTEM),FreeBSD)
SUBDIRS += growdisk SUBDIRS += growdisk
endif endif
# XXX: Remove imagezip and frisbee from Cygwin builds - not working.
ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
SUBDIRS := $(filter-out imagezip frisbee.redux,$(SUBDIRS))
endif
all: all-subdirs all: all-subdirs
include $(TESTBED_SRCDIR)/GNUmakerules include $(TESTBED_SRCDIR)/GNUmakerules
...@@ -42,13 +48,16 @@ client-install: client ...@@ -42,13 +48,16 @@ client-install: client
$(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/install-tarfile.1 $(INSTALL) -m 644 $(SRCDIR)/install-tarfile.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/install-tarfile.1
$(INSTALL_PROGRAM) $(SRCDIR)/install-rpm $(LBINDIR)/install-rpm $(INSTALL_PROGRAM) $(SRCDIR)/install-rpm $(LBINDIR)/install-rpm
$(MAKE) -C syncd client-install $(MAKE) -C syncd client-install
ifneq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) # Filter out again...
$(MAKE) -C dijkstra client-install $(MAKE) -C dijkstra client-install
$(MAKE) -C genhostsfile client-install
$(MAKE) -C imagezip client-install $(MAKE) -C imagezip client-install
$(MAKE) -C frisbee.redux client-install
endif
$(MAKE) -C genhostsfile client-install
ifeq ($(SYSTEM),FreeBSD) ifeq ($(SYSTEM),FreeBSD)
$(MAKE) -C growdisk client-install $(MAKE) -C growdisk client-install
endif endif
$(MAKE) -C frisbee.redux client-install
subboss: client subboss: client
......
...@@ -27,8 +27,8 @@ SDLIBS+= -ltb -lmysqlclient ...@@ -27,8 +27,8 @@ SDLIBS+= -ltb -lmysqlclient
LIBS= $(MLIBS) LIBS= $(MLIBS)
CP= cp -pf CP= cp -pf
ifeq ($(SYSTEM),CYGWIN_NT-5.1) ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
# Cygwin on Windows XP (a.k.a. NT 5.1). # Cygwin on Windows XP/7
MLIBS += -liphlpapi MLIBS += -liphlpapi
WINCLIENT = idlemon WINCLIENT = idlemon
...@@ -70,7 +70,7 @@ boss-install: $(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS) sdcollectd) webfe ...@@ -70,7 +70,7 @@ boss-install: $(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS) sdcollectd) webfe
client-install: client client-install: client
$(INSTALL_PROGRAM) slothd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/slothd$(EXE) $(INSTALL_PROGRAM) slothd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/slothd$(EXE)
ifeq ($(SYSTEM),CYGWIN_NT-5.1) ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT)
# If there are any RDP logins active, idlemon will be busy. Try moving it. # If there are any RDP logins active, idlemon will be busy. Try moving it.
-mv $(IDLEMONEXE) $(IDLEMONEXE).prev -mv $(IDLEMONEXE) $(IDLEMONEXE).prev
$(INSTALL_PROGRAM) idlemon$(EXE) $(IDLEMONEXE) $(INSTALL_PROGRAM) idlemon$(EXE) $(IDLEMONEXE)
......
...@@ -152,6 +152,7 @@ int main(int argc, char **argv) { ...@@ -152,6 +152,7 @@ int main(int argc, char **argv) {
tmppkt = pkt; tmppkt = pkt;
pkt = opkt; pkt = opkt;
opkt = tmppkt; opkt = tmppkt;
bzero(pkt, sizeof(*pkt));
} }
if (mopts.once) { if (mopts.once) {
...@@ -322,6 +323,21 @@ int init_slothd(void) { ...@@ -322,6 +323,21 @@ int init_slothd(void) {
parms->ifd = socket(PF_INET, SOCK_DGRAM, 0); parms->ifd = socket(PF_INET, SOCK_DGRAM, 0);
#endif #endif
#ifdef __CYGWIN__
{
/*
* Grab number of cpu cores.
*/
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
parms->numcpu = sysinfo.dwNumberOfProcessors;
if (parms->numcpu < 1) /* Catch a bogus answer. */
parms->numcpu = 1;
}
#endif
/* prepare UDP connection to server */ /* prepare UDP connection to server */
if ((parms->sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { if ((parms->sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
lerror("Could not alloc socket"); lerror("Could not alloc socket");
...@@ -598,29 +614,10 @@ void get_load(SLOTHD_PACKET *pkt) { ...@@ -598,29 +614,10 @@ void get_load(SLOTHD_PACKET *pkt) {
* averaged by system logging so it's no good for us. As long as we set our * averaged by system logging so it's no good for us. As long as we set our
* threshold of CPU busyness below 1.0, this will work fine. * threshold of CPU busyness below 1.0, this will work fine.
*/ */
char *ldavg_prog[] = {"tail", "-1", "/var/run/ldavg.csv", NULL};
int get_ldavg(char *, void *);
int ncpu = -1;
void get_load(SLOTHD_PACKET *pkt) { void get_load(SLOTHD_PACKET *pkt) {
pkt->loadavg[0] = pkt->loadavg[1] = pkt->loadavg[2] = -1.0; static char *ldavg_prog[] = {"tail", "-1", "/var/run/ldavg.csv", NULL};
if ( ncpu < 0 ) {
/* Hyper-threading on the pc3000's convinces NT that it has 2 processors,
* so it considers a busy process to be 50% utilization. One busy process
* should be 100% load average for us. Use "cpu count" in /proc/cpuinfo
* to get a multiplier.
*/
FILE *cpuinfo = fopen("/proc/cpuinfo", "r");
char line[80];
while (ncpu < 0 && fgets(line, 80, cpuinfo)
&& ! feof(cpuinfo) && ! ferror(cpuinfo))
sscanf(line, "cpu count : %d", &ncpu);
if (ncpu < 1) /* One-cpu machines have a cpu count of zero. */ pkt->loadavg[0] = pkt->loadavg[1] = pkt->loadavg[2] = -1.0;
ncpu = 1;
}
if (procpipe(ldavg_prog, &get_ldavg, (void*)pkt)) if (procpipe(ldavg_prog, &get_ldavg, (void*)pkt))
lwarn("get_ldavg exec failed."); lwarn("get_ldavg exec failed.");
...@@ -637,7 +634,8 @@ int get_ldavg(char *buf, void *data) { ...@@ -637,7 +634,8 @@ int get_ldavg(char *buf, void *data) {
} }
/* NT reports load as a percent, e.g. 44.5; we want a fraction, e.g. 0.445 */ /* NT reports load as a percent, e.g. 44.5; we want a fraction, e.g. 0.445 */
pkt->loadavg[0] = pkt->loadavg[1] = pkt->loadavg[2] = load * ncpu / 100.0; pkt->loadavg[0] = pkt->loadavg[1] = pkt->loadavg[2] =
load * parms->numcpu / 100.0;
if (opts->debug) if (opts->debug)
printf("load averages: %f, %f, %f\n", printf("load averages: %f, %f, %f\n",
pkt->loadavg[0], pkt->loadavg[1], pkt->loadavg[2]); pkt->loadavg[0], pkt->loadavg[1], pkt->loadavg[2]);
...@@ -798,9 +796,15 @@ int get_counters(char *buf, void *data) { ...@@ -798,9 +796,15 @@ int get_counters(char *buf, void *data) {
#else /* __CYGWIN__ */ #else /* __CYGWIN__ */
void get_packet_counts(SLOTHD_PACKET *pkt) { void get_packet_counts(SLOTHD_PACKET *pkt) {
static char *filters[] = {"WAN Miniport",
"WFP LightWeight Filter",
"QoS Packet Scheduler",
NULL};
static DWORD dwSize; static DWORD dwSize;
DWORD ret; DWORD ret;
int i; char curaddr[MACADDRLEN];
char *descr;
int i, j;
/* Call GetIfTable(), an MS IP Helper Function, to get packet counters. */ /* Call GetIfTable(), an MS IP Helper Function, to get packet counters. */
PMIB_IFTABLE iftable; PMIB_IFTABLE iftable;
...@@ -818,30 +822,56 @@ void get_packet_counts(SLOTHD_PACKET *pkt) { ...@@ -818,30 +822,56 @@ void get_packet_counts(SLOTHD_PACKET *pkt) {
/* Scan through the interface table. */ /* Scan through the interface table. */
pkt->ifcnt = 0; pkt->ifcnt = 0;
for (i = 0; i < min(iftable->dwNumEntries, MAXNUMIFACES); i++) { for (i = 0; i < iftable->dwNumEntries && pkt->ifcnt < MAXNUMIFACES; i++) {
ifrow = &(iftable->table[i]); ifrow = &(iftable->table[i]);
if (ifrow->dwType != MIB_IF_TYPE_LOOPBACK && /* Exclude loopback. */ if (ifrow->dwType == IF_TYPE_ETHERNET_CSMACD && /* Only Ethernet. */
ifrow->dwOperStatus == MIB_IF_OPER_STATUS_OPERATIONAL) { ifrow->dwOperStatus == IF_OPER_STATUS_OPERATIONAL) {
/* Format the MAC address. We don't have ether_ntoa(). */ /* Format the MAC address. We don't have ether_ntoa(). */
snprintf(pkt->ifaces[pkt->ifcnt].addr, MACADDRLEN, snprintf(curaddr, MACADDRLEN,
"%02x:%02x:%02x:%02x:%02x:%02x", "%02x:%02x:%02x:%02x:%02x:%02x",
ifrow->bPhysAddr[0], ifrow->bPhysAddr[1], ifrow->bPhysAddr[2], ifrow->bPhysAddr[0], ifrow->bPhysAddr[1], ifrow->bPhysAddr[2],
ifrow->bPhysAddr[3], ifrow->bPhysAddr[4], ifrow->bPhysAddr[5]); ifrow->bPhysAddr[3], ifrow->bPhysAddr[4], ifrow->bPhysAddr[5]);
/* Skip over bogus interfaces (WAN, filters, etc.). What a mess... */
descr = strndup((char*)ifrow->bDescr, ifrow->dwDescrLen);
if (!descr) {
lerror("Memory allocation failed!");
exit(1);
}
for(j = 0; filters[j] != NULL; j++) {
if (strstr(descr, filters[j]) != NULL) {
break;
}
}
free(descr);
if (filters[j]) {
continue;
}
if (opts->debug) if (opts->debug)
printf("macaddr: %s\n", pkt->ifaces[pkt->ifcnt].addr); printf("macaddr: %s\n", curaddr);
/* Grumble. ifrow->wszName is empty. /* Grumble. ifrow->wszName is empty. <- Not in Win7.
* Recognize the control interface by its MAC address. * Recognize the control interface by its MAC address.
*/ */
if (strncmp(pkt->ifaces[pkt->ifcnt].addr, parms->cifaddr, MACADDRLEN)==0) if (strncmp(curaddr, parms->cifaddr, MACADDRLEN)==0)
strncpy(pkt->ifaces[pkt->ifcnt].ifname, parms->cifname, MAXIFNAMELEN); strncpy(pkt->ifaces[pkt->ifcnt].ifname, parms->cifname, MAXIFNAMELEN);
else else
/* If it isn't the control interface, just show the MAC address. */ /* If it isn't the control interface, just show the MAC address. */
strncpy(pkt->ifaces[pkt->ifcnt].ifname, parms->cifaddr, MAXIFNAMELEN); strncpy(pkt->ifaces[pkt->ifcnt].ifname, curaddr, MAXIFNAMELEN);
if (opts->debug) /* Make certain the interface name is null terminated. */
printf("ifname: %s\n", pkt->ifaces[pkt->ifcnt].ifname); pkt->ifaces[pkt->ifcnt].ifname[MAXIFNAMELEN-1] = '\0';
/* Now it's time to save off the MAC address of the current entry. */
strncpy(pkt->ifaces[pkt->ifcnt].addr, curaddr, MACADDRLEN);
pkt->ifaces[pkt->ifcnt].addr[MACADDRLEN-1] = '\0';
if (opts->debug) {
printf("ifacename: %ls\n", ifrow->wszName);
printf("Description: %*s\n", (int)ifrow->dwDescrLen, ifrow->bDescr);
}
/* Packet counters, including unicast, broadcast, and multicast. */ /* Packet counters, including unicast, broadcast, and multicast. */
pkt->ifaces[pkt->ifcnt].ipkts = pkt->ifaces[pkt->ifcnt].ipkts =
......
...@@ -83,6 +83,7 @@ typedef struct { ...@@ -83,6 +83,7 @@ typedef struct {
char *cifname; char *cifname;
#ifdef __CYGWIN__ #ifdef __CYGWIN__
char *cifaddr; char *cifaddr;
u_int numcpu;
#endif /* __CYGWIN__ */ #endif /* __CYGWIN__ */
u_char dolast; u_char dolast;
time_t lastrpt; time_t lastrpt;
...@@ -134,4 +135,8 @@ int clear_ttys(void); ...@@ -134,4 +135,8 @@ int clear_ttys(void);
int add_tty(char*); int add_tty(char*);
int enum_ttys(void); int enum_ttys(void);
#ifdef __CYGWIN__
int get_ldavg(char*, void*);
#endif
#endif /* #ifndef _SLOTHD_H */ #endif /* #ifndef _SLOTHD_H */
...@@ -26,6 +26,10 @@ CFLAGS += -O -g -Wall -DUDP \ ...@@ -26,6 +26,10 @@ CFLAGS += -O -g -Wall -DUDP \
-I${TESTBED_LIBSRCDIR}/libtb \ -I${TESTBED_LIBSRCDIR}/libtb \
-I${TESTBED_LIBSRCDIR}/tmcd \ -I${TESTBED_LIBSRCDIR}/tmcd \
-L/usr/local/lib -L/usr/local/lib
ifeq ($(SYSTEM),Cygwin)
CFLAGS += -L/usr/lib/w32api
endif
TMLIBS = ${TESTBED_LIBOBJDIR}/tmcd/libtmcc.a TMLIBS = ${TESTBED_LIBOBJDIR}/tmcd/libtmcc.a
TMLIBS += ${TESTBED_LIBOBJDIR}/libtb/libtb.a TMLIBS += ${TESTBED_LIBOBJDIR}/libtb/libtb.a
LDFLAGS += $(LDSTATIC) LDFLAGS += $(LDSTATIC)
...@@ -103,10 +107,15 @@ endif ...@@ -103,10 +107,15 @@ endif
endif endif
ifeq ($(SYSTEM),Cygwin) ifeq ($(SYSTEM),Cygwin)
TMLIBS += -liphlpapi
# Cygwin on Windows XP (a.k.a. NT 5.1) - resembles the Linux case. # Cygwin on Windows XP (a.k.a. NT 5.1) - resembles the Linux case.
ifeq ($(MDSUBDIR),CYGWIN_NT-5.1) ifeq ($(MDREL),5.1)
MDSUBDIR = cygwinxp MDSUBDIR = cygwinxp
TMSLIBS += -lminires else
# Cygwin on Windows 7 (a.k.a. NT 6.1) - resembles the Linux case.
ifeq ($(MDREL),6.1)
MDSUBDIR = cygwinseven
endif
endif endif
endif endif
...@@ -118,7 +127,7 @@ tmcc-shared: tmcc.c tmcd.h $(TPMLIB) ...@@ -118,7 +127,7 @@ tmcc-shared: tmcc.c tmcd.h $(TPMLIB)
$(CC) $(CFLAGS) $(SSLFLAGS) -g -o tmcc $< $(LFLAGS) $(TMLIBS) $(CC) $(CFLAGS) $(SSLFLAGS) -g -o tmcc $< $(LFLAGS) $(TMLIBS)
tmcc-nossl-debug: tmcc.c tmcd.h tmcc-nossl-debug: tmcc.c tmcd.h
$(CC) $(CFLAGS) $(LDSTATIC) -g -o $@ $< $(LFLAGS) $(TMSLIBS) $(CC) $(CFLAGS) $(LDSTATIC) -g -o $@ $< $(LFLAGS) $(TMLIBS)
findif-debug: findif.o findif-debug: findif.o
$(CC) $(CFLAGS) -g -o $@ findif.o $(LFLAGS) $(LDSTATIC) $(CC) $(CFLAGS) -g -o $@ findif.o $(LFLAGS) $(LDSTATIC)
......
...@@ -424,7 +424,7 @@ sub doboot() ...@@ -424,7 +424,7 @@ sub doboot()
# #
# Anytime the home dir is on a local FS ... # Anytime the home dir is on a local FS ...
# #
if ($doit && $doupdate) { if ($doit && $doupdate && !WINDOWS()) {
# #
# Must ask for the current home dir since we rely on pw.conf. # Must ask for the current home dir since we rely on pw.conf.
# #
......
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
#
# XXX ONLY RUN THIS INSTALL ON A CYGWIN / WINDOWS XP NODE!
# Similar to linux9, cygwinseven is an overlay on linux, which is an overlay
# on common.
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
SRCDIR = @srcdir@
TESTBED_SRCDIR = @top_srcdir@
OBJDIR = @top_builddir@
SUBDIR = $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
include $(OBJDIR)/Makeconf
SCRIPTS =
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
#
all: $(SCRIPTS)
include $(TESTBED_SRCDIR)/GNUmakerules
DESTDIR =
SYSETCDIR = $(DESTDIR)/etc
ETCDIR = $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR = $(DESTDIR)$(CLIENT_BINDIR)
VARDIR = $(DESTDIR)$(CLIENT_VARDIR)
RCDIR = $(SYSETCDIR)/rc.d
INSTALL = /usr/bin/install -c
COMMON = $(SRCDIR)/../common
WINDOWS = /cygdrive/c/Windows
SYSTEM32 = $(WINDOWS)/System32
WBEM = $(SYSTEM32)/Wbem
SYSPREP = $(SYSTEM32)/sysprep
SPSCRIPTS = $(WINDOWS)/Setup/Scripts
install client-install: baselinux-install common-install etc-install \
sup-install script-install ##bin-install
@echo "Remember to install the PEM files if necessary"
simple-install: common-install script-install ##bin-install
dir-install: