mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-26 03:53:58 +08:00
Compare commits
109 Commits
kenjo_open
...
libeasy
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69fbaebca5 | ||
|
|
56d540050f | ||
|
|
81f449d288 | ||
|
|
167cdf8053 | ||
|
|
da53a2ef34 | ||
|
|
d86322a1a7 | ||
|
|
be83b9b677 | ||
|
|
e247f50a38 | ||
|
|
b71d08d543 | ||
|
|
550c0aa4b5 | ||
|
|
5c7962b353 | ||
|
|
67a4246293 | ||
|
|
3fbd6315a4 | ||
|
|
4143aeb032 | ||
|
|
f965eb801e | ||
|
|
5bfe6638e5 | ||
|
|
21c21bf609 | ||
|
|
abd2e29a85 | ||
|
|
c0931baab2 | ||
|
|
d515462ba9 | ||
|
|
2573d76b4e | ||
|
|
e15f018362 | ||
|
|
927bad6225 | ||
|
|
bdcc74dca4 | ||
|
|
d984398317 | ||
|
|
b78bb9d152 | ||
|
|
a652b67d04 | ||
|
|
0f85c77d41 | ||
|
|
2a2d942329 | ||
|
|
db2cbd0db2 | ||
|
|
210bbb570b | ||
|
|
b4f129d582 | ||
|
|
34548bd901 | ||
|
|
fe47b9a923 | ||
|
|
0edeb78d60 | ||
|
|
05b8383f62 | ||
|
|
3a6d301cfe | ||
|
|
44bf5a6c33 | ||
|
|
0f744a5cda | ||
|
|
a8c7c8989f | ||
|
|
f14dc75e71 | ||
|
|
a218fa0130 | ||
|
|
d21057904b | ||
|
|
69aaece76b | ||
|
|
167bfd2e49 | ||
|
|
5ac828fc16 | ||
|
|
da92efc708 | ||
|
|
ba98d3e7aa | ||
|
|
019a02fa7f | ||
|
|
42d496107e | ||
|
|
549378ecbd | ||
|
|
c0bef6ce70 | ||
|
|
97853638bf | ||
|
|
a968641bd1 | ||
|
|
e7c8c56819 | ||
|
|
f4b1bf345c | ||
|
|
6d212ecea3 | ||
|
|
444a5a0c82 | ||
|
|
b2fce09a7f | ||
|
|
6fe9ad271e | ||
|
|
7677e51aeb | ||
|
|
9724913f14 | ||
|
|
99925c9360 | ||
|
|
621ca1c23a | ||
|
|
316e7d1d47 | ||
|
|
8ebe2c7f5a | ||
|
|
0b4be48bf3 | ||
|
|
f680ff2229 | ||
|
|
60034eab91 | ||
|
|
6d539c17a7 | ||
|
|
2c06bbeaf0 | ||
|
|
d36147601b | ||
|
|
cb3c2d4b0e | ||
|
|
e11950b9a1 | ||
|
|
901c2df5cf | ||
|
|
504621b64b | ||
|
|
916ac0eea7 | ||
|
|
d7859ebe06 | ||
|
|
c96e9c170a | ||
|
|
9cb726d649 | ||
|
|
c3bb2895dc | ||
|
|
f9f19d1e0c | ||
|
|
df03c86b1d | ||
|
|
72aba70aaf | ||
|
|
09e20e451a | ||
|
|
743a9fb0ac | ||
|
|
605d816076 | ||
|
|
7319e7d6aa | ||
|
|
e89954c0c0 | ||
|
|
dcc6644b6e | ||
|
|
26a5a54673 | ||
|
|
a5d00e28d6 | ||
|
|
d5ab22bcbf | ||
|
|
31f5f9b017 | ||
|
|
055489fb21 | ||
|
|
3b09d142d9 | ||
|
|
96909bca38 | ||
|
|
31b38d98ec | ||
|
|
f18405e303 | ||
|
|
6973cf5f63 | ||
|
|
b9c5aaa012 | ||
|
|
a4c5bde955 | ||
|
|
66ed795149 | ||
|
|
9268a2960e | ||
|
|
ee9f652942 | ||
|
|
100b91d3d5 | ||
|
|
e58a80228d | ||
|
|
9f21e1568a | ||
|
|
71f340a122 |
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*/
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
@@ -16,6 +16,10 @@ config BBF_TR143
|
||||
bool "Compile with tr143 diagnostics features"
|
||||
default y
|
||||
|
||||
config BBF_TR157
|
||||
bool "Compile with tr157 bulkdata collector features"
|
||||
default y
|
||||
|
||||
config BBF_TR064
|
||||
bool "Compile with tr064 features"
|
||||
default n
|
||||
|
||||
17
bbf/Makefile
17
bbf/Makefile
@@ -1,22 +1,22 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=1.0-2019-09-18
|
||||
PKG_VERSION:=1.0-2019-12-10
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4be7fe3c202e221c4d094de36c8a88126cc47bdf
|
||||
PKG_SOURCE_VERSION:=0ea0b2c89a51ad56ca76d171b7fd5dcf38e102cd
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@@ -56,6 +56,11 @@ CONFIGURE_ARGS += \
|
||||
--enable-tr143
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR157),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr157
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR064),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr064
|
||||
@@ -65,6 +70,7 @@ define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/bbfdm
|
||||
@@ -75,6 +81,7 @@ define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/dmtree/tr181/*.h $(1)/usr/include/libbbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/dmtree/tr157/*.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
@@ -30,7 +30,7 @@ define Package/dectmngr2
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dectmngr2
|
||||
URL:=
|
||||
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus +libpicoevent
|
||||
DEPENDS:= +natalie-dect-h +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen @(PACKAGE_bcmkernel||PACKAGE_bcmopen) +libubox +ubus +libpicoevent endptmngr
|
||||
endef
|
||||
|
||||
define Package/dectmngr2/description
|
||||
|
||||
@@ -4,6 +4,7 @@ START=99
|
||||
USE_PROCD=1
|
||||
|
||||
RULE_LIST="/tmp/easy_qos_rule.list"
|
||||
CLIENT_LIST="/tmp/easy_qos_class_client.list"
|
||||
BRIDGE_INTF=""
|
||||
|
||||
[ -f /etc/profile.d/intel.sh ] && {
|
||||
@@ -16,6 +17,13 @@ log() {
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
exec_class_log() {
|
||||
${@} |grep -i successful
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
@@ -46,6 +54,114 @@ get_priority() {
|
||||
esac
|
||||
}
|
||||
|
||||
get_mark() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo "0x41/0x3df";;
|
||||
"low")
|
||||
echo "0x82/0x3df";;
|
||||
"besteffort")
|
||||
echo "0xc3/0x3df";;
|
||||
"normal")
|
||||
echo "0x104/0x3df";;
|
||||
"video")
|
||||
echo "0x145/0x3df";;
|
||||
"medium")
|
||||
echo "0x186/0x3df";;
|
||||
"high")
|
||||
echo "0x1c7/0x3df";;
|
||||
"highest")
|
||||
echo "0x208/0x3df";;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_ip_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark=$1; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j EXTMARK --set-mark ${mark}";
|
||||
if [ "${proto}" != "icmp" ]; then
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
is_lan_bridge() {
|
||||
local _section=$1
|
||||
local _type
|
||||
@@ -67,10 +183,10 @@ get_bridge_interface() {
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string:none' \
|
||||
'macaddr:string:none' \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger):none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
@@ -82,8 +198,14 @@ clear_existing_rules() {
|
||||
while read line
|
||||
do
|
||||
log "Deleting old classification rules"
|
||||
exec_log classcfg -D ${line} -i ${BRIDGE_INTF}
|
||||
exec_class_log classcfg -D ${line} -i ${BRIDGE_INTF}
|
||||
done <${RULE_LIST}
|
||||
|
||||
local rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||
done
|
||||
sync
|
||||
|
||||
[ -f ${RULE_LIST} ] && rm ${RULE_LIST}
|
||||
@@ -104,13 +226,16 @@ create_rule() {
|
||||
if [ "${mac_addr}" != "none" ]; then
|
||||
cmd="--smac ${mac_addr} ${cmd}";
|
||||
fi
|
||||
if [ "${ports}" != "none" ]; then
|
||||
IFS=","
|
||||
for port in ${ports};
|
||||
do
|
||||
cmd="--dport ${port}:${port} ${cmd}";
|
||||
done
|
||||
IFS=' '
|
||||
|
||||
if [ "${proto}" != "icmp" ]; then
|
||||
if [ "${ports}" != "none" ]; then
|
||||
IFS=","
|
||||
for port in ${ports};
|
||||
do
|
||||
cmd="--dport ${port}:${port} ${cmd}";
|
||||
done
|
||||
IFS=' '
|
||||
fi
|
||||
fi
|
||||
if [ "${proto}" != "none" ]; then
|
||||
cmd="-p ${proto} $cmd"
|
||||
@@ -119,14 +244,14 @@ create_rule() {
|
||||
cmd="-A ${rule_name} $cmd"
|
||||
|
||||
# Store the rule_names for cleanup on reload
|
||||
exec_log classcfg ${cmd}
|
||||
exec_class_log classcfg ${cmd}
|
||||
[ $? -eq 0 ] && \
|
||||
echo ${rule_name} >> ${RULE_LIST}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num port_list
|
||||
local priority macaddr proto port comment prio_num port_list ip ipmark
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
@@ -135,22 +260,33 @@ manage_rule() {
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
ipmark=$(get_mark ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
|
||||
if [ -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${port_list}
|
||||
create_rule udp ${macaddr} ${prio_num} ${port_list}
|
||||
if [ -n "${ip}" ]; then
|
||||
create_ip_rule tcp ${ip} ${ipmark} ${port_list}
|
||||
create_ip_rule udp ${ip} ${ipmark} ${port_list}
|
||||
fi
|
||||
else
|
||||
create_rule ${proto} ${macaddr} ${prio_num} ${port_list}
|
||||
if [ -n "${ip}" ]; then
|
||||
create_ip_rule ${proto} ${ip} ${ipmark} ${port_list}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
get_bridge_interface
|
||||
map_client_entries
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
@@ -103,18 +103,18 @@ validate_rule_section()
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(iptables -t mangle -S OUTPUT|grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
local rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S OUTPUT|grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
rule=$(iptables -t mangle -S PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
|
||||
done
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C OUTPUT ${@} 2>/dev/null
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A OUTPUT ${@}
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
|
||||
@@ -11,7 +11,7 @@ PKG_VERSION:=1.0.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b88afddd2f4cb216bfcd190f9096c138299c28e2
|
||||
PKG_SOURCE_VERSION:=cec7ae3a5c8348ea2d81a2abac0599a098752e3a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=2.4.0
|
||||
PKG_VERSION:=2.4.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=30f5527ae724d54537c803127e11992d1a5ae154
|
||||
PKG_SOURCE_VERSION:=0accbd7266b2742ad8921edd5dab974fc384a49a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -39,6 +39,12 @@ define Package/libwifi/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libeasy
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Helper and utility functions library (libeasy)
|
||||
DEPENDS+=+libnl +libnl-route
|
||||
endef
|
||||
|
||||
define Package/libwifi
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
@@ -82,13 +88,14 @@ endif
|
||||
define Package/libdsl
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= XDSL library (libdsl)
|
||||
DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi
|
||||
DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi +TARGET_intel_mips:kmod-ppa-drv
|
||||
endef
|
||||
|
||||
subdirs := \
|
||||
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
||||
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet)
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet) \
|
||||
$(if $(CONFIG_PACKAGE_libeasy),libeasy)
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
@@ -108,6 +115,13 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev/libeasy
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
@@ -140,6 +154,11 @@ define Build/InstallDev
|
||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||
endef
|
||||
|
||||
define Package/libeasy/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||
@@ -162,3 +181,4 @@ endef
|
||||
$(eval $(call BuildPackage,libwifi))
|
||||
$(eval $(call BuildPackage,libdsl))
|
||||
$(eval $(call BuildPackage,libethernet))
|
||||
$(eval $(call BuildPackage,libeasy))
|
||||
|
||||
@@ -8,29 +8,28 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.2
|
||||
PKG_SOURCE_VERSION:=631e61b7ab5d86f2f4c86756a117badff9fb0f2c
|
||||
|
||||
PKG_SOURCE_VERSION:=ef49d57c3824df4dfb4921d39461e2bd14f918a7
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE:=endptmngr-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://download.iopsys.eu/iopsys/opensdk/
|
||||
PKG_NAME:=endptmngr-open
|
||||
PATCH_DIR:=
|
||||
else
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/endptmngr
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_NAME:=endptmngr
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
endif
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +43,7 @@ define Package/endptmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Brcmslic
|
||||
URL:=
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen @(PACKAGE_bcmkernel||PACKAGE_bcmopen) @TARGET_HAS_VOICE
|
||||
endef
|
||||
|
||||
define Package/endptmngr/description
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2019-09-15
|
||||
PKG_VERSION:=4.0-2019-12-11
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=89564260af83117243b57dcc00a441f25225cb98
|
||||
PKG_SOURCE_VERSION:=3fdaca7e3463d46a52f31496b0f84deb6b21eaf8
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -33,31 +33,45 @@ CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/icwmp_stun
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 stun Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libopenssl +libblobmsg-json
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 stun Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libopenssl +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/icwmp_xmpp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 xmpp feature
|
||||
DEPENDS:=+libuci +libubox +libexpat +libstrophe
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 xmpp feature
|
||||
DEPENDS:=+libuci +libubox +libexpat +libstrophe
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 twamp feature
|
||||
DEPENDS:=+libuci
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 twamp feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 udpechoserver feature
|
||||
DEPENDS:=+libuci
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 udpechoserver feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp_bulkdata
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +curl +libblobmsg-json +libbbfdm
|
||||
endef
|
||||
|
||||
define Package/icwmp-tr098
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CWMP client for TR-098 Data Model
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl +libtr098
|
||||
endef
|
||||
|
||||
define Package/icwmp/Default
|
||||
@@ -96,13 +110,14 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_CFLAGS += -DEX400
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_icwmp-tr098),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-icwmp_tr098
|
||||
endif
|
||||
|
||||
ifneq ($(CWMP_REVISION)_,_)
|
||||
ifneq ($(CWMP_REVISION),exported)
|
||||
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||
@@ -172,6 +187,11 @@ endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/icwmp-tr098/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmp_tr098d $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Package/icwmp_stun/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_stund $(1)/usr/sbin/icwmp_stund
|
||||
@@ -209,6 +229,15 @@ define Package/icwmp_twamp/install
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_twamp $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Package/icwmp_bulkdata/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_bulkdatad $(1)/usr/sbin/icwmp_bulkdatad
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_bulkdatad $(1)/etc/init.d/icwmp_bulkdatad
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_bulkdata $(1)/etc/config
|
||||
endef
|
||||
|
||||
define Package/icwmp-$(BUILD_VARIANT)/postinst
|
||||
#!/bin/sh
|
||||
echo "$(CWMP_BKP_FILE)" >> $${IPKG_INSTROOT}/etc/sysupgrade.conf
|
||||
@@ -233,4 +262,6 @@ $(eval $(call BuildPackage,icwmp_stun))
|
||||
$(eval $(call BuildPackage,icwmp_xmpp))
|
||||
$(eval $(call BuildPackage,icwmp_udpechoserver))
|
||||
$(eval $(call BuildPackage,icwmp_twamp))
|
||||
$(eval $(call BuildPackage,icwmp_bulkdata))
|
||||
$(eval $(call BuildPackage,icwmp-tr098))
|
||||
$(eval $(call BuildPackage,icwmp-zstream))
|
||||
|
||||
57
ieee1905/Makefile
Normal file
57
ieee1905/Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=1.1.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3008fe46ee9247f0203b3a125fddebadbdd7dcdc
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ieee1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 handler
|
||||
DEPENDS:= +libwifi +ubox +libpicoevent +libpcap +libopenssl +libuci +libjson-c
|
||||
endef
|
||||
|
||||
define Package/ieee1905/description
|
||||
IEEE1905 stack with extended functionalities.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-DSEND_EMPTY_TLVS \
|
||||
-DFIX_BROKEN_TLVS \
|
||||
-DSPEED_UP_DISCOVERY \
|
||||
-DREGISTER_EXTENSION_BBF
|
||||
#-DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS \
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./ieee1905/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/button
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ieee1905 $(1)/etc/init.d/ieee1905
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/button/11-ieee1905 $(1)/etc/hotplug.d/button/11-ieee1905
|
||||
$(INSTALL_DATA) ./files/etc/config/ieee1905 $(1)/etc/config/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905d $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libs/*.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ieee1905))
|
||||
39
ieee1905/files/etc/config/ieee1905
Normal file
39
ieee1905/files/etc/config/ieee1905
Normal file
@@ -0,0 +1,39 @@
|
||||
config ieee1905
|
||||
option enabled '1'
|
||||
option debug true
|
||||
|
||||
config meshcomms 'global'
|
||||
option enabled '1'
|
||||
option basemacint 'wan'
|
||||
option mapall true
|
||||
# option registrar 'rai0'
|
||||
option debug_level 2
|
||||
option port 8888
|
||||
option cmdu_event false
|
||||
|
||||
#config al-iface
|
||||
# option enabled '1'
|
||||
# option ifname 'br-lan'
|
||||
# option media 'bridge'
|
||||
# option manufacturer_name 'Broadcom'
|
||||
# option model_name 'Eth EG400'
|
||||
# option model_number '00002'
|
||||
# option device_name 'EG400R1'
|
||||
|
||||
#config al-iface
|
||||
# option enabled '1'
|
||||
# option ifname 'wl0'
|
||||
# option media 'ap'
|
||||
# option manufacturer_name 'Mediatek'
|
||||
# option model_name 'WIFI EX400'
|
||||
# option model_number '00001'
|
||||
# option device_name 'EX400R0'
|
||||
|
||||
#config al-iface
|
||||
# option enabled '1'
|
||||
# option ifname 'wl1'
|
||||
# option media 'ap'
|
||||
# option manufacturer_name 'Mediatek'
|
||||
# option model_name 'WIFI EX400'
|
||||
# option model_number '00001'
|
||||
# option device_name 'EX400R0'
|
||||
36
ieee1905/files/etc/hotplug.d/button/11-ieee1905
Normal file
36
ieee1905/files/etc/hotplug.d/button/11-ieee1905
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
TOPOLOGY_FILE="/tmp/topology_change"
|
||||
WPS_FILE="/tmp/virtual_push_button"
|
||||
|
||||
handle_topology_change() {
|
||||
[ -f ${TOPOLOGY_FILE} ] && \
|
||||
touch ${TOPOLOGY_FILE}
|
||||
}
|
||||
|
||||
handle_wps() {
|
||||
[ -f ${WPS_FILE} ] && \
|
||||
touch ${WPS_FILE}
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
add|register)
|
||||
[ "wifibutton" == "$INTERFACE" -o "ecobutton" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wifi_2g" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wifi_5g" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wpsbutton" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wpscbutton" == "$INTERFACE" ] && {
|
||||
handle_topology_change
|
||||
}
|
||||
;;
|
||||
remove|unregister)
|
||||
;;
|
||||
esac
|
||||
197
ieee1905/files/etc/init.d/ieee1905
Normal file
197
ieee1905/files/etc/init.d/ieee1905
Normal file
@@ -0,0 +1,197 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
MESH_CONF=/tmp/meshcomms.config
|
||||
INTERFACE=""
|
||||
|
||||
validate_global_section()
|
||||
{
|
||||
uci_validate_section ieee1905 meshcomms "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'basemacint:string:wan' \
|
||||
'almac:string' \
|
||||
'registrar:string' \
|
||||
'mapall:bool:true' \
|
||||
'debug_level:uinteger:5' \
|
||||
'port:port:8888' \
|
||||
'cmdu_event:bool:true'
|
||||
}
|
||||
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:true' \
|
||||
'enabled:bool:true'
|
||||
}
|
||||
|
||||
get_device_name() {
|
||||
local device
|
||||
# Get wan L3 interface
|
||||
ubus list |grep -iq network.interface.${1}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
json_load "$(ubus -t 2 call network.interface.${1} status)"
|
||||
json_get_var device device
|
||||
echo ${device}
|
||||
fi
|
||||
}
|
||||
|
||||
get_interface_mac() {
|
||||
local l3 basemac
|
||||
l3=$(get_device_name ${1})
|
||||
if [ -n ${l3} ]; then
|
||||
json_load "$(ubus -t 2 call network.device status "{\"name\":\"${l3}\"}")"
|
||||
json_get_var basemac macaddr
|
||||
fi
|
||||
local first=0x$(echo $basemac |cut -d : -f 1)
|
||||
local rest=$(echo $basemac |cut -d : -f 2-)
|
||||
# Set local bit
|
||||
first=$((first|2))
|
||||
first=$(printf "%x" $first)
|
||||
basemac="${first}:${rest}"
|
||||
echo ${basemac}
|
||||
}
|
||||
|
||||
validate_al_section()
|
||||
{
|
||||
uci_validate_section ieee1905 al-iface "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'ifname:string' \
|
||||
'media:string:eth' \
|
||||
'manufacturer_name:string:iopsys' \
|
||||
'model_name:string' \
|
||||
'model_number:string' \
|
||||
'device_name:string'
|
||||
}
|
||||
|
||||
configure_interface()
|
||||
{
|
||||
local ifname media enabled manufacturer_name model_name model_number device_name
|
||||
validate_al_section ${1} || {
|
||||
echo "Validation of global section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ ${enabled} -eq 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
if [ -z ${INTERFACE} ]; then
|
||||
INTERFACE=${ifname}
|
||||
else
|
||||
INTERFACE="${INTERFACE},${ifname}"
|
||||
fi
|
||||
|
||||
json_add_object
|
||||
json_add_string ifname ${ifname}
|
||||
json_add_string media ${media}
|
||||
json_add_string manufacturer_name ${manufacturer_name}
|
||||
json_add_string model_name ${model_name}
|
||||
json_add_string model_number ${model_number}
|
||||
json_add_string device_name ${device_name}
|
||||
json_close_object
|
||||
}
|
||||
|
||||
configure_meshcomms()
|
||||
{
|
||||
local enabled almac basemacint mapall debug_level port l3device basemac intf registrar cmdu_event
|
||||
|
||||
validate_global_section global || {
|
||||
echo "Validation of global section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z ${almac} ]; then
|
||||
basemac=$(get_interface_mac ${basemacint})
|
||||
else
|
||||
basemac=${almac}
|
||||
fi
|
||||
|
||||
|
||||
local fname cname model cUrl
|
||||
fname=$(db get hw.board.boardId)
|
||||
cname=$(db get hw.board.iopVerCustomer)
|
||||
model=$(db get hw.board.routerModel)
|
||||
cUrl="http://192.168.1.1"
|
||||
|
||||
json_init
|
||||
# fill the al-iface info
|
||||
json_add_array al-iface
|
||||
config_foreach configure_interface al-iface
|
||||
json_close_array
|
||||
json_add_object deviceInfo
|
||||
json_add_string friendly_name ${fname}
|
||||
json_add_string manufacturer_name ${cname}
|
||||
json_add_string model ${model}
|
||||
json_add_string control_url ${cUrl}
|
||||
json_close_object
|
||||
json_add_object meshcomms
|
||||
json_add_int enabled ${enabled}
|
||||
json_add_string mac ${basemac}
|
||||
json_add_string interfaces ${INTERFACE}
|
||||
json_add_int map ${mapall}
|
||||
json_add_string registrar ${registrar}
|
||||
json_add_int debug_level ${debug_level}
|
||||
json_add_int port ${port}
|
||||
json_add_int cmdu_event ${cmdu_event}
|
||||
json_close_object
|
||||
|
||||
json_dump >${MESH_CONF}
|
||||
|
||||
}
|
||||
|
||||
configure_ieee1905()
|
||||
{
|
||||
local enabled debug
|
||||
|
||||
validate_ieee1905_section ${1} || {
|
||||
echo "Validation of ieee1905 section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ ${enabled} -ne 1 ]; then
|
||||
exit 0;
|
||||
fi
|
||||
}
|
||||
|
||||
configure_network() {
|
||||
[ -f ${MESH_CONF} ] && rm ${MESH_CONF}
|
||||
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach configure_ieee1905 ieee1905
|
||||
config_foreach configure_meshcomms meshcomms
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance ieee1905
|
||||
procd_set_param command ${PROG}
|
||||
configure_network
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_reload_trigger "netmode"
|
||||
}
|
||||
@@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=ifbt
|
||||
PKG_VERSION:=0.2
|
||||
|
||||
PKG_SOURCE_VERSION:=f6edff47b6c0a154ab892301acf767d19ac8ad73
|
||||
PKG_SOURCE_VERSION:=6a279efa5046ace0681a1d0e79592a120f80e171
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ifbt.git
|
||||
|
||||
|
||||
@@ -194,5 +194,5 @@ CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
CONFIG_KERNEL_DEVTMPFS=y
|
||||
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
LOCAL_MIRROR="http://download.iopsys.eu/iopsys/mirror/"
|
||||
CONFIG_LOCALMIRROR="http://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
|
||||
@@ -437,10 +437,6 @@ function genconfig {
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
# git ls-remote is used for testing access rights so do not ask for password
|
||||
# if the user has access the ssh key is used not password
|
||||
export GIT_SSH_COMMAND="ssh -oBatchMode=yes"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
|
||||
35
iop/scripts/licenses_gen.sh
Normal file
35
iop/scripts/licenses_gen.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
function license_report {
|
||||
LICDIR="/tmp/licenses-generator/"
|
||||
LICBIN="${LICDIR}/bin"
|
||||
|
||||
|
||||
dpkg -s python3 python3-requests python3-yaml python3-mako python3-six &> /dev/null
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Missing dependencies"
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3 python3-requests python3-yaml python3-mako python3-six
|
||||
|
||||
else
|
||||
echo "Dependecy check passed"
|
||||
fi
|
||||
|
||||
|
||||
if [ -d "$LICDIR" ]; then
|
||||
### Take action if $DIR exists ###
|
||||
echo "Creating json licences file and html formated report"
|
||||
else
|
||||
### Control will jump here if $DIR does NOT exists ###
|
||||
echo "Error: licenses-generator not found. getting from iopsys repo"
|
||||
git clone git@dev.iopsys.eu:iopsys/licenses-generator.git $LICDIR
|
||||
fi
|
||||
LICGET=`${LICBIN}/licenses-generator gen-License bin/`
|
||||
echo $LICGET
|
||||
${LICBIN}/licenses-generator gen-licrprt $LICGET
|
||||
exit 0
|
||||
|
||||
}
|
||||
|
||||
|
||||
register_command "license_report" "Generate a Licence report on latest build in json format and html under reports"
|
||||
32
json-editor/Makefile
Normal file
32
json-editor/Makefile
Normal file
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=json-editor
|
||||
PKG_RELEASE:=1.0.0
|
||||
|
||||
PKG_SOURCE_VERSION:=44b32937a062ec4ffc9f7355841dc94ab6efa50f
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/json-editor.git
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/json-editor
|
||||
SECTION:=base
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libjson-c +libblobmsg_json
|
||||
TITLE:=JSON-editor
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/src/json-editor.h $(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libjson-editor.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,json-editor))
|
||||
@@ -14,6 +14,8 @@ PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7875222706cb6999af0361ef0aebdc85cd75c127
|
||||
PKG_NAME:=libpicoevent
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
|
||||
67
meshcomms/Makefile
Normal file
67
meshcomms/Makefile
Normal file
@@ -0,0 +1,67 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=meshcomms
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=72048b609104a5479ac2cdae21d5d1f733fd2bc3
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/meshcomms.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=BSD2+Patent
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/meshcomms
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Mesh agent
|
||||
DEPENDS:=+libpcap +libopenssl +libubox +libubus +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/meshcomms/description
|
||||
meshComms is an open source implementation of IEEE 1905.1a that is an output
|
||||
of the Broadband Forum Open Broadband - Multi Access Point (OB-MAP) project.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
# -DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./meshcomms/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Package/meshcomms/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/lib
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/meshcomms
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/meshcomms/common
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/meshcomms/bbf
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/meshcomms/al
|
||||
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/meshcomms/factory
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/meshcomms.conf $(1)/etc/config/meshcomms
|
||||
$(INSTALL_BIN) ./files/meshcomms.init $(1)/etc/init.d/meshcomms
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/output/al_entity $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/output/libmeshcomms.so $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/output/libmeshcomms.so $(STAGING_DIR)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/include/meshcomms.h $(STAGING_DIR)/usr/include/meshcomms/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/common/interfaces/*.h $(STAGING_DIR)/usr/include/meshcomms/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/factory/interfaces/*.h $(STAGING_DIR)/usr/include/meshcomms/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/factory/interfaces/extensions/bbf/*.h $(STAGING_DIR)/usr/include/meshcomms/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/al/internal_interfaces/*.h $(STAGING_DIR)/usr/include/meshcomms/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,meshcomms))
|
||||
8
meshcomms/files/meshcomms.conf
Normal file
8
meshcomms/files/meshcomms.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
config meshcomms 'global'
|
||||
option basemacint 'wan'
|
||||
list interfaces 'lan'
|
||||
list interfaces 'wan'
|
||||
option mapall true
|
||||
option debug false
|
||||
option port 8888
|
||||
|
||||
105
meshcomms/files/meshcomms.init
Normal file
105
meshcomms/files/meshcomms.init
Normal file
@@ -0,0 +1,105 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/al_entity
|
||||
|
||||
validate_global_section()
|
||||
{
|
||||
uci_validate_section meshcomms meshcomms "${1}" \
|
||||
'basemacint:string:wan' \
|
||||
'interfaces:string:lan' \
|
||||
'mapall:bool:true' \
|
||||
'debug:bool:true' \
|
||||
'port:port:8888'
|
||||
}
|
||||
|
||||
get_device_name() {
|
||||
local device
|
||||
# Get wan L3 interface
|
||||
ubus list |grep -iq network.interface.${1}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
json_load "$(ubus -t 2 call network.interface.${1} status)"
|
||||
json_get_var device device
|
||||
echo ${device}
|
||||
fi
|
||||
}
|
||||
|
||||
get_interface_mac() {
|
||||
local l3 basemac
|
||||
l3=$(get_device_name ${1})
|
||||
if [ -n ${l3} ]; then
|
||||
json_load "$(ubus -t 2 call network.device status "{\"name\":\"${l3}\"}")"
|
||||
json_get_var basemac macaddr
|
||||
fi
|
||||
echo ${basemac}
|
||||
}
|
||||
|
||||
configure_meshcomms()
|
||||
{
|
||||
local basemacint interfaces mapall debug port l3device basemac intf
|
||||
|
||||
validate_global_section global || {
|
||||
echo "Validation of global section failed"
|
||||
return 1;
|
||||
}
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
basemac=$(get_interface_mac ${basemacint})
|
||||
|
||||
|
||||
for f in ${interfaces}
|
||||
do
|
||||
local l3=$(get_device_name $f)
|
||||
intf="${intf} ${l3}"
|
||||
done
|
||||
intf=$(echo $intf|sed 's/ /,/g')
|
||||
[ -z "${intf}" ] && \
|
||||
echo "interface list is empty/invalid">/dev/console \
|
||||
return 1
|
||||
|
||||
procd_append_param command -m ${basemac} -i ${intf}
|
||||
|
||||
[ "${debug}" -eq 1 ] && \
|
||||
procd_append_param command -vv
|
||||
|
||||
[ "${mapall}" -eq 1 ] && \
|
||||
procd_append_param command -w
|
||||
|
||||
[ ${port} -ne 8888 ] && \
|
||||
procd_append_param command -p ${port}
|
||||
}
|
||||
|
||||
configure_network() {
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
config_load meshcomms
|
||||
config_foreach configure_meshcomms meshcomms
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance meshcomms
|
||||
procd_set_param command ${PROG}
|
||||
configure_network
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
}
|
||||
@@ -16,6 +16,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mqtt-ciotc
|
||||
|
||||
@@ -16,7 +16,7 @@ PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9e2236989ff58d0db897f938b6b07b535144e0e2
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE:=PROPRIETARY RTX
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/image.mk
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_BUILD_DIR:=${BUILD_DIR}/ndt-$(PKG_VERSION)
|
||||
PKG_SOURCE:=ndt-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://software.internet2.edu/sources/ndt
|
||||
|
||||
PKG_LICENSE:=NONSTANDARD
|
||||
PKG_LICENSE:=NONSTANDARD_PERMISSIV
|
||||
PKG_LICENSE_FILES:=COPYRIGHT
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -244,17 +244,16 @@ revert_netmode() {
|
||||
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
logger -s -p user.info -t "netmode" "Could not switch to '$from' mode; going back to '$to' mode" > /dev/console
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
uci -q set netmode.setup.curmode="$to"
|
||||
uci -q set netmode.setup.repeaterready="$rready"
|
||||
uci commit netmode
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
rm -rf $OLD_MODE_FILE
|
||||
|
||||
logger -s -p user.info -t "netmode" "Restarting network services" > /dev/console
|
||||
ubus call network reload
|
||||
wifi reload
|
||||
/etc/init.d/network restart
|
||||
ubus call router.network reload
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=2.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e2816ff39f654a191afd49c90a05f70e99259d8e
|
||||
PKG_SOURCE_VERSION:=9c7921c8e39acfc31f563bd08220faba1012a834
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
@@ -51,7 +51,8 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
@@ -1,14 +1,41 @@
|
||||
# controller, mtp, connection makes a group and related to one another
|
||||
# ex: first controller will be mapped to first mtp and first connection
|
||||
# details, always defined in groups
|
||||
|
||||
config obuspa
|
||||
option cert '/etc/obuspa/rootCA.pem'
|
||||
option interface 'wan'
|
||||
option debug 'false'
|
||||
|
||||
config controller
|
||||
option endpointid 'self::usp-controller.com'
|
||||
option enable 'true'
|
||||
# Trust cerificate number
|
||||
option AssignedRole 1
|
||||
option PeriodicNotifInterval "86400"
|
||||
option PeriodicNotifTime "0001-01-01T00:00:00Z"
|
||||
option USPRetryMinimumWaitInterval "5"
|
||||
option USPRetryIntervalMultiplier "2000"
|
||||
option ControllerCode ""
|
||||
option protocol 'STOMP'
|
||||
|
||||
config mtp
|
||||
option enable 'true'
|
||||
option protocol 'STOMP'
|
||||
option destination 'uspq'
|
||||
option destination ''
|
||||
|
||||
config connection
|
||||
option host 'usp-controller.com'
|
||||
option username 'username'
|
||||
option password 'password'
|
||||
option encryption 'false'
|
||||
option encryption 'true'
|
||||
option enable 'true'
|
||||
option port 61613
|
||||
option virtualhost '/'
|
||||
option EnableHeartbeats "true"
|
||||
option OutgoingHeartbeat "30000"
|
||||
option IncomingHeartbeat "300000"
|
||||
option ServerRetryInitialInterval "60"
|
||||
option ServerRetryIntervalMultiplier "2000"
|
||||
option ServerRetryMaxInterval "30720"
|
||||
|
||||
|
||||
@@ -5,99 +5,210 @@ USE_PROCD=1
|
||||
|
||||
PROG=/usr/sbin/obuspa
|
||||
l3device=""
|
||||
|
||||
CTRL_PATH="Device.LocalAgent.Controller.1."
|
||||
MTP_PATH="Device.LocalAgent.MTP.1."
|
||||
CONN_PATH="Device.STOMP.Connection.1."
|
||||
certificate=""
|
||||
PARAM_FILE="/tmp/obuspa_param_reset.txt"
|
||||
conn_num=1
|
||||
mtp_num=1
|
||||
stomp_num=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t obuspa -p debug
|
||||
}
|
||||
|
||||
db_set() {
|
||||
log "DBSET param|${1}| value|${2}|"
|
||||
USP_BOARD_IFNAME=${l3device} ${PROG} -c dbset ${1} ${2}
|
||||
if [ -n "${1}" ]; then
|
||||
echo "${1} \"${2}\"">>${PARAM_FILE}
|
||||
else
|
||||
echo >>${PARAM_FILE}
|
||||
fi
|
||||
}
|
||||
|
||||
validate_obuspa_section()
|
||||
{
|
||||
uci_validate_section obuspa obuspa "${1}" \
|
||||
'cert:string:"/etc/obuspa/rootCA.pem"' \
|
||||
'interface:string:wan' \
|
||||
'debug:bool:false'
|
||||
}
|
||||
|
||||
validate_controller_section()
|
||||
{
|
||||
uci_validate_section obuspa controller "${1}" \
|
||||
'endpointid:string:"self:usp-controller.com"'
|
||||
'endpointid:string:"self:usp-controller.com"' \
|
||||
'enable:bool:true' \
|
||||
'AssignedRole:uinteger:1' \
|
||||
'PeriodicNotifInterval:uinteger:86400' \
|
||||
'PeriodicNotifTime:string:"0001-01-01T00:00:00Z"' \
|
||||
'USPRetryMinimumWaitInterval:uinteger:5' \
|
||||
'USPRetryIntervalMultiplier:uinteger:2000' \
|
||||
'ControllerCode:string' \
|
||||
'protocol:or("STOMP","CoAP")' \
|
||||
'CoAPHost:string' \
|
||||
'CoAPPath:string' \
|
||||
'CoAPPort:uinteger'
|
||||
}
|
||||
|
||||
validate_mtp_section()
|
||||
{
|
||||
uci_validate_section obuspa mtp "${1}" \
|
||||
'enable:bool:true' \
|
||||
'protocol:string:"STOMP"' \
|
||||
'destination:string:'
|
||||
'protocol:or("STOMP","CoAP")' \
|
||||
'destination:string' \
|
||||
'CoAPPath:string' \
|
||||
'CoAPPort:uinteger'
|
||||
}
|
||||
|
||||
validate_connection_section()
|
||||
{
|
||||
uci_validate_section obuspa connection "${1}" \
|
||||
'host:string:"usp-controller.com"' \
|
||||
'username:string:username' \
|
||||
'password:string:password' \
|
||||
'encryption:bool:true'
|
||||
'username:string:""' \
|
||||
'password:string:""' \
|
||||
'encryption:bool:true' \
|
||||
'enable:bool:true' \
|
||||
'port:uinteger:61613' \
|
||||
'virtualhost:string:"/"' \
|
||||
'EnableHeartbeats:bool:true' \
|
||||
'OutgoingHeartbeat:uinteger:30000' \
|
||||
'IncomingHeartbeat:uinteger:300000' \
|
||||
'ServerRetryInitialInterval:uinteger:60' \
|
||||
'ServerRetryIntervalMultiplier:uinteger:2000' \
|
||||
'ServerRetryMaxInterval:uinteger:30720'
|
||||
}
|
||||
|
||||
configure_controller() {
|
||||
local endpointid
|
||||
local endpointid enable AssignedRole PeriodicNotifInterval PeriodicNotifTime USPRetryMinimumWaitInterval
|
||||
local USPRetryIntervalMultiplier ControllerCode protocol CoAPHost CoAPPath CoAPPort
|
||||
|
||||
validate_controller_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${CTRL_PATH}EndpointID" ${endpointid}
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.EndpointID "${endpointid}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.Alias "cpe-${conn_num}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.Enable "true"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.AssignedRole "Device.LocalAgent.ControllerTrust.Role.${AssignedRole}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.PeriodicNotifInterval "${PeriodicNotifInterval}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.PeriodicNotifTime "${PeriodicNotifTime}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.USPRetryMinimumWaitInterval "${USPRetryMinimumWaitInterval}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.USPRetryIntervalMultiplier "${USPRetryIntervalMultiplier}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.ControllerCode "${ControllerCode}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.Alias "cpe-${conn_num}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.Enable "${enable}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.Protocol "${protocol}"
|
||||
if [ "${protocol}"=="STOMP" ]; then
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.STOMP.Reference "Device.STOMP.Connection.${conn_num}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.STOMP.Destination "controller-notify-dest"
|
||||
elif [ "${protocol}"=="CoAP" ]; then
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.CoAP.Host "${CoAPHost}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.CoAP.Path "${CoAPPath}"
|
||||
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.CoAP.Port "${CoAPPort}"
|
||||
else
|
||||
log "Unsupported protocol ${protocol}"
|
||||
fi
|
||||
db_set
|
||||
conn_num=$((conn_num+1))
|
||||
}
|
||||
|
||||
configure_mtp() {
|
||||
local protocol enable destination
|
||||
local protocol enable destination CoAPPath CoAPPort
|
||||
|
||||
validate_mtp_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${MTP_PATH}Enable" ${enable}
|
||||
db_set "${MTP_PATH}Protocol" ${protocol}
|
||||
db_set "${MTP_PATH}STOMP.Destination" ${destination}
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.Alias "cpe-${mtp_num}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.Enable "${enable}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.Protocol "${protocol}"
|
||||
if [ "${protocol}"=="STOMP" ]; then
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Reference "Device.STOMP.Connection.${mtp_num}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Destination "${destination}"
|
||||
elif [ "${protocol}"=="CoAP" ]; then
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Path "${CoAPPath}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Port "${CoAPPort}"
|
||||
else
|
||||
log "Unsupported protocol ${protocol}"
|
||||
fi
|
||||
db_set
|
||||
mtp_num=$((mtp_num+1))
|
||||
}
|
||||
|
||||
configure_connection() {
|
||||
local host username password encryption
|
||||
local host username password encryption enable port virtualhost EnableHeartbeats
|
||||
local OutgoingHeartbeat IncomingHeartbeat ServerRetryInitialInterval
|
||||
local ServerRetryIntervalMultiplier ServerRetryMaxInterval
|
||||
|
||||
validate_connection_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
db_set "${CONN_PATH}Host" ${host}
|
||||
db_set "${CONN_PATH}Username" ${username}
|
||||
db_set "${CONN_PATH}Password" ${password}
|
||||
db_set "${CONN_PATH}X_ARRIS-COM_EnableEncryption" ${encryption}
|
||||
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Host "${host}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Username "${username}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Password "${password}"
|
||||
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Alias "cpe-${stomp_num}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Enable "${enable}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.Port "${port}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.X_ARRIS-COM_EnableEncryption "${encryption}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.VirtualHost "${virtualhost}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.EnableHeartbeats "${EnableHeartbeats}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.OutgoingHeartbeat "${OutgoingHeartbeat}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.IncomingHeartbeat "${IncomingHeartbeat}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.ServerRetryInitialInterval "${ServerRetryInitialInterval}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.ServerRetryIntervalMultiplier "${ServerRetryIntervalMultiplier}"
|
||||
db_set Device.STOMP.Connection.${stomp_num}.ServerRetryMaxInterval "${ServerRetryMaxInterval}"
|
||||
db_set
|
||||
stomp_num=$((stomp_num+1))
|
||||
}
|
||||
|
||||
configure_obuspa() {
|
||||
local cert interface debug
|
||||
|
||||
validate_obuspa_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
# Get wan L3 interface
|
||||
json_load "$(ubus -t 2 call network.interface.${interface} status)"
|
||||
json_get_var l3device l3_device
|
||||
export USP_BOARD_IFNAME=${l3device}
|
||||
|
||||
# Set this variable for root user
|
||||
echo "export USP_BOARD_IFNAME=${l3device}">/root/.profile
|
||||
|
||||
[ -f $cert ] && certificate=$cert
|
||||
|
||||
}
|
||||
db_init() {
|
||||
[ -f ${PARAM_FILE} ] && rm -f ${PARAM_FILE}
|
||||
[ -f /tmp/usp.db ] && rm -f /tmp/usp.db
|
||||
|
||||
config_load obuspa
|
||||
config_foreach configure_obuspa obuspa
|
||||
config_foreach configure_controller controller
|
||||
config_foreach configure_mtp mtp
|
||||
config_foreach configure_connection connection
|
||||
config_foreach configure_mtp mtp
|
||||
db_set Internal.Reboot.Cause "LocalFactoryReset"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
# Get wan L3 interface
|
||||
json_load "$(ubus call network.interface.wan status)"
|
||||
json_get_var l3device l3_device
|
||||
procd_open_instance obuspa
|
||||
db_init
|
||||
procd_open_instance
|
||||
procd_set_param env USP_BOARD_IFNAME=${l3device}
|
||||
# Forward stdout of the command to logd
|
||||
# procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
# procd_set_param stderr 1
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -p -v 4
|
||||
procd_append_param command -p -v 4 -r ${PARAM_FILE}
|
||||
if [ -f "${certificate}" ]; then
|
||||
procd_append_param command -t ${certificate}
|
||||
fi
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
@@ -110,4 +221,3 @@ reload_service() {
|
||||
service_triggers() {
|
||||
procd_add_config_trigger "config.change" "obuspa" /etc/init.d/obuspa restart
|
||||
}
|
||||
|
||||
|
||||
48
opkgd/Makefile
Executable file
48
opkgd/Makefile
Executable file
@@ -0,0 +1,48 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=opkgd
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d3da32eca6e50b6be6e846a7f82c8e93c74c45a4
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/opkgd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/opkgd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=OPKG ubus backend
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid
|
||||
endef
|
||||
|
||||
define Package/opkgd/description
|
||||
Ubus based backend for OPKG which can be used by other applications running on top of it.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Package/opkgd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/opkgd.init $(1)/etc/init.d/opkgd
|
||||
$(INSTALL_DIR) $(1)/etc/opkg
|
||||
$(INSTALL_CONF) ./files/map_du $(1)/etc/opkg/map_du
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/opkgd $(1)/usr/sbin/opkgd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,opkgd))
|
||||
0
opkgd/files/map_du
Normal file
0
opkgd/files/map_du
Normal file
20
opkgd/files/opkgd.init
Normal file
20
opkgd/files/opkgd.init
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=94
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/opkgd
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=8a2b9ba61be4f13111b32dbef9e97eb40aea5866
|
||||
PKG_SOURCE_VERSION:=1c6efa76a23b9a8236a8f6d3b43349cf1e23655a
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@@ -4,7 +4,7 @@ PKG_NAME:=port-management
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/port-management
|
||||
|
||||
@@ -3,6 +3,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=power-management
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=4.1.1
|
||||
|
||||
PKG_SOURCE_VERSION:=b1e1d6218a90b533a3492fd93b0e2b256bc23cf6
|
||||
PKG_SOURCE_VERSION:=89619c1ae8243812a71cdc0ae31491e74866f4be
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
|
||||
|
||||
@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -17,6 +17,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
@@ -17,7 +17,7 @@ PKG_SOURCE_VERSION:=d687d07a137981f4fe78cc289b040e6426c61e29
|
||||
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/samba2/Default
|
||||
|
||||
@@ -18,6 +18,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/samba-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
#PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/nls.mk
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://www.routemeister.net/projects/sipcalc/files \
|
||||
http://download.google.com/mirror
|
||||
PKG_MD5SUM:=8d59e70d21d8f0568e310d342e3e2306
|
||||
|
||||
PKG_LICENSE:=NONSTANDARD_PERMISSIV
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/sipcalc
|
||||
|
||||
@@ -12,7 +12,8 @@ PKG_NAME:=speedtest-cli
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE:=speedtest_cli.py
|
||||
PKG_SOURCE_URL:=https://raw.githubusercontent.com/sivel/speedtest-cli/master
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/speedtest-cli
|
||||
|
||||
@@ -15,7 +15,8 @@ PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/topologyd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/topologyd
|
||||
|
||||
@@ -11,7 +11,8 @@ PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/tptest.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
TARGET_LDFLAGS+= \
|
||||
|
||||
@@ -11,7 +11,7 @@ PKG_SOURCE_VERSION:=e53d492a09c433718a520987c419cb6a4d4ae8dc
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1-only Apache-2.0
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_TR064_DEBUG \
|
||||
CONFIG_TR064_DEVEL
|
||||
|
||||
11
tr098/Config.in
Normal file
11
tr098/Config.in
Normal file
@@ -0,0 +1,11 @@
|
||||
if PACKAGE_libtr098
|
||||
|
||||
config LIBTR098_VENDOR_PREFIX
|
||||
string "TR-098 Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config UPNP_TR064
|
||||
bool "Compile with tr064 features"
|
||||
default n
|
||||
|
||||
endif
|
||||
73
tr098/Makefile
Normal file
73
tr098/Makefile
Normal file
@@ -0,0 +1,73 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libtr098
|
||||
PKG_VERSION:=1.0-2019-12-11
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/tr-098
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ce93aebda4c14cfc43a7a60d67d4716a576171fd
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libtr098
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Library for broadband-forum data model
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace
|
||||
endef
|
||||
|
||||
define Package/libtr098/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libtr098/description
|
||||
Test description will update later.
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBTR098_VENDOR_PREFIX)\\\"
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifeq ($(CONFIG_UPNP_TR064),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr064
|
||||
endif
|
||||
|
||||
define Package/libtr098/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libtr098.so* $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/etc/tr098
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/tr098
|
||||
$(INSTALL_DIR) $(1)/usr/share/tr098
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/tr098
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/libtr098
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libtr098/
|
||||
$(CP) $(PKG_BUILD_DIR)/tr098/*.h $(1)/usr/include/libtr098/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libtr098.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libtr098))
|
||||
@@ -24,6 +24,8 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSI
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
|
||||
# u-boot for mips_intel do not build in parallel.
|
||||
#PKG_BUILD_PARALLEL:=1
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=NONE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -5,14 +5,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=eeb458e2f5b309ec9290388863d73d8bdf176484
|
||||
PKG_SOURCE_VERSION:=ad23aa1ce58fe769c7cfa57673376400c0556580
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -20,7 +22,7 @@ define Package/uspd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=USP ubus backend
|
||||
DEPENDS:=+libubox +ubus +icwmp-curl
|
||||
DEPENDS:=+libubox +ubus +libbbfdm
|
||||
endef
|
||||
|
||||
define Package/uspd/description
|
||||
|
||||
@@ -8,7 +8,7 @@ PKG_NAME:=voice-client
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
|
||||
@@ -29,7 +29,7 @@ define Package/voice-client
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=voice-client
|
||||
DEPENDS:=+asterisk13
|
||||
DEPENDS:=@TARGET_HAS_VOICE
|
||||
endef
|
||||
|
||||
define Package/voice-client/description
|
||||
|
||||
@@ -153,7 +153,6 @@ assemble_and_copy_config()
|
||||
[ -f $TMPL_ASTERISK ] && cp $TMPL_ASTERISK $WORKDIR/asterisk.conf
|
||||
[ -f $TMPL_CDR ] && cp $TMPL_CDR $WORKDIR/cdr.conf
|
||||
[ -f $TMPL_CEL ] && cp $TMPL_CEL $WORKDIR/cel.conf
|
||||
[ -f $TMPL_INDICATIONS ] && cp $TMPL_INDICATIONS $WORKDIR/indications.conf
|
||||
[ -f $TMPL_MANAGER ] && cp $TMPL_MANAGER $WORKDIR/manager.conf
|
||||
[ -f $TMPL_MODULES ] && cp $TMPL_MODULES $WORKDIR/modules.conf
|
||||
[ -f $TMPL_EXTENSIONS_MACRO ] && cp $TMPL_EXTENSIONS_MACRO $WORKDIR/extensions_macro.conf
|
||||
@@ -165,6 +164,14 @@ assemble_and_copy_config()
|
||||
[ -f $TMPL_UDPTL ] && cp $TMPL_UDPTL $WORKDIR/udptl.conf
|
||||
[ -f $SPECRATECFG ] && cp $SPECRATECFG $WORKDIR/special_rate_nr.cfg
|
||||
|
||||
[ -f $TMPL_INDICATIONS ] && {
|
||||
cp $TMPL_INDICATIONS $WORKDIR/indications.conf
|
||||
|
||||
config_get country TEL country
|
||||
country_code=$(supportedCountries |grep $country |cut -d':' -f3 |tr [A-Z] [a-z])
|
||||
sed -i "s/^country=.*/country=${country_code}/g" $WORKDIR/indications.conf
|
||||
}
|
||||
|
||||
test -e $TMPL_MEETME && cp $TMPL_MEETME $WORKDIR/meetme.conf
|
||||
|
||||
# Handle extensions_extra, carry over old file to new config if there is one
|
||||
@@ -256,9 +263,7 @@ read_codecs_ptime()
|
||||
#
|
||||
read_lines()
|
||||
{
|
||||
local line call_lines lineid ldx lines llength clength
|
||||
local loffset=$(ubus -t 1 call voice.asterisk platform | jsonfilter -e @.lineoffset)
|
||||
loffset=${loffset:-0}
|
||||
local line call_lines lines clength
|
||||
|
||||
config_get call_lines $1 call_lines
|
||||
|
||||
@@ -267,28 +272,17 @@ read_lines()
|
||||
# convert line format to <LINENAME><LINEID>
|
||||
case $line in
|
||||
[0-9])
|
||||
line="$LINENAME$line"
|
||||
;;
|
||||
"$CHANNELNAME"/[0-9])
|
||||
# get the index from channel name
|
||||
clength=$(echo $CHANNELNAME | wc -c)
|
||||
line="$LINENAME${line:$clength}"
|
||||
line="${line:$clength}"
|
||||
;;
|
||||
esac
|
||||
|
||||
# get the index from line name
|
||||
# llength=$(echo $LINENAME | wc -c)
|
||||
# lineid="${lineid:$llength}"
|
||||
[ -n "$line" ] || continue
|
||||
|
||||
# get the index from uci config order
|
||||
lineid="$(uci show voice_client | grep =tel_line | grep -wn $line | cut -d ':' -f1)"
|
||||
|
||||
[ -n "$lineid" ] || continue
|
||||
|
||||
# -1 to match the line's uci config index number
|
||||
# +loffset to match the correct number in channel driver
|
||||
ldx=$((lineid-1+loffset))
|
||||
|
||||
lines="$lines$CHANNELNAME/$ldx&"
|
||||
lines="$lines$CHANNELNAME/$line&"
|
||||
done
|
||||
|
||||
lines=$(escape_sed_substitution $lines)
|
||||
@@ -1795,6 +1789,7 @@ configure_tel()
|
||||
local fac
|
||||
local echocancel
|
||||
local hold_target_before_refer
|
||||
local calleridtype
|
||||
|
||||
config_get jbenable TEL jbenable
|
||||
config_get jbforce TEL jbforce
|
||||
@@ -1805,6 +1800,7 @@ configure_tel()
|
||||
config_get fac TEL fac
|
||||
config_get echocancel TEL echo_cancel
|
||||
config_get hold_target_before_refer TEL hold_target_before_refer
|
||||
config_get calleridtype TEL calleridtype
|
||||
|
||||
CHANNEL_FAC="$CHANNEL_FAC $fac"
|
||||
# Convert whitespace to commas
|
||||
@@ -1823,6 +1819,12 @@ configure_tel()
|
||||
sed -i "s/|CHANNELS|/$(db get hw.board.VoicePorts)/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|ECHOCANCEL|/$(getEchoCancellingValue $echocancel)/" $WORKDIR/$LINENAME.tmp
|
||||
|
||||
if [ -n "${calleridtype}" ] ; then
|
||||
sed -i "s/^calleridtype *=.*/calleridtype = ${calleridtype}/g" $WORKDIR/$LINENAME.tmp
|
||||
else
|
||||
sed -i "/^calleridtype *=.*/d" $WORKDIR/$LINENAME.tmp
|
||||
fi
|
||||
|
||||
if [ "$dtmfmode" == "compatibility" ] ; then
|
||||
dtmfcompatibility="1"
|
||||
else
|
||||
@@ -2243,6 +2245,7 @@ reload_service() {
|
||||
# FXS channel module must be reloaded before sip module. Otherwise some attributes like
|
||||
# line's registration state which is updated by SIP module through callback might be
|
||||
# reset.
|
||||
asterisk -rx "config reload $ASTERISKDIR/indications.conf"
|
||||
asterisk -rx "$(getChipVendor) reload"
|
||||
asterisk -rx "config reload $ASTERISKDIR/sip.conf"
|
||||
sleep 1
|
||||
|
||||
@@ -37,27 +37,6 @@ EOT
|
||||
|
||||
}
|
||||
|
||||
# Default phone volume for iopsysWrt 4.X.
|
||||
uci -q batch <<-EOT
|
||||
set voice_client.$(getLineName)0.txgain=4
|
||||
set voice_client.$(getLineName)0.rxgain=4
|
||||
set voice_client.$(getLineName)1.txgain=4
|
||||
set voice_client.$(getLineName)1.rxgain=4
|
||||
set voice_client.$(getLineName)2.txgain=4
|
||||
set voice_client.$(getLineName)2.rxgain=4
|
||||
set voice_client.$(getLineName)3.txgain=4
|
||||
set voice_client.$(getLineName)3.rxgain=4
|
||||
set voice_client.$(getLineName)4.txgain=4
|
||||
set voice_client.$(getLineName)4.rxgain=4
|
||||
set voice_client.$(getLineName)5.txgain=4
|
||||
set voice_client.$(getLineName)5.rxgain=4
|
||||
set voice_client.$(getLineName)6.txgain=4
|
||||
set voice_client.$(getLineName)6.rxgain=4
|
||||
set voice_client.$(getLineName)7.txgain=4
|
||||
set voice_client.$(getLineName)7.rxgain=4
|
||||
commit voice_client
|
||||
EOT
|
||||
|
||||
# Add firewall include
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.sip
|
||||
|
||||
@@ -22,7 +22,7 @@ getBaseMAC() {
|
||||
}
|
||||
|
||||
getAllLines() {
|
||||
echo "BRCM/0&BRCM/1&BRCM/2&BRCM/3&BRCM/4&BRCM/5&BRCM/6"
|
||||
echo "BRCM/0&BRCM/1&BRCM/2&BRCM/3&BRCM/4&BRCM/5"
|
||||
}
|
||||
|
||||
getLineIdx() {
|
||||
|
||||
@@ -28,12 +28,11 @@ getBaseMAC() {
|
||||
}
|
||||
|
||||
getAllLines() {
|
||||
echo "TAPI/1&TAPI/2&TAPI/3&TAPI/4&TAPI/5&TAPI/6"
|
||||
echo "TAPI/0&TAPI/1"
|
||||
}
|
||||
|
||||
getLineIdx() {
|
||||
i=$1
|
||||
echo $((i+1))
|
||||
echo $1
|
||||
}
|
||||
|
||||
getEchoCancellingValue() {
|
||||
@@ -52,5 +51,14 @@ getEchoCancellingValue() {
|
||||
}
|
||||
|
||||
supportedCountries() {
|
||||
echo "ETSI:ETS"
|
||||
echo "Austria:AUT:AT"
|
||||
echo "Denmark:DNK:DK"
|
||||
echo "Estonia:EST:EE"
|
||||
echo "Germany:DEU:DE"
|
||||
echo "Netherlands:NLD:NL"
|
||||
echo "Norway:NOR:NO"
|
||||
echo "Spain:ESP:ES"
|
||||
echo "Sweden:SWE:SE"
|
||||
echo "Switzerland:CHE:CH"
|
||||
echo "United Kingdom:GBR:UK"
|
||||
}
|
||||
|
||||
@@ -103,9 +103,8 @@ case "$1" in
|
||||
echo $uniqueid | grep "[A-Z,a-z]" && continue
|
||||
from="$(echo $line | cut -d',' -f2)"
|
||||
to="$(echo $line | cut -d',' -f3)"
|
||||
callok=0
|
||||
uci show voice_client | grep user | grep -wq "$from\|$to" && callok=1
|
||||
[ $callok -eq 0 ] && continue
|
||||
# "from" will be empty for call log of internal call (beween extension numbers)
|
||||
[ -z "$from" ] && [ -z "$to" ] && continue
|
||||
account="$(echo $line | cut -d',' -f4)"
|
||||
actok=0
|
||||
uci show voice_client | grep sip_service_provider | grep -wq "$account" && actok=1
|
||||
@@ -138,8 +137,8 @@ case "$1" in
|
||||
json_add_int chanoffset 0
|
||||
;;
|
||||
"tapi")
|
||||
json_add_int lineoffset 1
|
||||
json_add_int chanoffset -1
|
||||
json_add_int lineoffset 0
|
||||
json_add_int chanoffset 0
|
||||
;;
|
||||
*)
|
||||
# Error, unknown platform
|
||||
|
||||
@@ -18,7 +18,8 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/voicesec
|
||||
|
||||
@@ -7,9 +7,12 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=wifilife
|
||||
PKG_VERSION:=2.5.0
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=9b9a787120743d121ce867251af45da076fe7cce
|
||||
PKG_SOURCE_VERSION:=878ad93c0f1ad49bd187f776808e0b86402b2238
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
ifeq ($(CONFIG_WIFILIFE_OPEN),y)
|
||||
TARGET_PROD=$(shell echo $(CONFIG_TARGET_BOARD) | sed s/\"//g)
|
||||
PKG_SOURCE_URL:=http://download.iopsys.eu/iopsys/opensdk/
|
||||
|
||||
@@ -8,12 +8,14 @@ PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=2.4.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c4063e9c5581fed6e75037d0b13698b7cb2d6c2a
|
||||
PKG_SOURCE_VERSION:=4b876ccabc1df73202bfb165b35fd6464ed019aa
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -8,12 +8,14 @@ PKG_NAME:=wifixd
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7aae246602af0df883ddefb83147010a457c2725
|
||||
PKG_SOURCE_VERSION:=cd63143c262e079d4a782ccfa60111f342e42e3e
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
Reference in New Issue
Block a user