Compare commits

..

1 Commits

Author SHA1 Message Date
Arun Muthusamy
0b1986c99e openvswitch feed package 2018-09-10 14:58:57 +02:00
550 changed files with 20236 additions and 29189 deletions

67
ated/Makefile Normal file
View File

@@ -0,0 +1,67 @@
#
# Copyright (C) 2016 inteno
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=ated
PKG_VERSION:=1.2.2
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=f614cba983d827d5185c60a6a5a35530621d44d2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=http://public.inteno.se:/ated
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)
# support parallel build
#PKG_BUILD_PARALLEL:=1
#re create configure scripts if not present.
#PKG_FIXUP:=autoreconf
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
# this way we don't need to pick out the resulting files from the build dir.
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/ated
CATEGORY:=Utilities
TITLE:=Daemon for handling wifi calibration
URL:=
DEPENDS:= libc
endef
define Package/ated/description
Daemon for handling wifi calibration
endef
#TARGET_CFLAGS += -I$(LINUX_DIR)/include -I$(LINUX_DIR)/arch/mips/include
MAKE_FLAGS += \
v=2 \
m=3
#TARGET_CPPFLAGS := \
# -I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
# -I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
# $(TARGET_CPPFLAGS)
# we donot wwant to have any install.
define Build/Install/Default
endef
define Package/ated/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ated $(1)/sbin/
endef
$(eval $(call BuildPackage,ated))

View File

@@ -13,9 +13,6 @@ PKG_MD5SUM:=b72c17870bfab2fd791b1f6de4d79f9e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)

View File

@@ -1,35 +0,0 @@
config BBF_VENDOR_EXTENSION
bool "Enable Vendor Extension"
default y
config BBF_VENDOR_LIST
string "Vendor List"
default "iopsys"
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
config BBF_TR471
bool "Enable TR-471 Data Model Support"
default y
config BBFDM_ENABLE_JSON_PLUGIN
bool "Enable json plugin to extend datamodel"
default y
config BBFDM_ENABLE_DOTSO_PLUGIN
bool "Enable shared library plugin to extend datamodel"
default y
config BBF_MAX_OBJECT_INSTANCES
int "Maximum number of instances per object"
default 255

View File

