mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
15 Commits
libeasy
...
json-schem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5eb7e89e82 | ||
|
|
0b2cdc705f | ||
|
|
33b0078ee1 | ||
|
|
7f8b7ffc27 | ||
|
|
4a0ed6226b | ||
|
|
a6cdf8d6ae | ||
|
|
7e10bb3c89 | ||
|
|
88c298bf45 | ||
|
|
d522e06f1a | ||
|
|
7f67b4884a | ||
|
|
7d356ffb78 | ||
|
|
85690d0e6a | ||
|
|
5b7ec894a3 | ||
|
|
6dd485609d | ||
|
|
b856f46843 |
@@ -5,18 +5,18 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=1.0-2019-12-10
|
||||
PKG_VERSION:=1.0-2019-11-05
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0ea0b2c89a51ad56ca76d171b7fd5dcf38e102cd
|
||||
PKG_SOURCE_VERSION:=8b6a24669f6a0d63ac1c706fbe607eddd6446bce
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@@ -81,7 +81,6 @@ define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/dmtree/tr181/*.h $(1)/usr/include/libbbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/dmtree/tr157/*.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
@@ -13,7 +13,7 @@ PKG_RELEASE:=1
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0accbd7266b2742ad8921edd5dab974fc384a49a
|
||||
PKG_SOURCE_VERSION:=429988cbd11edab826355f01b09f0588893b550a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -39,12 +39,6 @@ define Package/libwifi/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libeasy
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Helper and utility functions library (libeasy)
|
||||
DEPENDS+=+libnl +libnl-route
|
||||
endef
|
||||
|
||||
define Package/libwifi
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
@@ -94,8 +88,7 @@ endef
|
||||
subdirs := \
|
||||
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
||||
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet) \
|
||||
$(if $(CONFIG_PACKAGE_libeasy),libeasy)
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet)
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
@@ -115,13 +108,6 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev/libeasy
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
@@ -154,11 +140,6 @@ define Build/InstallDev
|
||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||
endef
|
||||
|
||||
define Package/libeasy/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||
@@ -181,4 +162,3 @@ endef
|
||||
$(eval $(call BuildPackage,libwifi))
|
||||
$(eval $(call BuildPackage,libdsl))
|
||||
$(eval $(call BuildPackage,libethernet))
|
||||
$(eval $(call BuildPackage,libeasy))
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2019-12-11
|
||||
PKG_VERSION:=4.0-2019-10-17
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3fdaca7e3463d46a52f31496b0f84deb6b21eaf8
|
||||
PKG_SOURCE_VERSION:=ee2e6c4e4063b822895a6e2612acd4b06caeffa6
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -33,52 +33,45 @@ CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/icwmp_stun
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 stun Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libopenssl +libblobmsg-json
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 stun Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libopenssl +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/icwmp_xmpp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 xmpp feature
|
||||
DEPENDS:=+libuci +libubox +libexpat +libstrophe
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 xmpp feature
|
||||
DEPENDS:=+libuci +libubox +libexpat +libstrophe
|
||||
endef
|
||||
|
||||
define Package/icwmp_twamp
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 twamp feature
|
||||
DEPENDS:=+libuci
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 twamp feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp_udpechoserver
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 udpechoserver feature
|
||||
DEPENDS:=+libuci
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 udpechoserver feature
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/icwmp_bulkdata
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +curl +libblobmsg-json +libbbfdm
|
||||
endef
|
||||
|
||||
define Package/icwmp-tr098
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CWMP client for TR-098 Data Model
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl +libtr098
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=TR-069 BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +curl +libblobmsg-json +libbbfdm
|
||||
endef
|
||||
|
||||
define Package/icwmp/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libbbfdm
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libbbfdm +libtr098
|
||||
endef
|
||||
|
||||
define Package/icwmp/description
|
||||
@@ -110,14 +103,13 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_CFLAGS += -DEX400
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_icwmp-tr098),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-icwmp_tr098
|
||||
endif
|
||||
|
||||
ifneq ($(CWMP_REVISION)_,_)
|
||||
ifneq ($(CWMP_REVISION),exported)
|
||||
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||
@@ -166,10 +158,21 @@ CONFIGURE_ARGS += \
|
||||
--enable-devel
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libtr098),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr098
|
||||
endif
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr181
|
||||
|
||||
define Package/icwmp-$(BUILD_VARIANT)/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin
|
||||
ifeq ($(CONFIG_PACKAGE_libtr098),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmp_tr098d $(1)/usr/sbin
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/cwmp $(1)/etc/config
|
||||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
@@ -187,11 +190,6 @@ endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/icwmp-tr098/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmp_tr098d $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Package/icwmp_stun/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmp_stund $(1)/usr/sbin/icwmp_stund
|
||||
@@ -263,5 +261,4 @@ $(eval $(call BuildPackage,icwmp_xmpp))
|
||||
$(eval $(call BuildPackage,icwmp_udpechoserver))
|
||||
$(eval $(call BuildPackage,icwmp_twamp))
|
||||
$(eval $(call BuildPackage,icwmp_bulkdata))
|
||||
$(eval $(call BuildPackage,icwmp-tr098))
|
||||
$(eval $(call BuildPackage,icwmp-zstream))
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3008fe46ee9247f0203b3a125fddebadbdd7dcdc
|
||||
PKG_SOURCE_VERSION:=a6a39128b1fe5132e51de4f580bf66f373515dcd
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
@@ -20,21 +20,16 @@ define Package/ieee1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 handler
|
||||
DEPENDS:= +libwifi +ubox +libpicoevent +libpcap +libopenssl +libuci +libjson-c
|
||||
DEPENDS:=+meshcomms +libubox +libubus +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/ieee1905/description
|
||||
IEEE1905 stack with extended functionalities.
|
||||
Listens to ieee1905 messages, parse and expose them over ubus.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-DSEND_EMPTY_TLVS \
|
||||
-DFIX_BROKEN_TLVS \
|
||||
-DSPEED_UP_DISCOVERY \
|
||||
-DREGISTER_EXTENSION_BBF
|
||||
#-DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./ieee1905/* $(PKG_BUILD_DIR)/
|
||||
@@ -42,16 +37,9 @@ TARGET_CFLAGS += \
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/button
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ieee1905 $(1)/etc/init.d/ieee1905
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/button/11-ieee1905 $(1)/etc/hotplug.d/button/11-ieee1905
|
||||
$(INSTALL_DATA) ./files/etc/config/ieee1905 $(1)/etc/config/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905d $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libs/*.so $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905 $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ieee1905))
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
config ieee1905
|
||||
option enabled '1'
|
||||
option debug true
|
||||
|
||||
config meshcomms 'global'
|
||||
option enabled '1'
|
||||
option basemacint 'wan'
|
||||
option mapall true
|
||||
# option registrar 'rai0'
|
||||
option debug_level 2
|
||||
option port 8888
|
||||
option cmdu_event false
|
||||
|
||||
#config al-iface
|
||||
# option enabled '1'
|
||||
# option ifname 'br-lan'
|
||||
# option media 'bridge'
|
||||
# option manufacturer_name 'Broadcom'
|
||||
# option model_name 'Eth EG400'
|
||||
# option model_number '00002'
|
||||
# option device_name 'EG400R1'
|
||||
|
||||
#config al-iface
|
||||
# option enabled '1'
|
||||
# option ifname 'wl0'
|
||||
# option media 'ap'
|
||||
# option manufacturer_name 'Mediatek'
|
||||
# option model_name 'WIFI EX400'
|
||||
# option model_number '00001'
|
||||
# option device_name 'EX400R0'
|
||||
|
||||
#config al-iface
|
||||
# option enabled '1'
|
||||
# option ifname 'wl1'
|
||||
# option media 'ap'
|
||||
# option manufacturer_name 'Mediatek'
|
||||
# option model_name 'WIFI EX400'
|
||||
# option model_number '00001'
|
||||
# option device_name 'EX400R0'
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
TOPOLOGY_FILE="/tmp/topology_change"
|
||||
WPS_FILE="/tmp/virtual_push_button"
|
||||
|
||||
handle_topology_change() {
|
||||
[ -f ${TOPOLOGY_FILE} ] && \
|
||||
touch ${TOPOLOGY_FILE}
|
||||
}
|
||||
|
||||
handle_wps() {
|
||||
[ -f ${WPS_FILE} ] && \
|
||||
touch ${WPS_FILE}
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
add|register)
|
||||
[ "wifibutton" == "$INTERFACE" -o "ecobutton" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wifi_2g" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wifi_5g" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wpsbutton" == "$INTERFACE" ] && {
|
||||
handle_wps
|
||||
}
|
||||
[ "wpscbutton" == "$INTERFACE" ] && {
|
||||
handle_topology_change
|
||||
}
|
||||
;;
|
||||
remove|unregister)
|
||||
;;
|
||||
esac
|
||||
@@ -4,184 +4,11 @@ START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
MESH_CONF=/tmp/meshcomms.config
|
||||
INTERFACE=""
|
||||
|
||||
validate_global_section()
|
||||
{
|
||||
uci_validate_section ieee1905 meshcomms "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'basemacint:string:wan' \
|
||||
'almac:string' \
|
||||
'registrar:string' \
|
||||
'mapall:bool:true' \
|
||||
'debug_level:uinteger:5' \
|
||||
'port:port:8888' \
|
||||
'cmdu_event:bool:true'
|
||||
}
|
||||
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:true' \
|
||||
'enabled:bool:true'
|
||||
}
|
||||
|
||||
get_device_name() {
|
||||
local device
|
||||
# Get wan L3 interface
|
||||
ubus list |grep -iq network.interface.${1}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
json_load "$(ubus -t 2 call network.interface.${1} status)"
|
||||
json_get_var device device
|
||||
echo ${device}
|
||||
fi
|
||||
}
|
||||
|
||||
get_interface_mac() {
|
||||
local l3 basemac
|
||||
l3=$(get_device_name ${1})
|
||||
if [ -n ${l3} ]; then
|
||||
json_load "$(ubus -t 2 call network.device status "{\"name\":\"${l3}\"}")"
|
||||
json_get_var basemac macaddr
|
||||
fi
|
||||
local first=0x$(echo $basemac |cut -d : -f 1)
|
||||
local rest=$(echo $basemac |cut -d : -f 2-)
|
||||
# Set local bit
|
||||
first=$((first|2))
|
||||
first=$(printf "%x" $first)
|
||||
basemac="${first}:${rest}"
|
||||
echo ${basemac}
|
||||
}
|
||||
|
||||
validate_al_section()
|
||||
{
|
||||
uci_validate_section ieee1905 al-iface "${1}" \
|
||||
'enabled:bool:false' \
|
||||
'ifname:string' \
|
||||
'media:string:eth' \
|
||||
'manufacturer_name:string:iopsys' \
|
||||
'model_name:string' \
|
||||
'model_number:string' \
|
||||
'device_name:string'
|
||||
}
|
||||
|
||||
configure_interface()
|
||||
{
|
||||
local ifname media enabled manufacturer_name model_name model_number device_name
|
||||
validate_al_section ${1} || {
|
||||
echo "Validation of global section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ ${enabled} -eq 0 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
if [ -z ${INTERFACE} ]; then
|
||||
INTERFACE=${ifname}
|
||||
else
|
||||
INTERFACE="${INTERFACE},${ifname}"
|
||||
fi
|
||||
|
||||
json_add_object
|
||||
json_add_string ifname ${ifname}
|
||||
json_add_string media ${media}
|
||||
json_add_string manufacturer_name ${manufacturer_name}
|
||||
json_add_string model_name ${model_name}
|
||||
json_add_string model_number ${model_number}
|
||||
json_add_string device_name ${device_name}
|
||||
json_close_object
|
||||
}
|
||||
|
||||
configure_meshcomms()
|
||||
{
|
||||
local enabled almac basemacint mapall debug_level port l3device basemac intf registrar cmdu_event
|
||||
|
||||
validate_global_section global || {
|
||||
echo "Validation of global section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z ${almac} ]; then
|
||||
basemac=$(get_interface_mac ${basemacint})
|
||||
else
|
||||
basemac=${almac}
|
||||
fi
|
||||
|
||||
|
||||
local fname cname model cUrl
|
||||
fname=$(db get hw.board.boardId)
|
||||
cname=$(db get hw.board.iopVerCustomer)
|
||||
model=$(db get hw.board.routerModel)
|
||||
cUrl="http://192.168.1.1"
|
||||
|
||||
json_init
|
||||
# fill the al-iface info
|
||||
json_add_array al-iface
|
||||
config_foreach configure_interface al-iface
|
||||
json_close_array
|
||||
json_add_object deviceInfo
|
||||
json_add_string friendly_name ${fname}
|
||||
json_add_string manufacturer_name ${cname}
|
||||
json_add_string model ${model}
|
||||
json_add_string control_url ${cUrl}
|
||||
json_close_object
|
||||
json_add_object meshcomms
|
||||
json_add_int enabled ${enabled}
|
||||
json_add_string mac ${basemac}
|
||||
json_add_string interfaces ${INTERFACE}
|
||||
json_add_int map ${mapall}
|
||||
json_add_string registrar ${registrar}
|
||||
json_add_int debug_level ${debug_level}
|
||||
json_add_int port ${port}
|
||||
json_add_int cmdu_event ${cmdu_event}
|
||||
json_close_object
|
||||
|
||||
json_dump >${MESH_CONF}
|
||||
|
||||
}
|
||||
|
||||
configure_ieee1905()
|
||||
{
|
||||
local enabled debug
|
||||
|
||||
validate_ieee1905_section ${1} || {
|
||||
echo "Validation of ieee1905 section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ ${enabled} -ne 1 ]; then
|
||||
exit 0;
|
||||
fi
|
||||
}
|
||||
|
||||
configure_network() {
|
||||
[ -f ${MESH_CONF} ] && rm ${MESH_CONF}
|
||||
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach configure_ieee1905 ieee1905
|
||||
config_foreach configure_meshcomms meshcomms
|
||||
}
|
||||
PROG=/usr/sbin/ieee1905
|
||||
|
||||
start_service() {
|
||||
procd_open_instance ieee1905
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
configure_network
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
@@ -191,7 +18,7 @@ reload_service() {
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_reload_trigger "netmode"
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_config_trigger "config.change" "ieee1905" /etc/init.d/ieee1905 restart
|
||||
}
|
||||
|
||||
36
iop/scripts/cve-check.sh
Normal file
36
iop/scripts/cve-check.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
function cvecheck {
|
||||
CVEDIR="/tmp/cve-indicator/"
|
||||
CVEBIN="${CVEDIR}/bin"
|
||||
REPORTS="reports"
|
||||
mkdir -p $REPORTS
|
||||
|
||||
dpkg -s python3 python3-requests python3-yaml python3-mako python3-six &> /dev/null
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Missing dependencies"
|
||||
sudo apt-get update
|
||||
sudo apt-get install python3 python3-requests python3-yaml python3-mako python3-six
|
||||
|
||||
else
|
||||
echo "Dependecy check passed"
|
||||
fi
|
||||
|
||||
|
||||
if [ -d "$CVEDIR" ]; then
|
||||
### Take action if $DIR exists ###
|
||||
echo "${CVEDIR} exists running cvecheck"
|
||||
else
|
||||
### Control will jump here if $DIR does NOT exists ###
|
||||
echo "Error: cvecheck not found. getting from iopsys repo"
|
||||
git clone git@dev.iopsys.eu:iopsys/cve-indicator.git /tmp/cve-indicator
|
||||
fi
|
||||
CVEGENLIST=`${CVEBIN}/cve-indicator gen-list openwrt bin`
|
||||
CVEGETCVES=`${CVEBIN}/cve-indicator get-cves $CVEGENLIST --api_url http://cve.circl.lu/api/cvefor/`
|
||||
CVEGETRPRT=`${CVEBIN}/cve-indicator gen-rprt $CVEGETCVES`
|
||||
exit 0
|
||||
|
||||
}
|
||||
|
||||
|
||||
register_command "cvecheck" "Generate a CVE report on latest build"
|
||||
38
libjson-validator/Makefile
Normal file
38
libjson-validator/Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libjson-validator
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_VERSION:=85805ddc350b416286d518c750031ca3206ce033
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/json-schema-validator.git
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/libjson-validator
|
||||
SECTION:=base
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libjson-schema-validator +libubox +libblobmsg-json
|
||||
TITLE:=JSON-validator
|
||||
endef
|
||||
|
||||
define Package/libjson-validator/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libjson-validator.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/src/json-validator.h $(1)/usr/include/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libjson-validator.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libjson-validator))
|
||||
@@ -244,16 +244,17 @@ revert_netmode() {
|
||||
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
logger -s -p user.info -t "netmode" "Could not switch to '$from' mode; going back to '$to' mode" > /dev/console
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
uci -q set netmode.setup.curmode="$to"
|
||||
uci -q set netmode.setup.repeaterready="$rready"
|
||||
uci commit netmode
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
rm -rf $OLD_MODE_FILE
|
||||
|
||||
logger -s -p user.info -t "netmode" "Restarting network services" > /dev/console
|
||||
/etc/init.d/network restart
|
||||
ubus call network reload
|
||||
wifi reload
|
||||
ubus call router.network reload
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=opkgd
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d3da32eca6e50b6be6e846a7f82c8e93c74c45a4
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/opkgd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/opkgd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=OPKG ubus backend
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid
|
||||
endef
|
||||
|
||||
define Package/opkgd/description
|
||||
Ubus based backend for OPKG which can be used by other applications running on top of it.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Package/opkgd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/opkgd.init $(1)/etc/init.d/opkgd
|
||||
$(INSTALL_DIR) $(1)/etc/opkg
|
||||
$(INSTALL_CONF) ./files/map_du $(1)/etc/opkg/map_du
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/opkgd $(1)/usr/sbin/opkgd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,opkgd))
|
||||
@@ -1,20 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=94
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/opkgd
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -23,3 +23,10 @@ config OWSD_UPROXYD
|
||||
Enabling uproxyd automates detection of other
|
||||
UBUS-X enabled devices in the network
|
||||
|
||||
config OWSD_JSON_VALIDATION
|
||||
bool "Enable JSON Input and Output Validation"
|
||||
default y
|
||||
help
|
||||
Enabling json validation allows owsd
|
||||
to validate rpc input and output format
|
||||
against json schemas
|
||||
|
||||
@@ -10,12 +10,12 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=1c6efa76a23b9a8236a8f6d3b43349cf1e23655a
|
||||
PKG_SOURCE_VERSION:=f952f8ded49d173c42edd6e40cff6c259a9e70f0
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS CONFIG_OWSD_UPROXYD
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS CONFIG_OWSD_UPROXYD CONFIG_OWSD_JSON_VALIDATION
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -24,11 +24,13 @@ USE_UBUS-y:=-DWSD_HAVE_UBUS=ON
|
||||
USE_DBUS-y:=-DWSD_HAVE_DBUS=ON
|
||||
USE_BOTH-y:=${USE_UBUS-y} ${USE_DBUS-y}
|
||||
USE_UPROXYD-y:=-DOWSD_UPROXYD=ON
|
||||
USE_JSON_VALIDATION-y:=-DOWSD_JSON_VALIDATION=ON
|
||||
|
||||
CMAKE_OPTIONS:=${USE_UBUS-${CONFIG_OWSD_USE_UBUS}} \
|
||||
${USE_DBUS-${CONFIG_OWSD_USE_DBUS}} \
|
||||
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}} \
|
||||
${USE_UPROXYD-${CONFIG_OWSD_UPROXYD}}
|
||||
${USE_UPROXYD-${CONFIG_OWSD_UPROXYD}} \
|
||||
${USE_JSON_VALIDATION-${CONFIG_OWSD_JSON_VALIDATION}}
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
@@ -44,7 +46,9 @@ define Package/owsd
|
||||
+OWSD_USE_DBUS_UBUS:ubus \
|
||||
+OWSD_USE_DBUS_UBUS:libdbus \
|
||||
+OWSD_USE_DBUS_UBUS:libxml2 \
|
||||
+OWSD_USE_DBUS_UBUS:dbus
|
||||
+OWSD_USE_DBUS_UBUS:dbus \
|
||||
+OWSD_JSON_VALIDATION:libjson-schema-validator \
|
||||
+OWSD_JSON_VALIDATION:libjson-validator
|
||||
TITLE:=owsd daemon
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libtr098
|
||||
PKG_VERSION:=1.0-2019-12-11
|
||||
PKG_VERSION:=1.0-2019-09-25
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/tr-098
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ce93aebda4c14cfc43a7a60d67d4716a576171fd
|
||||
PKG_SOURCE_VERSION:=c2de93e288907da239652bd137f2ddee389b5042
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
Reference in New Issue
Block a user