mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-26 03:53:58 +08:00
Compare commits
127 Commits
fe_de1
...
emctrl_exa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8eee85a7c7 | ||
|
|
7d7c89d24f | ||
|
|
07701b459b | ||
|
|
6c6d1eae5f | ||
|
|
58a91d6a7d | ||
|
|
b033b53958 | ||
|
|
f5df102fd9 | ||
|
|
d1f16dc432 | ||
|
|
0884ecd15e | ||
|
|
787570e7c7 | ||
|
|
33387c8e40 | ||
|
|
1b63c05762 | ||
|
|
c816ee7358 | ||
|
|
71c92846d2 | ||
|
|
fdf005fd8f | ||
|
|
ddac1730e6 | ||
|
|
c5e76fe6d4 | ||
|
|
eb7df8993c | ||
|
|
0c0e09fb2d | ||
|
|
834921f50b | ||
|
|
f161417d64 | ||
|
|
98689253d0 | ||
|
|
2be2045403 | ||
|
|
332793e0a8 | ||
|
|
736f77087e | ||
|
|
274d25094d | ||
|
|
636249c142 | ||
|
|
7bf598573b | ||
|
|
09588fe45e | ||
|
|
3f95d1f3f1 | ||
|
|
87425e5db9 | ||
|
|
a7f1342ad7 | ||
|
|
680c4b8f2a | ||
|
|
c897647054 | ||
|
|
d4715fd1ad | ||
|
|
8c2a7cfeac | ||
|
|
b898b5761b | ||
|
|
c298b611d2 | ||
|
|
b43fd6a3c0 | ||
|
|
53fc9f5782 | ||
|
|
7e975f95b5 | ||
|
|
3ee64793cc | ||
|
|
45bb27cff4 | ||
|
|
b15d45731e | ||
|
|
f043b4e0d9 | ||
|
|
328bc26684 | ||
|
|
7a06a9e479 | ||
|
|
77f50aaa16 | ||
|
|
ca646f8243 | ||
|
|
b7efd787cb | ||
|
|
91e9278cba | ||
|
|
1b1598273d | ||
|
|
272b7fce34 | ||
|
|
72f0044f1a | ||
|
|
a22a2c4386 | ||
|
|
a7a3352bca | ||
|
|
38e12b5b95 | ||
|
|
10f3015d32 | ||
|
|
3e14637e3d | ||
|
|
a03c7f0681 | ||
|
|
2053e3281f | ||
|
|
625fd2a488 | ||
|
|
99178dacd1 | ||
|
|
947fe9ef99 | ||
|
|
d99da1039b | ||
|
|
94e507b607 | ||
|
|
eb7fe9572d | ||
|
|
4f9dae3d0e | ||
|
|
dc650533f4 | ||
|
|
6521b012b3 | ||
|
|
c75fb703d2 | ||
|
|
ab250abfdb | ||
|
|
37111f2233 | ||
|
|
c4fa5713a2 | ||
|
|
657b2c7b65 | ||
|
|
b702ff6564 | ||
|
|
fb1dc90367 | ||
|
|
e57b39b430 | ||
|
|
cc0e87a0cd | ||
|
|
dd5bc10c72 | ||
|
|
092c7d139b | ||
|
|
137114d62a | ||
|
|
01f88ce2a8 | ||
|
|
243aba8c51 | ||
|
|
5211e526ec | ||
|
|
c5483f81db | ||
|
|
d8f4afdca5 | ||
|
|
6ef90dcd9d | ||
|
|
9eb14ac309 | ||
|
|
949b5db030 | ||
|
|
f42c062c08 | ||
|
|
42e23d0162 | ||
|
|
8794818492 | ||
|
|
412c88fb33 | ||
|
|
855d29af0c | ||
|
|
f9757c7f7a | ||
|
|
74eea33f1d | ||
|
|
0e9146a5c5 | ||
|
|
895c05669b | ||
|
|
7cd7719f9b | ||
|
|
c76e6142c2 | ||
|
|
dc63e6da74 | ||
|
|
affb07b513 | ||
|
|
4ea324f493 | ||
|
|
156acb308d | ||
|
|
e9237858b1 | ||
|
|
42cf056d57 | ||
|
|
a16bde6dae | ||
|
|
8b24b648c7 | ||
|
|
df9f5f97af | ||
|
|
8766ee44d6 | ||
|
|
1ab0c5b13d | ||
|
|
90dfcd0ad3 | ||
|
|
72e4b4f0cb | ||
|
|
633519ac3a | ||
|
|
7b4db3d325 | ||
|
|
305dd1d6a2 | ||
|
|
5a4eb4d297 | ||
|
|
8f81c1c4c3 | ||
|
|
5d6ae3fc2d | ||
|
|
faf133212e | ||
|
|
3c170edee3 | ||
|
|
736885c999 | ||
|
|
b9d8faff99 | ||
|
|
74fec650f6 | ||
|
|
c24ffb6b7c | ||
|
|
280c4e2592 |
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.9.3
|
||||
PKG_VERSION:=1.10.0
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=4e80fa7c00539753578617765739af9aa4d0d237
|
||||
PKG_SOURCE_VERSION:=75195a112e3aef2b07e224afbbffcb15368be58f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -100,35 +100,37 @@ endif
|
||||
define Package/libbbfdm-api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.secure $(1)/usr/libexec/rpcd/bbf.secure
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts/
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_api $(1)/usr/share/bbfdm/scripts/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/certificates
|
||||
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/usr/share/bbfdm/libbbfdm.so
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/97-firewall-service
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-link-core-plugins $(1)/etc/uci-defaults/99-link-core-plugins
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-remove-nonexisting-microservices $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
$(INSTALL_BIN) ./files/etc/firewall.service $(1)/etc/firewall.service
|
||||
|
||||
ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so $(1)
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm/scripts/
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_activate_handler.sh $(1)/usr/share/bbfdm/scripts/
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_check_idle.sh $(1)/usr/share/bbfdm/scripts/
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
remove_nonexisting_microservice() {
|
||||
local input_json
|
||||
|
||||
config_get input_json "$1" input_json ""
|
||||
|
||||
if [ -z "${input_json}" ]; then
|
||||
uci_remove bbfdm "${1}"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load bbfdm
|
||||
config_foreach remove_nonexisting_microservice "micro_service"
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
UNIFIED_PATH="/usr/share/bbfdm/plugins/"
|
||||
|
||||
log() {
|
||||
echo "$@" | logger -t bbfdm.uci-default -p info
|
||||
}
|
||||
|
||||
# Link JSON plugins
|
||||
for f in `ls -1 /etc/bbfdm/json/*.json`; do
|
||||
log "# BBFDM JSON plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link DotSo plugins
|
||||
for f in `ls -1 /usr/lib/bbfdm/*.so`; do
|
||||
log "# BBFDM DotSO plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link JSON plugins
|
||||
for f in `ls -1 /etc/bbfdm/plugins/*.json`; do
|
||||
log "# BBFDM JSON plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link DotSo plugins
|
||||
for f in `ls -1 /etc/bbfdm/plugins/*.so`; do
|
||||
log "# BBFDM DotSO plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.10
|
||||
PKG_VERSION:=2.1.11
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=e472e90feec31d9f318ea8c732ab564002e25db1
|
||||
PKG_SOURCE_VERSION:=5dd9cd3cfc95e9dce5f64fe9cadd274bb31b8fa6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -12,12 +12,21 @@ start_service() {
|
||||
config_load bulkdata
|
||||
config_get_bool enable bulkdata enable 1
|
||||
|
||||
[ "$enable" -eq "1" ] && {
|
||||
if [ ! -f "/var/state/bulkdatad" ]; then
|
||||
touch /var/state/bulkdatad
|
||||
uci -q -c /var/state set bulkdatad.global='global'
|
||||
uci -q -c /var/state commit bulkdatad
|
||||
fi
|
||||
|
||||
if [ "$enable" -eq "1" ]; then
|
||||
procd_open_instance "bulkdata"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bulkdata"
|
||||
}
|
||||
else
|
||||
uci -q -c /var/state set bulkdatad.global.status='Disabled'
|
||||
uci -q -c /var/state commit bulkdatad
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=6.0.0.11
|
||||
PKG_VERSION:=6.0.0.13
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7d268e33bbd78bfcf94bf6d8c92c484da22a7bee
|
||||
PKG_SOURCE_VERSION:=d75639d9ae82538103123b32fc0de9280e84cabb
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.6.6
|
||||
PKG_VERSION:=3.6.7
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=85c173d1fac535726b2e750be8c282b74fb7dbca
|
||||
PKG_SOURCE_VERSION:=98999eb75755f79a3c8a7e802e024b42914d1efc
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmngr
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.0.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
|
||||
PKG_SOURCE_VERSION:=03d8d79c1221adb92b5789c03e2489d26c6ae184
|
||||
PKG_SOURCE_VERSION:=f6223f6034a57753ae9d1552ab1334194b1deaff
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_VERSION:=1.2.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/dslmngr.git
|
||||
PKG_SOURCE_VERSION:=4a6f6f829006e481eeb20bcb121f7938d12c60ec
|
||||
PKG_SOURCE_VERSION:=2b1ecbd2079dbd88ed6d58b277b91dcf5038d869
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-qos
|
||||
PKG_VERSION:=1.1
|
||||
PKG_RELEASE:=0
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
DEPENDS:=@(TARGET_brcmbca||TARGET_airoha)
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
This package contains Easy QoS utility
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/easy-qos/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,easy-qos))
|
||||
@@ -1 +0,0 @@
|
||||
/etc/init.d/easy_qos reload
|
||||
@@ -1,140 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos.ebtable -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(ebtables --concurrent -t broute -L BROUTING|grep -m 1 mark)
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log ebtables --concurrent -t broute -D BROUTING ${rule}
|
||||
rule=$(ebtables --concurrent -t broute -L BROUTING|grep -m 1 mark)
|
||||
done
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local protocol=$1; shift
|
||||
local mac=$1; shift
|
||||
local mark="0x$1"; shift
|
||||
local forward_port=$1;
|
||||
local cmd="";
|
||||
local protocol_number
|
||||
|
||||
cmd="-j mark --mark-or ${mark}";
|
||||
if [ -n "${forward_port}" ]; then
|
||||
cmd="--ip-destination-port ${forward_port} ${cmd}";
|
||||
fi
|
||||
|
||||
case "${protocol}" in
|
||||
"tcp")
|
||||
protocol_number=6;;
|
||||
"udp")
|
||||
protocol_number=17;;
|
||||
"dccp")
|
||||
protocol_number=33;;
|
||||
"sctp")
|
||||
protocol_number=132;;
|
||||
*)
|
||||
log "Protocol ${protocol} not supported in ebtables"
|
||||
return;;
|
||||
esac
|
||||
|
||||
cmd="--ip-proto ${protocol_number} $cmd"
|
||||
cmd="-p ip $cmd"
|
||||
|
||||
cmd="-s ${mac} $cmd"
|
||||
exec_log ebtables --concurrent -t broute -A BROUTING ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num protocol
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
protocol=$(echo ${proto}|tr 'A-Z' 'a-z')
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${p}
|
||||
create_rule udp ${macaddr} ${prio_num} ${p}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
|
||||
fi
|
||||
done
|
||||
# Create rule for all ports if port is not mentioned in uci
|
||||
if [ -z "${port}" ]; then
|
||||
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num}
|
||||
create_rule udp ${macaddr} ${prio_num}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Do not apply rules if ebtables is not present in system
|
||||
[ -x /usr/sbin/ebtables ] || return;
|
||||
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
CLIENT_LIST="/tmp/easy_qos_client.list"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
"low")
|
||||
echo 1;;
|
||||
"besteffort")
|
||||
echo 2;;
|
||||
"normal")
|
||||
echo 3;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 5;;
|
||||
"high")
|
||||
echo 6;;
|
||||
"highest")
|
||||
echo 7;;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
# json_add_array "clients"
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
done
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark="0x$1/0x$1"; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j MARK --set-xmark ${mark}";
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num ip port_list
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
|
||||
if [ -n "${ip}" -a -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
|
||||
create_rule tcp ${ip} ${prio_num} ${port_list}
|
||||
create_rule udp ${ip} ${prio_num} ${port_list}
|
||||
else
|
||||
create_rule ${proto} ${ip} ${prio_num} ${port_list}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
clear_existing_rules
|
||||
map_client_entries
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
reload_service
|
||||
echo "Easy QoS installed">/dev/console;
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos"
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# Add firewall include
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.easyqos
|
||||
set firewall.easyqos=include
|
||||
set firewall.easyqos.path=/etc/firewall.easyqos
|
||||
set firewall.easyqos.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ebtables-extensions
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a23a70f5518a42d663156a156c1e3356f695b5ad
|
||||
PKG_SOURCE_VERSION:=35fb79f95c47d90e3791c7e126048b451f078f24
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ebtables-extensions.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
29
emctrl2/Makefile
Normal file
29
emctrl2/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=emctrl2
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/emctrl2
|
||||
CATEGORY:=Utilities
|
||||
TITLE:= EasyMesh Controller V2
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/emctrl2/description
|
||||
Em Controller to provide extended WiFi DataElement features
|
||||
endef
|
||||
|
||||
define Package/emctrl2/install
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/libemctrl2.so $(1) wifidmd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,emctrl2))
|
||||
21
emctrl2/src/Makefile
Normal file
21
emctrl2/src/Makefile
Normal file
@@ -0,0 +1,21 @@
|
||||
LIBOUT := libemctrl2.so
|
||||
|
||||
LIBOBJS := datamodel_override.o
|
||||
|
||||
PROG_CFLAGS = $(CFLAGS) -Wno-unused-parameter -fstrict-aliasing -g
|
||||
LIB_LDFLAGS = $(LDFLAGS)
|
||||
|
||||
FPIC := -fPIC
|
||||
|
||||
.PHONY: all
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(PROG_CFLAGS) $(FPIC) -c -o $@ $<
|
||||
|
||||
all: $(LIBOUT)
|
||||
|
||||
$(LIBOUT): $(LIBOBJS)
|
||||
$(CC) $(PROG_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f *.o $(LIBOUT)
|
||||
546
emctrl2/src/datamodel_override.c
Normal file
546
emctrl2/src/datamodel_override.c
Normal file
@@ -0,0 +1,546 @@
|
||||
/*
|
||||
* Copyright (C) 2023 iopsys Software Solutions AB
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 2.1
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* Author: <Name> <Surname> <name.surname@iopsys.eu>
|
||||
*/
|
||||
|
||||
#include <libbbfdm-api/dmcommon.h>
|
||||
|
||||
|
||||
/*************************************************************
|
||||
* ENTRY METHOD
|
||||
**************************************************************/
|
||||
static int browseWiFiDataElementsNetworkSSIDInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
//TODO
|
||||
struct dm_data *curr_data = NULL;
|
||||
char *inst = NULL, *mld_id = NULL;
|
||||
|
||||
// loop to create multiple multi-instance objects
|
||||
for(int i=0; i<=1; i++) {
|
||||
char inst[3] = {0};
|
||||
|
||||
// inst is instance number for the object
|
||||
snprintf(inst, sizeof(inst), "%d", i+1);
|
||||
// This API creates instance, curr_data is to pass some instance specific information to child object, children can access this info from *prev_data
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)curr_data, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int browseWiFiDataElementsNetworkDeviceDefault8021QInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
//TODO
|
||||
BBF_ERR("Debug print");
|
||||
// Instances can be created statically as well
|
||||
DM_LINK_INST_OBJ(dmctx, parent_node, prev_data, "1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int browseWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistoryInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
//TODO
|
||||
BBF_ERR("Debug print");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* ADD & DEL OBJ
|
||||
**************************************************************/
|
||||
static int addObjWiFiDataElementsNetworkDeviceDefault8021Q(char *refparam, struct dmctx *ctx, void *data, char **instance)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int delObjWiFiDataElementsNetworkDeviceDefault8021Q(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* GET & SET PARAM
|
||||
**************************************************************/
|
||||
static int get_WiFiDataElementsNetwork_SSIDNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
int cnt = get_number_of_entries(ctx, data, instance, browseWiFiDataElementsNetworkSSIDInst);
|
||||
dmasprintf(value, "%d", cnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_SSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_Band(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_AKMsAllowed(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_SuiteSelector(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_AdvertisementEnabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_MFPConfig(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_MobilityDomain(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkSSID_HaulType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDevice_TrafficSeparationAllowed(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDevice_Default8021QNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
int cnt = get_number_of_entries(ctx, data, instance, browseWiFiDataElementsNetworkDeviceDefault8021QInst);
|
||||
dmasprintf(value, "%d", cnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceDefault8021Q_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_WiFiDataElementsNetworkDeviceDefault8021Q_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (bbfdm_validate_boolean(ctx, value))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
//TODO
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceDefault8021Q_PrimaryVID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_WiFiDataElementsNetworkDeviceDefault8021Q_PrimaryVID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (bbfdm_validate_unsignedInt(ctx, value, RANGE_ARGS{{NULL,"4095"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
//TODO
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceDefault8021Q_DefaultPCP(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_WiFiDataElementsNetworkDeviceDefault8021Q_DefaultPCP(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (bbfdm_validate_unsignedInt(ctx, value, RANGE_ARGS{{NULL,"7"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
//TODO
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_Time(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_APOrigin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_TriggerEvent(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_SteeringApproach(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_APDestination(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_SteeringDuration(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTA_SteeringHistoryNumberOfEntries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
int cnt = get_number_of_entries(ctx, data, instance, browseWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistoryInst);
|
||||
dmasprintf(value, "%d", cnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* OPERATE COMMANDS
|
||||
**************************************************************/
|
||||
static operation_args wifidataelementsnetwork_settrafficseparation_args = {
|
||||
.in = (const char *[]) {
|
||||
"Enable",
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int get_operate_args_WiFiDataElementsNetwork_SetTrafficSeparation(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)&wifidataelementsnetwork_settrafficseparation_args;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int operate_WiFiDataElementsNetwork_SetTrafficSeparation(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static operation_args wifidataelementsnetwork_setpreferredbackhauls_args = {
|
||||
.in = (const char *[]) {
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int get_operate_args_WiFiDataElementsNetwork_SetPreferredBackhauls(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)&wifidataelementsnetwork_setpreferredbackhauls_args;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int operate_WiFiDataElementsNetwork_SetPreferredBackhauls(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static operation_args wifidataelementsnetwork_setssid_args = {
|
||||
.in = (const char *[]) {
|
||||
"SSID",
|
||||
"Enable",
|
||||
"AddRemoveChange",
|
||||
"PassPhrase",
|
||||
"Band",
|
||||
"AKMsAllowed",
|
||||
"SuiteSelector",
|
||||
"AdvertisementEnabled",
|
||||
"MFPConfig",
|
||||
"MobilityDomain",
|
||||
"HaulType",
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int get_operate_args_WiFiDataElementsNetwork_SetSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)&wifidataelementsnetwork_setssid_args;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int operate_WiFiDataElementsNetwork_SetSSID(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static operation_args wifidataelementsnetwork_setmscsdisallowed_args = {
|
||||
.in = (const char *[]) {
|
||||
"MSCSDisallowedStaList",
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static operation_args wifidataelementsnetworkdevice_setstasteeringstate_args = {
|
||||
.in = (const char *[]) {
|
||||
"Disallowed",
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int get_operate_args_WiFiDataElementsNetworkDevice_SetSTASteeringState(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)&wifidataelementsnetworkdevice_setstasteeringstate_args;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int operate_WiFiDataElementsNetworkDevice_SetSTASteeringState(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static operation_args wifidataelementsnetworkdevicemultiapdevicebackhaul_steerwifibackhaul_args = {
|
||||
.in = (const char *[]) {
|
||||
"TargetBSS",
|
||||
"Channel",
|
||||
"TimeOut",
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int get_operate_args_WiFiDataElementsNetworkDeviceMultiAPDeviceBackhaul_SteerWiFiBackhaul(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)&wifidataelementsnetworkdevicemultiapdevicebackhaul_steerwifibackhaul_args;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int operate_WiFiDataElementsNetworkDeviceMultiAPDeviceBackhaul_SteerWiFiBackhaul(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static operation_args wifidataelementsnetworkdeviceradio_channelscanrequest_args = {
|
||||
.in = (const char *[]) {
|
||||
"OpClass",
|
||||
"ChannelList",
|
||||
"ScanType",
|
||||
"DwellTime",
|
||||
"DFSDwellTime",
|
||||
"HomeTime",
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int get_operate_args_WiFiDataElementsNetworkDeviceRadio_ChannelScanRequest(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)&wifidataelementsnetworkdeviceradio_channelscanrequest_args;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int operate_WiFiDataElementsNetworkDeviceRadio_ChannelScanRequest(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
static operation_args wifidataelementsnetworkdeviceradiobssstamultiapsta_btmrequest_args = {
|
||||
.in = (const char *[]) {
|
||||
"DisassociationImminent",
|
||||
"DisassociationTimer",
|
||||
"BSSTerminationDuration",
|
||||
"ValidityInterval",
|
||||
"SteeringTimer",
|
||||
"TargetBSS",
|
||||
NULL
|
||||
},
|
||||
.out = (const char *[]) {
|
||||
"Status",
|
||||
NULL
|
||||
}
|
||||
};
|
||||
|
||||
static int get_operate_args_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTA_BTMRequest(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = (char *)&wifidataelementsnetworkdeviceradiobssstamultiapsta_btmrequest_args;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int operate_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTA_BTMRequest(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
DMLEAF tWiFiDataElementsNetworkParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"SSIDNumberOfEntries", &DMREAD, DMT_UNINT, get_WiFiDataElementsNetwork_SSIDNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"SetTrafficSeparation()", &DMASYNC, DMT_COMMAND, get_operate_args_WiFiDataElementsNetwork_SetTrafficSeparation, operate_WiFiDataElementsNetwork_SetTrafficSeparation, BBFDM_USP},
|
||||
{"SetPreferredBackhauls()", &DMASYNC, DMT_COMMAND, get_operate_args_WiFiDataElementsNetwork_SetPreferredBackhauls, operate_WiFiDataElementsNetwork_SetPreferredBackhauls, BBFDM_USP},
|
||||
{"SetSSID()", &DMASYNC, DMT_COMMAND, get_operate_args_WiFiDataElementsNetwork_SetSSID, operate_WiFiDataElementsNetwork_SetSSID, BBFDM_USP},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.WiFi.DataElements.Network.SSID.{i}. *** */
|
||||
DMLEAF tWiFiDataElementsNetworkSSIDParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"SSID", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkSSID_SSID, NULL, BBFDM_BOTH},
|
||||
{"Band", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkSSID_Band, NULL, BBFDM_BOTH},
|
||||
{"Enable", &DMREAD, DMT_BOOL, get_WiFiDataElementsNetworkSSID_Enable, NULL, BBFDM_BOTH},
|
||||
{"AKMsAllowed", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkSSID_AKMsAllowed, NULL, BBFDM_BOTH},
|
||||
{"SuiteSelector", &DMREAD, DMT_HEXBIN, get_WiFiDataElementsNetworkSSID_SuiteSelector, NULL, BBFDM_BOTH},
|
||||
{"AdvertisementEnabled", &DMREAD, DMT_BOOL, get_WiFiDataElementsNetworkSSID_AdvertisementEnabled, NULL, BBFDM_BOTH},
|
||||
{"MFPConfig", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkSSID_MFPConfig, NULL, BBFDM_BOTH},
|
||||
{"MobilityDomain", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkSSID_MobilityDomain, NULL, BBFDM_BOTH},
|
||||
{"HaulType", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkSSID_HaulType, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.WiFi.DataElements.Network. *** */
|
||||
DMOBJ tWiFiDataElementsNetworkObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys */
|
||||
{"SSID", &DMREAD, NULL, NULL, NULL, browseWiFiDataElementsNetworkSSIDInst, NULL, NULL, NULL, tWiFiDataElementsNetworkSSIDParams, NULL, BBFDM_BOTH, NULL},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tWiFiDataElementsNetworkDeviceParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"TrafficSeparationAllowed", &DMREAD, DMT_BOOL, get_WiFiDataElementsNetworkDevice_TrafficSeparationAllowed, NULL, BBFDM_BOTH},
|
||||
{"SetSTASteeringState()", &DMASYNC, DMT_COMMAND, get_operate_args_WiFiDataElementsNetworkDevice_SetSTASteeringState, operate_WiFiDataElementsNetworkDevice_SetSTASteeringState, BBFDM_USP},
|
||||
{"Default8021QNumberOfEntries", &DMREAD, DMT_UNINT, get_WiFiDataElementsNetworkDevice_Default8021QNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.WiFi.DataElements.Network.Device.{i}.Default8021Q.{i}. *** */
|
||||
DMLEAF tWiFiDataElementsNetworkDeviceDefault8021QParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"Enable", &DMWRITE, DMT_BOOL, get_WiFiDataElementsNetworkDeviceDefault8021Q_Enable, set_WiFiDataElementsNetworkDeviceDefault8021Q_Enable, BBFDM_BOTH},
|
||||
{"PrimaryVID", &DMWRITE, DMT_UNINT, get_WiFiDataElementsNetworkDeviceDefault8021Q_PrimaryVID, set_WiFiDataElementsNetworkDeviceDefault8021Q_PrimaryVID, BBFDM_BOTH},
|
||||
{"DefaultPCP", &DMWRITE, DMT_UNINT, get_WiFiDataElementsNetworkDeviceDefault8021Q_DefaultPCP, set_WiFiDataElementsNetworkDeviceDefault8021Q_DefaultPCP, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMOBJ tWiFiDataElementsNetworkDeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/
|
||||
{"Default8021Q", &DMWRITE, addObjWiFiDataElementsNetworkDeviceDefault8021Q, delObjWiFiDataElementsNetworkDeviceDefault8021Q, NULL, browseWiFiDataElementsNetworkDeviceDefault8021QInst, NULL, NULL, NULL, tWiFiDataElementsNetworkDeviceDefault8021QParams, NULL, BBFDM_BOTH, NULL},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tWiFiDataElementsNetworkDeviceMultiAPDeviceBackhaulParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"SteerWiFiBackhaul()", &DMASYNC, DMT_COMMAND, get_operate_args_WiFiDataElementsNetworkDeviceMultiAPDeviceBackhaul_SteerWiFiBackhaul, operate_WiFiDataElementsNetworkDeviceMultiAPDeviceBackhaul_SteerWiFiBackhaul, BBFDM_USP},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
||||
DMLEAF tWiFiDataElementsNetworkDeviceRadioParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"ChannelScanRequest()", &DMASYNC, DMT_COMMAND, get_operate_args_WiFiDataElementsNetworkDeviceRadio_ChannelScanRequest, operate_WiFiDataElementsNetworkDeviceRadio_ChannelScanRequest, BBFDM_USP},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.WiFi.DataElements.Network.Device.{i}.Radio.{i}.BSS.{i}.STA.{i}.MultiAPSTA.SteeringHistory.{i}. *** */
|
||||
DMLEAF tWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistoryParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"Time", &DMREAD, DMT_TIME, get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_Time, NULL, BBFDM_BOTH},
|
||||
{"APOrigin", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_APOrigin, NULL, BBFDM_BOTH},
|
||||
{"TriggerEvent", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_TriggerEvent, NULL, BBFDM_BOTH},
|
||||
{"SteeringApproach", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_SteeringApproach, NULL, BBFDM_BOTH},
|
||||
{"APDestination", &DMREAD, DMT_STRING, get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_APDestination, NULL, BBFDM_BOTH},
|
||||
{"SteeringDuration", &DMREAD, DMT_UNINT, get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistory_SteeringDuration, NULL, BBFDM_BOTH},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.WiFi.DataElements.Network.Device.{i}.Radio.{i}.BSS.{i}.STA.{i}.MultiAPSTA. *** */
|
||||
DMOBJ tWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTAObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys */
|
||||
{"SteeringHistory", &DMREAD, NULL, NULL, NULL, browseWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistoryInst, NULL, NULL, NULL, tWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTASteeringHistoryParams, NULL, BBFDM_BOTH, NULL},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTAParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type */
|
||||
{"SteeringHistoryNumberOfEntries", &DMREAD, DMT_UNINT, get_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTA_SteeringHistoryNumberOfEntries, NULL, BBFDM_BOTH},
|
||||
{"BTMRequest()", &DMASYNC, DMT_COMMAND, get_operate_args_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTA_BTMRequest, operate_WiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTA_BTMRequest, BBFDM_USP},
|
||||
{0}
|
||||
};
|
||||
|
||||
DM_MAP_OBJ tDynamicObj[] = {
|
||||
/* parentobj, nextobject, parameter */
|
||||
{"Device.WiFi.DataElements.Network.", tWiFiDataElementsNetworkObj, tWiFiDataElementsNetworkParams},
|
||||
{"Device.WiFi.DataElements.Network.Device.{i}.", tWiFiDataElementsNetworkDeviceObj, tWiFiDataElementsNetworkDeviceParams},
|
||||
{"Device.WiFi.DataElements.Network.Device.{i}.MultiAPDevice.Backhaul.", NULL, tWiFiDataElementsNetworkDeviceMultiAPDeviceBackhaulParams},
|
||||
{"Device.WiFi.DataElements.Network.Device.{i}.Radio.{i}.", NULL, tWiFiDataElementsNetworkDeviceRadioParams},
|
||||
{"Device.WiFi.DataElements.Network.Device.{i}.Radio.{i}.BSS.{i}.STA.{i}.MultiAPSTA.", tWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTAObj,tWiFiDataElementsNetworkDeviceRadioBSSSTAMultiAPSTAParams},
|
||||
{0}
|
||||
};
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.1.8
|
||||
PKG_VERSION:=2.1.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_SOURCE_VERSION:=21ab72bbd1e4c4439395e16b6cab8b39dced4d60
|
||||
PKG_SOURCE_VERSION:=2d35e86cc8dfd7ef4e0d8579f5d314e90faadc90
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=firewallmngr
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=d4bdd162cf37b3373df2448a70dcb4fbc1113535
|
||||
PKG_SOURCE_VERSION:=94246676dc2e2db29b94fcffec1be3cee3ec8e9f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -53,15 +53,21 @@ endif
|
||||
|
||||
define Package/firewallmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
ifeq ($(CONFIG_FIREWALLMNGR_PORT_TRIGGER),y)
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/lib/port-trigger
|
||||
|
||||
$(INSTALL_BIN) ./files/port-trigger/etc/init.d/port-trigger $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/port-trigger/etc/config/port-trigger $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/port-trigger/lib/port-trigger/port_trigger.sh $(1)/lib/port-trigger/
|
||||
endif
|
||||
$(INSTALL_BIN) ./files/firewall.portmap $(1)/etc/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_BIN) ./files/firewall.service $(1)/etc/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/
|
||||
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libfirewallmngr.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
#
|
||||
# Copright (C) 2018 The Internet Foundation In Sweden
|
||||
# Copyright (C) 2024 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fluentbit
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_NAME:=fluent-bit
|
||||
PKG_VERSION:=3.1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit.git
|
||||
PKG_SOURCE_VERSION:=v3.0.5
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_VERSION=v$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=9bedfabf859b88a2cfcf51cc17669b83a170e85427ce562131366cb1542b52ae
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -20,25 +22,32 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/fluentbit
|
||||
define Package/fluent-bit
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:= +libyaml +libopenssl +libcurl +libatomic +musl-fts
|
||||
TITLE:=FluentBit
|
||||
DEPENDS:= +libyaml +libopenssl +libcurl +libatomic +musl-fts +flex +bison
|
||||
TITLE:=Fluent-Bit
|
||||
URL:=https://fluentbit.io/
|
||||
endef
|
||||
|
||||
define Package/fluentbit/description
|
||||
define Package/fluent-bit/description
|
||||
Fluent Bit is a super fast, lightweight, and highly scalable logging and metrics processor and forwarder.
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./fluent-bit/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
# General options
|
||||
TARGET_LDFLAGS+=-lfts -latomic
|
||||
TARGET_LDFLAGS +=-lfts -latomic
|
||||
|
||||
CMAKE_OPTIONS+= \
|
||||
-DFLB_RELEASE=Yes \
|
||||
-DFLB_SMALL=Yes \
|
||||
-DFLB_SMALL=No \
|
||||
-DEXCLUDE_FROM_ALL=true \
|
||||
-DBUILD_SHAREDD_LIBS=Yes \
|
||||
-DFLB_DEBUG=No \
|
||||
-DFLB_SHARED_LIBS=Yes \
|
||||
-DFLB_DEBUG=Yes \
|
||||
-DFLB_ALL=No \
|
||||
-DFLB_JEMALLOC=No \
|
||||
-DFLB_EXAMPLES=No \
|
||||
@@ -156,10 +165,12 @@ CMAKE_OPTIONS += \
|
||||
-DFLB_OUT_CHRONICLE=No \
|
||||
-DFLB_OUT_PGSQL=No
|
||||
|
||||
define Package/fluentbit/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
define Package/fluent-bit/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/fluent-bit
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/fluent-bit $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/fluent-bit.conf $(1)/etc/fluent-bit/fluent-bit.conf
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/parsers.conf $(1)/etc/fluent-bit/parsers.conf
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,fluentbit))
|
||||
$(eval $(call BuildPackage,fluent-bit))
|
||||
15
fluent-bit/files/fluent-bit.conf
Normal file
15
fluent-bit/files/fluent-bit.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
[SERVICE]
|
||||
flush 3
|
||||
daemon Off
|
||||
log_level info
|
||||
parsers_file /etc/fluent-bit/parsers.conf
|
||||
|
||||
[INPUT]
|
||||
name syslog
|
||||
tag syslog
|
||||
path /dev/log
|
||||
|
||||
[OUTPUT]
|
||||
name null
|
||||
match *
|
||||
|
||||
14
fluent-bit/patches/0001-fix_out_file_plugin.patch
Normal file
14
fluent-bit/patches/0001-fix_out_file_plugin.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git a/plugins/out_file/file.c b/plugins/out_file/file.c
|
||||
index 2e47c9666..42ace24c6 100644
|
||||
--- a/plugins/out_file/file.c
|
||||
+++ b/plugins/out_file/file.c
|
||||
@@ -45,6 +45,9 @@
|
||||
#define NEWLINE "\n"
|
||||
#endif
|
||||
|
||||
+#undef PATH_MAX
|
||||
+#define PATH_MAX 256
|
||||
+
|
||||
struct flb_file_conf {
|
||||
const char *out_path;
|
||||
const char *out_file;
|
||||
6
icwmp/Config.in
Normal file
6
icwmp/Config.in
Normal file
@@ -0,0 +1,6 @@
|
||||
menu "Configuration"
|
||||
|
||||
config ICWMP_MGMT_FROM_USP
|
||||
bool "Support configuration of ManagementServer from USP"
|
||||
default y
|
||||
endmenu
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.7.18
|
||||
PKG_VERSION:=9.8.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=a19cce88d11de7cd380dd3be19d151c2976fa071
|
||||
PKG_SOURCE_VERSION:=580f923cfc89aa9f151096d8606dde71e4604d08
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -32,8 +32,21 @@ define Package/icwmp
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=TR069 CWMP client
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api +libopenssl
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/icwmp/description
|
||||
TR069 client implementation with bbfdm backend for TR181 support
|
||||
endef
|
||||
|
||||
define Package/icwmp/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_ICWMP_MGMT_FROM_USP),y)
|
||||
EXTRA_CFLAGS += -DCWMP_DUAL_SUPPORT=BBFDM_BOTH
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
|
||||
@@ -51,6 +64,7 @@ define Package/icwmp/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/critical_services.json $(1)/etc/icwmpd/critical_services.json
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
|
||||
@@ -41,6 +41,7 @@ config cpe 'cpe'
|
||||
option active_notif_throttle '0'
|
||||
option disable_gatewayinfo '0'
|
||||
option fw_upgrade_keep_settings '1'
|
||||
option clock_sync_timeout '128'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '0'
|
||||
|
||||
11
icwmp/files/etc/critical_services.json
Normal file
11
icwmp/files/etc/critical_services.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"services_list": [
|
||||
"firewall",
|
||||
"network",
|
||||
"dhcp",
|
||||
"stunc",
|
||||
"xmpp",
|
||||
"wireless",
|
||||
"time"
|
||||
]
|
||||
}
|
||||
@@ -6,7 +6,7 @@ log() {
|
||||
}
|
||||
|
||||
get_firewall_zone() {
|
||||
zone="$(uci show firewall|grep network|grep ${1}|cut -d. -f 2)"
|
||||
zone="$(uci show firewall|grep network|grep -w ${1}|cut -d. -f 2)"
|
||||
zone="${zone:-wan}" # defaults to wan zone
|
||||
echo "$zone"
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.4.6
|
||||
PKG_VERSION:=8.5.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e2f68a0ba54a6abf3481cdbb24d2dcc81e7f199c
|
||||
PKG_SOURCE_VERSION:=b0e9ef0934888281ba7db7843738e56e6541665a
|
||||
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
|
||||
|
||||
@@ -4,7 +4,7 @@ PKG_NAME:=iopsys-analytics
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fb84c1019a8a0fbfb624d9df8eb3604806645510
|
||||
PKG_SOURCE_VERSION:=aea91816de703cf1c72490f51c2aa73c2f61640d
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopsys-analytics.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ipt-trigger
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8d4b4520a2935a5717a27f486a3fc78357b2a0cd
|
||||
PKG_SOURCE_VERSION:=4f3d4427403e0a9be7653c1b92907ae8ae5f21ae
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ipt-trigger.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdpp
|
||||
PKG_VERSION:=2.1.0
|
||||
PKG_VERSION:=2.1.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=1f82436531d4bb094b0b74e99613e0dfc84eada3
|
||||
PKG_SOURCE_VERSION:=6024efd3db9dd490c07465ea9b0c15120063165c
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/libdpp.git
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libethernet
|
||||
PKG_VERSION:=7.2.109
|
||||
PKG_VERSION:=7.2.110
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=cc72f5ab0171cd0fc29bb48dafff6751ab2f0d9c
|
||||
PKG_SOURCE_VERSION:=d94e3029e4e9d14907fd6b283218defb4d319f5a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.13
|
||||
PKG_VERSION:=1.0.14
|
||||
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:=f1509651217d027376b5b7fc3f64ca86662e9b2d
|
||||
PKG_SOURCE_VERSION:=7fde62b9634c63b9bc71d1c20541798971a78dc8
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.73
|
||||
PKG_VERSION:=7.5.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=04ad674ce49b144fddd7797603a12729298c11a6
|
||||
PKG_SOURCE_VERSION:=e93fcd63354489846e5bb2450c7e8059774577d5
|
||||
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
|
||||
|
||||
26
logmngr/Config.in
Normal file
26
logmngr/Config.in
Normal file
@@ -0,0 +1,26 @@
|
||||
if PACKAGE_logmngr
|
||||
choice
|
||||
prompt "Select backend for syslog management"
|
||||
default LOGMNGR_BACKEND_FLUENTBIT
|
||||
depends on PACKAGE_logmngr
|
||||
help
|
||||
Select which backend daemon to use for syslog management
|
||||
|
||||
config LOGMNGR_BACKEND_FLUENTBIT
|
||||
bool "Use fluent-bit for log management"
|
||||
help
|
||||
Enable this option to use fluent-bit for log management.
|
||||
|
||||
config LOGMNGR_BACKEND_SYSLOG_NG
|
||||
bool "Use syslog-ng for log management"
|
||||
help
|
||||
Enable this option to use syslog-ng for log management.
|
||||
|
||||
endchoice
|
||||
config LOGMNGR_LOGROTATE
|
||||
bool "Logrotate support"
|
||||
depends on PACKAGE_logmngr
|
||||
default y
|
||||
help
|
||||
It adds support for logrotate functionality.
|
||||
endif
|
||||
74
logmngr/Makefile
Normal file
74
logmngr/Makefile
Normal file
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# Copyright (C) 2024 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=logmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/logmngr.git
|
||||
PKG_SOURCE_VERSION:=ec10abb3cc0f3b96eb806c9c67e18d9d134287e9
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=bbf_plugin
|
||||
|
||||
define Package/logmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Logging Manager
|
||||
DEPENDS:=+libbbfdm-api +LOGMNGR_BACKEND_FLUENTBIT:fluent-bit +LOGMNGR_LOGROTATE:logrotate
|
||||
DEPENDS+=+LOGMNGR_BACKEND_SYSLOG_NG:syslog-ng
|
||||
endef
|
||||
|
||||
define Package/logmngr/description
|
||||
Configure log management. This package has the datamodel as well as the
|
||||
the backend implementation for handling syslog.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./logmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/logmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/logmngr.init $(1)/etc/init.d/logmngr
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/logread $(1)/usr/sbin
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/10-logmngr_config_generate $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/logmngr
|
||||
ifeq ($(CONFIG_LOGMNGR_BACKEND_FLUENTBIT),y)
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/fluent-bit.sh $(1)/lib/logmngr/.
|
||||
endif
|
||||
ifeq ($(CONFIG_LOGMNGR_BACKEND_SYSLOG_NG),y)
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/syslog-ng.sh $(1)/lib/logmngr/.
|
||||
endif
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfsyslog.so $(1)
|
||||
ifeq ($(CONFIG_LOGMNGR_LOGROTATE),y)
|
||||
$(INSTALL_BIN) ./files/11-logmngr_logrotate_config_generate $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/logrotate.sh $(1)/lib/logmngr/.
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbflogrotate.so $(1)
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,logmngr))
|
||||
23
logmngr/files/10-logmngr_config_generate
Normal file
23
logmngr/files/10-logmngr_config_generate
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -s "/etc/config/logmngr" ]; then
|
||||
if uci -q get logmngr.@globals[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/logmngr
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/logmngr
|
||||
|
||||
uci set logmngr.globals=globals
|
||||
uci set logmngr.globals.enable=1
|
||||
|
||||
uci set logmngr.a1=action
|
||||
uci set logmngr.a1.name="ac1"
|
||||
|
||||
uci set logmngr.lf1=log_file
|
||||
uci set logmngr.lf1.enable=1
|
||||
uci set logmngr.lf1.action="ac1"
|
||||
uci set logmngr.lf1.file="/var/log/messages"
|
||||
uci commit logmngr
|
||||
14
logmngr/files/11-logmngr_logrotate_config_generate
Normal file
14
logmngr/files/11-logmngr_logrotate_config_generate
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -s "/etc/config/logmngr" ]; then
|
||||
if uci -q get logmngr.@log_rotate[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
fi
|
||||
uci set logmngr.lro1=log_rotate
|
||||
uci set logmngr.lro1.enable=1
|
||||
uci set logmngr.lro1.file_name="/var/log/messages"
|
||||
uci set logmngr.lro1.file_count=1
|
||||
uci set logmngr.lro1.max_file_size=1000000
|
||||
uci commit logmngr
|
||||
fi
|
||||
319
logmngr/files/lib/logmngr/fluent-bit.sh
Normal file
319
logmngr/files/lib/logmngr/fluent-bit.sh
Normal file
@@ -0,0 +1,319 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/logmngr/logrotate.sh
|
||||
|
||||
CONF_FILE=/etc/fluent-bit/fluent-bit.conf
|
||||
TMP_CONF_FILE=/tmp/fluent-bit/fluent-bit.conf
|
||||
|
||||
create_config_file() {
|
||||
mkdir -p /tmp/fluent-bit
|
||||
rm -f ${TMP_CONF_FILE}
|
||||
touch ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
create_service_section() {
|
||||
# the service section of the fluent-bit.conf file has hardcoded values,
|
||||
# no need to lookup any uci section to configure this section
|
||||
echo "[SERVICE]" >> ${TMP_CONF_FILE}
|
||||
echo " flush 3" >> ${TMP_CONF_FILE}
|
||||
echo " daemon off" >> ${TMP_CONF_FILE}
|
||||
echo " log_level info" >> ${TMP_CONF_FILE}
|
||||
echo " parsers_file /etc/fluent-bit/parsers.conf" >> ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
create_input_section() {
|
||||
local tag="$1"
|
||||
# the input in our case is always syslog, hence, this section of the
|
||||
# fluent-bit.conf file has hardcoded values as well that do not depend
|
||||
# on any uci value
|
||||
echo "[INPUT]" >> ${TMP_CONF_FILE}
|
||||
echo " name syslog" >> ${TMP_CONF_FILE}
|
||||
echo " tag $tag" >> ${TMP_CONF_FILE}
|
||||
echo " path /dev/log" >> ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
generate_facility_regex() {
|
||||
local facility_level=$1
|
||||
local pri=0
|
||||
|
||||
if [ "$facility_level" == "24" ]; then
|
||||
# value 24 means all facility level, which is as good as not
|
||||
# generating a filter section, so return
|
||||
return
|
||||
fi
|
||||
|
||||
# facility_level is a list value, hence, generate regex for
|
||||
# each value
|
||||
IFS=" "
|
||||
for val in $facility_level; do
|
||||
# as per rfc 5424 and 3164, pri in syslog msg is
|
||||
# facility*8+severity. Severity value can range from 0-7 hence
|
||||
# generate regex for each.
|
||||
for sval in 0 1 2 3 4 5 6 7; do
|
||||
pri=`expr $val \* 8 + $sval`
|
||||
echo " regex pri $pri" >> ${TMP_CONF_FILE}
|
||||
done
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
generate_severity_regex() {
|
||||
local sev_level="$1"
|
||||
local sev_compare="$2"
|
||||
local sev_action="$3"
|
||||
|
||||
local pri=0
|
||||
local param="exclude"
|
||||
|
||||
if [ "$sev_action" == "0" ]; then
|
||||
param="regex"
|
||||
fi
|
||||
|
||||
local fval=0
|
||||
if [ "$sev_compare" == "0" ]; then
|
||||
# generate regex for all facility values, with severity=sev_level
|
||||
while [ $fval -le 23 ] ; do
|
||||
pri=`expr $fval \* 8 + $sev_level`
|
||||
echo " $param pri $pri" >> ${TMP_CONF_FILE}
|
||||
fval=$((fval + 1))
|
||||
done
|
||||
elif [ "$sev_compare" == "1" ]; then
|
||||
# generate regex for all severity value greater than or equal to
|
||||
# sev_level. please, lower value have higher precedence, so sev_level
|
||||
# 0 which is emergency has higher precedence than error which is 3
|
||||
while [ $fval -le 23 ] ; do
|
||||
sval=0
|
||||
while [ $sev_level -ge $sval ]; do
|
||||
pri=`expr $fval \* 8 + $sval`
|
||||
echo " $param pri $pri" >> ${TMP_CONF_FILE}
|
||||
sval=$((sval + 1))
|
||||
done
|
||||
fval=$((fval + 1))
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
handle_filter_conf() {
|
||||
local section="$1" # config filter
|
||||
local filter_name="$2"
|
||||
local name
|
||||
|
||||
# no need to proceed if name of filter section is not one of the values
|
||||
# listed in option filter in config action section
|
||||
config_get name $section name
|
||||
if [ "$name" != "$filter_name" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# as per data model, at a time either facility_level or severity_level can
|
||||
# be specified along with pattern_match. hence, first process and generate
|
||||
# regex for pattern_match which is common in both condition. Next, we will
|
||||
# process facility_level and return if facility level is defined and not
|
||||
# process severity related params at all.
|
||||
|
||||
local pattern_match
|
||||
config_get pattern_match $section pattern_match
|
||||
if [ -n "$pattern_match" ]; then
|
||||
echo " regex $pattern_match" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
|
||||
local facility_level
|
||||
config_get facility_level $section facility_level
|
||||
|
||||
if [ -n "$facility_level" ]; then
|
||||
generate_facility_regex $facility_level
|
||||
# return from here since if facility_level is defined, then no
|
||||
# need to process severity_level
|
||||
return
|
||||
fi
|
||||
|
||||
local sev_level
|
||||
local sev_compare
|
||||
local sev_action
|
||||
config_get sev_level $section severity_level
|
||||
|
||||
if [ -n "$sev_level" ]; then
|
||||
# value 1 of severity compare corresponds to data model
|
||||
# and system default which is EqualorHigher
|
||||
config_get sev_compare $section severity_compare 1
|
||||
# value 0 of severity action corresponds to data model
|
||||
# and system default that is log
|
||||
config_get sev_action $section severity_action 0
|
||||
|
||||
generate_severity_regex $sev_level $sev_compare $sev_action
|
||||
fi
|
||||
}
|
||||
|
||||
create_filter_section() {
|
||||
local match="$1"
|
||||
|
||||
echo "[FILTER]" >> ${TMP_CONF_FILE}
|
||||
echo " name grep" >> ${TMP_CONF_FILE}
|
||||
echo " match $match" >> ${TMP_CONF_FILE}
|
||||
echo " logical_op or" >> ${TMP_CONF_FILE} # handle multiple filters
|
||||
}
|
||||
|
||||
handle_filter_ref() {
|
||||
local filter_name="$1"
|
||||
config_foreach handle_filter_conf filter "$filter_name"
|
||||
}
|
||||
|
||||
handle_log_file() {
|
||||
local section="$1" # out_file section
|
||||
local match="$2"
|
||||
local action_ref
|
||||
|
||||
config_get action_ref $section action
|
||||
if [ "$action_ref" != "$match" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local enabled
|
||||
config_get enabled $section enable
|
||||
if [ "$enabled" == 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local file
|
||||
config_get file $section file
|
||||
if [ -z "$file" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo "[OUTPUT]" >> ${TMP_CONF_FILE}
|
||||
echo " name file" >> ${TMP_CONF_FILE}
|
||||
echo " match $match" >> ${TMP_CONF_FILE}
|
||||
echo " file $file" >> ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
handle_log_remote() {
|
||||
local section="$1"
|
||||
local match="$2"
|
||||
local action_ref
|
||||
|
||||
config_get action_ref $section action
|
||||
if [ "$action_ref" != "$match" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local enabled
|
||||
config_get enabled $section enable
|
||||
if [ "$enabled" == 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
local address
|
||||
config_get address $section log_ip
|
||||
if [ -z "$address" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo "[OUTPUT]" >> ${TMP_CONF_FILE}
|
||||
echo " name syslog" >> ${TMP_CONF_FILE}
|
||||
echo " match $match" >> ${TMP_CONF_FILE}
|
||||
echo " host $address" >> ${TMP_CONF_FILE}
|
||||
|
||||
local proto # holds value tcp or udp
|
||||
config_get proto $section proto
|
||||
if [ -n "$proto" ]; then
|
||||
if [ "$proto" == "tls" ]; then
|
||||
echo " mode tcp" >> ${TMP_CONF_FILE}
|
||||
echo " tls on" >> ${TMP_CONF_FILE}
|
||||
else
|
||||
echo " mode $proto" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
fi
|
||||
|
||||
local port
|
||||
config_get port $section port
|
||||
if [ -n "$port" ]; then
|
||||
echo " port $port" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
|
||||
local cert
|
||||
local peer_verify
|
||||
config_get cert $section cert
|
||||
if [ -n "$cert" ]; then
|
||||
echo " tls.crt_file $cert" >> ${TMP_CONF_FILE}
|
||||
|
||||
config_get peer_verify $section peer_verify
|
||||
if [ "$peer_verify" == "1" ]; then
|
||||
echo " tls.verify on" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
handle_action() {
|
||||
local section="$1"
|
||||
|
||||
local filter
|
||||
config_get filter $section filter
|
||||
|
||||
# use config action option name as tag for input
|
||||
local tag
|
||||
config_get tag $section name
|
||||
if [ -z "$tag" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
create_input_section $tag
|
||||
if [ -n "$filter" ]; then
|
||||
# the only fluentbit filter that is useful for the datamodel is
|
||||
# grep. Also, fluentbit does not seem to handle multiple instances
|
||||
# of FILTER of same kind. Hence, each filter section corresponding
|
||||
# to an action entry in the uci would translate for us into a set of
|
||||
# regex/exclude values instead of individual FILTER section per uci
|
||||
# section filter is a list, treat according
|
||||
create_filter_section $tag
|
||||
|
||||
IFS=" "
|
||||
for finst in $filter; do
|
||||
handle_filter_ref $finst
|
||||
done
|
||||
fi
|
||||
|
||||
# handle output, each action can be associated with a out_log and out_syslog
|
||||
# section so figure out if any out_log or out_syslog section is associated
|
||||
# with this and action and setup output accordingly.
|
||||
config_foreach handle_log_file log_file "$tag"
|
||||
config_foreach handle_log_remote log_remote "$tag"
|
||||
|
||||
|
||||
}
|
||||
|
||||
handle_action_section() {
|
||||
config_foreach handle_action action
|
||||
}
|
||||
|
||||
apply_config_file() {
|
||||
cp ${TMP_CONF_FILE} ${CONF_FILE}
|
||||
}
|
||||
|
||||
PROG=/usr/sbin/fluent-bit
|
||||
logmngr_init() {
|
||||
create_config_file
|
||||
|
||||
config_load logmngr
|
||||
local enabled
|
||||
config_get enabled globals enable
|
||||
|
||||
if [ "$enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
create_service_section
|
||||
handle_action_section
|
||||
apply_config_file
|
||||
|
||||
if [ -f /lib/logmngr/logrotate.sh ]; then
|
||||
logrotate_init
|
||||
fi
|
||||
|
||||
procd_open_instance logmngr
|
||||
procd_set_param command $PROG -c $CONF_FILE
|
||||
procd_set_param file $CONF_FILE
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
96
logmngr/files/lib/logmngr/logrotate.sh
Normal file
96
logmngr/files/lib/logmngr/logrotate.sh
Normal file
@@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
LOGROTATE_FILE=/etc/logrotate.conf
|
||||
LOGROTATE_TMP_FILE=/tmp/logrotate/logrotate.conf
|
||||
|
||||
create_logrotate_file() {
|
||||
mkdir -p /tmp/logrotate
|
||||
rm -f ${LOGROTATE_TMP_FILE}
|
||||
touch ${LOGROTATE_FILE}
|
||||
}
|
||||
|
||||
|
||||
handle_logrotate() {
|
||||
local section="$1"
|
||||
|
||||
local enabled
|
||||
config_get enabled $section enable
|
||||
if [ "$enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local file_name
|
||||
config_get file_name $section file_name
|
||||
if [ -z "$file_name" ]; then
|
||||
# no file to rotate, return
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e "$file_name {" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tcreate" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tmissingok" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tnotifempty" >> ${LOGROTATE_TMP_FILE}
|
||||
|
||||
local file_count
|
||||
config_get file_count $section file_count
|
||||
if [ -n "$file_count" ]; then
|
||||
echo -e "\trotate $file_count" >> ${LOGROTATE_TMP_FILE}
|
||||
fi
|
||||
|
||||
local max_file_size
|
||||
config_get max_file_size $section max_file_size
|
||||
if [ -n "$max_file_size" ]; then
|
||||
echo -e "\tmaxsize $max_file_size" >> ${LOGROTATE_TMP_FILE}
|
||||
fi
|
||||
|
||||
local duration
|
||||
config_get duration $section duration
|
||||
if [ -n "$duration" ]; then
|
||||
echo -e "\tminutes $duration" >> ${LOGROTATE_TMP_FILE}
|
||||
fi
|
||||
|
||||
local retention
|
||||
config_get retention $section retention
|
||||
if [ -n "$retention" ]; then
|
||||
echo -e "\tmaxage $retention" >> ${LOGROTATE_TMP_FILE}
|
||||
fi
|
||||
|
||||
local compression
|
||||
config_get compression $section compression
|
||||
if [ -n "$compression" ]; then
|
||||
echo -e "\tcompress" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tcompresscmd $compression" >> ${LOGROTATE_TMP_FILE}
|
||||
fi
|
||||
|
||||
echo -e "\tpostrotate" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\t\tservice logmngr restart" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\t\tsleep 1" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "\tendscript" >> ${LOGROTATE_TMP_FILE}
|
||||
echo -e "}" >> ${LOGROTATE_TMP_FILE} # close the logfile section
|
||||
}
|
||||
|
||||
apply_logrotate_file() {
|
||||
cp ${LOGROTATE_TMP_FILE} ${LOGROTATE_FILE}
|
||||
}
|
||||
|
||||
config_cron_job() {
|
||||
# taking the liberty to configure the cron job hourly, that is, at the end
|
||||
# of each hour, check if logrotation is needed. The logrotate daemon, when
|
||||
# triggered hourly, will still honour the configure log rotation duration,
|
||||
# the only slight different being that if the minutes for log rotation
|
||||
# are configured in such a way that it falls within the hour, then the
|
||||
# log rotation will be done at the completion of hour and not before. I do
|
||||
# not think this is a drawback in the interest of keeping things simple.
|
||||
sed -i '/logrotate/d' /etc/crontabs/root
|
||||
echo "0 * * * * logrotate ${LOGROTATE_FILE}" >> /etc/crontabs/root
|
||||
/etc/init.d/cron restart
|
||||
}
|
||||
|
||||
logrotate_init() {
|
||||
create_logrotate_file
|
||||
config_foreach handle_logrotate log_rotate
|
||||
apply_logrotate_file
|
||||
config_cron_job
|
||||
}
|
||||
345
logmngr/files/lib/logmngr/syslog-ng.sh
Normal file
345
logmngr/files/lib/logmngr/syslog-ng.sh
Normal file
@@ -0,0 +1,345 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/logmngr/logrotate.sh
|
||||
|
||||
CONF_FILE=/etc/syslog-ng.conf
|
||||
TMP_CONF_FILE=/tmp/syslog-ng/syslog-ng.conf
|
||||
|
||||
create_config_file() {
|
||||
mkdir -p /tmp/syslog-ng
|
||||
rm -f ${TMP_CONF_FILE}
|
||||
touch ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
create_option_section() {
|
||||
# the option section of the syslog-ng.conf file has hardcoded values,
|
||||
# no need to lookup any uci section to configure this section
|
||||
echo -e "@version: 4.4" >> ${TMP_CONF_FILE}
|
||||
echo -e '@include "scl.conf"' >> ${TMP_CONF_FILE}
|
||||
echo -e "options {" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tchain_hostnames(no);" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tcreate_dirs(yes);" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tkeep_hostname(yes);" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tlog_fifo_size(256);" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tlog_msg_size(1024);" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tstats(freq(0));" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tflush_lines(0);" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tuse_fqdn(no);" >> ${TMP_CONF_FILE}
|
||||
echo "};" >> ${TMP_CONF_FILE}
|
||||
|
||||
}
|
||||
|
||||
create_input_section() {
|
||||
local tag="$1"
|
||||
# the input in our case is always syslog, hence, this section of the
|
||||
# fluent-bit.conf file has hardcoded values as well that do not depend
|
||||
# on any uci value
|
||||
echo -e "source $tag {" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tinternal();" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tunix-dgram("/dev/log");" >> ${TMP_CONF_FILE}
|
||||
echo "};" >> ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
generate_facility_regex() {
|
||||
local facility_level=$1
|
||||
|
||||
if [ "$facility_level" == "24" ]; then
|
||||
# value 24 means all facility level, which is as good as not
|
||||
# generating a filter section, so return
|
||||
return
|
||||
fi
|
||||
|
||||
# facility_level is a list value, hence, generate regex for
|
||||
# each value
|
||||
IFS=" "
|
||||
for val in $facility_level; do
|
||||
echo -e "\tfacility($val);" >> ${TMP_CONF_FILE}
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
generate_severity_regex() {
|
||||
local sev_level="$1"
|
||||
local sev_compare="$2"
|
||||
local sev_action="$3"
|
||||
|
||||
if [ "$sev_compare" == "0" ]; then
|
||||
case $sev_level in
|
||||
"0") echo -e "\tlevel(emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"1") echo -e "\tlevel(alert)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"2") echo -e "\tlevel(crit)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"3") echo -e "\tlevel(err)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"4") echo -e "\tlevel(warning)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"5") echo -e "\tlevel(notice)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"6") echo -e "\tlevel(info)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"7") echo -e "\tlevel(debug)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
esac
|
||||
elif [ "$sev_compare" == "1" ]; then
|
||||
# generate regex for all severity value greater than or equal to
|
||||
# sev_level
|
||||
case $sev_level in
|
||||
"0") echo -e "\tlevel(emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"1") echo -e "\tlevel(alert..emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"2") echo -e "\tlevel(crit..emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"3") echo -e "\tlevel(err..emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"4") echo -e "\tlevel(warning..emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"5") echo -e "\tlevel(notice..emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"6") echo -e "\tlevel(info..emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
"7") echo -e "\tlevel(debug..emerg)" >> ${TMP_CONF_FILE}
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
handle_filter_conf() {
|
||||
local section="$1" # config filter
|
||||
local filter_name="$2"
|
||||
local name
|
||||
|
||||
# no need to proceed if name of filter section is not one of the values
|
||||
# listed in option filter in config action section
|
||||
config_get name $section name
|
||||
if [ "$name" != "$filter_name" ]; then
|
||||
return
|
||||
fi
|
||||
echo -e "filter $name {" >> ${TMP_CONF_FILE}
|
||||
|
||||
# as per data model, at a time either facility_level or severity_level can
|
||||
# be specified along with pattern_match. hence, first process and generate
|
||||
# regex for pattern_match which is common in both condition. Next, we will
|
||||
# process facility_level and return if facility level is defined and not
|
||||
# process severity related params at all.
|
||||
|
||||
local pattern_match
|
||||
config_get pattern_match $section pattern_match
|
||||
if [ -n "$pattern_match" ]; then
|
||||
# the pattern here is in tag=>value pair, hence, break the pattern
|
||||
# and fill this filed
|
||||
local tag=$(echo $pattern_match | awk '{print $1}')
|
||||
local value=$(echo $pattern_match | awk '{print $2}')
|
||||
echo -e "\tmatch("$value" value("$tag"))" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
|
||||
local facility_level
|
||||
config_get facility_level $section facility_level
|
||||
|
||||
if [ -n "$facility_level" ]; then
|
||||
generate_facility_regex $facility_level
|
||||
# return from here since if facility_level is defined, then no
|
||||
# need to process severity_level
|
||||
echo "};" >> ${TMP_CONF_FILE}
|
||||
return
|
||||
fi
|
||||
|
||||
local sev_level
|
||||
local sev_compare
|
||||
local sev_action
|
||||
config_get sev_level $section severity_level
|
||||
|
||||
if [ -n "$sev_level" ]; then
|
||||
# value 1 of severity compare corresponds to data model
|
||||
# and system default which is EqualorHigher
|
||||
config_get sev_compare $section severity_compare 1
|
||||
# value 0 of severity action corresponds to data model
|
||||
# and system default that is log
|
||||
config_get sev_action $section severity_action 0
|
||||
|
||||
generate_severity_regex $sev_level $sev_compare $sev_action
|
||||
fi
|
||||
echo "};" >> ${TMP_CONF_FILE}
|
||||
}
|
||||
|
||||
handle_filter_ref() {
|
||||
local filter_name="$1"
|
||||
config_foreach handle_filter_conf filter "$filter_name"
|
||||
}
|
||||
|
||||
handle_log_file() {
|
||||
local section="$1" # out_file section
|
||||
local match="$2"
|
||||
local filter="$3"
|
||||
local action_ref
|
||||
|
||||
config_get action_ref $section action
|
||||
if [ "$action_ref" != "$match" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local enabled
|
||||
config_get enabled $section enable
|
||||
if [ "$enabled" == 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local file
|
||||
config_get file $section file
|
||||
if [ -z "$file" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
echo -e "destination file_$match {" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tfile("$file");" >> ${TMP_CONF_FILE}
|
||||
echo -e "};" >> ${TMP_CONF_FILE}
|
||||
|
||||
# now generate the log section for each action section to bring into effect
|
||||
# the filter, destination, source sections create above
|
||||
echo -e "log {" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tsource($tag);" >> ${TMP_CONF_FILE}
|
||||
if [ -n "$filter" ]; then
|
||||
IFS=" "
|
||||
for finst in $filter; do
|
||||
echo -e "\tfilter($finst);" >> ${TMP_CONF_FILE}
|
||||
done
|
||||
fi
|
||||
echo -e "\tdestination(file_$match);" >> ${TMP_CONF_FILE} # log_file
|
||||
echo -e "};" >> ${TMP_CONF_FILE} # close log section
|
||||
}
|
||||
|
||||
handle_log_remote() {
|
||||
local section="$1"
|
||||
local match="$2"
|
||||
local filter="$3"
|
||||
local action_ref
|
||||
|
||||
config_get action_ref $section action
|
||||
if [ "$action_ref" != "$match" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local enabled
|
||||
config_get enabled $section enable
|
||||
if [ "$enabled" == 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
local address
|
||||
config_get address $section log_ip
|
||||
if [ -z "$address" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
echo -e "destination remote_$match {" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tsyslog(" >> ${TMP_CONF_FILE}
|
||||
echo -e "\t\t"$address"" >> ${TMP_CONF_FILE}
|
||||
|
||||
local proto # holds value tcp or udp
|
||||
config_get proto $section proto
|
||||
if [ -n "$proto" ]; then
|
||||
echo -e "\t\ttransport($proto)" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
|
||||
local port
|
||||
config_get port $section port
|
||||
if [ -n "$port" ]; then
|
||||
echo -e "\t\tport($port)" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
|
||||
local cert
|
||||
local peer_verify
|
||||
config_get cert $section cert
|
||||
if [ -n "$cert" ]; then
|
||||
echo -e "\t\ttls(" >> ${TMP_CONF_FILE}
|
||||
echo -e "\t\t\tcert-file($cert)" >> ${TMP_CONF_FILE}
|
||||
|
||||
config_get peer_verify $section peer_verify
|
||||
if [ "$peer_verify" == "1" ]; then
|
||||
echo -e "\t\t\tpeer-verify(required-trusted)" >> ${TMP_CONF_FILE}
|
||||
fi
|
||||
echo -e "\t\t)" >> ${TMP_CONF_FILE} # close tls section
|
||||
fi
|
||||
echo -e "\t);" >> ${TMP_CONF_FILE} # close syslog section
|
||||
echo -e "};" >> ${TMP_CONF_FILE} # close destination section
|
||||
|
||||
# now generate the log section for each action section to bring into effect
|
||||
# the filter, destination, source sections create above
|
||||
echo -e "log {" >> ${TMP_CONF_FILE}
|
||||
echo -e "\tsource($tag);" >> ${TMP_CONF_FILE}
|
||||
if [ -n "$filter" ]; then
|
||||
IFS=" "
|
||||
for finst in $filter; do
|
||||
echo -e "\tfilter($finst);" >> ${TMP_CONF_FILE}
|
||||
done
|
||||
fi
|
||||
echo -e "\tdestination(remote_$match);" >> ${TMP_CONF_FILE} # log_file
|
||||
echo -e "};" >> ${TMP_CONF_FILE} # close log section
|
||||
}
|
||||
|
||||
handle_action() {
|
||||
local section="$1"
|
||||
|
||||
local filter
|
||||
config_get filter $section filter
|
||||
|
||||
# use config action option name as tag for input
|
||||
local tag
|
||||
config_get tag $section name
|
||||
if [ -z "$tag" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
create_input_section $tag
|
||||
if [ -n "$filter" ]; then
|
||||
IFS=" "
|
||||
for finst in $filter; do
|
||||
handle_filter_ref $finst
|
||||
done
|
||||
fi
|
||||
|
||||
# handle output, each action can be associated with a out_log and out_syslog
|
||||
# section so figure out if any out_log or out_syslog section is associated
|
||||
# with this and action and setup output accordingly.
|
||||
config_foreach handle_log_file log_file "$tag" "$filter"
|
||||
config_foreach handle_log_remote log_remote "$tag" "$filter"
|
||||
}
|
||||
|
||||
handle_action_section() {
|
||||
config_foreach handle_action action
|
||||
}
|
||||
|
||||
apply_config_file() {
|
||||
cp ${TMP_CONF_FILE} ${CONF_FILE}
|
||||
}
|
||||
|
||||
PROG=/usr/sbin/syslog-ng-ctl
|
||||
|
||||
logmngr_init() {
|
||||
create_config_file
|
||||
|
||||
config_load logmngr
|
||||
local enabled
|
||||
config_get enabled globals enable
|
||||
|
||||
if [ "$enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
create_option_section
|
||||
handle_action_section
|
||||
apply_config_file
|
||||
|
||||
if [ -f /lib/logmngr/logrotate.sh ]; then
|
||||
logrotate_init
|
||||
fi
|
||||
|
||||
procd_open_instance logmngr
|
||||
procd_set_param command $PROG reload
|
||||
procd_close_instance
|
||||
}
|
||||
16
logmngr/files/logmngr.init
Normal file
16
logmngr/files/logmngr.init
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=12
|
||||
STOP=89
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/logmngr
|
||||
|
||||
start_service() {
|
||||
logmngr_init
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger logmngr
|
||||
}
|
||||
108
logmngr/files/logread
Normal file
108
logmngr/files/logread
Normal file
@@ -0,0 +1,108 @@
|
||||
#!/bin/sh
|
||||
# Shell script compatibility wrapper for /sbin/logread
|
||||
#
|
||||
# Copyright (C) 2019 Dirk Brenken <dev@brenken.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
# use /var/log/messages as default
|
||||
logfile="/var/log/messages"
|
||||
|
||||
|
||||
handle_log_file() {
|
||||
local section="$1"
|
||||
|
||||
local enabled
|
||||
config_get enabled $section enable
|
||||
if [ "$enabled" == 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local file
|
||||
config_get file $section file
|
||||
if [ -z "$file" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
logfile="$file"
|
||||
}
|
||||
|
||||
config_load logmngr
|
||||
config_get logmngr_enabled globals enable
|
||||
if [ "$logmngr_enabled" == "0" ]; then
|
||||
printf "%s\n" "Error: logmngr is not enabled!"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# treat the last enabled log_file as logfile
|
||||
config_foreach handle_log_file log_file
|
||||
|
||||
if [ ! -f "${logfile}" ]
|
||||
then
|
||||
printf "%s\n" "Error: logfile $logfile not found!"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
usage()
|
||||
{
|
||||
printf "%s\n" "Usage: logread [options]"
|
||||
printf "%s\n" "Options:"
|
||||
printf "%5s %-10s%s\n" "-l" "<count>" "Got only the last 'count' messages"
|
||||
printf "%5s %-10s%s\n" "-e" "<pattern>" "Filter messages with a regexp"
|
||||
printf "%5s %-10s%s\n" "-f" "" "Follow log messages"
|
||||
printf "%5s %-10s%s\n" "-h" "" "Print this help message"
|
||||
}
|
||||
|
||||
if [ -z "${1}" ]
|
||||
then
|
||||
cat "${logfile}"
|
||||
exit 0
|
||||
else
|
||||
while [ "${1}" ]
|
||||
do
|
||||
case "${1}" in
|
||||
-l)
|
||||
shift
|
||||
count="${1//[^0-9]/}"
|
||||
tail -n "${count:-50}" "${logfile}"
|
||||
exit 0
|
||||
;;
|
||||
-e)
|
||||
shift
|
||||
pattern="${1}"
|
||||
grep -E "${pattern}" "${logfile}"
|
||||
exit 0
|
||||
;;
|
||||
-f)
|
||||
tail -f "${logfile}"
|
||||
exit 0
|
||||
;;
|
||||
-fe)
|
||||
shift
|
||||
pattern="${1}"
|
||||
tail -f "${logfile}" | grep -E "${pattern}"
|
||||
exit 0
|
||||
;;
|
||||
-h|*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
fi
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=6.1.1.2
|
||||
PKG_VERSION:=6.1.1.9
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=d0ff409ffe6bb03c97e14b34932f437f58f4e241
|
||||
PKG_SOURCE_VERSION:=8779b993dc8075aa48525340b9e86e13fa7ac54b
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -86,6 +86,12 @@ generate_multiap_config() {
|
||||
[ "$disable_mlo" == "1" ] || {
|
||||
uci set wireless.$dev.mlo="1"
|
||||
uci set wireless.$dev.mlo_capable="1"
|
||||
|
||||
# Prevent driver crash for extender - remove it after fix
|
||||
[ "$network_mode" == "extender" -a "$mode_band" == "6" ] && {
|
||||
uci set wireless.$dev.mlo="0"
|
||||
uci set wireless.$dev.mlo_capable="0"
|
||||
}
|
||||
uci commit wireless
|
||||
|
||||
# Disable for MLD/MLO
|
||||
@@ -199,11 +205,16 @@ map_genconf () {
|
||||
else
|
||||
uci set mapcontroller.controller.enabled="1"
|
||||
[ "$disable_mlo" == "1" ] && {
|
||||
mapcontroller_disable_mld() {
|
||||
uci set mapcontroller.$1.enabled='0'
|
||||
mapcontroller_remove_mld() {
|
||||
uci delete mapcontroller.$1
|
||||
}
|
||||
mapcontroller_remove_mld_id() {
|
||||
uci delete mapcontroller.$1.mld_id
|
||||
}
|
||||
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_disable_mld mld
|
||||
config_foreach mapcontroller_remove_mld mld
|
||||
config_foreach mapcontroller_remove_mld_id ap
|
||||
}
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=6.1.1.3
|
||||
PKG_VERSION:=6.1.1.5
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=ae18a1d747c0b89d55ed3eb3cd6d8a1b4499805d
|
||||
PKG_SOURCE_VERSION:=cb27de727b787bdb58bc4bf42fdef8732cb78134
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
24
mcastmngr/files/common/etc/hotplug.d/ethernet/mcast.hotplug
Executable file
24
mcastmngr/files/common/etc/hotplug.d/ethernet/mcast.hotplug
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$LINK" = "up" -a -n "$PORT" ] || exit 0
|
||||
|
||||
compare_mcast_snooping_interface() {
|
||||
local interface dev running
|
||||
|
||||
config_get interface "$1" interface
|
||||
|
||||
for dev in $interface; do
|
||||
if [ "$PORT" = "$dev" ]; then
|
||||
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
|
||||
if [ -z "${running}" ]; then
|
||||
/etc/init.d/mcast start
|
||||
else
|
||||
ubus call uci commit '{"config":"mcast"}'
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_load mcast
|
||||
config_foreach compare_mcast_snooping_interface "snooping"
|
||||
20
mcastmngr/files/common/etc/hotplug.d/iface/mcast.hotplug
Normal file → Executable file
20
mcastmngr/files/common/etc/hotplug.d/iface/mcast.hotplug
Normal file → Executable file
@@ -1,27 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
[ "$ACTION" = "ifup" -a -n "$INTERFACE" ] || exit 0
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
network_get_device l3device $INTERFACE
|
||||
network_get_device l3device "$INTERFACE"
|
||||
|
||||
[ -n "$l3device" ] || exit 0
|
||||
|
||||
compare_mcast_proxy_upstream() {
|
||||
local upstream
|
||||
local mode="$2"
|
||||
local upstream dev running
|
||||
|
||||
if [ "$mode" == "proxy" ]; then
|
||||
config_get upstream $1 upstream_interface
|
||||
else
|
||||
config_get upstream $1 interface
|
||||
fi
|
||||
config_get upstream "$1" upstream_interface
|
||||
|
||||
for dev in $upstream; do
|
||||
if [ "$l3device" == "$dev" ]; then
|
||||
if [ "$l3device" = "$dev" ]; then
|
||||
running=$(ubus call service list '{"name": "mcast"}' | jsonfilter -e '@.mcast.instances')
|
||||
if [ -z "${running}" ];then
|
||||
if [ -z "${running}" ]; then
|
||||
/etc/init.d/mcast start
|
||||
else
|
||||
ubus call uci commit '{"config":"mcast"}'
|
||||
@@ -32,5 +27,4 @@ compare_mcast_proxy_upstream() {
|
||||
}
|
||||
|
||||
config_load mcast
|
||||
config_foreach compare_mcast_proxy_upstream "proxy" "proxy"
|
||||
config_foreach compare_mcast_proxy_upstream "snooping" "snooping"
|
||||
config_foreach compare_mcast_proxy_upstream "proxy"
|
||||
|
||||
@@ -22,6 +22,11 @@ config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
select OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
bool "Adds a test controller by default (local access only)"
|
||||
default n
|
||||
|
||||
config OBUSPA_MAX_CONTROLLERS_NUM
|
||||
int "The maximum number of controllers to be supported"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=8.0.1.7
|
||||
PKG_VERSION:=8.0.5.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=0997eebe269d766eb738b80e4d5ccd40baf79090
|
||||
PKG_SOURCE_VERSION:=eb7bddb8c0bd00b7e5d33daa9d51725309ac50b9
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -32,7 +32,9 @@ define Package/obuspa
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates \
|
||||
+OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-ssl +OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-client-ssl \
|
||||
+OBUSPA_ENABLE_TEST_CONTROLLER:mosquitto-auth-shadow
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -127,6 +129,9 @@ define Package/obuspa/install
|
||||
$(INSTALL_BIN) ./files/obuspa.hotplug $(1)/etc/hotplug.d/iface/21-obuspa
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) ./files/etc/bbfdm/json/USPAgent.json $(1)
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/54-test-usp-remote $(1)/etc/uci-defaults/
|
||||
endif
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL),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
|
||||
|
||||
20
obuspa/files/etc/uci-defaults/54-test-usp-remote
Normal file
20
obuspa/files/etc/uci-defaults/54-test-usp-remote
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ ! -f "/etc/config/mosquitto" ]; then
|
||||
echo "Local mosquitto broker not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
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 auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
# Install test MQTT over WS listener
|
||||
add_usp_test
|
||||
@@ -40,16 +40,6 @@ add_obuspa_test_controller()
|
||||
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
|
||||
@@ -60,11 +50,8 @@ add_obuspa_config()
|
||||
}
|
||||
|
||||
# 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
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
diff --git a/src/core/device.h b/src/core/device.h
|
||||
index 5e367b7..db154a5 100644
|
||||
--- a/src/core/device.h
|
||||
+++ b/src/core/device.h
|
||||
@@ -330,6 +330,10 @@ int DEVICE_MTP_ValidateMqttReference(dm_req_t *req, char *value);
|
||||
void DEVICE_CONTROLLER_SetRolesFromMqtt(int mqtt_instance, int role_instance);
|
||||
char *DEVICE_CONTROLLER_GetControllerTopic(int mqtt_instance);
|
||||
@@ -336,6 +336,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
|
||||
int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void);
|
||||
#endif
|
||||
|
||||
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt);
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_conn_t *mpc);
|
||||
+#endif
|
||||
+
|
||||
#ifndef REMOVE_USP_BROKER
|
||||
int DEVICE_SUBSCRIPTION_RouteNotification(Usp__Msg *usp, int instance);
|
||||
bool DEVICE_SUBSCRIPTION_MarkVendorLayerSubs(int broker_instance, subs_notify_t notify_type, char *path, int group_id);
|
||||
diff --git a/src/core/device_controller.c b/src/core/device_controller.c
|
||||
index 97ca11d..19c91f1 100644
|
||||
--- a/src/core/device_controller.c
|
||||
+++ b/src/core/device_controller.c
|
||||
@@ -952,6 +952,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage(mtp_send_item_t *msi, char *endpoint_id
|
||||
@@ -967,6 +967,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -30,12 +26,12 @@ index 97ca11d..19c91f1 100644
|
||||
+** This function is used by ValidateUspRecord() to determine whether to process a received USP message
|
||||
+**
|
||||
+** \param endpoint_id - Endpoint ID of controller that sent a USP message
|
||||
+** \param mrt - pointer to structure specifying on which MTP the message was received
|
||||
+** \param mpc - pointer to structure specifying on which MTP the message was received
|
||||
+**
|
||||
+** \return true if the MTP is allowed, false otherwise
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt)
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_conn_t *mpc)
|
||||
+{
|
||||
+ controller_t *cont = FindEnabledControllerByEndpointId(endpoint_id);
|
||||
+ controller_mtp_t *mtp;
|
||||
@@ -46,18 +42,18 @@ index 97ca11d..19c91f1 100644
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ mtp = FindFirstEnabledMtp(cont, mrt->protocol);
|
||||
+ mtp = FindFirstEnabledMtp(cont, mpc->protocol);
|
||||
+
|
||||
+#ifdef ENABLE_WEBSOCKETS
|
||||
+ // Allow websocket server if no other MTP is configured
|
||||
+ if ((mrt->protocol == kMtpProtocol_WebSockets) && (mrt->wsserv_conn_id != INVALID))
|
||||
+ if ((mpc->protocol == kMtpProtocol_WebSockets) && (mpc->ws.serv_conn_id != INVALID))
|
||||
+ {
|
||||
+ return mtp == NULL;
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ // Disallow if there is no MTP configured with matching protocol
|
||||
+ if ((mtp == NULL) || (mtp->protocol != mrt->protocol))
|
||||
+ if ((mtp == NULL) || (mtp->protocol != mpc->protocol))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
@@ -67,7 +63,7 @@ index 97ca11d..19c91f1 100644
|
||||
+ {
|
||||
+#ifndef DISABLE_STOMP
|
||||
+ case kMtpProtocol_STOMP:
|
||||
+ return mtp->stomp_connection_instance == mrt->stomp_instance;
|
||||
+ return mtp->stomp_connection_instance == mpc->stomp.instance;
|
||||
+#endif
|
||||
+
|
||||
+#ifdef ENABLE_COAP
|
||||
@@ -77,12 +73,12 @@ index 97ca11d..19c91f1 100644
|
||||
+
|
||||
+#ifdef ENABLE_MQTT
|
||||
+ case kMtpProtocol_MQTT:
|
||||
+ return mtp->mqtt_connection_instance == mrt->mqtt_instance;
|
||||
+ return mtp->mqtt_connection_instance == mpc->mqtt.instance;
|
||||
+#endif
|
||||
+
|
||||
+#ifdef ENABLE_WEBSOCKETS
|
||||
+ case kMtpProtocol_WebSockets:
|
||||
+ return (mrt->wsclient_cont_instance == cont->instance) && (mrt->wsclient_mtp_instance == mtp->instance);
|
||||
+ return (mpc->ws.client_cont_instance == cont->instance) && (mpc->ws.client_mtp_instance == mtp->instance);
|
||||
+#endif
|
||||
+ default:
|
||||
+ TERMINATE_BAD_CASE(mtp->protocol);
|
||||
@@ -96,17 +92,15 @@ index 97ca11d..19c91f1 100644
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DEVICE_CONTROLLER_IsMTPConfigured
|
||||
diff --git a/src/core/msg_handler.c b/src/core/msg_handler.c
|
||||
index 2a04d39..0b3074b 100644
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -1206,6 +1206,15 @@ int ValidateUspRecord(UspRecord__Record *rec, mtp_conn_t *mtpc)
|
||||
@@ -1210,6 +1210,15 @@ int ValidateUspRecord(UspRecord__Record
|
||||
usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0);
|
||||
#endif
|
||||
|
||||
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
+ // Exit if the controller is not allowed to use the MTP on which the message was received
|
||||
+ if (DEVICE_CONTROLLER_IsMTPAllowed(rec->from_id, mrt) == false)
|
||||
+ if (DEVICE_CONTROLLER_IsMTPAllowed(rec->from_id, mtpc) == false)
|
||||
+ {
|
||||
+ USP_ERR_SetMessage("%s: Ignoring message from endpoint_id=%s (unauthorized MTP)", __FUNCTION__, rec->from_id);
|
||||
+ return USP_ERR_PERMISSION_DENIED;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -758,10 +758,6 @@ int ExecuteCli_Get(char *arg1, char *arg
|
||||
@@ -785,10 +785,6 @@ int ExecuteCli_Get(char *arg1, char *arg
|
||||
USP_ASSERT(gge->value != NULL);
|
||||
SendCliResponse("%s => %s\n", gge->path, gge->value);
|
||||
}
|
||||
@@ -11,36 +11,3 @@
|
||||
}
|
||||
|
||||
GROUP_GET_VECTOR_Destroy(&ggv);
|
||||
--- a/src/core/handle_get.c
|
||||
+++ b/src/core/handle_get.c
|
||||
@@ -260,26 +260,16 @@ void FormPathExprResponse(int get_expr_i
|
||||
return;
|
||||
}
|
||||
|
||||
- // If there was an error in getting any of the parameters associated with the path expression,
|
||||
- // then just add the first error, without any of the parameter values, for this path expression result
|
||||
- for (i=0; i < gi->num_entries; i++)
|
||||
- {
|
||||
- gge = &ggv->vector[gi->index + i];
|
||||
- if (gge->err_code != USP_ERR_OK)
|
||||
- {
|
||||
- (void)AddGetResp_ReqPathRes(resp, path_expr, gge->err_code, gge->err_msg);
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
// If the code gets here, then the value of all parameters were retrieved successfully, so add their values to the result_params
|
||||
req_path_result = AddGetResp_ReqPathRes(resp, path_expr, USP_ERR_OK, "");
|
||||
for (i=0; i < gi->num_entries; i++)
|
||||
{
|
||||
gge = &ggv->vector[gi->index + i];
|
||||
|
||||
- // Simple format contains a resolved_path_result for every object (and sub object)
|
||||
- AddResolvedPathResult(req_path_result, gge->path, gge->value);
|
||||
+ if (gge->err_code == USP_ERR_OK) {
|
||||
+ // Simple format contains a resolved_path_result for every object (and sub object)
|
||||
+ AddResolvedPathResult(req_path_result, gge->path, gge->value);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- a/src/protobuf-c/protobuf-c.c
|
||||
+++ b/src/protobuf-c/protobuf-c.c
|
||||
@@ -1926,6 +1926,7 @@ repeated_field_pack_to_buffer(const Prot
|
||||
buffer->append(buffer, rv, scratch);
|
||||
tmp = pack_buffer_packed_payload(field, count, array, buffer);
|
||||
assert(tmp == payload_len);
|
||||
+ (void)tmp; // Keep cmake production build happy
|
||||
return rv + payload_len;
|
||||
} else {
|
||||
size_t siz;
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -233,6 +233,8 @@ void HandleMqttDisconnect(mqtt_client_t
|
||||
@@ -241,6 +241,8 @@ void AddConnackSubscription(mqtt_client_
|
||||
#define DEFINE_MQTT_TrustCertVerifyCallbackIndex(index) \
|
||||
int MQTT_TrustCertVerifyCallback_##index (int preverify_ok, X509_STORE_CTX *x509_ctx) \
|
||||
{\
|
||||
@@ -9,7 +9,7 @@
|
||||
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
|
||||
}
|
||||
|
||||
@@ -243,6 +245,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
@@ -251,6 +253,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
|
||||
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
|
||||
@@ -21,7 +21,7 @@
|
||||
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
@@ -253,10 +260,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
@@ -261,10 +268,15 @@ ssl_verify_callback_t* mqtt_verify_callb
|
||||
MQTT_TrustCertVerifyCallbackIndex(2),
|
||||
MQTT_TrustCertVerifyCallbackIndex(3),
|
||||
MQTT_TrustCertVerifyCallbackIndex(4),
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -63,6 +63,8 @@
|
||||
|
||||
#include <mosquitto.h>
|
||||
|
||||
+#include <curl/curl.h>
|
||||
+
|
||||
// Defines for MQTT Property Values
|
||||
#define PUBLISH 0x30
|
||||
#define CONTENT_TYPE 3
|
||||
@@ -2192,6 +2194,75 @@ exit:
|
||||
}
|
||||
}
|
||||
|
||||
+static int _check_host_rechability(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
|
||||
+{
|
||||
+ bool *palive = (bool *)userp;
|
||||
+
|
||||
+ USP_ASSERT(palive != NULL);
|
||||
+ switch(type) {
|
||||
+ case CURLINFO_HEADER_OUT:
|
||||
+ case CURLINFO_HEADER_IN:
|
||||
+ *palive = true;
|
||||
+ break;
|
||||
+ case CURLINFO_TEXT:
|
||||
+ {
|
||||
+ USP_LOG_Debug("CURL DATA:: [%s]", data);
|
||||
+ if (strstr(data, "Connected to ") != NULL) {
|
||||
+ *palive = true;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int check_mqtt_host_reachability(mqtt_client_t *client)
|
||||
+{
|
||||
+ CURL *curl;
|
||||
+ mqtt_conn_params_t *cparam = &client->conn_params;
|
||||
+ char buffer[128] = {0};
|
||||
+ int ret = USP_ERR_INTERNAL_ERROR;
|
||||
+ bool is_alive = false;
|
||||
+
|
||||
+ curl = curl_easy_init();
|
||||
+ if(curl) {
|
||||
+ USP_SNPRINTF(buffer, 128, "mqtt://%s:%d", cparam->host, cparam->port);
|
||||
+ curl_easy_setopt(curl, CURLOPT_URL, buffer);
|
||||
+
|
||||
+ if (strlen(cparam->username) > 0) {
|
||||
+ curl_easy_setopt(curl, CURLOPT_USERNAME, cparam->username);
|
||||
+ }
|
||||
+
|
||||
+ if (strlen(cparam->password) > 0) {
|
||||
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, cparam->password);
|
||||
+ }
|
||||
+
|
||||
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
+ curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &is_alive);
|
||||
+ curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, _check_host_rechability);
|
||||
+
|
||||
+ /* complete within 2 seconds */
|
||||
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, 2L);
|
||||
+
|
||||
+ ret = curl_easy_perform(curl);
|
||||
+ /* Check for errors */
|
||||
+ if(ret == CURLE_OK || ret == CURLE_URL_MALFORMAT || is_alive == true) {
|
||||
+ USP_LOG_Debug("CURL MQTT host %s, ret %d, alive %d ...", buffer, ret, is_alive);
|
||||
+ ret = USP_ERR_OK;
|
||||
+ } else {
|
||||
+ USP_LOG_Info("# CURL MQTT host %s unreachable: %d=>%s ...", buffer, ret, curl_easy_strerror(ret));
|
||||
+ }
|
||||
+
|
||||
+ /* always cleanup */
|
||||
+ curl_easy_cleanup(curl);
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** PerformMqttClientConnect
|
||||
@@ -2261,6 +2332,14 @@ int PerformMqttClientConnect(mqtt_client
|
||||
keep_alive = 5;
|
||||
}
|
||||
|
||||
+ // Below function is a workaround to check the host reachability with a timeout
|
||||
+ // mosquitto_connect_* API block the thread for 2 mins if host is not reachable,
|
||||
+ // which halts other clients connectivity
|
||||
+ err = check_mqtt_host_reachability(client);
|
||||
+ if (err != USP_ERR_OK) {
|
||||
+ err = USP_ERR_INTERNAL_ERROR;
|
||||
+ goto exit;
|
||||
+ }
|
||||
// Release the access mutex temporarily whilst performing the connect call
|
||||
// We do this to prevent the data model thread from potentially being blocked, whilst the connect call is taking place
|
||||
OS_UTILS_UnlockMutex(&mqtt_access_mutex);
|
||||
82
obuspa/patches/0014-persist-connack-clientid.patch
Normal file
82
obuspa/patches/0014-persist-connack-clientid.patch
Normal file
@@ -0,0 +1,82 @@
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -63,6 +63,8 @@
|
||||
#include "retry_wait.h"
|
||||
#include "text_utils.h"
|
||||
#include "msg_handler.h"
|
||||
+#include "data_model.h"
|
||||
+#include "usp_api.h"
|
||||
|
||||
// Defines for MQTT Property Values
|
||||
#define PUBLISH 0x30
|
||||
@@ -2613,6 +2615,37 @@ exit:
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
+** handle_db_set_client_id
|
||||
+**
|
||||
+** Allows the caller to set client Id in DB from the data model thread
|
||||
+**
|
||||
+** \param arg1 - pointer to the client id path
|
||||
+** \param arg2 - pointer to the client id value
|
||||
+**
|
||||
+** \return None
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+void handle_db_set_client_id(void *arg1, void *arg2)
|
||||
+{
|
||||
+ if ((arg1 == NULL) || (arg2 == NULL)) {
|
||||
+ USP_SAFE_FREE(arg1);
|
||||
+ USP_SAFE_FREE(arg2);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ char *param_path = (char *)arg1;
|
||||
+ char *param_val = (char *)arg2;
|
||||
+
|
||||
+ if (USP_ERR_OK != DATA_MODEL_SetParameterInDatabase(param_path, param_val)) {
|
||||
+ USP_LOG_Debug("%s: Failed to set %s=>%s from CONNACK", __FUNCTION__, param_path, param_val);
|
||||
+ }
|
||||
+
|
||||
+ USP_SAFE_FREE(param_path);
|
||||
+ USP_SAFE_FREE(param_val);
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
** ConnectV5Callback
|
||||
**
|
||||
** Called by Libmosquitto when the CONNACK packet is received on an MQTTv5 connection
|
||||
@@ -2685,10 +2718,28 @@ void ConnectV5Callback(struct mosquitto
|
||||
&client_id_ptr, false /* skip first */) != NULL)
|
||||
{
|
||||
USP_LOG_Debug("%s: Received client_id: \"%s\"", __FUNCTION__, client_id_ptr);
|
||||
- USP_SAFE_FREE(client->conn_params.client_id);
|
||||
- client->conn_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
- USP_SAFE_FREE(client->next_params.client_id);
|
||||
- client->next_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
+
|
||||
+ if (client->conn_params.client_id == NULL || strcmp(client->conn_params.client_id, client_id_ptr) != 0) {
|
||||
+ USP_SAFE_FREE(client->conn_params.client_id);
|
||||
+ client->conn_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
+ USP_SAFE_FREE(client->next_params.client_id);
|
||||
+ client->next_params.client_id = USP_STRDUP(client_id_ptr);
|
||||
+
|
||||
+ // Persist client id from CONNACK in DB
|
||||
+ char buf[128] = {0}, *param_path = NULL, *param_val = NULL;
|
||||
+
|
||||
+ snprintf(buf, 128, "Device.MQTT.Client.%d.ClientID", instance);
|
||||
+
|
||||
+ param_path = USP_STRDUP(buf);
|
||||
+ param_val = USP_STRDUP(client_id_ptr);
|
||||
+
|
||||
+ if (USP_ERR_OK != USP_PROCESS_DoWork(handle_db_set_client_id, param_path, param_val)) {
|
||||
+ USP_LOG_Debug("%s: Failed to schedule set in data model thread for client id from CONNACK", __FUNCTION__);
|
||||
+ USP_SAFE_FREE(param_path);
|
||||
+ USP_SAFE_FREE(param_val);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
free(client_id_ptr);
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=packet-capture-diagnostics
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/packet-capture-diagnostics.git
|
||||
PKG_SOURCE_VERSION:=a47189b5faa9f678f1a27475c474cc1524d777f4
|
||||
PKG_SOURCE_VERSION:=6c64e11d78b3be9990714bf5fcd97752cc15c4a8
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.5.11
|
||||
PKG_VERSION:=1.5.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=0bfe78ce9daf1cfbe9453e2cb08327dc7885cea2
|
||||
PKG_SOURCE_VERSION:=e59f980306e9ef4c1e3e56839906b8c5cba18338
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.0.15
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=1b51a78b886ff1099128537437658ba7c140100f
|
||||
PKG_SOURCE_VERSION:=f6b77d16d2103b7336a476e710a10f1dd28274f6
|
||||
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
|
||||
@@ -36,6 +36,8 @@ define Package/qosmngr/description
|
||||
Configures L2 QoS and collects queue statistics
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./qosmngr/* $(PKG_BUILD_DIR)/
|
||||
@@ -54,6 +56,7 @@ endif
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qosmngr $(1)/usr/sbin
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/libqos_bbf.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libqos_vendor_bbf.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,qosmngr))
|
||||
|
||||
@@ -150,6 +150,15 @@ broute_filter_on_vid() {
|
||||
}
|
||||
|
||||
broute_append_rule() {
|
||||
# if src_if is loopback, then add the rule to OUTPUT(qos_output) chain of nat table
|
||||
if [ "$src_if" = "lo" ]; then
|
||||
echo "ebtables --concurrent -t nat -A qos_output $BR_RULE" >> /tmp/qos/classify.ebtables
|
||||
if [ -n "$BR6_RULE" ]; then
|
||||
echo "ebtables --concurrent -t nat -A qos_output $BR6_RULE" >> /tmp/qos/classify.ebtables
|
||||
fi
|
||||
return
|
||||
fi
|
||||
|
||||
local broute_chain="$1"
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed otherwise install ipv6 proto rule only.
|
||||
@@ -449,9 +458,9 @@ handle_ebtables_rules() {
|
||||
|
||||
if [ -n "$BR_RULE" ]; then
|
||||
if [ -n "$vid_mark" ] || [ -n "$pcp_mark" ]; then
|
||||
broute_append_rule "prevlanxlate"
|
||||
broute_append_rule "prevlanxlate" "$src_if"
|
||||
else
|
||||
broute_append_rule "qos"
|
||||
broute_append_rule "qos" "$src_if"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -501,6 +510,15 @@ handle_ebtables_dscp2pbit() {
|
||||
|
||||
create_ebtables_chains() {
|
||||
|
||||
ebtables --concurrent -t nat -N qos_output -P RETURN 2> /dev/null
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
ebtables --concurrent -t nat -A OUTPUT -j qos_output
|
||||
else
|
||||
ebtables --concurrent -t nat -D OUTPUT -j qos_output
|
||||
ebtables --concurrent -t nat -A OUTPUT -j qos_output
|
||||
fi
|
||||
|
||||
ebtables --concurrent -t broute -N dscp2pbits -P RETURN 2> /dev/null
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
@@ -531,8 +549,9 @@ create_ebtables_chains() {
|
||||
}
|
||||
|
||||
flush_ebtables_chains() {
|
||||
echo "ebtables -t broute -F qos" > /tmp/qos/classify.ebtables
|
||||
echo "ebtables -t broute -F dscp2pbits" >> /tmp/qos/classify.ebtables
|
||||
echo "ebtables -t broute -F prevlanxlate" >> /tmp/qos/classify.ebtables
|
||||
echo "ebtables --concurrent -t nat -F qos_output" > /tmp/qos/classify.ebtables
|
||||
echo "ebtables --concurrent -t broute -F qos" > /tmp/qos/classify.ebtables
|
||||
echo "ebtables --concurrent -t broute -F dscp2pbits" >> /tmp/qos/classify.ebtables
|
||||
echo "ebtables --concurrent -t broute -F prevlanxlate" >> /tmp/qos/classify.ebtables
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=self-diagnostics
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
@@ -62,12 +62,8 @@
|
||||
"cmd": "bridge fdb"
|
||||
},
|
||||
{
|
||||
"description": "TCP listened ports",
|
||||
"cmd": "netstat -tlnp"
|
||||
},
|
||||
{
|
||||
"description": "UDP listened ports",
|
||||
"cmd": "netstat -ulnp"
|
||||
"description": "TCP/UDP/Raw ports/Sockets",
|
||||
"cmd": "netstat -anp"
|
||||
},
|
||||
{
|
||||
"description": "MAC layer firewall status list",
|
||||
|
||||
@@ -78,8 +78,8 @@ int operate_Device_SelfTest(char *refparam, struct dmctx *ctx, void *data, char
|
||||
/* Get self test log instance */
|
||||
char *result = get_selftest_log_instance(ctx);
|
||||
|
||||
add_list_parameter(ctx, dmstrdup("Status"), dmstrdup("Complete"), DMT_TYPE[DMT_STRING], NULL);
|
||||
add_list_parameter(ctx, dmstrdup("Results"), result, DMT_TYPE[DMT_STRING], NULL);
|
||||
fill_blob_param(&ctx->bb, "Status", "Complete", DMT_TYPE[DMT_STRING], 0);
|
||||
fill_blob_param(&ctx->bb, "Results", result, DMT_TYPE[DMT_STRING], 0);
|
||||
|
||||
if (ctx->dm_type != BBFDM_USP) {
|
||||
diagnostics_set_option("selftest", "DiagnosticState", "Complete");
|
||||
@@ -89,7 +89,7 @@ int operate_Device_SelfTest(char *refparam, struct dmctx *ctx, void *data, char
|
||||
return 0;
|
||||
|
||||
err:
|
||||
add_list_parameter(ctx, dmstrdup("Status"), dmstrdup("Error_Internal"), DMT_TYPE[DMT_STRING], NULL);
|
||||
fill_blob_param(&ctx->bb, "Status", "Error_Internal", DMT_TYPE[DMT_STRING], 0);
|
||||
if (ctx->dm_type != BBFDM_USP) {
|
||||
diagnostics_set_option("selftest", "DiagnosticState", "Error");
|
||||
dmuci_commit_package_bbfdm(DMMAP_DIAGNOSTIGS);
|
||||
|
||||
@@ -101,3 +101,81 @@ 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.
|
||||
|
||||
# How to create a new Sulu user with Role Based Access Controller
|
||||
Sulu has a predefined set of users, but if it is required to add user with more/less datamodel access rights, that can be done from a USP Controller(sulu etc) or by using the command line tool.
|
||||
|
||||
In the below example, I use command line tool, but same operations can be done from controller as well to configure it, so we need
|
||||
- New user
|
||||
- New user role
|
||||
- Changes in UserInterface Instance to use the new user role
|
||||
- A ControllerTrust role to define datamodel access aligned with user role
|
||||
- Update the sulu controller to use the above role
|
||||
|
||||
Some global variables before proceeding further
|
||||
|
||||
```bash
|
||||
export UNAME=testuser
|
||||
export UPASS=testuser123
|
||||
```
|
||||
## Create an User Role
|
||||
|
||||
```bash
|
||||
ROLE="$(obuspa -c add Device.Users.Role. |cut -d " " -f 2)"
|
||||
|
||||
obuspa -c set ${ROLE}.RoleName ${UNAME}
|
||||
obuspa -c set ${ROLE}.Enable 1
|
||||
```
|
||||
|
||||
## Create an User
|
||||
|
||||
```bash
|
||||
USER="$(obuspa -c add Device.Users.User. |cut -d " " -f 2)"
|
||||
|
||||
obuspa -c set ${USER}.Username ${UNAME}
|
||||
obuspa -c set ${USER}.Password ${UPASS}
|
||||
obuspa -c set ${USER}.RoleParticipation ${ROLE}
|
||||
obuspa -c set ${USER}.Enable 1
|
||||
```
|
||||
|
||||
## Update UserInterface to use the new UserRole
|
||||
|
||||
Sulu has a reload hook to setup the necessary obuspa/mosquitto configuration, so no need to do LocalAgent Controller/MTP setup, this will reload obuspa service after uci update, so we have to wait for service to come up.
|
||||
|
||||
```bash
|
||||
bbfdmd -c set Device.UserInterface.HTTPAccess.1.AllowedRoles "Device.Users.Role.1,${ROLE}"
|
||||
|
||||
sleep 30
|
||||
```
|
||||
|
||||
## Create a ControllerTrust role aligned with user role
|
||||
|
||||
In this example, full access of 'Device.' added for the new user
|
||||
|
||||
```bash
|
||||
CTROLE="$(obuspa -c add Device.LocalAgent.ControllerTrust.Role. | cut -d " " -f 2)"
|
||||
|
||||
PERM="$(obuspa -c add ${CTROLE}.Permission. |cut -d " " -f 2)"
|
||||
|
||||
obuspa -c set ${PERM}.Targets Device.
|
||||
obuspa -c set ${PERM}.Param rw-n
|
||||
obuspa -c set ${PERM}.Obj rw-n
|
||||
obuspa -c set ${PERM}.InstantiatedObj rw-n
|
||||
obuspa -c set ${PERM}.CommandEvent r-xn
|
||||
obuspa -c set ${PERM}.Enable 1
|
||||
obuspa -c set ${CTROLE}.Enable 1
|
||||
```
|
||||
|
||||
## Set new role to Controller
|
||||
|
||||
```bash
|
||||
obuspa -c set Device.LocalAgent.Controller.[EndpointID==self::sulu-${UNAME}].AssignedRole "${CTROLE}"
|
||||
```
|
||||
|
||||
After these configuration reboot the device
|
||||
|
||||
```bash
|
||||
reboot
|
||||
```
|
||||
|
||||
After device boots sulu should be able to login with newly added user.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=3.1.61
|
||||
PKG_VERSION:=3.1.62
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
@@ -45,9 +45,7 @@ function _get_sulu_user_roles() {
|
||||
roles=$(uci -q get userinterface._sulu_s.role)
|
||||
|
||||
for role in ${roles}; do
|
||||
if [ -f "/etc/users/roles/$role.json" ]; then
|
||||
sulu_user_roles="${sulu_user_roles} ${role}"
|
||||
fi
|
||||
sulu_user_roles="${sulu_user_roles} ${role}"
|
||||
done
|
||||
|
||||
if [ -n "${sulu_user_roles}" ]; then
|
||||
@@ -284,9 +282,9 @@ function update_obuspa_config() {
|
||||
}
|
||||
|
||||
function configure_sulu() {
|
||||
update_obuspa_config
|
||||
_create_acl
|
||||
generate_sulu_conn_config
|
||||
_create_acl
|
||||
update_obuspa_config
|
||||
}
|
||||
|
||||
while getopts ":r" opt; do
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.5.10
|
||||
PKG_VERSION:=2.5.16
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=088ac916a87b4faf1aaafadc6ee77ae56674fd1c
|
||||
PKG_SOURCE_VERSION:=c36ff3594ed20d9bbc90d52adbdf7d6c186c4ce1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -3,3 +3,7 @@ config globals 'globals'
|
||||
option debug '1'
|
||||
option log_level '3'
|
||||
option lan_bridge 'br-lan'
|
||||
option root '/container'
|
||||
|
||||
config execenv 'execenv_1'
|
||||
option name 'oci'
|
||||
|
||||
@@ -241,7 +241,7 @@ start_service() {
|
||||
|
||||
env=$(uci -q get swmodd.@execenv[0].name)
|
||||
if [ -z "${root}" ] || [ -z "${bridge}" ]; then
|
||||
log "Base bundle root[$root] or bridge[$bridge] not defined"
|
||||
log "# Base bundle root[$root] or bridge[$bridge] not defined"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
|
||||
@@ -90,16 +90,17 @@ start_service() {
|
||||
# crun default runtime directory /run, if not present then create
|
||||
[ ! -d "/run" ] && ln -fs /var/run /run
|
||||
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# root [${root}] not present, creating ..."
|
||||
if [ -n "${root}" ]; then
|
||||
mkdir -p "${root}"
|
||||
else
|
||||
log "# Not starting, root [${root}] not defined"
|
||||
return 1
|
||||
if [ -L "${root}" ]; then
|
||||
if [ ! -d "${root}" ]; then
|
||||
mkdir -p $(realpath ${root})
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# Not starting, Base root [${root}] not accessible/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Currently only one execenv supported
|
||||
env_name="$(uci -q get swmodd.@execenv[0].name)"
|
||||
if [ -z "${env_name}" ]; then
|
||||
|
||||
@@ -74,7 +74,7 @@ setup_container_network() {
|
||||
}
|
||||
|
||||
run_container() {
|
||||
local bundle name bridge
|
||||
local bundle name bridge network
|
||||
|
||||
bundle="${1}"
|
||||
name="${2}"
|
||||
@@ -85,7 +85,13 @@ run_container() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
setup_container_network "${name}" "${bridge}"
|
||||
# Only do the network setup if defined in config
|
||||
network="$(cat ${BUNDLE}/${NAME}/config.json |jq '.linux.namespaces[] |select (.type == "network")')"
|
||||
if [ -n "${network}" ] ; then
|
||||
setup_container_network "${name}" "${bridge}"
|
||||
else
|
||||
log "Network not defined in config, using host network..."
|
||||
fi
|
||||
|
||||
script -q -c "crun run -b ${bundle}/${name} ${name}" /dev/null
|
||||
}
|
||||
@@ -139,7 +145,6 @@ update_config_json() {
|
||||
fi
|
||||
|
||||
# Update cabalities
|
||||
log "## PERM [$PERM], Name [${NAME}] ##"
|
||||
if [ -n "${PERM}" ]; then
|
||||
log "Updating Permission in the json ..."
|
||||
PERM="${PERM//,/ }"
|
||||
|
||||
@@ -10,32 +10,31 @@ configure_ee_path() {
|
||||
config_get oci_bundle globals oci_bundle_root ""
|
||||
|
||||
mkdir -p /etc/lxc
|
||||
if [ -n "${lxc_bundle}" ]; then
|
||||
# if lxc_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${lxc_bundle##/*/})
|
||||
root=$(echo ${lxc_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals lxc_bundle_root ""
|
||||
fi
|
||||
|
||||
if [ -n "${oci_bundle}" ]; then
|
||||
# if oci_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${oci_bundle##/*/})
|
||||
root=$(echo ${oci_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${oci_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -n "${lxc_bundle}" ]; then
|
||||
# if lxc_bundle_root define in swmodd, then remove it
|
||||
name=$(echo ${lxc_bundle##/*/})
|
||||
root=$(echo ${lxc_bundle%/$name})
|
||||
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -f /etc/lxc/lxc.conf ]; then
|
||||
bundle_path=$(cat /etc/lxc/lxc.conf | grep "lxc.lxcpath" | cut -d "=" -f 2 | sed 's/[[:blank:]]//g')
|
||||
name=$(echo ${bundle_path##/*/})
|
||||
root=$(echo ${bundle_path%/$name})
|
||||
else
|
||||
name="lxc"
|
||||
root="/srv"
|
||||
echo "lxc.lxcpath = /srv/lxc" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals oci_bundle_root ""
|
||||
fi
|
||||
|
||||
uci_set swmodd globals oci_bundle_root ""
|
||||
uci_set swmodd globals lxc_bundle_root ""
|
||||
|
||||
# configure root in globals section
|
||||
if ! uci_get swmodd globals root >/dev/null; then
|
||||
uci_set swmodd globals root ${root}
|
||||
if [ -n "${root}" ]; then
|
||||
if ! uci_get swmodd globals root >/dev/null; then
|
||||
uci_set swmodd globals root ${root}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "${name}" ]; then
|
||||
name="oci"
|
||||
fi
|
||||
|
||||
# configure execenv in swmodd
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=timemngr
|
||||
PKG_VERSION:=1.0.20
|
||||
PKG_VERSION:=1.0.22
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/timemngr.git
|
||||
PKG_SOURCE_VERSION:=f0b026bb5fffbd1c9a18b6814251b4c724aabad6
|
||||
PKG_SOURCE_VERSION:=d0dedf229e24535b5b6a284662f1560868fdcd7c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr104
|
||||
PKG_VERSION:=1.0.29
|
||||
PKG_VERSION:=1.0.32
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifeq ($(LOCAL_DEV),0)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/voice/tr104.git
|
||||
PKG_SOURCE_VERSION:=08841ec53304703eecbfcbf22824a502b97dd5e6
|
||||
PKG_SOURCE_VERSION:=5632a71e0da8d498c214469dec76d2774f3a8a15
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr143
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/tr143d.git
|
||||
PKG_SOURCE_VERSION:=6762d1efbb995be685af32af5f4b67cc4d737bcd
|
||||
PKG_SOURCE_VERSION:=54302dec291726b0e765e56b4d72ac53655e0f29
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tr471
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/tr471d.git
|
||||
PKG_SOURCE_VERSION:=036c87b237f266cf7f9fae170c37c863a5f4af2e
|
||||
PKG_SOURCE_VERSION:=69b4d324f2b2c78d858b0446dcb90dba9d5f60c3
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=urlfilter
|
||||
PKG_VERSION:=1.1.14
|
||||
PKG_VERSION:=1.1.15
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/urlfilter.git
|
||||
PKG_SOURCE_VERSION:=ebf8afb44ff808d3b99c45a7c636fb12a774f357
|
||||
PKG_SOURCE_VERSION:=b68c9bb94c24a7394997522e982e37d85e172e0c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -17,11 +17,17 @@ configure_firewall()
|
||||
iptables -w -I FORWARD 2 -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I FORWARD 3 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I FORWARD 4 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I FORWARD 5 -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I FORWARD 6 -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I INPUT 1 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I INPUT 2 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I INPUT 3 -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -I INPUT 4 -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
|
||||
# disable acceleration for https packet so that they can be read by urlfilter
|
||||
ebtables --concurrent -A FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -A FORWARD -p ip --ip-protocol 6 --ip-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -A FORWARD -p ip --ip-protocol 17 --ip-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
fi
|
||||
ip6tables -w -nL FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
@@ -30,11 +36,17 @@ configure_firewall()
|
||||
ip6tables -w -I FORWARD 2 -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I FORWARD 3 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I FORWARD 4 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I FORWARD 5 -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I FORWARD 6 -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I INPUT 1 -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I INPUT 2 -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I INPUT 3 -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -I INPUT 4 -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
|
||||
# disable acceleration for https packet so that they can be read by urlfilter
|
||||
ebtables --concurrent -A FORWARD -p ip6 --ip6-protocol 6 --ip6-destination-port 443 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -A FORWARD -p ip6 --ip6-protocol 6 --ip6-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -A FORWARD -p ip6 --ip6-protocol 17 --ip6-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
fi
|
||||
|
||||
}
|
||||
@@ -64,9 +76,15 @@ stop_service() {
|
||||
iptables -w -D FORWARD -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D FORWARD -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D FORWARD -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D FORWARD -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D FORWARD -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
iptables -w -D INPUT -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ebtables --concurrent -D FORWARD -p ip --ip-protocol 6 --ip-destination-port 443 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -D FORWARD -p ip --ip-protocol 6 --ip-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -D FORWARD -p ip --ip-protocol 17 --ip-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
fi
|
||||
ip6tables -w -nL FORWARD|grep -iqE "NFQUEUE"
|
||||
if [ "$?" -eq 0 ]; then
|
||||
@@ -75,9 +93,15 @@ stop_service() {
|
||||
ip6tables -w -D FORWARD -p tcp --dport 443 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D FORWARD -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D FORWARD -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D FORWARD -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D FORWARD -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D INPUT -p udp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D INPUT -p udp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D INPUT -p tcp --dport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ip6tables -w -D INPUT -p tcp --sport 53 -j NFQUEUE --queue-num 0 --queue-bypass
|
||||
ebtables --concurrent -D FORWARD -p ip6 --ip6-protocol 6 --ip6-destination-port 443 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -D FORWARD -p ip6 --ip6-protocol 6 --ip6-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
ebtables --concurrent -D FORWARD -p ip6 --ip6-protocol 17 --ip6-source-port 53 -j SKIPLOG 2> /dev/null
|
||||
fi
|
||||
}
|
||||
reload_service() {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usbmngr
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/usbmngr.git
|
||||
PKG_SOURCE_VERSION:=4f5f5dd701d40cdb134b98734db75446e5736a2e
|
||||
PKG_SOURCE_VERSION:=8854939163cc60154a52834fa70677b3d1a53d46
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usermngr
|
||||
PKG_VERSION:=1.2.17
|
||||
PKG_VERSION:=1.2.18
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/usermngr.git
|
||||
PKG_SOURCE_VERSION:=4ea2dfc2843b4cdf87e48deff512ee358c93298f
|
||||
PKG_SOURCE_VERSION:=3756e698d6debe4b5038a942e7332dc733f6f816
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usp-js
|
||||
PKG_VERSION:=1.2.5
|
||||
PKG_VERSION:=1.2.6
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git
|
||||
@@ -23,7 +23,7 @@ define Package/usp-js
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=A JS library for USP(TR369) protocol
|
||||
DEPENDS:=+quickjs +quickjs-websocket +@OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
DEPENDS:=+quickjs +quickjs-websocket +@OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
EXTRA_DEPENDS:=obuspa mosquitto-ssl
|
||||
endef
|
||||
|
||||
@@ -37,9 +37,7 @@ endef
|
||||
|
||||
define Package/usp-js/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/usp-js
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) $(PKG_BUILD_DIR)/qjs/* $(1)/usr/lib/usp-js/
|
||||
$(CP) ./files/etc/* $(1)/etc/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,usp-js))
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
USE_PROCD=1
|
||||
|
||||
log()
|
||||
{
|
||||
echo "$*"|logger -t usp-js -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
|
||||
|
||||
# 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() {
|
||||
publish_endpoint
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "obuspa"
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifidmd
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/wifidmd.git
|
||||
PKG_SOURCE_VERSION:=eb3a21f1baec749cfd2d53fd3e38fdab3a6d7a4c
|
||||
PKG_SOURCE_VERSION:=6523c92cc2880ec5eebfc60d09bb5084ec504b6e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=17.2.8
|
||||
PKG_VERSION:=17.3.3
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=780c224342a3aa238504eebef1e816fac8bd4498
|
||||
PKG_SOURCE_VERSION:=fe089207eb9050dbee7dd1e214e4ce1eeeb97851
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xmppc
|
||||
PKG_VERSION:=2.2.9
|
||||
PKG_VERSION:=2.2.10
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/xmppc.git
|
||||
PKG_SOURCE_VERSION:=ff76b296e767a5732d7b07ad94c141a4a6e50ed5
|
||||
PKG_SOURCE_VERSION:=a2945d99b916ddbe3b5270446e9b8d310a104052
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -11,12 +11,25 @@ stop_service() {
|
||||
if [ "${xmpp_running}" = "true" ]; then
|
||||
procd_send_signal xmppc '*' SIGKILL
|
||||
fi
|
||||
|
||||
if [ -f "/var/state/xmppc" ]; then
|
||||
uci -q -c /var/state delete xmppc.conn_status
|
||||
uci -q -c /var/state commit xmppc
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local con_name=$(uci -q get xmpp.xmpp.conn_req_connection)
|
||||
local con_enable=$(uci -q get xmpp."${con_name}".enable)
|
||||
|
||||
if [ ! -f "/var/state/xmppc" ]; then
|
||||
touch "/var/state/xmppc"
|
||||
fi
|
||||
|
||||
uci -q -c /var/state set xmppc.global='global'
|
||||
uci -q -c /var/state set xmppc.global.last_change="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||
uci -q -c /var/state commit xmppc
|
||||
|
||||
procd_open_instance
|
||||
if [ "$con_enable" = "1" ]; then
|
||||
procd_set_param command "$PROG"
|
||||
|
||||
Reference in New Issue
Block a user