@@ -1,213 +0,0 @@
#
# Copyright (C) 2022 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libbbfdm
PKG_VERSION:=6.8.49
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
PKG_SOURCE_VERSION:=87ae46df8b4e221b8894fd861d2eb785ae1f3bf3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_LICENSE:=LGPL-2.1
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libbbf_api
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF datamodel library, provides API to extend datamodel using DotSO plugins
ABI_VERSION:=1.0
endef
define Package/libbbfdm/default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Library for broadband forum data model support
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl +libbbf_api \
+BBF_TR471:obudpst
endef
define Package/libbbfdm
$(Package/libbbfdm/default)
TITLE += (internal)
VARIANT:=internal
endef
define Package/libbbfdm-mbedtls
$(Package/libbbfdm/default)
TITLE += (mbedtls)
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
VARIANT:=mbedtls
DEFAULT_VARIANT:=1
endef
define Package/libbbfdm-openssl
$(Package/libbbfdm/default)
TITLE += (openssl)
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
CONFLICTS := libbbfdm-mbedtls
VARIANT:=openssl
endef
define Package/libbbfdm-wolfssl
$(Package/libbbfdm/default)
TITLE += (wolfssl)
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
CONFLICTS := libbbfdm-mbedtls libbbfdm-openssl
VARIANT:=wolfssl
endef
define Package/userinterface
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=Package to add Device.UserInterface. datamodel support
endef
define Package/userinterface/description
Package to add Device.UserInterface. datamodel support using libbbf JSON Plugin
endef
define Package/libbbfdm/config
source "$(SOURCE)/Config_bbfdm.in"
endef
define Package/libbbf_api/description
Library contains the API(UCI, UBUS, JSON, CLI and Browse) of libbbfdm
endef
define Package/libbbfdm/description
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)
ifneq ($(USE_LOCAL),)
define Build/Prepare
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
endif
CMAKE_OPTIONS += \
-DBBF_TR181=ON
ifeq ($(CONFIG_BBF_TR104),y)
CMAKE_OPTIONS += \
-DBBF_TR104=ON
endif
ifeq ($(CONFIG_BBF_TR143),y)
CMAKE_OPTIONS += \
-DBBF_TR143=ON
endif
ifeq ($(CONFIG_BBF_TR471),y)
CMAKE_OPTIONS += \
-DBBF_TR471=ON
endif
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
CMAKE_OPTIONS += \
-DBBF_VENDOR_EXTENSION=ON
CMAKE_OPTIONS += \
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
endif ##CONFIG_BBF_VENDOR_EXTENSION
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
CMAKE_OPTIONS += \
-DBBF_JSON_PLUGIN=ON
endif
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
CMAKE_OPTIONS += \
-DBBF_DOTSO_PLUGIN=ON
endif
ifeq ($(BUILD_VARIANT),openssl)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
ifeq ($(BUILD_VARIANT),wolfssl)
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
endif
ifeq ($(BUILD_VARIANT),mbedtls)
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
endif
define Package/libbbf_api/install
$(INSTALL_DIR) $(1)/lib
endef
define Package/libbbfdm/default/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/lib/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
endef
define Package/libbbfdm/default/prerm
#!/bin/sh
rm -rf /etc/bbfdm/dmmap/*
exit 0
endef
define Package/userinterface/install
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DATA) ./files/etc/bbfdm/json/UserInterface.json $(1)/etc/bbfdm/json/
$(INSTALL_DATA) ./files/etc/config/userinterface $(1)/etc/config/userinterface
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
endef
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
Package/libbbfdm-openssl/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-wolfssl/install = $(Package/libbbfdm/default/install)
Package/libbbfdm-mbedtls/install = $(Package/libbbfdm/default/install)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
$(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/usr/lib/
endef
$(eval $(call BuildPackage,userinterface))
$(eval $(call BuildPackage,libbbf_api))
$(eval $(call BuildPackage,libbbfdm))
$(eval $(call BuildPackage,libbbfdm-openssl))
$(eval $(call BuildPackage,libbbfdm-wolfssl))
$(eval $(call BuildPackage,libbbfdm-mbedtls))

View File

@@ -1,117 +0,0 @@
{
"Device.UserInterface.": {
"type": "object",
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"Device.UserInterface.RemoteAccess.": {
"type": "object",
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"Enable": {
"type": "boolean",
"read": true,
"write": true,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "userinterface",
"section": {
"name": "remote_access"
},
"option": {
"name": "enable"
}
}
}
]
},
"Port": {
"type": "unsignedInt",
"read": true,
"write": true,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"range": [
{
"max": 65535
}
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "userinterface",
"section": {
"name": "remote_access"
},
"option": {
"name": "port"
}
}
}
]
},
"SupportedProtocols": {
"type": "string",
"read": true,
"write": false,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"list": {
"datatype": "string",
"enumerations": [
"HTTP",
"HTTPS"
]
},
"default": "HTTP"
},
"Protocol": {
"type": "string",
"read": true,
"write": true,
"version": "2.0",
"protocols": [
"cwmp",
"usp"
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "userinterface",
"section": {
"name": "remote_access"
},
"option": {
"name": "protocol"
}
}
}
]
}
}
}
}

View File

@@ -1,6 +0,0 @@
config userinterface 'remote_access'
option enable '0'
option interface 'wan'
option port '80'
option protocol 'HTTP'

View File

@@ -1,85 +0,0 @@
#!/bin/sh
#!/bin/sh
. /lib/functions.sh
IDENTIFIER="REMOTE-ACCESS-WAN"
log() {
echo "${@}"|logger -t firewall.userinterface -p info
}
if [ ! -f "/etc/config/userinterface" ]; then
exit 0;
fi
exec_cmd() {
if ! "$@"; then
log "Failed to run [$*]"
fi
}
configure_firewall_rule() {
local enable port protocol gui_port
local zone interface
config_load userinterface
config_get_bool enable remote_access enable 1
config_get port remote_access port
config_get interface remote_access interface
if [ "${enable}" -eq "0" ] || [ -z "${port}" ] || [ -z "${interface}" ]; then
return 0;
fi
zone="zone_${interface}_input"
iptables -w 1 -t filter -nL "${zone}" 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
iptables -w 1 -I "${zone}" -p tcp -m multiport --dports "${port}" -m conntrack --ctstate NEW,ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
zone="zone_${interface}_output"
iptables -w 1 -t filter -nL "${zone}" 2>/dev/null 1>&2
if [ "$?" -eq 0 ]; then
iptables -w 1 -I "${zone}" -p tcp -m multiport --dports "${port}" -m conntrack --ctstate ESTABLISHED -m comment --comment "${IDENTIFIER}" -j ACCEPT
fi
}
delete_firewall_rule() {
local zone interface
local CMD
config_load userinterface
config_get interface remote_access interface
# Clean remote interface rules
if [ -z "${interface}" ]; then
return 0
fi
zone="zone_${interface}_input"
CMD="iptables -w 1 -t filter -nL ${zone} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd iptables -w 1 -t filter -D "${zone}" "${rule_num}";
fi
done
zone="zone_${interface}_output"
CMD="iptables -w 1 -t filter -nL ${zone} --line-numbers"
while ${CMD} 2>/dev/null | grep "${IDENTIFIER}"; do
rule_num="$(${CMD} | grep "${IDENTIFIER}" | head -1|awk '{print $1}')"
if [ -n "${rule_num}" ]; then
exec_cmd iptables -w 1 -t filter -D "${zone}" "${rule_num}";
fi
done
}
# Delete existing remote access rules
delete_firewall_rule
# Configure the User Interface rule
configure_firewall_rule

View File

@@ -1,27 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
STOP=01
USE_PROCD=1
start_service() {
local enable
procd_open_instance usp
config_load userinterface
config_get_bool enable global enable 1
# Inject firewall rules
if [ "${enable}" -eq "1" ]; then
/etc/firewall.userinterface
fi
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "userinterface"
}

View File

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

View File

@@ -1 +0,0 @@
/etc/bbfdm/sysctl.conf

View File

@@ -1,42 +0,0 @@
#
# Copright (C) 2018 The Internet Foundation In Sweden
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bbk_cli
PKG_SOURCE_VERSION:=7b810a696c78b746185c11282bdbe3fb7f8c5d4b
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/dotse/bbk.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/bbk_cli
CATEGORY:=Utilities
DEPENDS:=+libpthread +libstdcpp
TITLE:=Bredbandskollen CLI - A bandwidth measurement tool
endef
define Package/bbk_cli/description
To measure connection speed in an environment that is missing a web browser,
for example, in a server, you can use our command line interface bbk_cli,
which is available for some of the most common operating systems.
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR)/src/cli CROSS_COMPILE="$(TARGET_CROSS)"
endef
define Package/bbk_cli/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cli/cli $(1)/sbin/bbk_cli
endef
$(eval $(call BuildPackage,bbk_cli))

View File

@@ -1,25 +0,0 @@
diff --git a/src/framework/engine.h b/src/framework/engine.h
index 57a48ad..9e1bc36 100644
--- a/src/framework/engine.h
+++ b/src/framework/engine.h
@@ -10,6 +10,7 @@
#include <map>
#include <vector>
#include <string>
+#include <sys/select.h>
#include "logger.h"
diff --git a/src/framework/mk.inc b/src/framework/mk.inc
index 793e211..13275be 100644
--- a/src/framework/mk.inc
+++ b/src/framework/mk.inc
@@ -7,7 +7,7 @@ OS:=$(shell uname)
CXXFLAGS += -O2 -W -Wall -I$(DIRLEVEL)
ifeq ($(OS),Linux)
-CXX = g++
+CXX = $(CROSS_COMPILE)g++
endif
ifeq ($(OS),Darwin)

View File

@@ -18,9 +18,6 @@ PKG_SOURCE_VERSION:=3ab81137cafe25c2ca4bc3a5f322a63646f9ce8d
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/bootchart2

View File

@@ -1,56 +0,0 @@
#
# Copyright (C) 2022 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:=bulkdata
PKG_VERSION:=2.0.10
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
PKG_SOURCE_VERSION:=6e85d2032e66df581fae7c72cd83cc89367b8fc8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
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/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=BBF BulkData Collection
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE \
-Wall -Werror
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ~/git/bulkdata/* $(PKG_BUILD_DIR)/
endef
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(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
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,6 +0,0 @@
config bulkdata 'bulkdata'
option enable '0'
#Log levels: Error=1, Warning=2, Info=3, Debug=4
option log_level '3'

View File

@@ -1,31 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
STOP=10
USE_PROCD=1
PROG="/usr/sbin/bulkdatad"
start_service() {
local enable
config_load bulkdata
config_get_bool enable bulkdata enable 1
procd_open_instance bulkdata
[ "$enable" -eq "1" ] && {
procd_set_param command "$PROG"
procd_set_param respawn "3" "7" "0"
}
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger bulkdata
}

View File

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

View File

@@ -1,38 +0,0 @@
#
# Copyright (C) 2019 IOPSYS
#
include $(TOPDIR)/rules.mk
PKG_NAME:=bulut
PKG_VERSION:=0.2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bulut/bulut-gw-client.git
PKG_SOURCE_VERSION:=227700c44817afa2c392fa08bf4cf70fa6177f01
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/bulut
CATEGORY:=Utilities
DEPENDS:=
TITLE:=bulut
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include
define Package/bulut/description
obuspa keys
endef
define Package/bulut/install
$(CP) $(PKG_BUILD_DIR)/files/* $(1)/
endef
$(eval $(call BuildPackage,bulut))

View File

@@ -1,19 +1,9 @@
#
# Copyright (C) 2018 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:=catv
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/catv

Binary file not shown.

View File

@@ -1,4 +1,7 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2015 inteno.org
#
START=71
USE_PROCD=1

31
crashlog/Makefile Normal file
View File

@@ -0,0 +1,31 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=crashlog
PKG_VERSION:=1.0.0
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/crashlog
CATEGORY:=Utilities
TITLE:=Handling kernel crash logs
endef
define Package/crashlog/description
Handling kernel crash logs.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./files/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/crashlog/install
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,crashlog))

Binary file not shown.

View File

@@ -0,0 +1,11 @@
#!/bin/sh /etc/rc.common
START=01
start()
{
if [ -e /proc/sys/kernel/core_pattern ]
then
echo "|/sbin/logcore %e %s" > /proc/sys/kernel/core_pattern
fi
}

View File

@@ -0,0 +1,56 @@
#!/bin/sh /etc/rc.common
START=99
send_log()
{
nr=$(db get hw.board.serialNumber)
hw=$(db get hw.board.hardware)
hwv=$(db get hw.board.hardwareVersion)
bid=$(db get hw.board.boardId)
sw=$(db get hw.board.iopVersion)
server=$(/sbin/uci get system.crashlog.server)
while true
do
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${bid}_${hwv}_${hw}_${sw}_${nr}
if [ $? == 0 ]
then
break;
fi
# wait for another minute then try again
sleep 60
done
}
fill_in_default()
{
/sbin/uci add system log
/sbin/uci rename system.@log[-1]=crashlog
/sbin/uci set system.crashlog.enable=no
/sbin/uci set system.crashlog.server="crash.inteno.se"
/sbin/uci commit
}
boot()
{
# is crashlog enabled ?
enable=$(/sbin/uci get system.crashlog.enable)
case $enable in
0|no|NO|false|FALSE)
exit 0
;;
"")
fill_in_default
exit 0
;;
esac
# is this boot a result from a crash ?
reason=$(cat /etc/boot_reason)
case $reason in
HW|WD)
send_log&
;;
esac
}

61
crashlog/files/sbin/logcore Executable file
View File

@@ -0,0 +1,61 @@
#! /bin/sh
TMP_CORE=/tmp/new_core
# first test if we can contact the log server.
# if not abort directly the core file takes up memory
alive()
{
ping -c1 $server
if [ $? != 0 ]
then
# drain core file from kernel
cat >/dev/null
exit 0
fi
}
fill_in_default()
{
/sbin/uci add system log
/sbin/uci rename system.@log[-1]=corelog
/sbin/uci set system.corelog.enable=no
/sbin/uci set system.corelog.server="crash.inteno.se"
/sbin/uci commit
}
# is corelog enabled ?
enable=$(/sbin/uci get system.corelog.enable)
case $enable in
0|no|NO|false|FALSE)
# drain core file from kernel
cat >/dev/null
exit 0
;;
"")
fill_in_default
exit 0
;;
esac
server=$(/sbin/uci get system.corelog.server)
alive
# dump out the core to disk we need this as scp needs a size before we send data
# and this is the only way to know how much data there is
cat >$TMP_CORE
# in case filesystem/memory is full at least kill the core in the kernel memory should give us some
# more memory to work with. normally this would do nothing.
cat >/dev/null
nr=$(db get hw.board.serialNumber)
hw=$(db get hw.board.hardware)
hwv=$(db get hw.board.hardwareVersion)
bid=$(db get hw.board.boardId)
sw=$(db get hw.board.iopVersion)
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${bid}_${hwv}_${hw}_${sw}_${nr}
rm $TMP_CORE

6
crashlog/files/usr/sbin/logssh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
# we need to have the -y option to dropbear to not halt the scp when
# transfering the log file to a new server for the first time.
# since we already need this also put in the keyfile
ssh -y -i /etc/dropbear/logid $@

42
crashlog/readme Normal file
View File

@@ -0,0 +1,42 @@
Install scp server.
Create a user account on a server and make sure it's possible to login to it
using ssh.
For now the user has to be called "log"
USER is the user name of the account
HOME is the user home directory.
Both should be changed to the correct value in all following example commands.
create HOME/bin
Put scp_upload in HOME/bin
make it executable "chmod a+x HOME/bin/scp_upload"
create home/.ssh (observer the dot .shh)
create an empty file HOME/.ssh/authorized_keys
-------------------------------
Now everyhting is setup for use but we have not added any clients.
What we need is the public key for the clients.
For dropbear "dropbearkey -y -f files/etc/dropbear/logid" will generate the public key.
----------
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwn9RaDAzxW1dTmIhXgFBnpi1lhj8xhYpCVQiPxxdk9IEmH8zjo4y9j3sPkqKOlRnkwjpZIpLEKBnpQTwVIMCU/AG7nDJX3OH9RfS9mLJQLfFL8HyGCyqDezFWldbyovhJZvdUeK4tAXJWv2W3OVHiz2L8IlncBgP/E9DJElsyhhQHsM96UE6tBkXsvXkoDbMSYXFcLbgiUwBKfmM2BF/aPDL45iznGur7/2j9v95PwJ0gtMu9jjNRq+pXCXhTh3bsnczm0MpZC1aiRc9nJAeGIMmhrf15E4jBKgTnrstzJxGVAdajKeR954KcNsS33cS2Wmui2YjmPbBXjqf1frzJ log@inteno
----------
The public key should be just one line. Add that line to the
HOME/.ssh/authorized_keys file on the scp server. Then add the follwoing as
the first text on the same line. that is insert before the key data.
command="HOME/bin/scp_upload",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
Do not forget to change HOME to the correct value for the server and there
should be one space separating the key data and the above text.
---------------------------------
Now test to make sure that you can upload new files, not download files
and not overwrite files from the client.

53
crashlog/scp_upload Normal file
View File

@@ -0,0 +1,53 @@
#! /bin/bash
# authorized_keys command="/home/boxi/my_scp",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
val=`expr match "$SSH_ORIGINAL_COMMAND" "scp"`
if [ $val != 3 ]
then
echo "only scp is allowed for this rsa key"
exit 1
fi
#strip out "scp" as getopts barf on anything not an option
args=${SSH_ORIGINAL_COMMAND:3}
# we must set args to positional paramters otherwise it's next to impossible
# to get to the rest of the line that is not arguments.
set -- $args
while getopts "rftdvpq" Option
do
case $Option in
r ) echo "recursive not allowed";exit 1;;
f ) echo "reading files not allowed";exit 1;;
t ) ;;
d ) ;;
v ) ;;
p ) ;;
q ) ;;
* ) ;; # Default.
esac
done
shift $(($OPTIND - 1))
file="$*"
dir=$(dirname "$file")
if [ "$dir" != "log" ]
then
echo "only allowed to write to log/"
exit 1
fi
# try to create uniq files
EXTRA=$((0))
while [ -e "${file}_${EXTRA}" ]
do
EXTRA=$((EXTRA +1))
done
logger -t scp_upload "${SSH_ORIGINAL_COMMAND}_${EXTRA}"
exec ${SSH_ORIGINAL_COMMAND}_${EXTRA}

View File

@@ -1,11 +0,0 @@
if PACKAGE_dectmngr
menu "Configuration"
config ENABLE_LINE_SETTINGS_EXTENSION
bool "Enable Line Settings List extension "
default y
endmenu
endif

View File

@@ -1,74 +0,0 @@
#
# 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.7
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=83f89a83cf860bbcf2b7f2e030215db315a5bbbf
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=DECT Manager
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c
endef
define Package/$(PKG_NAME)/description
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
endef
endif
TARGET_CFLAGS += \
-Wall \
-Werror \
-I$(STAGING_DIR)/usr/include/libxml2
ifeq ($(CONFIG_ENABLE_LINE_SETTINGS_EXTENSION),y)
TARGET_CFLAGS += -DENABLE_LINE_SETTINGS_EXTENSION
endif
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/dectmngr
$(CP) ./files/etc/* $(1)/etc/
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dect $(1)/lib/upgrade/keep.d/dect
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,3 +0,0 @@
config dect 'global'
option log_dect_cmbs 'syslog'
option log_level 'realtime,warning,error'

Binary file not shown.

View File

@@ -1,100 +0,0 @@
#!/bin/sh /etc/rc.common
source /lib/functions/uci-defaults.sh
START=70
STOP=12
USE_PROCD=1
NAME=dectmngr
PROG=/usr/sbin/dectmngr
LOG_PATH=/var/log/dectmngr
DB_PATH=/etc/dect
DECT_GPIO=$(db -q get hw.board.dect_gpio)
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
stop_and_wait_dectmngr() {
pidof $NAME && killall -q $NAME
pidof $NAME && sleep 2 # wait for the process to stop gracefully
while pidof $NAME; do
killall -q -9 $NAME
sleep 1
done
}
start_service() {
local opt_ext=
local rfpi=
local model_id=
local rxtun=
test $(db get hw.board.hasDect) = "0" && return
[ -n "$DECT_GPIO" ] && echo 1 > /sys/class/gpio/gpio${DECT_GPIO}/value
rfpi=$(db -q get hw.board.dect_rfpi)
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
model_id=$(db -q get hw.board.dect_model_id)
[ -n "$model_id" -a ${#model_id} -eq 8 ] || {
echo "Invalid hw.board.dect_model_id:$model_id. Set to 30.3B.06"
model_id="30.3B.06"
}
opt_ext="$opt_ext -model $model_id"
rxtun=$(db -q get hw.board.dect_rxtun)
[ -n "$rxtun" -a ${#rxtun} -eq 2 ] && opt_ext="$opt_ext -rxtun $rxtun"
config_load dect
config_get log_dect_cmbs global log_dect_cmbs syslog
procd_open_instance
if [ "$log_dect_cmbs" = "none" ]; then
echo "Starting dectmngr with cmbs logging disabled"
procd_set_param command $PROG -comname ttyH0 $opt_ext
rm -f $LOG_PATH/*
elif [ "$log_dect_cmbs" = "file" ]; then
echo "Starting dectmngr with cmbs logging enabled to file"
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
else
echo "Starting dectmngr with cmbs logging enabled to syslog"
procd_set_param command $PROG -comname ttyH0 -syslog $opt_ext
rm -f $LOG_PATH/*
fi
procd_set_param respawn 6 2 3
procd_set_param term_timeout 20
procd_set_param triggers asterisk
procd_close_instance
}
stop_service() {
test $(db get hw.board.hasDect) = "0" && return
[ -n "$DECT_GPIO" ] && echo 0 > /sys/class/gpio/gpio${DECT_GPIO}/value
stop_and_wait_dectmngr
}
reload_service() {
ubus call dect reload
}
service_triggers()
{
procd_add_config_trigger "config.change" "asterisk" /etc/init.d/dectmngr restart
procd_add_config_trigger "config.change" "dect" /etc/init.d/dectmngr reload
}
boot() {
[ -n "$DECT_GPIO" ] && {
echo ${DECT_GPIO} > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio${DECT_GPIO}/direction
}
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
start
}

View File

@@ -1 +0,0 @@
/etc/dect/LA_DB

54
dectmngr2/Makefile Normal file
View File

@@ -0,0 +1,54 @@
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=1.2.0
PKG_SOURCE_URL:=http://public.inteno.se:/dectmngr2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=877fcbd58d0ead82dbbc4c65f0ad7f8c938fcf74
PKG_NAME:=dectmngr2
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/dectmngr2
CATEGORY:=Utilities
TITLE:=Dectmngr2
URL:=
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus
endef
define Package/dectmngr2/description
Dectmngr2
endef
define Package/dectmngr2/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/dect/
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dectmngr2 $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/nvs_default $(1)/etc/dect/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dectmngr-wrapper.sh $(1)/usr/sbin/
$(CP) ./files/dect.config $(1)/etc/config/dect
endef
$(eval $(call BuildPackage,dectmngr2))

View File

@@ -0,0 +1,4 @@
config dect 'dect'
option radio 'auto'

View File

@@ -1,79 +0,0 @@
#
# Copyright (C) 2018 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:=dslmngr
PKG_VERSION:=1.2.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
else
$(info Unexpected CONFIG_TARGET)
endif
export TARGET_PLATFORM
define Package/dslmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=XDSL status and configration utility
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
endef
define Package/dslmngr/description
This package can be used to configure and provide status about
the XDSL subsystem through UBUS.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-I$(STAGING_DIR)/usr/include/xdsl \
-D_GNU_SOURCE
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)"
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/dslmngr/ $(PKG_BUILD_DIR)/
endef
endif
define Build/Compile
+$(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS)
endef
define Package/dslmngr/install
$(CP) ./files/common/* $(1)/
ifeq ($(CONFIG_TARGET_brcmbca),y)
$(CP) ./files/broadcom/* $(1)/
endif
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
endef
$(eval $(call BuildPackage,dslmngr))

View File

@@ -1,311 +0,0 @@
#!/bin/sh
. /lib/functions.sh
# ATM #
check_pvc() {
local vpi=$1
local vci=$2
local ret
ret=$(xtmctl operate conn --show | awk -v test="$vpi/$vci" '{if ($3==test ) print $5 }')
case $ret in
''|*[!0-9]*) return 0 ;;
*) return $ret ;;
esac
}
check_xtm_list() {
local qclass=$1
local pcr scr mbs
local ret
case $# in
1)
pcr=0
scr=0
mbs=0
;;
2)
pcr=$2
scr=0
mbs=0
;;
4)
pcr=$2
scr=$3
mbs=$4
;;
esac
ret=$(xtmctl operate tdte --show | awk -v test="$qclass" -v pcr="$pcr" -v scr="$scr" -v mbs="$mbs" '{if ($2==test && $3==pcr && $4==scr && $5==mbs ) print $1 }')
case $ret in
''|*[!0-9]*) return 0 ;;
*) return $ret ;;
esac
}
configure_atm_device() {
local name vpi vci device link_type encapsulation qos_class pcr mbs scr i
config_get name $1 name "ATM"
config_get vpi $1 vpi "8"
config_get vci $1 vci "35"
config_get device $1 device "atm0"
config_get link_type $1 link_type "eoa"
config_get encapsulation $1 encapsulation "llc"
config_get qos_class $1 qos_class "ubr"
config_get pcr $1 pcr
config_get mbs $1 mbs
config_get scr $1 scr
check_pvc $vpi $vci
ret=$?
if [ "$ret" -eq 0 ]; then
check_xtm_list $qos_class $pcr $scr $mbs
ret=$?
if [ "$ret" -eq 0 ]; then
case $qos_class in # ubr, cbr, gfr, vbr-nrt, vbr-rt, ubr+, abr
ubr)
xtmctl operate tdte --add "$qos_class"
;;
ubr_pcr|ubr+)
xtmctl operate tdte --add "$qos_class" $pcr
;;
cbr)
xtmctl operate tdte --add "$qos_class" $pcr
;;
nrtvbr|vbr-nrt)
xtmctl operate tdte --add "$qos_class" $pcr $scr $mbs
;;
rtvbr|vbr-rt)
xtmctl operate tdte --add "$qos_class" $pcr $scr $mbs
;;
gfr)
;;
abr)
;;
esac
fi
case $link_type in # EoA, IPoA, PPPoA, CIP
EoA|eoa)
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_eth" || encapsulation="llcsnap_eth"
;;
PPPoA|pppoa)
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_pppoa" || encapsulation="llcencaps_ppp"
;;
IPoA|ipoa)
[ $encapsulation == "vcmux" ] && encapsulation="vcmux_ipoa" || encapsulation="llcsnap_rtip"
;;
CIP|cip)
;;
esac
check_xtm_list $qos_class $pcr $scr $mbs
ret="$?"
xtmctl operate conn --add 1.$vpi.$vci aal5 $encapsulation 0 1 $ret
for i in `seq 0 7`; do
xtmctl operate conn --addq 1.$vpi.$vci $i wrr 1 dt # queue priority 0-7
done
xtmctl operate conn --createnetdev 1.$vpi.$vci $device
xtmctl operate intf --state 1 enable
fi
}
remove_atm_devices() {
local vpi vci rest
local vpivci=`xtmctl operate conn --show | grep "ATM\|mode" | awk '{if (NR!=1 && $1!="PTM") {print $3}}'`
for i in $vpivci
do
rest=${i#\/}
vpi=${rest%%\/*}
vci=${rest#*\/}
echo "xtmctl operate conn --delete 1.$vpi.$vci"
xtmctl operate conn --delete 1.$vpi.$vci
echo "xtmctl operate conn --deletenetdev 1.$vpi.$vci"
xtmctl operate conn --deletenetdev 1.$vpi.$vci
done
}
create_atm_devices() {
echo "Creating ATM Device(s)"
config_load dsl
config_foreach configure_atm_device atm-device
}
# ATM END #
# PTM #
check_ptm() {
local ret
local ptmprio=$1
local dslat=$2
if [ "$ptmprio" -eq 2 ]; then
ptmprio="high"
else
ptmprio="low"
fi
ret=$(xtmctl operate conn --show | awk -v dslat="$dslat" -v ptmprio="$ptmprio" '{if ($2 == dslat && $3 == ptmprio ) print $2 }')
case $ret in
''|*[!0-9]*) return 0 ;;
*) return $ret ;;
esac
}
configure_ptm_device() {
local name device priority portid i
config_get name $1 name "PTM"
config_get device $1 device "ptm0"
config_get priority $1 priority 1
config_get portid $1 portid 1
check_ptm $priority $portid
ret=$?
if [ "$ret" -eq 0 ]; then
xtmctl operate conn --add $portid.$priority
for i in `seq 0 7`; do
xtmctl operate conn --addq $portid.$priority $i wrr 1 dt -1 -1 3000 # queue priority 0-7
done
echo "xtmctl operate conn --createnetdev $portid.$priority $device"
xtmctl operate conn --createnetdev $portid.$priority $device
xtmctl operate intf --state 1 enable
fi
}
remove_ptm_devices() {
local delptm
local x=0
IFS=$'\n'
for i in `xtmctl operate conn --show | grep "PTM\|mode"`
do
if [ $x -eq 1 ]; then
delptm=$(echo $i | awk '{if ($1!="ATM") print $2"."$11}')
echo "xtmctl operate conn --delete $delptm"
xtmctl operate conn --delete $delptm
xtmctl operate conn --deletenetdev $delptm
fi
x=1
done
unset IFS
}
create_ptm_devices() {
echo "Creating PTM Device(s)"
config_load dsl
config_foreach configure_ptm_device ptm-device
}
# PTM END #
prioritize_arp()
{
ebtables -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
ebtables -t nat -A POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
}
xtm_remove_devices() {
remove_atm_devices
remove_ptm_devices
}
xtm_create_devices() {
local tpstc="$(xdslctl info --show | grep TPS-TC)"
if echo "$tpstc" | grep -q "ATM Mode"; then
create_atm_devices
elif echo "$tpstc" | grep -q "PTM Mode"; then
create_ptm_devices
fi
}
xdsl_configure() {
local VDSL=0
local GFAST=0
local mod=""
local modes=""
local profile=""
config_load dsl
# Modes
config_get mode line mode
for mod in $mode; do
[ $mod == "gdmt" ] && modes="${modes}d"
[ $mod == "glite" ] && modes="${modes}l"
[ $mod == "t1413" ] && modes="${modes}t"
[ $mod == "adsl2" ] && modes="${modes}2"
[ $mod == "adsl2p" ] && modes="${modes}p"
[ $mod == "annexl" ] && modes="${modes}e"
[ $mod == "annexm" ] && modes="${modes}m"
[ $mod == "vdsl2" ] && modes="${modes}v" && VDSL=1
[ $mod == "gfast" ] && modes="${modes}f" && GFAST=1
done
# VDSL Profiles
config_get profile line profile
# Capabilities
config_get_bool bitswap line bitswap 1
[ $bitswap -eq 1 ] && bitswap="on" || bitswap="off"
config_get_bool sra line sra 1
[ $sra -eq 1 ] && sra="on" || sra="off"
# config_get_bool trellis line trellis 1
config_get_bool sesdrop line sesdrop 0
[ $sesdrop -eq 1 ] && sesdrop="on" || sesdrop="off"
# VDSL2 only
config_get_bool us0 line us0 1
[ $us0 -eq 1 ] && us0="on" || us0="off"
# config_get_bool dynamicd line dynamicd 1
# config_get_bool dynamicf line dynamicf 1
config_get_bool sos line sos 0
[ $sos -eq 1 ] && sos="on" || sos="off"
config_get_bool phyReXmtUs line phyReXmtUs 0
config_get_bool phyReXmtDs line phyReXmtDs 1
phyReXmt=$(( $((phyReXmtUs<<1)) + phyReXmtDs))
if [ $VDSL -eq 1 -o $GFAST -eq 1 ]; then
echo "xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0 --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt"
xdslctl start --up --mod $modes --profile "$profile" --sra $sra --bitswap $bitswap --us0 $us0 --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt
# G.Fast hardware to VDSL hardware, to set the driver bit kPhyCfg2EnableGfastVdslMMTimeOut0.
# Enable V43 tone for GFAST.
echo "xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400"
xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400
else
echo "xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt"
xdslctl start --up --mod $modes --sra $sra --bitswap $bitswap --sesdrop $sesdrop --SOS $sos --phyReXmt $phyReXmt
fi
if [ $GFAST -eq 1 ]; then
# G.Fast hardware to VDSL hardware, to set the driver bit kPhyCfg2EnableGfastVdslMMTimeOut0.
# Enable V43 tone for GFAST.
echo "xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400"
xdslctl configure1 --phycfg 0 0 0 0 0 0 0 0 0 0 0 0x1400400 0x1400400
fi
}
xdsl_stop() {
# echo "Stopping DSL"
# stop causes IRQ issues
# xdslctl stop
return 0
}
xdsl_init() {
prioritize_arp
echo "Starting DSL"
xtmctl start
xtmctl operate intf --state 1 enable
}

View File

@@ -1,53 +0,0 @@
# OEM specific parameters
config oem-parameters 'oem'
# option country_code "0000" # 2 bytes hex
# option vendor_id "IO" # 4 bytes string
# option vendor_suffix "0000" # 2 bytes hex
# option sw_version "iopsys" # 16 bytes string
# option serial_nr "00000000" # 32 bytes string
# DSL Modes
config dsl-line line
list mode gdmt
list mode glite
list mode t1413
list mode adsl2
list mode adsl2p
list mode annexl
list mode annexm
list mode vdsl2
# VDSL2 profiles
list profile 8a
list profile 8b
list profile 8c
list profile 8d
list profile 12a
list profile 12b
list profile 17a
list profile 30a
option bitswap 1
option sra 1
option us0 1 # VDSL2 only
option sesdrop 0
option sos 0
option phyReXmtUs 0
option phyReXmtDs 1
config atm-device atm0
option name 'ATM'
option vpi '8'
option vci '35'
option device atm0
option link_type 'eoa' # EoA, IPoA, PPPoA, CIP
option encapsulation 'llc' # llc, vcmux
option qos_class 'ubr' # ubr, cbr, gfr, vbr-nrt, vbr-rt, ubr+, abr
# option pcr '512'
# option scr '256'
# option mbs '1024'
config ptm-device ptm0
option name 'PTM'
option device 'ptm0'
option priority '1'
option portid '1'

View File

@@ -1,7 +0,0 @@
[ "$STATUS" == "up" -o "$STATUS" == "down" ] || exit 0
. /lib/functions.sh
include /lib/dsl
xtm_remove_devices
xtm_create_devices

View File

@@ -1,7 +0,0 @@
if [ "$STATUS" == "up" ]; then
ubus call led.dsl set '{"state":"ok"}'
elif [ "$STATUS" == "down" ]; then
ubus call led.dsl set '{"state":"off"}'
elif [ "$STATUS" == "training" ]; then
ubus call led.dsl set '{"state":"alert"}'
fi

View File

@@ -1,48 +0,0 @@
#!/bin/sh /etc/rc.common
. /lib/functions.sh
include /lib/dsl
START=20
USE_PROCD=1
DSLMNGR=$(which dslmngr)
start_service() {
[ -n "$DSLMNGR" ] && {
procd_open_instance
procd_set_param command "$DSLMNGR"
procd_set_param respawn
procd_close_instance
}
xdsl_configure
xtm_create_devices
}
stop_service() {
[ -n "$DSLMNGR" ] && service_stop $DSLMNGR
xtm_remove_devices
xdsl_stop
}
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
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger dsl
}

View File

@@ -1,47 +0,0 @@
#
# Copyright (C) 2019 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-qos
PKG_VERSION:=1.1
PKG_RELEASE:=0
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=none
include $(INCLUDE_DIR)/package.mk
define Package/easy-qos
SECTION:=net
CATEGORY:=Network
TITLE:=Easy QoS
DEPENDS:=@(TARGET_brcmbca||TARGET_airoha)
endef
define Package/easy-qos/description
This package contains Easy QoS utility
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./files/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
endef
define Package/easy-qos/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
endef
$(eval $(call BuildPackage,easy-qos))

View File

@@ -1 +0,0 @@
/etc/init.d/easy_qos reload

View File

@@ -1,140 +0,0 @@
#!/bin/sh /etc/rc.common
START=99
USE_PROCD=1
log() {
echo "${@}"|logger -t easy_qos.ebtable -p debug
}
exec_log() {
${@}
if [ "${?}" -ne 0 ]; then
log "Failed to create ${@}";
fi
}
get_priority() {
local prio=$(echo $1|tr 'A-Z' 'a-z');
case "${prio}" in
"lowest")
echo 0;;
"low")
echo 1;;
"besteffort")
echo 2;;
"normal")
echo 3;;
"video")
echo 4;;
"medium")
echo 5;;
"high")
echo 6;;
"highest")
echo 7;;
esac
}
validate_rule_section()
{
uci_validate_section easy_qos rule "${1}" \
'priority:string' \
'macaddr:string' \
'proto:string:none' \
'port:list(uinteger)' \
'comment:string:none'
}
# Clear existing rules before applying new rules
clear_existing_rules() {
local rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
while [ -n "${rule}" ]; do
exec_log ebtables -t broute -D BROUTING ${rule}
rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
done
}
create_rule() {
local protocol=$1; shift
local mac=$1; shift
local mark="0x$1"; shift
local forward_port=$1;
local cmd="";
local protocol_number
cmd="-j mark --mark-or ${mark}";
if [ -n "${forward_port}" ]; then
cmd="--ip-destination-port ${forward_port} ${cmd}";
fi
case "${protocol}" in
"tcp")
protocol_number=6;;
"udp")
protocol_number=17;;
"dccp")
protocol_number=33;;
"sctp")
protocol_number=132;;
*)
log "Protocol ${protocol} not supported in ebtables"
return;;
esac
cmd="--ip-proto ${protocol_number} $cmd"
cmd="-p ip $cmd"
cmd="-s ${mac} $cmd"
exec_log ebtables -t broute -A BROUTING ${cmd}
}
manage_rule() {
local cfg="$1"
local priority macaddr proto port comment prio_num protocol
validate_rule_section "${1}" || {
log "Validation of section failed"
return 1;
}
protocol=$(echo ${proto}|tr 'A-Z' 'a-z')
prio_num=$(get_priority ${priority})
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
for p in ${port}; do
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
create_rule tcp ${macaddr} ${prio_num} ${p}
create_rule udp ${macaddr} ${prio_num} ${p}
else
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
fi
done
# Create rule for all ports if port is not mentioned in uci
if [ -z "${port}" ]; then
if [ "${protocol}" == "none" -o "${protocol}" == "tcpudp" ]; then
create_rule tcp ${macaddr} ${prio_num}
create_rule udp ${macaddr} ${prio_num}
else
create_rule ${protocol} ${macaddr} ${prio_num}
fi
fi
fi
}
reload_service() {
# Do not apply rules if ebtables is not present in system
[ -x /usr/sbin/ebtables ] || return;
clear_existing_rules
config_load easy_qos
config_foreach manage_rule rule
}
start_service() {
reload_service
}
service_triggers() {
procd_add_reload_trigger "easy_qos"
}

View File

@@ -1,186 +0,0 @@
#!/bin/sh /etc/rc.common
. /usr/share/libubox/jshn.sh
START=99
USE_PROCD=1
CLIENT_LIST="/tmp/easy_qos_client.list"
log() {
echo "${@}"|logger -t easy_qos -p debug
}
exec_log() {
${@}
if [ "${?}" -ne 0 ]; then
log "Failed to create ${@}";
fi
}
get_priority() {
local prio=$(echo $1|tr 'A-Z' 'a-z');
case "${prio}" in
"lowest")
echo 0;;
"low")
echo 1;;
"besteffort")
echo 2;;
"normal")
echo 3;;
"video")
echo 4;;
"medium")
echo 5;;
"high")
echo 6;;
"highest")
echo 7;;
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
# json_add_array "clients"
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"
}
validate_rule_section()
{
uci_validate_section easy_qos rule "${1}" \
'priority:string' \
'macaddr:string' \
'proto:string:none' \
'port:list(uinteger)' \
'comment:string:none'
}
# Clear existing rules before applying new rules
clear_existing_rules() {
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 PREROUTING | grep -m 1 MARK |sed 's/-A/-D/1')
done
}
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_rule() {
local proto=$1; shift
local src_ip=$1; shift
local mark="0x$1/0x$1"; shift
local ports=$1;
local cmd="";
cmd="-j MARK --set-xmark ${mark}";
if [ -n "${ports}" ]; then
cmd="--match multiport --dports ${ports} ${cmd}";
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}
}
manage_rule() {
local cfg="$1"
local priority macaddr proto port comment prio_num ip port_list
validate_rule_section "${1}" || {
log "Validation of section failed"
return 1;
}
prio_num=$(get_priority ${priority})
ip=$(get_ipaddress ${macaddr})
port_list=$(echo ${port}|sed 's/ /,/g')
if [ -n "${ip}" -a -n "${prio_num}" ]; then
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
create_rule tcp ${ip} ${prio_num} ${port_list}
create_rule udp ${ip} ${prio_num} ${port_list}
else
create_rule ${proto} ${ip} ${prio_num} ${port_list}
fi
fi
}
reload_service() {
clear_existing_rules
map_client_entries
config_load easy_qos
config_foreach manage_rule rule
clean_client_entries
}
start_service() {
reload_service
echo "Easy QoS installed">/dev/console;
}
service_triggers() {
procd_add_reload_trigger "easy_qos"
}

View File

@@ -1,8 +0,0 @@
# Add firewall include
uci -q batch <<-EOT
delete firewall.easyqos
set firewall.easyqos=include
set firewall.easyqos.path=/etc/firewall.easyqos
set firewall.easyqos.reload=1
commit firewall
EOT

View File

@@ -1,110 +0,0 @@
# All rights reserved.
# See LICENSE for more information.
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=easy-soc-events
PKG_VERSION:=1.1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
PKG_SOURCE_VERSION:=5c582b0165b574dc94e4865f82e0bb91fa561754
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
PKG_BUILD_DIR:=$(BUILD_DIR)/easy-soc-events-$(PKG_VERSION)
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
include $(INCLUDE_DIR)/package.mk
-include $(TOPDIR)/.config
ifneq ($(CONFIG_TARGET_brcmbca),)
LINUX_DIR=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.1
LINUX_VERSION := 4.1.52
LINUXINCLUDE=-Iarch/$(LINUX_KARCH)/mach-bcm963xx/include
BCM_BS_PROFILE := $(patsubst "%",%,$(CONFIG_BCM_KERNEL_PROFILE))
FS_DIR := $(BUILD_DIR)/bcmkernel/bcm963xx/targets/$(BCM_BS_PROFILE)/fs
MODULES_SUBDIR:=lib/modules/$(LINUX_VERSION)/extra
TARGET_MODULES_DIR:=/$(MODULES_SUBDIR)
endif
define KernelPackage/easy-soc-events/default
SUBMENU:=Other modules
endef
define KernelPackage/easy-soc-events
$(KernelPackage/easy-soc-events/default)
TITLE:=Helper module for netlink event notification
FILES:=$(PKG_BUILD_DIR)/easyevent.ko
AUTOLOAD:=$(call AutoLoad,11,easyevent)
endef
define KernelPackage/easy-soc-events-test
$(KernelPackage/easy-soc-events/default)
TITLE:=Test module for event notification through easyevent
DEPENDS+=+kmod-easy-soc-events
FILES+=$(PKG_BUILD_DIR)/test/testevent.ko
endef
define KernelPackage/easy-soc-events/description
This is a helper module to generate and pass netlink events from
kernel to user applications.
endef
#NOSTDINC_FLAGS :=
ifdef CONFIG_PACKAGE_kmod-easy-soc-events
PKG_MAKE_FLAGS += CONFIG_EASYEVENT=y
endif
LINUXINCLUDE += \
-I$(LINUX_DIR)/include -I$(LINUX_DIR)/include/$(LINUX_UAPI_DIR) \
-Iarch/$(LINUX_KARCH)/include \
-Iarch/$(LINUX_KARCH)/include/generated \
-Iarch/$(LINUX_KARCH)/include/generated/$(LINUX_UAPI_DIR) \
-I$(LINUX_DIR)/include/generated/uapi \
-Iarch/$(LINUX_KARCH)/include/$(LINUX_UAPI_DIR) \
-include ./include/linux/kconfig.h
define Build/Prepare
$(call Build/Prepare/Default)
endef
define Build/Compile
$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(KERNEL_MAKE_FLAGS) V=1 \
$(PKG_MAKE_FLAGS) \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
LINUXINCLUDE="$(LINUXINCLUDE)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
modules
endef
ifneq ($(CONFIG_TARGET_brcmbca),)
define KernelPackage/easy-soc-events/install-extra
cp $(PKG_BUILD_DIR)/easyevent.ko $(FS_DIR)/lib/modules/$(LINUX_VERSION)/extra
endef
endif
define KernelPackage/easy-soc-events/install
$(call KernelPackage/easy-soc-events/install-extra)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)/usr/include
#$(INSTALL_DIR) $(STAGING_DIR)/usr/include/linux
#$(CP) $(PKG_BUILD_DIR)/easysoc-event.h $(STAGING_DIR)/usr/include/linux/
#$(CP) $(PKG_BUILD_DIR)/easysoc-event.h $(LINUX_DIR)/include/linux/
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(STAGING_DIR)/usr/include/
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(STAGING_DIR)/usr/include/
$(CP) $(PKG_BUILD_DIR)/easyevent.h $(LINUX_DIR)/include/generated/uapi
$(CP) $(PKG_BUILD_DIR)/wifievent.h $(LINUX_DIR)/include/generated/uapi
endef
$(eval $(call KernelPackage,easy-soc-events-test))
$(eval $(call KernelPackage,easy-soc-events))

View File

@@ -1,156 +0,0 @@
#
# Copyright (C) 2020 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-soc-libs
PKG_VERSION:=7.2.26
PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=350793b45873480d8981dac540c4145705a7b7ba
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
PKG_MIRROR_HASH:=skip
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/easy-soc-libs
SECTION:=libs
CATEGORY:=Libraries
TITLE:=IOPSYS Easy SoC libraries
SUBMENU:=IOPSYS Easy SoC libraries
DEPENDS:=+libopenssl
MENU:=1
endef
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
TARGET_WIFI_TYPE=BROADCOM
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
TARGET_PLATFORM=TEST
TARGET_WIFI_TYPE=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
TARGET_PLATFORM=TEST
TARGET_WIFI_TYPE=TEST
TARGET_CFLAGS +=-DIOPSYS_TEST
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TARGET_WIFI_TYPE=MEDIATEK MAC80211
TARGET_CFLAGS +=-DIOPSYS_ECONET
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
TARGET_PLATFORM=IPQ95XX
TARGET_WIFI_TYPE=MAC80211
TARGET_CFLAGS +=-DIPQ95XX
else ifeq ($(CONFIG_TARGET_iopsys_mediatek),y)
TARGET_PLATFORM=LINUX
TARGET_WIFI_TYPE=MAC80211
TARGET_CFLAGS +=-DIOPSYS_LINUX
else
$(info Unexpected CONFIG_TARGET, use default MAC80211)
TARGET_PLATFORM=MAC80211
TARGET_WIFI_TYPE=MAC80211
TARGET_CFLAGS +=-DIOPSYS_MAC80211
endif
subdirs := \
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
$(if $(CONFIG_PACKAGE_libwifiutils),libwifi) \
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
$(if $(CONFIG_PACKAGE_libethernet),libethernet) \
$(if $(CONFIG_PACKAGE_libqos),libqos)
ifneq ($(CONFIG_PACKAGE_libwifi),)
TARGET_CFLAGS +=-DHAS_WIFI
endif
esl-pkgs := \
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
$(if $(CONFIG_PACKAGE_libwifiutils),libwifiutils) \
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
$(if $(CONFIG_PACKAGE_libethernet),libethernet) \
$(if $(CONFIG_PACKAGE_libqos),libqos)
esl-pkgs-all := \
libeasy \
libwifiutils \
libwifi \
libdsl \
libethernet \
libqos
ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
TARGET_CFLAGS +=-DLIBWIFI_USE_CTRL_IFACE
endif
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/openssl \
-I$(STAGING_DIR)/usr/include/libnl3
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
LDFLAGS="$(TARGET_LDFLAGS)" \
FPIC="$(FPIC)" \
PLATFORM="$(TARGET_PLATFORM)" \
WIFI_TYPE="$(TARGET_WIFI_TYPE)" \
subdirs="$(subdirs)"
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/easy-soc-libs/ $(PKG_BUILD_DIR)/
endef
endif
include easy.mk
include wifi.mk
include dsl.mk
include ethernet.mk
include qos.mk
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),\
$(PKG_BUILD_DIR)/.config_$(patsubst "%",%,$(CONFIG_TARGET_PROFILE)))
define Build/Compile/rebuild
$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.so\* | $(XARGS) rm -f;
$(if $(wildcard $(PKG_BUILD_DIR)/config_*), \
rm -f $(PKG_BUILD_DIR)/.config_*)
endef
endif
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(TARGET_CFLAGS) | mkhash md5)
define Build/Compile
$(Build/Compile/rebuild)
touch $(PKG_BUILD_DIR)/.config_$(CONFIG_TARGET_PROFILE)
$(call Build/Compile/Default)
$(foreach dir,$(esl-pkgs),$(call Build/Compile/$(dir)))
endef
define Build/InstallDev
$(foreach dir,$(esl-pkgs),$(call Build/InstallDev/$(dir),$(1),$(2));)
endef
define Package/easy-soc-libs/install
:
endef
$(eval $(foreach e,$(esl-pkgs-all),$(call BuildPackage,$(e))))

View File

@@ -1,44 +0,0 @@
define Package/libdsl
$(call Package/easy-soc-libs)
TITLE:= xDSL library (libdsl)
endef
define Package/libdsl/config
if PACKAGE_libdsl
config LIBDSL_DEBUG
depends on PACKAGE_libdsl
bool "Enable dsl debugging"
default n
config LIBDSL_TEST
depends on PACKAGE_libdsl
bool "Enable dsl test program"
default n
endif
endef
define Build/InstallDev/libdsl
$(INSTALL_DIR) $(1)/usr/include/xdsl
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl
$(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl
$(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
endef
ifeq ($(CONFIG_LIBDSL_TEST),y)
define Build/Compile/libdsl
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
endef
endif
define Package/libdsl/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
ifeq ($(CONFIG_LIBDSL_TEST),y)
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
endif
endef

View File

@@ -1,25 +0,0 @@
define Package/libeasy
$(call Package/easy-soc-libs)
TITLE:= Common helper functions library (libeasy)
DEPENDS+=+libnl +libnl-route
endef
define Build/InstallDev/libeasy
$(INSTALL_DIR) $(1)/usr/include/easy
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/hlist.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
endef
define Package/libeasy/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
endef

View File

@@ -1,27 +0,0 @@
define Package/libethernet
$(call Package/easy-soc-libs)
TITLE:= Ethernet library (libethernet)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_airoha:ecnt_api
endef
define Package/libethernet/config
config LIBETHERNET_DEBUG
depends on PACKAGE_libethernet
bool "Enable ethernet debugging"
default n
endef
define Build/InstallDev/libethernet
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
endef
define Package/libethernet/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/
endef

View File

@@ -1,27 +0,0 @@
define Package/libqos
$(call Package/easy-soc-libs)
TITLE:= QoS library (libqos)
DEPENDS+=+libnl +libnl-route +libeasy
endef
define Package/libqos/config
config LIBQOS_DEBUG
depends on PACKAGE_libqos
bool "Enable qos debugging"
default n
endef
define Build/InstallDev/libqos
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libqos/include/qos.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libqos/libqos.so $(1)/usr/lib/
endef
define Package/libqos/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libqos/libqos*.so* $(1)/usr/lib/
endef

View File

@@ -1,53 +0,0 @@
define Package/libwifiutils
$(call Package/easy-soc-libs)
TITLE:= WiFi utility library (libwifiutils.so)
DEPENDS+=+libnl +libnl-route +libeasy
endef
define Build/InstallDev/libwifiutils
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/wifidefs.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/wifiutils.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifiutils*.so* $(1)/usr/lib/
endef
define Package/libwifiutils/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifiutils*.so* $(1)/usr/lib/
endef
define Package/libwifi
$(call Package/easy-soc-libs)
TITLE:= WiFi library (libwifi)
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcmkernel
endef
define Package/libwifi/config
if PACKAGE_libwifi
config LIBWIFI_DEBUG
depends on PACKAGE_libwifi
bool "Enable debugging in libwifi"
default n
config LIBWIFI_USE_CTRL_IFACE
bool "Create UNIX sockets to interface with hostapd/wpa_supplicant"
default n
endif
endef
define Build/InstallDev/libwifi
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/wifiops.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
endef
define Package/libwifi/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
endef

View File

@@ -1,36 +1,35 @@
#
# Copyright (C) 2018 IOPSYS Software Solutions AB
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=endptmngr
PKG_VERSION:=0.6
PKG_RELEASE:=1
PKG_VERSION:=0.2
PKG_SOURCE_VERSION:=0cb8accbac3355b97a17064ec7da010a2c42db7b
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
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://iopsys.inteno.se/iopsys/consumer/
PKG_NAME:=endptmngr-open
else
PKG_SOURCE_URL:=git@private.inteno.se:endptmngr
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
PKG_SOURCE_VERSION:=fb85081443c19b5062bede49c80b1802c0f05d34
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_NAME:=endptmngr
endif
PKG_LICENSE:=PROPRIETARY
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
# All config variable that are passed to the make invocation, directly or
# indirectly. This ensures that the package is rebuilt on config-changes.
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
export CONFIG_BCM_CHIP_ID
include $(INCLUDE_DIR)/package.mk
@@ -40,28 +39,27 @@ endef
define Package/endptmngr
CATEGORY:=Utilities
TITLE:=Broadcom Voice Endpoint Manager
TITLE:=Brcmslic
URL:=
DEPENDS:= +libubox +ubus +libpicoevent +uci +bcmkernel @TARGET_HAS_VOICE @BCM_VOICE
DEPENDS:= +libubox +ubus +libpicoevent +PACKAGE_bcmkernel:bcmkernel +PACKAGE_bcmopen:bcmopen
endef
define Package/endptmngr/description
endptmngr
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -av --exclude=.* ~/git/endptmngr/* $(PKG_BUILD_DIR)/
ifeq ($(CONFIG_ENDPT_OPEN),y)
define Build/Compile
endef
endif
TARGET_CFLAGS += \
-Wall \
-Werror
define Package/endptmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/init.d/
cp $(PKG_BUILD_DIR)/files/etc/init.d/* $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endptmngr $(1)/usr/sbin/
endef

View File

@@ -0,0 +1,4 @@
config dect 'dect'
option radio 'auto'

View File

@@ -1,27 +0,0 @@
#!/bin/sh /etc/rc.common
START=68
STOP=12
USE_PROCD=1
NAME=endptmngr
start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
procd_open_instance
procd_set_param env hw_board_hasDect=$(db get hw.board.hasDect)
procd_set_param command $NAME
procd_set_param respawn "5" "0" "3"
procd_set_param nice -12
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger asterisk
}

View File

@@ -1,60 +0,0 @@
#
# Copyright (C) 2020 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=2.1.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip
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/ethmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Ethernet status and configration utility
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_iopsys_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
endef
define Package/ethmngr/description
This package can be used to configure and provide status about
the ethernet interfaces and ports through UBUS.
It uses APIs from the libethernet.so library.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_iopsys_mediatek),)
define Build/Compile
endef
endif
define Package/ethmngr/install
$(CP) ./files/common/* $(1)/
ifneq ($(CONFIG_TARGET_brcmbca),)
$(CP) ./files/broadcom/* $(1)/
else ifneq ($(CONFIG_TARGET_airoha),)
$(CP) ./files/airoha/* $(1)/
else
$(CP) ./files/linux/* $(1)/
endif
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_iopsys_mediatek),)
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
endif
endef
$(eval $(call BuildPackage,ethmngr))

View File

@@ -1,208 +0,0 @@
#!/bin/sh
. /lib/functions.sh
unset -f switchmgr
# alias for switchmgr
switchmgr() {
"/userfs/bin/switchmgr" "$@"
}
unset -f tc3162_get_lan_port
# get lan port port by ifname
# arg1: port ifname, ex: eth0.1
tc3162_get_lan_port() {
[[ -z "$1" ]] && return 255
local ifname="$1"
local if_idx=255
# only for tc3162 eth switch ports (eth0.x, 0 < x < 7)
case "${ifname}" in
eth0.*)
;;
*)
logger -t "port-management" \
"unsupported - ${ifname} is not tc3162 switch port"
return 255
;;
esac
let "if_idx=$(echo "${ifname}" | cut -f2 -d'.')"
[[ -z "${if_idx}" ]] && return 255
[[ ${if_idx} -lt 1 || ${if_idx} -gt 6 ]] && {
logger -t "port-management" \
"incorrect tc3162 lan port index ${if_idx} picked from ifname ${ifname}"
return 255
}
let "if_idx=${if_idx}-1"
return ${if_idx}
}
unset -f tc3162_get_mapped_port
# get mapped switch port by ifname
# arg1: port ifname, ex: eth0.1
tc3162_get_mapped_port() {
[[ -z "$1" ]] && return 255
local ifname="$1"
local if_idx=255
local prtmap_procfile="/proc/tc3162/eth_portmap"
local lan_prt=255
local port=255
local prtmap_out_line_num=4
local prtmap_out_line=""
# check "lan port map" marker in portmap output string
prtmap_out_line="$(sed -n "${prtmap_out_line_num}p" ${prtmap_procfile})"
[[ ${prtmap_out_line} != "lan_port_map" ]] && return 255
tc3162_get_lan_port "${ifname}"
let "if_idx=$?"
[[ -z "${if_idx}" || ${if_idx} -eq 255 ]] && return
# get lan portmapping string "lan_port mapped_port" for ifname by it's index
let "prtmap_out_line_num=${prtmap_out_line_num}+1+${if_idx}"
prtmap_out_line="$(sed -n "${prtmap_out_line_num}p" ${prtmap_procfile})"
# get and check lan port index from lan portmapping string
lan_prt=$(echo "${prtmap_out_line}" | cut -f 1 -d' ')
[[ -z "${lan_prt}" || "${if_idx}" != "${lan_prt}" ]] && return 255
# get and check mapped port from lan portmapping string
let "port=$(echo "${prtmap_out_line}" | cut -f 2 -d' ')"
[[ ${port} -lt 0 || ${port} -gt 255 ]] && return 255
return ${port}
}
unset -f get_max_port_speed
# arg1: port ifname, ex: eth0.1
get_max_port_speed() {
[[ -z "$1" ]] && { echo 0; return; }
local ifname="$1"
local port=255
local speed=0
[[ -d "/sys/class/net/${ifname}" ]] || {
logger -t "port-management" "interface ${ifname} is not found"
return
}
tc3162_get_lan_port "${ifname}"
let "port=$?"
[[ -z "${port}" || ${port} -eq 255 ]] && return
# tc3162 capability for all ports is 1Gbps
speed=1000
echo $speed
}
unset -f power_updown
# arg1: port ifname, ex: eth0.1
# arg2: port enabled, ex: 0/1/off/on/..
power_updown() {
[[ -z "$1" ]] && return
[[ -z "$2" ]] && return
local ifname="$1"
local enabled="$2"
local port=255
[[ -d "/sys/class/net/${ifname}" ]] || {
logger -t "port-management" "interface ${ifname} is not found"
return
}
let "enabled=$(get_bool "${enabled}" "-1")"
[[ ${enabled} -eq -1 ]] && return
tc3162_get_lan_port "${ifname}"
let "port=$?"
[[ -z "${port}" || ${port} -eq 255 ]] && return
switchmgr phy admin "${port}" "${enabled}"
}
unset -f set_port_settings
# arg1: port ifname, ex: eth0.1
# arg2: port enabled, ex: 0/1/off/on/..
# arg3: port speed, ex: 1000
# arg4: port duplex, ex: full
# arg5: port autoneg, ex: 0/1/off/on/..
# arg6: port eee, ex: 0/1/off/on/..
# arg7: port pause, ex: 0/1/off/on/..
set_port_settings() {
[[ -z "$1" ]] && return
[[ -z "$2" ]] && return
[[ -z "$3" ]] && return
[[ -z "$4" ]] && return
[[ -z "$5" ]] && return
[[ -z "$6" ]] && return
[[ -z "$7" ]] && return
local ifname="$1"
local enabled="$2"
local speed="$3"
local duplex="$4"
local autoneg=$5
local eee="$6"
local pause="$7"
local port=255
local speedmode=1
local last_speed=0
[[ -d "/sys/class/net/${ifname}" ]] || {
logger -t "port-management" "interface ${ifname} is not found"
return
}
let "enabled=$(get_bool "${enabled}" "-1")"
[[ ${enabled} -eq -1 ]] && return
let "autoneg=$(get_bool "${autoneg}" "-1")"
[[ ${autoneg} -eq -1 ]] && return
let "eee=$(get_bool "${eee}" "-1")"
[[ ${eee} -eq -1 ]] && return
let "pause=$(get_bool "${pause}" "-1")"
[[ ${pause} -eq -1 ]] && return
duplex="$(echo "${duplex}" | awk '{print tolower($0)}')"
[[ "${duplex}" != "half" && "${duplex}" != "full" ]] && return
tc3162_get_lan_port "${ifname}"
let "port=$?"
[[ -z "${port}" || ${port} -eq 255 ]] && return
last_speed="$(switchmgr phy maxspeed "${port}" | cut -f2 -d':')"
[[ -z "${last_speed}" || "${last_speed}" == "*Down*" ]] \
&& last_speed=${speed}
switchmgr phy pause "${port}" "${pause}"
# set speedmode: speed+duplex+autoneg
# FIXME: switchmgr has no separate setting for 1Gbps speed - use autoneg instead
if [[ ${autoneg} -eq 1 || ${speed} -gt 100 ]]; then
switchmgr phy speedmode ${port} "1"
else
[[ ${speed} -gt 10 ]] && let "speedmode=2" || let "speedmode=4"
[[ "${duplex}" == "half" ]] && let "speedmode=${speedmode}+1"
switchmgr phy speedmode "${port}" "${speedmode}"
fi
# TODO: implement MAC control register manipulations (mapped ports used) for
# eee settings change
# separate (tx/rx) pause (flow control) settings change
# set speed to 1Gbps separately from autoneg mode
# FIXME: workaround for duplex/pause settings being not applied if speed is unchanged
[[ ${last_speed} -eq ${speed} ]] && power_updown "${ifname}" 0
power_updown "${ifname}" ${enabled}
}

View File

@@ -1,140 +0,0 @@
# 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 Capabilities' | awk '{print$NF}' | cut -d'|' -f1)"
local speed=1000
case "$phycap" in
10GFD) speed=10000 ;;
5GFD) speed=5000 ;;
2.5GFD) speed=2500 ;;
1GFD|1GHD) 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
# 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"
phycrossbar="$(ethctl $ifname phy-crossbar | head -1)"
crossbartype="$(echo $phycrossbar | awk '{print$2$3}')"
# Take only the last PHY Endpoint (non-Serdes) into account as Serdes port number precedes
[ "$crossbartype" == "oncrossbar" ] && pyhendpoint="$(echo $phycrossbar | awk '{print$NF}')"
phycaps="$(ethctl $ifname media-type ${pyhendpoint:+ port $pyhendpoint} | awk -F'PHY Capabilities: ' '{print$2}')"
numofcaps="$(echo $phycaps | tr '|' ' ' | wc -w)"
if [ "$numofcaps" == "1" ]; then
logger -t "port-management" "$ifname is capable of $phycaps only; not setting speed/duplex"
else
logger -t "port-management" "$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
}

View File

@@ -1,50 +0,0 @@
#!/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
}

View File

@@ -1,81 +0,0 @@
#!/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

View File

@@ -1,95 +0,0 @@
# 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 000 | 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
}

49
eventlog/Makefile Normal file
View File

@@ -0,0 +1,49 @@
#
# Copyright (C) 2009-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=eventlog
PKG_VERSION:=0.2.9
PKG_RELEASE:=2
PKG_SOURCE_URL:=http://www.balabit.com/downloads/files/eventlog/0.2/
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_MD5SUM:=76e3d7a0b8f335c12099e9b91191fbf1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libeventlog
SECTION:=libs
CATEGORY:=Libraries
TITLE:=A new API to format and send structured log messages.
endef
define Package/eventlog/description
A new API to format and send structured log messages. It supports multiple message
representations (plain, XML attributes and XML tags) and multiple output methods
(local syslogd).
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/eventlog $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/eventlog.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libeventlog/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libevtlog.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libeventlog))

View File

@@ -1,106 +0,0 @@
#
# Copyright (C) 2022 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=evoice
PKG_VERSION:=0.2.39
LOCAL_DEV=0
LOCAL_DEV_EVOICE_DIR=~/voip/evoice
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/evoice.git
PKG_SOURCE_VERSION:=30d65330de0368f73ecf4a2e804c39a2ee280454
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
# All config variable that are passed to the make invocation, directly or
# indirectly. This ensures that the package is rebuilt on config-changes.
#PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Network
SUBMENU:=Telephony
TITLE:=Ensemble Voice
URL:=
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp +libopenssl +libjson-c +libblobmsg-json\
+TARGET_brcmbca:bcmkernel\
+TARGET_airoha:kmod-voip_driver\
+TARGET_airoha:voip_app +libbbf_api
endef
define Package/$(PKG_NAME)/description
Ensemble Voice. A stand alone SIP VoIP application.
endef
ifeq ($(LOCAL_DEV),1)
# If you want to build the code from your own local repositiory enable
# LOCAL_DEV and set LOCAL_DEV_EVOICE_DIR to your own git repository.
define Build/Prepare
@echo "======================================================="
@echo "DEVELOPMENT BUILD! rsync $(LOCAL_DEV_EVOICE_DIR) to $(PKG_BUILD_DIR)"
@echo "======================================================="
rsync -a $(LOCAL_DEV_EVOICE_DIR)/* $(PKG_BUILD_DIR)/
endef
endif
IDIR = $(STAGING_DIR)/usr/include
TONES_INI_REQUIRED=
ifeq ($(CONFIG_TARGET_brcmbca),y)
TARGET_PLATFORM=BROADCOM
BDIR = bcm963xx/userspace/private/apps/voice
CC_FLAGS = -I$(IDIR) -I$(IDIR)/$(BDIR)/inc\
-I$(IDIR)/bcm963xx/xchg/bos/publicInc\
-I$(IDIR)/bcm963xx/bcmdrivers/broadcom/include/bcm963xx
TRG=SVrgBcmFxs
JSONFILE=codecs_brcm.json
else ifeq ($(CONFIG_TARGET_airoha),y)
TARGET_PLATFORM=ECONET
TONES_INI_REQUIRED=y
TRG=SVrgMtekOwrt
JSONFILE=codecs_airoha.json
endif
# disable temporarily some not important warnings, force PIC
CC_FLAGS_VS=$(CC_FLAGS) -Wno-unused-parameter -Wno-unused-function -fPIC
export TARGET_PLATFORM
#used and altered by BIDE makefiles
export _XFLAGS
BIDE_MAKE_OPTS = -r -R -C $(PKG_BUILD_DIR) -f _bld/src/cdabs.mk\
SWB=b_gxxqca6 HWA=a_openwrt HWC=c_hosted OSP=p_posix LIF=cerder DBG=dbg
define Build/Compile
@echo "TARGET_PLATFORM=${TARGET_PLATFORM}"
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS)" TRG=$(TRG)
@echo "clean libvoiceservice before building shared lib!"
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS_VS)" TRG=libvoiceservice cleanall
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS_VS)" TRG=libvoiceservice
endef
define Package/evoice/install
$(CP) ./files/* $(1)/
$(if $(TONES_INI_REQUIRED),,$(RM) $(1)/etc/evoice/tones.ini)
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(1)/lib/voice/$(JSONFILE) $(1)/lib/voice/codecs_evoice.json
$(RM) $(1)/lib/voice/codecs_brcm.json
$(RM) $(1)/lib/voice/codecs_airoha.json
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/evoice $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/libvoiceservice.so $(1)/usr/lib/bbfdm/
endef
$(eval $(call BuildPackage,evoice))

View File

@@ -1,334 +0,0 @@
config SIPClient 'Client1'
option Enable '1'
option RegisterMode 'RFC3261'
option AuthUserName '51234'
option AuthPassword '51234'
option Network 'Network1'
option MaxSessions '5'
option RegisiterURI '51234@sip-proxy.iopsys.eu'
option E164Format '1'
config SIPClient 'Client2'
option Enable '1'
option RegisterMode 'RFC3261'
option AuthUserName '51235'
option AuthPassword '51235'
option Network 'Network1'
option MaxSessions '5'
option RegisiterURI '51235@sip-proxy.iopsys.eu'
option E164Format '1'
config SIPNetwork 'Network1'
option Enable '1'
option ProxyServer 'sip-proxy.iopsys.eu'
option AcceptFromProxyOnly '0'
option ProxyServerPort '5060'
option ProxyServerTransport 'UDP'
option RegistrarServer 'sip-proxy.iopsys.eu'
option RegistrarServerPort '5060'
option RegistrarServerTransport 'UDP'
option RegistrationPeriod '3240'
option RegisterExpires '3600'
option UserAgentDomain ' '
option TimerRegistrationFailed '120'
option TimerT1 '500'
option VoIPProfile 'VoIPProfile1'
option SIPSessionTimerEnable '0'
option SIPSessionExpireInterval '1800'
option SIPSessionMinimumTimer '90'
option SIPSessionRefresher 'NONE'
option SIPSessionTimerMode 'REQUEST'
option SIPSessionRefreshRequest 'UPDATE'
list CodecList '1CodecProfile1'
list CodecList '1CodecProfile2'
list CodecList '1CodecProfile3'
list CodecList '1CodecProfile5'
list CodecList '1CodecProfile4'
config CodecProfile '1CodecProfile1'
option Enable '1'
option Codec 'G.711ALaw'
option PacketizationPeriod '20'
option SilenceSupression '1'
config CodecProfile '1CodecProfile2'
option Enable '1'
option Codec 'G.711MuLaw'
option PacketizationPeriod '20'
option SilenceSupression '1'
config CodecProfile '1CodecProfile3'
option Enable '1'
option Codec 'G.726'
option PacketizationPeriod '20'
option SilenceSupression '0'
config CodecProfile '1CodecProfile4'
option Enable '1'
option Codec 'G.722'
option PacketizationPeriod '20'
option SilenceSupression '0'
config CodecProfile '1CodecProfile5'
option Enable '1'
option Codec 'G.729'
option PacketizationPeriod '20'
option SilenceSupression '0'
config VoIPProfile 'VoIPProfile1'
option Enable '1'
option DTMFMethod 'RFC4733'
option RTP '1RTP'
config RTP '1RTP'
option LocalPortMin '10020'
option LocalPortMax '10039'
option JitterBufferType 'Static'
config FXXPorts 'POTS'
option Region 'US'
config FXSPorts 'FXS1'
option Enable '1'
option DialType 'Tone'
option TransmitGain '0'
option ReceiveGain '0'
option EchoCancellationEnable '1'
config FXSPorts 'FXS2'
option Enable '1'
option DialType 'Tone'
option TransmitGain '0'
option ReceiveGain '0'
option EchoCancellationEnable '1'
config Extension 'Extension1'
option Enable '1'
option ExtensionNumber '10#'
option Provider 'FXS1'
option CallingFeatures 'Set1'
option Name 'Phone 1'
config Extension 'Extension2'
option Enable '1'
option ExtensionNumber '11#'
option Provider 'FXS2'
option CallingFeatures 'Set1'
option Name 'Phone 2'
config Line 'Line1'
option Enable '1'
option Provider 'Client1'
option CallingFeatures 'Set1'
config Line 'Line2'
option Enable '1'
option Provider 'Client2'
option CallingFeatures 'Set2'
config IncomingMap 'IncomingMap1'
option Enable '1'
option Extension 'Extension1'
option Line 'Line1'
config IncomingMap 'IncomingMap2'
option Enable '1'
option Extension 'Extension2'
option Line 'Line2'
config IncomingMap 'IncomingMap3'
option Enable '0'
option Extension 'Extension2'
option Line 'Line1'
config OutgoingMap 'OutgoingMap1'
option Enable '1'
option Extension 'Extension1'
option Line 'Line1'
config OutgoingMap 'OutgoingMap2'
option Enable '1'
option Extension 'Extension2'
option Line 'Line2'
config CallingFeatures 'Set1'
option CallerIDEnable '1'
option CallerIDNameEnable '1'
option CallForwardUnconditionalEnable '0'
option CallForwardUnconditionalNumber ' '
option CallForwardOnBusyEnable '0'
option CallForwardOnBusyNumber ' '
option CallForwardOnNoAnswerEnable '0'
option CallForwardOnNoAnswerRingTimeout '24'
option CallForwardOnNoAnswerNumber ' '
option CallTransferEnable '1'
option MWIEnable '1'
option VMWIEnable '1'
option LineMessagesWaiting '0'
option AnonymousCallRejectionEnable '0'
option AnonymousCallEnable '1'
option DoNotDisturbEnable '1'
option RepeatDialEnable '1'
option VoiceMailEnable '1'
option CallPickUpEnable '1'
option CCBSEnable '1'
option CallWaitingEnable '0'
config CallingFeatures 'Set2'
option CallerIDEnable '1'
option CallerIDNameEnable '1'
option CallForwardUnconditionalEnable '0'
option CallForwardUnconditionalNumber ' '
option CallForwardOnBusyEnable '0'
option CallForwardOnBusyNumber ' '
option CallForwardOnNoAnswerEnable '0'
option CallForwardOnNoAnswerRingTimeout '24'
option CallForwardOnNoAnswerNumber ' '
option CallTransferEnable '1'
option MWIEnable '1'
option VMWIEnable '1'
option LineMessagesWaiting '0'
option AnonymousCallRejectionEnable '0'
option AnonymousCallEnable '1'
option DoNotDisturbEnable '1'
option RepeatDialEnable '1'
option VoiceMailEnable '1'
option CallPickUpEnable '1'
option CCBSEnable '1'
option CallWaitingEnable '1'
config NumberingPlan 'NumberingPlan1'
option MinimumNumberOfDigits '1'
option MaximumNumberOfDigits '15'
option InterDigitTimerStd '2000'
option InterDigitTimerOpen '2000'
option TerminationDigit '#'
config NumberingPlan 'NumberingPlan2'
option MinimumNumberOfDigits '5'
option MaximumNumberOfDigits '15'
option InterDigitTimerStd '2000'
option InterDigitTimerOpen '2000'
option TerminationDigit ' '
list PrefixList '2PrefixInfo1'
list PrefixList '2PrefixInfo2'
list PrefixList '2PrefixInfo3'
list PrefixList '2PrefixInfo4'
list PrefixList '2PrefixInfo5'
list PrefixList '2PrefixInfo6'
list PrefixList '2PrefixInfo7'
list PrefixList '2PrefixInfo8'
list PrefixList '2PrefixInfo9'
config NumberingPlan 'NumberingPlan3'
option MinimumNumberOfDigits '5'
option MaximumNumberOfDigits '15'
option InterDigitTimerStd '2000'
option InterDigitTimerOpen '2000'
option TerminationDigit '#'
list PrefixList '3PrefixInfo1'
config PrefixInfo '2PrefixInfo1'
option Enable '1'
option PrefixRange '*43#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CW_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo2'
option Enable '1'
option PrefixRange '#43#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CW_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo3'
option Enable '1'
option PrefixRange '*21*(X+)#'
option PrefixMinNumberOfDigits '9'
option PrefixMaxNumberOfDigits '9'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFU_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo4'
option Enable '1'
option PrefixRange '#21#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFU_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo5'
option Enable '1'
option PrefixRange '*67*(X+)#'
option PrefixMinNumberOfDigits '9'
option PrefixMaxNumberOfDigits '9'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFB_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo6'
option Enable '1'
option PrefixRange '#67#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFB_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo7'
option Enable '1'
option PrefixRange '*61*(X+(*X+)?)#'
option PrefixMinNumberOfDigits '15'
option PrefixMaxNumberOfDigits '15'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFNR_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo8'
option Enable '1'
option PrefixRange '#61#'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CFNR_DEACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '2PrefixInfo9'
option Enable '1'
option PrefixRange '*31*'
option PrefixMinNumberOfDigits '4'
option PrefixMaxNumberOfDigits '4'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'CA_ACTIVATE'
option FacilityActionArgument ' '
config PrefixInfo '3PrefixInfo1'
option Enable '1'
option PrefixRange '110|112'
option PrefixMinNumberOfDigits '7'
option PrefixMaxNumberOfDigits '7'
option NumberOfDigitsToRemove '0'
option PosOfDigitsToRemove '0'
option FacilityAction 'X_IOPSYS_EU_EMERGENCY'
option FacilityActionArgument ' '
config DialPlan 'X_IOPSYS_EU_InternalNumber1'
option RegExp '1X#'

File diff suppressed because it is too large Load Diff

View File

@@ -1,181 +0,0 @@
# RO (Main)
config account 'map_board'
option HW_Has_Voice 'hw.board.hasVoice'
option HW_Has_DECT 'hw.board.hasDect'
option HW_Nr_Of_POTS_Ports 'hw.board.VoicePorts'
option HW_VoiceDSP 'hw.board.VoiceDSP'
option ProductID 'device.deviceinfo.ModelName'
option I3_VERSION 'device.deviceinfo.SoftwareVersion'
option SerialNumber 'device.deviceinfo.SerialNumber'
config account 'map_pots'
option Country 'voice.POTS.Region'
# Voice Service navigation paths
# Not used to initialize internal configuration
config navigation 'map_vs'
option Account 'voice.Client@.'
option Network 'voice.Client@.Network'
option VoIPProfile 'voice.Network@.VoIPProfile'
option CfAccount 'voice.Line@.CallingFeatures'
option CfPhone 'voice.Extension@.CallingFeatures'
option CodecList 'voice.Network@.CodecList'
option Codec 'voice.Codec@.Codec'
option OutgoingMapEnabled 'voice.OutgoingMap@.Enable'
option From_Phone 'voice.OutgoingMap@.Extension'
option Extension 'voice.Extension@.Provider'
option To_Account 'voice.OutgoingMap@.Line'
option Line 'voice.Line@.Provider'
option LineEnable 'voice.Line@.Enable'
option LineProvider 'voice.Line@.Provider'
option IncomingMapEnabled 'voice.IncomingMap@.Enable'
option From_Account 'voice.IncomingMap@.Line'
option To_Phone 'voice.IncomingMap@.Extension'
option ExtensionEnable 'voice.Extension@.Enable'
option ExtensionProvider 'voice.Extension@.Provider'
# Registration for account A-Z is associate with SIP.Clienti.Enable
# All parameters in this table are written to internal configuration
config account 'map_account'
option Registration 'voice.Client@.Enable'
option Display_Name ''
option PhoneNumber 'voice.Client@.RegisiterURI'
option Username 'voice.Client@.AuthUserName'
option Password 'voice.Client@.AuthPassword'
option SIP_Telephone_Syntax 'voice.Client@.E164Format'
option Device_Description 'voice.Client@.UserAgent'
# Network stuff associated with an account.
# All parameters in this table are written to internal configuration
config network 'map_net'
option Enable 'voice.Network@.Enable'
option Registration_Server 'voice.Network@.RegistrarServer'
option Outbound_Proxy 'voice.Network@.ProxyServer'
option Accept_From_Registered 'voice.Network@.AcceptFromProxyOnly'
option SIP_Port 'voice.Network@.RegistrarServerPort'
option SIP_Transport 'voice.Network@.RegistrarServerTransport'
option RegistrationPeriod 'voice.Network@.RegistrationPeriod'
option Registration_Interval 'voice.Network@.RegisterExpires'
option Reg_Failure_Interval 'voice.Network@.TimerRegistrationFailed'
option T1 'voice.Network@.TimerT1'
option UserAgentDomain 'voice.Network@.UserAgentDomain'
option SIP_SessTmrEnable 'voice.Network@.SIPSessionTimerEnable'
option SIP_SessTmrMode 'voice.Network@.SIPSessionTimerMode'
option SIP_SessTmrMsg 'voice.Network@.SIPSessionRefreshRequest'
option SIP_SessTmrRefresher 'voice.Network@.SIPSessionRefresher'
option SIP_MinSE 'voice.Network@.SIPSessionMinimumTimer'
option SIP_SessInterval 'voice.Network@.SIPSessionExpireInterval'
config VoIPProfile 'map_voip'
option Enable 'voice.VoIPProfile@.Enable'
option DTMF_Method 'voice.VoIPProfile@.DTMFMethod'
option RTP 'voice.VoIPProfile@.RTP'
config RTP 'map_rtp'
option RTP_Port_Base 'voice.@RTP@.LocalPortMin'
option RTP_Port_End 'voice.@RTP@.LocalPortMax'
config codecs 'map_codec'
option Codec 'voice.CodecProfile@.Codec'
option enable 'voice.CodecProfile@.Enable'
option ptime 'voice.CodecProfile@.PacketizationPeriod'
option dtx 'voice.CodecProfile@.SilenceSupression'
config fxsinfo 'map_fxs'
option Enable 'voice.FXS@.Enable'
option DialType 'voice.FXS@.DialType'
option TransmitGain 'voice.FXS@.TransmitGain'
option ReceiveGain 'voice.FXS@.ReceiveGain'
option EchoCancellationEnable 'voice.FXS@.EchoCancellationEnable'
config extensioninfo 'map_ext'
option Enable 'voice.Extension@.Enable'
option Internal_Number_Phone 'voice.Extension@.ExtensionNumber'
option Display_Name_Phone 'voice.Extension@.Name'
config capabilities 'map_capa'
option Call_Waiting_Enable 'voice.Capabilities@FacilityActions'
option Enable_Call_Diversion 'voice.Capabilities@FacilityActions'
config cs_account 'map_set'
option BusyCallWait 'voice.Set@.CallWaitingEnable'
option AlwaysDivert 'voice.Set@.CallForwardUnconditionalEnable'
option CFU_Number 'voice.Set@.CallForwardUnconditionalNumber'
option BusyDivert 'voice.Set@.CallForwardOnBusyEnable'
option CFB_Number 'voice.Set@.CallForwardOnBusyNumber'
option NoAnswDivert 'voice.Set@.CallForwardOnNoAnswerEnable'
option CFNR_Number 'voice.Set@.CallForwardOnNoAnswerNumber'
option CFNR_Timeout 'voice.Set@.CallForwardOnNoAnswerRingTimeout'
option Enable_Call_Transfer 'voice.Set@.CallTransferEnable'
option AnonymousReject 'voice.Set@.AnonymousCallRejectionEnable'
option AllowAnonymousConf 'voice.Set@.AnonymousCallEnable'
option CallerIDEnable 'voice.Set@.CallerIDEnable'
config cs_xvendor 'map_np_cs'
option np_sc_actCW 'voice.X_IOPSYS_EU_NpSc@.CW_ACT'
option np_sc_actCW_output 'voice.X_IOPSYS_EU_NpSc@.CW_OUT'
option np_sc_deactCW 'voice.X_IOPSYS_EU_NpSc@.CW_DEACT'
option np_sc_isactCW 'voice.X_IOPSYS_EU_NpSc@.CW_ISACT'
option np_sc_actCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_ACT'
option np_sc_actCFU_output 'voice.X_IOPSYS_EU_NpSc@.CFU_OUT'
option np_sc_deactCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_DEACT'
option np_sc_actCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_ACT'
option np_sc_actCFB_output 'voice.X_IOPSYS_EU_NpSc@.CFB_OUT'
option np_sc_deactCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_DEACT'
option np_sc_actCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_ACT'
option np_sc_actCFNR_output 'voice.X_IOPSYS_EU_NpSc@.CFNR_OUT'
option np_sc_deactCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_DEACT'
option np_sc_actRA 'voice.X_IOPSYS_EU_NpSc@.RA_ACT'
option np_sc_deactRA 'voice.X_IOPSYS_EU_NpSc@.RA_DEACT'
option np_sc_actAC 'voice.X_IOPSYS_EU_NpSc@.AC_ACT'
option np_sc_deactAC 'voice.X_IOPSYS_EU_NpSc@.AC_DEACT'
option np_sc_actAA 'voice.X_IOPSYS_EU_NpSc@.AA_ACT'
option np_sc_deactAA 'voice.X_IOPSYS_EU_NpSc@.AA_DEACT'
option np_sc_actAD 'voice.X_IOPSYS_EU_NpSc@.AD_ACT'
option np_sc_actAD_output 'voice.X_IOPSYS_EU_NpSc@.AD_OUT'
option np_sc_deactAD 'voice.X_IOPSYS_EU_NpSc@.AD_DEACT'
option np_sc_actMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_ACT'
option np_sc_deactMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_DEACT'
option np_sc_actMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_ACT'
option np_sc_deactMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_DEACT'
option np_sc_redial 'voice.X_IOPSYS_EU_NpSc@.REDIAL'
option np_sc_setMiscConf 'voice.X_IOPSYS_EU_NpSc@.SET_MISC'
config cc_xvendor 'map_np_in'
option np_in_limitExp 'voice.X_IOPSYS_EU_InternalNumber@.RegExp'
config cc_xvendor 'map_np_sh'
option sh_no_str 'voice.X_IOPSYS_EU_ShortNumber@.RegExp'
config cc_xvendor 'map_np_eme'
option np_eme 'voice.X_IOPSYS_EU_EmergencyNumber@.RegExp'
option np_eme_out 'voice.X_IOPSYS_EU_EmergencyNumber@.OutStr'
config cc_xvendor 'map_np_rn'
option np_rn 'voice.X_IOPSYS_EU_RegularNumber@.RegExp'
option np_rn_out 'voice.X_IOPSYS_EU_RegularNumber@.OutStr'
option np_rn_account 'voice.X_IOPSYS_EU_RegularNumber@.AccStr'
config cc_xvendor 'map_np_bn'
option np_bn 'voice.X_IOPSYS_EU_BarredNumber@.RegExp'
option np_bn_out 'voice.X_IOPSYS_EU_BarredNumber@.OutStr'
config TR104NumberingPlan 'map_np_tr'
option min_digits 'voice.NumberingPlan@.MinimumNumberOfDigits'
option max_digits 'voice.NumberingPlan@.MaximumNumberOfDigits'
option tmo_std 'voice.NumberingPlan@.InterDigitTimerStd'
option tmo_open 'voice.NumberingPlan@.InterDigitTimerOpen'
option term_digit 'voice.NumberingPlan@.TerminationDigit'
option prefix_list 'voice.NumberingPlan@.PrefixList'
config TR104NumberingPlanPrefix 'map_np_pf'
option enable 'voice.@PrefixInfo@.Enable'
option range 'voice.@PrefixInfo@.PrefixRange'
option prefix_min_digits 'voice.@PrefixInfo@.PrefixMinNumberOfDigits'
option prefix_max_digits 'voice.@PrefixInfo@.PrefixMaxNumberOfDigits'
option remove_digits 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
option remove_pos 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
option facility_act 'voice.@PrefixInfo@.FacilityAction'
option facility_arg 'voice.@PrefixInfo@.FacilityActionArgument'

View File

@@ -1,56 +0,0 @@
config static_prm 'defaults'
option Print_Control '4'
option Print_UDP_Addr '192.168.1.3'
option Print_UDP_Port '60000'
option Verbosity 'On'
option Failure_Log 'On'
option Message_Log 'On'
option Method_Trace 'Off'
option Dial_Cache_Size '0'
option Reverse_Fax_Detection '0'
option DSP_24 '0'
option DSP_36 '0'
option DSP_43 '0'
option Swap_Name_Nr_CID '0'
option R_Button_Lower_Lim '100'
option R_Button_Upper_Lim '800'
option HookOn_Delay '0'
option SupportLDD '0'
option LDD_Min_Break_Time '41'
option LDD_Max_Break_Time '94'
option LDD_Percent_Break '55'
option Tone_On_Hangup '1'
option BusyTone_On_Hangup '1'
option Enable_Analouge_Conf '0'
option PrackUsage '1'
option SIP_SupportedPath '0'
option IMS_Access_Network_Info ' '
option SIP_Reason_Protocol '0'
option SIP_Body_QOST '0'
option SIP_HistoryInfo '0'
option Customer_Spec2 '1'
option UTF8_Enable '0'
option RFC3325 '0'
option Accept_From_Registered '0'
option Polarity_Reversal '0'
option Closed_Dial_Plan '0'
option Netw_Dial '0'
option No_Answer_Tmo '180'
option UPnP_Enabled '0'
option NAT_Address ' '
option NAT_Address_From_SIP '0'
option HookOn_Transfer '0'
option Enable_Call_Transfer '1'
option CallerIDEnable '1'
option Multiparty_Transp '0'
option Presence_Indication '0'
option Login_Note ' '
option Login_Description ' '
option Logout_Note ' '
option Logout_Description ' '
option Resolve_Every_Transaction '2'
option Translate_Plus '1'
option Mid_Call_Services '0'
option Account_Restriction '0'
option Answering_Machine_Enable '0'

View File

@@ -1,32 +0,0 @@
#!/bin/sh /etc/rc.common
START=68
STOP=12
USE_PROCD=1
NAME=evoice
VOICE_UCI_CONFIG=voice
start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
which endptmngr >/dev/null 2>&1 && {
echo "evoice can't be started since endptmngr is installed. Please remove endptmngr and retry"
return
}
procd_open_instance
procd_set_param command $NAME
procd_set_param respawn "5" "0" "3"
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger $VOICE_UCI_CONFIG
}

View File

@@ -1,50 +0,0 @@
{
"G.711ALaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.711MuLaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.722": [
{
"BitRate": 64000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.726": [
{
"BitRate": 32000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
},
{
"BitRate": 24000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"G.729": [
{
"BitRate": 8000,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
],
"AMR": [
{
"BitRate": 7400,
"PacketizationPeriod": "20",
"SilenceSuppression": false
}
]
}

View File

@@ -1,140 +0,0 @@
{
"G.711MuLaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.711ALaw": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.726": [
{
"BitRate": 16000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 24000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 32000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 40000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.723.1": [
{
"BitRate": 5300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 6300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.729": [
{
"BitRate": 8000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"iLBC": [
{
"BitRate": 15200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 13300,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"G.722": [
{
"BitRate": 64000,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"AMR": [
{
"BitRate": 12200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 10200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 7950,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 7400,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 6700,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 5900,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 5150,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
},
{
"BitRate": 4750,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-EFR": [
{
"BitRate": 12200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-FR": [
{
"BitRate": 13200,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
],
"GSM-HR": [
{
"BitRate": 5600,
"PacketizationPeriod": "10-30",
"SilenceSuppression": true
}
]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,7 +1,7 @@
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
@@ -20,9 +20,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE
# support parallel build
#PKG_BUILD_PARALLEL:=1

View File

@@ -1,48 +0,0 @@
#
# 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:=fdtextract
PKG_RELEASE:=1
PKG_VERSION:=1.0
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e3cefda3b26c9aea3021b20725ce7b31b33eebc4
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=fdtextract
DEPENDS:= +libfdt
endef
define Package/$(PKG_NAME)/description
Command to extract sub images from FIT images.
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdtextract $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/fdtextract
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

54
fping/Makefile Normal file
View File

@@ -0,0 +1,54 @@
#
# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=fping
PKG_VERSION:=4.0
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://fping.org/dist/
PKG_HASH:=67eb4152b98ad34f99d2eec4e1098a0bb52caf13c0c89cd147349d08190fe8ce
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=BSD-4-Clause
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/fping
SECTION:=net
CATEGORY:=Network
TITLE:=sends ICMP ECHO_REQUEST packets to network hosts
URL:=http://fping.org/
endef
define Package/fping/description
fping is a ping like program which uses the Internet Control Message Protocol
(ICMP) echo request to determine if a target host is responding. fping
differs from ping in that you can specify any number of targets on the command
line, or specify a file containing the lists of targets to ping. Instead of
sending to one target until it times out or replies, fping will send out a
ping packet and move on to the next target in a round-robin fashion.
endef
CONFIGURE_ARGS+= \
--enable-ipv4 \
--enable-ipv6
TARGET_CFLAGS += -std=gnu99
define Package/fping/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fping $(1)/usr/bin/
endef
$(eval $(call BuildPackage,fping))

3
gigaset-elements/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
git-src

65
gigaset-elements/Makefile Normal file
View File

@@ -0,0 +1,65 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gigaset-elements
PKG_VERSION:=2.4.2
# PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_GIGASET_ELEMENTS_SRC_URL ?= git@public.inteno.se:gigaset-elements.git
PKG_GIGASET_ELEMENTS_VERSION ?= v$(PKG_VERSION)
PKG_SOURCE_URL:=$(PKG_GIGASET_ELEMENTS_SRC_URL)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=aa906b37062b6d7937a9c0f8e7b62b32afe4bdeb
PKG_MAINTAINER:=Magier Marcin, Figlarek Piotr
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
######################################################
define Package/gigaset-elements
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libjson-c +libcurl +libpthread
TITLE:=Gigaset elements
endef
######################################################
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) all
endef
define Package/gigaset-elements/install
$(CP) -r $(PKG_BUILD_DIR)/sysroot_common/* $(1)/
$(CP) -r $(PKG_BUILD_DIR)/sysroot_$(CONFIG_ARCH)/* $(1)/
endef
define Package/gigaset-elements/preinst
#!/bin/sh
mkdir -p $${IPKG_INSTROOT}/usr/gigaset/data/cert
mkdir -p $${IPKG_INSTROOT}/usr/gigaset/data/fw
endef
define Package/gigaset-elements/postrm
#!/bin/sh
rm -rf $${IPKG_INSTROOT}/usr/gigaset/data
rm -rf /usr/share/gigaset
endef
######################################################
$(eval $(call BuildPackage,gigaset-elements))

View File

@@ -1,90 +0,0 @@
# Copyright (c) 2017 Genexis B.V.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=gryphon-led-kernel-module
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
define KernelPackage/$(PKG_NAME)
SUBMENU:=LED modules
TITLE:=LED driver for Gryphon
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
DEPENDS:= +(TARGET_brcmbca):bcmkernel
PKG_LICENSE:=GPLv2
PKG_LICENSE_URL:=
endef
define KernelPackage/$(PKG_NAME)/description
This package contains the LED driver for Gryphon devices.
endef
EXTRA_KCONFIG:= CONFIG_RGB_LED=m
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
ifeq ($(CONFIG_TARGET_brcmbca),y)
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
# This assumes that the MODULES_SUBDIR set by OpenWrt is of the form
# lib/modules/4.19.235-abcdef where 4.19.235 is the version of our fake bcmlinux kernel
# and abcdef the git-commit.
# The kernel compiled by the Broadcom SDK has a uname -r of 4.19.235, i.e. without the git-commit.
# The assignment below removes the part after the - which puts modules in the right directory as
# long as the bcmlinux version matches the kernel version in the BCM SDK.
# So, this will only stop working in the time window where the BCM SDK has been updated
# but bcmlinux has not yet been updated.
MODULES_SUBDIR:=$(firstword $(subst -, ,$(MODULES_SUBDIR)))
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_PREFIX)-
ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"63158" "6856" "6858"))
# These targets use a 64-bit kernel
LINUX_KARCH:=arm64
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_PREFIX)-
else ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"6855" "6756" "47622" "63148" "63178"))
# These targets use a 32-bit arm-sfp kernel
LINUX_KARCH:=arm
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_ARMSFP_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_ARMSFP_TOOLCHAIN_PREFIX)-
endif
# For some reason, Broadcom's kernel does not set the include paths correctly when compiling out-of-tree modules
EXTRA_KCPPFLAGS:="-I $(LINUX_DIR)/../bcmkernel/include -I $(LINUX_DIR)/arch/arm/mach-bcm963xx/include"
endif
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
$(CP) src/* $(PKG_BUILD_DIR)
endef
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
ARCH="$(LINUX_KARCH)" \
SUBDIRS="$(PKG_BUILD_DIR)" \
EXTRA_CFLAGS="-DKERNEL_MODULE $(BUILDFLAGS) -I$(LINUX_DIR)/include -include generated/autoconf.h $(MODULE_INCLUDE)" \
modules
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
endef
$(eval $(call KernelPackage,$(PKG_NAME)))

View File

@@ -1,26 +0,0 @@
# Copyright (c) 2017 Genexis B.V.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
MODULE_NAME = gryphon-led-kernel-module
obj-m := $(MODULE_NAME).o
GENEXIS_FILES= \
main.o \
sk9822.o \
sk9822_bitbang.o
$(MODULE_NAME)-objs := $(GENEXIS_FILES)

View File

@@ -1,330 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#define DEBUG 1
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/printk.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/platform_device.h>
#include <linux/gpio/consumer.h>
#include <linux/of.h>
#include <linux/version.h>
#include "sk9822.h"
#define DRIVER_NAME "canyon_led"
#define DRIVER_AUTHOR "Genexis B.V."
#define DRIVER_DESC "Canyon LED driver for SK9822"
#define DRIVER_VERSION "1"
/**
* sysfs interfaces
*/
static ssize_t get_led_color(struct device *dev,
struct device_attribute *attr, char *buf)
{
int len;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
if (len <= 0) {
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
return -EIO;
}
return len;
}
/**
* @brief Set complete LED strip to a specific color
* @retval count number of bytes written
* @retval -EMSGSIZE if the message is too big
* @retval -EIO for all other errors (e.g. leds cannot be configured)
*/
static ssize_t set_led_color(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int ret = 0;
size_t buflen = count;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
/* strip newline */
if ((count > 0) && (buf[count-1] == '\n')) {
buflen--;
}
if (buflen != 6) { // RRGGBB\0
return -EMSGSIZE;
}
// Update the LED array here
ret = sk9822_set_color_str(sk9822, buf);
if (ret != 0) {
printk(KERN_ERR "Failed to set led color\n");
return -EIO;
}
// Now push to the HW
ret = sk9822_update(sk9822);
if (ret != 0) {
printk(KERN_ERR "Failed to update led\n");
return -EIO;
}
return count;
}
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
static ssize_t get_led_brightness(struct device *dev,
struct device_attribute *attr, char *buf)
{
int len;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
len = scnprintf(buf, PAGE_SIZE, "%x\n", sk9822->led_brightness);
if (len <= 0) {
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
return -EIO;
}
return len;
}
/**
* @brief Set LED brightness
* @retval count number of bytes written
* @retval -EINVAL if the message is not a valid hexadecimal number
* @retval -EIO for all other errors (e.g. leds cannot be configured)
*/
static ssize_t set_led_brightness(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int ret = 0;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
unsigned long val = SK9822_DEFAULT_BRIGHTNESS;
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
if (kstrtoul(buf, 16, &val)) {
return -EINVAL;
}
if(val > SK9822_DEFAULT_BRIGHTNESS) {
val = SK9822_DEFAULT_BRIGHTNESS;
}
sk9822->led_brightness = (uint8_t)val;
// Now push to the HW
ret = sk9822_update(sk9822);
if (ret != 0) {
printk(KERN_ERR "Failed to update led\n");
return -EIO;
}
return count;
}
static DEVICE_ATTR(led_brightness, S_IRUGO | S_IWUSR, get_led_brightness, set_led_brightness);
static struct attribute *sk9822_dev_attrs[] = {
&dev_attr_led_color.attr,
&dev_attr_led_brightness.attr,
NULL
};
static struct attribute_group sk9822_dev_attr_group = {
.name = "sk9822",
.attrs = sk9822_dev_attrs,
};
/**
* device prope and removal
*/
static int canyon_led_probe(struct platform_device *pdev)
{
int ret;
struct sk9822_leds *leds;
leds = devm_kzalloc(&pdev->dev, sizeof(*leds), GFP_KERNEL);
if (!leds) {
return -ENOMEM;
}
leds->dev = &pdev->dev;
leds->led_brightness = SK9822_DEFAULT_BRIGHTNESS;
ret = of_property_read_u16(pdev->dev.of_node, "led-count", &leds->led_count);
if (ret < 0) {
dev_warn(&pdev->dev, "Could not read led-count property\n");
leds->led_count = SK9822_DEFAULT_NUM_LEDS;
} else {
printk(KERN_INFO "Got led count: %u\n", leds->led_count);
}
leds->led_colors = devm_kzalloc(&pdev->dev,
(sizeof(cRGB) * leds->led_count), GFP_KERNEL);
if (!leds->led_colors) {
return -ENOMEM;
}
platform_set_drvdata(pdev, leds);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
#else
dev_warn(&pdev->dev, "Kernel version Not supported\n");
exit(1);
#endif
if (IS_ERR(leds->clock_gpio)) {
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
PTR_ERR(leds->clock_gpio));
return PTR_ERR(leds->clock_gpio);
}
gpiod_direction_output(leds->clock_gpio, 1);
if (IS_ERR(leds->clock_gpio)) {
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
PTR_ERR(leds->clock_gpio));
return PTR_ERR(leds->clock_gpio);
} else {
printk(KERN_INFO "Got clock gpio\n");
gpiod_set_value(leds->clock_gpio, 0);
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
#else
dev_warn(&pdev->dev, "Kernel version Not supported\n");
exit(1);
#endif
if (IS_ERR(leds->data_gpio)) {
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
PTR_ERR(leds->data_gpio));
return PTR_ERR(leds->data_gpio);
}
gpiod_direction_output(leds->data_gpio, 1);
if (IS_ERR(leds->data_gpio)) {
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
PTR_ERR(leds->data_gpio));
return PTR_ERR(leds->data_gpio);
} else {
printk(KERN_INFO "Got data gpio\n");
gpiod_set_value(leds->data_gpio, 0);
}
printk(KERN_INFO "Attempt to set filefs stuff\n");
ret = sysfs_create_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
if (ret) {
dev_err(&pdev->dev, "sysfs creation failed\n");
return ret;
}
#if 0
printk(KERN_INFO "Flash LEDs to verify they work\n");
sk9822_set_color_str(leds, "00FF00");
sk9822_update(leds);
msleep(200);
sk9822_set_color_str(leds, "000000");
sk9822_update(leds);
#endif
printk(KERN_INFO "canyon led successfully probed\n");
return 0;
}
static int canyon_led_remove(struct platform_device *pdev)
{
struct sk9822_leds *leds;
sysfs_remove_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
leds = platform_get_drvdata(pdev);
if (IS_ERR(leds)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -1;
}
if (leds->clock_gpio) {
gpiod_put(leds->clock_gpio);
}
if (leds->data_gpio) {
gpiod_put(leds->data_gpio);
}
printk(KERN_NOTICE "Bye, bye\n");
return 0;
}
/**
* platform driver metadata
*/
static const struct of_device_id canyon_led_of_ids[] = {
{ .compatible = "canyon,led" },
{ }
};
static struct platform_driver canyon_led = {
.probe = &canyon_led_probe,
.remove = &canyon_led_remove,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
.of_match_table = canyon_led_of_ids,
},
};
MODULE_DEVICE_TABLE(of, canyon_led_of_ids);
module_platform_driver(canyon_led);
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_VERSION(DRIVER_VERSION);
MODULE_LICENSE("GPL");

View File

@@ -1,82 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include "sk9822.h"
#include "sk9822_bitbang.h"
cRGB __hexs_to_rgb(const char *hex)
{
cRGB rgb;
int r, g, b;
sscanf(hex, "%02x%02x%02x", &r, &g, &b);
// This needs sanity checking
rgb.r = r;
rgb.g = g;
rgb.b = b;
return rgb;
}
/**
* @brief update the color over the given device struct to the provided HEX color
*/
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex)
{
int i;
cRGB color = __hexs_to_rgb(hex);
for (i = 0; i < sk9822->led_count; i++) {
sk9822->led_colors[i] = color;
}
return 0;
}
/**
* @brief write device struct to the device
*/
int sk9822_update(struct sk9822_leds *sk9822)
{
uint16_t i;
uint16_t led_count = sk9822->led_count;
// Start Frame
sk9822_bb_write(sk9822, 0x00);
sk9822_bb_write(sk9822, 0x00);
sk9822_bb_write(sk9822, 0x00);
sk9822_bb_write(sk9822, 0x00);
for (i = 0; i < led_count; i++) {
cRGB *p = &sk9822->led_colors[i];
sk9822_bb_write(sk9822, 0xe0+sk9822->led_brightness); // Maximum global brightness
sk9822_bb_write(sk9822, p->b);
sk9822_bb_write(sk9822, p->g);
sk9822_bb_write(sk9822, p->r);
}
// End frame
sk9822_bb_write(sk9822, 0xff);
sk9822_bb_write(sk9822, 0xff);
sk9822_bb_write(sk9822, 0xff);
sk9822_bb_write(sk9822, 0xff);
return 0;
}

