ucentral: development update

* update schema
* update openNDS
* mac80211 fix

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2021-05-21 13:47:14 +02:00
parent a0588cd3be
commit a8eeaf768e
9 changed files with 154 additions and 138 deletions

View File

@@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=opennds
PKG_FIXUP:=autoreconf
PKG_VERSION:=8.1.1
PKG_VERSION:=9.0.0
PKG_RELEASE:=1
PKG_SOURCE_URL:=https://codeload.github.com/opennds/opennds/tar.gz/v$(PKG_VERSION)?
PKG_SOURCE:=opennds-$(PKG_VERSION).tar.gz
PKG_HASH:=9e0ede334755dc95a4133a94304f4294b956d4849c48c5521f12b4ed295e356f
PKG_HASH:=466dbd78a9464d56f6bf8c8374071e4c21854700a8176a47e72e23930e4271b2
PKG_BUILD_DIR:=$(BUILD_DIR)/openNDS-$(PKG_VERSION)
PKG_MAINTAINER:=Rob White <rob@blue-wave.net>
@@ -21,7 +21,6 @@ PKG_LICENSE:=GPL-2.0+
include $(INCLUDE_DIR)/package.mk
define Package/opennds
SUBMENU:=Captive Portals
SECTION:=net
@@ -42,26 +41,27 @@ define Package/opennds/description
endef
define Package/opennds/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/opennds $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ndsctl $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/opennds/htdocs/images
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/usr/lib/opennds
$(CP) $(PKG_BUILD_DIR)/resources/splash.html $(1)/etc/opennds/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/splash.css $(1)/etc/opennds/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/status.html $(1)/etc/opennds/htdocs/
$(CP) $(PKG_BUILD_DIR)/resources/splash.jpg $(1)/etc/opennds/htdocs/images/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/config/opennds $(1)/etc/config/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/config/opennds $(1)/etc/opennds/config.uci
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/init.d/opennds $(1)/etc/init.d/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/etc/uci-defaults/40_opennds $(1)/etc/uci-defaults/
$(CP) $(PKG_BUILD_DIR)/linux_openwrt/opennds/files/usr/lib/opennds/restart.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/binauth/binauth_log.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/login.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/libopennds.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_click-to-continue-basic.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_click-to-continue-custom-placeholders.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_user-email-login-basic.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/PreAuth/theme_user-email-login-custom-placeholders.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/get_client_interface.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/get_client_token.sh $(1)/usr/lib/opennds/
$(CP) $(PKG_BUILD_DIR)/forward_authentication_service/libs/client_params.sh $(1)/usr/lib/opennds/

View File

