Developing lightweight computation at the DSG edge

Commit ef575198 authored by p4u's avatar p4u
Browse files

Merge branch 'experimental' of ssh://qmp.cat/qmp into experimental

parents 77b42cd3 7e4e545a
......@@ -32,13 +32,12 @@ Public Sources:
#PKG_SOURCE_URL:=git://git.bmx6.net/bmx6.git
PKG_SOURCE_URL:=git://github.com/axn/bmx6.git
PKG_REV:=bf55438352797a939ccf08eacdc3290928fe3fe7
#PKG_REV:=3434d7fddf8de71d3d4829cb6d5adcefbbf7fe4f
PKG_REV:=9e322f29d36dc6f6645428a6f4ae94999caa3343
Private Sources:
#PKG_SOURCE_URL:=file:///usr/src/bmx6/bmx6-private.git
PKG_VERSION:=r2012061801
PKG_VERSION:=r2012082801
PKG_RELEASE:=3
#PKG_INSTALL:=1 # this tries to install straight to /usr/sbin/bmx6
......@@ -101,6 +100,11 @@ define Package/bmx6-qmp-sms
TITLE:=sms plugin
endef
define Package/bmx6-qmp-quagga
$(call Package/bmx6-qmp/Default)
DEPENDS:=bmx6-qmp
TITLE:=bmx6 quagga plugin to redistribute/export routes (needs manet/bmx6 patched quagga 0.99.21)
endef
define Build/Configure
mkdir -p $(PKG_INSTALL_DIR)
......@@ -139,8 +143,15 @@ define Package/bmx6-qmp-sms/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_sms/bmx6_sms.so $(1)/usr/lib/bmx6_sms.so
endef
define Package/bmx6-qmp-quagga/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/bmx6_quagga/bmx6_quagga.so $(1)/usr/lib/bmx6_quagga.so
endef
$(eval $(call BuildPackage,bmx6-qmp))
$(eval $(call BuildPackage,bmx6-qmp-uci-config))
$(eval $(call BuildPackage,bmx6-qmp-json))
$(eval $(call BuildPackage,bmx6-qmp-sms))
$(eval $(call BuildPackage,bmx6-qmp-quagga))
# for more options execute: bmx6 --help
# for more information:
# http://bmx6.net/projects/bmx6/wiki
# options execute: bmx6 --help
config 'bmx6' 'general'
# option 'runtimeDir' '/var/run/bmx6'
# option 'tun4Address' '10.202.0.116/32'
# option 'tun4Address' '10.254.10.0/32'
# option 'tun6Address' '2012:0:0:1000::1/64'
#config 'ipVersion' 'ipVersion'
# option 'ipVersion' '6' # default is 4
# option 'throwRules' '0'
#config 'plugin'
# option 'plugin' 'bmx6_config.so'
#config 'plugin'
# option 'plugin' 'bmx6_json.so'
#config 'plugin'
# option 'plugin' 'bmx6_sms.so'
config 'dev' 'mesh_1'
option 'dev' 'eth0.12'
config 'dev' 'mesh_2'
option 'dev' 'ath0.12'
#config 'hna' 'my_global_prefix'
# option 'hna' '2012:0:0:74:0:0:0:0/64'
#config 'tunOut'
# option 'tunOut' 'ip6'
# option 'network' '2012::/16'
# option 'exportDistance' '0'
#config 'tunOut'
# option 'tunOut' 'ip4'
# option 'network' '10.254.0.0/16'
# option 'exportDistance' '0' # requires quagga plugin !
# option 'minPrefixLen' '27'
#config 'plugin'
# option 'plugin' 'bmx6_quagga.so'
#config 'redistribute'
# option 'redistribute' 'ospf6'
# option 'network' '10.0.0.0/8'
# option 'minPrefixLen' '10'
# option 'bandwidth' '10000000'
# option 'ospf6' '1'
# option 'aggregatePrefixLen' '16'
#config 'redistribute'
# option 'redistribute' 'bgp'
# option 'network' '0.0.0.0/0'
# option 'minPrefixLen' '0'
# option 'maxPrefixLen' '24'
# option 'bandwidth' '10000000'
# option 'bgp' '1'
# option 'aggregatePrefixLen' '8'
......@@ -17,6 +17,7 @@
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=cgi-bin-zero
PKG_VERSION:=1
......@@ -26,13 +27,13 @@ include $(INCLUDE_DIR)/package.mk
define Package/cgi-bin-zero
SECTION:=utils
CATEGORY:=Utilities
CATEGORY:=qMp
TITLE:=cgi-bin/zero
MAINTAINER:=Simó Albert i Beltran <sim6@probeta.net>
endef
define Package/cgi-bin-zero/description
cgi-bin/zero
cgi-bin/zero dummy script
endef
define Build/Compile
......@@ -44,3 +45,4 @@ define Package/cgi-bin-zero/install
endef
$(eval $(call BuildPackage,cgi-bin-zero))
--- a/etc/gwck/module/bmx6
+++ b/etc/gwck/module/bmx6
@@ -4,6 +4,9 @@
#
# Copyright (C) 2008-2012 Simó Albert i Beltran
#
+# Contributors:
+# Pau Escrich <p4u@dabax.net>
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@@ -17,32 +20,13 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# Version 0.1.20111106.1
+# Version 0.1.20111106.2
#############
# Variables #
#############
-# bmx6 tunInRemote value.
-if [ -n "$GWCK_MOD_BMX6_TUN_IN_REMOTE" ]
-then
- ipv6calc 2> /dev/null
- if [ $? != 127 ]
- then
- if ! GWCK_MOD_BMX6_TUN_IN_REMOTE="$(ipv6calc -q -I ipv6 -O ipv6 "$GWCK_MOD_BMX6_TUN_IN_REMOTE")"
- then
- log "ERROR: Invalid IPv6 address in GWCK_MOD_BMX6_TUN_IN_REMOTE variable. Using default value."
- fi
- else
- log "WARNING: bmx6 module needs the ipv6calc program to check IPv6 addresses. Please install it."
- fi
-fi
-
-[ -z "$GWCK_MOD_BMX6_TUN_IN_REMOTE" ] \
-&& GWCK_MOD_BMX6_TUN_IN_REMOTE="fd02::1000:ffff"
-
-
# bmx6 tunInNet value.
[ -z "$GWCK_MOD_BMX6_TUN_IN_NET" ] \
&& GWCK_MOD_BMX6_TUN_IN_NET="0.0.0.0/0"
@@ -70,11 +54,11 @@ fi
# Disable offer command.
[ -z "$GWCK_MOD_BMX6_DISABLE_OFFER" ] \
-&& GWCK_MOD_BMX6_DISABLE_OFFER="bmx6 -c tunInRemote=-$GWCK_MOD_BMX6_TUN_IN_REMOTE tunInNet=-$GWCK_MOD_BMX6_TUN_IN_NET"
+&& GWCK_MOD_BMX6_DISABLE_OFFER="bmx6 -c tunInNet=-$GWCK_MOD_BMX6_TUN_IN_NET"
# Enable offer command.
[ -z "$GWCK_MOD_BMX6_ENABLE_OFFER" ] \
-&& GWCK_MOD_BMX6_ENABLE_OFFER="bmx6 -c tunInRemote=$GWCK_MOD_BMX6_TUN_IN_REMOTE tunInNet=$GWCK_MOD_BMX6_TUN_IN_NET /bandwidth=$GWCK_MOD_BMX6_BANDWIDTH"
+&& GWCK_MOD_BMX6_ENABLE_OFFER="bmx6 -c tunInNet=$GWCK_MOD_BMX6_TUN_IN_NET /bandwidth=$GWCK_MOD_BMX6_BANDWIDTH"
# Disable search command.
[ -z "$GWCK_MOD_BMX6_DISABLE_SEARCH" ] \
@@ -96,19 +80,16 @@ gwck_mod_bmx6_this_node_offer()
{
local offer="$(bmx6 -c --parameters | while read key val
do
- if [ "$key" = "tunInRemote" ] && [ "$val" = "$GWCK_MOD_BMX6_TUN_IN_REMOTE" ]
- then
+ if [ "$key" = "tunInNet" ] && [ "$val" = "$GWCK_MOD_BMX6_TUN_IN_NET" ]
+ then
read key val
- if [ "$key" = "tunInNet" ] && [ "$val" = "$GWCK_MOD_BMX6_TUN_IN_NET" ]
+ if [ "$key" = "/bandwidth" ] && [ "$val" = "$GWCK_MOD_BMX6_BANDWIDTH" ]
then
- read key val
- if [ "$key" = "/bandwidth" ] && [ "$val" = "$GWCK_MOD_BMX6_BANDWIDTH" ]
- then
- echo "true"
- fi
+ echo "true"
fi
fi
done)"
+
[ -z "$offer" ] && offer="false"
if $offer
then
--- a/etc/gwck/gwck_conf_qmp_ipv4
+++ b/etc/gwck/gwck_conf_qmp_ipv4
@@ -60,14 +60,6 @@ MODULES="specific_routes bmx6"
# Routing table
#GWCK_MOD_SPECIFIC_ROUTES_RT_TABLE="200"
-
-# bmx6 tunInRemote value.
-#GWCK_MOD_BMX6_TUN_IN_REMOTE="fd02::1000:ffff"
-. /etc/qmp/qmp_functions.sh
-local gwck_mod_bmx6_primary_mesh_device="$(uci -q get qmp.interfaces.mesh_devices | awk '{print $1}')"
-local gwck_mod_bmx6_bmx6_mesh_prefix48="$(uci -q get qmp.networks.bmx6_mesh_prefix48)"
-GWCK_MOD_BMX6_TUN_IN_REMOTE="$(qmp_get_ula96 $gwck_mod_bmx6_bmx6_mesh_prefix48:: $gwck_mod_bmx6_primary_mesh_device 2002::ffff )"
-
# bmx6 tunInNet value.
#GWCK_MOD_BMX6_TUN_IN_NET="0.0.0.0/0"
GWCK_MOD_BMX6_TUN_IN_NET="$(uci -q get qmp.tunnels.offer_ipv4_tunnel)"
--- a/etc/gwck/gwck_conf_qmp_ipv6
+++ b/etc/gwck/gwck_conf_qmp_ipv6
@@ -60,14 +60,6 @@ MODULES="specific_routes bmx6"
# Routing table.
#GWCK_MOD_SPECIFIC_ROUTES_RT_TABLE="200"
-
-# bmx6 tunInRemote value.
-#GWCK_MOD_BMX6_TUN_IN_REMOTE="fd02::1000:ffff"
-. /etc/qmp/qmp_functions.sh
-local gwck_mod_bmx6_primary_mesh_device="$(uci -q get qmp.interfaces.mesh_devices | awk '{print $1}')"
-local gwck_mod_bmx6_bmx6_mesh_prefix48="$(uci -q get qmp.networks.bmx6_mesh_prefix48)"
-GWCK_MOD_BMX6_TUN_IN_REMOTE="$(qmp_get_ula96 $gwck_mod_bmx6_bmx6_mesh_prefix48:: $gwck_mod_bmx6_primary_mesh_device 2002::ffff )"
-
# bmx6 tunInNet value.
#GWCK_MOD_BMX6_TUN_IN_NET="0.0.0.0/0"
GWCK_MOD_BMX6_TUN_IN_NET="$(uci -q get qmp.tunnels.offer_ipv6_tunnel || echo "::/0")"
# Copyright (C) 2011 Pau Escrich <pau@dabax.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-theme-qmp
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/luci-theme-qmp
SECTION:=theme
CATEGORY:=qMp
TITLE:=Luci qMp theme
DEPENDS:=+luci-mod-admin-core
endef
define Package/luci-theme-qmp/description
bmx6 web interface for luci
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/luci-theme-qmp/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,luci-theme-qmp))
#!/bin/sh
uci batch <<-EOF
set luci.themes.qMp=/luci-static/qmp
set luci.main.mediaurlbase=/luci-static/qmp
commit luci
EOF
<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: footer.htm 7810 2011-10-28 15:15:27Z jow $
-%>
<div class="clear"></div>
</div>
</div>
<p class="luci">Powered by <%= luci.__appname__ .. " (" .. luci.__version__ .. ")" %></p>
</body>
</html>
<%#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008-2010 Jo-Philipp Wich <xm@subsignal.org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id: header.htm 7810 2011-10-28 15:15:27Z jow $
-%>
<%
local sys = require "luci.sys"
local http = require "luci.http"
local disp = require "luci.dispatcher"
local hostname = sys.hostname()
local load1, load5, load15 = sys.loadavg()
local request = disp.context.path
local request2 = disp.context.request
local category = request[1]
local cattree = category and disp.node(category)
local leaf = request2[#request2]
local tree = disp.node()
local node = disp.context.dispatched
local categories = disp.node_childs(tree)
local c = tree
local i, r
-- tag all nodes leading to this page
for i, r in ipairs(request) do
if c.nodes and c.nodes[r] then
c = c.nodes[r]
c._menu_selected = true
end
end
http.prepare_content("application/xhtml+xml")
local function nodeurl(prefix, name, query)
local url = controller .. prefix .. name .. "/"
if query then
url = url .. http.build_querystring(query)
end
return pcdata(url)
end
-%>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=luci.i18n.context.lang%>" lang="<%=luci.i18n.context.lang%>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css" />
<!--[if IE 6]><link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/ie6.css" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/ie7.css" /><![endif]-->
<!--[if IE 8]><link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/ie8.css" /><![endif]-->
<% if node and node.css then %><link rel="stylesheet" type="text/css" media="screen" href="<%=resource%>/<%=node.css%>" />
<% end -%>
<script type="text/javascript" src="<%=resource%>/xhr.js"></script>
<title><%=striptags( hostname .. ( (node and node.title) and ' - ' .. translate(node.title) or '')) %> - LuCI</title>
</head>
<body class="lang_<%=luci.i18n.context.lang%>">
<p class="skiplink">
<span id="skiplink1"><a href="#navigation"><%:Skip to navigation%></a></span>
<span id="skiplink2"><a href="#content"><%:Skip to content%></a></span>
</p>
<div class="hostinfo">
<%=hostname%> | <%=luci.version.distversion%> |
<%:Load%>: <%="%.2f" % load1%> <%="%.2f" % load5%> <%="%.2f" % load15%>
<span id="xhr_poll_status" style="display:none" onclick="XHR.running() ? XHR.halt() : XHR.run()">
| <%:Auto Refresh%>:
<span id="xhr_poll_status_on"><%:on%></span>
<span id="xhr_poll_status_off" style="display:none"><%:off%></span>
</span>
</div>
<div id="header">
<div class="banner" style="background-color: #000; display: block; clear: both; height: 58px;">
<div style="float:left;padding-left:24px"><a href="http://qmp.cat"><img src="/luci-static/qmp/qmp_small.png" height="45px" alt="qMp" style="padding: 5px;" border="0"/></a></div>
<div style="float:left; padding-top:20px;padding-left:5px;color:#ff9900"><h2>Quick Mesh Project</h2></div>
</div>
</div>
<%-
local function submenu(prefix, node)
local childs = disp.node_childs(node)
if #childs > 0 then
%>
<ul id="submenu_<%=string.gsub(string.gsub(prefix, "/", "_"), "^_(.-)_$", "%1")%>">
<%-
for i, r in ipairs(childs) do
local nnode = node.nodes[r]
local href = controller .. prefix .. r .. "/" ..
(nnode.query and http.build_querystring(nnode.query) or "")
%>
<li>
<a<%=ifattr(nnode._menu_selected, "class", "active")%> href="<%=luci.util.pcdata(href)%>"><%=translate(nnode.title)%></a>
<%- submenu(prefix .. r .. "/", nnode) %>
</li>
<%-
end
%>
</ul>
<%
end
end
%>
<div id="menubar">
<h2 class="navigation"><a id="navigation" name="navigation"><%:navigation Navigation%></a></h2>
<ul id="mainmenu" class="dropdowns">
<%
local childs = disp.node_childs(cattree)
if #childs > 0 then
for i, r in ipairs(childs) do
local nnode = cattree.nodes[r]
local href = controller .. "/" .. category .. "/" .. r ..
(nnode.query and http.build_querystring(k.query) or "")
%>
<li>
<a<%=ifattr(nnode._menu_selected, "class", "preactive")%> href="<%=href%>"><%=translate(nnode.title)%></a>
<%- submenu("/" .. category .. "/" .. r .. "/", nnode) %>
</li>
<%
end
end
%>
<li></li>
</ul>
<% if #categories > 1 then %>
<ul id="modemenu">
<% for i, r in ipairs(categories) do %>
<li><a<%=ifattr(request[1] == r, "class", "active")%> href="<%=controller%>/<%=r%>/"><%=striptags(translate(tree.nodes[r].title))%></a></li>
<% end %>
</ul>
<% end %>
<%
if tree.nodes[category] and tree.nodes[category].ucidata then
local ucic = 0
for i, j in pairs(require("luci.model.uci").cursor():changes()) do
for k, l in pairs(j) do
for m, n in pairs(l) do
ucic = ucic + 1;
end
end
end
-%>
<div id="savemenu">
<% if ucic > 0 then %>
<a class="warning" href="<%=controller%>/<%=category%>/uci/changes/?redir=<%=http.urlencode(http.formvalue("redir") or REQUEST_URI)%>"><%:Unsaved Changes%>: <%=ucic%></a>
<% end -%>
</div>
<% end %>
<div class="clear"></div>
</div>
<div id="maincontainer">
<div id="maincontent">
<noscript>
<div class="errorbox">
<strong><%:Java Script required!%></strong><br />
<%:You must enable Java Script in your browser or LuCI will not work properly.%>
</div>
</noscript>
<%- if luci.sys.user.getuser("root") and not luci.sys.user.getpasswd("root") then -%>
<div class="errorbox">
<strong><%:No password set!%></strong><br />
<%:There is no password set on this router. Please configure a root password to protect the web interface and enable SSH.%><br />
<a href="<%=pcdata(luci.dispatcher.build_url("admin/system/admin"))%>"><%:Go to password configuration...%></a>
</div>
<%- end -%>
@charset "utf-8";
@media all {
html {
min-height: 100%;
height: auto;
position:relative;
}
body {
color: #ffffff;
background-color: #000;
background-position: bottom center;
background-repeat: repeat-x;
font-family: Verdana, Arial, sans-serif;
font-size: 11pt;
line-height: 100%;
padding-bottom: 1.5em;
}
* {
margin: 0;
padding: 0;
}
a img {
border: none;
text-decoration: none;
}
small {
white-space: nowrap;
}
ul.l1 li a {
background-color: #AAAAAA;
background-image: url(tabbg.png);
background-repeat: repeat-x;
border-color: #444444;
}
ul.l1 li.tabmenu-item-logout a {
margin-left: 30px;
}
abbr,
acronym {
font-style: normal;
font-variant: normal;
}
abbr[title],