View File

@@ -1,46 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef SK9822_H_
#define SK9822_H_
#include <linux/types.h>
#define SK9822_DEFAULT_NUM_LEDS 32 // U16, used if DT param fails
#define SK9822_DEFAULT_BRIGHTNESS 15 // 5-bit brightness, 0-31
typedef struct {
uint8_t b;
uint8_t g;
uint8_t r;
} cRGB; // BGR (SK9822 Standard)
struct sk9822_leds {
struct device *dev;
struct gpio_desc *clock_gpio;
struct gpio_desc *data_gpio;
cRGB *led_colors;
uint8_t led_brightness;
uint16_t led_count;
};
int sk9822_set_color_str(struct sk9822_leds *sk9822, const char *hex);
int sk9822_update(struct sk9822_leds *sk9822);
#endif /* SK9822_H_ */

View File

@@ -1,48 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#include <linux/gpio/consumer.h>
#include <linux/delay.h>
#include <linux/types.h>
#include "sk9822.h"
/**
* @brief Bitbang write operation CLOCK+DATA
*
* Assumed state before call: CLOCK- Low, DATA- High
*/
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c)
{
uint8_t i;
for (i = 0; i < 8 ; i++) {
if (!(c&0x80)) {
gpiod_set_value(sk9822->data_gpio, 0); // set data low
} else {
gpiod_set_value(sk9822->data_gpio, 1); // set data high
}
gpiod_set_value(sk9822->clock_gpio, 1); // set clock high, data sampled here
c <<= 1;
udelay(1); // stretch clock
gpiod_set_value(sk9822->clock_gpio, 0); // set clock low
}
// State after call: SCK Low, Data high
}

