Developing lightweight computation at the DSG edge
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Quick Mesh Project
qMp packages
Commits
102b990b
Commit
102b990b
authored
Oct 22, 2012
by
p4u
Browse files
Merge branch 'testing' into gsoc
parents
3dbf09af
d5cf2c4a
Changes
71
Show whitespace changes
Inline
Side-by-side
HOWTO
View file @
102b990b
TODO
deleted
100644 → 0
View file @
3dbf09af
## AUTOCONF SYSTEM ##
- change option "name" for "essid"
- ESSID should depends on channel
- 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
has wlan* or ath* names in the list
- felix patches must be checked:
https://dev.openwrt.org/log/branches/backfire?rev=27441 and here:
https://dev.openwrt.org/log/branches/backfire/package/mac80211/files/lib/wifi
currently the patch instructions in the HOWTO fail!!!!!!
- Make sure firewall is really disabled !!!!!!!!!! ARGHHH!!!!!
DONE:
- The vlan problem with mac80211 drivers:
vlan interfaces for ath9k are created as vlan12@wlan1
NO vlan interfaces for ath5k devices are created.
Off the record:
## PAU ##
- this is off the record...
## AGUSTI ##
- Configuration eth0 in ipv4. Change 192.168.1.1 by default?
packages/bmx6-luci/files/usr/lib/lua/luci/controller/bmx6.lua
View file @
102b990b
...
...
@@ -64,6 +64,11 @@ function index()
entry
(
place
,
call
(
"action_links"
),
"Links"
).
leaf
=
true
table.remove
(
place
)
-- Gateways
table.insert
(
place
,
"Gateways"
)
entry
(
place
,
call
(
"action_gateways_j"
),
"Gateways"
).
leaf
=
true
table.remove
(
place
)
--- chat
table.insert
(
place
,
"Chat"
)
entry
(
place
,
call
(
"action_chat"
),
"Chat"
)
...
...
@@ -166,6 +171,11 @@ function action_neighbours_j()
luci
.
template
.
render
(
"bmx6/neighbours_j"
,
{
link_non_js
=
link_non_js
})
end
function
action_gateways_j
()
luci
.
template
.
render
(
"bmx6/gateways_j"
,
{})
end
function
action_links
(
host
)
local
links
=
bmx6json
.
get
(
"links"
,
host
)
local
devlinks
=
{}
...
...
packages/bmx6-luci/files/usr/lib/lua/luci/model/bmx6json.lua
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/model/cbi/bmx6/advanced.lua
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/model/cbi/bmx6/hna.lua
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/model/cbi/bmx6/interfaces.lua
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/model/cbi/bmx6/main.lua
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/model/cbi/bmx6/plugins.lua
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/view/admin_status/index/neighbours_simple.htm
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/view/bmx6/chat.htm
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/view/bmx6/gateways_j.htm
0 → 100644
View file @
102b990b
<
%+
header
%
>
<script
type=
"text/javascript"
src=
"<%=resource%>/cbi.js"
></script>
<script
type=
"text/javascript"
>
//
<!
[
CDATA
[
var
displayExtraInfo
=
function
(
id
)
{
document
.
getElementById
(
'
extra-info
'
).
innerHTML
=
document
.
getElementById
(
id
).
innerHTML
;
}
XHR
.
poll
(
5
,
'
/cgi-bin/bmx6-info
'
,
{
'
descriptions/all
'
:
''
},
function
(
x
,
st
)
{
var
tb
=
document
.
getElementById
(
'
descriptions_table
'
);
var
rowcount
=
0
;
var
tunicon
=
"
<%=resource%>/icons/tunnel.png
"
;
/* clear all rows */
while
(
tb
.
rows
.
length
>
1
)
tb
.
deleteRow
(
1
);
for
(
var
k
in
st
)
{
var
description
=
st
[
k
].
DESC_ADV
;
var
tun4in6
;
for
(
var
k
in
description
.
extensions
)
{
var
value
=
description
.
extensions
[
k
];
if
(
value
.
TUN4IN6_NET_EXTENSION
)
{
tun4in6
=
value
.
TUN4IN6_NET_EXTENSION
;
break
;
}
}
if
(
tun4in6
)
{
var
nodename
=
description
.
globalId
.
replace
(
/
\.
.+$/
,
''
);
for
(
var
i
=
0
;
i
<
tun4in6
.
length
;
i
++
)
{
var
tr
=
tb
.
insertRow
(
-
1
);
var
network
=
tun4in6
[
i
].
network
;
var
network_len
=
tun4in6
[
i
].
networklen
;
var
network_bw
=
tun4in6
[
i
].
bandwidth
;
if
(
network_len
>=
32
)
continue
;
tr
.
className
=
'
cbi-section-table-row cbi-rowstyle-
'
+
((
rowcount
++
%
2
)
+
1
);
tr
.
insertCell
(
-
1
).
innerHTML
=
String
.
format
(
'
<a href="/cgi-bin/bmx6control?function=gwselect&node=%s"><img src="%s" /></a>
'
,
nodename
,
tunicon
);
tr
.
insertCell
(
-
1
).
innerHTML
=
nodename
;
tr
.
insertCell
(
-
1
).
innerHTML
=
network
+
'
/
'
+
network_len
;
tr
.
insertCell
(
-
1
).
innerHTML
=
network_bw
;
}
if
(
tb
.
rows
.
length
==
1
)
{
var
tr
=
tb
.
insertRow
(
-
1
);
tr
.
className
=
'
cbi-section-table-row
'
;
var
td
=
tr
.
insertCell
(
-
1
);
td
.
colSpan
=
4
;
td
.
innerHTML
=
'
<em><br /><%:There are no gateways announced in the network.%></em>
'
;
}
}
}
}
);
//]]>
</script>
<style>
div
.hideme
{
display
:
none
;
}
div
.info
{
background
:
#FFF
;
border
:
solid
1px
;
height
:
80px
;
display
:
block
;
overflow
:
auto
;
}
div
.inforow
{
text-align
:
left
;
display
:
inline-block
;
width
:
20%
;
margin
:
5px
;
vertical-align
:
top
;
}
#extra-info
ul
{
list-style
:
none
outside
none
;
margin-left
:
0em
;
}
</style>
<div
class=
"cbi-map"
>
<h2>
Originators
</h2>
<div
class=
"cbi-map-descr"
></div>
<fieldset
class=
"cbi-section"
>
<legend><
%
:Mesh
gateways
%
></legend>
<table
class=
"cbi-section-table"
id=
"descriptions_table"
>
<tr
class=
"cbi-section-table-titles"
>
<th
class=
"cbi-section-table-cell"
></th>
<th
class=
"cbi-section-table-cell"
><
%
:Node
%
></th>
<th
class=
"cbi-section-table-cell"
><
%
:Network
%
></th>
<th
class=
"cbi-section-table-cell"
><
%
:Bandwidth
%
></th>
</tr>
<tr
class=
"cbi-section-table-row"
>
<td
colspan=
"4"
><em><br
/><
%
:Collecting
data...
%
></em></td>
</tr>
</table>
</fieldset>
</div>
<
%+
footer
%
>
packages/bmx6-luci/files/usr/lib/lua/luci/view/bmx6/graph.htm
View file @
102b990b
...
...
@@ -45,10 +45,14 @@ $Id$
var
key
=
(
data
[
i
].
globalId
<
data
[
i
].
links
[
j
].
globalId
)
?
data
[
i
].
globalId
+
'
|
'
+
data
[
i
].
links
[
j
].
globalId
:
data
[
i
].
links
[
j
].
globalId
+
'
|
'
+
data
[
i
].
globalId
;
if
(
!
seen
[
key
])
var
rxRate
=
data
[
i
].
links
[
j
].
rxRate
;
var
txRate
=
data
[
i
].
links
[
j
].
txRate
;
if
(
!
seen
[
key
]
&&
rxRate
>
0
&&
txRate
>
0
)
{
g
.
addEdge
(
data
[
i
].
globalId
,
data
[
i
].
links
[
j
].
globalId
,
{
label
:
data
[
i
].
links
[
j
].
rxRate
+
'
/
'
+
data
[
i
].
links
[
j
].
txRate
,
{
label
:
rxRate
+
'
/
'
+
txRate
,
directed
:
false
,
stroke
:
'
#aaaaaa
'
,
fill
:
'
#ffffff
'
,
'
label-style
'
:
{
'
font-size
'
:
10
}});
seen
[
key
]
=
true
;
...
...
packages/bmx6-luci/files/usr/lib/lua/luci/view/bmx6/links.htm
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/view/bmx6/neighbours.htm
View file @
102b990b
packages/bmx6-luci/files/usr/lib/lua/luci/view/bmx6/neighbours_j.htm
View file @
102b990b
...
...
@@ -35,7 +35,7 @@
var
tr
=
tb
.
insertRow
(
-
1
);
var
nodename
=
descriptions
[
i
].
DESC_ADV
.
globalId
.
replace
(
/
\.[^\.]
+$/
,
""
);
tr
.
className
=
'
cbi-section-table-row cbi-rowstyle-
'
+
((
i
%
2
)
+
1
);
tr
.
insertCell
(
-
1
).
innerHTML
=
'
<a onclick="displayExtraInfo(
\'
ip-
'
+
i
+
'
\'
)"><img src=
\
"
/luci-static/
resource
s
/cbi/help.gif
\
" /></a>
'
;
tr
.
insertCell
(
-
1
).
innerHTML
=
'
<a onclick="displayExtraInfo(
\'
ip-
'
+
i
+
'
\'
)"><img src=
\
"
<%=
resource
%>
/cbi/help.gif
\
" /></a>
'
;
tr
.
insertCell
(
-
1
).
innerHTML
=
nodename
;
var
extensions
=
descriptions
[
i
].
DESC_ADV
.
extensions
;
...
...
@@ -59,8 +59,10 @@
var
gateways
=
'
<ul>
'
;
for
(
var
t
=
0
;
t
<
tun4in6
.
length
;
t
++
)
{
gateways
+=
"
<li>
"
+
tun4in6
[
t
].
network
+
'
/
'
+
tun4in6
[
t
].
networklen
+
'
|
'
;
gateways
+=
tun4in6
[
t
].
bandwidth
+
'
</li>
'
;
if
(
tun4in6
[
t
].
networklen
==
"
32
"
)
gateways
+=
'
<li><a href="http://
'
+
tun4in6
[
t
].
network
+
'
">
'
+
tun4in6
[
t
].
network
+
'
</a></li>
'
;
else
gateways
+=
"
<li>
"
+
tun4in6
[
t
].
network
+
'
/
'
+
tun4in6
[
t
].
networklen
+
'
|
'
+
tun4in6
[
t
].
bandwidth
+
'
</li>
'
;
}
gateways
+=
'
</ul>
'
;
...
...
@@ -103,11 +105,7 @@
tr
.
insertCell
(
-
1
).
innerHTML
=
originators
[
i
].
blocked
;
//tr.onclick = displayExtraInfo("ip-"+i);
extrainfo
=
'
<div id="ip-
'
+
i
+
'
" class="hideme">
'
;
extrainfo
+=
"
<div class='inforow'><br /><br /><h4>
"
+
nodename
+
'
</h4></div>
\n
'
;
extrainfo
+=
"
<div class='inforow'><h5>Available IPs</h5>
\n
<p>
"
+
ipstxt_hidden
+
"
</p></div>
\n
"
;
extrainfo
+=
"
<div class='inforow'><h5>Gateways announced</h5>
\n
<p>
"
+
gateways
+
"
</p></div>
\n
"
;
extrainfo
+=
"
<div class='inforow'><h5>Networks announced</h5>
\n
<p>
"
+
hna6list
+
"
</p></div>
\n
"
;
extrainfo
=
'
<div id="ip-
'
+
i
+
'
" class="hideme">
'
+
"
<div class='inforow'><br /><br /><h4>
"
+
nodename
+
'
</h4></div>
\n
'
+
"
<div class='inforow'><h5>Available IPs</h5>
\n
<p>
"
+
ipstxt_hidden
+
"
</p></div>
\n
"
+
"
<div class='inforow'><h5>Gateways announced</h5>
\n
<p>
"
+
gateways
+
"
</p></div>
\n
"
+
"
<div class='inforow'><h5>Networks announced</h5>
\n
<p>
"
+
hna6list
+
"
</p></div>
\n
"
;
extrainfo
+=
"
\n
</div>
"
;
...
...
@@ -141,15 +139,15 @@
height
:
80px
;
display
:
block
;
overflow
:
auto
;
text-align
:
center
;
}
div
.inforow
{
text-align
:
left
;
text-align
:
center
;
display
:
inline-block
;
width
:
20%
;
margin
:
5px
;
vertical-align
:
top
;
}
#extra-info
ul
{
list-style
:
none
outside
none
;
margin-left
:
0em
;
}
...
...
@@ -161,7 +159,7 @@
<div
class=
"cbi-map-descr"
></div>
<div
id=
"extra-info"
class=
"info"
>
<br
/>
Click to the icon
<img
src=
"
/luci-static/
resource
s
/cbi/help.gif"
/>
to see individual node information
Click to the icon
<img
src=
"
<%=
resource
%>
/cbi/help.gif"
/>
to see individual node information
</div>
<fieldset
class=
"cbi-section"
>
<legend><
%
:Mesh
nodes
%
></legend>
...
...
packages/bmx6-luci/files/www/cgi-bin/bmx6-info
View file @
102b990b
packages/bmx6-qmp/Makefile
View file @
102b990b
...
...
@@ -32,12 +32,12 @@ Public Sources:
#PKG_SOURCE_URL:=git://git.bmx6.net/bmx6.git
PKG_SOURCE_URL
:=
git://github.com/axn/bmx6.git
PKG_REV
:=
9e322f29d36dc6f6645428a6f4ae94999caa3343
PKG_REV
:=
f49d102a6738b51aa936a4059e3e76136a32c582
Private Sources
:
#PKG_SOURCE_URL:=file:///usr/src/bmx6/bmx6-private.git
PKG_VERSION
:=
r2012
0828
01
PKG_VERSION
:=
r2012
1014
01
PKG_RELEASE
:=
3
#PKG_INSTALL:=1 # this tries to install straight to /usr/sbin/bmx6
...
...
packages/gwck-qmp/patches/010-adapt-to-new-bmx6
0 → 100644
View file @
102b990b
--- 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")"
packages/gwck-qmp/patches/011-masquerade_ipv4.patch
0 → 100644
View file @
102b990b
diff --git a/etc/gwck/gwck_conf_qmp_ipv4 b/etc/gwck/gwck_conf_qmp_ipv4
index ed28194..ac79dc4 100644
--- a/etc/gwck/gwck_conf_qmp_ipv4
+++ b/etc/gwck/gwck_conf_qmp_ipv4
@@ -137,6 +137,9 @@
done
iface="$(ip route | grep "^default" | grep -v "bmx6_out" | sed -n -e 's/.* dev \([^ ]\+\) .*/\1/gp')"
if [ -n "$iface" ] && ! echo "$iface" | grep -q " "
then
+ log "Masquerading via iptables"
+ iptables -A POSTROUTING -t nat -o $iface -j MASQUERADE
+
log "Clamping the MSS via iptables"
iptables -I FORWARD -o $iface -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
fi
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment