mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
278 Commits
ne_map
...
release-7.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddce033a5a | ||
|
|
3c557f56cf | ||
|
|
ba6e9e334d | ||
|
|
5afb27846a | ||
|
|
da6b78fc66 | ||
|
|
dfa716b68b | ||
|
|
c99b4bed3b | ||
|
|
0945e724ea | ||
|
|
3eba64701c | ||
|
|
106ae13535 | ||
|
|
6dfd9bc6e9 | ||
|
|
b5f9792a6d | ||
|
|
ec9f11cdb9 | ||
|
|
18b7370941 | ||
|
|
33b9620b5f | ||
|
|
3b33257502 | ||
|
|
f4c1cd7596 | ||
|
|
bce1c004fb | ||
|
|
88c81945b5 | ||
|
|
45c6d20b9e | ||
|
|
0740877068 | ||
|
|
0016db38b7 | ||
|
|
1f7e25ad18 | ||
|
|
c034b97513 | ||
|
|
cd34ac6acd | ||
|
|
b1578f02b2 | ||
|
|
1c2e38d1cf | ||
|
|
b6ec722a3c | ||
|
|
d655076bb7 | ||
|
|
cf4f7a5ee9 | ||
|
|
415243d9d5 | ||
|
|
4eb60b1199 | ||
|
|
42f85f02ef | ||
|
|
9fa333f811 | ||
|
|
a1936766f4 | ||
|
|
d7903e3912 | ||
|
|
07ab390f89 | ||
|
|
bdace90039 | ||
|
|
9bbb12eae1 | ||
|
|
e5f08d801b | ||
|
|
68f17cf1e8 | ||
|
|
972613399d | ||
|
|
ca8409e74e | ||
|
|
820aba6359 | ||
|
|
3871de8453 | ||
|
|
cec6165f25 | ||
|
|
5e7b84c27e | ||
|
|
65d05cc880 | ||
|
|
4de38e786e | ||
|
|
6254930f2d | ||
|
|
b849a95c5a | ||
|
|
ea991cb4f9 | ||
|
|
fbfcb9276f | ||
|
|
6b1cd1bde6 | ||
|
|
b1f5afaca8 | ||
|
|
ee2ba5a572 | ||
|
|
91504ce01d | ||
|
|
ab92c8ce5e | ||
|
|
161cd68c3c | ||
|
|
eb675d1193 | ||
|
|
1d4dbc59b4 | ||
|
|
3cb3a657d8 | ||
|
|
7f1898a0cc | ||
|
|
cee142b761 | ||
|
|
c1d70ea983 | ||
|
|
385bf86e99 | ||
|
|
31645bc7fa | ||
|
|
f1a355b7b8 | ||
|
|
fb245c8279 | ||
|
|
e0e2ed34ab | ||
|
|
303d26a12e | ||
|
|
f7ec53c0a1 | ||
|
|
b390b46c07 | ||
|
|
ac19369e3e | ||
|
|
4565208573 | ||
|
|
f174cd5e12 | ||
|
|
b1aa6341a2 | ||
|
|
bf6af55ba6 | ||
|
|
ad0d093b23 | ||
|
|
bcf799389d | ||
|
|
950023a786 | ||
|
|
73246e703a | ||
|
|
0e59720ad9 | ||
|
|
79e91c2458 | ||
|
|
43b5cdf816 | ||
|
|
f48cf5a3ab | ||
|
|
0924ffc34a | ||
|
|
ee38bf37d9 | ||
|
|
853ae1f351 | ||
|
|
1e5effb7fb | ||
|
|
c1a83b94f3 | ||
|
|
d68aee3e75 | ||
|
|
1d5b6f239f | ||
|
|
952e789c6d | ||
|
|
4ae6af4322 | ||
|
|
cf3309e0e5 | ||
|
|
3affc786d4 | ||
|
|
7c23220712 | ||
|
|
73ce886e9a | ||
|
|
b9e84a8679 | ||
|
|
e9eae90cef | ||
|
|
b02190065a | ||
|
|
bf6b547783 | ||
|
|
c42779c963 | ||
|
|
951a880017 | ||
|
|
de4b7fca62 | ||
|
|
a78540790d | ||
|
|
9c6c25bf4b | ||
|
|
cbdad382a2 | ||
|
|
482c1a1a81 | ||
|
|
324280cf8f | ||
|
|
49874bc3ef | ||
|
|
8820fc7d73 | ||
|
|
018c6ef9c4 | ||
|
|
da51891a58 | ||
|
|
c794673a8a | ||
|
|
cae61fd18b | ||
|
|
7e5b565190 | ||
|
|
4ca088bea5 | ||
|
|
b1bbb6e056 | ||
|
|
daca8e977f | ||
|
|
061bede64d | ||
|
|
177dab28d1 | ||
|
|
ae769b4dee | ||
|
|
0ef82d3d0f | ||
|
|
fdbe5689e2 | ||
|
|
30cafc9b45 | ||
|
|
e8a683a8ac | ||
|
|
502dec56b3 | ||
|
|
3f5a3cb200 | ||
|
|
fea1da3b53 | ||
|
|
7405571200 | ||
|
|
21a1a32f27 | ||
|
|
fa402fdb2e | ||
|
|
6f85fbd7ca | ||
|
|
058bfb4c8a | ||
|
|
3003cb98f4 | ||
|
|
762835179d | ||
|
|
29beb2dd33 | ||
|
|
1a20be1c9d | ||
|
|
52b92afac7 | ||
|
|
edff254a69 | ||
|
|
58cc602f8f | ||
|
|
1f4e445894 | ||
|
|
3460ddd956 | ||
|
|
b6f0dc71e4 | ||
|
|
74a1470463 | ||
|
|
d31a9abd2f | ||
|
|
ee74a4a06b | ||
|
|
5ec644e052 | ||
|
|
0787af4769 | ||
|
|
66aa4bf8de | ||
|
|
98d0c9b490 | ||
|
|
b853cc5bfb | ||
|
|
458938d614 | ||
|
|
d6514f0128 | ||
|
|
3bab7956a3 | ||
|
|
5e19d4aa13 | ||
|
|
49b4528cc9 | ||
|
|
60b009b24c | ||
|
|
8ee4951532 | ||
|
|
9c93a7157e | ||
|
|
46f4f18888 | ||
|
|
8da087908c | ||
|
|
3094ca245f | ||
|
|
0b2321a306 | ||
|
|
fe03fe073f | ||
|
|
815ddf9f7a | ||
|
|
bb47ceff49 | ||
|
|
e57a60bab3 | ||
|
|
ad4869ac85 | ||
|
|
16034d1c98 | ||
|
|
caae5d92f4 | ||
|
|
e64cfa29e4 | ||
|
|
d358cf56bd | ||
|
|
b86902dcbd | ||
|
|
ed7bf0fab1 | ||
|
|
8e5bf24ab0 | ||
|
|
9e518aa011 | ||
|
|
f654b5c350 | ||
|
|
cb4620da03 | ||
|
|
2a4594b30c | ||
|
|
df87055d04 | ||
|
|
32848d7f69 | ||
|
|
fd842a5638 | ||
|
|
0acfc03ce7 | ||
|
|
715ac12974 | ||
|
|
22f0aa3ea7 | ||
|
|
01e4ff2c8b | ||
|
|
2aa679f209 | ||
|
|
2a2ce30792 | ||
|
|
d5eb8f6335 | ||
|
|
0c09c1044c | ||
|
|
34670fb071 | ||
|
|
d7c9fdf574 | ||
|
|
61e6d6e6d0 | ||
|
|
07d3d98709 | ||
|
|
ea3805e531 | ||
|
|
712e05fbeb | ||
|
|
bfb51eb501 | ||
|
|
7ccc61effe | ||
|
|
3a85319a74 | ||
|
|
95c50f0808 | ||
|
|
fda7416852 | ||
|
|
f25274d726 | ||
|
|
6ba197ce98 | ||
|
|
0e2dc2f81c | ||
|
|
34a285bc6b | ||
|
|
da455c0808 | ||
|
|
07ac62e428 | ||
|
|
ccf5a26c17 | ||
|
|
f9e1decc9a | ||
|
|
21170ae143 | ||
|
|
9dbf0bc0e5 | ||
|
|
b5707298be | ||
|
|
a73b9b1dec | ||
|
|
bd830ca37b | ||
|
|
014f35b7ab | ||
|
|
0a9f5c30c9 | ||
|
|
c05e258ceb | ||
|
|
b318a5b6f2 | ||
|
|
1070248a0d | ||
|
|
9d3f965e62 | ||
|
|
ed690caaf1 | ||
|
|
ae5af97107 | ||
|
|
60b474355b | ||
|
|
1faed9afbd | ||
|
|
e6f090c9e6 | ||
|
|
532da477d9 | ||
|
|
ef281267db | ||
|
|
51f19923c0 | ||
|
|
6cf78059d7 | ||
|
|
a913f05342 | ||
|
|
83fb8b879b | ||
|
|
af3cbff6d1 | ||
|
|
45dcdc7783 | ||
|
|
8997c156d9 | ||
|
|
25e01248c5 | ||
|
|
2e70d12fd7 | ||
|
|
e47d128902 | ||
|
|
bb755d5774 | ||
|
|
250a89ca1d | ||
|
|
f139834fc7 | ||
|
|
0a8fb82fa8 | ||
|
|
0c8626ef5e | ||
|
|
dbd0fc3e17 | ||
|
|
267a855faf | ||
|
|
cea30db473 | ||
|
|
532aab72ee | ||
|
|
1a6a42b0ca | ||
|
|
2d21fa7e95 | ||
|
|
8a120f056a | ||
|
|
6e2083e30e | ||
|
|
9c50c4c41b | ||
|
|
689905913c | ||
|
|
c17d03ef56 | ||
|
|
0c65d03dca | ||
|
|
aeca33ecae | ||
|
|
150730e3e2 | ||
|
|
bc5d99459d | ||
|
|
2e4b1c84ac | ||
|
|
49a823a046 | ||
|
|
7ba428e4b2 | ||
|
|
f215dd2fb8 | ||
|
|
e9f91b465f | ||
|
|
6f4e3daffb | ||
|
|
9ecc88fc72 | ||
|
|
a9a44c2b13 | ||
|
|
71316b37e3 | ||
|
|
bb3267649f | ||
|
|
ae630fc142 | ||
|
|
9f71023857 | ||
|
|
8a86868513 | ||
|
|
91edc0fc99 | ||
|
|
a2bbe00934 | ||
|
|
3861cb8714 | ||
|
|
c94232f071 | ||
|
|
9cdc3e8265 |
@@ -1,3 +1,7 @@
|
||||
config BBF_VENDOR_EXTENSION
|
||||
bool "Enable Vendor Extension"
|
||||
default y
|
||||
|
||||
config BBF_VENDOR_LIST
|
||||
string "Vendor List"
|
||||
default "iopsys"
|
||||
@@ -6,14 +10,168 @@ config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
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 BBF_MAX_OBJECT_INSTANCES
|
||||
int "Maximum number of instances per object"
|
||||
default 255
|
||||
|
||||
menu "TR181 Datamodels"
|
||||
depends on PACKAGE_libbbfdm
|
||||
|
||||
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_TR181_ATM
|
||||
bool "Include Device.ATM."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_BRIDGING
|
||||
bool "Include Device.Bridging."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_DDNS
|
||||
bool "Include Device.DynamicDNS."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_DEVICEINFO
|
||||
bool "Include Device.DeviceInfo."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_DEVICEINFO_PROCESSSTATUS
|
||||
bool "Include Device.DeviceInfo.ProcessStatus."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_DHCPv4
|
||||
bool "Include Device.DHCPv4."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_DHCPv6
|
||||
bool "Include Device.DHCPv6."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_DNS
|
||||
bool "Include Device.DNS."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_DSL
|
||||
bool "Include Device.DSL."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_ETHERNET
|
||||
bool "Include Device.Ethenet."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_FAST
|
||||
bool "Include Device.FAST."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_FIREWALL
|
||||
bool "Include Device.Firewall."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_GATEWAYINFO
|
||||
bool "Include Device.GatewayInfo."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_GRE
|
||||
bool "Include Device.GRE."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_IEEE1905
|
||||
bool "Include Device.IEEE1905."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_INTERFACESTACK
|
||||
bool "Include Device.InterfaceStack."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_IP
|
||||
bool "Include Device.IP."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_LANCONFSEC
|
||||
bool "Include Device.LANonfigSecurity."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_MQTT
|
||||
bool "Include Device.MQTT."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_NAT
|
||||
bool "Include Device.NAT."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_PACKETCAPTURE
|
||||
bool "Include Device.PacketCaptureDiagnostics."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_PPP
|
||||
bool "Include Device.PPP."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_PTM
|
||||
bool "Include Device.PTM."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_QOS
|
||||
bool "Include Device.QoS."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_ROUTERADVERTISEMENT
|
||||
bool "Include Device.RouterAdvertisement."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_ROUTING
|
||||
bool "Include Device.Routing."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_SECURITY
|
||||
bool "Include Device.Security."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_SELFTEST
|
||||
bool "Include Device.SelfTestDiagnostics."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_SSH
|
||||
bool "Include Device.SSH."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_TIME
|
||||
bool "Include Device.Time."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_UPNP
|
||||
bool "Include Device.UPnP."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_USB
|
||||
bool "Include Device.USB."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_USERINTERFACE
|
||||
bool "Include Device.UserInterface."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_WIFI
|
||||
bool "Include Device.WiFi."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_WIFI_DATAELEMENTS
|
||||
bool "Include Device.WiFi.DataElements."
|
||||
default y
|
||||
|
||||
config BBFDM_TR181_WIFI_DATAELEMENTS_ASSOCEVENTS
|
||||
bool "Include deprecated AssociationEventData/DisassociationEventData tables"
|
||||
default n
|
||||
help
|
||||
TR181-2.17 deprecates below dataelements tables
|
||||
- Device.WiFi.DataElements.AssociationEvent.AssociationEventData.{i}.
|
||||
- Device.WiFi.DataElements.DisassociationEvent.DisassociationEventData.{i}.
|
||||
If this option is selected, above mentioned tables shall be added in datamodel.
|
||||
|
||||
endmenu
|
||||
|
||||
283
bbfdm/Makefile
283
bbfdm/Makefile
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.7.4
|
||||
PKG_VERSION:=1.4.23.29
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=57a3aedb8f6dea2a951d3edf1da0c868e252b27c
|
||||
PKG_SOURCE_VERSION:=2f1dac5686f54219fc7706c677905816b650dd1c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -21,24 +21,56 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include bbfdm.mk
|
||||
|
||||
define Package/libbbfdm-api
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF datamodel library, provides API to extend datamodel using DotSO plugins
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
ABI_VERSION:=1.0
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
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 +libbbfdm-api \
|
||||
+BBF_TR471:obudpst +libopenssl
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libcurl +libbbfdm-api \
|
||||
+BBF_TR471:obudpst
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (default)
|
||||
VARIANT:=default
|
||||
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-mbedtls
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
CONFLICTS := libbbfdm libbbfdm-openssl libbbfdm-wolfssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-openssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
|
||||
VARIANT:=openssl
|
||||
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-wolfssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-wolfssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
|
||||
VARIANT:=wolfssl
|
||||
CONFLICTS := libbbfdm libbbfdm-mbedtls libbbfdm-openssl
|
||||
endef
|
||||
|
||||
define Package/bbfdmd
|
||||
@@ -46,7 +78,20 @@ define Package/bbfdmd
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Datamodel ubus backend
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +libbbfdm
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api +PACKAGE_libbbfdm-mbedtls:libbbfdm-mbedtls \
|
||||
+PACKAGE_libbbfdm-openssl:libbbfdm-openssl +PACKAGE_libbbfdm-wolfssl:libbbfdm-wolfssl \
|
||||
+PACKAGE_libbbfdm:libbbfdm
|
||||
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
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -68,8 +113,153 @@ endef
|
||||
endif
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
-DBBF_WIFI_DATAELEMENTS=ON
|
||||
-DBBF_TR181=ON \
|
||||
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
|
||||
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_ATM),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_ATM
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_BRIDGING),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_BRIDGING
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_DDNS),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_DDNS
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_DEVICEINFO),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_DEVICEINFO
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_DEVICEINFO_PROCESSSTATUS),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_DEVICEINFO_PROCESSSTATUS
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_DHCPv4),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_DHCPv4
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_DHCPv6),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_DHCPv6
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_DNS),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_DNS
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_DSL),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_DSL
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_ETHERNET),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_ETHERNET
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_FAST),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_FAST
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_FIREWALL),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_FIREWALL
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_GATEWAYINFO),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_GATEWAYINFO
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_GRE),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_GRE
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_IEEE1905),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_IEEE1905
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_INTERFACESTACK),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_INTERFACESTACK
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_IP),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_IP
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_LANCONFSEC),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_LANCONFSEC
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_MQTT),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_MQTT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_NAT),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_NAT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_PACKETCAPTURE),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_PACKETCAPTURE
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_PPP),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_PPP
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_PTM),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_PTM
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_QOS),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_QOS
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_ROUTERADVERTISEMENT),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_ROUTERADVERTISEMENT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_ROUTING),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_ROUTING
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_SECURITY),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_SECURITY
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_SELFTEST),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_SELFTEST
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_SSH),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_SSH
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_TIME),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_TIME
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_UPNP),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_UPNP
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_USB),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_USB
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_USERINTERFACE),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_USERINTERFACE
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_WIFI),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_WIFI
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_WIFI_DATAELEMENTS),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_WIFI_DATAELEMENTS
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_TR181_WIFI_DATAELEMENTS_ASSOCEVENTS),y)
|
||||
TARGET_CFLAGS += -DBBFDM_TR181_WIFI_DATAELEMENTS_ASSOCEVENTS
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CMAKE_OPTIONS += \
|
||||
@@ -81,11 +271,33 @@ 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 ($(BUILD_VARIANT),default)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=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
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_bbfdmd),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
|
||||
@@ -94,9 +306,11 @@ endif
|
||||
define Package/libbbfdm-api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/scripts/bbf.config $(1)/usr/libexec/rpcd/bbf.config
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
define Package/libbbfdm/default/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
@@ -109,18 +323,15 @@ define Package/libbbfdm/install
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-link-core-plugins $(1)/etc/uci-defaults/99-link-core-plugins
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
$(INSTALL_BIN) ./files/etc/firewall.service $(1)/etc/firewall.service
|
||||
ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so)
|
||||
endif
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
|
||||
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
define Package/libbbfdm/default/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
@@ -132,22 +343,60 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_CONF) ./files/etc/config/schedules $(1)/etc/config/schedules
|
||||
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_lease_start_time.user $(1)/etc/udhcpc.user.d/udhcpc_lease_start_time.user
|
||||
endef
|
||||
|
||||
define Package/userinterface/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/etc/config/userinterface $(1)/etc/config/userinterface
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/userinterface $(1)/lib/upgrade/keep.d/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/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
|
||||
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
|
||||
endef
|
||||
|
||||
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)
|
||||
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/install = $(Package/libbbfdm/default/install)
|
||||
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/libbbfdm-api
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/tr181/device.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/vendor.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbfdm-api/
|
||||
# Work around for backward compatibility
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbfdm-api/include/libbbfdm_api.h $(1)/usr/include/libbbf_api.h
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbfdm-api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
$(eval $(call BuildPackage,libbbfdm-openssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-wolfssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-mbedtls))
|
||||
$(eval $(call BuildPackage,bbfdmd))
|
||||
|
||||
$(eval $(call BuildPackage,userinterface))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
config bbfdmd 'bbfdmd'
|
||||
option enabled '1'
|
||||
option loglevel '1'
|
||||
option refresh_time '10'
|
||||
option refresh_time '120'
|
||||
option transaction_timeout '30'
|
||||
option subprocess_level '2'
|
||||
|
||||
|
||||
2
bbfdm/files/etc/config/schedules
Normal file
2
bbfdm/files/etc/config/schedules
Normal file
@@ -0,0 +1,2 @@
|
||||
config global 'global'
|
||||
option enable '1'
|
||||
@@ -2,71 +2,40 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.dnat -p info
|
||||
}
|
||||
|
||||
exec_cmd() {
|
||||
if ! eval "$*"; then
|
||||
log "Failed to run [$*]"
|
||||
fi
|
||||
}
|
||||
|
||||
reorder_dnat_rules() {
|
||||
nat_chains=$(iptables -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
|
||||
|
||||
for chain in ${nat_chains}; do
|
||||
# Collect empty remote host & empty dport rules
|
||||
EMPTY_HOST_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
|
||||
if [ -n "${EMPTY_HOST_PORT}" ]; then
|
||||
echo "${EMPTY_HOST_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect empty remote host but non empty dport rules
|
||||
EMPTY_HOST=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
|
||||
if [ -n "${EMPTY_HOST}" ]; then
|
||||
echo "${EMPTY_HOST}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect non empty remote host but empty dport rules
|
||||
EMPTY_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
|
||||
if [ -n "${EMPTY_PORT}" ]; then
|
||||
echo "${EMPTY_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
|
||||
# Now add rules as per datamodel precedence shown below
|
||||
## Non empty remote host, empty dport
|
||||
## empty remote host, non empty dport
|
||||
## empty remote host, empty dport
|
||||
if [ -n "${EMPTY_PORT}" ]; then
|
||||
echo "${EMPTY_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
# Skip this chain if no matching rules were found
|
||||
[ -n "${EMPTY_HOST_PORT}" -o -n "${EMPTY_HOST}" -o -n "${EMPTY_PORT}" ] || continue
|
||||
|
||||
if [ -n "${EMPTY_HOST}" ]; then
|
||||
echo "${EMPTY_HOST}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
(
|
||||
echo '*nat'
|
||||
|
||||
if [ -n "${EMPTY_HOST_PORT}" ]; then
|
||||
echo "${EMPTY_HOST_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
# Delete collected rules
|
||||
[ -n "${EMPTY_HOST_PORT}" ] && echo "${EMPTY_HOST_PORT}" | sed 's/^-A /-D /'
|
||||
[ -n "${EMPTY_HOST}" ] && echo "${EMPTY_HOST}" | sed 's/^-A /-D /'
|
||||
[ -n "${EMPTY_PORT}" ] && echo "${EMPTY_PORT}" | sed 's/^-A /-D /'
|
||||
|
||||
# Now add rules as per datamodel precedence shown below
|
||||
## Non empty remote host, empty dport
|
||||
## empty remote host, non empty dport
|
||||
## empty remote host, empty dport
|
||||
[ -n "${EMPTY_PORT}" ] && echo "${EMPTY_PORT}"
|
||||
[ -n "${EMPTY_HOST}" ] && echo "${EMPTY_HOST}"
|
||||
[ -n "${EMPTY_HOST_PORT}" ] && echo "${EMPTY_HOST_PORT}"
|
||||
|
||||
echo 'COMMIT'
|
||||
) | iptables-restore -w -n
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ log() {
|
||||
}
|
||||
|
||||
exec_cmd() {
|
||||
if ! eval "$*"; then
|
||||
if ! "$@"; then
|
||||
log "Failed to run [$*]"
|
||||
echo "-1"
|
||||
return 0
|
||||
@@ -73,7 +73,7 @@ add_iptable_rule() {
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "iptables ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
|
||||
res=$(exec_cmd iptables -w ${cmd} -m comment --comment IPtables_service_rule -j "${action}")
|
||||
else
|
||||
#Add ipv4 sources if any
|
||||
src_list=""
|
||||
@@ -86,7 +86,7 @@ add_iptable_rule() {
|
||||
|
||||
if [ -n "$src_list" ]; then
|
||||
src_list=$(echo "${src_list}" | sed "s/,$//")
|
||||
res=$(exec_cmd "iptables -s $src_list ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
|
||||
res=$(exec_cmd iptables -w -s "$src_list" ${cmd} -m comment --comment IPtables_service_rule -j "${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -97,7 +97,7 @@ add_iptable_rule() {
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "ip6tables ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
|
||||
res=$(exec_cmd ip6tables -w ${cmd} -m comment --comment IP6tables_service_rule -j "${action}")
|
||||
else
|
||||
#Add ipv6 sources if any
|
||||
src_list=""
|
||||
@@ -110,7 +110,7 @@ add_iptable_rule() {
|
||||
|
||||
if [ -n "$src_list" ]; then
|
||||
src_list=$(echo "${src_list}" | sed "s/,$//")
|
||||
res=$(exec_cmd "ip6tables -s $src_list ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
|
||||
res=$(exec_cmd ip6tables -w -s "$src_list" ${cmd} -m comment --comment IP6tables_service_rule -j "${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -40,7 +40,12 @@ configure_bbfdmd()
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
if [ -f "${BBFDM_JSON_INPUT}" ]; then
|
||||
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
|
||||
cat ${BBFDM_JSON_INPUT} |jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' > ${BBFDM_TEMP_JSON}
|
||||
val="$(jq -r '.daemon.input // empty' ${BBFDM_TEMP_JSON})"
|
||||
if [ -z "${val}" ]; then
|
||||
log "Failed to generate temp input json, uci changes not applied"
|
||||
cp ${BBFDM_JSON_INPUT} ${BBFDM_TEMP_JSON}
|
||||
fi
|
||||
fi
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
|
||||
14
bbfdm/files/etc/udhcpc.user.d/udhcpc_lease_start_time.user
Normal file
14
bbfdm/files/etc/udhcpc.user.d/udhcpc_lease_start_time.user
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
leasestarttime="$(awk -F'.' '{print $1}' /proc/uptime 2> /dev/null)"
|
||||
target_file=/tmp/dhcp_client_info
|
||||
target_str="$INTERFACE $lease $leasestarttime"
|
||||
|
||||
# if this interface is present in file, then replace it
|
||||
if grep -q "$INTERFACE" "$target_file" 2> /dev/null; then
|
||||
# replace the whole line if pattern matches
|
||||
sed -i "/${INTERFACE}/c\\${target_str}" "$target_file"
|
||||
else
|
||||
# interface info was not present, append it to the file
|
||||
echo "$target_str" >> "$target_file"
|
||||
fi
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.5
|
||||
PKG_VERSION:=2.1.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=f03fb8682aa7efe760294e54c422f2eab856e08c
|
||||
PKG_SOURCE_VERSION:=f556410b51a2248f11358793f11ae54d3e53e85e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=capiagent
|
||||
PKG_VERSION:=2.1.1
|
||||
PKG_VERSION:=2.1.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=136cab3a9f1eec0132db9fa3f7bb1c8748ce1449
|
||||
PKG_SOURCE_VERSION:=3e671db8f567b19c109fc13b25bc571c4c73a962
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/capiagent.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,7 +31,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/capiagent
|
||||
TITLE+= capiagent (daemon implementing Wi-Fi Alliance's CAPI commands)
|
||||
DEPENDS= +libubox +libuci +libubus +libnl-genl +libeasy +libwifi \
|
||||
+libjson-c +libblobmsg-json +ubus +libieee1905 +libwifiutils
|
||||
+libjson-c +libblobmsg-json +ubus +libieee1905
|
||||
endef
|
||||
|
||||
define Package/capiagent/description
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=csmngr
|
||||
PKG_VERSION:=0.0.5
|
||||
PKG_VERSION:=1.0.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dcdaba75b85bf8758c34d3ae4a1be0ba09359331
|
||||
PKG_SOURCE_VERSION:=92c62f8df86066bd1718a6a6036195b113e74032
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/csmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
if PACKAGE_ddnsmngr
|
||||
choice
|
||||
prompt "Select backend for dynamic DNS management"
|
||||
default DDNSMNGR_BACKEND_DDNSSCRIPT
|
||||
depends on PACKAGE_ddnsmngr
|
||||
help
|
||||
Select which package to use for dynamic DNS support
|
||||
|
||||
config DDNSMNGR_BACKEND_DDNSSCRIPT
|
||||
bool "Use ddns_script"
|
||||
|
||||
config DDNSMNGR_BACKEND_INADYN
|
||||
bool "Use inadyn"
|
||||
|
||||
endchoice
|
||||
endif
|
||||
@@ -1,79 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2024 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddnsmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/ddnsmngr.git
|
||||
PKG_SOURCE_VERSION:=d0d37df44644ef2c1a0b11d3a4f92dc694ae1010
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT CONFIG_DDNSMNGR_BACKEND_INADYN
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Dynamic DNS manager
|
||||
DEPENDS:=+libbbfdm-api +DDNSMNGR_BACKEND_DDNSSCRIPT:ddns-scripts +DDNSMNGR_BACKEND_INADYN:inadyn
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Manage dynamic DNS updation and provides Device.DynamicDNS. datamodel object based on TR181-2.16
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/ddnsmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/ddnsmngr
|
||||
$(INSTALL_DIR) $(1)/etc/ddnsmngr/ddns
|
||||
$(INSTALL_DIR) $(1)/etc/ddnsmngr/servers
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ddnsmngr
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/libddnsmngr.so $(1)/etc/ddnsmngr/
|
||||
$(INSTALL_DATA) ./files/etc/ddnsmngr/input.json $(1)/etc/ddnsmngr/
|
||||
$(INSTALL_DATA) ./files/etc/config/ddnsmngr $(1)/etc/config/ddnsmngr
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-ddns-config-migrate $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ddnsmngr $(1)/etc/init.d/ddnsmngr
|
||||
ifeq ($(CONFIG_DDNSMNGR_BACKEND_DDNSSCRIPT),y)
|
||||
$(INSTALL_BIN) ./files/usr/lib/ddns_script/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/lib/ddnsmngr/ddnsmngr_updater.sh $(1)/usr/lib/ddnsmngr/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/ddns-script/server/* $(1)/etc/ddnsmngr/servers
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns-script/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
|
||||
endif
|
||||
ifeq ($(CONFIG_DDNSMNGR_BACKEND_INADYN),y)
|
||||
$(INSTALL_BIN) ./files/usr/lib/inadyn/ddnsmngr_service.sh $(1)/usr/lib/ddnsmngr/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/files/inadyn/server/* $(1)/etc/ddnsmngr/servers
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/inadyn/usr/libexec/rpcd/ddnsmngr $(1)/usr/libexec/rpcd/ddnsmngr
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -1,23 +0,0 @@
|
||||
config ddnsmngr 'global'
|
||||
option configfile '/var/run/ddnsmngr/ddnsmngr.json'
|
||||
option ddns_dateformat '%F %R'
|
||||
option ddns_rundir '/var/run/ddnsmngr'
|
||||
option ddns_logdir '/var/log/ddnsmngr'
|
||||
option ddns_loglines '250'
|
||||
option upd_privateip '0'
|
||||
option use_curl '1'
|
||||
|
||||
config server 'ddns_server_1'
|
||||
option enabled '1'
|
||||
option service 'dynu.com'
|
||||
option name 'dynu.com'
|
||||
|
||||
config server 'ddns_server_2'
|
||||
option enabled '1'
|
||||
option service 'dyndns.org'
|
||||
option name 'dyndns.org'
|
||||
|
||||
config server 'ddns_server_3'
|
||||
option enabled '1'
|
||||
option service 'zoneedit.com'
|
||||
option name 'zoneedit.com'
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/ddnsmngr/libddnsmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.ddnsmngr",
|
||||
"parent_dm": "Device.",
|
||||
"object": "DynamicDNS",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
DM_INPUT="/etc/ddnsmngr/input.json"
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
. /usr/lib/ddnsmngr/ddnsmngr_service.sh
|
||||
|
||||
start_service() {
|
||||
start_ddnsmngr_service
|
||||
bbfdm_add_service "bbfdm.ddnsmngr" "${DM_INPUT}"
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
stop_ddnsmngr_service
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
sleep 1
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger ddnsmngr
|
||||
add_ddnsmngr_triggers
|
||||
}
|
||||
@@ -1,170 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
cl_id=1
|
||||
srv_id=1
|
||||
|
||||
function get_ddns_config_option() {
|
||||
local val
|
||||
|
||||
val="$(uci -q get ddns.${1}.${2})"
|
||||
|
||||
if [ -z "${val}" ] && [ -n "${3}" ]; then
|
||||
val="${3}"
|
||||
fi
|
||||
|
||||
echo "${val}"
|
||||
}
|
||||
|
||||
function config_supported_service() {
|
||||
if ! uci -q get ddnsmngr.global >/dev/null 2>&1; then
|
||||
uci -q set ddnsmngr.global="ddnsmngr"
|
||||
fi
|
||||
|
||||
servers=""
|
||||
|
||||
for i in $(find /etc/ddnsmngr/servers/ -name '*.json' | cut -d'/' -f 5 | sed "s/.json//")
|
||||
do
|
||||
if [ -z "${servers}" ]; then
|
||||
servers="${i}"
|
||||
else
|
||||
servers="${servers},${i}"
|
||||
fi
|
||||
done
|
||||
|
||||
uci -q set ddnsmngr.global.supported_services="${servers}"
|
||||
}
|
||||
|
||||
function migrate_service_section() {
|
||||
client_sec=""
|
||||
enabled="$(get_ddns_config_option ${1} enabled "0")"
|
||||
service_name="$(get_ddns_config_option ${1} service_name)"
|
||||
interface="$(get_ddns_config_option ${1} interface)"
|
||||
ip_network="$(get_ddns_config_option ${1} ip_network)"
|
||||
username="$(get_ddns_config_option ${1} username)"
|
||||
password="$(get_ddns_config_option ${1} password)"
|
||||
lookup_host="$(get_ddns_config_option ${1} lookup_host)"
|
||||
use_ipv6="$(get_ddns_config_option ${1} use_ipv6 "0")"
|
||||
force_ipversion="$(get_ddns_config_option ${1} force_ipversion "0")"
|
||||
use_https="$(get_ddns_config_option ${1} use_https "0")"
|
||||
force_dnstcp="$(get_ddns_config_option ${1} force_dnstcp "0")"
|
||||
|
||||
if [ -z "${service_name}" ]; then
|
||||
uci -q delete ddns."${1}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# check server file is present in device
|
||||
if [ ! -f "/etc/ddnsmngr/servers/${service_name}.json" ]; then
|
||||
uci -q delete ddns."${1}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Check if client section is already added for this service
|
||||
clients=$(uci -q show ddnsmngr | grep "=client")
|
||||
client_count=$(echo "${clients}" | wc -l)
|
||||
|
||||
tmp=0
|
||||
while [ $tmp -lt $client_count ]
|
||||
do
|
||||
mngr_serv="$(uci -q get ddnsmngr.@client[$tmp].service_name)"
|
||||
mngr_intf="$(uci -q get ddnsmngr.@client[$tmp].interface)"
|
||||
mngr_netw="$(uci -q get ddnsmngr.@client[$tmp].ip_network)"
|
||||
mngr_user="$(uci -q get ddnsmngr.@client[$tmp].username)"
|
||||
mngr_ipv6="$(uci -q get ddnsmngr.@client[$tmp].use_ipv6)"
|
||||
mngr_forceip="$(uci -q get ddnsmngr.@client[$tmp].force_ipversion)"
|
||||
mngr_https="$(uci -q get ddnsmngr.@client[$tmp].use_https)"
|
||||
mngr_dnstcp="$(uci -q get ddnsmngr.@client[$tmp].force_dnstcp)"
|
||||
|
||||
[ -z "${mngr_ipv6}" ] && mngr_ipv6="0"
|
||||
[ -z "${mngr_forceip}" ] && mngr_forceip="0"
|
||||
[ -z "${mngr_https}" ] && mngr_https="0"
|
||||
[ -z "${mngr_dnstcp}" ] && mngr_dnstcp="0"
|
||||
|
||||
if [ "${mngr_serv}" == "${service_name}" ] && [ "${mngr_intf}" == "${interface}" ] && \
|
||||
[ "${mngr_netw}" == "${ip_network}" ] && [ "${mngr_user}" == "${username}" ] && \
|
||||
[ "${mngr_ipv6}" == "${use_ipv6}" ] && [ "${mngr_forceip}" == "${force_ipversion}" ] && \
|
||||
[ "${mngr_https}" == "${use_https}" ] && [ "${mngr_dnstcp}" == "${force_dnstcp}" ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
tmp=$(( tmp + 1 ))
|
||||
done
|
||||
|
||||
if [ $tmp -ne $client_count ]; then
|
||||
i=0
|
||||
for client in $clients; do
|
||||
if [ $i -eq $tmp ]; then
|
||||
client_sec="$(echo $client | cut -d'=' -f 1 | cut -d'.' -f 2)"
|
||||
break
|
||||
fi
|
||||
i=$(( i + 1 ))
|
||||
done
|
||||
|
||||
if [ $enabled -eq 1 ]; then
|
||||
uci -q set ddnsmngr."${client_sec}".enabled="1"
|
||||
fi
|
||||
else
|
||||
client_sec=ddns_mig_client_"${cl_id}"
|
||||
|
||||
uci -q set ddnsmngr."${client_sec}"="client"
|
||||
uci -q set ddnsmngr."${client_sec}".enabled="${enabled}"
|
||||
uci -q set ddnsmngr."${client_sec}".service_name="${service_name}"
|
||||
uci -q set ddnsmngr."${client_sec}".interface="${interface}"
|
||||
uci -q set ddnsmngr."${client_sec}".ip_network="${ip_network}"
|
||||
uci -q set ddnsmngr."${client_sec}".username="${username}"
|
||||
uci -q set ddnsmngr."${client_sec}".password="${password}"
|
||||
uci -q set ddnsmngr."${client_sec}".use_ipv6="${use_ipv6}"
|
||||
uci -q set ddnsmngr."${client_sec}".force_ipversion="${force_ipversion}"
|
||||
uci -q set ddnsmngr."${client_sec}".use_https="${use_https}"
|
||||
uci -q set ddnsmngr."${client_sec}".force_dnstcp="${force_dnstcp}"
|
||||
|
||||
cl_id=$(( cl_id + 1 ))
|
||||
|
||||
# add server section if not added
|
||||
servers=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'")
|
||||
if [ -z "${servers}" ]; then
|
||||
server_sec=ddns_mig_server_"${srv_id}"
|
||||
uci -q set ddnsmngr."${server_sec}"="server"
|
||||
uci -q set ddnsmngr."${server_sec}".enabled="1"
|
||||
uci -q set ddnsmngr."${server_sec}".service="${service_name}"
|
||||
uci -q set ddnsmngr."${server_sec}".name="${service_name}"
|
||||
|
||||
srv_id=$(( srv_id + 1 ))
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# if lookup_host is set then add host section
|
||||
if [ -n "${lookup_host}" ] && [ -n "${client_sec}" ]; then
|
||||
# check number of hosts present for this client
|
||||
host_count=$(uci -q show ddnsmngr | grep "dm_parent=\'${client_sec}\'" | wc -l)
|
||||
host_ix=$(( host_count + 1 ))
|
||||
host_sec="${client_sec}"_host_"${host_ix}"
|
||||
|
||||
uci -q set ddnsmngr."${host_sec}"="host"
|
||||
uci -q set ddnsmngr."${host_sec}".enabled="${enabled}"
|
||||
uci -q set ddnsmngr."${host_sec}".lookup_host="${lookup_host}"
|
||||
uci -q set ddnsmngr."${host_sec}".dm_parent="${client_sec}"
|
||||
fi
|
||||
|
||||
uci -q delete ddns."${1}"
|
||||
}
|
||||
|
||||
function migrate_ddns_config() {
|
||||
if [ ! -f "/etc/config/ddnsmngr" ]; then
|
||||
# Create ddnsmngr config file
|
||||
touch /etc/config/ddnsmngr
|
||||
fi
|
||||
|
||||
config_supported_service
|
||||
|
||||
config_load ddns
|
||||
config_foreach migrate_service_section service
|
||||
|
||||
uci -q commit ddns
|
||||
uci -q commit ddnsmngr
|
||||
}
|
||||
|
||||
migrate_ddns_config
|
||||
@@ -1,169 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
RUNDIR="/var/run/ddnsmngr"
|
||||
LOGDIR="/var/log/ddnsmngr"
|
||||
PROG="/usr/lib/ddnsmngr/ddnsmngr_updater.sh"
|
||||
CONFIGFILE="/var/run/ddnsmngr/ddnsmngr.json"
|
||||
CLIENT_INTFS=""
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
log() {
|
||||
echo "$*"|logger -t ddnsmngr.init -p debug
|
||||
}
|
||||
|
||||
validate_host_section() {
|
||||
uci_validate_section ddnsmngr host "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'lookup_host:string' \
|
||||
'dm_parent:string'
|
||||
}
|
||||
|
||||
validate_client_section() {
|
||||
uci_validate_section ddnsmngr client "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'service_name:string' \
|
||||
'interface:string' \
|
||||
'ip_network:string' \
|
||||
'username:string' \
|
||||
'password:string' \
|
||||
'use_https:bool:0' \
|
||||
'force_dnstcp:bool:0' \
|
||||
'use_ipv6:bool:0' \
|
||||
'force_ipversion:bool:0'
|
||||
}
|
||||
|
||||
add_object() {
|
||||
local enabled lookup_host dm_parent use_ipv6 force_ipversion proc_info_file
|
||||
local service_name interface ip_network username password use_https force_dnstcp
|
||||
|
||||
validate_host_section "${1}" || {
|
||||
log "Validation of host section failed"
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
validate_client_section "${dm_parent}" || {
|
||||
log "Validation of client section failed"
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
|
||||
if [ -z "${service_name}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
service_section=$(uci -q show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
|
||||
if [ -z "${service_section}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
|
||||
if [ "${service_enabled}" -ne 1 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_add_object
|
||||
json_add_string "interface" "${interface}"
|
||||
json_add_string "service_name" "${service_name}"
|
||||
json_add_string "username" "${username}"
|
||||
json_add_string "password" "${password}"
|
||||
json_add_string "lookup_host" "${lookup_host}"
|
||||
json_add_string "ip_network" "${ip_network}"
|
||||
json_add_string "proc_info_file" "${1}"
|
||||
json_add_string "use_ipv6" "${use_ipv6}"
|
||||
json_add_string "force_ipversion" "${force_ipversion}"
|
||||
json_add_string "use_https" "${use_https}"
|
||||
json_add_string "force_dnstcp" "${force_dnstcp}"
|
||||
json_close_object
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
interface="wan"
|
||||
else
|
||||
interface="wan6"
|
||||
fi
|
||||
fi
|
||||
|
||||
for intf in $CLIENT_INTFS; do
|
||||
if [ "${intf}" == "${interface}" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
|
||||
}
|
||||
|
||||
start_ddnsmngr_service() {
|
||||
run_dir=$(uci -q get ddnsmngr.global.ddns_rundir)
|
||||
log_dir=$(uci -q get ddnsmngr.global.ddns_logdir)
|
||||
|
||||
if [ -n "${run_dir}" ]; then
|
||||
RUNDIR="${run_dir}"
|
||||
fi
|
||||
|
||||
if [ -n "${log_dir}" ]; then
|
||||
LOGDIR="${log_dir}"
|
||||
fi
|
||||
|
||||
mkdir -p "${RUNDIR}"
|
||||
mkdir -p "${LOGDIR}"
|
||||
|
||||
conf_file=$(uci -q get ddnsmngr.global.configfile)
|
||||
if [ -n "${conf_file}" ]; then
|
||||
CONFIGFILE="${conf_file}"
|
||||
fi
|
||||
|
||||
touch "${CONFIGFILE}"
|
||||
|
||||
if [ ! -f "${CONFIGFILE}" ]; then
|
||||
log "Can not create ${CONFIGFILE}, exit"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_add_array "services"
|
||||
|
||||
config_load ddnsmngr
|
||||
config_foreach add_object host
|
||||
|
||||
json_close_array
|
||||
json_dump > "${CONFIGFILE}"
|
||||
|
||||
procd_open_instance ddnsmngr
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -c "${CONFIGFILE}"
|
||||
procd_append_param command -- start
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_ddnsmngr_service() {
|
||||
conf_file=$(uci -q get ddnsmngr.global.configfile)
|
||||
if [ -n "${conf_file}" ]; then
|
||||
CONFIGFILE="${conf_file}"
|
||||
fi
|
||||
|
||||
if [ ! -f "${CONFIGFILE}" ]; then
|
||||
log "${CONFIGFILE} not found, can't stop services if running any"
|
||||
fi
|
||||
|
||||
"$PROG" -c "${CONFIGFILE}" -- stop
|
||||
return 0
|
||||
}
|
||||
|
||||
add_ddnsmngr_triggers() {
|
||||
procd_open_trigger
|
||||
for intf in $CLIENT_INTFS; do
|
||||
# No need to handle other ifevents like ifupdate etc
|
||||
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
|
||||
procd_add_interface_trigger "interface.*.down" $intf /etc/init.d/ddnsmngr restart
|
||||
done
|
||||
procd_close_trigger
|
||||
}
|
||||
@@ -1,311 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
PROG="/usr/sbin/inadyn"
|
||||
CONFIGPATH="/tmp/inadyn_config"
|
||||
PIDPATH="/etc/inadyn_pid"
|
||||
CLIENT_INTFS=""
|
||||
CONFIG_FILES=""
|
||||
SERVER_PATH="/etc/ddnsmngr/servers"
|
||||
|
||||
FORMAT="custom [SECTION] {\n\tusername\t= [USER]\n\tpassword\t= [PWD]\n\tddns-server\t= [SERV]\n\tddns-path\t= [URI]\n\tssl\t\t= [SSL]\n\thostname\t= [NAME]\n\tcheckip-command\t= [CMD]\n\tddns-response\t= [RESPONSES]\n}"
|
||||
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
log() {
|
||||
echo "$*"|logger -t ddnsmngr.init -p debug
|
||||
}
|
||||
|
||||
get_service_data() {
|
||||
local provider="$1"
|
||||
shift
|
||||
local dir="$1"
|
||||
shift
|
||||
local ipv6="$1"
|
||||
shift
|
||||
|
||||
local name data url answer script
|
||||
|
||||
[ $# -ne 2 ] && {
|
||||
return 1
|
||||
}
|
||||
|
||||
[ -f "${dir}/${provider}.json" ] || {
|
||||
eval "$1=\"\""
|
||||
eval "$2=\"\""
|
||||
return 1
|
||||
}
|
||||
|
||||
json_load_file "${dir}/${provider}.json"
|
||||
json_get_var name "name"
|
||||
if [ "$ipv6" -eq "1" ]; then
|
||||
json_select "ipv6"
|
||||
else
|
||||
json_select "ipv4"
|
||||
fi
|
||||
json_get_var data "url"
|
||||
json_get_var answer "answer"
|
||||
json_select ".."
|
||||
json_cleanup
|
||||
|
||||
response=""
|
||||
if [ -n "${answer}" ]; then
|
||||
answer=$(echo "${answer}" | sed 's/|/ /g')
|
||||
for ans in $answer; do
|
||||
if [ -z "${response}" ]; then
|
||||
response="${ans}"
|
||||
else
|
||||
response="${response}, ${ans}"
|
||||
fi
|
||||
done
|
||||
response="{ ${response} }"
|
||||
fi
|
||||
|
||||
eval "$1=\"$data\""
|
||||
eval "$2=\"$response\""
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
generate_inadyn_config() {
|
||||
json_load "${1}"
|
||||
json_get_var service_name service_name
|
||||
json_get_var use_ipv6 use_ipv6
|
||||
json_get_var interface interface
|
||||
json_get_var username username
|
||||
json_get_var password password
|
||||
json_get_var host lookup_host
|
||||
json_get_var conf_file config_file
|
||||
json_get_var conf_dir config_dir
|
||||
json_get_var server_address server_address
|
||||
json_cleanup
|
||||
|
||||
if [ -z "${service_name}" ] || [ -z "${host}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "${conf_file}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "${conf_dir}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# First look into custom path to load the url otherwise default path
|
||||
get_service_data "${service_name}" "${SERVER_PATH}" "${use_ipv6}" server_url server_answer
|
||||
|
||||
if [ -z "${server_url}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Need to pick proto, server address and request uri separately from the url
|
||||
# format http://[server_address]/[update_Request_uri]
|
||||
proto=$(echo $server_url | cut -d':' -f 1)
|
||||
serv=$(echo $server_url | cut -d'/' -f 3 | cut -d'@' -f 2)
|
||||
uri=${server_url#*$serv}
|
||||
|
||||
if [ -z $proto ] || [ -z $serv ] || [ -z $uri ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
path=$(echo "$uri" | sed 's/&/\\&/g')
|
||||
update_uri=$(echo $path | sed -e "s#\[DOMAIN\]#%h#g" -e "s#\[PASSWORD\]#%p#g" \
|
||||
-e "s#\[USERNAME\]#%u#g" -e "s#\[IP\]#%i#g")
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
interface="wan"
|
||||
else
|
||||
interface="wan6"
|
||||
fi
|
||||
fi
|
||||
|
||||
# now get the physical interface name
|
||||
intf=$(ifstatus "${interface}" | jsonfilter -e '@.device')
|
||||
if [ -z "${intf}" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# command to get ip of the interface
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv4-address\\\\\"][0].address'\""
|
||||
else
|
||||
get_ip="\"ifstatus ${interface} | jsonfilter -e '@[\\\\\"ipv6-address\\\\\"][0].address'\""
|
||||
fi
|
||||
|
||||
if [ "${proto}" = "http" ]; then
|
||||
ssl="false"
|
||||
else
|
||||
ssl="true"
|
||||
fi
|
||||
|
||||
inadyn_ver=$(inadyn -v)
|
||||
user_agent="inadyn/${inadyn_ver}"
|
||||
|
||||
config_file="${conf_dir}/${conf_file}"
|
||||
touch "${config_file}"
|
||||
|
||||
echo "iface = ${intf}" > "${config_file}"
|
||||
echo "period = 600" >> "${config_file}"
|
||||
echo "user-agent = ${user_agent}" >> "${config_file}"
|
||||
|
||||
if [ "${use_ipv6}" -eq 1 ]; then
|
||||
echo "allow-ipv6 = true" >> "${config_file}"
|
||||
fi
|
||||
|
||||
if [ -z "${password}" ]; then
|
||||
FORMAT=$(echo "${FORMAT}" | sed 's/\\tpassword\\t= \[PWD\]\\n//g')
|
||||
fi
|
||||
|
||||
if [ -z "${server_answer}" ]; then
|
||||
FORMAT=$(echo "${FORMAT}" | sed 's/\\tddns-response\\t= \[RESPONSES\]\\n//g')
|
||||
fi
|
||||
|
||||
config=$(echo $FORMAT | sed -e "s#\[SECTION\]#$conf_file#g" -e "s#\[PWD\]#$password#g" \
|
||||
-e "s#\[USER\]#$username#g" -e "s#\[SERV\]#$serv#g" \
|
||||
-e "s#\[URI\]#\"$update_uri\"#g" -e "s#\[SSL\]#$ssl#g" \
|
||||
-e "s#\[NAME\]#$host#g" -e "s#\[CMD\]#$get_ip#g" \
|
||||
-e "s#\[RESPONSES\]#$server_answer#g")
|
||||
|
||||
echo -e "\n\n${config}" >> "${config_file}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_host_section() {
|
||||
uci_validate_section ddnsmngr host "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'lookup_host:string' \
|
||||
'dm_parent:string'
|
||||
}
|
||||
|
||||
validate_client_section() {
|
||||
uci_validate_section ddnsmngr client "${1}" \
|
||||
'enabled:bool:0' \
|
||||
'service_name:string' \
|
||||
'interface:string' \
|
||||
'ip_network:string' \
|
||||
'username:string' \
|
||||
'password:string' \
|
||||
'use_https:bool:0' \
|
||||
'force_dnstcp:bool:0' \
|
||||
'use_ipv6:bool:0' \
|
||||
'force_ipversion:bool:0'
|
||||
}
|
||||
|
||||
add_object() {
|
||||
local enabled lookup_host dm_parent use_ipv6 force_ipversion
|
||||
local service_name interface ip_network username password use_https force_dnstcp
|
||||
|
||||
validate_host_section "${1}" || {
|
||||
log "Validation of host section failed"
|
||||
return
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ] || [ -z "${dm_parent}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
validate_client_section "${dm_parent}" || {
|
||||
log "Validation of client section failed"
|
||||
return
|
||||
}
|
||||
|
||||
if [ "${enabled}" -ne 1 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
service_name=$(uci -q get ddnsmngr.${dm_parent}.service_name)
|
||||
if [ -z "${service_name}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
service_section=$(uci show ddnsmngr | grep "service=\'${service_name}\'" | cut -d'.' -f 2 | head -1)
|
||||
if [ -z "${service_section}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
service_enabled=$(uci -q get ddnsmngr.${service_section}.enabled)
|
||||
if [ "${service_enabled}" -ne 1 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_add_string "interface" "${interface}"
|
||||
json_add_string "service_name" "${service_name}"
|
||||
json_add_string "username" "${username}"
|
||||
json_add_string "password" "${password}"
|
||||
json_add_string "lookup_host" "${lookup_host}"
|
||||
json_add_string "ip_network" "${ip_network}"
|
||||
json_add_string "use_ipv6" "${use_ipv6}"
|
||||
json_add_string "force_ipversion" "${force_ipversion}"
|
||||
json_add_string "use_https" "${use_https}"
|
||||
json_add_string "force_dnstcp" "${force_dnstcp}"
|
||||
json_add_string "config_file" "${1}"
|
||||
json_add_string "config_dir" "${CONFIGPATH}"
|
||||
|
||||
json_str=$(json_dump)
|
||||
json_cleanup
|
||||
|
||||
generate_inadyn_config "${json_str}"
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
CONFIG_FILES="${CONFIG_FILES} ${1}"
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
if [ "${use_ipv6}" -eq 0 ]; then
|
||||
interface="wan"
|
||||
else
|
||||
interface="wan6"
|
||||
fi
|
||||
fi
|
||||
|
||||
for intf in $CLIENT_INTFS; do
|
||||
if [ "${intf}" == "${interface}" ]; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
CLIENT_INTFS="${CLIENT_INTFS} ${interface}"
|
||||
}
|
||||
|
||||
start_ddnsmngr_service() {
|
||||
rm -rf $CONFIGPATH
|
||||
mkdir $CONFIGPATH
|
||||
mkdir -p $PIDPATH
|
||||
|
||||
config_load ddnsmngr
|
||||
config_foreach add_object host
|
||||
|
||||
i=1
|
||||
for conf in $CONFIG_FILES; do
|
||||
instance="ddnsmngr_${i}"
|
||||
i=$(( i + 1 ))
|
||||
|
||||
procd_open_instance $instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -f "${CONFIGPATH}/${conf}"
|
||||
procd_append_param command -l debug
|
||||
procd_append_param command -P "${PIDPATH}/${conf}"
|
||||
procd_append_param command -n -C
|
||||
procd_close_instance
|
||||
done
|
||||
}
|
||||
|
||||
stop_ddnsmngr_service() {
|
||||
rm -rf $CONFIGPATH
|
||||
return 0
|
||||
}
|
||||
|
||||
add_ddnsmngr_triggers() {
|
||||
procd_open_trigger
|
||||
for intf in $CLIENT_INTFS; do
|
||||
# No need to handle other ifevents like ifupdate etc
|
||||
procd_add_interface_trigger "interface.*.up" $intf /etc/init.d/ddnsmngr restart
|
||||
done
|
||||
procd_close_trigger
|
||||
}
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.2.1.3
|
||||
PKG_VERSION:=4.2.1.1.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0fe317cbe2b2e37c25a6d6d4e6f5c1d6964f9e50
|
||||
PKG_SOURCE_VERSION:=9fae736fa6c4ee39e7775964c7f84b105196c034
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -29,7 +29,7 @@ define Package/decollector
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi DataElements Collector Proxy
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread +libnl-genl \
|
||||
+libeasy +libwifiutils +libieee1905 +ieee1905-map-plugin
|
||||
+libeasy +libwifiutils +libieee1905 +map-plugin
|
||||
endef
|
||||
|
||||
define Package/decollector/description
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.1.2
|
||||
PKG_VERSION:=2.1.3.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e5cccdd45a93d969d51c4085cb52b543df544811
|
||||
PKG_SOURCE_VERSION:=847a94cee530d60bfd10ceaee4185d64fb6397d0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -26,7 +26,7 @@ define Package/ethmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet status and configration utility
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/ethmngr/description
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.1.9
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b4990b384461f2d1ff75a122a7fa5d9276f211bb
|
||||
PKG_SOURCE_VERSION:=3aabf79273537b146e063e32cd0443d8a156daa2
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,8 +31,7 @@ define Package/hostmngr
|
||||
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
|
||||
+libnetfilter-conntrack \
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api \
|
||||
+libwifiutils
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api
|
||||
|
||||
endef
|
||||
|
||||
@@ -58,7 +57,7 @@ endif
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/hostmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(CP) ./files/etc $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/hostmngr/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/hostmngr/libhostmngr.so"
|
||||
"name": "/etc/hostmngr/libhostmngr.so",
|
||||
"plugin_dir": "/etc/hostmngr/plugins/"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
schedule_added=""
|
||||
|
||||
ACCESS_RULE=""
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
@@ -111,77 +108,70 @@ ip_rule_east_zone() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
add_access_rule() {
|
||||
local rule="$1"
|
||||
echo "iptables -w -A hosts_forward ${rule}" >> $ACL_FILE
|
||||
echo "ip6tables -w -A hosts_forward ${rule}" >> $ACL_FILE
|
||||
}
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
next_day_val=$(get_next_day $val)
|
||||
prev_day_val=$(get_previous_day $val)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
next_days="$next_day_val"
|
||||
prev_days="$prev_day_val"
|
||||
else
|
||||
day="$day,$val"
|
||||
next_days="$next_days,$next_day_val"
|
||||
prev_days="$prev_days,$prev_day_val"
|
||||
fi
|
||||
}
|
||||
|
||||
handle_schedule() {
|
||||
local schd_section="$1"
|
||||
local ac_section="$2"
|
||||
local acs_id
|
||||
local start_time
|
||||
local duration
|
||||
|
||||
IP_RULE="$ACCESS_RULE"
|
||||
IP_RULE1=""
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
|
||||
config_get acs_id "$schd_section" "dm_parent"
|
||||
|
||||
if [ "$acs_id" != "$ac_section" ]; then
|
||||
return # schedule not for this access control section
|
||||
fi
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
config_get is_enabled "$schd_section" "enable" 0
|
||||
local access_control
|
||||
local start_time=""
|
||||
local mac=""
|
||||
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
next_day_val=$(get_next_day $val)
|
||||
prev_day_val=$(get_previous_day $val)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
next_days="$next_day_val"
|
||||
prev_days="$prev_day_val"
|
||||
else
|
||||
day="$day,$val"
|
||||
next_days="$next_days,$next_day_val"
|
||||
prev_days="$prev_days,$prev_day_val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
config_get is_enabled "$access_control" "enable" 1
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local all_days="Monday Tuesday Wednesday Thursday Friday Saturday Sunday"
|
||||
local day_config
|
||||
config_get day_config "$schd_section" "day" "$all_days"
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
IFS=" "
|
||||
for d in $day_config; do
|
||||
handle_day_list $d
|
||||
done
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
config_get start_time "$schd_section" "start_time" "00:00"
|
||||
config_get duration "$schd_section" "duration"
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
zone=$(date +%z | cut -c 1)
|
||||
local_start_time=$start_time
|
||||
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
local_start_hh=$hh
|
||||
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
local_start_hh=$hh
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
@@ -189,10 +179,6 @@ handle_schedule() {
|
||||
ss=$(( rem_ss % 60 ))
|
||||
local_stop_time="$hh:$mm:$ss"
|
||||
local_stop_hh=$hh
|
||||
else
|
||||
# if duartion is not specified, then apply rule to end of the day
|
||||
local_stop_time="23:59:59"
|
||||
local_stop_hh="23"
|
||||
fi
|
||||
|
||||
utc_start_time=$(date -u -d @$(date "+%s" -d "$local_start_time") +%H:%M)
|
||||
@@ -205,91 +191,47 @@ handle_schedule() {
|
||||
ip_rule_east_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
fi
|
||||
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j ACCEPT"
|
||||
fi
|
||||
|
||||
add_access_rule "$IP_RULE"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
add_access_rule "$IP_RULE1"
|
||||
fi
|
||||
|
||||
# for access rules to be effective for a schedule, need to add DROP rule
|
||||
# to block the access outside the defined schedule
|
||||
if [ "$schedule_added" == "0" ]; then
|
||||
schedule_added="1"
|
||||
fi
|
||||
}
|
||||
|
||||
handle_access_control() {
|
||||
local ac_section="$1"
|
||||
local is_enabled
|
||||
|
||||
# default value of Hosts.AccessControl.{i}.Enable is false,
|
||||
# so, if not defined in uci as 1, assume 0
|
||||
config_get is_enabled "$ac_section" "enable" 0
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local mac_addr
|
||||
config_get mac_addr "$ac_section" "macaddr"
|
||||
if [ -z "$mac_addr" ]; then
|
||||
return
|
||||
else
|
||||
ACCESS_RULE="-m mac --mac-source $mac_addr"
|
||||
fi
|
||||
|
||||
local access_policy
|
||||
config_get access_policy "$ac_section" "access_policy"
|
||||
if [ -z "$access_policy" ]; then
|
||||
return # since system default is allow so no need to do anything
|
||||
fi
|
||||
|
||||
# As per Data Model, if access policy is deny, then schedule is to be ignored
|
||||
# and no access is to be provided for the device
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
ACCESS_RULE="$ACCESS_RULE -j DROP"
|
||||
add_access_rule "$ACCESS_RULE"
|
||||
return # no need to parse schedule
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j DROP"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j ACCEPT"
|
||||
fi
|
||||
fi
|
||||
|
||||
schedule_added="0"
|
||||
# check if schedule is defined for this access_control instance
|
||||
# and if yes, create rule accordingly
|
||||
config_foreach handle_schedule ac_schedule "$ac_section"
|
||||
|
||||
# for access rule to work, need to have default drop rule as last rule
|
||||
if [ "$schedule_added" == "1" ]; then
|
||||
IP_RULE="$ACCESS_RULE -j DROP"
|
||||
add_access_rule "$IP_RULE"
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
iptables -w -A hosts_forward ${IP_RULE1}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE1}
|
||||
fi
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
}
|
||||
|
||||
ACL_FILE="/tmp/hosts_access_control/access_control.rules"
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
rm -f $ACL_FILE
|
||||
|
||||
mkdir -p /tmp/hosts_access_control/
|
||||
touch $ACL_FILE
|
||||
|
||||
echo "iptables -w -F hosts_forward" >> $ACL_FILE
|
||||
echo "ip6tables -w -F hosts_forward" >> $ACL_FILE
|
||||
|
||||
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
|
||||
if [ -z "$hosts_forward" ]; then
|
||||
echo "iptables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
hosts_ipv4_forward=$(iptables -t filter --list -n | grep hosts_forward)
|
||||
if [ -z "$hosts_ipv4_forward" ]; then
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
|
||||
echo "ip6tables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
|
||||
hosts_ipv6_forward=$(ip6tables -t filter --list -n | grep hosts_forward)
|
||||
if [ -z "$hosts_ipv6_forward" ]; then
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "ip6tables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach handle_access_control access_control
|
||||
|
||||
# apply the rules
|
||||
sh $ACL_FILE
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.6.8
|
||||
PKG_VERSION:=9.5.29.18
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=7ff419cefc314156a0ac518972096ef0dfb87162
|
||||
PKG_SOURCE_VERSION:=816033a14672e8e9c3566ce06fa19fb422eeb546
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -26,21 +26,68 @@ include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/icwmp
|
||||
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 +libbbfdm-api +libopenssl
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml +libuuid +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/icwmp
|
||||
$(Package/icwmp/default)
|
||||
VARIANT:=default
|
||||
DEFAULT_VARIANT:=1
|
||||
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-openssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (openssl)
|
||||
VARIANT:=openssl
|
||||
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
|
||||
CONFLICTS := icwmp icwmp-mbedtls icwmp-wolfssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-wolfssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (wolfssl)
|
||||
VARIANT:=wolfssl
|
||||
DEPENDS += +PACKAGE_icwmp-wolfssl:libwolfssl
|
||||
CONFLICTS := icwmp icwmp-mbedtls icwmp-openssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-mbedtls
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_icwmp-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
CONFLICTS := icwmp icwmp-wolfssl icwmp-openssl
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),default)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=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
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/icwmp/install
|
||||
define Package/icwmp/default/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
@@ -62,4 +109,12 @@ define Package/icwmp/install
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libcwmpdm.so)
|
||||
endef
|
||||
|
||||
Package/icwmp/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-wolfssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-mbedtls/install = $(Package/icwmp/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,icwmp))
|
||||
$(eval $(call BuildPackage,icwmp-openssl))
|
||||
$(eval $(call BuildPackage,icwmp-wolfssl))
|
||||
$(eval $(call BuildPackage,icwmp-mbedtls))
|
||||
|
||||
@@ -5,7 +5,6 @@ config acs 'acs'
|
||||
option periodic_inform_interval '1800'
|
||||
option periodic_inform_time '0001-01-01T00:00:00Z'
|
||||
option dhcp_discovery 'enable'
|
||||
option ssl_capath "/etc/ssl/certs"
|
||||
# compression possible configs: GZIP, Deflate, Disabled
|
||||
option compression 'Disabled'
|
||||
# possible configs interval :[1:65535]
|
||||
|
||||
@@ -15,24 +15,32 @@ log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
regenerate_ssl_link() {
|
||||
local cert_dir="${1%/}"
|
||||
[ ! -d "${cert_dir}" ] || [ "${cert_dir}" = "/etc/ssl/certs" ] && return 0
|
||||
regenerate_ssl_link()
|
||||
{
|
||||
local cert_dir all_file rehash
|
||||
|
||||
generate_links() {
|
||||
local file_type="$1"
|
||||
local files="${cert_dir}"/*."${file_type}"
|
||||
for cfile in ${files}; do
|
||||
if [ -f "${cfile}" ]; then
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
[ -f "${cert_dir}/${rehash}.0" ] || \
|
||||
ln -s "${cfile}" "${cert_dir}/${rehash}.0"
|
||||
fi
|
||||
cert_dir="${1}"
|
||||
[ ! -d "${cert_dir}" ] && return 0;
|
||||
|
||||
### Generate all ssl link for pem certicates ###
|
||||
all_file=$(ls "${cert_dir}"/*.pem 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
[ -f "${cert_dir}"/"${rehash}".0 ] || \
|
||||
ln -s "${cfile}" "${cert_dir}"/"${rehash}".0
|
||||
done
|
||||
}
|
||||
fi
|
||||
|
||||
generate_links "pem"
|
||||
generate_links "crt"
|
||||
### Generate all ssl link for crt certicates ###
|
||||
all_file=$(ls "${cert_dir}"/*.crt 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
[ -f "${cert_dir}"/"${rehash}".0 ] || \
|
||||
ln -s "${cfile}" "${cert_dir}"/"${rehash}".0
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
@@ -428,14 +436,13 @@ validate_cpe_section()
|
||||
'notification:bool' \
|
||||
'exec_download:bool' \
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool:1' \
|
||||
'enable:bool' \
|
||||
'periodic_notify_interval:uinteger' \
|
||||
'fw_upgrade_keep_settings:bool'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
local ssl_capath enable url dhcp_url
|
||||
|
||||
local ssl_capath
|
||||
config_load cwmp
|
||||
|
||||
validate_acs_section || {
|
||||
@@ -443,17 +450,13 @@ validate_defaults() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z "${url}" ] && [ -z "${dhcp_url}" ]; then
|
||||
log "No ACS URL is configured"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ssl_capath="${ssl_capath%/}"
|
||||
# Put the cert pem file in keep list
|
||||
if [ -d "${ssl_capath}" ] && [ "${ssl_capath}" != "/etc/ssl/certs" ]; then
|
||||
if [ -d "${ssl_capath}" ]; then
|
||||
if ! grep "*.pem\|*.crt" /lib/upgrade/keep.d/icwmp; then
|
||||
echo "${ssl_capath}"'/*.pem' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.crt' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.0' >> /lib/upgrade/keep.d/icwmp
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -462,11 +465,6 @@ validate_defaults() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ "$enable" = "0" ]; then
|
||||
log "CWMP service disabled"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -514,17 +512,30 @@ boot() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable_cwmp url dhcp_url
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get url acs url ""
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
|
||||
procd_open_instance icwmp
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
procd_close_instance
|
||||
return 0
|
||||
fi
|
||||
|
||||
validate_defaults || {
|
||||
log "Validation of defaults failed"
|
||||
procd_close_instance
|
||||
return 1;
|
||||
}
|
||||
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
if [ -n "${url}" ] || [ -n "${dhcp_url}" ]; then
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
fi
|
||||
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
@@ -541,14 +552,16 @@ stop_service()
|
||||
reload_service() {
|
||||
local ret
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
|
||||
log "Reload service $ret"
|
||||
ret="0"
|
||||
|
||||
validate_defaults || {
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
stop
|
||||
start
|
||||
return 0;
|
||||
}
|
||||
return 0
|
||||
fi
|
||||
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
if [ "$ret" != "true" ]; then
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.3.7.1
|
||||
PKG_VERSION:=8.3.4.15
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=490979bd8ec0395795801f3bfb9dc47af1eb4ade
|
||||
PKG_SOURCE_VERSION:=bdf808d9b2c74e2613f1e2842cb01e62e2d1a3e1
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -60,12 +60,12 @@ define Package/libieee1905/description
|
||||
endef
|
||||
|
||||
plugins := \
|
||||
$(if $(CONFIG_PACKAGE_ieee1905-map-plugin),map) \
|
||||
$(if $(CONFIG_PACKAGE_ieee1905-snoop-plugin),snoop) \
|
||||
$(if $(CONFIG_PACKAGE_ieee1905-topology-plugin),topology)
|
||||
$(if $(CONFIG_PACKAGE_map-plugin),map) \
|
||||
$(if $(CONFIG_PACKAGE_snoop-plugin),snoop) \
|
||||
$(if $(CONFIG_PACKAGE_topology-plugin),topology)
|
||||
|
||||
|
||||
ppkg:=$(patsubst plugins/%.mk,ieee1905-%-plugin,$(wildcard plugins/*.mk))
|
||||
ppkg:=$(patsubst plugins/%.mk,%-plugin,$(wildcard plugins/*.mk))
|
||||
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
define Package/ieee1905-map-plugin
|
||||
define Package/map-plugin
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=Multi-AP plugin supporting WiFi-Alliance Easymesh standard
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
define Package/ieee1905-map-plugin/config
|
||||
if (PACKAGE_ieee1905-map-plugin)
|
||||
define Package/map-plugin/config
|
||||
if (PACKAGE_map-plugin)
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
@@ -32,7 +32,7 @@ ifeq ($(CONFIG_MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG),y)
|
||||
TARGET_CFLAGS += -DDYNAMIC_CNTLR_SYNC_CONFIG
|
||||
endif
|
||||
|
||||
define Build/InstallDev/ieee1905-map-plugin
|
||||
define Build/InstallDev/map-plugin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
@@ -43,7 +43,7 @@ define Build/InstallDev/ieee1905-map-plugin
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
endef
|
||||
|
||||
define Package/ieee1905-map-plugin/install
|
||||
define Package/map-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
define Package/ieee1905-snoop-plugin
|
||||
define Package/snoop-plugin
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=Show all received 1905 CMDUs over UBUS
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
define Package/ieee1905-snoop-plugin/install
|
||||
define Package/snoop-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/snoop/snoop.so $(1)/usr/lib/ieee1905/snoop.so
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
define Package/ieee1905-topology-plugin
|
||||
define Package/topology-plugin
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=Build full network topology of the 1905 nodes only
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
define Package/ieee1905-topology-plugin/install
|
||||
define Package/topology-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/topology/topology.so $(1)/usr/lib/ieee1905/topology.so
|
||||
|
||||
@@ -71,7 +71,7 @@ CONFIG_PACKAGE_wifimngr=y
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
|
||||
CONFIG_PACKAGE_ieee1905-topology-plugin=y
|
||||
CONFIG_PACKAGE_topology-plugin=y
|
||||
CONFIG_PACKAGE_decollector=y
|
||||
CONFIG_PACKAGE_map-agent=y
|
||||
CONFIG_PACKAGE_map-controller=y
|
||||
@@ -79,6 +79,7 @@ CONFIG_PACKAGE_map-controller=y
|
||||
# Network #
|
||||
CONFIG_PACKAGE_hostmngr=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_testnet=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
|
||||
# System #
|
||||
@@ -149,6 +150,7 @@ CONFIG_PACKAGE_ssdpd=y
|
||||
CONFIG_PACKAGE_miniupnpd-iptables=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
# CONFIG_MOSQUITTO_BRIDGE_SUPPORT is not set
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
|
||||
@@ -33,8 +33,7 @@ _iop()
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
|
||||
feeds_update feeds_update-legacy genconfig genconfig-legacy \
|
||||
generate_tarballs install_key \
|
||||
feeds_update genconfig generate_tarballs install_key \
|
||||
scp_changes setup_host ssh_install_key status \
|
||||
update_package update_feed_branches ssh_upgrade smoketest"
|
||||
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function feeds_update-legacy {
|
||||
heads=1
|
||||
developer=0
|
||||
override=1
|
||||
force=1
|
||||
|
||||
function update_failure {
|
||||
if [ $force == 1 ]; then
|
||||
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
|
||||
else
|
||||
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "inFh" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
heads=0
|
||||
;;
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
F)
|
||||
force=0
|
||||
;;
|
||||
h|\?)
|
||||
echo "Usage: ./iop feeds_update-legacy [-i] [-n] [-F] [-h]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo " -i - Only update index. Do not change HEAD in feeds."
|
||||
echo " -n - Do not replace core packages with iopsys versions."
|
||||
echo " -F - Do not force update if there are inaccessible feeds."
|
||||
echo " -h - Display this help message and exit."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
if [ $heads == 1 ]; then
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g || update_failure
|
||||
else
|
||||
./scripts/feeds update || update_failure
|
||||
fi
|
||||
fi
|
||||
./scripts/feeds update -ai || exit 1
|
||||
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a || exit 1
|
||||
./scripts/feeds install -f -p qualcomm -a || exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
|
||||
echo 'FEED_DEVICES_DIRS:='
|
||||
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h\n'
|
||||
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
|
||||
|
||||
# targets need to be installed explicitly
|
||||
for target in $(ls ./feeds/targets); do
|
||||
./scripts/feeds install -f -p targets $target || exit 1
|
||||
done
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a || exit 1
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig || exit 1
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap || exit 1
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update-legacy" "Update feeds to point to commit hashes from feeds.conf - legacy mode"
|
||||
@@ -1,9 +1,88 @@
|
||||
#!/bin/bash
|
||||
|
||||
function feeds_update {
|
||||
heads=1
|
||||
developer=0
|
||||
override=1
|
||||
force=1
|
||||
|
||||
function update_failure {
|
||||
if [ $force == 1 ]; then
|
||||
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
|
||||
else
|
||||
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "inFh" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
heads=0
|
||||
;;
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
F)
|
||||
force=0
|
||||
;;
|
||||
h|\?)
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-F] [-h]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo " -i - Only update index. Do not change HEAD in feeds."
|
||||
echo " -n - Do not replace core packages with iopsys versions."
|
||||
echo " -F - Do not force update if there are inaccessible feeds."
|
||||
echo " -h - Display this help message and exit."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
if [ $heads == 1 ]; then
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g || update_failure
|
||||
else
|
||||
./scripts/feeds update || update_failure
|
||||
fi
|
||||
fi
|
||||
./scripts/feeds update -ai || exit 1
|
||||
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a || exit 1
|
||||
./scripts/feeds install -f -p qualcomm -a || exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
echo '# DO NOT EDIT. Autogenerated file by ./iop feeds_update'
|
||||
echo 'FEED_DEVICES_DIRS:='
|
||||
find feeds -type f -name .is-feed-devices-dir -printf 'FEED_DEVICES_DIRS+=$(TOPDIR)/%h\n'
|
||||
) > target/linux/feed-devices/feed-devices-list.mk || exit 1
|
||||
|
||||
# targets need to be installed explicitly
|
||||
for target in $(ls ./feeds/targets); do
|
||||
./scripts/feeds install -f -p targets $target || exit 1
|
||||
done
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a || exit 1
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete || exit 1
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig || exit 1
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap || exit 1
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update" "Compatibility function only"
|
||||
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig-legacy {
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export IMPORT=1
|
||||
@@ -196,7 +196,7 @@ function genconfig-legacy {
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 genconfig-legacy [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
@@ -210,7 +210,7 @@ function genconfig-legacy {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig-legacy eg400 OPERATORX"
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
@@ -399,8 +399,6 @@ function genconfig-legacy {
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
;;
|
||||
*)
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
@@ -433,6 +431,15 @@ function genconfig-legacy {
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# Ensure strict file permissions, for when provided through the above
|
||||
if [ -f "$FILEDIR/etc/shadow" ]; then
|
||||
v "chmod 0600 $FILEDIR/etc/shadow"
|
||||
chmod 0600 "$FILEDIR/etc/shadow"
|
||||
fi
|
||||
if [ -d "$FILEDIR/etc/ssl/private" ]; then
|
||||
v "find $FILEDIR/etc/ssl/private -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'"
|
||||
find "$FILEDIR/etc/ssl/private" -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
@@ -496,7 +503,7 @@ function genconfig-legacy {
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig-legacy -h' to get instructions if you want to change current config"
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
@@ -532,4 +539,4 @@ function genconfig-legacy {
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig-legacy" "Generate configuration for board and customer - legacy mode"
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
21
iop/scripts/genconfig_min-legacy.sh → iop/scripts/genconfig_min.sh
Executable file → Normal file
21
iop/scripts/genconfig_min-legacy.sh → iop/scripts/genconfig_min.sh
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig_min-legacy {
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export SRCTREEOVERR=0
|
||||
@@ -195,7 +195,7 @@ function genconfig_min-legacy {
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 genconfig_min-legacy [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
@@ -209,7 +209,7 @@ function genconfig_min-legacy {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig_min-legacy eg400 OPERATORX"
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
@@ -373,8 +373,6 @@ function genconfig_min-legacy {
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
;;
|
||||
*)
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
@@ -407,6 +405,15 @@ function genconfig_min-legacy {
|
||||
fi
|
||||
done
|
||||
fi
|
||||
# Ensure strict file permissions, for when provided through the above
|
||||
if [ -f "$FILEDIR/etc/shadow" ]; then
|
||||
v "chmod 0600 $FILEDIR/etc/shadow"
|
||||
chmod 0600 "$FILEDIR/etc/shadow"
|
||||
fi
|
||||
if [ -d "$FILEDIR/etc/ssl/private" ]; then
|
||||
v "find $FILEDIR/etc/ssl/private -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'"
|
||||
find "$FILEDIR/etc/ssl/private" -type d -exec chmod 0700 '{}' ';' -o -type f -exec chmod 0600 '{}' ';'
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
@@ -464,7 +471,7 @@ function genconfig_min-legacy {
|
||||
if [ $# -eq 0 ]; then
|
||||
echo Current profile:
|
||||
cat $CURRENT_CONFIG_FILE
|
||||
echo "Try ./iop genconfig_min-legacy -h' to get instructions if you want to change current config"
|
||||
echo "Try ./iop genconfig -h' to get instructions if you want to change current config"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
@@ -500,4 +507,4 @@ function genconfig_min-legacy {
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig_min-legacy" "Generate configuration for customer with manual board configuration - legacy mode"
|
||||
register_command "genconfig_min" "Generate configuration for customer with manual board configuration"
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Function to convert parameters to lowercase
|
||||
function to_lowercase {
|
||||
local params=()
|
||||
for param in "$@"; do
|
||||
params+=("$(tr '[:upper:]' '[:lower:]' <<< "$param")")
|
||||
done
|
||||
echo "${params[@]}"
|
||||
}
|
||||
|
||||
function genconfig {
|
||||
target_script="./scripts/gen_config.py"
|
||||
|
||||
# First convert all to lowercase
|
||||
args=$(to_lowercase "$@")
|
||||
|
||||
# Check if an option is provided
|
||||
if [[ ${args[0]} == -* ]]; then
|
||||
# Convert options for target script
|
||||
if [[ ${args[0]} == "-b" || ${args[0]} == "--boards" ]]; then
|
||||
args=("--list")
|
||||
fi
|
||||
fi
|
||||
|
||||
${target_script} ${args[@]}
|
||||
}
|
||||
|
||||
register_command "genconfig" "Generate configuration for board and customer"
|
||||
@@ -1,10 +1,646 @@
|
||||
# Exported interface
|
||||
update_package() {
|
||||
echo "update_package is no longer supported." >&2
|
||||
echo "Its replacement will come soon." >&2
|
||||
echo >&2
|
||||
echo "For now update references in profiles/include/*.yml and feeds.conf.io manually." >&2
|
||||
return 1
|
||||
#!/bin/bash
|
||||
|
||||
print_git_update()
|
||||
{
|
||||
echo "pkg -> ${PKG_NAME}"
|
||||
echo " PKG_BUILD_DIR = ${PKG_BUILD_DIR}"
|
||||
echo " PKG_DIR = ${PKG_DIR}"
|
||||
echo " PKG_SOURCE = ${PKG_SOURCE}"
|
||||
echo " PKG_NAME = ${PKG_NAME}"
|
||||
echo " PKG_SOURCE_URL = ${PKG_SOURCE_URL}"
|
||||
echo " PKG_SOURCE_PROTO= ${PKG_SOURCE_PROTO}"
|
||||
echo " PKG_SOURCE_VERSION= ${PKG_SOURCE_VERSION}"
|
||||
echo " PKG_SOURCE = ${PKG_SOURCE}"
|
||||
echo " PKG_SOURCE_VERSION_FILE=${PKG_SOURCE_VERSION_FILE}"
|
||||
}
|
||||
|
||||
register_command "update_package" "No longer used command"
|
||||
is_git_same()
|
||||
{
|
||||
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
#echo "$PKG_NAME $git_last = ${PKG_SOURCE_VERSION}"
|
||||
if [ "$git_last" == "${PKG_SOURCE_VERSION}" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
update_this_pkg()
|
||||
{
|
||||
mk_hash=$(get_makefile_hash)
|
||||
|
||||
if [ "$mk_hash" != "${PKG_SOURCE_VERSION}" ]
|
||||
then
|
||||
echo "${PKG_NAME}:"
|
||||
echo " build dir = ${PKG_BUILD_DIR}"
|
||||
echo " feed makefile = ${mk_hash}"
|
||||
echo " stale hash = ${PKG_SOURCE_VERSION}"
|
||||
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
|
||||
echo " Git hash in package makefile and the git hash recorded from last compile of"
|
||||
echo " package is different. You probably want to recompile the package"
|
||||
echo " to get an up to date version in ${PKG_BUILD_DIR}/.git_update"
|
||||
echo ""
|
||||
|
||||
echo -n " Should we continue with the update anyway? [y/N]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
;;
|
||||
n|N|*)
|
||||
return 1;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "${PKG_NAME}:"
|
||||
echo " build dir = ${PKG_BUILD_DIR}"
|
||||
echo " pkg dir = ${PKG_DIR}"
|
||||
echo " feed makefile = ${PKG_SOURCE_VERSION}"
|
||||
echo " build git = $(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)"
|
||||
echo " package is at a different git commit in build compared to feed"
|
||||
echo -n " Should we update the feed and top project to reflect the new version ? [y/N]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
return 0;;
|
||||
*)
|
||||
echo ""
|
||||
return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_makefile_hash()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
grep "PKG_SOURCE_VERSION:=" ${PKG_DIR}/${name} | sed -e "s/\(^PKG_SOURCE_VERSION:=\)\(.*\)/\2/"
|
||||
}
|
||||
|
||||
insert_hash_in_feed_makefile()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
|
||||
git_last=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
|
||||
sed -i -e "s/\(^PKG_SOURCE_VERSION:=\).*/\1${git_last}/" ${PKG_DIR}/${name}
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
insert_version_in_feed_makefile()
|
||||
{
|
||||
if [ -n "$PKG_SOURCE_VERSION_FILE" ]
|
||||
then
|
||||
name="$PKG_SOURCE_VERSION_FILE"
|
||||
else
|
||||
name=Makefile
|
||||
fi
|
||||
|
||||
last_version=$(awk -F '=' '/PKG_VERSION:=/ {print $2}' ${PKG_DIR}/${name})
|
||||
|
||||
echo -n "please enter version: "
|
||||
read -ei "$last_version" answer
|
||||
|
||||
if [ -z ${answer} ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
sed -i -e "s/\(^PKG_VERSION:=\).*/\1${answer}/" ${PKG_DIR}/${name}
|
||||
(cd ${PKG_DIR}; git add ${name})
|
||||
}
|
||||
|
||||
|
||||
# BUG: fix if only local branche name!
|
||||
branch_uptodate()
|
||||
{
|
||||
# $1 git repo
|
||||
# $2 if it exist dont abort do the pull
|
||||
(cd $1
|
||||
git remote update 2>&1 >/dev/null
|
||||
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse @{u})
|
||||
BASE=$(git merge-base @ @{u})
|
||||
|
||||
if [ -z "$REMOTE" ]; then
|
||||
BRANCH=$(basename $(git symbolic-ref -q HEAD))
|
||||
echo "You need to setup a tracking branch for $BRANCH"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
if [ $LOCAL = $REMOTE ]; then
|
||||
return
|
||||
elif [ $LOCAL = $BASE ]; then
|
||||
if [ -n "$2" ]
|
||||
then
|
||||
echo "Doing automatic pull on [ $1 ]"
|
||||
if git pull
|
||||
then
|
||||
return
|
||||
else
|
||||
echo "Something wrong with pull. aborting, repo at"
|
||||
echo " [ $1 ]"
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo "Local repo behind remote:"
|
||||
echo "do git pull at repo"
|
||||
echo " [ $1 ]"
|
||||
exit 99
|
||||
fi
|
||||
elif [ $REMOTE = $BASE ]; then
|
||||
echo "Local repo ahead of remote. A push is needed"
|
||||
echo "Repo is at: $1"
|
||||
echo ""
|
||||
echo -n "Should we try a push ? [Y/n]:"
|
||||
read answer
|
||||
echo ""
|
||||
|
||||
case $answer in
|
||||
n|N|q|Q)
|
||||
exit 99;;
|
||||
*)
|
||||
echo -e "${Yellow}"
|
||||
if ! git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off}"
|
||||
exit 99
|
||||
fi
|
||||
echo -e "${Color_Off}Push done."
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
echo "Diverged. not sure what you did but there is no tracking branch. "
|
||||
echo "repo at [ $1 ]. fix it so that there is a tracking branch remote."
|
||||
echo "Often this is related to somebody having commited to the same branch"
|
||||
echo "on the server so a simple push wont work, try a 'git rebase'."
|
||||
exit 99
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
on_a_branch()
|
||||
{
|
||||
local repo=$1
|
||||
local type=$2
|
||||
(
|
||||
cd $repo
|
||||
name=$(git symbolic-ref -q HEAD)
|
||||
if [ -z "$name" ]
|
||||
then
|
||||
echo "git $type repo [ $repo ] is detached."
|
||||
|
||||
branches=($(git branch -r --contains $(git rev-parse HEAD)))
|
||||
if [ 0 == ${#branches[@]} ]
|
||||
then
|
||||
echo "It needs to be on a branch but git could not find any associated branch"
|
||||
echo ""
|
||||
echo "you need to make sure that the commit is not on a detached branch"
|
||||
echo "and that the branch exist in the remote repo also. it can not be a local name"
|
||||
echo "as it is about to get pushed so it can be part of system release"
|
||||
exit 99
|
||||
fi
|
||||
|
||||
echo "It needs to be on a branch. Please select one or quit if it is not in list."
|
||||
echo ""
|
||||
|
||||
i=0
|
||||
for branch in ${branches[*]}
|
||||
do
|
||||
echo "$i: $branch"
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -n "Select what branch to checkout. Q/q or N/n to quit? "
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
q|Q|n|N)
|
||||
echo "Aborting!"
|
||||
exit 99;;
|
||||
esac
|
||||
|
||||
echo -e "${Yellow}"
|
||||
pwd
|
||||
echo "git checkout ${branches[$answer]}"
|
||||
if ! git checkout -t ${branches[$answer]}
|
||||
then
|
||||
local_branch=$(basename ${branches[$answer]})
|
||||
if ! git checkout ${local_branch}
|
||||
then
|
||||
echo -e "${Color_Off}"
|
||||
echo "update_git aborting! something was wrong changing to branch ${branches[$answer]}"
|
||||
echo "go to [ $repo ] and fix it."
|
||||
exit 99
|
||||
fi
|
||||
fi
|
||||
echo -e "${Color_Off}"
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
git_repos_uptodate()
|
||||
{
|
||||
on_a_branch ${PKG_BUILD_DIR} package
|
||||
on_a_branch ${PKG_DIR} feed
|
||||
on_a_branch ${PWD} top
|
||||
branch_uptodate ${PKG_BUILD_DIR}
|
||||
branch_uptodate ${PKG_DIR} do_pull
|
||||
branch_uptodate ${PWD} do_pull
|
||||
}
|
||||
|
||||
get_feed_name()
|
||||
{
|
||||
|
||||
echo $1 |sed -e "s|.*feeds/\([^/]*\).*|\1|"
|
||||
|
||||
# rest=$(dirname $1)
|
||||
# base=$(basename $1)
|
||||
# prev=$base
|
||||
|
||||
# while [ -n "$rest" ]
|
||||
# do
|
||||
# if [ "$base" == "feeds" ]
|
||||
# then
|
||||
# echo "$prev"
|
||||
# fi
|
||||
# done
|
||||
}
|
||||
|
||||
create_message()
|
||||
{
|
||||
FORMAT="commit %H%n\
|
||||
Author: %aN <%aE>%n\
|
||||
Date: %ai%n\
|
||||
%n\
|
||||
%w(80,4,4)%s%n
|
||||
%b%n\
|
||||
%w()Base directory -> ${repo_PATH}/"
|
||||
local FROM=${PKG_SOURCE_VERSION}
|
||||
local TO=$(cd ${PKG_BUILD_DIR}; git rev-parse HEAD)
|
||||
|
||||
local commits=$(cd ${PKG_BUILD_DIR};git rev-list ${FROM}..${TO})
|
||||
|
||||
local feed=$(get_feed_name ${PKG_DIR})
|
||||
|
||||
echo "Update feed [ $feed ] package [ $PKG_NAME ]"
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
(cd ${PKG_BUILD_DIR}; git log --graph --oneline ${FROM}..${TO})
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
for commit in $commits
|
||||
do
|
||||
(cd ${PKG_BUILD_DIR}; git show --stat --pretty=format:"$FORMAT" $commit)
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
done
|
||||
}
|
||||
|
||||
edit_file()
|
||||
{
|
||||
echo -en "${Red}"
|
||||
echo "Here is the commit message we are going to use!"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo -en "${Color_Off}"
|
||||
cat $1
|
||||
echo -en "${Red}"
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
echo -en "${Color_Off}"
|
||||
|
||||
echo -n "Do you want to edit the message [y/N]? "
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
y|Y)
|
||||
$EDITOR $1;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
commit_feed()
|
||||
{
|
||||
template=$(readlink -f $1)
|
||||
edit_file $template
|
||||
|
||||
echo -e "${Yellow}"
|
||||
(
|
||||
cd ${PKG_DIR}
|
||||
if git commit -F $template
|
||||
then
|
||||
if git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off} Feed Updated!"
|
||||
return
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong push feed git ${PKG_DIR}"
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong committing to feed git ${PKG_DIR}"
|
||||
exit 99
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
||||
commit_feeds_config()
|
||||
{
|
||||
template=$(readlink -f $1)
|
||||
edit_file $template
|
||||
|
||||
echo -e "${Yellow}"
|
||||
if git commit -F $template
|
||||
then
|
||||
if git push origin HEAD
|
||||
then
|
||||
echo -e "${Color_Off}Feeds.conf updated!"
|
||||
return
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong push change to feeds.conf"
|
||||
echo "try \"git remote update ; git stash ;git rebase; git push;git stash pop\""
|
||||
exit 99
|
||||
fi
|
||||
else
|
||||
echo -e "${Color_Off}"
|
||||
echo "something wrong committing to feed git"
|
||||
exit 99
|
||||
fi
|
||||
}
|
||||
|
||||
insert_hash_in_feeds_config()
|
||||
{
|
||||
local feed=$(get_feed_name ${PKG_DIR})
|
||||
local TO=$(cd ${PKG_DIR}; git rev-parse HEAD)
|
||||
|
||||
sed -i feeds.conf -e "/ ${feed} / s/\(.*\)[;^].*/\1^${TO}/"
|
||||
git add feeds.conf
|
||||
}
|
||||
|
||||
check_packages()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes have been done to the packages."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
# only scan in the build directory that is currently in use.
|
||||
CPU=$(grep "CONFIG_CPU_TYPE=" .config| cut -f2 -d\")
|
||||
LIBC=$(grep "CONFIG_LIBC=" .config| cut -f2 -d\")
|
||||
|
||||
# First scan all files in build dir for packages that have .git directories.
|
||||
all_pkgs=$(find build_dir/*${CPU}*${LIBC}* -name ".git")
|
||||
|
||||
for pkg in `echo "$all_pkgs"`
|
||||
do
|
||||
pkg=$(dirname $pkg)
|
||||
|
||||
# check if the git in build is at same commit id as the feed makefile points out
|
||||
if [ -e ${pkg}/.git_update ]
|
||||
then
|
||||
source ${pkg}/.git_update
|
||||
fi
|
||||
|
||||
# print_git_update
|
||||
|
||||
if [ -n "${PKG_NAME}" ]
|
||||
then
|
||||
if ! is_git_same
|
||||
then
|
||||
if update_this_pkg
|
||||
then
|
||||
# print_git_update
|
||||
git_repos_uptodate
|
||||
insert_hash_in_feed_makefile
|
||||
[ ${UPDATE} -eq 1 ] && insert_version_in_feed_makefile
|
||||
create_message >tmp/msg
|
||||
commit_feed tmp/msg
|
||||
insert_hash_in_feeds_config
|
||||
commit_feeds_config tmp/msg
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# now handle the target git. we have only one
|
||||
|
||||
|
||||
feeds_hash()
|
||||
{
|
||||
grep -v "^#" feeds.conf | grep " $1 " | grep "\^" | sed -e "s/.*[;^]\(.*\)/\1/"
|
||||
}
|
||||
|
||||
insert_feed_hash_in_feeds_config()
|
||||
{
|
||||
local feed=$1
|
||||
local TO=$(cd feeds/${feed}; git rev-parse HEAD)
|
||||
|
||||
sed -i feeds.conf -e "/ ${feed} / s/\(.*\)[;^].*/\1^${TO}/"
|
||||
git add feeds.conf
|
||||
}
|
||||
|
||||
create_feed_message()
|
||||
{
|
||||
local feed=$1
|
||||
local FROM=$2
|
||||
local TO=$3
|
||||
|
||||
local FORMAT="commit %H%n\
|
||||
Author: %aN <%aE>%n\
|
||||
Date: %ai%n\
|
||||
%n\
|
||||
%w(80,4,4)%s%n
|
||||
%b%n\
|
||||
%w()Base directory -> feeds/$feed/"
|
||||
|
||||
|
||||
local commits=$(cd feeds/$feed;git rev-list ${FROM}..${TO})
|
||||
|
||||
echo "Update feed [ $feed ]"
|
||||
echo ""
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
(cd feeds/$feed; git log --graph --oneline ${FROM}..${TO})
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
|
||||
for commit in $commits
|
||||
do
|
||||
(cd feeds/$feed; git show --stat --pretty=format:"$FORMAT" $commit)
|
||||
echo "-------------------------------------------------------------------------------"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
check_feeds()
|
||||
{
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
echo "Now checking if any changes have been done to the feeds."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
feeds="$1"
|
||||
[ -n "$feeds" ] || feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
for feed in `echo $feeds`
|
||||
do
|
||||
feed_hash=$(feeds_hash $feed)
|
||||
[ -n "$feed_hash" ] || continue
|
||||
if [ -d feeds/$feed ]; then
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
|
||||
if [ "$feed_hash" != "$in_git" ]
|
||||
then
|
||||
|
||||
name=$(cd feeds/$feed;git symbolic-ref -q HEAD)
|
||||
if [ -z "$name" ]
|
||||
then
|
||||
echo "Feed feeds/${feed} is at a git commit which is different from feeds.conf"
|
||||
#echo "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
|
||||
on_a_branch feeds/${feed} feed
|
||||
|
||||
#redo the test here and see if the feeds.conf and git is still different.
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
if [ "$feed_hash" = "$in_git" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
LOCAL=$(cd feeds/$feed;git rev-parse @)
|
||||
REMOTE=$(cd feeds/$feed;git rev-parse @{u})
|
||||
BASE=$(cd feeds/$feed;git merge-base @ @{u})
|
||||
|
||||
# if we are behind the remote automatically do a pull
|
||||
if [ $LOCAL = $BASE ]; then
|
||||
(cd feeds/$feed ; git pull 1>/dev/null)
|
||||
|
||||
#redo the test here and see if the feeds.conf and git is still different.
|
||||
in_git=$(cd feeds/$feed; git rev-parse HEAD)
|
||||
if [ "$feed_hash" = "$in_git" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Feed feeds/${feed} is at different commit than what is in feeds.conf"
|
||||
#echo "git id from feeds.conf [$feed_hash] git id from feeds/${feed} [$in_git]"
|
||||
echo -n "Should we update feeds.conf to reflect the new version ? [y/N]:"
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
n|N|'')
|
||||
continue;;
|
||||
esac
|
||||
branch_uptodate feeds/${feed}
|
||||
create_feed_message ${feed} $feed_hash $in_git >tmp/msg
|
||||
insert_feed_hash_in_feeds_config ${feed}
|
||||
commit_feeds_config tmp/msg
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
is_local_and_remote_same()
|
||||
{
|
||||
git remote update 2>/dev/null 1>/dev/null
|
||||
LOCAL=$(git rev-parse @)
|
||||
REMOTE=$(git rev-parse @{u})
|
||||
|
||||
if [ $LOCAL = $REMOTE ]
|
||||
then
|
||||
return
|
||||
fi
|
||||
|
||||
local_name=$(git rev-parse --abbrev-ref @ )
|
||||
remote_name=$(git rev-parse --abbrev-ref @{u} )
|
||||
|
||||
echo "Top repo local branch \"$local_name\" is not at same point as remote \"$remote_name\""
|
||||
echo "This update script will update the feeds.conf file and for that to work it needs to"
|
||||
echo "be up to date with the remote."
|
||||
echo ""
|
||||
echo "please run:"
|
||||
echo " git pull"
|
||||
echo " ./iop feeds_update"
|
||||
echo ""
|
||||
echo "do not forget the bootstrap. but do not run make it can delete your package in build"
|
||||
exit 0
|
||||
}
|
||||
|
||||
usage(){
|
||||
echo -e "$0 [flags]"
|
||||
echo -e "flags:"
|
||||
echo -e " -f\tFeed to update"
|
||||
echo -e " -h\tShow this help"
|
||||
echo -e " -u\tUpdate package version\n"
|
||||
}
|
||||
|
||||
# Exported interface
|
||||
function update_package {
|
||||
|
||||
UPDATE=0
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
# Regular Colors
|
||||
Black='\033[0;30m' # Black
|
||||
Red='\033[0;31m' # Red
|
||||
Green='\033[0;32m' # Green
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
Blue='\033[0;34m' # Blue
|
||||
Purple='\033[0;35m' # Purple
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "f:hu" opt; do
|
||||
case $opt in
|
||||
f)
|
||||
feed=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$EDITOR" ]
|
||||
then
|
||||
if [ -f /usr/bin/vi ]; then
|
||||
EDITOR=vi
|
||||
else
|
||||
echo "env variable EDITOR needs to be set"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# allow subshells to abort the whole program by exiting with "exit 99"
|
||||
set -E
|
||||
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
||||
|
||||
is_local_and_remote_same
|
||||
[ -n "$feed" ] || check_packages
|
||||
check_feeds $feed
|
||||
}
|
||||
|
||||
register_command "update_package" "Publish changes to packages and feeds"
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=iopsys-analytics
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=88dd7997ed78b1ab02c2904ed90518c46a8fa26b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopsys-analytics.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Analytics tweaks for IOPSYS CI/CD purposes
|
||||
|
||||
# setting core dump limit
|
||||
DEPENDS+= \
|
||||
+prlimit \
|
||||
# monitoring
|
||||
DEPENDS+= \
|
||||
+collectd \
|
||||
+collectd-mod-cpu \
|
||||
+collectd-mod-exec \
|
||||
+collectd-mod-load \
|
||||
+collectd-mod-memory \
|
||||
+collectd-mod-network \
|
||||
+collectd-mod-processes \
|
||||
+collectd-mod-write-http \
|
||||
+@PACKAGE_COLLECTD_ENCRYPTED_NETWORK \
|
||||
# remote syslog
|
||||
DEPENDS+= \
|
||||
+syslog-ng \
|
||||
+@SYSLOGNG_LOGROTATE \
|
||||
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Analytics tweaks for IOPSYS internal CI/CD purposes
|
||||
e.g. syslog, system health, coredumps...
|
||||
endef
|
||||
|
||||
Build/Compile=
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(CP) -r $(PKG_BUILD_DIR)/files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -10,7 +10,7 @@ PKG_VERSION:=7.4.3
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ba80dcc51056772c906cac8022a2537b74959e6a
|
||||
PKG_SOURCE_VERSION:=0f16f1bd7d995427f0c4601b4e1e595224321df2
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -28,12 +28,6 @@ TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/libeasy/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall"
|
||||
|
||||
@@ -62,7 +56,6 @@ define Build/InstallDev/libeasy
|
||||
$(CP) $(PKG_BUILD_DIR)/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/hlist.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/timestamp.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libethernet
|
||||
PKG_VERSION:=7.2.107
|
||||
PKG_VERSION:=7.2.112.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9c0e9ecd62b79d4e89b4f013f04124870d237395
|
||||
PKG_SOURCE_VERSION:=938752e3bd4c524aa518fc247d186ebdf282e1c0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.0.13
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=68f0b4f3edecea9b8f05e72b6bbf3952d3946b7c
|
||||
PKG_SOURCE_VERSION:=c22f9b2e5348c3e4c99840314f68f35b379a3549
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
21
libvoice-airoha/files/etc/uci-defaults/99-asterisk
Executable file
21
libvoice-airoha/files/etc/uci-defaults/99-asterisk
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
hasVoice=$(db -q get hw.board.hasVoice)
|
||||
|
||||
[ "$hasVoice" = "1" ] || { rm -f "/etc/config/asterisk"; return; }
|
||||
|
||||
source /lib/voice/config_asterisk.sh
|
||||
|
||||
default_asterisk_config
|
||||
|
||||
SLIC=`cat /proc/device-tree/airoha-voice/slic-type`
|
||||
[ "${SLIC#pef}" != "${SLIC}" ] || return
|
||||
|
||||
echo Configure TxGain and RxGain for MXL SLIC $SLIC
|
||||
|
||||
ports=$(db -q get hw.board.VoicePorts)
|
||||
for p in $(seq 0 $((ports-1))); do
|
||||
uci set asterisk.extension${p}.txgain='10'
|
||||
uci set asterisk.extension${p}.rxgain='-15'
|
||||
done
|
||||
uci commit asterisk
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=3a8d0954ca351a1f8f669dc2f3d294409b90f091
|
||||
PKG_SOURCE_VERSION:=99ed0ea5ef83cebb444d135909573ccb2b37fe45
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
10
libvoice-broadcom/files/etc/uci-defaults/99-asterisk
Executable file
10
libvoice-broadcom/files/etc/uci-defaults/99-asterisk
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
hasVoice=$(db -q get hw.board.hasVoice)
|
||||
|
||||
[ "$hasVoice" = "1" ] || { rm -f "/etc/config/asterisk"; return; }
|
||||
|
||||
source /lib/voice/config_asterisk.sh
|
||||
|
||||
default_asterisk_config
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.4
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=17388c54e14d8505254c0640067cf697760310ee
|
||||
PKG_SOURCE_VERSION:=e6d689334000bc57498d9a3f203a8933160e1ef4
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.4.42
|
||||
PKG_VERSION:=7.4.16.18
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c3efa4ecd3bbf8247bc1b4c3e0ff512e42649531
|
||||
PKG_SOURCE_VERSION:=b8adef24b294279bf07c0f9d00813b51fae7107f
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -76,6 +76,10 @@ ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
|
||||
TARGET_CFLAGS +=-DLIBWIFI_USE_CTRL_IFACE
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBWIFI_SKIP_PROBES),y)
|
||||
TARGET_CFLAGS +=-DLIBWIFI_BRCM_SKIP_PROBES
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
@@ -143,7 +147,12 @@ define Package/libwifi/config
|
||||
|
||||
config LIBWIFI_USE_CTRL_IFACE
|
||||
bool "Create UNIX sockets to interface with hostapd/wpa_supplicant"
|
||||
default n
|
||||
|
||||
config LIBWIFI_SKIP_PROBES
|
||||
bool "Don't create probe-req events"
|
||||
default y
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
@@ -55,5 +55,8 @@ config AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST
|
||||
config AGENT_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
config DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER
|
||||
bool "Let dynbhd through AP-Autoconfiguration Search and DHCP Discovery determine the controller or agent role"
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.5.1.15.1
|
||||
PKG_VERSION:=4.5.0.34
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=e0538bb1eb0b85ac085e6abb61ebbf8e1712f1e7
|
||||
PKG_SOURCE_VERSION:=8a73986f67c717961dc62cf11c8b0458ab04cc05
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -28,7 +28,7 @@ define Package/map-agent
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+ieee1905-map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
|
||||
+map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
|
||||
@@ -40,7 +40,7 @@ define Package/dynbhd
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dynamic Backhaul Daemon
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+ieee1905-map-plugin +map-agent
|
||||
+map-plugin +map-agent
|
||||
endef
|
||||
|
||||
|
||||
@@ -105,6 +105,10 @@ ifeq ($(CONFIG_AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST),y)
|
||||
TARGET_CFLAGS += -DOPER_CHAN_CHANGE_RELAY_MCAST
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER),y)
|
||||
TARGET_CFLAGS += -DPERSIST_CONTROLLER
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
config agent 'agent'
|
||||
option enabled '0'
|
||||
option enabled '1'
|
||||
option debug '0'
|
||||
option profile '3'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
option island_prevention '1'
|
||||
option eth_onboards_wifi_bhs '1'
|
||||
option scan_on_boot_only '0'
|
||||
option chan_ch_relay_mcast '0'
|
||||
option chan_ch_relay_mcast '1'
|
||||
option guest_isolation '1'
|
||||
option dyn_cntlr_sync '0'
|
||||
list map_port 'all'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/network/utils.sh
|
||||
|
||||
conn_ports_file="/var/run/multiap/map.connected.ports"
|
||||
map_bh_file="/var/run/multiap/multiap.backhaul"
|
||||
|
||||
# Exit if AL Bridge is not configured to be a bridge device
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
[ "${al_bridge:0:3}" = "br-" ] || exit 0
|
||||
al_brnet="${al_bridge:3}"
|
||||
|
||||
# Exit if the PORT is not member of the AL Bridge
|
||||
[ "$(get_network_of $PORT)" = "$al_brnet" ] || exit 0
|
||||
port_bridge_sec="$(uci show network | grep -w $PORT | grep '\.ports' | cut -d'.' -f2)"
|
||||
port_bridge_name="$(uci -q get network.$port_bridge_sec.name)"
|
||||
[ "$port_bridge_name" = "$al_bridge" ] || exit 0
|
||||
|
||||
# Exit if the device is not operating in extender/repeater mode
|
||||
al_brnet="${al_bridge:3}"
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
############## Dynamic Backhaul Daemon ##############
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
generate_mapagent_config=0
|
||||
generate_wireless_sta_config=0
|
||||
|
||||
network_mode="$(fw_printenv -n netmode)"
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)"
|
||||
network_mode="$(fw_printenv -n netmode)" # default is layer3
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)" # default is full
|
||||
|
||||
is_airoha() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
@@ -181,20 +181,19 @@ map_genconf () {
|
||||
elif [ "$multiap_mode" == "auto" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=0
|
||||
elif [ "$multiap_mode" == "full" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=1
|
||||
elif [ "$multiap_mode" == "none" ]; then
|
||||
uci set mapagent.agent.enabled="0"
|
||||
else # default to full
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=1
|
||||
fi
|
||||
uci -q commit mapagent
|
||||
fi
|
||||
|
||||
|
||||
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
|
||||
uci set mapcontroller.controller.enabled="0"
|
||||
else
|
||||
uci set mapcontroller.controller.enabled="1"
|
||||
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
|
||||
uci set mapcontroller.controller.enabled="0"
|
||||
else
|
||||
uci set mapcontroller.controller.enabled="1"
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
config CONTROLLER_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
config CONTROLLER_PROPAGATE_PROBE_REQ
|
||||
depends on CONTROLLER_EASYMESH_VENDOR_EXT
|
||||
bool "Enable publishing probe requests vendor specific messages as UBUS events"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.6.0.5.2
|
||||
PKG_VERSION:=4.5.0.23
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=27b2dabe45811909122a90e185bab3860a340084
|
||||
PKG_SOURCE_VERSION:=ea159dee9536889171fe6f2463c2259ac48c4a97
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -27,7 +27,7 @@ define Package/map-controller
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +ieee1905-map-plugin \
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin \
|
||||
+CONTROLLER_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
@@ -63,6 +63,10 @@ TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_CONTROLLER_EASYMESH_VENDOR_E
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_PROPAGATE_PROBE_REQ),y)
|
||||
TARGET_CFLAGS += -DPROPAGATE_PROBE_REQ
|
||||
endif
|
||||
|
||||
define Package/map-controller/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/* $(1)/
|
||||
|
||||
@@ -39,7 +39,6 @@ config_snooping_upstream_interface() {
|
||||
local snooping_upstream_intf=""
|
||||
|
||||
json_load "$(devstatus $1)"
|
||||
logger -t "mcastconf" "$(devstatus $1)"
|
||||
itr=1
|
||||
json_select bridge-members
|
||||
|
||||
@@ -49,7 +48,7 @@ config_snooping_upstream_interface() {
|
||||
*.*)
|
||||
port="$(echo "$dev" | cut -d'.' -f 1)"
|
||||
if [ $port == $ethwan ]; then
|
||||
ifconfig $dev | grep RUNNING >/dev/null && $snooping_upstream_intf="$dev" && break
|
||||
ifconfig $dev | grep RUNNING >/dev/null && snooping_upstream_intf="$dev" && break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -91,7 +91,7 @@ interfaces_ok(){
|
||||
for itf in $up_interf; do
|
||||
# check if there exist a interface section for this upstream interface, if yes the
|
||||
# do nothing, if no then generate config as mcast config is outdated
|
||||
local dev_section=$(uci show network | grep -E "\.device=\'$itf\'" | cut -d'.' -f2)
|
||||
local dev_section=$(uci show network | grep -E "\.device=\'$itf\'" | head -n 1 | cut -d'.' -f2)
|
||||
|
||||
# mcast config is outdated, simply generate as per new logic
|
||||
if [ -z "$dev_section" ]; then
|
||||
|
||||
@@ -62,7 +62,7 @@ read_snooping() {
|
||||
local proto
|
||||
|
||||
config_get sec_enable "$config" enable 0
|
||||
config_get proto "$config" proto
|
||||
config_get proto "$config" proto "igmp"
|
||||
|
||||
if [ "$sec_enable" == "0" ]; then
|
||||
return
|
||||
@@ -103,7 +103,7 @@ read_proxy() {
|
||||
local proto
|
||||
|
||||
config_get sec_enable "$config" enable 0
|
||||
config_get proto "$config" proto
|
||||
config_get proto "$config" proto "igmp"
|
||||
|
||||
if [ "$sec_enable" == "0" ]; then
|
||||
return
|
||||
|
||||
@@ -46,9 +46,6 @@ device_has_ip() {
|
||||
# Read the openwrt interface for the device.
|
||||
# Device can have multiple logical interfaces like wan and wan6
|
||||
# but same l3 device
|
||||
# NB. Don't use 'get_network_of' here.
|
||||
# This function fails in some uci configurations for interfaces that refer
|
||||
# to a device indirectly.
|
||||
local ifaces=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.device='$device'].interface")
|
||||
for iface in $ifaces; do
|
||||
local ip=
|
||||
@@ -88,9 +85,8 @@ config_mcproxy_interfaces() {
|
||||
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
|
||||
local filter=""
|
||||
for excp in $exceptions; do
|
||||
local filter=""
|
||||
|
||||
case $excp in
|
||||
*/*)
|
||||
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
|
||||
@@ -101,16 +97,16 @@ config_mcproxy_interfaces() {
|
||||
filter="$filter ($excp | *)"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for upstream in $str_up; do
|
||||
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
for upstream in $str_up; do
|
||||
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
|
||||
for downstream in $str_down; do
|
||||
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
for downstream in $str_down; do
|
||||
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
}
|
||||
|
||||
@@ -120,6 +116,7 @@ config_sysfs_mcast_snooping() {
|
||||
|
||||
for downstream in $downstreams; do
|
||||
if device_is_bridge "$downstream"; then
|
||||
echo 0 > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
echo $snooping > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
fi
|
||||
done
|
||||
@@ -264,10 +261,6 @@ config_mcproxy_instance() {
|
||||
downstreams=$igmp_p_down_interfaces
|
||||
mcast_mode=$igmp_p_mode
|
||||
|
||||
# mcproxy reserves two multicast subscriptions for igmp router service groups
|
||||
local mg=$(cat /proc/sys/net/ipv4/igmp_max_memberships)
|
||||
mg=$((mg+2))
|
||||
echo $mg > /proc/sys/net/ipv4/igmp_max_memberships
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
case "$version" in
|
||||
[1-2])
|
||||
|
||||
@@ -98,6 +98,10 @@ l2_network_config() {
|
||||
# Update CWMP Agent WAN Interface
|
||||
uci -q set cwmp.cpe.default_wan_interface="lan"
|
||||
uci -q commit cwmp
|
||||
|
||||
# disable firewall
|
||||
uci -q set firewall.globals.enabled="0"
|
||||
uci -q commit firewall
|
||||
}
|
||||
|
||||
network_mode="$(fw_printenv -n netmode 2>/dev/null)"
|
||||
|
||||
@@ -22,6 +22,11 @@ config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
select OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL
|
||||
bool "Adds a test controller by default (local access only)"
|
||||
default n
|
||||
|
||||
config OBUSPA_MAX_CONTROLLERS_NUM
|
||||
int "The maximum number of controllers to be supported"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.5.16
|
||||
PKG_VERSION:=7.0.5.6.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=8249b1e9ae996ed45ec5edcd1adc128bd810a45b
|
||||
PKG_SOURCE_VERSION:=131e04ec5c6ddd8c2fb47f95fe7da2b9836ed925
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -32,7 +32,9 @@ define Package/obuspa
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl +ca-certificates \
|
||||
+OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-ssl +OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL:mosquitto-client-ssl \
|
||||
+OBUSPA_ENABLE_TEST_CONTROLLER:mosquitto-auth-shadow
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -104,12 +106,14 @@ define Package/obuspa/install
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/00-obuspa-extender-mode $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/USPAgent.json)
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/54-test-usp-remote $(1)/etc/uci-defaults/
|
||||
endif
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER_LOCAL),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||
endif
|
||||
|
||||
@@ -2,12 +2,13 @@ config obuspa 'global'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option dhcp_discovery '1'
|
||||
option log_level '1'
|
||||
option log_level '2'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
option trust_cert '/etc/ssl/cert.pem'
|
||||
#option trust_cert '/etc/ssl/cert.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
option max_cache_time '120'
|
||||
|
||||
|
||||
@@ -217,12 +217,10 @@ validate_controller_section()
|
||||
'Enable:bool:1' \
|
||||
'EndpointID:string' \
|
||||
'assigned_role_name:string' \
|
||||
'AssignedRole:string' \
|
||||
'Protocol:or("STOMP","CoAP","MQTT", "WebSocket")' \
|
||||
'Destination:string' \
|
||||
'Topic:string' \
|
||||
'ParameterName:list(string)' \
|
||||
'Reference:string' \
|
||||
'mqtt:string' \
|
||||
'stomp:string' \
|
||||
'Host:string' \
|
||||
@@ -230,7 +228,7 @@ validate_controller_section()
|
||||
'Path:string' \
|
||||
'EnableEncryption:bool' \
|
||||
'PeriodicNotifInterval:uinteger' \
|
||||
'SessionMode:string:Allow' \
|
||||
'SessionMode:string' \
|
||||
'ProvisioningCode:string'
|
||||
}
|
||||
|
||||
@@ -255,7 +253,6 @@ validate_mtp_section()
|
||||
'Path:string' \
|
||||
'mqtt:string' \
|
||||
'stomp:string' \
|
||||
'Reference:string' \
|
||||
'PublishQoS:uinteger' \
|
||||
'EnableEncryption:bool'
|
||||
}
|
||||
@@ -324,7 +321,7 @@ configure_controller()
|
||||
local EndpointID Enable
|
||||
local Protocol Destination
|
||||
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName ProvisioningCode
|
||||
local Host Port Path EnableEncryption Reference SessionMode PeriodicNotifInterval
|
||||
local Host Port Path EnableEncryption PeriodicNotifInterval
|
||||
local dm_ref sec
|
||||
|
||||
sec="${1}"
|
||||
@@ -346,16 +343,12 @@ configure_controller()
|
||||
fi
|
||||
|
||||
dm_ref=""
|
||||
if [ -z "${Reference}" ]; then
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
stomp="${stomp/stomp_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "${stomp}")
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
mqtt="${mqtt/mqtt_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.MQTT.Client." "${mqtt}")
|
||||
fi
|
||||
else
|
||||
dm_ref="${Reference}"
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
stomp="${stomp/stomp_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "${stomp}")
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
mqtt="${mqtt/mqtt_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.MQTT.Client." "${mqtt}")
|
||||
fi
|
||||
|
||||
db_set "${BASEPATH}.Alias" "${sec}"
|
||||
@@ -370,16 +363,15 @@ configure_controller()
|
||||
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
|
||||
fi
|
||||
|
||||
if [ -n "${SessionMode}" ]; then
|
||||
db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
|
||||
fi
|
||||
#if [ -n "${SessionMode}" ]; then
|
||||
# db_set "${BASEPATH}.E2ESession.SessionMode" "${SessionMode}"
|
||||
#fi
|
||||
|
||||
if [ -n "${assigned_role_name}" ]; then
|
||||
AssignedRole=$(get_role_index "${assigned_role_name}")
|
||||
fi
|
||||
|
||||
if [ -n "${AssignedRole}" ]; then
|
||||
db_set "${BASEPATH}.AssignedRole" "${AssignedRole}"
|
||||
if [ -n "${AssignedRole}" ]; then
|
||||
db_set "${BASEPATH}.AssignedRole" "${AssignedRole}"
|
||||
fi
|
||||
fi
|
||||
|
||||
db_set "${BASEPATH}.MTP.1.Alias" "${sec}"
|
||||
@@ -559,16 +551,12 @@ configure_mtp() {
|
||||
fi
|
||||
|
||||
dm_ref=""
|
||||
if [ -z "${Reference}" ]; then
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
stomp="${stomp/stomp_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "${stomp}")
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
mqtt="${mqtt/mqtt_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.MQTT.Client." "${mqtt}")
|
||||
fi
|
||||
else
|
||||
dm_ref="${Reference}"
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
stomp="${stomp/stomp_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.STOMP.Connection." "${stomp}")
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
mqtt="${mqtt/mqtt_/cpe-}"
|
||||
dm_ref=$(get_refrence_path "Device.MQTT.Client." "${mqtt}")
|
||||
fi
|
||||
|
||||
db_set "${BASEPATH}.Alias" "${sec}"
|
||||
@@ -776,8 +764,8 @@ sync_db_controller()
|
||||
{
|
||||
local cntrs copts sec pvalue protocol
|
||||
|
||||
copts="Enable EndpointID AssignedRole PeriodicNotifInterval"
|
||||
popts="Destination Topic Reference Host Port Path EnableEncryption"
|
||||
copts="Enable EndpointID PeriodicNotifInterval"
|
||||
popts="Destination Topic Host Port Path EnableEncryption"
|
||||
|
||||
cntrs="$(get_instances_from_db_dump Device.LocalAgent.Controller.)"
|
||||
for cntr in $cntrs; do
|
||||
@@ -809,8 +797,7 @@ sync_db_localagent_mtp()
|
||||
local mtps opts popts sec pvalue protocol
|
||||
|
||||
opts="Enable"
|
||||
popts="ResponseTopicConfigured Destination Port Path Reference EnableEncryption PublishQoS"
|
||||
ropts="mqtt stomp"
|
||||
popts="ResponseTopicConfigured Destination Port Path EnableEncryption PublishQoS"
|
||||
|
||||
mtps="$(get_instances_from_db_dump Device.LocalAgent.MTP.)"
|
||||
for inst in $mtps; do
|
||||
@@ -833,9 +820,6 @@ sync_db_localagent_mtp()
|
||||
pvalue="$(get_param_value_from_dump "${inst}"."${protocol}"."${param}")"
|
||||
uci_set obuspa "${sec}" "${param}" "${pvalue}"
|
||||
done
|
||||
for param in ${ropts}; do
|
||||
uci_set obuspa "${sec}" "${param}" ""
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
@@ -1002,6 +986,9 @@ db_init()
|
||||
reverse_update_db_with_uci
|
||||
fi
|
||||
|
||||
# Remove ControllerTrust.Role., if present in db for backward compatibility
|
||||
delete_sql_db_entry_with_pattern "^Device.LocalAgent.ControllerTrust.Role."
|
||||
|
||||
# Remove reset file if present
|
||||
[ -f "${RESET_FILE}" ] && mv ${RESET_FILE} ${RESET_FILE}.old
|
||||
|
||||
@@ -1034,11 +1021,17 @@ db_init()
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
local enabled role_file
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 0
|
||||
config_get role_file global role_file ""
|
||||
# Use the default role file if not defined in uci, but present in path
|
||||
if [ -z "${role_file}" ] && [ -f "/etc/obuspa/roles.json" ] ; then
|
||||
uci -q set obuspa.global.role_file="/etc/obuspa/roles.json"
|
||||
uci_commit obuspa
|
||||
fi
|
||||
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"dmcaching_exclude": [
|
||||
"Device.Hosts.Host.",
|
||||
"Device.IEEE1905.",
|
||||
"Device.WiFi.DataElements."
|
||||
"Device.Services.VoiceService."
|
||||
]
|
||||
}
|
||||
|
||||
@@ -260,6 +260,40 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Schedules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.{BBF_VENDOR_PREFIX}ParentalControl.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
@@ -584,6 +618,40 @@
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Schedules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.{BBF_VENDOR_PREFIX}ParentalControl.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
@@ -598,12 +666,29 @@
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.AccessControl.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
@@ -614,6 +699,15 @@
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_load obuspa
|
||||
config_get interface global interface ""
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" -a -z "$interface" ] ; then
|
||||
uci_set obuspa global interface "lan"
|
||||
fi
|
||||
fi
|
||||
20
obuspa/files/etc/uci-defaults/54-test-usp-remote
Normal file
20
obuspa/files/etc/uci-defaults/54-test-usp-remote
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ ! -f "/etc/config/mosquitto" ]; then
|
||||
echo "Local mosquitto broker not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
add_usp_test()
|
||||
{
|
||||
uci_add mosquitto listener usptest
|
||||
uci_set mosquitto usptest enabled 1
|
||||
uci_set mosquitto usptest port '9001'
|
||||
uci_set mosquitto usptest protocol 'websockets'
|
||||
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
# Install test MQTT over WS listener
|
||||
add_usp_test
|
||||
@@ -40,16 +40,6 @@ add_obuspa_test_controller()
|
||||
uci_set obuspa testcontroller assigned_role_name 'full_access'
|
||||
}
|
||||
|
||||
add_usp_test()
|
||||
{
|
||||
uci_add mosquitto listener usptest
|
||||
uci_set mosquitto usptest enabled 1
|
||||
uci_set mosquitto usptest port '9001'
|
||||
uci_set mosquitto usptest protocol 'websockets'
|
||||
uci_set mosquitto usptest require_certificates '0'
|
||||
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
add_obuspa_config()
|
||||
{
|
||||
uci_add mosquitto listener obuspa
|
||||
@@ -60,11 +50,8 @@ add_obuspa_config()
|
||||
}
|
||||
|
||||
# Install test usp controller config
|
||||
uci_load mosquitto
|
||||
add_usp_test
|
||||
add_obuspa_config
|
||||
|
||||
uci_load obuspa
|
||||
add_obuspa_test_mtp
|
||||
add_obuspa_test_mqtt
|
||||
add_obuspa_test_controller
|
||||
|
||||
@@ -129,15 +129,15 @@ get_vivsoi() {
|
||||
done
|
||||
}
|
||||
|
||||
get_netmode()
|
||||
get_access_role()
|
||||
{
|
||||
local mode
|
||||
local mode lan_proto
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
fi
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
|
||||
if [ "$mode" != "extender" ]; then
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
mode="extender"
|
||||
else
|
||||
mode="full_access"
|
||||
fi
|
||||
|
||||
@@ -146,13 +146,25 @@ get_netmode()
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
config_get wan_intf global interface "wan"
|
||||
config_get wan_intf global interface
|
||||
config_get_bool dhcp_discovery global dhcp_discovery 1
|
||||
|
||||
if [ "$enable_obuspa" = "0" ] || [ "$dhcp_discovery" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${wan_intf}" ]; then
|
||||
role="$(get_access_role)"
|
||||
|
||||
if [ "${role}" = "extender" ]; then
|
||||
wan_intf="lan"
|
||||
uci -q set obuspa.global.interface="lan"
|
||||
uci commit obuspa
|
||||
else
|
||||
wan_intf="wan"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt125" ]; then
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
@@ -231,7 +243,7 @@ if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_netmode)"
|
||||
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_access_role)"
|
||||
uci -q set obuspa.dhcpcontroller.Enable='1'
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
+**************************************************************************/
|
||||
+void SetControllerDummyID()
|
||||
+{
|
||||
+ cur_msg_controller_info.endpoint_id = "";
|
||||
+ cur_msg_controller_info.endpoint_id = "CLI_Utility";
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
|
||||
95
obuspa/patches/0012-check_mqtt_host_alive.patch
Normal file
95
obuspa/patches/0012-check_mqtt_host_alive.patch
Normal file
@@ -0,0 +1,95 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 04a1a9c..00b95a4 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -2124,6 +2124,75 @@ exit:
|
||||
}
|
||||
}
|
||||
|
||||
+static int _check_host_rechability(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
|
||||
+{
|
||||
+ bool *palive = (bool *)userp;
|
||||
+
|
||||
+ USP_ASSERT(palive != NULL);
|
||||
+ switch(type) {
|
||||
+ case CURLINFO_HEADER_OUT:
|
||||
+ case CURLINFO_HEADER_IN:
|
||||
+ *palive = true;
|
||||
+ break;
|
||||
+ case CURLINFO_TEXT:
|
||||
+ {
|
||||
+ USP_LOG_Debug("CURL DATA:: [%s]", data);
|
||||
+ if (strstr(data, "Connected to ") != NULL) {
|
||||
+ *palive = true;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int check_mqtt_host_reachability(mqtt_client_t *client)
|
||||
+{
|
||||
+ CURL *curl;
|
||||
+ mqtt_conn_params_t *cparam = &client->conn_params;
|
||||
+ char buffer[128] = {0};
|
||||
+ int ret = USP_ERR_INTERNAL_ERROR;
|
||||
+ bool is_alive = false;
|
||||
+
|
||||
+ curl = curl_easy_init();
|
||||
+ if(curl) {
|
||||
+ USP_SNPRINTF(buffer, 128, "mqtt://%s:%d", cparam->host, cparam->port);
|
||||
+ curl_easy_setopt(curl, CURLOPT_URL, buffer);
|
||||
+
|
||||
+ if (strlen(cparam->username) > 0) {
|
||||
+ curl_easy_setopt(curl, CURLOPT_USERNAME, cparam->username);
|
||||
+ }
|
||||
+
|
||||
+ if (strlen(cparam->password) > 0) {
|
||||
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, cparam->password);
|
||||
+ }
|
||||
+
|
||||
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||
+ curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &is_alive);
|
||||
+ curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, _check_host_rechability);
|
||||
+
|
||||
+ /* complete within 2 seconds */
|
||||
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, 2L);
|
||||
+
|
||||
+ ret = curl_easy_perform(curl);
|
||||
+ /* Check for errors */
|
||||
+ if(ret == CURLE_OK || ret == CURLE_URL_MALFORMAT || is_alive == true) {
|
||||
+ USP_LOG_Debug("CURL MQTT host %s, ret %d, alive %d ...", buffer, ret, is_alive);
|
||||
+ ret = USP_ERR_OK;
|
||||
+ } else {
|
||||
+ USP_LOG_Info("# CURL MQTT host %s unreachable: %d=>%s ...", buffer, ret, curl_easy_strerror(ret));
|
||||
+ }
|
||||
+
|
||||
+ /* always cleanup */
|
||||
+ curl_easy_cleanup(curl);
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** PerformMqttClientConnect
|
||||
@@ -2193,6 +2262,14 @@ int PerformMqttClientConnect(mqtt_client_t *client)
|
||||
keep_alive = 5;
|
||||
}
|
||||
|
||||
+ // Below function is a workaround to check the host reachability with a timeout
|
||||
+ // mosquitto_connect_* API block the thread for 2 mins if host is not reachable,
|
||||
+ // which halts other clients connectivity
|
||||
+ err = check_mqtt_host_reachability(client);
|
||||
+ if (err != USP_ERR_OK) {
|
||||
+ err = USP_ERR_INTERNAL_ERROR;
|
||||
+ goto exit;
|
||||
+ }
|
||||
// Release the access mutex temporarily whilst performing the connect call
|
||||
// We do this to prevent the data model thread from potentially being blocked, whilst the connect call is taking place
|
||||
OS_UTILS_UnlockMutex(&mqtt_access_mutex);
|
||||
76
obuspa/patches/0013-mqtt-retry-param-change.patch
Normal file
76
obuspa/patches/0013-mqtt-retry-param-change.patch
Normal file
@@ -0,0 +1,76 @@
|
||||
diff --git a/src/core/device_mqtt.c b/src/core/device_mqtt.c
|
||||
index 7b3c3df7eb..7beb78ef86 100755
|
||||
--- a/src/core/device_mqtt.c
|
||||
+++ b/src/core/device_mqtt.c
|
||||
@@ -1602,14 +1602,23 @@ int Validate_MQTTConnectRetryTime(dm_req_t *req, char *value)
|
||||
int NotifyChange_MQTTConnectRetryTime(dm_req_t *req, char *value)
|
||||
{
|
||||
mqtt_conn_params_t *mp;
|
||||
+ bool schedule_reconnect = false;
|
||||
|
||||
// Determine mqtt client to be updated
|
||||
mp = FindMqttParamsByInstance(inst1);
|
||||
USP_ASSERT(mp != NULL);
|
||||
|
||||
// Set the new value.
|
||||
+ if ((mp->retry.connect_retrytime != val_uint) && (mp->enable)) {
|
||||
+ schedule_reconnect = true;
|
||||
+ }
|
||||
+
|
||||
mp->retry.connect_retrytime = val_uint;
|
||||
|
||||
+ if (schedule_reconnect) {
|
||||
+ ScheduleMqttReconnect(mp);
|
||||
+ }
|
||||
+
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -1645,14 +1654,23 @@ int Validate_MQTTConnectRetryIntervalMultiplier(dm_req_t *req, char *value)
|
||||
int NotifyChange_MQTTConnectRetryIntervalMultiplier(dm_req_t *req, char *value)
|
||||
{
|
||||
mqtt_conn_params_t *mp;
|
||||
+ bool schedule_reconnect = false;
|
||||
|
||||
// Determine mqtt client to be updated
|
||||
mp = FindMqttParamsByInstance(inst1);
|
||||
USP_ASSERT(mp != NULL);
|
||||
|
||||
+ if ((mp->retry.interval_multiplier != val_int) && (mp->enable)) {
|
||||
+ schedule_reconnect = true;
|
||||
+ }
|
||||
+
|
||||
// Set the new value.
|
||||
mp->retry.interval_multiplier = val_int;
|
||||
|
||||
+ if (schedule_reconnect) {
|
||||
+ ScheduleMqttReconnect(mp);
|
||||
+ }
|
||||
+
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -1688,14 +1706,23 @@ int Validate_MQTTConnectRetryMaxInterval(dm_req_t *req, char *value)
|
||||
int NotifyChange_MQTTConnectRetryMaxInterval(dm_req_t *req, char *value)
|
||||
{
|
||||
mqtt_conn_params_t *mp;
|
||||
+ bool schedule_reconnect = false;
|
||||
|
||||
// Determine mqtt client to be updated
|
||||
mp = FindMqttParamsByInstance(inst1);
|
||||
USP_ASSERT(mp != NULL);
|
||||
|
||||
+ if ((mp->retry.max_interval != val_uint) && (mp->enable)) {
|
||||
+ schedule_reconnect = true;
|
||||
+ }
|
||||
+
|
||||
// Set the new value.
|
||||
mp->retry.max_interval = val_uint;
|
||||
|
||||
+ if (schedule_reconnect) {
|
||||
+ ScheduleMqttReconnect(mp);
|
||||
+ }
|
||||
+
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
90
obuspa/patches/0014-mqtt-reconnect.patch
Normal file
90
obuspa/patches/0014-mqtt-reconnect.patch
Normal file
@@ -0,0 +1,90 @@
|
||||
diff --git a/src/core/device_controller.c b/src/core/device_controller.c
|
||||
index a6335f5..57b8486 100644
|
||||
--- a/src/core/device_controller.c
|
||||
+++ b/src/core/device_controller.c
|
||||
@@ -2340,6 +2340,26 @@ int Notify_ControllerEnable(dm_req_t *req, char *value)
|
||||
}
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
+#ifdef ENABLE_MQTT
|
||||
+{
|
||||
+ // Reconnect MQTT client since it may need to update MQTT reference and Topic
|
||||
+ if (cont->enable)
|
||||
+ {
|
||||
+ int i;
|
||||
+ for (i=0; i<MAX_CONTROLLER_MTPS; i++)
|
||||
+ {
|
||||
+ controller_mtp_t *mtp;
|
||||
+
|
||||
+ mtp = &cont->mtps[i];
|
||||
+ if ((mtp->protocol == kMtpProtocol_MQTT) && (mtp->mqtt_connection_instance != INVALID) && (mtp->enable))
|
||||
+ {
|
||||
+ DEVICE_MQTT_ScheduleReconnect(mtp->mqtt_connection_instance);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
#endif
|
||||
|
||||
return USP_ERR_OK;
|
||||
@@ -2468,6 +2488,17 @@ int Notify_ControllerMtpEnable(dm_req_t *req, char *value)
|
||||
}
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
+#ifdef ENABLE_MQTT
|
||||
+{
|
||||
+ // Reconnect MQTT client since it may need to update MQTT reference and Topic
|
||||
+ if ((mtp->protocol == kMtpProtocol_MQTT) && (mtp->enable) && (cont->enable) &&
|
||||
+ (mtp->mqtt_connection_instance != INVALID))
|
||||
+ {
|
||||
+ DEVICE_MQTT_ScheduleReconnect(mtp->mqtt_connection_instance);
|
||||
+ }
|
||||
+}
|
||||
#endif
|
||||
|
||||
// NOTE: We do not have to do anything for STOMP, as these parameters are only searched when we send
|
||||
@@ -2559,6 +2590,16 @@ int Notify_ControllerMtpProtocol(dm_req_t *req, char *value)
|
||||
WSCLIENT_StartClient(cont->instance, mtp->instance, cont->endpoint_id, &mtp->websock);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
+#ifdef ENABLE_MQTT
|
||||
+{
|
||||
+ // Reconnect MQTT client since it may need to update MQTT reference and Topic
|
||||
+ if ((mtp->protocol == kMtpProtocol_MQTT) && (mtp->mqtt_connection_instance != INVALID))
|
||||
+ {
|
||||
+ DEVICE_MQTT_ScheduleReconnect(mtp->mqtt_connection_instance);
|
||||
+ }
|
||||
+}
|
||||
#endif
|
||||
|
||||
// NOTE: We don't need to do anything explicitly for STOMP
|
||||
diff --git a/src/core/device_mtp.c b/src/core/device_mtp.c
|
||||
index e78a305..d690978 100644
|
||||
--- a/src/core/device_mtp.c
|
||||
+++ b/src/core/device_mtp.c
|
||||
@@ -964,6 +964,9 @@ int NotifyChange_AgentMtpProtocol(dm_req_t *req, char *value)
|
||||
}
|
||||
#endif
|
||||
|
||||
+ // Cache the changed value
|
||||
+ mtp->protocol = new_protocol;
|
||||
+
|
||||
#ifdef ENABLE_MQTT
|
||||
// Schedule the affected MQTT connection to reconnect (because it might have lost or gained a agent queue to subscribe to)
|
||||
if ((mtp->enable) && (mtp->mqtt_connection_instance != INVALID))
|
||||
@@ -972,9 +975,6 @@ int NotifyChange_AgentMtpProtocol(dm_req_t *req, char *value)
|
||||
}
|
||||
#endif
|
||||
|
||||
- // Cache the changed value
|
||||
- mtp->protocol = new_protocol;
|
||||
-
|
||||
#ifndef DISABLE_STOMP
|
||||
// Schedule the affected STOMP connection to reconnect (because it might have lost or gained a agent queue to subscribe to)
|
||||
if ((mtp->enable) && (mtp->stomp_connection_instance != INVALID))
|
||||
9
periodicstats/Config.in
Normal file
9
periodicstats/Config.in
Normal file
@@ -0,0 +1,9 @@
|
||||
if PACKAGE_periodicstats
|
||||
config PERIODICSTAT_INTERNAL_SAMPLING_RATE
|
||||
int "Number of times statistics will be measured within a sample interval"
|
||||
range 3 10
|
||||
default 3
|
||||
depends on PACKAGE_periodicstats
|
||||
help
|
||||
This value must be in range of 3 to 10. (default 3)
|
||||
endif
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.5.3
|
||||
PKG_VERSION:=1.5.8.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/periodicstats.git
|
||||
PKG_SOURCE_VERSION:=28bea5be686013af0ba8e54cf4871f10015e4b06
|
||||
PKG_SOURCE_VERSION:=6bee158e3a4d56d573fb8f26fe06fe59b75138ca
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -32,6 +32,12 @@ define Package/periodicstats/description
|
||||
Manage periodic statistics
|
||||
endef
|
||||
|
||||
define Package/periodicstats/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -DINTERNAL_SAMPLING_RATE=$(CONFIG_PERIODICSTAT_INTERNAL_SAMPLING_RATE)
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/periodicstats/* $(PKG_BUILD_DIR)/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
config globals 'globals'
|
||||
option enable '0'
|
||||
option enable '1'
|
||||
option base_interval '5'
|
||||
|
||||
|
||||
@@ -17,16 +17,19 @@ start_service() {
|
||||
|
||||
bbfdm_add_service "bbfdm.periodicstats" "${PERIODICSTATS_JSON_INPUT}"
|
||||
|
||||
if [ "${enable}" -ne "1" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
procd_open_instance periodicstatsd
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
if [ "${enable}" -eq "1" ]; then
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
fi
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger periodicstats
|
||||
}
|
||||
|
||||
@@ -3,39 +3,34 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
set_serial_number() {
|
||||
vendor_id=$1
|
||||
vssn=$2
|
||||
local vendor_id="$1"
|
||||
local vssn="$2"
|
||||
|
||||
# Vendor id is not taken from serial automatically, propagate it as well
|
||||
/userfs/bin/omcicfgCmd set vendorId ${vendor_id}
|
||||
/userfs/bin/omcicfgCmd set sn ${vendor_id}${vssn}
|
||||
/userfs/bin/omcicfgCmd set vendorId "${vendor_id}"
|
||||
/userfs/bin/omcicfgCmd set sn "${vendor_id}${vssn}"
|
||||
}
|
||||
|
||||
set_equipment_id() {
|
||||
local eqid=$1
|
||||
local eq_id_default="KE2.119.241R2B"
|
||||
local eqid="$1"
|
||||
|
||||
if [ -z "$eqid" ]; then
|
||||
if [ -z "${eqid}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$eqid" = "$eq_id_default" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
/userfs/bin/omcicfgCmd set equipmentId ${eqid}
|
||||
/userfs/bin/omcicfgCmd set equipmentId "${eqid}"
|
||||
}
|
||||
|
||||
set_loid_authentication() {
|
||||
local loid=$1
|
||||
local loid_pwd=$2
|
||||
local loid="$1"
|
||||
local loid_pwd="$2"
|
||||
|
||||
[ -z "$loid" ] && return
|
||||
[ -z "${loid}" ] && return
|
||||
|
||||
/userfs/bin/omcicfgCmd set loid ${loid}
|
||||
/userfs/bin/omcicfgCmd set loid "${loid}"
|
||||
|
||||
if [ -n "$loid_pwd" ]; then
|
||||
/userfs/bin/omcicfgCmd set loid_password ${loid_pwd}
|
||||
if [ -n "${loid_pwd}" ]; then
|
||||
/userfs/bin/omcicfgCmd set loidPasswd "${loid_pwd}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -3,37 +3,39 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
set_serial_number() {
|
||||
vendor_id=$1
|
||||
vssn=$2
|
||||
local vendor_id="$1"
|
||||
local vssn="$2"
|
||||
|
||||
vendor_id="$(echo $vendor_id | hexdump -e '4/1 "%02X" "\n"')"
|
||||
vendor_id=${vendor_id:0:8}
|
||||
vendor_id="$(echo "${vendor_id}" | hexdump -e '4/1 "%02X" "\n"')"
|
||||
vendor_id="${vendor_id:0:8}"
|
||||
|
||||
bs /b/c gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vssn}
|
||||
}
|
||||
|
||||
set_equipment_id() {
|
||||
equipment_id=$1
|
||||
local equipment_id="$1"
|
||||
[ -z "$equipment_id" ] && return
|
||||
|
||||
json_add_string "equipment_id" $equipment_id
|
||||
json_add_string "equipment_id" "$equipment_id"
|
||||
}
|
||||
|
||||
set_loid_authentication() {
|
||||
loid=$1
|
||||
loid_password=$2
|
||||
local loid="$1"
|
||||
local loid_password="$2"
|
||||
|
||||
[ -z "$loid" ] && return
|
||||
|
||||
json_add_string "loid" $loid
|
||||
json_add_string "loid_password" $loid_password
|
||||
json_add_string "loid" "$loid"
|
||||
json_add_string "loid_password" "$loid_password"
|
||||
}
|
||||
|
||||
apply_xpon_uci_config() {
|
||||
local sn
|
||||
|
||||
json_init
|
||||
json_add_object 'ani'
|
||||
sn="$(uci -q get xpon.ani.serial_number)"
|
||||
json_add_string "serial_number" $sn
|
||||
json_add_string "serial_number" "$sn"
|
||||
configure_loid_authentication
|
||||
configure_equipment_id
|
||||
json_close_object
|
||||
|
||||
@@ -11,21 +11,21 @@ include /lib/xpon
|
||||
configure_serial_number() {
|
||||
# serial number generation is taken care in the uci defaults, so if
|
||||
# serial number is not found here its a misconfig
|
||||
serial_number="$(uci -q get xpon.ani.serial_number)"
|
||||
local serial_number="$(uci -q get xpon.ani.serial_number)"
|
||||
if [ ${#serial_number} -eq 12 ]; then
|
||||
vendor_id="${serial_number:0:4}"
|
||||
vssn="${serial_number:4:8}"
|
||||
local vendor_id="${serial_number:0:4}"
|
||||
local vssn="${serial_number:4:8}"
|
||||
else
|
||||
logger -s -t "xpon" "Serial number not found in uci, ont will probably not be registered at the olt"
|
||||
logger -s -t "xpon" "Please configure a valid serial number"
|
||||
logger -s -t "xpon" "Serial number not found in UCI, ONT will probably not be registered at the OLT."
|
||||
logger -s -t "xpon" "Please configure a valid serial number."
|
||||
return
|
||||
fi
|
||||
|
||||
set_serial_number $vendor_id $vssn
|
||||
set_serial_number "${vendor_id}" "${vssn}"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ "$(uci -q get xpon.ani.enable)" == "1" ]; then
|
||||
if [ "$(uci -q get xpon.ani.enable)" = "1" ]; then
|
||||
configure_serial_number
|
||||
apply_xpon_uci_config
|
||||
init_xpon
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
|
||||
configure_serial_number() {
|
||||
# check if serial number is present in the production data
|
||||
production_sn="$(fw_printenv -n gponsn)"
|
||||
local production_sn="$(fw_printenv -n gponsn)"
|
||||
if [ ${#production_sn} -eq 12 ]; then
|
||||
uci set xpon.ani.serial_number=$production_sn
|
||||
uci set xpon.ani.serial_number="${production_sn}"
|
||||
else
|
||||
macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
vendor_id="IOPS"
|
||||
vssn="${macaddr:4:8}"
|
||||
uci set xpon.ani.serial_number=$vendor_id$vssn
|
||||
local macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
local vendor_id="IOPS"
|
||||
local vssn="${macaddr:4:8}"
|
||||
|
||||
uci set xpon.ani.serial_number="${vendor_id}${vssn}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -18,37 +19,38 @@ configure_loid_authentication() {
|
||||
local production_loid
|
||||
local production_loidpwd
|
||||
|
||||
loid="$(uci -q get xpon.ani.loid)"
|
||||
loidpwd="$(uci -q get xpon.ani.loid_password)"
|
||||
if [ -z $loid ]; then
|
||||
local loid="$(uci -q get xpon.ani.loid)"
|
||||
local loidpwd="$(uci -q get xpon.ani.loid_password)"
|
||||
|
||||
if [ -z "${loid}" ]; then
|
||||
production_loid="$(fw_printenv -n gponloid)"
|
||||
fi
|
||||
if [ -z $loidpwd ]; then
|
||||
if [ -z "${loidpwd}" ]; then
|
||||
production_loidpwd="$(fw_printenv -n gponloid_password)"
|
||||
fi
|
||||
|
||||
if [ -n $production_loid ]; then
|
||||
uci set xpon.ani.loid=$production_loid
|
||||
if [ -n "${production_loid}" ]; then
|
||||
uci set xpon.ani.loid="${production_loid}"
|
||||
fi
|
||||
if [ -n $production_loidpwd ]; then
|
||||
uci set xpon.ani.loid_password=$production_loidpwd
|
||||
if [ -n "${production_loidpwd}" ]; then
|
||||
uci set xpon.ani.loid_password="${production_loidpwd}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/xpon" ]; then
|
||||
if uci -q get xpon.ani >/dev/null; then
|
||||
# generate serial number in case its not present and return
|
||||
serial_number="$(uci -q get xpon.ani.serial_number)"
|
||||
if [ ${#serial_number} -ne 12 ]; then
|
||||
if uci -q get xpon.ani >/dev/null; then
|
||||
# generate serial number in case its not present and return
|
||||
SERIAL_NUMBER="$(uci -q get xpon.ani.serial_number)"
|
||||
if [ ${#SERIAL_NUMBER} -ne 12 ]; then
|
||||
configure_serial_number
|
||||
fi
|
||||
configure_loid_authentication
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/xpon
|
||||
fi
|
||||
fi
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/xpon
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/xpon
|
||||
|
||||
uci set xpon.ani=ani
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
configure_equipment_id() {
|
||||
eqid="$(uci -q get xpon.ani.equipment_id)"
|
||||
set_equipment_id $eqid
|
||||
}
|
||||
|
||||
configure_loid_authentication() {
|
||||
loid="$(uci -q get xpon.ani.loid)"
|
||||
loid_pwd="$(uci -q get xpon.ani.loid_password)"
|
||||
set_loid_authentication $loid $loid_pwd
|
||||
configure_equipment_id() {
|
||||
local eqid="$(uci -q get xpon.ani.equipment_id)"
|
||||
|
||||
set_equipment_id "${eqid}"
|
||||
}
|
||||
|
||||
configure_loid_authentication() {
|
||||
local loid="$(uci -q get xpon.ani.loid)"
|
||||
local loid_pwd="$(uci -q get xpon.ani.loid_password)"
|
||||
|
||||
set_loid_authentication "${loid}" "${loid_pwd}"
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@ broute_rule_set_traffic_class() {
|
||||
fi
|
||||
}
|
||||
|
||||
broute_filter_on_dscp() {
|
||||
BR_RULE="$BR_RULE --ip-tos $1"
|
||||
}
|
||||
|
||||
broute_ipv4_rule_options()
|
||||
{
|
||||
local cid="$1"
|
||||
@@ -25,7 +29,12 @@ broute_ipv4_rule_options()
|
||||
set_ip_addr "$cid" ebt_match_src_ip ebt_match_dst_ip
|
||||
|
||||
if [ -n "$dscp_filter" ]; then
|
||||
echo "DSCP filter is not supporter"
|
||||
local tos_val
|
||||
local tos_hex
|
||||
|
||||
tos_val=$((dscp_filter<<2))
|
||||
tos_hex=$(printf "%x" $tos_val)
|
||||
broute_filter_on_dscp "$tos_hex"
|
||||
fi
|
||||
|
||||
if [ -n "$protocol" ]; then
|
||||
|
||||
@@ -15,6 +15,10 @@ include /lib/ethernet
|
||||
. /lib/qos/shaper.sh
|
||||
. /lib/qos/airoha.sh
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
# marking value be decimal for linux target as it uses set-mark whereas other
|
||||
# targets uses set-xmark, hence this function can't make it common
|
||||
ip_rule_get_converted_tos() {
|
||||
|
||||
@@ -34,6 +34,10 @@ get_port_number() {
|
||||
done
|
||||
}
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "0"
|
||||
}
|
||||
|
||||
# Function to handle a queue order and
|
||||
# update total number of queues
|
||||
handle_q_order() {
|
||||
|
||||
@@ -32,7 +32,7 @@ generate_queue(){
|
||||
uci set qos.@queue[-1].precedence="$order"
|
||||
uci set qos.@queue[-1].scheduling="SP"
|
||||
uci set qos.@queue[-1].rate="0"
|
||||
uci set qos.@queue[-1].burst_size="0"
|
||||
uci set qos.@queue[-1].burst_size=$(get_burst_size_per_queue)
|
||||
uci set qos.@queue[-1].weight="1"
|
||||
done
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@ Q_COUNT=0
|
||||
SP_Q_PRIO=7
|
||||
SOQ_wgt=0
|
||||
|
||||
get_burst_size_per_queue() {
|
||||
echo "1500"
|
||||
}
|
||||
|
||||
get_max_burst_size_per_queue() {
|
||||
# maximum burst size for tc class
|
||||
echo "4289999999"
|
||||
@@ -133,11 +137,10 @@ handle_queue() {
|
||||
config_get sc_alg "$qid" "scheduling"
|
||||
config_get wgt "$qid" "weight" 1
|
||||
config_get rate "$qid" "rate"
|
||||
config_get bs "$qid" "burst_size" 1500
|
||||
config_get bs "$qid" "burst_size"
|
||||
config_get qsize "$qid" "queue_size" 1024
|
||||
|
||||
[ "$rate" == "0" ] && rate="$port_bw"
|
||||
[ "$bs" == "0" ] && bs=1500
|
||||
|
||||
bs=$(( bs * 8 ))
|
||||
rate_bs=$(( rate * 25 ))
|
||||
@@ -217,12 +220,7 @@ ebt_match_ipv6_dscp() {
|
||||
}
|
||||
|
||||
broute_filter_on_dscp() {
|
||||
# The broadcom option --ip-dscp-extend actually accepts tos
|
||||
# and not dscp and that too in hex, hence, perform the conversion
|
||||
# from dscp in uci to tos first and then convert to hex
|
||||
tos_val=$(($1<<2))
|
||||
tos_hex=$(printf "%x" $tos_val)
|
||||
BR_RULE="$BR_RULE --ip-dscp-extend $tos_hex"
|
||||
BR_RULE="$BR_RULE --ip-tos $1"
|
||||
}
|
||||
|
||||
broute_ipv4_rule_options()
|
||||
@@ -234,7 +232,12 @@ broute_ipv4_rule_options()
|
||||
set_ip_addr $cid ebt_match_src_ip ebt_match_dst_ip
|
||||
|
||||
if [ ! -z $dscp_filter ]; then
|
||||
broute_filter_on_dscp "$dscp_filter"
|
||||
local tos_val
|
||||
local tos_hex
|
||||
|
||||
tos_val=$((dscp_filter<<2))
|
||||
tos_hex=$(printf "%x" $tos_val)
|
||||
broute_filter_on_dscp "$tos_hex"
|
||||
fi
|
||||
|
||||
if [ ! -z $protocol ]; then
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rulengd
|
||||
PKG_VERSION:=1.2.10
|
||||
PKG_VERSION:=1.2.11
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
|
||||
PKG_SOURCE_VERSION:=a32e325090d4303fe9aec786f81f0699006d21ab
|
||||
PKG_SOURCE_VERSION:=8fabf294cc056fd9a85cad06e81bd11df64e23a3
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunc
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.4.0
|
||||
PKG_VERSION:=1.3.3.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/stunc.git
|
||||
PKG_SOURCE_VERSION:=335f52d51b3b988917f0130303d571ac1fd9636c
|
||||
PKG_SOURCE_VERSION:=242326500576f644e7c730f556ce4a896c47be8c
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,25 +27,77 @@ include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/stunc
|
||||
define Package/stunc/default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF STUN Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbfdm-api +libopenssl
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/stunc
|
||||
$(Package/stunc/default)
|
||||
TITLE += (default)
|
||||
DEPENDS += +libopenssl
|
||||
VARIANT:=default
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/stunc-mbedtls
|
||||
$(Package/stunc/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_stunc-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
CONFLICTS := stunc stunc-openssl stunc-wolfssl
|
||||
endef
|
||||
|
||||
define Package/stunc-openssl
|
||||
$(Package/stunc/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_stunc-openssl:libopenssl
|
||||
VARIANT:=openssl
|
||||
CONFLICTS := stunc stunc-mbedtls stunc-wolfssl
|
||||
endef
|
||||
|
||||
define Package/stunc-wolfssl
|
||||
$(Package/stunc/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_stunc-wolfssl:libwolfssl
|
||||
VARIANT:=wolfssl
|
||||
CONFLICTS := stunc stunc-openssl stunc-mbedtls
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
ifeq ($(BUILD_VARIANT),default)
|
||||
MAKE_FLAGS += \
|
||||
USE_OPENSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
MAKE_FLAGS += \
|
||||
USE_WOLFSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
MAKE_FLAGS += \
|
||||
USE_MBEDTLS="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
MAKE_FLAGS += \
|
||||
USE_OPENSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/stunc/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/stunc/install
|
||||
define Package/stunc/default/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
@@ -55,4 +107,12 @@ define Package/stunc/install
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libstunc.so)
|
||||
endef
|
||||
|
||||
Package/stunc/install = $(Package/stunc/default/install)
|
||||
Package/stunc-openssl/install = $(Package/stunc/default/install)
|
||||
Package/stunc-wolfssl/install = $(Package/stunc/default/install)
|
||||
Package/stunc-mbedtls/install = $(Package/stunc/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,stunc))
|
||||
$(eval $(call BuildPackage,stunc-openssl))
|
||||
$(eval $(call BuildPackage,stunc-wolfssl))
|
||||
$(eval $(call BuildPackage,stunc-mbedtls))
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.5.5
|
||||
PKG_VERSION:=2.5.3.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/lcm/swmodd.git
|
||||
PKG_SOURCE_VERSION:=723d3597ef0f1b20fd3212b3e1ced3242f2491f1
|
||||
PKG_SOURCE_VERSION:=d8cc9a7a3749975720c9b748adadb2b6c920acdc
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -3,3 +3,7 @@ config globals 'globals'
|
||||
option debug '1'
|
||||
option log_level '3'
|
||||
option lan_bridge 'br-lan'
|
||||
option root '/container'
|
||||
|
||||
config execenv 'execenv_1'
|
||||
option name 'oci'
|
||||
|
||||
18
swmodd/files/etc/init.d/crun
Normal file → Executable file
18
swmodd/files/etc/init.d/crun
Normal file → Executable file
@@ -56,8 +56,8 @@ configure_lxc_container() {
|
||||
}
|
||||
|
||||
configure_crun_container() {
|
||||
local name type autostart du_status requested_state url username password
|
||||
local BRIDGE BUNDLE BOOT
|
||||
local name type autostart du_status requested_state url username password capability
|
||||
local BRIDGE BUNDLE BOOT PERM
|
||||
local RUNNER="/etc/swmodd/run.sh"
|
||||
|
||||
BUNDLE="${2}"
|
||||
@@ -73,6 +73,10 @@ configure_crun_container() {
|
||||
config_get url "${1}" url ""
|
||||
config_get username "${1}" username ""
|
||||
config_get password "${1}" password ""
|
||||
config_get capability "${1}" capability ""
|
||||
if [ -n "${capability}" ]; then
|
||||
PERM="-p ${capability// /,}"
|
||||
fi
|
||||
|
||||
if [ -z "${name}" ] || [ -z "${type}" ] || [ -z "${du_status}" ]; then
|
||||
return 0;
|
||||
@@ -148,7 +152,7 @@ configure_crun_container() {
|
||||
|
||||
if [ "${BOOT}" -eq "1" ]; then
|
||||
if [ "${autostart}" -eq 1 ]; then
|
||||
${RUNNER} -U -b "${BUNDLE}" -n "${name}"
|
||||
${RUNNER} -U -b "${BUNDLE}" -n "${name}" ${PERM}
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_description")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer "${1}" description "${result}"
|
||||
@@ -178,10 +182,10 @@ configure_crun_container() {
|
||||
fi
|
||||
elif [ "${requested_state}" = "Active" ]; then
|
||||
if is_container_running "${name}"; then
|
||||
${RUNNER} -u -n "${name}" -i "${BRIDGE}"
|
||||
${RUNNER} -u -n "${name}" -i "${BRIDGE}" ${PERM}
|
||||
crun resume "${name}"
|
||||
else
|
||||
${RUNNER} -U -b "${BUNDLE}" -n "${name}"
|
||||
${RUNNER} -U -b "${BUNDLE}" -n "${name}" ${PERM}
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_description")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer "${1}" description "${result}"
|
||||
@@ -207,7 +211,7 @@ configure_crun_container() {
|
||||
procd_set_param stderr 1
|
||||
procd_set_param command "${RUNNER}"
|
||||
procd_append_param command -b "${BUNDLE}" -n "${name}" -i "${BRIDGE}"
|
||||
procd_set_param respawn
|
||||
#procd_set_param respawn
|
||||
procd_close_instance "${name}"
|
||||
}
|
||||
|
||||
@@ -237,7 +241,7 @@ start_service() {
|
||||
|
||||
env=$(uci -q get swmodd.@execenv[0].name)
|
||||
if [ -z "${root}" ] || [ -z "${bridge}" ]; then
|
||||
log "Base bundle root[$root] or bridge[$bridge] not defined"
|
||||
log "# Base bundle root[$root] or bridge[$bridge] not defined"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ start_lxc_container() {
|
||||
return 0;
|
||||
fi
|
||||
|
||||
state=$(lxc-ls -f | tail -n +2 | grep -w "${name}" | cut -d " " -f 2)
|
||||
state=$(lxc-info -n "$name" -s -H)
|
||||
if [ -z "${state}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
@@ -91,13 +91,8 @@ start_service() {
|
||||
[ ! -d "/run" ] && ln -fs /var/run /run
|
||||
|
||||
if [ ! -d "${root}" ]; then
|
||||
log "# root [${root}] not present, creating ..."
|
||||
if [ -n "${root}" ]; then
|
||||
mkdir -p "${root}"
|
||||
else
|
||||
log "# Not starting, root [${root}] not defined"
|
||||
return 1
|
||||
fi
|
||||
log "# Not starting, Base root [${root}] not accessible/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Currently only one execenv supported
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user