View File

@@ -1,28 +0,0 @@
/*
* Copyright (c) 2017 Genexis B.V.
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef _SK9822_BB_H_
#define _SK9822_BB_H_
#include <linux/types.h>
#include "sk9822.h"
void sk9822_bb_write(struct sk9822_leds *sk9822, uint8_t c);
#endif /* _SK9822_BB_H_ */

4
ice-client/Config.in Normal file
View File

@@ -0,0 +1,4 @@
config ICE_OPEN
bool "Use pre-compiled version for Open SDK"
default n

1046
ice-client/Makefile Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
#!/bin/sh
grep -rq "^ice:" /etc/passwd || {
adduser -D -H -s /bin/false ice
}
uci -q delete passwords.ice
uci -q set passwords.ice=usertype
uci -q set passwords.ice.password="\$WPAKEY"
uci -q add_list passwords.ice._access_r=root
uci -q commit passwords
uci show rpcd | grep username=.*ice.* >/dev/null || {
cat >> /etc/config/rpcd << EOF
config login
option username 'ice'
option password '\$p\$ice'
list _access_r 'none'
list write 'user-user'
list write 'juci-broadcom-dsl'
list write 'juci-broadcom-dsl-admin'
list write 'juci-broadcom-ethernet'
list write 'juci-broadcom-iptv'
list write 'juci-broadcom-vlan'
list write 'juci-broadcom-vlan-admin'
list write 'juci-wireless'
list write 'juci-wireless-admin'
list write 'juci-catv'
list write 'juci-ddns'
list write 'juci-diagnostics'
list write 'juci-dnsmasq-dhcp'
list write 'juci-dropbear'
list write 'juci-ethernet'
list write 'juci-event'
list write 'juci-firewall-fw3'
list write 'juci-iconnect'
list write 'juci-igmpinfo'
list write 'juci-inteno-backup'
list write 'juci-inteno-multiwan'
list write 'juci-inteno-provisioning'
list write 'juci-inteno-qos'
list write 'juci-inteno-voice-client'
list write 'juci-minidlna'
list write 'juci-mod-status'
list write 'juci-mod-system'
list write 'juci-natalie-dect'
list write 'juci-netmode'
list write 'juci-network-netifd'
list write 'juci-owsd'
list write 'juci-printer'
list write 'juci-realtime-graphs'
list write 'juci-samba'
list write 'juci-sfp'
list write 'juci-snmpd'
list write 'juci-sysupgrade'
list write 'juci-uhttpd'
list write 'juci-upnp'
list write 'juci-usb'
list write 'core'
list write 'unauthenticated'
EOF
}
exit 0

