mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
214 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
adfda085d7 | ||
|
|
9034a41e93 | ||
|
|
8011700c3a | ||
|
|
a4b6d1c15d | ||
|
|
885ace494e | ||
|
|
139382c930 | ||
|
|
f77697fa15 | ||
|
|
0d230c1d96 | ||
|
|
ed4fdc13c9 | ||
|
|
a729eb4e75 | ||
|
|
f4efc133f9 | ||
|
|
c2aa56adff | ||
|
|
1530b0b9e4 | ||
|
|
c0c8f92d6b | ||
|
|
da99f3b66c | ||
|
|
4ec0b703f4 | ||
|
|
81f48dc776 | ||
|
|
0927fbaf35 | ||
|
|
a61770b99d | ||
|
|
2668e9d634 | ||
|
|
a9e482d9af | ||
|
|
71cdb3e11c | ||
|
|
ecd30ae17d | ||
|
|
a28ff87eca | ||
|
|
117bca46df | ||
|
|
2657260054 | ||
|
|
69c4c6cb31 | ||
|
|
2df5b55ed7 | ||
|
|
ecacb13edf | ||
|
|
3bf7d2557c | ||
|
|
df8d9ff1ef | ||
|
|
10564d779c | ||
|
|
b64f41dc6b | ||
|
|
cddf178691 | ||
|
|
67083c4ab4 | ||
|
|
063a97a7d0 | ||
|
|
3920ab6523 | ||
|
|
406c8ef73c | ||
|
|
8651b12aa6 | ||
|
|
3bc76dc1bb | ||
|
|
71d96711bd | ||
|
|
96966f447c | ||
|
|
4efe0b0e53 | ||
|
|
6f48560b97 | ||
|
|
bdb3d1847e | ||
|
|
f2cb3f4442 | ||
|
|
3df0e75b3f | ||
|
|
0afc1b9dd5 | ||
|
|
8e1a3b1184 | ||
|
|
854c2aa507 | ||
|
|
30282db3d5 | ||
|
|
6c9f034d29 | ||
|
|
d19c85ebde | ||
|
|
dfa0414918 | ||
|
|
30a4b1b745 | ||
|
|
ebbe691ecc | ||
|
|
ec9495cd41 | ||
|
|
c736b6244a | ||
|
|
ec4bd3cd91 | ||
|
|
d685b60f45 | ||
|
|
01f98c52c9 | ||
|
|
89af5bba92 | ||
|
|
f3edc9b7eb | ||
|
|
8ec904fac2 | ||
|
|
1d10770ed5 | ||
|
|
01f738b2b3 | ||
|
|
dc0b80097b | ||
|
|
ee283c2e1b | ||
|
|
d1f4dfbb71 | ||
|
|
28603606d6 | ||
|
|
0e06579c71 | ||
|
|
89afb954da | ||
|
|
01899c924a | ||
|
|
41453f0f97 | ||
|
|
dd12c2574f | ||
|
|
f7087bb8c7 | ||
|
|
16ce80d9ee | ||
|
|
02f85d54d0 | ||
|
|
c80da485c9 | ||
|
|
38e95765a3 | ||
|
|
1141ca1ef9 | ||
|
|
f0b1a32208 | ||
|
|
28dda87cfb | ||
|
|
f5be820ad5 | ||
|
|
8820cbe1b1 | ||
|
|
11293bb304 | ||
|
|
5dcf58e7dd | ||
|
|
91d345c7fb | ||
|
|
dc4c8bafc2 | ||
|
|
98287d382b | ||
|
|
fbaa28712d | ||
|
|
84a5b3f99f | ||
|
|
4ebffa9cfb | ||
|
|
ed33a61be7 | ||
|
|
99eb4bf546 | ||
|
|
0745796112 | ||
|
|
ebcf8b4b61 | ||
|
|
01f11f1ad0 | ||
|
|
df1537cd0c | ||
|
|
b370f1c242 | ||
|
|
c71de4a811 | ||
|
|
30e8ff5884 | ||
|
|
454eba7e5e | ||
|
|
8305d28285 | ||
|
|
cf4731761d | ||
|
|
bd81dfd51b | ||
|
|
e5a41d343b | ||
|
|
97c7eacf69 | ||
|
|
d1ceed52f2 | ||
|
|
6aef44ea9b | ||
|
|
fbf0aa29a3 | ||
|
|
8a9c147952 | ||
|
|
ac30cad2ed | ||
|
|
1ae87be0ac | ||
|
|
b93ebe260b | ||
|
|
7160fadf56 | ||
|
|
f06a0e93b7 | ||
|
|
7a54b81daf | ||
|
|
bd50a960ec | ||
|
|
64d3e07dd2 | ||
|
|
9401cea337 | ||
|
|
99c15dfe30 | ||
|
|
ce43197f45 | ||
|
|
047e533140 | ||
|
|
8c70ba4f00 | ||
|
|
a3760e2082 | ||
|
|
00f9133ae3 | ||
|
|
184dcd5b97 | ||
|
|
66163d3945 | ||
|
|
8bdfd3ea51 | ||
|
|
0689c0f91a | ||
|
|
7baea620ec | ||
|
|
a14dbdfb9c | ||
|
|
7c706a045b | ||
|
|
c346df2802 | ||
|
|
27ccd1582d | ||
|
|
7c3d1f919c | ||
|
|
3f398d1016 | ||
|
|
c6b9c83194 | ||
|
|
16843b0260 | ||
|
|
61cba7f7f7 | ||
|
|
2fb2b24201 | ||
|
|
9c838d993c | ||
|
|
0e1451bcd2 | ||
|
|
0c3299f631 | ||
|
|
c07da46687 | ||
|
|
f81fc0b77b | ||
|
|
ee67f14abd | ||
|
|
e5c76f17f6 | ||
|
|
546b14bed3 | ||
|
|
c4523c6040 | ||
|
|
072d786a14 | ||
|
|
2703fead62 | ||
|
|
c3922b7f3b | ||
|
|
ac1abfa6c3 | ||
|
|
40b8dd2869 | ||
|
|
578a4815ff | ||
|
|
68db860632 | ||
|
|
a804d28cef | ||
|
|
81a0b6345e | ||
|
|
3568f7c38d | ||
|
|
7ba3ca8af4 | ||
|
|
17b4588e03 | ||
|
|
0c7040bab0 | ||
|
|
cab73a2760 | ||
|
|
0b7165a05e | ||
|
|
792981e80f | ||
|
|
d9faf65cb5 | ||
|
|
11b83611ba | ||
|
|
3a2674270b | ||
|
|
a3d9850ae4 | ||
|
|
edb39ef5d8 | ||
|
|
e63d02dbb8 | ||
|
|
81104955be | ||
|
|
8f30e41569 | ||
|
|
1d49d924fe | ||
|
|
b24d674d6a | ||
|
|
5779233ec1 | ||
|
|
8c768bb802 | ||
|
|
bc51e940da | ||
|
|
1793cecba3 | ||
|
|
17dcae26d4 | ||
|
|
1858923fec | ||
|
|
2a392a4b98 | ||
|
|
a6ce979c65 | ||
|
|
ed3659afe6 | ||
|
|
4abb86d20b | ||
|
|
e762a9a87b | ||
|
|
85fe1dbc92 | ||
|
|
8489b6c3b6 | ||
|
|
d7e070db29 | ||
|
|
8bca63207f | ||
|
|
358e5721fe | ||
|
|
807b7ed64d | ||
|
|
89bc51cace | ||
|
|
f3b90dfa4c | ||
|
|
79894a4580 | ||
|
|
2a98ed289a | ||
|
|
e9f64893ac | ||
|
|
caa0653bfe | ||
|
|
bcb5366e68 | ||
|
|
b1158f5f60 | ||
|
|
a400700c49 | ||
|
|
b571fd47c9 | ||
|
|
8b952700ef | ||
|
|
23579fc961 | ||
|
|
76b388bb75 | ||
|
|
0c7d3eaee4 | ||
|
|
3986be824a | ||
|
|
ba7b94d4e5 | ||
|
|
e1520fdd48 | ||
|
|
8d20d4ba45 | ||
|
|
723c52bcf5 | ||
|
|
6e3490b985 |
@@ -10,10 +10,6 @@ config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config BBF_TR104
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR143
|
||||
bool "Enable TR-143 Data Model Support"
|
||||
default y
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.0.20
|
||||
PKG_VERSION:=1.3.10
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=4a8d286201efdff814f106e92147c697c32a94a9
|
||||
PKG_SOURCE_VERSION:=0f10ece1a6529bcd35f42631d17d98cf63ba60df
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -99,7 +99,7 @@ define Package/libbbfdm-api/description
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/description
|
||||
Library contains the data model tree. It includes TR181, TR104 and TR143 data models
|
||||
Library contains the data model tree. It includes TR181, TR143 data models
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
@@ -113,11 +113,6 @@ CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
-DBBF_WIFI_DATAELEMENTS=ON
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR104),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR104=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR143=ON
|
||||
@@ -211,8 +206,9 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/src/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/json/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
|
||||
endef
|
||||
|
||||
define Package/userinterface/install
|
||||
@@ -225,7 +221,9 @@ define Package/userinterface/install
|
||||
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
|
||||
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
endef
|
||||
|
||||
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)
|
||||
|
||||
17
bbfdm/files/etc/bbfdm/bbfdm_services.sh
Executable file
17
bbfdm/files/etc/bbfdm/bbfdm_services.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
BBFDMD="/usr/sbin/bbfdmd"
|
||||
|
||||
bbfdm_add_service()
|
||||
{
|
||||
local name path
|
||||
|
||||
name="${1}"
|
||||
path="${2}"
|
||||
|
||||
if [ -z "${name}" -o -z "$path" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path'], 'respawn': [0]}}}"
|
||||
}
|
||||
@@ -2,6 +2,6 @@
|
||||
config bbfdmd 'bbfdmd'
|
||||
option enabled '1'
|
||||
option loglevel '1'
|
||||
option refresh_time '10'
|
||||
option transaction_timeout '10'
|
||||
option refresh_time '0'
|
||||
option transaction_timeout '30'
|
||||
|
||||
|
||||
74
bbfdm/files/etc/firewall.portmap
Executable file
74
bbfdm/files/etc/firewall.portmap
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.dnat -p info
|
||||
}
|
||||
|
||||
exec_cmd() {
|
||||
if ! eval "$*"; then
|
||||
log "Failed to run [$*]"
|
||||
fi
|
||||
}
|
||||
|
||||
reorder_dnat_rules() {
|
||||
nat_chains=$(iptables -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
|
||||
|
||||
for chain in ${nat_chains}; do
|
||||
# Collect empty remote host & empty dport rules
|
||||
EMPTY_HOST_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
|
||||
if [ -n "${EMPTY_HOST_PORT}" ]; then
|
||||
echo "${EMPTY_HOST_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect empty remote host but non empty dport rules
|
||||
EMPTY_HOST=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
|
||||
if [ -n "${EMPTY_HOST}" ]; then
|
||||
echo "${EMPTY_HOST}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect non empty remote host but empty dport rules
|
||||
EMPTY_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
|
||||
if [ -n "${EMPTY_PORT}" ]; then
|
||||
echo "${EMPTY_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
# Now add rules as per datamodel precedence shown below
|
||||
## Non empty remote host, empty dport
|
||||
## empty remote host, non empty dport
|
||||
## empty remote host, empty dport
|
||||
if [ -n "${EMPTY_PORT}" ]; then
|
||||
echo "${EMPTY_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "${EMPTY_HOST}" ]; then
|
||||
echo "${EMPTY_HOST}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "${EMPTY_HOST_PORT}" ]; then
|
||||
echo "${EMPTY_HOST_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Re-order portmapping rules according to precedence hierarchy
|
||||
reorder_dnat_rules
|
||||
12
bbfdm/files/etc/uci-defaults/95-portmap-firewall
Normal file
12
bbfdm/files/etc/uci-defaults/95-portmap-firewall
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.port_hook
|
||||
set firewall.port_hook=include
|
||||
set firewall.port_hook.path=/etc/firewall.portmap
|
||||
set firewall.port_hook.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.0
|
||||
PKG_VERSION:=2.1.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -43,9 +43,9 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/bulkdata
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bulkdata
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
15
bulkdata/files/etc/bulkdata/input.json
Executable file
15
bulkdata/files/etc/bulkdata/input.json
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "JSON",
|
||||
"name": "/etc/bulkdata/bulkdata.json"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.bulkdata",
|
||||
"parent_dm": "Device.",
|
||||
"object": "BulkData",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,11 @@
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
BULKDATA_JSON_INPUT="/etc/bulkdata/input.json"
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
@@ -12,12 +15,14 @@ start_service() {
|
||||
config_load bulkdata
|
||||
config_get_bool enable bulkdata enable 1
|
||||
|
||||
procd_open_instance bulkdata
|
||||
[ "$enable" -eq "1" ] && {
|
||||
procd_open_instance "bulkdata"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bulkdata"
|
||||
}
|
||||
procd_close_instance
|
||||
|
||||
bbfdm_add_service "bbfdm.bulkdata" "${BULKDATA_JSON_INPUT}"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -6,13 +6,22 @@ STOP=20
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
if [ -e "/etc/config/mapagent" -o -e "/etc/config/mapcontroller" ]; then
|
||||
config_load mapagent
|
||||
config_get_bool agent_enabled agent enabled 1
|
||||
config_load mapcontroller
|
||||
config_get_bool controller_enabled controller enabled 1
|
||||
|
||||
if [ $agent_enabled -eq 1 -o $controller_enabled -eq 1 ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
|
||||
procd_set_param limits core="unlimited"
|
||||
#procd_set_param respawn
|
||||
#procd_set_param stdout 1
|
||||
#procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
@@ -2,6 +2,6 @@ menu "Configuration"
|
||||
|
||||
config DECOLLECTOR_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.0.2.1
|
||||
PKG_VERSION:=4.1.0.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fa1b24690ca00a73401fec1386dbf98932545d05
|
||||
PKG_SOURCE_VERSION:=39aad7f222eabf781f2bc1181c5ba3b23dc47629
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -17,10 +17,13 @@ start_service() {
|
||||
|
||||
config_load mapcontroller
|
||||
config_get en controller enabled "0"
|
||||
config_get collect_int controller de_collect_interval
|
||||
|
||||
[ -n "$collect_int" -a $collect_int -lt 30 ] && collect_int=""
|
||||
|
||||
[ $en -gt 0 ] && {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" "-d"
|
||||
procd_set_param command "$PROG" "-d" "${collect_int:+-t $collect_int}"
|
||||
#procd_set_param stdout 1
|
||||
#procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.5.9
|
||||
PKG_VERSION:=3.5.12
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ae9e8f3406f1087464b994cdfbc64a4ce2f86ed4
|
||||
PKG_SOURCE_VERSION:=27f69239e95c7e7c2c9673825bdafde446ae5ae2
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ define Package/ethmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet status and configration utility
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/ethmngr/description
|
||||
@@ -37,19 +37,14 @@ TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
|
||||
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
|
||||
define Build/Compile
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ethmngr/install
|
||||
$(CP) ./files/common/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
$(CP) ./files/broadcom/* $(1)/
|
||||
else
|
||||
$(CP) ./files/linux/* $(1)/
|
||||
endif
|
||||
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
|
||||
$(CP) ./files/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
|
||||
endif
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
# arg1: port ifname, ex: eth0
|
||||
get_max_port_speed() {
|
||||
if [ -z "$1" ]; then
|
||||
echo 0
|
||||
return
|
||||
fi
|
||||
|
||||
local ifname="$1"
|
||||
local phycap="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Capabilities' | awk '{print$NF}' | cut -d'|' -f1)"
|
||||
local speed=1000
|
||||
|
||||
case "$phycap" in
|
||||
10GFD) speed=10000 ;;
|
||||
5GFD) speed=5000 ;;
|
||||
2.5GFD) speed=2500 ;;
|
||||
1GFD|1GHD) speed=1000 ;;
|
||||
100MFD|100MHD) speed=100 ;;
|
||||
10MFD|10MHD) speed=10 ;;
|
||||
esac
|
||||
|
||||
echo $speed
|
||||
}
|
||||
|
||||
# arg1: port name, ex: eth0
|
||||
get_port_number() {
|
||||
[ -z "$1" ] && return
|
||||
local ports="0 1 2 3 4 5 6 7 8"
|
||||
local units="0 1"
|
||||
local port="$1"
|
||||
local ifname
|
||||
|
||||
for unit in $units; do
|
||||
for prt in $ports; do
|
||||
ifname="$(ethswctl getifname $unit $prt 2>/dev/null | awk '{print$NF}')"
|
||||
if [ "$ifname" == "$port" ]; then
|
||||
echo "$unit $prt"
|
||||
return
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
reset_port() {
|
||||
local ifname="$1"
|
||||
ethctl $ifname phy-reset >/dev/null
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
power_updown() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
|
||||
local updown="up"
|
||||
[ $enabled -eq 0 ] && updown="down"
|
||||
ethctl $ifname phy-power $updown >/dev/null
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
# arg3: port speed, ex: 1000
|
||||
# arg4: port duplex, ex: full
|
||||
# arg5: port autoneg, ex: on
|
||||
# arg6: port eee, ex: 0
|
||||
# arg7: port pause, ex: 0
|
||||
set_port_settings() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
local speed="$3"
|
||||
local duplex=$4
|
||||
local autoneg=$5
|
||||
local eee=$6
|
||||
local pause=$7
|
||||
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
local unitport="$(get_port_number $ifname)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
|
||||
[ $autoneg -eq 1 ] && autoneg="on" || autoneg="off"
|
||||
[ "$duplex" == "half" ] && duplex=0 || duplex=1
|
||||
[ "$duplex" == 0 ] && dplx="HD" || dplx="FD"
|
||||
[ "$autoneg" == "on" ] && media_type="auto" || media_type="$speed$dplx"
|
||||
|
||||
phycrossbar="$(ethctl $ifname phy-crossbar | head -1)"
|
||||
crossbartype="$(echo $phycrossbar | awk '{print$2$3}')"
|
||||
# Take only the last PHY Endpoint (non-Serdes) into account as Serdes port number precedes
|
||||
[ "$crossbartype" == "oncrossbar" ] && pyhendpoint="$(echo $phycrossbar | awk '{print$NF}')"
|
||||
|
||||
phycaps="$(ethctl $ifname media-type ${pyhendpoint:+ port $pyhendpoint} | awk -F'PHY Capabilities: ' '{print$2}')"
|
||||
numofcaps="$(echo $phycaps | tr '|' ' ' | wc -w)"
|
||||
|
||||
# Reset the port before setting new params
|
||||
reset_port $ifname
|
||||
|
||||
if [ "$numofcaps" == "1" ]; then
|
||||
logger -t "port-management" "$ifname is capable of $phycaps only; not setting speed/duplex"
|
||||
else
|
||||
logger -t "port-management" "$ifname is capable of $phycaps; setting speed/duplex to $media_type"
|
||||
ethctl $ifname media-type $media_type ${pyhendpoint:+ port $pyhendpoint} &>/dev/null
|
||||
fi
|
||||
|
||||
[ $eee -eq 1 ] && eee="on" || eee="off"
|
||||
ethtool --set-eee $ifname eee $eee 2>/dev/null
|
||||
|
||||
case $pause in
|
||||
off|0)
|
||||
pause=0x0
|
||||
auto=off
|
||||
rx=off
|
||||
tx=off
|
||||
;;
|
||||
on|1)
|
||||
pause=0x2
|
||||
auto=off
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
auto)
|
||||
pause=0x1
|
||||
auto=on
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
tx)
|
||||
pause=0x3
|
||||
auto=off
|
||||
rx=off
|
||||
tx=on
|
||||
;;
|
||||
rx)
|
||||
pause=0x4
|
||||
auto=off
|
||||
rx=on
|
||||
tx=off
|
||||
;;
|
||||
esac
|
||||
if [ "$auto" == "on" ]; then
|
||||
# Use ethswctl utility to set pause autoneg
|
||||
# as ethtool is not setting it properly
|
||||
ethswctl -c pause -n $unit -p $port -v $pause 2>&1 >/dev/null
|
||||
else
|
||||
ethtool --pause $ifname autoneg $auto rx $rx tx $tx 2>/dev/null
|
||||
fi
|
||||
|
||||
power_updown $ifname $enabled
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=15
|
||||
STOP=90
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ethmngr
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/ethernet
|
||||
|
||||
configure_ethernet_port(){
|
||||
local cfg=$1
|
||||
local ifname enabled speed duplex autoneg eee pause
|
||||
|
||||
config_get ifname $cfg ifname
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
config_get enabled $cfg enabled 1
|
||||
config_get speed $cfg speed 1000
|
||||
config_get duplex $cfg duplex "full"
|
||||
config_get autoneg $cfg autoneg 1
|
||||
config_get eee $cfg eee 0
|
||||
config_get pause $cfg pause 0
|
||||
|
||||
set_port_settings $ifname $enabled $speed $duplex $autoneg $eee $pause
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ -s /etc/config/ports ]; then
|
||||
config_load ports
|
||||
config_foreach configure_ethernet_port ethport
|
||||
fi
|
||||
|
||||
if [ -f $PROG ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger ports
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
populate_config_from_db() {
|
||||
. /lib/functions.sh
|
||||
. /lib/network/utils.sh
|
||||
include /lib/ethernet
|
||||
|
||||
portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
for port in $portorder; do
|
||||
speed="$(get_max_port_speed $port 2>/dev/null)"
|
||||
speed="${speed:-1000}"
|
||||
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
if [ "$(db -q get hw.board.ethernetWanPort)" = "$port" ]; then
|
||||
uci set ports.@ethport[-1].pause=1
|
||||
uci set ports.@ethport[-1].uplink=1
|
||||
else
|
||||
uci set ports.@ethport[-1].pause=0
|
||||
fi
|
||||
done
|
||||
|
||||
uci commit ports
|
||||
}
|
||||
|
||||
populate_config_from_device_tree() {
|
||||
for path in $(find /proc/device-tree/ -name "port@*"); do
|
||||
port="$(cat $path/label)"
|
||||
[ -n "$port" ] || continue
|
||||
[ "$port" = "cpu" ] && continue
|
||||
speed=1000
|
||||
if [ -e "$path/phy-mode" ]; then
|
||||
phymode="$(cat $path/phy-mode)"
|
||||
case "$phymode" in
|
||||
10000*) speed=10000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
esac
|
||||
fi
|
||||
PORT="$(echo $port | tr '[a-z]' '[A-Z]')"
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$PORT"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$PORT"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
if [ "$port" = "wan" ]; then
|
||||
uci set ports.@ethport[-1].pause=1
|
||||
uci set ports.@ethport[-1].uplink=1
|
||||
else
|
||||
uci set ports.@ethport[-1].pause=0
|
||||
fi
|
||||
done
|
||||
uci commit ports
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/ports" ]; then
|
||||
if uci -q get ports.@ethport[0] >/dev/null; then
|
||||
# exit if there is any valid content
|
||||
exit 0
|
||||
else
|
||||
rm -f /etc/config/ports
|
||||
fi
|
||||
fi
|
||||
|
||||
touch /etc/config/ports
|
||||
|
||||
if [ -f /sbin/db -a -n "$(db get hw.board.ethernetPortOrder 2>/dev/null)" ]; then
|
||||
populate_config_from_db
|
||||
elif [ -d /proc/device-tree/ ]; then
|
||||
populate_config_from_device_tree
|
||||
fi
|
||||
28
ethmngr/files/etc/init.d/ethmngr
Executable file
28
ethmngr/files/etc/init.d/ethmngr
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=15
|
||||
STOP=90
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ethmngr
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/ethernet
|
||||
|
||||
start_service() {
|
||||
if [ -f $PROG ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger network
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
# arg1: port ifname, ex: eth0
|
||||
get_max_port_speed() {
|
||||
if [ -z "$1" ]; then
|
||||
echo 0
|
||||
return
|
||||
fi
|
||||
|
||||
local ifname="$1"
|
||||
local phycap="$(ethtool $ifname | grep -A 10 "Supported link modes" | grep 00 | tail -n 1 | awk '{print$NF}')"
|
||||
local speed=1000
|
||||
|
||||
case "$phycap" in
|
||||
10000*) speed=10000 ;;
|
||||
5000*) speed=5000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
1000*) speed=1000 ;;
|
||||
100*) speed=100 ;;
|
||||
10*) speed=10 ;;
|
||||
esac
|
||||
|
||||
echo $speed
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
power_updown() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
|
||||
local updown="up"
|
||||
[ $enabled -eq 0 ] && updown="down"
|
||||
ip link set dev $ifname $updown
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
# arg3: port speed, ex: 1000
|
||||
# arg4: port duplex, ex: full
|
||||
# arg5: port autoneg, ex: on
|
||||
# arg6: port eee, ex: 0
|
||||
# arg7: port pause, ex: 0
|
||||
set_port_settings() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
local speed="$3"
|
||||
local duplex=$4
|
||||
local autoneg=$5
|
||||
local eee=$6
|
||||
local pause=$7
|
||||
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
[ $autoneg -eq 1 ] && autoneg="on" || autoneg="off"
|
||||
ethtool --change $ifname speed $speed duplex $duplex autoneg $autoneg
|
||||
|
||||
[ $eee -eq 1 ] && eee="on" || eee="off"
|
||||
ethtool --set-eee $ifname eee $eee 2>/dev/null
|
||||
|
||||
case $pause in
|
||||
off|0)
|
||||
pause=0x0
|
||||
auto=off
|
||||
rx=off
|
||||
tx=off
|
||||
;;
|
||||
on|1)
|
||||
pause=0x2
|
||||
auto=off
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
auto)
|
||||
pause=0x1
|
||||
auto=on
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
tx)
|
||||
pause=0x3
|
||||
auto=off
|
||||
rx=off
|
||||
tx=on
|
||||
;;
|
||||
rx)
|
||||
pause=0x4
|
||||
auto=off
|
||||
rx=on
|
||||
tx=off
|
||||
;;
|
||||
esac
|
||||
|
||||
ethtool --pause $ifname autoneg $auto rx $rx tx $tx 2>/dev/null
|
||||
|
||||
power_updown $ifname $enabled
|
||||
}
|
||||
42
fscryptctl/Makefile
Normal file
42
fscryptctl/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fscryptctl
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/google/fscryptctl.git
|
||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Encryption
|
||||
TITLE:=Fscryptctl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
fscryptctl is a low-level tool written in C that handles raw keys and manages policies for Linux filesystem encryption,
|
||||
specifically the "fscrypt" kernel interface which is supported by the ext4, f2fs, and UBIFS filesystems
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CC="$(TARGET_CC)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
fscryptctl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fscryptctl $(1)/usr/bin/fscryptctl
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
15
hostmngr/Config.in
Normal file
15
hostmngr/Config.in
Normal file
@@ -0,0 +1,15 @@
|
||||
if (PACKAGE_hostmngr)
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config HOSTMNGR_HOSTS_HISTORY
|
||||
bool "Keep history of hosts"
|
||||
default y
|
||||
|
||||
config HOSTMNGR_PLATFORM_HAS_WIFI
|
||||
bool "Platform has WiFi"
|
||||
default y if PACKAGE_libwifi
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
70
hostmngr/Makefile
Normal file
70
hostmngr/Makefile
Normal file
@@ -0,0 +1,70 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=0.17.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d355e72e31eb0e3640761af2aec390324c7d142b
|
||||
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
|
||||
endif
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
define Package/hostmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Show and manage hosts in the network
|
||||
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
|
||||
+libnetfilter-conntrack \
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi
|
||||
endef
|
||||
|
||||
define Package/hostmngr/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/hostmngr/description
|
||||
This package provides hostmngr that can detect and show host devices
|
||||
present in the network.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-I$(STAGING_DIR)/usr/include/libnetfilter_conntrack \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_HOSTMNGR_PLATFORM_HAS_WIFI),y)
|
||||
TARGET_CFLAGS += -DHAS_WIFI
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/hostmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/hostmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,hostmngr))
|
||||
9
hostmngr/files/etc/config/hostmngr
Normal file
9
hostmngr/files/etc/config/hostmngr
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
config global 'global'
|
||||
option enabled '1'
|
||||
option history '1'
|
||||
option history_file '/etc/hosts_history.json'
|
||||
option history_timeout '604800'
|
||||
|
||||
config interface
|
||||
list ifname 'br-lan'
|
||||
26
hostmngr/files/etc/init.d/hostmngr
Executable file
26
hostmngr/files/etc/init.d/hostmngr
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=97
|
||||
STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/hostmngr" "--config hostmngr" "-o" "/tmp/hostmngr.log" "-f"
|
||||
# procd_set_param respawn
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "hostmngr"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.3.5
|
||||
PKG_VERSION:=9.5.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=caa4ac86b91b698e73e09a3ba8b60add36ea4b62
|
||||
PKG_SOURCE_VERSION:=8167cfa5a0ce77f467ad173e44d0012a6cb9b3e3
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -39,6 +39,6 @@ config cpe 'cpe'
|
||||
option active_notif_throttle '0'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '1'
|
||||
option enable '0'
|
||||
option hostname ''
|
||||
option port '0'
|
||||
|
||||
@@ -5,46 +5,58 @@ log() {
|
||||
echo "${@}"|logger -t firewall.cwmp -p info
|
||||
}
|
||||
|
||||
if [ ! -f "/var/state/icwmp" ]; then
|
||||
get_firewall_zone() {
|
||||
zone="$(uci show firewall|grep network|grep ${1}|cut -d. -f 2)"
|
||||
zone="${zone:-wan}" # defaults to wan zone
|
||||
echo "$zone"
|
||||
}
|
||||
|
||||
cleanup_exiting_rules() {
|
||||
while iptables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Open_ACS_port"; do
|
||||
rule_num="$(iptables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Open_ACS_port" | head -1|awk '{print $1}')"
|
||||
if [ -n "${rule_num}" ]; then
|
||||
iptables -w 1 -D zone_"${1}"_input "${rule_num}";
|
||||
fi
|
||||
done
|
||||
while ip6tables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Open_ACS_port"; do
|
||||
rule_num="$(ip6tables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Open_ACS_port" | head -1|awk '{print $1}')"
|
||||
if [ -n "${rule_num}" ]; then
|
||||
ip6tables -w 1 -D zone_"${1}"_input "${rule_num}";
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
enable="$(uci -q get cwmp.cpe.enable)"
|
||||
enable="${enable:-1}"
|
||||
|
||||
if [ "$enable" -eq 0 ]; then
|
||||
log "CWMP not enabled"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
zone_name=$(uci -c /var/state -q get icwmp.acs.zonename)
|
||||
wan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
||||
wan="${wan:-wan}"
|
||||
|
||||
zone_name="$(get_firewall_zone $wan)"
|
||||
|
||||
port=$(uci -q get cwmp.cpe.port)
|
||||
port="${port:-7547}"
|
||||
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|awk '{print tolower($0)}')
|
||||
incoming_rule="${incoming_rule:-port_only}"
|
||||
|
||||
ipaddr=$(uci -c /var/state -q get icwmp.acs.ip)
|
||||
ip6addr=$(uci -c /var/state -q get icwmp.acs.ip6)
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr 'A-Z' 'a-z')
|
||||
|
||||
if [ -z "${zone_name}" ]; then
|
||||
log "empty firewall zone name"
|
||||
exit 0
|
||||
elif [ "$zone_name" = "icwmp" ]; then
|
||||
iptables -nL zone_icwmp_input 2> /dev/null
|
||||
if [ "$?" != 0 ]; then
|
||||
iptables -w 1 -N zone_icwmp_input
|
||||
iptables -w 1 -t filter -A INPUT -j zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport "${port}" -j REJECT
|
||||
else
|
||||
iptables -w 1 -F zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport "${port}" -j REJECT
|
||||
fi
|
||||
else
|
||||
iptables -w 1 -F zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -X zone_icwmp_input 2> /dev/null
|
||||
fi
|
||||
|
||||
cmd="iptables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
cmd6="ip6tables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
|
||||
# default incoming rule is Port only
|
||||
if [ -z "${incoming_rule}" ]; then
|
||||
incoming_rule="port_only"
|
||||
fi
|
||||
|
||||
if [ "${incoming_rule}" = "ip_only" ]; then
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
if [ -n "${ip6addr}" ]; then
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
@@ -55,6 +67,9 @@ elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
|
||||
if [ -n "${ip6addr}" ]; then
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
|
||||
@@ -64,17 +79,23 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
cleanup_exiting_rules "${zone_name}"
|
||||
|
||||
echo "${cmd}"|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd}
|
||||
log "Applied [${cmd}]"
|
||||
fi
|
||||
|
||||
echo "${cmd6}"|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd6="${cmd6} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd6}
|
||||
log "Applied [${cmd6}]"
|
||||
fi
|
||||
|
||||
uci -c /var/state -q set icwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit icwmp
|
||||
if [ -f "/var/state/icwmp" ]; then
|
||||
uci -c /var/state -q set icwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit icwmp
|
||||
fi
|
||||
|
||||
@@ -14,6 +14,8 @@ handle_icwmp_update() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
# wait for some time to avoid interface fluctuation
|
||||
sleep 10
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
|
||||
if [ "$ret" = "true" ]; then
|
||||
|
||||
@@ -98,7 +98,11 @@ configure_send_op125() {
|
||||
if [ "${uci}" = "network" ]; then
|
||||
local opt125="125:00:00:0D:E9"
|
||||
else
|
||||
local opt125="125,00:00:0D:E9"
|
||||
if [ -z "${sendopt}" ]; then
|
||||
local opt125="125,00:00:0D:E9"
|
||||
else
|
||||
local opt125=":00:00:0D:E9"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_get oui cpe manufacturer_oui ""
|
||||
@@ -178,10 +182,94 @@ configure_send_op125() {
|
||||
new_send_opt="$sendopt $opt125"
|
||||
uci -q set network."${intf}".sendopts="$new_send_opt"
|
||||
else
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$opt125"
|
||||
new_send_opt="$sendopt$opt125"
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$new_send_opt"
|
||||
fi
|
||||
}
|
||||
|
||||
check_for_suboptions() {
|
||||
# Check if option 4 and 5 present inside enterprise id 3561
|
||||
data=$(echo "${1}" | sed 's/://g')
|
||||
len=$(printf "${data}"|wc -c)
|
||||
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 8 ]; do
|
||||
subopt_present=0
|
||||
|
||||
ent_id="${data:0:8}"
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
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 ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
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 ))
|
||||
|
||||
len_val=${data:8:2}
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
if [ $opt_len -eq 0 ]; then
|
||||
echo ${subopt_present}
|
||||
return 0
|
||||
fi
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
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")
|
||||
case "${sub_opt_id}" in
|
||||
"4") subopt_present=1
|
||||
;;
|
||||
"5") subopt_present=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ${subopt_present} -eq 1 ]; then
|
||||
break;
|
||||
fi
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
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}}
|
||||
done
|
||||
|
||||
if [ ${subopt_present} -eq 1 ]; then
|
||||
break;
|
||||
else
|
||||
# move ahead data to next enterprise id
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${subopt_present}
|
||||
}
|
||||
|
||||
enable_dnsmasq_option125() {
|
||||
local lan="${1}"
|
||||
local send125_present=0
|
||||
@@ -190,16 +278,19 @@ enable_dnsmasq_option125() {
|
||||
local proto="$(uci -q get dhcp."${lan}".dhcpv4)"
|
||||
if [ "${proto}" = "server" ]; then
|
||||
opt_list="$(uci -q get dhcp."${lan}".dhcp_option)"
|
||||
base_opt=""
|
||||
|
||||
for sopt in $opt_list; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=1
|
||||
send125_present=$(check_for_suboptions "${sopt:4}")
|
||||
base_opt="${sopt}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
configure_send_op125 "" "${lan}" "dhcp"
|
||||
uci -q del_list dhcp."${lan}".dhcp_option="${base_opt}"
|
||||
configure_send_op125 "${base_opt}" "${lan}" "dhcp"
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
fi
|
||||
fi
|
||||
@@ -488,20 +579,17 @@ reload_service() {
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "cwmp"
|
||||
|
||||
procd_open_trigger
|
||||
json_add_array
|
||||
json_add_string "" "interface.update"
|
||||
json_add_array
|
||||
json_add_array
|
||||
json_add_string "" "run_script"
|
||||
json_add_string "" "/etc/icwmpd/update.sh"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
add_interface_trigger() {
|
||||
procd_add_interface_trigger "interface.update" "$1" /etc/icwmpd/update.sh
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
local wan_interface
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
procd_add_reload_trigger "cwmp"
|
||||
add_interface_trigger ${default_wan_interface}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.1.11
|
||||
PKG_VERSION:=8.2.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=90b8f44ca78b4711d5c86234fb0fc621ebd97fd9
|
||||
PKG_SOURCE_VERSION:=c03fc4287af3dd17655dcaa02fc37d67425531f7
|
||||
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
|
||||
@@ -89,6 +89,12 @@ ifeq ($(CONFIG_IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY),y)
|
||||
TARGET_CFLAGS += -DIEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_IEEE1905_EXTENSION_ALLOWED),y)
|
||||
TARGET_CFLAGS += -DEXTENSION_ALLOWED
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DHAS_UBUS
|
||||
|
||||
MAKE_FLAGS += \
|
||||
extmod_subdirs="$(patsubst %,extensions/%,$(plugins))"
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ define Package/map-plugin/config
|
||||
|
||||
config MULTIAP_EASYMESH_VERSION
|
||||
int "Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
bool "Sync configuration between dynamic controllers in the network"
|
||||
default n
|
||||
default y
|
||||
|
||||
config MULTIAP_FUZZ_1905_CMDUS
|
||||
bool "Include support to fuzz 1905 CMDUs for testing purpose"
|
||||
|
||||
38
iop/config
38
iop/config
@@ -59,13 +59,15 @@ CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_qosmngr=y
|
||||
CONFIG_PACKAGE_libwifiutils=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
CONFIG_PACKAGE_hostmngr=y
|
||||
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-agent=m
|
||||
CONFIG_PACKAGE_map-controller=m
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_topology-plugin=y
|
||||
CONFIG_PACKAGE_decollector=y
|
||||
CONFIG_PACKAGE_map-agent=y
|
||||
CONFIG_PACKAGE_map-controller=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
|
||||
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
|
||||
|
||||
@@ -86,12 +88,13 @@ CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_stunc=m
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_twamp=m
|
||||
CONFIG_PACKAGE_udpecho-client=m
|
||||
CONFIG_PACKAGE_udpecho-server=m
|
||||
CONFIG_PACKAGE_xmppc=m
|
||||
CONFIG_PACKAGE_stunc=y
|
||||
CONFIG_PACKAGE_swmodd=y
|
||||
CONFIG_PACKAGE_twamp=y
|
||||
CONFIG_PACKAGE_udpecho-client=y
|
||||
CONFIG_PACKAGE_udpecho-server=y
|
||||
CONFIG_PACKAGE_userinterface=y
|
||||
CONFIG_PACKAGE_xmppc=y
|
||||
|
||||
# WebGUI #
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
@@ -131,11 +134,12 @@ CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
|
||||
# Services #
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_atftp=y
|
||||
CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
CONFIG_PACKAGE_ssdpd=y
|
||||
CONFIG_PACKAGE_miniupnpd-iptables=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
@@ -144,7 +148,7 @@ CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
CONFIG_PACKAGE_vsftpd-tls=y
|
||||
|
||||
# Tools and Utilities #
|
||||
CONFIG_PACKAGE_curl=y
|
||||
@@ -160,11 +164,17 @@ CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_ip6tables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipmark=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iptables-mod-nflog=y
|
||||
CONFIG_PACKAGE_iptables-mod-nfqueue=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_nping=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_socat=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
|
||||
@@ -174,9 +184,12 @@ CONFIG_PACKAGE_traceroute6=y
|
||||
##########
|
||||
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_ca-certificates=y
|
||||
CONFIG_PACKAGE_crun=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libcap-bin=y
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
@@ -184,6 +197,7 @@ CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_procd-ujail=m
|
||||
CONFIG_PACKAGE_quota=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rrdns=y
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2029
|
||||
|
||||
build_bcmkernel_consumer() {
|
||||
local tarfile bcmkernelcommith sdkversion serverpath serverlink
|
||||
|
||||
sdkversion="$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')"
|
||||
sdkversion="${sdkversion:0:4}${sdkversion:(-1)}"
|
||||
bcmkernelcommith="$(grep -w "PKG_SOURCE_VERSION:" "$curdir/feeds/broadcom/bcmkernel/${sdkversion:0:5}"*".mk" | cut -d'=' -f2)"
|
||||
|
||||
[ -n "$board" ] && [ -n "$bcmkernelcommith" ] || return
|
||||
|
||||
serverpath="$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz"
|
||||
serverlink="$FPATH/bcmopen-$board-$majver.$minver-latest"
|
||||
|
||||
# do not build bcmopen sdk if it was already built before
|
||||
# if it was, check if there's a symlink in place and create it if missing
|
||||
ssh "$SERVER" "test -f '$serverpath' && { test -L '$serverlink' || ln -sf '$serverpath' '$serverlink'; }" && return
|
||||
|
||||
cd "./build_dir/target-"*"/bcmkernel-"*"-${sdkversion:0:4}"*"/bcm963xx/release"
|
||||
bash do_consumer_release -p "$profile" -y -F
|
||||
|
||||
tarfile='out/bcm963xx_*_consumer.tar.gz'
|
||||
[ $(ls -1 $tarfile | wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
||||
|
||||
scp -pv $tarfile "$SERVER":"$serverpath"
|
||||
ssh "$SERVER" "test -f '$serverpath' && ln -sf '$serverpath' '$serverlink'"
|
||||
rm -f $tarfile
|
||||
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_endptmngr_consumer() {
|
||||
# create endptmngr open version tar file
|
||||
local endptversion endptcommith
|
||||
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
|
||||
endptversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
[ -n "$profile" ] && [ -n "$endptversion" ] && [ -n "$endptcommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/endptmngr-$profile-$endptversion-$endptcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/endptmngr-$endptversion/
|
||||
mkdir endptmngr-open-$endptversion
|
||||
mkdir endptmngr-open-$endptversion/src
|
||||
cp ./src/endptmngr endptmngr-open-$endptversion/src
|
||||
cp -r ./files/ endptmngr-open-$endptversion/
|
||||
tar -czv endptmngr-open-$endptversion/ -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
scp -pv endptmngr-$profile-$endptversion-$endptcommith.tar.gz $SERVER:$FPATH/
|
||||
cp endptmngr-$profile-$endptversion-$endptcommith.tar.gz $curdir/
|
||||
rm -rf endptmngr-open-$endptversion
|
||||
rm -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
function print_usage {
|
||||
echo "Usage: $0 generate_tarballs"
|
||||
echo " -t <target>"
|
||||
}
|
||||
|
||||
function generate_tarballs {
|
||||
|
||||
SERVER="god@download.iopsys.eu"
|
||||
FPATH="/var/www/html/iopsys/opensdk"
|
||||
|
||||
set -e
|
||||
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
|
||||
|
||||
board=$(grep CONFIG_TARGET_FAMILY .config | cut -d'=' -f2 | tr -d '"')
|
||||
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
|
||||
majver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f1 -d .)
|
||||
minver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f2 -d .)
|
||||
curdir="$PWD"
|
||||
|
||||
|
||||
# Execute user command
|
||||
while getopts "t:h" opt; do
|
||||
case $opt in
|
||||
t)
|
||||
stk_target=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$stk_target" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_endptmngr_consumer
|
||||
else
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
register_command "generate_tarballs" "Generate tarballs for Open SDK"
|
||||
|
||||
@@ -36,6 +36,18 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
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)" \
|
||||
subdirs="$(subdirs)"
|
||||
|
||||
define Package/libdsl
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=3043d53818166ce02644d53f99b5830d228f78dd
|
||||
PKG_SOURCE_VERSION:=3f4cdca981b30d54ec5a426775fdcec2a63f83d9
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 16
|
||||
"bitrate": 16,
|
||||
"rtp_payload": 80
|
||||
},
|
||||
"g723": {
|
||||
"name": "G.723.1",
|
||||
@@ -48,7 +49,7 @@
|
||||
"bitrate": 15.2
|
||||
},
|
||||
"gsm": {
|
||||
"name": "GSM-AMR",
|
||||
"name": "AMR",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=dc227982c48ee6d722f3fe18dc9db71495ce9758
|
||||
PKG_SOURCE_VERSION:=548f8fccc9f8f0b5dd6bb39bdd9cac8659400cb6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"bitrate": 15.2
|
||||
},
|
||||
"gsm": {
|
||||
"name": "GSM-AMR",
|
||||
"name": "AMR",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=f2134d372b3f5e5810e18f34d64d5486d17fca64
|
||||
PKG_SOURCE_VERSION:=062a265754b93a865cfcd2745f200aa09fb4a668
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -15,14 +15,6 @@
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
},
|
||||
"g729a": {
|
||||
"name": "G.729a",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 40,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
},
|
||||
"g729": {
|
||||
"name": "G.729",
|
||||
"ptime_min": 10,
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.2.104
|
||||
PKG_VERSION:=7.2.111
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a246bf9fd92a1a8c107ffff3eb3428a4174a67df
|
||||
PKG_SOURCE_VERSION:=75bc4789e742584d45fcc2f9261267ed3e5c5492
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -48,7 +48,7 @@ else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_CFLAGS +=-DIPQ95XX
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
TARGET_WIFI_TYPE=MEDIATEK MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_LINUX
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
||||
|
||||
@@ -8,28 +8,28 @@ config AGENT_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
|
||||
config AGENT_ISLAND_PREVENTION
|
||||
bool "Support Island Prevention"
|
||||
default y if MULTIAP_AGENT_ISLAND_PREVENTION
|
||||
default y
|
||||
|
||||
config AGENT_EASYMESH_R2_CERT
|
||||
bool "Compile for WFA test bed"
|
||||
|
||||
config AGENT_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT
|
||||
bool "Enable extra features through Easymesh vendor extension"
|
||||
default y
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
default AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
enabled through AGENT_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.3.3.2
|
||||
PKG_VERSION:=4.3.5.5
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=6b1347b33333f3ef9884de0745aa862a0a1dabc8
|
||||
PKG_SOURCE_VERSION:=2a7421b0858640f53c4ad82eedb8f1a4c3b40f5d
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -28,7 +28,7 @@ define Package/map-agent
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin +ip-bridge +@BUSYBOX_CONFIG_PATCH +@BUSYBOX_CONFIG_DIFF
|
||||
+map-plugin +ip-bridge
|
||||
endef
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ TARGET_CFLAGS += -DEASYMESH_R2_CERT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
config agent 'agent'
|
||||
option enabled '1'
|
||||
option enabled '0'
|
||||
option debug '0'
|
||||
option profile '2'
|
||||
option profile '4'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
option eth_onboards_wifi_bhs '0'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
option eth_onboards_wifi_bhs '1'
|
||||
option scan_on_boot_only '0'
|
||||
option guest_isolation '1'
|
||||
list map_port 'all'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config dynamic_backhaul
|
||||
option missing_bh_timer '60'
|
||||
@@ -20,9 +22,9 @@ config controller_select
|
||||
option autostart '1'
|
||||
option local '0'
|
||||
|
||||
config radio
|
||||
option device 'phy0'
|
||||
option band '2'
|
||||
#config radio
|
||||
# option device 'phy0'
|
||||
# option band '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
@@ -33,9 +35,9 @@ config radio
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config radio
|
||||
option device 'phy1'
|
||||
option band '5'
|
||||
#config radio
|
||||
# option device 'phy1'
|
||||
# option band '5'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
@@ -46,12 +48,12 @@ config radio
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan0'
|
||||
option band '2'
|
||||
option device 'phy0'
|
||||
option priority '2'
|
||||
#config bsta
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan0'
|
||||
# option band '2'
|
||||
# option device 'phy0'
|
||||
# option priority '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
@@ -60,12 +62,12 @@ config bsta
|
||||
# option bssid '0a:1b:2c:3d:4e:53'
|
||||
# option vid '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan1'
|
||||
option band '5'
|
||||
option device 'phy1'
|
||||
option priority '0'
|
||||
#config bsta
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan1'
|
||||
# option band '5'
|
||||
# option device 'phy1'
|
||||
# option priority '0'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
|
||||
@@ -11,6 +11,9 @@ al_brnet="${al_bridge:3}"
|
||||
# Exit if the PORT is not member of the AL Bridge
|
||||
[ "$(get_network_of $PORT)" = "$al_brnet" ] || exit 0
|
||||
|
||||
# Exit if the device is not operating in extender/repeater mode
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
############## Dynamic Backhaul Daemon ##############
|
||||
if [ -n "$(which dynbhd)" ]; then
|
||||
pidof dynbhd >/dev/null && exit 0 # dynbhd is managing the links
|
||||
@@ -47,8 +50,6 @@ if [ -n "$wanport" ]; then
|
||||
########################################################
|
||||
else
|
||||
#################### DHCP Discovery ####################
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
brctl delif $al_bridge $PORT
|
||||
|
||||
|
||||
@@ -179,7 +179,16 @@ create_dir() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -f /usr/sbin/dynbhd ] && start_dynbhd_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;
|
||||
|
||||
@@ -11,18 +11,18 @@ config CONTROLLER_EASYMESH_VENDOR_EXT
|
||||
default y
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
|
||||
config CONTROLLER_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
default CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
enabled through CONTROLLER_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.3.0.6
|
||||
PKG_VERSION:=4.3.2.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=cadbccc7654a40f16f96f2c48e584b998c03620e
|
||||
PKG_SOURCE_VERSION:=5c57a6e2788b556f3d21ed39b415bc7e8e5db5ab
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -53,7 +53,7 @@ TARGET_CFLAGS += -DCONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
config controller 'controller'
|
||||
option enabled '1'
|
||||
option registrar '2 5'
|
||||
option enabled '0'
|
||||
option profile '4'
|
||||
option registrar '2 5 6'
|
||||
option debug '0'
|
||||
option bcn_metrics_max_num '10'
|
||||
option initial_channel_scan '0'
|
||||
option primary_vid '0'
|
||||
option enable_ts '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
option allow_bgdfs '0'
|
||||
option channel_plan '0'
|
||||
option de_collect_interval '60'
|
||||
|
||||
config sta_steering
|
||||
option steer_module 'rcpi'
|
||||
@@ -18,40 +21,46 @@ config sta_steering
|
||||
option use_usta_metrics '0'
|
||||
option bandsteer '0'
|
||||
option diffsnr '8'
|
||||
option rcpi_threshold_2g '70'
|
||||
option rcpi_threshold_5g '86'
|
||||
option rcpi_threshold_6g '86'
|
||||
option report_rcpi_threshold_2g '80'
|
||||
option report_rcpi_threshold_5g '96'
|
||||
option report_rcpi_threshold_6g '96'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'sae-mixed'
|
||||
option vid '1'
|
||||
option ssid 'IOWRT-2.4GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
#config ap
|
||||
# option band '2'
|
||||
# option encryption 'sae-mixed'
|
||||
# option vid '1'
|
||||
# option ssid 'IOWRT-2.4GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
# option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option type 'fronthaul'
|
||||
option vid '1'
|
||||
option ssid 'IOWRT-5GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
#config ap
|
||||
# option band '5'
|
||||
# option type 'fronthaul'
|
||||
# option vid '1'
|
||||
# option ssid 'IOWRT-5GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
# option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
#config ap
|
||||
# option band '2'
|
||||
# option type 'backhaul'
|
||||
# option vid '1'
|
||||
# list disallow_bsta '0'
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-5GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
#config ap
|
||||
# option band '5'
|
||||
# option type 'backhaul'
|
||||
# option vid '1'
|
||||
# list disallow_bsta '0'
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
# node and radio sections (per node) are auto
|
||||
# generated per Multi-AP Agent in the network
|
||||
|
||||
@@ -155,6 +155,10 @@ validate_controller_config() {
|
||||
return 0
|
||||
}
|
||||
|
||||
create_dir() {
|
||||
mkdir -p /etc/multiap
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
|
||||
@@ -164,6 +168,8 @@ start_service() {
|
||||
config_get_bool enabled controller enabled 1
|
||||
[ "$enabled" -eq 0 ] && return
|
||||
|
||||
create_dir
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/mapcontroller" "-d"
|
||||
|
||||
|
||||
@@ -7,16 +7,20 @@ config TOPOLOGYD_EASYMESH_VENDOR_EXT
|
||||
default y
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
default TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
enabled through TOPOLOGYD_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
config TOPOLOGYD_HOST_WAN_STATS
|
||||
bool "Enable wan statistics collection per hosts"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=2.5.1.21
|
||||
PKG_VERSION:=2.5.2.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=693b79873af0017bd53ec001af7f3997565420e8
|
||||
PKG_SOURCE_VERSION:=914f1ead2e65c1e24ed2d8786aa883730db2208f
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -49,9 +49,12 @@ endef
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_HOST_WAN_STATS),y)
|
||||
TARGET_CFLAGS += -DHOST_WAN_STATS
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
|
||||
@@ -4,4 +4,4 @@ config topology 'topology'
|
||||
option depth '8'
|
||||
option interval '60'
|
||||
option maxlog '32'
|
||||
option profile '2'
|
||||
option profile '4'
|
||||
|
||||
@@ -97,8 +97,7 @@ interfaces_ok(){
|
||||
# mcast config is outdated, simply generate as per new logic
|
||||
if [ -z "$dev_section" ]; then
|
||||
# check if the itf is a native interface && return 1
|
||||
native=$(ubus call uci get '{"config":"ports", "type":"ethport", "match":{"ifname":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
|
||||
[ -z "native" ] && return 1
|
||||
[ -f "/proc/net/vlan/$itf" ] || return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
|
||||
@@ -10,37 +10,81 @@ PROG_EXE=/usr/sbin/mcproxy
|
||||
PROG_PARAMS=
|
||||
PROG_PARAMS_SEPARATOR=:
|
||||
|
||||
setup_mcast_mode() {
|
||||
unused(){ :;}
|
||||
|
||||
__device_is_bridge() {
|
||||
local device="$2"
|
||||
local devsec__="$(uci show network | grep name=.*$device | cut -d'.' -f2)"
|
||||
local sectype="$(uci -q get network.$devsec__)"
|
||||
local devtype="$(uci -q get network.$devsec__.type)"
|
||||
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
|
||||
eval "$1=$devsec__"
|
||||
}
|
||||
|
||||
device_is_bridge() {
|
||||
local device="$1"
|
||||
local devsec=
|
||||
__device_is_bridge devsec "$device" || return 1
|
||||
}
|
||||
|
||||
device_ports() {
|
||||
local device="$1"
|
||||
local devsec=
|
||||
|
||||
if __device_is_bridge devsec "$device"; then
|
||||
echo "$(uci get network.$devsec.ports)"
|
||||
else
|
||||
echo "$device"
|
||||
fi
|
||||
}
|
||||
|
||||
device_has_ip() {
|
||||
local protocol="$1"
|
||||
local device="$2"
|
||||
|
||||
# Read the openwrt interface for the device.
|
||||
# Device can have multiple logical interfaces like wan and wan6
|
||||
# but same l3 device
|
||||
# NB. Don't use 'get_network_of' here.
|
||||
# This function fails in some uci configurations for interfaces that refer
|
||||
# to a device indirectly.
|
||||
local ifaces=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.device='$device'].interface")
|
||||
for iface in $ifaces; do
|
||||
local ip=
|
||||
case "$protocol" in
|
||||
"igmp") network_get_ipaddr ip "$iface" ;;
|
||||
"mld") network_get_ipaddr6 ip "$iface" ;;
|
||||
esac
|
||||
[ -n "$ip" ] && return
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
config_mcproxy_interfaces() {
|
||||
local upstreams="$1"
|
||||
local downstreams="$2"
|
||||
local exceptions="$3"
|
||||
local protocol="$1"
|
||||
local upstreams="$2"
|
||||
local downstreams="$3"
|
||||
local exceptions="$4"
|
||||
|
||||
if [ -z "$upstreams" ] || [ -z "$downstreams" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local str_up=""
|
||||
if [ -n "$upstreams" ]; then
|
||||
for upstream in $upstreams; do
|
||||
str_up="$str_up \"$upstream\""
|
||||
done
|
||||
fi
|
||||
for upstream in $upstreams; do
|
||||
device_has_ip "$protocol" "$upstream" || continue
|
||||
str_up="$str_up \"$upstream\""
|
||||
done
|
||||
[ -z "$str_up" ] && return 1
|
||||
|
||||
local str_down=""
|
||||
if [ -n "$downstreams" ]; then
|
||||
for downstream in $downstreams; do
|
||||
str_down="$str_down \"$downstream\""
|
||||
done
|
||||
fi
|
||||
for downstream in $downstreams; do
|
||||
device_has_ip "$protocol" "$downstream" || continue
|
||||
str_down="$str_down \"$downstream\""
|
||||
done
|
||||
[ -z "$str_down" ] && return 1
|
||||
|
||||
if [ ! -z $downstream ]; then
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$exceptions" ] || [ -z "$upstreams" ]; then
|
||||
return
|
||||
fi
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
|
||||
for excp in $exceptions; do
|
||||
local filter=""
|
||||
@@ -56,34 +100,63 @@ config_mcproxy_interfaces() {
|
||||
;;
|
||||
esac
|
||||
|
||||
for upstream in $upstreams; do
|
||||
echo "pinstance main upstream \"$upstream\" in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream \"$upstream\" out blacklist table{$filter };" >> $CONFFILE
|
||||
for upstream in $str_up; do
|
||||
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
|
||||
for downstream in $downstreams; do
|
||||
echo "pinstance main downstream \"$downstream\" in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream \"$downstream\" out blacklist table{$filter };" >> $CONFFILE
|
||||
for downstream in $str_down; do
|
||||
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_snooping() {
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
local downstreams="$1"
|
||||
|
||||
for downstream in $downstreams; do
|
||||
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
if device_is_bridge "$downstream"; then
|
||||
echo 1 > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_fastleave() {
|
||||
local downstreams="$1"
|
||||
local fastleave="$2"
|
||||
local prt
|
||||
|
||||
for downstream in $downstreams; do
|
||||
for prt in $(device_ports $downstream); do
|
||||
if [ -f /sys/class/net/$prt/brport/multicast_fast_leave ]; then
|
||||
echo $fastleave > /sys/class/net/$prt/brport/multicast_fast_leave
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_mode() {
|
||||
local downstreams=$1
|
||||
local mcast_mode=$2
|
||||
local prt
|
||||
|
||||
local mcast_flood=
|
||||
if [ $mcast_mode == "2" ]; then # disable mcast flood
|
||||
mcast_flood=0
|
||||
else
|
||||
mcast_flood=1
|
||||
fi
|
||||
|
||||
for downstream in $downstreams; do
|
||||
for prt in $(device_ports $downstream); do
|
||||
if [ -f /sys/class/net/$prt/brport/multicast_flood ]; then
|
||||
echo $mcast_flood > /sys/class/net/$prt/brport/multicast_flood
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_mcproxy_instance() {
|
||||
local protocol="$1"
|
||||
local version="$2"
|
||||
@@ -96,7 +169,7 @@ config_mcproxy_instance() {
|
||||
local exceptions=
|
||||
local upstreams=
|
||||
local downstreams=
|
||||
local intf_has_ip=
|
||||
local mcast_mode=2 # default value 2 is for blocking mode
|
||||
|
||||
CONFFILE=/var/etc/mcproxy_"$protocol".conf
|
||||
rm -f $CONFFILE
|
||||
@@ -121,6 +194,7 @@ config_mcproxy_instance() {
|
||||
|
||||
upstreams=$igmp_p_up_interfaces
|
||||
downstreams=$igmp_p_down_interfaces
|
||||
mcast_mode=$igmp_p_mode
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
case "$version" in
|
||||
[1-2])
|
||||
@@ -140,59 +214,26 @@ config_mcproxy_instance() {
|
||||
|
||||
upstreams=$mld_p_up_interfaces
|
||||
downstreams=$mld_p_down_interfaces
|
||||
mcast_mode=$mld_p_mode
|
||||
fi
|
||||
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
config_sysfs_mcast_snooping
|
||||
|
||||
[ -n "$max_groups" ] && echo -e "max_groups $max_groups;" >> $CONFFILE
|
||||
[ -n "$robustness" ] && echo -e "rv $robustness;" >> $CONFFILE
|
||||
[ -n "$query_interval" ] && echo -e "qi $query_interval;" >> $CONFFILE
|
||||
[ -n "$q_resp_interval" ] && echo -e "qri $q_resp_interval;" >> $CONFFILE
|
||||
[ -n "$last_mem_q_int" ] && echo -e "lmqi $last_mem_q_int;" >> $CONFFILE
|
||||
if [[ -n $fast_leave ]]; then
|
||||
echo -e "fastleave $fast_leave;\n" >> $CONFFILE
|
||||
config_sysfs_mcast_fastleave $fast_leave
|
||||
fi
|
||||
[ -n "$fast_leave" ] && echo -e "fastleave $fast_leave;\n" >> $CONFFILE
|
||||
|
||||
[ -n "$upstreams" ] && [ -n "$downstreams" ] &&
|
||||
config_mcproxy_interfaces "$upstreams" "$downstreams" "$exceptions"
|
||||
config_mcproxy_interfaces "$protocol" "$upstreams" "$downstreams" "$exceptions" || return
|
||||
|
||||
# In case on proxy, upstreams is a list. Iterating and running the mcproxy
|
||||
# for each valid upstream interface
|
||||
for upstream_device in $upstreams;
|
||||
do
|
||||
# Read the upstream interface for the upstream device
|
||||
# upstream device can have multiple logical interfaces like wan and wan6
|
||||
# but same l3 device
|
||||
local upstream_ifaces=$(get_network_of $upstream_device)
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
config_sysfs_mcast_snooping "$downstreams"
|
||||
[ -n $fast_leave ] &&
|
||||
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
|
||||
config_sysfs_mcast_mode "$downstreams" "$mcast_mode"
|
||||
|
||||
for iface in $upstream_ifaces;
|
||||
do
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
network_get_ipaddr upstream_ip $iface
|
||||
if [ ! -z "${upstream_ip}" ]; then
|
||||
intf_has_ip=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$protocol" == "mld" ]; then
|
||||
network_get_ipaddr6 upstream_ip $iface
|
||||
if [ ! -z "${upstream_ip}" ]; then
|
||||
intf_has_ip=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "${intf_has_ip}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
done
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
}
|
||||
|
||||
config_mcproxy() {
|
||||
@@ -205,28 +246,6 @@ config_mcproxy() {
|
||||
fi
|
||||
}
|
||||
|
||||
config_sysfs_mcast_fastleave() {
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
|
||||
for downstream in $downstreams; do
|
||||
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
ports="$(uci get network.$devsec.ports)"
|
||||
for prt in $ports; do
|
||||
echo $1 > /sys/class/net/$prt/brport/multicast_fast_leave
|
||||
done
|
||||
else
|
||||
[[ -f /sys/class/net/$downstream/brport/multicast_fast_leave ]] && echo $1 > /sys/class/net/$downstream/brport/multicast_fast_leave
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
configure_mcast() {
|
||||
config_global_params "set_max_groups_and_sources"
|
||||
|
||||
|
||||
@@ -4,15 +4,27 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
read_mcast_stats() {
|
||||
local temp_igmp_file='/tmp/igmp_stats_'$$
|
||||
local snooping_stats='/tmp/igmp_snooping_stats'
|
||||
local old_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
|
||||
|
||||
temp_igmp_file='/tmp/igmp_stats_'$$
|
||||
# Sending signal to mcproxy to dump multicast data in /tmp/igmp_snooping_stats
|
||||
mcast_pids=$(pidof mcproxy)
|
||||
local mcast_pids=$(pidof mcproxy)
|
||||
for pid in $mcast_pids
|
||||
do
|
||||
$(kill -10 $pid)
|
||||
done
|
||||
cat /tmp/igmp_snooping_stats > temp_igmp_file
|
||||
|
||||
# Wait for signal is being processed by mcproxy
|
||||
if [ -n "$mcast_pids" ]; then
|
||||
for i in 1 2 3; do
|
||||
local new_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
|
||||
[ -n "$new_mod_time" ] && [ "$new_mod_time" != "$old_mod_time" ] && break
|
||||
sleep 0.1
|
||||
done
|
||||
fi
|
||||
|
||||
cat "$snooping_stats" > "$temp_igmp_file"
|
||||
|
||||
local mcast_addrs=""
|
||||
local ifaces=""
|
||||
@@ -42,7 +54,7 @@ read_mcast_stats() {
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done < temp_igmp_file
|
||||
done < "$temp_igmp_file"
|
||||
|
||||
while read line; do
|
||||
# reading each line
|
||||
@@ -69,7 +81,7 @@ read_mcast_stats() {
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done < temp_igmp_file
|
||||
done < "$temp_igmp_file"
|
||||
|
||||
json_init
|
||||
json_add_array "snooping"
|
||||
@@ -89,7 +101,7 @@ read_mcast_stats() {
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done < temp_igmp_file
|
||||
done < "$temp_igmp_file"
|
||||
IFS=" "
|
||||
for gip_addr in $mcast_addrs; do
|
||||
grp_obj_added=0
|
||||
@@ -124,7 +136,7 @@ read_mcast_stats() {
|
||||
json_close_object #close the associated device object
|
||||
;;
|
||||
esac
|
||||
done < temp_igmp_file
|
||||
done < "$temp_igmp_file"
|
||||
json_close_array #close the associated devices array
|
||||
json_close_object # close the groups object
|
||||
done # close the loop for group addresses
|
||||
@@ -134,7 +146,7 @@ read_mcast_stats() {
|
||||
json_close_array # close the snooping array
|
||||
json_dump
|
||||
|
||||
rm -f temp_igmp_file
|
||||
rm -f "$temp_igmp_file"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obudpst
|
||||
PKG_VERSION:=7.5.1
|
||||
PKG_VERSION:=8.0.0
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/BroadbandForum/obudpst.git
|
||||
PKG_SOURCE_VERSION:=a8faf1925ea9189467e7f8d3b9d93c67c8b927bd
|
||||
PKG_SOURCE_VERSION:=1d00a6de1147b5fb4280c443a67b7e5ded3a5c97
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
if PACKAGE_obuspa
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config OBUSPA_DB_PATH
|
||||
string "Configure path for usp.db file"
|
||||
default "/tmp/"
|
||||
@@ -25,5 +22,8 @@ config OBUSPA_MTP_ENABLE_COAP
|
||||
config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
bool "Enable verification of controller MTP before processing the message"
|
||||
default n
|
||||
endmenu
|
||||
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.2.16
|
||||
PKG_VERSION:=7.0.2.26
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=312a739dc9106e8ff490288ba22270f4ce7e1fed
|
||||
PKG_SOURCE_VERSION:=7b3a47a4bf4c5e5a92470cb73ce15b09192e5936
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,6 +31,7 @@ define Package/obuspa
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
endef
|
||||
|
||||
@@ -102,6 +103,7 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
@@ -110,6 +112,12 @@ define Package/obuspa/install
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/USPAgent.json $(1)/etc/bbfdm/json/USPAgent.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/TransferComplete.json $(1)/etc/bbfdm/json/TransferComplete.json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
config obuspa 'global'
|
||||
option enabled '1'
|
||||
option debug '0'
|
||||
option dhcp_discovery '1'
|
||||
option interface 'wan'
|
||||
option log_level '1'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
|
||||
@@ -12,7 +12,7 @@ KEEP_FILE="/lib/upgrade/keep.d/obuspa"
|
||||
|
||||
RESET_FILE="/tmp/obuspa/obuspa_param_reset.txt"
|
||||
SQL_DB_FILE="/tmp/obuspa/usp.db"
|
||||
DB_DUMP="/tmp/obuspa/usp.dump"
|
||||
DB_DUMP="/tmp/obuspa/usp.dump_$(date +%s)"
|
||||
|
||||
BASEPATH=""
|
||||
INSTANCE_COUNT=0
|
||||
@@ -76,7 +76,7 @@ db_set()
|
||||
|
||||
dump_db()
|
||||
{
|
||||
${PROG} -f ${SQL_DB_FILE} -c show database |awk 'NR>1 {print $1 " \"" $3 "\""}' | sort > ${DB_DUMP}
|
||||
${PROG} -v0 -f ${SQL_DB_FILE} -c show database |awk '/^Device./ || /^Internal./ {print $1 " \"" $3 "\""}' | sort > ${DB_DUMP}
|
||||
}
|
||||
|
||||
# if db present then check if it matches with existing instances
|
||||
@@ -196,6 +196,10 @@ validate_obuspa_section()
|
||||
'debug:bool:0' \
|
||||
'prototrace:bool:0' \
|
||||
'log_level:uinteger' \
|
||||
'min_num_to_group:uinteger' \
|
||||
'max_group_sep:uinteger' \
|
||||
'max_cache_time:uinteger' \
|
||||
'ipc_timeout:uinteger' \
|
||||
'log_dest:string' \
|
||||
'db_file:string' \
|
||||
'role_file:file'
|
||||
@@ -226,8 +230,8 @@ validate_controller_section()
|
||||
'Path:string' \
|
||||
'EnableEncryption:bool' \
|
||||
'PeriodicNotifInterval:uinteger' \
|
||||
'SessionMode:string:Allow'
|
||||
|
||||
'SessionMode:string:Allow' \
|
||||
'ProvisioningCode:string'
|
||||
}
|
||||
|
||||
validate_subscription_section()
|
||||
@@ -319,7 +323,7 @@ configure_controller()
|
||||
{
|
||||
local EndpointID Enable
|
||||
local Protocol Destination
|
||||
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName
|
||||
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName ProvisioningCode
|
||||
local Host Port Path EnableEncryption Reference SessionMode PeriodicNotifInterval
|
||||
local dm_ref sec
|
||||
|
||||
@@ -358,6 +362,10 @@ configure_controller()
|
||||
db_set "${BASEPATH}.Enable" "${Enable}"
|
||||
db_set "${BASEPATH}.EndpointID" "${EndpointID}"
|
||||
|
||||
if [ -n "${ProvisioningCode}" ]; then
|
||||
db_set "${BASEPATH}.ProvisioningCode" "${ProvisioningCode}"
|
||||
fi
|
||||
|
||||
if [ -n "${PeriodicNotifInterval}" ]; then
|
||||
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
|
||||
fi
|
||||
@@ -1032,8 +1040,8 @@ register_service()
|
||||
|
||||
configure_obuspa
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
"${respawn_threshold:-10}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-5}"
|
||||
|
||||
procd_set_param watch bbfdm
|
||||
procd_close_instance
|
||||
|
||||
75
obuspa/files/etc/init.d/usptest
Executable file
75
obuspa/files/etc/init.d/usptest
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
USE_PROCD=1
|
||||
|
||||
log()
|
||||
{
|
||||
echo "$*"|logger -t usptest -p debug
|
||||
}
|
||||
|
||||
get_oui_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
|
||||
get_serial_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.SerialNumber
|
||||
}
|
||||
|
||||
publish_endpoint()
|
||||
{
|
||||
local AgentEndpointID serial oui user pass
|
||||
|
||||
if ! uci -q get obuspa.testmqtt; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# return if mosquitto_pub is not present
|
||||
if [ ! "$(command -v mosquitto_pub)" ]; then
|
||||
log "mosquitto_pub not present can't publish EndpointID"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
# Get endpoint id from obuspa config first
|
||||
config_load obuspa
|
||||
config_get AgentEndpointID localagent EndpointID ""
|
||||
if [ -z "${AgentEndpointID}" ]; then
|
||||
serial=$(get_serial_from_db)
|
||||
oui=$(get_oui_from_db)
|
||||
AgentEndpointID="os::${oui}-${serial//+/%2B}"
|
||||
fi
|
||||
|
||||
config_get user testmqtt Username ""
|
||||
config_get pass testmqtt Password ""
|
||||
|
||||
# publish Agent's EndpointID in mosquito broker for discovery by usp-js
|
||||
# This is a work around till obuspa adds supports for mDNS discovery
|
||||
if [ -n "${user}" ] && [ -n "${pass}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username, password"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}" -P "${pass}"
|
||||
elif [ -n "${user}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username only"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}"
|
||||
else
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance usptest
|
||||
publish_endpoint
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
publish_endpoint
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "mosquitto" "obuspa"
|
||||
}
|
||||
59
obuspa/files/etc/uci-defaults/02-obuspa-dhcp-option
Normal file
59
obuspa/files/etc/uci-defaults/02-obuspa-dhcp-option
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
configure_dhcp_options() {
|
||||
local enabled inerface discovery
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get interface global interface "wan"
|
||||
config_get_bool discovery global dhcp_discovery 1
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${discovery}" -eq 1 ]; then
|
||||
network_uci_update=0
|
||||
reqopts="$(uci -q get network."${interface}".reqopts)"
|
||||
proto="$(uci -q get network."${interface}".proto)"
|
||||
local req125_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
sendopts="$(uci -q get network."${interface}".sendopts)"
|
||||
opt124="124:"
|
||||
send124_present=0
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt124"* ]]; then
|
||||
send124_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${interface}".reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send124_present} -eq 0 ]; then
|
||||
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
|
||||
uci -q set network."${interface}".sendopts="$newsendopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${network_uci_update} -eq 1 ]; then
|
||||
uci commit network
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_dhcp_options
|
||||
70
obuspa/files/etc/uci-defaults/55-test-usp-controller
Normal file
70
obuspa/files/etc/uci-defaults/55-test-usp-controller
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ ! -f "/etc/config/obuspa" ]; then
|
||||
echo "Local obuspa not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/config/mosquitto" ]; then
|
||||
echo "Local mosquitto broker not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
add_obuspa_test_mtp()
|
||||
{
|
||||
uci_add obuspa mtp test_mtp
|
||||
uci_set obuspa test_mtp Protocol 'MQTT'
|
||||
uci_set obuspa test_mtp ResponseTopicConfigured '/usp/endpoint'
|
||||
uci_set obuspa test_mtp mqtt 'testmqtt'
|
||||
}
|
||||
|
||||
add_obuspa_test_mqtt()
|
||||
{
|
||||
# Adds Device.MQTT.Client.
|
||||
uci_add obuspa mqtt testmqtt
|
||||
uci_set obuspa testmqtt BrokerAddress '127.0.0.1'
|
||||
uci_set obuspa testmqtt BrokerPort '1883'
|
||||
uci_set obuspa testmqtt TransportProtocol 'TCP/IP'
|
||||
}
|
||||
|
||||
add_obuspa_test_controller()
|
||||
{
|
||||
# Adds Device.LocalAgent.Controller.
|
||||
uci_add obuspa controller testcontroller
|
||||
uci_set obuspa testcontroller EndpointID 'proto::interop-usp-controller'
|
||||
uci_set obuspa testcontroller Protocol 'MQTT'
|
||||
uci_set obuspa testcontroller Topic '/usp/controller'
|
||||
uci_set obuspa testcontroller mqtt 'testmqtt'
|
||||
uci_set obuspa testcontroller assigned_role_name 'full_access'
|
||||
}
|
||||
|
||||
add_usp_test()
|
||||
{
|
||||
uci_add mosquitto listener usptest
|
||||
uci_set mosquitto usptest enabled 1
|
||||
uci_set mosquitto usptest port '9001'
|
||||
uci_set mosquitto usptest protocol 'websockets'
|
||||
uci_set mosquitto usptest require_certificates '0'
|
||||
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
add_obuspa_config()
|
||||
{
|
||||
uci_add mosquitto listener obuspa
|
||||
uci_set mosquitto obuspa enabled 1
|
||||
uci_set mosquitto obuspa port '1883'
|
||||
uci_set mosquitto obuspa no_remote_access '1'
|
||||
uci_set mosquitto obuspa allow_anonymous '1'
|
||||
}
|
||||
|
||||
# Install test usp controller config
|
||||
uci_load mosquitto
|
||||
add_usp_test
|
||||
add_obuspa_config
|
||||
|
||||
uci_load obuspa
|
||||
add_obuspa_test_mtp
|
||||
add_obuspa_test_mqtt
|
||||
add_obuspa_test_controller
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspc
|
||||
PKG_VERSION:=1.0.1.1
|
||||
PKG_VERSION:=1.0.1.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa-test-controller.git
|
||||
PKG_SOURCE_VERSION:=f1f721bc1a4feaf63c7f7837eb7b0c86111e2f71
|
||||
PKG_SOURCE_VERSION:=2ae29195817e75ada7c030a03662e72dbaae8e77
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -66,6 +66,7 @@ define Package/obuspc/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspc $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspc $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-fix-agent-endpoint $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/100-add-mosquitto-listener $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspc $(1)/etc/config/
|
||||
endef
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ config obuspc 'global'
|
||||
|
||||
config mqtt 'mqtt'
|
||||
option BrokerAddress '127.0.0.1'
|
||||
option BrokerPort '1883'
|
||||
option BrokerPort '9006'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
|
||||
config controller 'controller'
|
||||
option EndpointID 'proto::interop-usp-controller'
|
||||
option EndpointID 'proto::discovery-usp-controller'
|
||||
option Protocol 'MQTT'
|
||||
option ResponseTopicConfigured '/usp/controller'
|
||||
option ResponseTopicConfigured '/usp/discovery/controller'
|
||||
option mqtt 'mqtt'
|
||||
|
||||
config agent 'agent'
|
||||
|
||||
@@ -14,6 +14,7 @@ BASEPATH=""
|
||||
INSTANCE_COUNT=0
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
global_init()
|
||||
{
|
||||
@@ -78,6 +79,261 @@ get_refrence_path()
|
||||
echo "${path}"
|
||||
}
|
||||
|
||||
convert_to_hex() {
|
||||
local val=""
|
||||
local optval="${1}"
|
||||
OPTIND=1
|
||||
while getopts ":" opt "-$optval"
|
||||
do
|
||||
temp=$(printf "%02X" "'${OPTARG:-:}")
|
||||
val="${val}:${temp}"
|
||||
done
|
||||
|
||||
echo "${val}"
|
||||
}
|
||||
|
||||
check_for_suboptions() {
|
||||
new_opt=""
|
||||
# Check if option 25 and 29 present inside enterprise id 3561
|
||||
data=$(echo "${1}" | sed 's/://g')
|
||||
len=$(printf "${data}"|wc -c)
|
||||
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 8 ]; do
|
||||
subopt_present=0
|
||||
|
||||
ent_id="${data:0:8}"
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
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 ))
|
||||
|
||||
opt=${data:0:"${data_len}"}
|
||||
if [ -n "${new_opt}" ]; then
|
||||
new_opt="${new_opt}:$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
else
|
||||
new_opt="$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
fi
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
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 ))
|
||||
|
||||
len_val=${data:8:2}
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
if [ $opt_len -eq 0 ]; then
|
||||
echo "${new_opt}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
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")
|
||||
case "${sub_opt_id}" in
|
||||
"25") subopt_present=1
|
||||
;;
|
||||
"26") subopt_present=1
|
||||
;;
|
||||
"27") subopt_present=1
|
||||
;;
|
||||
"28") subopt_present=1
|
||||
;;
|
||||
"29") subopt_present=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $subopt_present -eq 1 ]; then
|
||||
break;
|
||||
fi
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
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}}
|
||||
done
|
||||
|
||||
if [ $subopt_present -eq 1 ]; then
|
||||
# move ahead data to next enterprise id
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
else
|
||||
opt=${data:0:"${data_len}"}
|
||||
if [ -n "${new_opt}" ]; then
|
||||
new_opt="${new_opt}:$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
else
|
||||
new_opt="$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
fi
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${new_opt}"
|
||||
}
|
||||
|
||||
configure_dnsmasq_op125() {
|
||||
intf="${1}"
|
||||
|
||||
endpoint=""
|
||||
proto=""
|
||||
address=""
|
||||
port=""
|
||||
topic=""
|
||||
prov_code="obusp-client"
|
||||
interval="5"
|
||||
multiplier="2000"
|
||||
|
||||
config_load ${CONFIGURATION}
|
||||
config_get endpoint controller EndpointID
|
||||
config_get proto controller Protocol
|
||||
if [ -z "${endpoint}" ] || [ -z "${proto}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${proto}" = "MQTT" ]; then
|
||||
config_get port mqtt BrokerPort "1883"
|
||||
config_get topic controller ResponseTopicConfigured
|
||||
proto="mqtt://"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
address=$(ifstatus "${intf}" | jsonfilter -q -e '@["ipv4-address"][0].address')
|
||||
if [ -z "${address}" ] || [ -z "${topic}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
subop_present=0
|
||||
opt125="125,"
|
||||
base_opt=""
|
||||
|
||||
service="$(uci -q get dhcp."${intf}".dhcpv4)"
|
||||
if [ "${service}" = "server" ]; then
|
||||
opt_list="$(uci -q get dhcp."${intf}".dhcp_option)"
|
||||
for sopt in $opt_list; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
base_opt=$(check_for_suboptions "${sopt:4}")
|
||||
uci -q del_list dhcp."${intf}".dhcp_option="$sopt"
|
||||
uci -q commit dhcp
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${base_opt}" ]; then
|
||||
opt125="125,00:00:0D:E9"
|
||||
else
|
||||
opt125="125,${base_opt}:00:00:0D:E9"
|
||||
fi
|
||||
|
||||
url="${proto}${address}:${port}${topic}"
|
||||
url_len=$(echo -n "${url}" | wc -m)
|
||||
prov_code_len=$(echo -n "${prov_code}" | wc -m)
|
||||
endpoint_len=$(echo -n "${endpoint}" | wc -m)
|
||||
interval_len=$(echo -n "${interval}" | wc -m)
|
||||
multiplier_len=$(echo -n "${multiplier}" | wc -m)
|
||||
|
||||
([ ${url_len} -gt 255 ] || [ ${prov_code_len} -gt 255 ] || [ ${endpoint_len} -gt 255 ]) && return 0
|
||||
([ ${interval_len} -gt 255 ] || [ ${multiplier_len} -gt 255 ]) && return 0
|
||||
|
||||
opt125_len=$((url_len + prov_code_len + endpoint_len + interval_len + multiplier_len))
|
||||
opt125_len=$((opt125_len + 10))
|
||||
|
||||
[ $opt125_len -gt 255 ] && return 0
|
||||
|
||||
hex_opt125_len=$(printf "%02X" "${opt125_len}")
|
||||
opt125="${opt125}:${hex_opt125_len}"
|
||||
hex_url=$(convert_to_hex "${url}")
|
||||
if [ -z "${hex_url}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_url_len=$(printf "%02X" "${url_len}")
|
||||
opt125="${opt125}:19:${hex_url_len}${hex_url}"
|
||||
|
||||
hex_prov_code=$(convert_to_hex "${prov_code}")
|
||||
if [ -z "${hex_prov_code}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_prov_len=$(printf "%02X" "${prov_code_len}")
|
||||
opt125="${opt125}:1A:${hex_prov_len}${hex_prov_code}"
|
||||
|
||||
hex_interval=$(convert_to_hex "${interval}")
|
||||
if [ -z "${hex_interval}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_interval_len=$(printf "%02X" "${interval_len}")
|
||||
opt125="${opt125}:1B:${hex_interval_len}${hex_interval}"
|
||||
|
||||
hex_multiplier=$(convert_to_hex "${multiplier}")
|
||||
if [ -z "${hex_multiplier}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_multiplier_len=$(printf "%02X" "${multiplier_len}")
|
||||
opt125="${opt125}:1C:${hex_multiplier_len}${hex_multiplier}"
|
||||
|
||||
hex_endpoint=$(convert_to_hex "${endpoint}")
|
||||
if [ -z "${hex_endpoint}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_endpoint_len=$(printf "%02X" "${endpoint_len}")
|
||||
opt125="${opt125}:1D:${hex_endpoint_len}${hex_endpoint}"
|
||||
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$opt125"
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
}
|
||||
|
||||
boot() {
|
||||
local enabled
|
||||
local interface
|
||||
|
||||
config_load ${CONFIGURATION}
|
||||
config_get_bool enabled global enabled 0
|
||||
config_get interface global interface "lan"
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
configure_dnsmasq_op125 "${interface}"
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
validate_global_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} obuspc "${1}" \
|
||||
@@ -344,6 +600,11 @@ stop_service() {
|
||||
${PROG} -c stop >/dev/null 2>&1
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "obuspc"
|
||||
}
|
||||
|
||||
13
obuspc/files/etc/uci-defaults/100-add-mosquitto-listener
Normal file
13
obuspc/files/etc/uci-defaults/100-add-mosquitto-listener
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
section_exist=$(uci -q get mosquitto.obuspc)
|
||||
if [ -z "${section_exist}" ]; then
|
||||
section=$(uci -q add mosquitto listener)
|
||||
uci -q rename mosquitto.$section="obuspc"
|
||||
fi
|
||||
|
||||
port=$(uci -q get obuspc.mqtt.BrokerPort)
|
||||
uci -q set mosquitto.obuspc.enabled="1"
|
||||
uci -q set mosquitto.obuspc.port=$port
|
||||
uci -q set mosquitto.obuspc.allow_anonymous="1"
|
||||
uci commit mosquitto
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.4.1
|
||||
PKG_VERSION:=1.5.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=415b7b59d7cd84cb133b20e27eca63a8cd74a155
|
||||
PKG_SOURCE_VERSION:=e68c87c5648182cc08e69c5fd368e8d178f24804
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -42,10 +42,9 @@ define Package/periodicstats/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/periodicstatsd $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/periodicstats
|
||||
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/etc/periodicstats
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,periodicstats))
|
||||
|
||||
@@ -3,14 +3,19 @@
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/periodicstatsd
|
||||
PROG="/usr/sbin/periodicstatsd"
|
||||
PERIODICSTATS_JSON_INPUT="/etc/periodicstats/input.json"
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
|
||||
config_load periodicstats
|
||||
config_get_bool enable globals enable 1
|
||||
|
||||
bbfdm_add_service "bbfdm.periodicstats" "${PERIODICSTATS_JSON_INPUT}"
|
||||
|
||||
if [ "${enable}" -ne "1" ]; then
|
||||
return 0;
|
||||
|
||||
15
periodicstats/files/etc/periodicstats/input.json
Executable file
15
periodicstats/files/etc/periodicstats/input.json
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/periodicstats/libperiodicstats.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.periodicstats",
|
||||
"parent_dm": "Device.",
|
||||
"object": "PeriodicStatistics",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,39 @@ set_serial_number() {
|
||||
/userfs/bin/omcicfgCmd set sn ${vendor_id}${vssn}
|
||||
}
|
||||
|
||||
set_equipment_id() {
|
||||
local eqid=$1
|
||||
local eq_id_default="KE2.119.241R2B"
|
||||
|
||||
if [ -z "$eqid" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$eqid" = "$eq_id_default" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
/userfs/bin/omcicfgCmd set equipmentId ${eqid}
|
||||
}
|
||||
|
||||
set_loid_authentication() {
|
||||
local loid=$1
|
||||
local loid_pwd=$2
|
||||
|
||||
[ -z "$loid" ] && return
|
||||
|
||||
/userfs/bin/omcicfgCmd set loid ${loid}
|
||||
|
||||
if [ -n "$loid_pwd" ]; then
|
||||
/userfs/bin/omcicfgCmd set loid_password ${loid_pwd}
|
||||
fi
|
||||
}
|
||||
|
||||
apply_xpon_uci_config() {
|
||||
configure_loid_authentication
|
||||
configure_equipment_id
|
||||
}
|
||||
|
||||
init_xpon() {
|
||||
# don't start pon daemons if xpon module is not loaded
|
||||
[ -d /sys/module/xpon ] || return
|
||||
|
||||
@@ -12,11 +12,35 @@ set_serial_number() {
|
||||
bs /b/c gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vssn}
|
||||
}
|
||||
|
||||
init_xpon() {
|
||||
procd_open_instance pon_msgd
|
||||
procd_set_param command bcm_msgd -c gpon
|
||||
procd_close_instance
|
||||
set_equipment_id() {
|
||||
equipment_id=$1
|
||||
[ -z "$equipment_id" ] && return
|
||||
|
||||
json_add_string "equipment_id" $equipment_id
|
||||
}
|
||||
|
||||
set_loid_authentication() {
|
||||
loid=$1
|
||||
loid_password=$2
|
||||
[ -z "$loid" ] && return
|
||||
|
||||
json_add_string "loid" $loid
|
||||
json_add_string "loid_password" $loid_password
|
||||
}
|
||||
|
||||
apply_xpon_uci_config() {
|
||||
|
||||
json_init
|
||||
json_add_object 'ani'
|
||||
sn="$(uci -q get xpon.ani.serial_number)"
|
||||
json_add_string "serial_number" $sn
|
||||
configure_loid_authentication
|
||||
configure_equipment_id
|
||||
json_close_object
|
||||
json_dump > /tmp/xpon.json
|
||||
}
|
||||
|
||||
init_xpon() {
|
||||
procd_open_instance pon_daemon
|
||||
procd_set_param command omcid start -n
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -27,6 +27,7 @@ configure_serial_number() {
|
||||
start_service() {
|
||||
if [ "$(uci -q get xpon.ani.enable)" == "1" ]; then
|
||||
configure_serial_number
|
||||
apply_xpon_uci_config
|
||||
init_xpon
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -14,6 +14,28 @@ configure_serial_number() {
|
||||
fi
|
||||
}
|
||||
|
||||
configure_loid_authentication() {
|
||||
local production_loid
|
||||
local production_loidpwd
|
||||
|
||||
loid="$(uci -q get xpon.ani.loid)"
|
||||
loidpwd="$(uci -q get xpon.ani.loid_password)"
|
||||
if [ -z $loid ]; then
|
||||
production_loid="$(fw_printenv -n gponloid)"
|
||||
fi
|
||||
if [ -z $loidpwd ]; then
|
||||
production_loidpwd="$(fw_printenv -n gponloid_password)"
|
||||
fi
|
||||
|
||||
if [ -n $production_loid ]; then
|
||||
uci set xpon.ani.loid=$production_loid
|
||||
fi
|
||||
if [ -n $production_loidpwd ]; then
|
||||
uci set xpon.ani.loid_password=$production_loidpwd
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/xpon" ]; then
|
||||
if uci -q get xpon.ani >/dev/null; then
|
||||
# generate serial number in case its not present and return
|
||||
@@ -21,6 +43,7 @@ if [ -s "/etc/config/xpon" ]; then
|
||||
if [ ${#serial_number} -ne 12 ]; then
|
||||
configure_serial_number
|
||||
fi
|
||||
configure_loid_authentication
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/xpon
|
||||
@@ -31,4 +54,5 @@ touch /etc/config/xpon
|
||||
uci set xpon.ani=ani
|
||||
uci set xpon.ani.enable="1"
|
||||
configure_serial_number
|
||||
configure_loid_authentication
|
||||
|
||||
|
||||
13
ponmngr/files/common/lib/xpon/get_uci_config.sh
Normal file
13
ponmngr/files/common/lib/xpon/get_uci_config.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
configure_equipment_id() {
|
||||
eqid="$(uci -q get xpon.ani.equipment_id)"
|
||||
set_equipment_id $eqid
|
||||
}
|
||||
|
||||
configure_loid_authentication() {
|
||||
loid="$(uci -q get xpon.ani.loid)"
|
||||
loid_pwd="$(uci -q get xpon.ani.loid_password)"
|
||||
set_loid_authentication $loid $loid_pwd
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"GPON",
|
||||
"G-PON",
|
||||
"XG-PON",
|
||||
"NG-PON2",
|
||||
"XGS-PON"
|
||||
@@ -858,7 +858,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"ModuleVendor": {
|
||||
"VendorName": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
@@ -871,11 +871,11 @@
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "json",
|
||||
"key": "ModuleVendor"
|
||||
"key": "VendorName"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ModuleName": {
|
||||
"VendorPartNumber": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
@@ -888,11 +888,11 @@
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "json",
|
||||
"key": "ModuleName"
|
||||
"key": "VendorPartNumber"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ModuleVersion": {
|
||||
"VendorRevision": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
@@ -905,24 +905,7 @@
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "json",
|
||||
"key": "ModuleVersion"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ModuleFirmwareVersion": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "json",
|
||||
"key": "ModuleFirmwareVersion"
|
||||
"key": "VendorRevision"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_VERSION:=1.0.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=2e6d5650cb30e5ae4cc47c1fb9d85b48c49e6100
|
||||
PKG_SOURCE_VERSION:=b20ead8c752f7ccba1532340de9a0864b6ae4ea8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/qos/qos.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
ethwan="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
cpu_model="$(cat /proc/socinfo | grep 'SoC Name' | cut -d':' -f2)"
|
||||
queue_num=8
|
||||
|
||||
populate_no_of_queue(){
|
||||
@@ -17,28 +18,13 @@ populate_no_of_queue(){
|
||||
}
|
||||
|
||||
generate_queue(){
|
||||
section="$1"
|
||||
local ifname="$1"
|
||||
local no_of_q="$2"
|
||||
|
||||
config_get ifname "$section" "ifname"
|
||||
|
||||
local is_lan=0
|
||||
queue_num=$(qosmngr -q $ifname)
|
||||
|
||||
if [ "$ifname" != "$ethwan" ]; then
|
||||
is_lan=1
|
||||
populate_no_of_queue $queue_num
|
||||
fi
|
||||
|
||||
local no_of_q="0 1 2 3 4 5 6 7"
|
||||
|
||||
if [ $is_lan -eq 1 ] && [ $queue_num -eq 4 ]; then
|
||||
no_of_q="0 1 2 3"
|
||||
fi
|
||||
|
||||
i=0
|
||||
local i=0
|
||||
local total_q=$((${no_of_q##* } + 1))
|
||||
for i in $no_of_q; do
|
||||
order=$((total_q - i))
|
||||
local order=$((total_q - i))
|
||||
uci add qos queue
|
||||
uci rename qos.@queue[-1]="q_${i}_${ifname}"
|
||||
uci set qos.@queue[-1].enable="1"
|
||||
@@ -53,8 +39,31 @@ generate_queue(){
|
||||
uci commit qos
|
||||
}
|
||||
|
||||
generate_wan_queues() {
|
||||
local ifname="$1"
|
||||
local no_of_q="0 1 2 3 4 5 6 7"
|
||||
|
||||
generate_queue "$ifname" "$no_of_q"
|
||||
}
|
||||
|
||||
generate_lan_queues() {
|
||||
local ifname="$1"
|
||||
local no_of_q="0 1 2 3 4 5 6 7"
|
||||
|
||||
queue_num=$(qosmngr -q $ifname)
|
||||
|
||||
populate_no_of_queue $queue_num
|
||||
|
||||
if [ $queue_num -eq 4 ]; then
|
||||
no_of_q="0 1 2 3"
|
||||
fi
|
||||
|
||||
generate_queue "$ifname" "$no_of_q"
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/qos" ]; then
|
||||
if uci -q get qos.@queue[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/qos
|
||||
@@ -62,7 +71,16 @@ if [ -s "/etc/config/qos" ]; then
|
||||
fi
|
||||
touch /etc/config/qos
|
||||
|
||||
# generate qos queue config
|
||||
config_load ports
|
||||
config_foreach generate_queue ethport
|
||||
lan_ports=""
|
||||
wan_port=""
|
||||
|
||||
json_init
|
||||
json_load_file /etc/board.json
|
||||
json_select network
|
||||
json_select lan
|
||||
json_for_each_item "generate_lan_queues" "ports"
|
||||
|
||||
json_select ..
|
||||
json_select wan
|
||||
json_get_var wan_port device
|
||||
generate_wan_queues "$wan_port"
|
||||
|
||||
@@ -389,7 +389,7 @@ handle_ebtables_rules() {
|
||||
}
|
||||
|
||||
create_ebtables_chains() {
|
||||
ebtables -t broute -N qos
|
||||
ebtables -t broute -N qos 2> /dev/null
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
ebtables -t broute -I BROUTING -j qos
|
||||
|
||||
@@ -208,27 +208,27 @@ handle_iptables_rules() {
|
||||
}
|
||||
|
||||
create_iptables_chains() {
|
||||
iptables -w -t mangle -N qos_forward
|
||||
iptables -w -t mangle -N qos_forward 2> /dev/null
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t mangle -I FORWARD -j qos_forward
|
||||
|
||||
iptables -w -t mangle -N qos_prerouting
|
||||
iptables -w -t mangle -N qos_prerouting 2> /dev/null
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t mangle -I PREROUTING -j qos_prerouting
|
||||
|
||||
iptables -w -t mangle -N qos_output
|
||||
iptables -w -t mangle -N qos_output 2> /dev/null
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t mangle -I OUTPUT -j qos_output
|
||||
|
||||
ip6tables -t mangle -N qos_forward
|
||||
ip6tables -t mangle -N qos_forward 2> /dev/null
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -t mangle -I FORWARD -j qos_forward
|
||||
|
||||
ip6tables -t mangle -N qos_prerouting
|
||||
ip6tables -t mangle -N qos_prerouting 2> /dev/null
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -t mangle -I PREROUTING -j qos_prerouting
|
||||
|
||||
ip6tables -t mangle -N qos_output
|
||||
ip6tables -t mangle -N qos_output 2> /dev/null
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -t mangle -I OUTPUT -j qos_output
|
||||
}
|
||||
|
||||
@@ -344,26 +344,26 @@ pre_configure_queue() {
|
||||
echo 0 > /tmp/qos/$intf/q_idx
|
||||
|
||||
tc qdisc del dev $intf root
|
||||
tc qdisc del dev $intf ingress
|
||||
tc qdisc del dev $intf ingress 2> /dev/null
|
||||
done
|
||||
}
|
||||
|
||||
get_link_rate() {
|
||||
intf="$1"
|
||||
speed=0
|
||||
config_load ports
|
||||
get_speed() {
|
||||
psid="$1"
|
||||
iname="$2"
|
||||
config_load ports
|
||||
config_get ifname "$psid" "ifname"
|
||||
if [ "$ifname" == "$iname" ]; then
|
||||
config_get speed "$psid" "speed"
|
||||
fi
|
||||
}
|
||||
config_foreach get_speed ethport $intf
|
||||
echo "$speed"
|
||||
}
|
||||
get_link_rate() {
|
||||
intf="$1"
|
||||
speed=1000
|
||||
|
||||
if [ -d "/sys/class/net/$intf/" ]; then
|
||||
speed=$(cat /sys/class/net/$intf/speed 2>/dev/null)
|
||||
[ -z "$speed" ] & speed=1000
|
||||
fi
|
||||
|
||||
if [ $speed -le 0 ]; then
|
||||
# assuming default 1000
|
||||
speed=1000
|
||||
fi
|
||||
|
||||
echo "$speed"
|
||||
}
|
||||
|
||||
configure_queue() {
|
||||
qdisc_idx=0
|
||||
@@ -454,6 +454,9 @@ configure_qos() {
|
||||
pre_configure_queue
|
||||
configure_queue
|
||||
configure_classify
|
||||
if [ -f "/tmp/qos/classify.ebtables" ]; then
|
||||
sh /tmp/qos/classify.ebtables
|
||||
fi
|
||||
configure_policer
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunc
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.2.0
|
||||
PKG_VERSION:=1.3.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/stunc.git
|
||||
PKG_SOURCE_VERSION:=b8231dc570ecc914b52d9e3f8fc9c009280d1791
|
||||
PKG_SOURCE_VERSION:=8bf66ef0fac9dcbc63cb2b98cbce787d23059cd1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -85,3 +85,19 @@ After adding the makefile, user need to specify the list of plugins in below con
|
||||
```bash
|
||||
CONFIG_SULU_EXTRA_PACKAGES="sulu-plugin1 sulu-plugin2 sulu-theme1"
|
||||
```
|
||||
|
||||
# SULU PWA (Progressive Web App)
|
||||
PWA applications generally used for well know secured sites, which can be installed directly from web-browser as desktop/mobile application.
|
||||
|
||||
> Note:
|
||||
> 1. It requires well defined SSL keys for deployment of PWA for a defined site.
|
||||
> 2. It should be used with sites with well defined FQDN
|
||||
|
||||
To enable SULU PWA application, user need to select PWA in sulu/sulu-builder config options and provide the path of the pwa key file
|
||||
|
||||
```bash
|
||||
CONFIG_SULU_PWA_APP=y
|
||||
CONFIG_SULU_PWA_KEYS_PATH="/somepath_with_pwa.{crt,key}"
|
||||
```
|
||||
|
||||
>Note: Replacing/changing the keys might requires uninstall/install of PWA App and CTRL+Shift+R in browser to drop the cached site and load the new site with new keys.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=2.2.5
|
||||
PKG_VERSION:=3.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=2964b4263ee25fe16a0a74e833e269889dc8375f
|
||||
PKG_SOURCE_VERSION:=dd0374b05be401707a76adab86cf9115811d03ed
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_MOD:=core
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=2.2.5
|
||||
PKG_VERSION:=3.0.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=046bb209b4650564cc07d288112f3eb367aabca2
|
||||
PKG_SOURCE_VERSION:=00c5c42d6106a1e0a288c22510fee1d2fd882c1d
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
|
||||
@@ -28,7 +28,8 @@ define Package/sulu/default
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=SULU
|
||||
TITLE:=SULU-CE
|
||||
DEPENDS:=+nginx +mosquitto-auth-shadow +usermngr +jq
|
||||
DEPENDS:=+mosquitto-auth-shadow +usermngr +jq
|
||||
EXTRA_DEPENDS:=nginx
|
||||
endef
|
||||
|
||||
define Package/sulu
|
||||
@@ -41,10 +42,10 @@ endef
|
||||
|
||||
define Package/sulu-builder
|
||||
$(Package/sulu/default)
|
||||
CONFLICTS:=sulu
|
||||
TITLE += (Builder)
|
||||
VARIANT:=builder
|
||||
DEPENDS+=+sulu-base $(foreach plugin,$(SULU_PLUGINS), +PACKAGE_$(plugin):$(plugin)) $(foreach plugin,$(SULU_EXTRA), +PACKAGE_$(plugin):$(plugin))
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/sulu/description
|
||||
@@ -55,16 +56,45 @@ define Package/sulu-builder/description
|
||||
SULU-CE ReactJS based Web UI builder.
|
||||
endef
|
||||
|
||||
define Package/sulu/config
|
||||
config SULU_PWA_APP
|
||||
depends on PACKAGE_sulu
|
||||
bool "Enable SULU PWA App support"
|
||||
default n
|
||||
help
|
||||
Enable SULU PWA (Progressive Web App) support, this requires
|
||||
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
|
||||
|
||||
config SULU_PWA_KEYS_PATH
|
||||
depends on PACKAGE_sulu
|
||||
string "Path of pwa.crt and pwa.key for sulu/PWA"
|
||||
help
|
||||
Provide directory path for the certficates for PWA,
|
||||
directory must contain 'pwa.crt' and 'pwa.key'.
|
||||
endef
|
||||
|
||||
define Package/sulu-builder/config
|
||||
menu "Configuration"
|
||||
depends on PACKAGE_sulu-builder
|
||||
|
||||
config SULU_EXTRA_PACKAGES
|
||||
depends on PACKAGE_sulu-builder
|
||||
string "Space separated list of sulu packages"
|
||||
help
|
||||
You can specify the list of non core sulu package,
|
||||
so that sulu-builder include them before building the core.
|
||||
endmenu
|
||||
|
||||
config SULU_PWA_APP
|
||||
depends on PACKAGE_sulu-builder
|
||||
bool "Enable SULU PWA App support"
|
||||
default n
|
||||
help
|
||||
Enable SULU PWA (Progressive Web App) support, this requires
|
||||
'pwa.crt' and 'pwa.key' to be installed in '/etc/sulu/' directory.
|
||||
|
||||
config SULU_PWA_KEYS_PATH
|
||||
depends on PACKAGE_sulu-builder
|
||||
string "Path of pwa.crt and pwa.key for sulu/PWA"
|
||||
help
|
||||
Provide directory path for the certficates for PWA,
|
||||
directory must contain 'pwa.crt' and 'pwa.key'.
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),builder)
|
||||
@@ -82,7 +112,7 @@ define Build/Clean
|
||||
endef
|
||||
|
||||
define Package/sulu/install/Default
|
||||
$(INSTALL_DIR) $(1)/sulu/config/widgets
|
||||
$(INSTALL_DIR) $(1)/sulu/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_BIN) ./files/etc/config/sulu $(1)/etc/config/sulu
|
||||
|
||||
@@ -99,24 +129,37 @@ define Package/sulu/install/Default
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/40-add-sulu-nginx-config $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-update-nginx-uci-template $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/10-add-mqtt-config $(1)/etc/uci-defaults/
|
||||
ifeq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-eval-set-sulu-pwa-keys $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.crt $(1)/etc/sulu/
|
||||
$(INSTALL_DATA) $(CONFIG_SULU_PWA_KEYS_PATH)/pwa.key $(1)/etc/sulu/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/sulu/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu
|
||||
ifneq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/nonPWA.html $(1)/sulu/index.html
|
||||
endif
|
||||
ifneq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(RM) $(1)/sulu/config/widgets/lcm-store.json
|
||||
$(RM) $(1)/sulu/presets/lcm-store.json
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
define Package/sulu-builder/install
|
||||
$(Package/sulu/install/Default)
|
||||
$(INSTALL_DIR) $(1)/sulu/presets
|
||||
$(INSTALL_DIR) $(1)/sulu/settings
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/* $(1)/sulu
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/*.json $(1)/sulu/config/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/wan.json $(1)/sulu/config/widgets/
|
||||
ifeq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/lcm-store.json $(1)/sulu/config/widgets/
|
||||
ifneq ($(CONFIG_SULU_PWA_APP),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/nonPWA.html $(1)/sulu/index.html
|
||||
endif
|
||||
$(CP) $(PKG_BUILD_DIR)/build/device/presets/*.json $(1)/sulu/presets/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/device/settings/*.json $(1)/sulu/settings/
|
||||
ifneq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(RM) $(1)/sulu/presets/lcm-store.json
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
@@ -53,6 +53,14 @@ function _get_sulu_root()
|
||||
echo "${root:-/sulu}"
|
||||
}
|
||||
|
||||
function _get_sulu_connection_config()
|
||||
{
|
||||
local config
|
||||
|
||||
config="$(_get_sulu_root)/presets/connection-config.json"
|
||||
echo "${config}"
|
||||
}
|
||||
|
||||
function _get_sulu_session_mode()
|
||||
{
|
||||
echo "$(uci -q get sulu.global.SessionMode)"
|
||||
@@ -104,15 +112,15 @@ function generate_sulu_conn_config()
|
||||
rbac="${1}"
|
||||
users="$(_get_sulu_users)"
|
||||
session="$(_get_sulu_session_mode)"
|
||||
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
|
||||
SCONFIG="$(_get_sulu_connection_config)"
|
||||
|
||||
json_init;
|
||||
if [ "${rbac}" -eq "1" ]; then
|
||||
json_add_string 'currentConnection' 'rbac';
|
||||
json_add_string 'Current-connection' 'rbac';
|
||||
else
|
||||
json_add_string 'currentConnection' 'main';
|
||||
json_add_string 'Current-connection' 'main';
|
||||
fi
|
||||
json_add_object 'connections';
|
||||
json_add_object 'Connections';
|
||||
json_add_object 'rbac';
|
||||
json_add_string 'toId' "$(_get_endpoint_id)";
|
||||
json_add_int 'port' "$(_get_sulu_tls_port)";
|
||||
@@ -158,15 +166,15 @@ function set_sulu_connection_mode()
|
||||
{
|
||||
local rbac profile config SCONFIG
|
||||
|
||||
SCONFIG="$(_get_sulu_root)/config/connectionConfig.json"
|
||||
SCONFIG="$(_get_sulu_connection_config)"
|
||||
rbac="${1}"
|
||||
|
||||
profile="$(jq '.currentConnection' ${SCONFIG})"
|
||||
profile="$(jq '."Current-connection"' ${SCONFIG})"
|
||||
if [ "$rbac" -eq "1" -a "${profile}" == "\"main\"" ]; then
|
||||
config="$(jq '.currentConnection = "rbac"' ${SCONFIG})"
|
||||
config="$(jq '."Current-connection" = "rbac"' ${SCONFIG})"
|
||||
echo "${config}" > ${SCONFIG}
|
||||
elif [ "$rbac" -eq "0" -a "${profile}" == "\"rbac\"" ]; then
|
||||
config="$(jq '.currentConnection = "main"' ${SCONFIG})"
|
||||
config="$(jq '."Current-connection" = "main"' ${SCONFIG})"
|
||||
echo "${config}" > ${SCONFIG}
|
||||
fi
|
||||
}
|
||||
@@ -175,12 +183,12 @@ function update_sulu_connection_port()
|
||||
{
|
||||
local port ws_port SCONF
|
||||
|
||||
SCONF="$(_get_sulu_root)/config/connectionConfig.json"
|
||||
SCONF="$(_get_sulu_connection_config)"
|
||||
ws_port="$(_get_sulu_tls_port)"
|
||||
|
||||
port="$(jq '.connections.rbac.port' ${SCONF})"
|
||||
port="$(jq '.Connections.rbac.port' ${SCONF})"
|
||||
if [ "${port}" -ne "${ws_port}" ]; then
|
||||
jq ".connections.main.port = ${ws_port} | .connections.rbac.port = ${ws_port}" ${SCONF} > /tmp/sulu/ss_port.json
|
||||
jq ".Connections.main.port = ${ws_port} | .Connections.rbac.port = ${ws_port}" ${SCONF} > /tmp/sulu/ss_port.json
|
||||
mv /tmp/sulu/ss_port.json ${SCONF}
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -9,15 +9,14 @@ add_sulu_nginx_uci()
|
||||
if ! uci_get nginx _sulu_s >/dev/null 2>&1; then
|
||||
uci_add nginx server _sulu_s
|
||||
uci_set nginx _sulu_s root '/sulu'
|
||||
uci_add_list nginx _sulu_s listen "8443 http2 ssl"
|
||||
uci_add_list nginx _sulu_s listen "[::]:8443 http2 ssl"
|
||||
uci_add_list nginx _sulu_s listen "8443 ssl default_server"
|
||||
uci_add_list nginx _sulu_s listen "[::]:8443 ssl default_server"
|
||||
uci_set nginx _sulu_s server_name '_sulu_s'
|
||||
uci_add_list nginx _sulu_s include '/etc/sulu/nginx.locations'
|
||||
uci_set nginx _sulu_s uci_manage_ssl 'self-signed'
|
||||
uci_set nginx _sulu_s ssl_certificate '/etc/nginx/conf.d/_lan.crt'
|
||||
uci_set nginx _sulu_s ssl_certificate_key '/etc/nginx/conf.d/_lan.key'
|
||||
uci_set nginx _sulu_s ssl_session_cache 'shared:SSL:32k'
|
||||
uci_set nginx _sulu_s ssl_session_timeout '64m'
|
||||
uci_set nginx _sulu_s ssl_session_cache 'none'
|
||||
uci_set nginx _sulu_s access_log 'off; # logd openwrt'
|
||||
uci_set nginx _sulu_s error_log '/dev/null'
|
||||
fi
|
||||
@@ -27,7 +26,7 @@ add_sulu_nginx_uci()
|
||||
uci_add_list nginx _suluredirect listen "8080"
|
||||
uci_add_list nginx _suluredirect listen "[::]:8080"
|
||||
uci_set nginx _suluredirect server_name '_suluredirect'
|
||||
uci_set nginx _suluredirect return 'https://$host:8443$request_uri'
|
||||
uci_set nginx _suluredirect return '302 https://$host:8443$request_uri'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_sulu_pwa_key()
|
||||
{
|
||||
if [ -f "/etc/sulu/pwa.crt" -a -f "/etc/sulu/pwa.key" ]; then
|
||||
uci_load nginx
|
||||
uci_set nginx _sulu_s ssl_certificate '/etc/sulu/pwa.crt'
|
||||
uci_set nginx _sulu_s ssl_certificate_key '/etc/sulu/pwa.key'
|
||||
fi
|
||||
}
|
||||
|
||||
set_sulu_pwa_key
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-lcm
|
||||
PKG_VERSION:=2.2.4
|
||||
PKG_VERSION:=3.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-lcm.git
|
||||
PKG_SOURCE_VERSION:=46975426ffa53ffcc3b0d9e9160f6b3d4b6d82fd
|
||||
PKG_SOURCE_VERSION:=ac2e418026a0570bec16a77186a948e18e49d4c7
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_PLUGIN_INSTALL:=1
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-multi-ap
|
||||
PKG_VERSION:=2.2.4
|
||||
PKG_VERSION:=3.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-multi-ap.git
|
||||
PKG_SOURCE_VERSION:=d77f19d8d964c9ecf8ab6d2cc3c8ddc369135d7e
|
||||
PKG_SOURCE_VERSION:=1db484dc54aa10e1a6623d1e79be68d6d8859ac3
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=sulu-parental-control
|
||||
PKG_VERSION:=2.2.3
|
||||
PKG_VERSION:=3.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-parental-control.git
|
||||
PKG_SOURCE_VERSION:=27f3859e30efbbed211c033f923f35974b3619fd
|
||||
PKG_SOURCE_VERSION:=b50857e88d14de9752bd081159a6c71e8ea03539
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-theme-iopsys
|
||||
PKG_VERSION:=2.0.0
|
||||
PKG_VERSION:=3.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-theme-iopsys.git
|
||||
PKG_SOURCE_VERSION:=e80fea80cdf8d49db0ae70b5c26a5dab49b8a20d
|
||||
PKG_SOURCE_VERSION:=a69b75e44d111d2a943563f96413a7363a0b4bca
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include ../sulu-builder/sulu.mk
|
||||
|
||||
126
swmodd/Config.in
126
swmodd/Config.in
@@ -1,53 +1,83 @@
|
||||
menu "Configuration"
|
||||
config SWMODD_REGISTRY_PULL_SUPPORT
|
||||
bool "Add support to pull images from container image registries (i.e: docker.io, quay.io)"
|
||||
depends on PACKAGE_swmodd
|
||||
default n
|
||||
select PACKAGE_skopeo
|
||||
select PACKAGE_umoci
|
||||
|
||||
config SWMODD_LXC_SUPPORT
|
||||
bool "Handles LXC based containers"
|
||||
default y
|
||||
config SWMODD_LXC_SUPPORT
|
||||
bool "Handles LXC based containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select PACKAGE_lxc
|
||||
select PACKAGE_lxc-attach
|
||||
select PACKAGE_lxc-auto
|
||||
select PACKAGE_lxc-cgroup
|
||||
select PACKAGE_lxc-checkconfig
|
||||
select PACKAGE_lxc-common
|
||||
select PACKAGE_lxc-config
|
||||
select PACKAGE_lxc-configs
|
||||
select PACKAGE_lxc-console
|
||||
select PACKAGE_lxc-create
|
||||
select PACKAGE_lxc-destroy
|
||||
select PACKAGE_lxc-execute
|
||||
select PACKAGE_lxc-freeze
|
||||
select PACKAGE_lxc-hooks
|
||||
select PACKAGE_lxc-info
|
||||
select PACKAGE_lxc-init
|
||||
select PACKAGE_lxc-ls
|
||||
select PACKAGE_lxc-device
|
||||
select PACKAGE_lxc-start
|
||||
select PACKAGE_lxc-stop
|
||||
select PACKAGE_lxc-templates
|
||||
select PACKAGE_lxc-top
|
||||
select PACKAGE_lxc-unfreeze
|
||||
select PACKAGE_lxc-unprivileged
|
||||
select PACKAGE_lxc-unshare
|
||||
select PACKAGE_lxc-user-nic
|
||||
select PACKAGE_lxc-usernsexec
|
||||
select PACKAGE_lxc-wait
|
||||
|
||||
config SWMODD_OCI_SUPPORT
|
||||
bool "Handles OCI containers"
|
||||
default y
|
||||
depends on PACKAGE_swmodd
|
||||
select PACKAGE_crun
|
||||
config SWMODD_OCI_SUPPORT
|
||||
bool "Handles OCI containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select PACKAGE_crun
|
||||
|
||||
config SWMODD_REGISTRY_PULL_SUPPORT
|
||||
bool "Add support to pull images from container image registries (i.e: docker.io, quay.io)"
|
||||
default n
|
||||
depends on PACKAGE_swmodd
|
||||
select PACKAGE_skopeo
|
||||
select PACKAGE_umoci
|
||||
config SWMODD_KERNEL_OPTIONS
|
||||
bool "Enable kernel support for LXC and OCI containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select LXC_KERNEL_OPTIONS
|
||||
select LXC_BUSYBOX_OPTIONS
|
||||
select LXC_SECCOMP
|
||||
select LXC_NETWORKING
|
||||
select KERNEL_CGROUPS
|
||||
select KERNEL_CGROUP_SCHED
|
||||
select KERNEL_CGROUP_DEVICE
|
||||
select KERNEL_CGROUP_FREEZER
|
||||
select KERNEL_CGROUP_CPUACCT
|
||||
select KERNEL_CGROUP_NET_PRIO
|
||||
select KERNEL_NET_CLS_CGROUP
|
||||
select KERNEL_NAMESPACES
|
||||
select KERNEL_DEVPTS_MULTIPLE_INSTANCES
|
||||
select KERNEL_POSIX_MQUEUE
|
||||
select KERNEL_FAIR_GROUP_SCHED
|
||||
select KERNEL_RT_GROUP_SCHED
|
||||
select KERNEL_MEMCG
|
||||
select KERNEL_MEMCG_KMEM
|
||||
select KERNEL_CPUSETS
|
||||
select PACKAGE_kmod-ikconfig
|
||||
help
|
||||
Select needed kernel options for LXC and CRUN related utilities. Options
|
||||
include cgroups, namespaces and other miscellaneous options. These
|
||||
options unfortunately can not be installed as a module.
|
||||
|
||||
config SWMODD_KERNEL_OPTIONS
|
||||
bool "Enable kernel support for LXC and OCI containers"
|
||||
default y
|
||||
select KERNEL_CGROUPS
|
||||
select KERNEL_CGROUP_SCHED
|
||||
select KERNEL_CGROUP_DEVICE
|
||||
select KERNEL_CGROUP_FREEZER
|
||||
select KERNEL_CGROUP_CPUACCT
|
||||
select KERNEL_CGROUP_NET_PRIO
|
||||
select KERNEL_NET_CLS_CGROUP
|
||||
select KERNEL_NAMESPACES
|
||||
select KERNEL_DEVPTS_MULTIPLE_INSTANCES
|
||||
select KERNEL_POSIX_MQUEUE
|
||||
select KERNEL_FAIR_GROUP_SCHED
|
||||
select KERNEL_RT_GROUP_SCHED
|
||||
select KERNEL_MEMCG
|
||||
select KERNEL_MEMCG_KMEM
|
||||
select KERNEL_CPUSETS
|
||||
select PACKAGE_kmod-ikconfig
|
||||
help
|
||||
Select needed kernel options for LXC and CRUN related utilities. Options
|
||||
include cgroups, namespaces and other miscellaneous options. These
|
||||
options unfortunately can not be installed as a module.
|
||||
|
||||
config SWMODD_NETWORKING
|
||||
bool "Enable networking support for LXC/OCI containers"
|
||||
default y
|
||||
select PACKAGE_kmod-veth
|
||||
select PACKAGE_kmod-macvlan
|
||||
help
|
||||
Enable "veth pair device" and "macvlan"
|
||||
|
||||
endmenu
|
||||
config SWMODD_NETWORKING
|
||||
bool "Enable networking support for LXC/OCI containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select PACKAGE_kmod-veth
|
||||
select PACKAGE_kmod-macvlan
|
||||
help
|
||||
Enable "veth pair device" and "macvlan"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.2.4
|
||||
PKG_VERSION:=2.3.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=25cbdf268e803eeed4f840419825512724df055d
|
||||
PKG_SOURCE_VERSION:=f73adba35daa8e24b7f28dc73eb58f53761a0d3b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,8 +28,9 @@ define Package/swmodd
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:= Software Modules Daemon
|
||||
MENU:=1
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
|
||||
+PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
|
||||
+PACKAGE_lxc:lxc +PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
|
||||
+@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT +@BUSYBOX_CONFIG_SCRIPT \
|
||||
+swmodd-cgroup +jq +libbbfdm-api
|
||||
endef
|
||||
@@ -54,12 +55,12 @@ TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_crun),y)
|
||||
ifeq ($(CONFIG_SWMODD_OCI_SUPPORT),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_CRUN="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
ifeq ($(CONFIG_SWMODD_LXC_SUPPORT),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_LXC="yes"
|
||||
endif
|
||||
@@ -76,23 +77,24 @@ define Package/swmodd/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/share/swmodd/
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/init.d/swmodd $(1)/etc/init.d/swmodd
|
||||
$(INSTALL_BIN) ./files/etc/config/swmodd $(1)/etc/config/swmodd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/swmodd $(1)/usr/sbin/swmodd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libswmodd.so $(1)/usr/lib/bbfdm/libswmodd.so
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/opkg_offline.sh $(1)/usr/share/swmodd/opkg_offline
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-bundle-path $(1)/etc/uci-defaults/01-fix-bundle-path
|
||||
ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/lxc/templates/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/templates/lxc-iopsys $(1)/usr/share/lxc/templates/lxc-iopsys
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/02-migrate-lxc $(1)/etc/uci-defaults/02-migrate-lxc
|
||||
endif
|
||||
ifeq ($(CONFIG_PACKAGE_crun),y)
|
||||
$(INSTALL_DIR) $(1)/etc/swmodd
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/swmodd/run.sh $(1)/etc/swmodd/run.sh
|
||||
$(INSTALL_BIN) ./files/etc/init.d/crun $(1)/etc/init.d/crun
|
||||
$(INSTALL_BIN) ./files/etc/config/crun $(1)/etc/config/crun
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/crun_create $(1)/usr/sbin/crun_create
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-bundle-path $(1)/etc/uci-defaults/01-fix-bundle-path
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
@@ -6,6 +6,11 @@ STOP=01
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/swmodd
|
||||
|
||||
log()
|
||||
{
|
||||
logger -t swmodd.init "$*"
|
||||
}
|
||||
|
||||
validate_globals_section()
|
||||
{
|
||||
uci_validate_section swmodd swmodd "globals" \
|
||||
@@ -70,9 +75,15 @@ start_service() {
|
||||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
# Create the bundle paths if not present
|
||||
[ -n "${lxc_bundle_root}" ] && mkdir -p "${lxc_bundle_root}"
|
||||
[ -n "${oci_bundle_root}" ] && mkdir -p "${oci_bundle_root}"
|
||||
if [ ! -d "${lxc_bundle_root}" ]; then
|
||||
log "# Not staring lxc [${lxc_bundle_root}] not present/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "${oci_bundle_root}" ]; then
|
||||
log "# Not staring oci [${oci_bundle_root}] not present/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_open_instance swmodd
|
||||
procd_set_param command ${PROG}
|
||||
|
||||
@@ -21,23 +21,18 @@ if [ -n "${lxc_bundle}" ]; then
|
||||
elif [ -n "${lxc}" ]; then
|
||||
# if lxc_bundle_root not define in swmodd, update it with lxc path
|
||||
uci_set swmodd globals lxc_bundle_root ${lxc}
|
||||
uci_commit
|
||||
else
|
||||
mkdir -p /etc/lxc
|
||||
echo "lxc.lxcpath = /srv/" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals lxc_bundle_root "/srv/"
|
||||
uci_commit
|
||||
fi
|
||||
|
||||
if [ -z "${oci_bundle}" ] && [ -n "${lxc_bundle}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc_bundle_root if defined
|
||||
uci_set swmodd globals oci_bundle_root ${lxc_bundle}
|
||||
uci_commit
|
||||
elif [ -z "${oci_bundle}" ] && [ -n "${lxc}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc path
|
||||
uci_set swmodd globals oci_bundle_root ${lxc}
|
||||
uci_commit
|
||||
elif [ -z "${oci_bundle}" ]; then
|
||||
uci_set swmodd globals oci_bundle_root "/srv/"
|
||||
uci_commit
|
||||
fi
|
||||
|
||||
47
swmodd/files/etc/uci-defaults/02-migrate-lxc
Normal file
47
swmodd/files/etc/uci-defaults/02-migrate-lxc
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_change=0
|
||||
|
||||
migrate_lxc() {
|
||||
config_get name "${1}" name ""
|
||||
|
||||
if [ -z "${name}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Now lets check if already present in lxccontainer
|
||||
exist=$(uci -q -c "${2}" show lxccontainer | grep ".name='$name'")
|
||||
if [ -z "${exist}" ]; then
|
||||
# Not present, need to migrate
|
||||
sec=$(uci -q -c "${2}" add lxccontainer container)
|
||||
if [ -n "${sec}" ]; then
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".name="${name}"
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".type='lxc'
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".autostart='1'
|
||||
uci -q -c "${2}" set lxccontainer."${sec}".timeout='300'
|
||||
config_change=1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
config_load swmodd
|
||||
config_get lxc_bundle globals lxc_bundle_root ""
|
||||
|
||||
if [ -z "${lxc_bundle}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -d "${lxc_bundle}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
touch "${lxc_bundle}"/lxccontainer
|
||||
|
||||
config_load lxc-auto
|
||||
config_foreach migrate_lxc container "${lxc_bundle}"
|
||||
|
||||
if [ $config_change -eq 1 ]; then
|
||||
uci -q -c "${lxc_bundle}" commit lxccontainer
|
||||
fi
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user