diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-10-07 11:57:20 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-10-07 11:57:20 +0000 |
commit | 725611a466f2edf12f809d22339b22223af4afe7 (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /openwrt/package/wiviz/files | |
parent | f4dd5a6d7c4ebea48cd6292744cb9def6037de80 (diff) |
move old kamikaze out of trunk - will put buildroot-ng in there as soon as all the developers are ready
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@4944 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/wiviz/files')
25 files changed, 0 insertions, 466 deletions
diff --git a/openwrt/package/wiviz/files/www/cgi-bin/wiviz/get.cgi b/openwrt/package/wiviz/files/www/cgi-bin/wiviz/get.cgi deleted file mode 100755 index 161fc75ee..000000000 --- a/openwrt/package/wiviz/files/www/cgi-bin/wiviz/get.cgi +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -WIVIZ_PATH=wiviz - -echo Content-type: text/html -echo -killall -USR1 wiviz >/dev/null 2>&1 -if [ 0 -ne $? ] - then #### Wi-Viz daemon not running, start it - $WIVIZ_PATH >/dev/null </dev/null 2>&1 & - killall -USR1 wiviz > /dev/null - fi -echo "<html><head><script language='JavaScript1.2'>" -cat /tmp/wiviz-pipe -echo "</script></head><body></body></html>" diff --git a/openwrt/package/wiviz/files/www/cgi-bin/wiviz/set.cgi b/openwrt/package/wiviz/files/www/cgi-bin/wiviz/set.cgi deleted file mode 100755 index 17b47873a..000000000 --- a/openwrt/package/wiviz/files/www/cgi-bin/wiviz/set.cgi +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -httpd -d $QUERY_STRING > /tmp/wiviz-cfg -killall -USR2 wiviz diff --git a/openwrt/package/wiviz/files/www/wiviz/adhoc-idle.gif b/openwrt/package/wiviz/files/www/wiviz/adhoc-idle.gif Binary files differdeleted file mode 100755 index 05e479f78..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/adhoc-idle.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/adhoc-idle.png b/openwrt/package/wiviz/files/www/wiviz/adhoc-idle.png Binary files differdeleted file mode 100755 index b10b102ec..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/adhoc-idle.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/adhoc.gif b/openwrt/package/wiviz/files/www/wiviz/adhoc.gif Binary files differdeleted file mode 100755 index d07c80cce..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/adhoc.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/adhoc.png b/openwrt/package/wiviz/files/www/wiviz/adhoc.png Binary files differdeleted file mode 100755 index 57db25c28..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/adhoc.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap-idle.gif b/openwrt/package/wiviz/files/www/wiviz/ap-idle.gif Binary files differdeleted file mode 100755 index a92969611..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap-idle.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap-idle.png b/openwrt/package/wiviz/files/www/wiviz/ap-idle.png Binary files differdeleted file mode 100755 index a6e6fb320..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap-idle.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap-wep-idle.gif b/openwrt/package/wiviz/files/www/wiviz/ap-wep-idle.gif Binary files differdeleted file mode 100755 index a92969611..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap-wep-idle.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap-wep-idle.png b/openwrt/package/wiviz/files/www/wiviz/ap-wep-idle.png Binary files differdeleted file mode 100755 index a6e6fb320..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap-wep-idle.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap-wep.gif b/openwrt/package/wiviz/files/www/wiviz/ap-wep.gif Binary files differdeleted file mode 100755 index 29015207c..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap-wep.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap-wep.png b/openwrt/package/wiviz/files/www/wiviz/ap-wep.png Binary files differdeleted file mode 100755 index 3436183a8..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap-wep.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap.gif b/openwrt/package/wiviz/files/www/wiviz/ap.gif Binary files differdeleted file mode 100755 index 7eb5b3a6b..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/ap.png b/openwrt/package/wiviz/files/www/wiviz/ap.png Binary files differdeleted file mode 100755 index ccfc86431..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/ap.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/pip-idle.gif b/openwrt/package/wiviz/files/www/wiviz/pip-idle.gif Binary files differdeleted file mode 100755 index fa923bdf1..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/pip-idle.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/pip-idle.png b/openwrt/package/wiviz/files/www/wiviz/pip-idle.png Binary files differdeleted file mode 100755 index 3fe25fe33..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/pip-idle.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/pip.gif b/openwrt/package/wiviz/files/www/wiviz/pip.gif Binary files differdeleted file mode 100755 index 1c566e9aa..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/pip.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/pip.png b/openwrt/package/wiviz/files/www/wiviz/pip.png Binary files differdeleted file mode 100755 index 5c05a737a..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/pip.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/station-idle.gif b/openwrt/package/wiviz/files/www/wiviz/station-idle.gif Binary files differdeleted file mode 100755 index 155f02208..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/station-idle.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/station-idle.png b/openwrt/package/wiviz/files/www/wiviz/station-idle.png Binary files differdeleted file mode 100755 index eb1621e05..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/station-idle.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/station.gif b/openwrt/package/wiviz/files/www/wiviz/station.gif Binary files differdeleted file mode 100755 index c8a075f42..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/station.gif +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/station.png b/openwrt/package/wiviz/files/www/wiviz/station.png Binary files differdeleted file mode 100755 index 8daf8df35..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/station.png +++ /dev/null diff --git a/openwrt/package/wiviz/files/www/wiviz/wiviz.css b/openwrt/package/wiviz/files/www/wiviz/wiviz.css deleted file mode 100755 index 7b5afa706..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/wiviz.css +++ /dev/null @@ -1,76 +0,0 @@ -/* -This file is part of Wi-viz (http://wiviz.natetrue.com). - -Wi-viz is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License v2 as published by -the Free Software Foundation. - -Wi-viz is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Wi-viz; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -body { - background-color: #D0D0D0; - vertical-align: center; - text-align: center; -} -div.main { - background-color: #D0F0D0; - width: 500px; - height: 500px; - border: 1px solid #555599; - vertical-align: center; - text-align: center; -} -div.floater { - background-color: #D0F0D0; - width: 125px; - height: 300px; - border: 1px solid #555599; - float: right; - z-index: 3; -} -span.status { - color: #FF0000; -} -img.icon { - width: 50px; - height: 50px; -} -img.pip { - width: 12px; - height: 12px; - position: absolute; - z-index: 1; -} -td { - vertical-align: center; - text-align: center; -} -span.hostdesc { - font-size: 10pt; -} -span.extrafo { - font-size: 10pt; - visibility: hidden; -} -div.hostdiv { - position: absolute; - background-color: transparent; - text-align: center; - width: 150px; - z-index: 2; -} -div.hostdiv_hov { - position: absolute; - background-color: #C0E0C0; - text-align: center; - width: 150px; - z-index: 3; - border: 1px solid #000000; -} diff --git a/openwrt/package/wiviz/files/www/wiviz/wiviz.html b/openwrt/package/wiviz/files/www/wiviz/wiviz.html deleted file mode 100755 index f1356fd82..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/wiviz.html +++ /dev/null @@ -1,81 +0,0 @@ -<html> -<head> -<!-- -This file is part of Wi-viz (http://wiviz.natetrue.com). - -Wi-viz is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License v2 as published by -the Free Software Foundation. - -Wi-viz is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Wi-viz; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ---> -<title>Wi-viz wireless network environment visualization</title> -<link rel='stylesheet' type='text/css' href='wiviz.css'> -<script language='JavaScript1.2' src='wiviz.js'> -</script> -</head> -<body> -<h2>OpenWRT Wi-viz network visualization</h2> -<div class='floater'> -Status: <span id='status' class='status'>Monitoring</span><br> -<input type='button' id='togglelisten' value='Stop monitoring' onclick='toggleListen()'> -<p><form name='channelform' action='/cgi-bin/wiviz/set.cgi' method='get' target='wivizGetFrame'> -Channel setting: -<select id='channelsel' name='channelsel' onchange='channelSet()'> -<option value='nochange' selected>No change</option> -<option value='hop'>Hopping</option> -<option>1</option> -<option>2</option> -<option>3</option> -<option>4</option> -<option>5</option> -<option>6</option> -<option>7</option> -<option>8</option> -<option>9</option> -<option>10</option> -<option>11</option> -<option>12</option> -<option>13</option> -<option>14</option> -</select><br> -<span id='hopoptions' style='display: none'> -Time/channel: <select name='hopdwell'> -<option value='500'>0.5 sec</option> -<option selected value='1000'>1 sec</option> -<option value='2000'>2 sec</option> -<option value='5000'>5 sec</option> -</select><br> -Hop sequence: <select name='hopseq'> -<option selected>1,3,6,8,11</option> -<option>1,3,6,8,11,14</option> -<option>1,6,11</option> -<option value='1,2,3,4,5,6,7,8,9,10,11'>1 to 11</option> -<option value='1,2,3,4,5,6,7,8,9,10,11,12,13,14'>1 to 14</option> -</select><br> -<input type='submit' value='Set'> -</form> -</span> -</div> -<center> -<div id='infodiv' class='main'> -<table height=100% width=100%><tr><td> -<span id='pips' style='position: relative'></span> -<span id='content' style='position: relative'></span> -</td></tr></table> -</div> -</center> -<span id='debug' style='display: none'></span> -<iframe style='display:none' id='wivizGetFrame' name='wivizGetFrame' src='about:blank'></iframe> -<script language='JavaScript1.2'> - scan_thread(); -</script> -</body> -</html> diff --git a/openwrt/package/wiviz/files/www/wiviz/wiviz.js b/openwrt/package/wiviz/files/www/wiviz/wiviz.js deleted file mode 100755 index dc67d8f01..000000000 --- a/openwrt/package/wiviz/files/www/wiviz/wiviz.js +++ /dev/null @@ -1,291 +0,0 @@ -/* -This file is part of Wi-viz (http://wiviz.natetrue.com). - -Wi-viz is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License v2 as published by -the Free Software Foundation. - -Wi-viz is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with Wi-viz; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ -var mv = 353; -var stupid = eval('window.attachEvent') ? 1 : 0; -var hosts; -var idle_timeout = 20; -var erase_timeout = 35; -var skew_x = 0; skew_y = 0; -var listening = 1; -var wiviz_cgi_url = "/cgi-bin/wiviz/get.cgi"; - -//What? You mean the POSIX thread API hasn't been ported to Javascript? Bugger. -function scan_thread() { - var loc = document.getElementById('wivizGetFrame').contentWindow.location; - if (!listening) return; - if (loc.href != wiviz_cgi_url) { - loc.replace(wiviz_cgi_url); - } - else { - loc.reload(true); - } - setTimeout("scan_thread()", 5000); -} - -function toggleListen() { - statusel = document.getElementById('status'); - statusbutton = document.getElementById('togglelisten'); - listening = 1 - listening; - if (listening) { - statusel.innerHTML = "Monitoring"; - statusbutton.value = "Stop monitoring"; - document.getElementById('content').innerHTML = ''; - scan_thread(); - } - else { - statusel.innerHTML = "Stopped"; - statusbutton.value = "Start monitoring"; - } -} - -function channelSet() { - channelset = document.getElementById('channelsel').value; - if (channelset == 'hop') { - document.getElementById('hopoptions').style.display = 'inline'; - } - else { - document.getElementById('hopoptions').style.display = 'none'; - if (channelset != 'nochange') document.forms[0].submit(); - } -} - -function mousenter(e) { - if (stupid) e = event; - el = stupid ? e.srcElement : e.currentTarget; - el.parentNode.parentNode.className = 'hostdiv_hov'; - el.nextSibling.nextSibling.nextSibling.style.visibility = 'visible'; -} - -function mouseout(e) { - if (stupid) e = event; - el = stupid ? e.srcElement : e.currentTarget; - el.parentNode.parentNode.className = 'hostdiv'; - el.nextSibling.nextSibling.nextSibling.style.visibility = 'hidden'; -} - -function generate_mnemonic(hash) { - c = new Array('b','c','d','f','g','h','j','k','l','m','n','p','qu','r','s', - 't','v','w','y','z','th','ch','sh','cc','rr'); - v = new Array('a','e','i','o','u','ae','ai','ao','au','eo','ei','eu','iu','oa','oe'); - var i, a; - var p = hash & 1; - var n = ''; - for (i = 0; i < 4; i++) { - a = p ? c : v; - n += a[hash % a.length]; - hash += a.length << 3 + a.length / 2; - hash *= hash; - p = 1 - p; - } - return n; -} - -function mkhash(mac) { - var macarr = mac.split(/:/); - var hash = 0; - for (j = 0; j < 6; j++) { - hash += parseInt(macarr[j]) * j << j; - hash += 11; - } - if (hash < 0) hash = -hash; - return hash; -} - -function wiviz_callback(mhosts, cfgstring) { - var nh = ''; - hosts = mhosts; - for (i = 0; i < hosts.length; i++) { - hs = hosts[i]; - if (hs.length == 0) break; - hs.mac = hs[0]; - hs.rssi = hs[1]; - hs.desc = hs[2]; - hs.descarr = hs.desc.split(/-/) - hs.age = hs[3]; - hs.hash = mkhash(hs.mac); - hs.mnem = generate_mnemonic(hs.hash) - hs.name = hs.mnem; - el = document.getElementById(hs.mnem); - if (el) { - if (hs.age > erase_timeout) { - el.parentNode.removeChild(el); - continue; - } - el.innerHTML = genHTML(hs); - } - else { - if (hs.age > erase_timeout) continue; - hs.x = Math.sin(hs.hash / mv) * hs.rssi * 2 - 67; - hs.y = Math.cos(hs.hash / mv) * hs.rssi * 2; - nh += "<div class='hostdiv' id='" + hs.mnem + "' style='top: "; - nh += parseInt(hs.y) + "px; left: " + parseInt(hs.x) + "px'>"; - nh += genHTML(hs) + "</div>"; - } - } - document.getElementById('content').innerHTML += nh; - - cfgarr = cfgstring.split(/-/); - if (cfgarr[1]) { - if (cfgarr[1] == 'hopping') cfgarr[1] = 'hop'; - document.getElementById('channelsel').value = cfgarr[1]; - if (cfgarr[1] == 'hop') channelSet(); - } - - //repip(); - setTimeout("declump(); repip();", 250); -} - -function repip() { - var nh = ""; - if (!hosts) return; - for (i = 0; i < hosts.length; i++) { - hs = hosts[i]; - if (hs.length == 0) break; - mac = hs[0]; - rssi = hs[1]; - desc = hs[2].split(/-/); - if (desc[0] == 'sta' && desc[1] == 'assoc') { - bss = desc[2]; - hs.apmnem = generate_mnemonic(mkhash(bss)); - ap = document.getElementById(hs.apmnem); - sta = document.getElementById(hs.mnem); - if (ap && sta) { - x = parseInt(sta.style.left); - y = parseInt(sta.style.top); - dx = parseInt(ap.style.left) - x; - dy = parseInt(ap.style.top) - y; - x += 67; - y += 10; - d = Math.sqrt(dx*dx+dy*dy); - for (j = 0; j < d; j += 15) { - nh += "<img src='" - + ((hs.age < idle_timeout) ? "pip" : "pip-idle") - + (stupid ? ".gif" : ".png") - + "' class='pip' style='top:" - + parseInt(y+dy * j / d) + "; left:" - + parseInt(x+dx * j / d) + "'>"; - } - } - } - } - document.getElementById('pips').innerHTML = nh; -} - -function declump() { - var c = 0; - var top = 30000,left = 30000,right = -30000,bottom = -30000; - for (i = 0; i < hosts.length; i++) { - for (j = 0; j < hosts.length; j++) { - if (i == j) continue; - e1 = document.getElementById(hosts[i].mnem); - e2 = document.getElementById(hosts[j].mnem); - if (!e1 || !e2) continue; - x1 = parseInt(e1.style.left); - x2 = parseInt(e2.style.left); - y1 = parseInt(e1.style.top); - y2 = parseInt(e2.style.top); - if (x1 < left) left = x1; - if (y1 < top) top = y1; - if (x1 > right) right = x1; - if (y1 > bottom) bottom = y1; - ox = x2; - oy = y2; - dist = Math.sqrt(Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2)); - if (dist == 0) { - x2 += Math.random() * 5; - y2 += Math.random() * 5; - dist = 10; - } - if (dist < 100) { - cx = (x1-x2) * 5 / (dist / 3); - cy = (y1-y2) * 5 / (dist / 3); - x2 -= cx; - y2 -= cy; - } - if (hosts[j].apmnem == hosts[i].mnem - || hosts[i].apmnem == hosts[j].mnem) { - cx = (x1-x2) * 5 / (dist / 3); - cy = (y1-y2) * 5 / (dist / 3); - if (dist > 150) { - x2 += cx; - y2 += cy; - } - } - if (Math.abs(ox-x2) > 2 || Math.abs(oy-y2) > 2) { - e2.style.left = parseInt(x2); - e2.style.top = parseInt(y2); - c++; - } - } - } - if (top < bottom && left < right) { - document.getElementById('debug').innerHTML = left + "," + right + "," + top + "," +bottom; - document.getElementById('content').style.left = - document.getElementById('pips').style.left = - -(right - left) / 2 - left - 67; - document.getElementById('content').style.top = - document.getElementById('pips').style.top = - -(bottom - top) / 2 - top - 25; - } - repip(); - if (c) setTimeout("declump()", 100); -} - -function genHTML(hs) { - var nh = ''; - nh += "<center><img class='icon' src='" - a = hs.descarr; - if (a[0] == 'ap' || a[0] == 'adhoc') { - if (a[0] == 'ap') { - nh += "ap"; - if (a[5] == 'enc') nh += "-wep"; - } - else { - nh += "adhoc"; - } - hs.channel = a[2]; - hs.name = a[4]; - } - else if (a[0] == 'sta') { - nh += "station"; - hs.channel = 0; - } - nh += (hs.age < idle_timeout) ? "": "-idle"; - nh += stupid ? ".gif" : ".png"; - nh += "' onmouseover='mousenter(event)' onmouseout='mouseout(event)'" - + "><br><span class='hostdesc'>" + hs.mac + "<br><i>'" + hs.name; - nh += "'</i>"; - if (hs.channel) { - nh += " ch" + hs.channel; - } - nh += "</span><span class='extrafo'><br>"; - if (a[0] == 'ap') nh += "Access point"; - if (a[0] == 'sta') nh += "Station"; - if (a[0] == 'adhoc') nh += "Logical ad-hoc entity"; - if (a[0] == 'ap' || a[0] == 'adhoc') { - nh += "<br>"; - if (a[5] == '?enc') nh += "Encryption unknown"; - if (a[5] == 'enc') nh += "Encrypted"; - if (a[5] == 'unenc') nh += "Unencrypted"; - if (a[6] == 'wep') nh += "-WEP"; - if (a[6] == 'wpa') nh += "-WPA"; - } - nh += "<br>RSSI: " + hs.rssi + " dBm<br>" - + "Seen " + hs.age + " seconds ago<br>"; - nh += "</span></center>"; - return nh; -} |