Commit 5906de9b authored by David Johnson's avatar David Johnson
Browse files

Sanity-check input, unlink tmp files, add the built jar for legacy.

parent ff45bef8
......@@ -12,7 +12,6 @@ LOGGEDINORDIE($uid);
#$TARGET_FILE = "wireless-stats.data.zip";
$TARGET_FILE = "wireless-stats.data";
$DEV_PATH = "devel/johnsond/";
function death($msg) {
PAGEHEADER("Wireless Connectivity Data");
......@@ -23,7 +22,7 @@ function death($msg) {
}
## we need a type and a dataset.
if (isset($type) && isset($dataset)) {
if (isset($type) && isset($dataset) && !preg_match("/^[-\w]+$/", $dataset)) {
$dbq = DBQueryFatal("select * from wireless_stats where name='$dataset'");
if (mysql_num_rows($dbq)) {
......@@ -38,11 +37,11 @@ if (isset($type) && isset($dataset)) {
if ($type == "data") {
## find the file...
#$path = "/proj/$pid/exp/$eid/logs/$TARGET_FILE";
$path = "/usr/testbed/devel/johnsond/www/wireless-stats/$pid.$eid-$TARGET_FILE";
$path = "./wireless-stats/$pid.$eid-$TARGET_FILE";
if (file_exists($path)) {
## read and dump the file:
//header("Content-Type: application/zip");
//header("Content-Length: " . (filesize($path)));
#header("Content-Type: application/zip");
#header("Content-Length: " . (filesize($path)));
header("Content-Type: text/plain");
## obviously, this duplication of headers might not
## make all browsers very happy... if there's a
......@@ -65,6 +64,7 @@ if (isset($type) && isset($dataset)) {
$gen_args = "-o $tmpfile -t -z -y -f $floor $building";
$retval = SUEXEC($uid,"nobody","webfloormap $gen_args",
SUEXEC_ACTION_IGNORE);
sleep(1);
if ($retval) {
SUEXECERROR(SUEXEC_ACTION_USERERROR);
# Never returns.
......@@ -77,8 +77,16 @@ if (isset($type) && isset($dataset)) {
header("Content-type: image/jpg");
fpassthru($fp);
}
#readfile($tmpfile . ".jpg") or death("Error reading map image file!");
else {
death("Error while reading image file!");
}
$gen_args = "-k -o $tmpfile";
$retval = SUEXEC($uid,"nobody","webfloormap $gen_args",
SUEXEC_ACTION_IGNORE);
#unlink($tmpfile . ".jpg");
#unlink($tmp
}
else if ($type == "posit") {
$dbq = DBQueryFatal("select node_id,loc_x,loc_y,loc_z from " .
......@@ -107,7 +115,8 @@ if (isset($type) && isset($dataset)) {
}
else {
## error
death("You must supply a valid dataset name and type of data to generate!");
death("You must supply a valid dataset name and " .
"type of data to generate!");
}
## we're good, theoretically...
......
......@@ -12,47 +12,9 @@ LOGGEDINORDIE($uid);
PAGEHEADER("Wireless/WSN Testbed Connectivity Statistics");
## now do some text
?>
<h3>Instructions</h3>
This applet allows you to inspect the connectivity properties of
various Emulab wireless testbeds and areas. At the moment, you
can only view statistics for the static WSN testbed, but soon
you'll be able to inspect the various floors Emulab's wifi testbed
as well. The display shows nodes, "links" between them, and the
percentage of loss on each link.
<p>
To use this applet, simply select a dataset. Then, if the dataset
offers multiple power levels, choose one that corresponds to your
intended use. By default, all wireless "links" that can transmit
some data between any nodes are displayed. You can select a different
mode if desirable. "Select by source" means that links between nodes
you select in the list below and any other nodes are shown. "Select
by receiver" means that all links between the receivers you selected
and any senders are shown. You can also modify the selected nodes by
clicking on the map on the appropriate node circles. To add a node to a
selection, hold down the shift key and left-click on the node. To remove
a node from a selection, hold down the shift key and click the node. To
remove all nodes from a selection, click anywhere on the map outside of any
nodes. You can edit the current selection using the map, the list, or a
combination.
<p>
Since some maps may get cluttered with any links, we provide some
limiting options to reduce the number of links shown in a sensible manner.
You can limit by "k best neighbors", which filters out all but the
N best links leaving or entering the selected nodes; N is the number
you enter in the box just below this limit option. You can also
limit by setting a threshold; only nodes with loss rates above this
threshold are shown. To remove the limit, choose the "None" limit.
Finally, an additional option allows you to never see links with 0%
connectivity.
<p>
<h2><a href="#instructions">Instructions</a></h2>
<?php
......@@ -92,6 +54,49 @@ echo "<applet name='wireless-stats' code='WirelessMapApplet.class'
<param name='positurl' value='$positurl'>
</applet>\n";
?>
<h3><a name="instructions">Instructions</a></h3>
This applet allows you to inspect the connectivity properties of
various Emulab wireless testbeds and areas. At the moment, you
can only view statistics for the static WSN testbed, but soon
you'll be able to inspect the various floors Emulab's wifi testbed
as well. The display shows nodes, "links" between them, and the
percentage of loss on each link.
<p>
To use this applet, simply select a dataset. Then, if the dataset
offers multiple power levels, choose one that corresponds to your
intended use. By default, all wireless "links" that can transmit
some data between any nodes are displayed. You can select a different
mode if desirable. "Select by source" means that links between nodes
you select in the list below and any other nodes are shown. "Select
by receiver" means that all links between the receivers you selected
and any senders are shown. You can also modify the selected nodes by
clicking on the map on the appropriate node circles. To add a node to a
selection, hold down the shift key and left-click on the node. To remove
a node from a selection, hold down the shift key and click the node. To
remove all nodes from a selection, click anywhere on the map outside of any
nodes. You can edit the current selection using the map, the list, or a
combination.
<p>
Since some maps may get cluttered with any links, we provide some
limiting options to reduce the number of links shown in a sensible manner.
You can limit by "k best neighbors", which filters out all but the
N best links leaving or entering the selected nodes; N is the number
you enter in the box just below this limit option. You can also
limit by setting a threshold; only nodes with loss rates above this
threshold are shown. To remove the limit, choose the "None" limit.
Finally, an additional option allows you to never see links with 0%
connectivity.
<p>
<?php
PAGEFOOTER();
?>
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