Compare commits

..

1 Commits

Author SHA1 Message Date
Vivek Kumar Dutta
8eee85a7c7 emctrl2: example easymesh controller dm package 2024-08-09 12:03:45 +05:30
142 changed files with 4428 additions and 3180 deletions

View File

@@ -1,4 +1,7 @@
if PACKAGE_bbfdmd
if PACKAGE_libbbfdm
config BBF_VENDOR_LIST
string "Vendor List"
default "iopsys"
config BBF_VENDOR_PREFIX
string "Vendor Prefix"

View File

@@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.12.21
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:=062c13e83387e3ad37d6caaffd47cf57a1db7c7f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_VERSION:=75195a112e3aef2b07e224afbbffcb15368be58f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -32,28 +32,21 @@ define Package/libbbfdm-api
ABI_VERSION:=1.0
endef
define Package/libbbfdm-ubus
define Package/libbbfdm
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF datamodel ubus library, provides API to expose datamodel over ubus
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
TITLE:=Library for broadband forum data model support
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libopenssl
MENU:=1
endef
define Package/bbfdmd
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend to expose core tree
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libopenssl +libbbfdm-ubus +bbf_configmngr
endef
define Package/dm-service
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Datamodel ubus backend to expose micro-service tree
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr
TITLE:=Datamodel ubus backend
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm +jq +bbf_configmngr
endef
define Package/bbf_configmngr
@@ -62,10 +55,11 @@ define Package/bbf_configmngr
SUBMENU:=TRx69
TITLE:= BBF Config Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
MENU:=1
endef
define Package/bbfdmd/config
source "$(SOURCE)/Config_bbfdmd.in"
define Package/libbbfdm/config
source "$(SOURCE)/Config_bbfdm.in"
endef
define Package/bbf_configmngr/config
@@ -76,16 +70,8 @@ define Package/libbbfdm-api/description
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
endef
define Package/libbbfdm-ubus/description
Library contains the APIs to expose data model over ubus
endef
define Package/bbfdmd/description
Daemon to expose Datamodel core tree
endef
define Package/dm-service/description
Daemon to expose Datamodel micro-service tree
define Package/libbbfdm/description
Library contains the data model tree, It includes basic TR181 nodes.
endef
define Package/bbf_configmngr/description
@@ -99,9 +85,17 @@ endef
endif
CMAKE_OPTIONS += \
-DBBF_TR181=ON
CMAKE_OPTIONS += \
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES) \
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
CMAKE_OPTIONS += \
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
endif
define Package/libbbfdm-api/install
$(INSTALL_DIR) $(1)/lib
@@ -118,41 +112,45 @@ define Package/libbbfdm-api/install
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
endef
define Package/libbbfdm-ubus/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-ubus/libbbfdm-ubus.so $(1)/lib/
define Package/libbbfdm/install
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(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_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
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)/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
#!/bin/sh
rm -rf /etc/bbfdm/dmmap/*
exit 0
endef
define Package/bbfdmd/install
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
$(INSTALL_CONF) ./files/etc/config/schedules $(1)/etc/config/schedules
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
endef
define Package/dm-service/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/bbfdm.services $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dm-service/dm-service $(1)/usr/sbin/
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
endef
define Package/bbf_configmngr/install
@@ -161,8 +159,6 @@ ifeq ($(CONFIG_BBF_CONFIGMNGR_C_BACKEND),y)
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/bbf_configd $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
endif
ifeq ($(CONFIG_BBF_CONFIGMNGR_SCRIPT_BACKEND),y)
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
@@ -170,26 +166,15 @@ ifeq ($(CONFIG_BBF_CONFIGMNGR_SCRIPT_BACKEND),y)
endif
endef
define Package/bbfdmd/prerm
#!/bin/sh
rm -rf /etc/bbfdm/dmmap/*
exit 0
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-ubus
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-ubus/bbfdm-ubus.h $(1)/usr/include/libbbfdm-ubus/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/*.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-ubus/libbbfdm-ubus.so $(1)/usr/lib
endef
$(eval $(call BuildPackage,bbf_configmngr))
$(eval $(call BuildPackage,libbbfdm-api))
$(eval $(call BuildPackage,libbbfdm-ubus))
$(eval $(call BuildPackage,libbbfdm))
$(eval $(call BuildPackage,bbfdmd))
$(eval $(call BuildPackage,dm-service))

View File

@@ -0,0 +1,28 @@
{
"daemon": {
"config": {
},
"input": {
"type": "DotSo",
"name": "/usr/share/bbfdm/libbbfdm.so",
"plugin_dir": "/usr/share/bbfdm/plugins"
},
"output": {
"type": "UBUS",
"name": "bbfdm"
}
},
"cli": {
"config": {
"proto": "both",
"instance_mode": 0
},
"input": {
"type": "UBUS",
"name": "bbfdm"
},
"output": {
"type": "CLI"
}
}
}

View File

@@ -1,8 +1,11 @@
config bbfdmd 'bbfdmd'
option enable '1'
option debug '0'
option loglevel '3'
option loglevel '1'
option refresh_time '120'
option transaction_timeout '30'
option subprocess_level '2'
config micro_services 'micro_services'
option enable '1'
option enable_core '0'
option enable_respawn '1'

View File

@@ -1,2 +0,0 @@
config global 'global'
option enable '1'

View File

@@ -1,36 +1,15 @@
#!/bin/sh /etc/rc.common
START=80
START=64
STOP=10
USE_PROCD=1
PROG=/usr/sbin/bbf_configd
log() {
echo "${@}"|logger -t bbf.config -p info
}
create_needed_directories()
{
mkdir -p /tmp/bbfdm/.cwmp
mkdir -p /tmp/bbfdm/.usp
mkdir -p /tmp/bbfdm/.bbfdm
}
start_service()
{
create_needed_directories
procd_open_instance "bbf_configd"
procd_set_param command ${PROG}
#procd_append_param command -ddd
procd_set_param respawn
procd_close_instance "bbf_configd"
}
service_triggers() {
for config_file in /etc/config/*; do
config_name=$(basename "$config_file")
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh
done
}

View File

@@ -1,10 +1,10 @@
#!/bin/sh /etc/rc.common
START=60
START=40
STOP=8
USE_PROCD=1
PROG=/usr/sbin/dm-service
PROG=/usr/sbin/bbfdmd
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/micro_services"
@@ -18,38 +18,33 @@ validate_bbfdm_micro_service_section()
{
uci_validate_section bbfdm micro_services "micro_services" \
'enable:bool:true' \
'enable_core:bool:false'
'enable_core:bool:false' \
'enable_respawn:bool:true'
}
_add_microservice()
{
local name path loglevel
local enable enable_core
local name path
local enable enable_core enable_respawn
# Check enable from micro-service
path="${1}"
enable_core="${2}"
enable_respawn="${2}"
enable_core="${3}"
name="$(basename ${path})"
name="${name//.json}"
json_load_file "${path}"
json_select daemon
json_get_var enable enable 1
enable="$(jq -r '.daemon.enable//1' ${path})"
if [ "${enable}" -eq "0" ]; then
log "datamodel micro-service ${name} not enabled"
return 0
fi
json_select config
json_get_var loglevel loglevel 3
procd_open_instance "${name}"
procd_set_param command ${PROG}
procd_append_param command -m "${name}"
procd_append_param command -l "${loglevel}"
if [ "${enable_core}" -eq "1" ]; then
procd_set_param limits core="unlimited"
@@ -57,13 +52,15 @@ _add_microservice()
procd_set_param stderr 1
fi
procd_set_param respawn
if [ "${enable_respawn}" -eq "1" ]; then
procd_set_param respawn "3600" "5" "5"
fi
procd_close_instance "${name}"
}
configure_bbfdm_micro_services()
{
local enable enable_core
local enable enable_core enable_respawn
config_load bbfdm
validate_bbfdm_micro_service_section || {
@@ -80,7 +77,7 @@ configure_bbfdm_micro_services()
do
[ -e "$file" ] || continue
_add_microservice $file "${enable_core}"
_add_microservice $file "${enable_respawn}" "${enable_core}"
done
fi
}
@@ -95,7 +92,7 @@ _start_single_service()
file="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/${service}.json)"
[ -e "$file" ] || return
_add_microservice $file "0"
_add_microservice $file "0" "0"
fi
}

View File

@@ -1,11 +1,14 @@
#!/bin/sh /etc/rc.common
START=97
START=65
STOP=10
USE_PROCD=1
PROG=/usr/sbin/bbfdmd
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
BBFDM_TEMP_DIR="/tmp/bbfdm"
. /usr/share/libubox/jshn.sh
log() {
@@ -16,13 +19,17 @@ validate_bbfdm_bbfdmd_section()
{
uci_validate_section bbfdm bbfdmd "bbfdmd" \
'enable:bool:true' \
'sock:string' \
'debug:bool:false' \
'loglevel:uinteger:3'
'loglevel:uinteger:1' \
'refresh_time:uinteger:0' \
'transaction_timeout:uinteger:30' \
'subprocess_level:uinteger'
}
configure_bbfdmd()
{
local enable debug
local enable debug sock
local jlog jrefresh jtimeout jlevel
config_load bbfdm
@@ -33,17 +40,25 @@ configure_bbfdmd()
[ "${enable}" -eq 0 ] && return 0
procd_set_param command ${PROG}
procd_append_param command -l "${loglevel}"
if [ -f "${BBFDM_JSON_INPUT}" ]; then
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' ${BBFDM_JSON_INPUT})" > "${BBFDM_TEMP_DIR}/input.json"
fi
procd_set_param command ${PROG}
if [ "${debug}" -eq 1 ]; then
procd_set_param stdout 1
procd_set_param stderr 1
fi
if [ -f "${sock}" ]; then
procd_append_param command -s "${sock}"
fi
}
start_service()
{
mkdir -p ${BBFDM_TEMP_DIR}
procd_open_instance "bbfdm"
configure_bbfdmd
procd_set_param respawn

View File

@@ -2,7 +2,7 @@
BBFDM_BASE_DM_PATH="usr/share/bbfdm"
BBFDM_INPUT_PATH="etc/bbfdm/micro_services"
INPUT_TEMPLATE='{"daemon":{"enable":"1","service_name":"template","config":{"loglevel":"3"}}}'
INPUT_TEMPLATE='{"daemon":{"enable":"1","service_name":"template","config":{"loglevel":"1"}}}'
OUT_NAME=""
MICRO_SERVICE=0
@@ -79,11 +79,6 @@ bbfdm_install_dm()
exit 1
fi
if [ ! -f "${src}" ]; then
echo "File $src does not exists..."
exit 1
fi
if [ "${src##*.}" = "json" ]; then
echo "Compacting BBFDM JSON file"
minfile=$(mktemp)

View File

@@ -7,11 +7,5 @@ config BRIDGEMNGR_BRIDGE_VLAN
help
Set this option to use bridge-vlan as backend for VLAN objects.
config BRIDGEMNGR_BRIDGE_VENDOR_EXT
bool "Use bridge BBF vendor extensions"
default y
help
Set this option to use bridge BBF vendor extensions.
endmenu
endif

View File

@@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bridgemngr
PKG_VERSION:=1.0.7
PKG_VERSION:=1.0.5
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/network/bridgemngr
PKG_SOURCE_VERSION:=4f22b4a4270c8d9b94b9de6f5cbe2a1dd86a3027
PKG_SOURCE_VERSION:=c0f2e17f6d4f96aecfe72ab90be885939413176d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -26,8 +26,7 @@ include ../bbfdm/bbfdm.mk
define Package/bridgemngr
CATEGORY:=Utilities
TITLE:=Bridge Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
endef
define Package/bridgemngr/description
@@ -48,9 +47,8 @@ endif
define Package/bridgemngr/install
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_EXT), y)
ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_PLUGIN) ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME)
endif
endef

View File

@@ -1,31 +0,0 @@
{
"json_plugin_version": 2,
"Device.Bridging.Bridge.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": true,
"array": true,
"{BBF_VENDOR_PREFIX}VLANFiltering": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"description": "Enable or disable VLAN Filtering on this bridge.",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "vlan_filtering"
}
]
}
}
}

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=2.1.14
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:=93c9e87cb9f8f635cece1473cff6f67cff9ff7c0
PKG_SOURCE_VERSION:=5dd9cd3cfc95e9dce5f64fe9cadd274bb31b8fa6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -24,17 +24,12 @@ PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/bulkdata
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF BulkData Collection
DEPENDS:=+ubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
DEPENDS+=+libbbfdm-api +libbbfdm-ubus
endef
define Package/bulkdata/description
BulkData daemon for TR069 with bbfdm backend.
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
endef
TARGET_CFLAGS += \
@@ -47,13 +42,16 @@ define Build/Prepare
endef
endif
define Package/bulkdata/install
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(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_BIN) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/uci-defaults/95-bulkdata-translation-options $(1)/etc/uci-defaults/
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,bulkdata))
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -0,0 +1,960 @@
{
"json_plugin_version": 2,
"Device.BulkData.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"Enable": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"name": "bulkdata"
},
"option": {
"name": "enable"
}
}
}
]
},
"Status": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"Enabled",
"Disabled",
"Error"
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"name": "bulkdata"
},
"option": {
"name": "enable"
}
}
}
]
},
"MinReportingInterval": {
"type": "unsignedInt",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "0",
"datatype": "unsignedInt",
"unit": "seconds"
},
"Protocols": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "HTTP",
"list": {
"datatype": "string",
"enumerations": [
"Streaming",
"File",
"HTTP",
"MQTT"
]
}
},
"EncodingTypes": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "JSON,CSV",
"list": {
"datatype": "string",
"enumerations": [
"XML",
"XDR",
"CSV",
"JSON"
]
}
},
"ParameterWildCardSupported": {
"type": "boolean",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "1",
"datatype": "boolean"
},
"MaxNumberOfProfiles": {
"type": "int",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "-1",
"datatype": "int",
"range": [
{
"min": -1
}
]
},
"MaxNumberOfParameterReferences": {
"type": "int",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "-1",
"datatype": "int",
"range": [
{
"min": -1
}
]
},
"ProfileNumberOfEntries": {
"type": "unsignedInt",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"type": "profile"
},
"option": {
"name": "@Count"
}
}
}
]
},
"Device.BulkData.Profile.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": true,
"array": true,
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"type": "profile"
},
"dmmapfile": "dmmap_bulkdata"
}
}
],
"Enable": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "enable"
}
]
},
"Alias": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "Alias",
"range": [
{
"max": 64
}
],
"flags": [
"Unique"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "alias"
}
]
},
"Name": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 255
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "name"
}
]
},
"NumberOfRetainedFailedReports": {
"type": "int",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "int",
"range": [
{
"min": -1
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "nbre_of_retained_failed_reports"
}
]
},
"Protocol": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"Streaming",
"File",
"HTTP"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "protocol"
}
]
},
"EncodingType": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"XML",
"XDR",
"CSV",
"JSON"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "encoding_type"
}
]
},
"ReportingInterval": {
"type": "unsignedInt",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"range": [
{
"min": 1
}
],
"unit": "seconds",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "reporting_interval"
}
]
},
"TimeReference": {
"type": "dateTime",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "dateTime",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "time_reference"
}
]
},
"ParameterNumberOfEntries": {
"type": "unsignedInt",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"type": "profile_parameter"
},
"option": {
"name": "@Count"
}
}
}
]
},
"Device.BulkData.Profile.{i}.Parameter.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": true,
"array": true,
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"type": "profile_parameter"
},
"dmmapfile": "dmmap_bulkdata"
}
}
],
"Name": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 64
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "name"
}
]
},
"Reference": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "reference"
}
]
}
},
"Device.BulkData.Profile.{i}.CSVEncoding.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"FieldSeparator": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "csv_encoding_field_separator"
}
]
},
"RowSeparator": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "csv_encoding_row_separator"
}
]
},
"EscapeCharacter": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "csv_encoding_escape_character"
}
]
},
"ReportFormat": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"ParameterPerRow",
"ParameterPerColumn"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "csv_encoding_report_format"
}
]
},
"RowTimestamp": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"Unix-Epoch",
"ISO-8601",
"None"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "csv_encoding_row_time_stamp"
}
]
}
},
"Device.BulkData.Profile.{i}.JSONEncoding.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"ReportFormat": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"ObjectHierarchy",
"NameValuePair"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "json_encoding_report_format"
}
]
},
"ReportTimestamp": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"Unix-Epoch",
"ISO-8601",
"None"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "json_encoding_report_time_stamp"
}
]
}
},
"Device.BulkData.Profile.{i}.HTTP.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"URL": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "URL",
"range": [
{
"max": 2048
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_url"
}
]
},
"Username": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_username"
}
]
},
"Password": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"flags": [
"Secure"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_password"
}
]
},
"CompressionsSupported": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "GZIP",
"list": {
"datatype": "string",
"enumerations": [
"GZIP",
"Compress",
"Deflate"
]
}
},
"Compression": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"GZIP",
"Compress",
"Deflate"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_compression"
}
]
},
"MethodsSupported": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "POST,PUT",
"list": {
"datatype": "string",
"enumerations": [
"POST",
"PUT"
]
}
},
"Method": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"POST",
"PUT"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_method"
}
]
},
"UseDateHeader": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_use_date_header"
}
]
},
"RetryEnable": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_retry_enable"
}
]
},
"RetryMinimumWaitInterval": {
"type": "unsignedInt",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"range": [
{
"min": 1,
"max": 65535
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_retry_minimum_wait_interval"
}
]
},
"RetryIntervalMultiplier": {
"type": "unsignedInt",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"range": [
{
"min": 1000,
"max": 65535
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_retry_interval_multiplier"
}
]
},
"RequestURIParameterNumberOfEntries": {
"type": "unsignedInt",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"type": "profile_http_request_uri_parameter"
},
"option": {
"name": "@Count"
}
}
}
]
},
"PersistAcrossReboot": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "boolean",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "http_persist_across_reboot"
}
]
},
"Device.BulkData.Profile.{i}.HTTP.RequestURIParameter.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": true,
"array": true,
"mapping": [
{
"type": "uci",
"uci": {
"file": "bulkdata",
"section": {
"type": "profile_http_request_uri_parameter"
},
"dmmapfile": "dmmap_bulkdata"
}
}
],
"Name": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 64
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "name"
}
]
},
"Reference": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "reference"
}
]
}
}
}
}
}
}

View File

@@ -7,24 +7,34 @@ USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
start_service() {
procd_open_instance "bulkdata"
procd_set_param command "$PROG"
procd_set_param respawn
procd_close_instance "bulkdata"
local enable
config_load bulkdata
config_get_bool enable bulkdata enable 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() {
ret=$(ubus call service list '{"name":"bulkdatad"}' | jsonfilter -qe '@.bulkdatad.instances.bulkdata.running')
if [ "$ret" != "true" ]; then
stop
start
else
ubus send bulkdata.reload
fi
return 0
stop
start
}
service_triggers() {
service_triggers()
{
procd_add_reload_trigger bulkdata
}

View File

@@ -0,0 +1,75 @@
#!/bin/sh
. /lib/functions.sh
PROFILE_COUNT=1
get_next_count()
{
local config="$1"
local default_name="${2}"
local count=${3}
local found=0
if [ -z "$count" ]; then
count=1
fi
while [ "${found}" -ne 1 ]; do
uci -q get "${config}"."${default_name}"_${count} >/dev/null
if [ "$?" -eq 0 ]; then
count=$((count + 1))
else
found=1;
fi
done
echo "${default_name}_${count}"
}
translate_profile_id_to_profile_name() {
local section="${1}"
local profile_id="${2}"
local profile_name="${3}"
local curr_profile_id
config_get curr_profile_id "${section}" profile_id
[ -n "${curr_profile_id}" ] || return
[ "${curr_profile_id}" != "${profile_id}" ] && return
uci -q set bulkdata."${section}".profile_name="${profile_name}"
uci -q set bulkdata."${section}".profile_id=""
}
update_profile_sections() {
local section="${1}"
local default="${2}"
local profile_name
config_get profile_id "${section}" profile_id
[ -n "${profile_id}" ] || return
case "${section}" in
"cfg"*)
profile_name="$(get_next_count bulkdata "${default}" ${PROFILE_COUNT})"
uci_rename bulkdata "${section}" "${profile_name}"
;;
esac
PROFILE_COUNT=$((PROFILE_COUNT + 1))
[ -n "$profile_name" ] && section="${profile_name}"
uci -q set bulkdata."${section}".profile_id=""
config_foreach translate_profile_id_to_profile_name profile_parameter "${profile_id}" "${profile_name}"
config_foreach translate_profile_id_to_profile_name profile_http_request_uri_parameter "${profile_id}" "${profile_name}"
}
config_load bulkdata
config_foreach update_profile_sections profile profile
uci commit bulkdata
exit 0

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ddnsmngr
PKG_VERSION:=1.0.9
PKG_VERSION:=1.0.7
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ddnsmngr.git
PKG_SOURCE_VERSION:=5144e73fad92d23ae706894a4357436c3fe89355
PKG_SOURCE_VERSION:=4b0c679c4dc3e3725de5c0c55ed60f24b87c6edd
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -28,8 +28,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Dynamic DNS manager
DEPENDS:=+DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+libbbfdm-api +DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
MENU:=1
endef

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=6.1.0.3
PKG_VERSION:=6.0.0.13
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=005a48c7a40c3fcf89d031fda0e109a25431b20e
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

View File

@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.7.1
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:=daf66f6f2098a343fefb304e7ce9440f55ea1cd1
PKG_SOURCE_VERSION:=98999eb75755f79a3c8a7e802e024b42914d1efc
PKG_MIRROR_HASH:=skip
endif
@@ -28,7 +28,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=DECT Manager
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c +gpiod-tools +voicemngr
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c +gpiod-tools
endef
define Package/$(PKG_NAME)/description

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dhcpmngr
PKG_VERSION:=1.0.4
PKG_VERSION:=1.0.2
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
PKG_SOURCE_VERSION:=2a517188211849bcc324a9f9727eeb34d076c032
PKG_SOURCE_VERSION:=4c89a3f12686343e3cca23819255744ac06dfb22
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -28,10 +28,7 @@ define Package/dhcpmngr
SECTION:=net
CATEGORY:=Network
TITLE:=Package to add Device.DHCPv4 and v6 data model support.
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +odhcpd
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS+=+DNSMNGR_DNS_SD:umdns
DEPENDS+=+DNSMNGR_BACKEND_DNSMASQ:dnsmasq
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +dnsmasq
endef
define Package/dhcpmngr/description
@@ -47,10 +44,6 @@ endif
define Package/dhcpmngr/install
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_lease_start_time.user $(1)/etc/udhcpc.user.d/udhcpc_lease_start_time.user
ifeq ($(CONFIG_DNSMNGR_BACKEND_UNBOUND),y)
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/etc/uci-defaults/unbound.odhcpd.uci_default $(1)/etc/uci-defaults/16-set-unbound-as-odhcpd-leasetrigger
endif
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdhcpmngr.so $(1) $(PKG_NAME)
endef

View File

@@ -1,18 +0,0 @@
#!/bin/sh
# update odhcpd uci to use unbound's script as leasetrigger
uci -q get dhcp.odhcpd >/dev/null 2>&1 && {
maindhcp="$(uci -q get dhcp.odhcpd.maindhcp)"
# if odhcpd is the main dhcp
[ "$maindhcp" = "1" ] || [ "$maindhcp" = "true" ] || [ "$maindhcp" = "on" ] && {
# if unbound daemon and unbound script file is present
[ -e /usr/lib/unbound/odhcpd.sh ] && [ -e /usr/sbin/unbound ] && {
# then set unbound script as leasetrigger in dhcp UCI
uci -q set dhcp.odhcpd.leasetrigger='/usr/lib/unbound/odhcpd.sh'
uci commit dhcp
}
}
}
exit 0

View File

@@ -1,30 +0,0 @@
if PACKAGE_dnsmngr
menu "Configuration"
config DNSMNGR_DNS_SD
bool "Include Device.DNS.SD. TR-181 support"
default y
help
Set this option to include support for TR-181 DNS.SD. object.
choice
prompt "Select backend for DNS management"
default DNSMNGR_BACKEND_DNSMASQ
depends on PACKAGE_dnsmngr
help
Select which backend daemon to use for DNS
config DNSMNGR_BACKEND_DNSMASQ
bool "Use dnsmasq for dns and dhcp"
help
Enable this option to use dnsmasq + odhcpd for dns and dhcp.
config DNSMNGR_BACKEND_UNBOUND
bool "Use unbound with odhcpd-full for dns and dhcp"
help
Enable this option to use unbound + odhcpd for dns and dhcp.
endchoice
endmenu
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmngr
PKG_VERSION:=1.0.12
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:=fb49088ddb498980e2c91f03aea10bd502caeca1
PKG_SOURCE_VERSION:=f6223f6034a57753ae9d1552ab1334194b1deaff
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -27,48 +27,23 @@ MAKE_PATH:=src
define Package/dnsmngr
SECTION:=net
CATEGORY:=Network
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +odhcpd
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS+=+DNSMNGR_DNS_SD:umdns
DEPENDS+=+DNSMNGR_BACKEND_DNSMASQ:dnsmasq
DEPENDS+=+DNSMNGR_BACKEND_UNBOUND:unbound-daemon +DNSMNGR_BACKEND_UNBOUND:unbound-control
TITLE:=Package to configure DNS backend and TR-181 support
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +dnsmasq +umdns
TITLE:=Package to add Device.DNS. datamodel support
endef
define Package/dnsmngr/description
Package to configure DNS backend and TR-181 support.
Package to add Device.DNS. datamodel support.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(CONFIG_DNSMNGR_DNS_SD),y)
define Build/Compile
$(call Build/Compile/Default,all)
endef
else
define Build/Compile
$(call Build/Compile/Default,dns)
endef
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/dnsmngr/* $(PKG_BUILD_DIR)/
endef
endif
ifeq ($(CONFIG_DNSMNGR_BACKEND_DNSMASQ),y)
TARGET_CFLAGS += -DDNSMASQ_BACKEND
endif
define Package/dnsmngr/install
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdnsmngr.so $(1) $(PKG_NAME)
$(BBFDM_INSTALL_SCRIPT) -d $(PKG_BUILD_DIR)/scripts/nslookup $(1)
ifeq ($(CONFIG_DNSMNGR_DNS_SD),y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libdns_sd.so $(1) $(PKG_NAME)
endif
endef
$(eval $(call BuildPackage,dnsmngr))

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dslmngr
PKG_VERSION:=1.2.8
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:=5340cb31f759301f5aca3fd848fc3a63b0b4663f
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
@@ -40,8 +40,7 @@ define Package/dslmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=XDSL status and configration utility
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy +libbbfdm-api
endef
define Package/dslmngr/description

29
emctrl2/Makefile Normal file
View 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
View 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)

View 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}
};

View File

@@ -27,8 +27,7 @@ define Package/ethmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Ethernet status and configration utility
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy +libbbfdm-api
endef
define Package/ethmngr/description

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=firewallmngr
PKG_VERSION:=1.0.6
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:=2cac05871f7a8d93c144157c5f3f129deecf1a29
PKG_SOURCE_VERSION:=94246676dc2e2db29b94fcffec1be3cee3ec8e9f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -28,10 +28,9 @@ define Package/firewallmngr
SECTION:=net
CATEGORY:=Network
TITLE:=Package to add Device.Firewall and Device.NAT. data model support.
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +firewall
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +firewall
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:kmod-ipt-trigger +FIREWALLMNGR_PORT_TRIGGER:kmod-ip6t-trigger
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:iptables-mod-nfqueue
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
define Package/firewallmngr/description

View File

@@ -6,13 +6,14 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=fluent-bit
PKG_VERSION:=3.1.0
PKG_RELEASE:=$(AUTORELEASE)
PKG_RELEASE:=1
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit/archive/v$(PKG_VERSION)
PKG_HASH:=7a49e110cf3050b6c29c911063494b8081f3c743274d1d95e52562d0476ba1eb
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit.git
PKG_SOURCE_VERSION=v$(PKG_VERSION)
PKG_MIRROR_HASH:=9bedfabf859b88a2cfcf51cc17669b83a170e85427ce562131366cb1542b52ae
endif
PKG_LICENSE:=Apache-2.0

View File

@@ -1,45 +0,0 @@
diff --git a/plugins/out_file/file.c b/plugins/out_file/file.c
index 2e47c9666..95d28e438 100644
--- a/plugins/out_file/file.c
+++ b/plugins/out_file/file.c
@@ -27,6 +27,7 @@
#include <msgpack.h>
#include <stdio.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -55,6 +56,7 @@ struct flb_file_conf {
int csv_column_names;
int mkdir;
struct flb_output_instance *ins;
+ char hostname[256];
};
static char *check_delimiter(const char *str)
@@ -141,6 +143,9 @@ static int cb_file_init(struct flb_output_instance *ins,
}
}
+ if (gethostname(ctx->hostname, sizeof(ctx->hostname)) != 0)
+ snprintf(ctx->hostname, sizeof(ctx->hostname), "%s", "localhost");
+
tmp = flb_output_get_property("delimiter", ins);
ret_str = check_delimiter(tmp);
if (ret_str != NULL) {
@@ -233,12 +238,8 @@ static int template_output_write(struct flb_file_conf *ctx,
int i;
msgpack_object_kv *kv;
- /*
- * Right now we treat "{time}" specially and fill the placeholder
- * with the metadata timestamp (formatted as float).
- */
- if (!strncmp(key, "time", size)) {
- fprintf(fp, "%f", flb_time_to_double(tm));
+ if (!strncmp(key, "hostname", size)) {
+ fprintf(fp, "%s", ctx->hostname);
return 0;
}

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostmngr
PKG_VERSION:=1.2.9
PKG_VERSION:=1.2.6
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=27b2d7c3ef0ccb4e2c30f790f2b51881b6884d9c
PKG_SOURCE_VERSION:=aa365710b227ba82b1c43f9cdf497261edb21852
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
@@ -31,8 +31,9 @@ define Package/hostmngr
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
+libnetfilter-conntrack \
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libwifiutils
DEPENDS+= +libbbfdm-api +libbbfdm-ubus +dm-service
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api \
+libwifiutils
endef
define Package/hostmngr/config

View File

@@ -3,8 +3,4 @@ menu "Configuration"
config ICWMP_MGMT_FROM_USP
bool "Support configuration of ManagementServer from USP"
default y
config ICWMP_BACKUP_EVENTS
bool "Create backup of session events to persistent storage after each successful session"
default y
endmenu

View File

@@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.8.22
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:=2eeb0990616df846da55a154d2fed05c828d168f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_VERSION:=580f923cfc89aa9f151096d8606dde71e4604d08
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -31,8 +31,7 @@ define Package/icwmp
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=TR069 CWMP client
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libopenssl
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api +libopenssl
MENU:=1
endef
@@ -48,10 +47,6 @@ ifeq ($(CONFIG_ICWMP_MGMT_FROM_USP),y)
EXTRA_CFLAGS += -DCWMP_DUAL_SUPPORT=BBFDM_BOTH
endif
ifeq ($(CONFIG_ICWMP_BACKUP_EVENTS),y)
EXTRA_CFLAGS += -DPERSIST_BACKUP_SESSION_EVENTS
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
@@ -68,13 +63,12 @@ define Package/icwmp/install
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(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/
$(INSTALL_BIN) ./files/etc/uci-defaults/95-set-random-inform-time $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/icwmpd/vendor_log.sh $(1)/etc/icwmpd/vendor_log.sh
$(INSTALL_BIN) ./files/etc/icwmpd/firewall.cwmp $(1)/etc/icwmpd/firewall.cwmp
$(INSTALL_BIN) ./files/etc/icwmpd/critical_services.json $(1)/etc/icwmpd/critical_services.json
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user

View File

@@ -1,29 +0,0 @@
#!/bin/sh
# This script handles '2 Vendor Log File' of Download RPC
# Vendors can replace this file if they need to collect more logs
VENDOR_LOG_FILE="/tmp/icwmp/2_vendor_log"
ret=""
if [ -n "$(which logread)" ]; then
mkdir -p /tmp/icwmp
logread > "${VENDOR_LOG_FILE}"
arch_file="${VENDOR_LOG_FILE}.tar"
if [ -f "${arch_file}" ]; then
rm -f ${arch_file}
fi
if [ -f "${VENDOR_LOG_FILE}" ]; then
tar -cf "${arch_file}" "${VENDOR_LOG_FILE}" 2> /dev/null
if [ -f "${arch_file}" ]; then
ret="${arch_file}"
fi
rm -rf "${VENDOR_LOG_FILE}"
fi
fi
echo "${ret}"

View File

@@ -3,7 +3,7 @@
uci -q batch <<-EOT
delete firewall.cwmp
set firewall.cwmp=include
set firewall.cwmp.path=/etc/icwmpd/firewall.cwmp
set firewall.cwmp.path=/etc/firewall.cwmp
set firewall.cwmp.reload=1
commit firewall
EOT

View File

@@ -21,9 +21,6 @@ config IEEE1905_WIFI_EASYMESH
config IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
bool "Fragment large CMDU frame at TLV boundary instead of octet boundary"
config IEEE1905_BUILD_TR181_PLUGIN
bool "Build TR-181 mapping module (responsible for Device.IEEE1905.)"
endmenu
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.6.1
PKG_VERSION:=8.5.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5f7e6e30cbda36e431ecb7150d7494bce0c26f6f
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
@@ -48,8 +48,7 @@ define Package/ieee1905
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +ubus +libpthread \
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi \
+libwifiutils
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
+libwifiutils +libbbfdm-api
endef
include $(wildcard plugins/*.mk)
@@ -97,7 +96,6 @@ TARGET_CFLAGS += -DEXTENSION_ALLOWED
endif
TARGET_CFLAGS += -DHAS_UBUS
TARGET_CFLAGS += -DBUILD_TR181_PLUGIN
MAKE_FLAGS += \
extmod_subdirs="$(patsubst %,extensions/%,$(plugins))"

View File

@@ -36,7 +36,7 @@ _iop()
feeds_update genconfig \
generate_tarballs install_key \
scp_changes setup_host ssh_install_key status \
ssh_upgrade smoketest"
update_feed_branches ssh_upgrade smoketest"
if [ $COMP_CWORD -eq 1 ] ; then

72
iop/scripts/annexconfig.sh Executable file
View File

@@ -0,0 +1,72 @@
#!/bin/bash
function disable_add_config () {
local COPTION="$1"
HAVE_OPTION=`grep $COPTION .config | wc -l`
HAVE_OPTION_DISABLED=`grep "# $COPTION" .config | wc -l`
if [ "$HAVE_OPTION" = "1" ]
then
if [ "$HAVE_OPTION_DISABLED" = "0" ]
then
sed -i -e "s,$COPTION=y,# $COPTION is not set,g" .config
fi
else
echo "# $COPTION is not set" >> .config
fi
}
function enable_option () {
local COPTION="$1"
# cat .config| grep DSL
sed -i -e "s,# $COPTION is not set,$COPTION=y,g" .config
# cat .config| grep DSL
}
function annexconfig {
v() {
[ "$VERBOSE" -ge 1 ] && echo "$@"
}
local ANNEX="$1"
disable_add_config CONFIG_TARGET_NO_DSL
disable_add_config CONFIG_TARGET_DSL_ANNEX_A
disable_add_config CONFIG_TARGET_DSL_ANNEX_B
disable_add_config CONFIG_TARGET_DSL_ANNEX_C
disable_add_config CONFIG_TARGET_DSL_SADSL
disable_add_config CONFIG_TARGET_DSL_GFAST
if [ "$ANNEX" = "no" ]
then
echo "No DSL"
enable_option CONFIG_TARGET_NO_DSL
elif [ "$ANNEX" = "a" ]
then
echo "Annex A"
enable_option CONFIG_TARGET_DSL_ANNEX_A
elif [ "$ANNEX" = "b" ]
then
echo "Annex B"
enable_option CONFIG_TARGET_DSL_ANNEX_B
elif [ "$ANNEX" = "c" ]
then
echo "Annex C"
enable_option CONFIG_TARGET_DSL_ANNEX_C
elif [ "$ANNEX" = "sadsl" ]
then
echo "sadsl"
enable_option CONFIG_TARGET_DSL_SADSL
elif [ "$ANNEX" = "gfast" ]
then
echo "G.fast"
enable_option CONFIG_TARGET_DSL_GFAST
else
echo "Only option no,a,b,c,sadsl,gfast supported"
fi
}
register_command "annexconfig" "Select configuration annex"

View File

@@ -0,0 +1,42 @@
# this is a developer helper script to install firmware on a remote host running in CFE mode
function usage {
echo "usage: $0 cfe_upgrade <host> <file>"
}
function cfe_upgrade {
if [ -z "$1" ] ; then
usage
echo "Error: host required"
exit 1
fi
if [ -z "$2" ] ; then
usage
echo "Error: firmware filename required"
exit 1
fi
if [ ! -e $2 ] ; then
usage
echo "Error: firmware file does not exist"
exit 1
fi
IMAGE=`basename $2`
echo "CFE upgrade host: $1 with file $IMAGE"
[ "$2" ] && [ -e "$2" ] && curl -i -F filedata=@$2 http://$1/upload.cgi && echo "upgrade done!"
}
register_command "cfe_upgrade" "<host> <file> Install firmware on remote host in CFE mode"
function cfe_upgrade_latest {
if [ -z "$1" ] ; then
echo "usage: $0 cfe_upgrade_latest <host>"
echo "Error: host required"
exit 1
fi
{ cd `dirname $0`
IMAGE=`ls -Art bin/*/*.w | tail -n1`
[ "$IMAGE" ] && [ -e "$IMAGE" ] && ./iop cfe_upgrade $1 $IMAGE
}
}
register_command "cfe_upgrade_latest" "<host> Install latest firmware on remote host in CFE mode"

29
iop/scripts/genconfig_wrap.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Function to convert parameters to lowercase
function to_lowercase {
local params=()
for param in "$@"; do
params+=("$(tr '[:upper:]' '[:lower:]' <<< "$param")")
done
echo "${params[@]}"
}
function genconfig {
target_script="./scripts/gen_config.py"
# First convert all to lowercase
args=$(to_lowercase "$@")
# Check if an option is provided
if [[ ${args[0]} == -* ]]; then
# Convert options for target script
if [[ ${args[0]} == "-b" || ${args[0]} == "--boards" ]]; then
args=("--list")
fi
fi
${target_script} ${args[@]}
}
register_command "genconfig" "Generate configuration for board and customer"

283
iop/scripts/iopupgrade.sh Normal file
View File

@@ -0,0 +1,283 @@
# this is a developer helper script to install firmware on a remote host with SSH
function upd_usage {
echo "usage: $0 ssh_upgrade [-t <host>] [-f <file>] [opts] "
echo ""
echo " Default host is 192.168.1.1"
echo " Default firmware file is the latest one (last.{itb,pkgtb})"
echo " Default is to not keep configuration"
echo "opts:"
echo ""
echo " -i Interactive use, allows to select firmware file"
echo " -n Do not do the final reboot of the target board"
echo " -c Keep configuration"
echo " -x Force install even if firmware is not for this board"
echo " -b Force install of bootloader regardless of version installed"
}
function set_config_string {
eval $(grep $1 .config)
}
function upd_ask_ok {
echo "Will continue with the following settings:"
echo "-----------------------------------------"
printf "%20s: %s\n" "Firmware file" "$upd_fw_base"
printf "%20s: %s\n" "Host IP" "$upd_host"
printf "%20s: " "Reboot"
if [ "$upd_noreboot" == "0" ]; then printf "Yes\n"; else printf "No\n"; fi
printf "%20s: " "Keep config"
if [ "$upd_keepconf" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
printf "%20s: " "Force bootloader"
if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
printf "%20s: " "Force image upgrade"
if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
echo "-----------------------------------------"
echo -n "Continue? [Y/n/q]:"
read answer
case $answer in
n | N)
return 1
;;
q | Q)
exit 1
;;
y | Y | *)
return 0
;;
esac
}
function upd_select_file {
dialog --keep-tite --title "To select a file, use TAB/ARROW to highlight then press SPACEBAR -> RETURN" \
--fselect "${upd_fw:-bin/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/}" \
$((lines - 10)) $((cols - 5)) \
2>$tempfile
new_file=$(cat $tempfile)
if [ -n "$new_file" ]; then
upd_fw="$new_file"
upd_fw_base=$(basename $upd_fw)
fi
}
function upd_select_target {
dialog --keep-tite --title "Input the hostname/IP of the target board" \
--inputbox "Name/IP" \
$((lines - 10)) $((cols - 5)) \
"$upd_host" \
2>$tempfile
new_file=$(cat $tempfile)
if [ -n "$new_file" ]; then
upd_host="$new_file"
fi
}
function upd_select_reboot {
dialog --keep-tite --radiolist "Should the board reboot after download finished" \
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
"Reboot" "Restart board after done" $(if [ "$upd_noreboot" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
"No reboot" "Continue running old system" $(if [ "$upd_noreboot" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
2>$tempfile
res=$(cat $tempfile)
case $res in
"No reboot")
upd_noreboot=1
;;
"Reboot")
upd_noreboot=0
;;
esac
}
function upd_select_config {
dialog --keep-tite --radiolist "Should the configuration be kept" \
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
"Keep" "Keep the config from old system" $(if [ "$upd_keepconf" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
"Default" "Use default config for new system" $(if [ "$upd_keepconf" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
2>$tempfile
res=$(cat $tempfile)
case $res in
"Keep")
upd_keepconf=1
;;
"Default")
upd_keepconf=0
;;
esac
}
function upd_select_forceboot {
dialog --keep-tite --radiolist "Should the boot loader be updated regardless of the version installed" \
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
"Force" "Always update boot loader" $(if [ "$upd_forceboot" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
"Version check" "Only upgrade if version is newer" $(if [ "$upd_forceboot" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
2>$tempfile
res=$(cat $tempfile)
case $res in
"Force")
upd_forceboot=1
;;
"Version check")
upd_forceboot=0
;;
esac
}
function upd_select_forceimage {
dialog --keep-tite --radiolist "Should the image be stored in flash even if sanity checks would reject it" \
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
"Force" "Disable sanity check and force use of image (dangerous)" $(if [ "$upd_forceimage" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
"Only compatible" "Normal checks apply" $(if [ "$upd_forceimage" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
2>$tempfile
res=$(cat $tempfile)
case $res in
"Force")
upd_forceimage=1
;;
"Only compatible")
upd_forceimage=0
;;
esac
}
function upd_select {
dialog --keep-tite --ok-label "Select" --cancel-label "Done" --menu "Select item to change" \
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
"Firmware file" "$upd_fw_base" \
"Host IP" "$upd_host" \
"Reboot" $(if [ "$upd_noreboot" == "0" ]; then printf "Yes\n"; else printf "No\n"; fi) \
"Keep config" $(if [ "$upd_keepconf" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
"Force bootloader" $(if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
"Force image upgrade" $(if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
2>$tempfile
case $(cat $tempfile) in
"Firmware file")
upd_select_file
;;
"Host IP")
upd_select_target
;;
"Reboot")
upd_select_reboot
;;
"Keep config")
upd_select_config
;;
"Force bootloader")
upd_select_forceboot
;;
"Force image upgrade")
upd_select_forceimage
;;
*)
return
;;
esac
upd_select
}
function upd_select_start {
lines=$(tput lines)
cols=$(tput cols)
tempfile="$(mktemp)"
trap "rm -f $tempfile" 0 1 2 5 15
upd_select
}
function ssh_upgrade {
upd_noreboot=0
upd_forceboot=0
upd_keepconf=0
upd_forceimage=0
upd_fw_base=""
upd_fw=""
upd_host="192.168.1.1"
do_dialog=0
while getopts "f:hnxt:icb" opt; do
case $opt in
n)
upd_noreboot=1
;;
x)
upd_forceimage=1
;;
b)
upd_forceboot=1
;;
c)
upd_keepconf=1
;;
v)
verbose=$OPTARG
;;
f)
upd_fw=$OPTARG
;;
t)
upd_host=$OPTARG
;;
i)
do_dialog=1
;;
h)
upd_usage
exit 1
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
if [ -z "$upd_fw" ]; then
set_config_string CONFIG_TARGET_BOARD
set_config_string CONFIG_TARGET_SUBTARGET
upd_fw="$(realpath -q --canonicalize-existing --relative-to=. "bin/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/"last.{pkgtb,itb})"
if [ -z "$upd_fw" ] && [ $do_dialog -eq 0 ]; then
echo "Could not find image. Check that last.{itb,pkgtb} exists or specify an image using -f <image> or -i (interactive)." >&2
return 1
fi
fi
upd_fw_base="$(basename "$upd_fw")"
[ $do_dialog -eq 1 ] && upd_select_start
if ! upd_ask_ok; then
upd_select_start
if ! upd_ask_ok; then
exit 1
fi
fi
if [ ! -f $upd_fw ]; then
echo "Firmware file $firmware does not exist."
exit 1
fi
extra_args=""
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args --no-reboot"
[ $upd_forceimage -eq 1 ] && extra_args="$extra_args --force"
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args --force-loader-upgrade"
pv "$upd_fw" |
ssh \
-o ConnectTimeout=60 \
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
root@"$upd_host" \
sh -c "cat > '/tmp/$upd_fw_base' && (set -x && sysupgrade -v $extra_args /tmp/$upd_fw_base)" ||
echo "Sysupgrade failed" >&2 && return 1
}
register_command "ssh_upgrade" "-t <host> -f <file> [opts] Install firmware on remote host with SSH"

View File

@@ -0,0 +1,35 @@
#!/bin/sh
function license_report {
LICDIR="/tmp/licenses-generator/"
LICBIN="${LICDIR}/bin"
dpkg -s python3 python3-requests python3-yaml python3-mako python3-six &> /dev/null
if [ $? -ne 0 ]
then
echo "Missing dependencies"
sudo apt-get update
sudo apt-get install python3 python3-requests python3-yaml python3-mako python3-six
else
echo "Dependecy check passed"
fi
if [ -d "$LICDIR" ]; then
### Take action if $DIR exists ###
echo "Creating json licences file and html formated report"
else
### Control will jump here if $DIR does NOT exists ###
echo "Error: licenses-generator not found. getting from iopsys repo"
git clone git@dev.iopsys.eu:iopsys/licenses-generator.git $LICDIR
fi
LICGET=`${LICBIN}/licenses-generator gen-License bin/`
echo $LICGET
${LICBIN}/licenses-generator gen-licrprt $LICGET
exit 0
}
register_command "license_report" "Generate a Licence report on latest build in json format and html under reports"

89
iop/scripts/taas.sh Normal file
View File

@@ -0,0 +1,89 @@
# Shorthand command for doing a HIL runtime smoketest on the
# latest built image. Does the image boot up correctly?
# More info here:
# https://dev.iopsys.eu/iopsys/iopsys-taas
#--------------------------------------------------------------
function taas-init() {
local f
# Path to TaaS binarys. Try some likely ones.
if ! which taas-smoketest >/dev/null; then
PATH="${PATH}:${PWD}/../iopsys-taas/bin"
PATH="${PATH}:${PWD}/../taas/bin"
PATH="${PATH}:${HOME}/iopsys-taas/bin"
PATH="${PATH}:${HOME}/taas/bin"
PATH="${PATH}:${HOME}/bin"
PATH="${PATH}:/opt/iopsys-taas/bin"
PATH="${PATH}:/opt/taas/bin"
fi
if ! which taas-smoketest >/dev/null; then
echo "Error; TaaS is missing! Install it with:"
echo "git clone git@dev.iopsys.eu:iopsys/iopsys-taas.git ../iopsys-taas"
exit 1
fi
# Create a list of all images which might be of use.
for f in ${PWD}/bin/targets/iopsys-*/generic/last.*; do
[[ -s "$f" ]] && images+=("$f")
done
# Convert Iopsys target name to the TaaS product name format
# according to what is available in the remote lab for HIL.
# Also find a suitable image.
product=$(grep CONFIG_TARGET_PROFILE .config | \
tr -s "=\"" " " | cut -d " " -f 2) || exit
case "$product" in
smarthub3)
export product="SmartHub3a"
;;
dg400prime|eg400|ex600)
export product=$(echo -n "$product" | tr [[:lower:]] [[:upper:]])
;;
*)
echo "Unsupported target; skipping!"
exit 0
;;
esac
if [[ ${#images[@]} -eq 0 ]]; then
echo "No image found"
exit 1
fi
}
#--------------------------------------------------------------
function taas-smoketest {
declare -a images
taas-init || return
echo "Testing a $product with ${images[@]}..."
command taas-smoketest "${images[@]}" "$product" "$@"
}
#--------------------------------------------------------------
function taas-bootstrap {
declare -a images
if [[ -n "$1" ]]; then
taas-init || return
echo "Flashing $1..."
command taas-bootstrap "${images[@]}" "$@"
else
echo "Usage: ./iop taas-bootstrap dutX"
exit 1
fi
}
register_command "taas-bootstrap" "Write image to a remote lab device."
register_command "taas-smoketest" "Write image to a remote lab device and test it."

View File

@@ -0,0 +1,61 @@
#!/bin/sh
# Exported interface
function update_feed_branches {
local release="$1"
local ipath="$(pwd)"
local branch="$2"
local curbranch
[ -n "$release" ] || {
echo "Usage: ./update_feeds <RELEASE> <BRANCH>"
echo ""
echo "If you do not give a branch as argument,"
echo "<RELEASE> branch will be updated to commit"
echo "hash given in feeds.conf for each feed repo"
exit 1
}
if [ -n "$branch" ]; then
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo at branch $branch"
if git diff-index --quiet HEAD; then
curbranch=`git symbolic-ref HEAD 2>/dev/null`
curbranch=${curbranch##refs/heads/}
if [ -z $curbranch ]; then
curbranch=`git log -1 --pretty=format:"%H"`
fi
git checkout $branch || {
echo "couldn't checkout branch $branch"
exit 99
}
else
echo "You have unsaved changes."
exit 99
fi
else
echo "Updating release branch $release to specific commit hash given in feeds.conf for each feed repo"
fi
ifeeds="$(grep -r 'dev.iopsys.eu' feeds.conf | awk '{print$2}' | tr '\n' ' ')"
for f in $ifeeds; do
commith=$(grep $f feeds.conf | cut -d'^' -f2)
cd $ipath/feeds/$f
git branch -D $release 2>/dev/null
echo "$f: updating release branch $release to commit $commith"
git checkout $commith
git push origin :$release
git checkout -b $release
git push --set-upstream origin $release
cd $ipath
done
if [ -n "$branch" ]; then
echo "Release branch $release is updated to specific commit hash given in feeds.conf in in branch $branch for each feed repo"
git checkout $curbranch
else
echo "Release branch $release is updated to specific commit hash given in feeds.conf for each feed repo"
fi
}
register_command "update_feed_branches" "<release> [branch] Update branches in feeds from the current top level commit or specified top level branch"

View File

@@ -4,7 +4,7 @@ PKG_NAME:=iopsys-analytics
PKG_RELEASE:=$(COMMITCOUNT)
PKG_LICENSE:=PROPRIETARY
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=00189cea0a78b7a30dbfdd363b6d8e836437d1bc
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

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libdsl
PKG_VERSION:=7.2.100
PKG_VERSION:=7.2.99
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=20875ec79fcc7c546c2f1253c867d6afbc8bff75
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libdsl.git
PKG_SOURCE_VERSION:=f9f3fcd0f4140540db5bd41059bcca7ded083024
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libdsl.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
@@ -27,8 +27,6 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
CONFIG_ID=$(SUBTARGET:bcm%=BCM%)
CHIP_ID=$(CONFIG_ID:BCM9%=%)
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_$(CONFIG_ID) \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/broadcom/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
else ifeq ($(CONFIG_TARGET_x86),y)
@@ -57,19 +55,12 @@ define Package/libdsl
SUBMENU:=IOPSYS HAL libs
MENU:=1
TITLE:= xDSL library (libdsl)
DEPENDS+=TARGET_brcmbca:bcm963xx-bsp
endef
define Package/libdsl/description
Library provides xDSL/GFAST HAL APIs
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ./libdsl/* $(PKG_BUILD_DIR)/
endef
endif
define Package/libdsl/config
if PACKAGE_libdsl
config LIBDSL_DEBUG

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libethernet
PKG_VERSION:=7.2.111
PKG_VERSION:=7.2.110
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=6e7216e657dfb59e869e393ef58e6b4593c16fc7
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

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-broadcom
PKG_RELEASE:=1
PKG_VERSION:=1.0.15
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:=baf5ebfb45404714bbfcc3068080f93265934d8a
PKG_SOURCE_VERSION:=7fde62b9634c63b9bc71d1c20541798971a78dc8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -38,7 +38,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=IOPSYS libvoice for Broadcom
URL:=
DEPENDS:=+bcm963xx-voice
DEPENDS:=
endef
define Package/$(PKG_NAME)/description
@@ -56,3 +56,4 @@ define Package/$(PKG_NAME)/install
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-d2
PKG_RELEASE:=1
PKG_VERSION:=1.1.14
PKG_VERSION:=1.1.12
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:=0b2bef862fb5aea0b285e339459f46779224e2d0
PKG_SOURCE_VERSION:=772955d814af8bbf91cf5c76f128cd1d17755625
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.7.8
PKG_VERSION:=7.5.2
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b12d933e1cdd3b84eefbb45b0ecf2d1927f5d5dc
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
@@ -43,9 +43,6 @@ else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TARGET_WIFI_TYPE=MEDIATEK MAC80211
TARGET_CFLAGS +=-DIOPSYS_ECONET
ifeq ($(CONFIG_TARGET_airoha_an7581),y)
TARGET_CFLAGS +=-DCONFIG_MTK
endif
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
TARGET_PLATFORM=IPQ95XX
TARGET_WIFI_TYPE=QUALCOMM MAC80211
@@ -54,6 +51,10 @@ else ifeq ($(CONFIG_TARGET_ipq53xx),y)
TARGET_PLATFORM=IPQ53XX
TARGET_WIFI_TYPE=QUALCOMM MAC80211
TARGET_CFLAGS +=-DIPQ53XX
else ifeq ($(CONFIG_TARGET_mediatek),y)
TARGET_PLATFORM=LINUX
TARGET_WIFI_TYPE=MEDIATEK MAC80211
TARGET_CFLAGS +=-DIOPSYS_LINUX
else
$(info Unexpected CONFIG_TARGET, use default MAC80211)
TARGET_PLATFORM=MAC80211
@@ -75,10 +76,6 @@ ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
TARGET_CFLAGS +=-DLIBWIFI_USE_CTRL_IFACE
endif
ifeq ($(CONFIG_LIBWIFI_SKIP_PROBES),y)
TARGET_CFLAGS +=-DLIBWIFI_BRCM_SKIP_PROBES
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
@@ -147,11 +144,6 @@ define Package/libwifi/config
config LIBWIFI_USE_CTRL_IFACE
bool "Create UNIX sockets to interface with hostapd/wpa_supplicant"
default y
config LIBWIFI_SKIP_PROBES
bool "Don't create probe-req events"
default y
endif
endef

View File

@@ -17,18 +17,10 @@ config LOGMNGR_BACKEND_SYSLOG_NG
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.
config LOGMNGR_VENDOR_LOG_FILE
bool "Enable Device.DeviceInfo.VendorLogFile. Object"
depends on PACKAGE_logmngr
default y
help
It adds support for Device.DeviceInfo.VendorLogFile. Object.
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=logmngr
PKG_VERSION:=1.0.6
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:=37f9eef6ad92ab4835893c6c8ee65338917071b6
PKG_SOURCE_VERSION:=ec10abb3cc0f3b96eb806c9c67e18d9d134287e9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -27,9 +27,8 @@ define Package/logmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Logging Manager
DEPENDS:=+LOGMNGR_BACKEND_FLUENTBIT:fluent-bit +LOGMNGR_LOGROTATE:logrotate
DEPENDS:=+libbbfdm-api +LOGMNGR_BACKEND_FLUENTBIT:fluent-bit +LOGMNGR_LOGROTATE:logrotate
DEPENDS+=+LOGMNGR_BACKEND_SYSLOG_NG:syslog-ng
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
define Package/logmngr/description
@@ -52,26 +51,23 @@ define Package/logmngr/install
$(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/
$(INSTALL_BIN) ./files/logread $(1)/usr/sbin
$(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/
$(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_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbflogrotate.so $(1) sysmngr
endif
ifeq ($(CONFIG_LOGMNGR_VENDOR_LOG_FILE),y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfvendorlog.so $(1) sysmngr
$(INSTALL_DATA) ./files/lib/logmngr/logrotate.sh $(1)/lib/logmngr/.
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbflogrotate.so $(1)
endif
endef

View File

@@ -20,9 +20,4 @@ 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 set logmngr.lr1=log_remote
uci set logmngr.lr1.enable=0
uci set logmngr.lr1.action="ac1"
uci set logmngr.lr1.port="514"
uci commit logmngr

View File

@@ -184,9 +184,7 @@ handle_log_file() {
echo "[OUTPUT]" >> ${TMP_CONF_FILE}
echo " name file" >> ${TMP_CONF_FILE}
echo " match $match" >> ${TMP_CONF_FILE}
echo " file $file" >> ${TMP_CONF_FILE}
echo " format template" >> ${TMP_CONF_FILE}
echo " template {time} {hostname} {ident}: {message}" >> ${TMP_CONF_FILE}
echo " file $file" >> ${TMP_CONF_FILE}
}
handle_log_remote() {

View File

@@ -60,12 +60,10 @@ handle_logrotate() {
local compression
config_get compression $section compression
if [ -n "$compression" ]; then
cmd=$(echo "$compression" | awk '{print tolower($0)}')
echo -e "\tcompress" >> ${LOGROTATE_TMP_FILE}
echo -e "\tcompresscmd $cmd" >> ${LOGROTATE_TMP_FILE}
echo -e "\tcompresscmd $compression" >> ${LOGROTATE_TMP_FILE}
fi
echo -e "\taddextension _logrotate" >> ${LOGROTATE_TMP_FILE}
echo -e "\tpostrotate" >> ${LOGROTATE_TMP_FILE}
echo -e "\t\tservice logmngr restart" >> ${LOGROTATE_TMP_FILE}
echo -e "\t\tsleep 1" >> ${LOGROTATE_TMP_FILE}

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=6.2.1.11
PKG_VERSION:=6.1.1.9
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=8f7f2d4c873ef9da9c8403a9900621ff2bb0bfb3
PKG_SOURCE_VERSION:=8779b993dc8075aa48525340b9e86e13fa7ac54b
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause

View File

@@ -65,40 +65,10 @@ generate_multiap_config() {
device="$dev"
ifprefix_radio=""
if is_airoha; then
if [ -d "/sys/module/mt76" ]; then
ifprefix="wlan%_%"
ifname="wlan${devidx}_0"
ifname_bh="wlan${devidx}_1"
else
ifname_sta=""
case "$band" in
2g)
ifprefix="ra%"
ifname="ra0"
ifname_bh="ra1"
ifname_sta="apcli0"
;;
5g)
ifprefix="rai%"
ifname="rai0"
ifname_bh="rai1"
ifname_sta="apclii0"
;;
6g)
ifprefix="rax%"
ifname="rax0"
ifname_bh="rax1"
ifname_sta="apclix0"
;;
esac
ifprefix_radio="${ifprefix}"
if [ "${network_mode}" == "extender" ]; then
ifname="${ifname_sta}"
fi
fi
ifprefix="wlan%_%"
ifname="wlan${devidx}_0"
ifname_bh="wlan${devidx}_1"
uci set wireless.$dev.channels="$channels"
uci commit wireless
elif is_broadcom; then
@@ -116,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
@@ -129,17 +105,12 @@ generate_multiap_config() {
fi
if [ $generate_mapagent_config -eq 1 ]; then
if [ -z "${ifprefix_radio}" ]; then
uci set mapagent.agent.ifprefix="$ifprefix"
fi
uci set mapagent.agent.ifprefix="$ifprefix"
uci set mapagent.agent.brcm_setup="$brcm_setup"
uci set mapagent.agent.ap_follow_sta_dfs="$ap_follow_sta_dfs"
uci add mapagent radio
uci set mapagent.@radio[-1].device="$device"
uci set mapagent.@radio[-1].band="$mode_band"
if [ -n "${ifprefix_radio}" ]; then
uci set mapagent.@radio[-1].ifprefix="${ifprefix}"
fi
if [ "$network_mode" == "extender" ]; then
uci add mapagent bsta

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=6.1.2.7
PKG_VERSION:=6.1.1.5
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=3c9e5ff1dec3aa5c82e39069cd4c9da806877726
PKG_SOURCE_VERSION:=cb27de727b787bdb58bc4bf42fdef8732cb78134
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
LOCAL_DEV=0

View File

@@ -27,9 +27,6 @@ config sta_steering
option report_rcpi_threshold_2g '80'
option report_rcpi_threshold_5g '96'
option report_rcpi_threshold_6g '96'
option steer_retry_int '30'
option steer_int '180'
option steer_disable_int '600'
###################
# Default AP sections credentials will by updated

View File

@@ -6,14 +6,14 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mcastmngr
PKG_VERSION:=1.2.7
PKG_VERSION:=1.2.3
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:=275d7e5448333e53f8bc980344b39f7f577d4664
PKG_SOURCE_VERSION:=117acf7a29e3a343756aab9b0ae330022892c15b
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -29,8 +29,7 @@ MAKE_PATH:=bbf_plugin
define Package/mcastmngr
CATEGORY:=Utilities
TITLE:=Multicast Proxy/Snooping Manager
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
endef
define Package/mcastmngr/description

View File

@@ -39,6 +39,7 @@ config_snooping_upstream_interface() {
local snooping_upstream_intf=""
json_load "$(devstatus $1)"
logger -t "mcastconf" "$(devstatus $1)"
itr=1
json_select bridge-members
@@ -127,14 +128,14 @@ configure_mcpd_snooping() {
config_snooping_common_params $protocol $igmp_s_version $igmp_s_robustness $igmp_s_mode
config_mcast_querier_params $protocol $igmp_s_query_interval $igmp_s_q_resp_interval $igmp_s_last_mem_q_int
config_snooping_upstream_interface "$igmp_s_iface"
config_snooping_on_bridge $protocol "$igmp_s_iface" $igmp_s_mode
config_snooping_on_bridge $protocol $igmp_s_iface $igmp_s_mode
exceptions=$igmp_s_exceptions
fast_leave=$igmp_s_fast_leave
elif [ "$protocol" == "mld" ]; then
config_snooping_common_params $protocol $mld_s_version $mld_s_robustness $mld_s_mode
config_mcast_querier_params $protocol $mld_s_query_interval $mld_s_q_resp_interval $mld_s_last_mem_q_int
config_snooping_upstream_interface "$mld_s_iface"
config_snooping_on_bridge $protocol "$mld_s_iface" $mld_s_mode
config_snooping_on_bridge $protocol $mld_s_iface $mld_s_mode
exceptions=$mld_s_exceptions
fast_leave=$mld_s_fast_leave
fi
@@ -170,14 +171,14 @@ configure_mcpd_proxy() {
config_snooping_common_params $protocol $igmp_p_version $igmp_p_robustness $igmp_p_mode
config_mcast_querier_params $protocol $igmp_query_interval $igmp_q_resp_interval $igmp_last_mem_q_int
config_mcast_proxy_interface $protocol "$igmp_p_up_interfaces"
config_snooping_on_bridge $protocol "$igmp_p_down_interfaces" $igmp_p_mode
config_snooping_on_bridge $protocol $igmp_p_down_interfaces $igmp_p_mode
fast_leave=$igmp_fast_leave
exceptions=$igmp_p_exceptions
elif [ "$protocol" == "mld" ]; then
config_snooping_common_params $protocol $mld_p_version $mld_p_robustness $mld_p_mode
config_mcast_querier_params $protocol $mld_query_interval $mld_q_resp_interval $mld_last_mem_q_int
config_mcast_proxy_interface $protocol "$mld_p_up_interfaces"
config_snooping_on_bridge $protocol "$mld_p_down_interfaces" $mld_p_mode
config_snooping_on_bridge $protocol $mld_p_down_interfaces $mld_p_mode
fast_leave=$mld_fast_leave
exceptions=$mld_p_exceptions
fi

View File

@@ -3,42 +3,8 @@
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
readonly TEMPFILE="/tmp/snooping_stats_"$$
splitup_ipv6addr() {
local inaddr="$1"
local lowaddr=""
local hiaddr=""
local subaddr=""
local outaddr=""
OIFS=$IFS
IFS=":"
for subaddr in $inaddr; do
loaddr="$(printf "%x\n" 0x$(echo -n "$subaddr" | cut -b5-8))"
hiaddr="$(printf "%x\n" 0x$(echo -n "$subaddr" | cut -b1-4))"
if [ -z "$outaddr" ]; then
outaddr="${hiaddr}:${loaddr}"
else
outaddr="${outaddr}:${hiaddr}:${loaddr}"
fi
done
IFS=$OIFS
echo "$outaddr" | sed -e 's/0000/0/g' -e 's/00/0/g' -e 's/000/0/g'
}
meld_files() {
local type="$1"
if [ "$type" = "mld" ]; then
cat "/proc/net/${type}_snooping" | awk -F' ' '{ print $1 " " $2 " " $3 " " $4 " " $5 " " $6 " " $7 " " $8 " NULL " $9 " " $10 " " $11 " " $12 " " $13 " " $12 }' >> "$TEMPFILE"
else
cat "/proc/net/${type}_snooping" >> "$TEMPFILE"
fi
}
read_snooping_file() {
read_mcast_stats() {
cat /proc/net/igmp_snooping > /tmp/igmp_stats
local mcast_addrs=""
local ifaces=""
@@ -67,7 +33,7 @@ read_snooping_file() {
fi
;;
esac
done < "$TEMPFILE"
done < /tmp/igmp_stats
while read line; do
# reading each line
@@ -75,7 +41,6 @@ read_snooping_file() {
br-*)
found_ip=0
grp_ip="$(echo $line | awk -F ' ' '{ print $10 }')"
if [ -z "$mcast_addrs" ]; then
mcast_addrs="$grp_ip"
continue
@@ -95,13 +60,27 @@ read_snooping_file() {
fi
;;
esac
done < "$TEMPFILE"
done < /tmp/igmp_stats
json_init
json_add_array "snooping"
json_add_object ""
IFS=" "
for intf in $ifaces; do
json_add_object ""
json_add_string "interface" "$intf"
json_add_array "groups"
while read line; do
# reading each line
case $line in
br-*)
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
json_add_string "interface" "$intf"
json_add_array "groups"
break
;;
esac
done < /tmp/igmp_stats
IFS=" "
for gip_addr in $mcast_addrs; do
grp_obj_added=0
@@ -119,12 +98,7 @@ read_snooping_file() {
fi
if [ $grp_obj_added -eq 0 ]; then
json_add_object ""
if [ -n "$(echo $gip_addr | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
else
gip_addr=$(splitup_ipv6addr "$gip_addr")
gip="$(echo $gip_addr | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
fi
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
json_add_string "groupaddr" "$gip"
json_add_array "clients"
grp_obj_added=1
@@ -132,12 +106,7 @@ read_snooping_file() {
json_add_object ""
host_ip="$(echo $line | awk -F ' ' '{ print $14 }')"
if [ -n "$(echo $host_ip | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
else
host_ip=$(splitup_ipv6addr "$host_ip")
h_ip="$(echo $host_ip | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
fi
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
json_add_string "ipaddr" "$h_ip"
src_port="$(echo $line | awk -F ' ' '{ print $2 }')"
json_add_string "device" "$src_port"
@@ -146,29 +115,17 @@ read_snooping_file() {
json_close_object #close the associated device object
;;
esac
done < "$TEMPFILE"
if [ $grp_obj_added -eq 1 ]; then
json_close_array #close the associated devices array
json_close_object # close the groups object
fi
done < /tmp/igmp_stats
json_close_array #close the associated devices array
json_close_object # close the groups object
done # close the loop for group addresses
json_close_array #close the groups array
json_close_object # close the snooping object
done # close the loop for interfaces
}
read_mcast_stats() {
echo -n > "$TEMPFILE"
json_init
json_add_array "snooping"
meld_files "igmp"
meld_files "mld"
read_snooping_file
json_close_object # close the snooping object
json_close_array # close the snooping array
json_dump
rm -f "$TEMPFILE"
rm -f /tmp/igmp_stats
}
case "$1" in
@@ -178,12 +135,7 @@ case "$1" in
call)
case "$2" in
stats)
out="$(read_mcast_stats)"
if [ -z "${out}" ]; then
echo '{}'
else
echo "${out}"
fi
read_mcast_stats
;;
esac
;;

View File

@@ -85,8 +85,9 @@ config_mcproxy_interfaces() {
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
local filter=""
for excp in $exceptions; do
local filter=""
case $excp in
*/*)
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
@@ -97,16 +98,16 @@ config_mcproxy_interfaces() {
filter="$filter ($excp | *)"
;;
esac
done
for upstream in $str_up; do
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
done
for upstream in $str_up; do
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
done
for downstream in $str_down; do
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
for downstream in $str_down; do
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
done
done
}
@@ -394,15 +395,13 @@ config_mcproxy() {
disable_snooping
if [ "$igmp_p_enable" == "1" ]; then
config_mcproxy_instance igmp "$igmp_p_version"
fi
if [ "$igmp_s_enable" == "1" ]; then
elif [ "$igmp_s_enable" == "1" ]; then
config_snooping igmp "$igmp_s_version"
fi
if [ "$mld_p_enable" == "1" ]; then
config_mcproxy_instance mld "$mld_p_version"
fi
if [ "$mld_s_enable" == "1" ]; then
elif [ "$mld_s_enable" == "1" ]; then
config_snooping mld "$mld_s_version"
fi
}

View File

@@ -3,46 +3,12 @@
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
readonly TEMPFILE="/tmp/snooping_stats_"$$
mcast_snooping_interface() {
local interface intf gip vid port
config_get interface "$1" interface
for intf in $interface; do
[ -z "$(bridge mdb show dev "$intf" 2> /dev/null | grep -v -F "port ${intf} " | xargs)" ] && continue
json_add_object ""
json_add_string "interface" "$intf"
json_add_array "groups"
for gip in $(bridge mdb show dev "$intf" | grep -v -F "port ${intf} " | cut -f6 -d' ' | sort -u | xargs); do
json_add_object ""
json_add_string "groupaddr" "$gip"
json_add_array "clients"
for port in $(bridge mdb show dev "$intf" | grep -v -F "port ${intf} " | grep -F "grp ${gip} " | cut -f4 -d' ' | sort -u | xargs); do
json_add_object ""
json_add_string "device" "$port"
for vid in $(bridge mdb show dev "$intf" | grep -F "port ${port} grp ${gip} " | grep -F ' vid ' | cut -f9 -d' ' | sort -u | xargs); do
json_add_object ""
json_add_string "vid" "$vid"
json_close_object #close the associated vid object
done
json_close_object #close the associated device object
done
json_close_array #close the associated devices array
json_close_object # close the groups object
done # close the loop for group addresses
json_close_array #close the groups array
json_close_object # close the snooping object
done # close the loop for interfaces
}
meld_files() {
local type="$1"
local snooping_stats="/tmp/${type}_snooping_stats"
read_mcast_stats() {
local temp_igmp_file='/tmp/igmp_stats_'$$
local snooping_stats='/tmp/igmp_snooping_stats'
local old_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
# Sending signal to mcproxy to dump multicast data in /tmp/${type}_snooping_stats
# Sending signal to mcproxy to dump multicast data in /tmp/igmp_snooping_stats
local mcast_pids=$(pidof mcproxy)
for pid in $mcast_pids
do
@@ -58,11 +24,8 @@ meld_files() {
done
fi
[ ! -e "$snooping_stats" ] && return 0
cat "$snooping_stats" >> "$TEMPFILE"
}
cat "$snooping_stats" > "$temp_igmp_file"
read_snooping_file() {
local mcast_addrs=""
local ifaces=""
@@ -91,7 +54,7 @@ read_snooping_file() {
fi
;;
esac
done < "$TEMPFILE"
done < "$temp_igmp_file"
while read line; do
# reading each line
@@ -118,13 +81,27 @@ read_snooping_file() {
fi
;;
esac
done < "$TEMPFILE"
done < "$temp_igmp_file"
json_init
json_add_array "snooping"
json_add_object ""
IFS=" "
for intf in $ifaces; do
json_add_object ""
json_add_string "interface" "$intf"
json_add_array "groups"
while read line; do
# reading each line
case $line in
br-*)
snoop_iface="$(echo $line | awk -F ' ' '{ print $1 }')"
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
json_add_string "interface" "$intf"
json_add_array "groups"
break
;;
esac
done < "$temp_igmp_file"
IFS=" "
for gip_addr in $mcast_addrs; do
grp_obj_added=0
@@ -142,11 +119,7 @@ read_snooping_file() {
fi
if [ $grp_obj_added -eq 0 ]; then
json_add_object ""
if [ -n "$(echo $gip_addr | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
else
gip="$(echo $gip_addr | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
fi
gip="$(ipcalc.sh $gip_addr | grep IP | awk '{print substr($0,4)}')"
json_add_string "groupaddr" "$gip"
json_add_array "clients"
grp_obj_added=1
@@ -154,11 +127,7 @@ read_snooping_file() {
json_add_object ""
host_ip="$(echo $line | awk -F ' ' '{ print $3 }')"
if [ -n "$(echo $host_ip | grep -oE "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$")" ]; then
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
else
h_ip="$(echo $host_ip | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
fi
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
json_add_string "ipaddr" "$h_ip"
src_port="$(echo $line | awk -F ' ' '{ print $4 }')"
json_add_string "device" "$src_port"
@@ -167,32 +136,17 @@ read_snooping_file() {
json_close_object #close the associated device object
;;
esac
done < "$TEMPFILE"
if [ $grp_obj_added -eq 1 ]; then
json_close_array #close the associated devices array
json_close_object # close the groups object
fi
done < "$temp_igmp_file"
json_close_array #close the associated devices array
json_close_object # close the groups object
done # close the loop for group addresses
json_close_array #close the groups array
json_close_object # close the snooping object
done # close the loop for interfaces
}
read_mcast_stats() {
echo -n > "$TEMPFILE"
json_init
json_add_array "snooping"
meld_files "igmp"
meld_files "mld"
read_snooping_file
# L2 Snooping goes here
config_load mcast
config_foreach mcast_snooping_interface "snooping"
json_close_object # close the snooping object
json_close_array # close the snooping array
json_dump
rm -f "$TEMPFILE"
rm -f "$temp_igmp_file"
}
case "$1" in
@@ -202,12 +156,7 @@ case "$1" in
call)
case "$2" in
stats)
out="$(read_mcast_stats)"
if [ -z "${out}" ]; then
echo '{}'
else
echo "${out}"
fi
read_mcast_stats
;;
esac
;;

View File

@@ -1,51 +0,0 @@
#
# Copyright (C) 2020-2024 iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=netmngr
PKG_VERSION:=1.0.5
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/netmngr.git
PKG_SOURCE_VERSION:=4d778a577c761e5839cd6b6ade35bcc5c4588b10
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
define Package/netmngr
CATEGORY:=Utilities
TITLE:=Network Data Model Support
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
define Package/netmngr/description
Package to add Network data model support.
endef
MAKE_PATH:=src
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
define Package/netmngr/install
$(BBFDM_INSTALL_MS_DM) -u Network $(PKG_BUILD_DIR)/src/libnetmngr.so $(1) $(PKG_NAME)
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/src/libinterface_stack.so $(1)
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) ~/git/netmngr/* $(PKG_BUILD_DIR)/
endef
endif
$(eval $(call BuildPackage,netmngr))

View File

@@ -1,109 +0,0 @@
# Creating Custom Netmodes in IOWRT
This guide provides developers with detailed instructions on how to create and manage custom network modes (netmodes) in IOWRT. The `netmode` script allows for flexible network configuration, and developers can define their own modes by structuring the necessary files and scripts within the `/etc/netmodes/` directory.
## Table of Contents
1. [Overview of Netmodes](#overview-of-netmodes)
2. [Directory Structure](#directory-structure)
3. [Creating a Custom Netmode](#creating-a-custom-netmode)
- [Step 1: Pre-Execution Scripts](#step-1-pre-execution-scripts)
- [Step 2: UCI Configuration Files](#step-2-uci-configuration-files)
- [Step 3: Custom Execution Scripts](#step-3-custom-execution-scripts)
- [Step 4: Post-Execution Scripts](#step-4-post-execution-scripts)
4. [Enabling and Switching Netmodes](#enabling-and-switching-netmodes)
## Overview of Netmodes
Netmodes in IOWRT provide a way to switch between different network configurations based on the needs of the environment. Developers can create custom netmodes by organizing scripts and configuration files in specific directories under `/etc/netmodes/<NETMODE_NAME>`.
## Directory Structure
A custom netmode is defined within the `/etc/netmodes/<NETMODE_NAME>` directory, which should contain the following subdirectories:
- **/lib/netmode/pre/**: Generic scripts executed before the netmode-specific configurations are applied.
- **/etc/netmodes/<NETMODE_NAME>/uci/**: Contains UCI configuration files that will be copied to `/etc/config/` during the application of the netmode.
- **/etc/netmodes/<NETMODE_NAME>/scripts/**: Custom scripts specific to the netmode that are executed after the UCI configurations are applied.
- **/lib/netmode/post/**: Generic scripts executed after the netmode-specific configurations are completed.
## Creating a Custom Netmode
To create a new netmode, follow these steps:
### Step 1: Pre-Execution Scripts
Scripts located in `/lib/netmode/pre/` are executed before any mode-specific actions. These are typically used for preparing the system or cleaning up configurations from the previous netmode.
- **Create Pre-Execution Scripts**:
- Place your generic pre-execution scripts in `/lib/netmode/pre/`.
- Example script (`/lib/netmode/pre/cleanup.sh`):
```bash
#!/bin/sh
echo "Cleaning up old network configurations..."
# Add commands here
```
### Step 2: UCI Configuration Files
The UCI configuration files stored in `/etc/netmodes/<NETMODE_NAME>/uci/` will be copied to `/etc/config/`, effectively applying the desired network configuration.
- **Place UCI Config Files**:
- Create UCI configuration files under `/etc/netmodes/<NETMODE_NAME>/uci/`.
- Example (`/etc/netmodes/bridge/uci/network`):
````bash
config device 'br_lan'
option name 'br-lan'
option type 'bridge'
option multicast_to_unicast '0'
option bridge_empty '1'
list ports 'eth1'
list ports 'eth3'
list ports 'eth4'
config interface 'lan'
option proto 'dhcp'
option device 'br-lan'
option force_link '1'
option reqopts '43 125'
````
### Step 3: Custom Execution Scripts
After the UCI files are applied, any scripts in `/etc/netmodes/<NETMODE_NAME>/scripts/` are executed. These can be used to perform additional configuration tasks that are specific to the netmode.
- **Create Custom Scripts**:
- Add scripts to `/etc/netmodes/<NETMODE_NAME>/scripts/`.
- Example (`/etc/netmodes/bridge/scripts/setup_bridge.sh`):
```bash
#!/bin/sh
echo "Setting up bridge mode..."
# Additional configuration commands here
```
### Step 4: Post-Execution Scripts
Finally, the generic scripts in `/lib/netmode/post/` are executed. These scripts typically finalize the setup or perform any necessary cleanups.
- **Create Post-Execution Scripts**:
- Place scripts in `/lib/netmode/post/`.
- Example script (`/lib/netmode/post/restart_services.sh`):
```bash
#!/bin/sh
echo "Restarting network services..."
# Add commands here
```
## Enabling and Switching Netmodes
The netmode mechanism can be enabled or disabled via the UCI configuration, and you can switch between netmodes using UCI commands.
- **Enable Netmode**:
```bash
uci set netmode.global.enabled=1
uci commit netmode
```
- **Switch Netmode**:
```bash
uci set netmode.global.mode='<NETMODE_NAME>'
uci commit netmode
```

View File

@@ -1,3 +1,4 @@
if PACKAGE_obuspa
config OBUSPA_MTP_ENABLE_MQTT
bool "Enable MQTT as mtp protocol"
default y
@@ -55,3 +56,4 @@ config OBUSPA_SESSION_EXTENSION
Adds Device.LocalAgent.X_IOPSYS_EU_Session. object to simulate
a CWMP like session
endif

View File

@@ -5,15 +5,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=9.0.0.14
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:=00a9001bff19e074d4896b59e8839aab9f6f961e
PKG_SOURCE_VERSION:=eb7bddb8c0bd00b7e5d33daa9d51725309ac50b9
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -34,8 +34,7 @@ define Package/obuspa
MENU:=1
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 +libjson-c
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
+OBUSPA_ENABLE_TEST_CONTROLLER:mosquitto-auth-shadow
endef
define Package/obuspa/description
@@ -115,19 +114,20 @@ define Package/obuspa/install
$(INSTALL_DIR) $(1)/etc/users/roles
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
$(INSTALL_DATA) ./files/etc/users/roles/*.json $(1)/etc/users/roles/
$(INSTALL_DATA) ./files/etc/obuspa/usp_utils.sh $(1)/etc/obuspa/
echo "$(CONFIG_BBF_VENDOR_PREFIX)" > $(1)/etc/obuspa/vendor_prefix
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/60-generate-ctrust-defaults $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/obuspa-set-dhcp-option $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/92-obuspa_firewall $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/firewall.usp $(1)/etc/
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libuspagentdm.so $(1) $(PKG_NAME)
$(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

File diff suppressed because it is too large Load Diff

View File

@@ -5,9 +5,7 @@ config obuspa 'global'
option log_level '2'
option prototrace '0'
option db_file '/etc/obuspa/usp.db'
#option max_group_sep '2'
#option ipc_timeout '30'
#option max_cache_time '600'
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
#option trust_cert '/etc/obuspa/ca.pem'
#option client_cert '/etc/obuspa/client.pem'
#option log_dest '/tmp/obuspa.log'

View File

@@ -1,16 +0,0 @@
#!/bin/sh
log() {
echo "$*"|logger -t obuspa.firewall -p debug
}
config_load obuspa
config_get_bool enable_obuspa global enabled 1
if [ "$enable_obuspa" = "0" ]; then
return 0;
fi
sleep 1
log "Sending WakeUp! event to re-connect after firewall restart"
obuspa -c event "Device.LocalAgent.WakeUp!"

View File

@@ -40,7 +40,7 @@ db_set_reset_file()
shift
value="$*"
if [ -n "${param}" ]; then
if [ -n "${param}" ] && [ -n "${value}" ]; then
echo "${param} \"${value}\"">>${RESET_FILE}
else
echo >>${RESET_FILE}
@@ -352,9 +352,9 @@ configure_controller()
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
fi
if [ -n "${SessionMode}" ]; then
db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
fi
#if [ -n "${SessionMode}" ]; then
# db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
#fi
if [ -n "${assigned_role_name}" ]; then
AssignedRole=$(get_role_index "${assigned_role_name}")
@@ -368,21 +368,9 @@ configure_controller()
db_set "${BASEPATH}.MTP.1.Protocol" "${Protocol}"
# only support configuration of one mtp path per controller using uci
if [ "${Protocol}" = "MQTT" ]; then
# Cleanup
db_set "${BASEPATH}.MTP.1.WebSocket.Host" ""
db_set "${BASEPATH}.MTP.1.WebSocket.Path" ""
db_set "${BASEPATH}.MTP.1.STOMP.Reference" ""
db_set "${BASEPATH}.MTP.1.STOMP.Destination" ""
db_set "${BASEPATH}.MTP.1.MQTT.Reference" "${dm_ref}"
db_set "${BASEPATH}.MTP.1.MQTT.Topic" "${Topic}"
elif [ "${Protocol}" = "STOMP" ]; then
# Cleanup
db_set "${BASEPATH}.MTP.1.WebSocket.Host" ""
db_set "${BASEPATH}.MTP.1.WebSocket.Path" ""
db_set "${BASEPATH}.MTP.1.MQTT.Reference" ""
db_set "${BASEPATH}.MTP.1.MQTT.Topic" ""
db_set "${BASEPATH}.MTP.1.STOMP.Reference" "${dm_ref}"
db_set "${BASEPATH}.MTP.1.STOMP.Destination" "${Destination}"
elif [ "${Protocol}" = "CoAP" ]; then
@@ -391,12 +379,6 @@ configure_controller()
db_set "${BASEPATH}.MTP.1.CoAP.Port" "${Port}"
db_set "${BASEPATH}.MTP.1.CoAP.EnableEncryption" "${EnableEncryption}"
elif [ "${Protocol}" = "WebSocket" ]; then
# Cleanup
db_set "${BASEPATH}.MTP.1.STOMP.Reference" ""
db_set "${BASEPATH}.MTP.1.STOMP.Destination" ""
db_set "${BASEPATH}.MTP.1.MQTT.Reference" ""
db_set "${BASEPATH}.MTP.1.MQTT.Topic" ""
db_set "${BASEPATH}.MTP.1.WebSocket.Host" "${Host}"
db_set "${BASEPATH}.MTP.1.WebSocket.Port" "${Port}"
db_set "${BASEPATH}.MTP.1.WebSocket.Path" "${Path}"
@@ -527,34 +509,18 @@ configure_mtp() {
db_set "${BASEPATH}.Enable" "${Enable}"
db_set "${BASEPATH}.Protocol" "${Protocol}"
if [ "${Protocol}" = "MQTT" ]; then
# cleanup
db_set "${BASEPATH}.WebSocket.Path" ""
db_set "${BASEPATH}.STOMP.Reference" ""
db_set "${BASEPATH}.STOMP.Destination" ""
db_set "${BASEPATH}.MQTT.Reference" "${dm_ref}"
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" "${ResponseTopicConfigured}"
if [ -n "${PublishQoS}" ]; then
db_set "${BASEPATH}.MQTT.PublishQoS" "${PublishQoS}"
fi
elif [ "${Protocol}" = "STOMP" ]; then
# cleanup
db_set "${BASEPATH}.WebSocket.Path" ""
db_set "${BASEPATH}.MQTT.Reference" ""
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" ""
db_set "${BASEPATH}.STOMP.Reference" "${dm_ref}"
db_set "${BASEPATH}.STOMP.Destination" "${Destination}"
elif [ "${Protocol}" = "CoAP" ]; then
db_set "${BASEPATH}.CoAP.Path" "${Path}"
db_set "${BASEPATH}.CoAP.Port" "${Port}"
elif [ "${Protocol}" = "WebSocket" ]; then
# cleanup
db_set "${BASEPATH}.MQTT.Reference" ""
db_set "${BASEPATH}.MQTT.ResponseTopicConfigured" ""
db_set "${BASEPATH}.STOMP.Reference" ""
db_set "${BASEPATH}.STOMP.Destination" ""
db_set "${BASEPATH}.WebSocket.Path" "${Path}"
db_set "${BASEPATH}.WebSocket.Port" "${Port}"
db_set "${BASEPATH}.WebSocket.EnableEncryption" "${EnableEncryption}"
@@ -913,18 +879,6 @@ check_n_delete_db()
delete_sql_db_entry_with_pattern "${path}"
}
workaround_remove_download_pattern()
{
local inst
inst="$(cat ${DB_DUMP} |grep -E "Device.DeviceInfo.FirmwareImage.\d.Download()"|grep -oE "Device.LocalAgent.Request.\d.")"
if [ -n "${inst}" ]; then
log "Workaround to remove the old download Request [$inst]"
delete_sql_db_entry_with_pattern "${inst}"
fi
}
reverse_update_db_with_uci()
{
if [ ! -f "${DB_DUMP}" ]; then
@@ -1011,7 +965,6 @@ db_init()
cp /etc/config/obuspa /tmp/obuspa/
if [ -f "${DB_DUMP}" ]; then
workaround_remove_download_pattern
mv ${DB_DUMP} ${RESET_FILE}
fi

View File

@@ -0,0 +1,7 @@
{
"dmcaching_exclude": [
"Device.Hosts.Host.",
"Device.IEEE1905.",
"Device.WiFi.DataElements."
]
}

View File

@@ -1,12 +0,0 @@
#!/bin/sh
uci -q batch <<-EOT
delete firewall.usp
set firewall.usp=include
set firewall.usp.path=/etc/firewall.usp
set firewall.usp.reload=1
commit firewall
EOT
exit 0

View File

@@ -0,0 +1,39 @@
#!/bin/sh
get_access_role() {
local mode lan_proto
lan_proto="$(uci -q get network.lan.proto)"
if [ "${lan_proto}" == "dhcp" ]; then
mode="extender"
else
mode="full_access"
fi
echo "$mode"
}
config_load obuspa
config_get_bool enable_obuspa global enabled 1
config_get intf global interface
if [ "$enable_obuspa" = "0" ]; then
return 0;
fi
if [ -z "${intf}" ]; then
role="$(get_access_role)"
if [ "${role}" = "extender" ]; then
intf="lan"
else
intf="wan"
fi
fi
[ "$ACTION" = "ifup" -a "${intf}" = "${INTERFACE}" ] && {
sleep 1
obuspa -c event Device.LocalAgent.WakeUp!
}

View File

@@ -1,8 +1,6 @@
Index: obuspa-9.0.0.13/src/core/device.h
===================================================================
--- obuspa-9.0.0.13.orig/src/core/device.h
+++ obuspa-9.0.0.13/src/core/device.h
@@ -338,6 +338,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -336,6 +336,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void);
#endif
@@ -13,10 +11,8 @@ Index: obuspa-9.0.0.13/src/core/device.h
#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);
Index: obuspa-9.0.0.13/src/core/device_controller.c
===================================================================
--- obuspa-9.0.0.13.orig/src/core/device_controller.c
+++ obuspa-9.0.0.13/src/core/device_controller.c
--- a/src/core/device_controller.c
+++ b/src/core/device_controller.c
@@ -967,6 +967,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage
return USP_ERR_OK;
}
@@ -96,10 +92,8 @@ Index: obuspa-9.0.0.13/src/core/device_controller.c
/*********************************************************************//**
**
** DEVICE_CONTROLLER_IsMTPConfigured
Index: obuspa-9.0.0.13/src/core/msg_handler.c
===================================================================
--- obuspa-9.0.0.13.orig/src/core/msg_handler.c
+++ obuspa-9.0.0.13/src/core/msg_handler.c
--- a/src/core/msg_handler.c
+++ b/src/core/msg_handler.c
@@ -1210,6 +1210,15 @@ int ValidateUspRecord(UspRecord__Record
usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0);
#endif

View File

@@ -1,8 +1,6 @@
Index: obuspa-9.0.0.13/src/core/mqtt.c
===================================================================
--- obuspa-9.0.0.13.orig/src/core/mqtt.c
+++ obuspa-9.0.0.13/src/core/mqtt.c
@@ -256,6 +256,8 @@ void MqttSubscriptionDestroy(mqtt_subscr
--- a/src/core/mqtt.c
+++ b/src/core/mqtt.c
@@ -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) \
{\
@@ -11,7 +9,7 @@ Index: obuspa-9.0.0.13/src/core/mqtt.c
return DEVICE_SECURITY_TrustCertVerifyCallbackWithCertChain(preverify_ok, x509_ctx, &mqtt_clients[index].cert_chain);\
}
@@ -266,6 +268,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
@@ -251,6 +253,11 @@ DEFINE_MQTT_TrustCertVerifyCallbackIndex
DEFINE_MQTT_TrustCertVerifyCallbackIndex(2);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(3);
DEFINE_MQTT_TrustCertVerifyCallbackIndex(4);
@@ -23,7 +21,7 @@ Index: obuspa-9.0.0.13/src/core/mqtt.c
// Add more, with incrementing indexes here, if you change MAX_MQTT_CLIENTS
//------------------------------------------------------------------------------------
@@ -276,10 +283,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),

View 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);
}

View File

@@ -1,32 +0,0 @@
--- a/src/core/device_controller.c 2024-08-23 18:22:55.378560809 +0530
+++ b/src/core/device_controller.c 2024-08-23 19:09:07.130278193 +0530
@@ -4282,6 +4282,14 @@
goto exit;
}
+#if defined(E2ESESSION_EXPERIMENTAL_USP_V_1_2)
+ err = ProcessControllerE2ESessionAdded(cont);
+ if (err != USP_ERR_OK)
+ {
+ goto exit;
+ }
+#endif
+
// Exit if unable to get the object instance numbers present in this controller's MTP table
USP_SNPRINTF(path, sizeof(path), "%s.%d.MTP", device_cont_root, cont_instance);
err = DATA_MODEL_GetInstances(path, &iv);
@@ -4323,14 +4331,6 @@
DEVICE_MQTT_UpdateControllerTopics();
#endif
-#if defined(E2ESESSION_EXPERIMENTAL_USP_V_1_2)
- err = ProcessControllerE2ESessionAdded(cont);
- if (err != USP_ERR_OK)
- {
- goto exit;
- }
-#endif
-
// If the code gets here, then we successfully retrieved all data about the controller (even if some of the MTPs were not added)
err = USP_ERR_OK;

View File

@@ -1,60 +0,0 @@
diff --git a/src/core/cli_server.c b/src/core/cli_server.c
index d45555a..016c0b7 100644
--- a/src/core/cli_server.c
+++ b/src/core/cli_server.c
@@ -753,6 +753,15 @@ int ExecuteCli_Get(char *arg1, char *arg2, char *usage)
}
#endif
+ char *path[2] = {0};
+
+ path[0] = arg1;
+ if (arg1 == NULL) {
+ vendor_create_dm_cache(path, 0);
+ } else {
+ vendor_create_dm_cache(path, 1);
+ }
+
// Exit if unable to get a list of all parameters referenced by the expression
STR_VECTOR_Init(&params);
INT_VECTOR_Init(&group_ids);
diff --git a/src/core/data_model.h b/src/core/data_model.h
index b9dc686..0767d02 100755
--- a/src/core/data_model.h
+++ b/src/core/data_model.h
@@ -371,5 +371,6 @@ bool DM_PRIV_IsChildOf(char *path, dm_node_t *parent_node);
bool DM_PRIV_IsChildNodeOf(dm_node_t *node, dm_node_t *parent_node);
bool DM_PRIV_AreAllChildrenGroupId(dm_node_t *parent, int group_id);
+int vendor_create_dm_cache(char *paths[], int num_paths);
#endif
diff --git a/src/core/device_subscription.c b/src/core/device_subscription.c
index a35c0d5..fb2fdcd 100644
--- a/src/core/device_subscription.c
+++ b/src/core/device_subscription.c
@@ -72,10 +72,10 @@
//------------------------------------------------------------------------------
// Uncomment the following define to turn on extra debug which helps with debugging issues related to object
// creation/deletion notifications not being sent
-//#define DEBUG_OBJECT_NOTIFICATIONS
+#define DEBUG_OBJECT_NOTIFICATIONS
#ifdef DEBUG_OBJECT_NOTIFICATIONS
-#define USP_LOG_DebugNotifications(...) USP_LOG_Info(__VA_ARGS__)
+#define USP_LOG_DebugNotifications(...) USP_LOG_Debug(__VA_ARGS__)
#else
#define USP_LOG_DebugNotifications(...)
#endif
diff --git a/src/core/handle_get.c b/src/core/handle_get.c
index 170d27d..e4edfab 100644
--- a/src/core/handle_get.c
+++ b/src/core/handle_get.c
@@ -123,6 +123,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp, char *controller_endpoint, mtp_conn_t
goto exit;
}
+ vendor_create_dm_cache(path_exprs, num_path_expr);
// Calculate the number of hierarchical levels to traverse in the data model when performing partial path resolution
// NOTE: protocol buffer has depth as an unsigned quantity, but internally we use a signed number, so limit range to that of a signed number
depth = usp->body->request->get->max_depth;

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspc
PKG_VERSION:=1.0.1.8
PKG_VERSION:=1.0.1.7
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa-test-controller.git
PKG_SOURCE_VERSION:=1cf32fa4cb5c07906b1e061a394cf0413a6ad750
PKG_SOURCE_VERSION:=61f14c5a1fba8c251cf1cfb18c163eab62d5674d
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=packet-capture-diagnostics
PKG_VERSION:=1.0.2
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:=d1115ed0c129614192b9c4e68e7b81b52e08ea4f
PKG_SOURCE_VERSION:=6c64e11d78b3be9990714bf5fcd97752cc15c4a8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -27,8 +27,7 @@ define Package/packet-capture-diagnostics
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=PacketCaptureDiagnostics datamodel
DEPENDS:=+tcpdump
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+libbbfdm-api +tcpdump
MENU:=1
endef

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=periodicstats
PKG_VERSION:=1.5.13
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:=72974d0e22a64b2cec51857c3f17dc239fec079f
PKG_SOURCE_VERSION:=e59f980306e9ef4c1e3e56839906b8c5cba18338
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -26,8 +26,7 @@ define Package/periodicstats
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Periodic Statistics Daemon
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
endef
define Package/periodicstats/description

View File

@@ -26,8 +26,7 @@ define Package/port-trigger
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Port Trigger Daemon
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +kmod-ipt-trigger +kmod-ip6t-trigger +iptables-mod-nfqueue
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +kmod-ipt-trigger +kmod-ip6t-trigger +iptables-mod-nfqueue
endef
define Package/port-trigger/description

View File

@@ -28,9 +28,8 @@ 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
DEPENDS+=+kmod-vlantranslation +kmod-dscp2pbit +!(TARGET_brcmbca):ebtables-legacy
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
define Package/qosmngr/description

View File

@@ -26,17 +26,7 @@ hw_intf_init() {
# Initialize the hardware setup library
hw_init_all() {
local tc=0
export TMP_HW_QUEUE_LIST=""
echo clear > /proc/ifc_debug
echo reinit > /proc/ifc_debug
for tc in $(seq 0 7); do
rm -rf "/tmp/qos/dscp_values_${tc}_4"
rm -rf "/tmp/qos/dscp_values_${tc}_6"
done
return 0
}
@@ -160,8 +150,6 @@ hw_commit_all() {
local shape_rate="$TMP_HW_SHAPE_RATE"
local q_count="0"
local mac_qos_flag=""
local pbit=0
local tc=0
# Reorder queues
for q in ${sorted_list} ; do
@@ -217,33 +205,4 @@ hw_commit_all() {
else
/userfs/bin/qosrule discpline Enable 0
fi
if [ -x /userfs/bin/blapi_cmd ]; then
echo 1 > /proc/ifc_send_to_ppe
for tc in $(seq 0 7); do
if [ -s "/tmp/qos/dscp_values_${tc}_4" ]; then
sort -un "/tmp/qos/dscp_values_${tc}_4" | awk 'NR==1{first=$1;last=$1;next}
$1 == last+1 {last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
fi
if [ -s "/tmp/qos/dscp_values_${tc}_6" ]; then
[ -s "/tmp/qos/dscp_values_${tc}_4" ] && sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
$1 == last+1 {last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0");first=$1;last=first}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 0")}'
sort -un "/tmp/qos/dscp_values_${tc}_6" | awk 'NR==1{first=$1;last=$1;next}
$1 == last+1 {last=$1;next}
{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1");first=$1;last=first}
END{system("/userfs/bin/blapi_cmd traffic set_traffic_class DSCP " first*4 " " or(last*4, 0x3) " 1")}'
fi
done
fi
if [ -x /userfs/bin/ifc ]; then
echo 1 > /proc/ifc_send_to_ppe
for pbit in $(seq 0 7); do
/userfs/bin/ifc add vip pbit $pbit
done
fi
}

View File

@@ -26,7 +26,6 @@ broute_ipv4_rule_options()
config_get protocol "$cid" "proto"
config_get dscp_filter "$cid" "dscp_filter"
config_get icmp_type "$cid" "icmp_type"
config_get traffic_class "$cid" "traffic_class"
set_ip_addr "$cid" ebt_match_src_ip ebt_match_dst_ip
@@ -37,7 +36,6 @@ broute_ipv4_rule_options()
tos_val=$((dscp_filter<<2))
tos_hex=$(printf "%x" $tos_val)
broute_filter_on_dscp "$tos_hex"
[ -n "$traffic_class" -a "$dscp_filter" != "0" ] && echo "$((dscp_filter))" >> "/tmp/qos/dscp_values_${traffic_class}_4"
fi
if [ -n "$protocol" ]; then
@@ -59,7 +57,6 @@ broute_ipv6_rule_options()
config_get protocol "$cid" "proto"
config_get dscp_filter "$cid" "dscp_filter"
config_get icmp_type "$cid" "icmp_type"
config_get traffic_class "$cid" "traffic_class"
set_ip_addr "$cid" ebt_match_ipv6_src_ip ebt_match_ipv6_dst_ip
@@ -70,7 +67,6 @@ broute_ipv6_rule_options()
tos_val=$((dscp_filter<<2))
tos_hex=$(printf "%x" $tos_val)
ebt_match_ipv6_dscp "$tos_hex"
[ -n "$traffic_class" -a "$dscp_filter" != "0" ] && echo "$((dscp_filter))" >> "/tmp/qos/dscp_values_${traffic_class}_6"
fi
if [ -n "$protocol" ]; then

View File

@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=self-diagnostics
PKG_VERSION:=1.0.11
PKG_VERSION:=1.0.8
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0-only
@@ -13,8 +13,7 @@ define Package/self-diagnostics
CATEGORY:=Utilities
TITLE:=System Report
DEPENDS:=+@CONFIG_BUSYBOX_CONFIG_TIMEOUT +@CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PATH +@CONFIG_BUSYBOX_CONFIG_TEE \
+@CONFIG_BUSYBOX_CONFIG_GZIP
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
+@CONFIG_BUSYBOX_CONFIG_GZIP +libbbfdm-api
MENU:=1
endef

View File

@@ -2,5 +2,5 @@ config globals 'globals'
option extended_spec_dir '/etc/self-diagnostics/spec'
option exec_timeout '5'
option report_name 'self-diagnostics-report-$MODEL-$SERIAL'
option verbose '1'
option verbose '0'
option compression_level '9'

View File

@@ -11,28 +11,17 @@ case "$1" in
case "$2" in
generate)
read -t 1 -r input
local out
json_load "${input}"
json_get_var modules modules
if [ -z "${modules}" ]; then
out="$(${BIN} -j)"
${BIN} -j
else
out="$(${BIN} -j -m "${modules}")"
fi
if [ -z "${out}" ]; then
echo '{}'
else
echo "${out}"
${BIN} -j -m "${modules}"
fi
;;
list)
out="$(${BIN} -j -l)"
if [ -z "${out}" ]; then
echo '{}'
else
echo "${out}"
fi
${BIN} -j -l
;;
esac
;;

View File

@@ -5,19 +5,16 @@
JSON_OUT=0
SPEC_DIR="/usr/share/self-diagnostics/spec"
SPEC_EXT_DIR="/etc/self-diagnostics/spec"
REPORT_PATH="/var/log/"
REPORT_TEMP_DIR="$(mktemp -p ${REPORT_PATH} -d)"
REPORT_DIR="$(mktemp -d)"
REPORT_NAME="self-test-diagnostics"
VERBOSE=0
COMPOPTS=""
TIMEOUT=5
JSON_OUT_BUFFER=""
cleanup()
{
if [ -d "${REPORT_TEMP_DIR}" ]; then
rm -rf ${REPORT_TEMP_DIR}
fi
[ -d "${REPORT_DIR}" ] && \
rm -rf ${REPORT_DIR}
}
trap cleanup EXIT
@@ -38,20 +35,13 @@ help()
log()
{
log_file="${REPORT_TEMP_DIR}/execution.log"
log_file="${REPORT_DIR}/execution.log"
if [ "$VERBOSE" -eq 1 ]; then
logger -p debug -t $0 "$*"
logger -t $0 "$*"
fi
echo "[$(date +%Y:%m:%d-%H:%M:%S)] $*" >> ${log_file}
}
err_log()
{
log_file="${REPORT_TEMP_DIR}/execution.log"
logger -p err -t $0 "$*"
echo "[$(date +%Y:%m:%d-%H:%M:%S) ERR] $*" >> ${log_file}
}
# Alias ubus to have a smaller 5-second timeout on all subsequent calls
ubus()
{
@@ -70,26 +60,10 @@ config_load()
local temp
local MODEL SERIAL
# Default value for MODEL and SERIAL
MODEL="XXX"
SERIAL="FFFFFFFFFFFF"
log "# Starting Self diagnostics tests #"
if [ "${JSON_OUT}" -eq 1 ]; then
json_init
json_add_string "report_dir" "${REPORT_PATH}"
JSON_OUT_BUFFER="$(json_dump)"
else
echo "report_dir: ${REPORT_PATH}"
fi
temp="$(db -q get device.deviceinfo.ModelName)"
[ -d "${temp}" ] && \
MODEL="${temp}"
temp="$(db -q get device.deviceinfo.SerialNumber)"
[ -d "${temp}" ] && \
SERIAL="${temp}"
MODEL="$(db get device.deviceinfo.ModelName)"
SERIAL="$(db get device.deviceinfo.SerialNumber)"
temp="$(uci -q get self-diagnostics.globals.extended_spec_dir)"
[ -d "${temp}" ] && \
@@ -116,25 +90,24 @@ config_load()
exec_spec()
{
local json_file exec_skip name timeout exec_timeout rc start_time end_time
local json_file exec_skip name timeout exec_timeout rc
start_time="$(date +%s)"
json_file="$1"
[ -z "$json_file" ] && {
err_log "No/invalid spec json_file"
log "No/invalid spec json_file"
return 1
}
log "# Loading $json_file at ${start_time} ..."
log "Loading $json_file ..."
json_init
json_load_file "${json_file}" || {
err_log "Failed to load ${json_file} spec file"
log "Failed to load ${json_file} spec file"
return 1
}
name="$(basename ${json_file})"
export_path="${REPORT_TEMP_DIR}/${name//.json/.log}"
export_path="${REPORT_DIR}/${name//.json/.log}"
exec_skip=0
if json_is_a dependency array; then
@@ -149,7 +122,7 @@ exec_spec()
if [ "$type" == "file" ]; then
json_get_var file file
if [ ! -e "$file" ]; then
err_log "${json_file} has unmet file dependency $file"
log "${json_file} has unmet file dependency $file"
exec_skip=1
json_select ..
continue
@@ -162,7 +135,7 @@ exec_spec()
fi
[ "${exec_skip}" -eq 1 ] && {
err_log "Dependency not satisfied for ${json_file}"
log "Dependency not satisfied for ${json_file}"
return 0
}
@@ -176,10 +149,7 @@ exec_spec()
for key in $keys; do
if json_is_a $key object; then
json_select $key
local cmd_skip file
cmd_skip=0
file=""
if json_is_a dependency array; then
json_select "dependency"
json_get_keys d_keys
@@ -204,7 +174,7 @@ exec_spec()
[ $cmd_skip -eq 1 ] && {
json_select ..
err_log "Dependency not satisfied for ${file}"
log "Dependency not satisfied for ${file}"
continue
}
@@ -222,14 +192,24 @@ exec_spec()
echo "# $description #">> $export_path
echo "# Exec [$cmd], timeout [$exec_timeout] #" >> $export_path
echo "##########################################" >> $export_path
eval timeout ${exec_timeout} $cmd >> $export_path 2>&1
rc=$?
echo "######## Execution done return code $rc ######" >> $export_path
if [ "$VERBOSE" -eq 1 ]; then
if [[ "$cmd" == *"logread "* ]]; then
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path
rc=$?
else
eval timeout ${exec_timeout} $cmd 2>&1 | tee -a $export_path | logger -t self-diagnostics
rc=$?
fi
else
eval timeout ${exec_timeout} $cmd >> $export_path 2>&1
rc=$?
fi
echo "######## Execution return code $rc ######" >> $export_path
if [ "$rc" -eq 0 ]; then
log "Execution [$cmd] completed"
else
err_log "Execution [$cmd] Failed/Timeout with $rc exit code"
log "Execution [$cmd] Failed/Timeout with $rc exit code"
fi
echo >> $export_path
@@ -239,8 +219,7 @@ exec_spec()
json_select ..
fi
end_time="$(date +%s)"
log "# Handling of $json_file done, time: ${end_time}, time_spent: $((end_time - start_time)) sec"
log "Handling of $json_file done"
log ""
}
@@ -335,51 +314,38 @@ list_modules()
generate_report()
{
local filename
local filename report_path
filename="${REPORT_PATH}/${REPORT_NAME}"
report_path="$(dirname "${REPORT_DIR}")"
filename="${report_path}/${REPORT_NAME}"
[ -f "${filename}.tar" ] && rm "${filename}.tar"
[ -f "${filename}.tar.gz" ] && rm "${filename}.tar.gz"
log "# Report generation completed #"
cd ${REPORT_TEMP_DIR} && {
cd ${REPORT_DIR} && {
filename="${filename}.tar"
tar -cf "${filename}" *
}
rm -r "$REPORT_DIR"
if [ -n "$COMPOPTS" ]; then
gzip -${COMPOPTS} -f "${filename}"
filename="${filename}.gz"
fi
# Move logs if failed to generate tar
if [ ! -f "${filename}" ]; then
mv ${REPORT_TEMP_DIR}/*.log ${REPORT_PATH}/
fi
if [ "${JSON_OUT}" -eq 1 ]; then
json_init
json_load "${JSON_OUT_BUFFER}"
if [ -f "${filename}" ]; then
json_add_string result "${filename}"
else
log "error: Failed to generate report tar, check logs in ${REPORT_PATH}"
json_add_string error "Failed to generate report tar, check logs in ${REPORT_PATH}"
fi
json_add_string result "${filename}"
json_dump
else
if [ -f "${filename}" ]; then
echo "result: ${filename}"
else
log "error: Failed to generate report tar, check logs in ${REPORT_PATH}"
echo "error: Failed to generate report tar, check logs in ${REPORT_PATH}"
fi
echo "${filename}"
fi
}
[ ! -d "${SPEC_DIR}" ] && {
log "# ${SPEC_DIR} does not exist"
log "# ${SPEC_DIR} does not exits"
exit 1
}

View File

@@ -1,13 +0,0 @@
#!/bin/sh
function dump_var_state_file()
{
for f in `ls -1 /var/state/`; do
if [ -f "var/state/$f" ]; then
echo "cat /var/state/$f"
cat "/var/state/$f"
fi
done
}
dump_var_state_file

View File

@@ -18,8 +18,8 @@
"cmd": "uci export"
},
{
"description": "Runtime Configuration (/var/state/)",
"cmd": "sh /usr/share/self-diagnostics/helper/var_state_dump.sh"
"description": "Runtime Configuration",
"cmd": "cat /var/state/*"
},
{
"description": "Firmware Environment",

Some files were not shown because too many files have changed in this diff Show More