mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-01-10 14:47:26 +08:00
Compare commits
57 Commits
jo-dpp
...
rt_openvas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba737915b4 | ||
|
|
c11a5ff3db | ||
|
|
0527428f6c | ||
|
|
508ff7d041 | ||
|
|
53cdb49ba8 | ||
|
|
cdb76b1c18 | ||
|
|
8ed6bd1bfc | ||
|
|
028efc13c9 | ||
|
|
115234d93b | ||
|
|
34afbc348d | ||
|
|
8842b7e8b8 | ||
|
|
b10d8e0ec6 | ||
|
|
1ec66d5732 | ||
|
|
084691a29a | ||
|
|
d083dc041e | ||
|
|
c0c30ca012 | ||
|
|
65fbf9958d | ||
|
|
c0a6739981 | ||
|
|
81fdef1991 | ||
|
|
dc0dbb29ff | ||
|
|
aa98c2fff5 | ||
|
|
5c935f03fe | ||
|
|
b44e25c8ee | ||
|
|
822f5624b1 | ||
|
|
60f2fdd7cb | ||
|
|
6518f92be7 | ||
|
|
f674d32c4e | ||
|
|
e81c9f80cd | ||
|
|
e1fffddf85 | ||
|
|
1ddc202fd0 | ||
|
|
9ed4bea12e | ||
|
|
cebc62066b | ||
|
|
ebba65c729 | ||
|
|
0373547a79 | ||
|
|
1076ca4bd8 | ||
|
|
fda5aed59c | ||
|
|
1393125ceb | ||
|
|
8557dbc1a7 | ||
|
|
c4ca2ec55c | ||
|
|
3090636827 | ||
|
|
804e2c1568 | ||
|
|
1a2b31e159 | ||
|
|
37e930f183 | ||
|
|
c2560af1e9 | ||
|
|
1d24d5c4f7 | ||
|
|
ce5e7a3f61 | ||
|
|
a1a7bd02f5 | ||
|
|
1068ffa0eb | ||
|
|
628887b426 | ||
|
|
ec7ba74900 | ||
|
|
e383d1d145 | ||
|
|
abe813b656 | ||
|
|
d690cf904c | ||
|
|
fe82de8bd5 | ||
|
|
7a943dc49a | ||
|
|
bc2278e89b | ||
|
|
2996f2313c |
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.7.20
|
||||
PKG_VERSION:=1.7.28
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=2b62491910498d68055891b552c6d7078ce2dbc7
|
||||
PKG_SOURCE_VERSION:=fd894e7cb7bfaf695f6dccc996478589f162d38b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -143,7 +143,6 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BBFDMD="/usr/sbin/bbfdmd"
|
||||
|
||||
bbfdm_add_service()
|
||||
{
|
||||
local name path
|
||||
|
||||
name="${1}"
|
||||
path="${2}"
|
||||
|
||||
if [ -z "${name}" -o -z "$path" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
|
||||
echo "Use of bbfdm_add_service deprecated, please use bbfdm micro_service uci"
|
||||
}
|
||||
|
||||
bbfdm_stop_service()
|
||||
{
|
||||
local name
|
||||
|
||||
name="${1}"
|
||||
if [ -z "${name}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if ubus call service list '{"name":"bbfdm.services"}' |grep -q "bbfdm.$name"; then
|
||||
ubus call service delete "{'name':'bbfdm.services','instance':'bbfdm.$name'}"
|
||||
fi
|
||||
}
|
||||
|
||||
usages()
|
||||
{
|
||||
echo "Usages $0: <OPTIONS>..."
|
||||
echo
|
||||
echo " -h show help"
|
||||
echo " -k micro-service name to stop"
|
||||
echo
|
||||
}
|
||||
|
||||
while getopts "s:k:h" opts; do
|
||||
case "$opts" in
|
||||
h) usages; exit 0;;
|
||||
k) bbfdm_stop_service "${OPTARG}";;
|
||||
esac
|
||||
done
|
||||
@@ -7,7 +7,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.8
|
||||
PKG_VERSION:=2.1.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -50,7 +50,7 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/etc/config/bulkdata $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/95-bulkdata-translation-options $(1)/etc/uci-defaults/
|
||||
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=csmngr
|
||||
PKG_VERSION:=0.0.5
|
||||
PKG_VERSION:=0.0.8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dcdaba75b85bf8758c34d3ae4a1be0ba09359331
|
||||
PKG_SOURCE_VERSION:=ca899eb18b5bec38f4b8b4d08b42d89fef965c13
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/csmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.2.1.4
|
||||
PKG_VERSION:=4.4.0.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c18d0f411eea6974fc99dd9e717269087e75e874
|
||||
PKG_SOURCE_VERSION:=a42af441d0efc315714305d6b944e6b09a29b64d
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.1.5
|
||||
PKG_VERSION:=2.1.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=53d31f7027f759a36f47c026c50eaee2888619cc
|
||||
PKG_SOURCE_VERSION:=b1ca967248cc5c7b852e8a904134e0bed451a116
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -n "$PORT" -a -n "$LINK" ] || exit 0
|
||||
|
||||
case "$PORT" in
|
||||
# do not generate ethport ubus event
|
||||
# for wifi, dsl and brige devices
|
||||
wl*|wds*|atm*|ptm*|br-*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
speed=0
|
||||
duplex=full
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
devspeed="$(ubus -t 2 call network.device status "{\"name\":\"$PORT\"}" | jsonfilter -e @.speed)"
|
||||
speed=${devspeed:0:-1}
|
||||
duplex=${devspeed:0-1}
|
||||
[ "$duplex" == "H" ] && duplex="half" || duplex="full"
|
||||
fi
|
||||
|
||||
ubus send ethport "{\"ifname\":\"$PORT\",\"link\":\"$LINK\",\"speed\":\"$speed\",\"duplex\":\"$duplex\"}"
|
||||
2
ethmngr/files/etc/uci-defaults/ruleng.ethport
Normal file
2
ethmngr/files/etc/uci-defaults/ruleng.ethport
Normal file
@@ -0,0 +1,2 @@
|
||||
uci -q set ruleng.ethport=rule
|
||||
uci -q set ruleng.ethport.recipe='/etc/ruleng/ethport.json'
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.3.10
|
||||
PKG_VERSION:=8.3.15
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dc1f5af80bbea7bd03b8f87184636efd5373cd7e
|
||||
PKG_SOURCE_VERSION:=554fcccbf75e97ab73a3dbb41dc5d5367942438b
|
||||
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
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.4.3
|
||||
PKG_VERSION:=7.4.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ba80dcc51056772c906cac8022a2537b74959e6a
|
||||
PKG_SOURCE_VERSION:=7a9e69c413c2d0b950a1a2e0f2964439fb797f48
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@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.108
|
||||
PKG_VERSION:=7.2.109
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=df0181ae4e8391901a8005ffa17ff28fbce8ec64
|
||||
PKG_SOURCE_VERSION:=cc72f5ab0171cd0fc29bb48dafff6751ab2f0d9c
|
||||
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
|
||||
|
||||
@@ -10,7 +10,7 @@ PKG_VERSION:=7.2.106
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=02dba6571fddd9b4c5b4b671270604b4c0faf9ae
|
||||
PKG_SOURCE_VERSION:=0e54d7a992c506d6302d7cc32a39eb64e9b2c42e
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.50
|
||||
PKG_VERSION:=7.4.57
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=665fd6fd51d2676b4384938e695157f9a2e937b4
|
||||
PKG_SOURCE_VERSION:=324c17e9b1f3c4c2413e87d3baace95f3ab94083
|
||||
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
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.6.0.0
|
||||
PKG_VERSION:=4.6.0.3
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=34314514affb47a11b85d4cfe30211fa7a94abff
|
||||
PKG_SOURCE_VERSION:=4ecb56d8069896c1ca555e2acdbac94126002add
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
config agent 'agent'
|
||||
option enabled '0'
|
||||
option enabled '1'
|
||||
option debug '0'
|
||||
option profile '3'
|
||||
option al_bridge 'br-lan'
|
||||
option island_prevention '0'
|
||||
option island_prevention '1'
|
||||
option eth_onboards_wifi_bhs '1'
|
||||
option scan_on_boot_only '0'
|
||||
option chan_ch_relay_mcast '0'
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
generate_mapagent_config=0
|
||||
generate_wireless_sta_config=0
|
||||
|
||||
network_mode="$(fw_printenv -n netmode)"
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)"
|
||||
network_mode="$(fw_printenv -n netmode)" # default is layer3
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)" # default is full
|
||||
|
||||
is_airoha() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
@@ -175,16 +175,15 @@ map_genconf () {
|
||||
elif [ "$multiap_mode" == "auto" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=0
|
||||
elif [ "$multiap_mode" == "full" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=1
|
||||
elif [ "$multiap_mode" == "none" ]; then
|
||||
uci set mapagent.agent.enabled="0"
|
||||
else # default to full
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=1
|
||||
fi
|
||||
uci -q commit mapagent
|
||||
fi
|
||||
|
||||
|
||||
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
|
||||
uci set mapcontroller.controller.enabled="0"
|
||||
else
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.7.0.0
|
||||
PKG_VERSION:=4.7.0.3
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=cf047cf3b9b545f36a8e4c4e32da784253fb0853
|
||||
PKG_SOURCE_VERSION:=c8bb719f12aab18405375c6fc0ee2425fdcd8d4d
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
|
||||
@@ -1,36 +1,48 @@
|
||||
#
|
||||
# Copyright (C) 2013-2020 iopsys
|
||||
# Copyright (C) 2013-2024 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mcastmngr
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/mcastmngr.git
|
||||
PKG_SOURCE_VERSION:=5d5b42f5b46457ed938765f29994471485e7de81
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_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/mcastmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Multicast Proxy/Snooping Manager
|
||||
DEPENDS:=+!TARGET_brcmbca:mcproxy
|
||||
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/mcastmngr/description
|
||||
Configures IGMP and MLD snooping and proxy
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./mcastmngr/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/mcastmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
define Package/mcastmngr/install
|
||||
$(CP) ./files/common/* $(1)/
|
||||
@@ -39,6 +51,8 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
else
|
||||
$(CP) ./files/linux/* $(1)/
|
||||
endif
|
||||
$(call BbfdmInstallPluginInMicroservice, $(1)/etc/mcastmngr,$(PKG_BUILD_DIR)/bbf_plugin/libmcast_bbf.so)
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/common/etc/mcastmngr/input.json)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mcastmngr))
|
||||
|
||||
@@ -49,7 +49,7 @@ config_snooping_upstream_interface() {
|
||||
*.*)
|
||||
port="$(echo "$dev" | cut -d'.' -f 1)"
|
||||
if [ $port == $ethwan ]; then
|
||||
ifconfig $dev | grep RUNNING >/dev/null && $snooping_upstream_intf="$dev" && break
|
||||
ifconfig $dev | grep RUNNING >/dev/null && snooping_upstream_intf="$dev" && break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
14
mcastmngr/files/common/etc/mcastmngr/input.json
Executable file
14
mcastmngr/files/common/etc/mcastmngr/input.json
Executable file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/mcastmngr/libmcast_bbf.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"root_obj": "bbfdm",
|
||||
"multiple_objects": ["X_IOPSYS_EU_IGMP","X_IOPSYS_EU_MLD"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.5.19
|
||||
PKG_VERSION:=7.0.5.21
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=83e4608de2dd316efbe336b93dab90aa47a2b4a6
|
||||
PKG_SOURCE_VERSION:=8706169718211848d85af9aa6bcdb7b97db2b9b8
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -104,7 +104,6 @@ define Package/obuspa/install
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/00-obuspa-extender-mode $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_load obuspa
|
||||
config_get interface global interface ""
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" -a -z "$interface" ] ; then
|
||||
uci_set obuspa global interface "lan"
|
||||
fi
|
||||
fi
|
||||
@@ -129,15 +129,15 @@ get_vivsoi() {
|
||||
done
|
||||
}
|
||||
|
||||
get_netmode()
|
||||
get_access_role()
|
||||
{
|
||||
local mode
|
||||
local mode lan_proto
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
fi
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
|
||||
if [ "$mode" != "extender" ]; then
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
mode="extender"
|
||||
else
|
||||
mode="full_access"
|
||||
fi
|
||||
|
||||
@@ -146,13 +146,25 @@ get_netmode()
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
config_get wan_intf global interface "wan"
|
||||
config_get wan_intf global interface
|
||||
config_get_bool dhcp_discovery global dhcp_discovery 1
|
||||
|
||||
if [ "$enable_obuspa" = "0" ] || [ "$dhcp_discovery" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${wan_intf}" ]; then
|
||||
role="$(get_access_role)"
|
||||
|
||||
if [ "${role}" = "extender" ]; then
|
||||
wan_intf="lan"
|
||||
uci -q set obuspa.global.interface="lan"
|
||||
uci commit obuspa
|
||||
else
|
||||
wan_intf="wan"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt125" ]; then
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
@@ -231,7 +243,7 @@ if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_netmode)"
|
||||
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_access_role)"
|
||||
uci -q set obuspa.dhcpcontroller.Enable='1'
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
95
obuspa/patches/0012-check_mqtt_host_alive.patch
Normal file
95
obuspa/patches/0012-check_mqtt_host_alive.patch
Normal file
@@ -0,0 +1,95 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 04a1a9c..00b95a4 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -2124,6 +2124,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
|
||||
@@ -2193,6 +2262,14 @@ int PerformMqttClientConnect(mqtt_client_t *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);
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspc
|
||||
PKG_VERSION:=1.0.1.6
|
||||
PKG_VERSION:=1.0.1.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -64,7 +64,6 @@ define Package/obuspc/install
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspc $(1)/usr/sbin/uspc
|
||||
$(INSTALL_BIN) ./files/etc/init.d/uspc $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/50-disable-on-extender $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-fix-agent-endpoint $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/100-add-mosquitto-listener $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/etc/config/uspc $(1)/etc/config/
|
||||
|
||||
@@ -329,6 +329,13 @@ boot() {
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Check if device is an extender nothing to do
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
# extender so return
|
||||
return 0;
|
||||
fi
|
||||
|
||||
configure_dnsmasq_op125 "${interface}"
|
||||
|
||||
start
|
||||
@@ -591,6 +598,13 @@ start_service() {
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Check if device is an extender then do not start the service
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
# extender so return
|
||||
return 0;
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/usp/
|
||||
db_init
|
||||
register_service
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" ]; then
|
||||
uci set uspc.global.enabled=0
|
||||
uci commit uspc
|
||||
fi
|
||||
@@ -40,7 +40,8 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
else ifneq ($(CONFIG_TARGET_airoha),)
|
||||
$(CP) ./files/airoha/* $(1)/
|
||||
endif
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/xpon.json)
|
||||
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/ponmngr,./files/etc/ponmngr/xpon.json)
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/ponmngr/input.json)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ponmngr))
|
||||
|
||||
17
ponmngr/files/etc/ponmngr/input.json
Normal file
17
ponmngr/files/etc/ponmngr/input.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "JSON",
|
||||
"name": "/etc/ponmngr/xpon.json"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"object": "XPON",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_VERSION:=1.0.8
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4179d88a94d8d5989c67504228f9d61ec8a57aac
|
||||
PKG_SOURCE_VERSION:=c07b4631e42191a45426e3a7dd1e000700c48edc
|
||||
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
|
||||
@@ -22,12 +22,13 @@ PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/qosmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=QoS Manager
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
|
||||
DEPENDS:=+libbbfdm-api +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
|
||||
endef
|
||||
|
||||
define Package/qosmngr/description
|
||||
@@ -41,6 +42,7 @@ endef
|
||||
endif
|
||||
|
||||
define Package/qosmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/qos_bbf
|
||||
$(CP) ./files/common/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
$(CP) ./files/broadcom/* $(1)/
|
||||
@@ -51,6 +53,8 @@ else
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qosmngr $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libqos_bbf.so $(1)/etc/qos_bbf
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/common/etc/qos_bbf/input.json)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,qosmngr))
|
||||
|
||||
15
qosmngr/files/common/etc/qos_bbf/input.json
Executable file
15
qosmngr/files/common/etc/qos_bbf/input.json
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/qos_bbf/libqos_bbf.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.qos.",
|
||||
"parent_dm": "Device.",
|
||||
"object": "QoS",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
25
sshmngr/Config.in
Normal file
25
sshmngr/Config.in
Normal file
@@ -0,0 +1,25 @@
|
||||
if PACKAGE_sshmngr
|
||||
choice
|
||||
prompt "Select backend for SSH management"
|
||||
default SSHMNGR_BACKEND_OPENSSH
|
||||
depends on PACKAGE_sshmngr
|
||||
help
|
||||
Select which backend daemon to use for SSH
|
||||
|
||||
config SSHMNGR_BACKEND_OPENSSH
|
||||
bool "Use openssh for ssh"
|
||||
help
|
||||
Enable this option to use openssh for ssh.
|
||||
|
||||
config SSHMNGR_BACKEND_OPENSSH_PAM
|
||||
bool "Use openssh with PAM for ssh"
|
||||
help
|
||||
Enable this option to use PAM for ssh.
|
||||
|
||||
config SSHMNGR_BACKEND_DROPBEAR
|
||||
bool "Use dropbear for ssh"
|
||||
help
|
||||
Enable this option to use dropbear for ssh.
|
||||
|
||||
endchoice
|
||||
endif
|
||||
70
sshmngr/Makefile
Normal file
70
sshmngr/Makefile
Normal file
@@ -0,0 +1,70 @@
|
||||
#
|
||||
# Copyright (C) 2022-2024 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sshmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/sshmngr.git
|
||||
PKG_SOURCE_VERSION:=9758a7a0f798ad2b19597f4ec161e82edbdb2753
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/sshmngr
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Package to add Device.SSH data model support.
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
|
||||
DEPENDS+=+SSHMNGR_BACKEND_OPENSSH:openssh-server +SSHMNGR_BACKEND_OPENSSH:openssh-client-utils
|
||||
DEPENDS+=+SSHMNGR_BACKEND_OPENSSH_PAM:openssh-server-pam +SSHMNGR_BACKEND_OPENSSH_PAM:openssh-client-utils
|
||||
DEPENDS+=+SSHMNGR_BACKEND_DROPBEAR:dropbear
|
||||
endef
|
||||
|
||||
define Package/sshmngr/description
|
||||
Package to add Device.SSH data model support.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./sshmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/sshmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/lib/sshmngr
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
|
||||
$(INSTALL_DATA) ./files/common/etc/config/sshmngr $(1)/etc/config/
|
||||
$(INSTALL_BIN) ./files/common/etc/init.d/sshmngr $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/common/lib/sshmngr/sshmngr.sh $(1)/lib/sshmngr/
|
||||
$(INSTALL_BIN) ./files/common/usr/libexec/rpcd/sshmngr $(1)/usr/libexec/rpcd/
|
||||
ifeq ($(CONFIG_SSHMNGR_BACKEND_DROPBEAR),y)
|
||||
$(INSTALL_DATA) ./files/dropbear_backend/lib/sshmngr/backend.sh $(1)/lib/sshmngr/
|
||||
else
|
||||
$(INSTALL_DATA) ./files/openssh_backend/lib/sshmngr/backend.sh $(1)/lib/sshmngr/
|
||||
endif
|
||||
$(call BbfdmInstallPluginInMicroservice, $(1)/etc/sshmngr,$(PKG_BUILD_DIR)/src/libsshmngr.so)
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/common/etc/sshmngr/input.json)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,sshmngr))
|
||||
7
sshmngr/files/common/etc/config/sshmngr
Normal file
7
sshmngr/files/common/etc/config/sshmngr
Normal file
@@ -0,0 +1,7 @@
|
||||
config server 'ssh1'
|
||||
option enable '1'
|
||||
option PasswordAuth '1'
|
||||
option RootPasswordAuth '1'
|
||||
option RootLogin '1'
|
||||
option Port '22'
|
||||
option MaxAuthTries '10'
|
||||
11
sshmngr/files/common/etc/init.d/sshmngr
Executable file
11
sshmngr/files/common/etc/init.d/sshmngr
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=18
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/sshmngr/sshmngr.sh
|
||||
|
||||
service_triggers() {
|
||||
configure_ssh
|
||||
procd_add_reload_trigger sshmngr
|
||||
}
|
||||
15
sshmngr/files/common/etc/sshmngr/input.json
Executable file
15
sshmngr/files/common/etc/sshmngr/input.json
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/sshmngr/libsshmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.ssh.",
|
||||
"parent_dm": "Device.",
|
||||
"object": "SSH",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
64
sshmngr/files/common/lib/sshmngr/sshmngr.sh
Executable file
64
sshmngr/files/common/lib/sshmngr/sshmngr.sh
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/sshmngr/backend.sh
|
||||
|
||||
TEMP_UCI_PATH="/tmp/sshmngr"
|
||||
|
||||
handle_server_section()
|
||||
{
|
||||
local cfg="$1"
|
||||
local enable
|
||||
local PasswordAuth=""
|
||||
local Port=""
|
||||
local RootPasswordAuth=""
|
||||
local RootLogin=""
|
||||
local Interface=""
|
||||
local SSHKeepAlive=""
|
||||
local IdleTimeout=""
|
||||
local MaxAuthTries=""
|
||||
local ServerName="${cfg}"
|
||||
|
||||
config_get_bool enable $cfg enable 0
|
||||
|
||||
[ $enable -eq 0 ] && return
|
||||
|
||||
config_get PasswordAuth $cfg PasswordAuth
|
||||
config_get Port $cfg Port
|
||||
config_get RootPasswordAuth $cfg RootPasswordAuth
|
||||
config_get RootLogin $cfg RootLogin
|
||||
config_get Interface $cfg Interface
|
||||
config_get SSHKeepAlive $cfg SSHKeepAlive
|
||||
config_get IdleTimeout $cfg IdleTimeout
|
||||
config_get MaxAuthTries $cfg MaxAuthTries
|
||||
|
||||
# add section
|
||||
uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName=$CONFIG
|
||||
|
||||
# set options
|
||||
[ -n "$PasswordAuth" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.PasswordAuth=$PasswordAuth
|
||||
[ -n "$Port" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.Port=$Port
|
||||
[ -n "$RootPasswordAuth" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.RootPasswordAuth=$RootPasswordAuth
|
||||
[ -n "$RootLogin" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.RootLogin=$RootLogin
|
||||
[ -n "$Interface" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.Interface=$Interface
|
||||
[ -n "$SSHKeepAlive" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.SSHKeepAlive=$SSHKeepAlive
|
||||
[ -n "$IdleTimeout" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.IdleTimeout=$IdleTimeout
|
||||
[ -n "$MaxAuthTries" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.MaxAuthTries=$MaxAuthTries
|
||||
}
|
||||
|
||||
configure_ssh()
|
||||
{
|
||||
# remove temp UCI
|
||||
rm -rf "$TEMP_UCI_PATH"/$CONFIG 2>/dev/null
|
||||
mkdir -p "$TEMP_UCI_PATH"
|
||||
touch "$TEMP_UCI_PATH"/$CONFIG
|
||||
|
||||
# read all sshmngr server sections and then apply them to $CONFIG UCI
|
||||
config_load sshmngr
|
||||
config_foreach handle_server_section server
|
||||
|
||||
uci -c "$TEMP_UCI_PATH" commit $CONFIG
|
||||
|
||||
cp "$TEMP_UCI_PATH"/$CONFIG /etc/config/$CONFIG
|
||||
|
||||
/etc/init.d/$CONFIG reload
|
||||
}
|
||||
222
sshmngr/files/common/usr/libexec/rpcd/sshmngr
Executable file
222
sshmngr/files/common/usr/libexec/rpcd/sshmngr
Executable file
@@ -0,0 +1,222 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/sshmngr/backend.sh
|
||||
|
||||
TEMP_KEY_FILE="/tmp/tempkeyfile"
|
||||
|
||||
add_server_name()
|
||||
{
|
||||
local server_sec="${1}"
|
||||
|
||||
config_get_bool enable "${server_sec}" enable 0
|
||||
if [ "${enable}" -eq 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
server_names="${server_names} ${server_sec}"
|
||||
}
|
||||
|
||||
get_all_servers()
|
||||
{
|
||||
server_names=""
|
||||
|
||||
config_load sshmngr
|
||||
config_foreach add_server_name server
|
||||
|
||||
echo "${server_names}"
|
||||
}
|
||||
|
||||
get_pid()
|
||||
{
|
||||
local server_name="$1"
|
||||
local pid_file="$(get_pid_file "$server_name")"
|
||||
local server_pid=0
|
||||
|
||||
# if proper file exists
|
||||
if [ -f "${pid_file}" ] && [ -s "${pid_file}" ]; then
|
||||
server_pid="$(cat "${pid_file}")"
|
||||
fi
|
||||
|
||||
echo "$server_pid"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "dump" : {"server_name":"string"}, "kill_session" : {"session_pid":"string","server_name":"string"}, "list_keys" : {}, "add_pubkey" : {"current_key":"string","new_key":"string"}, "remove_pubkey" : {"key":"string"} }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
dump)
|
||||
read -r input
|
||||
json_load "${input}"
|
||||
json_get_var server_name "server_name"
|
||||
json_cleanup
|
||||
|
||||
if [ -z "$server_name" ]; then
|
||||
servers="$(get_all_servers)"
|
||||
else
|
||||
servers="$server_name"
|
||||
fi
|
||||
|
||||
json_init
|
||||
|
||||
for server in $servers; do
|
||||
json_add_object "$server"
|
||||
|
||||
pid_file="$(get_pid_file "$server")"
|
||||
server_pid="$(get_pid "$server")"
|
||||
|
||||
if [ "$server_pid" -eq 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# get all current sessions
|
||||
session_pids="$(get_session_pids "$pid_file")"
|
||||
|
||||
json_add_string "pid" "$server_pid"
|
||||
json_add_array "sessions"
|
||||
|
||||
for session_pid in $session_pids; do
|
||||
# if pid equals server pid then skip
|
||||
[ "$session_pid" -eq "$server_pid" ] && continue
|
||||
|
||||
# get this session's ppid
|
||||
session_ppid="$(grep PPid /proc/$session_pid/status | awk '{print $2}')"
|
||||
|
||||
# if session's parent is this server
|
||||
if [ "$session_ppid" -eq "$server_pid" ]; then
|
||||
session="$(netstat -ntp | grep $session_pid/ | awk '{print $5,$7}' | cut -d'/' -f 1)"
|
||||
|
||||
# return session IP, Port, PID
|
||||
ip=$(echo "$session" | cut -d ':' -f 1)
|
||||
port=$(echo "$session" | cut -d ':' -f 2 | cut -d ' ' -f 1)
|
||||
pid=$(echo "$session" | cut -d ':' -f 2 | cut -d ' ' -f 2)
|
||||
|
||||
json_add_object
|
||||
json_add_string "ip" "$ip"
|
||||
json_add_string "port" "$port"
|
||||
json_add_string "pid" "$pid"
|
||||
json_close_object
|
||||
fi
|
||||
done
|
||||
|
||||
json_close_array
|
||||
json_close_object
|
||||
done
|
||||
|
||||
json_dump
|
||||
;;
|
||||
|
||||
kill_session)
|
||||
read -r input
|
||||
json_load "${input}"
|
||||
json_get_var session_pid "session_pid"
|
||||
json_get_var server_name "server_name"
|
||||
json_cleanup
|
||||
|
||||
if [ "$session_pid" -gt 0 ]; then
|
||||
kill -15 "$session_pid"
|
||||
else
|
||||
[ -n "$server_name" ] || return
|
||||
|
||||
# if server_name is present
|
||||
# get all current sessions
|
||||
pid_file="$(get_pid_file "$server_name")"
|
||||
server_pid="$(get_pid "$server_name")"
|
||||
|
||||
if [ "$server_pid" -eq 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# get all current sessions
|
||||
session_pids="$(get_session_pids "$pid_file")"
|
||||
|
||||
for session_pid in $session_pids; do
|
||||
# if pid equals server pid then skip
|
||||
[ "$session_pid" -eq "$server_pid" ] && continue
|
||||
|
||||
# get this session's ppid
|
||||
session_ppid="$(grep PPid /proc/$session_pid/status | awk '{print $2}')"
|
||||
|
||||
# if session's parent is this server
|
||||
if [ "$session_ppid" -eq "$server_pid" ]; then
|
||||
kill -15 "$session_pid"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
;;
|
||||
|
||||
list_keys)
|
||||
# remove empty lines from file
|
||||
sed -i '/^[[:space:]]*$/d' "$KEY_FILE"
|
||||
|
||||
json_init
|
||||
json_add_array "keys"
|
||||
|
||||
while read line; do
|
||||
json_add_string "key" "${line}"
|
||||
done < "$KEY_FILE"
|
||||
|
||||
json_close_array
|
||||
json_dump
|
||||
;;
|
||||
|
||||
add_pubkey)
|
||||
read -r input
|
||||
json_load "${input}"
|
||||
json_get_var current_key "current_key"
|
||||
json_get_var new_key "new_key"
|
||||
json_cleanup
|
||||
|
||||
if [ -n "${new_key}" ]; then
|
||||
if [ -n "${current_key}" ]; then
|
||||
rm -rf TEMP_KEY_FILE
|
||||
touch TEMP_KEY_FILE
|
||||
|
||||
# sed -i "s/${current_key}/${new_key}/g" ${KEY_FILE}
|
||||
# sed is not advisable because the separator ("/") or anything else
|
||||
# can be present in the string
|
||||
while read line; do
|
||||
if [ "${line}" == "${current_key}" ]; then
|
||||
echo "${new_key}" >> TEMP_KEY_FILE
|
||||
else
|
||||
echo "${line}" >> TEMP_KEY_FILE
|
||||
fi
|
||||
done < "$KEY_FILE"
|
||||
|
||||
mv TEMP_KEY_FILE "$KEY_FILE"
|
||||
else
|
||||
echo "${new_key}" >> ${KEY_FILE}
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
remove_pubkey)
|
||||
read -r input
|
||||
json_load "${input}"
|
||||
json_get_var key "key"
|
||||
json_cleanup
|
||||
|
||||
|
||||
if [ -n "${key}" ]; then
|
||||
rm -rf TEMP_KEY_FILE
|
||||
touch TEMP_KEY_FILE
|
||||
|
||||
# sed -i "/${key}/d" ${KEY_FILE}
|
||||
# sed -i "s/${current_key}/${new_key}/g" ${KEY_FILE}
|
||||
# sed is not advisable because the separator ("/") or anything else
|
||||
# can be present in the string
|
||||
while read line; do
|
||||
if [ "${line}" != "${key}" ]; then
|
||||
echo "${line}" >> TEMP_KEY_FILE
|
||||
fi
|
||||
done < "$KEY_FILE"
|
||||
|
||||
mv TEMP_KEY_FILE "$KEY_FILE"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
20
sshmngr/files/dropbear_backend/lib/sshmngr/backend.sh
Executable file
20
sshmngr/files/dropbear_backend/lib/sshmngr/backend.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
KEY_FILE="/etc/dropbear/authorized_keys"
|
||||
CONFIG="dropbear"
|
||||
|
||||
get_pid_file()
|
||||
{
|
||||
local ServerName="$1"
|
||||
|
||||
echo "/var/run/$CONFIG.$ServerName.pid"
|
||||
}
|
||||
|
||||
get_session_pids()
|
||||
{
|
||||
local PidFile="$1"
|
||||
|
||||
echo "$(ps -w | grep $PidFile | grep -v grep | awk '{print $1}')"
|
||||
}
|
||||
18
sshmngr/files/openssh_backend/lib/sshmngr/backend.sh
Executable file
18
sshmngr/files/openssh_backend/lib/sshmngr/backend.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
CONFIG="sshd"
|
||||
KEY_FILE="/root/.ssh/authorized_keys"
|
||||
|
||||
get_pid_file()
|
||||
{
|
||||
local ServerName="$1"
|
||||
|
||||
echo "/var/run/$CONFIG.$ServerName.pid"
|
||||
}
|
||||
|
||||
get_session_pids()
|
||||
{
|
||||
echo "$(ps -w | grep sshd | grep pts | awk '{print $1}')"
|
||||
}
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-base
|
||||
PKG_VERSION:=3.1.57
|
||||
PKG_VERSION:=3.1.59
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=5c031a2e3c3ebc0b71566073a8296c75f422b8aa
|
||||
PKG_SOURCE_VERSION:=729253b3864edc3dfbb10c839f5b6e3db7a26cc1
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
SULU_MOD:=core
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=3.1.57
|
||||
PKG_VERSION:=3.1.59
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=f40a83b669b9a6abb527f3e7e6babbcd7c00622a
|
||||
PKG_SOURCE_VERSION:=51c0d46343b3b1122b4f1df73399526160f968dd
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)
|
||||
|
||||
@@ -19,5 +19,5 @@ start_service() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
[ -n "$TESTNET" ] && procd_running testnet && "$TESTNET" once
|
||||
procd_send_signal testnet
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
RELOAD=0
|
||||
WAITING=0
|
||||
|
||||
NETCON=0
|
||||
LASTSTATUS=""
|
||||
@@ -13,32 +14,32 @@ test_connection() {
|
||||
local defroute="$(ip r | grep default | awk '{print$3}' | head -1)"
|
||||
local def6route="$(ip -f inet6 r | grep default | awk '{print$3}')"
|
||||
local ping6dev="$(ip -f inet6 r | grep default | awk '{print$5}')"
|
||||
local resolvfile="$(uci -q get dhcp.@dnsmasq[0].resolvfile)"
|
||||
local resolvfile="$(uci -q get 'dhcp.@dnsmasq[0].resolvfile')"
|
||||
|
||||
if [ -n "$addr" ]; then
|
||||
ping -q -w 5 -c 1 $addr >/dev/null 2>&1 && return 0
|
||||
ping -q -w 5 -c 1 "$addr" >/dev/null 2>&1 && return 0
|
||||
elif [ -n "$defroute" ]; then
|
||||
ping -q -w 5 -c 1 $defroute >/dev/null 2>&1 && return 0
|
||||
ping -q -w 5 -c 1 "$defroute" >/dev/null 2>&1 && return 0
|
||||
if [ -e "$resolvfile" ]; then
|
||||
for nmsrv in $(grep nameserver "$resolvfile" | awk '{print$2}'); do
|
||||
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
|
||||
ping -q -w 5 -c 1 "$nmsrv" >/dev/null 2>&1 && return 0
|
||||
done
|
||||
fi
|
||||
elif [ -n "$def6route" -a -n "$ping6dev" ]; then
|
||||
ndisc6 -w 5 -1 $def6route $ping6dev >/dev/null 2>&1 && return 0
|
||||
ndisc6 -w 5 -1 "$def6route" "$ping6dev" >/dev/null 2>&1 && return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
internet_test() {
|
||||
local link dest
|
||||
local dest
|
||||
|
||||
# use the destination address given in config for connectivity check
|
||||
dest="$(uci -q get testnet.global.destination)"
|
||||
# for backwards compatibility
|
||||
[ -n "$dest" ] || dest="$(uci -q get system.@system[0].netping_addr)"
|
||||
[ -n "$dest" ] || dest="$(uci -q get 'system.@system[0].netping_addr')"
|
||||
|
||||
test_connection $dest
|
||||
test_connection "$dest"
|
||||
|
||||
if [ "$?" -eq 0 ]; then
|
||||
NETCON=1
|
||||
@@ -52,7 +53,7 @@ internet_test() {
|
||||
connectivity_test() {
|
||||
internet_test
|
||||
|
||||
if [ $NETCON -eq 1 ]; then
|
||||
if [ "$NETCON" -eq 1 ]; then
|
||||
CURSTATUS=1
|
||||
[ "$CURSTATUS" == "$LASTSTATUS" ] || ubus send internet '{"status" : "online"}'
|
||||
LASTSTATUS=1
|
||||
@@ -63,12 +64,14 @@ connectivity_test() {
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$1" == "once" ]; then
|
||||
connectivity_test
|
||||
exit 0
|
||||
fi
|
||||
trap RELOAD=1 HUP
|
||||
|
||||
while true; do
|
||||
if [ "$WAITING" -eq 0 ]; then
|
||||
sleep "$SLEEP_TIME" &
|
||||
WAITING=1
|
||||
fi
|
||||
RELOAD=0
|
||||
connectivity_test
|
||||
sleep $SLEEP_TIME
|
||||
[ "$RELOAD" -eq 0 ] && wait && WAITING=0
|
||||
done
|
||||
|
||||
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=voicemngr
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.9
|
||||
PKG_VERSION:=1.1.11
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -19,7 +19,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:=6ca306ea8e0bcc38deb94961b3ecac3bad3d046c
|
||||
PKG_SOURCE_VERSION:=33db1b82fbb161d5a4dc253ecb6e0fb0648de3c8
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -48,7 +48,7 @@ define Package/$(PKG_NAME)
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
include $(TOPDIR)/feeds/broadcom/bcmkernel/bcm-toolchain.mk
|
||||
TARGET_CFLAGS := -I$(STAGING_DIR)/usr/include/bcm963xx/ -L$(STAGING_DIR)/root-brcmbca/usr/lib/broadcom -L$(STAGING_DIR)/usr/lib/broadcom
|
||||
TARGET_CFLAGS := -I$(STAGING_DIR)/usr/include/bcm963xx/
|
||||
TARGET_CPPFLAGS :=
|
||||
TARGET_CXXFLAGS :=
|
||||
EXTRA_CFLAGS :=
|
||||
@@ -89,4 +89,3 @@ define Package/$(PKG_NAME)/install
|
||||
$(CP) $(PKG_BUILD_DIR)/libvoice/libvoice.so* $(1)/usr/lib/
|
||||
endef
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
|
||||
@@ -9,12 +9,10 @@ NAME=voicemngr
|
||||
start_service() {
|
||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
||||
|
||||
[ -d "/usr/lib/broadcom" ] && BCM_LIBS=LD_LIBRARY_PATH=/lib/broadcom:/usr/lib/broadcom
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param env hw_board_hasDect="$(db get hw.board.hasDect)" \
|
||||
hw_board_VoicePortNames="$(db get hw.board.VoicePortNames)" \
|
||||
$BCM_LIBS
|
||||
|
||||
procd_set_param command $NAME
|
||||
procd_set_param respawn "5" "0" "3"
|
||||
procd_set_param nice -12
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=17.0.15
|
||||
PKG_VERSION:=17.1.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=778e7d99ec4440a91604aac2b6893c288b73e473
|
||||
PKG_SOURCE_VERSION:=cb792147156bee07ec8f7ce4a53e3cc9501bf233
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user