@@ -1,16 +0,0 @@
Index: openNDS-8.1.1/linux_openwrt/opennds/files/etc/init.d/opennds
===================================================================
--- openNDS-8.1.1.orig/linux_openwrt/opennds/files/etc/init.d/opennds
+++ openNDS-8.1.1/linux_openwrt/opennds/files/etc/init.d/opennds
@@ -183,6 +183,11 @@ start_service() {
config_foreach create_instance opennds
}
+service_triggers()
+{
+ procd_add_reload_trigger "opennds"
+}
+
stop_service() {
# When procd terminates opennds, it does not exit fast enough.
# Otherwise procd will restart opennds twice. First time starting

View File

@@ -0,0 +1,17 @@
Index: openNDS-9.0.0/linux_openwrt/opennds/files/etc/init.d/opennds
===================================================================
--- openNDS-9.0.0.orig/linux_openwrt/opennds/files/etc/init.d/opennds
+++ openNDS-9.0.0/linux_openwrt/opennds/files/etc/init.d/opennds
@@ -182,3 +182,12 @@ stop_service() {
# opennds fails, second time it succeeds.
sleep 1
}
+
+reload_service() {
+ restart
+}
+
+service_triggers()
+{
+ procd_add_reload_trigger "opennds"
+}

View File

@@ -0,0 +1,122 @@
{
"uuid": 1,
"radios": [
{
"band": "6G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 80
},
{
"band": "5G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 80
},
{
"band": "2G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 80
}
],
"interfaces": [
{
"name": "WAN",
"role": "upstream",
"ethernet": [
{
"select-ports": [
"WAN*"
]
}
],
"ipv4": {
"addressing": "dynamic"
},
"ssids": [
{
"name": "OpenWifi",
"wifi-bands": [
"5G",
"2G"
],
"bss-mode": "ap",
"encryption": {
"proto": "psk2",
"key": "OpenWifi",
"ieee80211w": "optional"
},
"roaming": {
"message-exchange": "ds",
"generate-psk": true
}
}
]
},
{
"name": "LAN",
"role": "downstream",
"ethernet": [
{
"select-ports": [
"LAN*"
]
}
],
"ipv4": {
"addressing": "static",
"subnet": "192.168.1.1/24",
"dhcp": {
"lease-first": 10,
"lease-count": 100,
"lease-time": "6h"
}
}
},
{
"name": "captive",
"role": "downstream",
"captive": {
"max-clients": 32
},
"ipv4": {
"addressing": "static",
"subnet": "192.168.2.1/24",
"dhcp": {
"lease-first": 10,
"lease-count": 100,
"lease-time": "6h"
}
},
"ssids": [
{
"name": "Maverick",
"wifi-bands": [
"5G",
"2G"
],
"bss-mode": "ap",
"encryption": {
"proto": "none",
"ieee80211w": "optional"
},
"roaming": {
"message-exchange": "ds",
"generate-psk": true
}
}
]
}
],
"metrics": {
"statistics": {
"interval": 120,
"types": [ "ssids", "lldp", "clients" ]
},
"health": {
"interval": 120
}
}
}

View File

@@ -1,23 +1,12 @@
{
"uuid": 1,
"radios": [
{
"band": "6G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 80
},
{
"band": "5G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 80
},
{
"band": "2G",
"country": "CA",
"channel-mode": "HE",
"channel-width": 80
"channel-width": 80,
"channel": 32
}
],
@@ -39,18 +28,13 @@
{
"name": "OpenWifi",
"wifi-bands": [
"5G",
"2G"
"5G"
],
"bss-mode": "ap",
"encryption": {
"proto": "psk2",
"key": "OpenWifi",
"ieee80211w": "optional"
},
"roaming": {
"message-exchange": "ds",
"generate-psk": true
}
}
]

View File

@@ -15,6 +15,7 @@ config_load dhcp
config_foreach section_del dhcp dhcp
config_load firewall
config_foreach section_del rule firewall
config_foreach section_del zone firewall
config_foreach section_del forwarding firewall

View File

@@ -1,3 +1,3 @@
#!/bin/sh
uci set opennds.@opennds[-1].enabled=0
uci delete opennds.@opennds[-1]

View File

@@ -6,7 +6,7 @@ PKG_RELEASE:=1
PKG_SOURCE_URL=https://github.com/blogic/ucentral-schema.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-02-15
PKG_SOURCE_VERSION:=72978e949b093fbef1d38e01738afd764a227887
PKG_SOURCE_VERSION:=fd626c67dba508d6f2d6735ac2d0e8fc1ae8bbe8
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
PKG_LICENSE:=BSD-3-Clause

View File

@@ -118,63 +118,6 @@ mac80211_add_he_capabilities() {
IFS="$oifs"
}
mac80211_get_seg0() {
local ht_mode="$1"
local seg0=0
case "$ht_mode" in
40)
if [ $freq -gt 5950 ] && [ $freq -le 7115 ]; then
case "$(( ($channel / 4) % 2 ))" in
1) seg0=$(($channel - 2));;
0) seg0=$(($channel + 2));;
esac
elif [ $freq != 5935 ]; then
case "$(( ($channel / 4) % 2 ))" in
1) seg0=$(($channel + 2));;
0) seg0=$(($channel - 2));;
esac
fi
;;
80)
if [ $freq -gt 5950 ] && [ $freq -le 7115 ]; then
case "$(( ($channel / 4) % 4 ))" in
0) seg0=$(($channel + 6));;
1) seg0=$(($channel + 2));;
2) seg0=$(($channel - 2));;
3) seg0=$(($channel - 6));;
esac
elif [ $freq != 5935 ]; then
case "$(( ($channel / 4) % 4 ))" in
1) seg0=$(($channel + 6));;
2) seg0=$(($channel + 2));;
3) seg0=$(($channel - 2));;
0) seg0=$(($channel - 6));;
esac
fi
;;
160)
if [ $freq -gt 5950 ] && [ $freq -le 7115 ]; then
case "$channel" in
1|5|9|13|17|21|25|29) seg0=15;;
33|37|41|45|49|53|57|61) seg0=47;;
65|69|73|77|81|85|89|93) seg0=79;;
97|101|105|109|113|117|121|125) seg0=111;;
129|133|137|141|145|149|153|157) seg0=143;;
161|165|169|173|177|181|185|189) seg0=175;;
193|197|201|205|209|213|217|221) seg0=207;;
esac
elif [ $freq != 5935 ]; then
case "$channel" in
36|40|44|48|52|56|60|64) seg0=50;;
100|104|108|112|116|120|124|128) seg0=114;;
esac
fi
;;
esac
printf "$seg0"
}
mac80211_hostapd_setup_base() {
local phy="$1"
@@ -422,43 +365,8 @@ mac80211_hostapd_setup_base() {
# 802.11ax
enable_ax=0
case "$htmode" in
HE20) enable_ax=1
if [ $freq -gt 5950 ] && [ $freq -le 7115 ]; then
append base_cfg "op_class=131" "$N"
fi
;;
HE40)
HE20|HE40|HE80| HE160)
enable_ax=1
idx="$(mac80211_get_seg0 "40")"
if [ $freq -ge 5180 ] && [ $freq != 5935 ]; then
if [ $freq -gt 5950 ] && [ $freq -le 7115 ]; then
append base_cfg "op_class=132" "$N"
fi
append base_cfg "he_oper_chwidth=0" "$N"
append base_cfg "he_oper_centr_freq_seg0_idx=$idx" "$N"
fi
;;
HE80)
enable_ax=1
idx="$(mac80211_get_seg0 "80")"
if [ $freq != 5935 ]; then
if [ $freq -gt 5950 ] && [ $freq -le 7115 ]; then
append base_cfg "op_class=133" "$N"
fi
append base_cfg "he_oper_chwidth=1" "$N"
append base_cfg "he_oper_centr_freq_seg0_idx=$idx" "$N"
fi
;;
HE160)
enable_ax=1
idx="$(mac80211_get_seg0 "160")"
if [ $freq != 5935 ]; then
if [ $freq -gt 5950 ] && [ $freq -le 7115 ]; then
append base_cfg "op_class=134" "$N"
fi
append base_cfg "he_oper_chwidth=2" "$N"
append base_cfg "he_oper_centr_freq_seg0_idx=$idx" "$N"
fi
;;
esac