46
icgroupd/Makefile Normal file
View File

@@ -0,0 +1,46 @@
#
# Copyright (C) 2016 Inteno Broadband AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=icgroupd
PKG_VERSION:=1.0
PKG_RELEASE:=0
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=
PKG_MAINTAINER:=Inteno Broadband AB
include $(INCLUDE_DIR)/package.mk
define Package/icgroupd
SECTION:=base
CATEGORY:=Base system
TITLE:=Inteno cgroup daemon
DEPENDS:=+uci +busybox
endef
define Package/icgroupd/description
This package contains Intenos cgroup daemon and associated
configuration and startup scripts.
endef
define Build/Compile
true
endef
define Package/icgroupd/install
$(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d $(1)/etc/config
$(INSTALL_CONF) ./files/cgroups.config $(1)/etc/config/cgroups
$(INSTALL_BIN) ./files/cgroups.init $(1)/etc/init.d/cgroups
$(INSTALL_BIN) ./files/cgroupd $(1)/sbin/
endef
$(eval $(call BuildPackage,icgroupd))

76
icgroupd/files/cgroupd Executable file
View File

@@ -0,0 +1,76 @@
#!/bin/sh
CGBASEDIR=$1
CGCONFIG=$2
[ -n "$CGBASEDIR" -a -n "$CGCONFIG" ] || exit 1
[ -r /lib/functions.sh ] || exit 1
. /lib/functions.sh
CGPROCMAP=/tmp/cgprocmap
CGPERIOD=3s
DBGLOG=/tmp/cgroupd.log
DEBUG=0
add_to_procmap () {
local name_grp=$1
local name grp
name=$(echo $name_grp |awk -F= '{print $1}')
grp=$(echo $name_grp |awk -F= '{print $2}')
echo "($name) $grp" >> $CGPROCMAP
}
# Read configuration file and create process:group look-up table
# in /tmp file
read_config () {
local enab
config_load $CGCONFIG
config_get enab cgroups enabled "1"
[ $enab -eq 0 ] && exit 1
config_get CGDEFGROUP cgroups defgroup "_undef_"
[ "$CGDEFGROUP" == "_undef_" ] && exit 1
[ "$DEBUG" == "1" ] && echo "default $CGDEFGROUP" >> $DBGLOG
echo -n '' > $CGPROCMAP
config_list_foreach procmap procmap add_to_procmap
[ "$DEBUG" == "1" ] && cat $CGPROCMAP >> $DBGLOG
}
# Move all process except init from cgroup root to cgroups according
# to /tmp look-up table
move_wild_procs () {
local wild_procs=$(cat $CGBASEDIR/cgroup.procs)
local pid name grp
for pid in $wild_procs; do
[ $pid -eq 1 ] && continue
if [ -d /proc/$pid ]; then
name=$(awk '{print $2}' /proc/$pid/stat)
grp=$(awk "\$1==\"$name\" {print \$2}" $CGPROCMAP)
[ "$grp" == "." ] && continue
[ -n "$grp" ] || grp=$CGDEFGROUP
[ "$DEBUG" == "1" ] && \
echo "Moving proc $pid $name to $grp" >> $DBGLOG
echo $pid > $CGBASEDIR/$grp/cgroup.procs
fi
done
}
[ "$DEBUG" == "1" ] && echo "$0 started $(date)" >> $DBGLOG
read_config
while true; do
move_wild_procs
sleep $CGPERIOD
done

View File

@@ -0,0 +1,48 @@
config cgroups cgroups
option enabled 1
option defgroup iopsys/normal
config cgroup _root_
# list option cpu.rt_runtime_us=50000
list option memory.move_charge_at_immigrate=1
config cgroup iopsys
list option cpu.shares=4096
# list option cpu.rt_runtime_us=40000
list option memory.limit_in_bytes=-1
list option memory.move_charge_at_immigrate=1
config cgroup iopsys_normal
list option cpu.shares=1024
# list option cpu.rt_runtime_us=10000
list option memory.limit_in_bytes=-1
list option memory.move_charge_at_immigrate=1
config cgroup iopsys_high
list option cpu.shares=4096
# list option cpu.rt_runtime_us=30000
list option memory.limit_in_bytes=-1
list option memory.move_charge_at_immigrate=1
config cgroup 3prt
list option cpu.shares=1024
# list option cpu.rt_runtime_us=10000
list option memory.limit_in_bytes=75M
list option memory.move_charge_at_immigrate=1
config cgroup 3prt_normal
list option cpu.shares=1024
# list option cpu.rt_runtime_us=2500
list option memory.limit_in_bytes=75M
list option memory.move_charge_at_immigrate=1
config cgroup 3prt_high
list option cpu.shares=4096
# list option cpu.rt_runtime_us=7500
list option memory.limit_in_bytes=75M
list option memory.move_charge_at_immigrate=1
config procmap procmap
list procmap kthreadd=.
list procmap minidlna=3prt/normal

93
icgroupd/files/cgroups.init Executable file
View File

@@ -0,0 +1,93 @@
#!/bin/sh /etc/rc.common
START=01
USE_PROCD=1
PROCD_DEBUG=1
NAME=cgroupd
CGBASEDIR=/sys/fs/cgroup
CGCONFIG="cgroups"
DBGLOG=/tmp/cginit.log
DEBUG=0
cgroupinit_set_knob_value () {
local knob_val=$1
local dir=$2
local knob val
knob=$(echo $knob_val |awk -F= '{print $1}')
val=$(echo $knob_val |awk -F= '{print $2}')
/bin/echo $val > $CGBASEDIR/$dir/$knob
[ "$DEBUG" == "1" ] && \
echo "/bin/echo $val > $CGBASEDIR/$dir/$knob (ret=$?)" >> $DBGLOG
}
cgroupinit_create_group () {
local cgrp=$1
local dir
[ "$DEBUG" == "1" ] && echo "Create group $cgrp:" >> $DBGLOG
if [ "$cgrp" == "_root_" ]; then
dir=.
else
dir=$(echo $cgrp |tr '_' '/')
if [ ! -d $CGBASEDIR/$dir ]; then
mkdir $CGBASEDIR/$dir
[ "$DEBUG" == "1" ] && \
echo "mkdir $CGBASEDIR/$dir (ret=$?)" >> $DBGLOG
fi
fi
config_list_foreach $cgrp option cgroupinit_set_knob_value $dir
}
cgroupinit_configure_cgroups () {
local enab defgrp
[ "$DEBUG" == "1" ] && echo "$0 started $(date)" >> $DBGLOG
config_load $CGCONFIG
config_get enab cgroups enabled "1"
[ $enab -eq 0 ] && return 1
config_get defgrp cgroups defgroup "_undef_"
[ "$defgrp" == "_undef_" ] && return 1
if ! grep -q " $CGBASEDIR cgroup " /proc/mounts; then
mount -t cgroup -o nodev,noexec,nosuid cgroup $CGBASEDIR
[ $? -eq 0 ] || return 1
fi
config_foreach cgroupinit_create_group cgroup
return 0
}
start_service () {
cgroupinit_configure_cgroups
[ $? -eq 0 ] || return
procd_open_instance
procd_set_param command /sbin/cgroupd $CGBASEDIR $CGCONFIG
procd_set_param respawn
procd_close_instance
}
stop_service () {
local cgdir procs prc
for cgdir in $(find $CGBASEDIR -type d -mindepth 1 -depth); do
procs=$(cat $cgdir/cgroup.procs)
for prc in $procs; do
echo $prc > $CGBASEDIR/cgroup.procs
done
rmdir $cgdir
done
}
service_triggers() {
procd_add_reload_trigger $CGCONFIG
}

35
icwmp/Config_cwmp.in Normal file
View File

@@ -0,0 +1,35 @@
if PACKAGE_icwmp-curl || PACKAGE_icwmp-zstream
config CWMP_SCRIPTS_FULL
bool "Install all icwmp scripts"
default y
choice
prompt "Select ACS sever"
default CWMP_ACS_MULTI
config CWMP_ACS_MULTI
bool "No specific ACS, follow standard"
config CWMP_ACS_HDM
bool "HDM"
endchoice
config CWMP_DEBUG
bool "Compile with debug options"
default y
config XMPP_ENABLE
bool "enable xmpp feature"
default n
config CWMP_DEVEL_DEBUG
bool "Compile with development debug options"
default n
config LIBDATAMODEL_VENDOR_PREFIX
string "Vendor Prefix"
default "X_Inteno_SE_"
endif

View File

@@ -0,0 +1,7 @@
if PACKAGE_libdatamodel
config UPNP_TR064
bool "Compile with tr064 features"
default n
endif

View File

@@ -1,72 +1,88 @@
#
# Copyright (C) 2020-2022 IOPSYS Software Solutions AB
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the BSD-3-Clause
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.1.19
PKG_VERSION:=4.0-2018-09-03
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=http://public.inteno.se:/icwmp.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
PKG_SOURCE_VERSION:=9d8389cda16f410826920bb27fd8af4d28c79de9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
PKG_SOURCE_VERSION:=fe324dbae2c8dbcfb55555dee9b3700280151aa1
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_CONFIG_DEPENDS:= \
CONFIG_CWMP_ACS_MULTI \
CONFIG_CWMP_ACS_HDM \
CONFIG_CWMP_DEBUG \
CONFIG_CWMP_DEVEL_DEBUG
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/icwmp/default
define Package/libdatamodel
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for broadband-forum data model
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
endef
define Package/icwmp_stun
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
endef
define Package/icwmp/Default
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=TR069 CWMP client
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbf_api
TITLE:=CWMP client
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +libexpat +libstrophe +curl +libtrace +libdatamodel
endef
define Package/icwmp-openssl
$(Package/icwmp/default)
TITLE += (openssl)
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
VARIANT:=openssl
define Package/icwmp/description
A free client implementation of CWMP (TR-069) protocol
endef
define Package/icwmp-wolfssl
$(Package/icwmp/default)
TITLE += (wolfssl)
DEPENDS += +PACKAGE_icwmp-wolfssl:libwolfssl
CONFLICTS := icwmp-openssl
VARIANT:=wolfssl
define Package/icwmp-curl
$(call Package/icwmp/Default)
TITLE+= (using libcurl)
DEPENDS+= +libcurl
VARIANT:=curl
endef
define Package/icwmp-mbedtls
$(Package/icwmp/default)
TITLE += (mbedtls)
DEPENDS += +PACKAGE_icwmp-mbedtls:libmbedtls
CONFLICTS := icwmp-openssl icwmp-wolfssl
VARIANT:=mbedtls
DEFAULT_VARIANT:=1
define Package/icwmp-zstream
$(call Package/icwmp/Default)
TITLE+= (using libzstream)
DEPENDS+= +libzstream
VARIANT:=zstream
endef
ifeq ($(BUILD_VARIANT),openssl)
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
endif
define Package/icwmp-zstream/config
source "$(SOURCE)/Config_cwmp.in"
endef
ifeq ($(BUILD_VARIANT),wolfssl)
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
endif
ifeq ($(BUILD_VARIANT),mbedtls)
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
endif
define Package/libdatamodel/config
source "$(SOURCE)/Config_datamodel.in"
endef
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
ifneq ($(USE_LOCAL),)
@@ -75,34 +91,151 @@ define Build/Prepare
endef
endif
define Package/icwmp/default/install
$(INSTALL_DIR) $(1)/etc/icwmpd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libcwmpdm.so $(1)/usr/lib/bbfdm/libcwmpdm.so
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
$(INSTALL_DATA) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)/etc/bbfdm/json/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
TARGET_CFLAGS += -DEX400
endif
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBDATAMODEL_VENDOR_PREFIX)\\\"
TARGET_CFLAGS += \
-D_GNU_SOURCE -D_AADJ
ifneq ($(CWMP_REVISION)_,_)
ifneq ($(CWMP_REVISION),exported)
ifneq ($(CWMP_REVISION),Unversioned directory)
TARGET_CFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
TARGET_LDFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
endif
endif
endif
TARGET_LDFLAGS += \
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
CONFIGURE_ARGS += \
--with-uci-include-path=$(STAGING_DIR)/usr/include \
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
--with-libubus-include-path=$(STAGING_DIR)/usr/include
ifeq ($(CONFIG_UPNP_TR064),y)
CONFIGURE_ARGS += \
--enable-upnptr064
endif
ifeq ($(CONFIG_XMPP_ENABLE),y)
CONFIGURE_ARGS += \
--enable-xmpp
endif
ifeq ($(BUILD_VARIANT),zstream)
CONFIGURE_ARGS += \
--enable-http=zstream \
--with-zstream-include-path=$(STAGING_DIR)/usr/include
endif
ifeq ($(BUILD_VARIANT),curl)
CONFIGURE_ARGS += \
--enable-http=curl
endif
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
CONFIGURE_ARGS += \
--enable-acs=multi
endif
ifeq ($(CONFIG_CWMP_ACS_HDM),y)
CONFIGURE_ARGS += \
--enable-acs=hdm
endif
ifeq ($(CONFIG_CWMP_DEBUG),y)
CONFIGURE_ARGS += \
--enable-debug
endif
ifeq ($(CONFIG_CWMP_DEVEL_DEBUG),y)
CONFIGURE_ARGS += \
--enable-devel
endif
define Package/libdatamodel/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.so* $(1)/lib/
endef
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
Package/icwmp-wolfssl/install = $(Package/icwmp/default/install)
Package/icwmp-mbedtls/install = $(Package/icwmp/default/install)
define Package/icwmp-$(BUILD_VARIANT)/install
$(INSTALL_DIR) $(1)/etc/icwmpd
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/bin/.libs/icwmpd $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp $(1)/etc/config
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/icwmpd
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/firewall.cwmp $(1)/etc/firewall.cwmp
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmpd.init $(1)/etc/init.d/icwmpd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/90-cwmpfirewall
ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
$(INSTALL_DIR) $(1)/usr/share/icwmp
$(CP) $(PKG_BUILD_DIR)/scripts/defaults $(1)/usr/share/icwmp
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/icwmp
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/icwmp.sh $(1)/usr/sbin/icwmp
endif
$(CP) ./files/* $(1)/
endef
$(eval $(call BuildPackage,icwmp-openssl))
$(eval $(call BuildPackage,icwmp-wolfssl))
$(eval $(call BuildPackage,icwmp-mbedtls))
define Package/icwmp_stun/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_stund $(1)/usr/sbin/icwmp_stund
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_stund $(1)/etc/init.d/icwmp_stund
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_stun $(1)/etc/config
endef
define Package/icwmp_xmpp/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_xmppd $(1)/usr/sbin/icwmp_xmppd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/init/icwmp_xmppd $(1)/etc/init.d/icwmp_xmppd
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp_xmpp $(1)/etc/config
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libdatamodel
$(CP) $(PKG_BUILD_DIR)/dm/*.h $(1)/usr/include/libdatamodel
$(CP) $(PKG_BUILD_DIR)/dm/dmtree/common/root.h $(1)/usr/include/libdatamodel
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.so* $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libdatamodel.a $(1)/lib
endef
define Package/icwmp-$(BUILD_VARIANT)/postinst
#!/bin/sh
echo "$(CWMP_BKP_FILE)" >> $${IPKG_INSTROOT}/etc/sysupgrade.conf
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Enabling rc.d symlink for icwmpd"
/etc/init.d/icwmpd enable
fi
exit 0
endef
define Package/icwmp-$(BUILD_VARIANT)/prerm
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
echo "Disabling rc.d symlink for icwmpd"
/etc/init.d/icwmpd disable
fi
exit 0
endef
$(eval $(call BuildPackage,icwmp-curl))
$(eval $(call BuildPackage,libdatamodel))
$(eval $(call BuildPackage,icwmp_stun))
$(eval $(call BuildPackage,icwmp_xmpp))
$(eval $(call BuildPackage,icwmp-zstream))

136
icwmp/README Normal file
View File

@@ -0,0 +1,136 @@
1)Build
Requirements<74>:
librairies:
- libuci.so
- libexpat.so
- libcurl.so
- libpthread.so
- libopenssl.so
- libz.so
- libcrypto.so
the librairies should be present in the "staging_dir/target-i386_uClibc-0.9.30.1/usr/lib/" or "staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib"
header files and folders:
- expat.h
- expat_external.h
- uci.h
- uci_config.h
- zlib.h
- curl folder
- openssl folder
the header files and folders should be present in the staging_dir/target-i386_uClibc-0.9.30.1/usr/include/ or staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/usr/include/
if a librairie doesn't exist:
a- run make menuconfig and select the librarie
b- build the librarie package
2) Build
this software is composed of 3 packages:
- icwmp package: contains icwmpd daemon
- cwmp lib package: contains cwmplib and contains cwmp_value_change binary. They could be used by other user space applications in order to notify the icwmp daemon when paramter changes
- cwmp kernel package: contains cwmp kernel module. This module could be used by other kernel modules to notify the icwmpd daemon when kernel parameter changes
The three packages should be selected in the make menu config in order to get the three packages compiled.
To compile the three packages: $ make package/cwmpd/compile
3) OpenWRT settings
in the OpenWRT, Add the following lines in the /usr/share/udhcpc/default.script file:
uci_set_state provisioning iup tr069url "$url"
uci_set_state provisioning iup provisioningcode "$provisioningcode"
4) Run
Requirements:
- libuci package should be installed
- libexpat package should be installed
- libcurl package should be installed
- libpthread package should be installed
- libopenssl package should be installed
- libz package should be installed
- libcrypto package should be installed
Configure the acs url in the /etc/config/icwmp
and then start the cwmpd service: /etc/init.d/icwmpd start
for the help: /etc/init.d/icwmpd
5) Value Change
5.1) value change for user space applications (using the libcwmp)
Before using the libcwmp, we should check that the libcwmp package is selected in "make menu config". and we should check that the package is compiled.
The libcwmp should be installed uin the OpenWRT firmware
example of using libcwmp
in myapplication.c
#...
#include <cwmp_lib.h>
#...
int anyfunction ()
{
.....
/* parameter change here */
/* so we inform the icwmp: */
lib_api_cwmp_value_change_call (3, "InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress","lan2","3");
.....
/*
Description of lib_api_cwmp_value_change_call input parameters
parameter 1 : is the number of input string in the function lib_api_cwmp_value_change_call
parameter 2 : is the parameter path
parameter 3 : is the first correspondence related to the first indice
parameter 4 : is the second correspondence related to the second indice
.
.
.
parameter n : is the (n-2) correspondence related to the (n-2) indice
*/
}
5.2) value change for user space applications (using the cwmp_value_change CLI)
Before using the libcwmp, we should check that the libcwmp package is selected in "make menu config". and we should check that the package is compiled.
The libcwmp should be installed uin the OpenWRT firmware
in OpenWRT:
root@OpenWrt:~# cwmp_value_change InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress "lan2" "3"
in this case the command will force cwmp client to send a notification to the ACS (if and only if the parameter path as configured as active or as passive parameter using the setAttributeParameter method)
5.3) value change for kernel space modules
Before using the cwmp kernel module for value change, we should check that the kernel module package is selected in "make menu config". and we should check that the package is compiled.
The kernel module should be installed uin the OpenWRT firmware and should be insert before all other kernel modules
example of using cwmp kernel module
in mykernelmodule.c
#...
#include <linux/cwmp_kernel.h>
#...
int anykernelfunction ()
{
.....
/* parameter change here */
/* so we inform the cwmp: */
kernel_api_cwmp_value_change_call (3, "InternetGatewayDevice.LANDevice.{i}.LANHostConfigManagement.IPInterface.{i}.IPInterfaceIPAddress","lan2","3");
.....
/*
Description of lib_api_cwmp_value_change_call input parameters
parameter 1 : is the number of input string in the function lib_api_cwmp_value_change_call
parameter 2 : is the parameter path
parameter 3 : is the first correspondence related to the first indice
parameter 4 : is the second correspondence related to the second indice
.
.
.
parameter n : is the (n-2) correspondence related to the (n-2) indice
*/
}

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