Developing lightweight computation at the DSG edge

Commit 3877dffe authored by Axel Neumann's avatar Axel Neumann
Browse files

bmx6-qmp qmp-small-node bmx6-luci: towards tunXIn and Out...

parent 26a796ce
......@@ -20,7 +20,7 @@ general.addremove = false
general:option(Value,"globalPrefix","Global ip prefix","Specify global prefix for interfaces: NETADDR/LENGTH")
if m:get("ipVersion","ipVersion") == "6" then
general:option(Value,"niitSource","Ipv4 niit source","Specify niit4to6 source IP address (IP MUST be assigned to niit4to6 interface!)")
general:option(Value,"tun4Address","NIIT IPv4 tunnel address","specify default IPv4 tunnel address and announced range (IP SHOULD be assigned to niit4to6 interface!)")
end
-- IP section
......
......@@ -12,15 +12,15 @@ PKG_NAME:=bmx6-qmp
PKG_SOURCE_PROTO:=git
#Public Sources:
Public Sources:
PKG_SOURCE_URL:=git://git.bmx6.net/bmx6.git
PKG_REV:=b8931fcda4b643431d724914909d63e87d21967c
PKG_REV:=e761095012ee4ce102b67f27881cb9ab279c2e1d
#Private Sources:
#PKG_SOURCE_URL:=file:///usr/src/bmx6/bmx6-private.git
#PKG_REV:=ba3ef22f1d0521d593098fd8ae97e5ab2844e152
#PKG_REV:=e761095012ee4ce102b67f27881cb9ab279c2e1d
PKG_VERSION:=r2011090801
PKG_VERSION:=r2011101304
#PKG_RELEASE:=1
#PKG_INSTALL:=1 # this tries to install straight to /usr/sbin/bmx6
......
......@@ -2,7 +2,7 @@
config 'bmx6' 'general'
# option 'runtimeDir' '/var/run/bmx6'
# option 'niitSource' '10.202.0.116'
# option 'tun4Address' '10.202.0.116/32'
#config 'ipVersion' 'ipVersion'
# option 'ipVersion' '6' # default is 4
......@@ -17,7 +17,4 @@ config 'dev' 'mesh_2'
#config 'hna' 'my_global_prefix'
# option 'hna' '2012:0:0:74:0:0:0:0/64'
#config 'hna' 'niit6to4'
# option 'hna' '0:0:0:0:0:ffff:10.202.0.116/128'
## this config should work for Routerstation(PRO), Alix, Fonera, ...
config 'qmp' 'interfaces'
option 'lan_devices' 'eth0'
option 'wan_device' 'eth1'
option 'mesh_devices' 'eth0 wlan0 wlan1 wlan2'
# option 'configure_switch' 'eth0' # (uncomment line if available, e.g. WGT634U)
option 'lan_devices' 'eth0' # will be used as is!
option 'wan_device' 'eth1' # will be used as is!
option 'mesh_devices' 'eth0 wlan0 wlan1 wlan2' # will be extended by vlan tag!
config 'qmp' 'node'
# option community_node_id 901 # [0x0100..0xFFFF] if commented out then community_node_id will be
# autoconfigured based on last byte of MAC address, thus: [0x000..0x0FF]
config 'qmp' 'networks'
option 'niit_prefix96' '0:0:0:0:0:ffff'
option 'mesh_protocol_vids' 'olsr6:1 bmx6:2'
option 'lan_address' '192.168.22.1'
option 'lan_netmask' '255.255.255.0'
option 'niit_prefix96' '0:0:0:0:0:ffff' # omit trailing 32 ipv4 bits !
option 'mesh_protocol_vids' 'olsr6:1 bmx6:2' # means olsr6 use vlantag 10+1, bmx6 use vlantag 10+2
option 'mesh_vid_offset' '10'
option 'olsr6_mesh_prefix48' 'fd01:0:0'
option 'olsr6_ripe_prefix48' '2011:0:0'
option 'olsr6_ipv4_prefix24' '10.201'
option 'bmx6_mesh_prefix48' 'fd02:0:0'
option 'bmx6_ripe_prefix48' '2012:0:0'
option 'bmx6_ipv4_prefix24' '10.202'
# option 'olsr6_ipv4_address' '10.201.9.01'
# option 'olsr6_ipv4_netmask' '255.255.255.0'
# option 'olsr6_6to4_netmask' '120'
option 'bmx6_mesh_prefix48' 'fd02:0:0'
option 'bmx6_ripe_prefix48' '2012:0:0' # suffix is autoconfigured based on community_node_id
option 'bmx6_ipv4_prefix24' '10.202'
# option 'bmx6_ipv4_address' '10.202.9.01/24' # if commented out then option is autoconfigured based on
# community_node_id and bmx6_ipv4_prefix
option 'babel_mesh_prefix48' 'fd03:0:0'
config 'qmp' 'tunnels'
option 'search_ipv4_tunnel' '0.0.0.0/0'
option 'search_ipv6_tunnel' '::/0'
# option 'offer_ipv4_tunnel' '0.0.0.0/0'
# option 'offer_ipv6_tunnel' '::/0'
config 'qmp' 'wireless'
option 'driver' 'mac80211'
option 'driver' 'mac80211'
option 'country' 'UZ'
option 'bssid' '02:CA:FF:EE:BA:BE'
option 'bssid' '02:CA:FF:EE:BA:BE'
config 'wireless'
option 'mode' 'adhoc'
option 'name' 'qMp'
option 'name' 'qMp'
config 'wireless'
option 'mode' 'ap'
option 'name' 'qMp-AP'
option 'name' 'qMp-AP'
config 'wireless'
option 'mode' 'adhoc'
option 'name' 'qMp'
option 'name' 'qMp'
......@@ -284,7 +284,11 @@ qmp_get_ula96() {
local mac=$( qmp_get_mac_for_dev $dev_mac )
local ula96=$( qmp_calculate_ula96 $prefix $mac $suffix )
echo "$ula96/$mask"
if [ -z "$mask" ] ; then
echo "$ula96"
else
echo "$ula96/$mask"
fi
}
......@@ -292,7 +296,6 @@ qmp_get_ula96() {
qmp_get_addr64() {
local prefix=$1
......@@ -420,8 +423,8 @@ qmp_configure_network() {
uci set $conf.lan.ifname="$(uci get qmp.interfaces.lan_devices)"
# uci set $conf.lan.type="bridge"
uci set $conf.lan.proto="static"
uci set $conf.lan.ipaddr="192.168.1.1"
uci set $conf.lan.netmask="255.255.255.0"
uci set $conf.lan.ipaddr="$(uci get qmp.networks.lan_address)"
uci set $conf.lan.netmask="$(uci get qmp.networks.lan_netmask)"
if qmp_uci_test qmp.interfaces.mesh_devices && qmp_uci_test qmp.networks.mesh_protocol_vids; then
......@@ -489,8 +492,6 @@ qmp_configure_network() {
qmp_configure_bmx6() {
# set -x
local conf="bmx6"
......@@ -538,10 +539,10 @@ qmp_configure_bmx6() {
uci set $conf.mesh_$counter.dev="$ifname"
if qmp_uci_test qmp.networks.bmx6_ipv4_address ; then
uci set $conf.general.niitSource="$(uci get qmp.networks.bmx6_ipv4_address)"
uci set $conf.general.tun4Address="$(uci get qmp.networks.bmx6_ipv4_address)"
elif qmp_uci_test qmp.networks.bmx6_ipv4_prefix24 ; then
local ipv4_suffix24="$(( 0x$community_node_id / 0x100 )).$(( 0x$community_node_id % 0x100 ))"
uci set $conf.general.niitSource="$(uci get qmp.networks.bmx6_ipv4_prefix24).$ipv4_suffix24"
uci set $conf.general.tun4Address="$(uci get qmp.networks.bmx6_ipv4_prefix24).$ipv4_suffix24/32"
fi
counter=$(( $counter + 1 ))
......@@ -553,24 +554,35 @@ qmp_configure_bmx6() {
if qmp_uci_test qmp.networks.bmx6_ripe_prefix48 ; then
uci set $conf.ripe="hna"
uci set $conf.ripe.hna="$(uci get qmp.networks.bmx6_ripe_prefix48):$community_node_id:0:0:0:0/64"
uci set $conf.general.tun6Address="$(uci get qmp.networks.bmx6_ripe_prefix48):$community_node_id:0:0:0:1/64"
fi
if qmp_uci_test qmp.networks.niit_prefix96 ; then
if qmp_uci_test qmp.tunnels.search_ipv6_tunnel ; then
uci set $conf.tun6Out="tunOut"
uci set $conf.tun6Out.tunOut="tun6Out"
uci set $conf.tun6Out.network="$(uci get qmp.tunnels.search_ipv6_tunnel)"
fi
if qmp_uci_test qmp.networks.bmx6_ipv4_address && qmp_uci_test qmp.networks.bmx6_ipv4_netmask && qmp_uci_test qmp.networks.bmx6_6to4_netmask; then
local niit6to4_address="$(qmp_get_ip6_slow $(uci get qmp.networks.niit_prefix96):$(uci get qmp.networks.bmx6_ipv4_address)/$(uci get qmp.networks.bmx6_6to4_netmask))"
uci set $conf.niit6to4="hna"
uci set $conf.niit6to4.hna="$niit6to4_address/$(uci get qmp.networks.bmx6_6to4_netmask)"
elif qmp_uci_test qmp.networks.bmx6_ipv4_prefix24; then
local niit6to4_address="$(uci get qmp.networks.niit_prefix96):$(uci get qmp.networks.bmx6_ipv4_prefix24).$(( 0x$community_node_id / 0x100 )).$(( 0x$community_node_id % 0x100 ))"
uci set $conf.niit6to4="hna"
uci set $conf.niit6to4.hna="$niit6to4_address/128"
fi
if qmp_uci_test qmp.tunnels.search_ipv4_tunnel ; then
uci set $conf.tun4Out="tunOut"
uci set $conf.tun4Out.tunOut="tun4Out"
uci set $conf.tun4Out.network="$(uci get qmp.tunnels.search_ipv4_tunnel)"
elif qmp_uci_test qmp.tunnels.offer_ipv4_tunnel ; then
uci set $conf.tunInRemote="tunInRemote"
uci set $conf.tunInRemote.tunInRemote="$(qmp_get_ula96 $(uci get qmp.networks.bmx6_mesh_prefix48):: $primary_mesh_device 2002::ffff )"
uci set $conf.tun4InNet="tunInNet"
uci set $conf.tun4InNet.tunInNet="$(uci get qmp.tunnels.offer_ipv4_tunnel)"
uci set $conf.tun4InNet.bandwidth="1000000"
fi
uci commit $conf
# /etc/init.d/$conf restart
}
......
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