Compare commits

..

1 Commits

Author SHA1 Message Date
Janusz Dziedzic
e3b1ebf363 map-agent: wait ap-autoconfig when MLO
Don't generate APs early - just wait
ap-autoconfig.
2024-12-03 15:37:15 +00:00
177 changed files with 1513 additions and 2886 deletions

View File

@@ -2,9 +2,13 @@ if PACKAGE_bbfdmd
config BBF_VENDOR_PREFIX
string "Vendor Prefix"
default "X_IOWRT_EU_"
default "X_IOPSYS_EU_"
config BBF_OBFUSCATION_KEY
string "Obfuscation key"
default "371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04"
config BBF_MAX_OBJECT_INSTANCES
int "Maximum number of instances per object"
default 255
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.14.4
PKG_VERSION:=1.12.26
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=c8967d6bf47c8bc96cf8df94236b4edfc95aabea
PKG_SOURCE_VERSION:=811f0616c6a861c9b78d5a079a0f79f3eb0b23b2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -19,8 +19,6 @@ endif
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
include bbfdm.mk
@@ -70,6 +68,10 @@ define Package/bbfdmd/config
source "$(SOURCE)/Config_bbfdmd.in"
endef
define Package/bbf_configmngr/config
source "$(SOURCE)/bbf_configmngr.in"
endef
define Package/libbbfdm-api/description
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
endef
@@ -98,14 +100,12 @@ endif
CMAKE_OPTIONS += \
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
-DBBFDMD_MAX_MSG_LEN:Integer=10485760 \
-DCMAKE_BUILD_TYPE:String="Debug" \
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES) \
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
define Package/libbbfdm-api/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/libbbfdm-api.so $(1)/lib/
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/libbbfdm-api-v2.so $(1)/lib/
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.secure $(1)/usr/libexec/rpcd/bbf.secure
@@ -133,7 +133,6 @@ define Package/bbfdmd/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/bbfdmd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
@@ -159,14 +158,17 @@ endef
define Package/bbf_configmngr/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/bbfdm/
ifeq ($(CONFIG_BBF_CONFIGMNGR_C_BACKEND),y)
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/bbf_configd $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/bbf_configd
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
$(INSTALL_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
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.config $(1)/usr/libexec/rpcd/bbf.config
endif
$(INSTALL_DATA) ./files/etc/bbfdm/critical_services.json $(1)/etc/bbfdm/
endef
@@ -180,17 +182,11 @@ 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-api/legacy
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-api/version-2
$(INSTALL_DIR) $(1)/usr/include/libbbfdm-ubus
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/*.h $(1)/usr/include/libbbfdm-api/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/*.h $(1)/usr/include/libbbfdm-api/legacy/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/*.h $(1)/usr/include/libbbfdm-api/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/*.h $(1)/usr/include/libbbfdm-api/version-2/
$(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/legacy/include/*.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/legacy/libbbfdm-api.so $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/version-2/libbbfdm-api-v2.so $(1)/usr/lib
$(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

19
bbfdm/bbf_configmngr.in Normal file
View File

@@ -0,0 +1,19 @@
if PACKAGE_bbf_configmngr
choice
prompt "Select backend daemon for bbf.config"
default BBF_CONFIGMNGR_C_BACKEND
help
Select which backend daemon should be used for ubus bbf.config
config BBF_CONFIGMNGR_SCRIPT_BACKEND
bool "Use shell script backend"
help
Enable this option to use shell script as the backend for bbf.config. This can be useful for quick and easy scripting of configuration tasks.
config BBF_CONFIGMNGR_C_BACKEND
bool "Use C code backend"
help
Enable this option to use a C code implementation as the backend for bbf.config. This option is generally preferred for performance-critical tasks and scenarios requiring more robust and efficient handling.
endchoice
endif

View File

@@ -47,6 +47,7 @@ BBFDM_INSTALL_CORE_PLUGIN:=$(BBFDM_DIR)/tools/bbfdm.sh -p
# Note:
# - There could be only one main plugin file, so its bind to PKG_NAME
# - Micro-service input.json will be auto generated with this call
# - Use -u (optional argument) to overwrite ubus object name
#
# Example:
# BBFDM_INSTALL_MS_DM $(PKG_BUILD_DIR)/libcwmp.so $(1) $(PKG_NAME)
@@ -87,9 +88,6 @@ BBFDM_INSTALL_MS_PLUGIN:=$(BBFDM_DIR)/tools/bbfdm.sh -m -p
#
BBFDM_INSTALL_SCRIPT:=$(BBFDM_DIR)/tools/bbfdm.sh -s
BBFDM_REGISTER_SERVICES:=$(BBFDM_DIR)/tools/bbfdm.sh -t
# Deprecated functions errors
define BbfdmInstallPluginInMicroservice
$(warning # BbfdmInstallPluginInMicroservice function is deprecated, use BBFDM_INSTALL_MS_PLUGIN macro #)

View File

@@ -1,7 +1,7 @@
config bbfdmd 'bbfdmd'
option enable '1'
option debug '0'
option loglevel '4'
option loglevel '3'
config micro_services 'micro_services'
option enable '1'

View File

@@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
START=80
STOP=07
STOP=10
USE_PROCD=1
PROG=/usr/sbin/bbf_configd

View File

@@ -1,12 +1,12 @@
#!/bin/sh /etc/rc.common
START=60
STOP=05
STOP=8
USE_PROCD=1
PROG=/usr/sbin/dm-service
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/services"
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/micro_services"
. /usr/share/libubox/jshn.sh
@@ -24,7 +24,7 @@ validate_bbfdm_micro_service_section()
_add_microservice()
{
local name path loglevel
local enable enable_core unified_daemon
local enable enable_core
# Check enable from micro-service
path="${1}"
@@ -41,14 +41,9 @@ _add_microservice()
log "datamodel micro-service ${name} not enabled"
return 0
fi
json_get_var unified_daemon unified_daemon 0
if [ "${unified_daemon}" -eq "1" ]; then
return 0
fi
json_select config
json_get_var loglevel loglevel 4
json_get_var loglevel loglevel 3
procd_open_instance "${name}"

View File

@@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
START=97
STOP=06
STOP=10
USE_PROCD=1
PROG=/usr/sbin/bbfdmd
@@ -17,7 +17,7 @@ validate_bbfdm_bbfdmd_section()
uci_validate_section bbfdm bbfdmd "bbfdmd" \
'enable:bool:true' \
'debug:bool:false' \
'loglevel:uinteger:4'
'loglevel:uinteger:3'
}
configure_bbfdmd()

View File

@@ -2,18 +2,18 @@
BBFDM_BASE_DM_PATH="usr/share/bbfdm"
BBFDM_INPUT_PATH="etc/bbfdm/micro_services"
INPUT_FILE="0"
INPUT_TEMPLATE='{"daemon":{"enable":"1","service_name":"template","config":{"loglevel":"3"}}}'
OUT_NAME=""
MICRO_SERVICE=0
SCRIPT=0
DIAG=0
PLUGIN=0
DEST=""
VENDOR_EXTN=""
TOOLS="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
SRC=""
while getopts ":mpsdtv:" opt; do
while getopts ":mpsdu:" opt; do
case ${opt} in
m)
MICRO_SERVICE=1
@@ -27,11 +27,8 @@ while getopts ":mpsdtv:" opt; do
d)
DIAG=1
;;
t)
INPUT_FILE=1
;;
v)
VENDOR_EXTN=${OPTARG}
u)
OUT_NAME="${OPTARG}"
;;
?)
echo "Invalid option: ${OPTARG}"
@@ -92,10 +89,6 @@ bbfdm_install_dm()
minfile=$(mktemp)
jq -c 'del(..|.description?)' ${src} > ${minfile}
if [ -n "${VENDOR_EXTN}" ]; then
sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${minfile}
fi
src=${minfile}
if dpkg -s python3-jsonschema >/dev/null 2>&1; then
echo "Verifying bbfdm Datamodel JSON file"
@@ -115,6 +108,23 @@ bbfdm_install_dm()
fi
}
bbfdm_generate_input()
{
local dest ser
dest_dir=${1}
ser=${2}
dest=${dest_dir}/${ser}.json
if [ -n "${OUT_NAME}" ]; then
echo ${INPUT_TEMPLATE} | jq --arg service "${ser}" --arg OUT "${OUT_NAME}" '.daemon |= (.service_name = $service |.output.name = $OUT)' > ${dest}
else
echo ${INPUT_TEMPLATE} | jq --arg service "${ser}" '.daemon.service_name = $service' > ${dest}
fi
chmod 466 ${dest}
}
if [ -z "$SRC" ] || [ -z "${DEST}" ] ; then
echo "# BBFDM Null value in src[${SRC}], dest[${DEST}]"
exit 1
@@ -131,39 +141,6 @@ if [ "${SCRIPT}" -eq "1" ]; then
exit 0
fi
if [ "${INPUT_FILE}" -eq "1" ]; then
tempfile=""
if [ ! -f "${SRC}" ]; then
echo "# Datamodel Input file ${SRC} not available"
exit 1
fi
if ! cat ${SRC} |jq >/dev/null 2>&1; then
echo "# Invalid datamodel json input file"
exit 1
fi
if [ -z "${DATA}" ]; then
echo "# Package name not provided ...."
exit 1
fi
tempfile=$(mktemp)
cp ${SRC} ${tempfile}
if [ -n "${VENDOR_EXTN}" ]; then
sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${tempfile}
fi
install_dir ${DEST}/etc/bbfdm/services
install_data ${tempfile} ${DEST}/etc/bbfdm/services/${DATA}.json
if [ -f "${tempfile}" ]; then
rm ${tempfile}
fi
exit 0
fi
if [ "${MICRO_SERVICE}" -eq "1" ]; then
if [ -z "${DATA}" ]; then
echo "# service_name[${DATA}] not provided"
@@ -174,6 +151,10 @@ if [ "${MICRO_SERVICE}" -eq "1" ]; then
extn="$(basename ${SRC})"
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}.${extn##*.}
# main micro-service datamodel plugin, create an input file as well
install_dir ${DEST}/${BBFDM_INPUT_PATH}
bbfdm_generate_input ${DEST}/${BBFDM_INPUT_PATH}/ ${DATA}
else
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}/$(basename ${SRC})

View File

@@ -1,45 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2025 IOPSYS Software Solutions AB
include $(TOPDIR)/rules.mk
PKG_NAME:=blkpg-part
PKG_VERSION:=1
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=5a4ec5f53ed904b37fba03f3797fbe2af3077f8d
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/gportay/blkpg-part.git
PKG_MIRROR_HASH:=skip
PKG_MAINTAINER:=Andreas Gnau <andreas.gnau@iopsys.eu>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
MAKE_INSTALL_FLAGS += PREFIX=/usr
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=Disc
TITLE:=User space partition table and disk geometry handling utility
URL:=https://www.portay.io/blkpg-part/
endef
define Package/$(PKG_NAME)/description
blkpg-part creates temporary partitions that are not part of the GPT/MBR.
It makes a partition block device from any consecutive blocks that are
not partitioned. It creates, resizes and deletes partitions on the fly
without writing back the changes to the partition table.
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blkpg-part $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,5 +1,7 @@
if PACKAGE_bridgemngr
menu "Configuration"
config BRIDGEMNGR_BRIDGE_VLAN
bool "Use bridge-vlan backend"
help
@@ -11,7 +13,5 @@ config BRIDGEMNGR_BRIDGE_VENDOR_EXT
help
Set this option to use bridge BBF vendor extensions.
config BRIDGEMNGR_BRIDGE_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endmenu
endif

View File

@@ -5,14 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bridgemngr
PKG_VERSION:=1.0.11
PKG_VERSION:=1.0.7
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:=18c2921a1cf5bfa027c11c5e6ca605ef69fd1168
PKG_SOURCE_VERSION:=4f22b4a4270c8d9b94b9de6f5cbe2a1dd86a3027
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -40,31 +40,18 @@ endef
MAKE_PATH:=src
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VLAN),y)
TARGET_CFLAGS += -DBRIDGE_VLAN_BACKEND
endif
define Package/bridgemngr/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_EXT), y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_PLUGIN) -v ${VENDOR_PREFIX} ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_PLUGIN) ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME)
endif
$(INSTALL_BIN) ./files/etc/init.d/bridging $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/bridging $(1)/etc/config/
endef
ifeq ($(LOCAL_DEV),1)

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "bridgemngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "Bridging"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,33 +0,0 @@
#L2 filter UCI file
config chain 'qos_output'
option target 'qos_output'
option table 'nat'
option chain 'OUTPUT'
option policy 'RETURN'
config chain 'dscp2pbits'
option target 'dscp2pbits'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
config chain 'qos'
option target 'qos'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
config chain 'prevlanxlate'
option target 'prevlanxlate'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
option append 'false'
config chain 'mcsnooping'
option target 'mcsnooping'
option table 'broute'
option chain 'BROUTING'
option policy 'RETURN'
option append 'false'

View File

@@ -1,93 +0,0 @@
#!/bin/sh /etc/rc.common
# Start after bdmf shell, wanconf, and switch-script but before the network-script
START=20
STOP=10
USE_PROCD=1
. /lib/functions.sh
handle_ebtables_chain() {
local sid="$1"
local table
local chain
local target
local policy
local append
local enabled
local ret
config_get table "$sid" table filter
config_get chain "$sid" chain
config_get policy "$sid" policy RETURN
config_get target "$sid" target
config_get_bool append "$sid" append 1
config_get_bool enabled "$sid" enabled 1
[ "$enabled" = "0" ] && return
[ -z "${chain}" -o -z "${target}" ] && return
if [ "$append" != "0" ]; then
append="-A"
else
append="-I"
fi
ebtables --concurrent -t "$table" -N "$target" -P "$policy" 2> /dev/null
ret=$?
if [ $ret -eq 0 ]; then
ebtables --concurrent -t "$table" ${append} "$chain" -j "$target"
else
ebtables --concurrent -t "$table" -D "$chain" -j "$target"
ebtables --concurrent -t "$table" ${append} "$chain" -j "$target"
fi
}
handle_ebtables_rule() {
local sid="$1"
local table
local chain
local target
local match
local value
local enabled
local ret
config_get table "$sid" table filter
config_get chain "$sid" chain
config_get match "$sid" match
config_get value "$sid" value
config_get target "$sid" target RETURN
config_get_bool append "$sid" append 1
config_get_bool enabled "$sid" enabled 1
[ "$enabled" = "0" ] && return
[ -z "${chain}" -o -z "${target}" ] && return
if [ "$append" != "0" ]; then
append="-A"
else
append="-I"
fi
ebtables --concurrent -t "$table" -D "$chain" ${match} -j "$target" ${value} 2> /dev/null
ebtables --concurrent -t "$table" ${append} "$chain" ${match} -j "$target" ${value}
}
start_service() {
config_load bridging
config_foreach handle_ebtables_chain chain
config_foreach handle_ebtables_rule rule
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger bridging
}

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=2.1.19
PKG_VERSION:=2.1.14
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
PKG_SOURCE_VERSION:=628525b02ae9ccd39f4bc85cf616ed4a102bca48
PKG_SOURCE_VERSION:=93c9e87cb9f8f635cece1473cff6f67cff9ff7c0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -54,8 +54,6 @@ define Package/bulkdata/install
$(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/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,bulkdata))

View File

@@ -1,17 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "bulkdata",
"unified_daemon": true,
"services": [
{
"parent_dm": "Device.",
"object": "BulkData",
"proto": "cwmp"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,6 +1,6 @@
config bulkdata 'bulkdata'
option enable '0'
#Log levels: As per syslog 0-7, default 6=>LOG_INFO
option loglevel '3'
#Log levels: Error=1, Warning=2, Info=3, Debug=4
option log_level '3'

View File

@@ -6,20 +6,9 @@ STOP=10
USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
validate_global_section() {
uci_validate_section bulkdata bulkdata bulkdata \
'enable:bool:1' \
'loglevel:uinteger:3'
}
start_service() {
local enable loglevel
validate_global_section
procd_open_instance "bulkdata"
procd_set_param command "$PROG"
procd_append_param command -l ${loglevel}
procd_set_param respawn
procd_close_instance "bulkdata"
}

View File

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ddnsmngr
PKG_VERSION:=1.0.10
PKG_VERSION:=1.0.9
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
@@ -71,7 +71,6 @@ ifeq ($(CONFIG_DDNSMNGR_BACKEND_INADYN),y)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/inadyn/server/* $(1)/etc/ddnsmngr/servers
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/inadyn/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
endif
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libddnsmngr.so $(1) $(PKG_NAME)
endef

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "ddnsmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DynamicDNS"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=6.1.0.7
PKG_VERSION:=6.1.0.6
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=db4eae19a3f716eec5a37aa2786b9bbbe3160b54
PKG_SOURCE_VERSION:=37669ed8365397d65656f11a04f6af8cae57607c
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

@@ -5,7 +5,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dhcpmngr
PKG_VERSION:=1.0.5
PKG_VERSION:=1.0.4
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
@@ -52,7 +52,6 @@ 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_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdhcpmngr.so $(1) $(PKG_NAME)
endef

View File

@@ -1,20 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "dhcpmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DHCPv4"
},
{
"parent_dm": "Device.",
"object": "DHCPv6"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmngr
PKG_VERSION:=1.0.14
PKG_VERSION:=1.0.12
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
PKG_SOURCE_VERSION:=e64ec01b57d8b32e5230b34f6a3866250b1a8faf
PKG_SOURCE_VERSION:=fb49088ddb498980e2c91f03aea10bd502caeca1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -64,7 +64,6 @@ ifeq ($(CONFIG_DNSMNGR_BACKEND_DNSMASQ),y)
endif
define Package/dnsmngr/install
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(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)

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "dnsmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DNS"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dslmngr
PKG_VERSION:=1.2.9
PKG_VERSION:=1.2.8
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
@@ -78,7 +78,6 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
endif
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libbbfdsl.so $(1) $(PKG_NAME)
endef

View File

@@ -1,28 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "dslmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "DSL"
},
{
"parent_dm": "Device.",
"object": "FAST"
},
{
"parent_dm": "Device.",
"object": "ATM"
},
{
"parent_dm": "Device.",
"object": "PTM"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -6,21 +6,21 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ebtables-extensions
PKG_VERSION:=2.0.4
PKG_VERSION:=2.0.1
PKG_LICENSE:=GPL-2.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5ef3a5b057f6b59a4b90bd5ca15a852b0c27f3b3
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ebtables-extensions.git
PKG_SOURCE_VERSION:=9a2af49b455ee25ca0694274e004ced7c09855a0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ebt-vlantranslation
define KernelPackage/vlantranslation
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables VLAN translation
FILES:=$(PKG_BUILD_DIR)/src/ebt_vlantranslation.ko
@@ -29,7 +29,7 @@ define KernelPackage/ebt-vlantranslation
KCONFIG:=
endef
define KernelPackage/ebt-dscp2pbit
define KernelPackage/dscp2pbit
SUBMENU:=Other modules
TITLE:=Kernel module for DSCP-to-Pbit mapping
DEPENDS+=+kmod-ebtables
@@ -38,7 +38,7 @@ define KernelPackage/ebt-dscp2pbit
KCONFIG:=
endef
define KernelPackage/ebt-dhcp
define KernelPackage/dhcp
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables DHCP snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_dhcp.ko
@@ -47,7 +47,7 @@ define KernelPackage/ebt-dhcp
KCONFIG:=
endef
define KernelPackage/ebt-dhcpv6
define KernelPackage/dhcpv6
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables DHCPv6 snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_dhcpv6.ko
@@ -56,7 +56,7 @@ define KernelPackage/ebt-dhcpv6
KCONFIG:=
endef
define KernelPackage/ebt-ra
define KernelPackage/ra
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables NDP/RA snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_ra.ko
@@ -65,7 +65,7 @@ define KernelPackage/ebt-ra
KCONFIG:=
endef
define KernelPackage/ebt-dns
define KernelPackage/dns
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables DNS manipulation
FILES:=$(PKG_BUILD_DIR)/src/ebt_dns.ko
@@ -74,7 +74,7 @@ define KernelPackage/ebt-dns
KCONFIG:=
endef
define KernelPackage/ebt-pppoe_disc
define KernelPackage/pppoe_disc
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables PPPoE manipulation
FILES:=$(PKG_BUILD_DIR)/src/ebt_pppoe_disc.ko
@@ -83,7 +83,7 @@ define KernelPackage/ebt-pppoe_disc
KCONFIG:=
endef
define KernelPackage/ebt-l2pt
define KernelPackage/l2pt
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables L2CP tunneling
FILES:=$(PKG_BUILD_DIR)/src/ebt_l2pt.ko
@@ -92,7 +92,7 @@ define KernelPackage/ebt-l2pt
KCONFIG:=
endef
define KernelPackage/ebt-xtarp
define KernelPackage/xtarp
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables extended ARP matching
FILES:=$(PKG_BUILD_DIR)/src/ebt_xtarp.ko
@@ -101,7 +101,7 @@ define KernelPackage/ebt-xtarp
KCONFIG:=
endef
define KernelPackage/ebt-xtip
define KernelPackage/xtip
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables extended IPv4 matching
FILES:=$(PKG_BUILD_DIR)/src/ebt_xtip.ko
@@ -110,7 +110,7 @@ define KernelPackage/ebt-xtip
KCONFIG:=
endef
define KernelPackage/ebt-xtip6
define KernelPackage/xtip6
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables extended IPv6 matching
FILES:=$(PKG_BUILD_DIR)/src/ebt_xtip6.ko
@@ -119,76 +119,50 @@ define KernelPackage/ebt-xtip6
KCONFIG:=
endef
define KernelPackage/ebt-igmpsnooping
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables IGMP snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_igmpsnooping.ko
DEPENDS+=+kmod-ebtables
# AUTOLOAD:=$(call AutoLoad,30,ebt_igmpsnooping) - Will be loaded on demand
KCONFIG:=
endef
define KernelPackage/ebt-mldsnooping
SUBMENU:=Other modules
TITLE:=Kernel module for ebtables MLD snooping
FILES:=$(PKG_BUILD_DIR)/src/ebt_mldsnooping.ko
DEPENDS+=+kmod-ebtables
# AUTOLOAD:=$(call AutoLoad,30,ebt_mldsnooping) - Will be loaded on demand
KCONFIG:=
endef
define KernelPackage/ebt-dhcp/description
define KernelPackage/dhcp/description
Kernel module to enable DHCP snooping for ebtables
endef
define KernelPackage/ebt-dhcpv6/description
define KernelPackage/dhcpv6/description
Kernel module to enable DHCPv6 snooping for ebtables
endef
define KernelPackage/ebt-ra/description
define KernelPackage/ra/description
Kernel module to enable NDP/RA snooping for ebtables
endef
define KernelPackage/ebt-dns/description
define KernelPackage/dns/description
Kernel module to enable DNS manipulation for ebtables
endef
define KernelPackage/ebt-pppoe_disc/description
define KernelPackage/pppoe_disc/description
Kernel module to enable PPPoE manipulation for ebtables
endef
define KernelPackage/ebt-l2pt/description
define KernelPackage/l2pt/description
Kernel module to enable L2CP tunneling for ebtables
endef
define KernelPackage/ebt-xtarp/description
define KernelPackage/xtarp/description
Kernel module to enable extended ARP matching for ebtables
endef
define KernelPackage/ebt-xtip/description
define KernelPackage/xtip/description
Kernel module to enable extended IPv4 matching for ebtables
endef
define KernelPackage/ebt-xtip6/description
define KernelPackage/xtip6/description
Kernel module to enable extended IPv6 matching for ebtables
endef
define KernelPackage/ebt-vlantranslation/description
define KernelPackage/vlantranslation/description
Kernel module to enable VLAN translation for ebtables
endef
define KernelPackage/ebt-dscp2pbit/description
define KernelPackage/dscp2pbit/description
Kernel module to enable DSCP-to-Pbit mapping for ebtables
endef
define KernelPackage/ebt-igmpsnooping/description
Kernel module to enable IGMP snooping for ebtables
endef
define KernelPackage/ebt-mldsnooping/description
Kernel module to enable MLD snooping for ebtables
endef
ifeq ($(CONFIG_TARGET_brcmbca),y)
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
endif
@@ -213,8 +187,6 @@ endif
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtarp.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip6.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_igmpsnooping.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_mldsnooping.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
endef
define Build/InstallDev
@@ -232,8 +204,6 @@ endif
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtarp.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_xtip6.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_igmpsnooping.h $(1)/include/uapi/linux/netfilter_bridge/
$(CP) $(PKG_BUILD_DIR)/src/ebt_mldsnooping.h $(1)/include/uapi/linux/netfilter_bridge/
endef
KERNEL_MAKE_FLAGS += -I$(LINUX_DIR)/include
@@ -245,16 +215,14 @@ define Build/Compile
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/src" modules
endef
$(eval $(call KernelPackage,ebt-vlantranslation))
$(eval $(call KernelPackage,ebt-dscp2pbit))
$(eval $(call KernelPackage,ebt-dhcp))
$(eval $(call KernelPackage,ebt-dhcpv6))
$(eval $(call KernelPackage,ebt-ra))
$(eval $(call KernelPackage,ebt-dns))
$(eval $(call KernelPackage,ebt-pppoe_disc))
$(eval $(call KernelPackage,ebt-l2pt))
$(eval $(call KernelPackage,ebt-xtarp))
$(eval $(call KernelPackage,ebt-xtip))
$(eval $(call KernelPackage,ebt-xtip6))
$(eval $(call KernelPackage,ebt-igmpsnooping))
$(eval $(call KernelPackage,ebt-mldsnooping))
$(eval $(call KernelPackage,vlantranslation))
$(eval $(call KernelPackage,dscp2pbit))
$(eval $(call KernelPackage,dhcp))
$(eval $(call KernelPackage,dhcpv6))
$(eval $(call KernelPackage,ra))
$(eval $(call KernelPackage,dns))
$(eval $(call KernelPackage,pppoe_disc))
$(eval $(call KernelPackage,l2pt))
$(eval $(call KernelPackage,xtarp))
$(eval $(call KernelPackage,xtip))
$(eval $(call KernelPackage,xtip6))

View File

@@ -2,16 +2,8 @@ if (PACKAGE_ethmngr)
menu "Configurations"
config ETHMNGR_MACVLAN_EXTENSION
bool "Enable datamodel MACVLAN vendor extension"
config TR181_VENDOR_EXTENSIONS_MACVLAN
bool "Use TR181 vendor extension MACVLAN"
default y
config ETHMNGR_EXPOSE_ETHERNET_OBJECT
bool "Expose ethernet ubus object to fetch and clear interface stats"
default y
config ETHMNGR_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endmenu
endif

View File

@@ -5,30 +5,30 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=3.0.5
PKG_VERSION:=2.1.9
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
PKG_SOURCE_VERSION:=01e1c5f6642a8fa79fc445c71558ad02bda40eb5
PKG_SOURCE_VERSION:=2d35e86cc8dfd7ef4e0d8579f5d314e90faadc90
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
include ../bbfdm/bbfdm.mk
define Package/ethmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Ethernet status and configration utility
DEPENDS:=+libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +libblobmsg-json +libjson-c +libc +libubus
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
endef
define Package/ethmngr/description
@@ -41,39 +41,39 @@ define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(CONFIG_ETHMNGR_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_ETHMNGR_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/ethmngr/* $(PKG_BUILD_DIR)/
$(CP) -rf ./ethmngr/* $(PKG_BUILD_DIR)/
endef
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE \
-DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
ifeq ($(CONFIG_ETHMNGR_MACVLAN_EXTENSION),y)
TARGET_CFLAGS += -DETHMNGR_MACVLAN_EXTENSION
ifeq ($(CONFIG_TR181_VENDOR_EXTENSIONS_MACVLAN),y)
TARGET_CFLAGS += -DTR181_VENDOR_EXTENSIONS_MACVLAN
endif
ifeq ($(CONFIG_ETHMNGR_EXPOSE_ETHERNET_OBJECT),y)
TARGET_CFLAGS += -DETHMNGR_EXPOSE_ETHERNET_OBJECT
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
define Build/Compile
endef
endif
define Package/ethmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/etc/ethmngr
$(INSTALL_DIR) $(1)/etc/ethmngr/plugins
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
endif
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libbbfethernet.so $(1) $(PKG_NAME)
ifeq ($(CONFIG_TR181_VENDOR_EXTENSIONS_MACVLAN),y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/libbbfethernetmacvlan.so $(1) $(PKG_NAME)
endif
endef
$(eval $(call BuildPackage,ethmngr))

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "ethmngr",
"unified_daemon": true,
"services": [
{
"parent_dm": "Device.",
"object": "Ethernet"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,17 +1,28 @@
#!/bin/sh /etc/rc.common
START=80
START=15
STOP=90
USE_PROCD=1
PROG=/usr/sbin/ethmngr
. /lib/functions.sh
include /lib/ethernet
start_service() {
if [ -f $PROG ]; then
procd_open_instance "ethmngr"
procd_open_instance
procd_set_param command ${PROG}
procd_append_param command -l 3
procd_set_param respawn
procd_close_instance "ethmngr"
procd_close_instance
fi
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger network
}

View File

@@ -0,0 +1,20 @@
{
"ethport_update": {
"if" : [
{
"event": "network.device"
}
],
"then" : [
{
"cli": "/sbin/hotplug-call ethernet",
"envs": {
"PORT": "&network.device->ifname",
"LINK": "&network.device->link"
},
"timeout": 1
}
]
}
}

View File

@@ -0,0 +1,2 @@
uci -q set ruleng.ethport=rule
uci -q set ruleng.ethport.recipe='/etc/ruleng/ethport.json'

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=firewallmngr
PKG_VERSION:=1.0.9
PKG_VERSION:=1.0.6
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
PKG_SOURCE_VERSION:=77ad8425b73a3ac63f6160dc217635394ac87907
PKG_SOURCE_VERSION:=2cac05871f7a8d93c144157c5f3f129deecf1a29
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -69,7 +69,6 @@ endif
$(INSTALL_BIN) ./files/firewall.service $(1)/etc/
$(INSTALL_DATA) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libfirewallmngr.so $(1) $(PKG_NAME)
endef

View File

@@ -1,20 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "firewallmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "Firewall"
},
{
"parent_dm": "Device.",
"object": "NAT"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -10,15 +10,6 @@ config HOSTMNGR_PLATFORM_HAS_WIFI
bool "Platform has WiFi"
default y if PACKAGE_libwifi
config HOSTMNGR_DATAMODEL_EXT
bool "Keep vendor specific datamodel parameters"
default n
config HOSTMNGR_VENDOR_PREFIX
depends on HOSTMNGR_DATAMODEL_EXT
string "Vendor Prefix for hostmngr datamodel extension"
default ""
endmenu
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=hostmngr
PKG_VERSION:=1.2.14
PKG_VERSION:=1.2.11
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=6ea9fdb38a8e067b850841d6e7f7266bf76c363a
PKG_SOURCE_VERSION:=431b122a051a28a16b430c9dcc83d26f73030f79
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
@@ -24,7 +24,6 @@ PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
define Package/hostmngr
SECTION:=utils
CATEGORY:=Utilities
@@ -55,15 +54,6 @@ ifeq ($(CONFIG_HOSTMNGR_PLATFORM_HAS_WIFI),y)
TARGET_CFLAGS += -DHAS_WIFI
endif
ifeq ($(CONFIG_HOSTMNGR_DATAMODEL_EXT),y)
TARGET_CFLAGS += -DHAS_VENDOR_EXT
ifeq ($(CONFIG_HOSTMNGR_VENDOR_PREFIX),"")
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
else
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_HOSTMNGR_VENDOR_PREFIX)\\\"
endif
endif
MAKE_PATH:=src
define Package/hostmngr/install
@@ -72,14 +62,7 @@ define Package/hostmngr/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/usr/share/hostmngr
$(INSTALL_DATA) ./files/scripts/hosts_acl.sh $(1)/usr/share/hostmngr/
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1) $(PKG_NAME)
ifeq ($(CONFIG_HOSTMNGR_DATAMODEL_EXT),y)
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostext.so $(1) $(PKG_NAME)
endif
endef
ifeq ($(LOCAL_DEV),1)

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "hostmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "Hosts"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -8,14 +8,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.8.29
PKG_VERSION:=9.8.24
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=4075ec2c530fb1590aa484f98ed37c9dda5216f5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_VERSION:=868abeb86c2974b3647c7f66e085808c0f296721
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -77,7 +77,6 @@ define Package/icwmp/install
$(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
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libcwmpdm.so $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_PLUGIN) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1) $(PKG_NAME)
endef

View File

@@ -1,25 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "icwmp",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "ManagementServer"
},
{
"parent_dm": "Device.",
"object": "CWMPManagementServer",
"proto": "usp"
},
{
"parent_dm": "Device.",
"object": "XMPP"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -20,8 +20,9 @@ config cpe 'cpe'
option default_lan_interface 'lan'
option log_to_console 'disable'
option log_to_file 'disable'
# log_severity: INFO (Default)
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
option log_severity 'WARNING'
option log_severity 'ERROR'
option log_file_name '/var/log/icwmpd.log'
option log_max_size '102400'
option userid '' #$OUI-$SER

View File

@@ -23,7 +23,6 @@ config IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
config IEEE1905_BUILD_TR181_PLUGIN
bool "Build TR-181 mapping module (responsible for Device.IEEE1905.)"
default y
endmenu

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.7.0
PKG_VERSION:=8.6.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e65188bb2a05cf83f50ecf2ef8042cf75abe94a0
PKG_SOURCE_VERSION:=5f7e6e30cbda36e431ecb7150d7494bce0c26f6f
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
@@ -22,10 +22,8 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_IEEE1905_BUILD_TR181_PLUGIN),y)
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
endif
define Package/ieee1905/Default
SECTION:=utils
@@ -41,8 +39,7 @@ define Package/libieee1905
$(call Package/ieee1905/Default)
TITLE:=libieee1905.so (library for CMDU and TLV handling)
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +libwifiutils \
+iputils-arping
+libjson-c +libblobmsg-json +libwifiutils
endef
define Package/ieee1905
@@ -51,10 +48,8 @@ define Package/ieee1905
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
+libjson-c +libblobmsg-json +ubus +libpthread \
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi \
+libwifiutils +iputils-arping
DEPENDS+=+IEEE1905_BUILD_TR181_PLUGIN:libbbfdm-api \
+IEEE1905_BUILD_TR181_PLUGIN:libbbfdm-ubus \
+IEEE1905_BUILD_TR181_PLUGIN:dm-service
+libwifiutils
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
include $(wildcard plugins/*.mk)
@@ -102,10 +97,7 @@ TARGET_CFLAGS += -DEXTENSION_ALLOWED
endif
TARGET_CFLAGS += -DHAS_UBUS
ifeq ($(CONFIG_IEEE1905_BUILD_TR181_PLUGIN),y)
TARGET_CFLAGS += -DBUILD_TR181_PLUGIN
endif
MAKE_FLAGS += \
extmod_subdirs="$(patsubst %,extensions/%,$(plugins))"
@@ -119,10 +111,7 @@ define Package/ieee1905/install
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ieee1905d $(1)/usr/sbin/
ifeq ($(CONFIG_IEEE1905_BUILD_TR181_PLUGIN),y)
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/tr181/ieee1905dm.so $(1) $(PKG_NAME)
endif
endef
define Package/libieee1905/install

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "ieee1905",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "IEEE1905"
}
],
"config": {
"loglevel": "3"
}
}
}

7
iop/Config.in Normal file
View File

@@ -0,0 +1,7 @@
config TARGET_VERSION
string
prompt "Software Version"
config TARGET_CUSTOMER
string
prompt "Customer ID"

View File

@@ -24,6 +24,10 @@ define Package/iop/description
This package contains iopsysWrt SDK utilities
endef
define Package/iop/config
source "$(SOURCE)/Config.in"
endef
define Build/Compile
true
endef

9
iop/scripts/feeds_update.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
function feeds_update {
# always return true
exit 0
}
register_command "feeds_update" "Compatibility function only"

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libethernet
PKG_VERSION:=7.2.117
PKG_VERSION:=7.2.111
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e917cdcfa0beb15a452f204521bea3d3571190b3
PKG_SOURCE_VERSION:=6e7216e657dfb59e869e393ef58e6b4593c16fc7
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
@@ -66,8 +66,7 @@ define Package/libethernet
SUBMENU:=IOPSYS HAL libs
MENU:=1
TITLE:= Ethernet library (libethernet)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_brcmbca:bcm963xx-bsp
DEPENDS+=+TARGET_airoha:ecnt_api +TARGET_airoha:kmod-npu +MODULE_DEFAULT_xpon_bsp:xpon_bsp
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_airoha:ecnt_api +TARGET_brcmbca:bcm963xx-bsp
endef
define Package/libethernet/description
@@ -84,7 +83,7 @@ endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/libethernet/* $(PKG_BUILD_DIR)/
$(CP) -rf ./libethernet/* $(PKG_BUILD_DIR)/
endef
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libqos
PKG_VERSION:=7.2.109
PKG_VERSION:=7.2.108
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=6a72e35e1a662e2f707e4901679676a9c09b3bc2
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
PKG_SOURCE_VERSION:=4948d372c3d7e43a0ba9aee517dbb83b94bba3dc
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
endif
@@ -78,7 +78,7 @@ endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/libqos/* $(PKG_BUILD_DIR)/
$(CP) -rf ./libqos/* $(PKG_BUILD_DIR)/
endef
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.9.0
PKG_VERSION:=7.7.8
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=b4d974c213eb2ad0b98165241b83bbda013ba452
PKG_SOURCE_VERSION:=b12d933e1cdd3b84eefbb45b0ecf2d1927f5d5dc
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
@@ -41,22 +41,23 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TARGET_WIFI_TYPE=MEDIATEK
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
TARGET_WIFI_TYPE=QUALCOMM MAC80211
TARGET_CFLAGS +=-DIPQ95XX
else ifeq ($(CONFIG_TARGET_ipq53xx),y)
TARGET_PLATFORM=IPQ53XX
TARGET_WIFI_TYPE=QUALCOMM
TARGET_WIFI_TYPE=QUALCOMM MAC80211
TARGET_CFLAGS +=-DIPQ53XX
else
$(info Unexpected CONFIG_TARGET, use default MAC80211)
TARGET_PLATFORM=MAC80211
TARGET_WIFI_TYPE=MAC80211
TARGET_CFLAGS +=-DIOPSYS_MAC80211
endif

View File

@@ -5,13 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=logmngr
PKG_VERSION:=1.0.8
PKG_VERSION:=1.0.6
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/logmngr.git
PKG_SOURCE_VERSION:=7c2056c9f5dc23fd1260846c72210365ec69c882
PKG_SOURCE_VERSION:=37f9eef6ad92ab4835893c6c8ee65338917071b6
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -44,7 +43,7 @@ endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/logmngr/* $(PKG_BUILD_DIR)/
$(CP) -rf ./logmngr/* $(PKG_BUILD_DIR)/
endef
endif

View File

@@ -16,7 +16,7 @@ create_service_section() {
# the service section of the fluent-bit.conf file has hardcoded values,
# no need to lookup any uci section to configure this section
echo "[SERVICE]" >> ${TMP_CONF_FILE}
echo " flush 1" >> ${TMP_CONF_FILE}
echo " flush 3" >> ${TMP_CONF_FILE}
echo " daemon off" >> ${TMP_CONF_FILE}
echo " log_level info" >> ${TMP_CONF_FILE}
echo " parsers_file /etc/fluent-bit/parsers.conf" >> ${TMP_CONF_FILE}

View File

@@ -15,14 +15,7 @@ create_config_file() {
create_option_section() {
# the option section of the syslog-ng.conf file has hardcoded values,
# no need to lookup any uci section to configure this section
local syslog_version=$(syslog-ng -V | grep -i "Installer-Version" | awk -F': ' '{print $2}' | cut -d '.' -f1,2)
if [ -n "$syslog_version" ]; then
echo -e "@version: $syslog_version" >> ${TMP_CONF_FILE}
else
echo -e "@version: 4.7" >> ${TMP_CONF_FILE}
fi
echo -e "@version: 4.4" >> ${TMP_CONF_FILE}
echo -e '@include "scl.conf"' >> ${TMP_CONF_FILE}
echo -e "options {" >> ${TMP_CONF_FILE}
echo -e "\tchain_hostnames(no);" >> ${TMP_CONF_FILE}
@@ -44,8 +37,7 @@ create_input_section() {
# on any uci value
echo -e "source $tag {" >> ${TMP_CONF_FILE}
echo -e "\tinternal();" >> ${TMP_CONF_FILE}
echo -e "\tunix-dgram(\"/dev/log\");" >> ${TMP_CONF_FILE}
echo -e "\tfile(\"/proc/kmsg\" program_override(\"kernel\"));" >> ${TMP_CONF_FILE}
echo -e "\tunix-dgram("/dev/log");" >> ${TMP_CONF_FILE}
echo "};" >> ${TMP_CONF_FILE}
}
@@ -323,10 +315,11 @@ handle_action_section() {
}
apply_config_file() {
echo -e '@include "/etc/syslog-ng.d/"' >> ${TMP_CONF_FILE}
cp ${TMP_CONF_FILE} ${CONF_FILE}
}
PROG=/usr/sbin/syslog-ng-ctl
logmngr_init() {
create_config_file
@@ -346,9 +339,7 @@ logmngr_init() {
logrotate_init
fi
if procd_running 'syslog-ng'; then
/etc/init.d/syslog-ng reload
else
/etc/init.d/syslog-ng start
fi
procd_open_instance logmngr
procd_set_param command $PROG reload
procd_close_instance
}

View File

@@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
START=12
STOP=89
USE_PROCD=1
. /lib/functions.sh

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=6.3.1.2
PKG_VERSION:=6.2.2.2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=4547277f0637a4e7f18ff676350400efb4e37138
PKG_SOURCE_VERSION:=8554576cc8a68b89faba1b13a7be0386325da26a
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause
@@ -28,9 +28,7 @@ define Package/map-agent
CATEGORY:=Utilities
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
+ieee1905-map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp \
+uuidgen +openssl-util +!TARGET_brcmbca:ebtables-legacy \
+!TARGET_brcmbca:ebtables-legacy-utils
+ieee1905-map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
endef
ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)

View File

@@ -63,7 +63,7 @@ else
[ $dhcp -eq 1 ] || exit 0
else
[ -f $map_bh_file ] || exit 0
cur_bh="$(jsonfilter -e @.ifname < "$map_bh_file" 2>/dev/null)" || exit 0
cur_bh="$(cat $map_bh_file | jsonfilter -e @.ifname)"
[ "$cur_bh" = "$PORT" ] || exit 0
fi
########################################################

View File

@@ -15,13 +15,13 @@ rc="$?"
issue_discovery() {
local iface="$1"
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"${iface}\"}" > /dev/null 2>&1)
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"${iface}\"}")
json_load "$res" > /dev/null 2>&1
json_get_var data data
[ "$data" == "" ] && return
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}" > /dev/null 2>&1
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}"
}
process_vlans() {

View File

@@ -73,7 +73,6 @@ generate_multiap_config() {
ifname="wlan${devidx}_0"
ifname_bh="wlan${devidx}_1"
else
uci set mapagent.agent.mld_prefix="bss"
ifname_sta=""
case "$band" in
2g)
@@ -99,11 +98,6 @@ generate_multiap_config() {
if [ "${network_mode}" == "extender" ]; then
ifname="${ifname_sta}"
fi
[ "$disable_mlo" == "1" ] || {
uci set wireless.$dev.mlo="1"
uci set wireless.$dev.mlo_capable="1"
}
fi
uci set wireless.$dev.channels="$channels"

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=6.2.2.1
PKG_VERSION:=6.1.2.9
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=f3d3ef332678f6417d78529323119a71ba715337
PKG_SOURCE_VERSION:=94b30d021b13e9488f9c76e7ceece48c9a567321
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
LOCAL_DEV=0

View File

@@ -9,7 +9,6 @@ config controller 'controller'
option primary_vid '1'
option primary_pcp '0'
option allow_bgdfs '0'
option stale_sta_timeout '30d'
option channel_plan '0'
option de_collect_interval '60'

View File

@@ -23,7 +23,6 @@ validate_controller_section() {
'initial_channel_scan:bool:true' \
'resend_num:uinteger:0' \
'allow_bgdfs:range(0,2629744)' \
'stale_sta_timeout:string' \
'channel_plan:range(0,2629744)' \
'enable_ts:bool:false'

View File

@@ -1,5 +0,0 @@
if PACKAGE_mcastmngr
config MCASTMNGR_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endif

View File

@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=mcastmngr
PKG_VERSION:=1.2.10
PKG_VERSION:=1.2.7
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
LOCAL_DEV:=0
@@ -29,33 +29,21 @@ MAKE_PATH:=bbf_plugin
define Package/mcastmngr
CATEGORY:=Utilities
TITLE:=Multicast Proxy/Snooping Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+!TARGET_brcmbca:mcproxy +!TARGET_brcmbca:sipcalc
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +!TARGET_brcmbca:kmod-ebt-igmpsnooping +!TARGET_brcmbca:kmod-ebt-mldsnooping
DEPENDS+=+!TARGET_brcmbca:ebtables-legacy +bridgemngr
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
define Package/mcastmngr/description
Configures IGMP and MLD snooping and proxy
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/mcastmngr/* $(PKG_BUILD_DIR)/
endef
endif
ifeq ($(CONFIG_MCASTMNGR_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_MCASTMNGR_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
define Package/mcastmngr/install
$(CP) ./files/common/* $(1)/
@@ -64,7 +52,6 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
else
$(CP) ./files/linux/* $(1)/
endif
$(BBFDM_REGISTER_SERVICES) -v ${VENDOR_PREFIX} ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/libmcast_bbf.so $(1) $(PKG_NAME)
endef

View File

@@ -1,20 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "mcastmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "{BBF_VENDOR_PREFIX}IGMP"
},
{
"parent_dm": "Device.",
"object": "{BBF_VENDOR_PREFIX}MLD"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -251,7 +251,3 @@ configure_mcast() {
configure_mcpd
}
validate_params() {
return 0
}

View File

@@ -33,10 +33,6 @@ start_service() {
configure_mcast
fi
if ! validate_params; then
return
fi
if [ -z "${PROG_PARAMS}" ]; then
start_mcast_service
else

View File

@@ -9,7 +9,6 @@ CONFFILE=
PROG_EXE=/usr/sbin/mcproxy
PROG_PARAMS=
PROG_PARAMS_SEPARATOR=:
readonly WANPORT="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
snooping_bridges=
@@ -90,16 +89,9 @@ config_mcproxy_interfaces() {
for excp in $exceptions; do
case $excp in
*/*)
if [ "$protocol" == "igmp" ]; then
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
ip_end="$(ipcalc.sh $excp | grep BROADCAST | awk '{print substr($0,11)}')"
filter="$filter ($ip_start - $ip_end | *)"
elif [ "$protocol" == "mld" ]; then
output="$(sipcalc $excp | grep "Network range" -A 1 | cut -d'-' -f2 | tr '\n' ' ')"
ip_start="$(echo $output | awk '{print $1}')"
ip_end="$(echo $output | awk '{print $2}')"
filter="$filter ($ip_start - $ip_end | *)"
fi
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
ip_end="$(ipcalc.sh $excp | grep BROADCAST | awk '{print substr($0,11)}')"
filter="$filter ($ip_start - $ip_end | *)"
;;
*)
filter="$filter ($excp | *)"
@@ -312,22 +304,6 @@ config_mcproxy_instance() {
[ -n $fast_leave ] &&
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
config_sysfs_mcast_flood "$downstreams" "$mcast_mode"
for iface in $downstreams; do
if device_is_bridge "$iface"; then
if [ "${protocol}" = "mld" ]; then
ebtables -t broute -I mcsnooping -s Unicast -d 33:33:00:00:00:00/ff:ff:00:00:00:00 --logical-in ${iface} ! -i "${WANPORT}+" --mld-snooping
elif [ "${protocol}" = "igmp" ]; then
ebtables -t broute -I mcsnooping -s Unicast -d 01:00:5e:00:00:00/ff:ff:ff:00:00:00 --logical-in ${iface} ! -i "${WANPORT}+" --igmp-snooping
fi
else
if [ "${protocol}" = "mld" ]; then
ebtables -t broute -I mcsnooping -s Unicast -d 33:33:00:00:00:00/ff:ff:00:00:00:00 -i ${iface} --mld-snooping
elif [ "${protocol}" = "igmp" ]; then
ebtables -t broute -I mcsnooping -s Unicast -d 01:00:5e:00:00:00/ff:ff:ff:00:00:00 -i ${iface} --igmp-snooping
fi
fi
done
fi
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
@@ -341,12 +317,6 @@ disable_snooping_iface() {
disable_snooping() {
config_load network
config_foreach disable_snooping_iface device
ebtables --concurrent -t broute -F mcsnooping
# Clean up populated /procfs entries
rmmod ebt_igmpsnooping 2> /dev/null #Loaded on demand
rmmod ebt_mldsnooping 2> /dev/null #Loaded on demand
}
config_snooping() {
@@ -418,14 +388,6 @@ config_snooping() {
[ -n "$q_resp_interval" ] && config_sysfs_mcast_q_resp_interval "$interfaces" "$q_resp_interval"
[ -n "$last_mem_q_int" ] && config_sysfs_mcast_last_mem_q_int "$interfaces" "$last_mem_q_int"
[ -n "$fast_leave" ] && config_sysfs_mcast_fastleave "$interfaces" "$fast_leave"
for iface in $snooping_bridges; do
if [ "${protocol}" = "mld" ]; then
ebtables -t broute -I mcsnooping -s Unicast -d 33:33:00:00:00:00/ff:ff:00:00:00:00 --logical-in ${iface} ! -i "${WANPORT}+" --mld-snooping
elif [ "${protocol}" = "igmp" ]; then
ebtables -t broute -I mcsnooping -s Unicast -d 01:00:5e:00:00:00/ff:ff:ff:00:00:00 --logical-in ${iface} ! -i "${WANPORT}+" --igmp-snooping
fi
done
}
config_mcproxy() {
@@ -456,9 +418,3 @@ configure_mcast() {
read_mcast_proxy_params
config_mcproxy
}
validate_params() {
[ -n "${PROG_PARAMS}" ] && return 0
return 1
}

View File

@@ -5,11 +5,61 @@
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"
local old_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
tail -n +2 "/proc/net/${type}_snooping" >> "$TEMPFILE"
# Sending signal to mcproxy to dump multicast data in /tmp/${type}_snooping_stats
local mcast_pids=$(pidof mcproxy)
for pid in $mcast_pids
do
$(kill -10 $pid)
done
# Wait for signal is being processed by mcproxy
if [ -n "$mcast_pids" ]; then
for i in 1 2 3; do
local new_mod_time=$(date +%s 2>/dev/null -r "$snooping_stats")
[ -n "$new_mod_time" ] && [ "$new_mod_time" != "$old_mod_time" ] && break
sleep 0.1
done
fi
[ ! -e "$snooping_stats" ] && return 0
cat "$snooping_stats" >> "$TEMPFILE"
}
read_snooping_file() {
@@ -48,8 +98,7 @@ read_snooping_file() {
case $line in
br-*)
found_ip=0
grp_ip="$(echo $line | awk -F ' ' '{ print $7 }')"
grp_ip="$(echo $line | awk -F ' ' '{ print $2 }')"
if [ -z "$mcast_addrs" ]; then
mcast_addrs="$grp_ip"
continue
@@ -87,7 +136,7 @@ read_snooping_file() {
if [ "$snoop_iface" != "$intf" ]; then
continue
fi
grp_ip="$(echo $line | awk -F ' ' '{ print $7 }')"
grp_ip="$(echo $line | awk -F ' ' '{ print $2 }')"
if [ "$grp_ip" != "$gip_addr" ]; then
continue
fi
@@ -96,7 +145,7 @@ read_snooping_file() {
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="$(sipcalc -6 "$gip_addr" | awk '/^Compressed address/{print $4}')"
gip="$(echo $gip_addr | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
fi
json_add_string "groupaddr" "$gip"
json_add_array "clients"
@@ -104,16 +153,16 @@ read_snooping_file() {
fi
json_add_object ""
host_ip="$(echo $line | awk -F ' ' '{ print $8 }')"
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="$(sipcalc -6 "$host_ip" | awk '/^Compressed address/{print $4}')"
h_ip="$(echo $host_ip | grep -oE '^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{0,4}$')"
fi
json_add_string "ipaddr" "$h_ip"
src_port="$(echo $line | awk -F ' ' '{ print $2 }')"
src_port="$(echo $line | awk -F ' ' '{ print $4 }')"
json_add_string "device" "$src_port"
timeout="$(echo $line | awk -F ' ' '{ print $9 }')"
timeout="$(echo $line | awk -F ' ' '{ print $5 }')"
json_add_int "timeout" "$timeout"
json_close_object #close the associated device object
;;
@@ -137,6 +186,9 @@ read_mcast_stats() {
meld_files "igmp"
meld_files "mld"
read_snooping_file
# L2 Snooping goes here
config_load mcast
config_foreach mcast_snooping_interface "snooping"
json_close_array # close the snooping array
json_dump

View File

@@ -14,7 +14,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=mosquitto-auth-shadow
PKG_VERSION:=1.0.1
PKG_VERSION:=1.0.0
PKG_MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
PKG_LICENSE:=EPL-2.0
@@ -27,7 +27,7 @@ define Package/mosquitto-auth-shadow
SECTION:=net
CATEGORY:=Network
TITLE:=mosquitto - /etc/shadow authentication plugin
DEPENDS:=+mosquitto-ssl
DEPENDS:=mosquitto
USERID:=mosquitto=200:mosquitto=200 mosquitto=200:shadow=11
endef

View File

@@ -1,30 +0,0 @@
if PACKAGE_netmngr
config NETMNGR_GRE_OBJ
bool "Enable Device.GRE. Object"
default y
config NETMNGR_IP_OBJ
bool "Enable Device.IP. Object"
default y
config NETMNGR_ROUTING_OBJ
bool "Enable Device.Routing. Object"
default y
config NETMNGR_PPP_OBJ
bool "Enable Device.PPP. Object"
default y
config NETMNGR_ROUTER_ADVERTISEMENT_OBJ
bool "Enable Device.RouterAdvertisement. Object"
default y
config NETMNGR_IPV6RD_OBJ
bool "Enable Device.IPv6rd. Object"
default y
config NETMNGR_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endif

View File

@@ -1,17 +1,17 @@
#
# Copyright (C) 2024-2025 iopsys
# Copyright (C) 2020-2024 iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=netmngr
PKG_VERSION:=1.1.3
PKG_VERSION:=1.0.7
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/netmngr.git
PKG_SOURCE_VERSION:=f9a0e9490743c55bf7c6df02495b4dbba8c66aeb
PKG_SOURCE_VERSION:=539c23695a086fd3d628da7b0f0de764726cfa09
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -33,47 +33,12 @@ define Package/netmngr/description
Package to add Network data model support.
endef
define Package/netmngr/config
source "$(SOURCE)/Config.in"
endef
MAKE_PATH:=src
ifeq ($(CONFIG_NETMNGR_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_NETMNGR_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
ifeq ($(CONFIG_NETMNGR_GRE_OBJ),y)
MAKE_FLAGS += NETMNGR_GRE_OBJ=y
endif
ifeq ($(CONFIG_NETMNGR_IP_OBJ),y)
MAKE_FLAGS += NETMNGR_IP_OBJ=y
endif
ifeq ($(CONFIG_NETMNGR_ROUTING_OBJ),y)
MAKE_FLAGS += NETMNGR_ROUTING_OBJ=y
endif
ifeq ($(CONFIG_NETMNGR_PPP_OBJ),y)
MAKE_FLAGS += NETMNGR_PPP_OBJ=y
endif
ifeq ($(CONFIG_NETMNGR_ROUTER_ADVERTISEMENT_OBJ),y)
MAKE_FLAGS += NETMNGR_ROUTER_ADVERTISEMENT_OBJ=y
endif
ifeq ($(CONFIG_NETMNGR_IPV6RD_OBJ),y)
MAKE_FLAGS += NETMNGR_IPV6RD_OBJ=y
endif
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
define Package/netmngr/install
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libnetmngr.so $(1) $(PKG_NAME)
$(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

View File

@@ -1,36 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "netmngr",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "IP"
},
{
"parent_dm": "Device.",
"object": "GRE"
},
{
"parent_dm": "Device.",
"object": "PPP"
},
{
"parent_dm": "Device.",
"object": "Routing"
},
{
"parent_dm": "Device.",
"object": "RouterAdvertisement"
},
{
"parent_dm": "Device.",
"object": "IPv6rd"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,4 +1,3 @@
if PACKAGE_obuspa
config OBUSPA_MTP_ENABLE_MQTT
bool "Enable MQTT as mtp protocol"
default y
@@ -58,12 +57,8 @@ config OBUSPA_SESSION_EXTENSION
config OBUSPA_CWMP_DATAMODEL_SUPPORT
bool "Adds USPAgent, STOMP and MQTT dm from CWMP"
default y
default n
help
Expose Device.USPAgent., Device.STOMP., Device.MQTT.Client. objects over
ubus to make it available to bbfdm for CWMP access
config OBUSPA_VENDOR_PREFIX
string "Package specific datamodel Vendor Prefix for TR181 extensions"
default ""
endif

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=9.0.4.4
PKG_VERSION:=9.0.0.18
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
PKG_SOURCE_VERSION:=1e5638d104075741a62d777ea9a2c508740c3634
PKG_SOURCE_VERSION:=91f9882651de301153060dfe0784859d849aa809
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -50,16 +50,9 @@ TARGET_CFLAGS += \
-D_GNU_SOURCE \
-DHAVE_STRERROR_R \
-Wall \
-D_DM_VENDOR_PREFIX=$(CONFIG_BBF_VENDOR_PREFIX) \
-Werror
ifeq ($(CONFIG_OBUSPA_VENDOR_PREFIX),"")
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
else
VENDOR_PREFIX = $(CONFIG_OBUSPA_VENDOR_PREFIX)
endif
TARGET_CFLAGS += -D_DM_VENDOR_PREFIX=$(VENDOR_PREFIX)
CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX=/tmp
CMAKE_OPTIONS += -DCMAKE_INSTALL_LOCALSTATEDIR=""
@@ -103,7 +96,7 @@ ifeq ($(CONFIG_OBUSPA_SESSION_EXTENSION),y)
TARGET_CFLAGS += -DOBUSPA_ENABLE_SESSION_EXT
endif
ifneq ($(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM),)
ifdef $(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
TARGET_CFLAGS += -DOBUSPA_MAX_CONTROLLERS_NUM=$(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
endif
@@ -127,7 +120,7 @@ define Package/obuspa/install
$(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 "$(VENDOR_PREFIX)" > $(1)/etc/obuspa/vendor_prefix
echo "$(CONFIG_BBF_VENDOR_PREFIX)" > $(1)/etc/obuspa/vendor_prefix
$(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/
@@ -135,7 +128,6 @@ define Package/obuspa/install
$(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
ifeq ($(CONFIG_OBUSPA_CWMP_DATAMODEL_SUPPORT),y)
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libuspagentdm.so $(1) $(PKG_NAME)
endif
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)

View File

@@ -1,9 +0,0 @@
# Obuspa patch management
As a part of obuspa integration, patch files used to manage changes in obuspa core files.
| Patch series | Remarks |
| ------------ | ------- |
| 00 - series | Up-streamable features/bugs |
| 10 - series | ubus-integration optimizations |
| 20 - series | deployment specific |

View File

@@ -1,27 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "obuspa",
"unified_daemon": false,
"services": [
{
"parent_dm": "Device.",
"object": "USPAgent",
"proto": "cwmp"
},
{
"parent_dm": "Device.",
"object": "MQTT",
"proto": "cwmp"
},
{
"parent_dm": "Device.",
"object": "STOMP",
"proto": "cwmp"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -11,5 +11,4 @@ config obuspa 'global'
#option trust_cert '/etc/obuspa/ca.pem'
#option client_cert '/etc/obuspa/client.pem'
#option log_dest '/tmp/obuspa.log'
option dm_caching_exclude '/etc/obuspa/transient_dm.json'

View File

@@ -11,7 +11,7 @@ add_usp_test()
{
uci_add mosquitto listener usptest
uci_set mosquitto usptest enabled 1
uci_set mosquitto usptest port '9004'
uci_set mosquitto usptest port '9001'
uci_set mosquitto usptest protocol 'websockets'
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
}

View File

@@ -1,7 +1,5 @@
Index: obuspa-9.0.4.1/src/core/device.h
===================================================================
--- obuspa-9.0.4.1.orig/src/core/device.h
+++ obuspa-9.0.4.1/src/core/device.h
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -338,6 +338,10 @@ void DEVICE_CONTROLLER_SetInheritedRole(
int DEVICE_CONTROLLER_CountEnabledWebsockClientConnections(void);
#endif
@@ -13,10 +11,8 @@ Index: obuspa-9.0.4.1/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.4.1/src/core/device_controller.c
===================================================================
--- obuspa-9.0.4.1.orig/src/core/device_controller.c
+++ obuspa-9.0.4.1/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,11 +92,9 @@ Index: obuspa-9.0.4.1/src/core/device_controller.c
/*********************************************************************//**
**
** DEVICE_CONTROLLER_IsMTPConfigured
Index: obuspa-9.0.4.1/src/core/msg_handler.c
===================================================================
--- obuspa-9.0.4.1.orig/src/core/msg_handler.c
+++ obuspa-9.0.4.1/src/core/msg_handler.c
@@ -1219,6 +1219,15 @@ int ValidateUspRecord(UspRecord__Record
--- 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

@@ -0,0 +1,13 @@
--- a/src/core/cli_server.c
+++ b/src/core/cli_server.c
@@ -785,10 +785,6 @@ int ExecuteCli_Get(char *arg1, char *arg
USP_ASSERT(gge->value != NULL);
SendCliResponse("%s => %s\n", gge->path, gge->value);
}
- else
- {
- SendCliResponse("ERROR: %d retrieving %s (%s)\n", gge->err_code, gge->path, gge->err_msg);
- }
}
GROUP_GET_VECTOR_Destroy(&ggv);

View File

@@ -1,22 +1,5 @@
Index: obuspa-9.0.4.1/src/core/cli_server.c
===================================================================
--- obuspa-9.0.4.1.orig/src/core/cli_server.c
+++ obuspa-9.0.4.1/src/core/cli_server.c
@@ -715,10 +715,6 @@ int ExecuteCli_Get(str_vector_t *args)
USP_ASSERT(gge->value != NULL);
SendCliResponse("%s => %s\n", gge->path, gge->value);
}
- else
- {
- SendCliResponse("ERROR: %d retrieving %s (%s)\n", gge->err_code, gge->path, gge->err_msg);
- }
}
GROUP_GET_VECTOR_Destroy(&ggv);
Index: obuspa-9.0.4.1/src/core/data_model.c
===================================================================
--- obuspa-9.0.4.1.orig/src/core/data_model.c
+++ obuspa-9.0.4.1/src/core/data_model.c
--- a/src/core/data_model.c
+++ b/src/core/data_model.c
@@ -1316,7 +1316,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
// Exit if instance already exists - nothing to do
if (exists)

View File

@@ -0,0 +1,20 @@
--- a/src/core/data_model.c
+++ b/src/core/data_model.c
@@ -160,6 +160,7 @@ int SetVendorParam(dm_node_t *node, char
double_link_t *FindLinkToFirstObject(double_linked_list_t *list);
int OverrideNodeType(dm_node_t *node, dm_node_type_t type, char *schema_path, dm_instances_t *inst);
+extern bool is_running_cli_local_command;
/*********************************************************************//**
**
** DATA_MODEL_Init
@@ -267,7 +268,9 @@ int DATA_MODEL_Init(void)
}
// Set the default values of OUI, Serial Number and (LocalAgent) EndpointID, and cache EndpointID
+ if (is_running_cli_local_command == false) {
err = DEVICE_LOCAL_AGENT_SetDefaults();
+ }
if (err != USP_ERR_OK)
{
return err;

View File

@@ -0,0 +1,366 @@
--- a/src/core/bdc_exec.c
+++ b/src/core/bdc_exec.c
@@ -549,9 +549,14 @@ int StartSendingReport(bdc_connection_t
// Set the list of headers
bc->headers = NULL;
bc->headers = curl_slist_append(bc->headers, "Content-Type: application/json; charset=UTF-8");
- bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: NameValuePair");
+ if (bc->flags & BDC_FLAG_HEADER_OBJ_HIER)
+ bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: ObjectHierarchy");
+ else
+ bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: NameValuePair");
+
if (bc->flags & BDC_FLAG_GZIP)
{
+ curl_easy_setopt(curl_ctx, CURLOPT_ACCEPT_ENCODING, "gzip");
bc->headers = curl_slist_append(bc->headers, "Content-Encoding: gzip");
}
--- a/src/core/bdc_exec.h
+++ b/src/core/bdc_exec.h
@@ -53,6 +53,6 @@ void BDC_EXEC_ScheduleExit(void);
#define BDC_FLAG_PUT 0x00000001 // If set, HTTP PUT should be used instead of HTTP POST when sending the report to the BDC server
#define BDC_FLAG_GZIP 0x00000002 // If set, the reports contants are Gzipped
#define BDC_FLAG_DATE_HEADER 0x00000004 // If set, the date header should be included in the HTTP post.
-
+#define BDC_FLAG_HEADER_OBJ_HIER 0x00000008 // If set, report format in header would be ObjectHierarchy otherwise NameValuePair
#endif
--- a/src/core/device_bulkdata.c
+++ b/src/core/device_bulkdata.c
@@ -71,7 +71,8 @@
//------------------------------------------------------------------------------
// Definitions for formats that we support
#define BULKDATA_ENCODING_TYPE "JSON"
-#define BULKDATA_JSON_REPORT_FORMAT "NameValuePair"
+#define BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE "NameValuePair"
+#define BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER "ObjectHierarchy"
// Definitions for Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
@@ -162,6 +163,7 @@ typedef struct
char compression[9];
char method[9];
bool use_date_header;
+ char report_format[20];
} profile_ctrl_params_t;
//------------------------------------------------------------------------------
@@ -236,7 +238,7 @@ bulkdata_profile_t *bulkdata_find_free_p
bulkdata_profile_t *bulkdata_find_profile(int profile_id);
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
-char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp);
+char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
int bulkdata_start_profile(bulkdata_profile_t *bp);
@@ -310,7 +312,7 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Parameter.{i}.Reference", "", Validate_BulkDataReference, NULL, DM_STRING);
// Device.BulkData.Profile.{i}.JSONEncoding
- err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportFormat", BULKDATA_JSON_REPORT_FORMAT, Validate_BulkDataReportFormat, NULL, DM_STRING);
+ err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportFormat", BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE, Validate_BulkDataReportFormat, NULL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp", BULKDATA_JSON_TIMESTAMP_FORMAT_EPOCH, Validate_BulkDataReportTimestamp, NULL, DM_STRING);
// Device.BulkData.Profile.{i}.HTTP
@@ -698,9 +700,11 @@ int Validate_BulkDataReference(dm_req_t
int Validate_BulkDataReportFormat(dm_req_t *req, char *value)
{
// Exit if trying to set a value outside of the range we accept
- if (strcmp(value, BULKDATA_JSON_REPORT_FORMAT) != 0)
+ if (strcmp(value, BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE) != 0 &&
+ strcmp(value, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER) != 0)
{
- USP_ERR_SetMessage("%s: Only JSON Report Format supported is '%s'", __FUNCTION__, BULKDATA_JSON_REPORT_FORMAT);
+ USP_ERR_SetMessage("%s: Only JSON Report Format supported are '%s', '%s'", __FUNCTION__,
+ BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER);
return USP_ERR_INVALID_VALUE;
}
@@ -2008,6 +2012,14 @@ int bulkdata_platform_get_profile_contro
return err;
}
+ // Exit if unable to get ReportFormat
+ USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportFormat", bp->profile_id);
+ err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_format, sizeof(ctrl_params->report_format), 0);
+ if (err != USP_ERR_OK)
+ {
+ return err;
+ }
+
return USP_ERR_OK;
}
@@ -2283,7 +2295,7 @@ void bulkdata_process_profile_http(bulkd
}
// Exit if unable to generate the report
- json_report = bulkdata_generate_json_report(bp, ctrl.report_timestamp);
+ json_report = bulkdata_generate_json_report(bp, ctrl.report_timestamp, ctrl.report_format);
if (json_report == NULL)
{
USP_ERR_SetMessage("%s: bulkdata_generate_json_report failed", __FUNCTION__);
@@ -2333,7 +2345,8 @@ void bulkdata_process_profile_usp_event(
kv_pair_t kv;
report_t *cur_report;
char *json_report;
- char report_timestamp[33];
+ char report_timestamp[33] = {0};
+ char report_format[20] = {0};
// Exit if the MTP has not been connected to successfully after bootup
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
@@ -2350,6 +2363,14 @@ void bulkdata_process_profile_usp_event(
return;
}
+ // Exit if unable to get ReportFormat
+ USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportFormat", bp->profile_id);
+ err = DATA_MODEL_GetParameterValue(path, report_format, sizeof(report_format), 0);
+ if (err != USP_ERR_OK)
+ {
+ return;
+ }
+
// When sending via USP events, only one report is ever sent in each USP event
// So ensure all retained reports are removed. NOTE: Clearing the reports here is only necessary when switching protocol from HTTP to USP event, and where HTTP had some unsent reports
bulkdata_clear_retained_reports(bp);
@@ -2367,7 +2388,7 @@ void bulkdata_process_profile_usp_event(
bp->num_retained_reports = 1;
// Exit if unable to generate the report
- json_report = bulkdata_generate_json_report(bp, report_timestamp);
+ json_report = bulkdata_generate_json_report(bp, report_timestamp, report_format);
if (json_report == NULL)
{
USP_ERR_SetMessage("%s: bulkdata_generate_json_report failed", __FUNCTION__);
@@ -2579,21 +2600,7 @@ int bulkdata_reduce_to_alt_name(char *sp
return USP_ERR_OK;
}
-/*********************************************************************//**
-**
-** bulkdata_generate_json_report
-**
-** Generates a JSON name-value pair format report
-** NOTE: The report contains all retained failed reports, as well as the current report
-** See TR-157 section A.4.2 (end) for an example, and section A.3.5.2 for layout of content containing failed report transmissions
-**
-** \param bp - pointer to bulk data profile containing all reports (current and retained)
-** \param report_timestamp - value of Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
-**
-** \return pointer to NULL terminated dynamically allocated buffer containing the serialized report to send
-**
-**************************************************************************/
-char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp)
+static char *create_json_name_value_pair_report(bulkdata_profile_t *bp, char *report_timestamp)
{
JsonNode *top; // top of report
JsonNode *array; // array of reports (retained + current)
@@ -2608,7 +2615,6 @@ char *bulkdata_generate_json_report(bulk
long long value_as_ll;
unsigned long long value_as_ull;
bool value_as_bool;
- char *result;
int i, j;
char buf[32];
kv_pair_t *kv;
@@ -2631,7 +2637,7 @@ char *bulkdata_generate_json_report(bulk
}
else if (strcmp(report_timestamp, "ISO-8601")==0)
{
- result = iso8601_from_unix_time(report->collection_time, buf, sizeof(buf));
+ char *result = iso8601_from_unix_time(report->collection_time, buf, sizeof(buf));
if (result != NULL)
{
json_append_member(element, "CollectionTime", json_mkstring(buf));
@@ -2690,11 +2696,174 @@ char *bulkdata_generate_json_report(bulk
json_append_member(top, "Report", array);
// Serialize the JSON tree
- result = json_stringify(top, " ");
+ char *output = json_stringify(top, " ");
// Clean up the JSON tree
json_delete(top); // Other JsonNodes which are children of this top level tree will be deleted
+ return output;
+}
+
+static char *create_json_obj_hier_report(bulkdata_profile_t *bp, char *report_timestamp)
+{
+ JsonNode *top; // top of report
+ JsonNode *array; // array of reports (retained + current)
+ JsonNode *element; // element of json array, containing an individual report
+ JsonNode *temp;
+ char *param_path;
+ char *param_type_value;
+ char param_type;
+ char *param_value;
+ kv_vector_t *report_map;
+ report_t *report;
+ double value_as_number;
+ long long value_as_ll;
+ unsigned long long value_as_ull;
+ bool value_as_bool;
+ int i, j;
+ char buf[32];
+ kv_pair_t *kv;
+ int err;
+
+ top = json_mkobject();
+ array = json_mkarray();
+
+ // Iterate over all reports adding them to the JSON array
+ for (i=0; i < bp->num_retained_reports; i++)
+ {
+ report = &bp->reports[i];
+ report_map = &report->report_map;
+
+ // Add Collection time to each json report element (only if specified and not 'None')
+ element = json_mkobject();
+ if (strcmp(report_timestamp, "Unix-Epoch")==0)
+ {
+ json_append_member(element, "CollectionTime", json_mknumber(report->collection_time));
+ }
+ else if (strcmp(report_timestamp, "ISO-8601")==0)
+ {
+ char *result = iso8601_from_unix_time(report->collection_time, buf, sizeof(buf));
+ if (result != NULL)
+ {
+ json_append_member(element, "CollectionTime", json_mkstring(buf));
+ }
+ }
+
+ temp = element;
+ // Iterate over each parameter, adding it to the json element. Take account of the parameter's type
+ for (j=0; j < report_map->num_entries; j++)
+ {
+ char buff[2056] = {0};
+ char *pch = NULL, *pchr = NULL, *argv[128] = {0};
+ int n = 0;
+
+ kv = &report_map->vector[j];
+ param_path = kv->key;
+ param_type_value = kv->value;
+ param_type = param_type_value[0]; // First character denotes the type of the parameter
+ param_value = &param_type_value[1]; // Subsequent characters contain the parameter's value
+
+ strncpy(buff, param_path, sizeof(buff));
+ for (pch = strtok_r(buff, ".", &pchr); pch != NULL; pch = strtok_r(NULL, ".", &pchr)) {
+ int idx;
+ JsonNode *obj = element;
+ argv[n] = pch;
+
+ for (idx = 0; idx <= n; idx++) {
+ if (obj == NULL)
+ break;
+ obj = json_find_member(obj, argv[idx]);
+ }
+
+ if (obj)
+ temp = obj;
+ else {
+ if (pchr != NULL && *pchr != '\0') {
+ // It is a DMOBJ
+ JsonNode *new = json_mkobject();
+ json_append_member(temp, pch, new);
+ temp = new;
+ } else {
+ // It is a DMPARAM
+ switch (param_type)
+ {
+ case 'S':
+ json_append_member(temp, pch, json_mkstring(param_value) );
+ break;
+
+ case 'U':
+ value_as_ull = strtoull(param_value, NULL, 10);
+ json_append_member(temp, pch, json_mkulonglong(value_as_ull) );
+ break;
+
+ case 'L':
+ value_as_ll = strtoll(param_value, NULL, 10);
+ json_append_member(temp, pch, json_mklonglong(value_as_ll) );
+ break;
+
+ case 'N':
+ value_as_number = atof(param_value);
+ json_append_member(temp, pch, json_mknumber(value_as_number) );
+ break;
+
+ case 'B':
+ err = TEXT_UTILS_StringToBool(param_value, &value_as_bool);
+ if (err == USP_ERR_OK)
+ {
+ json_append_member(temp, pch, json_mkbool(value_as_bool) );
+ }
+ break;
+
+ default:
+ USP_ERR_SetMessage("%s: Invalid JSON parameter type ('%c') in report map for %s", __FUNCTION__, param_type_value[0], param_path);
+ break;
+ }
+ }
+ }
+ n++;
+ }
+ }
+
+ // Add the json element to the json array
+ json_append_element(array, element);
+ }
+
+ // Finally add the array to the report top level
+ json_append_member(top, "Report", array);
+
+ // Serialize the JSON tree
+ char *output = json_stringify(top, " ");
+
+ // Clean up the JSON tree
+ json_delete(top); // Other JsonNodes which are children of this top level tree will be deleted
+
+ return output;
+}
+
+/*********************************************************************//**
+**
+** bulkdata_generate_json_report
+**
+** Generates a JSON name-value pair or object-hierarchy format report
+** NOTE: The report contains all retained failed reports, as well as the current report
+** See TR-157 section A.4.2 (end) for an example, and section A.3.5.2 for layout of content containing failed report transmissions
+**
+** \param bp - pointer to bulk data profile containing all reports (current and retained)
+** \param report_timestamp - value of Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
+**
+** \return pointer to NULL terminated dynamically allocated buffer containing the serialized report to send
+**
+**************************************************************************/
+char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format)
+{
+ char *result = NULL;
+
+ if (strcmp(report_format, BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE) == 0) {
+ result = create_json_name_value_pair_report(bp, report_timestamp);
+ } else if (strcmp(report_format, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER) == 0) {
+ result = create_json_obj_hier_report(bp, report_timestamp);
+ }
+
return result;
}
@@ -2851,6 +3020,11 @@ int bulkdata_schedule_sending_http_repor
flags |= BDC_FLAG_DATE_HEADER;
}
+ if (strcmp(ctrl->report_format, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER) == 0)
+ {
+ flags |= BDC_FLAG_HEADER_OBJ_HIER;
+ }
+
// Exit if failed to post a message to BDC thread
// NOTE: Ownership of full_url, query_string, report, username and password passes to BDC_EXEC
err = BDC_EXEC_PostReportToSend(bp->profile_id, full_url, query_string, username, password, report, report_len, flags);

View File

@@ -1,21 +1,18 @@
diff --git a/src/core/bdc_exec.c b/src/core/bdc_exec.c
index dc30a98..6a2938b 100644
--- a/src/core/bdc_exec.c
+++ b/src/core/bdc_exec.c
@@ -548,10 +548,25 @@ int StartSendingReport(bdc_connection_t *bc)
@@ -548,11 +548,19 @@ int StartSendingReport(bdc_connection_t
// Set the list of headers
bc->headers = NULL;
- bc->headers = curl_slist_append(bc->headers, "Content-Type: application/json; charset=UTF-8");
- bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: NameValuePair");
+
+
- if (bc->flags & BDC_FLAG_HEADER_OBJ_HIER)
+ if (bc->flags & BDC_FLAG_HEADER_OBJ_HIER) {
+ bc->headers = curl_slist_append(bc->headers, "Content-Type: application/json; charset=UTF-8");
+ bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: ObjectHierarchy");
bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: ObjectHierarchy");
- else
+ } else if (bc->flags & BDC_FLAG_HEADER_NAME_VAL) {
+ bc->headers = curl_slist_append(bc->headers, "Content-Type: application/json; charset=UTF-8");
+ bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: NameValuePair");
bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: NameValuePair");
+ } else if (bc->flags & BDC_FLAG_HEADER_PER_COL) {
+ bc->headers = curl_slist_append(bc->headers, "Content-Type: text/csv; charset=UTF-8");
+ bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: ParameterPerColumn");
@@ -23,69 +20,59 @@ index dc30a98..6a2938b 100644
+ bc->headers = curl_slist_append(bc->headers, "Content-Type: text/csv; charset=UTF-8");
+ bc->headers = curl_slist_append(bc->headers, "BBF-Report-Format: ParameterPerRow");
+ }
+
if (bc->flags & BDC_FLAG_GZIP)
{
+ curl_easy_setopt(curl_ctx, CURLOPT_ACCEPT_ENCODING, "gzip");
bc->headers = curl_slist_append(bc->headers, "Content-Encoding: gzip");
}
diff --git a/src/core/bdc_exec.h b/src/core/bdc_exec.h
index 8c259c5..6322221 100644
--- a/src/core/bdc_exec.h
+++ b/src/core/bdc_exec.h
@@ -53,6 +53,8 @@ void BDC_EXEC_ScheduleExit(void);
@@ -53,6 +53,9 @@ void BDC_EXEC_ScheduleExit(void);
#define BDC_FLAG_PUT 0x00000001 // If set, HTTP PUT should be used instead of HTTP POST when sending the report to the BDC server
#define BDC_FLAG_GZIP 0x00000002 // If set, the reports contants are Gzipped
#define BDC_FLAG_DATE_HEADER 0x00000004 // If set, the date header should be included in the HTTP post.
-
-
-#define BDC_FLAG_HEADER_OBJ_HIER 0x00000008 // If set, report format in header would be ObjectHierarchy otherwise NameValuePair
+#define BDC_FLAG_HEADER_OBJ_HIER 0x00000008 // If set, report format in header would be json ObjectHierarchy
+#define BDC_FLAG_HEADER_NAME_VAL 0x00000010 // If set, report format in header would be json NameValuePair
+#define BDC_FLAG_HEADER_PER_ROW 0x00000020 // If set, report format in header would be csv ParameterPerRow
+#define BDC_FLAG_HEADER_PER_COL 0x00000040 // If set, report format in header would be csv ParameterPerColumn
#endif
diff --git a/src/core/device_bulkdata.c b/src/core/device_bulkdata.c
index 915b282..f799793 100755
--- a/src/core/device_bulkdata.c
+++ b/src/core/device_bulkdata.c
@@ -70,8 +70,12 @@
@@ -70,9 +70,12 @@
//------------------------------------------------------------------------------
// Definitions for formats that we support
-#define BULKDATA_ENCODING_TYPE "JSON"
-#define BULKDATA_JSON_REPORT_FORMAT "NameValuePair"
+#define BULKDATA_ENCODING_TYPE_JSON "JSON"
+#define BULKDATA_ENCODING_TYPE_CSV "CSV"
+#define BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE "NameValuePair"
+#define BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER "ObjectHierarchy"
#define BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE "NameValuePair"
#define BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER "ObjectHierarchy"
+#define BULKDATA_CSV_REPORT_FORMAT_PER_COLUMN "ParameterPerColumn"
+#define BULKDATA_CSV_REPORT_FORMAT_PER_ROW "ParameterPerRow"
// Definitions for Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
@@ -161,6 +165,7 @@ static char *profile_push_event_args[] =
@@ -156,6 +159,7 @@ static char *profile_push_event_args[] =
typedef struct
{
int num_retained_failed_reports;
+ char encoding_type[10];
#ifdef ENABLE_MQTT
char mqtt_reference[254]; // relates to Device.BulkData.Profile.{i}.MQTT.Reference
char mqtt_publish_topic[254]; // relates to Device.BulkData.Profile.{i}.MQTT.PublishTopic
@@ -171,6 +176,12 @@ typedef struct
char password[257];
char compression[9];
char report_timestamp[33];
char url[1025];
char username[257];
@@ -164,6 +168,11 @@ typedef struct
char method[9];
+ char report_format[20];
bool use_date_header;
char report_format[20];
+ char field_separator[10];
+ char row_separator[10];
+ char escape_char[10];
+ char csv_format[20];
+ char row_timestamp[33];
bool use_date_header;
} profile_ctrl_params_t;
@@ -219,6 +230,7 @@ int Validate_BulkDataEncodingType(dm_req_t *req, char *value);
//------------------------------------------------------------------------------
@@ -211,6 +220,7 @@ int Validate_BulkDataEncodingType(dm_req
int Validate_BulkDataReportingInterval(dm_req_t *req, char *value);
int Validate_BulkDataReference(dm_req_t *req, char *value);
int Validate_BulkDataReportFormat(dm_req_t *req, char *value);
@@ -93,26 +80,25 @@ index 915b282..f799793 100755
int Validate_BulkDataReportTimestamp(dm_req_t *req, char *value);
int Validate_BulkDataCompression(dm_req_t *req, char *value);
int Validate_BulkDataHTTPMethod(dm_req_t *req, char *value);
@@ -246,7 +258,8 @@ bulkdata_profile_t *bulkdata_find_free_profile(void);
bulkdata_profile_t *bulkdata_find_profile(int profile_id);
@@ -239,6 +249,8 @@ bulkdata_profile_t *bulkdata_find_profil
int bulkdata_calc_report_map(bulkdata_profile_t *bp, kv_vector_t *report_map);
int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *out_buf, int buf_len);
-char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp);
+char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
+char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator, char *row_separator, char *escape_char, char *csv_format, char *row_timestamp);
char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format);
+char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator, char *row_separator,
+ char *escape_char, char *csv_format, char *row_timestamp);
unsigned char *bulkdata_compress_report(profile_ctrl_params_t *ctrl, char *input_buf, int input_len, int *p_output_len);
int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_profile_t *bp, unsigned char *json_report, int report_len);
int bulkdata_start_profile(bulkdata_profile_t *bp);
@@ -261,6 +274,8 @@ char *bulkdata_platform_calc_uri_query_string(kv_vector_t *escaped_map);
@@ -253,6 +265,8 @@ char *bulkdata_platform_calc_uri_query_s
int bulkdata_platform_get_param_refs(int profile_id, param_ref_vector_t *param_refs);
void bulkdata_expand_param_ref(param_ref_entry_t *pr, group_get_vector_t *ggv);
void bulkdata_append_to_result_map(param_ref_entry_t *pr, group_get_vector_t *ggv, kv_vector_t *report_map);
+void append_string_to_target(char *str, char **output);
+char *csv_encode(const char *str);
#ifdef ENABLE_MQTT
int Validate_BulkDataMqttReference(dm_req_t *req, char *value);
void bulkdata_process_profile_mqtt(bulkdata_profile_t *bp);
@@ -298,7 +313,7 @@ int DEVICE_BULKDATA_Init(void)
/*********************************************************************//**
**
@@ -285,7 +299,7 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_VendorParam_ReadOnly("Device.BulkData.Status", Get_BulkDataGlobalStatus, DM_STRING);
err |= USP_REGISTER_Param_Constant("Device.BulkData.MinReportingInterval", BULKDATA_MINIMUM_REPORTING_INTERVAL_STR, DM_UINT);
err |= USP_REGISTER_Param_SupportedList("Device.BulkData.Protocols", bdc_protocols, NUM_ELEM(bdc_protocols));
@@ -121,7 +107,7 @@ index 915b282..f799793 100755
err |= USP_REGISTER_Param_Constant("Device.BulkData.ParameterWildCardSupported", "true", DM_BOOL);
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfProfiles", BULKDATA_MAX_PROFILES_STR, DM_INT);
err |= USP_REGISTER_Param_Constant("Device.BulkData.MaxNumberOfParameterReferences", "-1", DM_INT);
@@ -313,7 +328,7 @@ int DEVICE_BULKDATA_Init(void)
@@ -300,7 +314,7 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Name", "", NULL, NULL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.NumberOfRetainedFailedReports", "0", Validate_NumberOfRetainedFailedReports, NULL, DM_INT);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Protocol", BULKDATA_PROTOCOL_HTTP, Validate_BulkDataProtocol, NULL, DM_STRING);
@@ -130,12 +116,8 @@ index 915b282..f799793 100755
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.ReportingInterval", "86400", Validate_BulkDataReportingInterval, NotifyChange_BulkDataReportingInterval, DM_UINT);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.TimeReference", UNKNOWN_TIME_STR, NULL, NotifyChange_BulkDataTimeReference, DM_DATETIME);
@@ -325,9 +340,16 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.Parameter.{i}.Reference", "", Validate_BulkDataReference, NULL, DM_STRING);
// Device.BulkData.Profile.{i}.JSONEncoding
- err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportFormat", BULKDATA_JSON_REPORT_FORMAT, Validate_BulkDataReportFormat, NULL, DM_STRING);
+ err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportFormat", BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE, Validate_BulkDataReportFormat, NULL, DM_STRING);
@@ -315,6 +329,13 @@ int DEVICE_BULKDATA_Init(void)
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportFormat", BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE, Validate_BulkDataReportFormat, NULL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp", BULKDATA_JSON_TIMESTAMP_FORMAT_EPOCH, Validate_BulkDataReportTimestamp, NULL, DM_STRING);
+ // Device.BulkData.Profile.{i}.CSVEncoding
@@ -148,37 +130,23 @@ index 915b282..f799793 100755
// Device.BulkData.Profile.{i}.HTTP
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.URL", "", NULL, NotifyChange_BulkDataURL, DM_STRING);
err |= USP_REGISTER_DBParam_ReadWrite("Device.BulkData.Profile.{i}.HTTP.Username", "", NULL, NULL, DM_STRING);
@@ -613,9 +635,10 @@ int Validate_BulkDataProtocol(dm_req_t *req, char *value)
@@ -594,9 +615,10 @@ int Validate_BulkDataProtocol(dm_req_t *
int Validate_BulkDataEncodingType(dm_req_t *req, char *value)
{
// Exit if trying to set a value outside of the range we accept
- if (strcmp(value, BULKDATA_ENCODING_TYPE) != 0)
- {
- USP_ERR_SetMessage("%s: Only EncodingType supported is '%s'", __FUNCTION__, BULKDATA_ENCODING_TYPE);
+ if (strcmp(value, BULKDATA_ENCODING_TYPE_JSON) != 0 && strcmp(value, BULKDATA_ENCODING_TYPE_CSV) != 0)
+ {
{
- USP_ERR_SetMessage("%s: Only EncodingType supported is '%s'", __FUNCTION__, BULKDATA_ENCODING_TYPE);
+ USP_ERR_SetMessage("%s: Only EncodingType supported are '%s,%s'", __FUNCTION__,
+ BULKDATA_ENCODING_TYPE_JSON, BULKDATA_ENCODING_TYPE_CSV);
return USP_ERR_INVALID_VALUE;
}
@@ -719,9 +742,36 @@ int Validate_BulkDataReference(dm_req_t *req, char *value)
int Validate_BulkDataReportFormat(dm_req_t *req, char *value)
{
// Exit if trying to set a value outside of the range we accept
- if (strcmp(value, BULKDATA_JSON_REPORT_FORMAT) != 0)
+ if (strcmp(value, BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE) != 0 &&
+ strcmp(value, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER) != 0)
+ {
+ USP_ERR_SetMessage("%s: Supported JSON Report Formats are '%s', '%s'", __FUNCTION__, BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER);
+ return USP_ERR_INVALID_VALUE;
+ }
+
+ return USP_ERR_OK;
+}
+
+/*********************************************************************//**
+**
@@ -713,6 +735,32 @@ int Validate_BulkDataReportFormat(dm_req
/*********************************************************************//**
**
+** Validate_BulkDataCSVReportFormat
+**
+** Validates Device.BulkData.Profile.{i}.CSVEncoding.ReportFormat
@@ -194,14 +162,21 @@ index 915b282..f799793 100755
+ // Exit if trying to set a value outside of the range we accept
+ if (strcmp(value, BULKDATA_CSV_REPORT_FORMAT_PER_COLUMN) != 0 &&
+ strcmp(value, BULKDATA_CSV_REPORT_FORMAT_PER_ROW) != 0)
{
- USP_ERR_SetMessage("%s: Only JSON Report Format supported is '%s'", __FUNCTION__, BULKDATA_JSON_REPORT_FORMAT);
+ {
+ USP_ERR_SetMessage("%s: Only JSON Report Format supported are '%s', '%s'", __FUNCTION__,
+ BULKDATA_CSV_REPORT_FORMAT_PER_COLUMN, BULKDATA_CSV_REPORT_FORMAT_PER_ROW);
return USP_ERR_INVALID_VALUE;
}
@@ -2052,6 +2102,14 @@ int bulkdata_platform_get_profile_control_params(bulkdata_profile_t *bp, profile
+ return USP_ERR_INVALID_VALUE;
+ }
+
+ return USP_ERR_OK;
+}
+
+/*********************************************************************//**
+**
** Validate_BulkDataReportTimestamp
**
** Validates Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
@@ -2004,6 +2052,14 @@ int bulkdata_platform_get_profile_contro
return err;
}
@@ -216,7 +191,7 @@ index 915b282..f799793 100755
// Exit if unable to get ReportTimestamp
USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportTimestamp", bp->profile_id);
err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_timestamp, sizeof(ctrl_params->report_timestamp), 0);
@@ -2060,6 +2118,54 @@ int bulkdata_platform_get_profile_control_params(bulkdata_profile_t *bp, profile
@@ -2020,6 +2076,46 @@ int bulkdata_platform_get_profile_contro
return err;
}
@@ -260,18 +235,10 @@ index 915b282..f799793 100755
+ return err;
+ }
+
+ // Exit if unable to get ReportFormat
+ USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportFormat", bp->profile_id);
+ err = DATA_MODEL_GetParameterValue(path, ctrl_params->report_format, sizeof(ctrl_params->report_format), 0);
+ if (err != USP_ERR_OK)
+ {
+ return err;
+ }
+
#ifdef ENABLE_MQTT
{
char protocol[32];
@@ -2333,7 +2439,7 @@ void bulkdata_process_profile_http(bulkdata_profile_t *bp)
return USP_ERR_OK;
}
@@ -2256,7 +2352,7 @@ void bulkdata_process_profile_http(bulkd
{
int err;
report_t *cur_report;
@@ -280,11 +247,11 @@ index 915b282..f799793 100755
profile_ctrl_params_t ctrl;
unsigned char *compressed_report;
int compressed_len;
@@ -2372,10 +2478,23 @@ void bulkdata_process_profile_http(bulkdata_profile_t *bp)
@@ -2295,10 +2391,23 @@ void bulkdata_process_profile_http(bulkd
}
// Exit if unable to generate the report
- json_report = bulkdata_generate_json_report(bp, ctrl.report_timestamp);
- json_report = bulkdata_generate_json_report(bp, ctrl.report_timestamp, ctrl.report_format);
- if (json_report == NULL)
- {
- USP_ERR_SetMessage("%s: bulkdata_generate_json_report failed", __FUNCTION__);
@@ -308,7 +275,7 @@ index 915b282..f799793 100755
return;
}
@@ -2384,14 +2503,14 @@ void bulkdata_process_profile_http(bulkdata_profile_t *bp)
@@ -2307,14 +2416,14 @@ void bulkdata_process_profile_http(bulkd
USP_LOG_Info("BULK DATA: using compression method=%s", ctrl.compression);
if (enable_protocol_trace)
{
@@ -327,15 +294,15 @@ index 915b282..f799793 100755
}
// NOTE: From this point on, only the compressed_report exists
@@ -2421,8 +2540,15 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
@@ -2344,9 +2453,15 @@ void bulkdata_process_profile_usp_event(
kv_vector_t event_args;
kv_pair_t kv;
report_t *cur_report;
- char *json_report;
char report_timestamp[33];
+ char report_format[20];
+ char *report;
+ char encoding_type[10] = {0};
char report_timestamp[33] = {0};
char report_format[20] = {0};
+ char field_separator[10];
+ char row_separator[10];
+ char escape_char[10];
@@ -344,7 +311,7 @@ index 915b282..f799793 100755
// Exit if the MTP has not been connected to successfully after bootup
// This is to prevent BDC events being enqueued before the Boot! event is sent (the Boot! event is only sent after successfully connecting to the MTP).
@@ -2431,13 +2557,63 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
@@ -2355,20 +2470,62 @@ void bulkdata_process_profile_usp_event(
goto exit;
}
@@ -353,15 +320,19 @@ index 915b282..f799793 100755
- err = DATA_MODEL_GetParameterValue(path, report_timestamp, sizeof(report_timestamp), 0);
- if (err != USP_ERR_OK)
- {
- return;
- }
+ // Exit if unable to get EncodingType
+ USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.EncodingType", bp->profile_id);
+ err = DATA_MODEL_GetParameterValue(path, encoding_type, sizeof(encoding_type), 0);
+ if (err != USP_ERR_OK) {
+ return;
+ }
+
return;
}
- // Exit if unable to get ReportFormat
- USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportFormat", bp->profile_id);
- err = DATA_MODEL_GetParameterValue(path, report_format, sizeof(report_format), 0);
- if (err != USP_ERR_OK)
- {
- return;
+ if (strcmp(encoding_type, BULKDATA_ENCODING_TYPE_JSON) == 0) {
+ // Exit if unable to get ReportTimestamp
+ USP_SNPRINTF(path, sizeof(path), "Device.BulkData.Profile.%d.JSONEncoding.ReportTimestamp", bp->profile_id);
@@ -411,14 +382,15 @@ index 915b282..f799793 100755
+ if (err != USP_ERR_OK) {
+ return;
+ }
+ }
}
// When sending via USP events, only one report is ever sent in each USP event
// So ensure all retained reports are removed. NOTE: Clearing the reports here is only necessary when switching protocol from HTTP to USP event, and where HTTP had some unsent reports
@@ -2455,11 +2631,17 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
}
@@ -2388,10 +2545,16 @@ void bulkdata_process_profile_usp_event(
bp->num_retained_reports = 1;
// Exit if unable to generate the report
- json_report = bulkdata_generate_json_report(bp, report_timestamp, report_format);
- if (json_report == NULL)
+ if (strcmp(encoding_type, BULKDATA_ENCODING_TYPE_JSON) == 0) {
+ report = bulkdata_generate_json_report(bp, report_timestamp, report_format);
+ } else {
@@ -426,17 +398,14 @@ index 915b282..f799793 100755
+ csv_format, row_timestamp);
+ }
+
// Exit if unable to generate the report
- json_report = bulkdata_generate_json_report(bp, report_timestamp);
- if (json_report == NULL)
+ if (report == NULL)
{
- USP_ERR_SetMessage("%s: bulkdata_generate_json_report failed", __FUNCTION__);
+ USP_ERR_SetMessage("%s: bulkdata_generate_report failed", __FUNCTION__);
+ USP_ERR_SetMessage("%s: bulkdata failed to generate report", __FUNCTION__);
return;
}
@@ -2467,15 +2649,15 @@ void bulkdata_process_profile_usp_event(bulkdata_profile_t *bp)
@@ -2399,15 +2562,15 @@ void bulkdata_process_profile_usp_event(
// Construct event_args manually to avoid the overhead of a malloc and copy of the report in KV_VECTOR_Add()
kv.key = "Data";
@@ -455,194 +424,10 @@ index 915b282..f799793 100755
// From the point of view of this code, the report(s) have been successfully sent, so don't retain them
// NOTE: Sending of the reports successfully is delegated to the USP notification retry mechanism
@@ -2547,7 +2729,7 @@ void bulkdata_process_profile_mqtt(bulkdata_profile_t *bp)
}
@@ -2869,6 +3032,319 @@ char *bulkdata_generate_json_report(bulk
// Exit if unable to generate the report
- report = bulkdata_generate_json_report(bp, ctrl.report_timestamp);
+ report = bulkdata_generate_json_report(bp, ctrl.report_timestamp, ctrl.report_format);
if (report == NULL)
{
USP_ERR_SetMessage("%s: bulkdata_generate_json_report failed", __FUNCTION__);
@@ -2762,7 +2944,7 @@ int bulkdata_reduce_to_alt_name(char *spec, char *path, char *alt_name, char *ou
** \return pointer to NULL terminated dynamically allocated buffer containing the serialized report to send
/*********************************************************************//**
**
**************************************************************************/
-char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp)
+char *bulkdata_generate_json_name_value_pair_report(bulkdata_profile_t *bp, char *report_timestamp)
{
JsonNode *top; // top of report
JsonNode *array; // array of reports (retained + current)
@@ -2867,6 +3049,483 @@ char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timesta
return result;
}
+static char *create_json_obj_hier_report(bulkdata_profile_t *bp, char *report_timestamp)
+{
+ JsonNode *top; // top of report
+ JsonNode *array; // array of reports (retained + current)
+ JsonNode *element; // element of json array, containing an individual report
+ JsonNode *temp;
+ char *param_path;
+ char *param_type_value;
+ char param_type;
+ char *param_value;
+ kv_vector_t *report_map;
+ report_t *report;
+ double value_as_number;
+ long long value_as_ll;
+ unsigned long long value_as_ull;
+ bool value_as_bool;
+ int i, j;
+ char buf[32];
+ kv_pair_t *kv;
+ int err;
+ char *result;
+
+ top = json_mkobject();
+ array = json_mkarray();
+
+ // Iterate over all reports adding them to the JSON array
+ for (i=0; i < bp->num_retained_reports; i++)
+ {
+ report = &bp->reports[i];
+ report_map = &report->report_map;
+
+ // Add Collection time to each json report element (only if specified and not 'None')
+ element = json_mkobject();
+ if (strcmp(report_timestamp, "Unix-Epoch")==0)
+ {
+ json_append_member(element, "CollectionTime", json_mknumber(report->collection_time));
+ }
+ else if (strcmp(report_timestamp, "ISO-8601")==0)
+ {
+ result = iso8601_from_unix_time(report->collection_time, buf, sizeof(buf));
+ if (result != NULL)
+ {
+ json_append_member(element, "CollectionTime", json_mkstring(buf));
+ }
+ }
+
+ temp = element;
+ // Iterate over each parameter, adding it to the json element. Take account of the parameter's type
+ for (j=0; j < report_map->num_entries; j++)
+ {
+ char buff[2056] = {0};
+ char *pch = NULL, *pchr = NULL, *argv[128] = {0};
+ int n = 0;
+
+ kv = &report_map->vector[j];
+ param_path = kv->key;
+ param_type_value = kv->value;
+ param_type = param_type_value[0]; // First character denotes the type of the parameter
+ param_value = &param_type_value[1]; // Subsequent characters contain the parameter's value
+
+ strncpy(buff, param_path, sizeof(buff));
+ for (pch = strtok_r(buff, ".", &pchr); pch != NULL; pch = strtok_r(NULL, ".", &pchr)) {
+ int idx;
+ JsonNode *obj = element;
+ argv[n] = pch;
+
+ for (idx = 0; idx <= n; idx++) {
+ if (obj == NULL)
+ break;
+ obj = json_find_member(obj, argv[idx]);
+ }
+
+ if (obj)
+ temp = obj;
+ else {
+ if (pchr != NULL && *pchr != '\0') {
+ // It is a DMOBJ
+ JsonNode *new = json_mkobject();
+ json_append_member(temp, pch, new);
+ temp = new;
+ } else {
+ // It is a DMPARAM
+ switch (param_type)
+ {
+ case 'S':
+ json_append_member(temp, pch, json_mkstring(param_value) );
+ break;
+
+ case 'U':
+ value_as_ull = strtoull(param_value, NULL, 10);
+ json_append_member(temp, pch, json_mkulonglong(value_as_ull) );
+ break;
+
+ case 'L':
+ value_as_ll = strtoll(param_value, NULL, 10);
+ json_append_member(temp, pch, json_mklonglong(value_as_ll) );
+ break;
+
+ case 'N':
+ value_as_number = atof(param_value);
+ json_append_member(temp, pch, json_mknumber(value_as_number) );
+ break;
+
+ case 'B':
+ err = TEXT_UTILS_StringToBool(param_value, &value_as_bool);
+ if (err == USP_ERR_OK)
+ {
+ json_append_member(temp, pch, json_mkbool(value_as_bool) );
+ }
+ break;
+
+ default:
+ USP_ERR_SetMessage("%s: Invalid JSON parameter type ('%c') in report map for %s", __FUNCTION__, param_type_value[0], param_path);
+ break;
+ }
+ }
+ }
+ n++;
+ }
+ }
+
+ // Add the json element to the json array
+ json_append_element(array, element);
+ }
+
+ // Finally add the array to the report top level
+ json_append_member(top, "Report", array);
+
+ // Serialize the JSON tree
+ result = json_stringify(top, " ");
+
+ // Clean up the JSON tree
+ json_delete(top); // Other JsonNodes which are children of this top level tree will be deleted
+
+ return result;
+}
+
+/*********************************************************************//**
+**
+** bulkdata_generate_json_report
+**
+** Generates a JSON name-value pair or object-hierarchy format report
+** NOTE: The report contains all retained failed reports, as well as the current report
+** See TR-157 section A.4.2 (end) for an example, and section A.3.5.2 for layout of content containing failed report transmissions
+**
+** \param bp - pointer to bulk data profile containing all reports (current and retained)
+** \param report_timestamp - value of Device.BulkData.Profile.{i}.JSONEncoding.ReportTimestamp
+**
+** \return pointer to NULL terminated dynamically allocated buffer containing the serialized report to send
+**
+**************************************************************************/
+char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timestamp, char *report_format)
+{
+ char *result = NULL;
+
+ if (strcmp(report_format, BULKDATA_JSON_REPORT_FORMAT_NAME_VALUE) == 0) {
+ result = bulkdata_generate_json_name_value_pair_report(bp, report_timestamp);
+ } else if (strcmp(report_format, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER) == 0) {
+ result = create_json_obj_hier_report(bp, report_timestamp);
+ }
+
+ return result;
+}
+
+/*********************************************************************//**
+**
+** safe_asprintf
+**
+** Wrapper around asprintf that calls terminate in case of error
@@ -954,13 +739,18 @@ index 915b282..f799793 100755
+ return output;
+}
+
/*********************************************************************//**
**
+/*********************************************************************//**
+**
** bulkdata_compress_report
@@ -3070,6 +3729,20 @@ int bulkdata_schedule_sending_http_report(profile_ctrl_params_t *ctrl, bulkdata_
**
** Compresses the report to send
@@ -3020,9 +3496,18 @@ int bulkdata_schedule_sending_http_repor
flags |= BDC_FLAG_DATE_HEADER;
}
- if (strcmp(ctrl->report_format, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER) == 0)
- {
- flags |= BDC_FLAG_HEADER_OBJ_HIER;
+ if (strcmp(ctrl->encoding_type, BULKDATA_ENCODING_TYPE_JSON) == 0) {
+ if (strcmp(ctrl->report_format, BULKDATA_JSON_REPORT_FORMAT_OBJ_HIER) == 0) {
+ flags |= BDC_FLAG_HEADER_OBJ_HIER;
@@ -973,8 +763,6 @@ index 915b282..f799793 100755
+ } else {
+ flags |= BDC_FLAG_HEADER_PER_ROW;
+ }
+ }
+
}
// Exit if failed to post a message to BDC thread
// NOTE: Ownership of full_url, query_string, report, username and password passes to BDC_EXEC
err = BDC_EXEC_PostReportToSend(bp->profile_id, full_url, query_string, username, password, report, report_len, flags);

View File

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

View File

@@ -1,8 +1,6 @@
Index: obuspa-9.0.0.25/src/core/device_controller.c
===================================================================
--- obuspa-9.0.0.25.orig/src/core/device_controller.c
+++ obuspa-9.0.0.25/src/core/device_controller.c
@@ -4210,6 +4210,14 @@ int ProcessControllerAdded(int cont_inst
--- a/src/core/device_controller.c
+++ b/src/core/device_controller.c
@@ -4282,6 +4282,14 @@ int ProcessControllerAdded(int cont_inst
goto exit;
}
@@ -17,7 +15,7 @@ Index: obuspa-9.0.0.25/src/core/device_controller.c
// Exit if unable to get the object instance numbers present in this controller's MTP table
USP_SNPRINTF(path, sizeof(path), "%s.%d.MTP", device_cont_root, cont_instance);
err = DATA_MODEL_GetInstances(path, &iv);
@@ -4251,14 +4259,6 @@ int ProcessControllerAdded(int cont_inst
@@ -4323,14 +4331,6 @@ int ProcessControllerAdded(int cont_inst
DEVICE_MQTT_UpdateControllerTopics();
#endif

View File

@@ -0,0 +1,37 @@
--- a/src/core/cli_server.c
+++ b/src/core/cli_server.c
@@ -753,6 +753,15 @@ int ExecuteCli_Get(char *arg1, char *arg
}
#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);
--- a/src/core/data_model.h
+++ b/src/core/data_model.h
@@ -371,5 +371,6 @@ bool DM_PRIV_IsChildOf(char *path, dm_no
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
--- a/src/core/handle_get.c
+++ b/src/core/handle_get.c
@@ -123,6 +123,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp
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

@@ -1,62 +0,0 @@
Index: obuspa-9.0.4.1/src/core/cli_server.c
===================================================================
--- obuspa-9.0.4.1.orig/src/core/cli_server.c
+++ obuspa-9.0.4.1/src/core/cli_server.c
@@ -501,6 +501,7 @@ int CLI_SERVER_ExecuteCliCommand(char *c
SendCliResponse("WARNING: Discarding unused args: %s\n", args.vector[cli_cmd->max_args+1]);
}
+ vendor_create_dm_cache(NULL, 0);
// Process command
err = cli_cmd->exec_cmd(&args);
print_help = false;
@@ -683,6 +684,13 @@ int ExecuteCli_Get(str_vector_t *args)
}
#endif
+ if (arg1 != NULL) {
+ char *path[2] = {0};
+
+ path[0] = arg1;
+ 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);
Index: obuspa-9.0.4.1/src/core/data_model.h
===================================================================
--- obuspa-9.0.4.1.orig/src/core/data_model.h
+++ obuspa-9.0.4.1/src/core/data_model.h
@@ -370,5 +370,6 @@ int DM_PRIV_ReRegister_DBParam_Default(c
bool DM_PRIV_IsChildNodeOf(dm_node_t *node, dm_node_t *parent_node);
void DM_PRIV_GetAllEventsAndCommands(dm_node_t *node, str_vector_t *events, str_vector_t *commands);
+int vendor_create_dm_cache(char *paths[], int num_paths);
#endif
Index: obuspa-9.0.4.1/src/core/handle_get.c
===================================================================
--- obuspa-9.0.4.1.orig/src/core/handle_get.c
+++ obuspa-9.0.4.1/src/core/handle_get.c
@@ -123,6 +123,7 @@ void MSG_HANDLER_HandleGet(Usp__Msg *usp
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;
Index: obuspa-9.0.4.1/src/core/msg_handler.c
===================================================================
--- obuspa-9.0.4.1.orig/src/core/msg_handler.c
+++ obuspa-9.0.4.1/src/core/msg_handler.c
@@ -862,6 +862,8 @@ int HandleUspMessage(Usp__Msg *usp, char
MSG_HANDLER_UspMsgTypeToString(usp->header->msg_type),
iso8601_cur_time(buf, sizeof(buf)) );
+ // Drop the cached data before processing next message
+ vendor_create_dm_cache(NULL, 0);
// Process the message
cur_msg_type = usp_msg_type;
switch(usp_msg_type)

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "parentalcontrol",
"unified_daemon": true,
"services": [
{
"parent_dm": "Device.",
"object": "{BBF_VENDOR_PREFIX}ParentalControl"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,3 +0,0 @@
config globals 'globals'
option enable '0'
option loglevel '3'

View File

@@ -1,88 +0,0 @@
#!/bin/sh /etc/rc.common
START=95
STOP=10
USE_PROCD=1
PROG=/usr/sbin/urlfilter
. /lib/parentalcontrol/parentalcontrol.sh
validate_global_section() {
uci_validate_section parentalcontrol globals globals \
'enable:bool:1' \
'loglevel:uinteger:3'
}
remove_fw_rules() {
# remove urlfilter daemon rules
remove_iptables_nfqueue_rules
# remove internet_access and profile_bedtime_schedule rules
remove_internet_schedule_rules
}
configure_fw_rules() {
local enable
remove_fw_rules
config_load parentalcontrol
config_get_bool enable globals enable 0
if [ "${enable}" -eq "0" ]; then
# Parental control is disabled
return 0
fi
# Now flush the existing connections, otherwise,
# URL filtering cannot be performed on already open sites.
if [ -n "$(which conntrack)" ]; then
sleep 5
conntrack -F
fi
# this is for urlfilter daemon
add_iptables_nfqueue_rules
# this for internet_access and profile_bedtime_schedule sections
add_internet_schedule_rules
}
start_service() {
local enable loglevel
config_load parentalcontrol
validate_global_section
# add default bundles
process_default_bundles
# add firewall rules
configure_fw_rules
procd_open_instance parentalcontrol_dm
procd_set_param command ${PROG}
procd_append_param command -l ${loglevel}
procd_set_param respawn
procd_close_instance
}
stop_service() {
# remove default bundles
remove_default_bundles
remove_fw_rules
}
reload_service() {
ret=$(ubus call service list '{"name":"parentalcontrol"}' | jsonfilter -qe '@.parentalcontrol.instances.parentalcontrol_dm.running')
if [ "$ret" != "true" ]; then
stop
start
else
configure_fw_rules
ubus send parentalcontrol.reload
fi
}
service_triggers() {
procd_add_reload_trigger "parentalcontrol"
procd_add_reload_trigger "schedules"
}

View File

@@ -1,41 +0,0 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=passwdqc
PKG_VERSION:=2.0.3
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/openwall/passwdqc.git
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=BSD-3
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
TITLE:=libpam password checking module
DEPENDS:=+libpam +@BUSYBOX_CONFIG_PAM
endef
define Package/$(PKG_NAME)/description
pam_passwdqc is a simple password strength checking module for
PAM-aware password changing programs
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CC="$(TARGET_CC)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
pam_wrapped
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/security/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libpasswdqc.so* $(1)/usr/lib/security/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=periodicstats
PKG_VERSION:=1.5.16
PKG_VERSION:=1.5.13
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
PKG_SOURCE_VERSION:=8545c349a2704af45b30da0facf8940977333969
PKG_SOURCE_VERSION:=72974d0e22a64b2cec51857c3f17dc239fec079f
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -26,7 +26,7 @@ define Package/periodicstats
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Periodic Statistics Daemon
DEPENDS:=+ubus +libuci +libubox +libubus +libblobmsg-json
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef
@@ -50,7 +50,7 @@ define Package/periodicstats/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/periodicstatsd $(1)/usr/sbin
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1) $(PKG_NAME)
endef
$(eval $(call BuildPackage,periodicstats))

View File

@@ -1,16 +0,0 @@
{
"daemon": {
"enable": "1",
"service_name": "periodicstats",
"unified_daemon": true,
"services": [
{
"parent_dm": "Device.",
"object": "PeriodicStatistics"
}
],
"config": {
"loglevel": "3"
}
}
}

View File

@@ -1,3 +1,4 @@
config globals 'globals'
# log_level as per syslog i.e (0-7), default 6 (LOG_INFO)
option log_level '3'
option enable '1'
option base_interval '5'

View File

@@ -7,25 +7,22 @@ USE_PROCD=1
PROG="/usr/sbin/periodicstatsd"
start_service() {
local enable
config_load periodicstats
config_get log_level globals log_level "1"
config_get_bool enable globals enable 1
procd_open_instance "periodicstats"
procd_set_param command ${PROG} -l ${log_level}
procd_set_param respawn
procd_close_instance "periodicstats"
procd_open_instance periodicstatsd
if [ "${enable}" -eq "1" ]; then
procd_set_param command ${PROG}
procd_set_param respawn
fi
procd_close_instance
}
reload_service() {
ret=$(ubus call service list '{"name":"periodicstats"}' | jsonfilter -qe '@.periodicstats.instances.periodicstats.running')
if [ "$ret" != "true" ]; then
stop
start
else
ubus send periodicstats.reload
fi
return
stop
start
}
service_triggers() {

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