Developing lightweight computation at the DSG edge

Commit 132fc866 authored by p4u's avatar p4u
Browse files

Merge branch 'testing' into experimental

parents f987545c 58524028
......@@ -6,7 +6,7 @@ cd 13f
git clone ssh://gitosis@qmp.cat:221/qmp.git; cd qmp; git checkout --track origin/autoconfig; cd ..
svn co -r 27617 svn://svn.openwrt.org/openwrt/branches/backfire
git clone git://gitorious.org/eigennet/packages.git eigennet/packages
svn co -r 27617 svn://svn.openwrt.org/openwrt/packages packages
svn co -r 27617 svn://svn.openwrt.org/openwrt/packages packages
cd backfire
rm -rf feeds/
......@@ -27,11 +27,11 @@ cd backfire
## Configuring system
make menuconfig
* Target System (BCM947xxx, x86, atheros,...)
* Target Profile (WGT634u, wrap, alix, routerstation,...)
* Target Profile (WGT634u, wrap, alix, routerstation,...)
(* Global build-settings -> Compile the kernel with profiling enabled )
(* Advanced configuration options for developers -> Toolchain options -> Build gdb )
* Base system ->
qmp-big-node # for 8Mbyte flash devices
qmp-big-node # for 8Mbyte flash devices
qmp-small-node # for 4MByte flash devices STILL TO BIG ?? Needs testing on 4MB flash devices !!!
* remove for 4MByte-flash devices: network -> ppp
......@@ -41,12 +41,12 @@ HT40 is supported since backfire revision 27441
#### Optional, to have HT40 in IBSS mode: Patching files
## cp ../qmp/patches/004-ibss.patch package/mac80211/patches/
## cp ../qmp/patches/002-ibss_ht40.patch package/iw/patches/
## patch -p1 -i ../qmp/patches/mac80211.sh_ht40.patch package/mac80211/files/lib/wifi/mac80211.sh
## patch -p1 -i ../qmp/patches/mac80211.sh_ht40.patch package/mac80211/files/lib/wifi/mac80211.sh
## rm package/mac80211/patches/542-mac80211_enable_iftype_wds_aggregation.patch
## Kernel configuration
# sometimes you have to run make (build backfire with default kernel) once before you can continue with make kernel_menuconfig
make kernel_menuconfig
make kernel_menuconfig
(* File systems -> Dnotify support && Inotify file change notification support && Inotify support for userspace )
(* General setup -> Configure standard kernel features (for small systems) -> Enable ELF core dumps )
......@@ -95,13 +95,13 @@ sysupgrade -n /tmp/openwrt-ar71xx-ubnt-rspro-squashfs-sysupgrade.bin
#### POSTCONFIGURE:
#### POSTCONFIGURE:
after a second reboot (better wait a while) the system should be autoconfigured
ssh root@192.168.1.1
to enforce a reconfiguration remove /qmp_configured
to enforce a reconfiguration remove /qmp_configured
TODO: Which further options exist here???
......
......@@ -4,10 +4,10 @@
- ESSID should depends on channel
- after removing /qmp_configured and having changed driver
- after removing /qmp_configured and having changed driver
to madwifi autoconf scripts system ignores that.
In fact the decision wheter it loads madwifi or mac80211
depends on whether the qmp/network option mesh_devices
In fact the decision wheter it loads madwifi or mac80211
depends on whether the qmp/network option mesh_devices
has wlan* or ath* names in the list
- felix patches must be checked:
......@@ -22,7 +22,7 @@
DONE:
- The vlan problem with mac80211 drivers:
vlan interfaces for ath9k are created as vlan12@wlan1
vlan interfaces for ath9k are created as vlan12@wlan1
NO vlan interfaces for ath5k devices are created.
......
......@@ -23,40 +23,40 @@
local bmx6json = require("luci.model.bmx6json")
module("luci.controller.bmx6", package.seeall)
function index()
local place = {}
local place = {}
local ucim = require "luci.model.uci"
local uci = ucim.cursor()
-- checking if ignore is on
if uci:get("luci-bmx6","luci","ignore") == "1" then
return nil
end
-- getting value from uci database
local uci_place = uci:get("luci-bmx6","luci","place")
-- default values
if uci_place == nil then
place = {"bmx6"}
else
if uci_place == nil then
place = {"bmx6"}
else
local util = require "luci.util"
place = util.split(uci_place," ")
end
---------------------------
-- Starting with the pages
---------------------------
--- neighbours/descriptions (default)
entry(place,call("action_neighbours_j"),place[#place])
table.insert(place,"neighbours_nojs")
entry(place,call("action_neighbours_j"),place[#place])
table.insert(place,"neighbours_nojs")
entry(place, call("action_neighbours"), nil)
table.remove(place)
--- status (this is default one)
table.insert(place,"Status")
entry(place,call("action_status"),"Status")
entry(place,call("action_status"),"Status")
table.remove(place)
--- links
......@@ -66,54 +66,54 @@ function index()
--- chat
table.insert(place,"Chat")
entry(place,call("action_chat"),"Chat")
entry(place,call("action_chat"),"Chat")
table.remove(place)
--- Graph
table.insert(place,"Graph")
table.insert(place,"Graph")
entry(place, template("bmx6/graph"), "Graph")
table.remove(place)
--- Topology (hidden)
table.insert(place,"topology")
table.insert(place,"topology")
entry(place, call("action_topology"), nil)
table.remove(place)
--- configuration (CBI)
table.insert(place,"Configuration")
entry(place, cbi("bmx6/main"), "Configuration").dependent=false
table.insert(place,"Advanced")
table.insert(place,"Advanced")
entry(place, cbi("bmx6/advanced"), "Advanced")
table.remove(place)
table.insert(place,"Interfaces")
table.insert(place,"Interfaces")
entry(place, cbi("bmx6/interfaces"), "Interfaces")
table.remove(place)
table.insert(place,"Plugins")
table.insert(place,"Plugins")
entry(place, cbi("bmx6/plugins"), "Plugins")
table.remove(place)
table.insert(place,"HNA")
table.insert(place,"HNA")
entry(place, cbi("bmx6/hna"), "HNA")
table.remove(place)
table.remove(place)
table.remove(place)
end
function action_status()
local status = bmx6json.get("status").status or nil
local interfaces = bmx6json.get("interfaces").interfaces or nil
if status == nil or interfaces == nil then
luci.template.render("bmx6/error", {txt="Cannot fetch data from bmx6 json"})
luci.template.render("bmx6/error", {txt="Cannot fetch data from bmx6 json"})
else
luci.template.render("bmx6/status", {status=status,interfaces=interfaces})
end
end
function action_neighbours()
local orig_list = bmx6json.get("originators").originators or nil
......@@ -127,32 +127,32 @@ function action_neighbours()
local orig = nil
local name = ""
local ipv4 = ""
for _,o in ipairs(orig_list) do
orig = bmx6json.get("originators/"..o.name) or {}
desc = bmx6json.get("descriptions/"..o.name) or {}
if string.find(o.name,'.') then
name = luci.util.split(o.name,'.')[1]
else
name = o.name
end
--Not sure about that, but trying to find main ipv4 from HNA6 published by each node
--Not sure about that, but trying to find main ipv4 from HNA6 published by each node
if desc.DESC_ADV ~= nil then
for _,h in ipairs(desc.DESC_ADV.extensions[2].HNA6_EXTENSION) do
if h ~= nil and string.find(h.address,"::ffff:") then
ipv4=string.gsub(h.address,"::ffff:","")
break
end
end
end
end
if ipv4 == "" then
if ipv4 == "" then
ipv4="0.0.0.0"
end
table.insert(originators,{name=name,ipv4=ipv4,orig=orig,desc=desc})
end
......@@ -178,11 +178,11 @@ function action_links(host)
end
for _,l in ipairs(links) do
l.globalId = luci.util.split(l.globalId,'.')[1]
table.insert(devlinks[l.viaDev],l)
table.insert(devlinks[l.viaDev],l)
end
end
luci.template.render("bmx6/links", {links=devlinks})
luci.template.render("bmx6/links", {links=devlinks})
end
function action_topology()
......@@ -202,7 +202,7 @@ function action_topology()
end
luci.http.write('{ "globalId": "%s", "links": [' %o.globalId:match("^[^%.]+"))
local first2 = true
for i2,l in ipairs(links.links) do
......@@ -211,12 +211,12 @@ function action_topology()
else
luci.http.write(', ')
end
luci.http.write('{ "globalId": "%s", "rxRate": %s, "txRate": %s }'
%{ l.globalId:match("^[^%.]+"), l.rxRate, l.txRate })
end
luci.http.write(']}')
end
......@@ -257,11 +257,11 @@ function action_chat()
fd = io.open(sms_path,"r")
chat[sender] = fd:read()
fd:close()
fd:close()
end
end
to_send = luci.http.formvalue("toSend")
to_send = luci.http.formvalue("toSend")
if to_send ~= nil and #to_send > 1 then
fd = io.open(send_file,"w")
fd:write(to_send)
......
......@@ -59,7 +59,7 @@ function get(field, host)
if json_url[1] == "http" then
raw,err = wget(url..field,1000)
else
else
if json_url[1] == "exec" then
raw = sys.exec(json_url[2]..' '..field)
......@@ -78,11 +78,11 @@ function get(field, host)
data = decoder:get()
-- else
-- print_error("Cannot get data from bmx6 daemon",true)
-- return nil
-- return nil
end
return data
end
end
function print_error(txt,popup)
util.perror(txt)
......@@ -112,7 +112,7 @@ function wget(url, timeout)
if pid == 0 then
rfd:close()
nixio.dup(wfd, nixio.stdout)
local candidates = { "/usr/bin/wget", "/bin/wget" }
local _, bin
for _, bin in ipairs(candidates) do
......@@ -135,7 +135,7 @@ function wget(url, timeout)
err1 = "timeout"
break
end
local rv = rfd:read(4096)
if rv then
-- eof
......
......@@ -27,8 +27,8 @@ local http = require("luci.http")
local sys = require("luci.sys")
local options = bmx6json.get("options")
if options == nil or options.OPTIONS == nil then
m.message = "bmx6-json plugin is not running or some mistake in luci-bmx6 configuration, check /etc/config/luci-bmx6"
if options == nil or options.OPTIONS == nil then
m.message = "bmx6-json plugin is not running or some mistake in luci-bmx6 configuration, check /etc/config/luci-bmx6"
options = {}
else
options = options.OPTIONS
......@@ -41,17 +41,17 @@ local help = ""
local value = nil
local _,o
for _,o in ipairs(options) do
for _,o in ipairs(options) do
if o.name ~= nil and o.CHILD_OPTIONS == nil and o.configurable == 1 then
help = ""
name = o.name
if o.help ~= nil then
help = bmx6json.text2html(o.help)
if o.help ~= nil then
help = bmx6json.text2html(o.help)
end
if o.syntax ~= nil then
help = help .. "<br/><strong>Syntax: </strong>" .. bmx6json.text2html(o.syntax)
if o.syntax ~= nil then
help = help .. "<br/><strong>Syntax: </strong>" .. bmx6json.text2html(o.syntax)
end
if o.def ~= nil then
......
......@@ -32,8 +32,8 @@ function hna_option:validate(value)
local err = sys.call('bmx6 -c --test -a ' .. value)
if err ~= 0 then
return nil
end
return value
end
return value
end
function m.on_commit(self,map)
......
......@@ -37,7 +37,7 @@ end
-- Getting json and looking for device section
local json = bmx6json.get("options")
if json == nil or json.OPTIONS == nil then
if json == nil or json.OPTIONS == nil then
m.message = "bmx6-json plugin is not running or some mistake in luci-bmx6 configuration, check /etc/config/luci-bmx6"
json = {}
else
......
......@@ -60,7 +60,7 @@ for _,o in ipairs(options) do
ipoptions = o.CHILD_OPTIONS
break
end
end
end
local help = ""
local name = ""
......
......@@ -26,7 +26,7 @@ plugins_dir = {"/usr/lib/","/var/lib","/lib"}
plugin = m:section(TypedSection,"plugin","Plugin")
plugin.addremove = true
plugin.anonymous = false
plv = plugin:option(ListValue,"plugin", "Plugin")
plv = plugin:option(ListValue,"plugin", "Plugin")
for _,d in ipairs(plugins_dir) do
pl = luci.sys.exec("cd "..d..";ls bmx6_*")
......
......@@ -17,7 +17,7 @@
td.innerHTML = '<em><br /><%:Some problem with JSON: lenght of originators and descriptions different. %></em>';
return 1;
}
if ( originators && descriptions && tb)
{
/* clear all rows */
......@@ -29,7 +29,7 @@
var tr = tb.insertRow(-1);
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
tr.insertCell(-1).innerHTML = descriptions[i].DESC_ADV.globalId.replace(/\.[^\.]+$/,"");
var extensions = descriptions[i].DESC_ADV.extensions;
//Looking for the extensions
......@@ -42,7 +42,7 @@
break;
}
}
//Adding first HNA with prefix=128 as main address
var ipstxt = '';
var address;
......@@ -60,13 +60,13 @@
}
tr.insertCell(-1).innerHTML = ipstxt;
tr.insertCell(-1).innerHTML = originators[i].viaDev;
tr.insertCell(-1).innerHTML = originators[i].metric;
tr.insertCell(-1).innerHTML = originators[i].lastDesc;
tr.insertCell(-1).innerHTML = originators[i].lastRef;
tr.insertCell(-1).innerHTML = originators[i].blocked;
}
if( tb.rows.length == 1 )
......
......@@ -21,7 +21,7 @@
<form action="." method="post">
<input type="text" name="toSend" />
<input type="submit" value="send sms" />
<input type="submit" value="send sms" />
</form>
<br />
......
......@@ -47,8 +47,8 @@ $Id$
: data[i].links[j].globalId + '|' + data[i].globalId;
if (!seen[key])
{
g.addEdge(data[i].globalId, data[i].links[j].globalId,
{ label: data[i].links[j].rxRate + '/' + data[i].links[j].txRate,
g.addEdge(data[i].globalId, data[i].links[j].globalId,
{ label: data[i].links[j].rxRate + '/' + data[i].links[j].txRate,
directed: false, stroke: '#aaaaaa', fill: '#ffffff',
'label-style': { 'font-size': 10 }});
seen[key] = true;
......@@ -75,7 +75,7 @@ $Id$
layouter.layout();
renderer.draw();
}
}
);
//]]></script>
......
......@@ -14,7 +14,7 @@
</table>
<div style="display:table">
<% for i,l in ipairs(d) do %>
<div id="link" style="background-color:#dadbe9;left:50px;width:300px;margin:10px;float:left;position:relative">
<table>
......@@ -30,12 +30,12 @@
<ul>
<li>Local IP: <a href="[<%=l.llocalIp%>]"><%=l.llocalIp%></a></li>
<li>Device: <%=l.viaDev%></li>
<li>Rate (rx/tx):
<li>Rate (rx/tx):
<% if l.rxRate+l.txRate < 120 then %>
<span style="color:red;">
<% else %>
<span style="color:green;">
<% end %>
<% end %>
<%=l.rxRate%>/<%=l.txRate%>
</span>
</li>
......@@ -43,7 +43,7 @@
</ul>
</td>
</tr>
</table>
</table>
</div>
<% end %>
</div>
......
......@@ -22,7 +22,7 @@
font:bold 1.2em/2em "Century Gothic","Trebuchet MS",Arial,Helvetica,sans-serif;
color:#66a3d3;
}
#neighbour {
position:relative;
......@@ -49,18 +49,18 @@
<th scope="col">Last Desc</th>
<th scope="col">Last Ref</th>
</tr>
<% for i,o in ipairs(originators) do %>
<tr>
<td><%=o.name%></td>
<td><a href="http://<%=o.ipv4%>"><%=o.ipv4%></a></td>
<td><a href="http://[<%=o.orig.primaryIp%>]"><%=o.orig.primaryIp%></a></td>
<td><%=o.orig.viaDev%></td>
<td><%=o.orig.viaIp%></td>
<td><%=o.orig.viaDev%></td>
<td><%=o.orig.viaIp%></td>
<td><%=o.orig.routes%></td>
<td><%=o.orig.metric%></td>
<td><%=o.orig.lastDesc%></td>
<td><%=o.orig.lastRef%></td>
<td><%=o.orig.metric%></td>
<td><%=o.orig.lastDesc%></td>
<td><%=o.orig.lastRef%></td>
</tr>
<%end%>
</table>
......@@ -70,7 +70,7 @@
<th scope="col">Node</th>
<th scope="col">Announced networks</th>
</tr>
<% for i,o in ipairs(originators) do %>
<tr>
<td><%=o.name%></td>
......
......@@ -23,7 +23,7 @@
td.innerHTML += '<em><%: Please perform a manually cache flush from a terminal: bmx6 -c --flushAll %></em>'
return 1;
}
if ( originators && descriptions && tb)
{
/* clear all rows */
......@@ -37,7 +37,7 @@
tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
tr.insertCell(-1).innerHTML = '<a onclick="displayExtraInfo(\'ip-'+i+'\')"><img src=\"/luci-static/resources/cbi/help.gif\" /></a>';
tr.insertCell(-1).innerHTML = nodename;
var extensions = descriptions[i].DESC_ADV.extensions;
//Looking for the extensions
......@@ -55,7 +55,7 @@
tun4in6 = extensions[e].TUN4IN6_NET_EXTENSION;
}
}
var gateways = '<ul>';
for ( var t = 0; t < tun4in6.length; t++)
{
......@@ -63,7 +63,7 @@
gateways += tun4in6[t].bandwidth+'</li>';
}
gateways += '</ul>';
//Adding HNAs with prefix=128 as main address
var ipstxt = '';
var address;
......@@ -77,42 +77,42 @@
prefix = hna6[e].prefixlen;
if ( prefix == '128' )
{
if (first)
if (first)
{
ipstxt += address;
ipstxt_hidden += '<li><a href="http://['+address+']" >'+address+"</a></li>";
first = 0;