mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
104 Commits
netmode_de
...
map-1905
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac27b5519d | ||
|
|
cb4830aeb0 | ||
|
|
e5b7fe27d9 | ||
|
|
731cb728f2 | ||
|
|
feac6e8bc4 | ||
|
|
6c28dfe752 | ||
|
|
67228d4f90 | ||
|
|
2a6bfbdbe2 | ||
|
|
613d9f8d94 | ||
|
|
a88ac21e2e | ||
|
|
3169647767 | ||
|
|
5da3f9f82d | ||
|
|
a2df8d6594 | ||
|
|
07f549767e | ||
|
|
9f5d1bec50 | ||
|
|
f10138ab77 | ||
|
|
a5aab9dbf1 | ||
|
|
33b89c0ae7 | ||
|
|
c53ea32d91 | ||
|
|
f371cc2757 | ||
|
|
eaca767e15 | ||
|
|
7e9fa24351 | ||
|
|
22f1cc7569 | ||
|
|
ffe336f658 | ||
|
|
83a96ee602 | ||
|
|
375aa550e5 | ||
|
|
1e8f4fce8f | ||
|
|
7e8b7609cc | ||
|
|
bc34e5de25 | ||
|
|
75ed0959dd | ||
|
|
b24a7960ac | ||
|
|
1cf1b9e3b0 | ||
|
|
b5c88429a6 | ||
|
|
f8ecf6648b | ||
|
|
065449503c | ||
|
|
0602ccee21 | ||
|
|
9ca99f440d | ||
|
|
48948ede9b | ||
|
|
fd7e0a080e | ||
|
|
526c90911f | ||
|
|
a81928ce17 | ||
|
|
549826df1b | ||
|
|
44175caeb6 | ||
|
|
2c1c53e924 | ||
|
|
bf349c1436 | ||
|
|
5fa417b933 | ||
|
|
edd3d1652d | ||
|
|
b0f9ecbd13 | ||
|
|
de2631da4c | ||
|
|
a80498c137 | ||
|
|
261fb56475 | ||
|
|
8fd1f1b04f | ||
|
|
b840fb1fa5 | ||
|
|
8423ec95eb | ||
|
|
09258992ee | ||
|
|
432cb96b9c | ||
|
|
353fa426d2 | ||
|
|
924650e448 | ||
|
|
0db2e87bdc | ||
|
|
4c1277ec8a | ||
|
|
bcfc2335ff | ||
|
|
6ec3726ae6 | ||
|
|
63e0733c04 | ||
|
|
cc7fd5fcee | ||
|
|
a64fec1a35 | ||
|
|
8768c06dc9 | ||
|
|
01f8ba48e8 | ||
|
|
fc5f5cec8e | ||
|
|
ee621bf006 | ||
|
|
55321785a2 | ||
|
|
9435275d68 | ||
|
|
9e77c0ea88 | ||
|
|
887fbafd1c | ||
|
|
6542588fcf | ||
|
|
e616238c53 | ||
|
|
82a187a0c9 | ||
|
|
62af5545e0 | ||
|
|
7615130db2 | ||
|
|
127f88ba85 | ||
|
|
b796fc3293 | ||
|
|
c4d3f2d82e | ||
|
|
b4df9fa184 | ||
|
|
2484d38415 | ||
|
|
3ea4036d4a | ||
|
|
d1c7b1f0c5 | ||
|
|
e7019bf759 | ||
|
|
bc0af9746d | ||
|
|
c22499fa58 | ||
|
|
5daa2811d9 | ||
|
|
7f009d785a | ||
|
|
84093637e7 | ||
|
|
a90a982b77 | ||
|
|
0bfdb66148 | ||
|
|
b6ea95712a | ||
|
|
f9f652077e | ||
|
|
0a0c8aac05 | ||
|
|
6d269e8e08 | ||
|
|
33b0257e1a | ||
|
|
4e62f579bc | ||
|
|
b3536c8538 | ||
|
|
520b059e7b | ||
|
|
6ffef3c757 | ||
|
|
e159a19adc | ||
|
|
9250fe2302 |
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=1.2-2020-03-29
|
||||
PKG_VERSION:=1.2-2020-05-12
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=231350c496e3cd7cf62b6287c09c1f2834d41488
|
||||
PKG_SOURCE_VERSION:=80652051f58e5070cd047594599ae4a82257d18f
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -16,7 +16,6 @@ PKG_NAME:=dectmngr2
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -4,7 +4,5 @@ uci -q batch <<-EOT
|
||||
set firewall.easyqos=include
|
||||
set firewall.easyqos.path=/etc/firewall.easyqos
|
||||
set firewall.easyqos.reload=1
|
||||
uci del_list firewall.easyqos._access_w="root"
|
||||
uci add_list firewall.easyqos._access_w="root"
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
70
easy-soc-events/Makefile
Executable file
70
easy-soc-events/Makefile
Executable file
@@ -0,0 +1,70 @@
|
||||
# All rights reserved.
|
||||
# See LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=easy-soc-events
|
||||
PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
|
||||
PKG_SOURCE_VERSION:=f340418462d0aa119f8009d4321f18dc9c4e47b1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
-include $(TOPDIR)/.config
|
||||
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
|
||||
LINUX_DIR=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.1
|
||||
LINUXINCLUDE=-Iarch/$(LINUX_KARCH)/mach-bcm963xx/include
|
||||
endif
|
||||
|
||||
|
||||
define KernelPackage/easy-soc-events
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Helper module for netlink event notification
|
||||
FILES:=$(PKG_BUILD_DIR)/easyevent.ko
|
||||
AUTOLOAD:=$(call AutoProbe,easyevent)
|
||||
endef
|
||||
|
||||
define KernelPackage/easy-soc-events/description
|
||||
This is a helper module to generate and pass netlink events from
|
||||
kernel to user applications.
|
||||
endef
|
||||
|
||||
#NOSTDINC_FLAGS :=
|
||||
|
||||
LINUXINCLUDE += \
|
||||
-I$(LINUX_DIR)/include -I$(LINUX_DIR)/include/$(LINUX_UAPI_DIR) \
|
||||
-Iarch/$(LINUX_KARCH)/include \
|
||||
-Iarch/$(LINUX_KARCH)/include/generated \
|
||||
-Iarch/$(LINUX_KARCH)/include/generated/$(LINUX_UAPI_DIR) \
|
||||
-I$(LINUX_DIR)/include/generated/uapi \
|
||||
-Iarch/$(LINUX_KARCH)/include/$(LINUX_UAPI_DIR) \
|
||||
-include ./include/linux/kconfig.h
|
||||
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) V=1 \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
LINUXINCLUDE="$(LINUXINCLUDE)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(STAGING_DIR)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(STAGING_DIR)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(LINUX_DIR)/include/generated/uapi
|
||||
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(LINUX_DIR)/include/generated/uapi
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,easy-soc-events))
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=3.1.5
|
||||
PKG_VERSION:=3.1.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=794dbaeb2f6ff3070ba3cbae71e754ee93d03606
|
||||
PKG_SOURCE_VERSION:=0a9c1df3d0b75c434473a351103a9283de87190c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.2
|
||||
PKG_SOURCE_VERSION:=156c3f01d6e48d4cc2ffdcb1eb38ff7656478dd0
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_VERSION:=0.3
|
||||
PKG_SOURCE_VERSION:=afbfc4e8976fbcf9d4284338289d9d143664caa6
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
@@ -19,13 +19,12 @@ PKG_SOURCE_URL:=http://download.iopsys.eu/iopsys/opensdk/
|
||||
PKG_NAME:=endptmngr-open
|
||||
PATCH_DIR:=
|
||||
else
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/endptmngr
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2020-03-25
|
||||
PKG_VERSION:=4.0-2020-05-08
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=087ba5b857573a312d34c675a6fd5f88c0e46912
|
||||
PKG_SOURCE_VERSION:=d0eae460525c9dc735b12649ea338d1b81dc44bb
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
136
icwmp/README
136
icwmp/README
@@ -1,136 +0,0 @@
|
||||
1)Build
|
||||
Requirements<74>:
|
||||
librairies:
|
||||
- libuci.so
|
||||
- libexpat.so
|
||||
- libcurl.so
|
||||
- libpthread.so
|
||||
- libopenssl.so
|
||||
- libz.so
|
||||
- libcrypto.so
|
||||
the librairies should be present in the "staging_dir/target-i386_uClibc-0.9.30.1/usr/lib/" or "staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib"
|
||||
|
||||
header files and folders:
|
||||
- expat.h
|
||||
- expat_external.h
|
||||
- uci.h
|
||||
- uci_config.h
|
||||
- zlib.h
|
||||
- curl folder
|
||||
- openssl folder
|
||||
the header files and folders should be present in the staging_dir/target-i386_uClibc-0.9.30.1/usr/include/ or staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/usr/include/
|
||||
|
||||
|
||||
if a librairie doesn't exist:
|
||||
a- run make menuconfig and select the librarie
|
||||
b- build the librarie package
|
||||
|
||||
2) Build
|
||||
|
||||
this software is composed of 3 packages:
|
||||
- icwmp package: contains icwmpd daemon
|
||||
- cwmp lib package: contains cwmplib and contains cwmp_value_change binary. They could be used by other user space applications in order to notify the icwmp daemon when paramter changes
|
||||
- cwmp kernel package: contains cwmp kernel module. This module could be used by other kernel modules to notify the icwmpd daemon when kernel parameter changes
|
||||
|
||||
The three packages should be selected in the make menu config in order to get the three packages compiled.
|
||||
To compile the three packages: $ make package/cwmpd/compile
|
||||
|
||||
3) OpenWRT settings
|
||||
in the OpenWRT, Add the following lines in the /usr/share/udhcpc/default.script file:
|
||||
uci_set_state provisioning iup tr069url "$url"
|
||||
uci_set_state provisioning iup provisioningcode "$provisioningcode"
|
||||
|
||||
4) Run
|
||||
Requirements:
|
||||
- libuci package should be installed
|
||||
- libexpat package should be installed
|
||||
- libcurl package should be installed
|
||||
- libpthread package should be installed
|
||||
- libopenssl package should be installed
|
||||
- libz package should be installed
|
||||
- libcrypto package should be installed
|
||||
|
||||
Configure the acs url in the /etc/config/icwmp
|
||||
and then start the cwmpd service: /etc/init.d/icwmpd start
|
||||
for the help: /etc/init.d/icwmpd
|
||||
|
||||
5) Value Change
|
||||
|
||||
5.1) value change for user space applications (using the libcwmp)
|
||||
|
||||
Before using the libcwmp, we should check that the libcwmp package is selected in "make menu config". and we should check that the package is compiled.
|
||||
The libcwmp should be installed uin the OpenWRT firmware
|
||||
|
||||
example of using libcwmp
|
||||
in myapplication.c
|
||||
|
||||
#...
|
||||
#include <cwmp_lib.h>
|
||||
#...
|
||||
|
||||
int anyfunction ()
|
||||
{
|
||||
.....
|
||||
/* parameter change here */
|
||||
/* so we inform the icwmp: */
|
||||
lib_api_cwmp_value_change_call (3, "InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress","lan2","3");
|
||||
.....
|
||||
/*
|
||||
Description of lib_api_cwmp_value_change_call input parameters
|
||||
parameter 1 : is the number of input string in the function lib_api_cwmp_value_change_call
|
||||
parameter 2 : is the parameter path
|
||||
parameter 3 : is the first correspondence related to the first indice
|
||||
parameter 4 : is the second correspondence related to the second indice
|
||||
.
|
||||
.
|
||||
.
|
||||
parameter n : is the (n-2) correspondence related to the (n-2) indice
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
5.2) value change for user space applications (using the cwmp_value_change CLI)
|
||||
|
||||
Before using the libcwmp, we should check that the libcwmp package is selected in "make menu config". and we should check that the package is compiled.
|
||||
The libcwmp should be installed uin the OpenWRT firmware
|
||||
|
||||
in OpenWRT:
|
||||
|
||||
root@OpenWrt:~# cwmp_value_change InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress "lan2" "3"
|
||||
|
||||
in this case the command will force cwmp client to send a notification to the ACS (if and only if the parameter path as configured as active or as passive parameter using the setAttributeParameter method)
|
||||
|
||||
5.3) value change for kernel space modules
|
||||
Before using the cwmp kernel module for value change, we should check that the kernel module package is selected in "make menu config". and we should check that the package is compiled.
|
||||
The kernel module should be installed uin the OpenWRT firmware and should be insert before all other kernel modules
|
||||
|
||||
example of using cwmp kernel module
|
||||
in mykernelmodule.c
|
||||
|
||||
#...
|
||||
#include <linux/cwmp_kernel.h>
|
||||
#...
|
||||
|
||||
int anykernelfunction ()
|
||||
{
|
||||
.....
|
||||
/* parameter change here */
|
||||
/* so we inform the cwmp: */
|
||||
kernel_api_cwmp_value_change_call (3, "InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress","lan2","3");
|
||||
.....
|
||||
/*
|
||||
Description of lib_api_cwmp_value_change_call input parameters
|
||||
parameter 1 : is the number of input string in the function lib_api_cwmp_value_change_call
|
||||
parameter 2 : is the parameter path
|
||||
parameter 3 : is the first correspondence related to the first indice
|
||||
parameter 4 : is the second correspondence related to the second indice
|
||||
.
|
||||
.
|
||||
.
|
||||
parameter n : is the (n-2) correspondence related to the (n-2) indice
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ PKG_VERSION:=2.0.15
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=83e44c1cfcfec3a52a9ae61e9d954885caddb331
|
||||
PKG_SOURCE_VERSION:=223e41d6d21ba519b8c14c9f6a4e65c57dc5cda2
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
52
iop/config
52
iop/config
@@ -14,14 +14,13 @@ CONFIG_PACKAGE_comgt-ncm=y
|
||||
CONFIG_PACKAGE_crashlog=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_easy-qos=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_gdb=m
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_icwmp-curl=y
|
||||
CONFIG_PACKAGE_ifbt=y
|
||||
CONFIG_PACKAGE_imonitor=y
|
||||
CONFIG_PACKAGE_ifbt=m
|
||||
CONFIG_PACKAGE_imonitor=m
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_iopupgrade=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
@@ -33,47 +32,20 @@ CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_juci=y
|
||||
CONFIG_PACKAGE_juci-config-backup=y
|
||||
CONFIG_PACKAGE_juci-ddns=y
|
||||
CONFIG_PACKAGE_juci-diagnostics=y
|
||||
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
|
||||
CONFIG_PACKAGE_juci-dropbear=y
|
||||
CONFIG_PACKAGE_juci-easyqos=y
|
||||
CONFIG_PACKAGE_juci-event=y
|
||||
CONFIG_PACKAGE_juci-firewall-fw3=y
|
||||
CONFIG_PACKAGE_juci-icwmp=y
|
||||
CONFIG_PACKAGE_juci-igmpinfo=y
|
||||
CONFIG_PACKAGE_juci-minidlna=y
|
||||
CONFIG_PACKAGE_juci-mod-status=y
|
||||
CONFIG_PACKAGE_juci-mod-system=y
|
||||
CONFIG_PACKAGE_juci-mwan3=y
|
||||
CONFIG_PACKAGE_juci-netmode=y
|
||||
CONFIG_PACKAGE_juci-network-device=y
|
||||
CONFIG_PACKAGE_juci-network-dsl=y
|
||||
CONFIG_PACKAGE_juci-network-netifd=y
|
||||
CONFIG_PACKAGE_juci-network-port=y
|
||||
CONFIG_PACKAGE_juci-openvpn=y
|
||||
CONFIG_PACKAGE_juci-owsd=y
|
||||
CONFIG_PACKAGE_juci-realtime-graphs=y
|
||||
CONFIG_PACKAGE_juci-samba=y
|
||||
CONFIG_PACKAGE_juci-snmpd=y
|
||||
CONFIG_PACKAGE_juci-sysupgrade=y
|
||||
CONFIG_PACKAGE_juci-upnp=y
|
||||
CONFIG_PACKAGE_juci-usb=y
|
||||
CONFIG_PACKAGE_juci-voice-client=y
|
||||
CONFIG_PACKAGE_juci-wifilife=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-theme-iopsys=y
|
||||
CONFIG_PACKAGE_kmod-siit=y
|
||||
CONFIG_PACKAGE_libcgroup-daemon=y
|
||||
CONFIG_PACKAGE_libcgroup=y
|
||||
# CONFIG_PACKAGE_libcgroup-utils is not set
|
||||
CONFIG_PACKAGE_libdaemon=y
|
||||
CONFIG_PACKAGE_libffmpeg-mini=y
|
||||
CONFIG_PACKAGE_libffmpeg-mini=m
|
||||
CONFIG_PACKAGE_libgmp=y
|
||||
CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_loop-detector=m
|
||||
CONFIG_PACKAGE_minidlna=y
|
||||
CONFIG_PACKAGE_minidlna=m
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mwan3=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
@@ -90,7 +62,6 @@ CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_power-management=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoe=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
@@ -104,15 +75,14 @@ CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rsync=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_samba3=y
|
||||
CONFIG_PACKAGE_samba3-nmbd=y
|
||||
CONFIG_PACKAGE_snmpd=y
|
||||
CONFIG_PACKAGE_samba3=m
|
||||
CONFIG_PACKAGE_samba3-nmbd=m
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_tc=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_tptest=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
@@ -187,6 +157,14 @@ CONFIG_BUSYBOX_CONFIG_MOUNTPOINT=y
|
||||
CONFIG_BUSYBOX_CONFIG_RUN_PARTS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_RUN_PARTS_FANCY=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS=y
|
||||
CONFIG_BUSYBOX_CONFIG_GZIP_FAST=2
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FLOAT_DURATION=y
|
||||
CONFIG_BUSYBOX_CONFIG_USLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_REALPATH=y
|
||||
CONFIG_BUSYBOX_CONFIG_TTY=y
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
|
||||
381
iop/scripts/genconfig_min.sh
Normal file
381
iop/scripts/genconfig_min.sh
Normal file
@@ -0,0 +1,381 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
config_path=""
|
||||
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
|
||||
function verify_config {
|
||||
IFS=$'\n'
|
||||
org=$(<.genconfig.config)
|
||||
unset IFS
|
||||
local num
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
|
||||
#echo "lines to check $tot_lines"
|
||||
num=0
|
||||
for line in $org
|
||||
do
|
||||
conf_opt=$(echo $line | grep CONFIG_ | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
num=$((num+1))
|
||||
done
|
||||
}
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
|
||||
[ -e $brcm63xx_mips/genconfig ] &&
|
||||
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
|
||||
[ -e $brcm63xx_arm/genconfig ] &&
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
for p in $iopsys_brcm63xx_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_mips"
|
||||
config_path="$brcm63xx_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig dg400prime IOPSYS"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
|
||||
list_customers()
|
||||
{
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "No boards found for $CUSTOMER"
|
||||
fi
|
||||
elif [ "$CUSTOMER" ]; then
|
||||
echo "No customer called $CUSTOMER"
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "has no boards"
|
||||
fi
|
||||
done
|
||||
elif [ "$customers" ]; then
|
||||
echo -e "$customers"
|
||||
else
|
||||
echo "no customers found"
|
||||
fi
|
||||
else
|
||||
echo "No $CUSTCONF folder found"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir -p $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
shift
|
||||
local CUSTOMERS=$@
|
||||
|
||||
# Validate seleced board and customers
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ ! -d "$CUSTCONF/$CUSTOMER/" ]; then
|
||||
echo "Customer profile for '$CUSTOMER' does not exist"
|
||||
exit 1
|
||||
elif [ ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "'$BOARDTYPE' board profile does not exist for customer '$CUSTOMER'"
|
||||
if [ -f "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
echo "Common profile configuration will be used"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
rm -f .config
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
fi
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
fi
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR" CUSTREPO="${CUSTREPO:-}"
|
||||
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# we need to signal to bradcom SDK that we have changed the board id
|
||||
# currently boardparms.c and boardparms_voice.c is the only place that is depending on inteno boardid name
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### main #####
|
||||
if [ ! -e tmp/.iop_bootstrap ]; then
|
||||
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
|
||||
echo "Run: iop feeds_update"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-b|--boards)set_target LIST;exit 0;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig_min" "Generate configuration for customer with manual board configuration"
|
||||
@@ -60,12 +60,19 @@ build_endptmngr_consumer() {
|
||||
}
|
||||
|
||||
build_wifilife_consumer() {
|
||||
local target="$1"
|
||||
local ver commit
|
||||
ver=$(grep -w "PKG_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/wifilife/Makefile | cut -d'=' -f2)
|
||||
[ -n "$ver" -a -n "$commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/wifilife-$target-${ver}_${commit}.tar.xz" && return
|
||||
cd ./build_dir/target-*/wifilife-$ver/ipkg-* || cd ./build_dir/target-mips*musl-*/wifilife-$ver/ipkg-*
|
||||
if [ "$target" == "iopsys-ramips" ]; then
|
||||
cd ./build_dir/target-mipsel_1004kc_musl/wifilife-$ver/ipkg-*
|
||||
elif [ "$target" == "iopsys-brcm63xx-arm" ]; then
|
||||
cd ./build_dir/target-arm_xscale_musl_eabi/wifilife-$ver/ipkg-*
|
||||
else
|
||||
return
|
||||
fi
|
||||
mkdir -p wifilife-$ver/src
|
||||
cp -rf wifilife/usr/sbin/* wifilife-$ver/src/
|
||||
tar Jcf wifilife-${target}-${ver}_${commit}.tar.xz wifilife-$ver
|
||||
@@ -100,8 +107,8 @@ build_mediatek_wifi_consumer() {
|
||||
local ver commit
|
||||
local chip=$1
|
||||
|
||||
ver=$(grep -w "PKG_VERSION:" ./feeds/iopsys/mt${chip}/Makefile | cut -d'=' -f2)
|
||||
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/mt${chip}/Makefile | cut -d'=' -f2)
|
||||
ver=$(grep -w "PKG_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
|
||||
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
|
||||
[ -n "$ver" -a -n "$commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/mtk${chip}e-${ver}_${commit}.tar.xz" && return
|
||||
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/mtk${chip}e-$ver/ipkg-*
|
||||
@@ -163,12 +170,12 @@ function generate_tarballs {
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptmngr_consumer
|
||||
build_wifilife_consumer
|
||||
build_wifilife_consumer "$target"
|
||||
elif [ "$stk_target" == "mediatek" ]; then
|
||||
build_mediatek_kernel
|
||||
build_mediatek_wifi_consumer 7603
|
||||
build_mediatek_wifi_consumer 7615
|
||||
build_wifilife_consumer
|
||||
build_wifilife_consumer "$target"
|
||||
else
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
|
||||
36
iup/Makefile
36
iup/Makefile
@@ -1,36 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2006-2011 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iup
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/iup
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=iup client
|
||||
DEPENDS:=+libuci +uci +busybox
|
||||
endef
|
||||
|
||||
define Package/iup/description
|
||||
This package contains Inteno's IUP Client
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/iup/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
cp -r ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iup))
|
||||
@@ -1,17 +0,0 @@
|
||||
package 'provisioning'
|
||||
|
||||
config 'general' 'polling'
|
||||
option 'enabled' 'on'
|
||||
option 'starttime' '03'
|
||||
option 'interval' 'daily'
|
||||
|
||||
config 'server' 'configserver'
|
||||
option enabled 'off'
|
||||
|
||||
|
||||
config 'server' 'iup'
|
||||
option 'enabled' 'on'
|
||||
|
||||
config software 'uppgradeserver'
|
||||
option enabled 'off'
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# iup at boot
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
START=98
|
||||
STOP=15
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
include /lib/network
|
||||
|
||||
CRONPATH="/etc/crontabs/root"
|
||||
RANGE=60
|
||||
|
||||
management_interfaces() {
|
||||
local DHCP_IFACES=""
|
||||
|
||||
is_notbridged_dhcp() {
|
||||
local config="$1"
|
||||
local proto="$(uci -q get network.$config.proto)"
|
||||
local typ="$(uci -q get network.$config.type)"
|
||||
if [ "$proto" == "dhcp" -a "$typ" != "bridge" ]; then
|
||||
DHCP_IFACES="$DHCP_IFACES $config"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach is_notbridged_dhcp interface
|
||||
echo $DHCP_IFACES
|
||||
}
|
||||
|
||||
init_iup() {
|
||||
local polling_enabled
|
||||
local interval
|
||||
local starttime
|
||||
local nummber
|
||||
number=$RANDOM
|
||||
|
||||
[ -f $CRONPATH ] || touch $CRONPATH
|
||||
|
||||
config_load provisioning
|
||||
config_get polling_enabled polling enabled on
|
||||
config_get interval polling interval
|
||||
config_get starttime polling starttime
|
||||
|
||||
### Ask for IUP related DHCP options only if IUP is enabled ###
|
||||
new_reqopts() {
|
||||
local net=$1
|
||||
local enabled
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$net.reqopts)"
|
||||
local iupopts="66 67 128 224 225 226"
|
||||
local ropt iopt
|
||||
config_get enabled iup enabled "on"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $iupopts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
echo "$newreqopts"
|
||||
}
|
||||
for net in $(management_interfaces); do
|
||||
uci -q set network.$net.reqopts="$(new_reqopts $net)"
|
||||
done
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
#################################################################
|
||||
|
||||
if [ $polling_enabled == "off" ]; then
|
||||
sed -i "/\/sbin\/iup/d" $CRONPATH
|
||||
logger -s -t /etc/init.d/iup[$$] "Provisioning polling unscheduled" 2>/dev/console
|
||||
return
|
||||
fi
|
||||
|
||||
local log_hour=$starttime
|
||||
local log_minute
|
||||
local log_interval=$interval
|
||||
if [ $interval == "weekly" ]; then
|
||||
interval="0"
|
||||
log_interval="$log_interval/sunday"
|
||||
elif [ $interval == "hourly" ]; then
|
||||
interval='*'
|
||||
starttime='*'
|
||||
else
|
||||
interval='*'
|
||||
fi
|
||||
let "number %= $RANGE"
|
||||
if ! grep -q "$starttime \* \* \\$interval /sbin/iup" "$CRONPATH" ; then
|
||||
if grep -q "iup" "$CRONPATH" ; then
|
||||
sed -i "/iup/d" $CRONPATH
|
||||
fi
|
||||
echo "$number $starttime * * $interval /sbin/iup -v > /dev/null 2>&1" >> $CRONPATH
|
||||
fsync $CRONPATH
|
||||
/etc/init.d/cron restart
|
||||
fi
|
||||
log_minute=$(awk '/\/sbin\/iup/ {print $1}' /etc/crontabs/root)
|
||||
logger -s -t /etc/init.d/iup[$$] "Provisioning is scheduled at $log_hour:$log_minute $log_interval" 2>/dev/console
|
||||
}
|
||||
|
||||
start_service() {
|
||||
init_iup
|
||||
|
||||
/sbin/iup -v &
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
if [ -f "/tmp/run/iup.pid" ]; then
|
||||
kill -9 $(cat /tmp/run/iup.pid)
|
||||
rm -rf /tmp/run/iup.pid
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger provisioning
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
management_interfaces() {
|
||||
local DHCP_IFACES=""
|
||||
|
||||
is_notbridged_dhcp() {
|
||||
local config="$1"
|
||||
local proto="$(uci -q get network.$config.proto)"
|
||||
local typ="$(uci -q get network.$config.type)"
|
||||
if [ "$proto" == "dhcp" -a "$typ" != "bridge" ]; then
|
||||
DHCP_IFACES="$DHCP_IFACES $config"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach is_notbridged_dhcp interface
|
||||
echo $DHCP_IFACES
|
||||
}
|
||||
|
||||
set_iup_reqopts() {
|
||||
### Ask for IUP related DHCP options only if IUP is enabled ###
|
||||
new_reqopts() {
|
||||
local net=$1
|
||||
local enabled="$(uci -q get provisioning.iup.enabled)"
|
||||
enabled="${enabled:-on}"
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$net.reqopts)"
|
||||
local iupopts="66 67 128 224 225 226"
|
||||
local ropt iopt
|
||||
local net
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $iupopts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128|224|225|226) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
echo "$newreqopts"
|
||||
}
|
||||
for net in $(management_interfaces); do
|
||||
uci -q set network.$net.reqopts="$(new_reqopts $net)"
|
||||
done
|
||||
uci commit network
|
||||
}
|
||||
|
||||
set_iup_reqopts
|
||||
@@ -1,219 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# functions that take dhcp options received on the wan interface
|
||||
# and relay/repeat them for specific clients
|
||||
|
||||
#config dhcp_option_relay
|
||||
# option enable 1
|
||||
# list dhcp_option 43
|
||||
# list from_interface wan
|
||||
# option vendorclass '*SDX*'
|
||||
|
||||
# where:
|
||||
# dhcp_option_relay is the name of the section parsed by this script
|
||||
# enable/enabled - option, enable the uci section [default on]
|
||||
# dhcp_option/dhcp_options - list of dhcp options (0-255) to be relayed/repeated
|
||||
# overwrite - if same dhcp_option already exists in /etc/config/dhcp, overwrite it with this option [default off]
|
||||
# from_interface - list of interfaces (e.g. wan) to get the dhcp options from
|
||||
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
interface=""
|
||||
opt224=""
|
||||
opt225=""
|
||||
opt226=""
|
||||
opt43=""
|
||||
opt128=""
|
||||
opt66=""
|
||||
opt67=""
|
||||
opt132=""
|
||||
opt133=""
|
||||
newsectionid="0"
|
||||
|
||||
function parse_the_json()
|
||||
{
|
||||
local the_json="$@"
|
||||
|
||||
json_load "$the_json"
|
||||
json_get_var interface interface
|
||||
json_get_var opt224 privopt224
|
||||
json_get_var opt225 privopt225
|
||||
json_get_var opt226 privopt226
|
||||
json_get_var opt43 vendorspecinf # option 43
|
||||
json_get_var opt128 httpurl128
|
||||
json_get_var opt66 tftp # option 66
|
||||
json_get_var opt67 bootfile #option 67
|
||||
json_get_var opt132 vlanid # option 132
|
||||
json_get_var opt133 vlanpriority # option 133
|
||||
}
|
||||
|
||||
function add_section_dhcp_vendorclass()
|
||||
{
|
||||
local dhcp_option=$1
|
||||
local dhcp_option_value=$2
|
||||
local vendorclass=$3
|
||||
local new=
|
||||
newsectionid=$((newsectionid+1))
|
||||
|
||||
#echo "add_section_dchp_vendorclass $dhcp_option ${dhcp_option_value} $vendorclass"
|
||||
new=$(uci add dhcp vendorclass)
|
||||
uci set dhcp.$new.vendorclass="$vendorclass"
|
||||
uci set dhcp.$new.networkid="dhcp_option_relay_$newsectionid"
|
||||
uci add_list dhcp.$new.dhcp_option=$dhcp_option,\"${dhcp_option_value}\"
|
||||
|
||||
uci commit dhcp
|
||||
}
|
||||
|
||||
function dhcp_option_relay()
|
||||
{
|
||||
local section="$1"
|
||||
local enable="" enabled=""
|
||||
local dhcp_option="" dhcp_option_value=""
|
||||
local vendorclass=""
|
||||
#local overwrite=""
|
||||
local from_interface
|
||||
|
||||
#echo "section: $section"
|
||||
|
||||
# parse only enabled sections
|
||||
config_get_bool enabled $section enabled 1
|
||||
config_get_bool enable $section enable 1
|
||||
#echo "enabled: $enabled"
|
||||
#echo "enable : $enable"
|
||||
if [ "$enable" == "0" -o "$enabled" == "0" ] ; then
|
||||
#echo "section $section is not enabled"
|
||||
return
|
||||
fi
|
||||
# todo: for disabled sections: run only the removal of the dhcp options
|
||||
|
||||
# option overwrite 1
|
||||
#config_get_bool overwrite $section overwrite 0
|
||||
config_get vendorclass $section vendorclass
|
||||
if [ ${#vendorclass} -le 1 ]; then
|
||||
#echo "vendorclass must not be empty"
|
||||
return
|
||||
fi
|
||||
|
||||
# list to_interface lan
|
||||
# to_interface - list of interfaces (e.g. lan, guest) to advertise the dhcp options to
|
||||
#foreach_to_interface() {
|
||||
# local to_interface=$1
|
||||
# echo ""
|
||||
# echo " from_interface $from_interface"
|
||||
# echo " dhcp_option $dhcp_option"
|
||||
# echo " dhcp_option_value $dhcp_option_value"
|
||||
# echo " overwrite $overwrite"
|
||||
# echo " to_interface $to_interface"
|
||||
#
|
||||
# if [ ! $(uci -q get dhcp.$to_interface) ] ; then
|
||||
# echo "to_interface $to_interface does not exist in dhcp uci config"
|
||||
# return
|
||||
# fi
|
||||
#
|
||||
#}
|
||||
|
||||
|
||||
foreach_dhcp_option() {
|
||||
dhcp_option=$1
|
||||
|
||||
echo "dhcp_option: $dhcp_option"
|
||||
case $dhcp_option in
|
||||
43) dhcp_option_value=$opt43 ;;
|
||||
66) dhcp_option_value=$opt66 ;;
|
||||
67) dhcp_option_value=$opt67 ;;
|
||||
128) dhcp_option_value=$opt128 ;;
|
||||
132) dhcp_option_value=$opt132 ;;
|
||||
133) dhcp_option_value=$opt133 ;;
|
||||
224) dhcp_option_value=$opt224 ;;
|
||||
225) dhcp_option_value=$opt225 ;;
|
||||
226) dhcp_option_value=$opt226 ;;
|
||||
*) dhcp_option_value="unsupported" ;;
|
||||
esac
|
||||
|
||||
if [ "${dhcp_option_value}" == "unsupported" ] ; then
|
||||
echo "dhcp_option $dhcp_option is unsupported"
|
||||
return
|
||||
fi
|
||||
if [ "${dhcp_option_value}" == "" ] ; then
|
||||
echo "dhcp_option $dhcp_option is empty"
|
||||
return
|
||||
fi
|
||||
|
||||
#echo "dhcp_option: $dhcp_option dhcp_option_value: ${dhcp_option_value}"
|
||||
|
||||
#config_list_foreach $section to_interface foreach_to_interface
|
||||
|
||||
add_section_dhcp_vendorclass $dhcp_option ${dhcp_option_value} $vendorclass
|
||||
}
|
||||
|
||||
foreach_from_interface() {
|
||||
from_interface="$1"
|
||||
#echo "from_interface: $from_interface"
|
||||
if [ "$from_interface" != "$interface" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
dhcp_option=""
|
||||
config_list_foreach $section dhcp_option foreach_dhcp_option
|
||||
#config_list_foreach $section dhcp_options foreach_dhcp_option
|
||||
}
|
||||
|
||||
from_interface=""
|
||||
config_list_foreach $section from_interface foreach_from_interface
|
||||
}
|
||||
|
||||
|
||||
# in uci dhcp config:
|
||||
# remove all the vendorclass sections
|
||||
# that have previosly been configured by this script.
|
||||
# all are identified by "option networkid dhcp_option_relay_*"
|
||||
function dhcp_option_relay_clear_prev()
|
||||
{
|
||||
local to_remove=""
|
||||
|
||||
foreach_vendorclass() {
|
||||
local section="$1"
|
||||
local networkid
|
||||
config_get networkid $section networkid
|
||||
|
||||
case "$networkid"
|
||||
in dhcp_option_relay*)
|
||||
to_remove="$to_remove $section"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
config_load dhcp
|
||||
config_foreach foreach_vendorclass vendorclass
|
||||
|
||||
local sect
|
||||
for sect in $to_remove ; do
|
||||
uci_remove dhcp $sect
|
||||
done
|
||||
uci_commit dhcp
|
||||
}
|
||||
|
||||
|
||||
# the main function
|
||||
function dhcp_option_relay_parse()
|
||||
{
|
||||
local the_json="$@"
|
||||
parse_the_json "$the_json"
|
||||
|
||||
dhcp_option_relay_clear_prev
|
||||
|
||||
newsectionid="0"
|
||||
|
||||
config_load provisioning
|
||||
config_foreach dhcp_option_relay dhcp_option_relay
|
||||
#config_foreach dhcp_option_relay dhcp_options_relay
|
||||
#config_foreach dhcp_option_relay dhcpoption_relay
|
||||
#config_foreach dhcp_option_relay dhcpoptions_relay
|
||||
#config_foreach dhcp_option_relay dhcp_optionrelay
|
||||
#config_foreach dhcp_option_relay dhcp_optionsrelay
|
||||
#config_foreach dhcp_option_relay dhcpoptionrelay
|
||||
#config_foreach dhcp_option_relay dhcpoptionsrelay
|
||||
}
|
||||
|
||||
#dhcp_option_relay_parse
|
||||
@@ -1,595 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo $$ > /var/run/iup.pid
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions/savecfg.sh
|
||||
. /lib/functions/dhcp_option_relay.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
include /lib/upgrade
|
||||
include /lib/network
|
||||
|
||||
export IUPCONFFILES=/tmp/iup/sysupgrade.conffiles.tar.gz
|
||||
export IUPMD5=/etc/configchecksums
|
||||
export CONFILESLURP='/tmp/iup/*.conf'
|
||||
export IUPTEMP="/tmp/iup"
|
||||
export INTERACTIVE=0
|
||||
export VERBOSE=0
|
||||
export CONF=1
|
||||
export DESKEY=
|
||||
export MAC=
|
||||
export RANGE=10
|
||||
export RETRYSTOP=5
|
||||
export SLEEP=10
|
||||
|
||||
json_load "$(ubus call router.system info)"
|
||||
json_select system
|
||||
json_get_var MAC basemac
|
||||
json_select ..
|
||||
json_select keys
|
||||
json_get_var DESKEY des
|
||||
json_select ..
|
||||
|
||||
# MAC lowercase to uppercase and remove ':'
|
||||
MAC=$(echo $MAC | tr '[a-z]' '[A-Z]' | tr -d ':')
|
||||
|
||||
# Convert DESKEY to HEX format
|
||||
DESKEY=$(echo $DESKEY | tr -d '\n' | hexdump -e '16/1 "%02x"')
|
||||
|
||||
|
||||
# no verbose: no output
|
||||
# -v log to system log
|
||||
# -v -v log to system log and console
|
||||
# -v -v -v log to system log, console and stderr
|
||||
v() {
|
||||
[ "$VERBOSE" -eq 0 ] && return
|
||||
[ "$VERBOSE" -eq 1 ] && logger -t $0[$$] "$@" && return
|
||||
[ "$VERBOSE" -eq 2 ] && logger -s -t $0[$$] "$@" >/dev/console 2>&1 && return
|
||||
[ "$VERBOSE" -eq 3 ] && logger -s -t $0[$$] "$@" 2>&1 | tee /dev/console && return
|
||||
}
|
||||
|
||||
vv() {
|
||||
VERBOSE="$(($VERBOSE + 1))"
|
||||
v "$@"
|
||||
VERBOSE="$(($VERBOSE - 1))"
|
||||
|
||||
}
|
||||
|
||||
get_packages()
|
||||
{
|
||||
local pack
|
||||
pack=$(grep -w 'package' $1)
|
||||
pack=${pack//package/}
|
||||
#pack=${pack//[\'|\"]/}
|
||||
echo $pack | tr -d '\"' | tr -d "'"
|
||||
}
|
||||
|
||||
reload ()
|
||||
{
|
||||
local pack
|
||||
pack=$(get_packages $1)
|
||||
v "Calling ubus call uci commit for $pack"
|
||||
for packname in $pack
|
||||
do
|
||||
ubus call uci commit '{"config":"'$packname'"}'
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
save_usercfg()
|
||||
{
|
||||
savecfg_save_config fw_redirect fw_parental wifi
|
||||
}
|
||||
|
||||
apply_usercfg()
|
||||
{
|
||||
# decide to save the user changes based on keepuserconfig received through provisioning
|
||||
local keep
|
||||
config_load provisioning
|
||||
config_get_bool keep configserver keepuserconfig "0"
|
||||
v "apply_usercfg(): keepuserconfig = $keep"
|
||||
if [ "$keep" != "1" ] ; then
|
||||
savecfg_rm_files
|
||||
return
|
||||
fi
|
||||
|
||||
savecfg_apply_config fw_redirect fw_parental wifi
|
||||
}
|
||||
|
||||
handle_provisioning() {
|
||||
local config="$1"
|
||||
local default="$2"
|
||||
local enabled
|
||||
local url
|
||||
local tftpfile
|
||||
local host
|
||||
local md5
|
||||
local defaultreset
|
||||
local pack
|
||||
local packname
|
||||
local number=$RANDOM
|
||||
local retry=1
|
||||
local number
|
||||
local incsleep=$SLEEP
|
||||
let "number %= $RANGE"
|
||||
if [[ ! -e $IUPTEMP ]]; then
|
||||
mkdir $IUPTEMP
|
||||
fi
|
||||
touch $IUPCONFFILES
|
||||
config_get_bool enabled "$config" enabled "$default"
|
||||
config_get_bool defaultreset "$config" defaultreset
|
||||
config_get deckey "$config" deckey
|
||||
if [ "$enabled" -eq 1 ]; then
|
||||
if [ "$config" == "iup" ]; then
|
||||
v "Using url received in dhcp options"
|
||||
config_get url "$config" urliup
|
||||
else
|
||||
config_get url "$config" url
|
||||
fi
|
||||
url=${url//\$MAC/$MAC}
|
||||
v "Downloading from url \"$url\""
|
||||
|
||||
while [ $retry -le $RETRYSTOP ]
|
||||
do
|
||||
if [ ${url%%:*} == "tftp" ]; then
|
||||
tftpfile=${url#*\/\/}
|
||||
host=${tftpfile%%\/*}
|
||||
tftpfile=${tftpfile#*\/}
|
||||
|
||||
/usr/bin/tftp -l $IUPCONFFILES -r "$tftpfile" -g "$host"
|
||||
else
|
||||
get_image "$url" "cat" > $IUPCONFFILES
|
||||
fi
|
||||
if [ -s $IUPCONFFILES ]; then
|
||||
v "Download finished"
|
||||
retry=$((RETRYSTOP + 1))
|
||||
else
|
||||
v "Download failed, retrying in $incsleep seconds"
|
||||
sleep $incsleep
|
||||
incsleep=$((incsleep * retry + number))
|
||||
retry=$((retry+1))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ ! -s "$IUPCONFFILES" ] && [ "$enabled" -eq 1 ]; then
|
||||
echo "File not Found"
|
||||
reboot="off"
|
||||
CONF=0
|
||||
else
|
||||
handle_Downloaded_file $deckey
|
||||
fi
|
||||
}
|
||||
|
||||
handle_Downloaded_file()
|
||||
{
|
||||
local DECKEY
|
||||
local KEY
|
||||
[ -n "$1" ] && DECKEY=$(echo $1 | tr -d '\n' | hexdump -e '16/1 "%02x"')
|
||||
KEY=${DECKEY:-$DESKEY}
|
||||
local img_type
|
||||
case "$(get_image_type "$IUPCONFFILES")" in
|
||||
"INTENO") img_type=2 ;;
|
||||
"CFE+FS") img_type=1 ;;
|
||||
"FS") img_type=0 ;;
|
||||
*) img_type="UNKNOWN";;
|
||||
esac
|
||||
|
||||
if [ "$img_type" == "UNKNOWN" ] ; then
|
||||
case "$(hexdump -v -n 2 -e '1/1 "%02x"' $IUPCONFFILES)" in
|
||||
1f8b)
|
||||
v "Downloaded file is an unencrypted config"
|
||||
md5=$(md5sum $IUPCONFFILES)
|
||||
md5="${md5%% *}" # remove the first space and everything after it
|
||||
md5sum "$IUPCONFFILES" >> "$IUPMD5.temp"
|
||||
if grep -q "$md5" "$IUPMD5"; then
|
||||
v "Config is already up to date, nothing to do"
|
||||
#because config is up to date we need to disable last step reboot if set
|
||||
reboot="off"
|
||||
rm -rf $IUPTEMP
|
||||
else
|
||||
save_usercfg
|
||||
cd $IUPTEMP
|
||||
tar xvzf $IUPCONFFILES
|
||||
for f in $CONFILESLURP
|
||||
do
|
||||
v "File to be applied $f and config $(cat $f)"
|
||||
uci -f $f import
|
||||
done
|
||||
pack=$(get_packages $CONFILESLURP)
|
||||
v "Packages to be commited: $pack"
|
||||
for packname in $pack
|
||||
do
|
||||
uci commit $packname
|
||||
done
|
||||
apply_usercfg
|
||||
reboot=`uci -q get provisioning.configserver.reboot`
|
||||
if [ "$reboot" != "on" ]; then
|
||||
sync
|
||||
reload $CONFILESLURP
|
||||
fi
|
||||
rm -rf $IUPTEMP
|
||||
|
||||
cp /rom/etc/uci-defaults/* /etc/uci-defaults/
|
||||
sync
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
v "Downloaded file is an encrypted config"
|
||||
if [ $KEY ]; then
|
||||
openssl enc -d -des-ede -nosalt -K $KEY -iv "0000000000000000" -in $IUPCONFFILES -out $IUPCONFFILES.tmp
|
||||
if [ $? -eq 0 ]; then
|
||||
v "Decryption successful"
|
||||
mv $IUPCONFFILES.tmp $IUPCONFFILES
|
||||
handle_Downloaded_file
|
||||
else
|
||||
v "Decryption Failed! Exiting"
|
||||
rm -rf $IUPTEMP
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
v "No Key Defined"
|
||||
rm -rf $IUPTEMP
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
else
|
||||
v "Downloaded file is a firmware, will start reflashing"
|
||||
if [ "$defaultreset" -eq 1 ]; then
|
||||
v "Not saving configuration over reflash"
|
||||
/sbin/sysupgrade -v -n $IUPCONFFILES
|
||||
else
|
||||
v "Saving configuration over reflash"
|
||||
/sbin/sysupgrade -v $IUPCONFFILES
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# function: change_to_vlan
|
||||
# arg 1 = vlan id
|
||||
# arg 2 = vlan priority
|
||||
# arg 3 = $INTERFACE
|
||||
change_to_vlan() {
|
||||
# local variables.
|
||||
local name="vlan$1" # construct name = vlan + vlanid.
|
||||
local base_dev # varible holding device name of wan port.
|
||||
local wan_if # variable holding wan interfaces.
|
||||
local new_wan_if #
|
||||
|
||||
# extract device name.
|
||||
network_get_device base_dev $3
|
||||
|
||||
# bring down old interface/device.
|
||||
ifdown "${base_dev}"
|
||||
v "option 132: bringing down old if: ${base_dev}"
|
||||
|
||||
# extract base name of device.
|
||||
base_dev=$(echo ${base_dev} | cut -d. -f1)
|
||||
|
||||
# add "VLAN interface" to the "end of the file".
|
||||
uci add network device
|
||||
uci rename network.@device[-1]=${name}
|
||||
uci set network.@device[-1].type=8021q
|
||||
uci set network.@device[-1].ifname=${base_dev}
|
||||
uci set network.@device[-1].name="${base_dev}.${1}"
|
||||
uci set network.@device[-1].vid=${1}
|
||||
uci set network.@device[-1].priority=${2}
|
||||
# and commit the change.
|
||||
uci commit network
|
||||
v "option 132: committed update to file network"
|
||||
|
||||
# reload configuration files.
|
||||
ubus call network reload
|
||||
v "option 132: reload network config"
|
||||
|
||||
# replace old interface (like eth0.1 with new eth0.101).
|
||||
wan_if=$(uci get network.$3.ifname)
|
||||
v "option 132: old network.${3}.ifname: $wan_if"
|
||||
|
||||
# loop through the string, remove any word close to "base_dev".
|
||||
for word in ${wan_if}; do
|
||||
#echo $word
|
||||
case $word in
|
||||
${base_dev}*) # don't add if.
|
||||
;;
|
||||
*) new_wan_if=${word}' '${new_wan_if} # add if.
|
||||
#new_wan_if+=" ${word}" # probably not working in ash.
|
||||
;;
|
||||
esac
|
||||
done
|
||||
# append new interface.
|
||||
new_wan_if=${new_wan_if}${base_dev}.${1}
|
||||
uci set network.wan.ifname="${new_wan_if}"
|
||||
# and commit the change.
|
||||
uci commit network
|
||||
v "option 132: committed update to file network: ifname=${new_wan_if}"
|
||||
|
||||
# reboot into new if configuration.
|
||||
vv "Rebooting"
|
||||
export REBOOT_REASON=iup
|
||||
/sbin/reboot
|
||||
}
|
||||
|
||||
handle_option224()
|
||||
{
|
||||
if [ -z "$1" ] ; then
|
||||
echo "No argument"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $(echo $1|grep -o "," | wc -l) -eq 0 ] ; then
|
||||
url=$1
|
||||
else
|
||||
url=$(echo $1|cut -d',' -f1)
|
||||
a=$(echo $1|cut -d',' -f2)
|
||||
b=$(echo $1|cut -d',' -f3)
|
||||
c=$(echo $1|cut -d',' -f4)
|
||||
fi
|
||||
|
||||
currdate=$(date +"%Y-%m-%d")
|
||||
|
||||
active=0
|
||||
if [ -z $a ] ; then
|
||||
active=1
|
||||
elif [ $a ] && [ $b ] && [ $a -lt 25 ] ; then
|
||||
#Time
|
||||
begin=$(date +%s -d"$currdate $a")
|
||||
now=$(date +%s)
|
||||
end=$((begin+3600*$b))
|
||||
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
|
||||
active=1
|
||||
fi
|
||||
elif [ $a ] && [ $b ] && [ $c ] && [ $a -gt 25 ] ; then
|
||||
#Date
|
||||
y=$(echo $a| cut -c1-4)
|
||||
m=$(echo $a| cut -c5-6)
|
||||
d=$(echo $a| cut -c7-8)
|
||||
begin=$(date +%s -d"$y-$m-$d $b")
|
||||
now=$(date +%s)
|
||||
end=$((begin+3600*$c))
|
||||
if [ $now -gt $begin ] && [ $now -lt $end ] ; then
|
||||
active=1
|
||||
fi
|
||||
else
|
||||
echo "Bad format"
|
||||
return 1
|
||||
fi
|
||||
|
||||
softwareminuspath=${url##*/}
|
||||
|
||||
if [ $url ] && [ $active -eq 1 ]; then
|
||||
v "Software version to download \"$softwareminuspath\""
|
||||
local sysinfo=$(ubus call router.system info)
|
||||
json_load "$sysinfo"
|
||||
json_select system
|
||||
json_get_var firmware firmware
|
||||
local firmware_new=${softwareminuspath%.*} # remove extension (.w, .y or .y2) from filename
|
||||
if [ "$firmware_new" != "$firmware" ] ; then
|
||||
v "Firmware found $url will start flashing"
|
||||
v "Currently running firmware: \"$firmware\""
|
||||
v "Newly received firmware: \"$firmware_new\""
|
||||
wait_for_dns $url
|
||||
v "Start flashing"
|
||||
/sbin/sysupgrade -v $url &
|
||||
return 1
|
||||
else
|
||||
v "Firmware is up to date, nothing to do"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
parse_dhcp_options()
|
||||
{
|
||||
local the_json="$@"
|
||||
|
||||
# process the dhcp_option_relay sections
|
||||
dhcp_option_relay_parse "$the_json"
|
||||
|
||||
# Process IUP related DHCP options #
|
||||
local privopt224 privopt225 privopt226 vendorspecinf httpurl128
|
||||
local tftp bootfile vlanid vlanpriority interface
|
||||
|
||||
json_load "$the_json"
|
||||
json_get_var interface interface
|
||||
json_get_var privopt224 privopt224
|
||||
json_get_var privopt225 privopt225
|
||||
json_get_var privopt226 privopt226
|
||||
json_get_var vendorspecinf vendorspecinf # option 43
|
||||
json_get_var httpurl128 httpurl128
|
||||
json_get_var tftp tftp # option 66
|
||||
json_get_var bootfile bootfile #option 67
|
||||
json_get_var vlanid vlanid # option 132
|
||||
json_get_var vlanpriority vlanpriority # option 133
|
||||
|
||||
if [ $privopt224 ]; then
|
||||
v "dhcp option 224 firmware url $privopt224"
|
||||
handle_option224 $privopt224
|
||||
[ $? -eq 1 ] && exit
|
||||
fi
|
||||
|
||||
if [ $vendorspecinf ]; then
|
||||
v "dhcp option 43 tr69 url $vendorspecinf"
|
||||
url=${vendorspecinf%%,*}; rest=${vendorspecinf#*,}
|
||||
provisioningcode=${rest%%,*};
|
||||
[ -f /etc/config/cwmp ] && uci_set_state cwmp acs dhcp_url "$url"
|
||||
uci_set_state provisioning iup urlcwmp "$url"
|
||||
uci_set_state provisioning iup url "$url"
|
||||
uci_set_state provisioning iup provisioningcode "$provisioningcode"
|
||||
elif [ $httpurl128 ]; then
|
||||
v "dhcp option 128 http config url $httpurl128"
|
||||
uci_set_state provisioning iup urliup "$httpurl128"
|
||||
elif [ $tftp ]; then
|
||||
v "dhcp option 66 tftp config url $tftp"
|
||||
if [ ${bootfile:0:1} == '/' ]; then
|
||||
uci_set_state provisioning iup urliup "tftp://$tftp$bootfile"
|
||||
else
|
||||
uci_set_state provisioning iup urliup "tftp://$tftp/$bootfile"
|
||||
fi
|
||||
fi
|
||||
|
||||
# vlanid (and vlanpriority)
|
||||
if [ -n "$vlanid" -a -n "$vlanpriority" ]; then
|
||||
v "dhcp option 132 vlanid: ${vlanid} vlanpriority: ${vlanpriority}"
|
||||
change_to_vlan ${vlanid} ${vlanpriority} ${interface}
|
||||
elif [ -n "$vlanid" ]; then
|
||||
v "dhcp option 132 vlanid: ${vlanid}"
|
||||
change_to_vlan ${vlanid} 0 ${interface}
|
||||
elif [ -n "$privopt225" ] || [ -n "$privopt226" ]; then
|
||||
# opt225 and opt226 can be used together or separatly
|
||||
if [ -n "$privopt225" ]; then
|
||||
v "dhcp option 225: $privopt225"
|
||||
# option225 is allowd to change only once per CPE
|
||||
if [ "$(uci get -q ice.cloud.frozen)" != "1" ] ; then
|
||||
uci set ice.cloud.frozen="1"
|
||||
uci set ice.cloud.enabled="1"
|
||||
uci set ice.cloud.server="$privopt225"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$privopt226" ]; then
|
||||
v "dhcp option 226: $privopt226"
|
||||
[ -z "$(uci get -q ice.dhcp)" ] && uci set ice.dhcp="dhcp"
|
||||
uci set ice.dhcp.opt226connectionid="$privopt226"
|
||||
ubus send dhcp.opt226connectionid '{"opt226connectionid":"","value":"'$privopt226'"}'
|
||||
fi
|
||||
uci commit
|
||||
fi
|
||||
}
|
||||
|
||||
# wait_for_default_gateway to become reachable
|
||||
# return 0 if the default gateway is reachable
|
||||
# return 1 if the default gateway is not reachable after $wait_time
|
||||
wait_for_default_gateway()
|
||||
{
|
||||
local gateway
|
||||
local device
|
||||
local wait_time=120
|
||||
local wait_interval=10
|
||||
|
||||
while [ true ] ; do
|
||||
|
||||
gateway=""
|
||||
device=""
|
||||
network_flush_cache
|
||||
network_get_gateway gateway wan #true
|
||||
network_get_device device wan
|
||||
device="${device:+-I }$device"
|
||||
if ping -q -w 1 -c 1 $device $gateway >/dev/null 2>&1 ; then
|
||||
[ "$wait_time" -lt "60" ] && v "Default gateway $gateway is reachable"
|
||||
sleep $wait_interval
|
||||
return 0
|
||||
fi
|
||||
|
||||
# try the nameservers too
|
||||
for ns in $(grep nameserver /var/resolv.conf.auto | awk '{print $2}'); do
|
||||
if ping -q -w 1 -c 1 $device $ns >/dev/null 2>&1 ; then
|
||||
[ "$wait_time" -lt "60" ] && v "Name server $ns is reachable"
|
||||
sleep $wait_interval
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
v "Waiting for default gateway or name server. Countdown $wait_time seconds"
|
||||
sleep $wait_interval
|
||||
wait_time=$((wait_time - wait_interval))
|
||||
[ "$wait_time" -le "0" ] && break # timer expired
|
||||
done
|
||||
|
||||
return 1 # default gateway and name server are not reachable
|
||||
}
|
||||
|
||||
|
||||
main()
|
||||
{
|
||||
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
-v) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-q) export VERBOSE="$(($VERBOSE - 1))";;
|
||||
--dhcp-options)
|
||||
shift
|
||||
parse_dhcp_options "$@"
|
||||
exit 0
|
||||
;;
|
||||
-*)
|
||||
echo "Invalid option: $1"
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
if ! wait_for_default_gateway ; then
|
||||
v "Neither default gateway nor name server are reachable. Aborting iup."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $IUPMD5 ]; then
|
||||
v "Creating file $IUPMD5"
|
||||
touch $IUPMD5
|
||||
fi
|
||||
|
||||
|
||||
local iupurl
|
||||
local configurl
|
||||
local software
|
||||
local sofwareminuspath
|
||||
|
||||
config_load provisioning
|
||||
#check if iup should be used or if its overridden by /etc/config
|
||||
config_get configurl configserver url
|
||||
config_get reboot configserver reboot
|
||||
config_get iupurl iup urliup
|
||||
|
||||
if [ $configurl ]; then
|
||||
handle_provisioning configserver "0"
|
||||
elif [ $iupurl ]; then
|
||||
handle_provisioning iup "1"
|
||||
else
|
||||
v "No provisioning server configured"
|
||||
exit
|
||||
fi
|
||||
|
||||
config_load provisioning
|
||||
config_foreach handle_provisioning subconfig "0"
|
||||
config_get software uppgradeserver url
|
||||
sofwareminuspath=${software##*/}
|
||||
|
||||
if [ $software ]; then
|
||||
v "Software version to download \"$sofwareminuspath\""
|
||||
local sysinfo=$(ubus call router.system info)
|
||||
json_load "$sysinfo"
|
||||
json_select system
|
||||
json_get_var firmware firmware
|
||||
json_get_var filesystem filesystem
|
||||
if [ "$filesystem" == "JFFS2" ] ; then
|
||||
firmware=$firmware.w
|
||||
else
|
||||
firmware=$firmware.y3
|
||||
fi
|
||||
if [ "$sofwareminuspath" == "${sofwareminuspath/$firmware/}" ] ; then
|
||||
v "Software \"$software\""
|
||||
handle_provisioning uppgradeserver "0"
|
||||
else
|
||||
v "Will not update software, already up to date"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $CONF -eq 1 ]; then
|
||||
mv "$IUPMD5.temp" $IUPMD5
|
||||
fi
|
||||
|
||||
if [ "$reboot" == "on" ]; then
|
||||
vv "Rebooting"
|
||||
export REBOOT_REASON=iup
|
||||
/sbin/reboot
|
||||
fi
|
||||
|
||||
rm -rf /var/run/iup.pid
|
||||
}
|
||||
|
||||
main $@
|
||||
@@ -100,6 +100,6 @@ define Package/libcgroup-utils/install
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libcgroup))
|
||||
$(eval $(call BuildPackage,libcgroup-daemon))
|
||||
$(eval $(call BuildPackage,libcgroup-utils))
|
||||
#$(eval $(call BuildPackage,libcgroup))
|
||||
#$(eval $(call BuildPackage,libcgroup-daemon))
|
||||
#$(eval $(call BuildPackage,libcgroup-utils))
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.2
|
||||
PKG_VERSION:=0.3
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libpicoevent.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f4ab03b22fca57cec6c959fb5c54bcdd64c32467
|
||||
PKG_NAME:=libpicoevent
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
@@ -34,7 +34,7 @@ define Package/libtrace
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Libtrace library for packet trace processing
|
||||
URL:=http://research.wand.net.nz/software/libtrace.php
|
||||
DEPENDS:=+libpcap +libpthread +zlib +libbz2 +liblzo +librt +$(CXX_DEPENDS)
|
||||
DEPENDS:=+libpcap +libpthread +zlib +libbz2 +liblzo +librt +liblzma +$(CXX_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/libtrace/description
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-1905
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_VERSION:=0.0.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c5f002e7a90246107f1db2f38206f5c7fc7e1a66
|
||||
PKG_SOURCE_VERSION:=c525f73488a4b5da178cfc6968a9bde73cf8edb7
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
@@ -23,13 +23,19 @@ define Package/map-1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:= MultiAP Stack
|
||||
DEPENDS:= +ubox +lib1905al +libwifi
|
||||
DEPENDS:= +libuci +libjson-c +ubox +libpcap +libopenssl +libwifi +libeasy +libuci
|
||||
endef
|
||||
|
||||
define Package/map-1905/description
|
||||
MultiAP plugin for ieee1905d based on Wifi alliance's MAP-r2 specification
|
||||
endef
|
||||
|
||||
define Package/libmaputils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WFA MultiAP utility library
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
@@ -37,18 +43,11 @@ TARGET_CFLAGS += \
|
||||
-Wall \
|
||||
-Wextra
|
||||
|
||||
ifeq ($(CONFIG_IEEE1905_SEND_EMPTY_TLVS),y)
|
||||
TARGET_CFLAGS += -DSEND_EMPTY_TLVS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_FIX_BROKEN_TLVS),y)
|
||||
TARGET_CFLAGS += -DFIX_BROKEN_TLVS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_SPEED_UP_DISCOVERY),y)
|
||||
TARGET_CFLAGS += -DSPEED_UP_DISCOVERY
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS),y)
|
||||
TARGET_CFLAGS += -DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
endif
|
||||
TARGET_CFLAGS += -DALME_OVER_UBUS
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -59,6 +58,20 @@ endif
|
||||
define Package/map-1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifimap-2.so $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/usr/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ieee1905 $(1)/etc/init.d/ieee1905
|
||||
$(INSTALL_DATA) ./files/etc/config/ieee1905 $(1)/etc/config/ieee1905
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905d/ieee1905d $(1)/usr/sbin/
|
||||
$(CP) $(PKG_BUILD_DIR)/ieee1905d/lib/lib1905.so $(1)/usr/lib/lib1905.so
|
||||
endef
|
||||
|
||||
define Package/libmaputils/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/libmaputils.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
@@ -67,6 +80,8 @@ define Build/InstallDev
|
||||
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/map1905/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifimap-2.so $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmaputils))
|
||||
$(eval $(call BuildPackage,map-1905))
|
||||
|
||||
17
map-1905/files/etc/config/ieee1905
Normal file
17
map-1905/files/etc/config/ieee1905
Normal file
@@ -0,0 +1,17 @@
|
||||
config ieee1905
|
||||
option enabled '1'
|
||||
option debug true
|
||||
|
||||
config al
|
||||
option enabled '1'
|
||||
option basemacint 'wan'
|
||||
option mapall 0
|
||||
# option registrar true
|
||||
option debug_level 2
|
||||
option cmdu_event false
|
||||
option map_plugin 1
|
||||
|
||||
config al-iface
|
||||
option enabled '1'
|
||||
option ifname 'br-lan'
|
||||
option media 'bridge'
|
||||
276
map-1905/files/etc/init.d/ieee1905
Normal file
276
map-1905/files/etc/init.d/ieee1905
Normal file
@@ -0,0 +1,276 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
AL_CONF=/tmp/ieee1905.config
|
||||
INTERFACE=""
|
||||
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:false' \
|
||||
'enabled:bool:false'
|
||||
}
|
||||
|
||||
get_device_name() {
|
||||
local device
|
||||
# Get wan L3 interface
|
||||
ubus list |grep -iq network.interface.${1}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
json_load "$(ubus -t 2 call network.interface.${1} status)"
|
||||
json_get_var device device
|
||||
echo ${device}
|
||||
fi
|
||||
}
|
||||
|
||||
get_interface_mac() {
|
||||
local l3 basemac
|
||||
l3=$(get_device_name ${1})
|
||||
if [ -n ${l3} ]; then
|
||||
json_load "$(ubus -t 2 call network.device status "{\"name\":\"${l3}\"}")"
|
||||
json_get_var basemac macaddr
|
||||
fi
|
||||
local first=0x$(echo $basemac |cut -d : -f 1)
|
||||
local rest=$(echo $basemac |cut -d : -f 2-)
|
||||
# Set local bit
|
||||
first=$((first|2))
|
||||
first=$(printf "%02x" $first)
|
||||
basemac="${first}:${rest}"
|
||||
echo ${basemac}
|
||||
}
|
||||
|
||||
validate_al_iface_section()
|
||||
{
|
||||
uci_validate_section ieee1905 al-iface "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'ifname:string:br-lan' \
|
||||
'media:string:bridge'
|
||||
}
|
||||
|
||||
get_ifindex()
|
||||
{
|
||||
local ifname=${1}
|
||||
local ifindex=$(cat /sys/class/net/${ifname}/upper_*/ifindex 2>/dev/null)
|
||||
if [ -z ${ifindex} ]; then
|
||||
ifindex=$(cat /sys/class/net/${ifname}/ifindex)
|
||||
fi
|
||||
echo ${ifindex}
|
||||
}
|
||||
|
||||
get_wlan_passkey()
|
||||
{
|
||||
local ifname=${1}
|
||||
local pass=""
|
||||
local count=0
|
||||
|
||||
while true
|
||||
do
|
||||
local devname=$(uci get wireless.@wifi-iface[${count}].ifname 2>/dev/null)
|
||||
if [ $? -ne 0 ]; then
|
||||
break;
|
||||
fi
|
||||
if [ "${devname}"=="${ifname}" ]; then
|
||||
pass=$(uci get wireless.@wifi-iface[${count}].key 2>/dev/null)
|
||||
break;
|
||||
fi
|
||||
count=$((count+1))
|
||||
done
|
||||
echo ${pass}
|
||||
}
|
||||
|
||||
configure_interface()
|
||||
{
|
||||
local ifname media enabled manufacturer_name model_name model_number device_name serial_number
|
||||
local uuid ifindex
|
||||
|
||||
validate_al_iface_section ${1} || {
|
||||
echo "Validation of al-iface sec failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${enabled} -eq 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
# Only continue if interface exists
|
||||
ifconfig ${ifname} 2>/dev/null 1>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
if [ -z ${INTERFACE} ]; then
|
||||
INTERFACE=${ifname}
|
||||
else
|
||||
INTERFACE="${INTERFACE},${ifname}"
|
||||
fi
|
||||
|
||||
if [ "${media}" = "bridge" ]; then
|
||||
echo "Get interfaces from bridge">/dev/console
|
||||
local lower=$(ls -1 /sys/class/net/${ifname}/|grep lower_|tr '_' ' '|awk '{printf $2" "}')
|
||||
for intf in ${lower}
|
||||
do
|
||||
ubus list wifi.ap.${intf} 2>/dev/null 1>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
INTERFACE="${INTERFACE},${intf}"
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
ifindex=$(get_ifindex ${intf})
|
||||
local key=$(get_wlan_passkey ${ifname})
|
||||
json_add_object
|
||||
json_add_string ifname ${intf}
|
||||
json_add_string media "wifi"
|
||||
json_add_string network_key ${key}
|
||||
json_close_object
|
||||
fi
|
||||
done
|
||||
fi
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
ifindex=$(get_ifindex ${ifname})
|
||||
|
||||
json_add_object
|
||||
json_add_string ifname ${ifname}
|
||||
|
||||
if [ "${media}"=="bridge" ]; then
|
||||
json_add_string media "eth"
|
||||
elif [ "${media}"=="wifi" ]; then
|
||||
local key=$(get_wlan_passkey ${ifname})
|
||||
json_add_string media "wifi"
|
||||
json_add_string network_key ${key}
|
||||
else
|
||||
json_add_string media ${media}
|
||||
fi
|
||||
|
||||
json_close_object
|
||||
}
|
||||
|
||||
validate_al_section()
|
||||
{
|
||||
uci_validate_section ieee1905 meshcomms "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'basemacint:string:wan' \
|
||||
'almac:string' \
|
||||
'registrar:bool:false' \
|
||||
'mapall:bool:true' \
|
||||
'debug_level:uinteger:1' \
|
||||
'alme_port:port:8888' \
|
||||
'cmdu_event:bool:true' \
|
||||
'discovery_timer:uinteger:60' \
|
||||
'map_plugin:bool:false'
|
||||
}
|
||||
|
||||
|
||||
configure_al_entity()
|
||||
{
|
||||
local enabled almac basemacint mapall debug_level alme_port l3device basemac intf
|
||||
local registrar cmdu_event discovery_timer map_plugin
|
||||
|
||||
validate_al_section ${1} || {
|
||||
echo "Validation of al section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ -z ${almac} ]; then
|
||||
basemac=$(get_interface_mac ${basemacint})
|
||||
else
|
||||
basemac=${almac}
|
||||
fi
|
||||
|
||||
|
||||
local fname cname model cUrl
|
||||
fname=$(db get hw.board.boardId)
|
||||
cname=$(db get hw.board.iopVerCustomer)
|
||||
model=$(db get hw.board.routerModel)
|
||||
# get ip from lan bridge first
|
||||
cUrl=$(ifconfig br-lan 2>/dev/null|grep "inet addr:"|tr ':' ' '|awk '{printf $3}')
|
||||
if [ -z ${cUrl} ]; then
|
||||
cUrl=$(ifconfig br-wan 2>/dev/null|grep "inet addr:"|tr ':' ' '|awk '{printf $3}')
|
||||
fi
|
||||
if [ -z ${cUrl} ]; then
|
||||
cUrl="http://192.168.1.1"
|
||||
fi
|
||||
|
||||
json_init
|
||||
# fill the al-iface info
|
||||
json_add_array al-iface
|
||||
config_foreach configure_interface al-iface
|
||||
json_close_array
|
||||
|
||||
json_add_object deviceInfo
|
||||
json_add_string friendly_name ${fname}
|
||||
json_add_string manufacturer_name ${cname}
|
||||
json_add_string model ${model}
|
||||
json_add_string control_url ${cUrl}
|
||||
json_close_object
|
||||
|
||||
json_add_object al
|
||||
json_add_int enabled ${enabled}
|
||||
json_add_string mac ${basemac}
|
||||
json_add_string interfaces ${INTERFACE}
|
||||
json_add_int map ${mapall}
|
||||
json_add_int registrar ${registrar}
|
||||
json_add_int debug_level ${debug_level}
|
||||
json_add_int alme_port ${alme_port}
|
||||
json_add_int cmdu_event ${cmdu_event}
|
||||
json_add_int discovery_timer ${discovery_timer}
|
||||
json_add_int map_plugin ${map_plugin}
|
||||
json_close_object
|
||||
|
||||
json_dump >${AL_CONF}
|
||||
sync
|
||||
}
|
||||
|
||||
configure_ieee1905()
|
||||
{
|
||||
local enabled debug
|
||||
|
||||
validate_ieee1905_section ${1} || {
|
||||
echo "Validation of ieee1905 section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
# procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ ${enabled} -ne 1 ]; then
|
||||
exit 0;
|
||||
fi
|
||||
}
|
||||
|
||||
configure_network() {
|
||||
[ -f ${AL_CONF} ] && rm ${AL_CONF}
|
||||
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach configure_ieee1905 ieee1905
|
||||
config_foreach configure_al_entity al
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance ieee1905
|
||||
procd_set_param command ${PROG}
|
||||
configure_network
|
||||
# procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_reload_trigger "wireless"
|
||||
procd_add_reload_trigger "netmode"
|
||||
}
|
||||
60
mapagent/Makefile
Normal file
60
mapagent/Makefile
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mapagent
|
||||
PKG_VERSION:=2.0.1
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=362ddbaf2b9a5510c89b740fcc23d8425770da3d
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-agent.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mapagent
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus
|
||||
endef
|
||||
|
||||
define Package/mapagent/description
|
||||
This package implements EasyMesh R2 compliant WiFi Agent.
|
||||
endef
|
||||
|
||||
define Package/mapagent/config
|
||||
#source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/map-agent
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/src/include/*.h $(1)/usr/include/map-agent
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/timer_impl.h $(1)/usr/include/map-agent
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/mapagent/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/*.so* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mapagent))
|
||||
38
mcastmngr/Makefile
Normal file
38
mcastmngr/Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Copyright (C) 2013-2020 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mcastmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mcastmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=multicast packets manager daemon
|
||||
endef
|
||||
|
||||
define Package/mcastmngr/description
|
||||
Configures IGMP and MLD snooping and proxy
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./mcastmngr/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/mcastmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mcastmngr))
|
||||
35
mcastmngr/files/etc/init.d/mcast
Executable file
35
mcastmngr/files/etc/init.d/mcast
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=mcast
|
||||
|
||||
include /lib/network
|
||||
include /lib/mcast
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger network $NAME
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ -f "/etc/config/mcast" ]; then
|
||||
configure_mcast
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG_EXE"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
service_stop $PROG_EXE
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
55
mcastmngr/files/etc/uci-defaults/61-mcast_config_generate
Normal file
55
mcastmngr/files/etc/uci-defaults/61-mcast_config_generate
Normal file
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
generate_igmp_global_params(){
|
||||
uci add mcast igmp
|
||||
uci rename mcast.@igmp[-1]="igmp"
|
||||
uci set mcast.@igmp[-1].max_membership="20"
|
||||
uci set mcast.@igmp[-1].max_msf="10"
|
||||
uci set mcast.@igmp[-1].qrv="2"
|
||||
uci set mcast.@igmp[-1].force_version="0"
|
||||
|
||||
uci add mcast mld
|
||||
uci rename mcast.@mld[-1]="mld"
|
||||
uci set mcast.@mld[-1].mldv1_unsolicited_report_interval="10"
|
||||
uci set mcast.@mld[-1].mldv2_unsolicited_report_interval="1"
|
||||
uci set mcast.@mld[-1].qrv="2"
|
||||
uci set mcast.@mld[-1].force_version="0"
|
||||
|
||||
uci commit mcast
|
||||
}
|
||||
|
||||
generate_mcast_config(){
|
||||
section="$1"
|
||||
|
||||
config_get type "$section" "type"
|
||||
if [ "$type" != "bridge" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
uci add mcast snooping
|
||||
uci rename mcast.@snooping[-1]="msnoop_1"
|
||||
uci set mcast.@snooping[-1].enable="0"
|
||||
uci set mcast.@snooping[-1].proto="igmp"
|
||||
uci set mcast.@snooping[-1].version="2"
|
||||
uci set mcast.@snooping[-1].robustness="2"
|
||||
uci set mcast.@snooping[-1].aggregation="0"
|
||||
uci set mcast.@snooping[-1].interface="br-$section"
|
||||
uci commit mcast
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/mcast" ]; then
|
||||
if uci -q get mcast.@snooping[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/mcast
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/mcast
|
||||
|
||||
generate_igmp_global_params
|
||||
|
||||
config_load network
|
||||
config_foreach generate_mcast_config interface
|
||||
367
mcastmngr/files/lib/mcast/broadcom.sh
Executable file
367
mcastmngr/files/lib/mcast/broadcom.sh
Executable file
@@ -0,0 +1,367 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
include /lib/network
|
||||
|
||||
CONFFILE=/var/mcpd.conf
|
||||
PROG_EXE=/usr/sbin/mcpd
|
||||
|
||||
# Parameters available in snooping configuration
|
||||
igmp_s_enable=0
|
||||
igmp_s_version=2
|
||||
igmp_s_robustness=2
|
||||
igmp_s_iface=""
|
||||
igmp_s_exceptions=""
|
||||
|
||||
mld_s_enable=0
|
||||
mld_s_version=2
|
||||
mld_s_robustness=2
|
||||
mld_s_iface=""
|
||||
mld_s_exceptions=""
|
||||
|
||||
# Global params
|
||||
max_groups=25
|
||||
max_msf=10
|
||||
max_members=25
|
||||
mldv1_unsolicited_report_interval=10
|
||||
mldv2_unsolicited_report_interval=1
|
||||
|
||||
# Parameters available in proxy configuration
|
||||
igmp_p_enable=0
|
||||
igmp_p_version=2
|
||||
igmp_query_interval=125
|
||||
igmp_q_resp_interval=100
|
||||
igmp_last_mem_q_int=10
|
||||
igmp_fast_leave=1
|
||||
igmp_p_robustness=2
|
||||
igmp_p_up_interfaces=""
|
||||
igmp_p_down_interfaces=""
|
||||
igmp_p_exceptions=""
|
||||
|
||||
mld_p_enable=0
|
||||
mld_p_version=1
|
||||
mld_query_interval=125
|
||||
mld_q_resp_interval=100
|
||||
mld_last_mem_q_int=10
|
||||
mld_fast_leave=1
|
||||
mld_p_robustness=2
|
||||
mld_p_up_interfaces=""
|
||||
mld_p_down_interfaces=""
|
||||
mld_p_exceptions=""
|
||||
|
||||
# Standard parameters need by BCM's multicast daemon
|
||||
l_2_l_mcast=0
|
||||
allow_brdevice=0
|
||||
|
||||
proxdevs=""
|
||||
ethwan="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
read_snooping() {
|
||||
local config="$1"
|
||||
local sec_enable
|
||||
local proto
|
||||
|
||||
config_get sec_enable "$config" enable 0
|
||||
config_get proto "$config" proto
|
||||
|
||||
if [ "$sec_enable" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$proto" == "igmp" ]; then
|
||||
igmp_s_enable=$sec_enable
|
||||
config_get igmp_s_version "$config" version 2
|
||||
config_get igmp_s_robustness "$config" robustness 2
|
||||
config_get igmp_s_iface "$config" interface
|
||||
config_get igmp_s_exceptions "$config" filter
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$proto" == "mld" ]; then
|
||||
mld_s_enable=$sec_enable
|
||||
config_get mld_s_version "$config" version 2
|
||||
config_get mld_s_robustness "$config" robustness 2
|
||||
config_get mld_s_iface "$config" interface
|
||||
config_get mld_s_exceptions "$config" filter
|
||||
return
|
||||
fi
|
||||
}
|
||||
|
||||
read_proxy() {
|
||||
local config="$1"
|
||||
local sec_enable
|
||||
local proto
|
||||
|
||||
config_get sec_enable "$config" enable 0
|
||||
config_get proto "$config" proto
|
||||
|
||||
if [ "$sec_enable" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$proto" == "igmp" ]; then
|
||||
igmp_p_enable=$sec_enable
|
||||
config_get igmp_p_version "$config" version 2
|
||||
config_get igmp_query_interval "$config" query_interval
|
||||
config_get igmp_q_resp_interval "$config" query_response_interval
|
||||
config_get igmp_last_mem_q_int "$config" last_member_query_interval
|
||||
config_get igmp_fast_leave "$config" fast_leave 1
|
||||
config_get igmp_p_robustness "$config" robustness 2
|
||||
config_get igmp_p_up_interfaces "$config" upstream_interface
|
||||
config_get igmp_p_down_interfaces "$config" downstream_interface
|
||||
config_get igmp_p_exceptions "$config" filter
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$proto" == "mld" ]; then
|
||||
mld_p_enable=$sec_enable
|
||||
config_get mld_p_version "$config" version 2
|
||||
config_get mld_query_interval "$config" query_interval
|
||||
config_get mld_q_resp_interval "$config" query_response_interval
|
||||
config_get mld_last_mem_q_int "$config" last_member_query_interval
|
||||
config_get mld_fast_leave "$config" fast_leave 1
|
||||
config_get mld_p_robustness "$config" robustness 2
|
||||
config_get mld_p_up_interfaces "$config" upstream_interface
|
||||
config_get mld_p_down_interfaces "$config" downstream_interface
|
||||
config_get mld_p_exceptions "$config" filter
|
||||
return
|
||||
fi
|
||||
}
|
||||
|
||||
config_snooping_common_params() {
|
||||
local protocol="$1"
|
||||
echo "${protocol}-default-version $2" >> $CONFFILE
|
||||
echo "${protocol}-robustness-value $3" >> $CONFFILE
|
||||
echo "${protocol}-max-groups $max_groups" >> $CONFFILE
|
||||
echo "${protocol}-max-sources $max_msf" >> $CONFFILE
|
||||
echo "${protocol}-max-members $max_members" >> $CONFFILE
|
||||
echo "${protocol}-snooping-enable $4" >> $CONFFILE
|
||||
}
|
||||
|
||||
config_mcast_querier_params() {
|
||||
local protocol="$1"
|
||||
local query_interval=$2
|
||||
local q_resp_interval=$3
|
||||
local last_mem_q_int=$4
|
||||
|
||||
echo "${protocol}-query-interval $query_interval" >> $CONFFILE
|
||||
echo "${protocol}-query-response-interval $q_resp_interval" >> $CONFFILE
|
||||
echo "${protocol}-last-member-query-interval $last_mem_q_int" >> $CONFFILE
|
||||
}
|
||||
|
||||
config_snooping_on_bridge() {
|
||||
local protocol="$1"
|
||||
local bcm_mcast_p=1
|
||||
echo "${protocol}-snooping-interfaces $2" >> $CONFFILE
|
||||
|
||||
[ "$protocol" == "mld" ] && bcm_mcast_p=2
|
||||
|
||||
for snpif in $2; do
|
||||
case "$snpif" in
|
||||
br-*)
|
||||
# set snooping mode on the bridge
|
||||
bcmmcastctl mode -i $snpif -p $bcm_mcast_p -m $3
|
||||
# set L2L snooping mode on the bridge
|
||||
bcmmcastctl l2l -i $snpif -p $bcm_mcast_p -e $l_2_l_mcast # set L2L snooping mode on the bridge
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
handle_bridged_proxy_interface() {
|
||||
local p2="$1"
|
||||
local p_enable=0
|
||||
|
||||
if [ "$p2" == "igmp" ]; then
|
||||
p_enable=$igmp_p_enable
|
||||
else
|
||||
p_enable=$mld_p_enable
|
||||
fi
|
||||
|
||||
if [ $p_enable -eq 1 -a $allow_brdevice -eq 1 ]
|
||||
then
|
||||
proxdevs="$proxdevs $2"
|
||||
echo "upstream-interface $2" >>$CONFFILE
|
||||
else
|
||||
json_load "$(devstatus $2)"
|
||||
itr=1
|
||||
json_select bridge-members
|
||||
while json_get_var dev $itr; do
|
||||
case "$dev" in
|
||||
*.*)
|
||||
port="$(echo "$dev" | cut -d'.' -f 1)"
|
||||
if [ $port == $ethwan ]; then
|
||||
ifconfig $dev | grep RUNNING >/dev/null && proxdevs="$proxdevs $dev" && break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
itr=$(($itr + 1))
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
}
|
||||
|
||||
config_mcast_proxy_interface() {
|
||||
local itr
|
||||
local p1="$1"
|
||||
local p_enable
|
||||
|
||||
if [ "$p1" == "igmp" ]; then
|
||||
p_enable=$igmp_p_enable
|
||||
else
|
||||
p_enable=$mld_p_enable
|
||||
fi
|
||||
|
||||
for proxif in $2; do
|
||||
case "$proxif" in
|
||||
br-*)
|
||||
handle_bridged_proxy_interface $p1 $proxif
|
||||
;;
|
||||
*)
|
||||
proxdevs="$proxdevs $proxif"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $p_enable -eq 1 ]; then
|
||||
echo "${p1}-proxy-interfaces $proxdevs" >> $CONFFILE
|
||||
fi
|
||||
|
||||
[ -n "$proxdevs" ] && echo "${p1}-mcast-interfaces $proxdevs" >> $CONFFILE
|
||||
}
|
||||
|
||||
configure_mcpd_snooping() {
|
||||
local protocol="$1"
|
||||
local exceptions
|
||||
|
||||
|
||||
# Configure snooping related params
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
config_snooping_common_params $protocol $igmp_p_version $igmp_p_robustness $igmp_s_enable
|
||||
config_mcast_querier_params $protocol $igmp_query_interval $igmp_q_resp_interval $igmp_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol $igmp_s_iface
|
||||
config_snooping_on_bridge $protocol $igmp_s_iface $igmp_s_enable
|
||||
exceptions=$igmp_s_exceptions
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
config_snooping_common_params $protocol $mld_p_version $mld_p_robustness $mld_s_enable
|
||||
config_mcast_querier_params $protocol $mld_query_interval $mld_q_resp_interval $mld_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol $mld_s_iface
|
||||
config_snooping_on_bridge $protocol $mld_s_iface $mld_s_enable
|
||||
exceptions=$mld_s_exceptions
|
||||
fi
|
||||
|
||||
echo "${protocol}-proxy-enable 0" >> $CONFFILE
|
||||
[ -n "$exceptions" ] && echo "${protocol}-mcast-snoop-exceptions $exceptions" >> $CONFFILE
|
||||
}
|
||||
|
||||
configure_mcpd_proxy() {
|
||||
local s_mode=2
|
||||
local protocol="$1"
|
||||
local fast_leave=0
|
||||
local exceptions=""
|
||||
|
||||
# Configure snooping related params
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
config_snooping_common_params $protocol $igmp_p_version $igmp_p_robustness $s_mode
|
||||
config_mcast_querier_params $protocol $igmp_query_interval $igmp_q_resp_interval $igmp_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol $igmp_p_up_interfaces
|
||||
config_snooping_on_bridge $protocol $igmp_p_down_interfaces $s_mode
|
||||
fast_leave=$igmp_fast_leave
|
||||
exceptions=$igmp_p_exceptions
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
config_snooping_common_params $protocol $mld_p_version $mld_p_robustness $s_mode
|
||||
config_mcast_querier_params $protocol $mld_query_interval $mld_q_resp_interval $mld_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol $mld_p_up_interfaces
|
||||
config_snooping_on_bridge $protocol $mld_p_down_interfaces $s_mode
|
||||
fast_leave=$mld_fast_leave
|
||||
exceptions=$mld_p_exceptions
|
||||
fi
|
||||
|
||||
# This function will only be hit in case proxy is enabled, so hard coding
|
||||
# proxy enable should not be a problem
|
||||
echo "${protocol}-proxy-enable 1" >> $CONFFILE
|
||||
echo "${protocol}-fast-leave $fast_leave" >> $CONFFILE
|
||||
|
||||
[ -n "$exceptions" ] && echo "$protocol-mcast-snoop-exceptions $exceptions" >> $CONFFILE
|
||||
}
|
||||
|
||||
disable_snooping() {
|
||||
local bcm_mcast_p=$1
|
||||
|
||||
for br in $(brctl show | grep 'br-' | awk '{print$1}' | tr '\n' ' '); do
|
||||
bcmmcastctl mode -i $br -p $bcm_mcast_p -m 0 # disable snooping on all bridges
|
||||
bcmmcastctl l2l -i $br -p $bcm_mcast_p -e 0 # disable L2L snooping on all bridges
|
||||
done
|
||||
}
|
||||
|
||||
configure_mcpd() {
|
||||
disable_snooping 1
|
||||
disable_snooping 2
|
||||
|
||||
# BCM's mcpd does not allow configuration of proxy and L2 snooping simultaneously, hence
|
||||
# here, if proxy is to be configured then the configuration params of snooping are ignored.
|
||||
if [ "$igmp_p_enable" == "1" ]; then
|
||||
configure_mcpd_proxy igmp
|
||||
elif [ "$igmp_s_enable" == "1" ]; then
|
||||
configure_mcpd_snooping igmp
|
||||
fi
|
||||
|
||||
proxdevs=""
|
||||
if [ "$mld_p_enable" == "1" ]; then
|
||||
configure_mcpd_proxy mld
|
||||
elif [ "$mld_s_enable" == "1" ]; then
|
||||
configure_mcpd_snooping mld
|
||||
fi
|
||||
}
|
||||
|
||||
read_mcast_snooping_params() {
|
||||
config_load mcast
|
||||
config_foreach read_snooping snooping
|
||||
}
|
||||
|
||||
read_mcast_proxy_params() {
|
||||
config_load mcast
|
||||
config_foreach read_proxy proxy
|
||||
}
|
||||
|
||||
config_global_params() {
|
||||
local igmp_qrv
|
||||
local igmp_force_version
|
||||
local mld_qrv
|
||||
local mld_force_version
|
||||
|
||||
config_load mcast
|
||||
config_get max_msf igmp max_msf 10
|
||||
config_get max_groups igmp max_membership 25
|
||||
config_get igmp_qrv igmp qrv 2
|
||||
config_get igmp_force_version igmp force_version 0
|
||||
|
||||
config_get mld_qrv mld qrv 2
|
||||
config_get mldv1_unsolicited_report_interval mld mldv1_unsolicited_report_interval 10
|
||||
config_get mldv2_unsolicited_report_interval mld mldv2_unsolicited_report_interval 1
|
||||
config_get mld_force_version mld force_version 0
|
||||
|
||||
# mcpd internally writes max_groups and max_msf, no need to modify
|
||||
# here directly
|
||||
echo $igmp_qrv > /proc/sys/net/ipv4/igmp_qrv
|
||||
echo $igmp_force_version > /proc/sys/net/ipv4/conf/all/force_igmp_version
|
||||
|
||||
echo $mld_qrv > /proc/sys/net/ipv6/mld_qrv
|
||||
echo $mld_force_version > /proc/sys/net/ipv6/conf/all/force_mld_version
|
||||
echo $mldv1_unsolicited_report_interval > /proc/sys/net/ipv6/conf/all/mldv1_unsolicited_report_interval
|
||||
echo $mldv2_unsolicited_report_interval > /proc/sys/net/ipv6/conf/all/mldv2_unsolicited_report_interval
|
||||
}
|
||||
|
||||
configure_mcast() {
|
||||
rm -f $CONFFILE
|
||||
touch $CONFFILE
|
||||
|
||||
config_global_params
|
||||
|
||||
read_mcast_snooping_params
|
||||
read_mcast_proxy_params
|
||||
|
||||
configure_mcpd
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
# All rights reserved.
|
||||
# See LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mtk7603e
|
||||
PKG_VERSION:=4.1.2.0_20190222
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:mediatek/mt7603.git
|
||||
PKG_SOURCE_VERSION:=4e94b2c3f45b7d5374ed988cdad925d5ca30b838
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
|
||||
MTK7603_CONFIG:=$(shell cat mtk7603e.config)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/mtk7603e
|
||||
CATEGORY:=Mediatek drivers
|
||||
TITLE:=WiFi drivers
|
||||
#DEPENDS:= +wifi-profile
|
||||
ifneq ($(CONFIG_MTK_FAST_NAT_SUPPORT), )
|
||||
ifneq ($(CONFIG_NET_MEDIATEK_HNAT), )
|
||||
DEPENDS+=+kmod-mediatek_hnat
|
||||
endif
|
||||
endif
|
||||
FILES:=$(PKG_BUILD_DIR)/mt7603_wifi_ap/mt7603e.ko
|
||||
AUTOLOAD:=$(call AutoProbe, mt7603e)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
## check following
|
||||
#CONFIG_MT7603E_HOTSPOT=y (depends on missing WAPP_SUPPORT)
|
||||
#CONFIG_MT7603E_MBO_SUPPORT=y
|
||||
#CONFIG_MT7603E_MAP_SUPPORT=y
|
||||
#CONFIG_MT7603E_TXBF_SUPPORT=y (undef -DVHT_TXBF_SUPPORT)
|
||||
#CONFIG_MT7603E_ACL_V2_SUPPORT=y (build error)
|
||||
#CONFIG_MT7603E_DFS_SUPPORT=y (unnecessary)
|
||||
#CONFIG_MT7603E_SINGLE_SKU_V2=y (fix: get_single_sku_path())
|
||||
#CONFIG_MT7603E_WDS_SUPPORT=y ( incomplete? )
|
||||
#CONFIG_MT7603E_BTCOEX_CONCURRENT=y (undefined)
|
||||
|
||||
NOSTDINC_FLAGS := -DCONFIG_SECOND_IF_MT7615E -DCONFIG_FIRST_IF_MT7603E \
|
||||
-Wno-misleading-indentation
|
||||
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) V=1 \
|
||||
$(MTK7603_CONFIG) \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)/mt7603_wifi_ap" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define KernelPackage/mtk7603e/install
|
||||
$(INSTALL_DIR) $(1)/etc_ro/wlan
|
||||
$(INSTALL_DIR) $(1)/etc_ro/Wireless/RT2860
|
||||
$(INSTALL_DIR) $(1)/etc/Wireless/RT2860
|
||||
$(CP) ./files/MT7603_EEPROM.bin $(1)/etc_ro/wlan
|
||||
$(CP) ./files/RT2860.dat $(1)/etc/Wireless/RT2860/RT2860.dat
|
||||
$(CP) ./files/SingleSKU.dat $(1)/etc_ro/Wireless/RT2860
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,mtk7603e))
|
||||
Binary file not shown.
@@ -1,409 +0,0 @@
|
||||
Default
|
||||
AccessControlList0=
|
||||
AccessControlList1=
|
||||
AccessControlList10=
|
||||
AccessControlList11=
|
||||
AccessControlList12=
|
||||
AccessControlList13=
|
||||
AccessControlList14=
|
||||
AccessControlList15=
|
||||
AccessControlList2=
|
||||
AccessControlList3=
|
||||
AccessControlList4=
|
||||
AccessControlList5=
|
||||
AccessControlList6=
|
||||
AccessControlList7=
|
||||
AccessControlList8=
|
||||
AccessControlList9=
|
||||
AccessPolicy0=0
|
||||
AccessPolicy1=0
|
||||
AccessPolicy10=0
|
||||
AccessPolicy11=0
|
||||
AccessPolicy12=0
|
||||
AccessPolicy13=0
|
||||
AccessPolicy14=0
|
||||
AccessPolicy15=0
|
||||
AccessPolicy2=0
|
||||
AccessPolicy3=0
|
||||
AccessPolicy4=0
|
||||
AccessPolicy5=0
|
||||
AccessPolicy6=0
|
||||
AccessPolicy7=0
|
||||
AccessPolicy8=0
|
||||
AccessPolicy9=0
|
||||
AckPolicy=0;0;0;0
|
||||
APACM=0;0;0;0
|
||||
APAifsn=3;7;1;1
|
||||
ApCliAuthMode=WPA2PSK
|
||||
ApCliBssid=
|
||||
ApCliDefaultKeyID=
|
||||
ApCliEnable=0
|
||||
ApCliEncrypType=AES
|
||||
ApCliKey1Str=
|
||||
ApCliKey1Str1=
|
||||
ApCliKey1Type=0
|
||||
ApCliKey2Str=
|
||||
ApCliKey2Str1=
|
||||
ApCliKey2Type=0
|
||||
ApCliKey3Str=
|
||||
ApCliKey3Str1=
|
||||
ApCliKey3Type=0
|
||||
ApCliKey4Str=
|
||||
ApCliKey4Str1=
|
||||
ApCliKey4Type=0
|
||||
ApCliSsid=
|
||||
ApCliWirelessMode=9
|
||||
ApCliWPAPSK=
|
||||
ApCliWPAPSK1=
|
||||
APCwmax=6;10;4;3
|
||||
APCwmin=4;4;3;2
|
||||
APSDCapable=0
|
||||
APTxop=0;0;94;47
|
||||
AuthMode=WPA2PSK
|
||||
AutoChannelSelect=1
|
||||
AutoChannelSkipList=2;3;4;5;7;8;9;10;12;13;14
|
||||
AutoProvisionEn=0
|
||||
BandSteering=0
|
||||
BasicRate=15
|
||||
BeaconPeriod=100
|
||||
BFBACKOFFenable=0
|
||||
BgndScanSkipCh=
|
||||
BGProtection=0
|
||||
BndStrgBssIdx=
|
||||
BSSACM=0;0;0;0
|
||||
BSSAifsn=3;7;2;2
|
||||
BSSCwmax=10;10;4;3
|
||||
BSSCwmin=4;4;3;2
|
||||
BssidNum=4
|
||||
BSSTxop=0;0;94;47
|
||||
BW_Enable=0
|
||||
BW_Guarantee_Rate=
|
||||
BW_Maximum_Rate=
|
||||
BW_Priority=
|
||||
BW_Root=0
|
||||
CalCacheApply=0
|
||||
CarrierDetect=0
|
||||
Channel=auto
|
||||
ChannelGrp=
|
||||
CountryCode=DE
|
||||
CountryRegion=1
|
||||
CountryRegionABand=1
|
||||
CP_SUPPORT=2
|
||||
CSPeriod=6
|
||||
DBDC_MODE=0
|
||||
DebugFlags=0
|
||||
DefaultKeyID=1
|
||||
DfsCalibration=0
|
||||
DfsEnable=0
|
||||
DfsFalseAlarmPrevent=1
|
||||
DfsZeroWait=0
|
||||
DfsZeroWaitCacTime=255
|
||||
DisableOLBC=0
|
||||
DtimPeriod=1
|
||||
E2pAccessMode=2
|
||||
EAPifname=br0
|
||||
EDCCAEnable=1
|
||||
EncrypType=AES
|
||||
EthConvertMode=dongle
|
||||
EtherTrafficBand=0
|
||||
Ethifname=
|
||||
ETxBfEnCond=1
|
||||
FineAGC=0
|
||||
FixedTxMode=
|
||||
ForceRoamSupport=
|
||||
FragThreshold=2346
|
||||
FreqDelta=0
|
||||
FtSupport=0
|
||||
GreenAP=1
|
||||
G_BAND_256QAM=1
|
||||
HideSSID=0
|
||||
HT_AMSDU=1
|
||||
HT_AutoBA=1
|
||||
HT_BADecline=0
|
||||
HT_BAWinSize=64
|
||||
HT_BSSCoexistence=1
|
||||
HT_BW=0
|
||||
HT_DisallowTKIP=1
|
||||
HT_EXTCHA=1
|
||||
HT_GI=1
|
||||
HT_HTC=1
|
||||
HT_LDPC=1
|
||||
HT_LinkAdapt=0
|
||||
HT_MCS=33
|
||||
HT_MpduDensity=5
|
||||
HT_OpMode=0
|
||||
HT_PROTECT=1
|
||||
HT_RDG=0
|
||||
HT_RxStream=4
|
||||
HT_STBC=1
|
||||
HT_TxStream=4
|
||||
IcapMode=0
|
||||
idle_timeout_interval=0
|
||||
IEEE80211H=1
|
||||
IEEE8021X=0
|
||||
IgmpSnEnable=1
|
||||
ITxBfEn=1
|
||||
Key1Str=
|
||||
Key1Str1=
|
||||
Key1Str10=
|
||||
Key1Str11=
|
||||
Key1Str12=
|
||||
Key1Str13=
|
||||
Key1Str14=
|
||||
Key1Str15=
|
||||
Key1Str16=
|
||||
Key1Str2=
|
||||
Key1Str3=
|
||||
Key1Str4=
|
||||
Key1Str5=
|
||||
Key1Str6=
|
||||
Key1Str7=
|
||||
Key1Str8=
|
||||
Key1Str9=
|
||||
Key1Type=0
|
||||
Key2Str=
|
||||
Key2Str1=
|
||||
Key2Str10=
|
||||
Key2Str11=
|
||||
Key2Str12=
|
||||
Key2Str13=
|
||||
Key2Str14=
|
||||
Key2Str15=
|
||||
Key2Str16=
|
||||
Key2Str2=
|
||||
Key2Str3=
|
||||
Key2Str4=
|
||||
Key2Str5=
|
||||
Key2Str6=
|
||||
Key2Str7=
|
||||
Key2Str8=
|
||||
Key2Str9=
|
||||
Key2Type=0
|
||||
Key3Str=
|
||||
Key3Str1=
|
||||
Key3Str10=
|
||||
Key3Str11=
|
||||
Key3Str12=
|
||||
Key3Str13=
|
||||
Key3Str14=
|
||||
Key3Str15=
|
||||
Key3Str16=
|
||||
Key3Str2=
|
||||
Key3Str3=
|
||||
Key3Str4=
|
||||
Key3Str5=
|
||||
Key3Str6=
|
||||
Key3Str7=
|
||||
Key3Str8=
|
||||
Key3Str9=
|
||||
Key3Type=0
|
||||
Key4Str=
|
||||
Key4Str1=
|
||||
Key4Str10=
|
||||
Key4Str11=
|
||||
Key4Str12=
|
||||
Key4Str13=
|
||||
Key4Str14=
|
||||
Key4Str15=
|
||||
Key4Str16=
|
||||
Key4Str2=
|
||||
Key4Str3=
|
||||
Key4Str4=
|
||||
Key4Str5=
|
||||
Key4Str6=
|
||||
Key4Str7=
|
||||
Key4Str8=
|
||||
Key4Str9=
|
||||
Key4Type=0
|
||||
LinkTestSupport=0
|
||||
MACRepeaterEn=
|
||||
MACRepeaterOuiMode=2
|
||||
MeshAuthMode=WPA2PSK
|
||||
MeshAutoLink=0
|
||||
MeshDefaultkey=0
|
||||
MeshEncrypType=AES
|
||||
MeshId=
|
||||
MeshWEPKEY=
|
||||
MeshWPAKEY=
|
||||
MUTxRxEnable=0
|
||||
NoForwarding=0
|
||||
NoForwardingBTNBSSID=0
|
||||
own_ip_addr=10.10.10.254
|
||||
|
||||
PcieAspm=0
|
||||
PERCENTAGEenable=0
|
||||
PhyRateLimit=0
|
||||
PMFMFPC=1
|
||||
PMFMFPR=0
|
||||
PMFSHA256=0
|
||||
PMKCachePeriod=10
|
||||
PowerUpCckOfdm=0:0:0:0:0:0:0
|
||||
PowerUpHT20=0:0:0:0:0:0:0
|
||||
PowerUpHT40=0:0:0:0:0:0:0
|
||||
PowerUpVHT160=0:0:0:0:0:0:0
|
||||
PowerUpVHT20=0:0:0:0:0:0:0
|
||||
PowerUpVHT40=0:0:0:0:0:0:0
|
||||
PowerUpVHT80=0:0:0:0:0:0:0
|
||||
PreAntSwitch=
|
||||
PreAuth=0
|
||||
PreAuthifname=br0
|
||||
RadioLinkSelection=0
|
||||
RadioOn=1
|
||||
RADIUS_Acct_Key=
|
||||
RADIUS_Acct_Port=1813
|
||||
RADIUS_Acct_Server=
|
||||
RADIUS_Key1=
|
||||
RADIUS_Key10=
|
||||
RADIUS_Key11=
|
||||
RADIUS_Key12=
|
||||
RADIUS_Key13=
|
||||
RADIUS_Key14=
|
||||
RADIUS_Key15=
|
||||
RADIUS_Key16=
|
||||
RADIUS_Key2=
|
||||
RADIUS_Key3=
|
||||
RADIUS_Key4=
|
||||
RADIUS_Key5=
|
||||
RADIUS_Key6=
|
||||
RADIUS_Key7=
|
||||
RADIUS_Key8=
|
||||
RADIUS_Key9=
|
||||
RADIUS_Port=
|
||||
RADIUS_Server=
|
||||
RDRegion=CE
|
||||
RED_Enable=1
|
||||
RekeyInterval=3600
|
||||
RekeyMethod=DISABLE
|
||||
RRMEnable=255
|
||||
RTSThreshold=2347
|
||||
session_timeout_interval=0
|
||||
ShortSlot=1
|
||||
SKUenable=0
|
||||
SSID=IOPSYS.mt2
|
||||
SSID1=IOPSYS.mt2.1
|
||||
SSID10=
|
||||
SSID11=
|
||||
SSID12=
|
||||
SSID13=
|
||||
SSID14=
|
||||
SSID15=
|
||||
SSID16=
|
||||
SSID2=IOPSYS.mt2.2
|
||||
SSID3=IOPSYS.mt2.3
|
||||
SSID4=IOPSYS.mt2.4
|
||||
SSID5=
|
||||
SSID6=
|
||||
SSID7=
|
||||
SSID8=
|
||||
SSID9=
|
||||
StationKeepAlive=0
|
||||
StreamMode=0
|
||||
StreamModeMac0=
|
||||
StreamModeMac1=
|
||||
StreamModeMac2=
|
||||
StreamModeMac3=
|
||||
TGnWifiTest=0
|
||||
ThermalRecal=0
|
||||
TxBurst=1
|
||||
TxPower=100
|
||||
TxPreamble=1
|
||||
VHT_BW=0
|
||||
VHT_BW_SIGNAL=0
|
||||
VHT_LDPC=1
|
||||
VHT_Sec80_Channel=auto
|
||||
VHT_SGI=1
|
||||
VHT_STBC=1
|
||||
VLANID=0
|
||||
VLANPriority=0
|
||||
VLANTag=0
|
||||
VOW_Airtime_Ctrl_En=
|
||||
VOW_Airtime_Fairness_En=0
|
||||
VOW_BW_Ctrl=0
|
||||
VOW_Group_Backlog=
|
||||
VOW_Group_DWRR_Max_Wait_Time=
|
||||
VOW_Group_DWRR_Quantum=
|
||||
VOW_Group_Max_Airtime_Bucket_Size=
|
||||
VOW_Group_Max_Rate=
|
||||
VOW_Group_Max_Rate_Bucket_Size=
|
||||
VOW_Group_Max_Ratio=
|
||||
VOW_Group_Max_Wait_Time=
|
||||
VOW_Group_Min_Airtime_Bucket_Size=
|
||||
VOW_Group_Min_Rate=
|
||||
VOW_Group_Min_Rate_Bucket_Size=
|
||||
VOW_Group_Min_Ratio=
|
||||
VOW_Rate_Ctrl_En=
|
||||
VOW_Refill_Period=
|
||||
VOW_RX_En=1
|
||||
VOW_Sta_BE_DWRR_Quantum=
|
||||
VOW_Sta_BK_DWRR_Quantum=
|
||||
VOW_Sta_DWRR_Max_Wait_Time=
|
||||
VOW_Sta_VI_DWRR_Quantum=
|
||||
VOW_Sta_VO_DWRR_Quantum=
|
||||
VOW_WATF_Enable=
|
||||
VOW_WATF_MAC_LV0=
|
||||
VOW_WATF_MAC_LV1=
|
||||
VOW_WATF_MAC_LV2=
|
||||
VOW_WATF_MAC_LV3=
|
||||
VOW_WATF_Q_LV0=
|
||||
VOW_WATF_Q_LV1=
|
||||
VOW_WATF_Q_LV2=
|
||||
VOW_WATF_Q_LV3=
|
||||
VOW_WMM_Search_Rule_Band0=
|
||||
VOW_WMM_Search_Rule_Band1=
|
||||
WapiAsCertPath=
|
||||
WapiAsIpAddr=
|
||||
WapiAsPort=
|
||||
Wapiifname=
|
||||
WapiPsk1=
|
||||
WapiPsk10=
|
||||
WapiPsk11=
|
||||
WapiPsk12=
|
||||
WapiPsk13=
|
||||
WapiPsk14=
|
||||
WapiPsk15=
|
||||
WapiPsk16=
|
||||
WapiPsk2=
|
||||
WapiPsk3=
|
||||
WapiPsk4=
|
||||
WapiPsk5=
|
||||
WapiPsk6=
|
||||
WapiPsk7=
|
||||
WapiPsk8=
|
||||
WapiPsk9=
|
||||
WapiPskType=
|
||||
WapiUserCertPath=
|
||||
WCNTest=0
|
||||
Wds0Key=
|
||||
Wds1Key=
|
||||
Wds2Key=
|
||||
Wds3Key=
|
||||
WdsEnable=0
|
||||
WdsEncrypType=AES
|
||||
WdsList=
|
||||
WdsPhyMode=0
|
||||
WHNAT=0
|
||||
WiFiTest=0
|
||||
WirelessMode=9
|
||||
WmmCapable=1
|
||||
WPAPSK=1234554321
|
||||
WPAPSK1=1111100000
|
||||
WPAPSK10=
|
||||
WPAPSK11=
|
||||
WPAPSK12=
|
||||
WPAPSK13=
|
||||
WPAPSK14=
|
||||
WPAPSK15=
|
||||
WPAPSK16=
|
||||
WPAPSK2=2222200000
|
||||
WPAPSK3=3333300000
|
||||
WPAPSK4=4444400000
|
||||
WPAPSK5=
|
||||
WPAPSK6=
|
||||
WPAPSK7=
|
||||
WPAPSK8=
|
||||
WPAPSK9=
|
||||
WscConfMode=0
|
||||
WscConfStatus=2
|
||||
FtOtd=0
|
||||
FtRic=0
|
||||
FtMdId1=500
|
||||
@@ -1,16 +0,0 @@
|
||||
# Single SKU Max Power Table
|
||||
# |CCK 1~11 | | OFDM 6 ~ 54 | | HT20 MCS 0 ~ 15 | | HT40 MCS 0 ~ 15 |
|
||||
ch1 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13
|
||||
ch2 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16
|
||||
ch3 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14 12 12 12 12 12 12 12 12
|
||||
ch4 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14 16 16 16 16 16 16 16 16
|
||||
ch5 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14 16 16 16 16 16 16 16 16
|
||||
ch6 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14 16 16 16 16 16 16 16 16
|
||||
ch7 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14 16 16 16 16 16 16 16 16
|
||||
ch8 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14 16 16 16 16 16 16 16 16
|
||||
ch9 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14 12 12 12 12 12 12 12 12
|
||||
ch10 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 14 14 14 14 14 14 14 14
|
||||
ch11 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14
|
||||
ch12 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15
|
||||
ch13 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15
|
||||
ch14 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15
|
||||
@@ -1,84 +0,0 @@
|
||||
CONFIG_SUPPORT_OPENWRT=y
|
||||
CONFIG_RT_FIRST_CARD=7603
|
||||
CONFIG_RT_SECOND_CARD=7615
|
||||
CONFIG_RT_THIRD_CARD=0
|
||||
CONFIG_FIRST_IF_MT7603E=y
|
||||
CONFIG_SECOND_IF_MT7615E=y
|
||||
CONFIG_THIRD_IF_NONE=y
|
||||
CONFIG_RT_FIRST_IF_RF_OFFSET=0x0
|
||||
CONFIG_RT_SECOND_IF_RF_OFFSET=0x8000
|
||||
CONFIG_RT_THIRD_IF_RF_OFFSET=0x4000
|
||||
CONFIG_RT_FIRST_CARD_EEPROM="efuse"
|
||||
CONFIG_RT_SECOND_CARD_EEPROM="efuse"
|
||||
CONFIG_RT_THIRD_CARD_EEPROM="efuse"
|
||||
CONFIG_FIRST_IF_EEPROM_EFUSE=y
|
||||
CONFIG_SECOND_IF_EEPROM_EFUSE=y
|
||||
CONFIG_FIRST_IF_IPAILNA=y
|
||||
CONFIG_SECOND_IF_IPAILNA=y
|
||||
CONFIG_WIFI_DRIVER=y
|
||||
CONFIG_WIFI_BASIC_FUNC=y
|
||||
CONFIG_MULTI_INF_SUPPORT=y
|
||||
CONFIG_DOT11_N_SUPPORT=y
|
||||
CONFIG_G_BAND_256QAM_SUPPORT=y
|
||||
CONFIG_ICAP_SUPPORT=y
|
||||
CONFIG_MT_AP_SUPPORT=y
|
||||
CONFIG_BACKGROUND_SCAN_SUPPORT=y
|
||||
CONFIG_SMART_CARRIER_SENSE_SUPPORT=y
|
||||
CONFIG_MT_DFS_SUPPORT=y
|
||||
CONFIG_WSC_INCLUDED=y
|
||||
CONFIG_WSC_V2_SUPPORT=y
|
||||
CONFIG_DOT11W_PMF_SUPPORT=y
|
||||
CONFIG_TXBF_SUPPORT=y
|
||||
CONFIG_IGMP_SNOOP_SUPPORT=y
|
||||
CONFIG_ATE_SUPPORT=y
|
||||
CONFIG_UAPSD=y
|
||||
CONFIG_WIFI_MODE_AP=y
|
||||
CONFIG_WDS_SUPPORT=y
|
||||
CONFIG_MBSS_SUPPORT=y
|
||||
CONFIG_APCLI_SUPPORT=y
|
||||
CONFIG_MAC_REPEATER_SUPPORT=y
|
||||
CONFIG_VOW_SUPPORT=y
|
||||
CONFIG_BAND_STEERING=y
|
||||
CONFIG_MUMIMO_SUPPORT=y
|
||||
CONFIG_MU_RA_SUPPORT=y
|
||||
CONFIG_GREENAP_SUPPORT=y
|
||||
CONFIG_TPC_SUPPORT=y
|
||||
CONFIG_RLM_CAL_CACHE_SUPPORT=y
|
||||
CONFIG_CAL_BIN_FILE_SUPPORT=y
|
||||
CONFIG_WIFI_EAP_FEATURE=y
|
||||
CONFIG_WPA3_SUPPORT=y
|
||||
CONFIG_SPECTRUM_SUPPORT=y
|
||||
CONFIG_PRE_CAL_TRX_SET1_SUPPORT=y
|
||||
CONFIG_MCAST_RATE_SPECIFIC=y
|
||||
CONFIG_PRE_CAL_TRX_SET2_SUPPORT=y
|
||||
CONFIG_PCIE_ASPM_DYM_CTRL_SUPPORT=y
|
||||
CONFIG_CHIP_MT7603E=y
|
||||
CONFIG_MT_MAC=y
|
||||
CONFIG_MT7603E_RALINK_MT7603E=y
|
||||
CONFIG_MT7603E_RTMP_PCI_SUPPORT=y
|
||||
CONFIG_MT7603E_NEW_RATE_ADAPT_SUPPORT=y
|
||||
CONFIG_MT7603E_AGS_SUPPORT=y
|
||||
CONFIG_MT7603E_UAPSD=y
|
||||
CONFIG_MT7603E_MT_MAC=y
|
||||
CONFIG_MT7603E_WSC_INCLUDED=y
|
||||
CONFIG_MT7603E_WSC_V2_SUPPORT=y
|
||||
CONFIG_MT7603E_DOT11W_PMF_SUPPORT=y
|
||||
CONFIG_MT7603E_DOT11N_DRAFT3=y
|
||||
CONFIG_MT7603E_DOT11R_FT_SUPPORT=y
|
||||
CONFIG_MT7603E_DOT11K_RRM_SUPPORT=y
|
||||
CONFIG_MT7603E_WNM_SUPPORT=y
|
||||
CONFIG_MT7603E_INTERWORKING=y
|
||||
CONFIG_MT7603E_IGMP_SNOOP_SUPPORT=y
|
||||
CONFIG_MT7603E_LED_CONTROL_SUPPORT=y
|
||||
CONFIG_MT7603E_MBSS_SUPPORT=y
|
||||
CONFIG_MT7603E_APCLI_SUPPORT=y
|
||||
CONFIG_MT7603E_MULTI_APCLI_SUPPORT=y
|
||||
CONFIG_MT7603E_MAC_REPEATER_SUPPORT=y
|
||||
CONFIG_MT7603E_ATE_SUPPORT=y
|
||||
CONFIG_MT7603E_BAND_STEERING_7603=y
|
||||
CONFIG_MT7603E_MULTI_INF_SUPPORT=y
|
||||
CONFIG_MT7603E_WPA3_SUPPORT=y
|
||||
CONFIG_MT7603E_OWE_SUPPORT=y
|
||||
CONFIG_MT7603E_SECURITY_IMPROVEMENT_SUPPORT=y
|
||||
CONFIG_MT7603E_NEW_BW2040_COEXIST_SUPPORT=y
|
||||
CONFIG_MT7603E_RLT_AP_SUPPORT=m
|
||||
@@ -1,191 +0,0 @@
|
||||
diff -uprN a/mt7603_wifi/common/cmm_info.c b/mt7603_wifi/common/cmm_info.c
|
||||
--- a/mt7603_wifi/common/cmm_info.c 2019-02-22 10:01:55.000000000 +0100
|
||||
+++ b/mt7603_wifi/common/cmm_info.c 2019-12-08 21:47:48.553113878 +0100
|
||||
@@ -132,7 +132,7 @@ INT Set_DriverVersion_Proc(RTMP_ADAPTER
|
||||
{
|
||||
#ifdef CONFIG_AP_SUPPORT
|
||||
IF_DEV_CONFIG_OPMODE_ON_AP(pAd)
|
||||
- DBGPRINT(RT_DEBUG_OFF, ("Driver version-%s %s %s\n", AP_DRIVER_VERSION, __DATE__, __TIME__));
|
||||
+ DBGPRINT(RT_DEBUG_OFF, ("Driver version-%s\n", AP_DRIVER_VERSION));
|
||||
DBGPRINT(RT_DEBUG_OFF, ("Driver Patch\n"));
|
||||
DBGPRINT(RT_DEBUG_OFF, ("001 : 4AC + MGMT PSE queue pkt stuck detect & AP tr_entry is memory currupted\n"));
|
||||
DBGPRINT(RT_DEBUG_OFF, ("002 : wifi_forward support\n"));
|
||||
diff -uprN a/mt7603_wifi/os/linux/rt_linux.c b/mt7603_wifi/os/linux/rt_linux.c
|
||||
--- a/mt7603_wifi/os/linux/rt_linux.c 2019-02-22 10:01:39.000000000 +0100
|
||||
+++ b/mt7603_wifi/os/linux/rt_linux.c 2019-12-08 22:16:27.246150818 +0100
|
||||
@@ -47,8 +47,8 @@
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RA_HW_NAT) || defined(CONFIG_RA_HW_NAT_MODULE)
|
||||
-#include "../../../../../../../../net/nat/hw_nat/ra_nat.h"
|
||||
-#include "../../../../../../../../net/nat/hw_nat/frame_engine.h"
|
||||
+#include <../net/nat/hw_nat/ra_nat.h>
|
||||
+#include <../net/nat/hw_nat/frame_engine.h>
|
||||
#endif
|
||||
|
||||
/* TODO */
|
||||
@@ -855,18 +855,27 @@ void RtmpOSFileSeek(RTMP_OS_FD osfd, int
|
||||
int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen)
|
||||
{
|
||||
/* The object must have a read method */
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
|
||||
if (osfd->f_op && osfd->f_op->read) {
|
||||
return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
|
||||
- } else {
|
||||
- DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
|
||||
- return -1;
|
||||
+#else
|
||||
+ if (osfd->f_mode & FMODE_CAN_READ) {
|
||||
+ return __vfs_read(osfd, pDataPtr, readLen,&osfd->f_pos);
|
||||
+#endif
|
||||
+ } else {
|
||||
+ DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
-}
|
||||
|
||||
|
||||
int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen)
|
||||
{
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)
|
||||
return osfd->f_op->write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
|
||||
+#else
|
||||
+ return __vfs_write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
diff -uprN a/mt7603_wifi/os/linux/rt_proc.c b/mt7603_wifi/os/linux/rt_proc.c
|
||||
--- a/mt7603_wifi/os/linux/rt_proc.c 2019-02-22 10:01:39.000000000 +0100
|
||||
+++ b/mt7603_wifi/os/linux/rt_proc.c 2019-12-08 21:47:48.553113878 +0100
|
||||
@@ -61,7 +61,7 @@ int wl_proc_exit(void);
|
||||
#endif /* PROCREG_DIR */
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
-extern struct proc_dir_entry *procRegDir;
|
||||
+struct proc_dir_entry *procRegDir;
|
||||
|
||||
#ifdef VIDEO_TURBINE_SUPPORT
|
||||
extern BOOLEAN UpdateFromGlobal;
|
||||
diff -uprN a/mt7603_wifi/os/linux/rt_profile.c b/mt7603_wifi/os/linux/rt_profile.c
|
||||
--- a/mt7603_wifi/os/linux/rt_profile.c 2019-02-22 10:01:39.000000000 +0100
|
||||
+++ b/mt7603_wifi/os/linux/rt_profile.c 2019-12-09 10:27:49.609507632 +0100
|
||||
@@ -30,8 +30,8 @@
|
||||
#endif
|
||||
|
||||
#if defined (CONFIG_RA_HW_NAT) || defined (CONFIG_RA_HW_NAT_MODULE)
|
||||
-#include "../../../../../../../../net/nat/hw_nat/ra_nat.h"
|
||||
-#include "../../../../../../../../net/nat/hw_nat/frame_engine.h"
|
||||
+#include <../net/nat/hw_nat/ra_nat.h>
|
||||
+#include <../net/nat/hw_nat/frame_engine.h>
|
||||
#endif
|
||||
|
||||
|
||||
@@ -689,7 +689,11 @@ NDIS_STATUS RTMPReadParametersHook(RTMP_
|
||||
{
|
||||
#ifndef OS_ABL_SUPPORT
|
||||
// TODO: need to roll back when convert into OSABL code
|
||||
- fsize = (ULONG)srcf->f_dentry->d_inode->i_size;
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)
|
||||
+ fsize = (ULONG)srcf->f_dentry->d_inode->i_size;
|
||||
+#else
|
||||
+ fsize = (ULONG)srcf->f_path.dentry->d_inode->i_size;
|
||||
+#endif
|
||||
if (buf_size < (fsize + 1))
|
||||
buf_size = fsize + 1;
|
||||
#endif /* OS_ABL_SUPPORT */
|
||||
diff -uprN a/mt7603_wifi_ap/Makefile b/mt7603_wifi_ap/Makefile
|
||||
--- a/mt7603_wifi_ap/Makefile 2019-02-22 10:01:27.000000000 +0100
|
||||
+++ b/mt7603_wifi_ap/Makefile 2019-12-08 21:52:10.253012796 +0100
|
||||
@@ -16,6 +16,90 @@ DRV_NAME = mt7603_wifi
|
||||
RT_WIFI_DIR = ../mt7603_wifi
|
||||
endif
|
||||
|
||||
+ifeq ($(CONFIG_SUPPORT_OPENWRT),y)
|
||||
+###EXTRA_CFLAGS += -DCONFIG_SUPPORT_OPENWRT
|
||||
+ifneq ($(CONFIG_RT_FIRST_CARD),)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD=$(CONFIG_RT_FIRST_CARD)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_FIRST_IF_RF_OFFSET=$(CONFIG_RT_FIRST_IF_RF_OFFSET)
|
||||
+endif
|
||||
+ifneq ($(CONFIG_RT_SECOND_CARD),)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD=$(CONFIG_RT_SECOND_CARD)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_SECOND_IF_RF_OFFSET=$(CONFIG_RT_SECOND_IF_RF_OFFSET)
|
||||
+endif
|
||||
+ifneq ($(CONFIG_RT_THIRD_CARD),)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_THIRD_CARD=$(CONFIG_RT_THIRD_CARD)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_THIRD_IF_RF_OFFSET=$(CONFIG_RT_THIRD_IF_RF_OFFSET)
|
||||
+endif
|
||||
+ifeq ($(CONFIG_FIRST_IF_EEPROM_PROM),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"prom\""
|
||||
+else
|
||||
+ifeq ($(CONFIG_FIRST_IF_EEPROM_EFUSE),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"efuse\""
|
||||
+else
|
||||
+ifeq ($(CONFIG_FIRST_IF_EEPROM_FLASH),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"flash\""
|
||||
+endif
|
||||
+endif
|
||||
+endif
|
||||
+ifeq ($(CONFIG_SECOND_IF_EEPROM_PROM),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD_EEPROM="\"prom\""
|
||||
+else
|
||||
+ifeq ($(CONFIG_SECOND_IF_EEPROM_EFUSE),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD_EEPROM="\"efuse\""
|
||||
+else
|
||||
+ifeq ($(CONFIG_SECOND_IF_EEPROM_FLASH),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_SECOND_CARD_EEPROM="\"flash\""
|
||||
+endif
|
||||
+endif
|
||||
+endif
|
||||
+ifeq ($(CONFIG_THIRD_IF_EEPROM_PROM),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_THIRD_CARD_EEPROM="\"prom\""
|
||||
+else
|
||||
+ifeq ($(CONFIG_THIRD_IF_EEPROM_EFUSE),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_THIRD_CARD_EEPROM="\"efuse\""
|
||||
+else
|
||||
+ifeq ($(CONFIG_THIRD_IF_EEPROM_FLASH),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_RT_THIRD_CARD_EEPROM="\"flash\""
|
||||
+endif
|
||||
+endif
|
||||
+endif
|
||||
+endif
|
||||
+
|
||||
+ifeq ($(CONFIG_FIRST_IF_EPAELNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_FIRST_IF_EPAELNA
|
||||
+else
|
||||
+ifeq ($(CONFIG_FIRST_IF_IPAILNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_FIRST_IF_IPAILNA
|
||||
+else
|
||||
+ifeq ($(CONFIG_FIRST_IF_IPAELNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_FIRST_IF_IPAELNA
|
||||
+endif
|
||||
+endif
|
||||
+endif
|
||||
+ifeq ($(CONFIG_SECOND_IF_EPAELNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_SECOND_IF_EPAELNA
|
||||
+else
|
||||
+ifeq ($(CONFIG_SECOND_IF_IPAILNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_SECOND_IF_IPAILNA
|
||||
+else
|
||||
+ifeq ($(CONFIG_SECOND_IF_IPAELNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_SECOND_IF_IPAELNA
|
||||
+endif
|
||||
+endif
|
||||
+endif
|
||||
+ifeq ($(CONFIG_THIRD_IF_EPAELNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_THIRD_IF_EPAELNA
|
||||
+else
|
||||
+ifeq ($(CONFIG_THIRD_IF_IPAILNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_THIRD_IF_IPAILNA
|
||||
+else
|
||||
+ifeq ($(CONFIG_THIRD_IF_IPAELNA),y)
|
||||
+EXTRA_CFLAGS += -DCONFIG_THIRD_IF_IPAELNA
|
||||
+endif
|
||||
+endif
|
||||
+endif
|
||||
+
|
||||
+
|
||||
########################################################
|
||||
# Common files
|
||||
########################################################
|
||||
@@ -1,12 +0,0 @@
|
||||
diff -uprN a/mt7603_wifi/ap/ap_cfg.c b/mt7603_wifi/ap/ap_cfg.c
|
||||
--- a/mt7603_wifi/ap/ap_cfg.c 2020-02-15 13:29:48.306146391 +0100
|
||||
+++ b/mt7603_wifi/ap/ap_cfg.c 2020-02-15 13:30:08.838820056 +0100
|
||||
@@ -3329,7 +3329,7 @@ INT RTMPAPSetInformation(
|
||||
UCHAR *Buf;
|
||||
struct wnm_command *cmd_data;
|
||||
|
||||
- os_alloc_mem(Buf, (UCHAR **)&Buf, wrq->u.data.length);
|
||||
+ os_alloc_mem(NULL, (UCHAR **)&Buf, wrq->u.data.length);
|
||||
Status = copy_from_user(Buf, wrq->u.data.pointer, wrq->u.data.length);
|
||||
cmd_data = (struct wnm_command *)Buf;
|
||||
if (wnm_handle_command(pAd, cmd_data) != NDIS_STATUS_SUCCESS)
|
||||
@@ -1,64 +0,0 @@
|
||||
# All rights reserved.
|
||||
# See LICENSE for more information.
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mtk7615e
|
||||
PKG_VERSION:=5.0.4.0_20190503
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:mediatek/mt7615.git
|
||||
PKG_SOURCE_VERSION:=12c69fe1912113d16d17292bcee6415a8c9ab131
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
|
||||
MTK7615_CONFIG:=$(shell cat mtk7615e.config)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/mtk7615e
|
||||
CATEGORY:=Mediatek drivers
|
||||
TITLE:=WiFi drivers
|
||||
#DEPENDS:= +wifi-profile
|
||||
ifneq ($(CONFIG_MTK_FAST_NAT_SUPPORT), )
|
||||
ifneq ($(CONFIG_NET_MEDIATEK_HNAT), )
|
||||
DEPENDS+=+kmod-mediatek_hnat
|
||||
endif
|
||||
endif
|
||||
ifneq ($(CONFIG_MTK_WHNAT_SUPPORT), )
|
||||
FILES:=$(PKG_BUILD_DIR)/mt_wifi_ap/mt_wifi.ko \
|
||||
$(PKG_BUILD_DIR)/mt_wifi/embedded/plug_in/whnat/mt_whnat.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mt_wifi mt_whnat)
|
||||
else
|
||||
FILES:=$(PKG_BUILD_DIR)/mt_wifi_ap/mt_wifi.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mt_wifi)
|
||||
endif
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
NOSTDINC_FLAGS := -DCONFIG_SECOND_IF_MT7615E -DCONFIG_FIRST_IF_MT7603E \
|
||||
-Wno-misleading-indentation
|
||||
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) V=1 \
|
||||
$(MTK7615_CONFIG) \
|
||||
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)/mt_wifi_ap" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define KernelPackage/mtk7615e/install
|
||||
$(INSTALL_DIR) $(1)/etc_ro/wlan
|
||||
$(INSTALL_DIR) $(1)/etc_ro/Wireless/iNIC
|
||||
$(INSTALL_DIR) $(1)/etc/wireless
|
||||
$(INSTALL_DIR) $(1)/etc/Wireless/iNIC
|
||||
$(CP) ./files/MT7615_EEPROM.bin $(1)/etc_ro/wlan
|
||||
$(CP) ./files/l1profile.dat $(1)/etc/wireless
|
||||
$(CP) ./files/iNIC_ap.dat $(1)/etc/Wireless/iNIC
|
||||
$(CP) ./files/SingleSKU.dat $(1)/etc_ro/Wireless/iNIC
|
||||
$(CP) ./files/SingleSKU_BF.dat $(1)/etc_ro/Wireless/iNIC
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,mtk7615e))
|
||||
Binary file not shown.
@@ -1,46 +0,0 @@
|
||||
# 5G Channel OFDM VHT20 VHT40 VHT80 VHT160 Txstream_Delta TxSpatialStream_Delta
|
||||
Band: 5G OFDM_6M OFDM_9M OFDM_12M OFDM_18M OFDM_24M OFDM_36M OFDM_48M OFDM_54M VHT20_MCS0 VHT20_MCS1 VHT20_MCS2 VHT20_MCS3 VHT20_MCS4 VHT20_MCS5 VHT20_MCS6 VHT20_MCS7 VHT20_MCS8 VHT20_MCS9 VHT40_MCS0 VHT40_MCS1 VHT40_MCS2 VHT40_MCS3 VHT40_MCS4 VHT40_MCS5 VHT40_MCS6 VHT40_MCS7 VHT40_MCS8 VHT40_MCS9 VHT80_MCS0 VHT80_MCS1 VHT80_MCS2 VHT80_MCS3 VHT80_MCS4 VHT80_MCS5 VHT80_MCS6 VHT80_MCS7 VHT80_MCS8 VHT80_MCS9 VHT160_MCS0 VHT160_MCS1 VHT160_MCS2 VHT160_MCS3 VHT160_MCS4 VHT160_MCS5 VHT160_MCS6 VHT160_MCS7 VHT160_MCS8 VHT160_MCS9 Txstream_3T Txstream_2T Txstream_1T Txstream_1SS Txstream_2SS Txstream_3SS Txstream_4SS
|
||||
Ch184 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch188 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch192 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch196 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch8 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch12 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch16 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch36 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch40 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch44 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch48 12 12 12 12 12 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch52 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch56 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch60 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch64 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch68 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch72 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch76 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch80 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch84 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch88 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch92 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch96 12 12 12 12 12 10 10 10 10 10 10 10 14 14 14 14 14 14 14 14 14 14 14 14 14 14 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch100 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch104 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch108 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch112 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch116 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch120 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch124 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch128 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch132 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch136 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch140 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch144 16 16 16 16 16 15 15 15 15 15 15 15 13 13 13 13 13 13 13 15 15 15 15 15 15 15 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch149 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch153 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch157 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch161 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch165 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch169 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch173 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch177 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
Ch181 19 19 19 19 19 17 17 17 17 17 17 17 20 20 20 20 20 20 20 18 18 18 18 18 18 18 9 9 9 9 9 9 9 1 3 6 6 3 1 0
|
||||
@@ -1,55 +0,0 @@
|
||||
# Single SKU Max Power Table (unit is 1 dBm)
|
||||
|
||||
# 5G Channel
|
||||
Band: 5G MaxPower_4T MaxPower_3T MaxPower_2T
|
||||
Ch184 7 30 30
|
||||
Ch188 7 30 30
|
||||
Ch192 7 30 30
|
||||
Ch196 7 30 30
|
||||
Ch8 7 30 30
|
||||
Ch12 7 30 30
|
||||
Ch16 7 30 30
|
||||
Ch36 7 30 30
|
||||
Ch40 7 30 30
|
||||
Ch44 7 30 30
|
||||
Ch48 7 30 30
|
||||
Ch52 7 30 30
|
||||
Ch56 7 30 30
|
||||
Ch60 7 30 30
|
||||
Ch64 7 30 30
|
||||
Ch68 7 30 30
|
||||
Ch72 7 30 30
|
||||
Ch76 7 30 30
|
||||
Ch80 7 30 30
|
||||
Ch84 7 30 30
|
||||
Ch88 7 30 30
|
||||
Ch92 7 30 30
|
||||
Ch96 7 30 30
|
||||
Ch100 14 30 30
|
||||
Ch104 14 30 30
|
||||
Ch108 14 30 30
|
||||
Ch112 14 30 30
|
||||
Ch116 14 30 30
|
||||
Ch120 14 30 30
|
||||
Ch124 14 30 30
|
||||
Ch128 14 30 30
|
||||
Ch132 14 30 30
|
||||
Ch136 14 30 30
|
||||
Ch140 14 30 30
|
||||
Ch144 14 30 30
|
||||
Ch149 14 30 30
|
||||
Ch153 14 30 30
|
||||
Ch157 14 30 30
|
||||
Ch161 14 30 30
|
||||
Ch165 14 30 30
|
||||
Ch169 14 30 30
|
||||
Ch173 14 30 30
|
||||
Ch177 14 30 30
|
||||
Ch181 14 30 30
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,409 +0,0 @@
|
||||
Default
|
||||
AccessControlList0=
|
||||
AccessControlList1=
|
||||
AccessControlList10=
|
||||
AccessControlList11=
|
||||
AccessControlList12=
|
||||
AccessControlList13=
|
||||
AccessControlList14=
|
||||
AccessControlList15=
|
||||
AccessControlList2=
|
||||
AccessControlList3=
|
||||
AccessControlList4=
|
||||
AccessControlList5=
|
||||
AccessControlList6=
|
||||
AccessControlList7=
|
||||
AccessControlList8=
|
||||
AccessControlList9=
|
||||
AccessPolicy0=0
|
||||
AccessPolicy1=0
|
||||
AccessPolicy10=0
|
||||
AccessPolicy11=0
|
||||
AccessPolicy12=0
|
||||
AccessPolicy13=0
|
||||
AccessPolicy14=0
|
||||
AccessPolicy15=0
|
||||
AccessPolicy2=0
|
||||
AccessPolicy3=0
|
||||
AccessPolicy4=0
|
||||
AccessPolicy5=0
|
||||
AccessPolicy6=0
|
||||
AccessPolicy7=0
|
||||
AccessPolicy8=0
|
||||
AccessPolicy9=0
|
||||
AckPolicy=0;0;0;0
|
||||
APACM=0;0;0;0
|
||||
APAifsn=3;7;1;1
|
||||
ApCliAuthMode=OPEN
|
||||
ApCliBssid=
|
||||
ApCliDefaultKeyID=
|
||||
ApCliEnable=1
|
||||
ApCliEncrypType=NONE
|
||||
ApCliKey1Str=
|
||||
ApCliKey1Str1=
|
||||
ApCliKey1Type=1
|
||||
ApCliKey2Str=
|
||||
ApCliKey2Str1=
|
||||
ApCliKey2Type=1
|
||||
ApCliKey3Str=
|
||||
ApCliKey3Str1=
|
||||
ApCliKey3Type=1
|
||||
ApCliKey4Str=
|
||||
ApCliKey4Str1=
|
||||
ApCliKey4Type=1
|
||||
ApCliSsid=none
|
||||
ApCliWirelessMode=15
|
||||
ApCliWPAPSK=
|
||||
ApCliWPAPSK1=
|
||||
APCwmax=6;10;4;3
|
||||
APCwmin=4;4;3;2
|
||||
APSDCapable=0
|
||||
APTxop=0;0;94;47
|
||||
AuthMode=WPA2PSK
|
||||
AutoChannelSelect=3
|
||||
AutoChannelSkipList=116;120;124;128;140;144
|
||||
AutoProvisionEn=0
|
||||
BandSteering=0
|
||||
BasicRate=15
|
||||
BeaconPeriod=100
|
||||
BFBACKOFFenable=0
|
||||
BgndScanSkipCh=
|
||||
BGProtection=0
|
||||
BndStrgBssIdx=
|
||||
BSSACM=0;0;0;0
|
||||
BSSAifsn=3;7;2;2
|
||||
BSSCwmax=10;10;4;3
|
||||
BSSCwmin=4;4;3;2
|
||||
BssidNum=4
|
||||
BSSTxop=0;0;94;47
|
||||
BW_Enable=0
|
||||
BW_Guarantee_Rate=
|
||||
BW_Maximum_Rate=
|
||||
BW_Priority=
|
||||
BW_Root=0
|
||||
CalCacheApply=0
|
||||
CarrierDetect=0
|
||||
Channel=auto
|
||||
ChannelGrp=
|
||||
CountryCode=DE
|
||||
CountryRegion=1
|
||||
CountryRegionABand=1
|
||||
CP_SUPPORT=2
|
||||
CSPeriod=6
|
||||
DBDC_MODE=0
|
||||
DebugFlags=0
|
||||
DefaultKeyID=1
|
||||
DfsCalibration=0
|
||||
DfsEnable=1
|
||||
DfsFalseAlarmPrevent=1
|
||||
DfsZeroWait=1
|
||||
DfsZeroWaitCacTime=255
|
||||
DisableOLBC=0
|
||||
DtimPeriod=1
|
||||
E2pAccessMode=1
|
||||
EAPifname=br0
|
||||
EDCCAEnable=1
|
||||
EncrypType=AES
|
||||
EthConvertMode=dongle
|
||||
EtherTrafficBand=0
|
||||
Ethifname=
|
||||
ETxBfEnCond=1
|
||||
FineAGC=0
|
||||
FixedTxMode=
|
||||
ForceRoamSupport=
|
||||
FragThreshold=2346
|
||||
FreqDelta=0
|
||||
FtSupport=0
|
||||
GreenAP=1
|
||||
G_BAND_256QAM=1
|
||||
HideSSID=0
|
||||
HT_AMSDU=1
|
||||
HT_AutoBA=1
|
||||
HT_BADecline=0
|
||||
HT_BAWinSize=64
|
||||
HT_BSSCoexistence=1
|
||||
HT_BW=1
|
||||
HT_DisallowTKIP=1
|
||||
HT_EXTCHA=1
|
||||
HT_GI=1
|
||||
HT_HTC=1
|
||||
HT_LDPC=1
|
||||
HT_LinkAdapt=0
|
||||
HT_MCS=33
|
||||
HT_MpduDensity=5
|
||||
HT_OpMode=0
|
||||
HT_PROTECT=1
|
||||
HT_RDG=0
|
||||
HT_RxStream=4
|
||||
HT_STBC=1
|
||||
HT_TxStream=4
|
||||
IcapMode=0
|
||||
idle_timeout_interval=0
|
||||
IEEE80211H=1
|
||||
IEEE8021X=0
|
||||
IgmpSnEnable=1
|
||||
ITxBfEn=1
|
||||
Key1Str=
|
||||
Key1Str1=
|
||||
Key1Str10=
|
||||
Key1Str11=
|
||||
Key1Str12=
|
||||
Key1Str13=
|
||||
Key1Str14=
|
||||
Key1Str15=
|
||||
Key1Str16=
|
||||
Key1Str2=
|
||||
Key1Str3=
|
||||
Key1Str4=
|
||||
Key1Str5=
|
||||
Key1Str6=
|
||||
Key1Str7=
|
||||
Key1Str8=
|
||||
Key1Str9=
|
||||
Key1Type=0
|
||||
Key2Str=
|
||||
Key2Str1=
|
||||
Key2Str10=
|
||||
Key2Str11=
|
||||
Key2Str12=
|
||||
Key2Str13=
|
||||
Key2Str14=
|
||||
Key2Str15=
|
||||
Key2Str16=
|
||||
Key2Str2=
|
||||
Key2Str3=
|
||||
Key2Str4=
|
||||
Key2Str5=
|
||||
Key2Str6=
|
||||
Key2Str7=
|
||||
Key2Str8=
|
||||
Key2Str9=
|
||||
Key2Type=0
|
||||
Key3Str=
|
||||
Key3Str1=
|
||||
Key3Str10=
|
||||
Key3Str11=
|
||||
Key3Str12=
|
||||
Key3Str13=
|
||||
Key3Str14=
|
||||
Key3Str15=
|
||||
Key3Str16=
|
||||
Key3Str2=
|
||||
Key3Str3=
|
||||
Key3Str4=
|
||||
Key3Str5=
|
||||
Key3Str6=
|
||||
Key3Str7=
|
||||
Key3Str8=
|
||||
Key3Str9=
|
||||
Key3Type=0
|
||||
Key4Str=
|
||||
Key4Str1=
|
||||
Key4Str10=
|
||||
Key4Str11=
|
||||
Key4Str12=
|
||||
Key4Str13=
|
||||
Key4Str14=
|
||||
Key4Str15=
|
||||
Key4Str16=
|
||||
Key4Str2=
|
||||
Key4Str3=
|
||||
Key4Str4=
|
||||
Key4Str5=
|
||||
Key4Str6=
|
||||
Key4Str7=
|
||||
Key4Str8=
|
||||
Key4Str9=
|
||||
Key4Type=0
|
||||
LinkTestSupport=0
|
||||
MACRepeaterEn=0
|
||||
MACRepeaterOuiMode=
|
||||
MeshAuthMode=WPA2PSK
|
||||
MeshAutoLink=0
|
||||
MeshDefaultkey=0
|
||||
MeshEncrypType=AES
|
||||
MeshId=
|
||||
MeshWEPKEY=
|
||||
MeshWPAKEY=
|
||||
MUTxRxEnable=0
|
||||
NoForwarding=0
|
||||
NoForwardingBTNBSSID=0
|
||||
own_ip_addr=10.10.10.254
|
||||
|
||||
PcieAspm=0
|
||||
PERCENTAGEenable=1
|
||||
PhyRateLimit=0
|
||||
PMFMFPC=1
|
||||
PMFMFPR=0
|
||||
PMFSHA256=0
|
||||
PMKCachePeriod=10
|
||||
PowerUpCckOfdm=0:0:0:0:0:0:0
|
||||
PowerUpHT20=0:0:0:0:0:0:0
|
||||
PowerUpHT40=0:0:0:0:0:0:0
|
||||
PowerUpVHT160=0:0:0:0:0:0:0
|
||||
PowerUpVHT20=0:0:0:0:0:0:0
|
||||
PowerUpVHT40=0:0:0:0:0:0:0
|
||||
PowerUpVHT80=0:0:0:0:0:0:0
|
||||
PreAntSwitch=
|
||||
PreAuth=0
|
||||
PreAuthifname=br0
|
||||
RadioLinkSelection=0
|
||||
RadioOn=1
|
||||
RADIUS_Acct_Key=
|
||||
RADIUS_Acct_Port=1813
|
||||
RADIUS_Acct_Server=
|
||||
RADIUS_Key1=
|
||||
RADIUS_Key10=
|
||||
RADIUS_Key11=
|
||||
RADIUS_Key12=
|
||||
RADIUS_Key13=
|
||||
RADIUS_Key14=
|
||||
RADIUS_Key15=
|
||||
RADIUS_Key16=
|
||||
RADIUS_Key2=
|
||||
RADIUS_Key3=
|
||||
RADIUS_Key4=
|
||||
RADIUS_Key5=
|
||||
RADIUS_Key6=
|
||||
RADIUS_Key7=
|
||||
RADIUS_Key8=
|
||||
RADIUS_Key9=
|
||||
RADIUS_Port=1812
|
||||
RADIUS_Server=0
|
||||
RDRegion=CE
|
||||
RED_Enable=1
|
||||
RekeyInterval=3600
|
||||
RekeyMethod=DISABLE
|
||||
RRMEnable=255
|
||||
RTSThreshold=2347
|
||||
session_timeout_interval=0
|
||||
ShortSlot=1
|
||||
SKUenable=1
|
||||
SSID=IOPSYS.mt5
|
||||
SSID1=IOPSYS.mt5.1
|
||||
SSID10=
|
||||
SSID11=
|
||||
SSID12=
|
||||
SSID13=
|
||||
SSID14=
|
||||
SSID15=
|
||||
SSID16=
|
||||
SSID2=IOPSYS.mt5.2
|
||||
SSID3=IOPSYS.mt5.3
|
||||
SSID4=IOPSYS.mt5.4
|
||||
SSID5=
|
||||
SSID6=
|
||||
SSID7=
|
||||
SSID8=
|
||||
SSID9=
|
||||
StationKeepAlive=0
|
||||
StreamMode=0
|
||||
StreamModeMac0=
|
||||
StreamModeMac1=
|
||||
StreamModeMac2=
|
||||
StreamModeMac3=
|
||||
TGnWifiTest=0
|
||||
ThermalRecal=0
|
||||
TxBurst=1
|
||||
TxPower=100
|
||||
TxPreamble=1
|
||||
VHT_BW=1
|
||||
VHT_BW_SIGNAL=0
|
||||
VHT_LDPC=1
|
||||
VHT_Sec80_Channel=auto
|
||||
VHT_SGI=1
|
||||
VHT_STBC=1
|
||||
VLANID=0
|
||||
VLANPriority=0
|
||||
VLANTag=0
|
||||
VOW_Airtime_Ctrl_En=
|
||||
VOW_Airtime_Fairness_En=0
|
||||
VOW_BW_Ctrl=0
|
||||
VOW_Group_Backlog=
|
||||
VOW_Group_DWRR_Max_Wait_Time=
|
||||
VOW_Group_DWRR_Quantum=
|
||||
VOW_Group_Max_Airtime_Bucket_Size=
|
||||
VOW_Group_Max_Rate=
|
||||
VOW_Group_Max_Rate_Bucket_Size=
|
||||
VOW_Group_Max_Ratio=
|
||||
VOW_Group_Max_Wait_Time=
|
||||
VOW_Group_Min_Airtime_Bucket_Size=
|
||||
VOW_Group_Min_Rate=
|
||||
VOW_Group_Min_Rate_Bucket_Size=
|
||||
VOW_Group_Min_Ratio=
|
||||
VOW_Rate_Ctrl_En=
|
||||
VOW_Refill_Period=
|
||||
VOW_RX_En=1
|
||||
VOW_Sta_BE_DWRR_Quantum=
|
||||
VOW_Sta_BK_DWRR_Quantum=
|
||||
VOW_Sta_DWRR_Max_Wait_Time=
|
||||
VOW_Sta_VI_DWRR_Quantum=
|
||||
VOW_Sta_VO_DWRR_Quantum=
|
||||
VOW_WATF_Enable=
|
||||
VOW_WATF_MAC_LV0=
|
||||
VOW_WATF_MAC_LV1=
|
||||
VOW_WATF_MAC_LV2=
|
||||
VOW_WATF_MAC_LV3=
|
||||
VOW_WATF_Q_LV0=
|
||||
VOW_WATF_Q_LV1=
|
||||
VOW_WATF_Q_LV2=
|
||||
VOW_WATF_Q_LV3=
|
||||
VOW_WMM_Search_Rule_Band0=
|
||||
VOW_WMM_Search_Rule_Band1=
|
||||
WapiAsCertPath=
|
||||
WapiAsIpAddr=
|
||||
WapiAsPort=
|
||||
Wapiifname=
|
||||
WapiPsk1=
|
||||
WapiPsk10=
|
||||
WapiPsk11=
|
||||
WapiPsk12=
|
||||
WapiPsk13=
|
||||
WapiPsk14=
|
||||
WapiPsk15=
|
||||
WapiPsk16=
|
||||
WapiPsk2=
|
||||
WapiPsk3=
|
||||
WapiPsk4=
|
||||
WapiPsk5=
|
||||
WapiPsk6=
|
||||
WapiPsk7=
|
||||
WapiPsk8=
|
||||
WapiPsk9=
|
||||
WapiPskType=
|
||||
WapiUserCertPath=
|
||||
WCNTest=0
|
||||
Wds0Key=
|
||||
Wds1Key=
|
||||
Wds2Key=
|
||||
Wds3Key=
|
||||
WdsEnable=0
|
||||
WdsEncrypType=AES
|
||||
WdsList=
|
||||
WdsPhyMode=0
|
||||
WHNAT=1
|
||||
WiFiTest=0
|
||||
WirelessMode=15
|
||||
WmmCapable=1
|
||||
WPAPSK=1234554321
|
||||
WPAPSK1=1111100000
|
||||
WPAPSK10=
|
||||
WPAPSK11=
|
||||
WPAPSK12=
|
||||
WPAPSK13=
|
||||
WPAPSK14=
|
||||
WPAPSK15=
|
||||
WPAPSK16=
|
||||
WPAPSK2=2222200000
|
||||
WPAPSK3=3333300000
|
||||
WPAPSK4=4444400000
|
||||
WPAPSK5=
|
||||
WPAPSK6=
|
||||
WPAPSK7=
|
||||
WPAPSK8=
|
||||
WPAPSK9=
|
||||
WscConfMode=0
|
||||
WscConfStatus=2
|
||||
FtOtd=0
|
||||
FtRic=0
|
||||
FtMdId1=500
|
||||
@@ -1,406 +0,0 @@
|
||||
Default
|
||||
AccessControlList0=
|
||||
AccessControlList1=
|
||||
AccessControlList10=
|
||||
AccessControlList11=
|
||||
AccessControlList12=
|
||||
AccessControlList13=
|
||||
AccessControlList14=
|
||||
AccessControlList15=
|
||||
AccessControlList2=
|
||||
AccessControlList3=
|
||||
AccessControlList4=
|
||||
AccessControlList5=
|
||||
AccessControlList6=
|
||||
AccessControlList7=
|
||||
AccessControlList8=
|
||||
AccessControlList9=
|
||||
AccessPolicy0=0
|
||||
AccessPolicy1=0
|
||||
AccessPolicy10=0
|
||||
AccessPolicy11=0
|
||||
AccessPolicy12=0
|
||||
AccessPolicy13=0
|
||||
AccessPolicy14=0
|
||||
AccessPolicy15=0
|
||||
AccessPolicy2=0
|
||||
AccessPolicy3=0
|
||||
AccessPolicy4=0
|
||||
AccessPolicy5=0
|
||||
AccessPolicy6=0
|
||||
AccessPolicy7=0
|
||||
AccessPolicy8=0
|
||||
AccessPolicy9=0
|
||||
AckPolicy=0;0;0;0
|
||||
APACM=0;0;0;0
|
||||
APAifsn=3;7;1;1
|
||||
ApCliAuthMode=
|
||||
ApCliBssid=
|
||||
ApCliDefaultKeyID=
|
||||
ApCliEnable=
|
||||
ApCliEncrypType=
|
||||
ApCliKey1Str=
|
||||
ApCliKey1Str1=
|
||||
ApCliKey1Type=
|
||||
ApCliKey2Str=
|
||||
ApCliKey2Str1=
|
||||
ApCliKey2Type=
|
||||
ApCliKey3Str=
|
||||
ApCliKey3Str1=
|
||||
ApCliKey3Type=
|
||||
ApCliKey4Str=
|
||||
ApCliKey4Str1=
|
||||
ApCliKey4Type=
|
||||
ApCliSsid=
|
||||
ApCliWirelessMode=
|
||||
ApCliWPAPSK=
|
||||
ApCliWPAPSK1=
|
||||
APCwmax=6;10;4;3
|
||||
APCwmin=4;4;3;2
|
||||
APSDCapable=1
|
||||
APTxop=0;0;94;47
|
||||
AuthMode=WPA2PSK
|
||||
AutoChannelSelect=3
|
||||
AutoChannelSkipList=
|
||||
AutoProvisionEn=0
|
||||
BandSteering=0
|
||||
BasicRate=15
|
||||
BeaconPeriod=100
|
||||
BFBACKOFFenable=0
|
||||
BgndScanSkipCh=
|
||||
BGProtection=0
|
||||
BndStrgBssIdx=
|
||||
BSSACM=0;0;0;0
|
||||
BSSAifsn=3;7;2;2
|
||||
BSSCwmax=10;10;4;3
|
||||
BSSCwmin=4;4;3;2
|
||||
BssidNum=1
|
||||
BSSTxop=0;0;94;47
|
||||
BW_Enable=0
|
||||
BW_Guarantee_Rate=
|
||||
BW_Maximum_Rate=
|
||||
BW_Priority=
|
||||
BW_Root=0
|
||||
CalCacheApply=0
|
||||
CarrierDetect=0
|
||||
Channel=auto
|
||||
ChannelGrp=
|
||||
CountryCode=DE
|
||||
CountryRegion=1
|
||||
CountryRegionABand=1
|
||||
CP_SUPPORT=2
|
||||
CSPeriod=6
|
||||
DBDC_MODE=0
|
||||
DebugFlags=0
|
||||
DefaultKeyID=1
|
||||
DfsCalibration=0
|
||||
DfsEnable=0
|
||||
DfsFalseAlarmPrevent=1
|
||||
DfsZeroWait=0
|
||||
DfsZeroWaitCacTime=255
|
||||
DisableOLBC=0
|
||||
DtimPeriod=1
|
||||
E2pAccessMode=1
|
||||
EAPifname=br0
|
||||
EDCCAEnable=1
|
||||
EncrypType=AES
|
||||
EthConvertMode=dongle
|
||||
EtherTrafficBand=0
|
||||
Ethifname=
|
||||
ETxBfEnCond=1
|
||||
FineAGC=0
|
||||
FixedTxMode=
|
||||
ForceRoamSupport=
|
||||
FragThreshold=2346
|
||||
FreqDelta=0
|
||||
FtSupport=0
|
||||
GreenAP=1
|
||||
G_BAND_256QAM=1
|
||||
HideSSID=0
|
||||
HT_AMSDU=1
|
||||
HT_AutoBA=1
|
||||
HT_BADecline=0
|
||||
HT_BAWinSize=64
|
||||
HT_BSSCoexistence=1
|
||||
HT_BW=1
|
||||
HT_DisallowTKIP=1
|
||||
HT_EXTCHA=1
|
||||
HT_GI=1
|
||||
HT_HTC=1
|
||||
HT_LDPC=1
|
||||
HT_LinkAdapt=0
|
||||
HT_MCS=33
|
||||
HT_MpduDensity=5
|
||||
HT_OpMode=0
|
||||
HT_PROTECT=1
|
||||
HT_RDG=0
|
||||
HT_RxStream=4
|
||||
HT_STBC=1
|
||||
HT_TxStream=4
|
||||
IcapMode=0
|
||||
idle_timeout_interval=0
|
||||
IEEE80211H=1
|
||||
IEEE8021X=0
|
||||
IgmpSnEnable=1
|
||||
ITxBfEn=1
|
||||
Key1Str=
|
||||
Key1Str1=
|
||||
Key1Str10=
|
||||
Key1Str11=
|
||||
Key1Str12=
|
||||
Key1Str13=
|
||||
Key1Str14=
|
||||
Key1Str15=
|
||||
Key1Str16=
|
||||
Key1Str2=
|
||||
Key1Str3=
|
||||
Key1Str4=
|
||||
Key1Str5=
|
||||
Key1Str6=
|
||||
Key1Str7=
|
||||
Key1Str8=
|
||||
Key1Str9=
|
||||
Key1Type=0
|
||||
Key2Str=
|
||||
Key2Str1=
|
||||
Key2Str10=
|
||||
Key2Str11=
|
||||
Key2Str12=
|
||||
Key2Str13=
|
||||
Key2Str14=
|
||||
Key2Str15=
|
||||
Key2Str16=
|
||||
Key2Str2=
|
||||
Key2Str3=
|
||||
Key2Str4=
|
||||
Key2Str5=
|
||||
Key2Str6=
|
||||
Key2Str7=
|
||||
Key2Str8=
|
||||
Key2Str9=
|
||||
Key2Type=0
|
||||
Key3Str=
|
||||
Key3Str1=
|
||||
Key3Str10=
|
||||
Key3Str11=
|
||||
Key3Str12=
|
||||
Key3Str13=
|
||||
Key3Str14=
|
||||
Key3Str15=
|
||||
Key3Str16=
|
||||
Key3Str2=
|
||||
Key3Str3=
|
||||
Key3Str4=
|
||||
Key3Str5=
|
||||
Key3Str6=
|
||||
Key3Str7=
|
||||
Key3Str8=
|
||||
Key3Str9=
|
||||
Key3Type=0
|
||||
Key4Str=
|
||||
Key4Str1=
|
||||
Key4Str10=
|
||||
Key4Str11=
|
||||
Key4Str12=
|
||||
Key4Str13=
|
||||
Key4Str14=
|
||||
Key4Str15=
|
||||
Key4Str16=
|
||||
Key4Str2=
|
||||
Key4Str3=
|
||||
Key4Str4=
|
||||
Key4Str5=
|
||||
Key4Str6=
|
||||
Key4Str7=
|
||||
Key4Str8=
|
||||
Key4Str9=
|
||||
Key4Type=0
|
||||
LinkTestSupport=0
|
||||
MACRepeaterEn=
|
||||
MACRepeaterOuiMode=2
|
||||
MeshAuthMode=
|
||||
MeshAutoLink=0
|
||||
MeshDefaultkey=0
|
||||
MeshEncrypType=
|
||||
MeshId=
|
||||
MeshWEPKEY=
|
||||
MeshWPAKEY=
|
||||
MUTxRxEnable=0
|
||||
NoForwarding=0
|
||||
NoForwardingBTNBSSID=0
|
||||
own_ip_addr=10.10.10.254
|
||||
|
||||
PcieAspm=0
|
||||
PERCENTAGEenable=1
|
||||
PhyRateLimit=0
|
||||
PMFMFPC=1
|
||||
PMFMFPR=0
|
||||
PMFSHA256=0
|
||||
PMKCachePeriod=10
|
||||
PowerUpCckOfdm=0:0:0:0:0:0:0
|
||||
PowerUpHT20=0:0:0:0:0:0:0
|
||||
PowerUpHT40=0:0:0:0:0:0:0
|
||||
PowerUpVHT160=0:0:0:0:0:0:0
|
||||
PowerUpVHT20=0:0:0:0:0:0:0
|
||||
PowerUpVHT40=0:0:0:0:0:0:0
|
||||
PowerUpVHT80=0:0:0:0:0:0:0
|
||||
PreAntSwitch=
|
||||
PreAuth=0
|
||||
PreAuthifname=br0
|
||||
RadioLinkSelection=0
|
||||
RadioOn=1
|
||||
RADIUS_Acct_Key=
|
||||
RADIUS_Acct_Port=1813
|
||||
RADIUS_Acct_Server=
|
||||
RADIUS_Key1=
|
||||
RADIUS_Key10=
|
||||
RADIUS_Key11=
|
||||
RADIUS_Key12=
|
||||
RADIUS_Key13=
|
||||
RADIUS_Key14=
|
||||
RADIUS_Key15=
|
||||
RADIUS_Key16=
|
||||
RADIUS_Key2=
|
||||
RADIUS_Key3=
|
||||
RADIUS_Key4=
|
||||
RADIUS_Key5=
|
||||
RADIUS_Key6=
|
||||
RADIUS_Key7=
|
||||
RADIUS_Key8=
|
||||
RADIUS_Key9=
|
||||
RADIUS_Port=1812
|
||||
RADIUS_Server=0
|
||||
RDRegion=CE
|
||||
RED_Enable=1
|
||||
RekeyInterval=3600
|
||||
RekeyMethod=DISABLE
|
||||
RRMEnable=255
|
||||
RTSThreshold=2347
|
||||
session_timeout_interval=0
|
||||
ShortSlot=1
|
||||
SKUenable=1
|
||||
SSID=
|
||||
SSID1=IOPSYS.mt5
|
||||
SSID10=
|
||||
SSID11=
|
||||
SSID12=
|
||||
SSID13=
|
||||
SSID14=
|
||||
SSID15=
|
||||
SSID16=
|
||||
SSID2=
|
||||
SSID3=
|
||||
SSID4=
|
||||
SSID5=
|
||||
SSID6=
|
||||
SSID7=
|
||||
SSID8=
|
||||
SSID9=
|
||||
StationKeepAlive=0
|
||||
StreamMode=0
|
||||
StreamModeMac0=
|
||||
StreamModeMac1=
|
||||
StreamModeMac2=
|
||||
StreamModeMac3=
|
||||
TGnWifiTest=0
|
||||
ThermalRecal=0
|
||||
TxBurst=1
|
||||
TxPower=100
|
||||
TxPreamble=1
|
||||
VHT_BW=1
|
||||
VHT_BW_SIGNAL=0
|
||||
VHT_LDPC=1
|
||||
VHT_Sec80_Channel=0
|
||||
VHT_SGI=1
|
||||
VHT_STBC=1
|
||||
VLANID=0
|
||||
VLANPriority=0
|
||||
VLANTag=0
|
||||
VOW_Airtime_Ctrl_En=
|
||||
VOW_Airtime_Fairness_En=1
|
||||
VOW_BW_Ctrl=0
|
||||
VOW_Group_Backlog=
|
||||
VOW_Group_DWRR_Max_Wait_Time=
|
||||
VOW_Group_DWRR_Quantum=
|
||||
VOW_Group_Max_Airtime_Bucket_Size=
|
||||
VOW_Group_Max_Rate=
|
||||
VOW_Group_Max_Rate_Bucket_Size=
|
||||
VOW_Group_Max_Ratio=
|
||||
VOW_Group_Max_Wait_Time=
|
||||
VOW_Group_Min_Airtime_Bucket_Size=
|
||||
VOW_Group_Min_Rate=
|
||||
VOW_Group_Min_Rate_Bucket_Size=
|
||||
VOW_Group_Min_Ratio=
|
||||
VOW_Rate_Ctrl_En=
|
||||
VOW_Refill_Period=
|
||||
VOW_RX_En=1
|
||||
VOW_Sta_BE_DWRR_Quantum=
|
||||
VOW_Sta_BK_DWRR_Quantum=
|
||||
VOW_Sta_DWRR_Max_Wait_Time=
|
||||
VOW_Sta_VI_DWRR_Quantum=
|
||||
VOW_Sta_VO_DWRR_Quantum=
|
||||
VOW_WATF_Enable=
|
||||
VOW_WATF_MAC_LV0=
|
||||
VOW_WATF_MAC_LV1=
|
||||
VOW_WATF_MAC_LV2=
|
||||
VOW_WATF_MAC_LV3=
|
||||
VOW_WATF_Q_LV0=
|
||||
VOW_WATF_Q_LV1=
|
||||
VOW_WATF_Q_LV2=
|
||||
VOW_WATF_Q_LV3=
|
||||
VOW_WMM_Search_Rule_Band0=
|
||||
VOW_WMM_Search_Rule_Band1=
|
||||
WapiAsCertPath=
|
||||
WapiAsIpAddr=
|
||||
WapiAsPort=
|
||||
Wapiifname=
|
||||
WapiPsk1=
|
||||
WapiPsk10=
|
||||
WapiPsk11=
|
||||
WapiPsk12=
|
||||
WapiPsk13=
|
||||
WapiPsk14=
|
||||
WapiPsk15=
|
||||
WapiPsk16=
|
||||
WapiPsk2=
|
||||
WapiPsk3=
|
||||
WapiPsk4=
|
||||
WapiPsk5=
|
||||
WapiPsk6=
|
||||
WapiPsk7=
|
||||
WapiPsk8=
|
||||
WapiPsk9=
|
||||
WapiPskType=
|
||||
WapiUserCertPath=
|
||||
WCNTest=0
|
||||
Wds0Key=
|
||||
Wds1Key=
|
||||
Wds2Key=
|
||||
Wds3Key=
|
||||
WdsEnable=0
|
||||
WdsEncrypType=NONE
|
||||
WdsList=
|
||||
WdsPhyMode=0
|
||||
WHNAT=1
|
||||
WiFiTest=0
|
||||
WirelessMode=15
|
||||
WmmCapable=1
|
||||
WPAPSK=
|
||||
WPAPSK1=12345678
|
||||
WPAPSK10=
|
||||
WPAPSK11=
|
||||
WPAPSK12=
|
||||
WPAPSK13=
|
||||
WPAPSK14=
|
||||
WPAPSK15=
|
||||
WPAPSK16=
|
||||
WPAPSK2=
|
||||
WPAPSK3=
|
||||
WPAPSK4=
|
||||
WPAPSK5=
|
||||
WPAPSK6=
|
||||
WPAPSK7=
|
||||
WPAPSK8=
|
||||
WPAPSK9=
|
||||
WscConfMode=0
|
||||
WscConfStatus=2
|
||||
@@ -1,27 +0,0 @@
|
||||
Default
|
||||
INDEX0=MT7603
|
||||
INDEX0_profile_path=/etc/Wireless/RT2860/RT2860.dat
|
||||
INDEX0_EEPROM_offset=0x0
|
||||
INDEX0_EEPROM_size=0x4000
|
||||
INDEX0_EEPROM_name=e2p
|
||||
INDEX0_main_ifname=ra0
|
||||
INDEX0_ext_ifname=ra
|
||||
INDEX0_wds_ifname=wds
|
||||
INDEX0_apcli_ifname=apcli
|
||||
INDEX0_mesh_ifname=mesh
|
||||
INDEX0_nvram_zone=dev1
|
||||
INDEX0_single_sku_path=/etc_ro/Wireless/RT2860/SingleSKU.dat
|
||||
INDEX0_bf_sku_path=/etc_ro/Wireless/RT2860/SingleSKU_BF.dat
|
||||
INDEX1=MT7615
|
||||
INDEX1_profile_path=/etc/Wireless/iNIC/iNIC_ap.dat
|
||||
INDEX1_EEPROM_offset=0x4000
|
||||
INDEX1_EEPROM_size=0x4000
|
||||
INDEX1_EEPROM_name=e2p
|
||||
INDEX1_main_ifname=rai0
|
||||
INDEX1_ext_ifname=rai
|
||||
INDEX1_wds_ifname=wdsi
|
||||
INDEX1_apcli_ifname=apclii
|
||||
INDEX1_mesh_ifname=meshi
|
||||
INDEX1_nvram_zone=dev2
|
||||
INDEX1_single_sku_path=/etc_ro/Wireless/iNIC/SingleSKU.dat
|
||||
INDEX1_bf_sku_path=/etc_ro/Wireless/iNIC/SingleSKU_BF.dat
|
||||
@@ -1,250 +0,0 @@
|
||||
# Kconfig for mtk wifi
|
||||
|
||||
config MTK_WIFI_DRIVER
|
||||
bool
|
||||
default y
|
||||
depends on (PACKAGE_kmod-mtk7615e || PACKAGE_kmod-mtk7603e)
|
||||
select MTK_SUPPORT_OPENWRT
|
||||
select MTK_MT_WIFI
|
||||
select MTK_WIFI_BASIC_FUNC
|
||||
|
||||
if MTK_WIFI_DRIVER
|
||||
|
||||
menu "First WiFi card"
|
||||
choice
|
||||
prompt "Choose First WiFi card"
|
||||
default MTK_FIRST_IF_MT7603E
|
||||
|
||||
config MTK_FIRST_IF_NONE
|
||||
bool "None"
|
||||
|
||||
config MTK_FIRST_IF_MT7603E
|
||||
bool "MT7603E"
|
||||
select RALINK_MT7603E
|
||||
select MTK_WIFI_MT_MAC
|
||||
select MTK_MT_MAC
|
||||
select MTK_CHIP_MT7603E
|
||||
|
||||
config MTK_FIRST_IF_MT7615E
|
||||
bool "MT7615E"
|
||||
select MTK_WIFI_MT_MAC
|
||||
select MTK_MT_MAC
|
||||
select MTK_CHIP_MT7615E
|
||||
|
||||
endchoice
|
||||
|
||||
config MTK_RT_FIRST_CARD
|
||||
int
|
||||
depends on ! MTK_FIRST_IF_NONE
|
||||
default 7603 if MTK_FIRST_IF_MT7603E
|
||||
default 7615 if MTK_FIRST_IF_MT7615E
|
||||
|
||||
config MTK_MT_WIFI_PATH_FIRST_CARD
|
||||
string "WiFi driver build directory name"
|
||||
default "rlt_wifi"
|
||||
|
||||
config MTK_RT_FIRST_IF_RF_OFFSET
|
||||
hex "RF offset of 1st card"
|
||||
depends on ! MTK_FIRST_IF_NONE
|
||||
default 0x0
|
||||
|
||||
#prompt "WiFi detailed options for 1st card"
|
||||
|
||||
choice
|
||||
prompt "EEPROM Type of 1st Card"
|
||||
depends on ! MTK_FIRST_IF_NONE
|
||||
default MTK_FIRST_IF_EEPROM_EFUSE
|
||||
|
||||
config MTK_FIRST_IF_EEPROM_FLASH
|
||||
bool "FLASH"
|
||||
|
||||
config MTK_FIRST_IF_EEPROM_PROM
|
||||
bool "EEPROM"
|
||||
|
||||
config MTK_FIRST_IF_EEPROM_EFUSE
|
||||
bool "EFUSE"
|
||||
|
||||
endchoice
|
||||
|
||||
config MTK_RT_FIRST_CARD_EEPROM
|
||||
string
|
||||
depends on ! MTK_FIRST_IF_NONE
|
||||
default "prom" if MTK_FIRST_IF_EEPROM_PROM
|
||||
default "efuse" if MTK_FIRST_IF_EEPROM_EFUSE
|
||||
default "flash" if MTK_FIRST_IF_EEPROM_FLASH
|
||||
|
||||
choice
|
||||
prompt "PA/LNA Type of 1st Card"
|
||||
depends on ! MTK_FIRST_IF_NONE
|
||||
default MTK_FIRST_IF_IPAILNA
|
||||
|
||||
config MTK_FIRST_IF_EPAELNA
|
||||
bool "ePAeLNA"
|
||||
config MTK_FIRST_IF_IPAILNA
|
||||
bool "iPAiLNA"
|
||||
config MTK_FIRST_IF_IPAELNA
|
||||
bool "iPAeLNA"
|
||||
endchoice
|
||||
|
||||
menu "Operation Modes for 1st card"
|
||||
choice
|
||||
prompt "Operating mode"
|
||||
default MTK_WIFI_MODE_AP
|
||||
|
||||
config MTK_WIFI_MODE_AP
|
||||
bool "AP"
|
||||
|
||||
config MTK_WIFI_MODE_STA
|
||||
bool "STA"
|
||||
|
||||
config MTK_WIFI_MODE_BOTH
|
||||
bool "AP+STA"
|
||||
#select MTK_MT_STA_SUPPORT
|
||||
endchoice
|
||||
|
||||
source "ap.config.in"
|
||||
|
||||
endmenu
|
||||
endmenu
|
||||
### endmenu for 1st wifi card #######
|
||||
|
||||
#### menu starts for 2nd wifi card ###
|
||||
menu "Second WiFi card"
|
||||
|
||||
choice
|
||||
prompt "Choose Second WiFi card"
|
||||
default MTK_SECOND_IF_MT7615E
|
||||
|
||||
config MTK_SECOND_IF_NONE
|
||||
bool "None"
|
||||
|
||||
config MTK_SECOND_IF_MT7603E
|
||||
bool "MT7603E"
|
||||
select RALINK_MT7603E
|
||||
select MTK_WIFI_MT_MAC
|
||||
select MTK_MT_MAC
|
||||
select MTK_CHIP_MT7603E
|
||||
|
||||
config MTK_SECOND_IF_MT7615E
|
||||
bool "MT7615E"
|
||||
select MTK_WIFI_MT_MAC
|
||||
select MTK_MT_MAC
|
||||
select MTK_CHIP_MT7615E
|
||||
endchoice
|
||||
|
||||
config MTK_RT_SECOND_CARD
|
||||
int
|
||||
depends on ! MTK_SECOND_IF_NONE
|
||||
default 7603 if MTK_SECOND_IF_MT7603E
|
||||
default 7615 if MTK_SECOND_IF_MT7615E
|
||||
|
||||
config MTK_MT_WIFI_PATH_SECOND_CARD
|
||||
string "WiFi driver build directory name"
|
||||
default "mt_wifi"
|
||||
|
||||
config MTK_RT_SECOND_IF_RF_OFFSET
|
||||
hex "RF offset of 2nd card"
|
||||
depends on ! MTK_SECOND_IF_NONE
|
||||
default 0x8000
|
||||
|
||||
#prompt "WiFi detailed options for 2nd card"
|
||||
|
||||
choice
|
||||
prompt "EEPROM Type of 2nd Card"
|
||||
depends on ! MTK_SECOND_IF_NONE
|
||||
default MTK_SECOND_IF_EEPROM_EFUSE
|
||||
|
||||
config MTK_SECOND_IF_EEPROM_FLASH
|
||||
bool "FLASH"
|
||||
|
||||
config MTK_SECOND_IF_EEPROM_PROM
|
||||
bool "EEPROM"
|
||||
|
||||
config MTK_SECOND_IF_EEPROM_EFUSE
|
||||
bool "EFUSE"
|
||||
endchoice
|
||||
|
||||
config MTK_RT_SECOND_CARD_EEPROM
|
||||
string
|
||||
depends on ! MTK_SECOND_IF_NONE
|
||||
default "prom" if MTK_SECOND_IF_EEPROM_PROM
|
||||
default "efuse" if MTK_SECOND_IF_EEPROM_EFUSE
|
||||
default "flash" if MTK_SECOND_IF_EEPROM_FLASH
|
||||
|
||||
|
||||
choice
|
||||
prompt "PA/LNA Type of 2nd Card"
|
||||
depends on ! MTK_SECOND_IF_NONE
|
||||
default MTK_SECOND_IF_IPAILNA
|
||||
|
||||
config MTK_SECOND_IF_EPAELNA
|
||||
bool "ePAeLNA"
|
||||
config MTK_SECOND_IF_IPAILNA
|
||||
bool "iPAiLNA"
|
||||
config MTK_SECOND_IF_IPAELNA
|
||||
bool "iPAeLNA"
|
||||
endchoice
|
||||
|
||||
|
||||
menu "Operation Modes for 2nd card"
|
||||
choice
|
||||
prompt "Operating mode"
|
||||
default MTK_WIFI_MODE_AP
|
||||
|
||||
config MTK_WIFI_MODE_AP
|
||||
bool "AP"
|
||||
|
||||
config MTK_WIFI_MODE_STA
|
||||
bool "STA"
|
||||
|
||||
config MTK_WIFI_MODE_BOTH
|
||||
bool "AP+STA"
|
||||
endchoice
|
||||
|
||||
source "ap.config.in"
|
||||
|
||||
endmenu
|
||||
|
||||
endmenu
|
||||
### endmenu for 2nd wifi card #######
|
||||
|
||||
|
||||
#### placeholder for 3rd wifi card ###
|
||||
config MTK_THIRD_IF_NONE
|
||||
bool
|
||||
default y
|
||||
|
||||
config MTK_RT_THIRD_CARD
|
||||
int
|
||||
default 0
|
||||
|
||||
config MTK_RT_THIRD_IF_RF_OFFSET
|
||||
hex
|
||||
default 0x4000
|
||||
|
||||
config MTK_RT_THIRD_CARD_EEPROM
|
||||
string
|
||||
default "efuse"
|
||||
### placehlder for 3rd wifi card #######
|
||||
|
||||
|
||||
config MTK_MULTI_INF_SUPPORT
|
||||
bool
|
||||
default y if !MTK_FIRST_IF_NONE && !MTK_SECOND_IF_NONE
|
||||
|
||||
|
||||
source "common.config.in"
|
||||
|
||||
#if MTK_CHIP_MT7615E || MTK_CHIP_MT7622 || MTK_CHIP_MT7626 || MTK_CHIP_AXE || MTK_CHIP_MT7915
|
||||
# config MTK_MT_MAC
|
||||
# bool
|
||||
# default y
|
||||
# select MTK_RATE_ADAPTION
|
||||
# select MTK_RATE_ADAPT_AGBS_SUPPORT
|
||||
# select MTK_DOT11_N_SUPPORT
|
||||
# select MTK_DOT11_VHT_AC
|
||||
# select MTK_HDR_TRANS_TX_SUPPORT
|
||||
# select MTK_HDR_TRANS_RX_SUPPORT
|
||||
#endif
|
||||
|
||||
endif #MTK_WIFI_DRIVER#
|
||||
@@ -1,84 +0,0 @@
|
||||
CONFIG_SUPPORT_OPENWRT=y
|
||||
CONFIG_RT_FIRST_CARD=7603
|
||||
CONFIG_RT_SECOND_CARD=7615
|
||||
CONFIG_RT_THIRD_CARD=0
|
||||
CONFIG_FIRST_IF_MT7603E=y
|
||||
CONFIG_SECOND_IF_MT7615E=y
|
||||
CONFIG_THIRD_IF_NONE=y
|
||||
CONFIG_RT_FIRST_IF_RF_OFFSET=0x0
|
||||
CONFIG_RT_SECOND_IF_RF_OFFSET=0x8000
|
||||
CONFIG_RT_THIRD_IF_RF_OFFSET=0x4000
|
||||
CONFIG_RT_FIRST_CARD_EEPROM="efuse"
|
||||
CONFIG_RT_SECOND_CARD_EEPROM="efuse"
|
||||
CONFIG_RT_THIRD_CARD_EEPROM="efuse"
|
||||
CONFIG_FIRST_IF_EEPROM_EFUSE=y
|
||||
CONFIG_SECOND_IF_EEPROM_EFUSE=y
|
||||
CONFIG_FIRST_IF_IPAILNA=y
|
||||
CONFIG_SECOND_IF_IPAILNA=y
|
||||
CONFIG_WIFI_DRIVER=y
|
||||
CONFIG_WIFI_BASIC_FUNC=y
|
||||
CONFIG_MULTI_INF_SUPPORT=y
|
||||
CONFIG_DOT11_N_SUPPORT=y
|
||||
CONFIG_DOT11_VHT_AC=y
|
||||
CONFIG_G_BAND_256QAM_SUPPORT=y
|
||||
CONFIG_ICAP_SUPPORT=y
|
||||
CONFIG_BACKGROUND_SCAN_SUPPORT=y
|
||||
CONFIG_SMART_CARRIER_SENSE_SUPPORT=y
|
||||
CONFIG_MT_DFS_SUPPORT=y
|
||||
CONFIG_TXBF_SUPPORT=y
|
||||
CONFIG_ATE_SUPPORT=y
|
||||
CONFIG_WIFI_MODE_AP=y
|
||||
CONFIG_WDS_SUPPORT=y
|
||||
CONFIG_MBSS_SUPPORT=y
|
||||
CONFIG_APCLI_SUPPORT=y
|
||||
CONFIG_MULTI_APCLI_SUPPORT=y
|
||||
CONFIG_MAC_REPEATER_SUPPORT=y
|
||||
CONFIG_VOW_SUPPORT=y
|
||||
CONFIG_BAND_STEERING=y
|
||||
CONFIG_MUMIMO_SUPPORT=y
|
||||
CONFIG_MU_RA_SUPPORT=y
|
||||
CONFIG_GREENAP_SUPPORT=y
|
||||
CONFIG_TPC_SUPPORT=y
|
||||
CONFIG_RLM_CAL_CACHE_SUPPORT=y
|
||||
CONFIG_CAL_BIN_FILE_SUPPORT=y
|
||||
CONFIG_WIFI_EAP_FEATURE=y
|
||||
CONFIG_WPA3_SUPPORT=y
|
||||
CONFIG_SPECTRUM_SUPPORT=y
|
||||
CONFIG_PRE_CAL_TRX_SET1_SUPPORT=y
|
||||
CONFIG_MCAST_RATE_SPECIFIC=y
|
||||
CONFIG_PRE_CAL_TRX_SET2_SUPPORT=y
|
||||
CONFIG_PCIE_ASPM_DYM_CTRL_SUPPORT=y
|
||||
CONFIG_CHIP_MT7615E=y
|
||||
CONFIG_MT_MAC=y
|
||||
CONFIG_RTMP_PCI_SUPPORT=y
|
||||
CONFIG_NEW_RATE_ADAPT_SUPPORT=y
|
||||
CONFIG_AGS_SUPPORT=y
|
||||
CONFIG_UAPSD=y
|
||||
CONFIG_MT_MAC=y
|
||||
CONFIG_WSC_INCLUDED=y
|
||||
CONFIG_WSC_V2_SUPPORT=y
|
||||
CONFIG_DOT11W_PMF_SUPPORT=y
|
||||
CONFIG_DOT11N_DRAFT3=y
|
||||
CONFIG_DOT11R_FT_SUPPORT=y
|
||||
CONFIG_DOT11K_RRM_SUPPORT=y
|
||||
CONFIG_WNM_SUPPORT=y
|
||||
CONFIG_INTERWORKING=y
|
||||
CONFIG_IGMP_SNOOP_SUPPORT=y
|
||||
CONFIG_LED_CONTROL_SUPPORT=y
|
||||
CONFIG_ATE_SUPPORT=y
|
||||
CONFIG_MULTI_INF_SUPPORT=y
|
||||
CONFIG_OWE_SUPPORT=y
|
||||
CONFIG_SECURITY_IMPROVEMENT_SUPPORT=y
|
||||
CONFIG_MT_AP_SUPPORT=m
|
||||
CONFIG_DEFAULT_5G_PROFILE=y
|
||||
CONFIG_PASSPOINT_R2=y
|
||||
CONFIG_DSCP_QOS_MAP_SUPPORT=y
|
||||
CONFIG_DSCP_PRI_SUPPORT=7
|
||||
CONFIG_MBO_SUPPORT=y
|
||||
CONFIG_TXRX_STAT_SUPPORT=y
|
||||
CONFIG_VLAN_SUPPORT=y
|
||||
CONFIG_MAP_SUPPORT=y
|
||||
CONFIG_CUSTOMER_VENDOR_IE_SUPPORT=y
|
||||
CONFIG_BRCM_256QAM_SUPPORT=y
|
||||
CONFIG_HDR_TRANS_TX_SUPPORT=y
|
||||
CONFIG_HDR_TRANS_RX_SUPPORT=y
|
||||
@@ -1,33 +0,0 @@
|
||||
From 58f33070591a5a11b532b8365874d0eb104b0aab Mon Sep 17 00:00:00 2001
|
||||
From: Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
Date: Sun, 23 Feb 2020 12:30:45 +0100
|
||||
Subject: [PATCH] disable multi profile and set default to 5G
|
||||
|
||||
---
|
||||
mt_wifi_ap/Makefile | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/mt_wifi_ap/Makefile b/mt_wifi_ap/Makefile
|
||||
index a49520d..f8f16ab 100644
|
||||
--- a/mt_wifi_ap/Makefile
|
||||
+++ b/mt_wifi_ap/Makefile
|
||||
@@ -192,12 +192,12 @@ cmm_objs := $(SRC_EMBEDDED_DIR)/common/action.o\
|
||||
$(SRC_DIR)/protocol/protection.o\
|
||||
$(SRC_EMBEDDED_DIR)/common/misc_app.o
|
||||
|
||||
-EXTRA_CFLAGS += -DMULTI_PROFILE
|
||||
-cmm_objs += $(SRC_EMBEDDED_DIR)/common/multi_profile.o
|
||||
+#EXTRA_CFLAGS += -DMULTI_PROFILE
|
||||
+#cmm_objs += $(SRC_EMBEDDED_DIR)/common/multi_profile.o
|
||||
|
||||
-ifeq ($(CONFIG_DEFAULT_5G_PROFILE),y)
|
||||
+#ifeq ($(CONFIG_DEFAULT_5G_PROFILE),y)
|
||||
EXTRA_CFLAGS += -DDEFAULT_5G_PROFILE
|
||||
-endif
|
||||
+#endif
|
||||
|
||||
########################################################
|
||||
# Coex related files
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -15,7 +15,7 @@ PKG_SOURCE_URL:=http://download.iopsys.eu/iopsys/opensdk/
|
||||
PKG_NAME:=natalie-dect-open
|
||||
else
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:dialog/natalie-dect-12.26
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/dialog/natalie-dect-12.26.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
endif
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=0.2.0
|
||||
|
||||
PKG_SOURCE_VERSION:=6406325e72d7ddd0ff7aaa3a87669519021bdb11
|
||||
PKG_SOURCE_VERSION:=5c8abbdf86e4651c7c6f14f784cfb52e69979f96
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/netmoded
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
config mode 'setup'
|
||||
config netmoded 'netmoded'
|
||||
option enabled '0'
|
||||
|
||||
config setup 'setup'
|
||||
option enabled '0'
|
||||
option dir '/etc/netmodes'
|
||||
option detail ''
|
||||
option curmode 'routed'
|
||||
|
||||
config tools 'tools'
|
||||
option wificontrol 0
|
||||
option arp_discovery 1
|
||||
# option mode 'router'
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$INTERFACE" != "wan" ] && exit
|
||||
|
||||
automode="$(uci -q get netmode.setup.automode)"
|
||||
[ "$automode" == "0" ] && exit
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
. /lib/functions/netmode.sh
|
||||
|
||||
network_flush_cache
|
||||
network_get_ipaddr ipaddr $INTERFACE
|
||||
[ -z "$ipaddr" ] && exit
|
||||
|
||||
repeaterready="$(uci -q get netmode.setup.repeaterready)"
|
||||
curmode="$(uci -q get netmode.setup.curmode)"
|
||||
|
||||
if [ "$(netmode_get_ip_type $ipaddr)" == "private" ]; then
|
||||
if [ "$repeaterready" == "1" -o "${curmode:0:8}" == "repeater" ]; then
|
||||
# flush the ip on br-lan; br-lan will anyhow be deleted.
|
||||
# this is needed if the ip received on the wan is also from the same net
|
||||
logger -s -p user.info -t $0: [netmode] ip addr flush dev br-lan >/dev/console
|
||||
ip addr flush dev br-lan 2>/dev/null
|
||||
|
||||
# flush iptables in case the MASTER
|
||||
# tries to configure us before
|
||||
# firewall is disabled the proper way
|
||||
logger -s -p user.info -t $0: [netmode] iptables -F >/dev/console
|
||||
iptables -F
|
||||
|
||||
disable_firewall 1
|
||||
fi
|
||||
else
|
||||
disable_firewall 0
|
||||
fi
|
||||
|
||||
case "$curmode" in
|
||||
repeater*)
|
||||
;;
|
||||
*)
|
||||
[ "$repeaterready" == "1" ] || return
|
||||
if [ "$(netmode_get_ip_type $ipaddr)" == "private" ]; then
|
||||
wificontrol_takes_over || switch_netmode repeater
|
||||
else
|
||||
switch_netmode routed
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/netmode.sh
|
||||
|
||||
ps | grep hotplug | grep button && exit
|
||||
|
||||
[ -z "$INTERFACE" ] && exit
|
||||
|
||||
defroute=$(ip route | grep default | awk '{print$3}')
|
||||
|
||||
case "$(uci get netmode.setup.curmode)" in
|
||||
repeater*)
|
||||
;;
|
||||
*)
|
||||
ping -c 1 -w 5 $defroute >/dev/null 2>&1 || {
|
||||
logger -s -t "80-repeater" "ping to $defroute failed, sending USR1 to udhcpc" >/dev/console
|
||||
killall -USR1 udhcpc
|
||||
}
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$ACTION" in
|
||||
add|register|remove|unregister) correct_uplink $INTERFACE;;
|
||||
esac
|
||||
|
||||
@@ -9,6 +9,13 @@ NETMODED="/sbin/netmoded"
|
||||
. /lib/functions/netmode.sh
|
||||
|
||||
start_netmoded() {
|
||||
config_load netmode
|
||||
|
||||
config_get enabled netmoded enabled 0
|
||||
if [ "$enabled" != "1" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $NETMODED
|
||||
|
||||
@@ -24,18 +31,12 @@ start_service() {
|
||||
populate_netmodes
|
||||
|
||||
start_netmoded
|
||||
start_netmode_tools
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
switch_netmode
|
||||
|
||||
start_netmoded
|
||||
start_netmode_tools
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
stop_netmode_tools
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
9
netmode/files/etc/netmodes/bridge/DETAILS
Normal file
9
netmode/files/etc/netmodes/bridge/DETAILS
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Bridge Mode" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "NAT is disabled." }
|
||||
],
|
||||
"reboot" : 0
|
||||
}
|
||||
92
netmode/files/etc/netmodes/bridge/scripts/pre/bridge_mode.sh
Normal file
92
netmode/files/etc/netmodes/bridge/scripts/pre/bridge_mode.sh
Normal file
@@ -0,0 +1,92 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
BRIDGEPORTS=""
|
||||
|
||||
get_vlan() {
|
||||
local device="$1"
|
||||
for section in $(uci show network | grep "=device" | cut -d '=' -f1); do
|
||||
if [ "$(uci -q get $section.ifname)" == "$device" ]; then
|
||||
uci -q get $section.name
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_wifi_devs()
|
||||
{
|
||||
|
||||
add_wdev()
|
||||
{
|
||||
local cfg=$1
|
||||
# local disabled
|
||||
|
||||
# config_get_bool disabled $cfg disabled 0
|
||||
# config_get_bool ifname $cfg ifname
|
||||
|
||||
# if [ $disabled -eq 0 -a -n "$ifname" ]; then
|
||||
# BRIDGEPORTS="$ifname"
|
||||
# fi
|
||||
|
||||
uci -q set wireless.$cfg.network="wan"
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
config_foreach add_wdev "wifi-iface"
|
||||
|
||||
uci -q commit wireless
|
||||
}
|
||||
|
||||
add_xtm_devs() {
|
||||
local section device vlan
|
||||
|
||||
for section in $(uci show dsl | grep "=.*tm-device" | cut -d'=' -f1); do
|
||||
if [ -n "$(uci -q get $section.device)" ]; then
|
||||
|
||||
vlan="$(get_vlan $device)"
|
||||
[ -n "$vlan" ] && device="$vlan"
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
BRIDGEPORTS="$BRIDGEPORTS $device"
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_eth_ports() {
|
||||
|
||||
add_port()
|
||||
{
|
||||
local cfg=$1
|
||||
local ifname vlan
|
||||
|
||||
config_get ifname $cfg ifname
|
||||
|
||||
vlan="$(get_vlan $ifname)"
|
||||
[ -n "$vlan" ] && ifname="$vlan"
|
||||
|
||||
if [ -n "$ifname" ]; then
|
||||
BRIDGEPORTS="$BRIDGEPORTS $ifname"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load ports
|
||||
config_foreach add_port "ethport"
|
||||
}
|
||||
|
||||
add_xtm_devs
|
||||
add_eth_ports
|
||||
add_wifi_devs
|
||||
|
||||
BRIDGEPORTS="$(echo $BRIDGEPORTS | sed -e 's/[[:space:]]*$//')"
|
||||
|
||||
uci -q set network.wan.type="bridge"
|
||||
uci -q set network.wan.ifname="$BRIDGEPORTS"
|
||||
uci -q set network.wan6.ifname="@wan"
|
||||
uci -q delete network.lan.ifname
|
||||
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Repeater 5▴▾2.4&5" },
|
||||
{ "sv" : "Repeater 5▴▾2.4&5" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "Your router is going to act as a wired extender or wireless repeater to the selected Wireless Access Point. Uplink 5G & Downlink 2.4G + 5G" },
|
||||
{ "sv" : "Routern kommer att fungera som en trådbunden extender eller trådlös repeater till den valda trådlösa åtkomstpunkten. Uplink 5G & Downlink 2.4G + 5G" }
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
],
|
||||
"uplink_band" : 'a',
|
||||
"downlink_band" : 'a b',
|
||||
"credentials" : 1,
|
||||
"reboot" : 0
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
config interface 'loopback'
|
||||
option ifname 'lo'
|
||||
option proto 'static'
|
||||
option ipaddr '127.0.0.1'
|
||||
option netmask '255.0.0.0'
|
||||
|
||||
config device 'lan_dev'
|
||||
option name 'eth0.1'
|
||||
# Unused?
|
||||
#option macaddr '$MACLAN'
|
||||
option vid 1
|
||||
|
||||
config interface 'wan'
|
||||
option type 'bridge'
|
||||
option ifname 'eth0.2 eth0.1'
|
||||
option proto 'dhcp'
|
||||
#option hostname AUTO-CREATED AT FIRST BOOT
|
||||
option reqopts '66 67 128 224'
|
||||
option igmp_snooping '0'
|
||||
# Unused?
|
||||
#option macaddr '$MACWAN'
|
||||
|
||||
config device 'wan_dev'
|
||||
option name 'eth0.2'
|
||||
# Unused?
|
||||
#option macaddr '$MACWAN'
|
||||
option vid 2
|
||||
|
||||
config interface 'wan6'
|
||||
option ifname '@wan'
|
||||
option proto 'dhcpv6'
|
||||
|
||||
config switch
|
||||
option name 'switch0'
|
||||
option reset '1'
|
||||
option enable_vlan '1'
|
||||
|
||||
config switch_vlan
|
||||
option device 'switch0'
|
||||
option vlan '1'
|
||||
option ports '1 6t'
|
||||
|
||||
config switch_vlan
|
||||
option device 'switch0'
|
||||
option vlan '2'
|
||||
option ports '0 6t'
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#if wet in wireless config and SSID nad KEY was saved for it, apply to config
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
parse_wet_json()
|
||||
{
|
||||
local interface=$1
|
||||
local mode key encryption ssid connect_bssid
|
||||
|
||||
config_get mode $interface mode
|
||||
[ "$mode" = "wet" ] || return
|
||||
|
||||
json_load "$(cat /tmp/netmodecfg)" 2> /dev/null
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
json_get_var encryption encryption
|
||||
json_get_var connect_bssid connect_bssid
|
||||
|
||||
uci -q set wireless.$1.key="$key"
|
||||
uci -q set wireless.$1.encryption="$encryption"
|
||||
uci -q set wireless.$1.ssid="$ssid"
|
||||
uci -q set wireless.$1.connect_bssid="$connect_bssid"
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
apply_wet_cfg()
|
||||
{
|
||||
[ -f /tmp/netmodecfg ] || return
|
||||
|
||||
config_load wireless
|
||||
config_foreach parse_wet_json "wifi-iface"
|
||||
|
||||
rm /tmp/netmodecfg 2> /dev/null
|
||||
}
|
||||
|
||||
apply_wet_cfg
|
||||
@@ -1,2 +0,0 @@
|
||||
uci -q set owsd.ubusproxy.enable="0"
|
||||
uci -q commit owsd
|
||||
@@ -1,38 +0,0 @@
|
||||
#if mode wet in wireless config has SSID Key, save them
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
parse_wet_cfg()
|
||||
{
|
||||
local interface=$1
|
||||
local mode key encryption ssid connect_bssid
|
||||
|
||||
config_get mode $interface mode
|
||||
[ "$mode" = "wet" ] || return
|
||||
|
||||
config_get ssid $interface ssid
|
||||
config_get key $interface key
|
||||
config_get encryption $interface encryption
|
||||
config_get connect_bssid $interface connect_bssid
|
||||
|
||||
[ -n "$key" ] || return
|
||||
[ -n "$encryption" ] || return
|
||||
|
||||
json_init
|
||||
json_add_string "ssid" "$ssid"
|
||||
json_add_string "key" "$key"
|
||||
json_add_string "encryption" "$encryption"
|
||||
json_add_string "connect_bssid" "$connect_bssid"
|
||||
|
||||
echo "`json_dump`" > /tmp/netmodecfg
|
||||
}
|
||||
|
||||
save_wet_cfg()
|
||||
{
|
||||
config_load wireless
|
||||
config_foreach parse_wet_cfg "wifi-iface"
|
||||
}
|
||||
|
||||
save_wet_cfg
|
||||
@@ -1,55 +0,0 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config wifi-device ra0
|
||||
option band b
|
||||
option channel auto
|
||||
option bandwidth '20'
|
||||
option hwmode auto
|
||||
option htmode HT20
|
||||
option country 'DE'
|
||||
|
||||
config wifi-iface
|
||||
option device ra0
|
||||
option network wan
|
||||
option mode ap
|
||||
#option ssid AUTO-CREATED AT FIRST BOOT
|
||||
option encryption psk2
|
||||
#option key AUTO-CREATED AT FIRST BOOT
|
||||
option ifname ra0
|
||||
option wps 1
|
||||
|
||||
config wifi-device rai0
|
||||
option band a
|
||||
option channel auto
|
||||
option bandwidth '80'
|
||||
option hwmode 11ac
|
||||
option htmode VHT80
|
||||
option country 'DE'
|
||||
option beamforming 1
|
||||
|
||||
config wifi-iface
|
||||
option device rai0
|
||||
option network wan
|
||||
option mode ap
|
||||
#option ssid AUTO-CREATED AT FIRST BOOT
|
||||
option encryption psk2
|
||||
#option key AUTO-CREATED AT FIRST BOOT
|
||||
option ifname rai0
|
||||
option wps 1
|
||||
|
||||
config wifi-iface
|
||||
option device rai0
|
||||
option network wan
|
||||
option mode wet
|
||||
#option ssid AUTO-CREATED AT FIRST BOOT
|
||||
option encryption psk2
|
||||
#option key AUTO-CREATED AT FIRST BOOT
|
||||
option ifname apclii0
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Fully Routed (NAT)" },
|
||||
{ "sv" : "Fullt Omdirigerad (NAT)" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "" },
|
||||
{ "sv" : "" }
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
],
|
||||
"reboot" : 0,
|
||||
"credentials" : 0
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
config dnsmasq
|
||||
option domainneeded 1
|
||||
option boguspriv 1
|
||||
option filterwin2k 0
|
||||
option localise_queries 1
|
||||
option rebind_protection 0
|
||||
option rebind_localhost 1
|
||||
option local '/lan/'
|
||||
option domain 'lan'
|
||||
option expandhosts 1
|
||||
option nonegcache 0
|
||||
option authoritative 1
|
||||
option readethers 1
|
||||
option leasefile '/tmp/dhcp.leases'
|
||||
option resolvfile '/tmp/resolv.conf.auto'
|
||||
|
||||
config dhcp lan
|
||||
option interface lan
|
||||
option start 100
|
||||
option limit 150
|
||||
option leasetime 12h
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
config settings 'settings'
|
||||
option disabled '0'
|
||||
|
||||
config defaults
|
||||
option syn_flood 1
|
||||
option input ACCEPT
|
||||
option output ACCEPT
|
||||
option forward REJECT
|
||||
# Uncomment this line to disable ipv6 rules
|
||||
# option disable_ipv6 1
|
||||
|
||||
config zone
|
||||
option name lan
|
||||
list network 'lan'
|
||||
option input ACCEPT
|
||||
option output ACCEPT
|
||||
option forward ACCEPT
|
||||
|
||||
config zone
|
||||
option name wan
|
||||
list network 'wan'
|
||||
list network 'wan6'
|
||||
option input REJECT
|
||||
option output ACCEPT
|
||||
option forward REJECT
|
||||
option masq 1
|
||||
option mtu_fix 1
|
||||
|
||||
config forwarding
|
||||
option src lan
|
||||
option dest wan
|
||||
|
||||
# We need to accept udp packets on port 68,
|
||||
# see https://dev.openwrt.org/ticket/4108
|
||||
config rule
|
||||
option name Allow-DHCP-Renew
|
||||
option src wan
|
||||
option proto udp
|
||||
option dest_port 68
|
||||
option target ACCEPT
|
||||
option family ipv4
|
||||
|
||||
# Allow IPv4 ping
|
||||
config rule
|
||||
option name Allow-Ping
|
||||
option src wan
|
||||
option proto icmp
|
||||
option icmp_type echo-request
|
||||
option family ipv4
|
||||
option target ACCEPT
|
||||
|
||||
config rule
|
||||
option name Allow-IGMP
|
||||
option src wan
|
||||
option proto igmp
|
||||
option family ipv4
|
||||
option target ACCEPT
|
||||
|
||||
# Allow DHCPv6 replies
|
||||
# see https://dev.openwrt.org/ticket/10381
|
||||
config rule
|
||||
option name Allow-DHCPv6
|
||||
option src wan
|
||||
option proto udp
|
||||
option src_ip fe80::/10
|
||||
option src_port 547
|
||||
option dest_ip fe80::/10
|
||||
option dest_port 546
|
||||
option family ipv6
|
||||
option target ACCEPT
|
||||
|
||||
config rule
|
||||
option name Allow-MLD
|
||||
option src wan
|
||||
option proto icmp
|
||||
option src_ip fe80::/10
|
||||
list icmp_type '130/0'
|
||||
list icmp_type '131/0'
|
||||
list icmp_type '132/0'
|
||||
list icmp_type '143/0'
|
||||
option family ipv6
|
||||
option target ACCEPT
|
||||
|
||||
# Allow essential incoming IPv6 ICMP traffic
|
||||
config rule
|
||||
option name Allow-ICMPv6-Input
|
||||
option src wan
|
||||
option proto icmp
|
||||
list icmp_type echo-request
|
||||
list icmp_type echo-reply
|
||||
list icmp_type destination-unreachable
|
||||
list icmp_type packet-too-big
|
||||
list icmp_type time-exceeded
|
||||
list icmp_type bad-header
|
||||
list icmp_type unknown-header-type
|
||||
list icmp_type router-solicitation
|
||||
list icmp_type neighbour-solicitation
|
||||
list icmp_type router-advertisement
|
||||
list icmp_type neighbour-advertisement
|
||||
option limit 1000/sec
|
||||
option family ipv6
|
||||
option target ACCEPT
|
||||
|
||||
# Allow essential forwarded IPv6 ICMP traffic
|
||||
config rule
|
||||
option name Allow-ICMPv6-Forward
|
||||
option src wan
|
||||
option dest *
|
||||
option proto icmp
|
||||
list icmp_type echo-request
|
||||
list icmp_type echo-reply
|
||||
list icmp_type destination-unreachable
|
||||
list icmp_type packet-too-big
|
||||
list icmp_type time-exceeded
|
||||
list icmp_type bad-header
|
||||
list icmp_type unknown-header-type
|
||||
option limit 1000/sec
|
||||
option family ipv6
|
||||
option target ACCEPT
|
||||
|
||||
# allow IPsec/ESP and ISAKMP passthrough
|
||||
config rule
|
||||
option src wan
|
||||
option dest lan
|
||||
option proto esp
|
||||
option target ACCEPT
|
||||
|
||||
config rule
|
||||
option src wan
|
||||
option dest lan
|
||||
option dest_port 500
|
||||
option proto udp
|
||||
option target ACCEPT
|
||||
|
||||
config dmz dmz
|
||||
option enabled '0'
|
||||
option exclude_ports '5060 7547'
|
||||
|
||||
# include a file with users custom iptables rules
|
||||
config include
|
||||
option path /etc/firewall.user
|
||||
option reload 1
|
||||
|
||||
# include a file with rules for prioritizing some specific packets
|
||||
config include
|
||||
option path /etc/firewall.qos
|
||||
option reload 1
|
||||
|
||||
# include a file with rules for DMZ Host
|
||||
config include dmzhost
|
||||
option path /etc/firewall.dmz
|
||||
option reload 1
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
config interface 'loopback'
|
||||
option ifname 'lo'
|
||||
option proto 'static'
|
||||
option ipaddr '127.0.0.1'
|
||||
option netmask '255.0.0.0'
|
||||
|
||||
config interface 'lan'
|
||||
option type 'bridge'
|
||||
option proto 'static'
|
||||
option is_lan '1'
|
||||
option ipaddr '192.168.1.1'
|
||||
option netmask '255.255.255.0'
|
||||
option ip6assign '60'
|
||||
option ifname 'eth0.1'
|
||||
|
||||
config device 'lan_dev'
|
||||
option name 'eth0.1'
|
||||
# Unused?
|
||||
#option macaddr '$MACLAN'
|
||||
option vid 1
|
||||
|
||||
config interface 'wan'
|
||||
option ifname 'eth0.2'
|
||||
option proto 'dhcp'
|
||||
#option hostname AUTO-CREATED AT FIRST BOOT
|
||||
#option vendorid AUTO-CREATED AT FIRST BOOT
|
||||
option reqopts '66 67 128 224'
|
||||
|
||||
config device 'wan_dev'
|
||||
option name 'eth0.2'
|
||||
# Unused?
|
||||
#option macaddr '$MACWAN'
|
||||
option vid 2
|
||||
|
||||
config interface 'wan6'
|
||||
option ifname '@wan'
|
||||
option proto 'dhcpv6'
|
||||
|
||||
config switch
|
||||
option name 'switch0'
|
||||
option reset '1'
|
||||
option enable_vlan '1'
|
||||
|
||||
config switch_vlan
|
||||
option device 'switch0'
|
||||
option vlan '1'
|
||||
option ports '1 6t'
|
||||
|
||||
config switch_vlan
|
||||
option device 'switch0'
|
||||
option vlan '2'
|
||||
option ports '0 6t'
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
config wifi-status 'status'
|
||||
option wlan '1'
|
||||
option sched_status '0'
|
||||
option schedule '0'
|
||||
|
||||
config bandsteering 'bandsteering'
|
||||
option enabled '0'
|
||||
option policy '0'
|
||||
|
||||
config wifi-device ra0
|
||||
option band b
|
||||
option channel auto
|
||||
option bandwidth '20'
|
||||
option hwmode auto
|
||||
option htmode HT20
|
||||
option country 'DE'
|
||||
option scantimer '60'
|
||||
|
||||
config wifi-iface
|
||||
option device ra0
|
||||
option network lan
|
||||
option mode ap
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps 1
|
||||
option ifname ra0
|
||||
|
||||
config wifi-device rai0
|
||||
option band a
|
||||
option channel auto
|
||||
option bandwidth '80'
|
||||
option hwmode 11ac
|
||||
option htmode VHT80
|
||||
option country 'DE'
|
||||
option beamforming 1
|
||||
option scantimer '60'
|
||||
|
||||
config wifi-iface
|
||||
option device rai0
|
||||
option network lan
|
||||
option mode ap
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps 1
|
||||
option ifname rai0
|
||||
|
||||
9
netmode/files/etc/netmodes/router/DETAILS
Normal file
9
netmode/files/etc/netmodes/router/DETAILS
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Router Mode" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "NAT is enabled." }
|
||||
],
|
||||
"reboot" : 0
|
||||
}
|
||||
94
netmode/files/etc/netmodes/router/scripts/pre/router_mode.sh
Normal file
94
netmode/files/etc/netmodes/router/scripts/pre/router_mode.sh
Normal file
@@ -0,0 +1,94 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
WANPORTS=""
|
||||
LANPORTS=""
|
||||
|
||||
get_vlan() {
|
||||
local device="$1"
|
||||
for section in $(uci show network | grep "=device" | cut -d '=' -f1); do
|
||||
if [ "$(uci -q get $section.ifname)" == "$device" ]; then
|
||||
uci -q get $section.name
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_wifi_devs()
|
||||
{
|
||||
|
||||
add_wdev()
|
||||
{
|
||||
local cfg=$1
|
||||
|
||||
config_get mode $cfg mode "ap"
|
||||
|
||||
if [ "$mode" == "ap" ]; then
|
||||
uci -q set wireless.$cfg.network="lan"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
config_foreach add_wdev "wifi-iface"
|
||||
|
||||
uci -q commit wireless
|
||||
}
|
||||
|
||||
add_xtm_devs() {
|
||||
local section device vlan
|
||||
|
||||
for section in $(uci show dsl | grep "=.*tm-device" | cut -d'=' -f1); do
|
||||
device="$(uci -q get $section.device)"
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
vlan="$(get_vlan $device)"
|
||||
[ -n "$vlan" ] && device="$vlan"
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
WANPORTS="$WANPORTS $device"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_eth_ports() {
|
||||
|
||||
add_port()
|
||||
{
|
||||
local cfg=$1
|
||||
local uplink ifname vlan
|
||||
|
||||
config_get ifname $cfg ifname
|
||||
config_get_bool uplink $cfg uplink 0
|
||||
|
||||
vlan="$(get_vlan $ifname)"
|
||||
[ -n "$vlan" ] && ifname="$vlan"
|
||||
|
||||
if [ $uplink -eq 1 ]; then
|
||||
WANPORTS="$WANPORTS $ifname"
|
||||
else
|
||||
LANPORTS="$LANPORTS $ifname"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load ports
|
||||
config_foreach add_port "ethport"
|
||||
}
|
||||
|
||||
add_xtm_devs
|
||||
add_eth_ports
|
||||
add_wifi_devs
|
||||
|
||||
WANPORTS="$(echo $WANPORTS | sed -e 's/[[:space:]]*$//')"
|
||||
LANPORTS="$(echo $LANPORTS | sed -e 's/[[:space:]]*$//')"
|
||||
|
||||
uci -q set network.wan.type="anywan"
|
||||
uci -q set network.wan.ifname="$WANPORTS"
|
||||
uci -q set network.wan6.ifname="@wan"
|
||||
uci -q set network.lan.type="bridge"
|
||||
uci -q set network.lan.ifname="$LANPORTS"
|
||||
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
|
||||
@@ -3,120 +3,10 @@
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
NMTMPDIR=/var/netmodes
|
||||
OLD_MODE_FILE=/var/netmodes/old_mode
|
||||
CONF_BACKUP_DIR=/var/netmodes/backup/
|
||||
SWITCHMODELOCK="/tmp/switching_mode"
|
||||
MODEDIR=$(uci -q get netmode.setup.dir)
|
||||
MTK=0
|
||||
|
||||
opkg list-installed | grep -q kmod-mt.*mtk && MTK=1
|
||||
|
||||
[ -n "$MODEDIR" ] || MODEDIR="/etc/netmodes"
|
||||
|
||||
toggle_firewall() {
|
||||
local section=$1
|
||||
local disable=$2
|
||||
config_get name "$1" name
|
||||
if [ "$name" == "wan" ]; then
|
||||
uci -q set firewall.settings.disabled=$disable
|
||||
if [ "$disable" == "1" ]; then
|
||||
uci -q set firewall.$section.input="ACCEPT"
|
||||
else
|
||||
uci -q set firewall.$section.input="REJECT"
|
||||
fi
|
||||
uci -q commit firewall
|
||||
fi
|
||||
}
|
||||
|
||||
disable_firewall() {
|
||||
config_load firewall
|
||||
config_foreach toggle_firewall zone $1
|
||||
/etc/init.d/firewall reload
|
||||
}
|
||||
|
||||
is_known_macaddr()
|
||||
{
|
||||
macaddr=$1
|
||||
|
||||
echo $macaddr | grep -i -e "^00:22:07" \
|
||||
-e "^02:22:07" \
|
||||
-e "^44:D4:37" \
|
||||
-e "^00:0C:07" \
|
||||
-e "^02:0C:07" \
|
||||
-e "^06:0C:07" \
|
||||
-e "^00:0C:43" \
|
||||
-e "^02:0C:43" \
|
||||
-e "^06:0C:43" \
|
||||
&& return
|
||||
false
|
||||
}
|
||||
|
||||
get_wifi_wet_interface() {
|
||||
local ifname=""
|
||||
handle_interface() {
|
||||
[ -n "$ifname" ] && return
|
||||
config_get mode "$1" mode
|
||||
if [ "$mode" == "sta" -o "$mode" == "wet" ]; then
|
||||
config_get ifname "$1" ifname
|
||||
fi
|
||||
}
|
||||
config_load wireless
|
||||
config_foreach handle_interface wifi-iface
|
||||
echo "$ifname"
|
||||
}
|
||||
|
||||
get_wifi_iface_cfgstr() {
|
||||
get_cfgno() {
|
||||
config_get ifname "$1" ifname
|
||||
[ "$ifname" == "$2" ] && echo "wireless.$1"
|
||||
}
|
||||
config_load wireless
|
||||
config_foreach get_cfgno wifi-iface $1
|
||||
}
|
||||
|
||||
correct_uplink() {
|
||||
local IFACE="$1"
|
||||
local WANDEV="$(db -q get hw.board.ethernetWanPort)"
|
||||
local WETIF="$(get_wifi_wet_interface)"
|
||||
local link wetcfg wetnet wetmac
|
||||
|
||||
[ $MTK -eq 1 ] || WANDEV="$WANDEV.1"
|
||||
|
||||
[ -n "$IFACE" -a "$IFACE" != "$WANDEV" -a "$IFACE" != "$WETIF" ] && return
|
||||
|
||||
link=$(cat /sys/class/net/${WANDEV:0:4}/operstate)
|
||||
[ $MTK -eq 1 ] && link=$(swconfig dev switch0 port 0 get link | awk '{print$2}' | cut -d':' -f2)
|
||||
|
||||
if [ ! -f /tmp/netmodes/uplink-macaddr-corrected ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $WETIF)"
|
||||
wetnet="$(uci -q get $wetcfg.network)"
|
||||
wetmac="$(ifconfig $WETIF | grep HWaddr | awk '{print$NF}')"
|
||||
ethwanmac="$(ifconfig $WANDEV | grep HWaddr | awk '{print$NF}')"
|
||||
if [ -d /sys/class/net/br-$wetnet ]; then
|
||||
if [ "$link" == "up" ]; then
|
||||
ifconfig br-$wetnet hw ether $ethwanmac
|
||||
else
|
||||
ifconfig br-$wetnet hw ether $wetmac
|
||||
fi
|
||||
#touch -f /tmp/netmodes/uplink-macaddr-corrected
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$link" == "up" ]; then
|
||||
ubus call network.device set_state "{\"name\":\"$WETIF\", \"defer\":true}"
|
||||
ifconfig $WETIF down
|
||||
echo ethernet > /tmp/netmodes/uplink_type
|
||||
ubus call network.device set_state "{\"name\":\"$WANDEV\", \"defer\":false}"
|
||||
else
|
||||
ubus call network.device set_state "{\"name\":\"$WETIF\", \"defer\":false}"
|
||||
ifconfig $WETIF up
|
||||
echo wireless > /tmp/netmodes/uplink_type
|
||||
ubus call network.device set_state "{\"name\":\"$WANDEV\", \"defer\":true}"
|
||||
ubus call led.internet set '{"state" : "notice"}'
|
||||
fi
|
||||
}
|
||||
|
||||
run_netmode_scripts() {
|
||||
local mode=$1
|
||||
local when=$2
|
||||
@@ -135,220 +25,42 @@ run_netmode_scripts() {
|
||||
}
|
||||
|
||||
switch_netmode() {
|
||||
local newmode="$1"
|
||||
|
||||
[ -f /etc/config/netmode -a -d $MODEDIR ] || return
|
||||
|
||||
[ -n "$newmode" ] && uci -q set netmode.setup.curmode="$newmode"
|
||||
|
||||
local curmode conf old_mode
|
||||
|
||||
# NETMODE CONFIG #
|
||||
config_load netmode
|
||||
config_get curmode setup curmode
|
||||
uci -q set netmode.setup.repeaterready="0"
|
||||
|
||||
# set default JUCI page to overview
|
||||
uci -q set juci.juci.homepage="overview"
|
||||
uci commit juci
|
||||
local enabled
|
||||
config_get_bool enabled setup enabled '0'
|
||||
[ $enabled -eq 0 ] && return
|
||||
|
||||
if [ "$curmode" == "repeater" ]; then
|
||||
if [ $MTK -eq 1 ]; then
|
||||
curmode="repeater_mtk_5g_up_dual_down"
|
||||
else
|
||||
curmode="repeater_brcm_2g_up_dual_down"
|
||||
fi
|
||||
uci set netmode.setup.curmode="$curmode"
|
||||
fi
|
||||
if [ "$curmode" == "routed" ]; then
|
||||
if [ $MTK -eq 1 ]; then
|
||||
curmode="routed_mtk"
|
||||
else
|
||||
curmode="routed_brcm"
|
||||
fi
|
||||
uci set netmode.setup.curmode="$curmode"
|
||||
fi
|
||||
uci commit netmode
|
||||
# end of NETMODE CONFIG #
|
||||
local mode
|
||||
config_get mode setup mode
|
||||
|
||||
old_mode="$(cat $OLD_MODE_FILE 2>/dev/null)"
|
||||
[ -d "/etc/netmodes/$mode" ] || return
|
||||
|
||||
# if curmode has not changed do not copy configs
|
||||
if [ "$curmode" == "$old_mode" ]; then
|
||||
/etc/init.d/environment reload
|
||||
return
|
||||
fi
|
||||
logger -s -p user.info -t "netmode" "Switching to $mode Mode" >/dev/console
|
||||
|
||||
echo $curmode >$OLD_MODE_FILE
|
||||
run_netmode_scripts $mode "pre"
|
||||
|
||||
[ -d "/etc/netmodes/$curmode" ] || return
|
||||
local reboot=$(uci -q get netmode.$mode.reboot)
|
||||
|
||||
run_netmode_scripts $curmode "pre"
|
||||
|
||||
# make backup of current config before switching
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
mkdir -p $CONF_BACKUP_DIR
|
||||
cp -af /etc/config/* $CONF_BACKUP_DIR
|
||||
|
||||
logger -s -p user.info -t "netmode" "Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
|
||||
for file in $(ls /etc/netmodes/$curmode/); do
|
||||
case "$file" in
|
||||
DETAILS|scripts) continue ;;
|
||||
esac
|
||||
cp /etc/netmodes/$curmode/$file /etc/config/
|
||||
done
|
||||
sync
|
||||
|
||||
#commit owsd to reload all init.d scripts dependent on its config
|
||||
ubus call uci commit '{"config":"owsd"}'
|
||||
|
||||
local reboot=$(uci -q get netmode.$curmode.reboot)
|
||||
|
||||
if [ "$reboot" != "0" ]; then
|
||||
run_netmode_scripts $curmode "post"
|
||||
if [ "$reboot" == "1" ]; then
|
||||
#run_netmode_scripts $mode "post"
|
||||
reboot &
|
||||
exit
|
||||
fi
|
||||
|
||||
/etc/init.d/environment reload
|
||||
case "$curmode" in
|
||||
repeater*)
|
||||
touch $SWITCHMODELOCK
|
||||
logger -s -p user.info -t "netmode" "Switching to $curmode mode" > /dev/console
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
[ -f /etc/init.d/macoffset ] && /etc/init.d/macoffset reload
|
||||
ubus call network reload
|
||||
wifi reload nodat
|
||||
ubus call router.network reload
|
||||
rm -f /tmp/netmodes/uplink-macaddr-corrected
|
||||
correct_uplink
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
rm -f $SWITCHMODELOCK
|
||||
;;
|
||||
*)
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
[ -f /etc/init.d/macoffset ] && /etc/init.d/macoffset reload
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
;;
|
||||
esac
|
||||
|
||||
run_netmode_scripts $curmode "post"
|
||||
}
|
||||
|
||||
revert_netmode() {
|
||||
local from="$1"
|
||||
local to="$2"
|
||||
local rready="$3"
|
||||
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
logger -s -p user.info -t "netmode" "Could not switch to '$from' mode; going back to '$to' mode" > /dev/console
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
uci -q set netmode.setup.curmode="$to"
|
||||
uci -q set netmode.setup.repeaterready="$rready"
|
||||
uci commit netmode
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
rm -rf $OLD_MODE_FILE
|
||||
|
||||
logger -s -p user.info -t "netmode" "Restarting network services" > /dev/console
|
||||
/etc/init.d/network restart
|
||||
ubus call router.network reload
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
}
|
||||
|
||||
wificontrol_takes_over() {
|
||||
local ret
|
||||
[ -f /sbin/wificontrol ] || return
|
||||
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
|
||||
if pidof wificontrol >/dev/null; then
|
||||
ret=0
|
||||
# let netmode-conf up to 20 seconds before switching mode
|
||||
for tm in 2 4 6 8; do
|
||||
if [ -f /tmp/wificontrol.txt ]; then
|
||||
ret=1
|
||||
break
|
||||
fi
|
||||
sleep $tm
|
||||
done
|
||||
# let netmode-conf take over
|
||||
[ $ret -eq 1 ] && return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_netmode_handler() {
|
||||
for tm in 2 4 6 8; do
|
||||
if [ ! -f $SWITCHMODELOCK ]; then
|
||||
break
|
||||
fi
|
||||
sleep $tm
|
||||
done
|
||||
}
|
||||
|
||||
netmode_get_ip_type() {
|
||||
[ -n "$(echo $1 | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)')" ] && {
|
||||
logger -t $0 "netmode_get_ip_type: ip $1 is private"
|
||||
echo "private"
|
||||
} || {
|
||||
logger -t $0 "netmode_get_ip_type: ip $1 is public"
|
||||
echo "public"
|
||||
}
|
||||
}
|
||||
|
||||
get_device_of() {
|
||||
local PORT_NAMES=$(db get hw.board.ethernetPortNames)
|
||||
local PORT_ORDER=$(db get hw.board.ethernetPortOrder)
|
||||
local cnt=1
|
||||
local idx=0
|
||||
|
||||
local pnum=$(echo $PORT_NAMES | wc -w)
|
||||
|
||||
if [ $pnum -le 2 ]; then
|
||||
PORT_NAMES=$(echo $PORT_NAMES | sed 's/LAN/LAN1/g')
|
||||
fi
|
||||
|
||||
# get index of interface name
|
||||
for i in $PORT_NAMES; do
|
||||
if [ "$i" == "$1" ]; then
|
||||
idx=$cnt
|
||||
fi
|
||||
cnt=$((cnt+1))
|
||||
done
|
||||
|
||||
# get port name from index
|
||||
cnt=1
|
||||
for i in $PORT_ORDER; do
|
||||
if [ "$cnt" == "$idx" ]; then
|
||||
echo $i
|
||||
fi
|
||||
cnt=$((cnt+1))
|
||||
done
|
||||
#run_netmode_scripts $mode "post"
|
||||
}
|
||||
|
||||
populate_netmodes() {
|
||||
[ -f /etc/config/netmode -a -d $MODEDIR ] || return
|
||||
local curmode
|
||||
|
||||
config_load netmode
|
||||
|
||||
config_get curmode setup curmode
|
||||
|
||||
mkdir -p $NMTMPDIR
|
||||
|
||||
if [ "$curmode" == "routed" ]; then
|
||||
if [ $MTK -eq 1 ]; then
|
||||
curmode="routed_mtk"
|
||||
else
|
||||
curmode="routed_brcm"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $curmode > $OLD_MODE_FILE
|
||||
local enabled
|
||||
config_get_bool enabled setup enabled '0'
|
||||
[ $enabled -eq 0 ] && return
|
||||
|
||||
delete_netmode() {
|
||||
uci delete netmode.$1
|
||||
@@ -357,41 +69,9 @@ populate_netmodes() {
|
||||
config_foreach delete_netmode netmode
|
||||
uci commit netmode
|
||||
|
||||
wan=$(get_device_of WAN)
|
||||
lan1=$(get_device_of LAN1)
|
||||
lan2=$(get_device_of LAN2)
|
||||
lan3=$(get_device_of LAN3)
|
||||
lan4=$(get_device_of LAN4)
|
||||
lan5=$(get_device_of LAN5)
|
||||
|
||||
for file in $(find $MODEDIR -type f); do
|
||||
conf="$(echo $file | cut -d'/' -f5)"
|
||||
if [ "$conf" == "layer2_interface_ethernet" ]; then
|
||||
grep -q "\$WAN" $file && sed -i "s/\$WAN/$wan/g" $file
|
||||
fi
|
||||
if [ "$conf" == "network" ]; then
|
||||
grep -q "\$WAN" $file && sed -i "s/\$WAN/$wan/g" $file
|
||||
grep -q "\$LAN1" $file && sed -i "s/\$LAN1/$lan1/g" $file
|
||||
grep -q "\$LAN2" $file && sed -i "s/\$LAN2/$lan2/g" $file
|
||||
grep -q "\$LAN3" $file && sed -i "s/\$LAN3/$lan3/g" $file
|
||||
grep -q "\$LAN4" $file && sed -i "s/\$LAN4/$lan4/g" $file
|
||||
|
||||
ifname="$(uci -q get $file.wan.ifname | sed 's/[ \t]*$//')"
|
||||
uci -q set $file.wan.ifname="$ifname"
|
||||
uci -q commit $file
|
||||
fi
|
||||
done
|
||||
|
||||
local hardware=$(db get hw.board.model_name)
|
||||
local hardware=$(db -q get hw.board.model_name)
|
||||
local keys lang desc exp exclude support
|
||||
for mode in $(ls $MODEDIR); do
|
||||
|
||||
case "$mode" in
|
||||
repeater*)
|
||||
wlctl -i wl1 ap >/dev/null 2>&1 || ifconfig rai0 2>/dev/null | grep -q rai0 || continue
|
||||
;;
|
||||
esac
|
||||
|
||||
lang=""
|
||||
desc=""
|
||||
exp=""
|
||||
@@ -432,18 +112,6 @@ populate_netmodes() {
|
||||
}
|
||||
fi
|
||||
|
||||
if json_select acl; then
|
||||
_i=1
|
||||
while json_get_var user $_i; do
|
||||
uci del_list netmode.$mode._access_r="$user"
|
||||
uci del_list netmode.$mode._access_w="$user"
|
||||
uci add_list netmode.$mode._access_r="$user"
|
||||
uci add_list netmode.$mode._access_w="$user"
|
||||
_i=$((_i+1))
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
json_select description
|
||||
json_get_keys keys
|
||||
for k in $keys; do
|
||||
@@ -478,43 +146,5 @@ populate_netmodes() {
|
||||
uci -q set netmode.$mode.reboot="$reboot"
|
||||
done
|
||||
|
||||
config_get curmode setup curmode
|
||||
[ -d /etc/netmodes/$curmode ] || {
|
||||
[ $MTK -eq 1 ] && uci -q set netmode.setup.curmode="routed_mtk" || uci -q set netmode.setup.curmode="routed_brcm"
|
||||
}
|
||||
|
||||
uci commit netmode
|
||||
}
|
||||
|
||||
start_netmode_tools() {
|
||||
local curmode repeaterready wificontrol discover
|
||||
|
||||
killall -9 wificontrol >/dev/null 2>&1
|
||||
killall -9 netmode-discover >/dev/null 2>&1
|
||||
|
||||
config_load netmode
|
||||
config_get_bool repeaterready setup repeaterready 0
|
||||
config_get_bool wificontrol tools wificontrol 1
|
||||
config_get_bool arp_discovery tools arp_discovery 1
|
||||
|
||||
[ $repeaterready -eq 1 ] && {
|
||||
[ $arp_discovery -eq 1 ] && /sbin/netmode-discover &
|
||||
[ $wificontrol -eq 1 ] && /sbin/wificontrol --repeater &
|
||||
return
|
||||
}
|
||||
|
||||
config_get curmode setup curmode
|
||||
|
||||
case "$curmode" in
|
||||
repeater*)
|
||||
[ $arp_discovery -eq 1 ] && /sbin/netmode-discover &
|
||||
[ $wificontrol -eq 1 ] && /sbin/wificontrol --repeater &
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
stop_netmode_tools() {
|
||||
killall -9 netmode-discover >/dev/null 2>&1
|
||||
killall -9 wificontrol >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# receive new client events
|
||||
# and trigger wificontrol in --router mode for that client
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
action=
|
||||
ipaddr=
|
||||
macaddr=
|
||||
network=
|
||||
|
||||
timed_check() {
|
||||
while true; do
|
||||
network=${network:-lan}
|
||||
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}'
|
||||
wificontrol --router
|
||||
sleep $1
|
||||
done
|
||||
}
|
||||
|
||||
is_known_macaddr()
|
||||
{
|
||||
macaddr=$1
|
||||
|
||||
echo $macaddr | grep -i -e "^00:22:07" \
|
||||
-e "^02:22:07" \
|
||||
-e "^44:D4:37" \
|
||||
-e "^00:0C:07" \
|
||||
-e "^02:0C:07" \
|
||||
-e "^06:0C:07" \
|
||||
-e "^00:0C:43" \
|
||||
-e "^02:0C:43" \
|
||||
-e "^06:0C:43" \
|
||||
&& return
|
||||
false
|
||||
}
|
||||
|
||||
timed_check 60 &
|
||||
|
||||
while true ; do
|
||||
ubus listen client | \
|
||||
while read event ; do
|
||||
#echo "netmode-client-detect got event: $event" >/dev/console
|
||||
json_load "$event"
|
||||
json_select client
|
||||
json_get_var action action
|
||||
[ "$action" == "connect" ] || continue
|
||||
json_get_var macaddr macaddr
|
||||
json_get_var ipaddr ipaddr
|
||||
json_get_var network network "lan"
|
||||
|
||||
if is_known_macaddr $macaddr; then
|
||||
logger -s -p user.info -t $0 "netmode-client-detect: a new known device detected on '$network' network (MACAddr:$macaddr IPAddr:$ipaddr)" >/dev/console
|
||||
ubus call repeater get_creds '{"network":"'$network'","file":"/tmp/wificontrol.txt"}'
|
||||
/sbin/wificontrol --router --destination $ipaddr
|
||||
fi
|
||||
done
|
||||
done
|
||||
@@ -1,308 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/netmode.sh
|
||||
|
||||
state="exit"
|
||||
TMPPATH="/tmp/netmode_config_backup"
|
||||
CURMODE=""
|
||||
SLEEPTIME=300
|
||||
pid_file=/tmp/netmode-conf.pid
|
||||
|
||||
echo "$$" >$pid_file
|
||||
|
||||
cleanup(){
|
||||
rm -rf $pid_file
|
||||
# we need to trigger a reload of icwmp but ONLY if ip or device has changed
|
||||
[ -f "/etc/hotplug.d/iface/90-icwmp" ] && INTERFACE=wan ACTION=ifup sh /etc/hotplug.d/iface/90-icwmp
|
||||
exit
|
||||
}
|
||||
|
||||
trap cleanup SIGHUP SIGINT SIGTERM SIGSTOP
|
||||
|
||||
set_wireless_values() {
|
||||
local iface_num="$1"
|
||||
local ssid="$2"
|
||||
local key="$3"
|
||||
local encryption="$4"
|
||||
local device="$5"
|
||||
local old_ssid old_key old_encryption
|
||||
if ! uci -q get wireless.@wifi-iface[$iface_num] >/dev/null 2>&1; then
|
||||
state="reload"
|
||||
uci add wireless wifi-iface >/dev/null 2>&1
|
||||
uci set wireless.@wifi-iface[$iface_num].device="$device"
|
||||
fi
|
||||
local network="$(uci -q get wireless.@wifi-iface[$iface_num].network)"
|
||||
old_ssid="$(uci -q get wireless.@wifi-iface[$iface_num].ssid)"
|
||||
old_key="$(uci -q get wireless.@wifi-iface[$iface_num].key)"
|
||||
old_encryption="$(uci -q get wireless.@wifi-iface[$iface_num].encryption)"
|
||||
if [ "$old_ssid" != "$ssid" -o "$old_encryption" != "$encryption" -o "$old_key" != "$key" -o -z "$network" ]; then
|
||||
#TODO: get network dynamicaly
|
||||
[ "$state" == "exit" ] && state="apply"
|
||||
[ -z "$network" ] && network="wan"
|
||||
uci set wireless.@wifi-iface[$iface_num].network="$network"
|
||||
uci set wireless.@wifi-iface[$iface_num].ssid="$ssid"
|
||||
uci set wireless.@wifi-iface[$iface_num].key="$key"
|
||||
uci set wireless.@wifi-iface[$iface_num].encryption="$encryption"
|
||||
fi
|
||||
}
|
||||
|
||||
get_wifi_device_from_band(){
|
||||
local section="$1"
|
||||
local band="$2"
|
||||
local __ret="$3"
|
||||
local b
|
||||
config_get b $section "band"
|
||||
if [ "$band" == "$b" ]; then
|
||||
eval "export -- \"$__ret=$section\""
|
||||
fi
|
||||
}
|
||||
|
||||
get_device(){
|
||||
local band="$1"
|
||||
config_foreach get_wifi_device_from_band "wifi-device" "$band" "$2"
|
||||
}
|
||||
|
||||
get_iface_num() {
|
||||
local device="$1"
|
||||
local prev="$2"
|
||||
local __save="$3"
|
||||
local i=0
|
||||
local dev
|
||||
while true; do
|
||||
[ $i -gt 100 ] && break ## just a safty messure
|
||||
if ! uci -q get wireless.@wifi-iface[$i] >/dev/null; then
|
||||
break
|
||||
fi
|
||||
mode="$(uci -q get wireless.@wifi-iface[$i].mode)"
|
||||
if [ "$mode" == "wet" -o "$mode" == "sta" ]; then
|
||||
i=$((i+1))
|
||||
continue
|
||||
fi
|
||||
dev="$(uci -q get wireless.@wifi-iface[$i].device)"
|
||||
if [ "$dev" != "$device" ]; then
|
||||
[ -z "$dev" ] && break
|
||||
i=$((i+1))
|
||||
elif [ $prev -ne 0 ]; then
|
||||
i=$((i+1))
|
||||
prev=$((prev-1))
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
eval "export -- \"$__save=$i\""
|
||||
}
|
||||
|
||||
restore() {
|
||||
if [ "$1" == "back" ]; then
|
||||
uci set juci.juci.homepage='netmode-wizard'
|
||||
uci commit juci
|
||||
cp $TMPPATH/* /etc/config/
|
||||
sync
|
||||
uci set netmode.setup.curmode=$CURMODE
|
||||
uci commit netmode
|
||||
ubus call network reload
|
||||
wifi reload
|
||||
ubus call router.network reload
|
||||
fi
|
||||
rm -r $TMPPATH
|
||||
ubus call leds set '{"state":"normal"}'
|
||||
}
|
||||
|
||||
backup() {
|
||||
mkdir -p $TMPPATH
|
||||
cp /etc/config/* $TMPPATH/
|
||||
CURMODE="$(uci -q get netmode.setup.curmode)"
|
||||
ubus call leds set '{"state":"allflash"}'
|
||||
}
|
||||
|
||||
###### START HERE #######
|
||||
|
||||
file="$1"
|
||||
from_gui="$2"
|
||||
|
||||
[ -f "$file" ] || cleanup
|
||||
|
||||
# let netmode-handler up to 20 seconds to finish switching mode
|
||||
wait_for_netmode_handler
|
||||
|
||||
[ "$from_gui" == "true" ] && backup
|
||||
|
||||
json_load "`cat $file`"
|
||||
json_select "wifi_ifaces"
|
||||
|
||||
curmode=""
|
||||
repmode=""
|
||||
config_load netmode
|
||||
config_get curmode setup curmode
|
||||
|
||||
case $curmode in
|
||||
*repeater*)
|
||||
;;
|
||||
*)
|
||||
uci set netmode.setup.curmode="repeater"
|
||||
uci commit netmode
|
||||
/etc/init.d/netmode reload
|
||||
curmode="$(uci -q get netmode.setup.curmode)"
|
||||
;;
|
||||
esac
|
||||
|
||||
apcliband="a"
|
||||
case $curmode in
|
||||
*_2g_*) apcliband="b";;
|
||||
esac
|
||||
|
||||
i=1
|
||||
|
||||
dummy=
|
||||
band=
|
||||
ssid=
|
||||
key=
|
||||
encryption=
|
||||
device=
|
||||
iface_num=
|
||||
|
||||
while json_get_var dummy $i; do
|
||||
json_select $i
|
||||
json_get_var band band
|
||||
[ "$band" == "" -o "$apcliband" == "$band" ] && break
|
||||
json_select ..
|
||||
i=$((i+1))
|
||||
done
|
||||
|
||||
[ "$apcliband" == "$band" -o "$band" == "" ] || {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
cleanup
|
||||
}
|
||||
|
||||
repeater_iface_num=$(uci -q show wireless | grep -e ".mode='wet'" -e ".mode='sta'" | sed 's/.*\[\([0-9]\)\].*/\1/')
|
||||
|
||||
[ -z "$repeater_iface_num" ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
cleanup
|
||||
}
|
||||
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
json_get_var encryption encryption
|
||||
|
||||
set_wireless_values "$repeater_iface_num" "$ssid" "$key" "$encryption"
|
||||
|
||||
json_load "`cat $file`"
|
||||
json_select "wifi_ifaces"
|
||||
|
||||
config_load wireless
|
||||
b_num=0
|
||||
a_num=0
|
||||
|
||||
i=1
|
||||
while json_get_var dummy $i; do
|
||||
json_select $i
|
||||
json_get_var band band
|
||||
json_get_var ssid ssid
|
||||
json_get_var encryption encryption
|
||||
json_get_var key key
|
||||
if [ "$band" == "" ]; then
|
||||
get_device "a" device
|
||||
get_iface_num "$device" "$a_num" iface_num
|
||||
a_num=$((a_num+1))
|
||||
[ -z $iface_num ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
cleanup
|
||||
}
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
|
||||
get_device "b" device
|
||||
get_iface_num "$device" "$b_num" iface_num
|
||||
b_num=$((b_num+1))
|
||||
[ -z $iface_num ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
cleanup
|
||||
}
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
|
||||
else
|
||||
get_device "$band" device
|
||||
case $band in
|
||||
a)
|
||||
get_iface_num "$device" "$a_num" iface_num
|
||||
a_num=$((a_num+1))
|
||||
;;
|
||||
b)
|
||||
get_iface_num "$device" "$b_num" iface_num
|
||||
b_num=$((b_num+1))
|
||||
;;
|
||||
esac
|
||||
[ -z $iface_num ] && {
|
||||
[ "$from_gui" == "true" ] && restore "back"
|
||||
cleanup
|
||||
}
|
||||
set_wireless_values "$iface_num" "$ssid" "$key" "$encryption" "$device"
|
||||
fi
|
||||
i=$((i+1))
|
||||
json_select ..
|
||||
done
|
||||
|
||||
i=$((b_num + a_num + 1))
|
||||
|
||||
if [ $repeater_iface_num -gt $i ]; then
|
||||
i=$((i-1))
|
||||
fi
|
||||
|
||||
while uci -q get wireless.@wifi-iface[$i] >/dev/null; do
|
||||
# if repeater_iface_num is greater than the number of
|
||||
# configured downlink we need to make sure its not deleted
|
||||
local mode="$(uci -q get wireless.@wifi-iface[$i].mode)"
|
||||
if [ "$mode" == "wet" -o "$mode" == "sta" ]; then
|
||||
i=$((i+1))
|
||||
continue
|
||||
fi
|
||||
state="reload"
|
||||
uci -q delete wireless.@wifi-iface[$i] >/dev/null
|
||||
# do not increment i. The next interface will now
|
||||
# have the same index as the deleted interface
|
||||
done
|
||||
|
||||
uci commit wireless
|
||||
|
||||
if [ "$from_gui" == "true" ]; then
|
||||
# check for connectivity
|
||||
wifi reload
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
correct_uplink
|
||||
i=$SLEEPTIME
|
||||
|
||||
while [ $i -gt 0 ]; do
|
||||
ip=`route -n | awk '/^0.0.0.0/{print $2}'`
|
||||
if [ "$ip" == "" ]; then
|
||||
i=$((i-10))
|
||||
sleep 10
|
||||
continue
|
||||
fi
|
||||
ping -w1 $ip
|
||||
if [ $? -eq 0 ]; then
|
||||
restore
|
||||
cleanup
|
||||
else
|
||||
i=$((i-10))
|
||||
sleep 9
|
||||
fi
|
||||
done
|
||||
restore "back"
|
||||
else
|
||||
if [ "$state" == "exit" ]; then
|
||||
cleanup
|
||||
fi
|
||||
ubus call leds set '{"state":"allflash"}'
|
||||
if [ "$state" == "apply" ]; then
|
||||
# wifi apply
|
||||
wifi reload
|
||||
else
|
||||
# wifi reload
|
||||
wifi reload
|
||||
fi
|
||||
[ -f /etc/init.d/layer2 ] && /etc/init.d/layer2 reload
|
||||
correct_uplink
|
||||
ubus call leds set '{"state":"normal"}'
|
||||
fi
|
||||
|
||||
cleanup
|
||||
@@ -1,47 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
mask_to_cidr() {
|
||||
nbits=0
|
||||
IFS=.
|
||||
for dec in $1 ; do
|
||||
case $dec in
|
||||
255) let nbits+=8;;
|
||||
254) let nbits+=7;;
|
||||
252) let nbits+=6;;
|
||||
248) let nbits+=5;;
|
||||
240) let nbits+=4;;
|
||||
224) let nbits+=3;;
|
||||
192) let nbits+=2;;
|
||||
128) let nbits+=1;;
|
||||
0);;
|
||||
*) echo "Error: $dec is not recognised"; exit 1
|
||||
esac
|
||||
done
|
||||
echo "$nbits"
|
||||
}
|
||||
|
||||
while true; do
|
||||
[ -e /sys/class/net/br-wan ] || {
|
||||
sleep 5
|
||||
continue
|
||||
}
|
||||
|
||||
unlisted=0
|
||||
|
||||
ps | grep wifi | grep -q reload || {
|
||||
for mac in $(brctl showmacs br-wan 2>/dev/null | tail -n +2 | grep no | awk '{print$2}'); do
|
||||
grep -q "$mac" /proc/net/arp || unlisted=$((unlisted+1))
|
||||
done
|
||||
|
||||
ipaddr=$(ifconfig br-wan | grep -v inet6 | grep inet | tr ':' ' ' | awk '{print$3}')
|
||||
netmask=$(ifconfig br-wan | grep -v inet6 | grep inet | tr ':' ' ' | awk '{print$7}')
|
||||
mask=$(mask_to_cidr $netmask)
|
||||
}
|
||||
|
||||
if [ $unlisted -gt 0 -a -n "$ipaddr" -a -n "$netmask" -a $mask -ge 24 ]; then
|
||||
fping -c 1 -t 1000 -g $ipaddr/$mask -q >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
sleep 30
|
||||
done
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
netmode-conf "$1" "$2" &
|
||||
@@ -1,157 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/network/utils.sh
|
||||
|
||||
NETCON=0
|
||||
TVCON=0
|
||||
WANIP=0
|
||||
LASTSTATUS=""
|
||||
CURSTATUS=""
|
||||
ETHWAN="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
SLEEP_TIME=30
|
||||
enableCounter=0
|
||||
AccessPolicy=0
|
||||
|
||||
get_wifi_iface_cfgstr() {
|
||||
get_cfgno() {
|
||||
config_get ifname "$1" ifname
|
||||
[ "$ifname" == "$2" ] && echo "wireless.$1"
|
||||
}
|
||||
config_load wireless
|
||||
config_foreach get_cfgno wifi-iface $1
|
||||
}
|
||||
|
||||
ping_uplink()
|
||||
{
|
||||
local hasip hasdev hasmode
|
||||
local ipaddr=""
|
||||
local device=""
|
||||
local rready=""
|
||||
local wetif=""
|
||||
local assoclist=""
|
||||
local rv=0
|
||||
|
||||
[ -f /tmp/wps_client_mode_active ] && {
|
||||
ubus call led.internet set '{"state" : "off"}'
|
||||
return
|
||||
}
|
||||
|
||||
ipaddr="$(ip r | grep default | awk '{print$3}')"
|
||||
[ -n "$ipaddr" ] && hasip=1 || hasip=0
|
||||
|
||||
device="$(ip r | grep default | awk '{print$5}')"
|
||||
[ -n "$device" ] && hasdev=1 || hasdev=0
|
||||
|
||||
rready="$(uci -q get netmode.setup.repeaterready)"
|
||||
[ "$rready" == "1" ] && hasmode=0 || hasmode=1
|
||||
|
||||
if [ "$hasmode" == "1" ] && [ "$hasip" == "0" -o "$hasdev" == "0" ]; then
|
||||
rv=0
|
||||
elif [ "$hasmode" == "1" ]; then
|
||||
arping -f -q -c1 -w3 -I $device $ipaddr
|
||||
[ $? -eq 1 ] && rv=0 || rv=1
|
||||
|
||||
if [ "$rv" == "0" ]; then
|
||||
ping -c2 -w5 $ipaddr >/dev/null
|
||||
[ $? -eq 1 ] && rv=0 || rv=1
|
||||
fi
|
||||
else
|
||||
SLEEP_TIME=5
|
||||
ubus call led.internet set '{"state" : "off"}'
|
||||
return
|
||||
fi
|
||||
|
||||
if [ $rv -eq 0 ]; then
|
||||
echo "{ \"online\" : false }" > /tmp/internet_connection_status
|
||||
|
||||
SLEEP_TIME=10
|
||||
|
||||
wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
# If there is an uplink IP address but no connection for 5 minutes, reboot
|
||||
if [ $enableCounter -gt 32 ]; then
|
||||
logger -s -p user.info -t "testnet" "No uplink connection; reboot" >/dev/console
|
||||
ubus call led.internet set '{"state" : "error"}'
|
||||
reboot &
|
||||
elif [ $((enableCounter % 8)) -eq 0 -a $enableCounter -ge 8 -o $enableCounter -eq 0 ]; then
|
||||
ps | grep -v grep | grep -q 'wifi reload\|wifi import\|wifi.credentials\|iwpriv' && return
|
||||
|
||||
logger -s -p user.info -t "testnet" "No uplink connection; try to re-connect" >/dev/console
|
||||
|
||||
if [ -f /usr/sbin/wlctl ]; then
|
||||
assoclist="$(wlctl -i $wetif assoclist | head -1 | awk '{print$2}')"
|
||||
wlctl -i $wetif reassoc $assoclsit
|
||||
elif [ -f /usr/sbin/iwpriv ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
wetssid="$(uci -q get $wetcfg.ssid)"
|
||||
wetkey="$(uci -q get $wetcfg.key)"
|
||||
if [ -n "$wetkey" ]; then
|
||||
wetauth="WPA2PSK"
|
||||
wetenc="AES"
|
||||
else
|
||||
wetauth="OPEN"
|
||||
wetenc="NONE"
|
||||
fi
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set ApCliSsid="$wetssid"
|
||||
iwpriv $wetif set ApCliAuthMode="$wetauth"
|
||||
iwpriv $wetif set ApCliEncrypType="$wetenc"
|
||||
iwpriv $wetif set ApCliWPAPSK="$wetkey"
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set ApCliAutoConnect=1
|
||||
fi
|
||||
ubus call led.internet set '{"state" : "notice"}'
|
||||
# touch /tmp/netmodes/repeater_trying_to_connect
|
||||
# else
|
||||
# if [ -f /tmp/netmodes/repeater_trying_to_connect ]; then
|
||||
# rm -f /tmp/netmodes/repeater_trying_to_connect
|
||||
# else
|
||||
# ubus call led.internet set '{"state" : "error"}'
|
||||
# fi
|
||||
fi
|
||||
|
||||
enableCounter=$((enableCounter+1))
|
||||
|
||||
if [ $AccessPolicy -eq 1 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
AccessPolicy=1
|
||||
if [ -f /usr/sbin/iwpriv ]; then
|
||||
grep -q up /sys/class/net/$ETHWAN/operstate 2>/dev/null || {
|
||||
logger -s -p user.info -t "testnet" "Disconnect all stations and disable WiFi access on downlink wireless interfaces" >/dev/console
|
||||
# Do not allow clients to connect on 2.4GHz radio
|
||||
iwpriv ra0 set AccessPolicy=$AccessPolicy
|
||||
# Do not allow clients to connect on 5GHz radio
|
||||
iwpriv rai0 set AccessPolicy=$AccessPolicy
|
||||
# Disconnect clients on 2.4GHz radio
|
||||
iwpriv ra0 set DisConnectAllSta=2
|
||||
# Disconnect clients on 5GHz radio
|
||||
iwpriv rai0 set DisConnectAllSta=2
|
||||
}
|
||||
fi
|
||||
else
|
||||
grep -q "true" /tmp/internet_connection_status 2>/dev/null || logger -s -p user.info -t "testnet" "Uplink connection is gained" >/dev/console
|
||||
echo "{ \"online\" : true }" > /tmp/internet_connection_status
|
||||
leden="$(uci -q get leds.internet.enable)"
|
||||
[ "$leden" == "1" ] && ubus call led.internet set '{"state" : "eok"}'
|
||||
|
||||
SLEEP_TIME=5
|
||||
|
||||
enableCounter=0
|
||||
if [ $AccessPolicy -eq 0 ]; then
|
||||
return
|
||||
fi
|
||||
# Uplink working, allow clients to connect
|
||||
AccessPolicy=0
|
||||
|
||||
if [ -f /usr/sbin/iwpriv ]; then
|
||||
logger -s -p user.info -t "testnet" "Enable WiFi access on downlink wireless interfaces" >/dev/console
|
||||
iwpriv ra0 set AccessPolicy=$AccessPolicy
|
||||
iwpriv rai0 set AccessPolicy=$AccessPolicy
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
test_connection() {
|
||||
local addr="$1"
|
||||
@@ -166,31 +23,25 @@ test_connection() {
|
||||
for nmsrv in $(grep nameserver /var/resolv.conf.auto | awk '{print$2}'); do
|
||||
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
|
||||
done
|
||||
elif [ -n "$def6route" ] && [ -n "$ping6dev" ]; then
|
||||
elif [ -n "$def6route" -a -n "$ping6dev" ]; then
|
||||
ndisc6 -w 5 -1 $def6route $ping6dev >/dev/null 2>&1 && return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
wan_have_ip() {
|
||||
[ -d /sys/class/net/$ETHWAN ] || return
|
||||
ubus list led.wan >/dev/null 2>&1 || return
|
||||
|
||||
local addr=$(ip a show dev $ETHWAN | grep "inet "| awk '{print $2}')
|
||||
|
||||
if [ -n "$addr" ]; then
|
||||
WANIP=1
|
||||
ubus call led.wan set '{"state" : "ok"}'
|
||||
uplink_test() {
|
||||
uplink_phy_connected
|
||||
if [ $? -eq 0 ]; then
|
||||
ubus call led.wan set '{"state" : "ok"}' || ubus call led.broadband set '{"state" : "ok"}'
|
||||
else
|
||||
WANIP=0
|
||||
ubus call led.wan set '{"state" : "off"}' || ubus call led.broadband set '{"state" : "off"}'
|
||||
fi
|
||||
# don't set wan here status is set from hotplug, only set when ip is detected.
|
||||
}
|
||||
|
||||
internet_test() {
|
||||
local link dest
|
||||
|
||||
dest="$(uci -q get system.@system[0].netping_addr)"
|
||||
dest="$(uci -q get diagnostics.@connectivity[0].destination)"
|
||||
|
||||
test_connection $dest
|
||||
|
||||
@@ -205,41 +56,8 @@ internet_test() {
|
||||
fi
|
||||
}
|
||||
|
||||
iptv_test() {
|
||||
local dest="$(uci -q get system.@system[0].tvping_addr)"
|
||||
|
||||
[ -n "$dest" ] || return
|
||||
|
||||
ubus list led.ext >/dev/null 2>&1 || return
|
||||
|
||||
test_connection $dest
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
TVCON=1
|
||||
ubus call led.ext set '{"state" : "ok"}'
|
||||
else
|
||||
TVCON=0
|
||||
ubus call led.ext set '{"state" : "off"}'
|
||||
fi
|
||||
}
|
||||
|
||||
netmode_check() {
|
||||
local curmode="$(uci -q get netmode.setup.curmode)"
|
||||
local uplinkband="$(uci -q get netmode.$curmode.uplink_band)"
|
||||
local rready="$(uci -q get netmode.setup.repeaterready)"
|
||||
|
||||
[ "$rready" == "1" ] && uplinkband="a"
|
||||
|
||||
echo "$uplinkband"
|
||||
}
|
||||
|
||||
connectivity_test() {
|
||||
if [ "$(netmode_check)" != "" ]; then
|
||||
ping_uplink
|
||||
return
|
||||
fi
|
||||
|
||||
SLEEP_TIME=30
|
||||
uplink_test
|
||||
|
||||
internet_test
|
||||
|
||||
@@ -252,8 +70,6 @@ connectivity_test() {
|
||||
[ "$CURSTATUS" == "$LASTSTATUS" ] || ubus send internet '{"status" : "offline"}'
|
||||
LASTSTATUS=0
|
||||
fi
|
||||
|
||||
iptv_test
|
||||
}
|
||||
|
||||
if [ "$1" == "once" ]; then
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
WIFISTA=0
|
||||
STACONF="/etc/Wireless/iNIC/iNIC_ap.dat"
|
||||
[ -f $STACONF ] && WIFISTA=1
|
||||
|
||||
get_if_creds() {
|
||||
local section=$1
|
||||
local network=$2
|
||||
local net dev ssid key encryption band
|
||||
config_get net $section "network" "lan"
|
||||
if [ "$net" == "$network" ]; then
|
||||
config_get dev $section "device"
|
||||
band="$(uci -q get wireless.$dev.band)"
|
||||
config_get ssid $section ssid
|
||||
config_get key $section key
|
||||
config_get encryption $section encryption
|
||||
config_get disabled $section disabled 0
|
||||
[ $disabled -eq 1 ] && return
|
||||
[ "$ssid" == "" -o "$band" == "" ] && return
|
||||
json_add_object
|
||||
json_add_string "ssid" "$ssid"
|
||||
json_add_string "band" "$band"
|
||||
json_add_string "key" "$key"
|
||||
json_add_string "encryption" "$encryption"
|
||||
json_close_object
|
||||
fi
|
||||
}
|
||||
|
||||
validate_file() {
|
||||
local file="$1"
|
||||
local real="$(readlink -f `dirname $file`)"
|
||||
real="${real}/`basename $file`"
|
||||
case "$real" in
|
||||
/tmp/*)
|
||||
touch $real && return 0 || return 1
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
write_error(){
|
||||
json_init
|
||||
json_add_string "status" "error: $1"
|
||||
json_dump
|
||||
exit 1
|
||||
}
|
||||
|
||||
duplicate_if_single_radio() {
|
||||
json_select "wifi-ifaces"
|
||||
local i=1
|
||||
local dummy band dup_band num_radios
|
||||
|
||||
num_radios="$(uci -q show wireless | grep wifi-device | wc -l)"
|
||||
|
||||
[ "$num_radios" == "2" ] && return
|
||||
|
||||
band="$(uci -q get wireless.@wifi-device[0].band)"
|
||||
|
||||
[ "$band" == "a" ] && dup_band="b"
|
||||
[ "$band" == "b" ] && dup_band="a"
|
||||
[ -z "$dup_band" ] && return
|
||||
|
||||
|
||||
while json_get_var dummy $i; do
|
||||
i=$((i+1))
|
||||
done
|
||||
i=$((i-1))
|
||||
local ssid key encryption
|
||||
while [ $i -gt 0 ]; do
|
||||
json_select $i
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
json_get_var encryption encryption
|
||||
json_select ..
|
||||
json_add_object
|
||||
json_add_string "ssid" "$ssid"
|
||||
json_add_string "band" "$dup_band"
|
||||
json_add_string "key" "$key"
|
||||
json_add_string "encryption" "$encryption"
|
||||
json_close_object
|
||||
i=$((i-1))
|
||||
done
|
||||
}
|
||||
|
||||
get_wifi_iface_cfgstr() {
|
||||
get_cfgno() {
|
||||
config_get ifname "$1" ifname
|
||||
[ "$ifname" == "$2" ] && echo "wireless.$1"
|
||||
}
|
||||
config_load wireless
|
||||
config_foreach get_cfgno wifi-iface $1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
if [ $WIFISTA -eq 1 ]; then
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" }, "connect": { "ssid": "str", "key": "str" }, "forget_network": {}, "wps_enroll": {}, "wps_stop": {} }'
|
||||
else
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
fi
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
get_creds)
|
||||
#TODO: if not routed exit
|
||||
local curmode="$(uci -q get netmode.setup.curmode)"
|
||||
case $curmode in
|
||||
*repeater*) write_error "not in repeater mode";;
|
||||
esac
|
||||
local network file input
|
||||
read input
|
||||
json_load $input
|
||||
json_get_var network network
|
||||
json_get_var file file
|
||||
|
||||
json_init
|
||||
json_add_array "wifi-ifaces"
|
||||
config_load wireless
|
||||
config_foreach get_if_creds "wifi-iface" "$network"
|
||||
json_close_array
|
||||
|
||||
duplicate_if_single_radio
|
||||
|
||||
if [ "$file" == "" ]; then
|
||||
json_dump
|
||||
else
|
||||
validate_file $file && json_dump -i >$file || write_error "invalid filename (\"$file\"), file must be in /tmp/ and in an existing directory"
|
||||
fi
|
||||
json_init
|
||||
json_add_string "status" success
|
||||
json_dump
|
||||
;;
|
||||
set_creds)
|
||||
local file from_gui
|
||||
read input
|
||||
json_load "$input"
|
||||
json_get_var file file
|
||||
json_get_var from_gui from_gui
|
||||
validate_file "$file" || write_error "invalid filename (\"$file\"), file must be in /tmp and exist"
|
||||
json_load "`cat $file`" || write_error "invalid file content"
|
||||
json_select "wifi_ifaces" || write_error "invalid file content"
|
||||
|
||||
start-netmode-conf "$file" "$from_gui" >/dev/null 2>/dev/null
|
||||
|
||||
json_init
|
||||
json_add_string "status" success
|
||||
json_dump
|
||||
|
||||
;;
|
||||
connect)
|
||||
local ssid key enc auth wetif wetcfg wetssid wetkey code
|
||||
read input
|
||||
json_load "$input"
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
wetssid="$(uci -q get $wetcfg.ssid)"
|
||||
wetkey="$(uci -q get $wetcfg.key)"
|
||||
ssid="${ssid:-$wetssid}"
|
||||
key="${key:-$wetkey}"
|
||||
if [ -n "$key" ]; then
|
||||
auth="WPA2PSK"
|
||||
enc="AES"
|
||||
else
|
||||
auth="OPEN"
|
||||
enc="NONE"
|
||||
fi
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set ApCliSsid="$ssid"
|
||||
iwpriv $wetif set ApCliAuthMode="$auth"
|
||||
iwpriv $wetif set ApCliEncrypType="$enc"
|
||||
iwpriv $wetif set ApCliWPAPSK="$key"
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set ApCliAutoConnect=1
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
forget_network)
|
||||
local wetif wetcfg code
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
uci -q set $wetcfg.ssid=""
|
||||
uci -q set $wetcfg.key=""
|
||||
uci -q commit wireless
|
||||
|
||||
sed -i "s/ApCliSsid=.*/ApCliSsid=/g" $STACONF
|
||||
sed -i "s/ApCliAuthMode=.*/ApCliAuthMode=/g" $STACONF
|
||||
sed -i "s/ApCliEncrypType=.*/ApCliEncrypType=/g" $STACONF
|
||||
sed -i "s/ApCliWPAPSK=.*/ApCliWPAPSK=/g" $STACONF
|
||||
|
||||
ifconfig $wetif down
|
||||
ifconfig $wetif up
|
||||
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
wps_enroll)
|
||||
local wetif
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -n "$wetif" ]; then
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set WscConfMode=1
|
||||
iwpriv $wetif set WscMode=2
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set WscGetConf=1
|
||||
fi
|
||||
json_init
|
||||
json_add_string "ifname" $wetif
|
||||
json_dump
|
||||
;;
|
||||
wps_stop)
|
||||
local wetif
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -n "$wetif" ]; then
|
||||
iwpriv $wetif set WscStop=1
|
||||
fi
|
||||
json_init
|
||||
json_add_string "ifname" $wetif
|
||||
json_dump
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
18
netmode/files/usr/libexec/rpcd/testnet
Executable file
18
netmode/files/usr/libexec/rpcd/testnet
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "status" : {} }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
status)
|
||||
json_load "$(cat /tmp/internet_connection_status 2>/dev/null)"
|
||||
json_dump
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=opkgd
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d3da32eca6e50b6be6e846a7f82c8e93c74c45a4
|
||||
PKG_SOURCE_VERSION:=c5ead73a9c667ceaaba32826d27be53fdddaad24
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/opkgd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=1c6efa76a23b9a8236a8f6d3b43349cf1e23655a
|
||||
PKG_SOURCE_VERSION:=6d2c10b28d2064f9341b5185a32a735cbb8d644d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@@ -5,8 +5,8 @@ config owsd 'global'
|
||||
# option www_maxage '3600'
|
||||
|
||||
# ubusproxy is enbaled if: enable = 1 or peer exists or path exists
|
||||
#config ubusproxy 'ubusproxy'
|
||||
# option enable '0'
|
||||
config ubusproxy 'ubusproxy'
|
||||
option enable '0'
|
||||
# list peer 'wss://repeater_hostname/'
|
||||
# list peer 'wss://192.168.1.101/'
|
||||
# list object 'router.*'
|
||||
@@ -20,7 +20,9 @@ config owsd-listen 'loopback'
|
||||
option port '80'
|
||||
option interface 'loopback'
|
||||
option ipv6 'on'
|
||||
list origin '*'
|
||||
option whitelist_interface_as_origin '1'
|
||||
# list origin '*'
|
||||
|
||||
|
||||
config owsd-listen 'lan'
|
||||
option port '80'
|
||||
@@ -29,15 +31,6 @@ config owsd-listen 'lan'
|
||||
option ipv6only 'off'
|
||||
option whitelist_interface_as_origin '1'
|
||||
option whitelist_dhcp_domains '1'
|
||||
list origin '*'
|
||||
|
||||
#config owsd-listen 'lan_8080'
|
||||
# option port '8080'
|
||||
# option interface 'lan'
|
||||
# option ipv6 'on'
|
||||
# option whitelist_interface_as_origin '1'
|
||||
# option whitelist_dhcp_domains '1'
|
||||
# list origin '*'
|
||||
|
||||
#config owsd-listen 'lan_https'
|
||||
# option port '443'
|
||||
@@ -47,6 +40,14 @@ config owsd-listen 'lan'
|
||||
# option ca '/etc/ssl/certs/owsd-ca-for-clients.pem'
|
||||
# option whitelist_interface_as_origin '1'
|
||||
|
||||
config owsd-listen 'wan'
|
||||
option port '80'
|
||||
option interface 'wan'
|
||||
option ipv6 'on'
|
||||
option whitelist_interface_as_origin '1'
|
||||
# list origin '*'
|
||||
|
||||
|
||||
#config owsd-listen 'wan_https'
|
||||
# option port '443'
|
||||
# option interface 'wan'
|
||||
@@ -55,26 +56,3 @@ config owsd-listen 'lan'
|
||||
# option ca '/etc/ssl/certs/owsd-ca-for-clients.pem'
|
||||
# option whitelist_interface_as_origin '1'
|
||||
# list origin '*'
|
||||
|
||||
config owsd-listen 'wan'
|
||||
option port '80'
|
||||
option interface 'wan'
|
||||
option ipv6 'on'
|
||||
option whitelist_interface_as_origin '1'
|
||||
list origin '*'
|
||||
|
||||
config owsd-listen 'wan_8080'
|
||||
option port '8080'
|
||||
option interface 'wan'
|
||||
option ipv6 'on'
|
||||
option whitelist_interface_as_origin '1'
|
||||
list origin '*'
|
||||
|
||||
config owsd-listen 'wan6'
|
||||
option port '80'
|
||||
option interface 'wan6'
|
||||
option ipv6 'on'
|
||||
option ipv6only 'on'
|
||||
option whitelist_interface_as_origin '1'
|
||||
list origin '*'
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ validate_owsd_iface() {
|
||||
'port:port' \
|
||||
'interface:network' \
|
||||
'origin:list(string)' \
|
||||
'whitelist_interface_as_origin:bool:0' \
|
||||
'whitelist_interface_as_origin:bool:1' \
|
||||
'whitelist_dhcp_domains:bool:0' \
|
||||
'whitelist_all_origins:bool:0' \
|
||||
'ipv6:bool:1' \
|
||||
@@ -203,12 +203,12 @@ parse_owsd_iface() {
|
||||
config_list_foreach "$1" "origin" append_str
|
||||
|
||||
# uncomment code below when implementing one vhost per origin fix
|
||||
#[ -n "$2" ] && whitelist_all_origins=1
|
||||
[ -n "$2" ] && whitelist_all_origins=1
|
||||
|
||||
#if [ "$whitelist_all_origins" -eq 1 ]; then
|
||||
# whitelist_dhcp_domains=1
|
||||
# whitelist_interface_as_origin=1
|
||||
#fi
|
||||
if [ "$whitelist_all_origins" -eq 1 ]; then
|
||||
whitelist_dhcp_domains=1
|
||||
whitelist_interface_as_origin=1
|
||||
fi
|
||||
|
||||
if [ "$whitelist_dhcp_domains" -eq 1 ]; then
|
||||
for domain in $DHCP_DOMAINS; do
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=778735da4e25e2075a6ecb365850a61ceb4bd515
|
||||
PKG_SOURCE_VERSION:=4851bc6a0ee52a6f3399ac26a70e4ccced1b72cc
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
|
||||
|
||||
@@ -39,7 +39,7 @@ define Package/peripheral_manager
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Application deamon for handling of peripheral
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json @+PACKAGE_bcmkernel:bcmkernel
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json @+PACKAGE_bcmkernel:bcmkernel PACKAGE_bcmkernel:bcmkernel
|
||||
endef
|
||||
|
||||
define Package/peripheral_manager/description
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=power-management
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/power-management
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Power management tool
|
||||
endef
|
||||
|
||||
define Package/power-management/description
|
||||
Control Broadcom power options
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/power-management/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,power-management))
|
||||
@@ -1,6 +0,0 @@
|
||||
config power_mgmt 'power_mgmt'
|
||||
option avs 'stopped'
|
||||
option cpuspeed '0'
|
||||
option cpur4kwait '0'
|
||||
option ethapd '0'
|
||||
option eee '0'
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=13
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
parsebool() {
|
||||
[ "$1" = "1" ] && echo "on" || echo "off"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load power_mgmt
|
||||
|
||||
local speed
|
||||
config_get speed power_mgmt cpuspeed
|
||||
pwrctl config --cpuspeed $speed
|
||||
|
||||
local cpur4kwait
|
||||
config_get cpur4kwait power_mgmt cpur4kwait
|
||||
pwrctl config --wait $(parsebool $cpur4kwait)
|
||||
|
||||
local sr
|
||||
config_get sr power_mgmt sr
|
||||
pwrctl config --sr $(parsebool $sr)
|
||||
|
||||
local ethapd
|
||||
config_get ethapd power_mgmt ethapd
|
||||
pwrctl config --ethapd $(parsebool $ethapd)
|
||||
|
||||
local eee
|
||||
config_get eee power_mgmt eee
|
||||
pwrctl config --eee $(parsebool $eee)
|
||||
|
||||
local avs
|
||||
config_get avs power_mgmt avs
|
||||
pwrctl config --avs $avs
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger power_mgmt
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2013-2019 iopsys
|
||||
# Copyright (C) 2020 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
@@ -16,8 +16,10 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/qosmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=qos manager daemon
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=QoS Manager
|
||||
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm)
|
||||
endef
|
||||
|
||||
define Package/qosmngr/description
|
||||
|
||||
@@ -1,231 +0,0 @@
|
||||
config queue 'q0'
|
||||
option ifname 'eth2'
|
||||
option precedence 0
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 0
|
||||
option weight 1
|
||||
|
||||
config queue 'q1'
|
||||
option ifname 'eth2'
|
||||
option precedence 1
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 1
|
||||
option weight 1
|
||||
|
||||
config queue 'q2'
|
||||
option ifname 'eth2'
|
||||
option precedence 2
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 2
|
||||
option weight 1
|
||||
|
||||
config queue 'q3'
|
||||
option ifname 'eth2'
|
||||
option precedence 3
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 3
|
||||
option weight 1
|
||||
|
||||
config queue 'q4'
|
||||
option ifname 'eth2'
|
||||
option precedence 4
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 4
|
||||
option weight 1
|
||||
|
||||
config queue 'q5'
|
||||
option ifname 'eth2'
|
||||
option precedence 5
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 5
|
||||
option weight 1
|
||||
|
||||
config queue 'q6'
|
||||
option ifname 'eth2'
|
||||
option precedence 6
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 6
|
||||
option weight 1
|
||||
|
||||
config queue 'q7'
|
||||
option ifname 'eth2'
|
||||
option precedence 7
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 7
|
||||
option weight 1
|
||||
|
||||
config queue 'q8'
|
||||
option ifname 'eth1'
|
||||
option precedence 0
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 0
|
||||
option weight 1
|
||||
|
||||
config queue 'q9'
|
||||
option ifname 'eth1'
|
||||
option precedence 1
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 1
|
||||
option weight 1
|
||||
|
||||
config queue 'q10'
|
||||
option ifname 'eth1'
|
||||
option precedence 2
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 2
|
||||
option weight 1
|
||||
|
||||
config queue 'q11'
|
||||
option ifname 'eth1'
|
||||
option precedence 3
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 3
|
||||
option weight 1
|
||||
|
||||
config queue 'q12'
|
||||
option ifname 'eth1'
|
||||
option precedence 4
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 4
|
||||
option weight 1
|
||||
|
||||
config queue 'q13'
|
||||
option ifname 'eth1'
|
||||
option precedence 5
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 5
|
||||
option weight 1
|
||||
|
||||
config queue 'q14'
|
||||
option ifname 'eth1'
|
||||
option precedence 6
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 6
|
||||
option weight 1
|
||||
|
||||
config queue 'q15'
|
||||
option ifname 'eth1'
|
||||
option precedence 7
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 7
|
||||
option weight 1
|
||||
|
||||
config queue 'q16'
|
||||
option ifname 'eth0'
|
||||
option precedence 0
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 0
|
||||
option weight 1
|
||||
|
||||
config queue 'q17'
|
||||
option ifname 'eth0'
|
||||
option precedence 1
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 1
|
||||
option weight 1
|
||||
|
||||
config queue 'q18'
|
||||
option ifname 'eth0'
|
||||
option precedence 2
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 2
|
||||
option weight 1
|
||||
|
||||
config queue 'q19'
|
||||
option ifname 'eth0'
|
||||
option precedence 3
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 3
|
||||
option weight 1
|
||||
|
||||
config queue 'q20'
|
||||
option ifname 'eth0'
|
||||
option precedence 4
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 4
|
||||
option weight 1
|
||||
|
||||
config queue 'q21'
|
||||
option ifname 'eth0'
|
||||
option precedence 5
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 5
|
||||
option weight 1
|
||||
|
||||
config queue 'q22'
|
||||
option ifname 'eth0'
|
||||
option precedence 6
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 6
|
||||
option weight 1
|
||||
|
||||
config queue 'q23'
|
||||
option ifname 'eth0'
|
||||
option precedence 7
|
||||
option scheduling 'WRR'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
option traffic_class 7
|
||||
option weight 1
|
||||
|
||||
config shaper 's1'
|
||||
option ifname 'eth2'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
|
||||
config shaper 's2'
|
||||
option ifname 'eth1'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
|
||||
config shaper 's3'
|
||||
option ifname 'eth0'
|
||||
option rate 0
|
||||
option burst_size -1
|
||||
|
||||
@@ -9,19 +9,13 @@ STOP=90
|
||||
USE_PROCD=1
|
||||
NAME=qosmngr
|
||||
|
||||
# This function checks the hardware and calls corresponding
|
||||
# scripts as per the platform
|
||||
configure_queue()
|
||||
{
|
||||
if [ "$(db get hw.board.tm)" == "1" ]; then
|
||||
. /lib/qos/broadcom.sh
|
||||
fi
|
||||
}
|
||||
. /lib/functions.sh
|
||||
include /lib/qos
|
||||
|
||||
start_service() {
|
||||
# Call functions to configure queues
|
||||
# Call functions to configure QoS
|
||||
if [ -f "/etc/config/qos" ]; then
|
||||
configure_queue
|
||||
configure_qos
|
||||
fi
|
||||
|
||||
# procd_open_instance
|
||||
@@ -37,10 +31,8 @@ stop() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Call functions to configure queues
|
||||
if [ -f "/etc/config/qos" ]; then
|
||||
configure_queue
|
||||
fi
|
||||
# Call functions to configure QoS
|
||||
start
|
||||
|
||||
# reload the daemon responsible for reading qos stats
|
||||
# ubus -t 5 call qos reload
|
||||
|
||||
53
qosmngr/files/etc/uci-defaults/60-qos_queue_generate
Normal file
53
qosmngr/files/etc/uci-defaults/60-qos_queue_generate
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
ethwan="$(db -q get hw.board.ethernetWanPort)"
|
||||
cpu_model="$(grep Hardware /proc/cpuinfo | awk '{print$NF}')"
|
||||
|
||||
generate_queue(){
|
||||
section="$1"
|
||||
|
||||
config_get ifname "$section" "ifname"
|
||||
|
||||
local is_lan=0
|
||||
if [ "$ifname" != "$ethwan" ]; then
|
||||
is_lan=1
|
||||
fi
|
||||
|
||||
local no_of_q="0 1 2 3 4 5 6 7"
|
||||
|
||||
if [ $is_lan -eq 1 ]; then
|
||||
case $cpu_model in
|
||||
BCM968*) no_of_q="0 1 2 3" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
i=0
|
||||
for i in $no_of_q; do
|
||||
uci add qos queue
|
||||
uci rename qos.@queue[-1]="q_${i}_${ifname}"
|
||||
uci set qos.@queue[-1].enable="1"
|
||||
uci set qos.@queue[-1].ifname="$ifname"
|
||||
uci set qos.@queue[-1].precedence="$i"
|
||||
uci set qos.@queue[-1].scheduling="SP"
|
||||
uci set qos.@queue[-1].rate="0"
|
||||
uci set qos.@queue[-1].burst_size="-1"
|
||||
uci set qos.@queue[-1].weight="1"
|
||||
done
|
||||
|
||||
uci commit qos
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/qos" ]; then
|
||||
if uci -q get qos.@queue[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/qos
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/qos
|
||||
|
||||
config_load ports
|
||||
config_foreach generate_queue ethport
|
||||
@@ -1,75 +1,223 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
for intf in $(db get hw.board.ethernetPortOrder); do
|
||||
i=0
|
||||
for i in 0 1 2 3 4 5 6 7; do
|
||||
tmctl delqcfg --devtype 0 --if $intf --qid $i
|
||||
done
|
||||
done
|
||||
IP_RULE=""
|
||||
|
||||
for cmd in q pbit; do
|
||||
i=0
|
||||
while :
|
||||
do
|
||||
qid="q$i"
|
||||
ifname=$(uci -q get qos.$qid.ifname)
|
||||
#function to handle a queue section
|
||||
handle_queue() {
|
||||
qid="$1" #queue section ID
|
||||
cmd=$2 #additional parameter
|
||||
config_get is_enable "$qid" "enable"
|
||||
|
||||
# if ifname is empty that is good enough to break
|
||||
if [ -z "$ifname" ];then
|
||||
break
|
||||
fi
|
||||
#no need to configure disabled queues
|
||||
if [ $is_enable == '0' ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# it makes sense to read rest on the params only if port is present,
|
||||
# which kind of indicates whether the config section is available
|
||||
# or not
|
||||
config_get ifname "$qid" "ifname"
|
||||
#if ifname is empty that is good enough to break
|
||||
if [ -z "$ifname" ];then
|
||||
return
|
||||
fi
|
||||
|
||||
# lower the value, lower the priority of queue on this chip
|
||||
order=$(uci -q get qos.$qid.precedence)
|
||||
#lower the value, lower the priority of queue on this chip
|
||||
config_get order "$qid" "precedence"
|
||||
|
||||
# on this chip, 8 queues per port exist so values larger than this
|
||||
# cannot be supported
|
||||
if [ $order -gt 7 ]; then
|
||||
continue
|
||||
fi
|
||||
config_get tc "$qid" "traffic_class"
|
||||
config_get sc_alg "$qid" "scheduling"
|
||||
config_get wgt "$qid" "weight"
|
||||
config_get rate "$qid" "rate"
|
||||
config_get bs "$qid" "burst_size"
|
||||
|
||||
tc=$(uci -q get qos.$qid.traffic_class)
|
||||
sc_alg=$(uci -q get qos.$qid.scheduling)
|
||||
wgt=$(uci -q get qos.$qid.weight)
|
||||
rate=$(uci -q get qos.$qid.rate)
|
||||
bs=$(uci -q get qos.$qid.burst_size)
|
||||
salg=1
|
||||
|
||||
salg=1
|
||||
case "$sc_alg" in
|
||||
"SP") salg=1
|
||||
;;
|
||||
"WRR") salg=2
|
||||
;;
|
||||
"WDRR") salg=3
|
||||
;;
|
||||
"WFQ") salg=4
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $cmd == q ]; then
|
||||
# Call tmctl which is a broadcomm command to configure queues on a port.
|
||||
tmctl setqcfg --devtype 0 --if $ifname --qid $order --priority $order --weight $wgt --schedmode $salg --shapingrate $rate --burstsize $bs
|
||||
|
||||
else
|
||||
if [ $sc_alg == 'WRR' ]; then
|
||||
salg=2
|
||||
return
|
||||
fi
|
||||
|
||||
if [ $cmd == q ]; then
|
||||
# Call tmctl which is a broadcomm command to configure queues on a port.
|
||||
tmctl setqcfg --devtype 0 --if $ifname --qid $order --priority $order --weight $wgt --schedmode $salg --shapingrate $rate --burstsize $bs
|
||||
else
|
||||
# Now the mapping of p bit to a queue happens
|
||||
IFS=,
|
||||
for word in $tc; do
|
||||
tmctl setpbittoq --devtype 0 --if $ifname --pbit $word --qid $order
|
||||
done
|
||||
if [ -z "$tc" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Read the next configuration
|
||||
i=$((i + 1))
|
||||
done
|
||||
done
|
||||
|
||||
i=0
|
||||
while :
|
||||
do
|
||||
sid="s$i"
|
||||
ifname=$(uci -q get qos.$sid.ifname)
|
||||
# Now the mapping of p bit to a queue happens
|
||||
IFS=,
|
||||
for word in $tc; do
|
||||
tmctl setpbittoq --devtype 0 --if $ifname --pbit $word --qid $order
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
#function to handle a shaper section
|
||||
handle_shaper() {
|
||||
sid="$1" #queue section ID
|
||||
|
||||
config_get is_enable "$sid" "enable"
|
||||
# no need to configure disabled queues
|
||||
if [ $is_enable == '0' ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
config_get ifname "$sid" "ifname"
|
||||
# if ifname is empty that is good enough to break
|
||||
if [ -z "$ifname" ];then
|
||||
break
|
||||
return
|
||||
fi
|
||||
rate=$(uci -q get qos.$sid.rate)
|
||||
bs=$(uci -q get qos.$sid.burst_size)
|
||||
|
||||
config_get rate "$sid" "rate"
|
||||
config_get bs "$sid" "burst_size"
|
||||
tmctl setportshaper --devtype 0 --if $ifname --shapingrate $rate --burstsize $bs
|
||||
done
|
||||
}
|
||||
|
||||
#Below are the functions to construct iptables rules
|
||||
init_iptables_rule() {
|
||||
IP_RULE=""
|
||||
}
|
||||
iptables_filter_proto() {
|
||||
IP_RULE="$IP_RULE -p $1"
|
||||
}
|
||||
|
||||
iptables_filter_ip_src() {
|
||||
IP_RULE="$IP_RULE -s $1"
|
||||
}
|
||||
|
||||
iptables_filter_ip_dest() {
|
||||
IP_RULE="$IP_RULE -d $1"
|
||||
}
|
||||
|
||||
iptables_filter_ip_mask() {
|
||||
IP_RULE="$IP_RULE$1"
|
||||
}
|
||||
|
||||
iptables_filter_port_dest() {
|
||||
IP_RULE="$IP_RULE --dport $1"
|
||||
}
|
||||
|
||||
iptables_filter_port_src() {
|
||||
IP_RULE="$IP_RULE --sport $1"
|
||||
}
|
||||
|
||||
iptables_filter_port_dest_range() {
|
||||
IP_RULE="$IP_RULE --dport $1:$2"
|
||||
}
|
||||
|
||||
iptables_filter_port_src_range() {
|
||||
IP_RULE="$IP_RULE --sport $1:$2"
|
||||
}
|
||||
|
||||
iptables_filter_dscp_filter() {
|
||||
IP_RULE="$IP_RULE -m dscp --dscp $1"
|
||||
}
|
||||
|
||||
iptables_set_dscp_mark() {
|
||||
IP_RULE="$IP_RULE -j DSCP --set-dscp $1"
|
||||
}
|
||||
|
||||
mangle_append_rule(){
|
||||
echo "iptables -t mangle -A FORWARD $IP_RULE" >> /tmp/qos/classify.iptables
|
||||
}
|
||||
|
||||
handle_iptables_rules() {
|
||||
cid=$1
|
||||
init_iptables_rule
|
||||
config_get proto "$cid" "proto"
|
||||
config_get dscp_mark "$cid" "dscp_mark"
|
||||
config_get dscp_filter "$cid" "dscp_filter"
|
||||
config_get dest_port "$cid" "dest_port"
|
||||
config_get dest_port_range "$cid" "dest_port_range"
|
||||
config_get src_port "$cid" "src_port"
|
||||
config_get src_port_range "$cid" "src_port_range"
|
||||
config_get dest_ip "$cid" "dest_ip"
|
||||
config_get dest_mask "$cid" "dest_mask"
|
||||
config_get src_ip "$cid" "src_ip"
|
||||
config_get src_mask "$cid" "src_mask"
|
||||
|
||||
# filter proto
|
||||
[ -n "$proto" ] && iptables_filter_proto $proto
|
||||
|
||||
#filter src. ip
|
||||
[ -n "$src_ip" ] && iptables_filter_ip_src $src_ip
|
||||
|
||||
#filter dest. ip
|
||||
[ -n "$dest_ip" ] && iptables_filter_ip_dest $dest_ip
|
||||
|
||||
#filter src. ip mask
|
||||
[ -n "$src_mask" ] && iptables_filter_ip_mask $src_mask
|
||||
|
||||
#filter dest. ip mask
|
||||
[ -n "$dest_mask" ] && iptables_filter_ip_mask $dest_mask
|
||||
|
||||
#filter dest. port
|
||||
[ -n "$dest_port" -a -z "$dest_port_range" ] && iptables_filter_port_dest $dest_port
|
||||
|
||||
#filter src. port
|
||||
[ -n "$src_port" -a -z "$src_port_range" ] && iptables_filter_port_src $src_port
|
||||
|
||||
#filter dest. port range
|
||||
[ -n "$dest_port" -a -n "$dest_port_range" ] && iptables_filter_port_dest_range $dest_port $dest_port_range
|
||||
|
||||
#filter src. port range
|
||||
[ -n "$src_port" -a -n "$src_port_range" ] && iptables_filter_port_src_range $src_port $src_port_range
|
||||
|
||||
#filter dscp
|
||||
[ -n "$dscp_filter" ] && iptables_filter_dscp_filter $dscp_filter
|
||||
|
||||
#set dscp mark
|
||||
[ -n "$dscp_mark" ] && iptables_set_dscp_mark $dscp_mark
|
||||
|
||||
[ -n "$IP_RULE" ] && mangle_append_rule
|
||||
}
|
||||
|
||||
#function to handle a classify section
|
||||
handle_classify() {
|
||||
cid="$1" #classify section ID
|
||||
handle_iptables_rules $cid
|
||||
}
|
||||
|
||||
configure_qos() {
|
||||
# Delete queues
|
||||
for intf in $(db get hw.board.ethernetPortOrder); do
|
||||
i=0
|
||||
for i in 0 1 2 3 4 5 6 7; do
|
||||
tmctl delqcfg --devtype 0 --if $intf --qid $i
|
||||
done
|
||||
done
|
||||
|
||||
# Load UCI file
|
||||
config_load qos
|
||||
# Processing shaper section(s)
|
||||
config_foreach handle_shaper shaper
|
||||
|
||||
# Processing queue section(s)
|
||||
for cmd in q pbit; do
|
||||
config_foreach handle_queue queue $cmd
|
||||
done
|
||||
#processing classify section
|
||||
# Flush the broute table before processing classify section
|
||||
rm -f /tmp/qos/classify.iptables
|
||||
#create iptables script file if not present
|
||||
mkdir -p /tmp/qos/ && touch /tmp/qos/classify.iptables
|
||||
echo "iptables -t mangle -F FORWARD" > /tmp/qos/classify.iptables
|
||||
|
||||
config_foreach handle_classify classify
|
||||
# For now qosmngr will execute the ebtables and iptables scripts
|
||||
# that it generates, this can later be integrated with the include
|
||||
# section of firewall uci bu execute for now
|
||||
sh /tmp/qos/classify.iptables
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ bcom_get_queue_stats() {
|
||||
}
|
||||
|
||||
get_queue_stats() {
|
||||
if [ "$(db get hw.board.tm)" == "1" ]; then
|
||||
if [ "$(which tmctl)" ]; then
|
||||
bcom_get_queue_stats
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#
|
||||
# Copyright (C) 2013-2019 iopsys
|
||||
# Copyright (C) 2013-2020 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=5.0.0
|
||||
PKG_VERSION:=5.1.7
|
||||
|
||||
PKG_SOURCE_VERSION:=ff1db5af789da87666c230548df32a9a71b3fb27
|
||||
PKG_SOURCE_VERSION:=eb60c5d95b4b4b1aed3c38fa4b8335f92543b5c9
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
|
||||
|
||||
@@ -26,8 +26,8 @@ PKG_INSTALL:=
|
||||
|
||||
define Package/questd
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_ramips:libnl-tiny +libopenssl
|
||||
TITLE:=router info daemon
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread
|
||||
TITLE:=Router information daemon
|
||||
endef
|
||||
|
||||
define Package/questd/description
|
||||
|
||||
@@ -11,11 +11,6 @@ start_service() {
|
||||
procd_set_param command "/sbin/questd"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/sbin/graphd"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop() {
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
add_required_ubusproxy_objects() {
|
||||
uci -q del_list owsd.ubusproxy.object="wifix"
|
||||
uci -q add_list owsd.ubusproxy.object="wifix"
|
||||
uci commit owsd
|
||||
}
|
||||
|
||||
add_required_ubusproxy_objects
|
||||
|
||||
@@ -16,7 +16,7 @@ PKG_VERSION:=2016.08
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
ifdef CONFIG_TARGET_intel_mips
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:intel/uboot.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/intel/uboot.git
|
||||
PKG_SOURCE_VERSION:=feed838bd1bfeeb57a9afb93b4d704971f423d92
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/uboot.git
|
||||
|
||||
@@ -5,12 +5,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_VERSION:=1.0.14
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d7b2a249a49e1d54b02a328f0222121f238fca06
|
||||
PKG_SOURCE_VERSION:=872d3dea45caff5a92e25b4a12dd5de6b6c6a5e5
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
@@ -32,11 +35,20 @@ endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall -Wextra -Werror \
|
||||
-DDM_USE_LIBUBUS \
|
||||
-Wformat \
|
||||
-Wformat-signedness \
|
||||
-Wsign-conversion
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./uspd/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/uspd/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/uspd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2014 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=voice-client
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
VOICE_LIB:=broadcom.sh
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
VOICE_LIB:=broadcom.sh
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
VOICE_LIB:=intel.sh
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
VOICE_LIB:=broadcom.sh
|
||||
else
|
||||
$(info (UNEXPECTED CONFIG TARGET))
|
||||
VOICE_LIB:=broadcom.sh
|
||||
endif
|
||||
|
||||
define Package/voice-client
|
||||
SUBMENU:=Telephony
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=voice-client
|
||||
DEPENDS:=@TARGET_HAS_VOICE
|
||||
endef
|
||||
|
||||
define Package/voice-client/description
|
||||
voice-client
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/voice-client/install
|
||||
$(CP) ./files/etc $(1)/
|
||||
$(CP) ./files/sbin $(1)/
|
||||
$(CP) ./files/usr $(1)/
|
||||
mkdir -p $(1)/lib/voice
|
||||
$(CP) ./files/lib/cw.sh $(1)/lib/.
|
||||
$(CP) ./files/lib/voice/$(VOICE_LIB) $(1)/lib/voice/voicelib.sh
|
||||
|
||||
ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
sed -i \
|
||||
-e 's/brcm/tapi/g' \
|
||||
-e 's/BRCM/TAPI/g' \
|
||||
-e 's/broadcom/intel/g' \
|
||||
-e 's/SWE/ETS/g' \
|
||||
$(1)/etc/config/voice_client \
|
||||
$(1)/etc/asterisk_templates/*
|
||||
sed -i \
|
||||
-e '/echo_cancel/d' \
|
||||
-e "/config.*tel_advanced.*TEL/a \ option 'echo_cancel' '1'" \
|
||||
$(1)/etc/config/voice_client
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,voice-client))
|
||||
@@ -1,25 +0,0 @@
|
||||
AUS;19x+
|
||||
BEL;09xx+
|
||||
BRA;05xx+
|
||||
CHL;
|
||||
CHN;
|
||||
CZE;9xx+
|
||||
DNK;90xx+
|
||||
ETS;
|
||||
FIN;0(7[0,5]|[1-3,6]0)x+
|
||||
FRA;0[8,9]xx+
|
||||
DEU;0(9xx|137)x+
|
||||
HUN;06-[8,9]x+
|
||||
IND;
|
||||
ITA;8
|
||||
JPN;0990x+
|
||||
NLD;09xx+
|
||||
NZL;0900x+
|
||||
USA;1-900x+
|
||||
ESP;([8,9]0x|118)x+
|
||||
SWE;90510,09(00|39|44)x+,099x+
|
||||
CHE;09xx+
|
||||
NOR;82x+
|
||||
TWN;020[3,4,9]x+
|
||||
GBR;0[8,9]xx+
|
||||
ARE;[2,6]00x+
|
||||
@@ -1,80 +0,0 @@
|
||||
;
|
||||
; Named Access Control Lists (ACLs)
|
||||
;
|
||||
; A convenient way to share acl definitions
|
||||
;
|
||||
; This configuration file is read on startup
|
||||
;
|
||||
; CLI Commands
|
||||
; -----------------------------------------------------------
|
||||
; acl show Show all named ACLs configured
|
||||
; acl show <name> Show contents of a particular named ACL
|
||||
; reload acl Reload configuration file
|
||||
;
|
||||
; Any configuration that uses ACLs which has been made to be able to use named
|
||||
; ACLs will specify a named ACL with the 'acl' option in its configuration in
|
||||
; a similar fashion to the usual 'permit' and 'deny' options. Example:
|
||||
; acl=my_named_acl
|
||||
;
|
||||
; Multiple named ACLs can be applied by either comma separating the arguments or
|
||||
; just by adding additional ACL lines. Example:
|
||||
; acl=my_named_acl
|
||||
; acl=my_named_acl2
|
||||
;
|
||||
; or
|
||||
;
|
||||
; acl=my_named_acl,my_named_acl2
|
||||
;
|
||||
; ACLs specified by name are evaluated independently from the ACL specified via
|
||||
; permit/deny. In order for an address to pass a given ACL, it must pass both
|
||||
; the ACL specified by permit/deny for a given item as well as any named ACLs
|
||||
; that were specified.
|
||||
;
|
||||
;[example_named_acl1]
|
||||
;deny=0.0.0.0/0.0.0.0
|
||||
;permit=209.16.236.0
|
||||
;permit=209.16.236.1
|
||||
;
|
||||
;[example_named_acl2]
|
||||
;permit=0.0.0.0/0.0.0.0
|
||||
;deny=10.24.20.171
|
||||
;deny=10.24.20.103
|
||||
;deny=209.16.236.1
|
||||
;
|
||||
; example_named_acl1 above shows an example of whitelisting. When whitelisting, the
|
||||
; named ACLs should follow a deny that blocks everything (like deny=0.0.0.0/0.0.0.0)
|
||||
; The following example explains how combining the ACLs works:
|
||||
; <in another configuration>
|
||||
; [example_item_with_acl]
|
||||
; acl=example_named_acl1
|
||||
; acl=example_named_acl2
|
||||
;
|
||||
; Suppose 209.16.236.0 tries to communicate and the ACL for that example is applied to it...
|
||||
; First, example_named_acl1 is evaluated. The address is allowed by that ACL.
|
||||
; Next, example_named_acl2 is evaluated. The address isn't blocked by example_named_acl2
|
||||
; either, so it passes.
|
||||
;
|
||||
; Suppose instead 209.16.236.1 tries to communicate and the same ACL is applied.
|
||||
; First, example_named_acl1 is evaluated and the address is allowed.
|
||||
; However, it is blocked by example_named_acl2, so the address is blocked from the combined
|
||||
; ACL.
|
||||
;
|
||||
; Similarly, the permits/denies in specific configurations that make up an ACL definition
|
||||
; are also treated as a separate ACL for evaluation. So if we change the example above to:
|
||||
; <in another configuration>
|
||||
; [example_item_with_acl]
|
||||
; acl=example_named_acl1
|
||||
; acl=example_named_acl2
|
||||
; deny=209.16.236.0
|
||||
;
|
||||
; Then 209.16.236.0 will be rejected by the non-named component of the combined ACL even
|
||||
; though it passes the two named components.
|
||||
;
|
||||
;
|
||||
; Named ACLs can use ipv6 addresses just like normal ACLs.
|
||||
;[ipv6_example_1]
|
||||
;deny = ::
|
||||
;permit = ::1/128
|
||||
;
|
||||
;[ipv6_example_2]
|
||||
;permit = fe80::21d:bad:fad:2323
|
||||
@@ -1,114 +0,0 @@
|
||||
[directories](!)
|
||||
astetcdir => /etc/asterisk
|
||||
astmoddir => /usr/lib/asterisk/modules
|
||||
astvarlibdir => /var/lib/asterisk
|
||||
astdbdir => /var/lib/asterisk
|
||||
astkeydir => /var/lib/asterisk
|
||||
astdatadir => /usr/share/asterisk
|
||||
astagidir => /usr/share/asterisk/agi-bin
|
||||
astspooldir => /var/spool/asterisk
|
||||
astrundir => /var/run/asterisk
|
||||
astlogdir => /var/log/asterisk
|
||||
astsbindir => /usr/sbin
|
||||
|
||||
[options]
|
||||
;verbose = 3
|
||||
;debug = 3
|
||||
;alwaysfork = yes ; Same as -F at startup.
|
||||
;nofork = yes ; Same as -f at startup.
|
||||
;quiet = yes ; Same as -q at startup.
|
||||
;timestamp = yes ; Same as -T at startup.
|
||||
;execincludes = yes ; Support #exec in config files.
|
||||
;console = yes ; Run as console (same as -c at startup).
|
||||
;highpriority = yes ; Run realtime priority (same as -p at
|
||||
; startup).
|
||||
;initcrypto = yes ; Initialize crypto keys (same as -i at
|
||||
; startup).
|
||||
;nocolor = yes ; Disable console colors.
|
||||
;dontwarn = yes ; Disable some warnings.
|
||||
;dumpcore = yes ; Dump core on crash (same as -g at startup).
|
||||
;languageprefix = yes ; Use the new sound prefix path syntax.
|
||||
;systemname = my_system_name ; Prefix uniqueid with a system name for
|
||||
; Global uniqueness issues.
|
||||
;autosystemname = yes ; Automatically set systemname to hostname,
|
||||
; uses 'localhost' on failure, or systemname if
|
||||
; set.
|
||||
;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms)
|
||||
; If we get shorter DTMF messages, these will be
|
||||
; changed to the minimum duration
|
||||
;maxcalls = 10 ; Maximum amount of calls allowed.
|
||||
;maxload = 0.9 ; Asterisk stops accepting new calls if the
|
||||
; load average exceed this limit.
|
||||
;maxfiles = 1000 ; Maximum amount of openfiles.
|
||||
;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if
|
||||
; the amount of free memory falls below this
|
||||
; watermark.
|
||||
;cache_record_files = yes ; Cache recorded sound files to another
|
||||
; directory during recording.
|
||||
;record_cache_dir = /tmp ; Specify cache directory (used in conjunction
|
||||
; with cache_record_files).
|
||||
;transmit_silence = yes ; Transmit silence while a channel is in a
|
||||
; waiting state, a recording only state, or
|
||||
; when DTMF is being generated. Note that the
|
||||
; silence internally is generated in raw signed
|
||||
; linear format. This means that it must be
|
||||
; transcoded into the native format of the
|
||||
; channel before it can be sent to the device.
|
||||
; It is for this reason that this is optional,
|
||||
; as it may result in requiring a temporary
|
||||
; codec translation path for a channel that may
|
||||
; not otherwise require one.
|
||||
;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of
|
||||
; directly.
|
||||
;runuser = asterisk ; The user to run as.
|
||||
;rungroup = asterisk ; The group to run as.
|
||||
;lightbackground = yes ; If your terminal is set for a light-colored
|
||||
; background.
|
||||
;forceblackbackground = yes ; Force the background of the terminal to be
|
||||
; black, in order for terminal colors to show
|
||||
; up properly.
|
||||
;defaultlanguage = en ; Default language
|
||||
documentation_language = en_US ; Set the language you want documentation
|
||||
; displayed in. Value is in the same format as
|
||||
; locale names.
|
||||
hideconnect = yes ; Hide messages displayed when a remote console
|
||||
; connects and disconnects.
|
||||
;lockconfdir = no ; Protect the directory containing the
|
||||
; configuration files (/etc/asterisk) with a
|
||||
; lock.
|
||||
;stdexten = gosub ; How to invoke the extensions.conf stdexten.
|
||||
; macro - Invoke the stdexten using a macro as
|
||||
; done by legacy Asterisk versions.
|
||||
; gosub - Invoke the stdexten using a gosub as
|
||||
; documented in extensions.conf.sample.
|
||||
; Default gosub.
|
||||
;live_dangerously = no ; Enable the execution of 'dangerous' dialplan
|
||||
; functions from external sources (AMI,
|
||||
; etc.) These functions (such as SHELL) are
|
||||
; considered dangerous because they can allow
|
||||
; privilege escalation.
|
||||
; Default no
|
||||
;entityid=00:11:22:33:44:55 ; Entity ID.
|
||||
; This is in the form of a MAC address.
|
||||
; It should be universally unique.
|
||||
; It must be unique between servers communicating
|
||||
; with a protocol that uses this value.
|
||||
; This is currently is used by DUNDi and
|
||||
; Exchanging Device and Mailbox State
|
||||
; using protocols: XMPP, Corosync and PJSIP.
|
||||
;rtp_pt_dynamic = 96 ; Normally the Dynamic RTP Payload Type numbers
|
||||
; are 96-127, which allow 32 formats. When you
|
||||
; use more and receive the message "No Dynamic
|
||||
; RTP mapping available", extend the dynamic
|
||||
; range by going for 35 (or 0) instead of 96.
|
||||
; This allows 29 (or 64) more formats. 96 is the
|
||||
; default because any number below might be
|
||||
; rejected by a remote implementation; although
|
||||
; no such broken implementation is known, yet.
|
||||
|
||||
; Changing the following lines may compromise your security.
|
||||
;[files]
|
||||
;astctlpermissions = 0660
|
||||
;astctlowner = root
|
||||
;astctlgroup = apache
|
||||
;astctl = asterisk.ctl
|
||||
@@ -1,73 +0,0 @@
|
||||
;
|
||||
; Configuration file for chan_brcm
|
||||
;
|
||||
; The configuration is divided into sections for each physical endpoint, named '[brcmX]', where X is
|
||||
; a number indicating the endpoint id. The 'default' section contains default values that are applied to
|
||||
; all lines unless they are overridden.
|
||||
;
|
||||
[default]
|
||||
|
||||
; Allow remote transfer on hangup.
|
||||
; With one call active, press R, dial a new number and wait for ringback. Then hangup to do a remote connect.
|
||||
hangup_xfer=yes
|
||||
|
||||
; Enables the use of a jitterbuffer on the receiving side of a SIP channel. [yes/no] (Added in Version 1.4)
|
||||
; This is a global setting.
|
||||
jbenable = |JBENABLE|
|
||||
|
||||
; Forces the use of a jitterbuffer on the receive side of a SIP channel. [yes/no] Defaults to "no". (Added in Version 1.4)
|
||||
; This is a global setting.
|
||||
jbforce = |JBFORCE|
|
||||
|
||||
; Max length of the jitterbuffer in milliseconds. (Added in Version 1.4)
|
||||
; This is a global setting.
|
||||
jbmaxsize = |JBMAXSIZE|
|
||||
|
||||
; Jump in the frame timestamps over which the jitterbuffer is resynchronized. Useful to improve the quality of the voice, with big jumps in/broken timestamps, usually sent from exotic devices and programs. Defaults to 1000. (Added in Version 1.4)
|
||||
; This is a global setting.
|
||||
;jbresyncthreshold = 1000
|
||||
|
||||
; Jitterbuffer implementation, used on the receiving side of a SIP channel. Two implementations are currently available - "fixed" (with size always equals to jbmaxsize) and "adaptive" (with variable size, actually the new jb of IAX2). Defaults to fixed. (Added in Version 1.4)
|
||||
; This is a global setting.
|
||||
jbimpl = |JBIMPL|
|
||||
|
||||
; Context used for outbound calls
|
||||
context=default
|
||||
|
||||
; Context used for immediate/direct dialling.
|
||||
; When an exact match is found in this context, interdigit timeout is ignored and call is immediately initiated
|
||||
context_direct=default-direct
|
||||
|
||||
; Enable/Disable ring signal [off, on]
|
||||
ringsignal=on
|
||||
|
||||
; Inter-digit timeout, milliseconds
|
||||
dialoutmsec=|DIALOUTMSEC|
|
||||
|
||||
; Comfort Noise Generation
|
||||
; 0 = CNG off
|
||||
; 1 = White noise
|
||||
; 2 = Hot noise
|
||||
; 3 = Estimate
|
||||
;comfortnoise=0
|
||||
|
||||
; Maximum delay between on/off hook for detecting hook flash, milliseconds
|
||||
;hfmaxdelay=500
|
||||
|
||||
; Feature Access Codes
|
||||
; DTMF tone sequences to be treated as feature access codes
|
||||
; The '.' character is used as wildcard
|
||||
featureaccesscodes = |FAC|
|
||||
|
||||
;
|
||||
; Unused/undocumented settings, do not uncomment/change these
|
||||
;
|
||||
;language=
|
||||
|
||||
; Whether the transferor puts the transfer target on-hold before sending REFER
|
||||
;
|
||||
; The transferor needs put the transfer target on-hold before sending REFER to the transferee as per RFC5589.
|
||||
; But call transfer fails on some devices, e.g. Ericsson MTAS as the transfer target. The configuration is
|
||||
; to solve this kind of interoperability issue.
|
||||
hold_target_before_refer = |HOLDTARGET|
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
[general]
|
||||
enable=yes
|
||||
unanswered=yes
|
||||
batch=no
|
||||
safeshutdown=yes
|
||||
|
||||
[csv]
|
||||
usegmtime=no ; log date/time in GMT. Default is "no"
|
||||
loguniqueid=yes ; log uniqueid. Default is "no"
|
||||
loguserfield=yes ; log user field. Default is "no"
|
||||
accountlogs=no ; create separate log file for each account code. Default is "yes"
|
||||
maxrows=100
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user