mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
367 Commits
netmode_do
...
debug_lo_i
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35a2f406b8 | ||
|
|
1b4a870e11 | ||
|
|
fd7f4d720e | ||
|
|
5d23c8b5a1 | ||
|
|
288bbbd640 | ||
|
|
4461233f96 | ||
|
|
7784e915bc | ||
|
|
a2cfd3615f | ||
|
|
a84600031a | ||
|
|
781967f4aa | ||
|
|
d34671b1d0 | ||
|
|
ee51171fd8 | ||
|
|
54f08fc89b | ||
|
|
b2d62ee320 | ||
|
|
c68ca0390a | ||
|
|
a564e3bb8d | ||
|
|
1f57adfee5 | ||
|
|
4727a315ca | ||
|
|
8ff6663501 | ||
|
|
8608d4aa01 | ||
|
|
8eff97b281 | ||
|
|
2347dbfaa3 | ||
|
|
ad2c6a17a4 | ||
|
|
e529bc2564 | ||
|
|
27c1022601 | ||
|
|
6002211053 | ||
|
|
9c00a0928b | ||
|
|
7cdeecb7f7 | ||
|
|
6690b29272 | ||
|
|
d39b3ebaa4 | ||
|
|
1606a6bcd1 | ||
|
|
9e5c376576 | ||
|
|
bdc435c392 | ||
|
|
2d5570f6a0 | ||
|
|
09c488c1e6 | ||
|
|
9aa6878efc | ||
|
|
35b7e24278 | ||
|
|
0a00e910ba | ||
|
|
5d9c9d5708 | ||
|
|
401790274c | ||
|
|
4989129f2d | ||
|
|
a55324acc3 | ||
|
|
a9ce2df71a | ||
|
|
22f43092f4 | ||
|
|
6be2d52199 | ||
|
|
0ec72bec22 | ||
|
|
8b17665845 | ||
|
|
d9e9e53361 | ||
|
|
0fb178476f | ||
|
|
9ccae677a6 | ||
|
|
b6a6a37005 | ||
|
|
fe7a0b7d0c | ||
|
|
d9688d0d7b | ||
|
|
e5769f9b33 | ||
|
|
b50c9eb386 | ||
|
|
ab5e3a42b9 | ||
|
|
14609a860e | ||
|
|
d9c18aaf91 | ||
|
|
74f299a687 | ||
|
|
e97d29ed6b | ||
|
|
a9be5ff573 | ||
|
|
3e6eadcbec | ||
|
|
84394e3639 | ||
|
|
24f52886b8 | ||
|
|
9f6550a827 | ||
|
|
a04244942b | ||
|
|
2cc9859309 | ||
|
|
f918829cb7 | ||
|
|
0dac08d363 | ||
|
|
e4e41c837c | ||
|
|
4a61fc9674 | ||
|
|
012c3e1169 | ||
|
|
288dfa9244 | ||
|
|
b9e47162d0 | ||
|
|
1f18545faa | ||
|
|
93e592f583 | ||
|
|
92b0d5aed2 | ||
|
|
466a149107 | ||
|
|
1577a9bf69 | ||
|
|
3e1f65d668 | ||
|
|
08a56514f4 | ||
|
|
34ff04d8bb | ||
|
|
1e0b705c8b | ||
|
|
5b5a9bb231 | ||
|
|
5b6697789b | ||
|
|
172a0066dd | ||
|
|
44cd1ae18e | ||
|
|
37c2358ca5 | ||
|
|
b3d2b111f0 | ||
|
|
4ef899324b | ||
|
|
d39d28e6d8 | ||
|
|
cb48886ceb | ||
|
|
a7bbd943cc | ||
|
|
f74c2041ec | ||
|
|
ae2474d273 | ||
|
|
153b75395d | ||
|
|
3da4280752 | ||
|
|
95c7cb447b | ||
|
|
c9e9ac9a4e | ||
|
|
06921165db | ||
|
|
5c9a63c2a1 | ||
|
|
57530b8838 | ||
|
|
95a1d6899b | ||
|
|
724f456e3c | ||
|
|
9ef41069d6 | ||
|
|
eda55e9d9d | ||
|
|
bdead2797a | ||
|
|
022b138347 | ||
|
|
9f8a8b5591 | ||
|
|
7c8afb8eaf | ||
|
|
56bff31f81 | ||
|
|
59511621c6 | ||
|
|
fe73b36293 | ||
|
|
de85db9fa6 | ||
|
|
607b546317 | ||
|
|
47f964bd0d | ||
|
|
272656caa9 | ||
|
|
3ae1ba4530 | ||
|
|
d5c15c995e | ||
|
|
d73b91bdd3 | ||
|
|
e327dbce29 | ||
|
|
92d5156a9f | ||
|
|
63779cf56e | ||
|
|
96de2ee6c5 | ||
|
|
e768cb4c1d | ||
|
|
c02570e234 | ||
|
|
6750377b0e | ||
|
|
14eeac7c60 | ||
|
|
bfb09c7275 | ||
|
|
12c617822f | ||
|
|
71646ac551 | ||
|
|
740c050cd7 | ||
|
|
bb4069ce9b | ||
|
|
fa994ebd09 | ||
|
|
07efbdd3bd | ||
|
|
d9ef12897c | ||
|
|
7e0520c1d6 | ||
|
|
72bd92c9ea | ||
|
|
dbbc48a93a | ||
|
|
a5c6eb86c4 | ||
|
|
ac0b85f837 | ||
|
|
38d8d01f27 | ||
|
|
2ccfa1da43 | ||
|
|
731bd20943 | ||
|
|
67b71ce206 | ||
|
|
76713ffa40 | ||
|
|
49d18417db | ||
|
|
a39ffe9ebb | ||
|
|
853b5ec8bc | ||
|
|
7baa1ac579 | ||
|
|
1d7df80538 | ||
|
|
2e29c5c777 | ||
|
|
beda74eaaf | ||
|
|
e461b9d1f6 | ||
|
|
4265c3d191 | ||
|
|
9d5099944e | ||
|
|
46a14f82b6 | ||
|
|
f8f8ad7453 | ||
|
|
b74e5bcb6f | ||
|
|
0b3ed4c2f2 | ||
|
|
67a56f09c6 | ||
|
|
0fbb37f4ed | ||
|
|
60d395923d | ||
|
|
53a6bd9304 | ||
|
|
7354b4d971 | ||
|
|
28da651279 | ||
|
|
a582d6d115 | ||
|
|
341a925504 | ||
|
|
82c54d9422 | ||
|
|
660809e83e | ||
|
|
d34205adb1 | ||
|
|
dad2b56c02 | ||
|
|
e6618e200f | ||
|
|
c4f4f3e093 | ||
|
|
d454d20716 | ||
|
|
12d4d23f6e | ||
|
|
c2310ebb25 | ||
|
|
be472781d9 | ||
|
|
e4274b9c15 | ||
|
|
16d94a6628 | ||
|
|
bb090135b2 | ||
|
|
8d7cf1c701 | ||
|
|
9692cf8bc3 | ||
|
|
7fa5c901f9 | ||
|
|
7c2cbc4c1a | ||
|
|
a9bdc41462 | ||
|
|
389485a526 | ||
|
|
8087a16cdf | ||
|
|
4e33db2700 | ||
|
|
e6b7048775 | ||
|
|
23c43898a4 | ||
|
|
abebc40733 | ||
|
|
4823154afb | ||
|
|
936ce9be85 | ||
|
|
996c0b1832 | ||
|
|
8c4e77a96b | ||
|
|
e647ec0990 | ||
|
|
4cfbb3636f | ||
|
|
528ad5cbd2 | ||
|
|
def81d62d5 | ||
|
|
ad3028061c | ||
|
|
2c58ce6912 | ||
|
|
064418e23d | ||
|
|
ba95eec1b5 | ||
|
|
8554ccf3fc | ||
|
|
d6cf506901 | ||
|
|
263723b795 | ||
|
|
21724ac691 | ||
|
|
3422f7fc4d | ||
|
|
19e4b41368 | ||
|
|
db30526f64 | ||
|
|
d4c101f90f | ||
|
|
d90063c7d5 | ||
|
|
09323326f4 | ||
|
|
33b62a44c5 | ||
|
|
9d0f9750dc | ||
|
|
e68abd6288 | ||
|
|
61559073e8 | ||
|
|
ffd8352d38 | ||
|
|
d75d3bc3ed | ||
|
|
86ef800f0d | ||
|
|
130a3e5952 | ||
|
|
0d4b4c5399 | ||
|
|
2240a84adc | ||
|
|
d4dfe767c9 | ||
|
|
58f141573a | ||
|
|
91fac0490a | ||
|
|
a80713423c | ||
|
|
d530ffa4ba | ||
|
|
2da18cbb7d | ||
|
|
c89816ac60 | ||
|
|
03810c0099 | ||
|
|
aad4bd7db5 | ||
|
|
f36ba2dc1f | ||
|
|
91dced7427 | ||
|
|
57ef92af9a | ||
|
|
631122aa04 | ||
|
|
ede7966809 | ||
|
|
9a36c0310f | ||
|
|
2528cde629 | ||
|
|
f317c67aed | ||
|
|
7f14f8634e | ||
|
|
62552e2269 | ||
|
|
5837b73946 | ||
|
|
22bded8f33 | ||
|
|
1fbf254b3a | ||
|
|
3b6f88daed | ||
|
|
f8ceb6293d | ||
|
|
d5375c89b1 | ||
|
|
1301adc7c6 | ||
|
|
85d7715db7 | ||
|
|
25cb059235 | ||
|
|
a87b85eba5 | ||
|
|
49a83e17cb | ||
|
|
2ec059a373 | ||
|
|
7193985d39 | ||
|
|
74372dab99 | ||
|
|
6bc7842b0d | ||
|
|
87c2d0bb10 | ||
|
|
1e2f6161d6 | ||
|
|
bbb3df8c17 | ||
|
|
945d95b518 | ||
|
|
9eee6a59f8 | ||
|
|
1c6e8aaec8 | ||
|
|
aa7ad2dfe9 | ||
|
|
dd637db803 | ||
|
|
04b74dca49 | ||
|
|
5ab49f8ff4 | ||
|
|
4ac917a191 | ||
|
|
37d313ccc5 | ||
|
|
a225cc2e3f | ||
|
|
6df061de8e | ||
|
|
c6d3cac61e | ||
|
|
f1ac19b604 | ||
|
|
27bd279333 | ||
|
|
f7d845beaa | ||
|
|
41c39445bc | ||
|
|
f1c7fc9e1e | ||
|
|
426ddd0f30 | ||
|
|
9c26dc269e | ||
|
|
775c7bf9b9 | ||
|
|
154532348b | ||
|
|
ed638f3913 | ||
|
|
a3298e14cc | ||
|
|
0c72ad488c | ||
|
|
d39b258091 | ||
|
|
d4398bc4a7 | ||
|
|
4f479680b0 | ||
|
|
888b1c186a | ||
|
|
5ebb2552ac | ||
|
|
e7f26ec647 | ||
|
|
f4350eba32 | ||
|
|
e781b0c1cc | ||
|
|
075280c30b | ||
|
|
bd984a6f1c | ||
|
|
f017ef0b41 | ||
|
|
daf540bf4d | ||
|
|
9177090e7c | ||
|
|
8001d9d14b | ||
|
|
28c22277cd | ||
|
|
a82c3562f2 | ||
|
|
d6e6747380 | ||
|
|
9cf65109e8 | ||
|
|
819b9e3e97 | ||
|
|
05cf17b007 | ||
|
|
4538e26d87 | ||
|
|
c45695ce93 | ||
|
|
e8124555bb | ||
|
|
596df801e6 | ||
|
|
b713b68045 | ||
|
|
869d482198 | ||
|
|
e5c59ebfcd | ||
|
|
fd0c7e93ef | ||
|
|
862a278fbe | ||
|
|
87aa6ea898 | ||
|
|
64c6ff7787 | ||
|
|
ab66957fad | ||
|
|
e590fc7894 | ||
|
|
785f2e9db2 | ||
|
|
35cb886b3e | ||
|
|
a1e8a8a464 | ||
|
|
98c35bf25f | ||
|
|
7cc2e3eac9 | ||
|
|
f6aff4ba81 | ||
|
|
cbd0b5b6bb | ||
|
|
d2df0e5633 | ||
|
|
43be3d334c | ||
|
|
900c221ef8 | ||
|
|
1b88e03e43 | ||
|
|
b9e40818a3 | ||
|
|
af272291d2 | ||
|
|
e7e49350b1 | ||
|
|
40056f3e65 | ||
|
|
110589b1e2 | ||
|
|
a3352224c2 | ||
|
|
9e3cbbc1f7 | ||
|
|
dd18f6f9ed | ||
|
|
e69fba300a | ||
|
|
0bd3c5e020 | ||
|
|
bd115c48bf | ||
|
|
6241dc0500 | ||
|
|
5986d9ad3f | ||
|
|
e1d1b37edf | ||
|
|
ac6c0c3e60 | ||
|
|
ee13ac5774 | ||
|
|
f4fa5821e5 | ||
|
|
324f482548 | ||
|
|
a794e51f56 | ||
|
|
8bdc47344a | ||
|
|
544b0346d7 | ||
|
|
b95714fcb9 | ||
|
|
19ff37bd9b | ||
|
|
95f47e28a1 | ||
|
|
4edd2e5cbf | ||
|
|
3d54e83e0d | ||
|
|
ead2de7ad1 | ||
|
|
8e21d2d702 | ||
|
|
a2627faef1 | ||
|
|
10a0fa34c3 | ||
|
|
6e8c83eafd | ||
|
|
53cea83a61 | ||
|
|
69ff8452e2 | ||
|
|
f7c39b5fef | ||
|
|
7765b3de9c | ||
|
|
a51d5e6616 | ||
|
|
971392a796 | ||
|
|
291cd43b10 |
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.18.16
|
||||
PKG_VERSION:=1.16.6.6
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=72c3307651cb583121fa5b4abcaad957ddc264bd
|
||||
PKG_SOURCE_VERSION:=6317266bdfb0180d75ed2dd830e108f09fe2526a
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -55,7 +55,7 @@ define Package/dm-service
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Datamodel ubus backend to expose micro-service tree
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr +libeasy
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr
|
||||
@@ -183,7 +183,6 @@ define Package/bbf_configmngr/install
|
||||
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_default_reload.sh $(1)/etc/bbfdm/
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/critical_services.json $(1)/etc/bbfdm/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,47 +1,23 @@
|
||||
{
|
||||
"usp": [
|
||||
"/etc/config/firewall",
|
||||
"/etc/bbfdm/dmmap/dmmap_firewall",
|
||||
"/etc/config/network",
|
||||
"/etc/bbfdm/dmmap/IP",
|
||||
"/etc/bbfdm/dmmap/Ethernet",
|
||||
"/etc/bbfdm/dmmap/GRE",
|
||||
"/etc/bbfdm/dmmap/IPv6rd",
|
||||
"/etc/bbfdm/dmmap/PPP",
|
||||
"/etc/bbfdm/dmmap/Routing",
|
||||
"/etc/config/dhcp",
|
||||
"/etc/bbfdm/dmmap/DHCPv4",
|
||||
"/etc/bbfdm/dmmap/DHCPv6",
|
||||
"/etc/config/time",
|
||||
"/etc/bbfdm/dmmap/dmmap_time",
|
||||
"/etc/config/mapcontroller",
|
||||
"/etc/config/wireless",
|
||||
"/etc/bbfdm/dmmap/WiFi",
|
||||
"/etc/config/ieee1905",
|
||||
"/etc/config/mosquitto",
|
||||
"/etc/config/nginx",
|
||||
"/etc/config/netmode",
|
||||
"/etc/bbfdm/dmmap/dmmap_netmode"
|
||||
"firewall",
|
||||
"network",
|
||||
"dhcp",
|
||||
"time",
|
||||
"wireless",
|
||||
"ieee1905",
|
||||
"mapcontroller",
|
||||
"mosquitto",
|
||||
"nginx",
|
||||
"netmode"
|
||||
],
|
||||
"cwmp": [
|
||||
"/etc/config/firewall",
|
||||
"/etc/bbfdm/dmmap/dmmap_firewall",
|
||||
"/etc/config/network",
|
||||
"/etc/bbfdm/dmmap/IP",
|
||||
"/etc/bbfdm/dmmap/Ethernet",
|
||||
"/etc/bbfdm/dmmap/GRE",
|
||||
"/etc/bbfdm/dmmap/IPv6rd",
|
||||
"/etc/bbfdm/dmmap/PPP",
|
||||
"/etc/bbfdm/dmmap/Routing",
|
||||
"/etc/config/dhcp",
|
||||
"/etc/bbfdm/dmmap/DHCPv4",
|
||||
"/etc/bbfdm/dmmap/DHCPv6",
|
||||
"/etc/config/mapcontroller",
|
||||
"/etc/config/wireless",
|
||||
"/etc/bbfdm/dmmap/WiFi",
|
||||
"/etc/config/time",
|
||||
"/etc/bbfdm/dmmap/dmmap_time",
|
||||
"/etc/config/netmode",
|
||||
"/etc/bbfdm/dmmap/dmmap_netmode"
|
||||
"firewall",
|
||||
"network",
|
||||
"dhcp",
|
||||
"mapcontroller",
|
||||
"wireless",
|
||||
"time",
|
||||
"netmode"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -10,10 +10,19 @@ log() {
|
||||
echo "${@}"|logger -t bbf.config -p info
|
||||
}
|
||||
|
||||
create_needed_directories()
|
||||
{
|
||||
mkdir -p /tmp/bbfdm/.cwmp
|
||||
mkdir -p /tmp/bbfdm/.usp
|
||||
mkdir -p /tmp/bbfdm/.bbfdm
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
local log_level
|
||||
|
||||
create_needed_directories
|
||||
|
||||
config_load bbfdm
|
||||
config_get log_level "reload_handler" log_level 2
|
||||
|
||||
@@ -27,6 +36,6 @@ start_service()
|
||||
service_triggers() {
|
||||
for config_file in /etc/config/*; do
|
||||
config_name=$(basename "$config_file")
|
||||
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh "$config_name"
|
||||
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh
|
||||
done
|
||||
}
|
||||
|
||||
@@ -5,12 +5,6 @@ config BRIDGEMNGR_BRIDGE_VLAN
|
||||
help
|
||||
Set this option to use bridge-vlan as backend for VLAN objects.
|
||||
|
||||
config BRIDGEMNGR_COPY_PBITS
|
||||
bool "Copy pbits from cvlan to svlan"
|
||||
default y
|
||||
help
|
||||
Set this option to copy cvlan pbits to svlan pbits by default (driver vlan).
|
||||
|
||||
config BRIDGEMNGR_BRIDGE_VENDOR_EXT
|
||||
bool "Use bridge BBF vendor extensions"
|
||||
default y
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bridgemngr
|
||||
PKG_VERSION:=1.1.6
|
||||
PKG_VERSION:=1.0.18.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr.git
|
||||
PKG_SOURCE_VERSION:=882f8c8cc9a97372297d192cc916c4f8ffe7c25a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr
|
||||
PKG_SOURCE_VERSION:=71ed529be038392071b0399bcfe9d46e89d3cb46
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -51,10 +51,6 @@ ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VLAN),y)
|
||||
TARGET_CFLAGS += -DBRIDGE_VLAN_BACKEND
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_COPY_PBITS),y)
|
||||
TARGET_CFLAGS+=-DBRIDGEMNGR_COPY_PBITS
|
||||
endif
|
||||
|
||||
define Package/bridgemngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.23
|
||||
PKG_VERSION:=2.1.20
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=f54550f2d587a701c0a8d5cac4a0910a99ce92cf
|
||||
PKG_SOURCE_VERSION:=a5e57962938ca143ede65d92be90b6e9fce66e15
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -4,16 +4,4 @@ config DECOLLECTOR_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 6
|
||||
|
||||
config DECOLLECTOR_BUILD_TR181_PLUGIN
|
||||
bool "Build TR-181 mapping module (responsible for Device.WiFi.DataElements.)"
|
||||
default y
|
||||
|
||||
config DECOLLECTOR_VENDOR_EXTENSIONS
|
||||
bool "Iopsys vendor extensions for Device.WiFi.DataElements."
|
||||
default y
|
||||
|
||||
config DECOLLECTOR_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=6.2.3.8
|
||||
PKG_VERSION:=6.2.1.14
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8396091a83aefaf8423dfd41a957b04f3ed821e7
|
||||
PKG_SOURCE_VERSION:=d9ff69760bc34dd3928fa784dfb3116bfe3f95af
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -24,7 +24,6 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
|
||||
|
||||
define Package/decollector
|
||||
SECTION:=utils
|
||||
@@ -67,18 +66,6 @@ MAKE_PATH:=src
|
||||
|
||||
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_DECOLLECTOR_EASYMESH_VERSION)
|
||||
|
||||
ifeq ($(CONFIG_DECOLLECTOR_BUILD_TR181_PLUGIN),y)
|
||||
MAKE_FLAGS += DECOLLECTOR_BUILD_TR181_PLUGIN=y
|
||||
ifeq ($(CONFIG_DECOLLECTOR_VENDOR_EXTENSIONS),y)
|
||||
TARGET_CFLAGS += -DDECOLLECTOR_VENDOR_EXTENSIONS
|
||||
ifeq ($(CONFIG_DECOLLECTOR_VENDOR_PREFIX),"")
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
else
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_DECOLLECTOR_VENDOR_PREFIX)\\\"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
EXECS := \
|
||||
$(if $(CONFIG_PACKAGE_decollector),decollector)
|
||||
|
||||
@@ -89,7 +76,6 @@ define Package/decollector/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/decollector.init $(1)/etc/init.d/decollector
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/decollector $(1)/usr/sbin/
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,decollector))
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"enable": "1",
|
||||
"service_name": "decollector",
|
||||
"unified_daemon": true,
|
||||
"services": [
|
||||
{
|
||||
"parent_dm": "Device.WiFi.",
|
||||
"object": "DataElements"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"loglevel": "3"
|
||||
},
|
||||
"apply_handler": {
|
||||
"uci": [
|
||||
{
|
||||
"file": [
|
||||
"mapcontroller"
|
||||
],
|
||||
"external_handler": "/etc/wifidmd/bbf_config_reload.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.7.13
|
||||
PKG_VERSION:=3.7.10
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5c2720563b3ed889e9d4de6fdb9b0f6a9d584094
|
||||
PKG_SOURCE_VERSION:=1f851980a6ba616df54f79930225f8bcd563b711
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dhcpmngr
|
||||
PKG_VERSION:=1.1.6
|
||||
PKG_VERSION:=1.0.10
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
|
||||
PKG_SOURCE_VERSION:=74d96cd70119e4ea08767d68b45b4922162d0328
|
||||
PKG_SOURCE_VERSION:=e238e47fa13153c5b1890056b0d09c65879de8c5
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -11,12 +11,11 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dmcli
|
||||
PKG_LICENSE:=PROPRIETARY GENEXIS
|
||||
PKG_VERSION:=1.9.6
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.9.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/gnx/dmcli.git
|
||||
PKG_SOURCE_VERSION:=f03188eff6c2cab59e4c8f18a435c940ff5043f5
|
||||
PKG_SOURCE_VERSION:=2139e81d0faca09fe1832c503297ef75ea76d6eb
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
|
||||
PKG_SOURCE_VERSION:=83e485fae8905f9061257264cf43ea41e47743a6
|
||||
PKG_SOURCE_VERSION:=448d278734a824f9d4ad1e7a55acd16c222d4c7e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=3.1.4
|
||||
PKG_VERSION:=3.0.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_SOURCE_VERSION:=0283fb5cb74a7baca46c4360da680757c57c86ac
|
||||
PKG_SOURCE_VERSION:=0bcfd98d64b5bd8d3162944e2abd5740f9bf4b92
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -10,14 +10,19 @@ PKG_NAME:=fdtextract
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/fdtextract.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7917dbcb29724476cd46164eec29848df1e5fb67
|
||||
PKG_SOURCE_VERSION:=e3cefda3b26c9aea3021b20725ce7b31b33eebc4
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -35,7 +40,9 @@ endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdtextract $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/fdtextract
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -8,5 +8,11 @@ config FIREWALLMNGR_PORT_TRIGGER
|
||||
help
|
||||
Set this option to include support for PortTrigger object.
|
||||
|
||||
config FIREWALLMNGR_NAT_INTERFACE_SETTING
|
||||
bool "Include Device.NAT.InterfaceSetting"
|
||||
default y
|
||||
help
|
||||
Set this option to include support for NAT InterfaceSetting object.
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=firewallmngr
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.0.9.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=30319c67fb4db285a2bcd272b1c10bc040eecf19
|
||||
PKG_SOURCE_VERSION:=02dc90c48d996148b68d02632bac13a28d75cf25
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -52,6 +52,10 @@ ifeq ($(CONFIG_FIREWALLMNGR_PORT_TRIGGER),y)
|
||||
TARGET_CFLAGS += -DINCLUDE_PORT_TRIGGER
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FIREWALLMNGR_NAT_INTERFACE_SETTING),y)
|
||||
TARGET_CFLAGS += -DINCLUDE_NAT_IF_SETTING
|
||||
endif
|
||||
|
||||
define Package/firewallmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
|
||||
@@ -110,7 +110,7 @@ configure_send_op125() {
|
||||
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
[ -n "${sendopt}" ] && new_send_opt="$sendopt $opt125" || new_send_opt="$opt125"
|
||||
new_send_opt="$sendopt $opt125"
|
||||
uci -q set network."${intf}".sendopts="$new_send_opt"
|
||||
else
|
||||
new_send_opt="$sendopt$opt125"
|
||||
@@ -228,7 +228,7 @@ enable_dhcp_option125() {
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
[ -n "${reqopts}" ] && newreqopts="$reqopts 125" || newreqopts="125"
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${wan}".reqopts="$newreqopts"
|
||||
fi
|
||||
|
||||
|
||||
@@ -40,22 +40,22 @@ get_vivsoi() {
|
||||
|
||||
#hex-string 2 character=1 Byte
|
||||
# length in hex string will be twice of actual Byte length
|
||||
[ "${len}" -gt 8 ] || return
|
||||
[ "$len" -gt "8" ] || return
|
||||
|
||||
data="${opt125}"
|
||||
rem_len="${len}"
|
||||
while [ "${rem_len}" -gt 0 ]; do
|
||||
while [ $rem_len -gt 0 ]; do
|
||||
ent_id=${data:0:8}
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
|
||||
if [ "${ent_id}" -ne 3561 ]; then
|
||||
if [ $ent_id -ne 3561 ]; then
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -66,7 +66,7 @@ get_vivsoi() {
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
[ "${opt_len}" -eq 0 ] && return
|
||||
[ $opt_len -eq 0 ] && return
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
@@ -74,7 +74,7 @@ get_vivsoi() {
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
while [ "${sub_data_len}" -gt 0 ]; do
|
||||
while [ $sub_data_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${sub_data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
@@ -85,20 +85,20 @@ get_vivsoi() {
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# get the value of sub option starting 4 means starting after length
|
||||
sub_opt_val=${sub_data:4:"${sub_opt_len}"}
|
||||
sub_opt_val=${sub_data:4:${sub_opt_len}}
|
||||
|
||||
# assign the value found in sub option
|
||||
case "${sub_opt_id}" in
|
||||
"4")
|
||||
OUI=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
OUI=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
GW_DISCOVERED=1
|
||||
;;
|
||||
"5")
|
||||
SERIAL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
SERIAL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
GW_DISCOVERED=1
|
||||
;;
|
||||
"6")
|
||||
CLASS=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
CLASS=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
GW_DISCOVERED=1
|
||||
;;
|
||||
esac
|
||||
@@ -110,7 +110,7 @@ get_vivsoi() {
|
||||
sub_data_len=$((sub_data_len - sub_opt_end))
|
||||
|
||||
# fetch next sub option hex string
|
||||
sub_data=${sub_data:"${sub_opt_end}":"${sub_data_len}"}
|
||||
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
|
||||
done
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
@@ -131,13 +131,15 @@ send_host_query() {
|
||||
sleep 5
|
||||
|
||||
json_load "$(ubus call umdns browse)"
|
||||
if ! json_select discovered_services; then
|
||||
json_select discovered_services
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
json_cleanup
|
||||
loop=$(( loop - 1 ))
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! json_select _usp-agt-mqtt._tcp; then
|
||||
json_select _usp-agt-mqtt._tcp
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
json_cleanup
|
||||
loop=$(( loop - 1 ))
|
||||
continue
|
||||
@@ -154,7 +156,7 @@ send_host_query() {
|
||||
|
||||
json_get_keys keys
|
||||
for key in $keys; do
|
||||
json_select "${key}"
|
||||
json_select $key
|
||||
json_get_var _host host ""
|
||||
|
||||
if [ -z "${_host}" ] || [[ "${sent_host}" =~ " ${_host}" ]]; then
|
||||
@@ -164,10 +166,9 @@ send_host_query() {
|
||||
|
||||
sent_host="${sent_host} ${_host}"
|
||||
cmd="ubus call umdns query '{\"question\":\"$_host\",\"interface\":\"$intf\"}'"
|
||||
sh -c "${cmd}"
|
||||
eval $cmd
|
||||
resp=0
|
||||
json_select ..
|
||||
sleep 2 # umdns query sometime takes time to resolve so adding some sleep
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
@@ -184,29 +185,32 @@ get_usp_agent_id() {
|
||||
fi
|
||||
|
||||
json_load "$(ubus call umdns browse)"
|
||||
if ! json_select discovered_services; then
|
||||
json_select discovered_services
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
json_cleanup
|
||||
echo "${ID}"
|
||||
echo ${ID}
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! json_select _usp-agt-mqtt._tcp; then
|
||||
json_select _usp-agt-mqtt._tcp
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
json_cleanup
|
||||
echo "${ID}"
|
||||
echo ${ID}
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_get_keys keys
|
||||
for key in $keys; do
|
||||
json_select "${key}"
|
||||
if ! json_select "${family}"; then
|
||||
json_select $key
|
||||
json_select $family
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
|
||||
json_get_keys ips
|
||||
for ip in $ips; do
|
||||
json_get_var ip_val "${ip}"
|
||||
json_get_var ip_val $ip
|
||||
if [ "${ip_val}" != "${dhcp_ip}" ]; then
|
||||
continue
|
||||
fi
|
||||
@@ -215,8 +219,8 @@ get_usp_agent_id() {
|
||||
json_select txt
|
||||
json_get_keys txts
|
||||
for _txt in $txts; do
|
||||
json_get_var text_val "${_txt}"
|
||||
if [[ "${text_val:0:3}" = "ID=" ]]; then
|
||||
json_get_var text_val $_txt
|
||||
if [[ "${text_val:0:3}" == "ID=" ]]; then
|
||||
ID="${text_val:3}"
|
||||
break
|
||||
fi
|
||||
@@ -234,16 +238,16 @@ get_usp_agent_id() {
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
echo "${ID}"
|
||||
echo ${ID}
|
||||
}
|
||||
|
||||
get_mac_address() {
|
||||
ip="${1}"
|
||||
device="${2}"
|
||||
|
||||
mac=$(grep "${ip}" /proc/net/arp | awk '{print $4}')
|
||||
mac="$(cat /proc/net/arp | grep $ip | awk '{print $4}')"
|
||||
if [ -z "${mac}" ]; then
|
||||
arp_resp=$(arping -b -f -c 5 -I "${device}" "${ip}" | grep 'Unicast reply from' | awk '{print $5}')
|
||||
arp_resp="$(arping -b -f -c 5 -I $device $ip | grep 'Unicast reply from' | awk '{print $5}')"
|
||||
if [ -n "${arp_resp}" ]; then
|
||||
mac=${arp_resp:1:-1}
|
||||
fi
|
||||
@@ -256,7 +260,7 @@ send_unknown_gw_event() {
|
||||
mac="${1}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.unknown '{\"hwaddr\":\"$mac\"}'"
|
||||
sh -c "${cmd}"
|
||||
eval $cmd
|
||||
}
|
||||
|
||||
send_cwmp_gw_event() {
|
||||
@@ -265,14 +269,14 @@ send_cwmp_gw_event() {
|
||||
serial="${3}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.cwmp '{\"oui\":\"$oui\",\"class\":\"$class\",\"serial\":\"$serial\"}'"
|
||||
sh -c "${cmd}"
|
||||
eval $cmd
|
||||
}
|
||||
|
||||
send_usp_gw_event() {
|
||||
endpoint="${1}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.usp '{\"endpoint\":\"$endpoint\"}'"
|
||||
sh -c "${cmd}"
|
||||
eval $cmd
|
||||
}
|
||||
|
||||
config_load gateway
|
||||
@@ -283,13 +287,13 @@ if [ "${enable}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
if [ "${1}" = "deconfig" ]; then
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ "${1}" == "deconfig" ]; then
|
||||
rm -rf /var/state/gwinfo
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_load "$(ifstatus "${INTERFACE}")"
|
||||
json_load "$(ifstatus ${INTERFACE})"
|
||||
json_get_var dev_name device ""
|
||||
json_select data
|
||||
json_get_var dhcp_ip dhcpserver ""
|
||||
@@ -299,7 +303,7 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
MAC=$(get_mac_address "${dhcp_ip}" "${dev_name}")
|
||||
MAC="$(get_mac_address $dhcp_ip $dev_name)"
|
||||
|
||||
mkdir -p /var/state
|
||||
touch /var/state/gwinfo
|
||||
@@ -322,8 +326,8 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
len=$(echo -n "${opt125}" | wc -c)
|
||||
get_vivsoi "${opt125}" "${len}"
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
get_vivsoi "$opt125" "$len"
|
||||
|
||||
if [ "${GW_DISCOVERED}" -eq 0 ]; then
|
||||
send_unknown_gw_event "${MAC}"
|
||||
@@ -337,18 +341,19 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
uci -q -c /var/state commit gwinfo
|
||||
|
||||
# Check for USP parameters
|
||||
if ! ubus -t 15 wait_for umdns; then
|
||||
ubus -t 15 wait_for umdns
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
resp=$(send_host_query "${dev_name}")
|
||||
resp=$(send_host_query $dev_name)
|
||||
if [ "${resp}" -ne 0 ]; then
|
||||
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
ID=$(get_usp_agent_id "${dhcp_ip}")
|
||||
ID="$(get_usp_agent_id $dhcp_ip)"
|
||||
if [ -z "${ID}" ]; then
|
||||
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
|
||||
return 0
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.4.3
|
||||
PKG_VERSION:=1.3.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=667866b8149d3df83a05536319eac02aee0b6d75
|
||||
PKG_SOURCE_VERSION:=624fee52af9cce08c6c69a5f7dd2191691d61aa8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.10.10
|
||||
PKG_VERSION:=9.9.9.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=63251b6c9789b1428604af0a5c1d23d32d14a8b8
|
||||
PKG_SOURCE_VERSION:=cef78dc528690386caac5a7ff6c1afca6dd3d315
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -31,6 +31,7 @@ config cpe 'cpe'
|
||||
option bind_retries '5'
|
||||
option userid '' #$OUI-$SER
|
||||
option passwd ''
|
||||
option port '7547'
|
||||
option provisioning_code ''
|
||||
option amd_version '5'
|
||||
# compression possible configs: InstanceNumber, InstanceAlias
|
||||
|
||||
@@ -133,56 +133,9 @@ add_firewall_rule() {
|
||||
fi
|
||||
}
|
||||
|
||||
remove_port_protection() {
|
||||
local enabled chain rule rule_num
|
||||
|
||||
config_get enabled "${1}" "${2}"
|
||||
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
config_get zonename "$1" name
|
||||
[ -n "$zonename" ] || return 0
|
||||
|
||||
chain='prerouting_'$zonename'_rule'
|
||||
|
||||
while rule=$(iptables -w -t nat -nL "$chain" --line-numbers | grep -m 1 -w CWMP_Port_protection); do
|
||||
rule_num=${rule%%[$' \t']*}
|
||||
iptables -w -t nat -D "$chain" "$rule_num"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup_port_protection() {
|
||||
config_load firewall
|
||||
config_foreach remove_port_protection zone masq
|
||||
}
|
||||
|
||||
install_port_protection() {
|
||||
local PORT="${3}"
|
||||
local enabled zonename chain
|
||||
|
||||
config_get enabled "${1}" "${2}"
|
||||
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
config_get zonename "${1}" name
|
||||
[ -n "$zonename" ] || return 0
|
||||
|
||||
chain='prerouting_'$zonename'_rule'
|
||||
|
||||
iptables -w -t nat -I "$chain" -p tcp --dport "$PORT" -j ACCEPT -m comment --comment=CWMP_Port_protection
|
||||
iptables -w -t nat -I "$chain" -p udp --dport "$PORT" -j ACCEPT -m comment --comment=CWMP_Port_protection
|
||||
fi
|
||||
}
|
||||
|
||||
add_port_protection() {
|
||||
config_load firewall
|
||||
config_foreach install_port_protection zone masq "${1}"
|
||||
}
|
||||
|
||||
configure_connection_req_rules() {
|
||||
app="${1}"
|
||||
|
||||
cleanup_port_protection
|
||||
|
||||
wan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
||||
wan="${wan:-wan}"
|
||||
|
||||
@@ -222,11 +175,8 @@ configure_connection_req_rules() {
|
||||
fi
|
||||
fi
|
||||
|
||||
port=$(uci -q -c /var/state get icwmp.cpe.port)
|
||||
if [ -z "${port}" ]; then
|
||||
log "cwmp cpe port not configured"
|
||||
exit 0
|
||||
fi
|
||||
port=$(uci -q get cwmp.cpe.port)
|
||||
port="${port:-7547}"
|
||||
|
||||
ipaddr=$(uci -q get cwmp.cpe.allowed_cr_ip)
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
@@ -247,8 +197,6 @@ configure_connection_req_rules() {
|
||||
# Close the ACS port at Lan side
|
||||
close_downstream_acs_port "${lan}" "${port}"
|
||||
fi
|
||||
|
||||
add_port_protection "${port}"
|
||||
}
|
||||
|
||||
load_zone_names
|
||||
|
||||
@@ -5,6 +5,7 @@ uci -q batch <<-EOT
|
||||
set firewall.cwmp=include
|
||||
set firewall.cwmp.path=/etc/icwmpd/firewall.cwmp
|
||||
set firewall.cwmp.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -16,12 +16,12 @@ get_opt43() {
|
||||
local opt43="$1"
|
||||
local len="$2"
|
||||
|
||||
[ "${len}" -gt 2 ] || return
|
||||
[ "$len" -gt "2" ] || return
|
||||
|
||||
first_byte=${opt43:0:2}
|
||||
first_byte=$(printf "%d\n" "0x$first_byte")
|
||||
|
||||
if [ "${len}" -ge 4 ] && [ "${first_byte}" -ge 1 ] && [ "${first_byte}" -le 4 ]; then
|
||||
if [ $len -ge 4 ] && [ $first_byte -ge 1 ] && [ $first_byte -le 4 ]; then
|
||||
# it is in encapsulated form
|
||||
# opt43 encapsulated vendor-specific option has data in below format
|
||||
# Code Len Data item Code Len Data item Code
|
||||
@@ -35,7 +35,7 @@ get_opt43() {
|
||||
data="${opt43}"
|
||||
rem_len="${len}"
|
||||
# parsing of suboption of option 43
|
||||
while [ "${rem_len}" -gt 0 ]; do
|
||||
while [ $rem_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
@@ -50,13 +50,13 @@ get_opt43() {
|
||||
|
||||
# assign the value found in sub option
|
||||
case "${sub_opt_id}" in
|
||||
"1") DHCP_ACS_URL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"1") DHCP_ACS_URL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"2") DHCP_PROV_CODE=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"2") DHCP_PROV_CODE=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"3") MIN_WAIT_INVL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"3") MIN_WAIT_INVL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"4") INVL_MULTIPLIER=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"4") INVL_MULTIPLIER=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -70,14 +70,13 @@ get_opt43() {
|
||||
rem_len=$((rem_len - sub_opt_end))
|
||||
done
|
||||
else
|
||||
DHCP_ACS_URL=$(echo -n "${opt43}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
DHCP_ACS_URL=$(echo -n $opt43 | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
fi
|
||||
}
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_intf cpe default_wan_interface "wan"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get_bool insecure_enable acs insecure_enable "0"
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
config_get min_wait_intvl acs dhcp_retry_min_wait_interval "0"
|
||||
config_get intvl_multi acs dhcp_retry_interval_multiplier "0"
|
||||
@@ -93,9 +92,9 @@ if [ "$discovery_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt43" ]; then
|
||||
len=$(echo -n "$opt43"|wc -c)
|
||||
len=$(printf "$opt43"|wc -c)
|
||||
get_opt43 "$opt43" "$len"
|
||||
fi
|
||||
|
||||
@@ -103,17 +102,6 @@ if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${insecure_enable}" -eq "0" ]; then
|
||||
case $DHCP_ACS_URL in
|
||||
https://*)
|
||||
log "ACS url $DHCP_ACS_URL has https"
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
sec=$(uci -q get cwmp.acs)
|
||||
|
||||
if [ -z "${sec}" ]; then
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.7.44
|
||||
PKG_VERSION:=8.7.40
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=29ba8f04dc6bd7e77683352c0c71988f51fbadf8
|
||||
PKG_SOURCE_VERSION:=06e45ad44433b98b0630dab59d943fade7c24269
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -116,7 +116,7 @@ MAKE_PATH:=src
|
||||
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(CP) ./files/etc $(1)/
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"Device.IEEE1905.AL.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"{BBF_VENDOR_PREFIX}LocalOnlyMode": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"description": "Enable or disable interfaces from ieee1905.",
|
||||
"datatype": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ start_service() {
|
||||
validate_ieee1905_config || return 1;
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/ieee1905d" "-o" "/tmp/ieee1905.log" "-f"
|
||||
procd_set_param command "/usr/sbin/ieee1905d" "-ddddd" "-o" "/tmp/ieee1905.log"
|
||||
procd_set_param respawn
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param env IEEE1905_LOG_CMDU=1
|
||||
|
||||
@@ -4,7 +4,7 @@ PKG_NAME:=iopsys-analytics
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5ad41ca8eb5de887487feb7148b5dce44943218c
|
||||
PKG_SOURCE_VERSION:=25e32ac5a860aec6e53e3449565b71595073e014
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopsys-analytics.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqos
|
||||
PKG_VERSION:=7.2.111
|
||||
PKG_VERSION:=7.2.109
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE_VERSION:=2e4c6a9c27e0f4f68dfe7a5c930afefd8dc7119a
|
||||
PKG_SOURCE_VERSION:=4948d372c3d7e43a0ba9aee517dbb83b94bba3dc
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -65,7 +65,7 @@ define Package/libqos
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
MENU:=1
|
||||
TITLE:= QoS library (libqos)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_brcmbca:bcm963xx-bsp +TARGET_airoha:libuci
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_brcmbca:bcm963xx-bsp
|
||||
endef
|
||||
|
||||
define Package/libqos/config
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.8
|
||||
PKG_VERSION:=1.1.7
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=9763c574ec69e2aa492db4f1296d4bcd53776fba
|
||||
PKG_SOURCE_VERSION:=3a30086a68a3409f0396acb01380f91daabf7a2f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -25,5 +25,6 @@ db commit
|
||||
# configure the PCM for DECT/DCX81
|
||||
[ -f "/proc/device-tree/aliases/dcx81-uart" ] && {
|
||||
uci set dect.global.pcm_fsync='SHORT_LF'
|
||||
uci set dect.global.pcm_slot_start='8'
|
||||
uci set dect.global.dect_channel_start='3'
|
||||
}
|
||||
|
||||
@@ -1,32 +1,27 @@
|
||||
#
|
||||
# Copyright (C) 2019-2024 Iopsys
|
||||
# Copyright (C) 2025 Genexis Sweden AB
|
||||
# Copyright (C) 2020-2023 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.22.10
|
||||
PKG_VERSION:=7.13.10
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4759a74db66dd0b4bfa6707683129a317ae42779
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libwifi.git
|
||||
PKG_SOURCE_VERSION:=5e8d828c01ed7ab2feba9028b603dde9708cb656
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@genexis.eu>
|
||||
|
||||
MAKE_VERBOSE := 1
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
@@ -47,20 +42,10 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
|
||||
else ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TARGET_WIFI_TYPE=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET
|
||||
ifeq ($(CONFIG_TARGET_airoha_an7581),y)
|
||||
TARGET_CFLAGS +=-DCONFIG_MTK
|
||||
endif
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
ifeq ($(CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cx750),y)
|
||||
TARGET_WIFI_TYPE=MEDIATEK
|
||||
TARGET_CFLAGS +=-DCONFIG_MTK -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
|
||||
else ifeq ($(CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_mediatek_mt7987a-spim-nand-an8801sb),y)
|
||||
TARGET_WIFI_TYPE=MEDIATEK
|
||||
TARGET_CFLAGS +=-DCONFIG_MTK -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
|
||||
endif
|
||||
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_PLATFORM=IPQ95XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM
|
||||
@@ -82,7 +67,7 @@ endif
|
||||
PKG_BUILD_DEPENDS:=PACKAGE_kmod-mt7915e_en7523:mt76_en7523
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libwifi),)
|
||||
CMAKE_OPTIONS +=-DHAS_WIFI=ON
|
||||
TARGET_CFLAGS +=-DHAS_WIFI
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
|
||||
@@ -93,8 +78,18 @@ ifeq ($(CONFIG_LIBWIFI_SKIP_PROBES),y)
|
||||
TARGET_CFLAGS +=-DLIBWIFI_BRCM_SKIP_PROBES
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
CMAKE_OPTIONS += -DPLATFORM=$(TARGET_PLATFORM) -DWIFI_TYPE=$(TARGET_WIFI_TYPE)
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)" \
|
||||
PLATFORM="$(TARGET_PLATFORM)" \
|
||||
WIFI_TYPE="$(TARGET_WIFI_TYPE)" \
|
||||
subdirs="$(subdirs)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -102,39 +97,43 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/libwifiutils
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:= WiFi utility library (libwifiutils.so)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libopenssl
|
||||
endef
|
||||
|
||||
define Package/libwifiutils/description
|
||||
Library provides WiFi utility functions
|
||||
endef
|
||||
|
||||
define Package/libwifi
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:= WiFi HAL library (libwifi-7.so.m)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcm963xx-bsp
|
||||
define Package/libwifi-common
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libwifi
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/libwifi/description
|
||||
Library provides WiFi HAL APIs
|
||||
Library provides WiFi HAL APIs and WiFi common utility functions
|
||||
endef
|
||||
|
||||
define Package/libwifiutils
|
||||
$(call Package/libwifi-common)
|
||||
TITLE:= WiFi utility library (libwifiutils.so)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwifiutils
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/wifidefs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/wifiutils.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/libwifiutils*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifidefs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifiutils.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifiutils/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/libwifiutils*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/libwifi
|
||||
$(call Package/libwifi-common)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcm963xx-bsp
|
||||
endef
|
||||
|
||||
define Package/libwifi/config
|
||||
@@ -155,12 +154,13 @@ define Package/libwifi/config
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifiops.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifiops.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifi.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi-7*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi-7*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libwifiutils))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=09
|
||||
START=12
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ create_service_section() {
|
||||
append_conf " flush 1"
|
||||
append_conf " daemon off"
|
||||
append_conf " log_level info"
|
||||
append_conf " coro_stack_size 1048576"
|
||||
append_conf " coro_stack_size 24576"
|
||||
append_conf " parsers_file /etc/fluent-bit/parsers.conf"
|
||||
append_conf " hot_reload on"
|
||||
append_conf ""
|
||||
|
||||
@@ -63,12 +63,8 @@ config AGENT_CHECK_PARTIAL_WIFI_RELOAD
|
||||
bool "Option that allow SSID/PSK simple reload"
|
||||
default y
|
||||
|
||||
config DYNBH
|
||||
bool "Enable map-agent dynamic Ethernet backhaul management"
|
||||
default n
|
||||
|
||||
config DYNBH_DYNAMICALLY_PERSIST_CONTROLLER
|
||||
bool "Let map-agent through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
|
||||
config DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER
|
||||
bool "Let dynbhd through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
|
||||
|
||||
config AGENT_UNASSOC_STA_CONT_MONITOR
|
||||
bool "Enable continuos monitoring of unassociated clients"
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=6.5.0.9
|
||||
PKG_VERSION:=6.3.7.17
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=f4d201acde3320b1019c1831315e58a8ecb0290c
|
||||
PKG_SOURCE_VERSION:=7f71fafbec49fa4b25d1e8d07cfc1fee5b4bbab0
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -38,6 +38,14 @@ ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
|
||||
TARGET_CFLAGS += -DUSE_LIBDPP
|
||||
endif
|
||||
|
||||
define Package/dynbhd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dynamic Backhaul Daemon
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+ieee1905-map-plugin +map-agent
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_AGENT_ZEROTOUCH_DPP),y)
|
||||
TARGET_CFLAGS += -DZEROTOUCH_DPP
|
||||
endif
|
||||
@@ -46,6 +54,10 @@ define Package/map-agent/description
|
||||
This package provides EasyMesh R6 compliant Wi-Fi Multi-AP Agent.
|
||||
endef
|
||||
|
||||
define Package/dynbhd/description
|
||||
Dyanmic LAN/WAN port detection and loop avoidance.
|
||||
endef
|
||||
|
||||
define Package/map-agent/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
@@ -103,11 +115,7 @@ ifeq ($(CONFIG_AGENT_CHECK_PARTIAL_WIFI_RELOAD),y)
|
||||
TARGET_CFLAGS += -DCHECK_PARTIAL_WIFI_RELOAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DYNBH),y)
|
||||
TARGET_CFLAGS += -DDYNBH
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DYNBH_DYNAMICALLY_PERSIST_CONTROLLER),y)
|
||||
ifeq ($(CONFIG_DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER),y)
|
||||
TARGET_CFLAGS += -DPERSIST_CONTROLLER
|
||||
endif
|
||||
|
||||
@@ -120,10 +128,6 @@ MAKE_PATH:=src
|
||||
define Package/map-agent/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/* $(1)/
|
||||
ifeq ($(CONFIG_DYNBH),y)
|
||||
$(RM) $(1)/etc/hotplug.d/ethernet/map-dynamic-backhaul
|
||||
$(RM) $(1)/etc/hotplug.d/ethernet/map-topology-discovery
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/lib/wifi
|
||||
@@ -131,6 +135,15 @@ endif
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/dynbhd/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/lib/wifi/dynbhd
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/ethernet
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/dynbhd $(1)/usr/sbin/dynbhd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/api $(1)/lib/wifi/dynbhd/api
|
||||
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/map-dynamic-backhaul $(1)/etc/hotplug.d/ethernet/map-dynamic-backhaul
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -139,3 +152,4 @@ endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,map-agent))
|
||||
$(eval $(call BuildPackage,dynbhd))
|
||||
|
||||
@@ -17,7 +17,7 @@ config dynamic_backhaul
|
||||
option missing_bh_reconfig_timer '1800'
|
||||
|
||||
config controller_select
|
||||
option mode 'auto'
|
||||
option id 'auto'
|
||||
option probe_int '20'
|
||||
option retry_int '9'
|
||||
option autostart '1'
|
||||
|
||||
@@ -27,6 +27,11 @@ done
|
||||
al_brnet="${al_bridge:3}"
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
############## Dynamic Backhaul Daemon ##############
|
||||
if [ -n "$(which dynbhd)" ]; then
|
||||
exit 0
|
||||
fi
|
||||
########################################################
|
||||
|
||||
################ Dedicated ETH WAN Port ################
|
||||
wanport="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
|
||||
@@ -90,8 +95,7 @@ if [ "$LINK" = "up" ]; then
|
||||
config_foreach remove_from_bridge bsta
|
||||
config_foreach update_bstas bsta down
|
||||
|
||||
hwaddr="$(ifconfig $PORT | grep -i hwaddr | awk '{print $5}' | awk '{print tolower($0)}')"
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT" "$hwaddr"
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT"
|
||||
else
|
||||
/lib/wifi/multiap unset_uplink "eth"
|
||||
#rm -f "$map_bh_file"
|
||||
|
||||
@@ -7,6 +7,20 @@ USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
|
||||
MAP_DEV="map_dev"
|
||||
MAP_IF="map"
|
||||
|
||||
|
||||
start_dynbhd_service() {
|
||||
rm -f /var/run/multiap/multiap.backhaul
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/dynbhd"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
validate_agent_section() {
|
||||
uci_validate_section mapagent agent "agent" \
|
||||
'enabled:bool:true' \
|
||||
@@ -37,7 +51,7 @@ validate_cs_section() {
|
||||
|
||||
uci_validate_section mapagent $section "${section}" \
|
||||
'local:bool:false' \
|
||||
'mode:string' \
|
||||
'id:string' \
|
||||
'probe_int:range(0,1000):20' \
|
||||
'retry_int:range(0,255):3' \
|
||||
'autostart:bool:false'
|
||||
@@ -165,6 +179,17 @@ create_dir() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ -f /usr/sbin/dynbhd ]; then
|
||||
# Start dynbhd only if the device is operating in extender/repeater mode
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
if [ "${al_bridge:0:3}" = "br-" ]; then
|
||||
al_brnet="${al_bridge:3}"
|
||||
if [ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ]; then
|
||||
start_dynbhd_service
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
config_load "mapagent"
|
||||
validate_agent_config || return 1;
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
cfg=mapagent
|
||||
config_load $cfg
|
||||
|
||||
if uci -q get $cfg.agent.partial_wifi_reload >/dev/null; then
|
||||
uci -q set $cfg.agent.partial_wifi_reload='0'
|
||||
fi
|
||||
|
||||
if uci -q get $cfg.agent.chan_ch_relay_mcast >/dev/null; then
|
||||
uci -q set $cfg.agent.chan_ch_relay_mcast='0'
|
||||
fi
|
||||
|
||||
rename_dpp_uri() {
|
||||
local section="$1"
|
||||
local type device ifname band
|
||||
local ch_list=""
|
||||
|
||||
config_get type "$section" type
|
||||
config_get device "$section" device
|
||||
config_get ifname "$section" ifname
|
||||
config_get band "$section" band
|
||||
config_get chirp_interval "$section" chirp_interval
|
||||
|
||||
append_chan() {
|
||||
local val="$1"
|
||||
local chan_num="${val#*/}"
|
||||
ch_list="$ch_list $chan_num"
|
||||
}
|
||||
config_list_foreach "$section" chan append_chan
|
||||
|
||||
new_section=$(uci add "$cfg" dpp_chirp)
|
||||
[ -n "$type" ] && uci set "$cfg.$new_section.type=$type"
|
||||
[ -n "$device" ] && uci set "$cfg.$new_section.device=$device"
|
||||
[ -n "$ifname" ] && uci set "$cfg.$new_section.ifname=$ifname"
|
||||
[ -n "$band" ] && uci set "$cfg.$new_section.band=$band"
|
||||
|
||||
if [ -n "$chirp_interval" ]; then
|
||||
uci set "${cfg}.${new_section}.chirp_interval=$chirp_interval"
|
||||
fi
|
||||
|
||||
for ch in $ch_list; do
|
||||
uci add_list "$cfg.$new_section.channel=$ch"
|
||||
done
|
||||
uci delete "$cfg.$section"
|
||||
}
|
||||
|
||||
uci -q delete "$cfg.@dpp_controller[0]"
|
||||
|
||||
config_foreach rename_dpp_uri dpp_uri
|
||||
|
||||
exit 0
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
adapt_cntlr_sel() {
|
||||
local section=$1
|
||||
id=$(uci -q get mapagent.@controller_select[0].id)
|
||||
|
||||
uci -q del mapagent.@controller_select[0].id
|
||||
|
||||
# re-apply any custom value
|
||||
[ -z "${id}" ] || uci -q set mapagent.@controller_select[0].mode="${id}"
|
||||
}
|
||||
|
||||
adapt_cntlr_sel
|
||||
@@ -10,11 +10,6 @@ network_mode="$(fw_printenv -n netmode)" # default is layer3
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)" # default is full
|
||||
disable_mlo="$(fw_printenv -n disable_mlo)"
|
||||
|
||||
is_logan() {
|
||||
[ -d /sys/module/mt_wifi ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
is_airoha() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
strings /proc/device-tree/compatible | grep -qE '^(econet,|airoha,)'; return
|
||||
@@ -69,45 +64,45 @@ generate_multiap_config() {
|
||||
device="$dev"
|
||||
|
||||
ifprefix_radio=""
|
||||
if is_logan; then
|
||||
uci set mapagent.agent.mld_ap_prefix="bss"
|
||||
uci set mapagent.agent.mld_sta_prefix="sta"
|
||||
ifname_sta=""
|
||||
case "$band" in
|
||||
2g)
|
||||
ifprefix="ra%"
|
||||
ifname="ra0"
|
||||
ifname_bh="ra1"
|
||||
ifname_sta="apcli0"
|
||||
;;
|
||||
5g)
|
||||
ifprefix="rai%"
|
||||
ifname="rai0"
|
||||
ifname_bh="rai1"
|
||||
ifname_sta="apclii0"
|
||||
;;
|
||||
6g)
|
||||
ifprefix="rax%"
|
||||
ifname="rax0"
|
||||
ifname_bh="rax1"
|
||||
ifname_sta="apclix0"
|
||||
;;
|
||||
esac
|
||||
ifprefix_radio="${ifprefix}"
|
||||
if [ "${network_mode}" == "extender" ]; then
|
||||
ifname="${ifname_sta}"
|
||||
fi
|
||||
|
||||
[ "$disable_mlo" == "1" ] || {
|
||||
uci set wireless.$dev.mlo="1"
|
||||
uci set wireless.$dev.mlo_capable="1"
|
||||
}
|
||||
elif is_airoha; then
|
||||
if is_airoha; then
|
||||
if [ -d "/sys/module/mt76" ]; then
|
||||
ifprefix="wlan%_%"
|
||||
ifname="wlan${devidx}_0"
|
||||
ifname_bh="wlan${devidx}_1"
|
||||
else
|
||||
uci set mapagent.agent.mld_prefix="bss"
|
||||
ifname_sta=""
|
||||
case "$band" in
|
||||
2g)
|
||||
ifprefix="ra%"
|
||||
ifname="ra0"
|
||||
ifname_bh="ra1"
|
||||
ifname_sta="apcli0"
|
||||
;;
|
||||
5g)
|
||||
ifprefix="rai%"
|
||||
ifname="rai0"
|
||||
ifname_bh="rai1"
|
||||
ifname_sta="apclii0"
|
||||
;;
|
||||
6g)
|
||||
ifprefix="rax%"
|
||||
ifname="rax0"
|
||||
ifname_bh="rax1"
|
||||
ifname_sta="apclix0"
|
||||
;;
|
||||
esac
|
||||
ifprefix_radio="${ifprefix}"
|
||||
if [ "${network_mode}" == "extender" ]; then
|
||||
ifname="${ifname_sta}"
|
||||
fi
|
||||
|
||||
[ "$disable_mlo" == "1" ] || {
|
||||
uci set wireless.$dev.mlo="1"
|
||||
uci set wireless.$dev.mlo_capable="1"
|
||||
}
|
||||
fi
|
||||
|
||||
uci set wireless.$dev.channels="$channels"
|
||||
uci commit wireless
|
||||
elif is_broadcom; then
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=6.4.4.16
|
||||
PKG_VERSION:=6.4.4.13
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=2f8d2afc604c090637acdb01e630e233cd9aceff
|
||||
PKG_SOURCE_VERSION:=bd0fb2b63830e19038d9495517c03fdc3900cdfa
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@genexis.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -4,10 +4,11 @@ config controller 'controller'
|
||||
option registrar '2 5 6'
|
||||
option debug '2'
|
||||
option bcn_metrics_max_num '10'
|
||||
option initial_channel_scan '0'
|
||||
option enable_ts '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
option stale_sta_timeout '20d'
|
||||
option stale_sta_timeout '30d'
|
||||
option de_collect_interval '60'
|
||||
list plugin 'zerotouch'
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ validate_controller_section() {
|
||||
'registrar:string' \
|
||||
'debug:range(0,16)' \
|
||||
'bcn_metrics_max_num:range(1,256)' \
|
||||
'initial_channel_scan:bool:true' \
|
||||
'resend_num:uinteger:0' \
|
||||
'allow_bgdfs:range(0,2629744)' \
|
||||
'stale_sta_timeout:string' \
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
cfg=mapcontroller
|
||||
config_load $cfg
|
||||
|
||||
uci -q get $cfg.controller.debug >/dev/null 2>&1 && \
|
||||
uci set $cfg.controller.debug='2'
|
||||
|
||||
allow_bgdfs=$(uci -q get $cfg.controller.allow_bgdfs || echo "0")
|
||||
channel_plan_val=$(uci -q get $cfg.controller.channel_plan || echo "0")
|
||||
|
||||
uci -q delete $cfg.controller.allow_bgdfs
|
||||
uci -q delete $cfg.controller.channel_plan
|
||||
|
||||
uci -q get $cfg.controller.stale_sta_timeout >/dev/null 2>&1 || \
|
||||
uci set $cfg.controller.stale_sta_timeout='30d'
|
||||
|
||||
if [ -f /usr/lib/mapcontroller/zerotouch.so ]; then
|
||||
uci -q del_list $cfg.controller.plugin='zerotouch'
|
||||
uci -q add_list $cfg.controller.plugin='zerotouch'
|
||||
fi
|
||||
|
||||
if ! uci show $cfg 2>/dev/null | grep -q "=channel_plan"; then
|
||||
section=$(uci add $cfg channel_plan)
|
||||
uci set $cfg.$section.preclear_dfs="$allow_bgdfs"
|
||||
uci set $cfg.$section.acs="$channel_plan_val"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
cfg="mapcontroller"
|
||||
config_load "$cfg"
|
||||
|
||||
used_ids=""
|
||||
|
||||
collect_used_ids() {
|
||||
local section="$1"
|
||||
local id
|
||||
|
||||
id=$(uci -q get ${cfg}.${section}.id)
|
||||
if [ -n "$id" ] && printf "%s" "$id" | grep -qE '^[0-9]+$'; then
|
||||
used_ids="$used_ids $id"
|
||||
fi
|
||||
}
|
||||
|
||||
# Find first available ID from 0 to INT32_MAX
|
||||
find_first_available_id() {
|
||||
local max_int=2147483647
|
||||
local expected=0
|
||||
local id
|
||||
|
||||
# Convert list to sorted unique list
|
||||
sorted_ids=$(printf "%s\n" $used_ids | sort -n | uniq)
|
||||
|
||||
for id in $sorted_ids; do
|
||||
if [ "$id" -eq "$expected" ]; then
|
||||
expected=$((expected + 1))
|
||||
elif [ "$id" -gt "$expected" ]; then
|
||||
# Found a gap -> return the gap
|
||||
echo "$expected"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
# If no gaps, next available is `expected`
|
||||
if [ "$expected" -le "$max_int" ]; then
|
||||
echo "$expected"
|
||||
else
|
||||
echo -1
|
||||
fi
|
||||
}
|
||||
|
||||
# Assign ID if missing
|
||||
add_qos_rule_id() {
|
||||
local section="$1"
|
||||
local id
|
||||
|
||||
id=$(uci -q get ${cfg}.${section}.id)
|
||||
if [ -z "$id" ]; then
|
||||
new_id=$(find_first_available_id)
|
||||
[ "$new_id" -ge 0 ] || return # No available ID
|
||||
uci -q set ${cfg}.${section}.id="$new_id"
|
||||
|
||||
used_ids="$used_ids $new_id"
|
||||
fi
|
||||
}
|
||||
|
||||
# Step 1: Collect all existing IDs
|
||||
config_foreach collect_used_ids qos_rule
|
||||
|
||||
# Step 2: Assign IDs to rules missing them
|
||||
config_foreach add_qos_rule_id qos_rule
|
||||
@@ -14,3 +14,5 @@ for sec in $sections; do
|
||||
|
||||
uci rename $cfg.$s=$sec
|
||||
done
|
||||
|
||||
uci commit $cfg
|
||||
|
||||
@@ -21,9 +21,21 @@ adapt_sta_steering() {
|
||||
uci -q del $cfg.@sta_steering[0].use_usta_metrics
|
||||
uci -q del $cfg.@sta_steering[0].bandsteer
|
||||
uci -q del $cfg.@sta_steering[0].diffsnr
|
||||
if [ -f /usr/lib/mapcontroller/rcpi.so ]; then
|
||||
uci -q del_list $cfg.@sta_steering[0].plugins="rcpi"
|
||||
uci -q add_list $cfg.@sta_steering[0].plugins="rcpi"
|
||||
fi
|
||||
|
||||
if [ -f /usr/lib/mapcontroller/rate.so ]; then
|
||||
uci -q del_list $cfg.@sta_steering[0].plugins="rate"
|
||||
uci -q add_list $cfg.@sta_steering[0].plugins="rate"
|
||||
fi
|
||||
|
||||
if [ -f /usr/lib/mapcontroller/bsteer.so ]; then
|
||||
uci -q del_list $cfg.@sta_steering[0].plugins="bsteer"
|
||||
uci -q add_list $cfg.@sta_steering[0].plugins="bsteer"
|
||||
fi
|
||||
|
||||
uci del_list $cfg.@sta_steering[0].plugins="rcpi"
|
||||
uci add_list $cfg.@sta_steering[0].plugins="rcpi"
|
||||
uci -q set $cfg.@sta_steering[0].plugins_enabled="1"
|
||||
uci -q set $cfg.@sta_steering[0].plugins_policy="any"
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-plugins
|
||||
PKG_VERSION:=1.2.7
|
||||
PKG_VERSION:=1.2.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -59,8 +59,7 @@ define Package/map-plugins
|
||||
endef
|
||||
|
||||
define Package/map-plugins/description
|
||||
Provides extra Multi-AP services viz. steering, channel-planning,
|
||||
self-organizing network, zero-touch onboarding etc.
|
||||
Provides extra Multi-AP services viz. steering, channel-planning, self-organizing network etc.
|
||||
endef
|
||||
|
||||
define Package/map-plugins/install
|
||||
@@ -71,11 +70,5 @@ define Build/Compile
|
||||
$(foreach p,$(plugins),$(call Build/Compile/map-plugins-$(p), $(1)))
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/map-plugins/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,map-plugins))
|
||||
$(eval $(foreach p,$(ppkg),$(call BuildPackage,$(p))))
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmngr
|
||||
PKG_VERSION:=1.2.4
|
||||
PKG_VERSION:=1.1.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/netmngr.git
|
||||
PKG_SOURCE_VERSION:=8240c6089cdd44f268db135920800b8fc1d65ca9
|
||||
PKG_SOURCE_VERSION:=6310f32b80f8abeccbf99ad55ce88792b19342d6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,380 +1,109 @@
|
||||
# Netmode - Network Mode Switching for OpenWrt/iopsys
|
||||
# Creating Custom Netmodes in IOWRT
|
||||
|
||||
**Version**: 1.1.11
|
||||
**License**: GPL-2.0-only
|
||||
**Maintainer**: iopsys
|
||||
|
||||
## Overview
|
||||
|
||||
Netmode is a network configuration management package for OpenWrt/iopsys-based routers that enables seamless switching between different WAN connection types. It provides a unified interface for managing network modes including DHCP, PPPoE, Static IP, and Bridge configurations.
|
||||
|
||||
### Key Features
|
||||
|
||||
- **Simple Mode Switching**: Change WAN connection type with a single command
|
||||
- **Multiple Mode Support**: DHCP, PPPoE, Static IP, and Bridged mode
|
||||
- **Automatic Configuration**: Handles network, firewall, DHCP, and multicast settings
|
||||
- **TR-069/USP Integration**: Remote management via BBF data model
|
||||
- **Extensible Architecture**: Easy to add custom network modes
|
||||
- **Safe Transitions**: Proper cleanup and validation during mode switches
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
# Install via opkg
|
||||
opkg update
|
||||
opkg install netmode
|
||||
|
||||
# Or build from source
|
||||
make package/feeds/iopsys/netmode/compile
|
||||
```
|
||||
|
||||
### Basic Usage
|
||||
|
||||
```bash
|
||||
# Check current mode
|
||||
cat /etc/netmodes/.last_mode
|
||||
|
||||
# Switch to DHCP mode
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
|
||||
# Switch to PPPoE mode
|
||||
uci set netmode.global.mode='routed-pppoe'
|
||||
uci set netmode.@supported_args[2].value='username@isp.com'
|
||||
uci set netmode.@supported_args[3].value='password'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
## Supported Modes
|
||||
|
||||
| Mode | Description | Use Case |
|
||||
|------|-------------|----------|
|
||||
| **routed-dhcp** | Router with DHCP WAN | Cable/Fiber internet with automatic IP |
|
||||
| **routed-pppoe** | Router with PPPoE WAN | DSL internet with authentication |
|
||||
| **routed-static** | Router with Static IP WAN | Business connections with fixed IP |
|
||||
| **bridged** | L2 Bridge Mode | Transparent bridge, no routing |
|
||||
|
||||
## Documentation
|
||||
|
||||
Comprehensive documentation is available in the following guides:
|
||||
|
||||
### For Users
|
||||
- **[USER_GUIDE.md](USER_GUIDE.md)** - Complete user guide with configuration examples
|
||||
- Getting started
|
||||
- Mode descriptions
|
||||
- Common use cases
|
||||
- Troubleshooting
|
||||
- FAQ
|
||||
|
||||
### For Developers
|
||||
- **[DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md)** - Developer documentation
|
||||
- Development environment setup
|
||||
- Code organization
|
||||
- API reference
|
||||
- Testing framework
|
||||
- Contributing guidelines
|
||||
|
||||
### For Implementers
|
||||
- **[IMPLEMENTATION_GUIDE.md](IMPLEMENTATION_GUIDE.md)** - Implementation details
|
||||
- Architecture overview
|
||||
- Creating custom modes
|
||||
- Environment variables
|
||||
- Hook system
|
||||
- Data model integration
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ Netmode System │
|
||||
├─────────────────────────────────────────┤
|
||||
│ UCI Config → Init Service → Mode Scripts│
|
||||
│ ↓ ↓ ↓ │
|
||||
│ Environment Pre-hooks UCI Copy │
|
||||
│ Variables ↓ ↓ │
|
||||
│ ↓ Mode Scripts Post-hooks │
|
||||
│ └──────────┴────────────┘ │
|
||||
│ Network Reconfiguration │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
### Components
|
||||
|
||||
- **Init Service** (`/etc/init.d/netmode`): Orchestrates mode switching
|
||||
- **Mode Scripts** (`/etc/netmodes/<mode>/scripts/`): Mode-specific configuration
|
||||
- **UCI Config** (`/etc/config/netmode`): Mode definitions and parameters
|
||||
- **Data Model** (`datamodel.json`): BBF TR-181 integration
|
||||
- **Hooks** (`/lib/netmode/{pre,post}/`): Pre/post mode switch scripts
|
||||
|
||||
## Configuration Examples
|
||||
|
||||
### DHCP with VLAN
|
||||
|
||||
```bash
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
uci set netmode.@supported_args[0].value='100' # VLAN ID
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### PPPoE with Custom DNS
|
||||
|
||||
```bash
|
||||
uci set netmode.global.mode='routed-pppoe'
|
||||
uci set netmode.@supported_args[2].value='user@isp.com'
|
||||
uci set netmode.@supported_args[3].value='password123'
|
||||
uci set netmode.@supported_args[6].value='8.8.8.8,8.8.4.4'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### Static IP Business Connection
|
||||
|
||||
```bash
|
||||
uci set netmode.global.mode='routed-static'
|
||||
uci set netmode.@supported_args[6].value='203.0.113.10'
|
||||
uci set netmode.@supported_args[7].value='255.255.255.0'
|
||||
uci set netmode.@supported_args[8].value='203.0.113.1'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
## Creating Custom Modes
|
||||
|
||||
Custom network modes can be added by following these steps:
|
||||
|
||||
1. **Create mode directory structure**:
|
||||
```bash
|
||||
mkdir -p /etc/netmodes/my-mode/scripts
|
||||
```
|
||||
|
||||
2. **Define mode in supported_modes.json**:
|
||||
```json
|
||||
{
|
||||
"name": "my-mode",
|
||||
"description": "My Custom Mode",
|
||||
"supported_args": [...]
|
||||
}
|
||||
```
|
||||
|
||||
3. **Create mode script**:
|
||||
```bash
|
||||
cat > /etc/netmodes/my-mode/scripts/10-my-mode << 'EOF'
|
||||
#!/bin/sh
|
||||
# Configuration logic here
|
||||
EOF
|
||||
chmod +x /etc/netmodes/my-mode/scripts/10-my-mode
|
||||
```
|
||||
|
||||
4. **Import to UCI and test**:
|
||||
```bash
|
||||
sh /etc/uci-defaults/40_netmode_populated_supported_modes
|
||||
uci set netmode.global.mode='my-mode'
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
See [IMPLEMENTATION_GUIDE.md](IMPLEMENTATION_GUIDE.md#creating-a-new-network-mode) for detailed instructions.
|
||||
|
||||
## TR-069/USP Integration
|
||||
|
||||
Netmode exposes a BBF TR-181 data model for remote management:
|
||||
|
||||
**Data Model Path**: `Device.X_IOPSYS_EU_NetMode.`
|
||||
|
||||
```
|
||||
Device.X_IOPSYS_EU_NetMode.
|
||||
├── Enable (boolean, r/w)
|
||||
├── Mode (string, r/w)
|
||||
├── SupportedModesNumberOfEntries (unsignedInt, r)
|
||||
└── SupportedModes.{i}.
|
||||
├── Name (string, r)
|
||||
├── Description (string, r)
|
||||
└── SupportedArguments.{i}.
|
||||
├── Name (string, r)
|
||||
├── Type (string, r)
|
||||
├── Required (boolean, r)
|
||||
└── Value (string, r/w)
|
||||
```
|
||||
|
||||
Example TR-069 operation:
|
||||
```xml
|
||||
<SetParameterValues>
|
||||
<ParameterList>
|
||||
<ParameterValueStruct>
|
||||
<Name>Device.X_IOPSYS_EU_NetMode.Mode</Name>
|
||||
<Value>routed-dhcp</Value>
|
||||
</ParameterValueStruct>
|
||||
</ParameterList>
|
||||
</SetParameterValues>
|
||||
```
|
||||
|
||||
## System Requirements
|
||||
|
||||
- **Platform**: OpenWrt/iopsys
|
||||
- **Dependencies**:
|
||||
- `dm-service` (BBF data model service)
|
||||
- `uci`
|
||||
- `procd`
|
||||
- `libubox` (jshn)
|
||||
- **Recommended**:
|
||||
- `logread` for monitoring
|
||||
- `firewall`, `odhcpd`, `mcast` for full functionality
|
||||
|
||||
## File Structure
|
||||
|
||||
```
|
||||
netmode/
|
||||
├── Makefile # Package build definition
|
||||
├── README.md # This file
|
||||
├── IMPLEMENTATION_GUIDE.md # Implementation guide
|
||||
├── DEVELOPER_GUIDE.md # Developer documentation
|
||||
├── USER_GUIDE.md # User documentation
|
||||
├── bbfdm_service.json # BBF service registration
|
||||
└── files/
|
||||
├── etc/
|
||||
│ ├── config/netmode # UCI configuration
|
||||
│ ├── init.d/netmode # Init script (START=11)
|
||||
│ ├── uci-defaults/ # First-boot scripts
|
||||
│ └── netmodes/
|
||||
│ ├── supported_modes.json # Mode definitions
|
||||
│ ├── routed-dhcp/scripts/
|
||||
│ ├── routed-pppoe/scripts/
|
||||
│ ├── routed-static/scripts/
|
||||
│ └── bridged/scripts/
|
||||
└── lib/
|
||||
├── netmode/
|
||||
│ ├── pre/ # Pre-switch hooks
|
||||
│ └── post/ # Post-switch hooks
|
||||
└── upgrade/keep.d/netmode # Sysupgrade preservation
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Mode Not Switching
|
||||
|
||||
```bash
|
||||
# Check if enabled
|
||||
uci get netmode.global.enabled
|
||||
|
||||
# Check logs
|
||||
logread | grep netmode
|
||||
|
||||
# Force mode change
|
||||
rm /etc/netmodes/.last_mode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### No Internet After Switch
|
||||
|
||||
```bash
|
||||
# Verify mode applied
|
||||
cat /etc/netmodes/.last_mode
|
||||
|
||||
# Check WAN status
|
||||
ifconfig wan
|
||||
ip route
|
||||
|
||||
# Restart network
|
||||
/etc/init.d/network restart
|
||||
```
|
||||
|
||||
### PPPoE Authentication Failed
|
||||
|
||||
```bash
|
||||
# Check credentials
|
||||
uci show network.wan | grep -E "username|password"
|
||||
|
||||
# Check logs
|
||||
logread | grep ppp
|
||||
|
||||
# Verify VLAN if required
|
||||
uci get network.wan.device
|
||||
```
|
||||
|
||||
See [USER_GUIDE.md](USER_GUIDE.md#troubleshooting) for comprehensive troubleshooting.
|
||||
|
||||
## Development
|
||||
|
||||
### Building
|
||||
|
||||
```bash
|
||||
# Clone repository
|
||||
cd feeds/iopsys/netmode
|
||||
|
||||
# Build package
|
||||
make package/feeds/iopsys/netmode/compile V=s
|
||||
|
||||
# Install on device
|
||||
scp bin/packages/*/iopsys/netmode_*.ipk root@192.168.1.1:/tmp/
|
||||
ssh root@192.168.1.1 "opkg install /tmp/netmode_*.ipk"
|
||||
```
|
||||
|
||||
### Testing
|
||||
|
||||
```bash
|
||||
# Run mode switch test
|
||||
./test-mode-switch.sh routed-dhcp
|
||||
|
||||
# Monitor logs
|
||||
logread -f | grep netmode
|
||||
|
||||
# Verify configuration
|
||||
uci show network
|
||||
cat /etc/netmodes/.last_mode
|
||||
```
|
||||
|
||||
### Contributing
|
||||
|
||||
Contributions are welcome! Please follow these steps:
|
||||
|
||||
1. Fork the repository
|
||||
2. Create a feature branch
|
||||
3. Make your changes
|
||||
4. Test thoroughly on target hardware
|
||||
5. Update documentation
|
||||
6. Submit a pull request
|
||||
|
||||
See [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md#contributing-guidelines) for detailed guidelines.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the GNU General Public License v2.0 only.
|
||||
|
||||
See `/LICENSE` for more information.
|
||||
|
||||
## Support
|
||||
|
||||
- **Documentation**: See guides in this repository
|
||||
- **Issues**: Contact iopsys development team
|
||||
- **Community**: OpenWrt and iopsys forums
|
||||
|
||||
## Changelog
|
||||
|
||||
### Version 1.1.11
|
||||
- Current stable release
|
||||
- Support for DHCP, PPPoE, Static IP, and Bridge modes
|
||||
- BBF TR-181 data model integration
|
||||
- Comprehensive documentation
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
- OpenWrt project for the underlying platform
|
||||
- iopsys for development and maintenance
|
||||
- Contributors and testers
|
||||
|
||||
## Related Projects
|
||||
|
||||
- [OpenWrt](https://openwrt.org/) - Linux operating system for embedded devices
|
||||
- [iopsys](https://www.iopsys.eu/) - Broadband device management
|
||||
- [BBF](https://www.broadband-forum.org/) - Broadband Forum standards
|
||||
|
||||
---
|
||||
|
||||
**For detailed information, please refer to the specific guides:**
|
||||
- Users: [USER_GUIDE.md](USER_GUIDE.md)
|
||||
- Developers: [DEVELOPER_GUIDE.md](DEVELOPER_GUIDE.md)
|
||||
- Implementers: [IMPLEMENTATION_GUIDE.md](IMPLEMENTATION_GUIDE.md)
|
||||
This guide provides developers with detailed instructions on how to create and manage custom network modes (netmodes) in IOWRT. The `netmode` script allows for flexible network configuration, and developers can define their own modes by structuring the necessary files and scripts within the `/etc/netmodes/` directory.
|
||||
|
||||
## Table of Contents
|
||||
1. [Overview of Netmodes](#overview-of-netmodes)
|
||||
2. [Directory Structure](#directory-structure)
|
||||
3. [Creating a Custom Netmode](#creating-a-custom-netmode)
|
||||
- [Step 1: Pre-Execution Scripts](#step-1-pre-execution-scripts)
|
||||
- [Step 2: UCI Configuration Files](#step-2-uci-configuration-files)
|
||||
- [Step 3: Custom Execution Scripts](#step-3-custom-execution-scripts)
|
||||
- [Step 4: Post-Execution Scripts](#step-4-post-execution-scripts)
|
||||
4. [Enabling and Switching Netmodes](#enabling-and-switching-netmodes)
|
||||
|
||||
## Overview of Netmodes
|
||||
|
||||
Netmodes in IOWRT provide a way to switch between different network configurations based on the needs of the environment. Developers can create custom netmodes by organizing scripts and configuration files in specific directories under `/etc/netmodes/<NETMODE_NAME>`.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
A custom netmode is defined within the `/etc/netmodes/<NETMODE_NAME>` directory, which should contain the following subdirectories:
|
||||
|
||||
- **/lib/netmode/pre/**: Generic scripts executed before the netmode-specific configurations are applied.
|
||||
- **/etc/netmodes/<NETMODE_NAME>/uci/**: Contains UCI configuration files that will be copied to `/etc/config/` during the application of the netmode.
|
||||
- **/etc/netmodes/<NETMODE_NAME>/scripts/**: Custom scripts specific to the netmode that are executed after the UCI configurations are applied.
|
||||
- **/lib/netmode/post/**: Generic scripts executed after the netmode-specific configurations are completed.
|
||||
|
||||
## Creating a Custom Netmode
|
||||
|
||||
To create a new netmode, follow these steps:
|
||||
|
||||
### Step 1: Pre-Execution Scripts
|
||||
|
||||
Scripts located in `/lib/netmode/pre/` are executed before any mode-specific actions. These are typically used for preparing the system or cleaning up configurations from the previous netmode.
|
||||
|
||||
- **Create Pre-Execution Scripts**:
|
||||
- Place your generic pre-execution scripts in `/lib/netmode/pre/`.
|
||||
- Example script (`/lib/netmode/pre/cleanup.sh`):
|
||||
```bash
|
||||
#!/bin/sh
|
||||
echo "Cleaning up old network configurations..."
|
||||
# Add commands here
|
||||
```
|
||||
|
||||
### Step 2: UCI Configuration Files
|
||||
|
||||
The UCI configuration files stored in `/etc/netmodes/<NETMODE_NAME>/uci/` will be copied to `/etc/config/`, effectively applying the desired network configuration.
|
||||
|
||||
- **Place UCI Config Files**:
|
||||
- Create UCI configuration files under `/etc/netmodes/<NETMODE_NAME>/uci/`.
|
||||
- Example (`/etc/netmodes/bridge/uci/network`):
|
||||
````bash
|
||||
config device 'br_lan'
|
||||
option name 'br-lan'
|
||||
option type 'bridge'
|
||||
option multicast_to_unicast '0'
|
||||
option bridge_empty '1'
|
||||
list ports 'eth1'
|
||||
list ports 'eth3'
|
||||
list ports 'eth4'
|
||||
|
||||
config interface 'lan'
|
||||
option proto 'dhcp'
|
||||
option device 'br-lan'
|
||||
option force_link '1'
|
||||
option reqopts '43 125'
|
||||
````
|
||||
|
||||
### Step 3: Custom Execution Scripts
|
||||
|
||||
After the UCI files are applied, any scripts in `/etc/netmodes/<NETMODE_NAME>/scripts/` are executed. These can be used to perform additional configuration tasks that are specific to the netmode.
|
||||
|
||||
- **Create Custom Scripts**:
|
||||
- Add scripts to `/etc/netmodes/<NETMODE_NAME>/scripts/`.
|
||||
- Example (`/etc/netmodes/bridge/scripts/setup_bridge.sh`):
|
||||
```bash
|
||||
#!/bin/sh
|
||||
echo "Setting up bridge mode..."
|
||||
# Additional configuration commands here
|
||||
```
|
||||
|
||||
### Step 4: Post-Execution Scripts
|
||||
|
||||
Finally, the generic scripts in `/lib/netmode/post/` are executed. These scripts typically finalize the setup or perform any necessary cleanups.
|
||||
|
||||
- **Create Post-Execution Scripts**:
|
||||
- Place scripts in `/lib/netmode/post/`.
|
||||
- Example script (`/lib/netmode/post/restart_services.sh`):
|
||||
```bash
|
||||
#!/bin/sh
|
||||
echo "Restarting network services..."
|
||||
# Add commands here
|
||||
```
|
||||
|
||||
## Enabling and Switching Netmodes
|
||||
|
||||
The netmode mechanism can be enabled or disabled via the UCI configuration, and you can switch between netmodes using UCI commands.
|
||||
|
||||
- **Enable Netmode**:
|
||||
```bash
|
||||
uci set netmode.global.enabled=1
|
||||
uci commit netmode
|
||||
```
|
||||
|
||||
- **Switch Netmode**:
|
||||
```bash
|
||||
uci set netmode.global.mode='<NETMODE_NAME>'
|
||||
uci commit netmode
|
||||
```
|
||||
|
||||
@@ -1,857 +0,0 @@
|
||||
# Netmode User Guide
|
||||
|
||||
## Table of Contents
|
||||
1. [Introduction](#introduction)
|
||||
2. [Getting Started](#getting-started)
|
||||
3. [Available Network Modes](#available-network-modes)
|
||||
4. [Configuration Methods](#configuration-methods)
|
||||
5. [Common Use Cases](#common-use-cases)
|
||||
6. [Troubleshooting](#troubleshooting)
|
||||
7. [FAQ](#faq)
|
||||
8. [Glossary](#glossary)
|
||||
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
### What is Netmode?
|
||||
|
||||
Netmode is a network configuration management system for iopsys-based routers that allows you to easily switch between different WAN (Wide Area Network) connection types without manual configuration.
|
||||
|
||||
### Why Use Netmode?
|
||||
|
||||
- **Simplicity**: Switch network modes with a single command
|
||||
- **Flexibility**: Support for multiple WAN connection types
|
||||
- **Consistency**: Ensures proper configuration of all related network services
|
||||
- **Remote Management**: Can be controlled via TR-069/USP protocols
|
||||
- **Safety**: Automatically handles complex network reconfigurations
|
||||
|
||||
### Supported Connection Types
|
||||
|
||||
- **DHCP**: Automatic IP configuration (most common for cable/fiber connections)
|
||||
- **PPPoE**: Username/password authentication (common for DSL connections)
|
||||
- **Static IP**: Manual IP configuration (business connections)
|
||||
- **Bridged Mode**: Bridge/modem mode (disable routing)
|
||||
|
||||
---
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Checking if Netmode is Installed
|
||||
|
||||
```bash
|
||||
# Check if netmode package is installed
|
||||
opkg list-installed | grep netmode
|
||||
|
||||
# Check netmode service status
|
||||
service netmode status
|
||||
```
|
||||
|
||||
Expected output:
|
||||
```
|
||||
netmode - 1.1.11-1 - Network Modes and Utils
|
||||
```
|
||||
|
||||
### Checking Current Mode
|
||||
|
||||
```bash
|
||||
# View current configuration
|
||||
uci show netmode.global
|
||||
|
||||
# Check active mode
|
||||
cat /etc/netmodes/.last_mode
|
||||
```
|
||||
|
||||
Example output:
|
||||
```
|
||||
netmode.global=netmode
|
||||
netmode.global.enabled='1'
|
||||
netmode.global.mode='routed-dhcp'
|
||||
```
|
||||
|
||||
### Viewing Available Modes
|
||||
|
||||
```bash
|
||||
# List all supported modes
|
||||
uci show netmode | grep "supported_modes.*name"
|
||||
```
|
||||
|
||||
Example output:
|
||||
```
|
||||
netmode.@supported_modes[0].name='routed-dhcp'
|
||||
netmode.@supported_modes[1].name='routed-pppoe'
|
||||
netmode.@supported_modes[2].name='routed-static'
|
||||
netmode.@supported_modes[3].name='bridged'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Available Network Modes
|
||||
|
||||
### 1. Routed DHCP Mode
|
||||
|
||||
**Mode Name**: `routed-dhcp`
|
||||
|
||||
**When to Use**:
|
||||
- Cable internet connection
|
||||
- Fiber internet connection
|
||||
- Any ISP that automatically provides IP configuration
|
||||
|
||||
**Features**:
|
||||
- Automatic IP address assignment
|
||||
- Built-in router (NAT)
|
||||
- Firewall enabled
|
||||
- DHCP server for local devices
|
||||
- IPv4 and IPv6 support
|
||||
|
||||
**Configuration Parameters**:
|
||||
- `vlanid` (optional): VLAN ID if required by ISP
|
||||
- `dns_servers` (optional): Custom DNS servers (comma-separated)
|
||||
|
||||
**Example Configuration**:
|
||||
```bash
|
||||
# Basic DHCP mode
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
|
||||
# DHCP with VLAN ID 100
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
# Find VLAN argument and set value
|
||||
uci set netmode.@supported_args[0].value='100'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 2. Routed PPPoE Mode
|
||||
|
||||
**Mode Name**: `routed-pppoe`
|
||||
|
||||
**When to Use**:
|
||||
- DSL internet connection
|
||||
- ISP requires username and password authentication
|
||||
- Connection uses PPPoE protocol
|
||||
|
||||
**Features**:
|
||||
- Username/password authentication
|
||||
- Built-in router (NAT)
|
||||
- Firewall enabled
|
||||
- DHCP server for local devices
|
||||
- Automatic MTU optimization
|
||||
|
||||
**Required Parameters**:
|
||||
- `username`: PPPoE username (provided by ISP)
|
||||
- `password`: PPPoE password (provided by ISP)
|
||||
|
||||
**Optional Parameters**:
|
||||
- `vlanid`: VLAN ID if required by ISP
|
||||
- `mtu`: Maximum transmission unit (default: 1492 for PPPoE)
|
||||
- `dns_servers`: Custom DNS servers (comma-separated)
|
||||
|
||||
**Example Configuration**:
|
||||
```bash
|
||||
# Set mode
|
||||
uci set netmode.global.mode='routed-pppoe'
|
||||
|
||||
# Set username (find correct argument index)
|
||||
uci set netmode.@supported_args[2].value='myuser@isp.com'
|
||||
|
||||
# Set password
|
||||
uci set netmode.@supported_args[3].value='mypassword'
|
||||
|
||||
# Optional: Set VLAN
|
||||
uci set netmode.@supported_args[4].value='100'
|
||||
|
||||
# Optional: Set MTU
|
||||
uci set netmode.@supported_args[5].value='1492'
|
||||
|
||||
# Apply configuration
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
**Important Notes**:
|
||||
- Device will reboot after configuration
|
||||
- Keep ISP credentials safe
|
||||
- Most DSL connections use VLAN ID 7 or 100 (check with ISP)
|
||||
- MTU typically 1492 for PPPoE (auto-configured)
|
||||
|
||||
---
|
||||
|
||||
### 3. Routed Static IP Mode
|
||||
|
||||
**Mode Name**: `routed-static`
|
||||
|
||||
**When to Use**:
|
||||
- Business internet connection with static IP
|
||||
- ISP provided specific IP address, subnet mask, and gateway
|
||||
- Fixed IP address required for services (web server, VPN, etc.)
|
||||
|
||||
**Features**:
|
||||
- Manual IP configuration
|
||||
- Built-in router (NAT)
|
||||
- Firewall enabled
|
||||
- DHCP server for local devices
|
||||
- Fixed WAN IP address
|
||||
|
||||
**Required Parameters**:
|
||||
- `ipaddr`: Static IP address (e.g., 93.21.0.104)
|
||||
- `netmask`: Subnet mask (e.g., 255.255.255.0)
|
||||
- `gateway`: Default gateway IP (e.g., 93.21.0.1)
|
||||
|
||||
**Optional Parameters**:
|
||||
- `vlanid`: VLAN ID if required
|
||||
- `dns_servers`: DNS servers (comma-separated, e.g., 8.8.8.8,8.8.4.4)
|
||||
|
||||
**Example Configuration**:
|
||||
```bash
|
||||
# Set mode
|
||||
uci set netmode.global.mode='routed-static'
|
||||
|
||||
# Set IP address
|
||||
uci set netmode.@supported_args[6].value='93.21.0.104'
|
||||
|
||||
# Set subnet mask
|
||||
uci set netmode.@supported_args[7].value='255.255.255.0'
|
||||
|
||||
# Set gateway
|
||||
uci set netmode.@supported_args[8].value='93.21.0.1'
|
||||
|
||||
# Optional: Set DNS servers
|
||||
uci set netmode.@supported_args[9].value='8.8.8.8,8.8.4.4'
|
||||
|
||||
# Apply configuration
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
**Important Notes**:
|
||||
- Use exact IP settings provided by ISP
|
||||
- Incorrect settings will result in no internet connectivity
|
||||
- DNS servers are optional but recommended
|
||||
- Device will reboot after configuration
|
||||
|
||||
---
|
||||
|
||||
### 4. Bridged Mode
|
||||
|
||||
**Mode Name**: `bridged`
|
||||
|
||||
**When to Use**:
|
||||
- Using router as a bridge/modem only
|
||||
- Another router handles routing and DHCP
|
||||
- ISP requires bridge mode
|
||||
- Cascading routers (not recommended, prefer this mode on upstream device)
|
||||
|
||||
**Features**:
|
||||
- All LAN and WAN ports bridged together
|
||||
- No routing (NAT disabled)
|
||||
- Firewall disabled
|
||||
- DHCP server disabled
|
||||
- Device acts as transparent bridge
|
||||
|
||||
**Configuration Parameters**:
|
||||
- No parameters required
|
||||
|
||||
**Example Configuration**:
|
||||
```bash
|
||||
# Set mode
|
||||
uci set netmode.global.mode='bridged'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
**Important Notes**:
|
||||
- Device will obtain IP from upstream router/ISP
|
||||
- Web interface may be inaccessible until device gets IP
|
||||
- To access device: connect directly and check DHCP leases on upstream router
|
||||
- Device will reboot after configuration
|
||||
- Use this mode carefully - you may lose access to the device
|
||||
|
||||
**Reverting from Bridge Mode**:
|
||||
If you lose access, connect via serial console or perform factory reset.
|
||||
|
||||
---
|
||||
|
||||
## Configuration Methods
|
||||
|
||||
### Method 1: UCI Command Line (SSH/Console)
|
||||
|
||||
**Step-by-step procedure**:
|
||||
|
||||
```bash
|
||||
# 1. Connect to device
|
||||
ssh root@192.168.1.1
|
||||
|
||||
# 2. View current configuration
|
||||
uci show netmode
|
||||
|
||||
# 3. Set desired mode
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
|
||||
# 4. Set any required parameters (example for PPPoE)
|
||||
uci set netmode.@supported_args[2].value='username@isp.com'
|
||||
uci set netmode.@supported_args[3].value='password123'
|
||||
|
||||
# 5. Save configuration
|
||||
uci commit netmode
|
||||
|
||||
# 6. Apply changes
|
||||
service netmode restart
|
||||
|
||||
# 7. Monitor logs (optional)
|
||||
logread -f | grep netmode
|
||||
```
|
||||
|
||||
### Method 2: TR-069/CWMP (Remote Management)
|
||||
|
||||
If your device is managed by an ACS (Auto Configuration Server):
|
||||
|
||||
**Get current mode**:
|
||||
```xml
|
||||
GetParameterValues
|
||||
Device.X_IOPSYS_EU_NetMode.Mode
|
||||
```
|
||||
|
||||
**Set PPPoE mode**:
|
||||
```xml
|
||||
SetParameterValues
|
||||
Device.X_IOPSYS_EU_NetMode.Mode = "routed-pppoe"
|
||||
Device.X_IOPSYS_EU_NetMode.SupportedModes.2.SupportedArguments.1.Value = "username@isp.com"
|
||||
Device.X_IOPSYS_EU_NetMode.SupportedModes.2.SupportedArguments.2.Value = "password123"
|
||||
```
|
||||
|
||||
**Trigger mode change**:
|
||||
```bash
|
||||
# On device (via TR-069 script)
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### Method 3: Web Interface (if available)
|
||||
|
||||
Some firmware may provide a web interface for netmode configuration.
|
||||
|
||||
Typical location: **Network → WAN → Connection Type**
|
||||
|
||||
---
|
||||
|
||||
## Common Use Cases
|
||||
|
||||
### Use Case 1: Switching from DHCP to PPPoE
|
||||
|
||||
**Scenario**: ISP changed from cable to DSL connection
|
||||
|
||||
```bash
|
||||
# 1. Connect to router
|
||||
ssh root@192.168.1.1
|
||||
|
||||
# 2. Find username and password argument indices
|
||||
uci show netmode | grep -A3 "name='username'"
|
||||
# Note the index numbers
|
||||
|
||||
# 3. Set mode and credentials
|
||||
uci set netmode.global.mode='routed-pppoe'
|
||||
uci set netmode.@supported_args[2].value='newuser@dsl-isp.com'
|
||||
uci set netmode.@supported_args[3].value='newpassword'
|
||||
|
||||
# 4. If ISP requires VLAN (e.g., VLAN 7)
|
||||
uci set netmode.@supported_args[4].value='7'
|
||||
|
||||
# 5. Apply
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
|
||||
# Device will reboot
|
||||
```
|
||||
|
||||
### Use Case 2: Adding Custom DNS Servers
|
||||
|
||||
**Scenario**: Want to use Google DNS or Cloudflare DNS
|
||||
|
||||
```bash
|
||||
# For DHCP mode
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
|
||||
# Find dns_servers argument index
|
||||
uci show netmode | grep -B2 "name='dns_servers'"
|
||||
|
||||
# Set custom DNS (Google DNS example)
|
||||
uci set netmode.@supported_args[1].value='8.8.8.8,8.8.4.4'
|
||||
|
||||
# Or Cloudflare DNS
|
||||
uci set netmode.@supported_args[1].value='1.1.1.1,1.0.0.1'
|
||||
|
||||
# Apply
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### Use Case 3: Configuring VLAN for ISP
|
||||
|
||||
**Scenario**: ISP requires VLAN tagging (common for fiber)
|
||||
|
||||
```bash
|
||||
# Identify your mode (example: DHCP)
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
|
||||
# Find VLAN argument
|
||||
uci show netmode | grep -B2 "name='vlanid'"
|
||||
|
||||
# Set VLAN ID (ISP will provide this, commonly 100, 7, or other)
|
||||
uci set netmode.@supported_args[0].value='100'
|
||||
|
||||
# Apply
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### Use Case 4: Setting Up Bridge Mode for Secondary Router
|
||||
|
||||
**Scenario**: Using dedicated router behind ISP modem
|
||||
|
||||
```bash
|
||||
# Configure device as bridge
|
||||
uci set netmode.global.mode='bridged'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
|
||||
# After reboot, device will be in bridge mode
|
||||
# Connect to it via the IP it receives from upstream
|
||||
```
|
||||
|
||||
### Use Case 5: Business Static IP Setup
|
||||
|
||||
**Scenario**: ISP provided static IP configuration
|
||||
|
||||
**ISP Information**:
|
||||
- IP Address: 203.0.113.10
|
||||
- Subnet Mask: 255.255.255.248
|
||||
- Gateway: 203.0.113.9
|
||||
- DNS: 203.0.113.1, 203.0.113.2
|
||||
|
||||
```bash
|
||||
# Set mode
|
||||
uci set netmode.global.mode='routed-static'
|
||||
|
||||
# Configure IP settings (find argument indices first)
|
||||
uci show netmode | grep -B2 "name='ipaddr'"
|
||||
uci show netmode | grep -B2 "name='netmask'"
|
||||
uci show netmode | grep -B2 "name='gateway'"
|
||||
|
||||
# Set values
|
||||
uci set netmode.@supported_args[6].value='203.0.113.10'
|
||||
uci set netmode.@supported_args[7].value='255.255.255.248'
|
||||
uci set netmode.@supported_args[8].value='203.0.113.9'
|
||||
uci set netmode.@supported_args[9].value='203.0.113.1,203.0.113.2'
|
||||
|
||||
# Apply
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Problem: No Internet After Mode Switch
|
||||
|
||||
**Symptoms**:
|
||||
- Cannot access websites
|
||||
- No WAN IP address
|
||||
- Local network works but no internet
|
||||
|
||||
**Diagnosis**:
|
||||
```bash
|
||||
# Check WAN interface status
|
||||
ifconfig wan
|
||||
|
||||
# Check if WAN has IP
|
||||
ip addr show wan
|
||||
|
||||
# Check routing table
|
||||
ip route
|
||||
|
||||
# Check DNS resolution
|
||||
nslookup google.com
|
||||
|
||||
# Check mode applied correctly
|
||||
cat /etc/netmodes/.last_mode
|
||||
uci show netmode.global.mode
|
||||
```
|
||||
|
||||
**Solutions**:
|
||||
|
||||
1. **For DHCP mode**:
|
||||
```bash
|
||||
# Restart network
|
||||
/etc/init.d/network restart
|
||||
|
||||
# Release and renew DHCP
|
||||
udhcpc -i wan -n
|
||||
```
|
||||
|
||||
2. **For PPPoE mode**:
|
||||
```bash
|
||||
# Check credentials
|
||||
uci show network.wan.username
|
||||
uci show network.wan.password
|
||||
|
||||
# Check PPPoE connection
|
||||
logread | grep pppd
|
||||
|
||||
# Restart PPPoE
|
||||
ifdown wan
|
||||
ifup wan
|
||||
```
|
||||
|
||||
3. **For Static IP mode**:
|
||||
```bash
|
||||
# Verify settings
|
||||
uci show network.wan
|
||||
|
||||
# Check if gateway is reachable
|
||||
ping -c 3 $(uci get network.wan.gateway)
|
||||
```
|
||||
|
||||
### Problem: Cannot Access Router After Mode Change
|
||||
|
||||
**Symptoms**:
|
||||
- Cannot reach router web interface
|
||||
- Cannot SSH to router
|
||||
- Router appears offline
|
||||
|
||||
**Solutions**:
|
||||
|
||||
1. **Check router IP address**:
|
||||
- Routed modes: Router should be at `192.168.1.1`
|
||||
- Bridged mode: Router gets IP from upstream device
|
||||
|
||||
2. **For bridged mode**:
|
||||
```bash
|
||||
# Connect to upstream router
|
||||
# Check DHCP leases for your device MAC address
|
||||
# Or connect via serial console
|
||||
```
|
||||
|
||||
3. **Factory reset** (last resort):
|
||||
- Hold reset button for 10 seconds
|
||||
- Device will reset to default configuration
|
||||
|
||||
### Problem: Mode Not Switching
|
||||
|
||||
**Symptoms**:
|
||||
- `.last_mode` not updated
|
||||
- Old configuration still active
|
||||
- No changes after restart
|
||||
|
||||
**Diagnosis**:
|
||||
```bash
|
||||
# Check if netmode is enabled
|
||||
uci get netmode.global.enabled
|
||||
|
||||
# Check logs
|
||||
logread | grep netmode
|
||||
|
||||
# Check if mode exists
|
||||
ls /etc/netmodes/*/scripts/
|
||||
```
|
||||
|
||||
**Solutions**:
|
||||
```bash
|
||||
# Enable netmode if disabled
|
||||
uci set netmode.global.enabled='1'
|
||||
uci commit netmode
|
||||
|
||||
# Force mode change by removing last_mode
|
||||
rm /etc/netmodes/.last_mode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### Problem: PPPoE Authentication Failure
|
||||
|
||||
**Symptoms**:
|
||||
- WAN interface shows "connecting" but never connects
|
||||
- Logs show authentication errors
|
||||
|
||||
**Diagnosis**:
|
||||
```bash
|
||||
# Check PPPoE logs
|
||||
logread | grep ppp
|
||||
|
||||
# Common errors:
|
||||
# - "authentication failed"
|
||||
# - "LCP timeout"
|
||||
# - "CHAP authentication failed"
|
||||
```
|
||||
|
||||
**Solutions**:
|
||||
```bash
|
||||
# Verify credentials (double-check with ISP)
|
||||
uci show network.wan.username
|
||||
uci show network.wan.password
|
||||
|
||||
# Some ISPs require VLAN tagging
|
||||
uci set netmode.@supported_args[4].value='7' # or ISP-specific VLAN
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
|
||||
# Check if service name is required (rare)
|
||||
uci set network.wan.service='ISP-SERVICE-NAME'
|
||||
uci commit network
|
||||
```
|
||||
|
||||
### Problem: Slow Internet After Mode Switch
|
||||
|
||||
**Symptoms**:
|
||||
- Internet works but very slow
|
||||
- High latency
|
||||
|
||||
**Solutions**:
|
||||
|
||||
1. **Check MTU settings** (especially for PPPoE):
|
||||
```bash
|
||||
# Set MTU for PPPoE
|
||||
uci set netmode.@supported_args[5].value='1492'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
2. **Check for DNS issues**:
|
||||
```bash
|
||||
# Test DNS resolution speed
|
||||
time nslookup google.com
|
||||
|
||||
# Use faster DNS
|
||||
uci set netmode.@supported_args[X].value='1.1.1.1,1.0.0.1'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
3. **Check WAN speed**:
|
||||
```bash
|
||||
# Install iperf3 and test
|
||||
opkg update
|
||||
opkg install iperf3
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## FAQ
|
||||
|
||||
### General Questions
|
||||
|
||||
**Q: Will I lose my configuration when switching modes?**
|
||||
|
||||
A: Netmode preserves most router settings (WiFi, firewall rules, etc.), but WAN-specific settings are reconfigured. Local network settings remain unchanged.
|
||||
|
||||
**Q: How long does a mode switch take?**
|
||||
|
||||
A: The mode switch itself takes a few seconds, but the device will reboot, which takes 1-2 minutes total.
|
||||
|
||||
**Q: Can I switch modes remotely?**
|
||||
|
||||
A: Yes, via SSH or TR-069/USP if configured. However, be careful with bridge mode as you may lose connectivity.
|
||||
|
||||
**Q: Do I need to reboot manually?**
|
||||
|
||||
A: No, the system automatically reboots after applying a new mode.
|
||||
|
||||
**Q: Can I schedule a mode switch?**
|
||||
|
||||
A: Yes, using cron:
|
||||
```bash
|
||||
# Switch to bridged mode at 2 AM
|
||||
echo "0 2 * * * uci set netmode.global.mode='bridged' && uci commit && service netmode restart" | crontab -
|
||||
```
|
||||
|
||||
### Mode-Specific Questions
|
||||
|
||||
**Q: Which mode should I use?**
|
||||
|
||||
A: Depends on your ISP:
|
||||
- Cable/Fiber without login: **routed-dhcp**
|
||||
- DSL with username/password: **routed-pppoe**
|
||||
- Static IP business connection: **routed-static**
|
||||
- Using as bridge only: **bridged**
|
||||
|
||||
**Q: Can I use PPPoE with VLAN?**
|
||||
|
||||
A: Yes, set both the mode and VLAN ID:
|
||||
```bash
|
||||
uci set netmode.global.mode='routed-pppoe'
|
||||
uci set netmode.@supported_args[4].value='100'
|
||||
```
|
||||
|
||||
**Q: What's the difference between routed and bridged mode?**
|
||||
|
||||
A:
|
||||
- **Routed modes**: Router performs NAT, runs firewall, provides DHCP to local network
|
||||
- **Bridged mode**: Router acts as transparent bridge, no NAT, no firewall, no DHCP
|
||||
|
||||
**Q: Can I customize the LAN IP in routed modes?**
|
||||
|
||||
A: Yes, but not through netmode. After mode switch, manually configure:
|
||||
```bash
|
||||
uci set network.lan.ipaddr='192.168.2.1'
|
||||
uci commit network
|
||||
/etc/init.d/network restart
|
||||
```
|
||||
|
||||
### Technical Questions
|
||||
|
||||
**Q: Where are my credentials stored?**
|
||||
|
||||
A: In `/etc/config/netmode` (UCI configuration). They are cleared from memory after mode application for security.
|
||||
|
||||
**Q: Can I create custom modes?**
|
||||
|
||||
A: Yes, advanced users can create custom modes. See the IMPLEMENTATION_GUIDE.md and DEVELOPER_GUIDE.md.
|
||||
|
||||
**Q: Does netmode support IPv6?**
|
||||
|
||||
A: Yes, routed-dhcp and routed-pppoe modes support IPv6 (DHCPv6).
|
||||
|
||||
**Q: What happens to firewall rules?**
|
||||
|
||||
A: Firewall is enabled for routed modes and disabled for bridged mode. Custom rules are preserved.
|
||||
|
||||
**Q: Can I use multiple WAN connections?**
|
||||
|
||||
A: Netmode manages the primary WAN. For multi-WAN setups, configure secondary WANs manually after netmode configuration.
|
||||
|
||||
---
|
||||
|
||||
## Glossary
|
||||
|
||||
**Bridge Mode**: Operating mode where the router acts as a transparent network bridge without routing or NAT.
|
||||
|
||||
**DHCP (Dynamic Host Configuration Protocol)**: Automatic IP address assignment protocol.
|
||||
|
||||
**DMZ (Demilitarized Zone)**: Network segment that sits between internal network and external network.
|
||||
|
||||
**DNS (Domain Name System)**: Service that translates domain names to IP addresses.
|
||||
|
||||
**Gateway**: Router IP address that connects local network to the internet.
|
||||
|
||||
**ISP (Internet Service Provider)**: Company providing internet access.
|
||||
|
||||
**LAN (Local Area Network)**: Internal network (devices in your home/office).
|
||||
|
||||
**MTU (Maximum Transmission Unit)**: Largest packet size that can be transmitted. PPPoE typically uses 1492.
|
||||
|
||||
**NAT (Network Address Translation)**: Technology allowing multiple devices to share one public IP address.
|
||||
|
||||
**PPPoE (Point-to-Point Protocol over Ethernet)**: Authentication protocol commonly used for DSL connections.
|
||||
|
||||
**Static IP**: Fixed IP address that doesn't change (opposite of DHCP).
|
||||
|
||||
**Subnet Mask**: Defines the network portion of an IP address (e.g., 255.255.255.0).
|
||||
|
||||
**TR-069/CWMP**: Remote management protocol for network devices.
|
||||
|
||||
**UCI (Unified Configuration Interface)**: OpenWrt configuration system.
|
||||
|
||||
**USP (User Services Platform)**: Next-generation device management protocol.
|
||||
|
||||
**VLAN (Virtual LAN)**: Network segmentation using VLAN tags (802.1Q).
|
||||
|
||||
**WAN (Wide Area Network)**: External network connection (internet).
|
||||
|
||||
---
|
||||
|
||||
## Getting Help
|
||||
|
||||
### Log Collection
|
||||
|
||||
When reporting issues, collect these logs:
|
||||
|
||||
```bash
|
||||
# System logs
|
||||
logread > /tmp/system.log
|
||||
|
||||
# Network configuration
|
||||
uci export network > /tmp/network.conf
|
||||
uci export netmode > /tmp/netmode.conf
|
||||
|
||||
# Interface status
|
||||
ifconfig > /tmp/interfaces.txt
|
||||
ip route > /tmp/routes.txt
|
||||
|
||||
# Copy to external system
|
||||
scp /tmp/*.{log,conf,txt} user@external-host:/path/
|
||||
```
|
||||
|
||||
### Support Resources
|
||||
|
||||
- **Documentation**: Check IMPLEMENTATION_GUIDE.md and DEVELOPER_GUIDE.md
|
||||
- **Community Forums**: OpenWrt and iopsys community forums
|
||||
- **Issue Tracker**: Report bugs to iopsys development team
|
||||
- **ISP Support**: Contact ISP for connection-specific parameters (VLAN, credentials, etc.)
|
||||
|
||||
### Before Contacting Support
|
||||
|
||||
Please have ready:
|
||||
1. Current mode: `cat /etc/netmodes/.last_mode`
|
||||
2. Netmode version: `opkg info netmode | grep Version`
|
||||
3. Error logs: `logread | grep netmode`
|
||||
4. Network configuration: `uci export netmode`
|
||||
5. What you're trying to achieve
|
||||
6. What you've already tried
|
||||
|
||||
---
|
||||
|
||||
## Quick Reference Card
|
||||
|
||||
### Common Commands
|
||||
|
||||
```bash
|
||||
# View current mode
|
||||
cat /etc/netmodes/.last_mode
|
||||
|
||||
# List available modes
|
||||
uci show netmode | grep "supported_modes.*name"
|
||||
|
||||
# Switch to DHCP
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
uci commit netmode && service netmode restart
|
||||
|
||||
# Switch to PPPoE
|
||||
uci set netmode.global.mode='routed-pppoe'
|
||||
uci set netmode.@supported_args[2].value='username'
|
||||
uci set netmode.@supported_args[3].value='password'
|
||||
uci commit netmode && service netmode restart
|
||||
|
||||
# Switch to Bridge
|
||||
uci set netmode.global.mode='bridged'
|
||||
uci commit netmode && service netmode restart
|
||||
|
||||
# View logs
|
||||
logread | grep netmode
|
||||
|
||||
# Reset to last mode
|
||||
rm /etc/netmodes/.last_mode
|
||||
service netmode restart
|
||||
```
|
||||
|
||||
### Emergency Recovery
|
||||
|
||||
```bash
|
||||
# If locked out after bridge mode
|
||||
# Connect via serial console and run:
|
||||
uci set netmode.global.mode='routed-dhcp'
|
||||
uci commit netmode
|
||||
service netmode restart
|
||||
|
||||
# Factory reset (hold reset button 10 seconds)
|
||||
# Or via console:
|
||||
firstboot -y && reboot
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Document Version**: 1.0
|
||||
**Package Version**: 1.1.11
|
||||
**Last Updated**: 2024
|
||||
**License**: GPL-2.0-only
|
||||
@@ -58,7 +58,7 @@
|
||||
"name": "mode"
|
||||
}
|
||||
},
|
||||
"linker_obj": "Device.{BBF_VENDOR_PREFIX}NetMode.SupportedModes.*.Name"
|
||||
"linker_obj": "Device.{BBF_VENDOR_PREFIX}NetMode.SupportedModes.[Name==@key]."
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -4,16 +4,12 @@ if [ ! -f /var/run/boot_complete ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f /etc/bbfdm/dmmap/PPP ]; then
|
||||
rm -f /etc/bbfdm/dmmap/PPP
|
||||
if [ -f /etc/bbfdm/dmmap/dmmap_ppp ]; then
|
||||
rm -f /etc/bbfdm/dmmap/dmmap_ppp
|
||||
fi
|
||||
|
||||
if [ -f /etc/bbfdm/dmmap/IP ]; then
|
||||
rm -f /etc/bbfdm/dmmap/IP
|
||||
fi
|
||||
|
||||
if [ -f /etc/bbfdm/dmmap/Ethernet ]; then
|
||||
rm -f /etc/bbfdm/dmmap/Ethernet
|
||||
if [ -f /etc/bbfdm/dmmap/dmmap_network ]; then
|
||||
rm -f /etc/bbfdm/dmmap/dmmap_network*
|
||||
fi
|
||||
|
||||
sleep 5
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=10.0.7.10
|
||||
PKG_VERSION:=10.0.0.22
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=c3b7c7653edb63326e7070b6891a95ad6cf7a2ee
|
||||
PKG_SOURCE_VERSION:=12991107039ee685fcd1000bb2649dd1c4b344ff
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -649,6 +649,11 @@ configure_obuspa() {
|
||||
if [ -f "${trust_cert}" ]; then
|
||||
procd_append_param command -t "${trust_cert}"
|
||||
fi
|
||||
else
|
||||
# Use default CA, if trust store not defined
|
||||
if [ -f "/etc/ssl/cert.pem" ]; then
|
||||
procd_append_param command -t "/etc/ssl/cert.pem"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${client_cert}" ]; then
|
||||
|
||||
@@ -53,7 +53,13 @@ add_mdns_advertise() {
|
||||
json_dump > /etc/umdns/obuspa_mdns.json
|
||||
}
|
||||
|
||||
role="$(get_device_role)"
|
||||
if [ "${role}" == "gateway" ]; then
|
||||
add_mdns_advertise
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
|
||||
if [ "${enable_obuspa}" -eq 1 ]; then
|
||||
role="$(get_device_role)"
|
||||
|
||||
if [ "${role}" == "gateway" ]; then
|
||||
add_mdns_advertise
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -19,11 +19,19 @@ get_access_role()
|
||||
|
||||
configure_dhcp_options() {
|
||||
local enabled inerface discovery
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get interface global interface
|
||||
config_get_bool discovery global dhcp_discovery 1
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${discovery}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
role="$(get_access_role)"
|
||||
|
||||
@@ -58,12 +66,12 @@ configure_dhcp_options() {
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
[ -n "${reqopts}" ] && newreqopts="$reqopts 125" || newreqopts="125"
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${interface}".reqopts="$newreqopts"
|
||||
fi
|
||||
|
||||
if [ ${send124_present} -eq 0 ]; then
|
||||
[ -n "${sendopts}" ] && newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70" || newsendopts="124:00:00:0D:E9:04:03:75:73:70"
|
||||
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
|
||||
uci -q set network."${interface}".sendopts="$newsendopts"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.5.0/src/core/device_controller.c
|
||||
Index: obuspa-10.0.0.1/src/core/device_controller.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.5.0.orig/src/core/device_controller.c
|
||||
+++ obuspa-10.0.5.0/src/core/device_controller.c
|
||||
@@ -4223,6 +4223,14 @@ int ProcessControllerAdded(int cont_inst
|
||||
--- obuspa-10.0.0.1.orig/src/core/device_controller.c
|
||||
+++ obuspa-10.0.0.1/src/core/device_controller.c
|
||||
@@ -4211,6 +4211,14 @@ int ProcessControllerAdded(int cont_inst
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ Index: obuspa-10.0.5.0/src/core/device_controller.c
|
||||
// Exit if unable to get the object instance numbers present in this controller's MTP table
|
||||
USP_SNPRINTF(path, sizeof(path), "%s.%d.MTP", device_cont_root, cont_instance);
|
||||
err = DATA_MODEL_GetInstances(path, &iv);
|
||||
@@ -4264,14 +4272,6 @@ int ProcessControllerAdded(int cont_inst
|
||||
@@ -4252,14 +4260,6 @@ int ProcessControllerAdded(int cont_inst
|
||||
DEVICE_MQTT_UpdateControllerTopics();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: obuspa-10.0.4.0/src/core/bdc_exec.c
|
||||
Index: obuspa-10.0.0.1/src/core/bdc_exec.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.4.0.orig/src/core/bdc_exec.c
|
||||
+++ obuspa-10.0.4.0/src/core/bdc_exec.c
|
||||
--- obuspa-10.0.0.1.orig/src/core/bdc_exec.c
|
||||
+++ obuspa-10.0.0.1/src/core/bdc_exec.c
|
||||
@@ -549,10 +549,25 @@ int StartSendingReport(bdc_connection_t
|
||||
|
||||
// Set the list of headers
|
||||
@@ -30,10 +30,10 @@ Index: obuspa-10.0.4.0/src/core/bdc_exec.c
|
||||
bc->headers = curl_slist_append(bc->headers, "Content-Encoding: gzip");
|
||||
}
|
||||
|
||||
Index: obuspa-10.0.4.0/src/core/bdc_exec.h
|
||||
Index: obuspa-10.0.0.1/src/core/bdc_exec.h
|
||||
===================================================================
|
||||
--- obuspa-10.0.4.0.orig/src/core/bdc_exec.h
|
||||
+++ obuspa-10.0.4.0/src/core/bdc_exec.h
|
||||
--- obuspa-10.0.0.1.orig/src/core/bdc_exec.h
|
||||
+++ obuspa-10.0.0.1/src/core/bdc_exec.h
|
||||
@@ -54,6 +54,8 @@ void BDC_EXEC_ScheduleExit(void);
|
||||
#define BDC_FLAG_PUT 0x00000001 // If set, HTTP PUT should be used instead of HTTP POST when sending the report to the BDC server
|
||||
#define BDC_FLAG_GZIP 0x00000002 // If set, the reports contants are Gzipped
|
||||
@@ -45,10 +45,10 @@ Index: obuspa-10.0.4.0/src/core/bdc_exec.h
|
||||
+#define BDC_FLAG_HEADER_PER_ROW 0x00000020 // If set, report format in header would be csv ParameterPerRow
|
||||
+#define BDC_FLAG_HEADER_PER_COL 0x00000040 // If set, report format in header would be csv ParameterPerColumn
|
||||
#endif
|
||||
Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.4.0.orig/src/core/device_bulkdata.c
|
||||
+++ obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
--- obuspa-10.0.0.1.orig/src/core/device_bulkdata.c
|
||||
+++ obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
@@ -71,8 +71,12 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -95,7 +95,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
int Validate_BulkDataHTTPMethod(dm_req_t *req, char *value);
|
||||
@@ -247,7 +259,8 @@ bulkdata_profile_t *bulkdata_find_free_p
|
||||
bulkdata_profile_t *bulkdata_find_profile(int profile_id);
|
||||
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map, combined_role_t *combined_role);
|
||||
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
|
||||
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
|
||||
-char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp);
|
||||
+char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
|
||||
@@ -103,16 +103,16 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
|
||||
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
|
||||
int bulkdata_start_profile(bulkdata_profile_t *bp);
|
||||
@@ -263,6 +276,8 @@ int bulkdata_platform_get_param_refs(int
|
||||
int bulkdata_platform_calc_combined_role(int instance, combined_role_t **bulkdata_role, combined_role_t *combined_role, int *cont_instance);
|
||||
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv, combined_role_t *combined_role);
|
||||
@@ -262,6 +275,8 @@ char *bulkdata_platform_calc_uri_query_s
|
||||
int bulkdata_platform_get_param_refs(int profile_id, param_ref_vector_t *param_refs);
|
||||
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv);
|
||||
void bulkdata_append_to_result_map(param_ref_entry_t *pr, group_get_vector_t *ggv, kv_vector_t *report_map);
|
||||
+void append_string_to_target(char *str, char **output);
|
||||
+char *csv_encode(const char *str);
|
||||
int GetAuto_BulkDataController(dm_req_t *req, char *buf, int len);
|
||||
#ifdef ENABLE_MQTT
|
||||
int Validate_BulkDataMqttReference(dm_req_t *req, char *value);
|
||||
@@ -301,7 +316,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
void bulkdata_process_profile_mqtt(bulkdata_profile_t *bp);
|
||||
@@ -299,7 +314,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_VendorParam_ReadOnly("Device.BulkData.Status", Get_BulkDataGlobalStatus, DM_STRING);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MinReportingInterval", BULKDATA_MINIMUM_REPORTING_INTERVAL_STR, DM_UINT);
|
||||
err |= USP_REGISTER_Param_SupportedList("Device.BulkData.Protocols", bdc_protocols, NUM_ELEM(bdc_protocols));
|
||||
@@ -121,7 +121,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.ParameterWildCardSupported", "true", DM_BOOL);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfProfiles", BULKDATA_MAX_PROFILES_STR, DM_INT);
|
||||
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfParameterReferences", "-1", DM_INT);
|
||||
@@ -316,7 +331,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
@@ -314,7 +329,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Name", "", NULL, NULL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.NumberOfRetainedFailedReports", "0", Validate_NumberOfRetainedFailedReports, NULL, DM_INT);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Protocol", BULKDATA_PROTOCOL_HTTP, Validate_BulkDataProtocol, NULL, DM_STRING);
|
||||
@@ -129,8 +129,8 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
+ err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.EncodingType", BULKDATA_ENCODING_TYPE_JSON, Validate_BulkDataEncodingType, NULL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.ReportingInterval", "86400", Validate_BulkDataReportingInterval, NotifyChange_BulkDataReportingInterval, DM_UINT);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.TimeReference", UNKNOWN_TIME_STR, NULL, NotifyChange_BulkDataTimeReference, DM_DATETIME);
|
||||
err |= USP_REGISTER_DBParam_ReadOnlyAuto("Device.BulkData.Profile.{i}.Controller", GetAuto_BulkDataController, DM_STRING);
|
||||
@@ -329,9 +344,16 @@ int DEVICE_BULKDATA_Init(void)
|
||||
|
||||
@@ -326,9 +341,16 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Parameter.{i}.Reference", "", Validate_BulkDataReference, NULL, DM_STRING);
|
||||
|
||||
// Device.BulkData.Profile.{i}.JSONEncoding
|
||||
@@ -148,7 +148,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
// Device.BulkData.Profile.{i}.HTTP
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.URL", "", NULL, NotifyChange_BulkDataURL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.Username", "", NULL, NULL, DM_STRING);
|
||||
@@ -687,9 +709,10 @@ int Validate_BulkDataProtocol(dm_req_t *
|
||||
@@ -614,9 +636,10 @@ int Validate_BulkDataProtocol(dm_req_t *
|
||||
int Validate_BulkDataEncodingType(dm_req_t *req, char *value)
|
||||
{
|
||||
// Exit if trying to set a value outside of the range we accept
|
||||
@@ -162,7 +162,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
return USP_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@@ -793,9 +816,36 @@ int Validate_BulkDataReference(dm_req_t
|
||||
@@ -720,9 +743,36 @@ int Validate_BulkDataReference(dm_req_t
|
||||
int Validate_BulkDataReportFormat(dm_req_t *req, char *value)
|
||||
{
|
||||
// Exit if trying to set a value outside of the range we accept
|
||||
@@ -201,7 +201,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
return USP_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@@ -2151,6 +2201,14 @@ int bulkdata_platform_get_profile_contro
|
||||
@@ -2053,6 +2103,14 @@ int bulkdata_platform_get_profile_contro
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
// Exit if unable to get ReportTimestamp
|
||||
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportTimestamp", bp->profile_id);
|
||||
err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_timestamp, sizeof(ctrl_params->report_timestamp), 0);
|
||||
@@ -2159,6 +2217,54 @@ int bulkdata_platform_get_profile_contro
|
||||
@@ -2061,6 +2119,54 @@ int bulkdata_platform_get_profile_contro
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
#ifdef ENABLE_MQTT
|
||||
{
|
||||
char protocol[32];
|
||||
@@ -2492,7 +2598,7 @@ void bulkdata_process_profile_http(bulkd
|
||||
@@ -2334,7 +2440,7 @@ void bulkdata_process_profile_http(bulkd
|
||||
{
|
||||
int err;
|
||||
report_t *cur_report;
|
||||
@@ -280,7 +280,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
profile_ctrl_params_t ctrl;
|
||||
unsigned char *compressed_report;
|
||||
int compressed_len;
|
||||
@@ -2541,26 +2647,39 @@ void bulkdata_process_profile_http(bulkd
|
||||
@@ -2373,10 +2479,23 @@ void bulkdata_process_profile_http(bulkd
|
||||
}
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -308,9 +308,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
return;
|
||||
}
|
||||
|
||||
// Print out the JSON report, if debugging is enabled
|
||||
- USP_LOG_Info("\nBULK DATA: %sing at time %s, to url=%s", ctrl.method, iso8601_cur_time(buf, sizeof(buf)), ctrl.url);
|
||||
+ USP_LOG_Info("BULK DATA: %sing at time %s, to url=%s", ctrl.method, iso8601_cur_time(buf, sizeof(buf)), ctrl.url);
|
||||
@@ -2385,14 +2504,14 @@ void bulkdata_process_profile_http(bulkd
|
||||
USP_LOG_Info("BULK DATA: using compression method=%s", ctrl.compression);
|
||||
if (enable_protocol_trace)
|
||||
{
|
||||
@@ -329,7 +327,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
}
|
||||
// NOTE: From this point on, only the compressed_report exists
|
||||
|
||||
@@ -2590,8 +2709,15 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2422,8 +2541,15 @@ void bulkdata_process_profile_usp_event(
|
||||
kv_vector_t event_args;
|
||||
kv_pair_t kv;
|
||||
report_t *cur_report;
|
||||
@@ -343,11 +341,11 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
+ char escape_char[10];
|
||||
+ char csv_format[20];
|
||||
+ char row_timestamp[33];
|
||||
combined_role_t *bulkdata_role;
|
||||
combined_role_t combined_role;
|
||||
int cont_instance;
|
||||
@@ -2610,13 +2736,63 @@ void bulkdata_process_profile_usp_event(
|
||||
return;
|
||||
|
||||
// Exit if the MTP has not been connected to successfully after bootup
|
||||
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
|
||||
@@ -2432,13 +2558,63 @@ void bulkdata_process_profile_usp_event(
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- // Exit if unable to get ReportTimestamp
|
||||
@@ -417,7 +415,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
|
||||
// When sending via USP events, only one report is ever sent in each USP event
|
||||
// So ensure all retained reports are removed. NOTE: Clearing the reports here is only necessary when switching protocol from HTTP to USP event, and where HTTP had some unsent reports
|
||||
@@ -2634,11 +2810,17 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2456,11 +2632,17 @@ void bulkdata_process_profile_usp_event(
|
||||
}
|
||||
bp->num_retained_reports = 1;
|
||||
|
||||
@@ -438,7 +436,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2646,15 +2828,15 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2468,15 +2650,15 @@ void bulkdata_process_profile_usp_event(
|
||||
|
||||
// Construct event_args manually to avoid the overhead of a malloc and copy of the report in KV_VECTOR_Add()
|
||||
kv.key = "Data";
|
||||
@@ -448,7 +446,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
event_args.num_entries = 1;
|
||||
|
||||
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.Push!", bp->profile_id);
|
||||
DEVICE_SUBSCRIPTION_ProcessAllEventCompleteSubscriptions(path, &event_args, cont_instance);
|
||||
DEVICE_SUBSCRIPTION_ProcessAllEventCompleteSubscriptions(path, &event_args);
|
||||
|
||||
- // Free the report. No need to free the event_args as json_report is the only thing dynamically allocated in it
|
||||
- free(json_report); // The report is not allocated via USP_MALLOC
|
||||
@@ -457,7 +455,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
|
||||
// From the point of view of this code, the report(s) have been successfully sent, so don't retain them
|
||||
// NOTE: Sending of the reports successfully is delegated to the USP notification retry mechanism
|
||||
@@ -2736,15 +2918,28 @@ void bulkdata_process_profile_mqtt(bulkd
|
||||
@@ -2548,11 +2730,24 @@ void bulkdata_process_profile_mqtt(bulkd
|
||||
}
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -487,21 +485,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
}
|
||||
|
||||
// Print out the JSON report, if debugging is enabled
|
||||
- USP_LOG_Debug("\nBULK DATA: Sending at time %s to MQTT topic %s", iso8601_cur_time(buf, sizeof(buf)), ctrl.mqtt_publish_topic);
|
||||
+ USP_LOG_Debug("BULK DATA: Sending at time %s to MQTT topic %s", iso8601_cur_time(buf, sizeof(buf)), ctrl.mqtt_publish_topic);
|
||||
if (enable_protocol_trace)
|
||||
{
|
||||
USP_LOG_String(kLogLevel_Info, kLogType_Protocol, report);
|
||||
@@ -2939,7 +3134,7 @@ int bulkdata_reduce_to_alt_name(char *sp
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
-** bulkdata_generate_json_report
|
||||
+** bulkdata_generate_json_name_value_pair_report
|
||||
**
|
||||
** Generates a JSON name-value pair format report
|
||||
** NOTE: The report contains all retained failed reports, as well as the current report
|
||||
@@ -2951,7 +3146,7 @@ int bulkdata_reduce_to_alt_name(char *sp
|
||||
@@ -2763,7 +2958,7 @@ int bulkdata_reduce_to_alt_name(char *sp
|
||||
** \return pointer to NULL terminated dynamically allocated buffer containing the serialized report to send
|
||||
**
|
||||
**************************************************************************/
|
||||
@@ -510,7 +494,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
{
|
||||
JsonNode *top; // top of report
|
||||
JsonNode *array; // array of reports (retained + current)
|
||||
@@ -3056,6 +3251,483 @@ char *bulkdata_generate_json_report(bulk
|
||||
@@ -2868,6 +3063,483 @@ char *bulkdata_generate_json_report(bulk
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -994,7 +978,7 @@ Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** bulkdata_compress_report
|
||||
@@ -3259,6 +3931,20 @@ int bulkdata_schedule_sending_http_repor
|
||||
@@ -3071,6 +3743,20 @@ int bulkdata_schedule_sending_http_repor
|
||||
flags |= BDC_FLAG_DATE_HEADER;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: obuspa-10.0.5.0/src/core/expr_vector.c
|
||||
Index: obuspa-10.0.0.1/src/core/expr_vector.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.5.0.orig/src/core/expr_vector.c
|
||||
+++ obuspa-10.0.5.0/src/core/expr_vector.c
|
||||
--- obuspa-10.0.0.1.orig/src/core/expr_vector.c
|
||||
+++ obuspa-10.0.0.1/src/core/expr_vector.c
|
||||
@@ -59,6 +59,7 @@ char *expr_op_2_str[kExprOp_Max] =
|
||||
"<", // kExprOp_LessThan
|
||||
">", // kExprOp_GreaterThan
|
||||
@@ -10,7 +10,7 @@ Index: obuspa-10.0.5.0/src/core/expr_vector.c
|
||||
};
|
||||
|
||||
|
||||
@@ -487,6 +488,15 @@ char *SplitOnOperator(char *buf, expr_op
|
||||
@@ -483,6 +484,15 @@ char *SplitOnOperator(char *buf, expr_op
|
||||
*op = '\0';
|
||||
return &op[2];
|
||||
}
|
||||
@@ -26,10 +26,10 @@ Index: obuspa-10.0.5.0/src/core/expr_vector.c
|
||||
|
||||
// Exit if found the "<" operator
|
||||
op = strchr(buf, '<');
|
||||
Index: obuspa-10.0.5.0/src/core/path_resolver.c
|
||||
Index: obuspa-10.0.0.1/src/core/path_resolver.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.5.0.orig/src/core/path_resolver.c
|
||||
+++ obuspa-10.0.5.0/src/core/path_resolver.c
|
||||
--- obuspa-10.0.0.1.orig/src/core/path_resolver.c
|
||||
+++ obuspa-10.0.0.1/src/core/path_resolver.c
|
||||
@@ -1088,7 +1088,7 @@ int ResolveUniqueKey(char *resolved, cha
|
||||
char temp[MAX_DM_PATH];
|
||||
bool is_match;
|
||||
@@ -38,7 +38,7 @@ Index: obuspa-10.0.5.0/src/core/path_resolver.c
|
||||
+ expr_op_t valid_ops[] = {kExprOp_Equal, kExprOp_NotEqual, kExprOp_LessThanOrEqual, kExprOp_GreaterThanOrEqual, kExprOp_LessThan, kExprOp_GreaterThan, kExprOp_Contains};
|
||||
|
||||
// Exit if unable to find the end of the unique key
|
||||
p = TEXT_UTILS_StrStr(unresolved, "]");
|
||||
p = strchr(unresolved, ']');
|
||||
@@ -1754,6 +1754,67 @@ int DoUniqueKeysMatch(int index, search_
|
||||
}
|
||||
USP_ASSERT(gge->value != NULL); // GROUP_GET_VECTOR_GetValues() should have set an error message if the vendor hook didn't set a value for the parameter
|
||||
@@ -107,10 +107,10 @@ Index: obuspa-10.0.5.0/src/core/path_resolver.c
|
||||
// Determine the function to call to perform the comparison
|
||||
if (type_flags & (DM_INT | DM_UINT | DM_ULONG | DM_LONG | DM_DECIMAL))
|
||||
{
|
||||
Index: obuspa-10.0.5.0/src/include/usp_api.h
|
||||
Index: obuspa-10.0.0.1/src/include/usp_api.h
|
||||
===================================================================
|
||||
--- obuspa-10.0.5.0.orig/src/include/usp_api.h
|
||||
+++ obuspa-10.0.5.0/src/include/usp_api.h
|
||||
--- obuspa-10.0.0.1.orig/src/include/usp_api.h
|
||||
+++ obuspa-10.0.0.1/src/include/usp_api.h
|
||||
@@ -106,6 +106,7 @@ typedef enum
|
||||
kExprOp_LessThan, // '<'
|
||||
kExprOp_GreaterThan, // '>'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.7.0/src/core/cli_server.c
|
||||
Index: obuspa-10.0.0.2/src/core/cli_server.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/cli_server.c
|
||||
+++ obuspa-10.0.7.0/src/core/cli_server.c
|
||||
@@ -726,10 +726,6 @@ int ExecuteCli_Get(str_vector_t *args)
|
||||
--- obuspa-10.0.0.2.orig/src/core/cli_server.c
|
||||
+++ obuspa-10.0.0.2/src/core/cli_server.c
|
||||
@@ -724,10 +724,6 @@ int ExecuteCli_Get(str_vector_t *args)
|
||||
USP_ASSERT(gge->value != NULL);
|
||||
SendCliResponse("%s => %s\n", gge->path, gge->value);
|
||||
}
|
||||
@@ -13,11 +13,11 @@ Index: obuspa-10.0.7.0/src/core/cli_server.c
|
||||
}
|
||||
|
||||
GROUP_GET_VECTOR_Destroy(&ggv);
|
||||
Index: obuspa-10.0.7.0/src/core/data_model.c
|
||||
Index: obuspa-10.0.0.2/src/core/data_model.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/data_model.c
|
||||
+++ obuspa-10.0.7.0/src/core/data_model.c
|
||||
@@ -1398,7 +1398,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
--- obuspa-10.0.0.2.orig/src/core/data_model.c
|
||||
+++ obuspa-10.0.0.2/src/core/data_model.c
|
||||
@@ -1321,7 +1321,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
// Exit if instance already exists - nothing to do
|
||||
if (exists)
|
||||
{
|
||||
@@ -26,7 +26,7 @@ Index: obuspa-10.0.7.0/src/core/data_model.c
|
||||
return USP_ERR_CREATION_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1486,7 +1486,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
@@ -1409,7 +1409,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
// Exit if instance does not exist - nothing to do
|
||||
if (exists == false)
|
||||
{
|
||||
@@ -35,11 +35,11 @@ Index: obuspa-10.0.7.0/src/core/data_model.c
|
||||
return USP_ERR_OBJECT_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/mqtt.c
|
||||
+++ obuspa-10.0.7.0/src/core/mqtt.c
|
||||
@@ -4070,7 +4070,7 @@ void MessageV5Callback(struct mosquitto
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 388697a..444b4da 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -4020,7 +4020,7 @@ void MessageV5Callback(struct mosquitto *mosq, void *userdata, const struct mosq
|
||||
if (mosquitto_property_read_string(props, RESPONSE_TOPIC,
|
||||
&response_info_ptr, false) == NULL)
|
||||
{
|
||||
|
||||
@@ -4,11 +4,11 @@ Date: Wed Apr 30 17:18:27 2025 +0530
|
||||
|
||||
1001-use-datamodel-caching.patch
|
||||
|
||||
Index: obuspa-10.0.7.0/src/core/cli_server.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/cli_server.c
|
||||
+++ obuspa-10.0.7.0/src/core/cli_server.c
|
||||
@@ -513,6 +513,7 @@ int CLI_SERVER_ExecuteCliCommand(char *c
|
||||
diff --git a/src/core/cli_server.c b/src/core/cli_server.c
|
||||
index da61c6f..abac7cb 100644
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -511,6 +511,7 @@ int CLI_SERVER_ExecuteCliCommand(char *cmd_line)
|
||||
SendCliResponse("WARNING: Discarding unused args: %s\n", args.vector[cli_cmd->max_args+1]);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ Index: obuspa-10.0.7.0/src/core/cli_server.c
|
||||
// Process command
|
||||
err = cli_cmd->exec_cmd(&args);
|
||||
print_help = false;
|
||||
@@ -672,6 +673,11 @@ int ExecuteCli_Version(str_vector_t *arg
|
||||
@@ -670,6 +671,11 @@ int ExecuteCli_Version(str_vector_t *args)
|
||||
int ExecuteCli_Get(str_vector_t *args)
|
||||
{
|
||||
combined_role_t *combined_role;
|
||||
@@ -28,22 +28,22 @@ Index: obuspa-10.0.7.0/src/core/cli_server.c
|
||||
#ifndef REMOVE_USP_BROKER
|
||||
char *arg1;
|
||||
|
||||
Index: obuspa-10.0.7.0/src/core/data_model.h
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/data_model.h
|
||||
+++ obuspa-10.0.7.0/src/core/data_model.h
|
||||
@@ -417,5 +417,6 @@ int DM_PRIV_ReRegister_DBParam_Default(c
|
||||
diff --git a/src/core/data_model.h b/src/core/data_model.h
|
||||
index 7564127..2736d7c 100755
|
||||
--- a/src/core/data_model.h
|
||||
+++ b/src/core/data_model.h
|
||||
@@ -405,5 +405,6 @@ int DM_PRIV_ReRegister_DBParam_Default(char *path, char *value);
|
||||
bool DM_PRIV_IsChildNodeOf(dm_node_t *node, dm_node_t *parent_node);
|
||||
void DM_PRIV_GetAllEventsAndCommands(dm_node_t *node, str_vector_t *events, str_vector_t *commands);
|
||||
|
||||
+int vendor_create_dm_cache(char *paths[], int num_paths);
|
||||
#endif
|
||||
|
||||
Index: obuspa-10.0.7.0/src/core/handle_get.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/handle_get.c
|
||||
+++ obuspa-10.0.7.0/src/core/handle_get.c
|
||||
@@ -129,6 +129,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp
|
||||
diff --git a/src/core/handle_get.c b/src/core/handle_get.c
|
||||
index d9d3e9e..c263978 100644
|
||||
--- a/src/core/handle_get.c
|
||||
+++ b/src/core/handle_get.c
|
||||
@@ -129,6 +129,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp, char *controller_endpoint, mtp_conn_t
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ Index: obuspa-10.0.7.0/src/core/handle_get.c
|
||||
// Calculate the number of hierarchical levels to traverse in the data model when performing partial path resolution
|
||||
// NOTE: protocol buffer has depth as an unsigned quantity, but internally we use a signed number, so limit range to that of a signed number
|
||||
depth = usp->body->request->get->max_depth;
|
||||
Index: obuspa-10.0.7.0/src/core/msg_handler.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/msg_handler.c
|
||||
+++ obuspa-10.0.7.0/src/core/msg_handler.c
|
||||
@@ -987,6 +987,8 @@ int HandleUspMessage(Usp__Msg *usp, char
|
||||
diff --git a/src/core/msg_handler.c b/src/core/msg_handler.c
|
||||
index 647591d..b7498d8 100755
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -863,6 +863,8 @@ int HandleUspMessage(Usp__Msg *usp, char *endpoint_id, mtp_conn_t *mtpc)
|
||||
MSG_HANDLER_UspMsgTypeToString(usp->header->msg_type),
|
||||
iso8601_cur_time(buf, sizeof(buf)) );
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.4.0.orig/src/core/device_bulkdata.c
|
||||
+++ obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
@@ -378,6 +378,8 @@ int DEVICE_BULKDATA_Init(void)
|
||||
--- obuspa-10.0.0.1.orig/src/core/device_bulkdata.c
|
||||
+++ obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
@@ -375,6 +375,8 @@ int DEVICE_BULKDATA_Init(void)
|
||||
// Device.BulkData.Profile.{i}.MQTT
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.MQTT.Reference", "", Validate_BulkDataMqttReference, NULL, DM_STRING);
|
||||
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.MQTT.PublishTopic", "", NULL, NULL, DM_STRING);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.7.0/src/core/data_model.c
|
||||
Index: obuspa-10.0.0.2/src/core/data_model.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/data_model.c
|
||||
+++ obuspa-10.0.7.0/src/core/data_model.c
|
||||
@@ -5519,7 +5519,7 @@ int RegisterDefaultControllerTrust(void)
|
||||
--- obuspa-10.0.0.2.orig/src/core/data_model.c
|
||||
+++ obuspa-10.0.0.2/src/core/data_model.c
|
||||
@@ -5347,7 +5347,7 @@ int RegisterDefaultControllerTrust(void)
|
||||
int err = USP_ERR_OK;
|
||||
|
||||
// Register 'Full Access' role
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.6.0/src/core/device.h
|
||||
Index: obuspa-10.0.0.2/src/core/device.h
|
||||
===================================================================
|
||||
--- obuspa-10.0.6.0.orig/src/core/device.h
|
||||
+++ obuspa-10.0.6.0/src/core/device.h
|
||||
@@ -355,6 +355,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
|
||||
--- obuspa-10.0.0.2.orig/src/core/device.h
|
||||
+++ obuspa-10.0.0.2/src/core/device.h
|
||||
@@ -346,6 +346,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
|
||||
int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void);
|
||||
#endif
|
||||
|
||||
@@ -13,11 +13,11 @@ Index: obuspa-10.0.6.0/src/core/device.h
|
||||
#ifndef REMOVE_USP_BROKER
|
||||
int DEVICE_SUBSCRIPTION_RouteNotification(Usp__Msg *usp, int instance, char *subscribed_path);
|
||||
bool DEVICE_SUBSCRIPTION_MarkVendorLayerSubs(int broker_instance, subs_notify_t notify_type, char *path, int group_id);
|
||||
Index: obuspa-10.0.6.0/src/core/device_controller.c
|
||||
Index: obuspa-10.0.0.2/src/core/device_controller.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.6.0.orig/src/core/device_controller.c
|
||||
+++ obuspa-10.0.6.0/src/core/device_controller.c
|
||||
@@ -969,6 +969,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage
|
||||
--- obuspa-10.0.0.2.orig/src/core/device_controller.c
|
||||
+++ obuspa-10.0.0.2/src/core/device_controller.c
|
||||
@@ -968,6 +968,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -96,11 +96,11 @@ Index: obuspa-10.0.6.0/src/core/device_controller.c
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DEVICE_CONTROLLER_IsMTPConfigured
|
||||
Index: obuspa-10.0.6.0/src/core/msg_handler.c
|
||||
Index: obuspa-10.0.0.2/src/core/msg_handler.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.6.0.orig/src/core/msg_handler.c
|
||||
+++ obuspa-10.0.6.0/src/core/msg_handler.c
|
||||
@@ -1344,6 +1344,15 @@ int ValidateUspRecord(UspRecord__Record
|
||||
--- obuspa-10.0.0.2.orig/src/core/msg_handler.c
|
||||
+++ obuspa-10.0.0.2/src/core/msg_handler.c
|
||||
@@ -1220,6 +1220,15 @@ int ValidateUspRecord(UspRecord__Record
|
||||
usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.6.0/src/core/mqtt.c
|
||||
Index: obuspa-10.0.0.1/src/core/mqtt.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.6.0.orig/src/core/mqtt.c
|
||||
+++ obuspa-10.0.6.0/src/core/mqtt.c
|
||||
@@ -265,6 +265,8 @@ void SaveMqttPublishErrMsg(const char *f
|
||||
--- obuspa-10.0.0.1.orig/src/core/mqtt.c
|
||||
+++ obuspa-10.0.0.1/src/core/mqtt.c
|
||||
@@ -259,6 +259,8 @@ void MqttSubscriptionDestroy(mqtt_subscr
|
||||
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
|
||||
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
|
||||
{\
|
||||
@@ -11,7 +11,7 @@ Index: obuspa-10.0.6.0/src/core/mqtt.c
|
||||
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
|
||||
}
|
||||
|
||||
@@ -275,6 +277,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
@@ -269,6 +271,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
|
||||
@@ -23,7 +23,7 @@ Index: obuspa-10.0.6.0/src/core/mqtt.c
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -285,10 +292,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
@@ -279,10 +286,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
MQTT_TrustCertVerifyCallbackIndex(2),
|
||||
MQTT_TrustCertVerifyCallbackIndex(3),
|
||||
MQTT_TrustCertVerifyCallbackIndex(4),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.7.0.orig/src/core/mqtt.c
|
||||
+++ obuspa-10.0.7.0/src/core/mqtt.c
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 70978501b1..96119fe080 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
@@ -10,7 +10,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
#include <mosquitto.h>
|
||||
|
||||
#include "mqtt.h"
|
||||
@@ -206,8 +207,9 @@ int EnableMosquitto(mqtt_client_t *clien
|
||||
@@ -201,8 +202,9 @@ int EnableMosquitto(mqtt_client_t *client);
|
||||
void SetupCallbacks(mqtt_client_t *client);
|
||||
void QueueUspConnectRecord_MQTT(mqtt_client_t *client, mtp_send_item_t *msi, char *controller_topic, time_t expiry_time);
|
||||
int SendQueueHead(mqtt_client_t *client);
|
||||
@@ -21,7 +21,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
int ConnectSetEncryption(mqtt_client_t *client);
|
||||
void ConnectCallback(struct mosquitto *mosq, void *userdata, int result);
|
||||
void ConnectV5Callback(struct mosquitto *mosq, void *userdata, int result, int flags, const mosquitto_property *props);
|
||||
@@ -250,7 +252,7 @@ void HandleMqttReconnect(mqtt_client_t *
|
||||
@@ -245,7 +247,7 @@ void HandleMqttReconnect(mqtt_client_t *client);
|
||||
void HandleMqttReconnectAfterDisconnect(mqtt_client_t *client);
|
||||
void HandleMqttDisconnect(mqtt_client_t *client);
|
||||
void DisconnectIfAllSubscriptionsFailed(mqtt_client_t *client);
|
||||
@@ -30,7 +30,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
void RemoveMqttQueueItem(mqtt_client_t *client, mqtt_send_item_t *queued_msg);
|
||||
void RemoveExpiredMqttMessages(mqtt_client_t *client);
|
||||
void ParseSubscribeTopicsFromConnack(mqtt_client_t *client, mosquitto_property *prop);
|
||||
@@ -2380,6 +2382,143 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
@@ -2350,6 +2352,143 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** IsMqttBrokerUp
|
||||
@@ -2394,109 +2533,92 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
@@ -2364,109 +2503,92 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
** \return true if the MQTT Broker is up, false otherwise
|
||||
**
|
||||
**************************************************************************/
|
||||
@@ -343,7 +343,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -2517,18 +2639,20 @@ void Connect(mqtt_client_t *client)
|
||||
@@ -2487,18 +2609,20 @@ void Connect(mqtt_client_t *client)
|
||||
{
|
||||
int err = USP_ERR_OK;
|
||||
bool is_up;
|
||||
@@ -367,7 +367,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
|
||||
// Exit if failed to connect
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -2561,7 +2685,7 @@ exit:
|
||||
@@ -2531,7 +2655,7 @@ exit:
|
||||
** \return USP_ERR_INTERNAL_ERROR if failed to connect (and should retry)
|
||||
**
|
||||
**************************************************************************/
|
||||
@@ -376,7 +376,7 @@ Index: obuspa-10.0.7.0/src/core/mqtt.c
|
||||
{
|
||||
int version;
|
||||
mosquitto_property *proplist = NULL;
|
||||
@@ -2631,19 +2755,19 @@ int PerformMqttClientConnect(mqtt_client
|
||||
@@ -2601,19 +2725,19 @@ int PerformMqttClientConnect(mqtt_client_t *client)
|
||||
// We do this to prevent the data model thread from potentially being blocked, whilst the connect call is taking place
|
||||
OS_UTILS_UnlockMutex(&mqtt_access_mutex);
|
||||
|
||||
|
||||
@@ -97,13 +97,15 @@ packet_capture_launch() {
|
||||
fi
|
||||
|
||||
if [ -n "${interface}" ]; then
|
||||
intf=$(ifstatus "${interface}" | jsonfilter -e '$.l3_device')
|
||||
intf=$(ifstatus "${interface}" | jq ".l3_device")
|
||||
|
||||
if [ -z "${intf}" ]; then
|
||||
# Error
|
||||
packet_capture_error "Error_Internal" "${proto}"
|
||||
return
|
||||
fi
|
||||
|
||||
intf=$(eval echo "${intf}")
|
||||
fi
|
||||
|
||||
cmd="timeout ${duration} tcpdump -w ${filename}"
|
||||
|
||||
@@ -11,7 +11,7 @@ LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/parental-control.git
|
||||
PKG_SOURCE_VERSION:=11777ff069888fc543c2501110313b654bbbfbc9
|
||||
PKG_SOURCE_VERSION:=2cada36853091856e3efc2fc630f7cf06aa9c352
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -148,7 +148,7 @@ reload_service() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
local enable urlfilter default_wan_interface
|
||||
local enable urlfilter default_wan_interface
|
||||
|
||||
validate_global_section || {
|
||||
return 1
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.6.3
|
||||
PKG_VERSION:=1.5.18
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=351db77e982b1f4887e5878345fe98be72d262fb
|
||||
PKG_SOURCE_VERSION:=2772d77bd477adfdf513499fda11397107996d21
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
60
peripheral_manager/Makefile
Normal file
60
peripheral_manager/Makefile
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=peripheral_manager
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=21522c2003b8c61904acc61ff97e54fc9b0c3c92
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
# support parallel build
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
|
||||
# this way we don't need to pick out the resulting files from the build dir.
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/peripheral_manager
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Application deamon for handling of peripheral
|
||||
URL:=
|
||||
DEPENDS:=+libuci +libubus +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/peripheral_manager/description
|
||||
Application handling peripheral
|
||||
endef
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DCMAKE_BUILD_TYPE:String="Release" \
|
||||
|
||||
define Package/peripheral_manager/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/peripheral_manager $(1)/sbin/
|
||||
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpio_test $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,peripheral_manager))
|
||||
62
peripheral_manager/files/etc/init.d/ledmngr
Executable file
62
peripheral_manager/files/etc/init.d/ledmngr
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=20
|
||||
USE_PROCD=1
|
||||
|
||||
setled() {
|
||||
local enable
|
||||
local brightness
|
||||
|
||||
config_get_bool enable $1 enable 1
|
||||
config_get brightness $1 brightness 100
|
||||
ubus call led.$1 set "{\"enable\":$enable,\"brightness\":$brightness}"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
|
||||
config_load leds
|
||||
config_foreach setled led
|
||||
config_get_bool enable leds enable 1
|
||||
|
||||
if [ "$enable" == "0" ]; then
|
||||
ubus call leds set '{"state" : "alloff"}'
|
||||
else
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
local led ledname
|
||||
|
||||
ubus list led* >/dev/null || sleep 1
|
||||
ubus list led* >/dev/null || sleep 1
|
||||
|
||||
[ -f /etc/config/leds ] || touch /etc/config/leds
|
||||
|
||||
if ! uci -q get leds.leds >/dev/null; then
|
||||
uci set leds.leds=leds
|
||||
uci set leds.leds.enable=1
|
||||
fi
|
||||
|
||||
for led in $(ubus list led.*); do
|
||||
ledname=${led:4}
|
||||
case $ledname in
|
||||
*phy*) continue ;;
|
||||
esac
|
||||
if ! uci -q get leds.$ledname >/dev/null; then
|
||||
uci set leds.$ledname=led
|
||||
uci set leds.$ledname.enable=1
|
||||
fi
|
||||
done
|
||||
|
||||
uci commit leds
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "leds"
|
||||
}
|
||||
|
||||
25
peripheral_manager/files/etc/init.d/peripheral_manager
Executable file
25
peripheral_manager/files/etc/init.d/peripheral_manager
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=12
|
||||
STOP=89
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=peripheral_manager
|
||||
PROG=/sbin/peripheral_manager
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" -f
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for led.status
|
||||
ubus call led.status set '{"state":"notice"}'
|
||||
ubus -t 2 wait_for buttons
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
ubus call leds set '{"state":"alloff"}'
|
||||
}
|
||||
19
peripheral_manager/files/sbin/ledctl
Executable file
19
peripheral_manager/files/sbin/ledctl
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
usage () {
|
||||
echo "Usage: ledctl [normal|test|allon|alloff|production]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ $# -ne 1 ] && usage
|
||||
ledstate=$(echo $1 | tr 'A-Z' 'a-z')
|
||||
|
||||
case $ledstate in
|
||||
normal|test|allon|alloff|production)
|
||||
ubus call leds set "{\"state\" : \"$ledstate\"}"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
22
ponmngr/files/common/etc/uci-defaults/60-xpon-generate
Normal file → Executable file
22
ponmngr/files/common/etc/uci-defaults/60-xpon-generate
Normal file → Executable file
@@ -1,17 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/system.sh
|
||||
. /lib/functions/iopsys-environment.sh
|
||||
|
||||
configure_serial_number() {
|
||||
# check if serial number is present in the production data
|
||||
local production_sn="$(get_xpon_serial 2>/dev/null)"
|
||||
[ ${#production_sn} -eq 12 ] || production_sn="$(fw_printenv -n gponsn)"
|
||||
|
||||
local production_sn="$(fw_printenv -n gponsn)"
|
||||
if [ ${#production_sn} -eq 12 ]; then
|
||||
uci set xpon.ani.serial_number="${production_sn}"
|
||||
else
|
||||
local macaddr="$(get_mac_label | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
local macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
local vendor_id="IOPS"
|
||||
local vssn="${macaddr:4:8}"
|
||||
|
||||
@@ -24,10 +20,8 @@ configure_ploam_password() {
|
||||
local passwd="$(uci -q get xpon.ani.ploam_password)"
|
||||
|
||||
if [ -z "${passwd}" ]; then
|
||||
local production_passwd="$(get_xpon_password 2>/dev/null)"
|
||||
[ -n "${production_passwd}" ] || production_passwd="$(fw_printenv -n gponpswd)"
|
||||
|
||||
if [ -n "${production_passwd}" ]; then
|
||||
local production_passwd="$(fw_printenv -n gponpswd)"
|
||||
if [ -n ${#production_passwd} ]; then
|
||||
uci set xpon.ani.ploam_password="${production_passwd}"
|
||||
uci set xpon.ani.ploam_hexadecimalpassword=0
|
||||
fi
|
||||
@@ -42,12 +36,10 @@ configure_loid_authentication() {
|
||||
local loidpwd="$(uci -q get xpon.ani.loid_password)"
|
||||
|
||||
if [ -z "${loid}" ]; then
|
||||
production_loid="$(get_xpon_loid 2>/dev/null)"
|
||||
[ -n "${production_loid}" ] || production_loid="$(fw_printenv -n gponloid)"
|
||||
production_loid="$(fw_printenv -n gponloid)"
|
||||
fi
|
||||
if [ -z "${loidpwd}" ]; then
|
||||
production_loidpwd="$(get_xpon_loid_password 2>/dev/null)"
|
||||
[ -n "${production_loidpwd}" ] || production_loidpwd="$(fw_printenv -n gponloid_password)"
|
||||
production_loidpwd="$(fw_printenv -n gponloid_password)"
|
||||
fi
|
||||
|
||||
if [ -n "${production_loid}" ]; then
|
||||
@@ -56,6 +48,7 @@ configure_loid_authentication() {
|
||||
if [ -n "${production_loidpwd}" ]; then
|
||||
uci set xpon.ani.loid_password="${production_loidpwd}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/xpon" ]; then
|
||||
@@ -79,3 +72,4 @@ uci set xpon.ani.enable="1"
|
||||
configure_serial_number
|
||||
configure_ploam_password
|
||||
configure_loid_authentication
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_VERSION:=1.1.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
|
||||
PKG_SOURCE_VERSION:=ee6692438c5d533758c2ea50624c049cda2d07da
|
||||
PKG_SOURCE_VERSION:=1a15f1da7a1474d29aad77b8ad3272fcf4b4f6d1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -114,7 +114,6 @@ hw_init_all() {
|
||||
export TMP_HW_QUEUE_LIST=""
|
||||
echo clear > /proc/ifc_debug
|
||||
echo reinit > /proc/ifc_debug
|
||||
echo 'set mode 0 2' 2> /dev/null > /proc/tc3162/fe_acnt_mapping # Accounter #2 is used for meter #0, so we need re-assign IP flow accounting mode (mode 0) to #2.
|
||||
|
||||
for tc in $(seq 0 7); do
|
||||
rm -rf "/tmp/qos/dscp_values_${tc}_4"
|
||||
@@ -134,10 +133,6 @@ hw_init_all() {
|
||||
# set_wan_ingress_rate "0" - Not needed, done in policer.sh
|
||||
set_wan_egress_rate "0" "0"
|
||||
|
||||
# Don't put TCP ACKs into a high priority queue
|
||||
echo 0 > /proc/qdma_lan/tcp_ack_flag
|
||||
echo 0 > /proc/qdma_wan/tcp_ack_flag
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ handle_policer() {
|
||||
# Configure policer based on UCI subtree 'qos.policer'
|
||||
configure_policer() {
|
||||
# initialize ratelimit params
|
||||
/userfs/bin/femgr ratelimit set rx_mode 1 2 0
|
||||
/userfs/bin/femgr ratelimit set rx_mode 1 2
|
||||
/userfs/bin/qdmamgr_wan set general_rx_init enable trtcm 8 125
|
||||
|
||||
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
|
||||
|
||||
@@ -22,6 +22,10 @@ ip_rule_get_converted_tos() {
|
||||
echo $con_tos
|
||||
}
|
||||
|
||||
flush_hw_nat() {
|
||||
hw_nat -! > /dev/null 2>&1
|
||||
}
|
||||
|
||||
configure_qos() {
|
||||
# queue configuration is being done after shaper configuration,
|
||||
# If port shapingrate configuration on DISC device is called after queue configuration then
|
||||
@@ -33,8 +37,9 @@ configure_qos() {
|
||||
configure_policer
|
||||
configure_classify
|
||||
if [ -f "/tmp/qos/classify.ebtables" ]; then
|
||||
sh /tmp/qos/classify.ebtables
|
||||
sh /tmp/qos/classify.ebtables
|
||||
fi
|
||||
flush_hw_nat
|
||||
}
|
||||
|
||||
reload_qos() {
|
||||
@@ -65,6 +70,7 @@ reload_qos() {
|
||||
;;
|
||||
esac
|
||||
hw_commit_all
|
||||
flush_hw_nat
|
||||
}
|
||||
|
||||
reload_qos_service() {
|
||||
|
||||
@@ -42,7 +42,7 @@ handle_shaper() {
|
||||
# Configure shaper based on options saved to UCI tree 'qos.shaper'
|
||||
configure_shaper() {
|
||||
# initialize ratelimit params
|
||||
/userfs/bin/femgr ratelimit set rx_mode 0 2 0
|
||||
/userfs/bin/femgr ratelimit set rx_mode 0 2
|
||||
/userfs/bin/qdmamgr_lan set general_rx_init enable trtcm 8 125
|
||||
|
||||
# Delete existing shaper
|
||||
|
||||
@@ -5,8 +5,8 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/bellard/quickjs.git
|
||||
PKG_SOURCE_DATE:=2025-07-09
|
||||
PKG_SOURCE_VERSION:=1fdc768fdc8571300755cdd3e4654ce99c0255ce
|
||||
PKG_SOURCE_DATE:=2022-03-06
|
||||
PKG_SOURCE_VERSION:=2788d71e823b522b178db3b3660ce93689534e6d
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_LICENSE:=MIT
|
||||
|
||||
@@ -31,30 +31,15 @@ define Package/quickjs/description
|
||||
endef
|
||||
|
||||
MAKE_FLAGS = \
|
||||
PREFIX=/usr \
|
||||
prefix=/usr \
|
||||
CONFIG_SMALL=y \
|
||||
EXTRA_LIBS="-latomic" \
|
||||
CROSS_PREFIX="$(TARGET_CROSS)"
|
||||
|
||||
define Build/Compile
|
||||
# The upstream Makefile uses the same CFLAGS for host and target builds,
|
||||
# which breaks cross-compilation. We work around this by first building
|
||||
# the host tools ('host-qjsc', 'unicode_gen') with the host compiler
|
||||
# and flags.
|
||||
# We still pass MAKE_FLAGS so the upstream Makefile knows we're cross-compiling.
|
||||
CFLAGS="$(HOST_CFLAGS)" \
|
||||
LDFLAGS="$(HOST_LDFLAGS)" \
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
$(MAKE_FLAGS) \
|
||||
host-qjsc unicode_gen
|
||||
|
||||
# Then we proceed with the default build process for the target binaries.
|
||||
# Make should not rebuild the host tools as they are already up-to-date.
|
||||
$(call Build/Compile/Default)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/quickjs
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/quickjs/libquickjs.a $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/quickjs/libquickjs.lto.a $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/include/quickjs
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/quickjs/quickjs.h $(1)/usr/include/quickjs/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/include/quickjs/quickjs-libc.h $(1)/usr/include/quickjs/
|
||||
|
||||
87
quickjs/patches/000-build-options.patch
Normal file
87
quickjs/patches/000-build-options.patch
Normal file
@@ -0,0 +1,87 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 49b1f6f..2c96eae 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -33,6 +33,8 @@ CONFIG_LTO=y
|
||||
#CONFIG_WERROR=y
|
||||
# force 32 bit build for some utilities
|
||||
#CONFIG_M32=y
|
||||
+# build with -Os instead of -O2
|
||||
+#CONFIG_SMALL=y
|
||||
|
||||
ifdef CONFIG_DARWIN
|
||||
# use clang instead of gcc
|
||||
@@ -52,6 +54,13 @@ CONFIG_BIGNUM=y
|
||||
|
||||
OBJDIR=.obj
|
||||
|
||||
+CFLAGS_ENV:=$(CFLAGS)
|
||||
+LDFLAGS_ENV:=$(LDFLAGS)
|
||||
+
|
||||
+HOST_BUILD=
|
||||
+CFLAGS=$(if $(HOST_BUILD),,$(CFLAGS_ENV))
|
||||
+LDFLAGS=$(if $(HOST_BUILD),,$(LDFLAGS_ENV))
|
||||
+
|
||||
ifdef CONFIG_WIN32
|
||||
ifdef CONFIG_M32
|
||||
CROSS_PREFIX=i686-w64-mingw32-
|
||||
@@ -66,7 +75,7 @@ endif
|
||||
ifdef CONFIG_CLANG
|
||||
HOST_CC=clang
|
||||
CC=$(CROSS_PREFIX)clang
|
||||
- CFLAGS=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
+ CFLAGS += -g -Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
CFLAGS += -Wextra
|
||||
CFLAGS += -Wno-sign-compare
|
||||
CFLAGS += -Wno-missing-field-initializers
|
||||
@@ -87,7 +96,7 @@ ifdef CONFIG_CLANG
|
||||
else
|
||||
HOST_CC=gcc
|
||||
CC=$(CROSS_PREFIX)gcc
|
||||
- CFLAGS=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
+ CFLAGS += -g -Wall -MMD -MF $(OBJDIR)/$(@F).d
|
||||
CFLAGS += -Wno-array-bounds -Wno-format-truncation
|
||||
ifdef CONFIG_LTO
|
||||
AR=$(CROSS_PREFIX)gcc-ar
|
||||
@@ -110,9 +119,13 @@ endif
|
||||
CFLAGS+=$(DEFINES)
|
||||
CFLAGS_DEBUG=$(CFLAGS) -O0
|
||||
CFLAGS_SMALL=$(CFLAGS) -Os
|
||||
+ifdef CONFIG_SMALL
|
||||
+CFLAGS_OPT=$(CFLAGS) -Os
|
||||
+else
|
||||
CFLAGS_OPT=$(CFLAGS) -O2
|
||||
+endif
|
||||
CFLAGS_NOLTO:=$(CFLAGS_OPT)
|
||||
-LDFLAGS=-g
|
||||
+LDFLAGS+=-g
|
||||
ifdef CONFIG_LTO
|
||||
CFLAGS_SMALL+=-flto
|
||||
CFLAGS_OPT+=-flto
|
||||
@@ -195,6 +208,8 @@ qjsc$(EXE): $(OBJDIR)/qjsc.o $(QJS_LIB_OBJS)
|
||||
|
||||
ifneq ($(CROSS_PREFIX),)
|
||||
|
||||
+$(QJSC): HOST_BUILD=1
|
||||
+
|
||||
$(QJSC): $(OBJDIR)/qjsc.host.o \
|
||||
$(patsubst %.o, %.host.o, $(QJS_LIB_OBJS))
|
||||
$(HOST_CC) $(LDFLAGS) -o $@ $^ $(HOST_LIBS)
|
||||
@@ -262,6 +277,8 @@ run-test262-32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)
|
||||
$(OBJDIR)/%.o: %.c | $(OBJDIR)
|
||||
$(CC) $(CFLAGS_OPT) -c -o $@ $<
|
||||
|
||||
+$(OBJDIR)/%.host.o: HOST_BUILD=1
|
||||
+
|
||||
$(OBJDIR)/%.host.o: %.c | $(OBJDIR)
|
||||
$(HOST_CC) $(CFLAGS_OPT) -c -o $@ $<
|
||||
|
||||
@@ -286,6 +303,8 @@ $(OBJDIR)/%.check.o: %.c | $(OBJDIR)
|
||||
regexp_test: libregexp.c libunicode.c cutils.c
|
||||
$(CC) $(LDFLAGS) $(CFLAGS) -DTEST -o $@ libregexp.c libunicode.c cutils.c $(LIBS)
|
||||
|
||||
+unicode_gen: HOST_BUILD=1
|
||||
+
|
||||
unicode_gen: $(OBJDIR)/unicode_gen.host.o $(OBJDIR)/cutils.host.o libunicode.c unicode_gen_def.h
|
||||
$(HOST_CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJDIR)/unicode_gen.host.o $(OBJDIR)/cutils.host.o
|
||||
|
||||
106
quickjs/patches/001-no-fenv-dtoa-libbf.patch
Normal file
106
quickjs/patches/001-no-fenv-dtoa-libbf.patch
Normal file
@@ -0,0 +1,106 @@
|
||||
diff --git a/quickjs.c b/quickjs.c
|
||||
index 7916013..3936eec 100644
|
||||
--- a/quickjs.c
|
||||
+++ b/quickjs.c
|
||||
@@ -67,6 +67,16 @@
|
||||
#define CONFIG_PRINTF_RNDN
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_PRINTF_RNDN
|
||||
+#if !defined(FE_DOWNWARD) || !defined(FE_UPWARD)
|
||||
+#ifdef CONFIG_BIGNUM
|
||||
+#define CONFIG_DTOA_LIBBF
|
||||
+#else
|
||||
+#error "CONFIG_BIGNUM required if printf is RNDN and there is no fenv support"
|
||||
+#endif
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
/* define to include Atomics.* operations which depend on the OS
|
||||
threads */
|
||||
#if !defined(EMSCRIPTEN)
|
||||
@@ -11299,6 +11309,11 @@ static char *i64toa(char *buf_end, int64_t n, unsigned int base)
|
||||
return q;
|
||||
}
|
||||
|
||||
+/* maximum buffer size for js_dtoa */
|
||||
+#define JS_DTOA_BUF_SIZE 128
|
||||
+
|
||||
+#ifndef CONFIG_DTOA_LIBBF
|
||||
+
|
||||
/* buf1 contains the printf result */
|
||||
static void js_ecvt1(double d, int n_digits, int *decpt, int *sign, char *buf,
|
||||
int rounding_mode, char *buf1, int buf1_size)
|
||||
@@ -11318,9 +11333,6 @@ static void js_ecvt1(double d, int n_digits, int *decpt, int *sign, char *buf,
|
||||
*decpt = atoi(buf1 + n_digits + 2 + (n_digits > 1)) + 1;
|
||||
}
|
||||
|
||||
-/* maximum buffer size for js_dtoa */
|
||||
-#define JS_DTOA_BUF_SIZE 128
|
||||
-
|
||||
/* needed because ecvt usually limits the number of digits to
|
||||
17. Return the number of digits. */
|
||||
static int js_ecvt(double d, int n_digits, int *decpt, int *sign, char *buf,
|
||||
@@ -11429,6 +11441,8 @@ static void js_fcvt(char *buf, int buf_size, double d, int n_digits)
|
||||
js_fcvt1(buf, buf_size, d, n_digits, rounding_mode);
|
||||
}
|
||||
|
||||
+#endif /* CONFIG_DTOA_LIBBF */
|
||||
+
|
||||
/* radix != 10 is only supported with flags = JS_DTOA_VAR_FORMAT */
|
||||
/* use as many digits as necessary */
|
||||
#define JS_DTOA_VAR_FORMAT (0 << 0)
|
||||
@@ -11442,8 +11456,10 @@ static void js_fcvt(char *buf, int buf_size, double d, int n_digits)
|
||||
/* XXX: slow and maybe not fully correct. Use libbf when it is fast enough.
|
||||
XXX: radix != 10 is only supported for small integers
|
||||
*/
|
||||
-static void js_dtoa1(char *buf, double d, int radix, int n_digits, int flags)
|
||||
+static JSValue js_dtoa(JSContext *ctx,
|
||||
+ double d, int radix, int n_digits, int flags)
|
||||
{
|
||||
+ char buf[JS_DTOA_BUF_SIZE];
|
||||
char *q;
|
||||
|
||||
if (!isfinite(d)) {
|
||||
@@ -11465,6 +11481,25 @@ static void js_dtoa1(char *buf, double d, int radix, int n_digits, int flags)
|
||||
ptr = i64toa(buf1 + sizeof(buf1), i64, radix);
|
||||
strcpy(buf, ptr);
|
||||
} else {
|
||||
+#ifdef CONFIG_DTOA_LIBBF
|
||||
+ bf_flags_t bf_flags;
|
||||
+ generic_conv:
|
||||
+ bf_flags = BF_RNDNA;
|
||||
+ switch (flags & 3) {
|
||||
+ case JS_DTOA_VAR_FORMAT:
|
||||
+ bf_flags |= BF_FTOA_FORMAT_FREE_MIN;
|
||||
+ break;
|
||||
+ case JS_DTOA_FIXED_FORMAT:
|
||||
+ bf_flags |= BF_FTOA_FORMAT_FIXED;
|
||||
+ break;
|
||||
+ case JS_DTOA_FRAC_FORMAT:
|
||||
+ bf_flags |= BF_FTOA_FORMAT_FRAC;
|
||||
+ break;
|
||||
+ }
|
||||
+ if (flags & JS_DTOA_FORCE_EXP)
|
||||
+ bf_flags |= BF_FTOA_FORCE_EXP;
|
||||
+ return js_ftoa(ctx, JS_NewFloat64(ctx, d), radix, n_digits, bf_flags);
|
||||
+#else /* CONFIG_DTOA_LIBBF */
|
||||
if (d == 0.0)
|
||||
d = 0.0; /* convert -0 to 0 */
|
||||
if (flags == JS_DTOA_FRAC_FORMAT) {
|
||||
@@ -11528,14 +11563,8 @@ static void js_dtoa1(char *buf, double d, int radix, int n_digits, int flags)
|
||||
sprintf(q, "%d", p);
|
||||
}
|
||||
}
|
||||
+#endif /* CONFIG_DTOA_LIBBF */
|
||||
}
|
||||
-}
|
||||
-
|
||||
-static JSValue js_dtoa(JSContext *ctx,
|
||||
- double d, int radix, int n_digits, int flags)
|
||||
-{
|
||||
- char buf[JS_DTOA_BUF_SIZE];
|
||||
- js_dtoa1(buf, d, radix, n_digits, flags);
|
||||
return JS_NewString(ctx, buf);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
diff --git a/quickjs-libc.c b/quickjs-libc.c
|
||||
index 54a7a15..a64c4d6 100644
|
||||
index e180dd0..76182d2 100644
|
||||
--- a/quickjs-libc.c
|
||||
+++ b/quickjs-libc.c
|
||||
@@ -385,12 +385,86 @@ fail:
|
||||
@@ -358,12 +358,89 @@ fail:
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
|
||||
+#define READALL_CHUNK (10*1024)
|
||||
+// For reading files that are not seekable, per second answer from stackoverflow:
|
||||
+// https://stackoverflow.com/questions/14002954/c-programming-how-to-read-the-whole-file-contents-into-a-buffer
|
||||
+
|
||||
+#define READALL_CHUNK 10*1024
|
||||
+
|
||||
+static int readall(FILE *f, JSContext *ctx, uint8_t **dataptr, size_t *sizeptr)
|
||||
+{
|
||||
@@ -87,10 +90,10 @@ index 54a7a15..a64c4d6 100644
|
||||
size_t buf_len;
|
||||
- long lret;
|
||||
+ long lret = 0;
|
||||
|
||||
|
||||
f = fopen(filename, "rb");
|
||||
if (!f)
|
||||
@@ -398,7 +472,7 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
|
||||
@@ -371,7 +448,7 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
|
||||
if (fseek(f, 0, SEEK_END) < 0)
|
||||
goto fail;
|
||||
lret = ftell(f);
|
||||
@@ -99,7 +102,7 @@ index 54a7a15..a64c4d6 100644
|
||||
goto fail;
|
||||
/* XXX: on Linux, ftell() return LONG_MAX for directories */
|
||||
if (lret == LONG_MAX) {
|
||||
@@ -414,13 +488,19 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
|
||||
@@ -387,13 +464,19 @@ uint8_t *js_load_file(JSContext *ctx, size_t *pbuf_len, const char *filename)
|
||||
buf = malloc(buf_len + 1);
|
||||
if (!buf)
|
||||
goto fail;
|
||||
@@ -51,10 +51,6 @@
|
||||
"description": "MAP Agent Backhaul Info",
|
||||
"cmd": "ubus call map.agent backhaul_info"
|
||||
},
|
||||
{
|
||||
"description": "MAP Agent Backhaul Status",
|
||||
"cmd": "ubus call map.agent backhaul"
|
||||
},
|
||||
{
|
||||
"description": "MAP Controller Status",
|
||||
"cmd": "ubus call map.controller status"
|
||||
|
||||
@@ -28,15 +28,4 @@ config SSHMNGR_SFTP
|
||||
default y
|
||||
help
|
||||
Enable this option to support the SFTP protocol.
|
||||
|
||||
config SSHMNGR_SECURITY_MFA
|
||||
bool "MFA using PAM and Google authenticator"
|
||||
depends on SSHMNGR_BACKEND_OPENSSH_PAM
|
||||
default n
|
||||
help
|
||||
Enable this option to use MFA with PAM based Google authenticator.
|
||||
|
||||
config SSHMNGR_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sshmngr
|
||||
PKG_VERSION:=1.1.1
|
||||
PKG_VERSION:=1.0.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/sshmngr.git
|
||||
PKG_SOURCE_VERSION:=dc0e3933231680aec844d587d49fefbc0cc7f8d7
|
||||
PKG_SOURCE_VERSION:=0c7d58a51d6f5eb4ad33e03630206bbb4e559779
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -34,7 +34,6 @@ define Package/sshmngr
|
||||
DEPENDS+=+SSHMNGR_BACKEND_OPENSSH_PAM:openssh-server-pam +SSHMNGR_BACKEND_OPENSSH_PAM:openssh-client-utils
|
||||
DEPENDS+=+SSHMNGR_BACKEND_DROPBEAR:dropbear
|
||||
DEPENDS+=+SSHMNGR_SFTP:openssh-sftp-server
|
||||
DEPENDS+=+SSHMNGR_SECURITY_MFA:google-authenticator-libpam
|
||||
endef
|
||||
|
||||
define Package/sshmngr/description
|
||||
@@ -45,13 +44,6 @@ define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_SSHMNGR_VENDOR_PREFIX),"")
|
||||
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
|
||||
else
|
||||
VENDOR_PREFIX = $(CONFIG_SSHMNGR_VENDOR_PREFIX)
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./sshmngr/* $(PKG_BUILD_DIR)/
|
||||
@@ -75,16 +67,6 @@ endif
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libsshmngr.so $(1) $(PKG_NAME)
|
||||
|
||||
ifeq ($(CONFIG_SSHMNGR_BACKEND_OPENSSH_PAM),y)
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DATA) ./files/openssh_backend/lib/sshmngr/pam_config.sh $(1)/lib/sshmngr/
|
||||
$(INSTALL_BIN) ./files/openssh_backend/etc/uci-defaults/91-set-sshd-pam $(1)/etc/uci-defaults/
|
||||
ifeq ($(CONFIG_SSHMNGR_SECURITY_MFA),y)
|
||||
$(INSTALL_BIN) ./files/openssh_backend/etc/uci-defaults/92-set-ssh-mfa $(1)/etc/uci-defaults/
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) -v ${VENDOR_PREFIX} ./files/openssh_backend/ssh_mfa_override.json $(1) $(PKG_NAME)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_fail2ban),y)
|
||||
$(INSTALL_DIR) $(1)/etc/fail2ban/jail.d
|
||||
$(INSTALL_DIR) $(1)/etc/fail2ban/filter.d/
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/sshmngr/backend.sh
|
||||
|
||||
MFA_SECRET_FILE="/etc/security/mfa_secret"
|
||||
|
||||
add_server_name()
|
||||
{
|
||||
local server_sec="${1}"
|
||||
@@ -46,7 +44,7 @@ get_pid()
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "dump" : {"server_name":"string"}, "kill_session" : {"session_pid":"string","server_name":"string"}, "list_keys" : {}, "add_pubkey" : {"current_key":"string","new_key":"string"}, "remove_pubkey" : {"key":"string"}, "get_mfa_key" : {}, "get_mfa_recovery" : {} }'
|
||||
echo '{ "dump" : {"server_name":"string"}, "kill_session" : {"session_pid":"string","server_name":"string"}, "list_keys" : {}, "add_pubkey" : {"current_key":"string","new_key":"string"}, "remove_pubkey" : {"key":"string"} }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
@@ -223,31 +221,6 @@ case "$1" in
|
||||
fi
|
||||
echo '{}'
|
||||
;;
|
||||
|
||||
get_mfa_key)
|
||||
mfa_key=""
|
||||
if [ -f "${MFA_SECRET_FILE}" ]; then
|
||||
mfa_key="$(head -n 1 "$MFA_SECRET_FILE" 2>/dev/null)"
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_add_string "mfa_key" "${mfa_key}"
|
||||
json_dump
|
||||
;;
|
||||
|
||||
get_mfa_recovery)
|
||||
mfa_recovery_codes=""
|
||||
|
||||
if [ -f "${MFA_SECRET_FILE}" ]; then
|
||||
mfa_recovery_codes="$(tail -n 3 "$MFA_SECRET_FILE" 2>/dev/null | tr '\n' ',')"
|
||||
# remove trailing comma
|
||||
mfa_recovery_codes="${mfa_recovery_codes%,}"
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_add_string "recovery_codes" "${mfa_recovery_codes}"
|
||||
json_dump
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# create or over-write our desired file
|
||||
# /etc/pam.d/sshd
|
||||
cat << 'EOF' > /etc/pam.d/sshd
|
||||
auth required pam_env.so
|
||||
auth include sshd-auth
|
||||
account required pam_nologin.so
|
||||
account include sshd-account
|
||||
session include common-session
|
||||
session required pam_limits.so
|
||||
password include sshd-password
|
||||
EOF
|
||||
|
||||
# /etc/pam.d/sshd-auth
|
||||
cat << 'EOF' > /etc/pam.d/sshd-auth
|
||||
auth [success=1 default=ignore] pam_unix.so nullok_secure
|
||||
auth requisite pam_deny.so
|
||||
auth required pam_permit.so
|
||||
EOF
|
||||
|
||||
# /etc/pam.d/sshd-password
|
||||
cat << 'EOF' > /etc/pam.d/sshd-password
|
||||
password [success=1 default=ignore] pam_unix.so sha512
|
||||
password requisite pam_deny.so
|
||||
password required pam_permit.so
|
||||
EOF
|
||||
|
||||
# /etc/pam.d/sshd-account
|
||||
cat << 'EOF' > /etc/pam.d/sshd-account
|
||||
account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
|
||||
account requisite pam_deny.so
|
||||
account required pam_permit.so
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /etc/config/sshd ]; then
|
||||
# make sure not to change already existing setting
|
||||
if ! uci -q get sshd.@sshd[0].UseMFA 2>&1 > /dev/null; then
|
||||
uci -q set sshd.@sshd[0].UseMFA=1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,228 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# List of required .so files
|
||||
REQUIRED_MODULES="
|
||||
/usr/lib/security/pam_faildelay.so
|
||||
/usr/lib/security/pam_faillock.so
|
||||
/usr/lib/security/pam_unix.so
|
||||
/usr/lib/security/pam_deny.so
|
||||
/usr/lib/security/pam_permit.so
|
||||
/usr/lib/security/pam_passwdqc.so
|
||||
"
|
||||
|
||||
MFA_APP="google-authenticator"
|
||||
MFA_LIB="/usr/lib/security/pam_google_authenticator.so"
|
||||
MFA_DIR="/etc/security"
|
||||
MFA_SECRET_FILE="${MFA_DIR}/mfa_secret"
|
||||
MFA_QR_FILE="${MFA_DIR}/mfa_qr"
|
||||
|
||||
log() {
|
||||
echo "$*" | logger -t sshd.init -p info
|
||||
}
|
||||
|
||||
log_err() {
|
||||
echo "$*" | logger -t sshd.init -p err
|
||||
}
|
||||
|
||||
check_required_modules() {
|
||||
for mod in $REQUIRED_MODULES; do
|
||||
if [ ! -f "$mod" ]; then
|
||||
log_err "ERROR: Cannot setup security policy, missing PAM module: $mod"
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
write_line() {
|
||||
local filepath="$1"
|
||||
local line="$2"
|
||||
|
||||
echo "$line" >> "$filepath"
|
||||
}
|
||||
|
||||
compare_and_replace() {
|
||||
local src dst
|
||||
src="$1"
|
||||
dst="$2"
|
||||
|
||||
if [ ! -f "$dst" ] || ! cmp -s "$src" "$dst"; then
|
||||
cp "$src" "$dst"
|
||||
log "Updated $dst"
|
||||
fi
|
||||
}
|
||||
|
||||
setup_mfa() {
|
||||
mkdir -p "$MFA_DIR"
|
||||
|
||||
if [ -f "${MFA_SECRET_FILE}" ] && [ -f "${MFA_QR_FILE}" ]; then
|
||||
log "Not updating MFA files, they already exist"
|
||||
return
|
||||
fi
|
||||
|
||||
touch "$MFA_SECRET_FILE"
|
||||
touch "$MFA_QR_FILE"
|
||||
chmod 600 "$MFA_SECRET_FILE"
|
||||
chmod 600 "$MFA_QR_FILE"
|
||||
|
||||
local cmd="$MFA_APP -f -s $MFA_SECRET_FILE -C -t -d -r 3 -R 30 -w 3 -Q UTF8 -e 3"
|
||||
|
||||
log "Running MFA app: $cmd"
|
||||
# if the google-authenticator senses that the output is not going to a terminal
|
||||
# then it does not print out the QR, so simple redirection does not work
|
||||
# we have to run the command inside a pseudo-terminal using script command
|
||||
# and then redirect that output to a file
|
||||
cmd="script -q -c \"$cmd\" $MFA_QR_FILE > /dev/null"
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
update_auth() {
|
||||
# Write /etc/pam.d/sshd-auth
|
||||
local tmp_file pam_file
|
||||
tmp_file="/tmp/sshd-auth"
|
||||
pam_file="/etc/pam.d/sshd-auth"
|
||||
|
||||
local auth_enabled="${1}"
|
||||
local enabled="${2}"
|
||||
local mfa_enabled="${3}"
|
||||
|
||||
local faildelay="$(uci -q get users.authentication_policy.fail_delay || echo 3)"
|
||||
local faillock_lockout_time="$(uci -q get users.authentication_policy.faillock_lockout_time || echo 300)"
|
||||
local faillock_attempts="$(uci -q get users.authentication_policy.faillock_attempts || echo 6)"
|
||||
|
||||
# Convert seconds to microseconds for pam_faildelay
|
||||
local faildelay_usec=$((faildelay * 1000000))
|
||||
|
||||
rm -f "$tmp_file"
|
||||
touch "$tmp_file"
|
||||
|
||||
if [ "${auth_enabled}" -eq 1 ] && [ "${enabled}" -eq 1 ]; then
|
||||
write_line "$tmp_file" "auth optional pam_faildelay.so delay=$faildelay_usec"
|
||||
write_line "$tmp_file" "auth required pam_faillock.so preauth deny=$faillock_attempts even_deny_root unlock_time=$faillock_lockout_time"
|
||||
fi
|
||||
|
||||
write_line "$tmp_file" "auth [success=1 default=bad] pam_unix.so nullok_secure"
|
||||
write_line "$tmp_file" "auth [default=die] pam_faillock.so authfail audit deny=$faillock_attempts even_deny_root unlock_time=$faillock_lockout_time"
|
||||
|
||||
if [ "$mfa_enabled" -eq 1 ]; then
|
||||
write_line "$tmp_file" "auth [success=1 default=bad] pam_google_authenticator.so secret=$MFA_SECRET_FILE"
|
||||
write_line "$tmp_file" "auth [default=die] pam_faillock.so authfail audit deny=$faillock_attempts even_deny_root unlock_time=$faillock_lockout_time"
|
||||
fi
|
||||
|
||||
write_line "$tmp_file" "auth sufficient pam_faillock.so authsucc audit deny=$faillock_attempts even_deny_root unlock_time=$faillock_lockout_time"
|
||||
|
||||
write_line "$tmp_file" "auth requisite pam_deny.so"
|
||||
|
||||
compare_and_replace "$tmp_file" "$pam_file"
|
||||
}
|
||||
|
||||
build_pam_passwdqc_line() {
|
||||
local base="password requisite pam_passwdqc.so"
|
||||
local k v line
|
||||
|
||||
for line in $(uci show users.passwdqc 2>/dev/null); do
|
||||
case "$line" in
|
||||
users.passwdqc=*) continue ;;
|
||||
users.passwdqc.enabled=*) continue ;;
|
||||
esac
|
||||
|
||||
k="${line%%=*}"
|
||||
k="${k#users.passwdqc.}"
|
||||
v="${line#*=}"
|
||||
v="${v%\'}"
|
||||
v="${v#\'}"
|
||||
base="$base $k=$v"
|
||||
done
|
||||
|
||||
base="$base match=0"
|
||||
|
||||
echo "$base"
|
||||
}
|
||||
|
||||
# NOTE:
|
||||
# for some reason setting min 8 makes passwdqc accept minimum 12 letter password with this configuration
|
||||
# if we set it to 12 then we need atleast 16 characters and so on
|
||||
# passphrase = 0 means no space separated words
|
||||
# passphrase = N means the number of words required for a passphrase or 0 to disable the support for user-chosen passphrases.
|
||||
# rest can be figured out from passwdqc man page
|
||||
update_password() {
|
||||
local tmp_file pam_file enabled line
|
||||
tmp_file="/tmp/sshd-password"
|
||||
pam_file="/etc/pam.d/sshd-password"
|
||||
|
||||
local auth_enabled="${1}"
|
||||
|
||||
rm -f "$tmp_file"
|
||||
touch "$tmp_file"
|
||||
|
||||
# Check if section exists
|
||||
if uci -q get users.passwdqc >/dev/null 2>&1; then
|
||||
# if enabled is not present it is assumed to be 0
|
||||
enabled=$(uci -q get users.passwdqc.enabled || echo "0")
|
||||
if [ "${auth_enabled}" -eq 1 ] && [ "${enabled}" -eq 1 ]; then
|
||||
line="$(build_pam_passwdqc_line)"
|
||||
write_line "$tmp_file" "$line"
|
||||
fi
|
||||
fi
|
||||
|
||||
write_line "$tmp_file" "password [success=1 default=ignore] pam_unix.so sha512"
|
||||
write_line "$tmp_file" ""
|
||||
write_line "$tmp_file" "password requisite pam_deny.so"
|
||||
write_line "$tmp_file" "password required pam_permit.so"
|
||||
|
||||
compare_and_replace "$tmp_file" "$pam_file"
|
||||
}
|
||||
|
||||
update_account() {
|
||||
# Write /etc/pam.d/sshd-account
|
||||
local tmp_file pam_file
|
||||
tmp_file="/tmp/sshd-account"
|
||||
pam_file="/etc/pam.d/sshd-account"
|
||||
|
||||
local auth_enabled="${1}"
|
||||
local enabled="${2}"
|
||||
|
||||
rm -f "$tmp_file"
|
||||
touch "$tmp_file"
|
||||
|
||||
if [ "${auth_enabled}" -eq 1 ] && [ "${enabled}" -eq 1 ]; then
|
||||
write_line "$tmp_file" "account required pam_faillock.so"
|
||||
fi
|
||||
|
||||
write_line "$tmp_file" "account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so"
|
||||
write_line "$tmp_file" ""
|
||||
write_line "$tmp_file" "account requisite pam_deny.so"
|
||||
write_line "$tmp_file" "account required pam_permit.so"
|
||||
|
||||
compare_and_replace "$tmp_file" "$pam_file"
|
||||
}
|
||||
|
||||
handle_security_policy() {
|
||||
local auth_enabled enabled
|
||||
local use_mfa mfa_enabled
|
||||
|
||||
# Read UCI values
|
||||
auth_enabled="$(uci -q get users.users.auth_policy_enable || echo 0)"
|
||||
enabled="$(uci -q get users.authentication_policy.enabled || echo 0)"
|
||||
use_mfa="$(uci -q get sshd.@sshd[0].UseMFA || echo 0)"
|
||||
|
||||
# if any .so files are missing, then we cannot setup security
|
||||
if ! check_required_modules; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Detect and enable MFA only if requested and module exists
|
||||
if which "$MFA_APP" > /dev/null 2>&1 && [ "$use_mfa" = "1" ] && [ -f "$MFA_LIB" ]; then
|
||||
mfa_enabled=1
|
||||
setup_mfa
|
||||
else
|
||||
rm -rf "${MFA_QR_FILE}"
|
||||
rm -rf "${MFA_SECRET_FILE}"
|
||||
mfa_enabled=0
|
||||
fi
|
||||
|
||||
update_auth "${auth_enabled}" "${enabled}" "${mfa_enabled}"
|
||||
update_account "${auth_enabled}" "${enabled}"
|
||||
update_password "${auth_enabled}"
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
{
|
||||
"json_plugin_version": 2,
|
||||
"Device.SSH.Server.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"{BBF_VENDOR_PREFIX}UseMFA": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "UseMFA"
|
||||
}
|
||||
]
|
||||
},
|
||||
"{BBF_VENDOR_PREFIX}MFA_Key": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "ubus",
|
||||
"ubus": {
|
||||
"object": "sshmngr",
|
||||
"method": "get_mfa_key",
|
||||
"args": {},
|
||||
"key": "mfa_key"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"{BBF_VENDOR_PREFIX}MFA_Recovery_Codes": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "ubus",
|
||||
"ubus": {
|
||||
"object": "sshmngr",
|
||||
"method": "get_mfa_recovery",
|
||||
"args": {},
|
||||
"key": "recovery_codes"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,8 +50,6 @@ location / {
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,Content-Type,Range' always;
|
||||
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
||||
}
|
||||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
||||
add_header Pragma 'no-cache';
|
||||
|
||||
if (!-f $document_root/connection/ready) {
|
||||
return 503;
|
||||
|
||||
@@ -8,7 +8,7 @@ config SWMODD_REGISTRY_PULL_SUPPORT
|
||||
config SWMODD_LXC_SUPPORT
|
||||
bool "Handles LXC based containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default n
|
||||
default y
|
||||
select PACKAGE_lxc
|
||||
select PACKAGE_lxc-attach
|
||||
select PACKAGE_lxc-auto
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user