mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
342 Commits
debug_lo_i
...
subnet_acl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb7b1cf0b8 | ||
|
|
ff24c2e1fa | ||
|
|
9944917399 | ||
|
|
2a25fc0ec7 | ||
|
|
ebd7e68714 | ||
|
|
000762c0cb | ||
|
|
c4328f411f | ||
|
|
0428934a69 | ||
|
|
580d24e04a | ||
|
|
95778a4262 | ||
|
|
02ee448479 | ||
|
|
0dcc9743a2 | ||
|
|
1a1a1e1255 | ||
|
|
9710e46c51 | ||
|
|
19e69f7b61 | ||
|
|
e319c85064 | ||
|
|
29638a28f7 | ||
|
|
ccb337ecbd | ||
|
|
5474b1c6d0 | ||
|
|
8df0ad8e46 | ||
|
|
6e358a6bd1 | ||
|
|
20a28db536 | ||
|
|
c6ee9114bc | ||
|
|
89fb4a0857 | ||
|
|
8d86188ff1 | ||
|
|
18d6afea15 | ||
|
|
0cb9aac1f1 | ||
|
|
dfe2af4643 | ||
|
|
2fe133227d | ||
|
|
15f17da6e5 | ||
|
|
2e56ef292c | ||
|
|
65e4bebc0f | ||
|
|
ceb577a6ab | ||
|
|
2d45a45126 | ||
|
|
45294a9f0c | ||
|
|
eb5c837353 | ||
|
|
495d95dcc8 | ||
|
|
32e5dc46b3 | ||
|
|
6980c1e2e5 | ||
|
|
da727b4dc1 | ||
|
|
d8aaacc4c9 | ||
|
|
e036702c16 | ||
|
|
604a105bc9 | ||
|
|
04bdaa950f | ||
|
|
54fdaf2b43 | ||
|
|
644e98e595 | ||
|
|
9fc594d74f | ||
|
|
ac7cfb581e | ||
|
|
ba75b33fc5 | ||
|
|
912978164b | ||
|
|
7a50c328e1 | ||
|
|
f8c9088db7 | ||
|
|
fd34c3e9f3 | ||
|
|
70d7d7a64d | ||
|
|
112f4cb99d | ||
|
|
2380a6de86 | ||
|
|
b0c168322e | ||
|
|
22d8a0992c | ||
|
|
3c075c293c | ||
|
|
17ae16e5d2 | ||
|
|
46dc9e86d8 | ||
|
|
0b3420240d | ||
|
|
83ca06b626 | ||
|
|
2dafb9ec2c | ||
|
|
c2c54e5ca0 | ||
|
|
9314e4bbf3 | ||
|
|
5840332288 | ||
|
|
bb4fffb680 | ||
|
|
4b2b09080d | ||
|
|
ba651b5457 | ||
|
|
1509db0630 | ||
|
|
85e97ca660 | ||
|
|
f9640bc237 | ||
|
|
72b16e33ab | ||
|
|
4e81706967 | ||
|
|
483fc2e6cb | ||
|
|
c2594f2d37 | ||
|
|
fb2eac485b | ||
|
|
c867ab610e | ||
|
|
ef8d667b83 | ||
|
|
3934674c81 | ||
|
|
4f53f35dc1 | ||
|
|
4fe815299a | ||
|
|
9394517727 | ||
|
|
742b357026 | ||
|
|
d383896918 | ||
|
|
646f5d6e1c | ||
|
|
d897632279 | ||
|
|
47e93f13c1 | ||
|
|
70bb662514 | ||
|
|
6f9ec4bf7d | ||
|
|
fc88c554c1 | ||
|
|
5ba6ade386 | ||
|
|
0d1b585c5d | ||
|
|
bf43efa993 | ||
|
|
0e3545cacb | ||
|
|
fefe14d540 | ||
|
|
b6df14f78e | ||
|
|
24cfbe2e48 | ||
|
|
eee28bb66c | ||
|
|
5fcee38906 | ||
|
|
72a9da5bd3 | ||
|
|
2cf19c9469 | ||
|
|
bd0fed8409 | ||
|
|
b23e510dd3 | ||
|
|
bf06544066 | ||
|
|
85762b4641 | ||
|
|
60dafc2028 | ||
|
|
e6054d9f8f | ||
|
|
8b106e6b58 | ||
|
|
41edb9f1a5 | ||
|
|
f6026298e8 | ||
|
|
c3ab091cdc | ||
|
|
dcfca56db8 | ||
|
|
991657fc99 | ||
|
|
90f13664e9 | ||
|
|
e843c83d0c | ||
|
|
7d5c13a9f5 | ||
|
|
417a5c5428 | ||
|
|
0074af0d3c | ||
|
|
fae1f7d816 | ||
|
|
f500a8c749 | ||
|
|
af9e4f99c6 | ||
|
|
e451e32f77 | ||
|
|
26cbba9724 | ||
|
|
5be4e38c68 | ||
|
|
549534f8aa | ||
|
|
f4a623e637 | ||
|
|
833a9a002a | ||
|
|
ff4e68f70a | ||
|
|
b471113bfa | ||
|
|
2b997a4386 | ||
|
|
06a280707a | ||
|
|
c54fd95889 | ||
|
|
86fb3db75b | ||
|
|
70cda05eda | ||
|
|
502aab4f3c | ||
|
|
34b63e84aa | ||
|
|
5f2aa06285 | ||
|
|
5232cc61ac | ||
|
|
98d8e9866c | ||
|
|
0e59fd0d47 | ||
|
|
a7e8e65d88 | ||
|
|
1fd74364fa | ||
|
|
20c49302c1 | ||
|
|
c2e5ade3bb | ||
|
|
b933622547 | ||
|
|
7b12c29425 | ||
|
|
082452bfb5 | ||
|
|
a6b8987dac | ||
|
|
d1307bfd76 | ||
|
|
edd78f675e | ||
|
|
3a1772e1b8 | ||
|
|
b2dd40cae3 | ||
|
|
24f22d0ecc | ||
|
|
a86f478014 | ||
|
|
9a59ccc498 | ||
|
|
15e4dd732a | ||
|
|
784a281fa6 | ||
|
|
8f82b31658 | ||
|
|
3745b4e913 | ||
|
|
90d646319b | ||
|
|
13064e27b3 | ||
|
|
539bf50985 | ||
|
|
1b7b377bd1 | ||
|
|
1c9ba1c83c | ||
|
|
e307ee7aa8 | ||
|
|
6bcf7987d7 | ||
|
|
ff146bf093 | ||
|
|
0f23bee1da | ||
|
|
2070630b07 | ||
|
|
f1702b3e70 | ||
|
|
9634b0678b | ||
|
|
d395030be7 | ||
|
|
4cb0504eb3 | ||
|
|
6df57301f9 | ||
|
|
f527b8a25a | ||
|
|
fbba67542e | ||
|
|
824d6d3abe | ||
|
|
1a9a339cc6 | ||
|
|
0533f114d1 | ||
|
|
dc579e3c60 | ||
|
|
d232e76905 | ||
|
|
2fffb45748 | ||
|
|
b15f1b5026 | ||
|
|
43a0dfc863 | ||
|
|
307381c9af | ||
|
|
1a80f2df47 | ||
|
|
9b79eb42db | ||
|
|
602926b076 | ||
|
|
74cfe57095 | ||
|
|
01845eded6 | ||
|
|
11dce5812c | ||
|
|
7af15ec9a9 | ||
|
|
8359755dc8 | ||
|
|
1a735b7730 | ||
|
|
6a008d3419 | ||
|
|
6142da5d43 | ||
|
|
f5715d478a | ||
|
|
bce9364d14 | ||
|
|
425949900b | ||
|
|
938681c270 | ||
|
|
30f7a15450 | ||
|
|
4d4006309b | ||
|
|
41f1e0d52a | ||
|
|
db207a87fc | ||
|
|
89ab349565 | ||
|
|
8ffe108f95 | ||
|
|
074d9268b0 | ||
|
|
fc7b21aa73 | ||
|
|
6f83732b0e | ||
|
|
97141307ed | ||
|
|
ddec5540bc | ||
|
|
09b97ae69d | ||
|
|
977c1b5767 | ||
|
|
467b3897fb | ||
|
|
a688381a3c | ||
|
|
9bad79439b | ||
|
|
608b9637b0 | ||
|
|
fcd59e95f0 | ||
|
|
5820d98e2c | ||
|
|
9c6b9d6260 | ||
|
|
9fad74246e | ||
|
|
aab3f74290 | ||
|
|
0eb2ce3728 | ||
|
|
f9aabb68d5 | ||
|
|
9917da1ca3 | ||
|
|
acf7344c13 | ||
|
|
693ff8bd19 | ||
|
|
c1286064bb | ||
|
|
2503b1fc72 | ||
|
|
d468c13b3f | ||
|
|
064611a15d | ||
|
|
5c427dd08a | ||
|
|
1703e6d328 | ||
|
|
35c27393ce | ||
|
|
fca93627ba | ||
|
|
417a127dd9 | ||
|
|
afde0b98ad | ||
|
|
a0069cc9be | ||
|
|
368255f50b | ||
|
|
ad1233ff32 | ||
|
|
697ddc356e | ||
|
|
b82eb8325e | ||
|
|
c150053a83 | ||
|
|
7ee83ff47f | ||
|
|
98905256f8 | ||
|
|
a8a511c4ff | ||
|
|
d0d90946b3 | ||
|
|
c2ad0fa44d | ||
|
|
be7fa433c5 | ||
|
|
01e9d7c0bc | ||
|
|
2f398a2671 | ||
|
|
8254547866 | ||
|
|
e8ceb167b5 | ||
|
|
434c794671 | ||
|
|
9628be4812 | ||
|
|
bd90dc7ec2 | ||
|
|
e0736df927 | ||
|
|
afa58be1f8 | ||
|
|
3cbcac96ba | ||
|
|
a92f32eba4 | ||
|
|
842968da4f | ||
|
|
60ef90c1b6 | ||
|
|
56cec9cb7f | ||
|
|
4042d46009 | ||
|
|
d6dfc5bd08 | ||
|
|
451036aebc | ||
|
|
8d01ace7a6 | ||
|
|
d7e22b922b | ||
|
|
a1d535058d | ||
|
|
1bb307ef4f | ||
|
|
404a642e41 | ||
|
|
ae3f1819e6 | ||
|
|
fbd8f64c40 | ||
|
|
369fc0d4bb | ||
|
|
b44afe067f | ||
|
|
d69245f570 | ||
|
|
c3564ff528 | ||
|
|
fafe1d9447 | ||
|
|
e35bf1d509 | ||
|
|
8e11e5dbc8 | ||
|
|
2698ee9358 | ||
|
|
92be6f1129 | ||
|
|
4dfc196968 | ||
|
|
1c17fed77d | ||
|
|
27b9fb9350 | ||
|
|
b917a2177e | ||
|
|
2372de4864 | ||
|
|
c5d7ddd851 | ||
|
|
a688b2091c | ||
|
|
bfc7e6a78a | ||
|
|
41495cf6e5 | ||
|
|
d3d1b444de | ||
|
|
9681b6222c | ||
|
|
d20fb01a1b | ||
|
|
85e49b3df6 | ||
|
|
511e0af668 | ||
|
|
1151478d13 | ||
|
|
7e87028731 | ||
|
|
cb18ecc420 | ||
|
|
e581c05d27 | ||
|
|
3ae6c52e7d | ||
|
|
498a06916b | ||
|
|
332057fdd4 | ||
|
|
58aff3cb45 | ||
|
|
5678b6dcaa | ||
|
|
a597c514f7 | ||
|
|
3c1dcf90eb | ||
|
|
62dc6c28a3 | ||
|
|
2703ea0421 | ||
|
|
b4a0572b7c | ||
|
|
428055c911 | ||
|
|
97723f9e7a | ||
|
|
2dceb5b44b | ||
|
|
8c9689caf7 | ||
|
|
af5bb94c8c | ||
|
|
9db65fcfba | ||
|
|
2b43c27e53 | ||
|
|
c16f4d3f82 | ||
|
|
99a4f3c036 | ||
|
|
71217d4f68 | ||
|
|
ad012d7549 | ||
|
|
6cca837500 | ||
|
|
6bec3c159c | ||
|
|
fd921bb196 | ||
|
|
60d2f92da3 | ||
|
|
8f83250890 | ||
|
|
652ec8a4af | ||
|
|
937b824055 | ||
|
|
889723079b | ||
|
|
7a457ae32a | ||
|
|
7e5e38e657 | ||
|
|
44edac6572 | ||
|
|
fea3e1e4ef | ||
|
|
eae31a6dd4 | ||
|
|
3a1a65d5df | ||
|
|
70a22d0299 | ||
|
|
2a19a1a92a | ||
|
|
5b865c9dbc | ||
|
|
bc041faf04 | ||
|
|
de08bc79a1 |
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.16.6.6
|
||||
PKG_VERSION:=1.18.10
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=6317266bdfb0180d75ed2dd830e108f09fe2526a
|
||||
PKG_SOURCE_VERSION:=1a86b8a4432a2c3a9d41a9b18ccfc830bd0083cb
|
||||
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
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr +libeasy
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr
|
||||
@@ -107,7 +107,7 @@ endif
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=20971520 \
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=10485760 \
|
||||
-DCMAKE_BUILD_TYPE:String="Debug" \
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ 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,23 +1,51 @@
|
||||
{
|
||||
"usp": [
|
||||
"firewall",
|
||||
"network",
|
||||
"dhcp",
|
||||
"time",
|
||||
"wireless",
|
||||
"ieee1905",
|
||||
"mapcontroller",
|
||||
"mosquitto",
|
||||
"nginx",
|
||||
"netmode"
|
||||
"/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/dmmap_dhcp",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_client",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_relay",
|
||||
"/etc/bbfdm/dmmap/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"
|
||||
],
|
||||
"cwmp": [
|
||||
"firewall",
|
||||
"network",
|
||||
"dhcp",
|
||||
"mapcontroller",
|
||||
"wireless",
|
||||
"time",
|
||||
"netmode"
|
||||
"/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/dmmap_dhcp",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_client",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_relay",
|
||||
"/etc/bbfdm/dmmap/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"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -10,19 +10,10 @@ 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
|
||||
|
||||
@@ -36,6 +27,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
|
||||
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh "$config_name"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bridgemngr
|
||||
PKG_VERSION:=1.0.18.2
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr
|
||||
PKG_SOURCE_VERSION:=71ed529be038392071b0399bcfe9d46e89d3cb46
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr.git
|
||||
PKG_SOURCE_VERSION:=e5e0d9adfc919c25d88a867d42a9c500cb09f834
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.20
|
||||
PKG_VERSION:=2.1.23
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=a5e57962938ca143ede65d92be90b6e9fce66e15
|
||||
PKG_SOURCE_VERSION:=f54550f2d587a701c0a8d5cac4a0910a99ce92cf
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -4,4 +4,16 @@ 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.1.14
|
||||
PKG_VERSION:=6.2.2.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d9ff69760bc34dd3928fa784dfb3116bfe3f95af
|
||||
PKG_SOURCE_VERSION:=b632ef13fed94c683d65dedcbc91afdee9ee980f
|
||||
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,6 +24,7 @@ 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
|
||||
@@ -66,6 +67,18 @@ 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)
|
||||
|
||||
@@ -76,6 +89,7 @@ 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))
|
||||
|
||||
26
decollector/bbfdm_service.json
Normal file
26
decollector/bbfdm_service.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"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.10
|
||||
PKG_VERSION:=3.7.11
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=1f851980a6ba616df54f79930225f8bcd563b711
|
||||
PKG_SOURCE_VERSION:=815ee44808169b8e1efa2cac44bd7d238ad33cdc
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
if PACKAGE_dhcpmngr
|
||||
|
||||
config DHCPMNGR_ENABLE_VENDOR_EXT
|
||||
bool "Use datamodel vendor extensions"
|
||||
default y
|
||||
help
|
||||
Set this option to use bridge BBF vendor extensions.
|
||||
|
||||
config DHCPMNGR_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
endif
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dhcpmngr
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_VERSION:=1.0.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
|
||||
PKG_SOURCE_VERSION:=e238e47fa13153c5b1890056b0d09c65879de8c5
|
||||
PKG_SOURCE_VERSION:=986f66608959f4f589009d580b046e250d8c620d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -39,22 +39,6 @@ define Package/dhcpmngr/description
|
||||
Package to add Device.DHCPv4. and Device.DHCPv6. data model support.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_DHCPMNGR_ENABLE_VENDOR_EXT),y)
|
||||
MAKE_FLAGS += DHCPMNGR_ENABLE_VENDOR_EXT=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DHCPMNGR_VENDOR_PREFIX),"")
|
||||
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
|
||||
else
|
||||
VENDOR_PREFIX = $(CONFIG_DHCPMNGR_VENDOR_PREFIX)
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/dhcpmngr/* $(PKG_BUILD_DIR)/
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2023 Genexis Netherlands B.V. All rights reserved.
|
||||
# This Software and its content are protected by the Dutch Copyright Act
|
||||
# ('Auteurswet'). All and any copying and distribution of the software
|
||||
# and its content without authorization by Genexis Netherlands B.V. is
|
||||
# prohibited. The prohibition includes every form of reproduction and
|
||||
# distribution.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dmcli-plugins
|
||||
PKG_LICENSE:=PROPRIETARY GENEXIS
|
||||
PKG_VERSION:=2.2.6
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/gnx/dmcli-plugin-easydm.git
|
||||
PKG_SOURCE_VERSION:=bc8b8527e8a41bdba73cb277a3c6c3b42b045153
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dmcli-plugins
|
||||
SECTION:=tools
|
||||
CATEGORY:=Genexis
|
||||
TITLE:=Easy-to-use data model on top of TR181
|
||||
URL:=http://genexis.eu
|
||||
DEPENDS:=+dmcli
|
||||
endef
|
||||
|
||||
define Package/dmcli-plugins/description
|
||||
EasyDM offers a user-friendly approach to configuring TR-181
|
||||
simplifying the process with its intuitive interface.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
define Package/dmcli-plugins/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/dmcli/plugins
|
||||
$(CP) $(PKG_BUILD_DIR)/src/*.js $(1)/usr/lib/dmcli/plugins/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dmcli-plugins))
|
||||
@@ -1,9 +0,0 @@
|
||||
if PACKAGE_dmcli
|
||||
|
||||
config DMCLI_REMOTE_CONNECTION
|
||||
bool "Add dmcli remote controller configuration"
|
||||
default n
|
||||
help
|
||||
This adds a usp controller configuration for dmcli remote connection from different machine/laptop/server.
|
||||
|
||||
endif
|
||||
@@ -1,75 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2021 Genexis Netherlands B.V. All rights reserved.
|
||||
# This Software and its content are protected by the Dutch Copyright Act
|
||||
# ('Auteurswet'). All and any copying and distribution of the software
|
||||
# and its content without authorization by Genexis Netherlands B.V. is
|
||||
# prohibited. The prohibition includes every form of reproduction and
|
||||
# distribution.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dmcli
|
||||
PKG_LICENSE:=PROPRIETARY GENEXIS
|
||||
PKG_VERSION:=1.9.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/gnx/dmcli.git
|
||||
PKG_SOURCE_VERSION:=2139e81d0faca09fe1832c503297ef75ea76d6eb
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dmcli
|
||||
SECTION:=tools
|
||||
CATEGORY:=Genexis
|
||||
TITLE:=DMCLI (datamodel-based CLI)
|
||||
URL:=http://genexis.eu
|
||||
DEPENDS:=+usp-js +DMCLI_REMOTE_CONNECTION:mosquitto-auth-plugin +shadow-utils +@BUSYBOX_CONFIG_ADDUSER
|
||||
endef
|
||||
|
||||
define Package/dmcli/description
|
||||
CLI to view and configure datamodels of CPE
|
||||
endef
|
||||
|
||||
define Package/dmcli/conffiles
|
||||
/etc/dmcli/dmcli.conf
|
||||
endef
|
||||
|
||||
define Package/dmcli/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/dmcli/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dmcli $(1)/usr/bin/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/dmcli
|
||||
$(CP) $(PKG_BUILD_DIR)/common $(1)/usr/lib/dmcli/
|
||||
mv $(1)/usr/lib/dmcli/common/os_qjs.js $(1)/usr/lib/dmcli/common/os.js
|
||||
rm $(1)/usr/lib/dmcli/common/os_node.js
|
||||
$(CP) $(PKG_BUILD_DIR)/core $(1)/usr/lib/dmcli/
|
||||
$(CP) $(PKG_BUILD_DIR)/cli $(1)/usr/lib/dmcli/
|
||||
$(CP) $(PKG_BUILD_DIR)/data $(1)/usr/lib/dmcli/
|
||||
$(CP) $(PKG_BUILD_DIR)/plugins $(1)/usr/lib/dmcli/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/36-dmcli $(1)/etc/uci-defaults/
|
||||
ifeq ($(CONFIG_DMCLI_REMOTE_CONNECTION),y)
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/36-dmcli-remote $(1)/etc/uci-defaults/
|
||||
else
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/36-dmcli-remote-remove $(1)/etc/uci-defaults/
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/dmcli
|
||||
$(CP) ./files/etc/dmcli/dmcli.acl $(1)/etc/dmcli/
|
||||
$(CP) ./files/etc/dmcli/dmcli.conf $(1)/etc/dmcli/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/users/roles/
|
||||
$(INSTALL_DATA) ./files/etc/users/roles/operator.json $(1)/etc/users/roles/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dmcli))
|
||||
@@ -1,4 +0,0 @@
|
||||
user operator
|
||||
topic read /usp/operator/controller/reply-to
|
||||
topic read /usp/operator/controller
|
||||
topic write /usp/operator/endpoint
|
||||
@@ -1,45 +0,0 @@
|
||||
{
|
||||
"Settings": {
|
||||
"USP": {
|
||||
"ActiveConnectionProfile": "local",
|
||||
"ConnectionProfile": [
|
||||
{
|
||||
"Name": "local",
|
||||
"Host": "127.0.0.1",
|
||||
"Port": 9002,
|
||||
"Username": "operator",
|
||||
"Protocol": "ws",
|
||||
"FromId": "oui:000F94:device-controller-operator",
|
||||
"PublishEndpoint": "/usp/operator/endpoint",
|
||||
"SubscribeEndpoint": "/usp/operator/controller"
|
||||
}
|
||||
],
|
||||
"Session": {
|
||||
"AutoStart": false
|
||||
},
|
||||
"Notification": {
|
||||
"LogTo": "console",
|
||||
"Format": "brief",
|
||||
"LogFile": "usp-notification.log"
|
||||
}
|
||||
},
|
||||
"CLI": {
|
||||
"Home": "/",
|
||||
"Color": "true",
|
||||
"Mode": "Command",
|
||||
"ShowCommandTime": false,
|
||||
"SortDMTree": false
|
||||
},
|
||||
"Prompt": {
|
||||
"Auto": true,
|
||||
"Color": "default",
|
||||
"SelectedBackgroundColor": "yellow",
|
||||
"PageSize": "3",
|
||||
"AutoPromptOnEmptyCommand": false,
|
||||
"AutoPromptInstanceNumbers": false
|
||||
},
|
||||
"Log": {
|
||||
"Level": "Error"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/iopsys-environment.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
DMCLI_CONF="/etc/dmcli/dmcli.conf"
|
||||
CONTROLLER_ID='oui:000F94:device-controller-operator'
|
||||
DMCLI_RESP_TOPIC="/usp/operator/endpoint"
|
||||
DMCLI_CTRL_TOPIC="/usp/operator/controller"
|
||||
DMCLI_PORT="9002"
|
||||
|
||||
grep -q "^operator:" /etc/passwd || {
|
||||
adduser -g 'Operator' -D -H -s /usr/bin/dmcli --home '/usr/lib/dmcli' 'operator'
|
||||
hash=""
|
||||
if type get_operator_password_hash > /dev/null 2>&1; then
|
||||
hash=$(get_operator_password_hash)
|
||||
fi
|
||||
if [ -z "$hash" ]; then
|
||||
hash='$6$zP4Wk/VQJOLwwofC$teuhnYFQBcA8YUZo/Q0quDMi4SsOHmfBcyvt5VNchPnzgwF1nfNNliC3yBVW22NwmwttPEWeBEBfnMTBB0rYs/'
|
||||
fi
|
||||
echo "operator:${hash}" | chpasswd -e
|
||||
}
|
||||
|
||||
grep -q "^/usr/bin/dmcli$" /etc/shells || {
|
||||
echo '/usr/bin/dmcli' >> /etc/shells
|
||||
}
|
||||
|
||||
uci -q del_list sshd.@sshd[0].AllowUsers='operator'
|
||||
uci -q add_list sshd.@sshd[0].AllowUsers='operator'
|
||||
|
||||
uci -q delete users.operator
|
||||
uci -q set users.operator=user
|
||||
uci -q set users.operator.enabled=1
|
||||
uci -q set users.operator.shell='dmcli'
|
||||
uci -q set users.operator.member_roles='operator'
|
||||
|
||||
if [ -f "/etc/config/mosquitto" ]; then
|
||||
uci_add mosquitto listener dmcli_local
|
||||
uci_set mosquitto dmcli_local enabled 1
|
||||
uci_set mosquitto dmcli_local port "${DMCLI_PORT}"
|
||||
uci_set mosquitto dmcli_local protocol 'websockets'
|
||||
uci_set mosquitto dmcli_local acl_file '/etc/dmcli/dmcli.acl'
|
||||
uci_set mosquitto dmcli_local no_remote_access '1'
|
||||
uci_set mosquitto dmcli_local allow_anonymous '1'
|
||||
fi
|
||||
|
||||
if [ -f "/etc/config/obuspa" ]; then
|
||||
uci_add obuspa mqtt mqtt_operator
|
||||
uci_set obuspa mqtt_operator BrokerAddress '127.0.0.1'
|
||||
uci_set obuspa mqtt_operator BrokerPort '1883'
|
||||
uci_set obuspa mqtt_operator TransportProtocol 'TCP/IP'
|
||||
|
||||
uci_add obuspa mtp mtp_operator
|
||||
uci_set obuspa mtp_operator Protocol 'MQTT'
|
||||
uci_set obuspa mtp_operator ResponseTopicConfigured "${DMCLI_RESP_TOPIC}"
|
||||
uci_set obuspa mtp_operator mqtt 'mqtt_operator'
|
||||
|
||||
uci_add obuspa controller controller_operator
|
||||
uci_set obuspa controller_operator EndpointID "${CONTROLLER_ID}"
|
||||
uci_set obuspa controller_operator Protocol 'MQTT'
|
||||
uci_set obuspa controller_operator Topic "${DMCLI_CTRL_TOPIC}"
|
||||
uci_set obuspa controller_operator mqtt 'mqtt_operator'
|
||||
uci_set obuspa controller_operator assigned_role_name 'operator'
|
||||
fi
|
||||
|
||||
_get_endpoint_id() {
|
||||
local id serial oui
|
||||
|
||||
id="$(uci -q get obuspa.localagent.EndpointID)"
|
||||
if [ -n "${id}" ]; then
|
||||
echo "${id}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
serial="$(db -q get device.deviceinfo.SerialNumber)"
|
||||
oui="$(db -q get device.deviceinfo.ManufacturerOUI)"
|
||||
|
||||
echo "os::${oui}-${serial//+/%2B}"
|
||||
}
|
||||
|
||||
update_dmcli_conf() {
|
||||
local endpointid confTmpFile
|
||||
local port fromid publish subscribe toid
|
||||
|
||||
if [ -f "${DMCLI_CONF}" ]; then
|
||||
endpointid="$(_get_endpoint_id)"
|
||||
json_load_file "${DMCLI_CONF}" || return
|
||||
json_select "Settings" || return
|
||||
json_select "USP" || return
|
||||
json_select "ConnectionProfile" || return
|
||||
json_select "1" || return
|
||||
json_get_var port "Port"
|
||||
json_get_var fromid "FromId"
|
||||
json_get_var publish "PublishEndpoint"
|
||||
json_get_var subscribe "SubscribeEndpoint"
|
||||
json_get_var toid "ToId"
|
||||
|
||||
json_add_int "Port" "${DMCLI_PORT}"
|
||||
json_add_string "FromId" "${CONTROLLER_ID}"
|
||||
json_add_string "PublishEndpoint" "${DMCLI_RESP_TOPIC}"
|
||||
json_add_string "SubscribeEndpoint" "${DMCLI_CTRL_TOPIC}"
|
||||
json_add_string "ToId" "${endpointid}"
|
||||
json_select ..
|
||||
json_select ..
|
||||
json_select ..
|
||||
json_select ..
|
||||
|
||||
if [ "${port}" != "${DMCLI_PORT}" ] || [ "${fromid}" != "${CONTROLLER_ID}" ] || \
|
||||
[ "${publish}" != "${DMCLI_RESP_TOPIC}" ] || [ "${subscribe}" != "${DMCLI_CTRL_TOPIC}" ] || \
|
||||
[ "${toid}" != "${endpointid}" ]; then
|
||||
confTmpFile="$(mktemp -u -p "$(dirname "$DMCLI_CONF")" "$(basename "$DMCLI_CONF").XXXXXXX")"
|
||||
json_pretty
|
||||
json_dump > "${confTmpFile}" || return
|
||||
mv -f "${confTmpFile}" "${DMCLI_CONF}" || return
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
update_dmcli_conf || exit
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ -f "/etc/config/mosquitto" ]; then
|
||||
uci_add mosquitto listener dmcli
|
||||
uci_set mosquitto dmcli enabled 1
|
||||
uci_set mosquitto dmcli port '9003'
|
||||
uci_set mosquitto dmcli protocol 'websockets'
|
||||
uci_set mosquitto dmcli auth_plugin '/usr/lib/mosquitto_auth_plugin.so'
|
||||
uci_set mosquitto dmcli acl_file '/etc/dmcli/dmcli.acl'
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ -f "/etc/config/mosquitto" ]; then
|
||||
uci_remove mosquitto dmcli
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"tr181": {
|
||||
"name": "operator",
|
||||
"instance": 6,
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
all: dmcli
|
||||
|
||||
dmcli: main.c
|
||||
$(CC) $(CFLAGS) -Wall -Werror -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f dmcli
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Genexis Netherlands B.V. All rights reserved.
|
||||
* This Software and its content are protected by the Dutch Copyright Act
|
||||
* ('Auteurswet'). All and any copying and distribution of the software
|
||||
* and its content without authorization by Genexis Netherlands B.V. is
|
||||
* prohibited. The prohibition includes every form of reproduction and
|
||||
* distribution.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* C Wrapper for operator to login to the CLI via ssh: the shell in
|
||||
* the passwd file cannot be a script that requires an interpreter. */
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
char *cmd[3 + (argc > 1 ? argc - 1 : 0)];
|
||||
|
||||
cmd[0] = "/usr/bin/qjs";
|
||||
cmd[1] = "/usr/lib/dmcli/cli/main.js";
|
||||
cmd[2] = NULL;
|
||||
|
||||
if (argc > 1) {
|
||||
memcpy(&cmd[2], &argv[1], (argc - 1) * sizeof(char *));
|
||||
cmd[2 + argc - 1] = NULL;
|
||||
}
|
||||
|
||||
execv(cmd[0], cmd);
|
||||
fprintf(stderr, "%s: command not found\n", cmd[0]);
|
||||
return 127;
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmngr
|
||||
PKG_VERSION:=1.0.20
|
||||
PKG_VERSION:=1.0.18
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
|
||||
PKG_SOURCE_VERSION:=448d278734a824f9d4ad1e7a55acd16c222d4c7e
|
||||
PKG_SOURCE_VERSION:=80fa147e6f1f0d9c1a62a62a693ff3adaef45363
|
||||
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.0.9
|
||||
PKG_VERSION:=3.1.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_SOURCE_VERSION:=0bcfd98d64b5bd8d3162944e2abd5740f9bf4b92
|
||||
PKG_SOURCE_VERSION:=7bc8297e1a74adb522f7635bab4f93a1a2620216
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -10,19 +10,14 @@ PKG_NAME:=fdtextract
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/fdtextract.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e3cefda3b26c9aea3021b20725ce7b31b33eebc4
|
||||
PKG_SOURCE_VERSION:=7917dbcb29724476cd46164eec29848df1e5fb67
|
||||
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
|
||||
|
||||
@@ -40,9 +35,7 @@ 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,11 +8,5 @@ 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.9.5
|
||||
PKG_VERSION:=1.0.10
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=02dc90c48d996148b68d02632bac13a28d75cf25
|
||||
PKG_SOURCE_VERSION:=05ad0d6f7f21520eecd05429c14d1963de2a8463
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -52,10 +52,6 @@ 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
|
||||
|
||||
@@ -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,15 +131,13 @@ send_host_query() {
|
||||
sleep 5
|
||||
|
||||
json_load "$(ubus call umdns browse)"
|
||||
json_select discovered_services
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
if ! json_select discovered_services; then
|
||||
json_cleanup
|
||||
loop=$(( loop - 1 ))
|
||||
continue
|
||||
fi
|
||||
|
||||
json_select _usp-agt-mqtt._tcp
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
if ! json_select _usp-agt-mqtt._tcp; then
|
||||
json_cleanup
|
||||
loop=$(( loop - 1 ))
|
||||
continue
|
||||
@@ -156,7 +154,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
|
||||
@@ -166,9 +164,10 @@ send_host_query() {
|
||||
|
||||
sent_host="${sent_host} ${_host}"
|
||||
cmd="ubus call umdns query '{\"question\":\"$_host\",\"interface\":\"$intf\"}'"
|
||||
eval $cmd
|
||||
sh -c "${cmd}"
|
||||
resp=0
|
||||
json_select ..
|
||||
sleep 2 # umdns query sometime takes time to resolve so adding some sleep
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
@@ -185,32 +184,29 @@ get_usp_agent_id() {
|
||||
fi
|
||||
|
||||
json_load "$(ubus call umdns browse)"
|
||||
json_select discovered_services
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
if ! json_select discovered_services; then
|
||||
json_cleanup
|
||||
echo ${ID}
|
||||
echo "${ID}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_select _usp-agt-mqtt._tcp
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
if ! json_select _usp-agt-mqtt._tcp; then
|
||||
json_cleanup
|
||||
echo ${ID}
|
||||
echo "${ID}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_get_keys keys
|
||||
for key in $keys; do
|
||||
json_select $key
|
||||
json_select $family
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
json_select "${key}"
|
||||
if ! json_select "${family}"; 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
|
||||
@@ -219,8 +215,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
|
||||
@@ -238,16 +234,16 @@ get_usp_agent_id() {
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
echo ${ID}
|
||||
echo "${ID}"
|
||||
}
|
||||
|
||||
get_mac_address() {
|
||||
ip="${1}"
|
||||
device="${2}"
|
||||
|
||||
mac="$(cat /proc/net/arp | grep $ip | awk '{print $4}')"
|
||||
mac=$(grep "${ip}" /proc/net/arp | 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
|
||||
@@ -260,7 +256,7 @@ send_unknown_gw_event() {
|
||||
mac="${1}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.unknown '{\"hwaddr\":\"$mac\"}'"
|
||||
eval $cmd
|
||||
sh -c "${cmd}"
|
||||
}
|
||||
|
||||
send_cwmp_gw_event() {
|
||||
@@ -269,14 +265,14 @@ send_cwmp_gw_event() {
|
||||
serial="${3}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.cwmp '{\"oui\":\"$oui\",\"class\":\"$class\",\"serial\":\"$serial\"}'"
|
||||
eval $cmd
|
||||
sh -c "${cmd}"
|
||||
}
|
||||
|
||||
send_usp_gw_event() {
|
||||
endpoint="${1}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.usp '{\"endpoint\":\"$endpoint\"}'"
|
||||
eval $cmd
|
||||
sh -c "${cmd}"
|
||||
}
|
||||
|
||||
config_load gateway
|
||||
@@ -287,13 +283,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 ""
|
||||
@@ -303,7 +299,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
|
||||
@@ -326,8 +322,8 @@ if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
get_vivsoi "$opt125" "$len"
|
||||
len=$(echo -n "${opt125}" | wc -c)
|
||||
get_vivsoi "${opt125}" "${len}"
|
||||
|
||||
if [ "${GW_DISCOVERED}" -eq 0 ]; then
|
||||
send_unknown_gw_event "${MAC}"
|
||||
@@ -341,19 +337,18 @@ if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
uci -q -c /var/state commit gwinfo
|
||||
|
||||
# Check for USP parameters
|
||||
ubus -t 15 wait_for umdns
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
if ! ubus -t 15 wait_for umdns; 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.3.6
|
||||
PKG_VERSION:=1.4.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=624fee52af9cce08c6c69a5f7dd2191691d61aa8
|
||||
PKG_SOURCE_VERSION:=230d55ae6769e1ebde02cef3f718e6c4cf1b1962
|
||||
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.9.9.8
|
||||
PKG_VERSION:=9.10.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=cef78dc528690386caac5a7ff6c1afca6dd3d315
|
||||
PKG_SOURCE_VERSION:=7f4a159f6ff49584655e57bb801218eb083fba67
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -84,7 +84,6 @@ define Package/icwmp/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/50-cwmp-align-keep-config $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-set-random-inform-time $(1)/etc/uci-defaults/
|
||||
|
||||
@@ -31,7 +31,6 @@ 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
|
||||
@@ -43,9 +42,7 @@ config cpe 'cpe'
|
||||
option periodic_notify_interval '10'
|
||||
option incoming_rule 'Port_Only'
|
||||
option active_notif_throttle '0'
|
||||
#option KeepConfig '1'
|
||||
#option KeepOpConf '1'
|
||||
#option ConfigScope 'UserOnly'
|
||||
option fw_upgrade_keep_settings '1'
|
||||
option clock_sync_timeout '128'
|
||||
option disable_datatype_check '0'
|
||||
#list allowed_cr_ip '10.5.1.0/24'
|
||||
|
||||
@@ -133,9 +133,56 @@ 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}"
|
||||
|
||||
@@ -175,8 +222,11 @@ configure_connection_req_rules() {
|
||||
fi
|
||||
fi
|
||||
|
||||
port=$(uci -q get cwmp.cpe.port)
|
||||
port="${port:-7547}"
|
||||
port=$(uci -q -c /var/state get icwmp.cpe.port)
|
||||
if [ -z "${port}" ]; then
|
||||
log "cwmp cpe port not configured"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ipaddr=$(uci -q get cwmp.cpe.allowed_cr_ip)
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
@@ -197,6 +247,8 @@ 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
|
||||
|
||||
@@ -97,9 +97,7 @@ validate_cpe_section()
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool:1' \
|
||||
'periodic_notify_interval:uinteger' \
|
||||
'KeepConfig:bool' \
|
||||
'KeepOpConf:bool' \
|
||||
'ConfigScope:string'
|
||||
'fw_upgrade_keep_settings:bool'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
@@ -170,21 +168,13 @@ start_service() {
|
||||
|
||||
stop_service()
|
||||
{
|
||||
local switch_bank KeepConfig KeepOpConf ConfigScope
|
||||
local switch_bank
|
||||
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
|
||||
switch_bank=$(uci -q -c /var/state/ get icwmp.cpe.switch_bank)
|
||||
if [ "$switch_bank" = "1" ] && [ -x /etc/sysmngr/fwbank ]; then
|
||||
KeepConfig="$(uci -q get cwmp.cpe.KeepConfig)"
|
||||
KeepOpConf="$(uci -q get cwmp.cpe.KeepOpConf)"
|
||||
ConfigScope="$(uci -q get cwmp.cpe.ConfigScope)"
|
||||
|
||||
json_init
|
||||
[ -n "${KeepConfig}" ] && json_add_boolean "keep_config" "${KeepConfig}"
|
||||
[ -n "${KeepOpConf}" ] && json_add_boolean "keep_opconf" "${KeepOpConf}"
|
||||
[ -n "${ConfigScope}" ] && json_add_string "config_scope" "${ConfigScope}"
|
||||
|
||||
json_dump| /etc/sysmngr/fwbank call copy_config
|
||||
if [ -n "$switch_bank" ] && [ "$switch_bank" = "1" ]; then
|
||||
[ -x /etc/sysmngr/fwbank ] && /etc/sysmngr/fwbank call copy_config
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
keep_settings="$(uci -q get cwmp.cpe.fw_upgrade_keep_settings)"
|
||||
if [ -n "${keep_settings}" ]; then
|
||||
uci -q delete cwmp.cpe.fw_upgrade_keep_settings
|
||||
uci -q set cwmp.cpe.KeepConfig="${keep_settings}"
|
||||
fi
|
||||
@@ -5,7 +5,6 @@ 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,13 +70,14 @@ 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"
|
||||
@@ -92,9 +93,9 @@ if [ "$discovery_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
if [ -n "$opt43" ]; then
|
||||
len=$(printf "$opt43"|wc -c)
|
||||
len=$(echo -n "$opt43"|wc -c)
|
||||
get_opt43 "$opt43" "$len"
|
||||
fi
|
||||
|
||||
@@ -102,6 +103,17 @@ 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.40
|
||||
PKG_VERSION:=8.7.38
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=06e45ad44433b98b0630dab59d943fade7c24269
|
||||
PKG_SOURCE_VERSION:=c685111f87aaca4dc17cc03b0d34e20b47c83a03
|
||||
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/* $(1)/
|
||||
$(CP) ./files/etc $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
23
ieee1905/files/datamodel_description.json
Normal file
23
ieee1905/files/datamodel_description.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"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" "-ddddd" "-o" "/tmp/ieee1905.log"
|
||||
procd_set_param command "/usr/sbin/ieee1905d" "-o" "/tmp/ieee1905.log" "-f"
|
||||
procd_set_param respawn
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param env IEEE1905_LOG_CMDU=1
|
||||
|
||||
@@ -34,9 +34,6 @@ define Package/$(PKG_NAME)
|
||||
+@PACKAGE_syslog-ng:SYSLOGNG_LOGROTATE \
|
||||
+PACKAGE_fluent-bit:logrotate \
|
||||
+@DMCLI_REMOTE_CONNECTION
|
||||
# tools used in development/testing
|
||||
DEPENDS+= \
|
||||
+iperf3
|
||||
|
||||
endef
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdpp
|
||||
PKG_VERSION:=2.1.3
|
||||
PKG_VERSION:=2.1.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fdfe23e51ff77ca6d2661ad6208d097758524147
|
||||
PKG_SOURCE_VERSION:=6024efd3db9dd490c07465ea9b0c15120063165c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/libdpp.git
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.5.1
|
||||
PKG_VERSION:=7.5.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b981f7e1bd51f66041cd0c25d15af74ae1e3bc75
|
||||
PKG_SOURCE_VERSION:=18f93677bb4d33ebb6249324a5043294f0eae16c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libeasy.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -1,27 +1,32 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Iopsys
|
||||
# Copyright (C) 2019-2024 Iopsys
|
||||
# Copyright (C) 2025 Genexis Sweden AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.13.10
|
||||
PKG_VERSION:=7.22.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=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_VERSION:=fadbe86a2ea05037ee9df6040b74bec683a6ca66
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libwifi.git
|
||||
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:=LICENSE
|
||||
PKG_LICENSE_FILES:=
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@genexis.eu>
|
||||
|
||||
MAKE_VERBOSE := 1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
@@ -42,10 +47,20 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
|
||||
else ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TARGET_WIFI_TYPE=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
|
||||
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
|
||||
@@ -67,7 +82,7 @@ endif
|
||||
PKG_BUILD_DEPENDS:=PACKAGE_kmod-mt7915e_en7523:mt76_en7523
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libwifi),)
|
||||
TARGET_CFLAGS +=-DHAS_WIFI
|
||||
CMAKE_OPTIONS +=-DHAS_WIFI=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
|
||||
@@ -78,18 +93,8 @@ 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
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)" \
|
||||
PLATFORM="$(TARGET_PLATFORM)" \
|
||||
WIFI_TYPE="$(TARGET_WIFI_TYPE)" \
|
||||
subdirs="$(subdirs)"
|
||||
CMAKE_OPTIONS += -DPLATFORM=$(TARGET_PLATFORM) -DWIFI_TYPE=$(TARGET_WIFI_TYPE)
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -97,43 +102,39 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/libwifi-common
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libwifi
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
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
|
||||
endef
|
||||
|
||||
define Package/libwifi/description
|
||||
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
|
||||
Library provides WiFi HAL APIs
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwifiutils
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(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/
|
||||
$(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/
|
||||
endef
|
||||
|
||||
define Package/libwifiutils/install
|
||||
$(INSTALL_DIR) $(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
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/libwifiutils*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifi/config
|
||||
@@ -154,13 +155,12 @@ define Package/libwifi/config
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(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/
|
||||
$(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/
|
||||
endef
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi-7*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libwifiutils))
|
||||
|
||||
@@ -65,10 +65,8 @@ define Package/logmngr/install
|
||||
$(INSTALL_DIR) $(1)/lib/logmngr
|
||||
ifeq ($(CONFIG_LOGMNGR_BACKEND_FLUENTBIT),y)
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/ntp/
|
||||
$(INSTALL_BIN) ./files/logread $(1)/sbin/
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/fluent-bit.sh $(1)/lib/logmngr/
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/ntp/20-reload_fluent_bit $(1)/etc/hotplug.d/ntp/
|
||||
else ifeq ($(CONFIG_LOGMNGR_BACKEND_SYSLOG_NG),y)
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/syslog-ng.sh $(1)/lib/logmngr/
|
||||
endif
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
# This hotplug script reloads fluent-bit, so that kmsg logs' timestamp gets in sync
|
||||
|
||||
[ "$ACTION" = stratum ] || exit 0
|
||||
|
||||
# only once
|
||||
if ! uci -q get time.global.first_use_date > /dev/null 2>&1; then
|
||||
flb_pid="$(pidof fluent-bit)"
|
||||
|
||||
if [ -n "$flb_pid" ]; then
|
||||
logger -t "logmngr.hotplug" -p info "reload fluent-bit due to ntp sync"
|
||||
kill -SIGHUP "$flb_pid"
|
||||
fi
|
||||
fi
|
||||
@@ -63,8 +63,12 @@ config AGENT_CHECK_PARTIAL_WIFI_RELOAD
|
||||
bool "Option that allow SSID/PSK simple reload"
|
||||
default y
|
||||
|
||||
config DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER
|
||||
bool "Let dynbhd through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
|
||||
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 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.3.7.17
|
||||
PKG_VERSION:=6.4.3.5
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=7f71fafbec49fa4b25d1e8d07cfc1fee5b4bbab0
|
||||
PKG_SOURCE_VERSION:=eeea7b39112717639046ac347e30ed0991ca490f
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -38,14 +38,6 @@ 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
|
||||
@@ -54,10 +46,6 @@ 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
|
||||
@@ -115,7 +103,11 @@ ifeq ($(CONFIG_AGENT_CHECK_PARTIAL_WIFI_RELOAD),y)
|
||||
TARGET_CFLAGS += -DCHECK_PARTIAL_WIFI_RELOAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER),y)
|
||||
ifeq ($(CONFIG_DYNBH),y)
|
||||
TARGET_CFLAGS += -DDYNBH
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DYNBH_DYNAMICALLY_PERSIST_CONTROLLER),y)
|
||||
TARGET_CFLAGS += -DPERSIST_CONTROLLER
|
||||
endif
|
||||
|
||||
@@ -128,6 +120,10 @@ 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
|
||||
@@ -135,15 +131,6 @@ define Package/map-agent/install
|
||||
$(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
|
||||
@@ -152,4 +139,3 @@ 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 id 'auto'
|
||||
option mode 'auto'
|
||||
option probe_int '20'
|
||||
option retry_int '9'
|
||||
option autostart '1'
|
||||
|
||||
@@ -27,11 +27,6 @@ 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)"
|
||||
@@ -95,7 +90,8 @@ if [ "$LINK" = "up" ]; then
|
||||
config_foreach remove_from_bridge bsta
|
||||
config_foreach update_bstas bsta down
|
||||
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT"
|
||||
hwaddr="$(ifconfig $PORT | grep -i hwaddr | awk '{print $5}' | awk '{print tolower($0)}')"
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT" "$hwaddr"
|
||||
else
|
||||
/lib/wifi/multiap unset_uplink "eth"
|
||||
#rm -f "$map_bh_file"
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=97
|
||||
START=98
|
||||
STOP=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' \
|
||||
@@ -51,7 +37,7 @@ validate_cs_section() {
|
||||
|
||||
uci_validate_section mapagent $section "${section}" \
|
||||
'local:bool:false' \
|
||||
'id:string' \
|
||||
'mode:string' \
|
||||
'probe_int:range(0,1000):20' \
|
||||
'retry_int:range(0,255):3' \
|
||||
'autostart:bool:false'
|
||||
@@ -179,17 +165,6 @@ 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;
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/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
|
||||
15
map-agent/files/etc/uci-defaults/994-map-set-cntlr-sel-mode
Normal file
15
map-agent/files/etc/uci-defaults/994-map-set-cntlr-sel-mode
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/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,6 +10,11 @@ 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
|
||||
@@ -64,45 +69,44 @@ generate_multiap_config() {
|
||||
device="$dev"
|
||||
|
||||
ifprefix_radio=""
|
||||
if is_airoha; then
|
||||
if is_logan; then
|
||||
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"
|
||||
}
|
||||
elif 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.13
|
||||
PKG_VERSION:=6.4.4.4
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=bd0fb2b63830e19038d9495517c03fdc3900cdfa
|
||||
PKG_SOURCE_VERSION:=3d10c21efbb0b0da7206435a1ecfeed107d55e83
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@genexis.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -4,17 +4,16 @@ 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 '30d'
|
||||
option stale_sta_timeout '20d'
|
||||
option de_collect_interval '60'
|
||||
list plugin 'zerotouch'
|
||||
|
||||
config sta_steering 'sta_steering'
|
||||
option enable_sta_steer '1'
|
||||
option enable_bsta_steer '1'
|
||||
option enable_bsta_steer '0'
|
||||
option rcpi_threshold_2g '70'
|
||||
option rcpi_threshold_5g '86'
|
||||
option rcpi_threshold_6g '86'
|
||||
|
||||
@@ -20,7 +20,6 @@ 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' \
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/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
|
||||
@@ -21,21 +21,9 @@ 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,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-plugins
|
||||
PKG_VERSION:=1.2.6
|
||||
PKG_VERSION:=1.2.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dd873ca4e2cb321302dae1955da24d1be271b2b1
|
||||
PKG_SOURCE_VERSION:=03524191711a50a07b9c26f3be2c16b845140e49
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-plugins.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -59,7 +59,8 @@ define Package/map-plugins
|
||||
endef
|
||||
|
||||
define Package/map-plugins/description
|
||||
Provides extra Multi-AP services viz. steering, channel-planning, self-organizing network etc.
|
||||
Provides extra Multi-AP services viz. steering, channel-planning,
|
||||
self-organizing network, zero-touch onboarding etc.
|
||||
endef
|
||||
|
||||
define Package/map-plugins/install
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mosquitto-auth-plugin
|
||||
PKG_VERSION:=1.2.1
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
PKG_MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
|
||||
PKG_LICENSE:=EPL-2.0
|
||||
@@ -47,7 +47,7 @@ endif
|
||||
|
||||
define Package/mosquitto-auth-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto_auth_plugin.so $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto_auth_shadow.so $(1)/usr/lib/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmngr
|
||||
PKG_VERSION:=1.1.8
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/netmngr.git
|
||||
PKG_SOURCE_VERSION:=6310f32b80f8abeccbf99ad55ce88792b19342d6
|
||||
PKG_SOURCE_VERSION:=ff08a8cc5c860056a022e5376a973dee5a323595
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=1.1.11
|
||||
PKG_VERSION:=1.1.7
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
"name": "mode"
|
||||
}
|
||||
},
|
||||
"linker_obj": "Device.{BBF_VENDOR_PREFIX}NetMode.SupportedModes.[Name==@key]."
|
||||
"linker_obj": "Device.{BBF_VENDOR_PREFIX}NetMode.SupportedModes.*.Name"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=11
|
||||
START=10
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
@@ -117,7 +117,6 @@ start_service() {
|
||||
config_get_bool enabled global enabled '0'
|
||||
[ $enabled -eq 0 ] && return
|
||||
|
||||
[ -d $MODEDIR ] || mkdir -p $MODEDIR
|
||||
# Get the desired netmode from config
|
||||
config_get mode global mode ""
|
||||
# Check if netmode is set as boot environment parameter
|
||||
@@ -128,12 +127,9 @@ start_service() {
|
||||
# Get the last saved mode
|
||||
lastmode="$(cat $MODEDIR/.last_mode 2>/dev/null)"
|
||||
# Return if desired mode is same as last saved mode
|
||||
if [ "$mode" = "$lastmode" ]; then
|
||||
_log "Not switching mode[${mode}], lastmode[${lastmode}]"
|
||||
return
|
||||
fi
|
||||
[ "$mode" == "$lastmode" ] && return
|
||||
|
||||
_log "Switching to [${mode}] Mode"
|
||||
_log "Switching to [${mode}] Mode" >/dev/console
|
||||
|
||||
# Configure env variables
|
||||
configure_env_vars ${mode}
|
||||
@@ -151,19 +147,20 @@ start_service() {
|
||||
|
||||
# Execute mode specific scripts
|
||||
if [ -d $MODEDIR/$mode/scripts ]; then
|
||||
_log "Executing $MODEDIR/$mode/scripts/* scripts"
|
||||
for script in $(ls $MODEDIR/$mode/scripts/); do
|
||||
_log "Executing [${mode}], script [${script}]"
|
||||
sh $MODEDIR/$mode/scripts/$script
|
||||
done
|
||||
fi
|
||||
|
||||
# Save mode as last mode
|
||||
echo "$mode" > $MODEDIR/.last_mode
|
||||
_log "Switching to Mode [${mode}] done, last mode updated"
|
||||
|
||||
# Execute netmode generic post-mode-switch scripts
|
||||
libnetmode_exec "post"
|
||||
cleanup_env_vars "${mode}"
|
||||
|
||||
# Save mode as last mode
|
||||
[ -d $MODEDIR ] || mkdir -p $MODEDIR
|
||||
echo "$mode" > $MODEDIR/.last_mode
|
||||
_log "Switching to Mode [${mode}] done, last mode updated" >/dev/console
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
@@ -61,8 +61,8 @@ l2_network_config() {
|
||||
uci -q set network.lan6.device='@lan'
|
||||
uci -q set network.lan6.reqprefix='no'
|
||||
|
||||
uci -q delete network.wan
|
||||
uci -q delete network.wan6
|
||||
uci -q set network.wan.disabled='1'
|
||||
uci -q set network.wan6.disabled='1'
|
||||
|
||||
uci -q delete network.br_lan.ports
|
||||
uci -q set network.br_lan.bridge_empty='1'
|
||||
@@ -116,3 +116,12 @@ l2_network_config() {
|
||||
|
||||
l2_network_config
|
||||
l2_mcast_config
|
||||
|
||||
# If device is already boot-up, assume netmode changed during runtime
|
||||
if [ -f /var/run/boot_complete ]; then
|
||||
/etc/init.d/odhcpd stop 2>/dev/null
|
||||
for config in network dhcp ssdpd cwmp gateway firewall mcast; do
|
||||
ubus call uci commit "{\"config\":\"$config\"}"
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -43,31 +43,22 @@ l3_network_config() {
|
||||
uci -q delete network.wan.netmask
|
||||
|
||||
uci -q set network.wan6=interface
|
||||
uci -q set network.wan6.proto="dhcpv6"
|
||||
uci -q set network.wan6.proto='dhcpv6'
|
||||
uci -q delete network.wan6.disabled
|
||||
|
||||
# Delete all VLAN sections; new ones will be created in next function if required
|
||||
for vlandev_sec in $(uci show network | grep "type=.*8021q" | cut -d'.' -f1,2); do
|
||||
uci -q delete $vlandev_sec
|
||||
done
|
||||
|
||||
if [ -n "$wandev" ] && echo "$NETMODE_vlanid" | grep -Eq '^[0-9]+$' && [ "$NETMODE_vlanid" -ge 1 ]; then
|
||||
vlandev="$wandev.$NETMODE_vlanid"
|
||||
vlandev_sec=$(echo $vlandev | tr '.' '_')
|
||||
uci -q set network.${vlandev_sec}=device
|
||||
uci -q set network.${vlandev_sec}.type="8021q"
|
||||
uci -q set network.${vlandev_sec}.name="$vlandev"
|
||||
uci -q set network.${vlandev_sec}.ifname="$wandev"
|
||||
uci -q set network.${vlandev_sec}.vid=$NETMODE_vlanid
|
||||
uci -q set network.vlan_${NETMODE_vlanid}=device
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.type="8021q"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.name="$wandev.$NETMODE_vlanid"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.ifname="$wandev"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.vid=$NETMODE_vlanid
|
||||
|
||||
wandev="$vlandev"
|
||||
wandev="$wandev.$NETMODE_vlanid"
|
||||
fi
|
||||
|
||||
uci -q set network.wan.device="$wandev"
|
||||
uci -q set network.wan6.device="$wandev"
|
||||
|
||||
uci -q set network.WAN.mtu="$NETMODE_mtu"
|
||||
|
||||
uci -q delete network.wan.dns
|
||||
if [ -n "$NETMODE_dns_servers" ]; then
|
||||
dns_servers="$(echo $NETMODE_dns_servers | tr ',' ' ')"
|
||||
@@ -126,3 +117,12 @@ l3_network_config() {
|
||||
|
||||
l3_network_config
|
||||
l3_mcast_config
|
||||
|
||||
# If device is already boot-up, assume netmode changed during runtime
|
||||
if [ -f /var/run/boot_complete ]; then
|
||||
/etc/init.d/odhcpd restart 2>/dev/null
|
||||
for config in network dhcp ssdpd cwmp gateway firewall mcast; do
|
||||
ubus call uci commit "{\"config\":\"$config\"}"
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -42,28 +42,20 @@ l3_network_pppoe_config() {
|
||||
uci -q delete network.wan.gateway
|
||||
uci -q delete network.wan.netmask
|
||||
|
||||
uci -q delete network.wan6
|
||||
|
||||
# Delete all VLAN sections; new ones will be created in next function if required
|
||||
for vlandev_sec in $(uci show network | grep "type=.*8021q" | cut -d'.' -f1,2); do
|
||||
uci -q delete $vlandev_sec
|
||||
done
|
||||
uci -q set network.wan6.disabled='1'
|
||||
|
||||
if [ -n "$wandev" ] && echo "$NETMODE_vlanid" | grep -Eq '^[0-9]+$' && [ "$NETMODE_vlanid" -ge 1 ]; then
|
||||
vlandev="$wandev.$NETMODE_vlanid"
|
||||
vlandev_sec=$(echo $vlandev | tr '.' '_')
|
||||
uci -q set network.${vlandev_sec}=device
|
||||
uci -q set network.${vlandev_sec}.type="8021q"
|
||||
uci -q set network.${vlandev_sec}.name="$vlandev"
|
||||
uci -q set network.${vlandev_sec}.ifname="$wandev"
|
||||
uci -q set network.${vlandev_sec}.vid=$NETMODE_vlanid
|
||||
uci -q set network.vlan_${NETMODE_vlanid}=device
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.type="8021q"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.name="$wandev.$NETMODE_vlanid"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.ifname="$wandev"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.vid=$NETMODE_vlanid
|
||||
|
||||
wandev="$vlandev"
|
||||
wandev="$wandev.$NETMODE_vlanid"
|
||||
fi
|
||||
|
||||
uci -q set network.wan.device="$wandev"
|
||||
|
||||
uci -q set network.WAN.mtu="$NETMODE_mtu"
|
||||
uci -q set network.wan6.device="$wandev"
|
||||
|
||||
uci -q delete network.wan.dns
|
||||
if [ -n "$NETMODE_dns_servers" ]; then
|
||||
@@ -123,3 +115,12 @@ l3_network_pppoe_config() {
|
||||
|
||||
l3_network_pppoe_config
|
||||
l3_mcast_config
|
||||
|
||||
# If device is already boot-up, assume netmode changed during runtime
|
||||
if [ -f /var/run/boot_complete ]; then
|
||||
/etc/init.d/odhcpd restart 2>/dev/null
|
||||
for config in network dhcp ssdpd cwmp gateway firewall mcast; do
|
||||
ubus call uci commit "{\"config\":\"$config\"}"
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -43,28 +43,20 @@ l3_network_config() {
|
||||
uci -q delete network.wan.username
|
||||
uci -q delete network.wan.password
|
||||
|
||||
uci -q delete network.wan6
|
||||
|
||||
# Delete all VLAN sections; new ones will be created in next function if required
|
||||
for vlandev_sec in $(uci show network | grep "type=.*8021q" | cut -d'.' -f1,2); do
|
||||
uci -q delete $vlandev_sec
|
||||
done
|
||||
uci -q set network.wan6.disabled='1'
|
||||
|
||||
if [ -n "$wandev" ] && echo "$NETMODE_vlanid" | grep -Eq '^[0-9]+$' && [ "$NETMODE_vlanid" -ge 1 ]; then
|
||||
vlandev="$wandev.$NETMODE_vlanid"
|
||||
vlandev_sec=$(echo $vlandev | tr '.' '_')
|
||||
uci -q set network.${vlandev_sec}=device
|
||||
uci -q set network.${vlandev_sec}.type="8021q"
|
||||
uci -q set network.${vlandev_sec}.name="$vlandev"
|
||||
uci -q set network.${vlandev_sec}.ifname="$wandev"
|
||||
uci -q set network.${vlandev_sec}.vid=$NETMODE_vlanid
|
||||
uci -q set network.vlan_${NETMODE_vlanid}=device
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.type="8021q"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.name="$wandev.$NETMODE_vlanid"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.ifname="$wandev"
|
||||
uci -q set network.vlan_${NETMODE_vlanid}.vid=$NETMODE_vlanid
|
||||
|
||||
wandev="$vlandev"
|
||||
wandev="$wandev.$NETMODE_vlanid"
|
||||
fi
|
||||
|
||||
uci -q set network.wan.device="$wandev"
|
||||
|
||||
uci -q set network.WAN.mtu="$NETMODE_mtu"
|
||||
uci -q set network.wan6.device="$wandev"
|
||||
|
||||
uci -q delete network.wan.dns
|
||||
if [ -n "$NETMODE_dns_servers" ]; then
|
||||
@@ -124,3 +116,12 @@ l3_network_config() {
|
||||
|
||||
l3_network_config
|
||||
l3_mcast_config
|
||||
|
||||
# If device is already boot-up, assume netmode changed during runtime
|
||||
if [ -f /var/run/boot_complete ]; then
|
||||
/etc/init.d/odhcpd restart 2>/dev/null
|
||||
for config in network dhcp ssdpd cwmp gateway firewall mcast; do
|
||||
ubus call uci commit "{\"config\":\"$config\"}"
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -43,12 +43,6 @@
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "mtu",
|
||||
"description": "MTU",
|
||||
"required": false,
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"name": "dns_servers",
|
||||
"description": "DNS Servers",
|
||||
|
||||
@@ -1,45 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
enabled="$(uci -q get netmode.global.enabled)"
|
||||
if [ "$enabled" != "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
opconf_file="/opconf/opconf.json"
|
||||
[ -f $opconf_file ] || opconf_file="/usr_data/opconf/opconf.json"
|
||||
|
||||
# Check if netmode getting provisioned from opconf, in case of opconf
|
||||
# provisioning, mode setting not required
|
||||
mode="$(jsonfilter -i $opconf_file -e @.netmode.mode 2>/dev/null)"
|
||||
if [ -n "${mode}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if opconf has wan provisioning enabled, if yes, get the proto/mode from opconf
|
||||
proto="$(jsonfilter -i $opconf_file -e '@.network.wan[@.name="wan"].proto' 2>/dev/null)"
|
||||
if [ -n "${proto}" ]; then
|
||||
mode="routed-${proto}"
|
||||
uci -q set netmode.global.mode="${mode}"
|
||||
echo "${mode}" > /etc/netmodes/.last_mode
|
||||
exit 0
|
||||
fi
|
||||
[ "$enabled" == "1" ] || exit 0
|
||||
|
||||
mode="$(uci -q get netmode.global.mode)"
|
||||
wanproto=$(uci -q get network.wan.proto)
|
||||
[ -n "$mode" ] && exit 0
|
||||
|
||||
if [ -n "$mode" ]; then
|
||||
# check if wanproto and mode aligned
|
||||
if [ "${mode}" = "routed-${wanproto}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/netmodes/supported_modes.json" ]; then
|
||||
exit 0
|
||||
fi
|
||||
[ -f /etc/netmodes/supported_modes.json ] || exit 0
|
||||
|
||||
# NetMode is enabled without a Mode being set
|
||||
# Figure out the current mode from network config
|
||||
wanproto=$(uci -q get network.wan.proto)
|
||||
curmode=""
|
||||
case "$wanproto" in
|
||||
dhcp) curmode="routed-dhcp" ;;
|
||||
@@ -49,12 +20,10 @@ esac
|
||||
|
||||
found=0
|
||||
for md in $(jsonfilter -i /etc/netmodes/supported_modes.json -e "@.supported_modes.*.name"); do
|
||||
[ "$md" = "$curmode" ] && found=1
|
||||
[ "$md" == "$curmode" ] && found=1
|
||||
done
|
||||
|
||||
if [ $found -eq 1 ]; then
|
||||
uci -q set netmode.global.mode="$curmode"
|
||||
echo "$curmode" > /etc/netmodes/.last_mode
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script is to cleanup dmmap and restart datamodel related services
|
||||
# when wan mode changes
|
||||
|
||||
if [ -d "/etc/bbfdm/dmmap/" ]; then
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
fi
|
||||
|
||||
# If device is booting up, no need to restart services
|
||||
if [ ! -f /var/run/boot_complete ]; then
|
||||
exit 0
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -f /etc/bbfdm/dmmap/dmmap_ppp ]; then
|
||||
rm -f /etc/bbfdm/dmmap/dmmap_ppp
|
||||
if [ -x "/etc/init.d/bbfdm.services" ]; then
|
||||
/etc/init.d/bbfdm.services restart
|
||||
fi
|
||||
|
||||
if [ -f /etc/bbfdm/dmmap/dmmap_network ]; then
|
||||
rm -f /etc/bbfdm/dmmap/dmmap_network*
|
||||
if [ -x "/etc/init.d/bbfdmd" ]; then
|
||||
/etc/init.d/bbfdmd restart
|
||||
fi
|
||||
|
||||
sleep 5
|
||||
|
||||
reboot -f
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/etc/netmodes/.last_mode
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=10.0.0.22
|
||||
PKG_VERSION:=10.0.7.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=12991107039ee685fcd1000bb2649dd1c4b344ff
|
||||
PKG_SOURCE_VERSION:=f3b5b79476adadc55830de9466361c0eeced473e
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -649,11 +649,6 @@ 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
|
||||
@@ -720,7 +715,7 @@ start_service() {
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get_bool enabled global enabled 0
|
||||
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.0.1/src/core/device_controller.c
|
||||
Index: obuspa-10.0.5.0/src/core/device_controller.c
|
||||
===================================================================
|
||||
--- 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
|
||||
--- 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
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ Index: obuspa-10.0.0.1/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);
|
||||
@@ -4252,14 +4260,6 @@ int ProcessControllerAdded(int cont_inst
|
||||
@@ -4264,14 +4272,6 @@ int ProcessControllerAdded(int cont_inst
|
||||
DEVICE_MQTT_UpdateControllerTopics();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: obuspa-10.0.0.1/src/core/bdc_exec.c
|
||||
Index: 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
|
||||
--- obuspa-10.0.4.0.orig/src/core/bdc_exec.c
|
||||
+++ obuspa-10.0.4.0/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.0.1/src/core/bdc_exec.c
|
||||
bc->headers = curl_slist_append(bc->headers, "Content-Encoding: gzip");
|
||||
}
|
||||
|
||||
Index: obuspa-10.0.0.1/src/core/bdc_exec.h
|
||||
Index: 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
|
||||
--- obuspa-10.0.4.0.orig/src/core/bdc_exec.h
|
||||
+++ obuspa-10.0.4.0/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.0.1/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.0.1/src/core/device_bulkdata.c
|
||||
Index: 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
|
||||
--- obuspa-10.0.4.0.orig/src/core/device_bulkdata.c
|
||||
+++ obuspa-10.0.4.0/src/core/device_bulkdata.c
|
||||
@@ -71,8 +71,12 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -95,7 +95,7 @@ Index: obuspa-10.0.0.1/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);
|
||||
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map, combined_role_t *combined_role);
|
||||
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.0.1/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);
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
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);
|
||||
void bulkdata_process_profile_mqtt(bulkdata_profile_t *bp);
|
||||
@@ -299,7 +314,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
@@ -301,7 +316,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.0.1/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);
|
||||
@@ -314,7 +329,7 @@ int DEVICE_BULKDATA_Init(void)
|
||||
@@ -316,7 +331,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.0.1/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);
|
||||
|
||||
@@ -326,9 +341,16 @@ int DEVICE_BULKDATA_Init(void)
|
||||
err |= USP_REGISTER_DBParam_ReadOnlyAuto("Device.BulkData.Profile.{i}.Controller", GetAuto_BulkDataController, DM_STRING);
|
||||
@@ -329,9 +344,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.0.1/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);
|
||||
@@ -614,9 +636,10 @@ int Validate_BulkDataProtocol(dm_req_t *
|
||||
@@ -687,9 +709,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.0.1/src/core/device_bulkdata.c
|
||||
return USP_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@@ -720,9 +743,36 @@ int Validate_BulkDataReference(dm_req_t
|
||||
@@ -793,9 +816,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.0.1/src/core/device_bulkdata.c
|
||||
return USP_ERR_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@@ -2053,6 +2103,14 @@ int bulkdata_platform_get_profile_contro
|
||||
@@ -2151,6 +2201,14 @@ int bulkdata_platform_get_profile_contro
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ Index: obuspa-10.0.0.1/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);
|
||||
@@ -2061,6 +2119,54 @@ int bulkdata_platform_get_profile_contro
|
||||
@@ -2159,6 +2217,54 @@ int bulkdata_platform_get_profile_contro
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
#ifdef ENABLE_MQTT
|
||||
{
|
||||
char protocol[32];
|
||||
@@ -2334,7 +2440,7 @@ void bulkdata_process_profile_http(bulkd
|
||||
@@ -2492,7 +2598,7 @@ void bulkdata_process_profile_http(bulkd
|
||||
{
|
||||
int err;
|
||||
report_t *cur_report;
|
||||
@@ -280,7 +280,7 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
profile_ctrl_params_t ctrl;
|
||||
unsigned char *compressed_report;
|
||||
int compressed_len;
|
||||
@@ -2373,10 +2479,23 @@ void bulkdata_process_profile_http(bulkd
|
||||
@@ -2541,26 +2647,39 @@ void bulkdata_process_profile_http(bulkd
|
||||
}
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -308,7 +308,9 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2385,14 +2504,14 @@ void bulkdata_process_profile_http(bulkd
|
||||
// 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);
|
||||
USP_LOG_Info("BULK DATA: using compression method=%s", ctrl.compression);
|
||||
if (enable_protocol_trace)
|
||||
{
|
||||
@@ -327,7 +329,7 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
}
|
||||
// NOTE: From this point on, only the compressed_report exists
|
||||
|
||||
@@ -2422,8 +2541,15 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2590,8 +2709,15 @@ void bulkdata_process_profile_usp_event(
|
||||
kv_vector_t event_args;
|
||||
kv_pair_t kv;
|
||||
report_t *cur_report;
|
||||
@@ -341,11 +343,11 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
+ char escape_char[10];
|
||||
+ char csv_format[20];
|
||||
+ char row_timestamp[33];
|
||||
|
||||
// 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;
|
||||
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 unable to get ReportTimestamp
|
||||
@@ -415,7 +417,7 @@ Index: obuspa-10.0.0.1/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
|
||||
@@ -2456,11 +2632,17 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2634,11 +2810,17 @@ void bulkdata_process_profile_usp_event(
|
||||
}
|
||||
bp->num_retained_reports = 1;
|
||||
|
||||
@@ -436,7 +438,7 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2468,15 +2650,15 @@ void bulkdata_process_profile_usp_event(
|
||||
@@ -2646,15 +2828,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";
|
||||
@@ -446,7 +448,7 @@ Index: obuspa-10.0.0.1/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);
|
||||
DEVICE_SUBSCRIPTION_ProcessAllEventCompleteSubscriptions(path, &event_args, cont_instance);
|
||||
|
||||
- // 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
|
||||
@@ -455,7 +457,7 @@ Index: obuspa-10.0.0.1/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
|
||||
@@ -2548,11 +2730,24 @@ void bulkdata_process_profile_mqtt(bulkd
|
||||
@@ -2736,15 +2918,28 @@ void bulkdata_process_profile_mqtt(bulkd
|
||||
}
|
||||
|
||||
// Exit if unable to generate the report
|
||||
@@ -485,7 +487,21 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
}
|
||||
|
||||
// Print out the JSON report, if debugging is enabled
|
||||
@@ -2763,7 +2958,7 @@ int bulkdata_reduce_to_alt_name(char *sp
|
||||
- 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
|
||||
** \return pointer to NULL terminated dynamically allocated buffer containing the serialized report to send
|
||||
**
|
||||
**************************************************************************/
|
||||
@@ -494,7 +510,7 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
{
|
||||
JsonNode *top; // top of report
|
||||
JsonNode *array; // array of reports (retained + current)
|
||||
@@ -2868,6 +3063,483 @@ char *bulkdata_generate_json_report(bulk
|
||||
@@ -3056,6 +3251,483 @@ char *bulkdata_generate_json_report(bulk
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -978,7 +994,7 @@ Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** bulkdata_compress_report
|
||||
@@ -3071,6 +3743,20 @@ int bulkdata_schedule_sending_http_repor
|
||||
@@ -3259,6 +3931,20 @@ int bulkdata_schedule_sending_http_repor
|
||||
flags |= BDC_FLAG_DATE_HEADER;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Index: obuspa-10.0.0.1/src/core/expr_vector.c
|
||||
Index: 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
|
||||
--- obuspa-10.0.5.0.orig/src/core/expr_vector.c
|
||||
+++ obuspa-10.0.5.0/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.0.1/src/core/expr_vector.c
|
||||
};
|
||||
|
||||
|
||||
@@ -483,6 +484,15 @@ char *SplitOnOperator(char *buf, expr_op
|
||||
@@ -487,6 +488,15 @@ char *SplitOnOperator(char *buf, expr_op
|
||||
*op = '\0';
|
||||
return &op[2];
|
||||
}
|
||||
@@ -26,10 +26,10 @@ Index: obuspa-10.0.0.1/src/core/expr_vector.c
|
||||
|
||||
// Exit if found the "<" operator
|
||||
op = strchr(buf, '<');
|
||||
Index: obuspa-10.0.0.1/src/core/path_resolver.c
|
||||
Index: 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
|
||||
--- obuspa-10.0.5.0.orig/src/core/path_resolver.c
|
||||
+++ obuspa-10.0.5.0/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.0.1/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 = strchr(unresolved, ']');
|
||||
p = TEXT_UTILS_StrStr(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.0.1/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.0.1/src/include/usp_api.h
|
||||
Index: 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
|
||||
--- obuspa-10.0.5.0.orig/src/include/usp_api.h
|
||||
+++ obuspa-10.0.5.0/src/include/usp_api.h
|
||||
@@ -106,6 +106,7 @@ typedef enum
|
||||
kExprOp_LessThan, // '<'
|
||||
kExprOp_GreaterThan, // '>'
|
||||
|
||||
176
obuspa/patches/1000-SecuredRole-bbfdm.patch
Normal file
176
obuspa/patches/1000-SecuredRole-bbfdm.patch
Normal file
@@ -0,0 +1,176 @@
|
||||
Index: obuspa-10.0.5.0/src/core/device.h
|
||||
===================================================================
|
||||
--- obuspa-10.0.5.0.orig/src/core/device.h
|
||||
+++ obuspa-10.0.5.0/src/core/device.h
|
||||
@@ -311,6 +311,9 @@ int DEVICE_CTRUST_InstSelToRoleInstance(
|
||||
char *DEVICE_CTRUST_InstSelToPermTarget(int role_index, void *is, int *perm_instance);
|
||||
int DEVICE_CTRUST_SetRoleParameter(int instance, char *param_name, char *new_value);
|
||||
int DEVICE_CTRUST_SetPermissionParameter(int instance1, int instance2, char *param_name, char *new_value);
|
||||
+
|
||||
+bool DEVICE_CTRUST_IsControllerSecured(void);
|
||||
+
|
||||
int DEVICE_CTRUST_DumpPermissionSelectors(int role_instance, char *path);
|
||||
int DEVICE_REQUEST_Init(void);
|
||||
int DEVICE_REQUEST_Add(char *path, char *command_key, int *instance);
|
||||
Index: obuspa-10.0.5.0/src/core/device_ctrust.c
|
||||
===================================================================
|
||||
--- obuspa-10.0.5.0.orig/src/core/device_ctrust.c
|
||||
+++ obuspa-10.0.5.0/src/core/device_ctrust.c
|
||||
@@ -246,6 +246,7 @@ credential_t *FindCredentialByCertInstan
|
||||
int Get_CredentialRole(dm_req_t *req, char *buf, int len);
|
||||
int Get_CredentialCertificate(dm_req_t *req, char *buf, int len);
|
||||
int Get_CredentialNumEntries(dm_req_t *req, char *buf, int len);
|
||||
+int Validate_SecuredRoles(dm_req_t *req, char *value);
|
||||
void ApplySearchExpressionPermissions(char *path, inst_sel_t *sel);
|
||||
bool ValidateDataModelPathSegment(char *segment, bool is_last, char *path);
|
||||
|
||||
@@ -293,6 +294,9 @@ int DEVICE_CTRUST_Init(void)
|
||||
// Create a timer which will be used to apply all modified permissions to the data model, after processing a USP Message
|
||||
SYNC_TIMER_Add(ApplyModifiedPermissions, 0, END_OF_TIME);
|
||||
|
||||
+ // Register Device.LocalAgent.ControllerTrust.SecuredRoles parameter
|
||||
+ err |= USP_REGISTER_DBParam_ReadWrite(DEVICE_CTRUST_ROOT ".SecuredRoles", "", Validate_SecuredRoles, NULL, DM_STRING);
|
||||
+
|
||||
// Register parameters implemented by this component
|
||||
// Device.LocalAgent.ControllerTrust.Role.{i}
|
||||
err |= USP_REGISTER_Object(DEVICE_ROLE_ROOT, ValidateAdd_CTrustRole, NULL, Notify_CTrustRoleAdded,
|
||||
@@ -3533,3 +3537,139 @@ exit:
|
||||
return err;
|
||||
}
|
||||
#endif // REMOVE_DEVICE_SECURITY
|
||||
+
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** Validate_SecuredRoles
|
||||
+**
|
||||
+** Validates Device.LocalAgent.ControllerTrust.SecuredRoles
|
||||
+** Each list item MUST be the Path Name of a row in the Device.LocalAgent.ControllerTrust.Role table
|
||||
+**
|
||||
+** \param req - pointer to structure identifying the parameter
|
||||
+** \param value - value that the controller would like to set the parameter to
|
||||
+**
|
||||
+** \return USP_ERR_OK if successful
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+int Validate_SecuredRoles(dm_req_t *req, char *value)
|
||||
+{
|
||||
+ char *role_path;
|
||||
+ char *saveptr;
|
||||
+ char *str;
|
||||
+ char temp[MAX_DM_PATH];
|
||||
+ int role_instance;
|
||||
+ int err;
|
||||
+
|
||||
+ // Empty string is valid
|
||||
+ if (*value == '\0')
|
||||
+ {
|
||||
+ return USP_ERR_OK;
|
||||
+ }
|
||||
+
|
||||
+ // Copy the value as strtok_r modifies the string
|
||||
+ USP_STRNCPY(temp, value, sizeof(temp));
|
||||
+
|
||||
+ // Iterate through comma-separated list
|
||||
+ str = temp;
|
||||
+ role_path = strtok_r(str, ",", &saveptr);
|
||||
+ while (role_path != NULL)
|
||||
+ {
|
||||
+ // Trim whitespace
|
||||
+ role_path = TEXT_UTILS_TrimBuffer(role_path);
|
||||
+
|
||||
+ // Verify that this path exists in the Role table using DM_ACCESS_ValidateReference
|
||||
+ err = DM_ACCESS_ValidateReference(role_path, "Device.LocalAgent.ControllerTrust.Role.{i}", &role_instance);
|
||||
+ if (err != USP_ERR_OK)
|
||||
+ {
|
||||
+ USP_ERR_SetMessage("%s: Role path '%s' does not exist in Device.LocalAgent.ControllerTrust.Role table", __FUNCTION__, role_path);
|
||||
+ return USP_ERR_INVALID_VALUE;
|
||||
+ }
|
||||
+
|
||||
+ role_path = strtok_r(NULL, ",", &saveptr);
|
||||
+ }
|
||||
+
|
||||
+ return USP_ERR_OK;
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** DEVICE_CTRUST_IsControllerSecured
|
||||
+**
|
||||
+** Determines whether the specified controller has a secured role
|
||||
+**
|
||||
+** \param combined_role - pointer to structure containing the role indexes for this controller
|
||||
+**
|
||||
+** \return true if the controller has a secured role, false otherwise
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+bool DEVICE_CTRUST_IsControllerSecured()
|
||||
+{
|
||||
+ char secured_roles[MAX_DM_PATH];
|
||||
+ char *role_path;
|
||||
+ char *saveptr;
|
||||
+ char *str;
|
||||
+ char temp[MAX_DM_PATH];
|
||||
+ int err;
|
||||
+ role_t *role;
|
||||
+ int role_instance;
|
||||
+ combined_role_t combined_role;
|
||||
+ controller_info_t ci;
|
||||
+
|
||||
+ // Exit if unable to get the secured roles
|
||||
+ err = DATA_MODEL_GetParameterValue("Device.LocalAgent.ControllerTrust.SecuredRoles", secured_roles, sizeof(secured_roles), 0);
|
||||
+ if (err != USP_ERR_OK)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // Empty string means no secured roles
|
||||
+ if (*secured_roles == '\0')
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ MSG_HANDLER_GetControllerInfo(&ci);
|
||||
+ if (ci.endpoint_id == NULL)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if(strlen(ci.endpoint_id) == 0)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ MSG_HANDLER_GetMsgRole(&combined_role);
|
||||
+ // Copy the value as strtok_r modifies the string
|
||||
+ USP_STRNCPY(temp, secured_roles, sizeof(temp));
|
||||
+
|
||||
+ // Iterate through comma-separated list
|
||||
+ str = temp;
|
||||
+ role_path = strtok_r(str, ",", &saveptr);
|
||||
+ while (role_path != NULL)
|
||||
+ {
|
||||
+ // Trim whitespace
|
||||
+ role_path = TEXT_UTILS_TrimBuffer(role_path);
|
||||
+
|
||||
+ // Extract the instance number from the role path
|
||||
+ err = DM_ACCESS_ValidateReference(role_path, "Device.LocalAgent.ControllerTrust.Role.{i}", &role_instance);
|
||||
+ if (err == USP_ERR_OK)
|
||||
+ {
|
||||
+ // Find the role in our internal array
|
||||
+ role = FindRoleByInstance(role_instance);
|
||||
+ if (role != NULL)
|
||||
+ {
|
||||
+ // Check if this role matches either the inherited or assigned role
|
||||
+ if ((role - roles == combined_role.inherited_index) ||
|
||||
+ (role - roles == combined_role.assigned_index))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ role_path = strtok_r(NULL, ",", &saveptr);
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.0.2/src/core/cli_server.c
|
||||
Index: obuspa-10.0.7.0/src/core/cli_server.c
|
||||
===================================================================
|
||||
--- 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)
|
||||
--- 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)
|
||||
USP_ASSERT(gge->value != NULL);
|
||||
SendCliResponse("%s => %s\n", gge->path, gge->value);
|
||||
}
|
||||
@@ -13,11 +13,11 @@ Index: obuspa-10.0.0.2/src/core/cli_server.c
|
||||
}
|
||||
|
||||
GROUP_GET_VECTOR_Destroy(&ggv);
|
||||
Index: obuspa-10.0.0.2/src/core/data_model.c
|
||||
Index: obuspa-10.0.7.0/src/core/data_model.c
|
||||
===================================================================
|
||||
--- 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
|
||||
--- 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
|
||||
// Exit if instance already exists - nothing to do
|
||||
if (exists)
|
||||
{
|
||||
@@ -26,7 +26,7 @@ Index: obuspa-10.0.0.2/src/core/data_model.c
|
||||
return USP_ERR_CREATION_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1409,7 +1409,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
@@ -1486,7 +1486,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.0.2/src/core/data_model.c
|
||||
return USP_ERR_OBJECT_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
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)
|
||||
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
|
||||
SendCliResponse("WARNING: Discarding unused args: %s\n", args.vector[cli_cmd->max_args+1]);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ index da61c6f..abac7cb 100644
|
||||
// Process command
|
||||
err = cli_cmd->exec_cmd(&args);
|
||||
print_help = false;
|
||||
@@ -670,6 +671,11 @@ int ExecuteCli_Version(str_vector_t *args)
|
||||
@@ -672,6 +673,11 @@ int ExecuteCli_Version(str_vector_t *arg
|
||||
int ExecuteCli_Get(str_vector_t *args)
|
||||
{
|
||||
combined_role_t *combined_role;
|
||||
@@ -28,22 +28,22 @@ index da61c6f..abac7cb 100644
|
||||
#ifndef REMOVE_USP_BROKER
|
||||
char *arg1;
|
||||
|
||||
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);
|
||||
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
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -51,11 +51,11 @@ index d9d3e9e..c263978 100644
|
||||
// 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;
|
||||
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)
|
||||
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
|
||||
MSG_HANDLER_UspMsgTypeToString(usp->header->msg_type),
|
||||
iso8601_cur_time(buf, sizeof(buf)) );
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.0.1/src/core/device_bulkdata.c
|
||||
Index: 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
|
||||
@@ -375,6 +375,8 @@ int DEVICE_BULKDATA_Init(void)
|
||||
--- 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)
|
||||
// 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.0.2/src/core/data_model.c
|
||||
Index: obuspa-10.0.7.0/src/core/data_model.c
|
||||
===================================================================
|
||||
--- 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)
|
||||
--- 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)
|
||||
int err = USP_ERR_OK;
|
||||
|
||||
// Register 'Full Access' role
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.0.2/src/core/device.h
|
||||
Index: obuspa-10.0.6.0/src/core/device.h
|
||||
===================================================================
|
||||
--- 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(
|
||||
--- 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(
|
||||
int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void);
|
||||
#endif
|
||||
|
||||
@@ -13,11 +13,11 @@ Index: obuspa-10.0.0.2/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.0.2/src/core/device_controller.c
|
||||
Index: obuspa-10.0.6.0/src/core/device_controller.c
|
||||
===================================================================
|
||||
--- 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
|
||||
--- 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
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -96,11 +96,11 @@ Index: obuspa-10.0.0.2/src/core/device_controller.c
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DEVICE_CONTROLLER_IsMTPConfigured
|
||||
Index: obuspa-10.0.0.2/src/core/msg_handler.c
|
||||
Index: obuspa-10.0.6.0/src/core/msg_handler.c
|
||||
===================================================================
|
||||
--- 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
|
||||
--- 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
|
||||
usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
Index: obuspa-10.0.0.1/src/core/mqtt.c
|
||||
Index: obuspa-10.0.6.0/src/core/mqtt.c
|
||||
===================================================================
|
||||
--- 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
|
||||
--- 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
|
||||
#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.0.1/src/core/mqtt.c
|
||||
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
|
||||
}
|
||||
|
||||
@@ -269,6 +271,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
@@ -275,6 +277,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
|
||||
@@ -23,7 +23,7 @@ Index: obuspa-10.0.0.1/src/core/mqtt.c
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -279,10 +286,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
@@ -285,10 +292,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
MQTT_TrustCertVerifyCallbackIndex(2),
|
||||
MQTT_TrustCertVerifyCallbackIndex(3),
|
||||
MQTT_TrustCertVerifyCallbackIndex(4),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
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
|
||||
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
|
||||
@@ -53,6 +53,7 @@
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/err.h>
|
||||
@@ -10,7 +10,7 @@ index 70978501b1..96119fe080 100644
|
||||
#include <mosquitto.h>
|
||||
|
||||
#include "mqtt.h"
|
||||
@@ -201,8 +202,9 @@ int EnableMosquitto(mqtt_client_t *client);
|
||||
@@ -206,8 +207,9 @@ int EnableMosquitto(mqtt_client_t *clien
|
||||
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 70978501b1..96119fe080 100644
|
||||
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);
|
||||
@@ -245,7 +247,7 @@ void HandleMqttReconnect(mqtt_client_t *client);
|
||||
@@ -250,7 +252,7 @@ void HandleMqttReconnect(mqtt_client_t *
|
||||
void HandleMqttReconnectAfterDisconnect(mqtt_client_t *client);
|
||||
void HandleMqttDisconnect(mqtt_client_t *client);
|
||||
void DisconnectIfAllSubscriptionsFailed(mqtt_client_t *client);
|
||||
@@ -30,7 +30,7 @@ index 70978501b1..96119fe080 100644
|
||||
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);
|
||||
@@ -2350,6 +2352,143 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
@@ -2380,6 +2382,143 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ index 70978501b1..96119fe080 100644
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** IsMqttBrokerUp
|
||||
@@ -2364,109 +2503,92 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
@@ -2394,109 +2533,92 @@ int SendQueueHead(mqtt_client_t *client)
|
||||
** \return true if the MQTT Broker is up, false otherwise
|
||||
**
|
||||
**************************************************************************/
|
||||
@@ -343,7 +343,7 @@ index 70978501b1..96119fe080 100644
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -2487,18 +2609,20 @@ void Connect(mqtt_client_t *client)
|
||||
@@ -2517,18 +2639,20 @@ void Connect(mqtt_client_t *client)
|
||||
{
|
||||
int err = USP_ERR_OK;
|
||||
bool is_up;
|
||||
@@ -367,7 +367,7 @@ index 70978501b1..96119fe080 100644
|
||||
|
||||
// Exit if failed to connect
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -2531,7 +2655,7 @@ exit:
|
||||
@@ -2561,7 +2685,7 @@ exit:
|
||||
** \return USP_ERR_INTERNAL_ERROR if failed to connect (and should retry)
|
||||
**
|
||||
**************************************************************************/
|
||||
@@ -376,7 +376,7 @@ index 70978501b1..96119fe080 100644
|
||||
{
|
||||
int version;
|
||||
mosquitto_property *proplist = NULL;
|
||||
@@ -2601,19 +2725,19 @@ int PerformMqttClientConnect(mqtt_client_t *client)
|
||||
@@ -2631,19 +2755,19 @@ int PerformMqttClientConnect(mqtt_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,15 +97,13 @@ packet_capture_launch() {
|
||||
fi
|
||||
|
||||
if [ -n "${interface}" ]; then
|
||||
intf=$(ifstatus "${interface}" | jq ".l3_device")
|
||||
intf=$(ifstatus "${interface}" | jsonfilter -e '$.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}"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=parental-control
|
||||
PKG_VERSION:=1.4.6
|
||||
PKG_VERSION:=1.4.3
|
||||
|
||||
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:=2cada36853091856e3efc2fc630f7cf06aa9c352
|
||||
PKG_SOURCE_VERSION:=f7ec652c763bf6ffd550bf7d51b2c125774b79af
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,7 +27,7 @@ define Package/parental-control
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=URL filter
|
||||
DEPENDS:=+libuci +libnetfilter-queue +libnfnetlink +iptables-mod-nfqueue +libpthread
|
||||
DEPENDS+=+libubox +ubus +conntrack +libcurl +cmph +libjson-c
|
||||
DEPENDS+=+libubox +ubus +conntrack +libcurl +cmph
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
@@ -83,14 +83,18 @@ define Package/parental-control/install
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/95-firewall_parentalcontrol.ucidefaults $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/35-migrate_urlfilter.ucidefaults $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/parentalcontrol $(1)/lib/upgrade/keep.d/parentalcontrol
|
||||
|
||||
$(BBFDM_REGISTER_SERVICES) -v ${VENDOR_PREFIX} ./bbfdm_service.json $(1) parentalcontrol
|
||||
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/40-parental_control_update_bundle_path $(1)/etc/uci-defaults/
|
||||
ifeq ($(CONFIG_PARENTAL_CONTROL_URLFILTERING),y)
|
||||
$(INSTALL_DATA) ./files/etc/parentalcontrol/url_bundles.json $(1)/etc/parentalcontrol/
|
||||
$(INSTALL_DATA) ./files/etc/parentalcontrol/urlbundle_override.json $(1)/etc/parentalcontrol/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/50-parental_control_add_bundles $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/urlbundle_override.json $(1)/etc/parentalcontrol/
|
||||
else
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) -v ${VENDOR_PREFIX} ./files/urlbundle_override.json $(1) parentalcontrol
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/50-parental_control_disable_urlfilter $(1)/etc/uci-defaults/
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
config globals 'globals'
|
||||
option enable '1'
|
||||
option loglevel '3'
|
||||
option urlfilter '0'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
{
|
||||
"urlBundles": [
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/abuse-nl.txt",
|
||||
"name": "Abuse"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/ads-nl.txt",
|
||||
"name": "Ads"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/crypto-nl.txt",
|
||||
"name": "Crypto"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/drugs-nl.txt",
|
||||
"name": "Drugs"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/everything-nl.txt",
|
||||
"name": "Everything else"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/facebook-nl.txt",
|
||||
"name": "Facebook/Instagram"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/fraud-nl.txt",
|
||||
"name": "Fraud"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/gambling-nl.txt",
|
||||
"name": "Gambling"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/malware-nl.txt",
|
||||
"name": "Malware"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/phishing-nl.txt",
|
||||
"name": "Phishing"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/piracy-nl.txt",
|
||||
"name": "Piracy"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/porn-nl.txt",
|
||||
"name": "Porn"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt",
|
||||
"name": "Ransomware"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/redirect-nl.txt",
|
||||
"name": "Redirect"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/scam-nl.txt",
|
||||
"name": "Scam"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/tiktok-nl.txt",
|
||||
"name": "TikTok"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/torrent-nl.txt",
|
||||
"name": "Torrent"
|
||||
},
|
||||
{
|
||||
"url": "https://blocklistproject.github.io/Lists/alt-version/tracking-nl.txt",
|
||||
"name": "Tracking"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -25,6 +25,14 @@ check_mounted_app_partition() {
|
||||
|
||||
if check_mounted_app_partition; then
|
||||
uci -q set parentalcontrol.globals.bundle_path="${APPS_DIR}/parentalcontrol"
|
||||
|
||||
# configure the urlfilter if not configured
|
||||
urlfilter="$(uci -q get parentalcontrol.globals.urlfilter)"
|
||||
if [ -z "${urlfilter}" ]; then
|
||||
uci -q set parentalcontrol.globals.urlfilter='1'
|
||||
fi
|
||||
else
|
||||
uci -q set parentalcontrol.globals.urlfilter='0'
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ ! -f "/etc/config/parentalcontrol" ] && exit 0
|
||||
|
||||
COUNT=1
|
||||
|
||||
add_urlbundle()
|
||||
{
|
||||
local name url
|
||||
|
||||
url="${1}"; shift
|
||||
name="$*"
|
||||
|
||||
uci -q set parentalcontrol.urlbundle_${COUNT}=urlbundle
|
||||
uci -q set parentalcontrol.urlbundle_${COUNT}.name="${name}"
|
||||
uci -q set parentalcontrol.urlbundle_${COUNT}.download_url="${url}"
|
||||
|
||||
COUNT="$((COUNT+1))"
|
||||
}
|
||||
|
||||
urlfilter="$(uci -q get parentalcontrol.globals.urlfilter)"
|
||||
if [ "${urlfilter}" -eq "1" ]; then
|
||||
add_urlbundle "https://blocklistproject.github.io/Lists/alt-version/abuse-nl.txt" "Abuse"
|
||||
add_urlbundle "https://blocklistproject.github.io/Lists/alt-version/ads-nl.txt" "Ads"
|
||||
add_urlbundle "https://blocklistproject.github.io/Lists/alt-version/crypto-nl.txt" "Crypto"
|
||||
add_urlbundle "https://blocklistproject.github.io/Lists/alt-version/drugs-nl.txt" "Drugs"
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/everything-nl.txt' "Everything else"
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/facebook-nl.txt' 'Facebook/Instagram'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/fraud-nl.txt' 'Fraud'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/gambling-nl.txt' 'Gambling'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/malware-nl.txt' 'Malware'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/phishing-nl.txt' 'Phishing'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/piracy-nl.txt' 'Piracy'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/porn-nl.txt' 'Porn'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/ransomware-nl.txt' 'Ransomware'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/redirect-nl.txt' 'Redirect'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/scam-nl.txt' 'Scam'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/tiktok-nl.txt' 'TikTok'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/torrent-nl.txt' 'Torrent'
|
||||
add_urlbundle 'https://blocklistproject.github.io/Lists/alt-version/tracking-nl.txt' 'Tracking'
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
[ ! -f "/etc/config/parentalcontrol" ] && exit 0
|
||||
|
||||
uci -q set parentalcontrol.globals.urlfilter='0'
|
||||
|
||||
_delete_urlbundle() {
|
||||
uci_remove parentalcontrol "${1}"
|
||||
}
|
||||
|
||||
config_load "parentalcontrol"
|
||||
config_foreach _delete_urlbundle urlbundle
|
||||
@@ -311,6 +311,31 @@ handle_schedule() {
|
||||
generate_ip_rule "$utc_start_relative_day" "$utc_end_relative_day" "$utc_start_time" "$utc_stop_time" "$target"
|
||||
}
|
||||
|
||||
# Function that parses input for MAC addresses or hostnames
|
||||
parse_macs_or_hostnames() {
|
||||
local input="$1"
|
||||
local lease_file="/tmp/dhcp.leases"
|
||||
|
||||
[ -f "$lease_file" ] || lease_file="/etc/parentalcontrol/dhcp.leases"
|
||||
[ -f "$lease_file" ] || { log "Error: No DHCP lease file found."; return 1; }
|
||||
|
||||
for item in $input; do
|
||||
case "$item" in
|
||||
??:??:??:??:??:??)
|
||||
# It's a MAC address, print it as is
|
||||
echo "$item"
|
||||
;;
|
||||
*)
|
||||
# Assume it's a hostname and search for its MAC address in the leases file
|
||||
mac=$(awk -v hostname="$item" '$4 == hostname {print $2}' "$lease_file")
|
||||
if [ -n "$mac" ]; then
|
||||
echo "$mac"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
handle_bedtime() {
|
||||
local mac_addresses="$1"
|
||||
local mac
|
||||
@@ -345,61 +370,38 @@ handle_internet_break() {
|
||||
done
|
||||
}
|
||||
|
||||
parse_macs() {
|
||||
local maclist="$1"
|
||||
local m mac
|
||||
|
||||
for m in $maclist; do
|
||||
# trim whitespace
|
||||
mac="$(echo "$m" | tr -d ' \t\r\n')"
|
||||
|
||||
# validate format
|
||||
if echo "$mac" | grep -qE '^[0-9A-Fa-f]{2}(:[0-9A-Fa-f]{2}){5}$'; then
|
||||
echo "$mac"
|
||||
else
|
||||
log "parse_macs(): Invalid MAC in mac list: '$mac'"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
handle_profile() {
|
||||
local profile_section="$1"
|
||||
local internet_break_enable bedtime_enable hostlist maclist
|
||||
local internet_break_enable bedtime_enable hostlist
|
||||
|
||||
config_get_bool internet_break_enable "$profile_section" "internet_break_enable" 0
|
||||
config_get_bool bedtime_enable "$profile_section" "bedtime_enable" 0
|
||||
config_get hostlist "$profile_section" "host"
|
||||
|
||||
if [ $internet_break_enable -eq 0 ] && [ $bedtime_enable -eq 0 ]; then
|
||||
if [ -z "$hostlist" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
config_get hostlist "$profile_section" "host"
|
||||
config_get maclist "$profile_section" "mac"
|
||||
ACCESS_RULE=""
|
||||
|
||||
# If both lists are empty, nothing to do
|
||||
if [ -z "$hostlist" ] && [ -z "$maclist" ]; then
|
||||
return
|
||||
fi
|
||||
# convert hostnames to mac addresses if needed
|
||||
# and replace newlines with space because it messes up the for loops in
|
||||
# handle_internet_break and handle_bedtime functions
|
||||
local mac_addresses="$(parse_macs_or_hostnames "${hostlist}" | tr '\n' ' ')"
|
||||
|
||||
ACCESS_RULE=""
|
||||
# default value of Hosts.AccessControl.{i}.Enable is false,
|
||||
# so, if not defined in uci as 1, assume 0
|
||||
config_get_bool internet_break_enable "$profile_section" "internet_break_enable" 0
|
||||
if [ $internet_break_enable -gt 0 ]; then
|
||||
handle_internet_break "${mac_addresses}"
|
||||
# handle_internet_break may have loaded schedules uci
|
||||
# so, reload parentalcontrol
|
||||
config_load "parentalcontrol"
|
||||
fi
|
||||
|
||||
# both uci options contain mac addresses
|
||||
# one is given directly by the user
|
||||
# other is resolved by the data model from Hosts.Host object
|
||||
local mac_addresses="$(parse_macs "${hostlist} ${maclist}" | awk '{ if (NF && !seen[$0]++) { print $0 } }' | tr '\n' ' ')"
|
||||
config_get_bool bedtime_enable "$profile_section" "bedtime_enable" 0
|
||||
if [ $bedtime_enable -gt 0 ]; then
|
||||
handle_bedtime "${mac_addresses}"
|
||||
fi
|
||||
|
||||
# default value of Hosts.AccessControl.{i}.Enable is false,
|
||||
# so, if not defined in uci as 1, assume 0
|
||||
if [ $internet_break_enable -gt 0 ]; then
|
||||
handle_internet_break "${mac_addresses}"
|
||||
# handle_internet_break may have loaded schedules uci
|
||||
# so, reload parentalcontrol
|
||||
config_load "parentalcontrol"
|
||||
fi
|
||||
|
||||
if [ $bedtime_enable -gt 0 ]; then
|
||||
handle_bedtime "${mac_addresses}"
|
||||
fi
|
||||
}
|
||||
|
||||
add_internet_schedule_rules() {
|
||||
@@ -565,44 +567,38 @@ remove_internet_schedule_rules() {
|
||||
fi
|
||||
}
|
||||
|
||||
get_host_ip_from_mac() {
|
||||
local mac="$1"
|
||||
local ip=""
|
||||
|
||||
# Validate MAC format
|
||||
if ! echo "$mac" | grep -qE '^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$'; then
|
||||
log "get_host_ip_from_mac(): Invalid MAC address format '$mac'"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Try to find IP from ARP table
|
||||
ip="$(cat /proc/net/arp | awk -v mac="$mac" 'tolower($4) == tolower(mac) {print $1; exit}')"
|
||||
|
||||
if [ -n "$ip" ]; then
|
||||
URLFILTER_IPS="${URLFILTER_IPS} ${ip}"
|
||||
return 0
|
||||
else
|
||||
log "get_host_ip_from_mac(): No IP found for MAC $mac in ARP table"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Global array for resolved IPs
|
||||
URLFILTER_IPS=""
|
||||
|
||||
# Resolve hostname or MAC to IP from lease_file
|
||||
get_host_ip() {
|
||||
local host="$1"
|
||||
local ip
|
||||
local lease_file="/tmp/dhcp.leases"
|
||||
|
||||
[ -f "$lease_file" ] || lease_file="/etc/parentalcontrol/dhcp.leases"
|
||||
[ -f "$lease_file" ] || { log "Error: get_host_ip(): No DHCP lease file found."; return 1; }
|
||||
|
||||
# try DHCP lease lookup
|
||||
ip="$(awk -v h="$host" '
|
||||
{
|
||||
mac=$2; ipaddr=$3; name=$4
|
||||
if (h == name || h == mac) { print ipaddr; exit }
|
||||
}' "$lease_file")"
|
||||
|
||||
[ -n "$ip" ] && URLFILTER_IPS="$URLFILTER_IPS $ip"
|
||||
}
|
||||
|
||||
# Process each profile section
|
||||
resolve_profile_hosts() {
|
||||
local section="$1"
|
||||
local hostlist maclist h m
|
||||
local hostlist
|
||||
|
||||
config_get hostlist "$section" host
|
||||
config_get maclist "$section" mac
|
||||
[ -z "$hostlist" ] && return
|
||||
|
||||
for h in $hostlist; do
|
||||
get_host_ip_from_mac "$h"
|
||||
done
|
||||
|
||||
for m in $maclist; do
|
||||
get_host_ip_from_mac "$m"
|
||||
get_host_ip "$h"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
LOCKFILE="/tmp/sync_bundles.lock"
|
||||
log_level="$(uci -q get parentalcontrol.globals.loglevel)"
|
||||
log_level="${log_level:-1}"
|
||||
URLBUNDLE_JSON="/etc/parentalcontrol/url_bundles.json"
|
||||
DEBUG=0
|
||||
|
||||
log_err() {
|
||||
@@ -87,7 +85,6 @@ update_bundle_file_from_url() {
|
||||
local success=0
|
||||
while [ $attempt -le 3 ]; do
|
||||
if curl -s -o "$temp_file" "$download_url"; then
|
||||
log_info "Download successful for $download_url"
|
||||
success=1
|
||||
break
|
||||
else
|
||||
@@ -221,33 +218,24 @@ cleanup_bundle_files() {
|
||||
# Collect all download_url entries using config_foreach
|
||||
local urls=""
|
||||
get_download_url() {
|
||||
local enable url
|
||||
|
||||
json_select "${2}"
|
||||
|
||||
json_get_var url url
|
||||
json_get_var enable enable
|
||||
enable="${enable:-1}"
|
||||
local section="$1"
|
||||
config_get url "$section" download_url
|
||||
config_get_bool enable "$1" enable 1
|
||||
|
||||
if [ "${enable}" -eq 0 ]; then
|
||||
log_info "get_download_url: Skipping bundle ${name} not enabled"
|
||||
json_select ..
|
||||
# bundle is disabled
|
||||
return 0
|
||||
fi
|
||||
|
||||
url="${url#file://}"
|
||||
url="${url#https://}"
|
||||
url="${url#http://}"
|
||||
|
||||
url="${url##*/}" # Get everything after the last '/'
|
||||
urls="$urls $url"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
json_init
|
||||
json_load_file "${URLBUNDLE_JSON}"
|
||||
|
||||
json_for_each_item get_download_url "urlBundles"
|
||||
config_load parentalcontrol
|
||||
config_foreach get_download_url urlbundle
|
||||
|
||||
# Loop through all files in the directory
|
||||
for file in "$dir"/*; do
|
||||
@@ -306,29 +294,30 @@ handle_filter_for_bundles() {
|
||||
fi
|
||||
|
||||
check_bundle_exists() {
|
||||
local enable url name
|
||||
local enable download_url name cfg
|
||||
|
||||
json_select "${2}"
|
||||
|
||||
json_get_var name name
|
||||
json_get_var url url
|
||||
json_get_var enable enable
|
||||
enable="${enable:-1}"
|
||||
cfg="$1"
|
||||
config_get name "$cfg" name
|
||||
config_get_bool enable "$cfg" enable 1
|
||||
config_get download_url "$cfg" download_url
|
||||
|
||||
if [ "${enable}" -eq 0 ]; then
|
||||
log_info "check_bundle_exists: Skipping bundle ${name} not enabled"
|
||||
json_select ..
|
||||
log_info "Skipping bundle ${name} not enabled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
handle_download_url "${url}" "${name}"
|
||||
json_select ..
|
||||
handle_download_url "$download_url" "$name"
|
||||
local exit_status=$?
|
||||
if [ "$exit_status" -eq 1 ]; then
|
||||
uci -q set "parentalcontrol.${cfg}.status"="Error"
|
||||
else
|
||||
uci -q set "parentalcontrol.${cfg}.status"=""
|
||||
fi
|
||||
|
||||
uci commit parentalcontrol
|
||||
}
|
||||
|
||||
json_init
|
||||
json_load_file "${URLBUNDLE_JSON}"
|
||||
|
||||
json_for_each_item check_bundle_exists "urlBundles"
|
||||
config_foreach check_bundle_exists urlbundle
|
||||
}
|
||||
|
||||
# Open file descriptor 200 for locking
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/etc/parentalcontrol/dhcp.leases
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.5.18
|
||||
PKG_VERSION:=1.6.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=2772d77bd477adfdf513499fda11397107996d21
|
||||
PKG_SOURCE_VERSION:=351db77e982b1f4887e5878345fe98be72d262fb
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
#
|
||||
# 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))
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user