Developing lightweight computation at the DSG edge

Commit fbff072f authored by p4u's avatar p4u
Browse files

Node ID is autoconfigured according the primary_device eth0. New web section Node

parent 9824ca07
## this config should work for Routerstation(PRO), Alix, Fonera, ...
config 'qmp' 'interfaces'
# option 'configure_switch' 'eth0' # (uncomment line if available, e.g. WGT634U)
option 'lan_devices' 'eth0 wlan1' # will be used as is!
option 'wan_device' 'eth1' # will be used as is!
option 'wan_devices' 'eth1' # will be used as is!
option 'mesh_devices' 'wlan0 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]
option 'primary_device' 'eth0'
option 'community_id' 'qmp'
option 'community_node_id' ''
option 'key' '/tmp/qmp_key'
config 'qmp' 'non_overlapping'
......@@ -68,3 +67,4 @@ config 'wireless'
config 'wireless'
option 'mode' 'adhoc'
option 'name' 'qMp.cat'
......@@ -56,6 +56,10 @@ configure_network() {
apply_netserver
}
configure_system() {
qmp_configure_system
}
enable_ns_ppt() {
echo 8 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio8/direction
......@@ -70,6 +74,7 @@ help() {
echo " search_default_gw : Search for a default gw in the network"
echo " configure_wifi : Configure and apply current wifi settings"
echo " configure_network : Configure and apply current network settings"
echo " configure_system : Configure and apply current system settings (qmp.node section and so on)"
echo " apply_netserver : Start/stop nerserver depending on qmp configuration"
echo " enable_ns_ppt : Enable POE passtrought from NanoStation M2/5 devices. Be careful with this"
echo ""
......
......@@ -398,6 +398,7 @@ qmp_configure_network() {
if qmp_uci_test qmp.interfaces.wan_device ; then
uci set $conf.wan="interface"
uci set $conf.wan.ifname="$(uci get qmp.interfaces.wan_device)"
uci set $conf.wan.type="bridge"
uci set $conf.wan.proto="dhcp"
fi
......@@ -634,17 +635,6 @@ qmp_configure_bmx6() {
# /etc/init.d/$conf restart
}
qmp_configure_olsr6() {
local conf="olsrd"
......@@ -753,11 +743,6 @@ EOF
}
qmp_configure_olsr6_uci_unused() {
local conf="olsrd_uci"
......@@ -823,15 +808,20 @@ qmp_configure_olsr6_uci_unused() {
qmp_configure_system() {
local primary_mesh_device="$(uci get qmp.interfaces.mesh_devices | awk '{print $1}')"
local primary_device="$(uci get qmp.node.primary_device)"
[ -z "$primary_device" ] && primary_device="eth0"
local community_node_id
if qmp_uci_test qmp.node.community_node_id; then
community_node_id="$(uci get qmp.node.community_node_id)"
elif ! [ -z "$primary_mesh_device" ] ; then
community_node_id="$( qmp_get_mac_for_dev $primary_mesh_device | awk -F':' '{print $6}' )"
else
community_node_id="$(qmp_get_mac_for_dev $primary_device | awk -F':' '{print $6}' )"
fi
uci set system.@system[0].hostname=qmp${community_node_id}
local community_id="$(uci get qmp.node.community_id)"
[ -z "$community_id" ] && community_id="qmp"
uci set system.@system[0].hostname=${community_id}${community_node_id}
uci commit system
# enable IPv6 in httpd:
......
......@@ -65,7 +65,7 @@ for i,l in ipairs(eth_int) do
end
-- Option wan_device
wan = eth_section:option(ListValue, "wan_device", "WAN device","This device will be used for internet or any other gateway connection")
wan = eth_section:option(ListValue, "wan_devices", "WAN devices","These devices will be used for internet or any other gateway connection")
for i,w in ipairs(eth_int) do
wan:value(w,w)
end
......
......@@ -82,6 +82,7 @@ for _,wdev in ipairs(wdevs) do
mode = s_wireless:option(ListValue,"mode","Mode")
mode:value("adhoc","Ad-Hoc")
mode:value("ap","Access Point")
mode:value("client","Client")
mode:value("none","Not used")
-- Name
......
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