mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-23 02:24:16 +08:00
Compare commits
287 Commits
dectmngr_l
...
dynamic-co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6a542e151 | ||
|
|
9c81aacd88 | ||
|
|
298d4dcb97 | ||
|
|
190544d3c4 | ||
|
|
2412a29226 | ||
|
|
c80b487052 | ||
|
|
4ca4047418 | ||
|
|
c30151607a | ||
|
|
6df48c0f7f | ||
|
|
d67c459153 | ||
|
|
47f5aade80 | ||
|
|
e06e1db9b0 | ||
|
|
6bfc426e63 | ||
|
|
04be1d3efd | ||
|
|
4b57a9dcd5 | ||
|
|
0a065403d5 | ||
|
|
0b598ddfb1 | ||
|
|
b5ef7c7278 | ||
|
|
8ed348342c | ||
|
|
aeb966b798 | ||
|
|
0d9ca4aa94 | ||
|
|
3529860fd2 | ||
|
|
a03ee39fd7 | ||
|
|
dca448d139 | ||
|
|
8947c5b8c7 | ||
|
|
572570b0f1 | ||
|
|
95d200bf3d | ||
|
|
3f58dd2dd2 | ||
|
|
c60672a710 | ||
|
|
16b6469277 | ||
|
|
cf18df1a94 | ||
|
|
ce6766ba9f | ||
|
|
0f517dd0e7 | ||
|
|
d3be3f9c4f | ||
|
|
efd1537a07 | ||
|
|
33c9290916 | ||
|
|
853c6a8452 | ||
|
|
5526fdb02c | ||
|
|
df05c3a3d6 | ||
|
|
40d414f791 | ||
|
|
0cf8492eab | ||
|
|
4619bf1722 | ||
|
|
6c52598bfb | ||
|
|
69330c5799 | ||
|
|
67781c7f18 | ||
|
|
482ddb50e8 | ||
|
|
6b937f3248 | ||
|
|
04ddc46cd5 | ||
|
|
51ce00eebe | ||
|
|
611c1414dc | ||
|
|
5ad1bea18b | ||
|
|
57339f81be | ||
|
|
82762ede0d | ||
|
|
4e324f3d18 | ||
|
|
8ab10fb3a1 | ||
|
|
f9a9543726 | ||
|
|
62223cebfd | ||
|
|
6104c14cfd | ||
|
|
6fb7284483 | ||
|
|
7c373c2edb | ||
|
|
82390070c1 | ||
|
|
c5bfa7332a | ||
|
|
e0e9dffee8 | ||
|
|
b5cfd5410e | ||
|
|
7b0e49753e | ||
|
|
6a04e6e29a | ||
|
|
9b2ca1bf90 | ||
|
|
2f2089e114 | ||
|
|
b78a542d28 | ||
|
|
08ce89a394 | ||
|
|
e4416db22b | ||
|
|
b5e195499a | ||
|
|
eb1d8deeff | ||
|
|
cb37cc60b9 | ||
|
|
83277d8a0c | ||
|
|
e28f1a653c | ||
|
|
c23c0248e1 | ||
|
|
82c064d4d9 | ||
|
|
5dc2d1ea7b | ||
|
|
f072dc5ba3 | ||
|
|
370af9b5fa | ||
|
|
aff71647aa | ||
|
|
b6ffbdae70 | ||
|
|
214c588bc1 | ||
|
|
da91ccda1c | ||
|
|
1d64b9e958 | ||
|
|
bbe507c740 | ||
|
|
c36da1cf8e | ||
|
|
54172e7065 | ||
|
|
5a145b69f8 | ||
|
|
20d861bd21 | ||
|
|
dc2ba58371 | ||
|
|
e800a445ae | ||
|
|
eadfc0feb3 | ||
|
|
bf5a6f6c3b | ||
|
|
4862dec4d9 | ||
|
|
56960ef0c0 | ||
|
|
3d5c8467c2 | ||
|
|
3fb8a697a0 | ||
|
|
c165587b54 | ||
|
|
e661570fbd | ||
|
|
28ff0a01df | ||
|
|
86075ea908 | ||
|
|
9ed638eb6b | ||
|
|
4054f8d273 | ||
|
|
d44a9e2634 | ||
|
|
e0cdb4020d | ||
|
|
74dadc162f | ||
|
|
e53c25807f | ||
|
|
ca64bded7c | ||
|
|
0709b46a63 | ||
|
|
e3be97f48e | ||
|
|
82f0db990f | ||
|
|
b2d17c0704 | ||
|
|
47fd6bd077 | ||
|
|
8837dc7a6c | ||
|
|
e35f05d037 | ||
|
|
5b3d595030 | ||
|
|
dfa9e7357e | ||
|
|
1a63ffbe5a | ||
|
|
5238b0776a | ||
|
|
28cfda6b96 | ||
|
|
eeae93881d | ||
|
|
5ef2db2754 | ||
|
|
d3a1612294 | ||
|
|
ee619a99a6 | ||
|
|
31c4944988 | ||
|
|
94aeedd9b0 | ||
|
|
3fbe2bd73b | ||
|
|
ff6f46dbd2 | ||
|
|
dc312da663 | ||
|
|
c0b8538dfe | ||
|
|
9935c43076 | ||
|
|
0b5b7d4984 | ||
|
|
23387f0fcc | ||
|
|
afe7a13e3c | ||
|
|
5eb7f17b84 | ||
|
|
9b7b0184c8 | ||
|
|
3f64f35b50 | ||
|
|
58e0b0556a | ||
|
|
0f69d96b8f | ||
|
|
3cc7151326 | ||
|
|
4191852fcb | ||
|
|
e049486b44 | ||
|
|
5fc945c32e | ||
|
|
a021f7984e | ||
|
|
9a3fbe874e | ||
|
|
b1b86e7093 | ||
|
|
5ea3018b02 | ||
|
|
3f336a21f4 | ||
|
|
ac28911137 | ||
|
|
c04d6e5414 | ||
|
|
0745ab63cf | ||
|
|
bce42023b1 | ||
|
|
b852055460 | ||
|
|
f1acd2b4b1 | ||
|
|
77c62b3059 | ||
|
|
206305fa40 | ||
|
|
9a7f798933 | ||
|
|
3cabbb6919 | ||
|
|
ab0645fe4c | ||
|
|
60adf6e369 | ||
|
|
5ca12a752e | ||
|
|
5fe6420620 | ||
|
|
fd5ae2b847 | ||
|
|
d1f3854b99 | ||
|
|
f444ba6651 | ||
|
|
2214fd99e8 | ||
|
|
35c5d54a76 | ||
|
|
4fd6d70b71 | ||
|
|
f67d771ea4 | ||
|
|
0fc5cc4442 | ||
|
|
9b1d5753eb | ||
|
|
34d5a178ae | ||
|
|
6cfb68796e | ||
|
|
dcdf4e82e5 | ||
|
|
9f3e2ae06d | ||
|
|
0793dccefa | ||
|
|
5d7350279b | ||
|
|
44d242d4aa | ||
|
|
bae25db654 | ||
|
|
a66aacb48d | ||
|
|
b7d861466a | ||
|
|
f17c3d4763 | ||
|
|
3ed8832a85 | ||
|
|
11f8d68cc3 | ||
|
|
52551d7357 | ||
|
|
9d777db805 | ||
|
|
1f3c68ad79 | ||
|
|
34be7d88b0 | ||
|
|
62dc2e55d5 | ||
|
|
492579a5d1 | ||
|
|
025ce42f56 | ||
|
|
6fef055c62 | ||
|
|
eae6b6b8eb | ||
|
|
23d4e3cf18 | ||
|
|
41bcbe55b9 | ||
|
|
63e9af8cc2 | ||
|
|
40ef251948 | ||
|
|
ad7d90c070 | ||
|
|
3b165d9e2f | ||
|
|
190e3cb3a0 | ||
|
|
8a759a67e4 | ||
|
|
d6edbf4e57 | ||
|
|
c8ab92f6dc | ||
|
|
6e2209f6e0 | ||
|
|
fadc9ffcf4 | ||
|
|
10b627f68c | ||
|
|
34e29aaf84 | ||
|
|
016dbef779 | ||
|
|
d95dae7282 | ||
|
|
b274be6adc | ||
|
|
975008a951 | ||
|
|
893c292150 | ||
|
|
3857f5d3ee | ||
|
|
e09277cdc2 | ||
|
|
37c24c0625 | ||
|
|
354d7e8c22 | ||
|
|
2409d8f4e0 | ||
|
|
df0e96d9ac | ||
|
|
fae8008269 | ||
|
|
a6a3599455 | ||
|
|
86983e9c9c | ||
|
|
b2c5d21322 | ||
|
|
161c89060e | ||
|
|
d14dbe80c9 | ||
|
|
c7a08a2f04 | ||
|
|
b104b1997a | ||
|
|
06ac5624ab | ||
|
|
7572e4eb1e | ||
|
|
eb34cb7cb2 | ||
|
|
6fc3ff4750 | ||
|
|
cbed9517bc | ||
|
|
2ca9158f15 | ||
|
|
5b77f36ae4 | ||
|
|
289d805bdc | ||
|
|
ed159425a5 | ||
|
|
f701de6e47 | ||
|
|
8f159de428 | ||
|
|
54aa763d01 | ||
|
|
df39cf1e4f | ||
|
|
3a74eb3d86 | ||
|
|
46603ce0f2 | ||
|
|
3c6f3ab3bf | ||
|
|
02761cabac | ||
|
|
72ff019c46 | ||
|
|
f2256e36a1 | ||
|
|
0772483396 | ||
|
|
4956969ef5 | ||
|
|
ed6901fe74 | ||
|
|
f981f1ea39 | ||
|
|
04bc5acf53 | ||
|
|
35c49cb4b7 | ||
|
|
bcd4ad4c24 | ||
|
|
c3f99c0914 | ||
|
|
67a85ccf49 | ||
|
|
7df3657de8 | ||
|
|
0d4b589f86 | ||
|
|
fb608ea6ff | ||
|
|
3b05ec8666 | ||
|
|
9463798787 | ||
|
|
92f1e90079 | ||
|
|
8b60cb2457 | ||
|
|
0527428f6c | ||
|
|
508ff7d041 | ||
|
|
53cdb49ba8 | ||
|
|
cdb76b1c18 | ||
|
|
8ed6bd1bfc | ||
|
|
028efc13c9 | ||
|
|
115234d93b | ||
|
|
34afbc348d | ||
|
|
8842b7e8b8 | ||
|
|
b10d8e0ec6 | ||
|
|
1ec66d5732 | ||
|
|
084691a29a | ||
|
|
d083dc041e | ||
|
|
c0c30ca012 | ||
|
|
65fbf9958d | ||
|
|
c0a6739981 | ||
|
|
81fdef1991 | ||
|
|
dc0dbb29ff | ||
|
|
aa98c2fff5 | ||
|
|
5c935f03fe | ||
|
|
b44e25c8ee | ||
|
|
822f5624b1 | ||
|
|
60f2fdd7cb | ||
|
|
6518f92be7 |
@@ -10,14 +10,6 @@ config BBF_OBFUSCATION_KEY
|
||||
string "Obfuscation key"
|
||||
default "371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04"
|
||||
|
||||
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
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.7.25
|
||||
PKG_VERSION:=1.8.26
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=d852b8fefa0eb07a7cb9850fa0688d8c94e005a9
|
||||
PKG_SOURCE_VERSION:=6df8fecbcc72e55f2ba06ae933dcddb6f725b204
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -37,8 +37,7 @@ define Package/libbbfdm
|
||||
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 +libbbfdm-api +libopenssl
|
||||
endef
|
||||
|
||||
define Package/bbfdmd
|
||||
@@ -46,7 +45,7 @@ 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 +libbbfdm +jq
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -69,17 +68,6 @@ endif
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
-DBBF_WIFI_DATAELEMENTS=ON
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR143=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR471),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR471=ON
|
||||
endif
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
@@ -96,6 +84,7 @@ define Package/libbbfdm-api/install
|
||||
$(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.secure $(1)/usr/libexec/rpcd/bbf.secure
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/scripts/bbf.config $(1)/usr/libexec/rpcd/bbf.config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/certificates
|
||||
@@ -107,7 +96,8 @@ define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/usr/share/bbfdm/libbbfdm.so
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/97-firewall-service
|
||||
@@ -117,14 +107,12 @@ define Package/libbbfdm/install
|
||||
$(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
|
||||
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so $(1)
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts/
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm/scripts/
|
||||
$(LN) /usr/share/bbfdm/scripts/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
@@ -142,8 +130,8 @@ define Package/bbfdmd/install
|
||||
$(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_BIN) ./files/etc/init.d/bbfdm.services $(1)/etc/init.d/
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(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
|
||||
endef
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ bbfdm provides few compile time configuration options and compile time help util
|
||||
| ----------------------- | ------------- | ----------- |
|
||||
| CONFIG_BBF_VENDOR_LIST | List of vendor extension directories | iopsys |
|
||||
| CONFIG_BBF_VENDOR_PREFIX | Prefix for Vendor extension datamodel objects/parameters | X_IOPSYS_EU_ |
|
||||
| CONFIG_BBF_TR143 | Enable/Add TR-143 Data Model Support | y |
|
||||
| CONFIG_BBF_TR471 | Enable/Add TR-471 Data Model Support | y |
|
||||
| CONFIG_BBF_MAX_OBJECT_INSTANCES | Maximum number of instances per object | 255 |
|
||||
| BBF_OBFUSCATION_KEY | Hash used to encode/decode in `bbf.secure` object | 371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04 |
|
||||
|
||||
@@ -38,77 +36,3 @@ $ echo -n "Sup3rS3cur3Passw0rd" | sha512sum
|
||||
|
||||
bbfdm provides a helper utility [bbfdm.mk](./bbfdm.mk) to install datamodel plugins in bbfdm core or in microservice directory.
|
||||
|
||||
### Install datamodel DotSO/JSON plugin in bbfdm core
|
||||
|
||||
Utility to install the DotSO/JSON plugin in bbfdm core plugin path
|
||||
|
||||
```bash
|
||||
# inputs:
|
||||
# $1 => package install directory
|
||||
# $2 => Plugin artifact
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```make
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
|
||||
endef
|
||||
```
|
||||
|
||||
### Install datamodel DotSO/JSON plugin in bbfdm core with priority
|
||||
|
||||
Its now possible to overwrite/remove core datamodel with plugin, so, if some datamodel objects/parameters are present in more than one plugin, order in which they loaded into memory becomes crucial, this Utility help to configure a priority order in which they gets loaded in memory.
|
||||
|
||||
```bash
|
||||
# inputs:
|
||||
# $1 => package install directory
|
||||
# $2 => Priority of the installed plugin
|
||||
# $3 => Plugin artifact
|
||||
```
|
||||
|
||||
Example:
|
||||
```make
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(call BbfdmInstallPluginWithPriority,$(1),01,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
|
||||
endef
|
||||
```
|
||||
|
||||
> Note: Last loaded plugin gets the highest priority
|
||||
|
||||
### Install plugin into micro-service directory
|
||||
|
||||
Utility to install the plugin in datamodel microservice directory, ex. user wants to run a datamodel micro-service, it required to install the DotSO/JSON plugin into a non bbf core directory, this utility helps in installing the DotSO/JSON plugin in mentioned directory.
|
||||
|
||||
```bash
|
||||
# inputs:
|
||||
# $1 => package install directory with micro-service directory
|
||||
# $2 => Plugin artifact
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```make
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
|
||||
endef
|
||||
```
|
||||
|
||||
### Install datamodel micro-service input file
|
||||
|
||||
Utility to install the datamodel plugin input file into the bbfdm micro-service directory, so that bbfdm auto start the datamodel micro-service before main bbfdm process.
|
||||
|
||||
```bash
|
||||
# inputs:
|
||||
# $1 => package install directory
|
||||
# $2 => Microservice input.json path
|
||||
```
|
||||
|
||||
Example:
|
||||
|
||||
```make
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
|
||||
endef
|
||||
```
|
||||
|
||||
|
||||
133
bbfdm/bbfdm.mk
133
bbfdm/bbfdm.mk
@@ -2,56 +2,113 @@
|
||||
# Copyright (C) 2023 IOPSYS
|
||||
#
|
||||
|
||||
# Utility to install the plugin in bbfdm core path
|
||||
# inputs:
|
||||
# $1 => package install directory
|
||||
# $2 => Plugin artifact
|
||||
#
|
||||
# Example:
|
||||
# $(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
|
||||
#
|
||||
define BbfdmInstallPlugin
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
|
||||
endef
|
||||
BBFDM_BASE_DM_PATH=/usr/share/bbfdm
|
||||
BBFDM_INPUT_PATH=/etc/bbfdm/micro_services
|
||||
BBFDM_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
# Utility to install the plugin in bbfdm core path with priority
|
||||
# inputs:
|
||||
# $1 => package install directory
|
||||
# $2 => Priority of the installed plugin
|
||||
# $3 => Plugin artifact
|
||||
#
|
||||
# Example:
|
||||
# $(call BbfdmInstallPluginWithPriority,$(1),01,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
|
||||
#
|
||||
define BbfdmInstallPluginWithPriority
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(3) $(1)/etc/bbfdm/plugins/$(2)_$(shell basename ${3})
|
||||
endef
|
||||
#BBFDM_VERSION:=$(shell grep -oP '(?<=^PKG_VERSION:=).*' ${BBFDM_DIR}/Makefile)
|
||||
#BBFDM_TOOLS:=$(BUILD_DIR)/bbfdm-$(BBFDM_VERSION)/tools
|
||||
|
||||
# Utility to install the plugin in datamodel microservice directory
|
||||
# inputs:
|
||||
# $1 => package install directory with micro-service directory
|
||||
# $2 => Plugin artifact
|
||||
# Utility to install the plugin in bbfdm core path with priority.
|
||||
# Its now possible to overwrite/remove core datamodel with plugin, so, if some
|
||||
# datamodel objects/parameters are present in more than one plugin, order in
|
||||
# which they loaded into memory becomes crucial, this Utility help to configure
|
||||
# a priority order in which they gets loaded in memory.
|
||||
#
|
||||
# ARGS:
|
||||
# $1 => Plugin artifact
|
||||
# $2 => package install directory
|
||||
# $3 => Priority of the installed plugin (Optional)
|
||||
#
|
||||
# Note:
|
||||
# - Last loaded plugin gets the highest priority
|
||||
#
|
||||
# Example:
|
||||
# $(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
|
||||
# BBFDM_INSTALL_CORE_PLUGIN ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)
|
||||
#
|
||||
# Example to install plugin with priority:
|
||||
# BBFDM_INSTALL_CORE_PLUGIN ./files/etc/bbfdm/json/CWMPManagementServer.json $(1) 01
|
||||
#
|
||||
BBFDM_INSTALL_CORE_PLUGIN:=$(BBFDM_DIR)/tools/bbfdm.sh -p
|
||||
|
||||
|
||||
# Utility to install the micro-service datamodel
|
||||
# Use Case:
|
||||
# user wants to run a datamodel micro-service, it required to install the
|
||||
# DotSO/JSON plugin into a bbf shared directory, this utility helps in
|
||||
# installing the DotSO/JSON plugin in bbfdm shared directory, and auto-generate
|
||||
# input file for the micro-service
|
||||
#
|
||||
# ARGS:
|
||||
# $1 => DotSo or Json plugin with complete path
|
||||
# $2 => package install directory
|
||||
# $3 => service name
|
||||
#
|
||||
# Note:
|
||||
# - There could be only one main plugin file, so its bind to PKG_NAME
|
||||
# - Micro-service input.json will be auto generated with this call
|
||||
# - Use -u (optional argument) to overwrite ubus object name
|
||||
#
|
||||
# Example:
|
||||
# BBFDM_INSTALL_MS_DM $(PKG_BUILD_DIR)/libcwmp.so $(1) $(PKG_NAME)
|
||||
#
|
||||
BBFDM_INSTALL_MS_DM:=$(BBFDM_DIR)/tools/bbfdm.sh -m
|
||||
|
||||
|
||||
# Utility to install a plugins in datamodel micro-service
|
||||
#
|
||||
# ARGS:
|
||||
# $1 => DotSo or Json plugin with complete path
|
||||
# $2 => package install directory
|
||||
# $3 => service name
|
||||
#
|
||||
# Note:
|
||||
# - Use the service_name/PKG_NAME of the service in which this has to run
|
||||
#
|
||||
# Example:
|
||||
# BBFDM_INSTALL_MS_PLUGIN $(PKG_BUILD_DIR)/libxmpp.so $(1) icwmp
|
||||
#
|
||||
BBFDM_INSTALL_MS_PLUGIN:=$(BBFDM_DIR)/tools/bbfdm.sh -m -p
|
||||
|
||||
# Utility to install the helper scripts in default bbfdm script path
|
||||
#
|
||||
# Use Case:
|
||||
# User want to install some script for running diagnostics
|
||||
#
|
||||
# ARGS:
|
||||
# $1 => Script with complete path
|
||||
# $2 => package install directory
|
||||
#
|
||||
# Note:
|
||||
# - Use with -d option to install script in bbf.diag directory
|
||||
#
|
||||
# Example:
|
||||
# BBFDM_INSTALL_SCRIPT $(PKG_BUILD_DIR)/download $(1)
|
||||
# BBFDM_INSTALL_SCRIPT -d $(PKG_BUILD_DIR)/ipping $(1)
|
||||
#
|
||||
BBFDM_INSTALL_SCRIPT:=$(BBFDM_DIR)/tools/bbfdm.sh -s
|
||||
|
||||
# Deprecated functions errors
|
||||
define BbfdmInstallPluginInMicroservice
|
||||
$(warning # BbfdmInstallPluginInMicroservice function is deprecated, use BBFDM_INSTALL_MS_PLUGIN macro #)
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(INSTALL_DATA) $(2) $(1)/
|
||||
endef
|
||||
|
||||
# Utility to install the datamodel plugin input file
|
||||
# inputs:
|
||||
# $1 => package install directory
|
||||
# $2 => Microservice input.json path
|
||||
#
|
||||
# Example:
|
||||
# $(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
|
||||
#
|
||||
define BbfdmInstallMicroServiceInputFile
|
||||
$(warning # function BbfdmInstallMicroServiceInputFile deprecated, input file auto generated with BBFDM_INSTALL_MS_DM #)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/micro_services
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/micro_services/$(PKG_NAME).json
|
||||
endef
|
||||
|
||||
define BbfdmInstallPlugin
|
||||
$(warning # function BbfdmInstallPlugin deprecated, use BBFDM_INSTALL_CORE_PLUGIN macro #)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
|
||||
endef
|
||||
|
||||
define BbfdmInstallPluginWithPriority
|
||||
$(warning # fucntion BbfdmInstallPluginWithPriority deprecated, use BBFDM_INSTALL_CORE_PLUGIN #)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(3) $(1)/etc/bbfdm/plugins/$(2)_$(shell basename ${3})
|
||||
endef
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BBFDMD="/usr/sbin/bbfdmd"
|
||||
|
||||
bbfdm_add_service()
|
||||
{
|
||||
local name path
|
||||
|
||||
name="${1}"
|
||||
path="${2}"
|
||||
|
||||
if [ -z "${name}" -o -z "$path" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
|
||||
echo "Use of bbfdm_add_service deprecated, please use bbfdm micro_service uci"
|
||||
}
|
||||
|
||||
bbfdm_stop_service()
|
||||
{
|
||||
local name
|
||||
|
||||
name="${1}"
|
||||
if [ -z "${name}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if ubus call service list '{"name":"bbfdm.services"}' |grep -q "bbfdm.$name"; then
|
||||
ubus call service delete "{'name':'bbfdm.services','instance':'bbfdm.$name'}"
|
||||
fi
|
||||
}
|
||||
|
||||
usages()
|
||||
{
|
||||
echo "Usages $0: <OPTIONS>..."
|
||||
echo
|
||||
echo " -h show help"
|
||||
echo " -k micro-service name to stop"
|
||||
echo
|
||||
}
|
||||
|
||||
while getopts "s:k:h" opts; do
|
||||
case "$opts" in
|
||||
h) usages; exit 0;;
|
||||
k) bbfdm_stop_service "${OPTARG}";;
|
||||
esac
|
||||
done
|
||||
@@ -4,8 +4,8 @@
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/lib/libbbfdm.so",
|
||||
"plugin_dir": "/etc/bbfdm/plugins"
|
||||
"name": "/usr/share/bbfdm/libbbfdm.so",
|
||||
"plugin_dir": "/usr/share/bbfdm/plugins"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
|
||||
106
bbfdm/files/etc/init.d/bbfdm.services
Normal file
106
bbfdm/files/etc/init.d/bbfdm.services
Normal file
@@ -0,0 +1,106 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=40
|
||||
STOP=8
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
|
||||
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/micro_services"
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t bbfdmd.services -p info
|
||||
}
|
||||
|
||||
validate_bbfdm_micro_service_section()
|
||||
{
|
||||
uci_validate_section bbfdm micro_services "micro_services" \
|
||||
'enable:bool:true' \
|
||||
'enable_core:bool:false' \
|
||||
'enable_respawn:bool:true'
|
||||
}
|
||||
|
||||
_add_microservice()
|
||||
{
|
||||
local name path
|
||||
local enable enable_core enable_respawn
|
||||
|
||||
# Check enable from micro-service
|
||||
path="${1}"
|
||||
enable_respawn="${2}"
|
||||
enable_core="${3}"
|
||||
|
||||
name="$(basename ${path})"
|
||||
name="${name//.json}"
|
||||
|
||||
enable="$(jq -r '.daemon.enable//1' ${path})"
|
||||
if [ "${enable}" -eq "0" ]; then
|
||||
log "datamodel micro-service ${name} not enabled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
procd_open_instance "${name}"
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -m "${name}"
|
||||
|
||||
if [ "${enable_core}" -eq "1" ]; then
|
||||
procd_set_param limits core="unlimited"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ "${enable_respawn}" -eq "1" ]; then
|
||||
procd_set_param respawn "3600" "5" "5"
|
||||
fi
|
||||
procd_close_instance "${name}"
|
||||
}
|
||||
|
||||
configure_bbfdm_micro_services()
|
||||
{
|
||||
local enable enable_core enable_respawn
|
||||
|
||||
config_load bbfdm
|
||||
validate_bbfdm_micro_service_section || {
|
||||
log "Validation of micro_service section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ "${enable}" -eq "0" ] && return 0
|
||||
|
||||
if [ -d "${BBFDM_MICROSERVICE_DIR}" ]; then
|
||||
FILES="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/*.json)"
|
||||
|
||||
for file in $FILES;
|
||||
do
|
||||
[ -e "$file" ] || continue
|
||||
|
||||
_add_microservice $file "${enable_respawn}" "${enable_core}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
_start_single_service()
|
||||
{
|
||||
local service file
|
||||
|
||||
service="${1}"
|
||||
|
||||
if [ -d "${BBFDM_MICROSERVICE_DIR}" ]; then
|
||||
file="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/${service}.json)"
|
||||
[ -e "$file" ] || return
|
||||
|
||||
_add_microservice $file "0" "0"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
_start_single_service "${1}"
|
||||
else
|
||||
configure_bbfdm_micro_services
|
||||
fi
|
||||
}
|
||||
@@ -7,7 +7,6 @@ USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
|
||||
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
|
||||
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/micro_services"
|
||||
BBFDM_TEMP_DIR="/tmp/bbfdm"
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
@@ -28,91 +27,6 @@ validate_bbfdm_bbfdmd_section()
|
||||
'subprocess_level:uinteger'
|
||||
}
|
||||
|
||||
validate_bbfdm_micro_service_section()
|
||||
{
|
||||
uci_validate_section bbfdm micro_services "micro_services" \
|
||||
'enable:bool:true' \
|
||||
'enable_core:bool:false' \
|
||||
'enable_respawn:bool:true'
|
||||
}
|
||||
|
||||
bbfdm_add_micro_service()
|
||||
{
|
||||
local name path cmd
|
||||
local enable enable_core enable_respawn
|
||||
|
||||
validate_bbfdm_micro_service_section || {
|
||||
log "Validation of micro_service section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ "${enable}" -eq "0" ] && return 0
|
||||
|
||||
path="${1}"
|
||||
name="$(basename ${path})"
|
||||
name="${name//.json}"
|
||||
|
||||
json_init
|
||||
json_add_string name "bbfdm.services"
|
||||
json_add_object "instances"
|
||||
json_add_object "${name}"
|
||||
json_add_array "command"
|
||||
json_add_string "" "${PROG}"
|
||||
json_add_string "" "-m"
|
||||
json_add_string "" "${path}"
|
||||
json_close_array
|
||||
|
||||
if [ "${enable_core}" -eq "1" ]; then
|
||||
json_add_object "limits"
|
||||
json_add_string "core" "unlimited"
|
||||
json_close_object
|
||||
json_add_boolean "stdout" 1
|
||||
json_add_boolean "stderr" 1
|
||||
fi
|
||||
|
||||
if [ "${enable_respawn}" -eq "1" ]; then
|
||||
json_add_array "respawn"
|
||||
json_add_string "" "3600"
|
||||
json_add_string "" "5"
|
||||
json_add_string "" "5"
|
||||
json_close_array
|
||||
fi
|
||||
json_close_object
|
||||
json_close_object
|
||||
|
||||
cmd="$(json_dump)"
|
||||
ubus call service add "${cmd}"
|
||||
}
|
||||
|
||||
_add_microservice()
|
||||
{
|
||||
local enable loglevel input_json name
|
||||
|
||||
name="${1}"
|
||||
input_json="$(jq -r '.daemon.input.name' ${name})"
|
||||
|
||||
if [ -f "${input_json}" ]; then
|
||||
bbfdm_add_micro_service "${name}"
|
||||
else
|
||||
log "Input json [${input_json}] does not defined/present"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
configure_bbfdm_micro_services()
|
||||
{
|
||||
if [ -d "${BBFDM_MICROSERVICE_DIR}" ]; then
|
||||
FILES="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/*.json)"
|
||||
|
||||
for service in $FILES;
|
||||
do
|
||||
[ -e "$service" ] || continue
|
||||
_add_microservice $service
|
||||
done
|
||||
fi
|
||||
ubus call service state '{"name":"bbfdm.services", "spawn":true}'
|
||||
}
|
||||
|
||||
configure_bbfdmd()
|
||||
{
|
||||
local enable debug sock
|
||||
@@ -145,19 +59,12 @@ start_service()
|
||||
{
|
||||
mkdir -p ${BBFDM_TEMP_DIR}
|
||||
|
||||
configure_bbfdm_micro_services
|
||||
|
||||
procd_open_instance "bbfdm"
|
||||
configure_bbfdmd
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bbfdm"
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
ubus call service delete '{"name":"bbfdm.services"}'
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "bbfdm"
|
||||
|
||||
@@ -1,16 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
UNIFIED_PATH="/etc/bbfdm/plugins/"
|
||||
UNIFIED_PATH="/usr/share/bbfdm/plugins/"
|
||||
|
||||
log() {
|
||||
echo "$@" | logger -t bbfdm.uci-default -p info
|
||||
}
|
||||
|
||||
# Link JSON plugins
|
||||
for f in `ls -1 /etc/bbfdm/json/*.json`; do
|
||||
echo "# BBFDM JSON plugin ${f} not aligned #"
|
||||
log "# BBFDM JSON plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link DotSo plugins
|
||||
for f in `ls -1 /usr/lib/bbfdm/*.so`; do
|
||||
echo "# BBFDM DotSO plugin ${f} not aligned #"
|
||||
log "# BBFDM DotSO plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link JSON plugins
|
||||
for f in `ls -1 /etc/bbfdm/plugins/*.json`; do
|
||||
log "# BBFDM JSON plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link DotSo plugins
|
||||
for f in `ls -1 /etc/bbfdm/plugins/*.so`; do
|
||||
log "# BBFDM DotSO plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
|
||||
169
bbfdm/tools/bbfdm.sh
Executable file
169
bbfdm/tools/bbfdm.sh
Executable file
@@ -0,0 +1,169 @@
|
||||
#!/bin/bash
|
||||
|
||||
BBFDM_BASE_DM_PATH="usr/share/bbfdm"
|
||||
BBFDM_INPUT_PATH="etc/bbfdm/micro_services"
|
||||
INPUT_TEMPLATE='{"daemon":{"enable":"1","service_name":"template","config":{"loglevel":"1"}}}'
|
||||
OUT_NAME=""
|
||||
|
||||
MICRO_SERVICE=0
|
||||
SCRIPT=0
|
||||
DIAG=0
|
||||
PLUGIN=0
|
||||
DEST=""
|
||||
TOOLS="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
SRC=""
|
||||
|
||||
while getopts ":mpsdu:" opt; do
|
||||
case ${opt} in
|
||||
m)
|
||||
MICRO_SERVICE=1
|
||||
;;
|
||||
p)
|
||||
PLUGIN=1
|
||||
;;
|
||||
s)
|
||||
SCRIPT=1
|
||||
;;
|
||||
d)
|
||||
DIAG=1
|
||||
;;
|
||||
u)
|
||||
OUT_NAME="${OPTARG}"
|
||||
;;
|
||||
?)
|
||||
echo "Invalid option: ${OPTARG}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
SRC="${1}"
|
||||
shift
|
||||
DEST="${1}"
|
||||
shift
|
||||
DATA="${1}"
|
||||
|
||||
install_bin() {
|
||||
if ! install -m0755 ${1} ${2}; then
|
||||
echo "Failed to install bin ${1} => ${2}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_dir() {
|
||||
if ! install -d -m0755 ${1}; then
|
||||
echo "Failed to create directory ${1}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
install_data() {
|
||||
if ! install -m0644 ${1} ${2}; then
|
||||
echo "Failed to install ${1} => ${2}"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Installing datamodel
|
||||
bbfdm_install_dm()
|
||||
{
|
||||
local src dest minfile
|
||||
|
||||
src="$1"
|
||||
dest="$2"
|
||||
minfile=""
|
||||
|
||||
if [ -z ${src} ] || [ -z "${dest}" ] || [ -z "${TOOLS}" ]; then
|
||||
echo "Invalid input option for install dm $@"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${src##*.}" = "json" ]; then
|
||||
echo "Compacting BBFDM JSON file"
|
||||
minfile=$(mktemp)
|
||||
jq -c 'del(..|.description?)' ${src} > ${minfile}
|
||||
|
||||
src=${minfile}
|
||||
if dpkg -s python3-jsonschema >/dev/null 2>&1; then
|
||||
echo "Verifying bbfdm Datamodel JSON file"
|
||||
if ! ${TOOLS}/validate_plugins.py ${src}; then
|
||||
echo "Validation of the plugin failed ${src}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "## Install python3-jsonschema to verify datamodel plugins"
|
||||
fi
|
||||
fi
|
||||
|
||||
install_bin ${src} ${dest}
|
||||
|
||||
if [ -f "${minfile}" ]; then
|
||||
rm ${minfile}
|
||||
fi
|
||||
}
|
||||
|
||||
bbfdm_generate_input()
|
||||
{
|
||||
local dest ser
|
||||
|
||||
dest_dir=${1}
|
||||
ser=${2}
|
||||
dest=${dest_dir}/${ser}.json
|
||||
|
||||
if [ -n "${OUT_NAME}" ]; then
|
||||
echo ${INPUT_TEMPLATE} | jq --arg service "${ser}" --arg OUT "${OUT_NAME}" '.daemon |= (.service_name = $service |.output.name = $OUT)' > ${dest}
|
||||
else
|
||||
echo ${INPUT_TEMPLATE} | jq --arg service "${ser}" '.daemon.service_name = $service' > ${dest}
|
||||
fi
|
||||
|
||||
chmod 466 ${dest}
|
||||
}
|
||||
|
||||
if [ -z "$SRC" ] || [ -z "${DEST}" ] ; then
|
||||
echo "# BBFDM Null value in src[${SRC}], dest[${DEST}]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${SCRIPT}" -eq "1" ]; then
|
||||
if [ "${DIAG}" -eq "1" ]; then
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/scripts/bbf_diag
|
||||
install_bin ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/scripts/bbf_diag/
|
||||
else
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/scripts
|
||||
install_bin ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/scripts/
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${MICRO_SERVICE}" -eq "1" ]; then
|
||||
if [ -z "${DATA}" ]; then
|
||||
echo "# service_name[${DATA}] not provided"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "${PLUGIN}" -ne "1" ]; then
|
||||
extn="$(basename ${SRC})"
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}.${extn##*.}
|
||||
|
||||
# main micro-service datamodel plugin, create an input file as well
|
||||
install_dir ${DEST}/${BBFDM_INPUT_PATH}
|
||||
bbfdm_generate_input ${DEST}/${BBFDM_INPUT_PATH}/ ${DATA}
|
||||
else
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}/$(basename ${SRC})
|
||||
fi
|
||||
else
|
||||
if [ "${PLUGIN}" -eq "1" ]; then
|
||||
priority="${DATA:-0}"
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/plugins
|
||||
if [ "${priority}" -gt "0" ]; then
|
||||
# install with priority if defined
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/plugins/${priority}_$(basename ${SRC})
|
||||
else
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/plugins/$(basename ${SRC})
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
330
bbfdm/tools/validate_plugins.py
Executable file
330
bbfdm/tools/validate_plugins.py
Executable file
@@ -0,0 +1,330 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
# Copyright (C) 2024 iopsys Software Solutions AB
|
||||
# Author: Amin Ben Romdhane <amin.benromdhane@iopsys.eu>
|
||||
|
||||
import sys
|
||||
import json
|
||||
from jsonschema import validate
|
||||
|
||||
JSON_PLUGIN_VERSION = 0
|
||||
|
||||
obj_schema = {
|
||||
"definitions": {
|
||||
"type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"object"
|
||||
]
|
||||
},
|
||||
"map_type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"uci",
|
||||
"ubus"
|
||||
]
|
||||
},
|
||||
"protocols_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"type" : {"$ref": "#/definitions/type_t"},
|
||||
"version" : {"type": "string"},
|
||||
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
|
||||
"uniqueKeys" : {"type" : "array"},
|
||||
"access" : {"type" : "boolean"},
|
||||
"array" : {"type" : "boolean"},
|
||||
"mapping" : {"type" : "object", "properties" : {
|
||||
"type" : {"$ref": "#/definitions/map_type_t"},
|
||||
"uci" : {"type" : "object", "properties" : {
|
||||
"file" : {"type": "string"},
|
||||
"section" : {"type": "object", "properties" : {
|
||||
"type" : {"type": "string"}
|
||||
}
|
||||
},
|
||||
"dmmapfile" : {"type": "string"}
|
||||
}
|
||||
},
|
||||
"ubus" : {"type" : "object", "properties" : {
|
||||
"object" : {"type": "string"},
|
||||
"method" : {"type": "string"},
|
||||
"args" : {"type": "object"},
|
||||
"key" : {"type": "string"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"protocols",
|
||||
"array",
|
||||
"access"
|
||||
]
|
||||
}
|
||||
|
||||
obj_schema_v1 = {
|
||||
"definitions": {
|
||||
"type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"object"
|
||||
]
|
||||
},
|
||||
"map_type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"uci",
|
||||
"ubus"
|
||||
]
|
||||
},
|
||||
"protocols_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"cwmp",
|
||||
"usp",
|
||||
"none"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"type" : {"$ref": "#/definitions/type_t"},
|
||||
"version" : {"type": "string"},
|
||||
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
|
||||
"uniqueKeys" : {"type" : "array"},
|
||||
"access" : {"type" : "boolean"},
|
||||
"array" : {"type" : "boolean"},
|
||||
"mapping" : {"type" : "array", "items" : {
|
||||
"type" : "object", "properties" : {
|
||||
"type" : {"$ref": "#/definitions/map_type_t"},
|
||||
"uci" : {"type" : "object", "properties" : {
|
||||
"file" : {"type": "string"},
|
||||
"section" : {"type": "object", "properties" : {
|
||||
"type" : {"type": "string"}
|
||||
}
|
||||
},
|
||||
"dmmapfile" : {"type": "string"}
|
||||
}
|
||||
},
|
||||
"ubus" : {"type" : "object", "properties" : {
|
||||
"object" : {"type": "string"},
|
||||
"method" : {"type": "string"},
|
||||
"args" : {"type": "object"},
|
||||
"key" : {"type": "string"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"protocols",
|
||||
"array",
|
||||
"access"
|
||||
]
|
||||
}
|
||||
|
||||
param_schema = {
|
||||
"definitions": {
|
||||
"type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"string",
|
||||
"unsignedInt",
|
||||
"unsignedLong",
|
||||
"int",
|
||||
"long",
|
||||
"boolean",
|
||||
"dateTime",
|
||||
"hexBinary",
|
||||
"base64",
|
||||
"decimal"
|
||||
]
|
||||
},
|
||||
"map_type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"uci",
|
||||
"ubus",
|
||||
"procfs",
|
||||
"sysfs",
|
||||
"json",
|
||||
"uci_sec"
|
||||
]
|
||||
},
|
||||
"protocols_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"cwmp",
|
||||
"usp",
|
||||
"none"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"type" : {"$ref": "#/definitions/type_t"},
|
||||
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
|
||||
"read" : {"type" : "boolean"},
|
||||
"write" : {"type" : "boolean"},
|
||||
"mapping" : {"type" : "array", "items" : {"type": "object", "properties" : {
|
||||
"type" : {"$ref": "#/definitions/map_type_t"},
|
||||
"uci" : {"type" : "object", "properties" : {
|
||||
"file" : {"type": "string"},
|
||||
"section" : {"type": "object", "properties" : {
|
||||
"type" : {"type": "string"},
|
||||
"index" : {"type": "string"}
|
||||
}
|
||||
},
|
||||
"option" : {"type": "object", "properties" : {
|
||||
"name" : {"type": "string"} }
|
||||
}
|
||||
}
|
||||
},
|
||||
"ubus" : {"type" : "object", "properties" : {
|
||||
"object" : {"type": "string"},
|
||||
"method" : {"type": "string"},
|
||||
"args" : {"type": "object"},
|
||||
"key" : {"type": "string"}
|
||||
}
|
||||
},
|
||||
"procfs" : {"type" : "object", "properties" : {
|
||||
"file" : {"type": "string"}
|
||||
}
|
||||
},
|
||||
"sysfs" : {"type" : "object", "properties" : {
|
||||
"file" : {"type": "string"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"protocols",
|
||||
"read",
|
||||
"write"
|
||||
]
|
||||
}
|
||||
|
||||
event_schema = {
|
||||
"definitions": {
|
||||
"type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"event"
|
||||
]
|
||||
},
|
||||
"protocols_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"usp"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"type" : {"$ref": "#/definitions/type_t"},
|
||||
"version" : {"type": "string"},
|
||||
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"protocols"
|
||||
]
|
||||
}
|
||||
|
||||
command_schema = {
|
||||
"definitions": {
|
||||
"type_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"command"
|
||||
]
|
||||
},
|
||||
"protocols_t": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"usp"
|
||||
]
|
||||
}
|
||||
},
|
||||
"type" : "object",
|
||||
"properties" : {
|
||||
"type" : {"$ref": "#/definitions/type_t"},
|
||||
"async" : {"type" : "boolean"},
|
||||
"protocols" : {"type" : "array", "items" : {"$ref": "#/definitions/protocols_t"}},
|
||||
"input" : {"type" : "object"},
|
||||
"output" : {"type" : "object"}
|
||||
},
|
||||
"required": [
|
||||
"type",
|
||||
"async",
|
||||
"protocols"
|
||||
]
|
||||
}
|
||||
|
||||
def print_validate_json_usage():
|
||||
print("Usage: " + sys.argv[0] + " <dm json file>")
|
||||
print("Examples:")
|
||||
print(" - " + sys.argv[0] + " datamodel.json")
|
||||
print(" ==> Validate the json file")
|
||||
print("")
|
||||
exit(1)
|
||||
|
||||
def parse_value( key , value ):
|
||||
|
||||
if key.endswith('.') and not key.startswith('Device.'):
|
||||
print(key + " is not a valid path")
|
||||
exit(1)
|
||||
|
||||
if key.endswith('.') and (JSON_PLUGIN_VERSION == 1 or JSON_PLUGIN_VERSION == 2):
|
||||
__schema = obj_schema_v1
|
||||
elif key.endswith('.'):
|
||||
__schema = obj_schema
|
||||
elif key.endswith('!'):
|
||||
__schema = event_schema
|
||||
elif key.endswith('()'):
|
||||
__schema = command_schema
|
||||
else:
|
||||
__schema = param_schema
|
||||
|
||||
validate(instance = value, schema = __schema)
|
||||
|
||||
for k, v in value.items():
|
||||
if k != "list" and k != "mapping" and k != "input" and k != "output" and isinstance(v, dict):
|
||||
parse_value(k, v)
|
||||
|
||||
### main ###
|
||||
if len(sys.argv) < 2:
|
||||
print_validate_json_usage()
|
||||
|
||||
json_file = open(sys.argv[1], "r", encoding='utf-8')
|
||||
try:
|
||||
json_data = json.loads(json_file.read())
|
||||
except ValueError:
|
||||
print(sys.argv[1] + " file has a wrong JSON format!!!!!")
|
||||
exit(1)
|
||||
|
||||
for __key, __value in json_data.items():
|
||||
|
||||
if __key == "json_plugin_version":
|
||||
|
||||
if not isinstance(__value, int) or __value not in [0, 1, 2]:
|
||||
raise ValueError("Invalid value for json_plugin_version")
|
||||
|
||||
JSON_PLUGIN_VERSION = __value
|
||||
continue
|
||||
|
||||
parse_value(__key , __value)
|
||||
|
||||
print("JSON File is Valid")
|
||||
53
bridgemngr/Makefile
Normal file
53
bridgemngr/Makefile
Normal file
@@ -0,0 +1,53 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bridgemngr
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr
|
||||
PKG_SOURCE_VERSION:=9cddf87b527ef1614a8a39db67e6578ff1810031
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/bridgemngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Bridge Manager
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/bridgemngr/description
|
||||
Package to add Device.Bridging. data model support.
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
define Package/bridgemngr/install
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
|
||||
ifeq ($(findstring iopsys,$(CONFIG_BBF_VENDOR_LIST)),iopsys)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME)
|
||||
endif
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) ~/git/bridgemngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,bridgemngr))
|
||||
@@ -7,7 +7,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.9
|
||||
PKG_VERSION:=2.1.10
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -46,14 +46,12 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/bulkdata
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/etc/config/bulkdata $(1)/etc/config/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/95-bulkdata-translation-options $(1)/etc/uci-defaults/
|
||||
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
960
bulkdata/bulkdata/usr/share/bbfdm/micro_services/bulkdata.json
Normal file
960
bulkdata/bulkdata/usr/share/bbfdm/micro_services/bulkdata.json
Normal file
@@ -0,0 +1,960 @@
|
||||
{
|
||||
"json_plugin_version": 2,
|
||||
"Device.BulkData.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"Enable": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"name": "bulkdata"
|
||||
},
|
||||
"option": {
|
||||
"name": "enable"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Status": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Enabled",
|
||||
"Disabled",
|
||||
"Error"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"name": "bulkdata"
|
||||
},
|
||||
"option": {
|
||||
"name": "enable"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"MinReportingInterval": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "0",
|
||||
"datatype": "unsignedInt",
|
||||
"unit": "seconds"
|
||||
},
|
||||
"Protocols": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "HTTP",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Streaming",
|
||||
"File",
|
||||
"HTTP",
|
||||
"MQTT"
|
||||
]
|
||||
}
|
||||
},
|
||||
"EncodingTypes": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "JSON,CSV",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"XML",
|
||||
"XDR",
|
||||
"CSV",
|
||||
"JSON"
|
||||
]
|
||||
}
|
||||
},
|
||||
"ParameterWildCardSupported": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "1",
|
||||
"datatype": "boolean"
|
||||
},
|
||||
"MaxNumberOfProfiles": {
|
||||
"type": "int",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "-1",
|
||||
"datatype": "int",
|
||||
"range": [
|
||||
{
|
||||
"min": -1
|
||||
}
|
||||
]
|
||||
},
|
||||
"MaxNumberOfParameterReferences": {
|
||||
"type": "int",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "-1",
|
||||
"datatype": "int",
|
||||
"range": [
|
||||
{
|
||||
"min": -1
|
||||
}
|
||||
]
|
||||
},
|
||||
"ProfileNumberOfEntries": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile"
|
||||
},
|
||||
"option": {
|
||||
"name": "@Count"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile"
|
||||
},
|
||||
"dmmapfile": "dmmap_bulkdata"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Enable": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "enable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Alias": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "Alias",
|
||||
"range": [
|
||||
{
|
||||
"max": 64
|
||||
}
|
||||
],
|
||||
"flags": [
|
||||
"Unique"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "alias"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Name": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 255
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"NumberOfRetainedFailedReports": {
|
||||
"type": "int",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "int",
|
||||
"range": [
|
||||
{
|
||||
"min": -1
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "nbre_of_retained_failed_reports"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Protocol": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Streaming",
|
||||
"File",
|
||||
"HTTP"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "protocol"
|
||||
}
|
||||
]
|
||||
},
|
||||
"EncodingType": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"XML",
|
||||
"XDR",
|
||||
"CSV",
|
||||
"JSON"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "encoding_type"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ReportingInterval": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"range": [
|
||||
{
|
||||
"min": 1
|
||||
}
|
||||
],
|
||||
"unit": "seconds",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "reporting_interval"
|
||||
}
|
||||
]
|
||||
},
|
||||
"TimeReference": {
|
||||
"type": "dateTime",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "dateTime",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "time_reference"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ParameterNumberOfEntries": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_parameter"
|
||||
},
|
||||
"option": {
|
||||
"name": "@Count"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.Parameter.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_parameter"
|
||||
},
|
||||
"dmmapfile": "dmmap_bulkdata"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Name": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 64
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Reference": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "reference"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.CSVEncoding.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"FieldSeparator": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_field_separator"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RowSeparator": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_row_separator"
|
||||
}
|
||||
]
|
||||
},
|
||||
"EscapeCharacter": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_escape_character"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ReportFormat": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"ParameterPerRow",
|
||||
"ParameterPerColumn"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_report_format"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RowTimestamp": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Unix-Epoch",
|
||||
"ISO-8601",
|
||||
"None"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "csv_encoding_row_time_stamp"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.JSONEncoding.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"ReportFormat": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"ObjectHierarchy",
|
||||
"NameValuePair"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "json_encoding_report_format"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ReportTimestamp": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Unix-Epoch",
|
||||
"ISO-8601",
|
||||
"None"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "json_encoding_report_time_stamp"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.HTTP.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"URL": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "URL",
|
||||
"range": [
|
||||
{
|
||||
"max": 2048
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_url"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Username": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_username"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Password": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"flags": [
|
||||
"Secure"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_password"
|
||||
}
|
||||
]
|
||||
},
|
||||
"CompressionsSupported": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "GZIP",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"GZIP",
|
||||
"Compress",
|
||||
"Deflate"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Compression": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"GZIP",
|
||||
"Compress",
|
||||
"Deflate"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_compression"
|
||||
}
|
||||
]
|
||||
},
|
||||
"MethodsSupported": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"default": "POST,PUT",
|
||||
"list": {
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"POST",
|
||||
"PUT"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Method": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"POST",
|
||||
"PUT"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_method"
|
||||
}
|
||||
]
|
||||
},
|
||||
"UseDateHeader": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_use_date_header"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RetryEnable": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_retry_enable"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RetryMinimumWaitInterval": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"range": [
|
||||
{
|
||||
"min": 1,
|
||||
"max": 65535
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_retry_minimum_wait_interval"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RetryIntervalMultiplier": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"range": [
|
||||
{
|
||||
"min": 1000,
|
||||
"max": 65535
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_retry_interval_multiplier"
|
||||
}
|
||||
]
|
||||
},
|
||||
"RequestURIParameterNumberOfEntries": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": false,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt",
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_http_request_uri_parameter"
|
||||
},
|
||||
"option": {
|
||||
"name": "@Count"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"PersistAcrossReboot": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "boolean",
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "http_persist_across_reboot"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Device.BulkData.Profile.{i}.HTTP.RequestURIParameter.{i}.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": true,
|
||||
"array": true,
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "bulkdata",
|
||||
"section": {
|
||||
"type": "profile_http_request_uri_parameter"
|
||||
},
|
||||
"dmmapfile": "dmmap_bulkdata"
|
||||
}
|
||||
}
|
||||
],
|
||||
"Name": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 64
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "name"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Reference": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"data": "@Parent",
|
||||
"type": "uci_sec",
|
||||
"key": "reference"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "JSON",
|
||||
"name": "/etc/bulkdata/bulkdata.json"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"object": "BulkData",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=csmngr
|
||||
PKG_VERSION:=0.0.5
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dcdaba75b85bf8758c34d3ae4a1be0ba09359331
|
||||
PKG_SOURCE_VERSION:=5e50fe388fff29b08d895c1c580152cccfa290ad
|
||||
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
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddnsmngr
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ddnsmngr.git
|
||||
PKG_SOURCE_VERSION:=d0d37df44644ef2c1a0b11d3a4f92dc694ae1010
|
||||
PKG_SOURCE_VERSION:=f3c818322747922035a9eafe5de05d148ce15b4b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -49,17 +49,13 @@ 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
|
||||
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/ddnsmngr,$(PKG_BUILD_DIR)/src/libddnsmngr.so)
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/ddnsmngr/input.json)
|
||||
$(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
|
||||
@@ -74,6 +70,7 @@ ifeq ($(CONFIG_DDNSMNGR_BACKEND_INADYN),y)
|
||||
$(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
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libddnsmngr.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/ddnsmngr/libddnsmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"object": "DynamicDNS",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,6 @@ menu "Configuration"
|
||||
|
||||
config DECOLLECTOR_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 4
|
||||
default 6
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.4.0.1
|
||||
PKG_VERSION:=6.0.0.9
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a42af441d0efc315714305d6b944e6b09a29b64d
|
||||
PKG_SOURCE_VERSION:=08cd179438b8085c19e7d7523c9b26adfcb93129
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.6.5
|
||||
PKG_VERSION:=3.6.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=192e74db2082e3f89f6defe9d752d752b0b09079
|
||||
PKG_SOURCE_VERSION:=85c173d1fac535726b2e750be8c282b74fb7dbca
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ LOG_PATH=/var/log/dectmngr
|
||||
DB_PATH=/etc/dect
|
||||
DCX81_UART_DT_ALIAS=/proc/device-tree/aliases/dcx81-uart
|
||||
|
||||
DECT_GPIO="$(gpiofind DCX81_RSTN | cut -d ' ' -f 2 2>/dev/null)"
|
||||
|
||||
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
|
||||
stop_and_wait_dectmngr() {
|
||||
dect_pid=$(pidof $PROG)
|
||||
@@ -64,8 +62,6 @@ start_service() {
|
||||
dcx81_uart_device=/dev/ttyH0
|
||||
fi
|
||||
|
||||
[ -n "$DECT_GPIO" ] && echo 1 > /sys/class/gpio/gpio${DECT_GPIO}/value
|
||||
|
||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
||||
|
||||
@@ -112,7 +108,6 @@ start_service() {
|
||||
stop_service() {
|
||||
has_dect || return 0
|
||||
|
||||
[ -n "$DECT_GPIO" ] && echo 0 > /sys/class/gpio/gpio${DECT_GPIO}/value
|
||||
stop_and_wait_dectmngr
|
||||
}
|
||||
|
||||
@@ -126,11 +121,6 @@ service_triggers() {
|
||||
}
|
||||
|
||||
boot() {
|
||||
[ -n "$DECT_GPIO" ] && {
|
||||
echo ${DECT_GPIO} > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${DECT_GPIO}/direction
|
||||
}
|
||||
|
||||
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
|
||||
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
|
||||
start
|
||||
|
||||
50
dhcpmngr/Makefile
Normal file
50
dhcpmngr/Makefile
Normal file
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# Copyright (C) 2024 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dhcpmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
|
||||
PKG_SOURCE_VERSION:=d15d21766c1a1e5054b2391de1cfc4708be7a14c
|
||||
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
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/dhcpmngr
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Package to add Device.DHCPv4 and v6 data model support.
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +dnsmasq
|
||||
endef
|
||||
|
||||
define Package/dhcpmngr/description
|
||||
Package to add Device.DHCPv4. and Device.DHCPv6. data model support.
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/dhcpmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/dhcpmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_lease_start_time.user $(1)/etc/udhcpc.user.d/udhcpc_lease_start_time.user
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdhcpmngr.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dhcpmngr))
|
||||
@@ -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
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmngr
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=1.0.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
|
||||
PKG_SOURCE_VERSION:=347070e096b98946ba660791e3c78d1646adc54a
|
||||
PKG_SOURCE_VERSION:=03d8d79c1221adb92b5789c03e2489d26c6ae184
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -42,9 +42,8 @@ endef
|
||||
endif
|
||||
|
||||
define Package/dnsmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/dnsmngr
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libdnsmngr.so $(1)/etc/dnsmngr
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/dnsmngr/input.json)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdnsmngr.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_SCRIPT) -d $(PKG_BUILD_DIR)/scripts/nslookup $(1)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dnsmngr))
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/dnsmngr/libdnsmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"object": "DNS",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_VERSION:=1.2.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=6009d4cdabc2fb6827a1dd6096a96e720e97750b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/dslmngr.git
|
||||
PKG_SOURCE_VERSION:=d71bef278b8222dee1c278723f8264aa8faf5e40
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -77,7 +77,7 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdsl.so $(1)/etc/dsl/
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libbbfdsl.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dslmngr))
|
||||
|
||||
@@ -211,8 +211,8 @@ create_ptm_devices() {
|
||||
|
||||
prioritize_arp()
|
||||
{
|
||||
ebtables -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
|
||||
ebtables -t nat -A POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
|
||||
ebtables --concurrent -t nat -D POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
|
||||
ebtables --concurrent -t nat -A POSTROUTING -j mark --mark-or 0x7 -p ARP >/dev/null
|
||||
}
|
||||
|
||||
xtm_remove_devices() {
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/dsl/libbbfdsl.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"root_obj": "bbfdm",
|
||||
"multiple_objects": ["DSL","PTM","ATM","FAST"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,10 +48,10 @@ validate_rule_section()
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
local rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
local rule=$(ebtables --concurrent -t broute -L BROUTING|grep -m 1 mark)
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log ebtables -t broute -D BROUTING ${rule}
|
||||
rule=$(ebtables -t broute -L BROUTING|grep -m 1 mark)
|
||||
exec_log ebtables --concurrent -t broute -D BROUTING ${rule}
|
||||
rule=$(ebtables --concurrent -t broute -L BROUTING|grep -m 1 mark)
|
||||
done
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ create_rule() {
|
||||
cmd="-p ip $cmd"
|
||||
|
||||
cmd="-s ${mac} $cmd"
|
||||
exec_log ebtables -t broute -A BROUTING ${cmd}
|
||||
exec_log ebtables --concurrent -t broute -A BROUTING ${cmd}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
|
||||
80
ebtables-extensions/Makefile
Normal file
80
ebtables-extensions/Makefile
Normal file
@@ -0,0 +1,80 @@
|
||||
#
|
||||
# Copyright (C) 2024 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ebtables-extensions
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a23a70f5518a42d663156a156c1e3356f695b5ad
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ebtables-extensions.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/vlantranslation
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Kernel module for ebtables VLAN translation
|
||||
FILES:=$(PKG_BUILD_DIR)/src/ebt_vlantranslation.ko
|
||||
DEPENDS+=+kmod-ebtables
|
||||
AUTOLOAD:=$(call AutoLoad,30,ebt_vlantranslation,1)
|
||||
KCONFIG:=
|
||||
endef
|
||||
|
||||
define KernelPackage/dscp2pbit
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Kernel module for DSCP-to-Pbit mapping
|
||||
DEPENDS+=+kmod-ebtables
|
||||
FILES:=$(PKG_BUILD_DIR)/src/ebt_dscp2pbit.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,ebt_dscp2pbit,1)
|
||||
KCONFIG:=
|
||||
endef
|
||||
|
||||
define KernelPackage/vlantranslation/description
|
||||
Kernel module to enable VLAN translation for ebtables
|
||||
endef
|
||||
|
||||
define KernelPackage/dscp2pbit/description
|
||||
Kernel module to enableDSCP-to-Pbit mapping for ebtables
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./src/* $(PKG_BUILD_DIR)/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/ebt_vlantranslation.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/ebt_dscp2pbit.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
|
||||
endef
|
||||
else
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/src/ebt_vlantranslation.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/ebt_dscp2pbit.h $(LINUX_DIR)/include/uapi/linux/netfilter_bridge/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/include/uapi/linux/netfilter_bridge/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/ebt_vlantranslation.h $(1)/include/uapi/linux/netfilter_bridge/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/ebt_dscp2pbit.h $(1)/include/uapi/linux/netfilter_bridge/
|
||||
endef
|
||||
|
||||
KERNEL_MAKE_FLAGS += -I$(LINUX_DIR)/include
|
||||
|
||||
define Build/Compile
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/src" modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,vlantranslation))
|
||||
$(eval $(call KernelPackage,dscp2pbit))
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.1.5
|
||||
PKG_VERSION:=2.1.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=53d31f7027f759a36f47c026c50eaee2888619cc
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_SOURCE_VERSION:=d029ce86fe99b7896f096f68eda3f6caa000ee5f
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -69,9 +69,10 @@ ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
|
||||
endif
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfethernet.so $(1)/etc/ethmngr
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfethernetmacvlan.so $(1)/etc/ethmngr/plugins
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bbfdm/micro_services/ethernet.json)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libbbfethernet.so $(1) $(PKG_NAME)
|
||||
ifeq ($(CONFIG_TR181_VENDOR_EXTENSIONS_MACVLAN),y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/libbbfethernetmacvlan.so $(1) $(PKG_NAME)
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ethmngr))
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/ethmngr/libbbfethernet.so",
|
||||
"plugin_dir": "/etc/ethmngr/plugins"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"object": "Ethernet",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
12
firewallmngr/Config.in
Normal file
12
firewallmngr/Config.in
Normal file
@@ -0,0 +1,12 @@
|
||||
if PACKAGE_firewallmngr
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config FIREWALLMNGR_PORT_TRIGGER
|
||||
bool "Include Device.NAT.PortTrigger"
|
||||
default y
|
||||
help
|
||||
Set this option to include support for PortTrigger object.
|
||||
|
||||
endmenu
|
||||
endif
|
||||
68
firewallmngr/Makefile
Normal file
68
firewallmngr/Makefile
Normal file
@@ -0,0 +1,68 @@
|
||||
#
|
||||
# Copyright (C) 2024 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=firewallmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=f5c3e2c93a8a992ab24291eb2c67adf77de7f896
|
||||
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
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/firewallmngr
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Package to add Device.Firewall and Device.NAT. data model support.
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +firewall
|
||||
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:kmod-ipt-trigger +FIREWALLMNGR_PORT_TRIGGER:kmod-ip6t-trigger
|
||||
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:iptables-mod-nfqueue
|
||||
endef
|
||||
|
||||
define Package/firewallmngr/description
|
||||
Package to add Device.Firewall. and Device.NAT. data model support.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/firewallmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_FIREWALLMNGR_PORT_TRIGGER),y)
|
||||
TARGET_CFLAGS += -DINCLUDE_PORT_TRIGGER
|
||||
endif
|
||||
|
||||
define Package/firewallmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
ifeq ($(CONFIG_FIREWALLMNGR_PORT_TRIGGER),y)
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/lib/port-trigger
|
||||
|
||||
$(INSTALL_BIN) ./files/port-trigger/etc/init.d/port-trigger $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/port-trigger/etc/config/port-trigger $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/port-trigger/lib/port-trigger/port_trigger.sh $(1)/lib/port-trigger/
|
||||
endif
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libfirewallmngr.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,firewallmngr))
|
||||
1
firewallmngr/files/port-trigger/etc/config/port-trigger
Normal file
1
firewallmngr/files/port-trigger/etc/config/port-trigger
Normal file
@@ -0,0 +1 @@
|
||||
#port trigger uci file
|
||||
21
firewallmngr/files/port-trigger/etc/init.d/port-trigger
Normal file
21
firewallmngr/files/port-trigger/etc/init.d/port-trigger
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
STOP=20
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/port-trigger/port_trigger.sh
|
||||
|
||||
start_service() {
|
||||
port_trigger_handling
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger firewall
|
||||
procd_add_reload_trigger port-trigger
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
start
|
||||
}
|
||||
157
firewallmngr/files/port-trigger/lib/port-trigger/port_trigger.sh
Executable file
157
firewallmngr/files/port-trigger/lib/port-trigger/port_trigger.sh
Executable file
@@ -0,0 +1,157 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
process_port_trigger() {
|
||||
local rule_id="$1"
|
||||
local is_enabled=""
|
||||
local duration=""
|
||||
local trigger_dport=""
|
||||
local trigger_dport_end=""
|
||||
local protocol=""
|
||||
local interface=""
|
||||
local open_dport=""
|
||||
local open_dport_end=""
|
||||
local open_protocol=""
|
||||
local ptg_id=""
|
||||
local IP_RULE=""
|
||||
local IP6_RULE=""
|
||||
local IP_RULE_FWD=""
|
||||
|
||||
get_port_trigger() {
|
||||
local ptg_name
|
||||
config_get ptg_name "$1" "name"
|
||||
if [ "$ptg_name" == "$2" ]; then
|
||||
ptg_id="$1"
|
||||
return
|
||||
fi
|
||||
}
|
||||
|
||||
ptg_id=""
|
||||
config_get name "$rule_id" "port_trigger"
|
||||
config_foreach get_port_trigger "port_trigger" "$name"
|
||||
[ -z "$ptg_id" ] && return
|
||||
|
||||
is_enabled=$(uci -q get port-trigger."$ptg_id".enable)
|
||||
|
||||
if [ -z "$is_enabled" ] || [ "$is_enabled" = "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
protocol=$(uci -q get port-trigger."$ptg_id".protocol)
|
||||
[ -z "$protocol" ] && return
|
||||
|
||||
if [ "$protocol" = "UDP" ] || [ "$protocol" = "udp" ]; then
|
||||
IP_RULE="$IP_RULE -p udp"
|
||||
IP6_RULE="$IP6_RULE -p udp"
|
||||
IP_RULE_FWD="$IP_RULE_FWD -p udp"
|
||||
elif [ "$protocol" = "TCP" ] || [ "$protocol" = "tcp" ]; then
|
||||
IP_RULE="$IP_RULE -p tcp"
|
||||
IP6_RULE="$IP6_RULE -p tcp"
|
||||
IP_RULE_FWD="$IP_RULE_FWD -p tcp"
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
trigger_dport=$(uci -q get port-trigger."$ptg_id".port)
|
||||
[ -z "$trigger_dport" ] && return
|
||||
IP_RULE="$IP_RULE --dport $trigger_dport"
|
||||
IP6_RULE="$IP6_RULE --dport $trigger_dport"
|
||||
|
||||
trigger_dport_end=$(uci -q get port-trigger."$ptg_id".end_port_range)
|
||||
if [ -n "$trigger_dport_end" ]; then
|
||||
IP_RULE="$IP_RULE:$trigger_dport"
|
||||
IP6_RULE="$IP6_RULE:$trigger_dport"
|
||||
fi
|
||||
|
||||
config_get open_protocol "$rule_id" "protocol"
|
||||
if [ "$open_protocol" = "UDP" ] || [ "$open_protocol" = "udp" ]; then
|
||||
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto udp"
|
||||
IP6_RULE="$IP6_RULE -j TRIGGER --trigger-type out --trigger-proto udp"
|
||||
elif [ "$open_protocol" = "TCP" ] || [ "$open_protocol" = "tcp" ]; then
|
||||
IP_RULE="$IP_RULE -j TRIGGER --trigger-type out --trigger-proto tcp"
|
||||
IP6_RULE="$IP6_RULE -j TRIGGER --trigger-type out --trigger-proto tcp"
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
config_get open_dport "$rule_id" "port"
|
||||
[ -z "$open_dport" ] && return
|
||||
IP_RULE="$IP_RULE --trigger-match $open_dport"
|
||||
IP6_RULE="$IP6_RULE --trigger-match $open_dport"
|
||||
IP_RULE_FWD="$IP_RULE_FWD --dport $open_dport"
|
||||
|
||||
config_get open_dport_end "$rule_id" "end_port_range"
|
||||
if [ -z "$open_dport_end" ]; then
|
||||
IP_RULE="$IP_RULE --trigger-relate $open_dport"
|
||||
IP6_RULE="$IP6_RULE --trigger-relate $open_dport"
|
||||
else
|
||||
IP_RULE="$IP_RULE-$open_dport_end --trigger-relate $open_dport-$open_dport_end"
|
||||
IP6_RULE="$IP6_RULE-$open_dport_end --trigger-relate $open_dport-$open_dport_end"
|
||||
IP_RULE_FWD="$IP_RULE_FWD:$open_dport_end"
|
||||
fi
|
||||
|
||||
duration=$(uci -q get port-trigger."$ptg_id".auto_disable_duration)
|
||||
if [ -n "$duration" ]; then
|
||||
IP_RULE="$IP_RULE --trigger-timeout $duration"
|
||||
IP6_RULE="$IP6_RULE --trigger-timeout $duration"
|
||||
fi
|
||||
|
||||
interface=$(uci -q get port-trigger."$ptg_id".src)
|
||||
[ -z "$interface" ] && return
|
||||
device=$(uci -q get network.$interface.device)
|
||||
IP_RULE_1="iptables -w -t nat -A prerouting_porttrigger -i $device $IP_RULE"
|
||||
echo "$IP_RULE_1">>/tmp/port_trigger_iptables
|
||||
|
||||
IP_RULE_1="ip6tables -w -t nat -A prerouting_porttrigger -i $device $IP6_RULE"
|
||||
echo "$IP_RULE_1">>/tmp/port_trigger_ip6tables
|
||||
|
||||
if [ -n "$duration" ]; then
|
||||
echo "iptables -w -t filter -A forwarding_wan_porttrigger $IP_RULE_FWD -j TRIGGER --trigger-type in --trigger-timeout $duration">>/tmp/port_trigger_iptables
|
||||
echo "ip6tables -w -t filter -A forwarding_wan_porttrigger $IP_RULE_FWD -j TRIGGER --trigger-type in --trigger-timeout $duration">>/tmp/port_trigger_ip6tables
|
||||
|
||||
echo "iptables -w -t nat -A prerouting_wan_porttrigger $IP_RULE_FWD -j TRIGGER --trigger-type dnat --trigger-timeout $duration">>/tmp/port_trigger_iptables
|
||||
else
|
||||
echo "iptables -w -t filter -A forwarding_wan_porttrigger $IP_RULE_FWD -j TRIGGER --trigger-type in">>/tmp/port_trigger_iptables
|
||||
echo "ip6tables -w -t filter -A forwarding_wan_porttrigger $IP_RULE_FWD -j TRIGGER --trigger-type in">>/tmp/port_trigger_ip6tables
|
||||
|
||||
echo "iptables -w -t nat -A prerouting_wan_porttrigger $IP_RULE_FWD -j TRIGGER --trigger-type dnat">>/tmp/port_trigger_iptables
|
||||
fi
|
||||
}
|
||||
|
||||
port_trigger_handling() {
|
||||
rm /tmp/port_trigger_iptables 2> /dev/null
|
||||
rm /tmp/port_trigger_ip6tables 2> /dev/null
|
||||
touch /tmp/port_trigger_iptables
|
||||
touch /tmp/port_trigger_ip6tables
|
||||
|
||||
echo "iptables -w -t nat -F prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "iptables -w -t filter -F forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "iptables -w -t nat -F prerouting_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "ip6tables -w -t nat -F prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
echo "ip6tables -w -t filter -F forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
|
||||
echo "iptables -w -t nat -N prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t nat -I PREROUTING -j prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "iptables -w -t filter -N forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t filter -I forwarding_wan_rule -j forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "iptables -w -t nat -N prerouting_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t nat -I prerouting_wan_rule -j prerouting_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
|
||||
echo "ip6tables -w -t nat -N prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "ip6tables -w -t nat -I PREROUTING -j prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
echo "ip6tables -w -t filter -N forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "ip6tables -w -t filter -I forwarding_wan_rule -j forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
|
||||
# Load /etc/config/port-trigger UCI file
|
||||
config_load port-trigger
|
||||
config_foreach process_port_trigger rule
|
||||
|
||||
sh /tmp/port_trigger_iptables
|
||||
sh /tmp/port_trigger_ip6tables
|
||||
}
|
||||
@@ -28,7 +28,7 @@ define KernelPackage/$(PKG_NAME)
|
||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||
DEPENDS:= +(TARGET_brcmbca):bcmkernel
|
||||
DEPENDS:= +(TARGET_brcmbca):bcm963xx-bsp
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_VERSION:=1.2.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b4990b384461f2d1ff75a122a7fa5d9276f211bb
|
||||
PKG_SOURCE_VERSION:=20402c9fb60afa0678d844b0401e1b89699ff8b3
|
||||
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
|
||||
@@ -22,7 +22,7 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
|
||||
|
||||
define Package/hostmngr
|
||||
SECTION:=utils
|
||||
@@ -60,11 +60,10 @@ MAKE_PATH:=src
|
||||
define Package/hostmngr/install
|
||||
$(CP) ./files/etc $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/hostmngr/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/
|
||||
$(INSTALL_DIR) $(1)/usr/share/hostmngr
|
||||
$(INSTALL_DATA) ./files/scripts/hosts_acl.sh $(1)/usr/share/hostmngr/
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/hostmngr/libhostmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"object": "Hosts",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,11 +277,15 @@ 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
|
||||
hosts_ipv4_forward=$(iptables -t filter --list -n | grep hosts_forward)
|
||||
if [ -z "$hosts_ipv4_forward" ]; then
|
||||
echo "iptables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
|
||||
fi
|
||||
|
||||
hosts_ipv6_forward=$(ip6tables -t filter --list -n | grep hosts_forward)
|
||||
if [ -z "$hosts_ipv6_forward" ]; then
|
||||
echo "ip6tables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "ip6tables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.7.4
|
||||
PKG_VERSION:=9.7.15
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=1a5ed79a014ff3e9633b70b310bf3f21dea6f036
|
||||
PKG_SOURCE_VERSION:=fb3c8833f3fce7fe3659395cab48e7078f2007d5
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -48,7 +48,6 @@ define Package/icwmp/install
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd/plugins
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
@@ -59,9 +58,8 @@ define Package/icwmp/install
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
|
||||
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/icwmpd,$(PKG_BUILD_DIR)/libcwmpdm.so)
|
||||
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/icwmpd/plugins,./files/etc/bbfdm/json/CWMPManagementServer.json)
|
||||
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/icwmpd/input.json)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libcwmpdm.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,icwmp))
|
||||
|
||||
@@ -5,7 +5,7 @@ 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"
|
||||
#option ssl_capath "/etc/icwmpd/ca.pem"
|
||||
# compression possible configs: GZIP, Deflate, Disabled
|
||||
option compression 'Disabled'
|
||||
# possible configs interval :[1:65535]
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
"loglevel": "1"
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/icwmpd/libcwmpdm.so",
|
||||
"plugin_dir": "/etc/icwmpd/plugins/"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"parent_dm": "Device.",
|
||||
"multiple_objects": [ "ManagementServer", "XMPP" , "CWMPManagementServer"],
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,15 @@ log() {
|
||||
}
|
||||
|
||||
regenerate_ssl_link() {
|
||||
local cert_dir="${1%/}"
|
||||
local cert_dir
|
||||
|
||||
cert_dir="${1%/}"
|
||||
if [ -f "${cert_dir}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do not generate the c_rehash if its system default cert path
|
||||
# ca-certificate package already generates c_rehash on compilation
|
||||
[ ! -d "${cert_dir}" ] || [ "${cert_dir}" = "/etc/ssl/certs" ] && return 0
|
||||
|
||||
generate_links() {
|
||||
@@ -26,14 +34,15 @@ regenerate_ssl_link() {
|
||||
for cfile in ${files}; do
|
||||
if [ -f "${cfile}" ]; then
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
[ -f "${cert_dir}/${rehash}.0" ] || \
|
||||
if [ ! -f "${cert_dir}/${rehash}.0" ]; then
|
||||
log "Generating c_rehash for ${cfile}=>${rehash}.0"
|
||||
ln -s "${cfile}" "${cert_dir}/${rehash}.0"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
generate_links "pem"
|
||||
generate_links "crt"
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.3.12
|
||||
PKG_VERSION:=8.4.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4f94b73ac3e9472bbcd84c6c8f91118aa6ca9f6b
|
||||
PKG_SOURCE_VERSION:=4d60d4a9b55940fffa39b7799abf2a7962ae2113
|
||||
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
|
||||
@@ -22,6 +22,7 @@ PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
|
||||
|
||||
|
||||
define Package/ieee1905/Default
|
||||
@@ -38,7 +39,7 @@ define Package/libieee1905
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=libieee1905.so (library for CMDU and TLV handling)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json
|
||||
+libjson-c +libblobmsg-json +libwifiutils
|
||||
endef
|
||||
|
||||
define Package/ieee1905
|
||||
@@ -46,7 +47,8 @@ define Package/ieee1905
|
||||
TITLE:=ieee1905d (daemon implementing 1905.1 and provides cli)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ubus +libpthread \
|
||||
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi
|
||||
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi \
|
||||
+libwifiutils +libbbfdm-api
|
||||
endef
|
||||
|
||||
include $(wildcard plugins/*.mk)
|
||||
@@ -107,6 +109,7 @@ define Package/ieee1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ieee1905d $(1)/usr/sbin/
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/tr181/ieee1905dm.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
define Package/libieee1905/install
|
||||
|
||||
@@ -12,7 +12,7 @@ define Package/ieee1905-map-plugin/config
|
||||
|
||||
config MULTIAP_EASYMESH_VERSION
|
||||
int "Easymesh version"
|
||||
default 4
|
||||
default 6
|
||||
|
||||
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
bool "Sync configuration between dynamic controllers in the network"
|
||||
|
||||
335
iop/config
335
iop/config
@@ -1,335 +0,0 @@
|
||||
############
|
||||
# Generic #
|
||||
##########
|
||||
|
||||
# Build #
|
||||
CONFIG_BUILD_LOG=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_DEVEL=y
|
||||
# CONFIG_USE_SSTRIP is not set
|
||||
CONFIG_USE_STRIP=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
|
||||
CONFIG_JSON_CYCLONEDX_SBOM=y
|
||||
CONFIG_INCLUDE_CONFIG=y
|
||||
|
||||
# Image #
|
||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
|
||||
# Although UBIFS and EXT4 images work on all non-secure-boot devices,
|
||||
# squashfs is the only officially supported rootfs filesystem.
|
||||
# A writable rootfs is useful for developping an debugging preinit code.
|
||||
# CONFIG_TARGET_ROOTFS_UBIFS is not set
|
||||
# CONFIG_TARGET_ROOTFS_EXT4FS is not set
|
||||
|
||||
# /etc/banner and /etc/device_info #
|
||||
CONFIG_IMAGEOPT=y
|
||||
CONFIG_VERSIONOPT=y
|
||||
CONFIG_VERSION_MANUFACTURER="IOPSYS"
|
||||
CONFIG_VERSION_MANUFACTURER_URL="https://iopsys.eu/"
|
||||
CONFIG_VERSION_DIST="IOWRT"
|
||||
|
||||
# OpenWrt is given by CONFIG_VERSION_NUMBER which we do not want to override.
|
||||
# disabling CONFIG_VERSION_FILENAMES will hide the OpenWrt version from the image filename
|
||||
# CONFIG_VERSION_FILENAMES is not set
|
||||
|
||||
# CONFIG_VERSION_CODE is set to the IOWRT version instead by the genconfig-script and
|
||||
# CONFIG_VERSION_CODE_FILENAMES will put it into the image filename.
|
||||
CONFIG_VERSION_CODE_FILENAMES=y
|
||||
|
||||
CONFIG_VERSION_HOME_URL="https://iopsys.eu"
|
||||
CONFIG_VERSION_BUG_URL="https://iopsys.eu"
|
||||
CONFIG_VERSION_SUPPORT_URL="https://iopsys.eu"
|
||||
|
||||
# /lib/preinit #
|
||||
CONFIG_PREINITOPT=y
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_STDERR is not set
|
||||
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
||||
CONFIG_TARGET_PREINIT_TIMEOUT=1
|
||||
# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set
|
||||
CONFIG_TARGET_PREINIT_IFNAME=""
|
||||
CONFIG_TARGET_PREINIT_IP=""
|
||||
CONFIG_TARGET_PREINIT_NETMASK=""
|
||||
CONFIG_TARGET_PREINIT_BROADCAST=""
|
||||
|
||||
# Mirror #
|
||||
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
|
||||
##################
|
||||
# IOWRT Add-ons #
|
||||
################
|
||||
|
||||
# EasySoC HAL #
|
||||
CONFIG_PACKAGE_qosmngr=y
|
||||
CONFIG_PACKAGE_libwifiutils=y
|
||||
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_decollector=y
|
||||
CONFIG_PACKAGE_map-agent=y
|
||||
CONFIG_PACKAGE_map-controller=y
|
||||
|
||||
# Network #
|
||||
CONFIG_PACKAGE_hostmngr=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
|
||||
# System #
|
||||
CONFIG_PACKAGE_imonitor=m
|
||||
CONFIG_PACKAGE_questd=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_usermngr=y
|
||||
|
||||
# TR-x69 #
|
||||
CONFIG_PACKAGE_libbbfdm=y
|
||||
CONFIG_PACKAGE_bbfdmd=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_stunc=y
|
||||
CONFIG_PACKAGE_swmodd=y
|
||||
CONFIG_PACKAGE_twamp=y
|
||||
CONFIG_PACKAGE_udpecho-client=y
|
||||
CONFIG_PACKAGE_udpecho-server=y
|
||||
CONFIG_PACKAGE_userinterface=y
|
||||
CONFIG_PACKAGE_xmppc=y
|
||||
CONFIG_PACKAGE_timemngr=y
|
||||
CONFIG_PACKAGE_self-diagnostics=y
|
||||
|
||||
# WebGUI #
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
|
||||
|
||||
############
|
||||
# Network #
|
||||
##########
|
||||
|
||||
# Protocols #
|
||||
CONFIG_PACKAGE_6in4=y
|
||||
CONFIG_PACKAGE_6rd=y
|
||||
CONFIG_PACKAGE_6to4=y
|
||||
CONFIG_PACKAGE_chat=y
|
||||
CONFIG_PACKAGE_comgt=y
|
||||
CONFIG_PACKAGE_comgt-directip=y
|
||||
CONFIG_PACKAGE_comgt-ncm=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_firewall=y
|
||||
# CONFIG_PACKAGE_firewall4 is not set
|
||||
CONFIG_PACKAGE_gre=y
|
||||
CONFIG_PACKAGE_map=y
|
||||
CONFIG_PACKAGE_ntfs-3g=y
|
||||
CONFIG_PACKAGE_ntpd=y
|
||||
CONFIG_PACKAGE_odhcp6c=y
|
||||
CONFIG_PACKAGE_odhcpd=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoe=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
CONFIG_PACKAGE_ppp-mod-pptp=y
|
||||
CONFIG_PACKAGE_ppp-multilink=y
|
||||
# CONFIG_PACKAGE_ppp is not set
|
||||
CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
|
||||
# Services #
|
||||
CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
CONFIG_PACKAGE_ssdpd=y
|
||||
CONFIG_PACKAGE_miniupnpd-iptables=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=y
|
||||
|
||||
# Tools and Utilities #
|
||||
CONFIG_PACKAGE_curl=y
|
||||
CONFIG_PACKAGE_libcurl=y
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_ip-bridge=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_ip6tables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipmark=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iptables-mod-nflog=y
|
||||
CONFIG_PACKAGE_iptables-mod-nfqueue=y
|
||||
CONFIG_PACKAGE_iputils-arping=y
|
||||
CONFIG_PACKAGE_iputils-ping=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_socat=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
|
||||
|
||||
############
|
||||
# System #
|
||||
##########
|
||||
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_ca-certificates=y
|
||||
CONFIG_PACKAGE_crun=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_gpiod-tools=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libcap-bin=y
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_procd-ujail=m
|
||||
CONFIG_PACKAGE_quota=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rrdns=y
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_uledd=y
|
||||
# The urandom-seed package is very strange. It seeds urandom with urandom...
|
||||
# Disable it. Most SoCs nowadays has HW random generators anyway.
|
||||
# CONFIG_PACKAGE_urandom-seed is not set
|
||||
# CONFIG_PACKAGE_urngd is not set
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_uuidgen=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
|
||||
|
||||
################
|
||||
# LuCI WebGUI #
|
||||
##############
|
||||
|
||||
# BEGIN: luci-nginx metapackage with some changes
|
||||
# We do not want libiwinfo-lua on non-WiFi targets, but it is already
|
||||
# depended on by other luci-packages, so no need to take it in explicitly
|
||||
CONFIG_PACKAGE_luci-mod-admin-full=y
|
||||
CONFIG_PACKAGE_luci-app-firewall=y
|
||||
CONFIG_PACKAGE_luci-app-opkg=y
|
||||
CONFIG_PACKAGE_luci-proto-ppp=y
|
||||
CONFIG_PACKAGE_luci-proto-ipv6=y
|
||||
# CONFIG_LUCI_JSMIN is not set
|
||||
# CONFIG_LUCI_CSSTIDY is not set
|
||||
CONFIG_PACKAGE_luci-mod-dashboard=y
|
||||
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
|
||||
CONFIG_PACKAGE_nginx-mod-luci=y
|
||||
|
||||
|
||||
############
|
||||
# BusyBox #
|
||||
##########
|
||||
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||
CONFIG_BUSYBOX_CONFIG_CTTYHACK=y
|
||||
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
|
||||
# CONFIG_BUSYBOX_CONFIG_HTTPD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_INSMOD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MODINFO is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS=y
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
|
||||
CONFIG_BUSYBOX_CONFIG_LOGIN=y
|
||||
# CONFIG_BUSYBOX_CONFIG_LSMOD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_LSPCI=y
|
||||
CONFIG_BUSYBOX_CONFIG_LSUSB=y
|
||||
CONFIG_BUSYBOX_CONFIG_MICROCOM=y
|
||||
# CONFIG_BUSYBOX_CONFIG_RMMOD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_STTY=y
|
||||
CONFIG_BUSYBOX_CONFIG_TFTP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CGI=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_HTTPD_USE_SENDFILE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_NOLOGIN is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_SECURETTY=y
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_GET=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_TFTP_PUT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_WGET is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_LOGIN_SCRIPTS is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_PAM is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_TFTP_DEBUG is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_NTPD is not set
|
||||
CONFIG_BUSYBOX_CONFIG_MOUNTPOINT=y
|
||||
CONFIG_BUSYBOX_CONFIG_RUN_PARTS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_RUN_PARTS_FANCY=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS=y
|
||||
CONFIG_BUSYBOX_CONFIG_GZIP_FAST=2
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FLOAT_DURATION=y
|
||||
CONFIG_BUSYBOX_CONFIG_USLEEP=y
|
||||
CONFIG_BUSYBOX_CONFIG_REALPATH=y
|
||||
CONFIG_BUSYBOX_CONFIG_TTY=y
|
||||
CONFIG_BUSYBOX_CONFIG_BLOCKDEV=y
|
||||
CONFIG_BUSYBOX_CONFIG_PARTPROBE=y
|
||||
CONFIG_BUSYBOX_CONFIG_LFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FDISK=y
|
||||
CONFIG_BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_GPT_LABEL=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED=y
|
||||
CONFIG_BUSYBOX_CONFIG_IONICE=y
|
||||
CONFIG_BUSYBOX_CONFIG_RENICE=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_BTRFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_NOHUP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="sha512"
|
||||
# CONFIG_BUSYBOX_CONFIG_ARPING is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_PING is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_PING6 is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_PING is not set
|
||||
@@ -33,10 +33,10 @@ _iop()
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
|
||||
feeds_update feeds_update-legacy genconfig genconfig-legacy \
|
||||
feeds_update genconfig \
|
||||
generate_tarballs install_key \
|
||||
scp_changes setup_host ssh_install_key status \
|
||||
update_package update_feed_branches ssh_upgrade smoketest"
|
||||
update_feed_branches ssh_upgrade smoketest"
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ] ; then
|
||||
|
||||
|
||||
@@ -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,535 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig-legacy {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
brcmbca_feed="target/linux/feeds/brcmbca"
|
||||
airoha_feed="target/linux/feeds/airoha"
|
||||
x86_feed="target/linux/feeds/x86"
|
||||
armsr_feed="target/linux/feeds/armsr"
|
||||
mediatek_feed="target/linux/feeds/mediatek"
|
||||
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
|
||||
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
|
||||
function verify_config {
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
|
||||
while read -r line
|
||||
do
|
||||
conf_opt=$(echo $line | grep "^[ #]*CONFIG_" | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
done < .genconfig.config
|
||||
}
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/feeds/$TARGET" ]; then
|
||||
local targetpath="./target/linux/feeds/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
if [ -e "$targetpath/genconfig" ]; then
|
||||
profiles=$(cd $targetpath; ./genconfig)
|
||||
|
||||
for p in $profiles; do
|
||||
if [ $p == $profile ]; then
|
||||
pfound=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $pfound -eq 1 ]; then
|
||||
target="$(echo $TARGET | tr '-' '_')"
|
||||
target_config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
[ -e $brcmbca_feed/genconfig ] &&
|
||||
brcmbca=$(cd $brcmbca_feed; ./genconfig)
|
||||
[ -e $airoha_feed/genconfig ] &&
|
||||
airoha=$(cd $airoha_feed; ./genconfig)
|
||||
[ -e $x86_feed/genconfig ] &&
|
||||
x86=$(cd $x86_feed; ./genconfig)
|
||||
[ -e $armsr_feed/genconfig ] &&
|
||||
armsr=$(cd $armsr_feed; ./genconfig)
|
||||
[ -e $mediatek_feed/genconfig ] &&
|
||||
mediatek=$(cd $mediatek_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
|
||||
ipq95xx=$(cd $qualcomm_ipq95xx_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq53xx_feed/genconfig ] &&
|
||||
ipq53xx=$(cd $qualcomm_ipq53xx_feed; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in brcmbca airoha x86 armsr mediatek ipq95xx ipq53xx; do
|
||||
echo "$list based boards:"
|
||||
a=$(echo "${!list}" | sort)
|
||||
for b in $a; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
for p in $airoha; do
|
||||
if [ $p == $profile ]; then
|
||||
target="airoha"
|
||||
target_config_path="$airoha_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="x86"
|
||||
target_config_path="$x86_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $armsr; do
|
||||
if [ $p == $profile ]; then
|
||||
target="armsr"
|
||||
target_config_path="$armsr_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="mediatek"
|
||||
target_config_path="$mediatek_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $ipq95xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="ipq95xx"
|
||||
target_config_path="$qualcomm_ipq95xx_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $ipq53xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="ipq53xx"
|
||||
target_config_path="$qualcomm_ipq53xx_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $brcmbca; do
|
||||
if [ $p == $profile ]; then
|
||||
target="brcmbca"
|
||||
target_config_path="$brcmbca_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 genconfig-legacy [ 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"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
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 "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
|
||||
list_customers()
|
||||
{
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "No boards found for $CUSTOMER"
|
||||
fi
|
||||
elif [ "$CUSTOMER" ]; then
|
||||
echo "No customer called $CUSTOMER"
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "has no boards"
|
||||
fi
|
||||
done
|
||||
elif [ "$customers" ]; then
|
||||
echo -e "$customers"
|
||||
else
|
||||
echo "no customers found"
|
||||
fi
|
||||
else
|
||||
echo "No $CUSTCONF folder found"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
git remote -v | grep -q http || {
|
||||
CUSTBRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
if git ls-remote $CUSTREPO -q 2>/dev/null; then
|
||||
if [ ! -d "$CUSTPATH" ]; then
|
||||
echo "Cloning $CUSTBRANCH branch of $CUSTREPO"
|
||||
git clone -b "$CUSTBRANCH" "$CUSTREPO" "$CUSTPATH" 2>/dev/null || {
|
||||
DEFBRANCH="$(git remote show $CUSTREPO | grep 'HEAD branch' | cut -d' ' -f5)"
|
||||
echo "$CUSTBRANCH branch is not found, cloning $DEFBRANCH branch of $CUSTREPO"
|
||||
git clone "$CUSTREPO" "$CUSTPATH"
|
||||
}
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd $CUSTPATH
|
||||
echo "Checking out $CUSTBRANCH branch in $CUSTPATH"
|
||||
git checkout "$CUSTBRANCH" 2>/dev/null || {
|
||||
DEFBRANCH="$(git symbolic-ref refs/remotes/origin/HEAD | cut -d '/' -f4)"
|
||||
echo "Checking out $CUSTBRANCH branch has failed, using $DEFBRANCH branch in $CUSTPATH"
|
||||
}
|
||||
v "git pull"
|
||||
git pull
|
||||
cd - >/dev/null #go back
|
||||
fi
|
||||
else
|
||||
echo "You do not have access to $CUSTREPO"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir -p $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
}
|
||||
|
||||
get_subtarget_for_device() {
|
||||
readonly target="$1"
|
||||
readonly device="$2"
|
||||
readonly targetinfo_file="tmp/info/.targetinfo-feeds_$target"
|
||||
readonly target_profile_line="Target-Profile: DEVICE_$device"
|
||||
# We want to know after which Target: $target/$subtarget line
|
||||
# our $target_profile_line appears
|
||||
# This is a crude way to "parse" the file using shell 🤯
|
||||
# 1. grep for both lines with line number output
|
||||
# 2. grep again to determine the device profile line that we looked for
|
||||
# but output one context line before as well to determine corresponding subtarget line
|
||||
# 4. Use head and sed to extract the subtarget
|
||||
grep "^Target: $target/\|^$target_profile_line" "$targetinfo_file" \
|
||||
| grep -E -B1 "^$target_profile_line" \
|
||||
| head -n1 \
|
||||
| sed -E "s|^Target: $target/||"
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
shift
|
||||
local CUSTOMERS=$@
|
||||
|
||||
# Validate seleced board and customers
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ ! -d "$CUSTCONF/$CUSTOMER/" ]; then
|
||||
echo "Customer profile for '$CUSTOMER' does not exist"
|
||||
exit 1
|
||||
elif [ ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "'$BOARDTYPE' board profile does not exist for customer '$CUSTOMER'"
|
||||
if [ -f "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
echo "Common profile configuration will be used"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
rm -f .config
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
# hack to support custom-devices until we have deprecated this genconfig-script...
|
||||
local custom_found=false
|
||||
local used_config_file
|
||||
|
||||
for config_file in feeds/*/devices/$target/config/$BOARDTYPE/config; do
|
||||
if [ "$custom_found" = "true" ]; then
|
||||
echo
|
||||
echo "Error was found!"
|
||||
echo "Please use only one path."
|
||||
echo "Two instances of $target/config/$BOARDTYPE exists:"
|
||||
echo "Path 1: $used_config_file"
|
||||
echo "Path 2: $config_file"
|
||||
return 1
|
||||
fi
|
||||
if [ -f "$config_file" ]; then
|
||||
cat "$config_file" >> .config
|
||||
echo "" >> .config
|
||||
custom_found=true
|
||||
used_config_file=$config_file
|
||||
fi
|
||||
done
|
||||
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
case "$target" in
|
||||
airoha | mediatek | brcmbca | ipq95xx | ipq53xx)
|
||||
# This assumes the device name to be unique within one target,
|
||||
# which is a fair assumption to make.
|
||||
local subtarget="$(get_subtarget_for_device "${target/_/-}" "$BOARDTYPE")"
|
||||
if [ -z "$subtarget" ]; then
|
||||
echo "Error determining subtarget for $target / ${BOARDTYPE}"
|
||||
return 1
|
||||
fi
|
||||
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
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
local version="${git_version,,}${CUSTOMERS:+-${CUSTOMERS// /}}"
|
||||
local version_lower="${version,,}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${version_lower}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${version_lower}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
# rewrite url to clone with ssh instead of http
|
||||
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
||||
else
|
||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# we need to signal to bradcom SDK that we have changed the board id
|
||||
# currently boardparms.c and boardparms_voice.c is the only place that is depending on boardid name
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### main #####
|
||||
if [ ! -e tmp/.iop_bootstrap ]; then
|
||||
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
|
||||
echo "Run: iop feeds_update"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-b|--boards)set_target LIST;exit 0;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@" || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig-legacy" "Generate configuration for board and customer - legacy mode"
|
||||
@@ -1,503 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function genconfig_min-legacy {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
brcmbca_feed="target/linux/feeds/brcmbca"
|
||||
airoha_feed="target/linux/feeds/airoha"
|
||||
x86_feed="target/linux/feeds/x86"
|
||||
armsr_feed="target/linux/feeds/armsr"
|
||||
mediatek_feed="target/linux/feeds/mediatek"
|
||||
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
|
||||
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Yellow='\033[0;33m' # Yellow
|
||||
|
||||
function find_last {
|
||||
egrep "^[ #]*${1}[ =]" $2 | tail -n1
|
||||
}
|
||||
|
||||
function is_new {
|
||||
for opt in $conf_warned
|
||||
do
|
||||
if [ "$opt" == "$1" ]
|
||||
then
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
# option not found return true
|
||||
return 0
|
||||
}
|
||||
|
||||
function verify_config {
|
||||
local conf_opt
|
||||
local conf_org
|
||||
local conf_new
|
||||
|
||||
while read -r line
|
||||
do
|
||||
conf_opt=$(echo $line | grep "^[ #]*CONFIG_" | sed 's|.*\(CONFIG_[^ =]*\)[ =].*|\1|')
|
||||
if [ -n "${conf_opt}" ]
|
||||
then
|
||||
conf_org=$(find_last ${conf_opt} .genconfig.config)
|
||||
conf_new=$(find_last ${conf_opt} .config)
|
||||
if [ "$conf_org" != "$conf_new" ]
|
||||
then
|
||||
if is_new $conf_opt
|
||||
then
|
||||
echo -e "config option [${Red}$conf_opt${Color_Off}] is not set correctly in .config"
|
||||
echo -e "got value [${Yellow}$conf_new${Color_Off}] but wanted [${Yellow}$conf_org${Color_Off}]"
|
||||
echo "This is a real problem somebody needs to investigate"
|
||||
echo ""
|
||||
conf_warned="$conf_warned $conf_opt"
|
||||
fi
|
||||
else
|
||||
true
|
||||
# for debug to see all options
|
||||
#echo -e "wanted [$conf_org] got [$conf_new]"
|
||||
fi
|
||||
fi
|
||||
done < .genconfig.config
|
||||
}
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/feeds/$TARGET" ]; then
|
||||
local targetpath="./target/linux/feeds/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
if [ -e "$targetpath/genconfig" ]; then
|
||||
profiles=$(cd $targetpath; ./genconfig)
|
||||
|
||||
for p in $profiles; do
|
||||
if [ $p == $profile ]; then
|
||||
pfound=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $pfound -eq 1 ]; then
|
||||
target="$(echo $TARGET | tr '-' '_')"
|
||||
target_config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
[ -e $brcmbca_feed/genconfig ] &&
|
||||
brcmbca=$(cd $brcmbca_feed; ./genconfig)
|
||||
[ -e $airoha_feed/genconfig ] &&
|
||||
airoha=$(cd $airoha_feed; ./genconfig)
|
||||
[ -e $x86_feed/genconfig ] &&
|
||||
x86=$(cd $x86_feed; ./genconfig)
|
||||
[ -e $armsr_feed/genconfig ] &&
|
||||
armsr=$(cd $armsr_feed; ./genconfig)
|
||||
[ -e $mediatek_feed/genconfig ] &&
|
||||
mediatek=$(cd $mediatek_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
|
||||
ipq95xx=$(cd $qualcomm_ipq95xx_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq53xx_feed/genconfig ] &&
|
||||
ipq53xx=$(cd $qualcomm_ipq53xx_feed; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in brcmbca airoha x86 armsr mediatek ipq95xx ipq53xx; do
|
||||
echo "$list based boards:"
|
||||
a=$(echo "${!list}" | sort)
|
||||
for b in $a; do
|
||||
echo -e "\t$b"
|
||||
done
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
for p in $airoha; do
|
||||
if [ $p == $profile ]; then
|
||||
target="airoha"
|
||||
target_config_path="$airoha_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="x86"
|
||||
target_config_path="$x86_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $armsr; do
|
||||
if [ $p == $profile ]; then
|
||||
target="armsr"
|
||||
target_config_path="$armsr_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="mediatek"
|
||||
target_config_path="$mediatek_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $ipq95xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="ipq95xx"
|
||||
target_config_path="$qualcomm_ipq95xx_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $ipq53xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="ipq53xx"
|
||||
target_config_path="$qualcomm_ipq53xx_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $brcmbca; do
|
||||
if [ $p == $profile ]; then
|
||||
target="brcmbca"
|
||||
target_config_path="$brcmbca_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
}
|
||||
|
||||
v() {
|
||||
[ "$VERBOSE" -ge 1 ] && echo "$@"
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo
|
||||
echo 1>&2 "Usage: $0 genconfig_min-legacy [ 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"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
echo -e " -s|--override\t\tEnable 'Package source tree override'"
|
||||
echo -e " -S|--brcmsingle\tForce build of bcmkernel to use only one thread"
|
||||
echo -e " -h|--help\t\tShow this message"
|
||||
echo -e " -l|--list [customer]\tList all Customers or all boards for one customer"
|
||||
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 "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
|
||||
list_customers()
|
||||
{
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "No boards found for $CUSTOMER"
|
||||
fi
|
||||
elif [ "$CUSTOMER" ]; then
|
||||
echo "No customer called $CUSTOMER"
|
||||
exit 1
|
||||
elif [ -d $CUSTCONF ]; then
|
||||
local customers="$(ls -1 $CUSTCONF)"
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common )"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
done
|
||||
else
|
||||
echo "has no boards"
|
||||
fi
|
||||
done
|
||||
elif [ "$customers" ]; then
|
||||
echo -e "$customers"
|
||||
else
|
||||
echo "no customers found"
|
||||
fi
|
||||
else
|
||||
echo "No $CUSTCONF folder found"
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
{
|
||||
|
||||
if [ ! -d "$FILEDIR" ]; then
|
||||
mkdir -p $FILEDIR
|
||||
elif [ -d "$FILEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
}
|
||||
|
||||
get_subtarget_for_device() {
|
||||
readonly target="$1"
|
||||
readonly device="$2"
|
||||
readonly targetinfo_file="tmp/info/.targetinfo-feeds_$target"
|
||||
readonly target_profile_line="Target-Profile: DEVICE_$device"
|
||||
# We want to know after which Target: $target/$subtarget line
|
||||
# our $target_profile_line appears
|
||||
# This is a crude way to "parse" the file using shell 🤯
|
||||
# 1. grep for both lines with line number output
|
||||
# 2. grep again to determine the device profile line that we looked for
|
||||
# but output one context line before as well to determine corresponding subtarget line
|
||||
# 4. Use head and sed to extract the subtarget
|
||||
grep "^Target: $target/\|^$target_profile_line" "$targetinfo_file" \
|
||||
| grep -E -B1 "^$target_profile_line" \
|
||||
| head -n1 \
|
||||
| sed -E "s|^Target: $target/||"
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
{
|
||||
local BOARDTYPE=$1
|
||||
shift
|
||||
local CUSTOMERS=$@
|
||||
|
||||
# Validate seleced board and customers
|
||||
set_target $BOARDTYPE
|
||||
if [ $target == "bogus" ]; then
|
||||
echo "Hardware profile does not exist"
|
||||
exit 1
|
||||
elif [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ ! -d "$CUSTCONF/$CUSTOMER/" ]; then
|
||||
echo "Customer profile for '$CUSTOMER' does not exist"
|
||||
exit 1
|
||||
elif [ ! -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/" ]; then
|
||||
echo "'$BOARDTYPE' board profile does not exist for customer '$CUSTOMER'"
|
||||
if [ -f "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
echo "Common profile configuration will be used"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Generate base config
|
||||
rm -f .config
|
||||
v "Config $BOARDTYPE selected"
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
# hack to support custom-devices until we have deprecated this genconfig-script...
|
||||
local custom_found=false
|
||||
local used_config_file
|
||||
|
||||
for config_file in feeds/*/devices/$target/config/$BOARDTYPE/config; do
|
||||
if [ "$custom_found" = "true" ]; then
|
||||
echo
|
||||
echo "Error was found!"
|
||||
echo "Please use only one path."
|
||||
echo "Two instances of $target/config/$BOARDTYPE exists:"
|
||||
echo "Path 1: $used_config_file"
|
||||
echo "Path 2: $config_file"
|
||||
return 1
|
||||
fi
|
||||
if [ -f "$config_file" ]; then
|
||||
cat "$config_file" >> .config
|
||||
echo "" >> .config
|
||||
custom_found=true
|
||||
used_config_file=$config_file
|
||||
fi
|
||||
done
|
||||
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
case "$target" in
|
||||
airoha | mediatek | brcmbca | ipq95xx | ipq53xx)
|
||||
# This assumes the device name to be unique within one target,
|
||||
# which is a fair assumption to make.
|
||||
local subtarget="$(get_subtarget_for_device "${target/_/-}" "$BOARDTYPE")"
|
||||
if [ -z "$subtarget" ]; then
|
||||
echo "Error determining subtarget for $target / ${BOARDTYPE}"
|
||||
return 1
|
||||
fi
|
||||
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
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
# Add customerconfig diff if a customer is selected
|
||||
if [ -n "$CUSTOMERS" ]; then
|
||||
for CUSTOMER in $CUSTOMERS; do
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/common/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/common/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/$BOARDTYPE/fs" ]; then
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
local version="${git_version,,}${CUSTOMERS:+-${CUSTOMERS// /}}"
|
||||
local version_lower="${version,,}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${version_lower}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${version_lower}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
echo "CONFIG_DEVEL=y" >>.config
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
then
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
# we need to signal to bradcom SDK that we have changed the board id
|
||||
# currently boardparms.c and boardparms_voice.c is the only place that is depending on boardid name
|
||||
# so just touch that file.
|
||||
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null
|
||||
|
||||
# Store generated config
|
||||
cp .config .genconfig.config
|
||||
|
||||
# Set default values based on selected parameters
|
||||
v "$(make defconfig 2>&1)"
|
||||
|
||||
echo Set version to $(grep -w CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"')
|
||||
|
||||
# Clean base-file package to force rebuild when changing profile
|
||||
v "$(make package/base-files/clean 2>&1)"
|
||||
|
||||
verify_config
|
||||
}
|
||||
|
||||
####### main #####
|
||||
if [ ! -e tmp/.iop_bootstrap ]; then
|
||||
echo "You have not installed feeds. Running genconfig in this state would create a non functional configuration."
|
||||
echo "Run: iop feeds_update"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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"
|
||||
exit 0
|
||||
else
|
||||
while [ -n "$1" ]; do
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
-p|--profile) export PROFILE="$2"; shift;;
|
||||
-r|--repo) export CUSTREPO="$2"; shift;;
|
||||
-s|--override) export SRCTREEOVERR=1;;
|
||||
-S|--brcmsingel) export BRCM_MAX_JOBS=1;;
|
||||
-h|--help) usage;;
|
||||
-l|--list) list_customers 0 $2;;
|
||||
-a|--list-all)list_customers 1;;
|
||||
-b|--boards)set_target LIST;exit 0;;
|
||||
-*)
|
||||
echo "Invalid option: $1 "
|
||||
echo "Try -h or --help for more information."
|
||||
exit 1
|
||||
;;
|
||||
*) break;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "genconfig_min-legacy" "Generate configuration for customer with manual board configuration - legacy mode"
|
||||
@@ -1,7 +0,0 @@
|
||||
update_package() {
|
||||
echo "update_package is no longer supported." >&2
|
||||
echo "Its replacement is ./iop set-feed-rev." >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
register_command "update_package" "No longer used command"
|
||||
@@ -4,7 +4,7 @@ PKG_NAME:=iopsys-analytics
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=1a749bdebd142a83ba0733f1644a6241403c9097
|
||||
PKG_SOURCE_VERSION:=fb84c1019a8a0fbfb624d9df8eb3604806645510
|
||||
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
|
||||
|
||||
@@ -6,15 +6,24 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ipt-trigger
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8d4b4520a2935a5717a27f486a3fc78357b2a0cd
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ipt-trigger.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/ipt-trigger
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Kernel module for iptables port trigger
|
||||
FILES:=$(PKG_BUILD_DIR)/ipv4/ipt_TRIGGER.ko
|
||||
FILES:=$(PKG_BUILD_DIR)/src/ipv4/ipt_TRIGGER.ko
|
||||
DEPENDS+=+kmod-nf-nat +xtables-legacy
|
||||
AUTOLOAD:=$(call AutoLoad,30,ipt_TRIGGER,1)
|
||||
KCONFIG:=
|
||||
@@ -24,7 +33,7 @@ define KernelPackage/ip6t-trigger
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Kernel module for ip6tables port trigger
|
||||
DEPENDS+=+kmod-nf-nat +xtables-legacy
|
||||
FILES:=$(PKG_BUILD_DIR)/ipv6/ip6t_TRIGGER.ko
|
||||
FILES:=$(PKG_BUILD_DIR)/src/ipv6/ip6t_TRIGGER.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,ip6t_TRIGGER,1)
|
||||
KCONFIG:=
|
||||
endef
|
||||
@@ -41,21 +50,28 @@ ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./src/* $(PKG_BUILD_DIR)/
|
||||
$(CP) $(PKG_BUILD_DIR)/ipt_TRIGGER.h $(LINUX_DIR)/include/linux/netfilter_ipv4/
|
||||
$(CP) -rf ./ipt-trigger/* $(PKG_BUILD_DIR)/
|
||||
$(CP) ./ipt-trigger/include/ipt_TRIGGER.h $(LINUX_DIR)/include/linux/netfilter_ipv4/
|
||||
endef
|
||||
else
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
$(CP) $(PKG_BUILD_DIR)/include/ipt_TRIGGER.h $(LINUX_DIR)/include/linux/netfilter_ipv4/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/include/linux/netfilter_ipv4
|
||||
$(CP) $(PKG_BUILD_DIR)/ipt_TRIGGER.h $(1)/include/linux/netfilter_ipv4/
|
||||
$(CP) $(PKG_BUILD_DIR)/include/ipt_TRIGGER.h $(1)/include/linux/netfilter_ipv4/
|
||||
endef
|
||||
|
||||
KERNEL_MAKE_FLAGS += -I$(LINUX_DIR)/include
|
||||
|
||||
define Build/Compile
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/ipv4/" modules
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/ipv6/" modules
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/src/ipv4/" modules
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/src/ipv6/" modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,ipt-trigger))
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#ifndef _IPT_TRIGGER_H_target
|
||||
#define _IPT_TRIGGER_H_target
|
||||
|
||||
#define TRIGGER_TIMEOUT 600 /* 600 secs */
|
||||
|
||||
enum ipt_trigger_type
|
||||
{
|
||||
IPT_TRIGGER_DNAT = 1,
|
||||
IPT_TRIGGER_IN = 2,
|
||||
IPT_TRIGGER_OUT = 3,
|
||||
IPT_TRIGGER_REFRESH = 4
|
||||
};
|
||||
|
||||
struct ipt_trigger_ports {
|
||||
u_int16_t mport[2]; /* Related destination port range */
|
||||
u_int16_t rport[2]; /* Port range to map related destination port range to */
|
||||
};
|
||||
|
||||
struct ipt_trigger_info {
|
||||
enum ipt_trigger_type type;
|
||||
u_int16_t proto; /* Related protocol */
|
||||
u_int16_t trigger_timeout; /* Auto disable duration */
|
||||
struct ipt_trigger_ports ports;
|
||||
};
|
||||
|
||||
#endif /*_IPT_TRIGGER_H_target*/
|
||||
@@ -1 +0,0 @@
|
||||
obj-m +=ipt_TRIGGER.o
|
||||
@@ -1,407 +0,0 @@
|
||||
/* Kernel module to match the port-ranges, trigger related port-ranges,
|
||||
* and alters the destination to a local IP address.
|
||||
*
|
||||
* Copyright (C) 2003, CyberTAN Corporation
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Description:
|
||||
* This is kernel module for port-triggering.
|
||||
*
|
||||
* The module follows the Netfilter framework, called extended packet
|
||||
* matching modules.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ip.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/netfilter.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/inetdevice.h>
|
||||
#include <linux/list.h>
|
||||
#include <net/protocol.h>
|
||||
#include <net/checksum.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
#include <linux/netfilter_ipv4.h>
|
||||
#include <linux/netfilter_ipv4/ip_tables.h>
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
#include <net/netfilter/nf_conntrack_core.h>
|
||||
#include <net/netfilter/nf_conntrack_tuple.h>
|
||||
#include <net/netfilter/nf_nat.h>
|
||||
#include <linux/netfilter_ipv4/ipt_TRIGGER.h>
|
||||
|
||||
/* This rwlock protects the main hash table, protocol/helper/expected
|
||||
* registrations, conntrack timers*/
|
||||
|
||||
|
||||
static DEFINE_SPINLOCK(nf_trigger_lock);
|
||||
|
||||
|
||||
|
||||
#define NF_IP_PRE_ROUTING 0
|
||||
#define NF_IP_FORWARD 2
|
||||
#define IPT_CONTINUE XT_CONTINUE
|
||||
|
||||
|
||||
|
||||
/***********************lock help**********************/
|
||||
#define MUST_BE_READ_LOCKED(l)
|
||||
#define MUST_BE_WRITE_LOCKED(l)
|
||||
|
||||
|
||||
#define LOCK_BH(l) spin_lock_bh(l)
|
||||
#define UNLOCK_BH(l) spin_unlock_bh(l)
|
||||
|
||||
#define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&nf_trigger_lock)
|
||||
#define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&nf_trigger_lock)
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************list help**********************/
|
||||
#define LIST_FIND(head, cmpfn, type, args...) \
|
||||
({ \
|
||||
const struct list_head *__i, *__j = NULL; \
|
||||
\
|
||||
ASSERT_READ_LOCK(head); \
|
||||
list_for_each(__i, (head)) \
|
||||
if (cmpfn((const type)__i , ## args)) { \
|
||||
__j = __i; \
|
||||
break; \
|
||||
} \
|
||||
(type)__j; \
|
||||
})
|
||||
|
||||
static inline int
|
||||
__list_cmp_same(const void *p1, const void *p2) { return p1 == p2; }
|
||||
|
||||
static inline void
|
||||
list_prepend(struct list_head *head, void *new)
|
||||
{
|
||||
ASSERT_WRITE_LOCK(head);
|
||||
list_add(new, head);
|
||||
}
|
||||
|
||||
#define list_named_find(head, name) \
|
||||
LIST_FIND(head, __list_cmp_name, void *, name)
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("Netfilter Core Team <coreteam@netfilter.org>");
|
||||
MODULE_DESCRIPTION("iptables trigger target module");
|
||||
|
||||
#if 0
|
||||
#define DEBUGP printk
|
||||
#else
|
||||
#define DEBUGP(format, args...)
|
||||
#endif
|
||||
|
||||
struct ipt_trigger {
|
||||
struct list_head list; /* Trigger list */
|
||||
struct timer_list timeout; /* Timer for list destroying */
|
||||
u_int32_t srcip; /* Outgoing source address */
|
||||
u_int32_t dstip; /* Outgoing destination address */
|
||||
u_int16_t mproto; /* Trigger protocol */
|
||||
u_int16_t rproto; /* Related protocol */
|
||||
u_int16_t trigger_timeout; /* Auto disable duration */
|
||||
struct ipt_trigger_ports ports; /* Trigger and related ports */
|
||||
u_int8_t reply; /* Confirm a reply connection */
|
||||
};
|
||||
|
||||
LIST_HEAD(ipt_trigger_list);
|
||||
|
||||
static void trigger_refresh(struct ipt_trigger *trig, unsigned long extra_jiffies)
|
||||
{
|
||||
DEBUGP("%s: \n", __FUNCTION__);
|
||||
LOCK_BH(&nf_trigger_lock);
|
||||
/* Need del_timer for race avoidance (may already be dying). */
|
||||
if (del_timer(&trig->timeout)) {
|
||||
trig->timeout.expires = jiffies + extra_jiffies;
|
||||
add_timer(&trig->timeout);
|
||||
}
|
||||
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
}
|
||||
|
||||
static void __del_trigger(struct ipt_trigger *trig)
|
||||
{
|
||||
DEBUGP("%s: \n", __FUNCTION__);
|
||||
MUST_BE_WRITE_LOCKED(&nf_trigger_lock);
|
||||
|
||||
/* delete from 'ipt_trigger_list' */
|
||||
list_del(&trig->list);
|
||||
kfree(trig);
|
||||
}
|
||||
|
||||
static void trigger_timeout(struct timer_list *t)
|
||||
{
|
||||
struct ipt_trigger *trig = from_timer(trig, t, timeout);
|
||||
|
||||
DEBUGP("trigger list %p timed out\n", trig);
|
||||
LOCK_BH(&nf_trigger_lock);
|
||||
__del_trigger(trig);
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
add_new_trigger(struct ipt_trigger *trig)
|
||||
{
|
||||
struct ipt_trigger *new = NULL;
|
||||
|
||||
DEBUGP("!!!!!!!!!!!! %s !!!!!!!!!!!\n", __FUNCTION__);
|
||||
|
||||
LOCK_BH(&nf_trigger_lock);
|
||||
new = (struct ipt_trigger *)
|
||||
kmalloc(sizeof(struct ipt_trigger), GFP_ATOMIC);
|
||||
|
||||
if (!new) {
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
DEBUGP("%s: OOM allocating trigger list\n", __FUNCTION__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(new, 0, sizeof(*trig));
|
||||
INIT_LIST_HEAD(&new->list);
|
||||
memcpy(new, trig, sizeof(*trig));
|
||||
|
||||
/* add to global table of trigger */
|
||||
list_prepend(&ipt_trigger_list, &new->list);
|
||||
|
||||
/* add and start timer if required */
|
||||
timer_setup(&new->timeout, trigger_timeout, 0);
|
||||
mod_timer(&new->timeout, jiffies + (trig->trigger_timeout * HZ));
|
||||
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Service-Name OutBound InBound
|
||||
* 1. TMD UDP:1000 TCP/UDP:2000..2010
|
||||
* 2. WOKAO UDP:1000 TCP/UDP:3000..3010
|
||||
* 3. net2phone-1 UDP:6801 TCP:30000..30000
|
||||
* 4. net2phone-2 UDP:6801 UDP:30000..30000
|
||||
*
|
||||
* For supporting to use the same outgoing port to trigger different port rules,
|
||||
* it should check the inbound protocol and port range value. If all conditions
|
||||
* are matched, it is a same trigger item, else it needs to create a new one.
|
||||
*/
|
||||
static inline int trigger_out_matched(const struct ipt_trigger *i,
|
||||
const u_int16_t proto, const u_int16_t dport, const struct ipt_trigger_info *info)
|
||||
{
|
||||
DEBUGP("%s: i=%p, proto= %d, dport=%d.\n", __FUNCTION__, i, proto, dport);
|
||||
DEBUGP("%s: Got one, mproto= %d, mport[0..1]=%d, %d, ", __FUNCTION__,
|
||||
i->mproto, i->ports.mport[0], i->ports.mport[1]);
|
||||
DEBUGP("rproto= %d, rport[0..1]=%d, %d.\n",
|
||||
i->rproto, i->ports.rport[0], i->ports.rport[1]);
|
||||
|
||||
return ((i->mproto == proto) &&
|
||||
(i->ports.mport[0] <= dport) &&
|
||||
(i->ports.mport[1] >= dport) &&
|
||||
(i->rproto == info->proto) &&
|
||||
(i->ports.rport[0] == info->ports.rport[0]) &&
|
||||
(i->ports.rport[1] == info->ports.rport[1]));
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_out(struct sk_buff *skb,
|
||||
unsigned int hooknum,
|
||||
const void *targinfo)
|
||||
{
|
||||
const struct ipt_trigger_info *info = targinfo;
|
||||
struct ipt_trigger trig, *found;
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *tcph = (void *)iph + iph->ihl*4; /* Might be TCP, UDP */
|
||||
|
||||
DEBUGP("############# %s ############\n", __FUNCTION__);
|
||||
/* Check if the trigger range has already existed in 'ipt_trigger_list'. */
|
||||
found = LIST_FIND(&ipt_trigger_list, trigger_out_matched,
|
||||
struct ipt_trigger *, iph->protocol, ntohs(tcph->dest), info);
|
||||
|
||||
|
||||
if (found) {
|
||||
/* Yeah, it exists. We need to update(delay) the destroying timer. */
|
||||
trigger_refresh(found, info->trigger_timeout * HZ);
|
||||
/* In order to allow multiple hosts use the same port range, we update
|
||||
the 'saddr' after previous trigger has a reply connection. */
|
||||
if (found->reply)
|
||||
found->srcip = iph->saddr;
|
||||
}
|
||||
else {
|
||||
/* Create new trigger */
|
||||
memset(&trig, 0, sizeof(trig));
|
||||
trig.srcip = iph->saddr;
|
||||
trig.mproto = iph->protocol;
|
||||
trig.rproto = info->proto;
|
||||
trig.trigger_timeout = info->trigger_timeout;
|
||||
memcpy(&trig.ports, &info->ports, sizeof(struct ipt_trigger_ports));
|
||||
add_new_trigger(&trig); /* Add the new 'trig' to list 'ipt_trigger_list'. */
|
||||
}
|
||||
|
||||
return IPT_CONTINUE; /* We don't block any packet. */
|
||||
}
|
||||
|
||||
static inline int trigger_in_matched(const struct ipt_trigger *i,
|
||||
const u_int16_t proto, const u_int16_t dport)
|
||||
{
|
||||
u_int16_t rproto = i->rproto;
|
||||
|
||||
DEBUGP("%s: i=%p, proto= %d, dport=%d.\n", __FUNCTION__, i, proto, dport);
|
||||
DEBUGP("%s: Got one, rproto= %d, rport[0..1]=%d, %d.\n", __FUNCTION__,
|
||||
i->rproto, i->ports.rport[0], i->ports.rport[1]);
|
||||
|
||||
if (!rproto)
|
||||
rproto = proto;
|
||||
|
||||
return ((rproto == proto) && (i->ports.rport[0] <= dport)
|
||||
&& (i->ports.rport[1] >= dport));
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_in(struct sk_buff *skb,
|
||||
unsigned int hooknum,
|
||||
const void *targinfo)
|
||||
{
|
||||
const struct ipt_trigger_info *info = targinfo;
|
||||
struct ipt_trigger *found;
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *tcph = (void *)iph + iph->ihl*4; /* Might be TCP, UDP */
|
||||
/* Check if the trigger-ed range has already existed in 'ipt_trigger_list'. */
|
||||
found = LIST_FIND(&ipt_trigger_list, trigger_in_matched,
|
||||
struct ipt_trigger *, iph->protocol, ntohs(tcph->dest));
|
||||
if (found) {
|
||||
DEBUGP("############# %s ############\n", __FUNCTION__);
|
||||
/* Yeah, it exists. We need to update(delay) the destroying timer. */
|
||||
trigger_refresh(found, info->trigger_timeout * HZ);
|
||||
return NF_ACCEPT; /* Accept it, or the imcoming packet could be
|
||||
dropped in the FORWARD chain */
|
||||
}
|
||||
|
||||
return IPT_CONTINUE; /* Our job is the interception. */
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_dnat(struct sk_buff *skb,
|
||||
unsigned int hooknum,
|
||||
const void *targinfo)
|
||||
{
|
||||
struct ipt_trigger *found = NULL;
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct tcphdr *tcph = (void *)iph + iph->ihl*4; /* Might be TCP, UDP */
|
||||
struct nf_conn *ct = NULL;
|
||||
enum ip_conntrack_info ctinfo;
|
||||
struct nf_nat_range2 newrange;
|
||||
|
||||
DEBUGP("############# %s ############%d\n", __FUNCTION__, __LINE__);
|
||||
/* Check if the trigger-ed range has already existed in 'ipt_trigger_list'. */
|
||||
found = LIST_FIND(&ipt_trigger_list, trigger_in_matched,
|
||||
struct ipt_trigger *, iph->protocol, ntohs(tcph->dest));
|
||||
if (found) {
|
||||
DEBUGP("############# %s ############%d srcip:%d\n", __FUNCTION__, __LINE__, found->srcip);
|
||||
}
|
||||
|
||||
if (!found || !found->srcip)
|
||||
return IPT_CONTINUE; /* We don't block any packet. */
|
||||
|
||||
DEBUGP("############# %s ############\n", __FUNCTION__);
|
||||
found->reply = 1; /* Confirm there has been a reply connection. */
|
||||
ct = nf_ct_get(skb, &ctinfo);
|
||||
|
||||
DEBUGP("%s: got ", __FUNCTION__);
|
||||
|
||||
|
||||
/* Alter the destination of imcoming packet. */
|
||||
/* Transfer from original range. */
|
||||
memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
|
||||
memset(&newrange.max_addr, 0, sizeof(newrange.max_addr));
|
||||
memset(&newrange.min_proto, 0, sizeof(newrange.min_proto));
|
||||
memset(&newrange.max_proto, 0, sizeof(newrange.max_proto));
|
||||
newrange.flags = NF_NAT_RANGE_MAP_IPS;
|
||||
newrange.min_addr.ip = found->srcip;
|
||||
newrange.max_addr.ip = found->srcip;
|
||||
DEBUGP("%s: found->srcip = %x\n", __FUNCTION__, found->srcip);
|
||||
|
||||
/* Hand modified range to generic setup. */
|
||||
return nf_nat_setup_info(ct, &newrange, NF_NAT_MANIP_DST);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_target(struct sk_buff *skb,
|
||||
const struct xt_action_param *par)
|
||||
{
|
||||
const struct ipt_trigger_info *info = par->targinfo;
|
||||
const struct iphdr *iph = ip_hdr(skb);
|
||||
unsigned int hooknum = xt_hooknum(par);
|
||||
|
||||
DEBUGP("%s: type = %s\n", __FUNCTION__,
|
||||
(info->type == IPT_TRIGGER_DNAT) ? "dnat" :
|
||||
(info->type == IPT_TRIGGER_IN) ? "in" : "out");
|
||||
|
||||
/* The Port-trigger only supports TCP and UDP. */
|
||||
if ((iph->protocol != IPPROTO_TCP) && (iph->protocol != IPPROTO_UDP))
|
||||
return IPT_CONTINUE;
|
||||
|
||||
if (info->type == IPT_TRIGGER_OUT)
|
||||
return trigger_out(skb, hooknum, info);
|
||||
else if (info->type == IPT_TRIGGER_IN)
|
||||
return trigger_in(skb, hooknum, info);
|
||||
else if (info->type == IPT_TRIGGER_DNAT)
|
||||
return trigger_dnat(skb, hooknum, info);
|
||||
|
||||
return IPT_CONTINUE;
|
||||
}
|
||||
static int
|
||||
trigger_check(const struct xt_tgchk_param *par)
|
||||
{
|
||||
const struct ipt_trigger_info *info = par->targinfo;
|
||||
|
||||
if ((strcmp(par->table, "mangle") == 0)) {
|
||||
DEBUGP("trigger_check: bad table `%s'.\n", par->table);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (par->hook_mask & ~((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_FORWARD))) {
|
||||
DEBUGP("trigger_check: bad hooks %x.\n", par->hook_mask);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (info->proto) {
|
||||
if (info->proto != IPPROTO_TCP && info->proto != IPPROTO_UDP) {
|
||||
DEBUGP("trigger_check: bad proto %d.\n", info->proto);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
if (info->type == IPT_TRIGGER_OUT) {
|
||||
if (!info->ports.mport[0] || !info->ports.rport[0]) {
|
||||
DEBUGP("trigger_check: Try 'iptbles -j TRIGGER -h' for help.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static struct xt_target redirect_reg = {
|
||||
.name = "TRIGGER",
|
||||
.family = NFPROTO_IPV4,
|
||||
.target = trigger_target,
|
||||
.targetsize = sizeof(struct ipt_trigger_info),
|
||||
.checkentry = trigger_check,
|
||||
.me = THIS_MODULE,
|
||||
};
|
||||
|
||||
static int __init init(void)
|
||||
{
|
||||
return xt_register_target(&redirect_reg);
|
||||
}
|
||||
|
||||
static void __exit fini(void)
|
||||
{
|
||||
xt_unregister_target(&redirect_reg);
|
||||
}
|
||||
|
||||
module_init(init);
|
||||
module_exit(fini);
|
||||
@@ -1 +0,0 @@
|
||||
obj-m +=ip6t_TRIGGER.o
|
||||
@@ -1,429 +0,0 @@
|
||||
/* Kernel module to match the port-ranges, trigger related port-ranges,
|
||||
* and alters the destination to a local IPv6 address.
|
||||
*
|
||||
* Copyright (C) 2024, IOPSYS
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Description:
|
||||
* This is kernel module for port-triggering.
|
||||
*
|
||||
* The module follows the Netfilter framework, called extended packet
|
||||
* matching modules.
|
||||
*/
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/timer.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/netfilter.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/if.h>
|
||||
#include <linux/inetdevice.h>
|
||||
#include <linux/list.h>
|
||||
#include <net/protocol.h>
|
||||
#include <net/checksum.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
#include <linux/netfilter_ipv6.h>
|
||||
#include <linux/netfilter_ipv6/ip6_tables.h>
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
#include <net/netfilter/nf_conntrack_core.h>
|
||||
#include <net/netfilter/nf_conntrack_tuple.h>
|
||||
#include <net/netfilter/nf_nat.h>
|
||||
#include <linux/netfilter_ipv4/ipt_TRIGGER.h>
|
||||
|
||||
/* This rwlock protects the main hash table, protocol/helper/expected
|
||||
* registrations, conntrack timers*/
|
||||
|
||||
|
||||
static DEFINE_SPINLOCK(nf_trigger_lock);
|
||||
|
||||
|
||||
|
||||
#define NF_IP_PRE_ROUTING 0
|
||||
#define NF_IP_FORWARD 2
|
||||
#define IPT_CONTINUE XT_CONTINUE
|
||||
|
||||
|
||||
|
||||
/***********************lock help**********************/
|
||||
#define MUST_BE_READ_LOCKED(l)
|
||||
#define MUST_BE_WRITE_LOCKED(l)
|
||||
|
||||
|
||||
#define LOCK_BH(l) spin_lock_bh(l)
|
||||
#define UNLOCK_BH(l) spin_unlock_bh(l)
|
||||
|
||||
#define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&nf_trigger_lock)
|
||||
#define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&nf_trigger_lock)
|
||||
|
||||
|
||||
|
||||
|
||||
/***********************list help**********************/
|
||||
#define LIST_FIND(head, cmpfn, type, args...) \
|
||||
({ \
|
||||
const struct list_head *__i, *__j = NULL; \
|
||||
\
|
||||
ASSERT_READ_LOCK(head); \
|
||||
list_for_each(__i, (head)) \
|
||||
if (cmpfn((const type)__i , ## args)) { \
|
||||
__j = __i; \
|
||||
break; \
|
||||
} \
|
||||
(type)__j; \
|
||||
})
|
||||
|
||||
static inline int
|
||||
__list_cmp_same(const void *p1, const void *p2) { return p1 == p2; }
|
||||
|
||||
static inline void
|
||||
list_prepend(struct list_head *head, void *new)
|
||||
{
|
||||
ASSERT_WRITE_LOCK(head);
|
||||
list_add(new, head);
|
||||
}
|
||||
|
||||
#define list_named_find(head, name) \
|
||||
LIST_FIND(head, __list_cmp_name, void *, name)
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_AUTHOR("IOPSYS Network Team");
|
||||
MODULE_DESCRIPTION("iptables trigger target module");
|
||||
|
||||
#if 0
|
||||
#define DEBUGP printk
|
||||
#else
|
||||
#define DEBUGP(format, args...)
|
||||
#endif
|
||||
|
||||
struct ipt_trigger {
|
||||
struct list_head list; /* Trigger list */
|
||||
struct timer_list timeout; /* Timer for list destroying */
|
||||
struct in6_addr srcip; /* Outgoing source address */
|
||||
struct in6_addr dstip; /* Outgoing destination address */
|
||||
u_int16_t mproto; /* Trigger protocol */
|
||||
u_int16_t rproto; /* Related protocol */
|
||||
u_int16_t trigger_timeout; /* Auto disable duration */
|
||||
struct ipt_trigger_ports ports; /* Trigger and related ports */
|
||||
u_int8_t reply; /* Confirm a reply connection */
|
||||
};
|
||||
|
||||
LIST_HEAD(ipt_trigger_list);
|
||||
|
||||
static unsigned char *ipv6_header_get_L4_header_offset(const struct ipv6hdr *ip6h_p)
|
||||
{
|
||||
unsigned int ext_head_count = 8;
|
||||
const struct ipv6_opt_hdr *ip_ext_p;
|
||||
unsigned int payload_offset = 0;
|
||||
char *tcpudp_hdr = NULL;
|
||||
uint8_t nextHdr_p;
|
||||
|
||||
nextHdr_p = ip6h_p->nexthdr;
|
||||
ip_ext_p = (const struct ipv6_opt_hdr *)(ip6h_p + 1);
|
||||
payload_offset = sizeof(struct ipv6hdr);
|
||||
|
||||
do {
|
||||
if ((nextHdr_p == IPPROTO_TCP) || (nextHdr_p == IPPROTO_UDP)) {
|
||||
tcpudp_hdr = (unsigned char *)ip6h_p + payload_offset;
|
||||
break;
|
||||
}
|
||||
|
||||
payload_offset += (ip_ext_p->hdrlen + 1U) << 3U;
|
||||
nextHdr_p = ip_ext_p->nexthdr;
|
||||
ip_ext_p = (struct ipv6_opt_hdr *)((uint8_t *)ip6h_p + payload_offset);
|
||||
ext_head_count--; /* at most 8 extension headers */
|
||||
} while (ext_head_count);
|
||||
|
||||
return tcpudp_hdr;
|
||||
}
|
||||
|
||||
static void trigger_refresh(struct ipt_trigger *trig, unsigned long extra_jiffies)
|
||||
{
|
||||
DEBUGP("%s: \n", __FUNCTION__);
|
||||
LOCK_BH(&nf_trigger_lock);
|
||||
/* Need del_timer for race avoidance (may already be dying). */
|
||||
if (del_timer(&trig->timeout)) {
|
||||
trig->timeout.expires = jiffies + extra_jiffies;
|
||||
add_timer(&trig->timeout);
|
||||
}
|
||||
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
}
|
||||
|
||||
static void __del_trigger(struct ipt_trigger *trig)
|
||||
{
|
||||
DEBUGP("%s: \n", __FUNCTION__);
|
||||
MUST_BE_WRITE_LOCKED(&nf_trigger_lock);
|
||||
|
||||
/* delete from 'ipt_trigger_list' */
|
||||
list_del(&trig->list);
|
||||
kfree(trig);
|
||||
}
|
||||
|
||||
static void trigger_timeout(struct timer_list *t)
|
||||
{
|
||||
struct ipt_trigger *trig = from_timer(trig, t, timeout);
|
||||
|
||||
DEBUGP("trigger list %p timed out\n", trig);
|
||||
LOCK_BH(&nf_trigger_lock);
|
||||
__del_trigger(trig);
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
add_new_trigger(struct ipt_trigger *trig)
|
||||
{
|
||||
struct ipt_trigger *new = NULL;
|
||||
|
||||
DEBUGP("!!!!!!!!!!!! %s !!!!!!!!!!!\n", __FUNCTION__);
|
||||
|
||||
LOCK_BH(&nf_trigger_lock);
|
||||
new = (struct ipt_trigger *)
|
||||
kmalloc(sizeof(struct ipt_trigger), GFP_ATOMIC);
|
||||
|
||||
if (!new) {
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
DEBUGP("%s: OOM allocating trigger list\n", __FUNCTION__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
memset(new, 0, sizeof(*trig));
|
||||
INIT_LIST_HEAD(&new->list);
|
||||
memcpy(new, trig, sizeof(*trig));
|
||||
|
||||
/* add to global table of trigger */
|
||||
list_prepend(&ipt_trigger_list, &new->list);
|
||||
|
||||
/* add and start timer if required */
|
||||
timer_setup(&new->timeout, trigger_timeout, 0);
|
||||
mod_timer(&new->timeout, jiffies + (trig->trigger_timeout * HZ));
|
||||
|
||||
UNLOCK_BH(&nf_trigger_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Service-Name OutBound InBound
|
||||
* 1. TMD UDP:1000 TCP/UDP:2000..2010
|
||||
* 2. WOKAO UDP:1000 TCP/UDP:3000..3010
|
||||
* 3. net2phone-1 UDP:6801 TCP:30000..30000
|
||||
* 4. net2phone-2 UDP:6801 UDP:30000..30000
|
||||
*
|
||||
* For supporting to use the same outgoing port to trigger different port rules,
|
||||
* it should check the inbound protocol and port range value. If all conditions
|
||||
* are matched, it is a same trigger item, else it needs to create a new one.
|
||||
*/
|
||||
static inline int trigger_out_matched(const struct ipt_trigger *i,
|
||||
const u_int16_t proto, const u_int16_t dport, const struct ipt_trigger_info *info)
|
||||
{
|
||||
DEBUGP("%s: i=%p, proto= %d, dport=%d.\n", __FUNCTION__, i, proto, dport);
|
||||
DEBUGP("%s: Got one, mproto= %d, mport[0..1]=%d, %d, ", __FUNCTION__,
|
||||
i->mproto, i->ports.mport[0], i->ports.mport[1]);
|
||||
DEBUGP("rproto= %d, rport[0..1]=%d, %d.\n",
|
||||
i->rproto, i->ports.rport[0], i->ports.rport[1]);
|
||||
|
||||
return ((i->mproto == proto) &&
|
||||
(i->ports.mport[0] <= dport) &&
|
||||
(i->ports.mport[1] >= dport) &&
|
||||
(i->rproto == info->proto) &&
|
||||
(i->ports.rport[0] == info->ports.rport[0]) &&
|
||||
(i->ports.rport[1] == info->ports.rport[1]));
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_out(struct sk_buff *skb,
|
||||
unsigned int hooknum,
|
||||
const void *targinfo)
|
||||
{
|
||||
const struct ipt_trigger_info *info = targinfo;
|
||||
struct ipt_trigger trig, *found;
|
||||
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||
struct tcphdr *tcph = (struct tcphdr*)ipv6_header_get_L4_header_offset(ip6h); /* Might be TCP, UDP */
|
||||
|
||||
DEBUGP("############# %s ############\n", __FUNCTION__);
|
||||
/* Check if the trigger range has already existed in 'ipt_trigger_list'. */
|
||||
found = LIST_FIND(&ipt_trigger_list, trigger_out_matched,
|
||||
struct ipt_trigger *, ip6h->nexthdr, ntohs(tcph->dest), info);
|
||||
|
||||
|
||||
if (found) {
|
||||
/* Yeah, it exists. We need to update(delay) the destroying timer. */
|
||||
trigger_refresh(found, info->trigger_timeout * HZ);
|
||||
/* In order to allow multiple hosts use the same port range, we update
|
||||
the 'saddr' after previous trigger has a reply connection. */
|
||||
if (found->reply)
|
||||
found->srcip = ip6h->saddr;
|
||||
}
|
||||
else {
|
||||
/* Create new trigger */
|
||||
memset(&trig, 0, sizeof(trig));
|
||||
memcpy(&trig.srcip, &ip6h->saddr, sizeof(trig.srcip));
|
||||
trig.mproto = ip6h->nexthdr;
|
||||
trig.rproto = info->proto;
|
||||
trig.trigger_timeout = info->trigger_timeout;
|
||||
memcpy(&trig.ports, &info->ports, sizeof(struct ipt_trigger_ports));
|
||||
add_new_trigger(&trig); /* Add the new 'trig' to list 'ipt_trigger_list'. */
|
||||
}
|
||||
|
||||
return IPT_CONTINUE; /* We don't block any packet. */
|
||||
}
|
||||
|
||||
static inline int trigger_in_matched(const struct ipt_trigger *i,
|
||||
const u_int16_t proto, const u_int16_t dport)
|
||||
{
|
||||
u_int16_t rproto = i->rproto;
|
||||
|
||||
DEBUGP("%s: i=%p, proto= %d, dport=%d.\n", __FUNCTION__, i, proto, dport);
|
||||
DEBUGP("%s: Got one, rproto= %d, rport[0..1]=%d, %d.\n", __FUNCTION__,
|
||||
i->rproto, i->ports.rport[0], i->ports.rport[1]);
|
||||
|
||||
if (!rproto)
|
||||
rproto = proto;
|
||||
|
||||
return ((rproto == proto) && (i->ports.rport[0] <= dport)
|
||||
&& (i->ports.rport[1] >= dport));
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_in(struct sk_buff *skb,
|
||||
unsigned int hooknum,
|
||||
const void *targinfo)
|
||||
{
|
||||
const struct ipt_trigger_info *info = targinfo;
|
||||
struct ipt_trigger *found;
|
||||
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||
struct tcphdr *tcph =(struct tcphdr*)ipv6_header_get_L4_header_offset(ip6h); /* Might be TCP, UDP */
|
||||
/* Check if the trigger-ed range has already existed in 'ipt_trigger_list'. */
|
||||
found = LIST_FIND(&ipt_trigger_list, trigger_in_matched,
|
||||
struct ipt_trigger *, ip6h->nexthdr, ntohs(tcph->dest));
|
||||
if (found) {
|
||||
DEBUGP("############# %s ############\n", __FUNCTION__);
|
||||
/* Yeah, it exists. We need to update(delay) the destroying timer. */
|
||||
trigger_refresh(found, info->trigger_timeout * HZ);
|
||||
return NF_ACCEPT; /* Accept it, or the imcoming packet could be
|
||||
dropped in the FORWARD chain */
|
||||
}
|
||||
|
||||
return IPT_CONTINUE; /* Our job is the interception. */
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_dnat(struct sk_buff *skb,
|
||||
unsigned int hooknum,
|
||||
const void *targinfo)
|
||||
{
|
||||
struct ipt_trigger *found = NULL;
|
||||
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||
struct tcphdr *tcph =(struct tcphdr*)ipv6_header_get_L4_header_offset(ip6h); /* Might be TCP, UDP */
|
||||
struct nf_conn *ct = NULL;
|
||||
enum ip_conntrack_info ctinfo;
|
||||
struct nf_nat_range2 newrange;
|
||||
|
||||
/* Check if the trigger-ed range has already existed in 'ipt_trigger_list'. */
|
||||
found = LIST_FIND(&ipt_trigger_list, trigger_in_matched,
|
||||
struct ipt_trigger *, ip6h->nexthdr, ntohs(tcph->dest));
|
||||
|
||||
if (!found)
|
||||
return IPT_CONTINUE; /* We don't block any packet. */
|
||||
|
||||
DEBUGP("############# %s ############\n", __FUNCTION__);
|
||||
found->reply = 1; /* Confirm there has been a reply connection. */
|
||||
ct = nf_ct_get(skb, &ctinfo);
|
||||
|
||||
DEBUGP("%s: got ", __FUNCTION__);
|
||||
|
||||
|
||||
/* Alter the destination of imcoming packet. */
|
||||
/* Transfer from original range. */
|
||||
memset(&newrange.min_addr, 0, sizeof(newrange.min_addr));
|
||||
memset(&newrange.max_addr, 0, sizeof(newrange.max_addr));
|
||||
memset(&newrange.min_proto, 0, sizeof(newrange.min_proto));
|
||||
memset(&newrange.max_proto, 0, sizeof(newrange.max_proto));
|
||||
newrange.flags = NF_NAT_RANGE_MAP_IPS;
|
||||
memcpy(&newrange.min_addr.ip, &found->srcip, sizeof(newrange.min_addr.ip));
|
||||
memcpy(&newrange.max_addr.ip, &found->srcip, sizeof(newrange.max_addr.ip));
|
||||
DEBUGP("%s: found->srcip = %x\n", __FUNCTION__, found->srcip);
|
||||
|
||||
/* Hand modified range to generic setup. */
|
||||
return nf_nat_setup_info(ct, &newrange, NF_NAT_MANIP_DST);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
trigger_target(struct sk_buff *skb,
|
||||
const struct xt_action_param *par)
|
||||
{
|
||||
const struct ipt_trigger_info *info = par->targinfo;
|
||||
const struct ipv6hdr *ip6h = ipv6_hdr(skb);
|
||||
unsigned int hooknum = xt_hooknum(par);
|
||||
|
||||
DEBUGP("%s: type = %s\n", __FUNCTION__,
|
||||
(info->type == IPT_TRIGGER_DNAT) ? "dnat" :
|
||||
(info->type == IPT_TRIGGER_IN) ? "in" : "out");
|
||||
|
||||
/* The Port-trigger only supports TCP and UDP. */
|
||||
if ((ip6h->nexthdr != IPPROTO_TCP) && (ip6h->nexthdr != IPPROTO_UDP))
|
||||
return IPT_CONTINUE;
|
||||
|
||||
if (info->type == IPT_TRIGGER_OUT)
|
||||
return trigger_out(skb, hooknum, info);
|
||||
else if (info->type == IPT_TRIGGER_IN)
|
||||
return trigger_in(skb, hooknum, info);
|
||||
else if (info->type == IPT_TRIGGER_DNAT)
|
||||
return trigger_dnat(skb, hooknum, info);
|
||||
|
||||
return IPT_CONTINUE;
|
||||
}
|
||||
static int
|
||||
trigger_check(const struct xt_tgchk_param *par)
|
||||
{
|
||||
const struct ipt_trigger_info *info = par->targinfo;
|
||||
|
||||
if ((strcmp(par->table, "mangle") == 0)) {
|
||||
DEBUGP("trigger_check: bad table `%s'.\n", par->table);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (par->hook_mask & ~((1 << NF_IP_PRE_ROUTING) | (1 << NF_IP_FORWARD))) {
|
||||
DEBUGP("trigger_check: bad hooks %x.\n", par->hook_mask);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (info->proto) {
|
||||
if (info->proto != IPPROTO_TCP && info->proto != IPPROTO_UDP) {
|
||||
DEBUGP("trigger_check: bad proto %d.\n", info->proto);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
if (info->type == IPT_TRIGGER_OUT) {
|
||||
if (!info->ports.mport[0] || !info->ports.rport[0]) {
|
||||
DEBUGP("trigger_check: Try 'iptbles -j TRIGGER -h' for help.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static struct xt_target redirect_reg = {
|
||||
.name = "TRIGGER",
|
||||
.family = NFPROTO_IPV6,
|
||||
.target = trigger_target,
|
||||
.targetsize = sizeof(struct ipt_trigger_info),
|
||||
.checkentry = trigger_check,
|
||||
.me = THIS_MODULE,
|
||||
};
|
||||
|
||||
static int __init init(void)
|
||||
{
|
||||
return xt_register_target(&redirect_reg);
|
||||
}
|
||||
|
||||
static void __exit fini(void)
|
||||
{
|
||||
xt_unregister_target(&redirect_reg);
|
||||
}
|
||||
|
||||
module_init(init);
|
||||
module_exit(fini);
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.4.4
|
||||
PKG_VERSION:=7.4.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7a9e69c413c2d0b950a1a2e0f2964439fb797f48
|
||||
PKG_SOURCE_VERSION:=67e6b91b8aca4c068a71f097f5f0576b47ec1d2e
|
||||
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
|
||||
|
||||
@@ -66,7 +66,7 @@ define Package/libethernet
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
MENU:=1
|
||||
TITLE:= Ethernet library (libethernet)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_airoha:ecnt_api +TARGET_brcmbca:bcmkernel
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_airoha:ecnt_api +TARGET_brcmbca:bcm963xx-bsp
|
||||
endef
|
||||
|
||||
define Package/libethernet/description
|
||||
|
||||
@@ -26,11 +26,8 @@ define Package/libpicoevent-bcm
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Libpicoevent-bcm
|
||||
URL:=
|
||||
DEPENDS:= +TARGET_brcmbca:bcmkernel
|
||||
DEPENDS:= +TARGET_brcmbca:bcm963xx-bsp
|
||||
include $(TOPDIR)/feeds/broadcom/bcmkernel/bcm-toolchain.mk
|
||||
TARGET_CFLAGS := -Os -pipe -mfpu=vfpv3-d16 -mfloat-abi=softfp -DCONFIG_TARGET_brcmbca -g3 -fno-caller-saves -fno-plt -Wno-error=unused-but-set-variable -Wno-error=unused-result \
|
||||
-mfloat-abi=soft -fmacro-prefix-map=$(BUILD_DIR)libpicoevent-bcm-0.3=libpicoevent-bcm-0.3 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 \
|
||||
-Wl,-z,now -Wl,-z,relro -Wl,--build-i
|
||||
endef
|
||||
|
||||
define Package/libpicoevent-bcm/description
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqos
|
||||
PKG_VERSION:=7.2.106
|
||||
PKG_VERSION:=7.2.107
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=0e54d7a992c506d6302d7cc32a39eb64e9b2c42e
|
||||
PKG_SOURCE_VERSION:=de659f50c0ae1cd4ec64315b301c53595eaf39de
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -65,7 +65,7 @@ define Package/libqos
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
MENU:=1
|
||||
TITLE:= QoS library (libqos)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_brcmbca:bcmkernel
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_brcmbca:bcm963xx-bsp
|
||||
endef
|
||||
|
||||
define Package/libqos/config
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.10
|
||||
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:=059574b5036c840df97feecdace141e59210acc2
|
||||
PKG_SOURCE_VERSION:=f1509651217d027376b5b7fc3f64ca86662e9b2d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.6
|
||||
PKG_VERSION:=1.1.11
|
||||
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:=054cbe19186dbc3682f6977e7856cdac1226f17a
|
||||
PKG_SOURCE_VERSION:=95fb29a31f7665abbe87af4a74cf52b7e5f22a29
|
||||
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.54
|
||||
PKG_VERSION:=7.4.69
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=89db12dd11025fd4b6d7dfa3ec497a4b9b2d1ab8
|
||||
PKG_SOURCE_VERSION:=8a5d8b5defb7cedc5876bb5fbee5c1ad185de889
|
||||
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
|
||||
@@ -131,7 +131,7 @@ endef
|
||||
define Package/libwifi
|
||||
$(call Package/libwifi-common)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcmkernel
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcm963xx-bsp
|
||||
endef
|
||||
|
||||
define Package/libwifi/config
|
||||
|
||||
@@ -15,7 +15,7 @@ config AGENT_EASYMESH_R2_CERT
|
||||
|
||||
config AGENT_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 4
|
||||
default 6
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT
|
||||
bool "Enable extra features through Easymesh vendor extension"
|
||||
@@ -55,5 +55,12 @@ config AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST
|
||||
config AGENT_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
config AGENT_CHECK_PARTIAL_WIFI_RELOAD
|
||||
bool "Option that allow SSID/PSK simple reload"
|
||||
default y
|
||||
|
||||
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.6.0.3
|
||||
PKG_VERSION:=6.1.1.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=4ecb56d8069896c1ca555e2acdbac94126002add
|
||||
PKG_SOURCE_VERSION:=d0ff409ffe6bb03c97e14b34932f437f58f4e241
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -105,6 +105,14 @@ ifeq ($(CONFIG_AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST),y)
|
||||
TARGET_CFLAGS += -DOPER_CHAN_CHANGE_RELAY_MCAST
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_CHECK_PARTIAL_WIFI_RELOAD),y)
|
||||
TARGET_CFLAGS += -DCHECK_PARTIAL_WIFI_RELOAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DYNBHD_DYNAMICALLY_PERSIST_CONTROLLER),y)
|
||||
TARGET_CFLAGS += -DPERSIST_CONTROLLER
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
|
||||
@@ -3,11 +3,12 @@ config agent 'agent'
|
||||
option debug '0'
|
||||
option profile '3'
|
||||
option al_bridge 'br-lan'
|
||||
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 guest_isolation '1'
|
||||
option partial_wifi_reload '0'
|
||||
list map_port 'all'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ generate_wireless_sta_config=0
|
||||
|
||||
network_mode="$(fw_printenv -n netmode)" # default is layer3
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)" # default is full
|
||||
disable_mlo="$(fw_printenv -n disable_mlo)"
|
||||
|
||||
is_airoha() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
@@ -81,6 +82,16 @@ generate_multiap_config() {
|
||||
ifname="wlan${devidx}"
|
||||
ifname_bh="wlan${devidx}-1"
|
||||
ap_follow_sta_dfs="1"
|
||||
|
||||
[ "$disable_mlo" == "1" ] || {
|
||||
uci set wireless.$dev.mlo="1"
|
||||
uci set wireless.$dev.mlo_capable="1"
|
||||
uci commit wireless
|
||||
|
||||
# Disable for MLD/MLO
|
||||
uci set mapagent.agent.island_prevention="0"
|
||||
uci commit mapagent
|
||||
}
|
||||
else
|
||||
ifprefix="wlan%-"
|
||||
ifname="wlan$devidx"
|
||||
@@ -182,12 +193,19 @@ map_genconf () {
|
||||
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"
|
||||
[ "$disable_mlo" == "1" ] && {
|
||||
mapcontroller_disable_mld() {
|
||||
uci set mapcontroller.$1.enabled='0'
|
||||
}
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_disable_mld mld
|
||||
}
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ config CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
|
||||
config CONTROLLER_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 4
|
||||
default 6
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
@@ -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.7.0.2
|
||||
PKG_VERSION:=6.1.1.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=433218c312cde4e72e77de307172e899fa0f58a1
|
||||
PKG_SOURCE_VERSION:=480a5304591632729212408d77d220f707cb9d6b
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -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)/
|
||||
|
||||
@@ -40,6 +40,7 @@ config ap
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option mld_id '1'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
@@ -48,6 +49,7 @@ config ap
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option mld_id '1'
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
@@ -56,6 +58,7 @@ config ap
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option mld_id '1'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
@@ -64,6 +67,7 @@ config ap
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
option mld_id '2'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
@@ -72,6 +76,7 @@ config ap
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
option mld_id '2'
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
@@ -80,6 +85,21 @@ config ap
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
option mld_id '2'
|
||||
|
||||
config mld
|
||||
option id '1'
|
||||
option ssid '$DEVICE_MANUFACTURER-$BASEMAC_ADDR'
|
||||
option key '$WIFI_FH_KEY'
|
||||
# option vid '1'
|
||||
option type 'fronthaul'
|
||||
|
||||
config mld
|
||||
option id '2'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH'
|
||||
option key '$WIFI_BH_KEY'
|
||||
# option vid '1'
|
||||
option type 'backhaul'
|
||||
|
||||
# node and radio sections (per node) are auto
|
||||
# generated per Multi-AP Agent in the network
|
||||
|
||||
@@ -1,36 +1,48 @@
|
||||
#
|
||||
# Copyright (C) 2013-2020 iopsys
|
||||
# Copyright (C) 2013-2024 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mcastmngr
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.2.3
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/mcastmngr.git
|
||||
PKG_SOURCE_VERSION:=117acf7a29e3a343756aab9b0ae330022892c15b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
MAKE_PATH:=bbf_plugin
|
||||
|
||||
define Package/mcastmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Multicast Proxy/Snooping Manager
|
||||
DEPENDS:=+!TARGET_brcmbca:mcproxy
|
||||
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json +libbbfdm-api
|
||||
endef
|
||||
|
||||
define Package/mcastmngr/description
|
||||
Configures IGMP and MLD snooping and proxy
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./mcastmngr/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/mcastmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
define Package/mcastmngr/install
|
||||
$(CP) ./files/common/* $(1)/
|
||||
@@ -39,6 +51,7 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
else
|
||||
$(CP) ./files/linux/* $(1)/
|
||||
endif
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/bbf_plugin/libmcast_bbf.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mcastmngr))
|
||||
|
||||
@@ -49,7 +49,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
|
||||
|
||||
@@ -117,6 +117,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
|
||||
|
||||
@@ -30,4 +30,25 @@ config OBUSPA_MAX_CONTROLLERS_NUM
|
||||
help
|
||||
This value must be in range of 1 to 10. (default 5)
|
||||
|
||||
config OBUSPA_DOWNLOAD_EXTENSION
|
||||
bool "Adds Device.LocalAgent.X_IOPSYS_EU_Download()"
|
||||
default y
|
||||
help
|
||||
Adds Device.LocalAgent.X_IOPSYS_EU_Download() operate command
|
||||
for local file download to cpe
|
||||
|
||||
config OBUSPA_UPLOAD_EXTENSION
|
||||
bool "Adds Device.LocalAgent.X_IOPSYS_EU_Upload()"
|
||||
default y
|
||||
help
|
||||
Adds Device.LocalAgent.X_IOPSYS_EU_Upload() operate command
|
||||
for pull a file from cpe
|
||||
|
||||
config OBUSPA_SESSION_EXTENSION
|
||||
bool "Adds Device.LocalAgent.X_IOPSYS_EU_Session."
|
||||
default y
|
||||
help
|
||||
Adds Device.LocalAgent.X_IOPSYS_EU_Session. object to simulate
|
||||
a CWMP like session
|
||||
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.5.20
|
||||
PKG_VERSION:=8.0.1.6
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=8706169718211848d85af9aa6bcdb7b97db2b9b8
|
||||
PKG_SOURCE_VERSION:=0997eebe269d766eb738b80e4d5ccd40baf79090
|
||||
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,7 @@ 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
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -81,6 +81,18 @@ else
|
||||
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_DOWNLOAD_EXTENSION),y)
|
||||
TARGET_CFLAGS += -DOBUSPA_ENABLE_DOWNLOAD_EXT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_UPLOAD_EXTENSION),y)
|
||||
TARGET_CFLAGS += -DOBUSPA_ENABLE_UPLOAD_EXT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_SESSION_EXTENSION),y)
|
||||
TARGET_CFLAGS += -DOBUSPA_ENABLE_SESSION_EXT
|
||||
endif
|
||||
|
||||
ifdef $(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
|
||||
TARGET_CFLAGS += -DOBUSPA_MAX_CONTROLLERS_NUM=$(CONFIG_OBUSPA_MAX_CONTROLLERS_NUM)
|
||||
endif
|
||||
@@ -97,18 +109,23 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/users/roles
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/users/roles/*.json $(1)/etc/users/roles/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/usp_utils.sh $(1)/etc/obuspa/
|
||||
echo "$(CONFIG_BBF_VENDOR_PREFIX)" > $(1)/etc/obuspa/vendor_prefix
|
||||
$(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/uci-defaults/60-generate-ctrust-defaults $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/obuspa-set-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)
|
||||
$(INSTALL_BIN) ./files/obuspa.hotplug $(1)/etc/hotplug.d/iface/21-obuspa
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) ./files/etc/bbfdm/json/USPAgent.json $(1)
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||
|
||||
@@ -2,12 +2,11 @@ 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/obuspa/ca.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ CONFIGURATION=obuspa
|
||||
ENV_PROFILE="/root/.profile"
|
||||
KEEP_FILE="/lib/upgrade/keep.d/obuspa"
|
||||
|
||||
RESET_FILE="/tmp/obuspa/obuspa_param_reset.txt"
|
||||
RESET_FILE="/tmp/obuspa/fw_defaults"
|
||||
SQL_DB_FILE="/tmp/obuspa/usp.db"
|
||||
DB_DUMP="/tmp/obuspa/usp.dump_$(date +%s)"
|
||||
|
||||
@@ -19,6 +19,7 @@ INSTANCE_COUNT=0
|
||||
|
||||
. /lib/functions/network.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /etc/obuspa/usp_utils.sh
|
||||
|
||||
global_init()
|
||||
{
|
||||
@@ -76,7 +77,7 @@ db_set()
|
||||
|
||||
dump_db()
|
||||
{
|
||||
${PROG} -v0 -f ${SQL_DB_FILE} -c show database |awk '/^Device./ || /^Internal./ {print $1 " \"" $3 "\""}' | sort > ${DB_DUMP}
|
||||
${PROG} -v0 -f ${SQL_DB_FILE} -c show database |grep "^Internal.\|^Device."|sed '{s/=> /"/g;s/$/"/g}' | sort > ${DB_DUMP}
|
||||
}
|
||||
|
||||
# if db present then check if it matches with existing instances
|
||||
@@ -147,44 +148,6 @@ update_keep()
|
||||
fi
|
||||
}
|
||||
|
||||
get_role_index_from_json()
|
||||
{
|
||||
local role="$1"
|
||||
local role_def_file="$2"
|
||||
local num=0
|
||||
local roles_obj
|
||||
|
||||
# In case of role is empty or file not present
|
||||
if [ -z "${role}" ] || [ ! -f "${role_def_file}" ]; then
|
||||
echo "${num}"
|
||||
return ${num}
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_load_file "${role_def_file}"
|
||||
|
||||
json_select roles
|
||||
json_get_keys roles_obj
|
||||
|
||||
for k in ${roles_obj}; do
|
||||
local rname
|
||||
json_select "$k"
|
||||
json_get_var rname name
|
||||
json_select ..
|
||||
|
||||
if [ "${rname}" != "Untrusted" ] && [ "${rname}" != "full_access" ]; then
|
||||
num=$(( num + 1 ))
|
||||
fi
|
||||
|
||||
if [ "${role}" = "${rname}" ]; then
|
||||
echo "${num}"
|
||||
return ${num}
|
||||
fi
|
||||
done
|
||||
|
||||
return ${num}
|
||||
}
|
||||
|
||||
validate_obuspa_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} obuspa "${1}" \
|
||||
@@ -201,8 +164,7 @@ validate_obuspa_section()
|
||||
'max_cache_time:uinteger' \
|
||||
'ipc_timeout:uinteger' \
|
||||
'log_dest:string' \
|
||||
'db_file:string' \
|
||||
'role_file:file'
|
||||
'db_file:string'
|
||||
}
|
||||
|
||||
validate_localagent_section()
|
||||
@@ -217,12 +179,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 +190,7 @@ validate_controller_section()
|
||||
'Path:string' \
|
||||
'EnableEncryption:bool' \
|
||||
'PeriodicNotifInterval:uinteger' \
|
||||
'SessionMode:string:Allow' \
|
||||
'SessionMode:string' \
|
||||
'ProvisioningCode:string'
|
||||
}
|
||||
|
||||
@@ -255,7 +215,6 @@ validate_mtp_section()
|
||||
'Path:string' \
|
||||
'mqtt:string' \
|
||||
'stomp:string' \
|
||||
'Reference:string' \
|
||||
'PublishQoS:uinteger' \
|
||||
'EnableEncryption:bool'
|
||||
}
|
||||
@@ -319,12 +278,39 @@ update_reset_reason()
|
||||
fi
|
||||
}
|
||||
|
||||
get_role_index()
|
||||
{
|
||||
local name drole
|
||||
|
||||
name="${1}"
|
||||
drole="Device.LocalAgent.ControllerTrust.Role.2"
|
||||
if [ -z "${name}" ]; then
|
||||
log "No role name provided, use Untrusted role index 2"
|
||||
echo "${drole}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Get if from CTRUST file first if present, then from dbdump and then use default Untrusted role
|
||||
if [ -f "${CTRUST_RESET_FILE}" ]; then
|
||||
val="$(grep "Device.LocalAgent.ControllerTrust.Role.\d.Name" ${CTRUST_RESET_FILE} |grep $name)"
|
||||
val="$(echo ${val/.Name /,}|cut -d, -f 1)"
|
||||
echo "$val"
|
||||
elif [ -f "${DB_DUMP}" ]; then
|
||||
val="$(grep "Device.LocalAgent.ControllerTrust.Role.\d.Name" ${DB_DUMP} |grep $name)"
|
||||
val="$(echo ${val/.Name /,}|cut -d, -f 1)"
|
||||
echo "$val"
|
||||
else
|
||||
log "Not able to get role ${name}, use Untrusted role"
|
||||
echo "${drole}"
|
||||
fi
|
||||
}
|
||||
|
||||
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 +332,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 +352,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}"
|
||||
@@ -455,49 +436,6 @@ configure_subscription()
|
||||
uci_remove obuspa "${1}"
|
||||
}
|
||||
|
||||
check_json_load()
|
||||
{
|
||||
local ret
|
||||
|
||||
ret=0
|
||||
if [ -f "${role_def_file}" ]; then
|
||||
json_init
|
||||
if json_load_file "${role_def_file}" 2>&1 |grep -q Failed; then
|
||||
log "failed to load [${role_def_file}]"
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
json_init
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
get_role_index()
|
||||
{
|
||||
local role="Device.LocalAgent.ControllerTrust.Role"
|
||||
local idx=0
|
||||
local role_name="$1"
|
||||
local role_def_file
|
||||
|
||||
role_def_file=$(uci -q get obuspa.global.role_file 2>/dev/null)
|
||||
case "${role_name}" in
|
||||
'full_access')
|
||||
idx=1;
|
||||
;;
|
||||
'Untrusted')
|
||||
idx=2;
|
||||
;;
|
||||
*)
|
||||
local ji=0
|
||||
|
||||
if check_json_load; then
|
||||
ji=$(get_role_index_from_json "${role_name}" "${role_def_file}")
|
||||
fi
|
||||
idx=$(( ji + 2 )) # Add predefined roles
|
||||
esac
|
||||
|
||||
echo "${role}.${idx}"
|
||||
}
|
||||
|
||||
configure_challenges()
|
||||
{
|
||||
local Enable Description role_name Role Value Retries LockoutPeriod
|
||||
@@ -559,16 +497,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 +710,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 +743,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 +766,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
|
||||
}
|
||||
|
||||
@@ -886,6 +816,7 @@ sync_update_sec()
|
||||
config_get _sync "${1}" _sync ""
|
||||
if [ -z "${_sync}" ]; then
|
||||
uci_remove obuspa "${1}"
|
||||
log "Deleting obuspa.${1} section ..."
|
||||
else
|
||||
uci_remove obuspa "${1}" _sync
|
||||
fi
|
||||
@@ -966,7 +897,7 @@ reverse_update_db_with_uci()
|
||||
# Create factory reset file
|
||||
db_init()
|
||||
{
|
||||
local reason
|
||||
local reason role_file
|
||||
|
||||
reason="${1}"
|
||||
mkdir -p /tmp/obuspa/
|
||||
@@ -974,12 +905,19 @@ db_init()
|
||||
# Load configuration
|
||||
config_load $CONFIGURATION
|
||||
config_get SQL_DB_FILE global db_file "/tmp/obuspa/usp.db"
|
||||
config_get role_file global role_file ""
|
||||
|
||||
if [ -f "${SQL_DB_FILE}.old" ] && [ ! -f "${SQL_DB_FILE}" ]; then
|
||||
log "Copying old db, since new db not present ..."
|
||||
mv ${SQL_DB_FILE}.old ${SQL_DB_FILE}
|
||||
fi
|
||||
|
||||
if [ -f "${role_file}" ]; then
|
||||
configure_ctrust_role "${role_file}"
|
||||
uci_set obuspa global role_file ""
|
||||
uci commit ${CONFIGURATION}
|
||||
fi
|
||||
|
||||
# Dump datamodel parameters from DB
|
||||
if [ -f "${SQL_DB_FILE}" ]; then
|
||||
dump_db
|
||||
@@ -1030,7 +968,10 @@ db_init()
|
||||
mv ${DB_DUMP} ${RESET_FILE}
|
||||
fi
|
||||
|
||||
return 0;
|
||||
if [ -f "${CTRUST_RESET_FILE}" ]; then
|
||||
cat ${CTRUST_RESET_FILE} >> ${RESET_FILE}
|
||||
rm ${CTRUST_RESET_FILE}
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
@@ -1,724 +0,0 @@
|
||||
{
|
||||
"roles": [
|
||||
{
|
||||
"name": "full_access",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Untrusted",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.ProcessStatus.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorConfigFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorLogFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.Processor.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.Reboot()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SelfTestDiagnostics()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.FactoryReset()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.Server.Pool.{i}.StaticAddress.",
|
||||
"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.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"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}URLFilter.",
|
||||
"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}OpenVPN.",
|
||||
"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": [
|
||||
"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.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"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.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"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.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"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.SoftwareModules.",
|
||||
"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.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"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.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SSH.",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "user",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.AccessPoint.{i}.WPS.InitiateWPSPBC()",
|
||||
"perm": [
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.DataElements.Network.SetSSID()",
|
||||
"perm": [
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "extender",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SSH.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "undefined-4"
|
||||
}
|
||||
]
|
||||
}
|
||||
217
obuspa/files/etc/obuspa/usp_utils.sh
Executable file
217
obuspa/files/etc/obuspa/usp_utils.sh
Executable file
@@ -0,0 +1,217 @@
|
||||
#!/bin/sh
|
||||
|
||||
CTRUST_RESET_FILE="/tmp/obuspa/ctrust_reset"
|
||||
VENDOR_PREFIX_FILE="/etc/obuspa/vendor_prefix"
|
||||
FW_DEFAULT_ROLE_DIR="/etc/users/roles"
|
||||
|
||||
|
||||
# include jshn.sh
|
||||
if [ -f "/usr/local/share/libubox/jshn.sh" ]; then
|
||||
. /usr/local/share/libubox/jshn.sh
|
||||
else
|
||||
. /usr/share/libubox/jshn.sh
|
||||
fi
|
||||
|
||||
db_add()
|
||||
{
|
||||
local param value
|
||||
|
||||
param="${1}"
|
||||
shift
|
||||
value="$*"
|
||||
|
||||
if [ -n "${param}" ] && [ -n "${value}" ]; then
|
||||
echo "${param} \"${value}\"">>${CTRUST_RESET_FILE}
|
||||
else
|
||||
echo >>${CTRUST_RESET_FILE}
|
||||
fi
|
||||
}
|
||||
|
||||
get_param_permission()
|
||||
{
|
||||
local input rinst pinst path prefix
|
||||
local pperm operm cperm iperm
|
||||
|
||||
pperm="----"
|
||||
operm="----"
|
||||
cperm="----"
|
||||
iperm="----"
|
||||
|
||||
path="${1}"
|
||||
shift
|
||||
rinst="${1}"
|
||||
shift
|
||||
pinst="${1}"
|
||||
shift
|
||||
input="${@}"
|
||||
|
||||
for p in ${input}; do
|
||||
case ${p} in
|
||||
PERMIT_GET)
|
||||
pperm="r${pperm:1:4}"
|
||||
;;
|
||||
PERMIT_SET)
|
||||
pperm="${pperm:0:1}w${pperm:2:4}"
|
||||
;;
|
||||
PERMIT_SUBS_VAL_CHANGE)
|
||||
pperm="${pperm:0:3}n"
|
||||
;;
|
||||
PERMIT_OBJ_INFO)
|
||||
operm="r${operm:1:4}"
|
||||
;;
|
||||
PERMIT_ADD)
|
||||
operm="${operm:0:1}w${operm:2:4}"
|
||||
;;
|
||||
PERMIT_SUBS_OBJ_ADD)
|
||||
operm="${operm:0:3}n"
|
||||
;;
|
||||
PERMIT_GET_INST)
|
||||
iperm="r${iperm:1:4}"
|
||||
;;
|
||||
PERMIT_DEL)
|
||||
iperm="${iperm:0:1}w${iperm:2:4}"
|
||||
;;
|
||||
PERMIT_SUBS_OBJ_DEL)
|
||||
iperm="${iperm:0:3}n"
|
||||
;;
|
||||
PERMIT_CMD_INFO)
|
||||
cperm="r${cperm:1:4}"
|
||||
;;
|
||||
PERMIT_OPER)
|
||||
cperm="${cperm:0:2}x${cperm:3:4}"
|
||||
;;
|
||||
PERMIT_SUBS_EVT_OPER_COMP)
|
||||
cperm="${cperm:0:3}n"
|
||||
;;
|
||||
PERMIT_NONE)
|
||||
pperm="----"
|
||||
iperm="----"
|
||||
cperm="----"
|
||||
operm="----"
|
||||
;;
|
||||
PERMIT_ALL)
|
||||
pperm="rw-n"
|
||||
iperm="rw-n"
|
||||
operm="rw-n"
|
||||
cperm="r-xn"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -f "${VENDOR_PREFIX_FILE}" ]; then
|
||||
prefix="$(cat ${VENDOR_PREFIX_FILE})"
|
||||
else
|
||||
prefix="X_IOPSYS_XX_"
|
||||
fi
|
||||
|
||||
path="${path//\{i\}/*}"
|
||||
path="${path//\{BBF_VENDOR_PREFIX\}/${prefix}}"
|
||||
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.Alias cpe-${pinst}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.Enable 1
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.Order ${pinst}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.Targets ${path}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.Param ${pperm}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.Obj ${operm}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.InstantiatedObj ${iperm}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Permission.${pinst}.CommandEvent ${cperm}
|
||||
}
|
||||
|
||||
configure_permission()
|
||||
{
|
||||
local obj inst name rinst
|
||||
|
||||
obj="${1}"
|
||||
inst="${2}"
|
||||
name="${3}"
|
||||
rinst="${4}"
|
||||
|
||||
if [ -z "${inst}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_select ${inst}
|
||||
|
||||
json_get_var path object
|
||||
json_get_values perm perm
|
||||
|
||||
get_param_permission "${path}" "${rinst}" "${inst}" "${perm}"
|
||||
db_add
|
||||
|
||||
json_select ..
|
||||
}
|
||||
|
||||
|
||||
configure_roles()
|
||||
{
|
||||
local rinst rname
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Illegal number of parameters"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
json_select $2
|
||||
json_get_var rname name
|
||||
|
||||
if [ "${rname}" = "full_access" ]; then
|
||||
rinst=1
|
||||
rname="Full Access"
|
||||
elif [ "${rname}" = "Untrusted" ]; then
|
||||
rinst=2
|
||||
else
|
||||
rinst="$2"
|
||||
fi
|
||||
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Alias cpe-${rinst}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Enable 1
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Name ${rname}
|
||||
|
||||
json_for_each_item configure_permission permission "${name}" ${rinst}
|
||||
json_select ..
|
||||
}
|
||||
|
||||
configure_roles_dir()
|
||||
{
|
||||
local rinst rname
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "Illegal number of parameters"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rname="${1}"
|
||||
rinst="${2}"
|
||||
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Alias cpe-${rinst}
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Enable 1
|
||||
db_add Device.LocalAgent.ControllerTrust.Role.${rinst}.Name ${rname}
|
||||
|
||||
json_for_each_item configure_permission permission "${name}" ${rinst}
|
||||
json_select ..
|
||||
}
|
||||
|
||||
configure_ctrust_role()
|
||||
{
|
||||
local num
|
||||
local roles_obj
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
if [ -f "${1}" ]; then
|
||||
json_init
|
||||
json_load_file "${1}"
|
||||
json_for_each_item configure_roles roles
|
||||
else
|
||||
num=3
|
||||
for f in $(ls -1 ${FW_DEFAULT_ROLE_DIR}); do
|
||||
echo "Loading $f ....."
|
||||
json_init
|
||||
json_load_file "${FW_DEFAULT_ROLE_DIR}/${f}"
|
||||
json_select tr181
|
||||
configure_roles_dir "${f/.json/}" "${num}"
|
||||
num=$((num + 1))
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# configure_ctrust_role "${@}"
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_load obuspa
|
||||
config_get interface global interface ""
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" -a -z "$interface" ] ; then
|
||||
uci_set obuspa global interface "lan"
|
||||
fi
|
||||
fi
|
||||
@@ -1,59 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
configure_dhcp_options() {
|
||||
local enabled inerface discovery
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get interface global interface "wan"
|
||||
config_get_bool discovery global dhcp_discovery 1
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${discovery}" -eq 1 ]; then
|
||||
network_uci_update=0
|
||||
reqopts="$(uci -q get network."${interface}".reqopts)"
|
||||
proto="$(uci -q get network."${interface}".proto)"
|
||||
local req125_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
sendopts="$(uci -q get network."${interface}".sendopts)"
|
||||
opt124="124:"
|
||||
send124_present=0
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt124"* ]]; then
|
||||
send124_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${interface}".reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send124_present} -eq 0 ]; then
|
||||
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
|
||||
uci -q set network."${interface}".sendopts="$newsendopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${network_uci_update} -eq 1 ]; then
|
||||
uci commit network
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_dhcp_options
|
||||
15
obuspa/files/etc/uci-defaults/60-generate-ctrust-defaults
Normal file
15
obuspa/files/etc/uci-defaults/60-generate-ctrust-defaults
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /etc/obuspa/usp_utils.sh
|
||||
|
||||
rfile="$(uci -q get obuspa.global.role_file)"
|
||||
|
||||
# Reset the role_file if present
|
||||
if [ -n "${rfile}" ]; then
|
||||
uci -q set obuspa.global.role_file=""
|
||||
fi
|
||||
|
||||
configure_ctrust_role "${rfile}"
|
||||
|
||||
exit 0
|
||||
88
obuspa/files/etc/uci-defaults/obuspa-set-dhcp-option
Normal file
88
obuspa/files/etc/uci-defaults/obuspa-set-dhcp-option
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
get_access_role()
|
||||
{
|
||||
local mode lan_proto
|
||||
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
mode="extender"
|
||||
else
|
||||
mode="full_access"
|
||||
fi
|
||||
|
||||
echo "$mode"
|
||||
}
|
||||
|
||||
configure_dhcp_options() {
|
||||
local enabled inerface discovery
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get interface global interface
|
||||
config_get_bool discovery global dhcp_discovery 1
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${discovery}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "${interface}" ]; then
|
||||
role="$(get_access_role)"
|
||||
|
||||
if [ "${role}" = "extender" ]; then
|
||||
interface="lan"
|
||||
uci -q set obuspa.global.interface="lan"
|
||||
uci commit obuspa
|
||||
else
|
||||
interface="wan"
|
||||
fi
|
||||
fi
|
||||
|
||||
network_uci_update=0
|
||||
reqopts="$(uci -q get network."${interface}".reqopts)"
|
||||
proto="$(uci -q get network."${interface}".proto)"
|
||||
local req125_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
sendopts="$(uci -q get network."${interface}".sendopts)"
|
||||
opt124="124:"
|
||||
send124_present=0
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt124"* ]]; then
|
||||
send124_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${interface}".reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send124_present} -eq 0 ]; then
|
||||
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
|
||||
uci -q set network."${interface}".sendopts="$newsendopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${network_uci_update} -eq 1 ]; then
|
||||
uci commit network
|
||||
fi
|
||||
}
|
||||
|
||||
configure_dhcp_options
|
||||
@@ -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
|
||||
|
||||
26
obuspa/files/etc/users/roles/extender.json
Normal file
26
obuspa/files/etc/users/roles/extender.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"tr181": {
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SSH.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
12
obuspa/files/etc/users/roles/full_access.json
Normal file
12
obuspa/files/etc/users/roles/full_access.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"tr181": {
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
39
obuspa/files/obuspa.hotplug
Normal file
39
obuspa/files/obuspa.hotplug
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
get_access_role() {
|
||||
local mode lan_proto
|
||||
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
mode="extender"
|
||||
else
|
||||
mode="full_access"
|
||||
fi
|
||||
|
||||
echo "$mode"
|
||||
}
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
config_get intf global interface
|
||||
|
||||
if [ "$enable_obuspa" = "0" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -z "${intf}" ]; then
|
||||
role="$(get_access_role)"
|
||||
|
||||
if [ "${role}" = "extender" ]; then
|
||||
intf="lan"
|
||||
else
|
||||
intf="wan"
|
||||
fi
|
||||
fi
|
||||
|
||||
[ "$ACTION" = "ifup" -a "${intf}" = "${INTERFACE}" ] && {
|
||||
sleep 1
|
||||
obuspa -c event Device.LocalAgent.WakeUp!
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
diff --git a/src/core/device.h b/src/core/device.h
|
||||
index 5ca0782..ee6d88c 100644
|
||||
index 5e367b7..db154a5 100644
|
||||
--- a/src/core/device.h
|
||||
+++ b/src/core/device.h
|
||||
@@ -157,6 +157,9 @@ int DEVICE_CONTROLLER_Start(void);
|
||||
void DEVICE_CONTROLLER_Stop(void);
|
||||
int DEVICE_CONTROLLER_FindInstanceByEndpointId(char *endpoint_id);
|
||||
int DEVICE_CONTROLLER_QueueBinaryMessage(mtp_send_item_t *msi, char *endpoint_id, char *usp_msg_id, mtp_reply_to_t *mtp_reply_to, time_t expiry_time);
|
||||
@@ -330,6 +330,10 @@ int DEVICE_MTP_ValidateMqttReference(dm_req_t *req, char *value);
|
||||
void DEVICE_CONTROLLER_SetRolesFromMqtt(int mqtt_instance, int role_instance);
|
||||
char *DEVICE_CONTROLLER_GetControllerTopic(int mqtt_instance);
|
||||
|
||||
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
+bool DEVICE_CONTROLLER_IsMTPAllowed(char *endpoint_id, mtp_reply_to_t *mrt);
|
||||
+#endif
|
||||
bool DEVICE_CONTROLLER_IsMTPConfigured(char *endpoint_id, mtp_protocol_t protocol);
|
||||
char *DEVICE_CONTROLLER_FindEndpointIdByInstance(int instance);
|
||||
char *DEVICE_CONTROLLER_FindEndpointByMTP(mtp_reply_to_t *mrt);
|
||||
+
|
||||
#ifndef REMOVE_USP_BROKER
|
||||
int DEVICE_SUBSCRIPTION_RouteNotification(Usp__Msg *usp, int instance);
|
||||
bool DEVICE_SUBSCRIPTION_MarkVendorLayerSubs(int broker_instance, subs_notify_t notify_type, char *path, int group_id);
|
||||
diff --git a/src/core/device_controller.c b/src/core/device_controller.c
|
||||
index ae609f5..a6335f5 100644
|
||||
index 97ca11d..19c91f1 100644
|
||||
--- a/src/core/device_controller.c
|
||||
+++ b/src/core/device_controller.c
|
||||
@@ -900,6 +900,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage(mtp_send_item_t *msi, char *endpoint_id
|
||||
@@ -952,6 +952,78 @@ int DEVICE_CONTROLLER_QueueBinaryMessage(mtp_send_item_t *msi, char *endpoint_id
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
|
||||
@@ -96,12 +97,12 @@ index ae609f5..a6335f5 100644
|
||||
**
|
||||
** DEVICE_CONTROLLER_IsMTPConfigured
|
||||
diff --git a/src/core/msg_handler.c b/src/core/msg_handler.c
|
||||
index 8313342..a953562 100644
|
||||
index 2a04d39..0b3074b 100644
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -759,6 +759,15 @@ int ValidateUspRecord(UspRecord__Record *rec, mtp_reply_to_t *mrt)
|
||||
return USP_ERR_RECORD_FIELD_INVALID;
|
||||
}
|
||||
@@ -1206,6 +1206,15 @@ int ValidateUspRecord(UspRecord__Record *rec, mtp_conn_t *mtpc)
|
||||
usp_service_instance = USP_BROKER_GetUspServiceInstance(rec->from_id, 0);
|
||||
#endif
|
||||
|
||||
+#ifdef OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
+ // Exit if the controller is not allowed to use the MTP on which the message was received
|
||||
@@ -112,6 +113,6 @@ index 8313342..a953562 100644
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
// Exit if the controller is unknown
|
||||
// Exit if the endpoint sending the message is unknown
|
||||
cur_msg_controller_instance = DEVICE_CONTROLLER_FindInstanceByEndpointId(rec->from_id);
|
||||
if (cur_msg_controller_instance == INVALID)
|
||||
if ((cur_msg_controller_instance == INVALID) && (usp_service_instance == INVALID))
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -780,6 +780,7 @@ int ExecuteCli_Set(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -865,6 +866,7 @@ int ExecuteCli_Add(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
@@ -976,6 +978,7 @@ int ExecuteCli_Del(char *arg1, char *arg
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ SetControllerRoleForInternal();
|
||||
// Exit if unable to start a transaction
|
||||
err = DM_TRANS_Start(&trans);
|
||||
if (err != USP_ERR_OK)
|
||||
--- a/src/core/data_model.h
|
||||
+++ b/src/core/data_model.h
|
||||
@@ -325,6 +325,8 @@ void DATA_MODEL_DumpSchema(void);
|
||||
void DATA_MODEL_DumpInstances(void);
|
||||
char DATA_MODEL_GetJSONParameterType(char *path);
|
||||
int DATA_MODEL_SetParameterInDatabase(char *path, char *value);
|
||||
+void SetControllerRoleForInternal();
|
||||
+void SetControllerDummyID();
|
||||
|
||||
int DM_PRIV_InitSetRequest(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst, char *new_value);
|
||||
void DM_PRIV_RequestInit(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst);
|
||||
--- a/src/core/dm_exec.c
|
||||
+++ b/src/core/dm_exec.c
|
||||
@@ -1207,6 +1207,7 @@ void ProcessMessageQueueSocketActivity(s
|
||||
return;
|
||||
}
|
||||
|
||||
+ SetControllerDummyID(); // To make sure session handler does not break with internal services
|
||||
switch(msg.type)
|
||||
{
|
||||
case kDmExecMsg_ProcessUspRecord:
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -902,6 +902,34 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
+** SetControllerDummyID
|
||||
+**
|
||||
+** Sets the role for internal user
|
||||
+**
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+void SetControllerDummyID()
|
||||
+{
|
||||
+ cur_msg_controller_info.endpoint_id = "CLI_Utility";
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** SetControllerRoleForInternal
|
||||
+**
|
||||
+** Sets the role for internal user
|
||||
+**
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+void SetControllerRoleForInternal()
|
||||
+{
|
||||
+ cur_msg_combined_role.inherited = kCTrustRole_Untrusted;
|
||||
+ cur_msg_combined_role.assigned = kCTrustRole_FullAccess;
|
||||
+ SetControllerDummyID();
|
||||
+}
|
||||
+
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
** CacheControllerRoleForCurMsg
|
||||
**
|
||||
** Retrieves the role to use for the specified controller, and caches it locally, so that
|
||||
@@ -1,8 +1,17 @@
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 04a1a9c..00b95a4 100644
|
||||
index 70a10c2..e8a39cf 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -2124,6 +2124,75 @@ exit:
|
||||
@@ -63,6 +63,8 @@
|
||||
|
||||
#include <mosquitto.h>
|
||||
|
||||
+#include <curl/curl.h>
|
||||
+
|
||||
// Defines for MQTT Property Values
|
||||
#define PUBLISH 0x30
|
||||
#define CONTENT_TYPE 3
|
||||
@@ -2180,6 +2182,75 @@ exit:
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +87,7 @@ index 04a1a9c..00b95a4 100644
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** PerformMqttClientConnect
|
||||
@@ -2193,6 +2262,14 @@ int PerformMqttClientConnect(mqtt_client_t *client)
|
||||
@@ -2249,6 +2320,14 @@ int PerformMqttClientConnect(mqtt_client_t *client)
|
||||
keep_alive = 5;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspc
|
||||
PKG_VERSION:=1.0.1.6
|
||||
PKG_VERSION:=1.0.1.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -64,7 +64,6 @@ define Package/obuspc/install
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspc $(1)/usr/sbin/uspc
|
||||
$(INSTALL_BIN) ./files/etc/init.d/uspc $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/50-disable-on-extender $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-fix-agent-endpoint $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/100-add-mosquitto-listener $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/etc/config/uspc $(1)/etc/config/
|
||||
|
||||
@@ -329,6 +329,13 @@ boot() {
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Check if device is an extender nothing to do
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
# extender so return
|
||||
return 0;
|
||||
fi
|
||||
|
||||
configure_dnsmasq_op125 "${interface}"
|
||||
|
||||
start
|
||||
@@ -591,6 +598,13 @@ start_service() {
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Check if device is an extender then do not start the service
|
||||
lan_proto="$(uci -q get network.lan.proto)"
|
||||
if [ "${lan_proto}" == "dhcp" ]; then
|
||||
# extender so return
|
||||
return 0;
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/usp/
|
||||
db_init
|
||||
register_service
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" ]; then
|
||||
uci set uspc.global.enabled=0
|
||||
uci commit uspc
|
||||
fi
|
||||
51
packet-capture-diagnostics/Makefile
Normal file
51
packet-capture-diagnostics/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2023 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=packet-capture-diagnostics
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/packet-capture-diagnostics.git
|
||||
PKG_SOURCE_VERSION:=a47189b5faa9f678f1a27475c474cc1524d777f4
|
||||
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
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/packet-capture-diagnostics
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=PacketCaptureDiagnostics datamodel
|
||||
DEPENDS:=+libbbfdm-api +tcpdump
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/packet-capture-diagnostics/description
|
||||
Package to add Device.PacketCaptureDiagnostics. datamodel support using bbfdm
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/packet-capture-diagnostics/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/packet-capture-diagnostics/install
|
||||
$(BBFDM_INSTALL_SCRIPT) ./files/scripts/packetcapture $(1)
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/src/libpackcapture.so $(1)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,packet-capture-diagnostics))
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user