mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 11:05:02 +08:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7016375eec | ||
|
|
2bc05fc355 | ||
|
|
b04105b0be | ||
|
|
0ce7697b9e | ||
|
|
399e9368ab | ||
|
|
1bf86ea636 | ||
|
|
7c5081b21d | ||
|
|
e84b61eed9 | ||
|
|
fe42f1cf3e | ||
|
|
22a8cf7d3d | ||
|
|
53ebf47632 | ||
|
|
dedb73eda7 | ||
|
|
d83fc6510e | ||
|
|
6f69d1862c | ||
|
|
0c2d5f0434 | ||
|
|
a4b7083bf4 | ||
|
|
d165368adc | ||
|
|
1bc5f8ebad | ||
|
|
585457537c | ||
|
|
9773c8c2ad | ||
|
|
a39025fea6 | ||
|
|
7a56796959 | ||
|
|
bd3896dba0 | ||
|
|
fe7d43ec63 | ||
|
|
117c470eb6 | ||
|
|
8387a42f6a | ||
|
|
0e906f2189 |
@@ -10,6 +10,10 @@ config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config BBF_TR104
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR143
|
||||
bool "Enable TR-143 Data Model Support"
|
||||
default y
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.3.30
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=60171c88176bd0e8d8cb67ddea3cb4f40b834f17
|
||||
PKG_SOURCE_VERSION:=dec994de5a1338bbda82c2fb01218d70bef9b09d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -99,7 +99,7 @@ define Package/libbbfdm-api/description
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/description
|
||||
Library contains the data model tree. It includes TR181, TR143 data models
|
||||
Library contains the data model tree. It includes TR181, TR104 and TR143 data models
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
@@ -113,6 +113,11 @@ CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
-DBBF_WIFI_DATAELEMENTS=ON
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR104),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR104=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR143=ON
|
||||
@@ -206,9 +211,8 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/src/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/json/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
|
||||
endef
|
||||
|
||||
define Package/userinterface/install
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BBFDMD="/usr/sbin/bbfdmd"
|
||||
|
||||
bbfdm_add_service()
|
||||
{
|
||||
local name path
|
||||
|
||||
name="${1}"
|
||||
path="${2}"
|
||||
|
||||
if [ -z "${name}" -o -z "$path" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path'], 'respawn': [0]}}}"
|
||||
}
|
||||
@@ -3,5 +3,5 @@ config bbfdmd 'bbfdmd'
|
||||
option enabled '1'
|
||||
option loglevel '1'
|
||||
option refresh_time '10'
|
||||
option transaction_timeout '30'
|
||||
option transaction_timeout '10'
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
START=96
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
|
||||
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
|
||||
BBFDM_TEMP_JSON="/tmp/bbfdm.json"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t bbfdmd.init -p info
|
||||
@@ -17,47 +16,43 @@ validate_bbfdm_bbfdmd_section()
|
||||
{
|
||||
uci_validate_section bbfdm bbfdmd "bbfdmd" \
|
||||
'enabled:bool:true' \
|
||||
'sock:string' \
|
||||
'debug:bool:false' \
|
||||
'loglevel:uinteger:1' \
|
||||
'refresh_time:uinteger:0' \
|
||||
'transaction_timeout:uinteger:30' \
|
||||
'loglevel:uinteger' \
|
||||
'sock:string' \
|
||||
'refresh_time:uinteger' \
|
||||
'transaction_timeout:uinteger' \
|
||||
'subprocess_level:uinteger'
|
||||
}
|
||||
|
||||
configure_bbfdmd()
|
||||
{
|
||||
local enabled debug sock update
|
||||
local jlog jrefresh jtimeout
|
||||
local enabled debug sock
|
||||
|
||||
update=0
|
||||
config_load bbfdm
|
||||
|
||||
validate_bbfdm_bbfdmd_section || {
|
||||
log "Validation of bbfdmd section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
[ ! -f "${BBFDM_JSON_INPUT}" ] && return 0
|
||||
|
||||
jlog="$(jq '.daemon.config.loglevel' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${loglevel}\"" != "${jlog}" ]; then
|
||||
update=1
|
||||
if [ -n "${loglevel}" ]; then
|
||||
echo "$(jq --arg res ${loglevel} '.daemon.config += {"loglevel": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
fi
|
||||
|
||||
jrefresh="$(jq '.daemon.config.refresh_time' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${refresh_time}\"" != "${jrefresh}" ]; then
|
||||
update=1
|
||||
if [ -n "${refresh_time}" ]; then
|
||||
echo "$(jq --arg res ${refresh_time} '.daemon.config += {"refresh_time": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
fi
|
||||
|
||||
jtimeout="$(jq '.daemon.config.transaction_timeout' ${BBFDM_JSON_INPUT})"
|
||||
if [ "\"${transaction_timeout}\"" != "${jtimeout}" ]; then
|
||||
update=1
|
||||
if [ -n "${transaction_timeout}" ]; then
|
||||
echo "$(jq --arg res ${transaction_timeout} '.daemon.config += {"transaction_timeout": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
fi
|
||||
|
||||
if [ "${update}" -eq "1" ]; then
|
||||
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
|
||||
mv ${BBFDM_TEMP_JSON} ${BBFDM_JSON_INPUT}
|
||||
if [ -n "${subprocess_level}" ]; then
|
||||
echo "$(jq --arg res ${subprocess_level} '.daemon.config += {"subprocess_level": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
fi
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
@@ -77,13 +72,6 @@ start_service()
|
||||
configure_bbfdmd
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bbfdm"
|
||||
|
||||
ubus call service state '{"name":"bbfdm.services", "spawn":true}'
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
ubus call service state '{"name":"bbfdm.services", "spawn":false}'
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
bbfdm_sysctl_conf="/etc/bbfdm/sysctl.conf"
|
||||
|
||||
update_device_section() {
|
||||
local section="${1}"
|
||||
local dev_name="${2}"
|
||||
local ipv6="${3}"
|
||||
local name
|
||||
|
||||
# Get name value
|
||||
config_get name "${section}" name
|
||||
|
||||
# Retrun if the name value is different to the dev_name value
|
||||
[ "${name}" != "${dev_name}" ] && return
|
||||
|
||||
if [ "${ipv6}" = "0" ]; then
|
||||
ipv6="1"
|
||||
else
|
||||
ipv6="0"
|
||||
fi
|
||||
|
||||
# Add ipv6 option
|
||||
uci -q set network.${section}.ipv6="${ipv6}"
|
||||
}
|
||||
|
||||
parse_bbfdm_sysctl_conf_file() {
|
||||
# Check if the file exists
|
||||
[ -f "${bbfdm_sysctl_conf}" ] || return
|
||||
|
||||
# Create a temporary file
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
# Load network config
|
||||
config_load network
|
||||
|
||||
# Read each line of the file
|
||||
while read -r line; do
|
||||
if echo "$line" | grep -Eq '^net\.ipv6\.conf\.(.+)\.disable_ipv6=([0-1])$'; then
|
||||
name=$(echo "$line" | sed -n 's/^net\.ipv6\.conf\.\(.*\)\.disable_ipv6=[0-1]$/\1/p')
|
||||
value=$(echo "$line" | sed -n 's/^net\.ipv6\.conf\.\(.*\)\.disable_ipv6=\([0-1]\)$/\2/p')
|
||||
|
||||
config_foreach update_device_section device "${name}" "${value}"
|
||||
else
|
||||
# If the line doesn't match, preserve it in the temporary file
|
||||
echo "$line" >> "$tmpfile"
|
||||
fi
|
||||
done < "${bbfdm_sysctl_conf}"
|
||||
|
||||
# Replace the original file with the modified content
|
||||
mv "$tmpfile" "${bbfdm_sysctl_conf}"
|
||||
|
||||
# Apply the changes
|
||||
uci commit network
|
||||
sysctl -e -p "${bbfdm_sysctl_conf}" >&-
|
||||
}
|
||||
|
||||
parse_bbfdm_sysctl_conf_file
|
||||
|
||||
exit 0
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.2
|
||||
PKG_VERSION:=2.1.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=d83c42070e7f10178dc1c2d0ce078e3d6d42d889
|
||||
PKG_SOURCE_VERSION:=2dd55d9c9eb01ed1b11e16bad9e2c3e8badfffeb
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -43,9 +43,9 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/bulkdata
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bulkdata
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/json
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "JSON",
|
||||
"name": "/etc/bulkdata/bulkdata.json"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.bulkdata",
|
||||
"parent_dm": "Device.",
|
||||
"object": "BulkData",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=60
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
BULKDATA_JSON_INPUT="/etc/bulkdata/input.json"
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
@@ -15,14 +12,12 @@ start_service() {
|
||||
config_load bulkdata
|
||||
config_get_bool enable bulkdata enable 1
|
||||
|
||||
procd_open_instance bulkdata
|
||||
[ "$enable" -eq "1" ] && {
|
||||
procd_open_instance "bulkdata"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bulkdata"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
}
|
||||
|
||||
bbfdm_add_service "bbfdm.bulkdata" "${BULKDATA_JSON_INPUT}"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -6,22 +6,13 @@ STOP=20
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
if [ -e "/etc/config/mapagent" -o -e "/etc/config/mapcontroller" ]; then
|
||||
config_load mapagent
|
||||
config_get_bool agent_enabled agent enabled 1
|
||||
config_load mapcontroller
|
||||
config_get_bool controller_enabled controller enabled 1
|
||||
|
||||
if [ $agent_enabled -eq 1 -o $controller_enabled -eq 1 ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
|
||||
procd_set_param limits core="unlimited"
|
||||
#procd_set_param respawn
|
||||
#procd_set_param stdout 1
|
||||
#procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
fi
|
||||
fi
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
@@ -2,6 +2,6 @@ menu "Configuration"
|
||||
|
||||
config DECOLLECTOR_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 4
|
||||
default 2
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.1.0.4
|
||||
PKG_VERSION:=4.0.2.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=566f0b7d148c0ece72f311c4f4b6b5f8e11d6f97
|
||||
PKG_SOURCE_VERSION:=944a981d8d3f9548f464c862778b67455aee9112
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -19,8 +19,6 @@ start_service() {
|
||||
config_get en controller enabled "0"
|
||||
config_get collect_int controller de_collect_interval
|
||||
|
||||
[ -n "$collect_int" -a $collect_int -lt 30 ] && collect_int=""
|
||||
|
||||
[ $en -gt 0 ] && {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" "-d" "${collect_int:+-t $collect_int}"
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.5.14
|
||||
PKG_VERSION:=3.5.11
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4f16755f8ac09d373234565f050832c049bdf543
|
||||
PKG_SOURCE_VERSION:=18dece420502e25a9bd9f3b534bc6c338fcc9377
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
Binary file not shown.
@@ -302,8 +302,6 @@ xdsl_stop() {
|
||||
}
|
||||
|
||||
xdsl_init() {
|
||||
[ -d /sys/class/net/dsl0/ ] || exit
|
||||
|
||||
prioritize_arp
|
||||
|
||||
echo "Starting DSL"
|
||||
|
||||
@@ -26,6 +26,10 @@ stop_service() {
|
||||
}
|
||||
|
||||
boot() {
|
||||
local HASADSL="$(db -q get hw.board.hasAdsl)"
|
||||
local HASVDSL="$(db -q get hw.board.hasVdsl)"
|
||||
[ "$HASADSL" == "1" -o "$HASVDSL" == "1" ] || return
|
||||
|
||||
xdsl_init
|
||||
|
||||
start
|
||||
|
||||
@@ -23,7 +23,7 @@ define Package/ethmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet status and configration utility
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/ethmngr/description
|
||||
@@ -37,14 +37,19 @@ TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
|
||||
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
|
||||
define Build/Compile
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ethmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
|
||||
$(CP) ./files/common/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
$(CP) ./files/broadcom/* $(1)/
|
||||
else
|
||||
$(CP) ./files/linux/* $(1)/
|
||||
endif
|
||||
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
|
||||
endif
|
||||
|
||||
144
ethmngr/files/broadcom/lib/ethernet/broadcom.sh
Normal file
144
ethmngr/files/broadcom/lib/ethernet/broadcom.sh
Normal file
@@ -0,0 +1,144 @@
|
||||
# arg1: port ifname, ex: eth0
|
||||
get_max_port_speed() {
|
||||
if [ -z "$1" ]; then
|
||||
echo 0
|
||||
return
|
||||
fi
|
||||
|
||||
local ifname="$1"
|
||||
local phycap="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
|
||||
local speed=1000
|
||||
|
||||
case "$phycap" in
|
||||
10GFD*) speed=10000 ;;
|
||||
5GFD*) speed=5000 ;;
|
||||
2.5GFD*) speed=2500 ;;
|
||||
1GFD*) speed=1000 ;;
|
||||
100MFD*|100MHD*) speed=100 ;;
|
||||
10MFD*|10MHD*) speed=10 ;;
|
||||
esac
|
||||
|
||||
echo $speed
|
||||
}
|
||||
|
||||
# arg1: port name, ex: eth0
|
||||
get_port_number() {
|
||||
[ -z "$1" ] && return
|
||||
local ports="0 1 2 3 4 5 6 7 8"
|
||||
local units="0 1"
|
||||
local port="$1"
|
||||
local ifname
|
||||
|
||||
for unit in $units; do
|
||||
for prt in $ports; do
|
||||
ifname="$(ethswctl getifname $unit $prt 2>/dev/null | awk '{print$NF}')"
|
||||
if [ "$ifname" == "$port" ]; then
|
||||
echo "$unit $prt"
|
||||
return
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
reset_port() {
|
||||
local ifname="$1"
|
||||
ethctl $ifname phy-reset >/dev/null
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
power_updown() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
|
||||
local updown="up"
|
||||
[ $enabled -eq 0 ] && updown="down"
|
||||
ethctl $ifname phy-power $updown >/dev/null
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
# arg3: port speed, ex: 1000
|
||||
# arg4: port duplex, ex: full
|
||||
# arg5: port autoneg, ex: on
|
||||
# arg6: port eee, ex: 0
|
||||
# arg7: port pause, ex: 0
|
||||
set_port_settings() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
local speed="$3"
|
||||
local duplex=$4
|
||||
local autoneg=$5
|
||||
local eee=$6
|
||||
local pause=$7
|
||||
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
local unitport="$(get_port_number $ifname)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
|
||||
[ $autoneg -eq 1 ] && autoneg="on" || autoneg="off"
|
||||
[ "$duplex" == "half" ] && duplex=0 || duplex=1
|
||||
[ "$duplex" == 0 ] && dplx="HD" || dplx="FD"
|
||||
[ "$autoneg" == "on" ] && media_type="auto" || media_type="$speed$dplx"
|
||||
|
||||
phycaps="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
|
||||
numofcaps="$(echo $phycaps | tr ':' ' ' | wc -w)"
|
||||
|
||||
# Reset the port before setting new params
|
||||
reset_port $ifname
|
||||
|
||||
if [ "$numofcaps" == "1" ]; then
|
||||
logger -t "ethmngr" "$ifname is capable of $phycaps only; not setting speed/duplex"
|
||||
else
|
||||
logger -t "ethmngr" "$ifname is capable of $phycaps; setting speed/duplex to $media_type"
|
||||
ethctl $ifname media-type $media_type ${pyhendpoint:+ port $pyhendpoint} &>/dev/null
|
||||
fi
|
||||
|
||||
[ $eee -eq 1 ] && eee="on" || eee="off"
|
||||
ethtool --set-eee $ifname eee $eee 2>/dev/null
|
||||
|
||||
case $pause in
|
||||
off|0)
|
||||
pause=0x0
|
||||
auto=off
|
||||
rx=off
|
||||
tx=off
|
||||
;;
|
||||
on|1)
|
||||
pause=0x2
|
||||
auto=off
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
auto)
|
||||
pause=0x1
|
||||
auto=on
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
tx)
|
||||
pause=0x3
|
||||
auto=off
|
||||
rx=off
|
||||
tx=on
|
||||
;;
|
||||
rx)
|
||||
pause=0x4
|
||||
auto=off
|
||||
rx=on
|
||||
tx=off
|
||||
;;
|
||||
esac
|
||||
if [ "$auto" == "on" ]; then
|
||||
# Use ethswctl utility to set pause autoneg
|
||||
# as ethtool is not setting it properly
|
||||
ethswctl -c pause -n $unit -p $port -v $pause 2>&1 >/dev/null
|
||||
else
|
||||
ethtool --pause $ifname autoneg $auto rx $rx tx $tx 2>/dev/null
|
||||
fi
|
||||
|
||||
power_updown $ifname $enabled
|
||||
}
|
||||
0
ethmngr/files/common/etc/config/ports
Normal file
0
ethmngr/files/common/etc/config/ports
Normal file
50
ethmngr/files/common/etc/init.d/ethmngr
Executable file
50
ethmngr/files/common/etc/init.d/ethmngr
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=15
|
||||
STOP=90
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ethmngr
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/ethernet
|
||||
|
||||
configure_ethernet_port(){
|
||||
local cfg=$1
|
||||
local ifname enabled speed duplex autoneg eee pause
|
||||
|
||||
config_get ifname $cfg ifname
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
config_get enabled $cfg enabled 1
|
||||
config_get speed $cfg speed 1000
|
||||
config_get duplex $cfg duplex "full"
|
||||
config_get autoneg $cfg autoneg 1
|
||||
config_get eee $cfg eee 0
|
||||
config_get pause $cfg pause 0
|
||||
|
||||
set_port_settings $ifname $enabled $speed $duplex $autoneg $eee $pause
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ -s /etc/config/ports ]; then
|
||||
config_load ports
|
||||
config_foreach configure_ethernet_port ethport
|
||||
fi
|
||||
|
||||
if [ -f $PROG ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger ports
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
|
||||
populate_config_from_db() {
|
||||
. /lib/functions.sh
|
||||
. /lib/network/utils.sh
|
||||
include /lib/ethernet
|
||||
|
||||
portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
for port in $portorder; do
|
||||
speed="$(get_max_port_speed $port 2>/dev/null)"
|
||||
speed="${speed:-1000}"
|
||||
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
if [ "$(db -q get hw.board.ethernetWanPort)" = "$port" ]; then
|
||||
uci set ports.@ethport[-1].pause=1
|
||||
uci set ports.@ethport[-1].uplink=1
|
||||
else
|
||||
uci set ports.@ethport[-1].pause=0
|
||||
fi
|
||||
done
|
||||
|
||||
uci commit ports
|
||||
}
|
||||
|
||||
populate_config_from_device_tree() {
|
||||
for path in $(find /proc/device-tree/ -name "port@*"); do
|
||||
port="$(cat $path/label)"
|
||||
[ -n "$port" ] || continue
|
||||
[ "$port" = "cpu" ] && continue
|
||||
speed=1000
|
||||
if [ -e "$path/phy-mode" ]; then
|
||||
phymode="$(cat $path/phy-mode)"
|
||||
case "$phymode" in
|
||||
10000*) speed=10000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
esac
|
||||
fi
|
||||
PORT="$(echo $port | tr '[a-z]' '[A-Z]')"
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$PORT"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$PORT"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
if [ "$port" = "wan" ]; then
|
||||
uci set ports.@ethport[-1].pause=1
|
||||
uci set ports.@ethport[-1].uplink=1
|
||||
else
|
||||
uci set ports.@ethport[-1].pause=0
|
||||
fi
|
||||
done
|
||||
uci commit ports
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/ports" ]; then
|
||||
if uci -q get ports.@ethport[0] >/dev/null; then
|
||||
# exit if there is any valid content
|
||||
exit 0
|
||||
else
|
||||
rm -f /etc/config/ports
|
||||
fi
|
||||
fi
|
||||
|
||||
touch /etc/config/ports
|
||||
|
||||
if [ -f /sbin/db -a -n "$(db get hw.board.ethernetPortOrder 2>/dev/null)" ]; then
|
||||
populate_config_from_db
|
||||
elif [ -d /proc/device-tree/ ]; then
|
||||
populate_config_from_device_tree
|
||||
fi
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=15
|
||||
STOP=90
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ethmngr
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/ethernet
|
||||
|
||||
start_service() {
|
||||
if [ -f $PROG ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger network
|
||||
}
|
||||
95
ethmngr/files/linux/lib/ethernet/linux.sh
Normal file
95
ethmngr/files/linux/lib/ethernet/linux.sh
Normal file
@@ -0,0 +1,95 @@
|
||||
# arg1: port ifname, ex: eth0
|
||||
get_max_port_speed() {
|
||||
if [ -z "$1" ]; then
|
||||
echo 0
|
||||
return
|
||||
fi
|
||||
|
||||
local ifname="$1"
|
||||
local phycap="$(ethtool $ifname | grep -A 10 "Supported link modes" | grep 00 | tail -n 1 | awk '{print$NF}')"
|
||||
local speed=1000
|
||||
|
||||
case "$phycap" in
|
||||
10000*) speed=10000 ;;
|
||||
5000*) speed=5000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
1000*) speed=1000 ;;
|
||||
100*) speed=100 ;;
|
||||
10*) speed=10 ;;
|
||||
esac
|
||||
|
||||
echo $speed
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
power_updown() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
|
||||
local updown="up"
|
||||
[ $enabled -eq 0 ] && updown="down"
|
||||
ip link set dev $ifname $updown
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
# arg3: port speed, ex: 1000
|
||||
# arg4: port duplex, ex: full
|
||||
# arg5: port autoneg, ex: on
|
||||
# arg6: port eee, ex: 0
|
||||
# arg7: port pause, ex: 0
|
||||
set_port_settings() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
local speed="$3"
|
||||
local duplex=$4
|
||||
local autoneg=$5
|
||||
local eee=$6
|
||||
local pause=$7
|
||||
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
[ $autoneg -eq 1 ] && autoneg="on" || autoneg="off"
|
||||
ethtool --change $ifname speed $speed duplex $duplex autoneg $autoneg
|
||||
|
||||
[ $eee -eq 1 ] && eee="on" || eee="off"
|
||||
ethtool --set-eee $ifname eee $eee 2>/dev/null
|
||||
|
||||
case $pause in
|
||||
off|0)
|
||||
pause=0x0
|
||||
auto=off
|
||||
rx=off
|
||||
tx=off
|
||||
;;
|
||||
on|1)
|
||||
pause=0x2
|
||||
auto=off
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
auto)
|
||||
pause=0x1
|
||||
auto=on
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
tx)
|
||||
pause=0x3
|
||||
auto=off
|
||||
rx=off
|
||||
tx=on
|
||||
;;
|
||||
rx)
|
||||
pause=0x4
|
||||
auto=off
|
||||
rx=on
|
||||
tx=off
|
||||
;;
|
||||
esac
|
||||
|
||||
ethtool --pause $ifname autoneg $auto rx $rx tx $tx 2>/dev/null
|
||||
|
||||
power_updown $ifname $enabled
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fscryptctl
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/google/fscryptctl.git
|
||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Encryption
|
||||
TITLE:=Fscryptctl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
fscryptctl is a low-level tool written in C that handles raw keys and manages policies for Linux filesystem encryption,
|
||||
specifically the "fscrypt" kernel interface which is supported by the ext4, f2fs, and UBIFS filesystems
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CC="$(TARGET_CC)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
fscryptctl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fscryptctl $(1)/usr/bin/fscryptctl
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -1,15 +0,0 @@
|
||||
if (PACKAGE_hostmngr)
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config HOSTMNGR_HOSTS_HISTORY
|
||||
bool "Keep history of hosts"
|
||||
default y
|
||||
|
||||
config HOSTMNGR_PLATFORM_HAS_WIFI
|
||||
bool "Platform has WiFi"
|
||||
default y if PACKAGE_libwifi
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
@@ -1,74 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=bfb9098121d665a324c86a2a9ee0971871d6c22e
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
define Package/hostmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Show and manage hosts in the network
|
||||
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
|
||||
+libnetfilter-conntrack \
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api
|
||||
|
||||
endef
|
||||
|
||||
define Package/hostmngr/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/hostmngr/description
|
||||
This package provides hostmngr that can detect and show host devices
|
||||
present in the network.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-I$(STAGING_DIR)/usr/include/libnetfilter_conntrack \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_HOSTMNGR_PLATFORM_HAS_WIFI),y)
|
||||
TARGET_CFLAGS += -DHAS_WIFI
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/hostmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/hostmngr/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/
|
||||
$(INSTALL_DATA) ./files/etc/hostmngr/input.json $(1)/etc/hostmngr/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/hostmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,hostmngr))
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
config global 'global'
|
||||
option enabled '1'
|
||||
option history '1'
|
||||
option history_file '/etc/hosts_history.json'
|
||||
option history_timeout '86400'
|
||||
|
||||
config interface
|
||||
list ifname 'br-lan'
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/hostmngr/libhostmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.hosts",
|
||||
"parent_dm": "Device.",
|
||||
"object": "Hosts",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=97
|
||||
STOP=20
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
HOSTS_JSON_INPUT="/etc/hostmngr/input.json"
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/hostmngr" "--config hosts" "-o" "/tmp/hostmngr.log" "-f"
|
||||
# procd_set_param respawn
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
|
||||
bbfdm_add_service "bbfdm.hosts" "${HOSTS_JSON_INPUT}"
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "hosts"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q get hosts.global.ageing_timer || exit 0
|
||||
|
||||
|
||||
# Old hosts UCI config is detected; Convert to new format
|
||||
|
||||
ageing_timer="$(uci -q get hosts.global.ageing_timer)"
|
||||
history_timeout=$((ageing_timer*60))
|
||||
|
||||
uci -q set hosts.global.enabled=1
|
||||
uci -q delete hosts.global.ageing_timer
|
||||
uci -q set hosts.global.history_timeout="$history_timeout"
|
||||
uci -q rename hosts.global.reboot_persistent=history
|
||||
uci -q set hosts.global.history_file="/etc/hosts_history.json"
|
||||
|
||||
uci -q add hosts interface
|
||||
for ifname in $(uci -q get hosts.global.ifname); do
|
||||
uci -q add_list hosts.@interface[-1].ifname="$ifname"
|
||||
done
|
||||
|
||||
uci -q delete hosts.global.ifname
|
||||
exit 0
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.5.8
|
||||
PKG_VERSION:=9.3.8
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=79871c5365cf89ce718b922b0863c8a68c09a771
|
||||
PKG_SOURCE_VERSION:=09b7cd7a6b647dd8cbc038698af9298883b5c262
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -39,6 +39,6 @@ config cpe 'cpe'
|
||||
option active_notif_throttle '0'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '0'
|
||||
option enable '1'
|
||||
option hostname ''
|
||||
option port '0'
|
||||
|
||||
@@ -5,58 +5,46 @@ log() {
|
||||
echo "${@}"|logger -t firewall.cwmp -p info
|
||||
}
|
||||
|
||||
get_firewall_zone() {
|
||||
zone="$(uci show firewall|grep network|grep ${1}|cut -d. -f 2)"
|
||||
zone="${zone:-wan}" # defaults to wan zone
|
||||
echo "$zone"
|
||||
}
|
||||
|
||||
cleanup_exiting_rules() {
|
||||
while iptables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Open_ACS_port"; do
|
||||
rule_num="$(iptables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Open_ACS_port" | head -1|awk '{print $1}')"
|
||||
if [ -n "${rule_num}" ]; then
|
||||
iptables -w 1 -D zone_"${1}"_input "${rule_num}";
|
||||
fi
|
||||
done
|
||||
while ip6tables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Open_ACS_port"; do
|
||||
rule_num="$(ip6tables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Open_ACS_port" | head -1|awk '{print $1}')"
|
||||
if [ -n "${rule_num}" ]; then
|
||||
ip6tables -w 1 -D zone_"${1}"_input "${rule_num}";
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
enable="$(uci -q get cwmp.cpe.enable)"
|
||||
enable="${enable:-1}"
|
||||
|
||||
if [ "$enable" -eq 0 ]; then
|
||||
log "CWMP not enabled"
|
||||
if [ ! -f "/var/state/icwmp" ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
wan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
||||
wan="${wan:-wan}"
|
||||
|
||||
zone_name="$(get_firewall_zone $wan)"
|
||||
|
||||
zone_name=$(uci -c /var/state -q get icwmp.acs.zonename)
|
||||
port=$(uci -q get cwmp.cpe.port)
|
||||
port="${port:-7547}"
|
||||
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|awk '{print tolower($0)}')
|
||||
incoming_rule="${incoming_rule:-port_only}"
|
||||
|
||||
ipaddr=$(uci -c /var/state -q get icwmp.acs.ip)
|
||||
ip6addr=$(uci -c /var/state -q get icwmp.acs.ip6)
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr 'A-Z' 'a-z')
|
||||
|
||||
if [ -z "${zone_name}" ]; then
|
||||
log "empty firewall zone name"
|
||||
exit 0
|
||||
elif [ "$zone_name" = "icwmp" ]; then
|
||||
iptables -nL zone_icwmp_input 2> /dev/null
|
||||
if [ "$?" != 0 ]; then
|
||||
iptables -w 1 -N zone_icwmp_input
|
||||
iptables -w 1 -t filter -A INPUT -j zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport "${port}" -j REJECT
|
||||
else
|
||||
iptables -w 1 -F zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport "${port}" -j REJECT
|
||||
fi
|
||||
else
|
||||
iptables -w 1 -F zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -X zone_icwmp_input 2> /dev/null
|
||||
fi
|
||||
|
||||
cmd="iptables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
cmd6="ip6tables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
|
||||
# default incoming rule is Port only
|
||||
if [ -z "${incoming_rule}" ]; then
|
||||
incoming_rule="port_only"
|
||||
fi
|
||||
|
||||
if [ "${incoming_rule}" = "ip_only" ]; then
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
if [ -n "${ip6addr}" ]; then
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
@@ -67,9 +55,6 @@ elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
|
||||
if [ -n "${ip6addr}" ]; then
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
|
||||
@@ -79,23 +64,17 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
cleanup_exiting_rules "${zone_name}"
|
||||
|
||||
echo "${cmd}"|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd}
|
||||
log "Applied [${cmd}]"
|
||||
fi
|
||||
|
||||
echo "${cmd6}"|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd6="${cmd6} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd6}
|
||||
log "Applied [${cmd6}]"
|
||||
fi
|
||||
|
||||
if [ -f "/var/state/icwmp" ]; then
|
||||
uci -c /var/state -q set icwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit icwmp
|
||||
fi
|
||||
uci -c /var/state -q set icwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit icwmp
|
||||
|
||||
@@ -18,7 +18,14 @@ handle_icwmp_update() {
|
||||
sleep 10
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
|
||||
if [ "$ret" != "true" ]; then
|
||||
if [ "$ret" = "true" ]; then
|
||||
# read status from var/state/icwmp
|
||||
status=$(uci -q -c /var/state get icwmp.sess_status.current_status)
|
||||
if [ "$status" != "running" ]; then
|
||||
log "Trigger out of bound inform, since last inform status was failure"
|
||||
ubus -t 10 call tr069 inform >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
log "Restarting icwmp tr069 object"
|
||||
/etc/init.d/icwmpd restart
|
||||
fi
|
||||
|
||||
@@ -98,11 +98,7 @@ configure_send_op125() {
|
||||
if [ "${uci}" = "network" ]; then
|
||||
local opt125="125:00:00:0D:E9"
|
||||
else
|
||||
if [ -z "${sendopt}" ]; then
|
||||
local opt125="125,00:00:0D:E9"
|
||||
else
|
||||
local opt125=":00:00:0D:E9"
|
||||
fi
|
||||
local opt125="125,00:00:0D:E9"
|
||||
fi
|
||||
|
||||
config_get oui cpe manufacturer_oui ""
|
||||
@@ -182,94 +178,10 @@ configure_send_op125() {
|
||||
new_send_opt="$sendopt $opt125"
|
||||
uci -q set network."${intf}".sendopts="$new_send_opt"
|
||||
else
|
||||
new_send_opt="$sendopt$opt125"
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$new_send_opt"
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$opt125"
|
||||
fi
|
||||
}
|
||||
|
||||
check_for_suboptions() {
|
||||
# Check if option 4 and 5 present inside enterprise id 3561
|
||||
data=$(echo "${1}" | sed 's/://g')
|
||||
len=$(printf "${data}"|wc -c)
|
||||
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 8 ]; do
|
||||
subopt_present=0
|
||||
|
||||
ent_id="${data:0:8}"
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
if [ $ent_id -ne 3561 ]; then
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
len_val=${data:8:2}
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
if [ $opt_len -eq 0 ]; then
|
||||
echo ${subopt_present}
|
||||
return 0
|
||||
fi
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
while [ $sub_data_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${sub_data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
case "${sub_opt_id}" in
|
||||
"4") subopt_present=1
|
||||
;;
|
||||
"5") subopt_present=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ${subopt_present} -eq 1 ]; then
|
||||
break;
|
||||
fi
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
sub_data_len=$((sub_data_len - sub_opt_end))
|
||||
|
||||
# fetch next sub option hex string
|
||||
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
|
||||
done
|
||||
|
||||
if [ ${subopt_present} -eq 1 ]; then
|
||||
break;
|
||||
else
|
||||
# move ahead data to next enterprise id
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${subopt_present}
|
||||
}
|
||||
|
||||
enable_dnsmasq_option125() {
|
||||
local lan="${1}"
|
||||
local send125_present=0
|
||||
@@ -278,19 +190,16 @@ enable_dnsmasq_option125() {
|
||||
local proto="$(uci -q get dhcp."${lan}".dhcpv4)"
|
||||
if [ "${proto}" = "server" ]; then
|
||||
opt_list="$(uci -q get dhcp."${lan}".dhcp_option)"
|
||||
base_opt=""
|
||||
|
||||
for sopt in $opt_list; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=$(check_for_suboptions "${sopt:4}")
|
||||
base_opt="${sopt}"
|
||||
send125_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
uci -q del_list dhcp."${lan}".dhcp_option="${base_opt}"
|
||||
configure_send_op125 "${base_opt}" "${lan}" "dhcp"
|
||||
configure_send_op125 "" "${lan}" "dhcp"
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
fi
|
||||
fi
|
||||
@@ -566,8 +475,16 @@ reload_service() {
|
||||
fi
|
||||
|
||||
status="$(echo "${tr069_status}" | jsonfilter -qe '@.cwmp.status')"
|
||||
ret="$?"
|
||||
if [ "$status" = "up" ]; then
|
||||
ubus -t 1 call tr069 command '{"command":"reload"}'
|
||||
ret="$?"
|
||||
fi
|
||||
|
||||
if [ "$status" = "init" ] || [ "$ret" -ne "0" ]; then
|
||||
log "Restarting CWMP client"
|
||||
stop
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -582,6 +499,6 @@ service_triggers() {
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
procd_add_reload_trigger "cwmp"
|
||||
add_interface_trigger ${wan_interface}
|
||||
add_interface_trigger ${default_wan_interface}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.2.19
|
||||
PKG_VERSION:=8.1.16
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3d175485a7461ce567e3bee47e1c760e15434367
|
||||
PKG_SOURCE_VERSION:=4843afa0069c8eff18c6bdde6a5dd76625dc1ac5
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -89,12 +89,6 @@ ifeq ($(CONFIG_IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY),y)
|
||||
TARGET_CFLAGS += -DIEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_IEEE1905_EXTENSION_ALLOWED),y)
|
||||
TARGET_CFLAGS += -DEXTENSION_ALLOWED
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DHAS_UBUS
|
||||
|
||||
MAKE_FLAGS += \
|
||||
extmod_subdirs="$(patsubst %,extensions/%,$(plugins))"
|
||||
|
||||
|
||||
@@ -2,16 +2,13 @@ config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
list extmodule 'topology'
|
||||
option registrar '2 5 6'
|
||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config al-iface
|
||||
option enabled '1'
|
||||
list ifname 'br-lan'
|
||||
list ifname '/eth.*'
|
||||
list ifname '/wl.*'
|
||||
list ifname '/wds.*'
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
|
||||
# ap sections are auto-generated/overwritten during onboarding
|
||||
#
|
||||
|
||||
@@ -12,11 +12,11 @@ define Package/map-plugin/config
|
||||
|
||||
config MULTIAP_EASYMESH_VERSION
|
||||
int "Easymesh version"
|
||||
default 4
|
||||
default 2
|
||||
|
||||
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
bool "Sync configuration between dynamic controllers in the network"
|
||||
default y
|
||||
default n
|
||||
|
||||
config MULTIAP_FUZZ_1905_CMDUS
|
||||
bool "Include support to fuzz 1905 CMDUs for testing purpose"
|
||||
|
||||
41
iop/config
41
iop/config
@@ -62,14 +62,14 @@ CONFIG_PACKAGE_wifimngr=y
|
||||
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
|
||||
CONFIG_PACKAGE_topology-plugin=y
|
||||
CONFIG_PACKAGE_map-agent=m
|
||||
CONFIG_PACKAGE_map-controller=m
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_decollector=y
|
||||
CONFIG_PACKAGE_map-agent=y
|
||||
CONFIG_PACKAGE_map-controller=y
|
||||
|
||||
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
|
||||
|
||||
# Network #
|
||||
CONFIG_PACKAGE_hostmngr=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
|
||||
@@ -86,14 +86,12 @@ CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_stunc=y
|
||||
CONFIG_PACKAGE_swmodd=y
|
||||
CONFIG_PACKAGE_twamp=y
|
||||
CONFIG_PACKAGE_udpecho-client=y
|
||||
CONFIG_PACKAGE_udpecho-server=y
|
||||
CONFIG_PACKAGE_userinterface=y
|
||||
CONFIG_PACKAGE_xmppc=y
|
||||
CONFIG_PACKAGE_timemngr=y
|
||||
CONFIG_PACKAGE_stunc=m
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_twamp=m
|
||||
CONFIG_PACKAGE_udpecho-client=m
|
||||
CONFIG_PACKAGE_udpecho-server=m
|
||||
CONFIG_PACKAGE_xmppc=m
|
||||
|
||||
# WebGUI #
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
@@ -133,12 +131,11 @@ CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
|
||||
# Services #
|
||||
CONFIG_PACKAGE_atftp=y
|
||||
CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
CONFIG_PACKAGE_ssdpd=y
|
||||
CONFIG_PACKAGE_miniupnpd-iptables=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
@@ -147,7 +144,7 @@ CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
|
||||
# Tools and Utilities #
|
||||
CONFIG_PACKAGE_curl=y
|
||||
@@ -163,17 +160,11 @@ CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_ip6tables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipmark=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iptables-mod-nflog=y
|
||||
CONFIG_PACKAGE_iptables-mod-nfqueue=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_nping=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_socat=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
|
||||
@@ -183,12 +174,9 @@ CONFIG_PACKAGE_traceroute6=y
|
||||
##########
|
||||
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_ca-certificates=y
|
||||
CONFIG_PACKAGE_crun=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libcap-bin=y
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
@@ -196,7 +184,6 @@ CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_procd-ujail=m
|
||||
CONFIG_PACKAGE_quota=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rrdns=y
|
||||
|
||||
108
iop/scripts/generate_tarballs.sh
Executable file
108
iop/scripts/generate_tarballs.sh
Executable file
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2029
|
||||
|
||||
build_bcmkernel_consumer() {
|
||||
local tarfile bcmkernelcommith sdkversion serverpath serverlink
|
||||
|
||||
sdkversion="$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')"
|
||||
sdkversion="${sdkversion:0:4}${sdkversion:(-1)}"
|
||||
bcmkernelcommith="$(grep -w "PKG_SOURCE_VERSION:" "$curdir/feeds/broadcom/bcmkernel/${sdkversion:0:5}"*".mk" | cut -d'=' -f2)"
|
||||
|
||||
[ -n "$board" ] && [ -n "$bcmkernelcommith" ] || return
|
||||
|
||||
serverpath="$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz"
|
||||
serverlink="$FPATH/bcmopen-$board-$majver.$minver-latest"
|
||||
|
||||
# do not build bcmopen sdk if it was already built before
|
||||
# if it was, check if there's a symlink in place and create it if missing
|
||||
ssh "$SERVER" "test -f '$serverpath' && { test -L '$serverlink' || ln -sf '$serverpath' '$serverlink'; }" && return
|
||||
|
||||
cd "./build_dir/target-"*"/bcmkernel-"*"-${sdkversion:0:4}"*"/bcm963xx/release"
|
||||
bash do_consumer_release -p "$profile" -y -F
|
||||
|
||||
tarfile='out/bcm963xx_*_consumer.tar.gz'
|
||||
[ $(ls -1 $tarfile | wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
||||
|
||||
scp -pv $tarfile "$SERVER":"$serverpath"
|
||||
ssh "$SERVER" "test -f '$serverpath' && ln -sf '$serverpath' '$serverlink'"
|
||||
rm -f $tarfile
|
||||
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_endptmngr_consumer() {
|
||||
# create endptmngr open version tar file
|
||||
local endptversion endptcommith
|
||||
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
|
||||
endptversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
[ -n "$profile" ] && [ -n "$endptversion" ] && [ -n "$endptcommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/endptmngr-$profile-$endptversion-$endptcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/endptmngr-$endptversion/
|
||||
mkdir endptmngr-open-$endptversion
|
||||
mkdir endptmngr-open-$endptversion/src
|
||||
cp ./src/endptmngr endptmngr-open-$endptversion/src
|
||||
cp -r ./files/ endptmngr-open-$endptversion/
|
||||
tar -czv endptmngr-open-$endptversion/ -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
scp -pv endptmngr-$profile-$endptversion-$endptcommith.tar.gz $SERVER:$FPATH/
|
||||
cp endptmngr-$profile-$endptversion-$endptcommith.tar.gz $curdir/
|
||||
rm -rf endptmngr-open-$endptversion
|
||||
rm -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
function print_usage {
|
||||
echo "Usage: $0 generate_tarballs"
|
||||
echo " -t <target>"
|
||||
}
|
||||
|
||||
function generate_tarballs {
|
||||
|
||||
SERVER="god@download.iopsys.eu"
|
||||
FPATH="/var/www/html/iopsys/opensdk"
|
||||
|
||||
set -e
|
||||
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
|
||||
|
||||
board=$(grep CONFIG_TARGET_FAMILY .config | cut -d'=' -f2 | tr -d '"')
|
||||
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
|
||||
majver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f1 -d .)
|
||||
minver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f2 -d .)
|
||||
curdir="$PWD"
|
||||
|
||||
|
||||
# Execute user command
|
||||
while getopts "t:h" opt; do
|
||||
case $opt in
|
||||
t)
|
||||
stk_target=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$stk_target" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_endptmngr_consumer
|
||||
else
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
register_command "generate_tarballs" "Generate tarballs for Open SDK"
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libethernet
|
||||
PKG_VERSION:=7.2.105
|
||||
PKG_VERSION:=7.2.104
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4a363a699c4a8024054ca095f1b7818f8bd56ded
|
||||
PKG_SOURCE_VERSION:=d777636ca43302a95e571ab030ec44ef50905570
|
||||
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
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqos
|
||||
PKG_VERSION:=7.2.105
|
||||
PKG_VERSION:=7.2.101
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=78cc1481feff7adc09749e73a3513fae4d9ded28
|
||||
PKG_SOURCE_VERSION:=93ca0a66d6f82bca208bbe52b75ed582b20aa094
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -37,11 +37,14 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
|
||||
else ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET
|
||||
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_PLATFORM=IPQ95XX
|
||||
TARGET_CFLAGS +=-DIPQ95XX
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_CFLAGS +=-DIOPSYS_LINUX
|
||||
else
|
||||
$(info Using default LINUX)
|
||||
$(info Unexpected CONFIG_TARGET, use default LINUX)
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_CFLAGS +=-DIOPSYS_LINUX
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=5e1befd02c6734ee8b94b7ef54d6171ba1086042
|
||||
PKG_SOURCE_VERSION:=3f4cdca981b30d54ec5a426775fdcec2a63f83d9
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"ulaw": {
|
||||
"name": "G.711MuLaw",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 60,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
@@ -10,7 +10,7 @@
|
||||
"alaw": {
|
||||
"name": "G.711ALaw",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 60,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
@@ -18,16 +18,15 @@
|
||||
"g726": {
|
||||
"name": "G.726",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 60,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 16,
|
||||
"rtp_payload": 80
|
||||
"bitrate": 16
|
||||
},
|
||||
"g723": {
|
||||
"name": "G.723.1",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 60,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 30,
|
||||
"ptime_increment": 30,
|
||||
"bitrate": 5.3
|
||||
@@ -35,18 +34,26 @@
|
||||
"g729": {
|
||||
"name": "G.729",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 60,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 8
|
||||
},
|
||||
"g722": {
|
||||
"name": "G.722",
|
||||
"ilbc": {
|
||||
"name": "iLBC",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 60,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
"ptime_increment": 30,
|
||||
"bitrate": 15.2
|
||||
},
|
||||
"gsm": {
|
||||
"name": "AMR",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 20,
|
||||
"bitrate": 12.2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=8c8fa2b70e2bd570deb291478b31fa81a4ab3c1a
|
||||
PKG_SOURCE_VERSION:=548f8fccc9f8f0b5dd6bb39bdd9cac8659400cb6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=e60fdaa93e1385bbea08751dcd392cddffdf3345
|
||||
PKG_SOURCE_VERSION:=062a265754b93a865cfcd2745f200aa09fb4a668
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.3
|
||||
PKG_VERSION:=7.2.107
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=66cd6a376308ab28b0650883e6ba7bb1952ce6fc
|
||||
PKG_SOURCE_VERSION:=1bd819ac21f86a0956b1f69ef1d110665e240a5f
|
||||
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
|
||||
@@ -46,13 +46,9 @@ else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_PLATFORM=IPQ95XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM MAC80211
|
||||
TARGET_CFLAGS +=-DIPQ95XX
|
||||
else ifeq ($(CONFIG_TARGET_ipq53xx),y)
|
||||
TARGET_PLATFORM=IPQ53XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM MAC80211
|
||||
TARGET_CFLAGS +=-DIPQ53XX
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_WIFI_TYPE=MEDIATEK MAC80211
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_LINUX
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
||||
@@ -61,12 +57,6 @@ else
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-mt7915e),)
|
||||
TARGET_CFLAGS=-DMT7915_VENDOR_EXT
|
||||
endif
|
||||
|
||||
PKG_BUILD_DEPENDS:=PACKAGE_kmod-mt7915e:mt76
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libwifi),)
|
||||
TARGET_CFLAGS +=-DHAS_WIFI
|
||||
endif
|
||||
|
||||
@@ -8,28 +8,28 @@ config AGENT_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
|
||||
config AGENT_ISLAND_PREVENTION
|
||||
bool "Support Island Prevention"
|
||||
default y
|
||||
default y if MULTIAP_AGENT_ISLAND_PREVENTION
|
||||
|
||||
config AGENT_EASYMESH_R2_CERT
|
||||
bool "Compile for WFA test bed"
|
||||
|
||||
config AGENT_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 4
|
||||
default 2
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT
|
||||
bool "Enable extra features through Easymesh vendor extension"
|
||||
default y
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
default AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
enabled through AGENT_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
@@ -45,12 +45,5 @@ config AGENT_LOCAL_ACS_SERVICE
|
||||
config AGENT_STRICT_OPER_CHANNEL_REPORT
|
||||
bool "Report operation channel strictly, skip some unsolicited reports"
|
||||
|
||||
config AGENT_WIRELESS_EXPLICIT_RELOAD
|
||||
bool "Reload wireless after UCI commit"
|
||||
|
||||
config AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST
|
||||
bool "Use config opt to determine if Oper Channel Report CMDU is send as relayed multicast or directly to controller"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.3.7.0
|
||||
PKG_VERSION:=4.3.3.10
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=03a85b04d10c08dccd96381ef6f2ece91d16dc52
|
||||
PKG_SOURCE_VERSION:=644884a8b421fd830f793b94779876395eecd8e6
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -74,7 +74,7 @@ TARGET_CFLAGS += -DEASYMESH_R2_CERT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
@@ -94,14 +94,6 @@ ifeq ($(CONFIG_AGENT_STRICT_OPER_CHANNEL_REPORT),y)
|
||||
TARGET_CFLAGS += -DSTRICT_OPER_CHANNEL_REPORT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_WIRELESS_EXPLICIT_RELOAD),y)
|
||||
TARGET_CFLAGS += -DWIRELESS_EXPLICIT_RELOAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST),y)
|
||||
TARGET_CFLAGS += -DOPER_CHAN_CHANGE_RELAY_MCAST
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
config agent 'agent'
|
||||
option enabled '0'
|
||||
option enabled '1'
|
||||
option debug '0'
|
||||
option profile '4'
|
||||
option profile '2'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
option eth_onboards_wifi_bhs '1'
|
||||
option scan_on_boot_only '0'
|
||||
option chan_ch_relay_mcast '1'
|
||||
option guest_isolation '1'
|
||||
list map_port 'all'
|
||||
option eth_onboards_wifi_bhs '0'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
option scan_on_boot_only '0'
|
||||
list map_port 'all'
|
||||
|
||||
config dynamic_backhaul
|
||||
option missing_bh_timer '60'
|
||||
@@ -23,9 +21,9 @@ config controller_select
|
||||
option autostart '1'
|
||||
option local '0'
|
||||
|
||||
#config radio
|
||||
# option device 'phy0'
|
||||
# option band '2'
|
||||
config radio
|
||||
option device 'phy0'
|
||||
option band '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
@@ -36,9 +34,9 @@ config controller_select
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config radio
|
||||
# option device 'phy1'
|
||||
# option band '5'
|
||||
config radio
|
||||
option device 'phy1'
|
||||
option band '5'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
@@ -49,12 +47,12 @@ config controller_select
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config bsta
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan0'
|
||||
# option band '2'
|
||||
# option device 'phy0'
|
||||
# option priority '2'
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan0'
|
||||
option band '2'
|
||||
option device 'phy0'
|
||||
option priority '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
@@ -63,12 +61,12 @@ config controller_select
|
||||
# option bssid '0a:1b:2c:3d:4e:53'
|
||||
# option vid '1'
|
||||
|
||||
#config bsta
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan1'
|
||||
# option band '5'
|
||||
# option device 'phy1'
|
||||
# option priority '0'
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan1'
|
||||
option band '5'
|
||||
option device 'phy1'
|
||||
option priority '0'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
. /lib/network/utils.sh
|
||||
|
||||
conn_ports_file="/var/run/multiap/map.connected.ports"
|
||||
conn_ports_file="/tmp/map.connected.ports"
|
||||
map_bh_file="/var/run/multiap/multiap.backhaul"
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
[ "${al_bridge:0:3}" = "br-" ] || exit 0
|
||||
@@ -11,15 +11,11 @@ al_brnet="${al_bridge:3}"
|
||||
# Exit if the PORT is not member of the AL Bridge
|
||||
[ "$(get_network_of $PORT)" = "$al_brnet" ] || exit 0
|
||||
|
||||
# Exit if the device is not operating in extender/repeater mode
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
############## Dynamic Backhaul Daemon ##############
|
||||
if [ -n "$(which dynbhd)" ]; then
|
||||
pidof dynbhd >/dev/null && exit 0 # dynbhd is managing the links
|
||||
|
||||
if [ ! -f $conn_ports_file ]; then
|
||||
mkdir -p /var/run/multiap
|
||||
touch $conn_ports_file
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch $conn_ports_file
|
||||
@@ -51,6 +47,8 @@ if [ -n "$wanport" ]; then
|
||||
########################################################
|
||||
else
|
||||
#################### DHCP Discovery ####################
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
brctl delif $al_bridge $PORT
|
||||
|
||||
|
||||
@@ -179,16 +179,7 @@ create_dir() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ -f /usr/sbin/dynbhd ]; then
|
||||
# Start dynbhd only if the device is operating in extender/repeater mode
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
if [ "${al_bridge:0:3}" = "br-" ]; then
|
||||
al_brnet="${al_bridge:3}"
|
||||
if [ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ]; then
|
||||
start_dynbhd_service
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
[ -f /usr/sbin/dynbhd ] && start_dynbhd_service
|
||||
|
||||
config_load "mapagent"
|
||||
validate_agent_config || return 1;
|
||||
@@ -219,8 +210,3 @@ reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
boot() {
|
||||
/lib/wifi/multiap conf
|
||||
start
|
||||
}
|
||||
|
||||
@@ -1,198 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
generate_mapagent_config=0
|
||||
generate_wireless_sta_config=0
|
||||
|
||||
network_mode="$(fw_printenv -n netmode)"
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)"
|
||||
|
||||
is_airoha() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
strings /proc/device-tree/compatible | grep -qE '^(econet,|airoha,)'; return
|
||||
}
|
||||
|
||||
is_broadcom() {
|
||||
[ -e /dev/bcm ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
is_qualcomm() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
strings /proc/device-tree/compatible | grep -qE '^(qcom,|ipq,)'; return
|
||||
}
|
||||
|
||||
generate_multiap_config() {
|
||||
devidx=0
|
||||
|
||||
generate_config() {
|
||||
dev="$1"
|
||||
|
||||
[ -n "$dev" ] || continue
|
||||
|
||||
config_get band $dev band
|
||||
|
||||
mode_band=""
|
||||
priority=
|
||||
dpp_chan=
|
||||
channels=
|
||||
|
||||
case "$band" in
|
||||
2g)
|
||||
mode_band=2
|
||||
priority=2
|
||||
dpp_chan="81/1"
|
||||
channels="1 6 11"
|
||||
;;
|
||||
5g)
|
||||
mode_band=5
|
||||
priority=1
|
||||
dpp_chan="128/36"
|
||||
channels="36-64 100-112"
|
||||
;;
|
||||
6g)
|
||||
mode_band=6
|
||||
priority=0
|
||||
dpp_chan="133/49"
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$mode_band" ] || continue
|
||||
|
||||
devidx=$(echo ${dev} |tr -dc '0-9')
|
||||
|
||||
device="$dev"
|
||||
|
||||
if is_airoha; then
|
||||
ifprefix="wlan%_%"
|
||||
ifname="wlan${devidx}_0"
|
||||
ifname_bh="wlan${devidx}_1"
|
||||
uci set wireless.$dev.channels="$channels"
|
||||
uci commit wireless
|
||||
elif is_broadcom; then
|
||||
ifprefix="wl"
|
||||
ifname="wl${devidx}"
|
||||
ifname_bh="$ifname.1"
|
||||
device="wl${devidx}"
|
||||
brcm_setup="1"
|
||||
elif is_qualcomm; then
|
||||
ifprefix="wlan0%-"
|
||||
ifname="wlan${devidx}"
|
||||
ifname_bh="wlan${devidx}-1"
|
||||
else
|
||||
ifprefix="wlan%-"
|
||||
ifname="wlan$devidx"
|
||||
ifname_bh="$ifname-1"
|
||||
fi
|
||||
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.ifprefix="$ifprefix"
|
||||
uci set mapagent.agent.brcm_setup="$brcm_setup"
|
||||
uci add mapagent radio
|
||||
uci set mapagent.@radio[-1].device="$device"
|
||||
uci set mapagent.@radio[-1].band="$mode_band"
|
||||
|
||||
if [ "$network_mode" == "extender" ]; then
|
||||
uci add mapagent bsta
|
||||
uci set mapagent.@bsta[-1].device="$device"
|
||||
uci set mapagent.@bsta[-1].ifname="$ifname"
|
||||
uci set mapagent.@bsta[-1].band="$mode_band"
|
||||
uci set mapagent.@bsta[-1].priority="$priority"
|
||||
|
||||
#uci add mapagent dpp_uri
|
||||
#uci set mapagent.@dpp_uri[-1].type="qrcode"
|
||||
#uci set mapagent.@dpp_uri[-1].device="$device"
|
||||
#uci set mapagent.@dpp_uri[-1].ifname="$ifname"
|
||||
#uci set mapagent.@dpp_uri[-1].band="$mode_band"
|
||||
#uci set mapagent.@dpp_uri[-1].chirp_interval="10"
|
||||
#uci add_list mapagent.@dpp_uri[-1].dpp_chan="$dpp_chan"
|
||||
|
||||
if [ $generate_wireless_sta_config -eq 1 ]; then
|
||||
secname="default_sta_${device}"
|
||||
uci set wireless.$secname=wifi-iface
|
||||
uci set wireless.$secname.device="$device"
|
||||
uci set wireless.$secname.mode="sta"
|
||||
uci set wireless.$secname.ifname="$ifname"
|
||||
uci set wireless.$secname.disabled="0"
|
||||
uci set wireless.$secname.default_disabled="1"
|
||||
uci set wireless.$secname.multi_ap="1"
|
||||
uci commit wireless
|
||||
else
|
||||
ubus call uci set "{\"config\":\"wireless\",\"type\":\"wifi-iface\", \
|
||||
\"match\":{\"mode\":\"sta\", \"ifname\":\"$ifname\", \"device\":\"$device\"},\"values\":{\"multi_ap\":\"1\"}}" 2>/dev/null
|
||||
fi
|
||||
else
|
||||
uci add mapagent ap
|
||||
uci set mapagent.@ap[-1].type="fronthaul"
|
||||
uci set mapagent.@ap[-1].device="$device"
|
||||
uci set mapagent.@ap[-1].ifname="$ifname"
|
||||
uci set mapagent.@ap[-1].band="$mode_band"
|
||||
uci add mapagent ap
|
||||
uci set mapagent.@ap[-1].type="backhaul"
|
||||
uci set mapagent.@ap[-1].device="$device"
|
||||
uci set mapagent.@ap[-1].ifname="$ifname_bh"
|
||||
uci set mapagent.@ap[-1].band="$mode_band"
|
||||
|
||||
if [ "$multiap_mode" != "none" ]; then
|
||||
ubus call uci set "{\"config\":\"wireless\",\"type\":\"wifi-iface\", \
|
||||
\"match\":{\"ifname\":\"$ifname\", \"device\":\"$device\"},\"values\":{\"multi_ap\":\"2\"}}" 2>/dev/null
|
||||
ubus call uci set "{\"config\":\"wireless\",\"type\":\"wifi-iface\", \
|
||||
\"match\":{\"ifname\":\"$ifname_bh\", \"device\":\"$device\"},\"values\":{\"multi_ap\":\"1\"}}" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
config_foreach generate_config wifi-device
|
||||
}
|
||||
|
||||
map_genconf () {
|
||||
if [ -f /etc/config/mapagent -a -z "$(uci -q get mapagent.@radio[0].band)" ]; then
|
||||
generate_mapagent_config=1
|
||||
fi
|
||||
|
||||
if [ "$network_mode" == "extender" ]; then
|
||||
if ! uci show wireless | grep -q "mode=.*sta"; then
|
||||
generate_wireless_sta_config=1
|
||||
|
||||
if is_broadcom; then
|
||||
for section in $(uci show wireless | grep wifi-device | cut -d'.' -f2 | cut -d'=' -f1); do
|
||||
uci -q set wireless.$section.apsta="1"
|
||||
done
|
||||
fi
|
||||
|
||||
for section in $(uci show wireless | grep "mode=.*ap" | cut -d'.' -f2); do
|
||||
uci delete wireless.$section
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
generate_multiap_config
|
||||
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.enabled="1"
|
||||
if [ "$multiap_mode" == "agent" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=0
|
||||
uci -q set mapagent.@controller_select[0].local=0
|
||||
elif [ "$multiap_mode" == "auto" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=0
|
||||
elif [ "$multiap_mode" == "full" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=1
|
||||
elif [ "$multiap_mode" == "none" ]; then
|
||||
uci set mapagent.agent.enabled="0"
|
||||
fi
|
||||
uci -q commit mapagent
|
||||
fi
|
||||
|
||||
|
||||
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
|
||||
uci set mapcontroller.controller.enabled="0"
|
||||
else
|
||||
uci set mapcontroller.controller.enabled="1"
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
}
|
||||
@@ -11,18 +11,18 @@ config CONTROLLER_EASYMESH_VENDOR_EXT
|
||||
default y
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
|
||||
config CONTROLLER_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 4
|
||||
default 2
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
default CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
enabled through CONTROLLER_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.3.3.0
|
||||
PKG_VERSION:=4.3.0.8
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=cc50001914d500655ffdb8eede3c38f650417209
|
||||
PKG_SOURCE_VERSION:=0d83f8acd66a4cb97f2f123149696334d7f03e6e
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -53,7 +53,7 @@ TARGET_CFLAGS += -DCONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
config controller 'controller'
|
||||
option enabled '1' # may be modified by other package start-up scripts (i.e. map-agent)
|
||||
option profile '4'
|
||||
option registrar '2 5 6'
|
||||
option enabled '1'
|
||||
option registrar '2 5'
|
||||
option debug '0'
|
||||
option bcn_metrics_max_num '10'
|
||||
option initial_channel_scan '0'
|
||||
option enable_ts '0'
|
||||
option primary_vid '1'
|
||||
option primary_vid '0'
|
||||
option primary_pcp '0'
|
||||
option allow_bgdfs '0'
|
||||
option channel_plan '0'
|
||||
option de_collect_interval '60'
|
||||
|
||||
config sta_steering
|
||||
option steer_module 'rcpi'
|
||||
@@ -21,65 +18,40 @@ config sta_steering
|
||||
option use_usta_metrics '0'
|
||||
option bandsteer '0'
|
||||
option diffsnr '8'
|
||||
option rcpi_threshold_2g '70'
|
||||
option rcpi_threshold_5g '86'
|
||||
option rcpi_threshold_6g '86'
|
||||
option report_rcpi_threshold_2g '80'
|
||||
option report_rcpi_threshold_5g '96'
|
||||
option report_rcpi_threshold_6g '96'
|
||||
|
||||
###################
|
||||
# Default AP sections credentials will by updated
|
||||
# by uci-defaults script 99-mapcntlr
|
||||
###################
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid '$DEVICE_MANUFACTURER-$BASEMAC_ADDR'
|
||||
option encryption 'sae-mixed'
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option ssid 'IOWRT-2.4GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid '$DEVICE_MANUFACTURER-$BASEMAC_ADDR'
|
||||
option type 'fronthaul'
|
||||
option vid '1'
|
||||
option ssid 'IOWRT-5GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
option ssid '$DEVICE_MANUFACTURER-$BASEMAC_ADDR'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-5GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-6GHz'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-5GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
# node and radio sections (per node) are auto
|
||||
# generated per Multi-AP Agent in the network
|
||||
@@ -90,6 +62,8 @@ config ap
|
||||
# option backhaul_ul_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_dl_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_type 'none'
|
||||
# option primary_vid '1'
|
||||
# option primary_pcp '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
# option report_metric_periodic '0'
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/device_info
|
||||
|
||||
WIFI_BH_KEY=$(openssl rand -rand /dev/urandom -hex 64 2>/dev/null | openssl dgst -hex -sha256 | cut -d " " -f 2)
|
||||
WIFI_BH_KEY=${WIFI_BH_KEY::-1}
|
||||
|
||||
BASEMAC_ADDR="$(fw_printenv -n ethaddr | tr -d ':')"
|
||||
[ ${#BASEMAC_ADDR} -eq 12 ] || BASEMAC_ADDR="$(db -q get device.deviceinfo.BaseMACAddress | tr -d ':')"
|
||||
|
||||
WIFI_FH_KEY="$(db get hw.board.wpa_key)"
|
||||
WIFI_FH_KEY="${WIFI_FH_KEY:-1234567890}"
|
||||
|
||||
sed -i -e "s/\$BASEMAC_ADDR/$BASEMAC_ADDR/g" \
|
||||
-e "s/\$WIFI_FH_KEY/$WIFI_FH_KEY/g" \
|
||||
-e "s/\$WIFI_BH_KEY/$WIFI_BH_KEY/g" \
|
||||
-e "s/\$DEVICE_MANUFACTURER/$DEVICE_MANUFACTURER/g" \
|
||||
/etc/config/mapcontroller 2>/dev/null
|
||||
@@ -7,14 +7,14 @@ config TOPOLOGYD_EASYMESH_VENDOR_EXT
|
||||
default y
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
default TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
enabled through TOPOLOGYD_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=2.5.2.1
|
||||
PKG_VERSION:=2.5.1.24
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=914f1ead2e65c1e24ed2d8786aa883730db2208f
|
||||
PKG_SOURCE_VERSION:=9f15e813c39ff23cef27975ce138bd3286f30adf
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -49,7 +49,7 @@ endef
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_HOST_WAN_STATS),y)
|
||||
|
||||
5
map-topology/files/etc/config/hosts
Normal file
5
map-topology/files/etc/config/hosts
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
config global 'global'
|
||||
option ageing_timer '1440'
|
||||
option reboot_persistent '0'
|
||||
list ifname 'br-lan'
|
||||
@@ -4,4 +4,4 @@ config topology 'topology'
|
||||
option depth '8'
|
||||
option interval '60'
|
||||
option maxlog '32'
|
||||
option profile '4'
|
||||
option profile '2'
|
||||
|
||||
@@ -97,7 +97,8 @@ interfaces_ok(){
|
||||
# mcast config is outdated, simply generate as per new logic
|
||||
if [ -z "$dev_section" ]; then
|
||||
# check if the itf is a native interface && return 1
|
||||
[ -f "/proc/net/vlan/$itf" ] || return 1
|
||||
native=$(ubus call uci get '{"config":"ports", "type":"ethport", "match":{"ifname":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
|
||||
[ -z "native" ] && return 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
|
||||
@@ -246,10 +246,6 @@ config_mcproxy() {
|
||||
fi
|
||||
}
|
||||
|
||||
setup_mcast_mode() {
|
||||
:
|
||||
}
|
||||
|
||||
configure_mcast() {
|
||||
config_global_params "set_max_groups_and_sources"
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obudpst
|
||||
PKG_VERSION:=8.0.0
|
||||
PKG_VERSION:=7.5.1
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/BroadbandForum/obudpst.git
|
||||
PKG_SOURCE_VERSION:=1d00a6de1147b5fb4280c443a67b7e5ded3a5c97
|
||||
PKG_SOURCE_VERSION:=a8faf1925ea9189467e7f8d3b9d93c67c8b927bd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
if PACKAGE_obuspa
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config OBUSPA_DB_PATH
|
||||
string "Configure path for usp.db file"
|
||||
default "/tmp/"
|
||||
@@ -22,8 +25,5 @@ config OBUSPA_MTP_ENABLE_COAP
|
||||
config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
bool "Enable verification of controller MTP before processing the message"
|
||||
default n
|
||||
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.4.4
|
||||
PKG_VERSION:=7.0.2.22.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=7ae856494f6cae9e81510818a7944b1259ca55b2
|
||||
PKG_SOURCE_VERSION:=001a4cf2de7e20f322ac48ef73c6b5b84db39992
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,7 +31,6 @@ define Package/obuspa
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
endef
|
||||
|
||||
@@ -103,7 +102,6 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
@@ -111,14 +109,7 @@ define Package/obuspa/install
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/USPAgent.json $(1)/etc/bbfdm/json/USPAgent.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/TransferComplete.json $(1)/etc/bbfdm/json/TransferComplete.json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/00-obuspa-extender-mode $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
config obuspa 'global'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option dhcp_discovery '1'
|
||||
option debug '0'
|
||||
option log_level '1'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
#option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
#option trust_cert '/etc/obuspa/rootCA.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
#option log_dest '/var/log/obuspa'
|
||||
|
||||
|
||||
@@ -230,8 +230,8 @@ validate_controller_section()
|
||||
'Path:string' \
|
||||
'EnableEncryption:bool' \
|
||||
'PeriodicNotifInterval:uinteger' \
|
||||
'SessionMode:string:Allow' \
|
||||
'ProvisioningCode:string'
|
||||
'SessionMode:string:Allow'
|
||||
|
||||
}
|
||||
|
||||
validate_subscription_section()
|
||||
@@ -323,7 +323,7 @@ configure_controller()
|
||||
{
|
||||
local EndpointID Enable
|
||||
local Protocol Destination
|
||||
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName ProvisioningCode
|
||||
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName
|
||||
local Host Port Path EnableEncryption Reference SessionMode PeriodicNotifInterval
|
||||
local dm_ref sec
|
||||
|
||||
@@ -362,10 +362,6 @@ configure_controller()
|
||||
db_set "${BASEPATH}.Enable" "${Enable}"
|
||||
db_set "${BASEPATH}.EndpointID" "${EndpointID}"
|
||||
|
||||
if [ -n "${ProvisioningCode}" ]; then
|
||||
db_set "${BASEPATH}.ProvisioningCode" "${ProvisioningCode}"
|
||||
fi
|
||||
|
||||
if [ -n "${PeriodicNotifInterval}" ]; then
|
||||
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
|
||||
fi
|
||||
@@ -1073,4 +1069,25 @@ reload_service() {
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "obuspa"
|
||||
|
||||
# Create a reload trigger if schema update avaialble
|
||||
procd_open_trigger
|
||||
json_add_array
|
||||
json_add_string "" "bbfdm"
|
||||
json_add_array
|
||||
json_add_string "" "if"
|
||||
json_add_array
|
||||
json_add_string "" "eq"
|
||||
json_add_string "" "action"
|
||||
json_add_string "" "schema_update_available"
|
||||
json_close_array
|
||||
json_add_array
|
||||
json_add_string "" "run_script"
|
||||
json_add_string "" "/etc/init.d/obuspa"
|
||||
json_add_string "" "restart"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
USE_PROCD=1
|
||||
|
||||
log()
|
||||
{
|
||||
echo "$*"|logger -t usptest -p debug
|
||||
}
|
||||
|
||||
get_oui_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
|
||||
get_serial_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.SerialNumber
|
||||
}
|
||||
|
||||
publish_endpoint()
|
||||
{
|
||||
local AgentEndpointID serial oui user pass
|
||||
|
||||
if ! uci -q get obuspa.testmqtt; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# return if mosquitto_pub is not present
|
||||
if [ ! "$(command -v mosquitto_pub)" ]; then
|
||||
log "mosquitto_pub not present can't publish EndpointID"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
# Get endpoint id from obuspa config first
|
||||
config_load obuspa
|
||||
config_get AgentEndpointID localagent EndpointID ""
|
||||
if [ -z "${AgentEndpointID}" ]; then
|
||||
serial=$(get_serial_from_db)
|
||||
oui=$(get_oui_from_db)
|
||||
AgentEndpointID="os::${oui}-${serial//+/%2B}"
|
||||
fi
|
||||
|
||||
config_get user testmqtt Username ""
|
||||
config_get pass testmqtt Password ""
|
||||
|
||||
# publish Agent's EndpointID in mosquito broker for discovery by usp-js
|
||||
# This is a work around till obuspa adds supports for mDNS discovery
|
||||
if [ -n "${user}" ] && [ -n "${pass}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username, password"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}" -P "${pass}"
|
||||
elif [ -n "${user}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username only"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}"
|
||||
else
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance usptest
|
||||
publish_endpoint
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
publish_endpoint
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "mosquitto" "obuspa"
|
||||
}
|
||||
@@ -1,18 +1,7 @@
|
||||
{
|
||||
"roles": [
|
||||
{
|
||||
"name": "full_access",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Untrusted",
|
||||
"name": "admin",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
@@ -24,44 +13,31 @@
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.ProcessStatus.",
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorConfigFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorLogFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.Processor.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -79,289 +55,40 @@
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SoftwareModules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.XMPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_DEL"
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
"PERMIT_GET_INST"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "extender",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SSH.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
"name": "undefined-1"
|
||||
},
|
||||
{
|
||||
"name": "undefined-2"
|
||||
},
|
||||
{
|
||||
"name": "undefined-3"
|
||||
},
|
||||
{
|
||||
"name": "undefined-4"
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_load obuspa
|
||||
config_get interface global interface ""
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" -a -z "$interface" ] ; then
|
||||
uci_set obuspa global interface "lan"
|
||||
fi
|
||||
fi
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
configure_dhcp_options() {
|
||||
local enabled inerface discovery
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get interface global interface "wan"
|
||||
config_get_bool discovery global dhcp_discovery 1
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${discovery}" -eq 1 ]; then
|
||||
network_uci_update=0
|
||||
reqopts="$(uci -q get network."${interface}".reqopts)"
|
||||
proto="$(uci -q get network."${interface}".proto)"
|
||||
local req125_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
sendopts="$(uci -q get network."${interface}".sendopts)"
|
||||
opt124="124:"
|
||||
send124_present=0
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt124"* ]]; then
|
||||
send124_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${interface}".reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send124_present} -eq 0 ]; then
|
||||
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
|
||||
uci -q set network."${interface}".sendopts="$newsendopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${network_uci_update} -eq 1 ]; then
|
||||
uci commit network
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_dhcp_options
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ ! -f "/etc/config/obuspa" ]; then
|
||||
echo "Local obuspa not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/config/mosquitto" ]; then
|
||||
echo "Local mosquitto broker not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
add_obuspa_test_mtp()
|
||||
{
|
||||
uci_add obuspa mtp test_mtp
|
||||
uci_set obuspa test_mtp Protocol 'MQTT'
|
||||
uci_set obuspa test_mtp ResponseTopicConfigured '/usp/endpoint'
|
||||
uci_set obuspa test_mtp mqtt 'testmqtt'
|
||||
}
|
||||
|
||||
add_obuspa_test_mqtt()
|
||||
{
|
||||
# Adds Device.MQTT.Client.
|
||||
uci_add obuspa mqtt testmqtt
|
||||
uci_set obuspa testmqtt BrokerAddress '127.0.0.1'
|
||||
uci_set obuspa testmqtt BrokerPort '1883'
|
||||
uci_set obuspa testmqtt TransportProtocol 'TCP/IP'
|
||||
}
|
||||
|
||||
add_obuspa_test_controller()
|
||||
{
|
||||
# Adds Device.LocalAgent.Controller.
|
||||
uci_add obuspa controller testcontroller
|
||||
uci_set obuspa testcontroller EndpointID 'proto::interop-usp-controller'
|
||||
uci_set obuspa testcontroller Protocol 'MQTT'
|
||||
uci_set obuspa testcontroller Topic '/usp/controller'
|
||||
uci_set obuspa testcontroller mqtt 'testmqtt'
|
||||
uci_set obuspa testcontroller assigned_role_name 'full_access'
|
||||
}
|
||||
|
||||
add_usp_test()
|
||||
{
|
||||
uci_add mosquitto listener usptest
|
||||
uci_set mosquitto usptest enabled 1
|
||||
uci_set mosquitto usptest port '9001'
|
||||
uci_set mosquitto usptest protocol 'websockets'
|
||||
uci_set mosquitto usptest require_certificates '0'
|
||||
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
add_obuspa_config()
|
||||
{
|
||||
uci_add mosquitto listener obuspa
|
||||
uci_set mosquitto obuspa enabled 1
|
||||
uci_set mosquitto obuspa port '1883'
|
||||
uci_set mosquitto obuspa no_remote_access '1'
|
||||
uci_set mosquitto obuspa allow_anonymous '1'
|
||||
}
|
||||
|
||||
# Install test usp controller config
|
||||
uci_load mosquitto
|
||||
add_usp_test
|
||||
add_obuspa_config
|
||||
|
||||
uci_load obuspa
|
||||
add_obuspa_test_mtp
|
||||
add_obuspa_test_mqtt
|
||||
add_obuspa_test_controller
|
||||
@@ -1,314 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
URL=""
|
||||
PROV_CODE=""
|
||||
RETRY_MIN_INTERVAL="5"
|
||||
RETRY_INTERVAL_MUL="2000"
|
||||
ENDPOINT_ID=""
|
||||
|
||||
get_oui_from_db() {
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
|
||||
get_serial_from_db() {
|
||||
db -q get device.deviceinfo.SerialNumber
|
||||
}
|
||||
|
||||
get_vivsoi() {
|
||||
# opt125 environment variable has data in below format
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | enterprise-number1 |
|
||||
# | |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | data-len1 | |
|
||||
# +-+-+-+-+-+-+-+-+ option-data1 |
|
||||
# / /
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|
||||
# | enterprise-number2 | ^
|
||||
# | | |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
||||
# | data-len2 | | optional
|
||||
# +-+-+-+-+-+-+-+-+ option-data2 | |
|
||||
# / / |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
||||
# ~ ... ~ V
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|
||||
|
||||
# Enterprise Id Len Sub Op SLen Data Sub Op SLen Data Sub Op SLen Data
|
||||
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
|
||||
# | id | n | 1 | n1 | D1 | 2 | n2 | D2 | ... | 6 | n6 | D6 |
|
||||
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
|
||||
|
||||
local opt125="$1"
|
||||
local len="$2"
|
||||
local ent_id
|
||||
|
||||
#hex-string 2 character=1 Byte
|
||||
# length in hex string will be twice of actual Byte length
|
||||
[ "$len" -gt "8" ] || return
|
||||
|
||||
data="${opt125}"
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 0 ]; do
|
||||
ent_id=${data:0:8}
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
|
||||
if [ $ent_id -ne 3561 ]; then
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
[ $opt_len -eq 0 ] && return
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
while [ $sub_data_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${sub_data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# get the value of sub option starting 4 means starting after length
|
||||
sub_opt_val=${sub_data:4:${sub_opt_len}}
|
||||
|
||||
# assign the value found in sub option
|
||||
case "${sub_opt_id}" in
|
||||
"25") URL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"26") PROV_CODE=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"27") RETRY_MIN_INTERVAL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"28") RETRY_INTERVAL_MUL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"29") ENDPOINT_ID=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
esac
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
sub_data_len=$((sub_data_len - sub_opt_end))
|
||||
|
||||
# fetch next sub option hex string
|
||||
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
|
||||
done
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
done
|
||||
}
|
||||
|
||||
get_netmode()
|
||||
{
|
||||
local mode
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
fi
|
||||
|
||||
if [ "$mode" != "extender" ]; then
|
||||
mode="full_access"
|
||||
fi
|
||||
|
||||
echo "$mode"
|
||||
}
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
config_get wan_intf global interface "wan"
|
||||
config_get_bool dhcp_discovery global dhcp_discovery 1
|
||||
|
||||
if [ "$enable_obuspa" = "0" ] || [ "$dhcp_discovery" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt125" ]; then
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
get_vivsoi "$opt125" "$len"
|
||||
fi
|
||||
|
||||
if [ -z "$URL" ] || [ -z "$ENDPOINT_ID" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
proto=""
|
||||
ip=""
|
||||
port=""
|
||||
topic=""
|
||||
is_fqdn=1
|
||||
|
||||
case $URL in
|
||||
ws://*) is_fqdn=0;;
|
||||
wss://*) is_fqdn=0;;
|
||||
mqtt://*) is_fqdn=0;;
|
||||
mqtts://*) is_fqdn=0;;
|
||||
*) is_fqdn=1
|
||||
esac;
|
||||
|
||||
if [ ${is_fqdn} -eq 1 ]; then
|
||||
# This is an FQDN, perform DNS query
|
||||
nslookup -type=a $URL > /tmp/fqdn_ip
|
||||
nslookup -type=ptr $URL > /tmp/fqdn_ptr
|
||||
return 0
|
||||
else
|
||||
proto=$(echo "${URL}" | awk -F: '{print $1}')
|
||||
dest=$(echo "${URL}" | awk -F/ '{print $3}')
|
||||
ip=$(echo "${dest}" | awk -F: '{print $1}')
|
||||
port=$(echo "${dest}" | awk -F: '{print $2}')
|
||||
topic=$(echo "${URL}" | sed 's/^.*:'"${port}"'/\1/g')
|
||||
fi
|
||||
|
||||
offered_proto=""
|
||||
if [ "${proto}" == "mqtt" ] || [ "${proto}" == "mqtts" ]; then
|
||||
offered_proto="MQTT"
|
||||
elif [ "${proto}" == "ws" ] || [ "${proto}" == "wss" ]; then
|
||||
offered_proto="WebSocket"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
uci_change=0
|
||||
mtp_encrypt="0"
|
||||
## Handling of controller section
|
||||
ct_endpoint=$(uci -q get obuspa.dhcpcontroller.EndpointID)
|
||||
ct_proto=$(uci -q get obuspa.dhcpcontroller.Protocol)
|
||||
ct_topic=$(uci -q get obuspa.dhcpcontroller.Topic)
|
||||
ct_enable=$(uci -q get obuspa.dhcpcontroller.Enable)
|
||||
ct_prov=$(uci -q get obuspa.dhcpcontroller.ProvisioningCode)
|
||||
|
||||
if [ "${ct_endpoint}" != "${ENDPOINT_ID}" ] || [ "${ct_proto}" != "${offered_proto}" ] || [ "${ct_topic}" != "${topic}" ] || [ "${ct_enable}" != "1" ] || [ "${ct_prov}" != "${PROV_CODE}" ]; then
|
||||
uci -q del obuspa.dhcpcontroller
|
||||
sec=$(uci -q add obuspa controller)
|
||||
uci -q rename obuspa."${sec}"='dhcpcontroller'
|
||||
uci -q set obuspa.dhcpcontroller.EndpointID="${ENDPOINT_ID}"
|
||||
uci -q set obuspa.dhcpcontroller.ProvisioningCode="${PROV_CODE}"
|
||||
uci -q set obuspa.dhcpcontroller.Protocol="${offered_proto}"
|
||||
if [ "${offered_proto}" == "MQTT" ]; then
|
||||
uci -q set obuspa.dhcpcontroller.Topic="${topic}"
|
||||
uci -q set obuspa.dhcpcontroller.mqtt='dhcpmqtt'
|
||||
else
|
||||
uci -q set obuspa.dhcpcontroller.Path="${topic}"
|
||||
uci -q set obuspa.dhcpcontroller.Host="${ip}"
|
||||
uci -q set obuspa.dhcpcontroller.Port="${port}"
|
||||
if [ "${proto}" == "wss" ]; then
|
||||
uci -q set obuspa.dhcpcontroller.EnableEncryption='1'
|
||||
mtp_encrypt="1"
|
||||
else
|
||||
uci -q set obuspa.dhcpcontroller.EnableEncryption='0'
|
||||
mtp_encrypt="0"
|
||||
fi
|
||||
fi
|
||||
|
||||
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_netmode)"
|
||||
uci -q set obuspa.dhcpcontroller.Enable='1'
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
if [ "${offered_proto}" == "WebSocket" ]; then
|
||||
ex_mqtt=$(uci -q get obuspa.dhcpmqtt)
|
||||
if [ -n "${ex_mqtt}" ]; then
|
||||
uci -q del obuspa.dhcpmqtt
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
## Handling of mtp section
|
||||
ct_proto=$(uci -q get obuspa.dhcpmtp.Protocol)
|
||||
ct_port=$(uci -q get obuspa.dhcpmtp.Port)
|
||||
ct_enable=$(uci -q get obuspa.dhcpmtp.Enable)
|
||||
ct_encrypt=$(uci -q get obuspa.dhcpmtp.EnableEncryption)
|
||||
|
||||
if [ "${ct_proto}" != "WebSocket" ] || [ "${ct_port}" != "${port}" ] || [ "${ct_enable}" != "1" ] || [ "${ct_encrypt}" != "${mtp_encrypt}" ]; then
|
||||
uci -q del obuspa.dhcpmtp
|
||||
sec=$(uci -q add obuspa mtp)
|
||||
uci -q rename obuspa."${sec}"='dhcpmtp'
|
||||
uci -q set obuspa.dhcpmtp.Protocol='WebSocket'
|
||||
uci -q set obuspa.dhcpmtp.Port="${port}"
|
||||
uci -q set obuspa.dhcpmtp.Enable='1'
|
||||
uci -q set obuspa.dhcpmtp.EnableEncryption="${mtp_encrypt}"
|
||||
uci_change=1
|
||||
fi
|
||||
else
|
||||
if [ "${proto}" == "mqtt" ]; then
|
||||
transport_proto="TCP/IP"
|
||||
else
|
||||
transport_proto="TLS"
|
||||
fi
|
||||
|
||||
## Handling of mqtt section
|
||||
ct_address=$(uci -q get obuspa.dhcpmqtt.BrokerAddress)
|
||||
ct_port=$(uci -q get obuspa.dhcpmqtt.BrokerPort)
|
||||
ct_proto=$(uci -q get obuspa.dhcpmqtt.TransportProtocol)
|
||||
ct_enable=$(uci -q get obuspa.dhcpmqtt.Enable)
|
||||
ct_ver=$(uci -q get obuspa.dhcpmqtt.ProtocolVersion)
|
||||
|
||||
if [ "${ct_address}" != "${ip}" ] || [ "${ct_port}" != "${port}" ] || [ "${ct_proto}" != "${transport_proto}" ] || [ "${ct_enable}" != "1" ] || [ "${ct_ver}" != "5.0" ]; then
|
||||
uci -q del obuspa.dhcpmqtt
|
||||
sec=$(uci -q add obuspa mqtt)
|
||||
uci -q rename obuspa."${sec}"='dhcpmqtt'
|
||||
uci -q set obuspa.dhcpmqtt.BrokerAddress="${ip}"
|
||||
uci -q set obuspa.dhcpmqtt.BrokerPort="${port}"
|
||||
uci -q set obuspa.dhcpmqtt.TransportProtocol="${transport_proto}"
|
||||
uci -q set obuspa.dhcpmqtt.Enable='1'
|
||||
uci -q set obuspa.dhcpmqtt.ProtocolVersion='5.0'
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
## Handling of mtp section
|
||||
ct_proto=$(uci -q get obuspa.dhcpmtp.Protocol)
|
||||
ct_topic=$(uci -q get obuspa.dhcpmtp.ResponseTopicConfigured)
|
||||
ct_enable=$(uci -q get obuspa.dhcpmtp.Enable)
|
||||
|
||||
config_load obuspa
|
||||
config_get AgentEndpointID localagent EndpointID ""
|
||||
if [ -z "${AgentEndpointID}" ]; then
|
||||
serial=$(get_serial_from_db)
|
||||
oui=$(get_oui_from_db)
|
||||
AgentEndpointID=$(echo "${oui}-${serial//+/%2B}")
|
||||
fi
|
||||
|
||||
topic_base=$(echo "${AgentEndpointID}" | sed -E 's/[^[:alnum:]]/_/g')
|
||||
agent_topic="/usp/${topic_base}/endpoint"
|
||||
|
||||
if [ "${ct_proto}" != "MQTT" ] || [ "${ct_topic}" != "${agent_topic}" ] || [ "${ct_enable}" != "1" ]; then
|
||||
uci -q del obuspa.dhcpmtp
|
||||
sec=$(uci -q add obuspa mtp)
|
||||
uci -q rename obuspa."${sec}"='dhcpmtp'
|
||||
uci -q set obuspa.dhcpmtp.Protocol='MQTT'
|
||||
uci -q set obuspa.dhcpmtp.ResponseTopicConfigured="${agent_topic}"
|
||||
uci -q set obuspa.dhcpmtp.Enable='1'
|
||||
uci -q set obuspa.dhcpmtp.mqtt='dhcpmqtt'
|
||||
uci_change=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${uci_change} -eq 1 ]; then
|
||||
ubus call uci commit '{"config":"obuspa"}'
|
||||
fi
|
||||
fi
|
||||
@@ -20,7 +20,7 @@
|
||||
void DM_PRIV_RequestInit(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst);
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -902,6 +902,20 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
@@ -893,6 +893,20 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/core/data_model.c
|
||||
+++ b/src/core/data_model.c
|
||||
@@ -1243,7 +1243,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
@@ -1242,7 +1242,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
// Exit if instance already exists - nothing to do
|
||||
if (exists)
|
||||
{
|
||||
@@ -9,7 +9,7 @@
|
||||
return USP_ERR_CREATION_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1328,7 +1328,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
@@ -1327,7 +1327,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
// Exit if instance does not exist - nothing to do
|
||||
if (exists == false)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
diff --git a/src/core/data_model.c b/src/core/data_model.c
|
||||
index 2cf4b6c..b92cf59 100644
|
||||
--- a/src/core/data_model.c
|
||||
+++ b/src/core/data_model.c
|
||||
@@ -137,6 +137,7 @@ int GetVendorParam(dm_node_t *node, char
|
||||
@@ -136,6 +136,7 @@ void DumpDataModelNodeMap(void);
|
||||
int GetVendorParam(dm_node_t *node, char *path, dm_instances_t *inst, char *buf, int len, dm_req_t *req);
|
||||
int SetVendorParam(dm_node_t *node, char *path, dm_instances_t *inst, char *value, dm_req_t *req);
|
||||
double_link_t *FindLinkToFirstObject(double_linked_list_t *list);
|
||||
|
||||
+extern bool is_running_cli_local_command;
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DATA_MODEL_Init
|
||||
@@ -224,7 +225,9 @@ int DATA_MODEL_Init(void)
|
||||
@@ -223,7 +224,9 @@ int DATA_MODEL_Init(void)
|
||||
}
|
||||
|
||||
// Set the default values of OUI, Serial Number and (LocalAgent) EndpointID, and cache EndpointID
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspc
|
||||
PKG_VERSION:=1.0.1.5
|
||||
PKG_VERSION:=1.0.1.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa-test-controller.git
|
||||
PKG_SOURCE_VERSION:=61f14c5a1fba8c251cf1cfb18c163eab62d5674d
|
||||
PKG_SOURCE_VERSION:=f1f721bc1a4feaf63c7f7837eb7b0c86111e2f71
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -63,12 +63,10 @@ define Package/obuspc/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspc $(1)/usr/sbin/uspc
|
||||
$(INSTALL_BIN) ./files/etc/init.d/uspc $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/50-disable-on-extender $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspc $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspc $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-fix-agent-endpoint $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/100-add-mosquitto-listener $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/etc/config/uspc $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspc $(1)/etc/config/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspc))
|
||||
|
||||
19
obuspc/files/etc/config/obuspc
Normal file
19
obuspc/files/etc/config/obuspc
Normal file
@@ -0,0 +1,19 @@
|
||||
config obuspc 'global'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option log_level '1'
|
||||
option prototrace '1'
|
||||
|
||||
config mqtt 'mqtt'
|
||||
option BrokerAddress '127.0.0.1'
|
||||
option BrokerPort '1883'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
|
||||
config controller 'controller'
|
||||
option EndpointID 'proto::interop-usp-controller'
|
||||
option Protocol 'MQTT'
|
||||
option ResponseTopicConfigured '/usp/controller'
|
||||
option mqtt 'mqtt'
|
||||
|
||||
config agent 'agent'
|
||||
option Topic '/usp/endpoint'
|
||||
@@ -1,24 +0,0 @@
|
||||
config global 'global'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option log_level '1'
|
||||
option prototrace '0'
|
||||
|
||||
config mqtt 'mqtt'
|
||||
option BrokerAddress '127.0.0.1'
|
||||
option BrokerPort '9006'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
|
||||
config controller 'controller'
|
||||
option EndpointID 'proto::discovery-usp-controller'
|
||||
option Protocol 'MQTT'
|
||||
option ResponseTopicConfigured '/usp/discovery/controller'
|
||||
option mqtt 'mqtt'
|
||||
|
||||
config proxy 'usp'
|
||||
option protocol 'USP'
|
||||
option parent_dm 'Device.'
|
||||
option mount_point 'Node'
|
||||
|
||||
config agent 'agent'
|
||||
option Topic '/usp/endpoint'
|
||||
@@ -4,17 +4,16 @@ START=99
|
||||
STOP=01
|
||||
USE_PROCD=1
|
||||
|
||||
PROG=/usr/sbin/uspc
|
||||
CONFIGURATION=uspc
|
||||
PROG=/usr/sbin/obuspc
|
||||
CONFIGURATION=obuspc
|
||||
|
||||
RESET_FILE="/tmp/usp/uspc_param_reset.txt"
|
||||
RESET_FILE="/tmp/usp/obuspc_param_reset.txt"
|
||||
SQL_DB_FILE="/tmp/usp/uspc.db"
|
||||
|
||||
BASEPATH=""
|
||||
INSTANCE_COUNT=0
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
global_init()
|
||||
{
|
||||
@@ -24,7 +23,7 @@ global_init()
|
||||
|
||||
log()
|
||||
{
|
||||
echo "$*"|logger -t uspc.init -p debug
|
||||
echo "$*"|logger -t obuspc.init -p debug
|
||||
}
|
||||
|
||||
db_set_reset_file()
|
||||
@@ -79,264 +78,9 @@ get_refrence_path()
|
||||
echo "${path}"
|
||||
}
|
||||
|
||||
convert_to_hex() {
|
||||
local val=""
|
||||
local optval="${1}"
|
||||
OPTIND=1
|
||||
while getopts ":" opt "-$optval"
|
||||
do
|
||||
temp=$(printf "%02X" "'${OPTARG:-:}")
|
||||
val="${val}:${temp}"
|
||||
done
|
||||
|
||||
echo "${val}"
|
||||
}
|
||||
|
||||
check_for_suboptions() {
|
||||
new_opt=""
|
||||
# Check if option 25 and 29 present inside enterprise id 3561
|
||||
data=$(echo "${1}" | sed 's/://g')
|
||||
len=$(printf "${data}"|wc -c)
|
||||
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 8 ]; do
|
||||
subopt_present=0
|
||||
|
||||
ent_id="${data:0:8}"
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
if [ $ent_id -ne 3561 ]; then
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
opt=${data:0:"${data_len}"}
|
||||
if [ -n "${new_opt}" ]; then
|
||||
new_opt="${new_opt}:$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
else
|
||||
new_opt="$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
fi
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
len_val=${data:8:2}
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
if [ $opt_len -eq 0 ]; then
|
||||
echo "${new_opt}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
while [ $sub_data_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${sub_data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
case "${sub_opt_id}" in
|
||||
"25") subopt_present=1
|
||||
;;
|
||||
"26") subopt_present=1
|
||||
;;
|
||||
"27") subopt_present=1
|
||||
;;
|
||||
"28") subopt_present=1
|
||||
;;
|
||||
"29") subopt_present=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ $subopt_present -eq 1 ]; then
|
||||
break;
|
||||
fi
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
sub_data_len=$((sub_data_len - sub_opt_end))
|
||||
|
||||
# fetch next sub option hex string
|
||||
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
|
||||
done
|
||||
|
||||
if [ $subopt_present -eq 1 ]; then
|
||||
# move ahead data to next enterprise id
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
else
|
||||
opt=${data:0:"${data_len}"}
|
||||
if [ -n "${new_opt}" ]; then
|
||||
new_opt="${new_opt}:$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
else
|
||||
new_opt="$(echo ${opt} | sed 's/../&:/g;s/:$//')"
|
||||
fi
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${new_opt}"
|
||||
}
|
||||
|
||||
configure_dnsmasq_op125() {
|
||||
intf="${1}"
|
||||
|
||||
endpoint=""
|
||||
proto=""
|
||||
address=""
|
||||
port=""
|
||||
topic=""
|
||||
prov_code="obusp-client"
|
||||
interval="5"
|
||||
multiplier="2000"
|
||||
|
||||
config_load ${CONFIGURATION}
|
||||
config_get endpoint controller EndpointID
|
||||
config_get proto controller Protocol
|
||||
if [ -z "${endpoint}" ] || [ -z "${proto}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${proto}" = "MQTT" ]; then
|
||||
config_get port mqtt BrokerPort "1883"
|
||||
config_get topic controller ResponseTopicConfigured
|
||||
proto="mqtt://"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
address=$(ifstatus "${intf}" | jsonfilter -q -e '@["ipv4-address"][0].address')
|
||||
if [ -z "${address}" ] || [ -z "${topic}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
subop_present=0
|
||||
opt125="125,"
|
||||
base_opt=""
|
||||
|
||||
service="$(uci -q get dhcp."${intf}".dhcpv4)"
|
||||
if [ "${service}" = "server" ]; then
|
||||
opt_list="$(uci -q get dhcp."${intf}".dhcp_option)"
|
||||
for sopt in $opt_list; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
base_opt=$(check_for_suboptions "${sopt:4}")
|
||||
uci -q del_list dhcp."${intf}".dhcp_option="$sopt"
|
||||
uci -q commit dhcp
|
||||
break
|
||||
fi
|
||||
done
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${base_opt}" ]; then
|
||||
opt125="125,00:00:0D:E9"
|
||||
else
|
||||
opt125="125,${base_opt}:00:00:0D:E9"
|
||||
fi
|
||||
|
||||
url="${proto}${address}:${port}${topic}"
|
||||
url_len=$(echo -n "${url}" | wc -m)
|
||||
prov_code_len=$(echo -n "${prov_code}" | wc -m)
|
||||
endpoint_len=$(echo -n "${endpoint}" | wc -m)
|
||||
interval_len=$(echo -n "${interval}" | wc -m)
|
||||
multiplier_len=$(echo -n "${multiplier}" | wc -m)
|
||||
|
||||
([ ${url_len} -gt 255 ] || [ ${prov_code_len} -gt 255 ] || [ ${endpoint_len} -gt 255 ]) && return 0
|
||||
([ ${interval_len} -gt 255 ] || [ ${multiplier_len} -gt 255 ]) && return 0
|
||||
|
||||
opt125_len=$((url_len + prov_code_len + endpoint_len + interval_len + multiplier_len))
|
||||
opt125_len=$((opt125_len + 10))
|
||||
|
||||
[ $opt125_len -gt 255 ] && return 0
|
||||
|
||||
hex_opt125_len=$(printf "%02X" "${opt125_len}")
|
||||
opt125="${opt125}:${hex_opt125_len}"
|
||||
hex_url=$(convert_to_hex "${url}")
|
||||
if [ -z "${hex_url}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_url_len=$(printf "%02X" "${url_len}")
|
||||
opt125="${opt125}:19:${hex_url_len}${hex_url}"
|
||||
|
||||
hex_prov_code=$(convert_to_hex "${prov_code}")
|
||||
if [ -z "${hex_prov_code}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_prov_len=$(printf "%02X" "${prov_code_len}")
|
||||
opt125="${opt125}:1A:${hex_prov_len}${hex_prov_code}"
|
||||
|
||||
hex_interval=$(convert_to_hex "${interval}")
|
||||
if [ -z "${hex_interval}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_interval_len=$(printf "%02X" "${interval_len}")
|
||||
opt125="${opt125}:1B:${hex_interval_len}${hex_interval}"
|
||||
|
||||
hex_multiplier=$(convert_to_hex "${multiplier}")
|
||||
if [ -z "${hex_multiplier}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_multiplier_len=$(printf "%02X" "${multiplier_len}")
|
||||
opt125="${opt125}:1C:${hex_multiplier_len}${hex_multiplier}"
|
||||
|
||||
hex_endpoint=$(convert_to_hex "${endpoint}")
|
||||
if [ -z "${hex_endpoint}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_endpoint_len=$(printf "%02X" "${endpoint_len}")
|
||||
opt125="${opt125}:1D:${hex_endpoint_len}${hex_endpoint}"
|
||||
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$opt125"
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
}
|
||||
|
||||
boot() {
|
||||
local enabled
|
||||
local interface
|
||||
|
||||
config_load ${CONFIGURATION}
|
||||
config_get_bool enabled global enabled 0
|
||||
config_get interface global interface "lan"
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
configure_dnsmasq_op125 "${interface}"
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
validate_global_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} uspc "${1}" \
|
||||
uci_validate_section ${CONFIGURATION} obuspc "${1}" \
|
||||
'enabled:bool:1' \
|
||||
'debug:bool:0' \
|
||||
'prototrace:bool:0' \
|
||||
@@ -513,7 +257,7 @@ configure_mqtt_client() {
|
||||
db_set
|
||||
}
|
||||
|
||||
configure_uspc() {
|
||||
configure_obuspc() {
|
||||
local enabled trust_cert ifname interface debug prototrace log_level db_file log_dest
|
||||
local client_cert
|
||||
|
||||
@@ -573,7 +317,7 @@ register_service()
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
procd_set_param command ${PROG}
|
||||
|
||||
configure_uspc
|
||||
configure_obuspc
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
@@ -582,7 +326,7 @@ register_service()
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled mode
|
||||
local enabled
|
||||
|
||||
config_load ${CONFIGURATION}
|
||||
config_get_bool enabled global enabled 0
|
||||
@@ -600,11 +344,6 @@ stop_service() {
|
||||
${PROG} -c stop >/dev/null 2>&1
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "uspc"
|
||||
procd_add_reload_trigger "obuspc"
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# exit if running in an extender
|
||||
enabled="$(uci -q get uspc.global.enabled)"
|
||||
if [ "$enabled" -eq 0 ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
section_exist=$(uci -q get mosquitto.uspc)
|
||||
if [ -z "${section_exist}" ]; then
|
||||
uci set mosquitto.uspc=listener
|
||||
fi
|
||||
|
||||
port=$(uci -q get uspc.mqtt.BrokerPort)
|
||||
uci -q set mosquitto.uspc.enabled="1"
|
||||
uci -q set mosquitto.uspc.port=$port
|
||||
uci -q set mosquitto.uspc.allow_anonymous="1"
|
||||
uci commit mosquitto
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" ]; then
|
||||
uci set uspc.global.enabled=0
|
||||
uci commit uspc
|
||||
fi
|
||||
@@ -2,12 +2,6 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
# exit if running in an extender
|
||||
enabled="$(uci -q get uspc.global.enabled)"
|
||||
if [ "$enabled" -eq 0 ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
get_oui_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
@@ -31,7 +25,7 @@ fix_agent_endpoint()
|
||||
AgentEndpointID="os::${oui}-${serial//+/%2B}"
|
||||
fi
|
||||
|
||||
uci -q set uspc.agent.EndpointID="${AgentEndpointID}"
|
||||
uci -q set obuspc.agent.EndpointID="${AgentEndpointID}"
|
||||
}
|
||||
|
||||
fix_agent_endpoint
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.5.2
|
||||
PKG_VERSION:=1.4.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=375c71ebaabffa2e47aa37a04e072232492eff25
|
||||
PKG_SOURCE_VERSION:=415b7b59d7cd84cb133b20e27eca63a8cd74a155
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -42,9 +42,10 @@ define Package/periodicstats/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/periodicstatsd $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/periodicstats
|
||||
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/etc/periodicstats
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,periodicstats))
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=61
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/periodicstatsd"
|
||||
PERIODICSTATS_JSON_INPUT="/etc/periodicstats/input.json"
|
||||
PROG=/usr/sbin/periodicstatsd
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
|
||||
config_load periodicstats
|
||||
config_get_bool enable globals enable 1
|
||||
|
||||
bbfdm_add_service "bbfdm.periodicstats" "${PERIODICSTATS_JSON_INPUT}"
|
||||
|
||||
if [ "${enable}" -ne "1" ]; then
|
||||
return 0;
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/periodicstats/libperiodicstats.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.periodicstats",
|
||||
"parent_dm": "Device.",
|
||||
"object": "PeriodicStatistics",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,39 +11,6 @@ set_serial_number() {
|
||||
/userfs/bin/omcicfgCmd set sn ${vendor_id}${vssn}
|
||||
}
|
||||
|
||||
set_equipment_id() {
|
||||
local eqid=$1
|
||||
local eq_id_default="KE2.119.241R2B"
|
||||
|
||||
if [ -z "$eqid" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$eqid" = "$eq_id_default" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
/userfs/bin/omcicfgCmd set equipmentId ${eqid}
|
||||
}
|
||||
|
||||
set_loid_authentication() {
|
||||
local loid=$1
|
||||
local loid_pwd=$2
|
||||
|
||||
[ -z "$loid" ] && return
|
||||
|
||||
/userfs/bin/omcicfgCmd set loid ${loid}
|
||||
|
||||
if [ -n "$loid_pwd" ]; then
|
||||
/userfs/bin/omcicfgCmd set loid_password ${loid_pwd}
|
||||
fi
|
||||
}
|
||||
|
||||
apply_xpon_uci_config() {
|
||||
configure_loid_authentication
|
||||
configure_equipment_id
|
||||
}
|
||||
|
||||
init_xpon() {
|
||||
# don't start pon daemons if xpon module is not loaded
|
||||
[ -d /sys/module/xpon ] || return
|
||||
|
||||
@@ -12,35 +12,11 @@ set_serial_number() {
|
||||
bs /b/c gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vssn}
|
||||
}
|
||||
|
||||
set_equipment_id() {
|
||||
equipment_id=$1
|
||||
[ -z "$equipment_id" ] && return
|
||||
|
||||
json_add_string "equipment_id" $equipment_id
|
||||
}
|
||||
|
||||
set_loid_authentication() {
|
||||
loid=$1
|
||||
loid_password=$2
|
||||
[ -z "$loid" ] && return
|
||||
|
||||
json_add_string "loid" $loid
|
||||
json_add_string "loid_password" $loid_password
|
||||
}
|
||||
|
||||
apply_xpon_uci_config() {
|
||||
|
||||
json_init
|
||||
json_add_object 'ani'
|
||||
sn="$(uci -q get xpon.ani.serial_number)"
|
||||
json_add_string "serial_number" $sn
|
||||
configure_loid_authentication
|
||||
configure_equipment_id
|
||||
json_close_object
|
||||
json_dump > /tmp/xpon.json
|
||||
}
|
||||
|
||||
init_xpon() {
|
||||
procd_open_instance pon_msgd
|
||||
procd_set_param command bcm_msgd -c gpon
|
||||
procd_close_instance
|
||||
|
||||
procd_open_instance pon_daemon
|
||||
procd_set_param command omcid start -n
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -27,7 +27,6 @@ configure_serial_number() {
|
||||
start_service() {
|
||||
if [ "$(uci -q get xpon.ani.enable)" == "1" ]; then
|
||||
configure_serial_number
|
||||
apply_xpon_uci_config
|
||||
init_xpon
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -14,28 +14,6 @@ configure_serial_number() {
|
||||
fi
|
||||
}
|
||||
|
||||
configure_loid_authentication() {
|
||||
local production_loid
|
||||
local production_loidpwd
|
||||
|
||||
loid="$(uci -q get xpon.ani.loid)"
|
||||
loidpwd="$(uci -q get xpon.ani.loid_password)"
|
||||
if [ -z $loid ]; then
|
||||
production_loid="$(fw_printenv -n gponloid)"
|
||||
fi
|
||||
if [ -z $loidpwd ]; then
|
||||
production_loidpwd="$(fw_printenv -n gponloid_password)"
|
||||
fi
|
||||
|
||||
if [ -n $production_loid ]; then
|
||||
uci set xpon.ani.loid=$production_loid
|
||||
fi
|
||||
if [ -n $production_loidpwd ]; then
|
||||
uci set xpon.ani.loid_password=$production_loidpwd
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/xpon" ]; then
|
||||
if uci -q get xpon.ani >/dev/null; then
|
||||
# generate serial number in case its not present and return
|
||||
@@ -43,7 +21,6 @@ if [ -s "/etc/config/xpon" ]; then
|
||||
if [ ${#serial_number} -ne 12 ]; then
|
||||
configure_serial_number
|
||||
fi
|
||||
configure_loid_authentication
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/xpon
|
||||
@@ -54,5 +31,4 @@ touch /etc/config/xpon
|
||||
uci set xpon.ani=ani
|
||||
uci set xpon.ani.enable="1"
|
||||
configure_serial_number
|
||||
configure_loid_authentication
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
configure_equipment_id() {
|
||||
eqid="$(uci -q get xpon.ani.equipment_id)"
|
||||
set_equipment_id $eqid
|
||||
}
|
||||
|
||||
configure_loid_authentication() {
|
||||
loid="$(uci -q get xpon.ani.loid)"
|
||||
loid_pwd="$(uci -q get xpon.ani.loid_password)"
|
||||
set_loid_authentication $loid $loid_pwd
|
||||
}
|
||||
|
||||
@@ -911,7 +911,6 @@
|
||||
},
|
||||
"PONMode": {
|
||||
"type": "string",
|
||||
"default": "Unknown",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
@@ -929,7 +928,6 @@
|
||||
},
|
||||
"Connector": {
|
||||
"type": "string",
|
||||
"default": "Unknown",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
|
||||
@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.0.7
|
||||
PKG_VERSION:=1.0.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4179d88a94d8d5989c67504228f9d61ec8a57aac
|
||||
PKG_SOURCE_VERSION:=2e6d5650cb30e5ae4cc47c1fb9d85b48c49e6100
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -15,25 +15,6 @@ SP_Q_PRIO=7
|
||||
cfg_name=""
|
||||
cfg_type=""
|
||||
|
||||
get_port_number() {
|
||||
[ -z "$1" ] && return
|
||||
local ports="0 1 2 3 4 5 6 7 8"
|
||||
local units="0 1"
|
||||
local port="$1"
|
||||
local prt
|
||||
local ifname
|
||||
|
||||
for unit in $units; do
|
||||
for prt in $ports; do
|
||||
ifname="$(ethswctl getifname $unit $prt 2>/dev/null | awk '{print$NF}')"
|
||||
if [ "$ifname" == "$port" ]; then
|
||||
echo "$unit $prt"
|
||||
return
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
get_rate_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/qos/qos.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
ethwan="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
cpu_model="$(cat /proc/socinfo | grep 'SoC Name' | cut -d':' -f2)"
|
||||
queue_num=8
|
||||
|
||||
populate_no_of_queue(){
|
||||
@@ -18,13 +17,28 @@ populate_no_of_queue(){
|
||||
}
|
||||
|
||||
generate_queue(){
|
||||
local ifname="$1"
|
||||
local no_of_q="$2"
|
||||
section="$1"
|
||||
|
||||
local i=0
|
||||
config_get ifname "$section" "ifname"
|
||||
|
||||
local is_lan=0
|
||||
queue_num=$(qosmngr -q $ifname)
|
||||
|
||||
if [ "$ifname" != "$ethwan" ]; then
|
||||
is_lan=1
|
||||
populate_no_of_queue $queue_num
|
||||
fi
|
||||
|
||||
local no_of_q="0 1 2 3 4 5 6 7"
|
||||
|
||||
if [ $is_lan -eq 1 ] && [ $queue_num -eq 4 ]; then
|
||||
no_of_q="0 1 2 3"
|
||||
fi
|
||||
|
||||
i=0
|
||||
local total_q=$((${no_of_q##* } + 1))
|
||||
for i in $no_of_q; do
|
||||
local order=$((total_q - i))
|
||||
order=$((total_q - i))
|
||||
uci add qos queue
|
||||
uci rename qos.@queue[-1]="q_${i}_${ifname}"
|
||||
uci set qos.@queue[-1].enable="1"
|
||||
@@ -39,31 +53,8 @@ generate_queue(){
|
||||
uci commit qos
|
||||
}
|
||||
|
||||
generate_wan_queues() {
|
||||
local ifname="$1"
|
||||
local no_of_q="0 1 2 3 4 5 6 7"
|
||||
|
||||
generate_queue "$ifname" "$no_of_q"
|
||||
}
|
||||
|
||||
generate_lan_queues() {
|
||||
local ifname="$1"
|
||||
local no_of_q="0 1 2 3 4 5 6 7"
|
||||
|
||||
queue_num=$(qosmngr -q $ifname)
|
||||
|
||||
populate_no_of_queue $queue_num
|
||||
|
||||
if [ $queue_num -eq 4 ]; then
|
||||
no_of_q="0 1 2 3"
|
||||
fi
|
||||
|
||||
generate_queue "$ifname" "$no_of_q"
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/qos" ]; then
|
||||
if uci -q get qos.@queue[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/qos
|
||||
@@ -71,22 +62,7 @@ if [ -s "/etc/config/qos" ]; then
|
||||
fi
|
||||
touch /etc/config/qos
|
||||
|
||||
lan_ports=""
|
||||
wan_port=""
|
||||
# generate qos queue config
|
||||
config_load ports
|
||||
config_foreach generate_queue ethport
|
||||
|
||||
json_init
|
||||
json_load_file /etc/board.json
|
||||
json_select network
|
||||
json_select lan
|
||||
if json_is_a ports array; then
|
||||
json_for_each_item "generate_lan_queues" "ports"
|
||||
else
|
||||
json_get_var lan_device device
|
||||
[ -n "$lan_device" ] && generate_lan_queues "$lan_device"
|
||||
fi
|
||||
|
||||
json_select ..
|
||||
json_select wan 2>/dev/null
|
||||
json_get_var wan_port device
|
||||
[ -n "$wan_port" ] && generate_wan_queues "$wan_port"
|
||||
json_cleanup
|
||||
|
||||
@@ -389,13 +389,13 @@ handle_ebtables_rules() {
|
||||
}
|
||||
|
||||
create_ebtables_chains() {
|
||||
ebtables -t broute -N qos 2> /dev/null
|
||||
ebtables -t broute -N qos
|
||||
ret=$?
|
||||
if [ $ret -eq 0 ]; then
|
||||
ebtables -t broute -A BROUTING -j qos
|
||||
ebtables -t broute -I BROUTING -j qos
|
||||
else
|
||||
ebtables -t broute -D BROUTING -j qos
|
||||
ebtables -t broute -A BROUTING -j qos
|
||||
ebtables -t broute -I BROUTING -j qos
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user