diff --git a/feeds/ucentral/ucentral-event/files/ucentral-event b/feeds/ucentral/ucentral-event/files/ucentral-event index 1c22baa4e..630b8d76d 100755 --- a/feeds/ucentral/ucentral-event/files/ucentral-event +++ b/feeds/ucentral/ucentral-event/files/ucentral-event @@ -78,7 +78,8 @@ function event(object, verb, payload) { }); } -let handlers = { +let handlers; +handlers = { 'sta-authorized': function(notify, hapd) { /* force FDB flush on QCA Wifi-6 silicon */ system(`echo ${notify.data.address} > /sys/kernel/debug/ssdk_flush_mac`); @@ -118,7 +119,30 @@ let handlers = { }); }, + vlan_add_swconfig: function(notify) { + let msg = { + name: notify.data.ifname, + 'link-ext': true, + vlan: [ `${notify.data.vlan_id}:u` ] + }; + ubus.call('network.interface.up_none', 'add_device', msg); + + msg = { + name: 'eth0.' + notify.data.vlan_id, + vlan: [ `${notify.data.vlan_id}:u` ] + }; + + ubus.call('network.interface.up_none', 'add_device', msg); + + let cmd = 'swconfig dev ' + config.config.swconfig + ' vlan ' + notify.data.vlan_id + ' set ports \"' + join(' ', config.config.swconfig_ports) + '\"'; + system(cmd); + system('swconfig dev ' + config.config.swconfig + ' set apply'); + }, + vlan_add: function(notify) { + if (config.config.swconfig) + return handlers.vlan_add_swconfig(notify); + for (let wan in wan_ports) { let msg = { name: wan, diff --git a/feeds/ucentral/ucentral-schema/Makefile b/feeds/ucentral/ucentral-schema/Makefile index 7abc3b7d0..7357dc867 100644 --- a/feeds/ucentral/ucentral-schema/Makefile +++ b/feeds/ucentral/ucentral-schema/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=ucentral-schema PKG_RELEASE:=1 PKG_SOURCE_URL=https://github.com/Telecominfraproject/wlan-ucentral-schema.git -PKG_MIRROR_HASH:=e5f1001047a601d68c236be740470766dbeab40852093d3c57102a2edc761eb2 +PKG_MIRROR_HASH:=b755e945d2e50f2c3607d44492227b41c4d38026068ad7dd554be5c4412772ce PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2022-05-29 -PKG_SOURCE_VERSION:=75222fea7044e4b08a870aeb3284838efd7b6d9f +PKG_SOURCE_VERSION:=9338ea9cefeec3f4bf40cd1f7d0755f6caa131fb PKG_MAINTAINER:=John Crispin PKG_LICENSE:=BSD-3-Clause diff --git a/feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/multi-psk.json b/feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/multi-psk.json index 2cc552052..924098308 100644 --- a/feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/multi-psk.json +++ b/feeds/ucentral/ucentral-schema/files/etc/ucentral/examples/multi-psk.json @@ -34,27 +34,6 @@ ], "ipv4": { "addressing": "dynamic" - } - }, - { - "name": "LAN", - "role": "downstream", - "services": [ "http", "ssh" ], - "ethernet": [ - { - "select-ports": [ - "LAN*" - ] - } - ], - "ipv4": { - "addressing": "static", - "subnet": "192.168.1.1/24", - "dhcp": { - "lease-first": 10, - "lease-count": 100, - "lease-time": "6h" - } }, "ssids": [ { @@ -84,6 +63,27 @@ } } ] + }, + { + "name": "LAN", + "role": "downstream", + "services": [ "http", "ssh" ], + "ethernet": [ + { + "select-ports": [ + "LAN*" + ] + } + ], + "ipv4": { + "addressing": "static", + "subnet": "192.168.1.1/24", + "dhcp": { + "lease-first": 10, + "lease-count": 100, + "lease-time": "6h" + } + } } ], "services": { diff --git a/feeds/ucentral/ucentral-state/files/ucentral-state b/feeds/ucentral/ucentral-state/files/ucentral-state index 428d39ad5..67a6edcbb 100755 --- a/feeds/ucentral/ucentral-state/files/ucentral-state +++ b/feeds/ucentral/ucentral-state/files/ucentral-state @@ -184,6 +184,7 @@ let state_handler = { let ubus_methods = { set: { call: function(req) { + ulog(LOG_INFO, 'state %s -> %s\n', current_state, req.args.state); if (current_state == req.args.state) return; if (!state_handler[req.args.state])