Compare commits

..

70 Commits

Author SHA1 Message Date
Vivek Kumar Dutta
74f11c7b74 bbfdm: unified path for services 2024-04-10 09:44:47 +05:30
Mohd Husaam Mehdi
b10d8e0ec6 ponmngr: add Device.XPON. bbf object as a micro service
add Device.XPON. object as a bbf micro service instead of a plugin
as is done currently
2024-04-09 16:16:23 +05:30
Mohd Husaam Mehdi
1ec66d5732 mcastmngr: add IGMP and MLD vendor extensions as micro service
move IGMP and MLD vendor extensions from bbfdm to mcastmngr and
add them as a bbfdm micro service
2024-04-09 08:55:22 +00:00
Andreas Gnau
084691a29a voicemngr: Do not manually specify BCM lib paths
Do not explicitly specify BCM libary search paths. All binaries have a
correct RUNPATH set via feeds/broadcom/bcmkernel/bcm-toolchain.mk and
the Makefile has been updated to respect LDFLAGS. Setting LD_LIBARY_PATH
and specifiying custome library search paths is thus no longer
necessary.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
2024-04-09 10:06:47 +02:00
Amin Ben Romdhane
d083dc041e ethmngr: 2.1.6 2024-04-09 09:39:36 +02:00
Amin Ben Romdhane
c0c30ca012 bbfdm: 1.7.28 2024-04-09 09:38:37 +02:00
Markus Gothe
65fbf9958d mcastmngr: Fix typo in Broadcom snooping. 2024-04-09 03:52:52 +00:00
Janusz Dziedzic
c0a6739981 sshmngr: set MaxAuthTries=10
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@iopsys.eu>
2024-04-09 03:50:46 +00:00
Yalu Zhang
81fdef1991 voicemngr-1.1.10: Fix a misleading log message 2024-04-08 16:13:00 +02:00
Janusz Dziedzic
dc0dbb29ff wifimngr: 17.0.17 2024-04-08 07:07:53 +00:00
Vivek Kumar Dutta
aa98c2fff5 bbfdm: move Device.QoS. to qosmngr 2024-04-06 12:53:39 +05:30
Vivek Kumar Dutta
5c935f03fe bbfdm: removed deprecated bbfdm_services.sh script
bbfdm_services.sh script had dependency on init script of package, which adds
the datamodel microserice.

This functionality now optimized and provided with 'bbfdm.mk' compile time
helper utility's 'BbfdmInstallMicroServiceInputFile' function.
2024-04-05 18:15:06 +05:30
Mohd Mehdi
b44e25c8ee sshmngr: remove bbfdm_add_service call from init script 2024-04-05 12:44:47 +00:00
Mohd Husaam Mehdi
822f5624b1 qosmngr: remove bbfdm_add_service call from init script 2024-04-05 17:22:25 +05:30
Vivek Kumar Dutta
60f2fdd7cb sulu: 3.1.59 2024-04-05 15:18:06 +05:30
Mohd Husaam Mehdi
6518f92be7 qosmngr: move Device.QoS. from bbfdm to qosmngr
qos.c and qos.h are now added as a bbfdm micro service
2024-04-05 12:47:08 +05:30
Jakob Olsson
f674d32c4e map-controller: 4.7.0.2 2024-04-04 12:57:41 +02:00
Vivek Kumar Dutta
e81c9f80cd bbfdm: Update OperatingChannelBandwidth for 320MHz 2024-04-04 11:50:53 +05:30
Vivek Kumar Dutta
e1fffddf85 obuspa: workaround to skip unreachable mqtt broker 2024-04-04 05:56:57 +00:00
Jakob Olsson
1ddc202fd0 ieee1905: 8.3.12 2024-04-03 18:04:44 +02:00
Janusz Dziedzic
9ed4bea12e libwifi: 7.4.54 2024-04-03 13:35:19 +00:00
Rahul Thakur
cebc62066b sshmngr: fix makefile
update install section to install files to correct paths
2024-04-03 11:30:25 +00:00
Jakob Olsson
ebba65c729 ieee1905: 8.3.11 2024-04-03 12:33:47 +02:00
Jakob Olsson
0373547a79 libwifi: 7.4.53 2024-04-03 11:33:01 +02:00
Jakob Olsson
1076ca4bd8 libwifi: 7.4.52 2024-04-03 11:16:15 +02:00
Vivek Kumar Dutta
fda5aed59c bbfdm: move Device.SSH. to sshmngr 2024-04-02 17:43:33 +05:30
Rahul Thakur
1393125ceb sshmngr: configurable backend
Make the backend daemon configurable, please note, still need
to disable dropbear as default in config and choose the backend
based on config in sshmngr
2024-04-02 16:30:49 +05:30
Mohd Husaam Mehdi
8557dbc1a7 sshmngr: add Device.SSH. support as a microservice 2024-04-01 23:16:57 +05:30
Jakob Olsson
c4ca2ec55c map-controller: 4.7.0.1 2024-03-28 12:52:26 +01:00
Jakob Olsson
3090636827 map-agent: 4.6.0.3 2024-03-28 12:50:17 +01:00
Jakob Olsson
804e2c1568 map-agent: 4.6.0.2 2024-03-27 14:04:50 +01:00
Jakob Olsson
1a2b31e159 wifimngr: 17.0.16 2024-03-27 14:04:44 +01:00
Jakob Olsson
37e930f183 libwifi: 7.4.51 2024-03-27 14:04:36 +01:00
Anjan Chanda
c2560af1e9 decollector: 4.4.0.1 2024-03-27 14:01:24 +01:00
Sukru Senli
1d24d5c4f7 ethmngr: add ruleng ethport recipe and generate deprecated ubus event 2024-03-26 14:09:18 +00:00
Jakob Olsson
ce5e7a3f61 map-agent: config: set enabled '1' as default 2024-03-26 14:08:53 +01:00
Sukru Senli
a1a7bd02f5 map-agent: map_genconfig: set full as default multiap_mode 2024-03-26 09:27:07 +00:00
Rahul Thakur
1068ffa0eb Update package libethernet
* cc72f5a libethernet: fix log spam
2024-03-26 12:52:06 +05:30
Vivek Kumar Dutta
628887b426 bbfdm: refresh instances with events 2024-03-26 11:06:28 +05:30
Erik Karlsson
ec7ba74900 testnet: avoid potential race condition
Instead of running a second instance of testnet once and in parallel
with the background task on interface up/down, the background task is
woken up. The avoids the potential for a race where under certain
circumstances a ubus event for internet up or down may never be sent.

Also remove unused include and add missing quotation.
2024-03-25 15:18:16 +00:00
Vivek Kumar Dutta
e383d1d145 sulu: 3.1.58 2024-03-25 20:22:03 +05:30
Amin Ben Romdhane
abe813b656 bbfdm: 1.7.22 2024-03-25 14:18:29 +01:00
Amin Ben Romdhane
d690cf904c bulkdata: Fix init.d permission issue 2024-03-25 14:15:42 +01:00
Jakob Olsson
fe82de8bd5 map-agent: 4.6.0.1 2024-03-25 11:37:43 +01:00
Amin Ben Romdhane
7a943dc49a bbfdm: 1.7.21 2024-03-22 13:32:36 +01:00
Arne Jonsson
bc2278e89b libqos: add support for Broadcom SDK bcm_5.04L.04p3 2024-03-22 12:08:47 +00:00
Jakob Olsson
2996f2313c libeasy: 7.4.4 2024-03-22 11:57:02 +01:00
Jakob Olsson
d95c7288e9 map-controller: 4.7.0.0 2024-03-22 11:35:03 +01:00
Jakob Olsson
43f7c0d23e map-agent: 4.6.0.0 2024-03-22 11:34:33 +01:00
Jakob Olsson
616273eb43 libdpp: 2.1.0 2024-03-22 11:20:16 +01:00
Jakob Olsson
aeca902517 wifimngr: 17.0.15 2024-03-22 11:19:05 +01:00
Jakob Olsson
652cd1c78a libwifi: 7.4.50 2024-03-22 11:18:25 +01:00
Anjan Chanda
7ab19c15d9 ieee1905d: 8.3.10 2024-03-22 10:45:13 +01:00
Vivek Kumar Dutta
35226f843c usermngr: use bbf.secure to store/retrive password 2024-03-21 19:56:38 +05:30
Amin Ben Romdhane
b8b02aabd3 bbfdm: Added bbf.secure to encode/decode values
Added a ubus method `bbf.secure` which allows encoding/decoding of values using sha512 hash or with a RSA private/public key pair
2024-03-21 13:50:22 +00:00
Vivek Kumar Dutta
6784f696af sulu: 3.1.57 2024-03-21 18:30:47 +05:30
Vivek Kumar Dutta
350b9ce7c8 dnsmngr: align with bbfdm 2024-03-21 18:14:52 +05:30
Vivek Kumar Dutta
5cbe7033c8 icwmp: Suppport Cancelled DiagnosticsState 2024-03-21 18:12:18 +05:30
Vivek Kumar Dutta
c15b4aa0c3 bbfdm: 1.7.19
- JSON Plugin: use ubus blocking API to run operate command
- Fix the refresh instances order
- Support Canceled DiagnosticsState
2024-03-21 18:03:00 +05:30
Filip Matusiak
e7ff39bfc8 self-diagnostics: add radio status and iw dev 2024-03-21 10:02:20 +00:00
Arne Jonsson
196ea82509 voicemngr: add ssl and crypto lib needed by new Broadcom version 2024-03-21 10:31:42 +01:00
Yalu Zhang
be38a9cdca libvoice-d2-1.1.6: Support K-break signal 2024-03-20 18:00:44 +01:00
Vivek Kumar Dutta
aa4424b97f sulu: 3.1.56 2024-03-20 19:59:30 +05:30
Vivek Kumar Dutta
a1b4b34b39 bbfdm: option to add respawn and core for microservice 2024-03-20 19:42:47 +05:30
Vivek Kumar Dutta
b0ea1a6a53 sulu: 3.1.55 2024-03-20 10:03:20 +05:30
Rahul Thakur
ad9742abb4 update package ethmngr
* 53d31f7 ethmngr: remove event
2024-03-20 09:54:44 +05:30
Rahul Thakur
53c8950947 ethmngr: add ruleng recipe for ethport hotplug event
hotplug event generated now from ruleng recipe based on the
network.device event
2024-03-20 01:05:43 +00:00
Amin Ben Romdhane
edd89d2aaf bbfdm: 1.7.17 2024-03-19 14:20:42 +01:00
Roman Azarenko
718860f30e iopsys-analytics: fix compatibility with iputils-ping 2024-03-19 13:12:25 +01:00
Rahul Thakur
025533f734 qosmngr: handle single lan port devices
update logic to read board ports to also handle devices with
single lan port
2024-03-19 16:34:23 +05:30
102 changed files with 1039 additions and 4217 deletions

View File

@@ -6,6 +6,10 @@ config BBF_VENDOR_PREFIX
string "Vendor Prefix"
default "X_IOPSYS_EU_"
config BBF_OBFUSCATION_KEY
string "Obfuscation key"
default "371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04"
config BBF_TR143
bool "Enable TR-143 Data Model Support"
default y

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bbfdm
PKG_VERSION:=1.7.17
PKG_VERSION:=1.8.0
USE_LOCAL:=0
ifneq ($(USE_LOCAL),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
PKG_SOURCE_VERSION:=8c998e886ce5345cfead5092ccf5447b8a8f7ee7
PKG_SOURCE_VERSION:=f64c33163742fb1b379952ea8ae34dac677f5e57
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -94,6 +94,11 @@ endif
define Package/libbbfdm-api/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/libbbfdm-api.so $(1)/lib/
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(CP) $(PKG_BUILD_DIR)/libbbfdm-api/scripts/bbf.secure $(1)/usr/libexec/rpcd/bbf.secure
$(INSTALL_DIR) $(1)/etc/bbfdm
echo "$(CONFIG_BBF_OBFUSCATION_KEY)" > $(1)/etc/bbfdm/.secure_hash
$(INSTALL_DIR) $(1)/etc/bbfdm/certificates
endef
define Package/libbbfdm/install
@@ -102,7 +107,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
@@ -112,13 +118,13 @@ 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
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/libbbfdm/dmtree/vendor/iopsys/libbbfdm_iopsys_ext.so, $(1))
endif
ifeq ($(CONFIG_BBF_TR143),y)
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts/
$(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
$(CP) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm/scripts/
$(LN) /usr/share/bbfdm/scripts/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
endif
endef
@@ -138,7 +144,6 @@ define Package/bbfdmd/install
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
$(INSTALL_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

View File

@@ -4,89 +4,37 @@ bbfdm provides few compile time configuration options and compile time help util
## Compilation options
| Configuration option | Default Value | Description |
| Configuration option | Description | Default Value |
| ----------------------- | ------------- | ----------- |
| CONFIG_BBF_VENDOR_LIST | iopsys | List of vendor extension directories |
| CONFIG_BBF_VENDOR_PREFIX | X_IOPSYS_EU_ | Prefix for Vendor extension datamodel objects/parameters |
| CONFIG_BBF_TR143 | y | Enable/Add TR-143 Data Model Support |
| CONFIG_BBF_TR471 | y | Enable/Add TR-471 Data Model Support |
| CONFIG_BBF_MAX_OBJECT_INSTANCES | 255 | Maximum number of instances per object |
| 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 |
#### BBF_OBFUSCATION_KEY
`bbfdm` provides an ubus object called `bbf.secure` to allow encoding/decoding the values, `bbf.secure` currently support following methods internally to encode/decode
- Encode/Decode using a predefined SHA512 Hash key
- Encode/Decode using a private/public RSA key pair
The `BBF_OBFUSCATION_KEY` compile time configuration option used to defined the SHA512 HASH, if this option is undefined, then it usages a default value as mention in the above table.
User must override this parameter with their own hash value, to generate a hash user can run below command and copy the hash value to this option.
ex: User wants to use 'Sup3rS3cur3Passw0rd' as passkey, then can get the SHA512 sum with
```bash
$ echo -n "Sup3rS3cur3Passw0rd" | sha512sum
371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04 -
```
> Note: Additionally, user can install RSA private key in '/etc/bbfdm/certificates/private_key.pem' path, if private key is present `bbf.secure` shall use rsa private certificate for encrypt/decrypt function. In case of key not present in the pre-defined path, hash will be used for the same.
## Helper utility (bbfdm.mk)
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
```

View File

@@ -2,56 +2,107 @@
# Copyright (C) 2023 IOPSYS
#
BBFDM_BASE_DM_PATH=/usr/share/bbfdm
# Utility to install the plugin in bbfdm core path
# inputs:
# $1 => package install directory
# $2 => Plugin artifact
# $1 => Plugin artifact
# $2 => package install directory
#
# Example:
# $(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
# $(call BbfdmInstallCorePlugin, ./files/etc/bbfdm/json/CWMPManagementServer.json, $(1))
#
define BbfdmInstallPlugin
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
define BbfdmInstallCorePlugin
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins/
endef
# Utility to install the plugin in bbfdm core path with priority
# 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.
#
# inputs:
# $1 => package install directory
# $2 => Priority of the installed plugin
# $3 => Plugin artifact
# $1 => Plugin artifact
# $2 => package install directory
# $3 => Priority of the installed plugin
#
# Note:
# - Last loaded plugin gets the highest priority
#
# Example:
# $(call BbfdmInstallPluginWithPriority,$(1),01,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
# $(call BbfdmInstallCorePluginPriority, $(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json, $(1), 01)
#
define BbfdmInstallPluginWithPriority
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
$(INSTALL_DATA) $(3) $(1)/etc/bbfdm/plugins/$(2)_$(shell basename ${3})
endef
# Utility to install the plugin in datamodel microservice directory
# inputs:
# $1 => package install directory with micro-service directory
# $2 => Plugin artifact
#
# Example:
# $(call BbfdmInstallPluginInMicroservice,$(1)/etc/bulkdata,$(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json)
#
define BbfdmInstallPluginInMicroservice
$(INSTALL_DIR) $(1)
$(INSTALL_DATA) $(2) $(1)/
define BbfdmInstallCorePluginPriority
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/plugins/$(strip $(3))_$(notdir $(strip $(1)))
endef
# Utility to install the datamodel plugin input file
# inputs:
# $1 => package install directory
# $2 => Microservice input.json path
# $1 => Microservice input.json path
# $2 => package install directory
#
# Example:
# $(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bulkdata/input.json)
# $(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bulkdata/input.json, $(1))
#
define BbfdmInstallMicroServiceInputFile
$(INSTALL_DIR) $(1)/etc/bbfdm/micro_services
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/micro_services/$(PKG_NAME).json
define BbfdmInstallMicroServiceDMInputFile
$(INSTALL_DIR) $(strip $(2))/etc/bbfdm/micro_services
$(INSTALL_DATA) $(1) $(strip $(2))/etc/bbfdm/micro_services/$(PKG_NAME).json
endef
# Utility to install the main plugin in bbfdm service directory, ex.
# 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.
#
# inputs:
# $1 => DotSo or Json plugin with complete path
# $2 => package install directory
#
# Note:
# - There could be only one main plugin file, so its bind to PKG_NAME
#
# Example:
# $(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/libcwmp.so, $(1))
#
define BbfdmInstallMicroServiceDM
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services/$(strip $(PKG_NAME))$(suffix $(strip $(1)))
endef
# Utility to install the plugins and datamodel extensions inside a microservice plugin directory
# inputs:
# $1 => package install directory
# $2 => DotSo or Json datamodel plugin/extension with complete path
# $3 => service name
#
# Note:
# - Use the service_name/PKG_NAME of the service in which this has to run
#
# Example:
# $(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/libxmpp.so, $(1), icwmp)
#
define BbfdmInstallMicroServicePlugin
$(INSTALL_DIR) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services/$(strip $(3))
$(INSTALL_DATA) $(1) $(strip $(2))$(BBFDM_BASE_DM_PATH)/micro_services/$(strip $(3))/
endef
# Deprecated functions errors
define BbfdmInstallPluginInMicroservice
$(error # BbfdmInstallPluginInMicroservice is deprecated, use BbfdmInstallMicroServiceDM or BbfdmInstallMicroServicePlugin #)
endef
define BbfdmInstallMicroServiceInputFile
$(error # BbfdmInstallMicroServiceInputFile deprecated, use BbfdmInstallMicroServiceDMInputFile #)
endef
define BbfdmInstallPlugin
$(error # BbfdmInstallPlugin deprecated, use BbfdmInstallCorePlugin #)
endef
define BbfdmInstallPluginWithPriority
$(error # BbfdmInstallPluginWithPriority deprecated, use BbfdmInstallCorePluginPriority #)
endef

View File

@@ -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

View File

@@ -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",

View File

@@ -1,6 +1,11 @@
config bbfdmd 'bbfdmd'
option enable '1'
option loglevel '1'
option refresh_time '300'
option refresh_time '120'
option transaction_timeout '30'
option subprocess_level '2'
config micro_services 'micro_services'
option enable '1'
option enable_core '0'
option enable_respawn '1'

View File

@@ -10,6 +10,8 @@ BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
BBFDM_MICROSERVICE_DIR="/etc/bbfdm/micro_services"
BBFDM_TEMP_DIR="/tmp/bbfdm"
. /usr/share/libubox/jshn.sh
log() {
echo "${@}"|logger -t bbfdmd.init -p info
}
@@ -26,41 +28,83 @@ validate_bbfdm_bbfdmd_section()
'subprocess_level:uinteger'
}
bbfdm_add_micro_service()
validate_bbfdm_micro_service_section()
{
local name path
path="${1}"
name="$(basename ${path})"
name="${name//.json}"
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['${PROG}','-m','$path']}}}"
uci_validate_section bbfdm micro_services "micro_services" \
'enable:bool:true' \
'enable_core:bool:false' \
'enable_respawn:bool:true'
}
_add_microservice()
{
local enable loglevel input_json name
local name path cmd
local enable enable_core enable_respawn
name="${1}"
input_json="$(jq -r '.daemon.input.name' ${name})"
# Check enable from micro-service
path="${1}"
enable_respawn="${2}"
enable_core="${3}"
if [ -f "${input_json}" ]; then
bbfdm_add_micro_service "${name}"
else
log "Input json [${input_json}] does not defined/present"
name="$(basename ${path})"
name="${name//.json}"
enable="$(jq '.daemon.enable//1' ${path})"
if [ "${enable}" -eq "0" ]; then
log "datamodel micro-service ${name} not enabled"
return 0
fi
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 "" "${name}"
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}"
}
configure_bbfdm_micro_services()
{
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
if [ -d "${BBFDM_MICROSERVICE_DIR}" ]; then
FILES="$(ls -1 ${BBFDM_MICROSERVICE_DIR}/*.json)"
for service in $FILES;
do
[ -e "$service" ] || continue
_add_microservice $service
_add_microservice $service "${enable_respawn}" "${enable_core}"
done
fi
ubus call service state '{"name":"bbfdm.services", "spawn":true}'
@@ -108,7 +152,7 @@ start_service()
stop_service()
{
ubus call service state '{"name":"bbfdm.services", "spawn":false}'
ubus call service delete '{"name":"bbfdm.services"}'
}
service_triggers()

View File

@@ -1,6 +1,6 @@
#!/bin/sh
UNIFIED_PATH="/etc/bbfdm/plugins/"
UNIFIED_PATH="/usr/share/bbfdm/plugins/"
# Link JSON plugins
for f in `ls -1 /etc/bbfdm/json/*.json`; do

View File

@@ -7,7 +7,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=bulkdata
PKG_VERSION:=2.1.8
PKG_VERSION:=2.1.9
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
@@ -50,10 +50,10 @@ define Package/$(PKG_NAME)/install
$(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_DATA) ./files/etc/init.d/bulkdatad $(1)/etc/init.d/
$(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)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/bulkdata.json, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bulkdata/input.json, $(1))
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "bulkdata",
"config": {
"loglevel": "1"
},
"input": {
"type": "JSON",
"name": "/etc/bulkdata/bulkdata.json"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -49,17 +49,15 @@ 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)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/src/libddnsmngr.so, $(1), $(PKG_NAME))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/ddnsmngr/input.json, $(1))
$(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

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "ddnsmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/ddnsmngr/libddnsmngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=decollector
PKG_VERSION:=4.2.1.4
PKG_VERSION:=4.4.0.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c18d0f411eea6974fc99dd9e717269087e75e874
PKG_SOURCE_VERSION:=a42af441d0efc315714305d6b944e6b09a29b64d
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmngr
PKG_VERSION:=1.0.2
PKG_VERSION:=1.0.3
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
PKG_SOURCE_VERSION:=3abb2b026c697b63f574bdc619e912e85ea55115
PKG_SOURCE_VERSION:=347070e096b98946ba660791e3c78d1646adc54a
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)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/src/libdnsmngr.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/dnsmngr/input.json, $(1))
endef
$(eval $(call BuildPackage,dnsmngr))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "dnsmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/dnsmngr/libdnsmngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -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/
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/libbbfdsl.so, $(1))
endef
$(eval $(call BuildPackage,dslmngr))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "dslmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/dsl/libbbfdsl.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=2.1.4
PKG_VERSION:=2.1.6
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a64e2775a3931f4e4624c9314658132ae9b7c5e3
PKG_SOURCE_VERSION:=b1ca967248cc5c7b852e8a904134e0bed451a116
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
@@ -69,9 +69,9 @@ 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)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/libbbfethernet.so, $(1))
$(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/libbbfethernetmacvlan.so, $(1), $(PKG_NAME))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/bbfdm/micro_services/ethernet.json, $(1))
endef
$(eval $(call BuildPackage,ethmngr))

View File

@@ -1,13 +1,9 @@
{
"daemon": {
"service_name": "ethmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/ethmngr/libbbfethernet.so",
"plugin_dir": "/etc/ethmngr/plugins"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -0,0 +1,23 @@
#!/bin/sh
[ -n "$PORT" -a -n "$LINK" ] || exit 0
case "$PORT" in
# do not generate ethport ubus event
# for wifi, dsl and brige devices
wl*|wds*|atm*|ptm*|br-*)
exit 0
;;
esac
speed=0
duplex=full
if [ "$LINK" = "up" ]; then
devspeed="$(ubus -t 2 call network.device status "{\"name\":\"$PORT\"}" | jsonfilter -e @.speed)"
speed=${devspeed:0:-1}
duplex=${devspeed:0-1}
[ "$duplex" == "H" ] && duplex="half" || duplex="full"
fi
ubus send ethport "{\"ifname\":\"$PORT\",\"link\":\"$LINK\",\"speed\":\"$speed\",\"duplex\":\"$duplex\"}"

View File

@@ -0,0 +1,20 @@
{
"ethport_update": {
"if" : [
{
"event": "network.device"
}
],
"then" : [
{
"cli": "/sbin/hotplug-call ethernet",
"envs": {
"PORT": "&network.device->ifname",
"LINK": "&network.device->link"
},
"timeout": 1
}
]
}
}

View File

@@ -0,0 +1,2 @@
uci -q set ruleng.ethport=rule
uci -q set ruleng.ethport.recipe='/etc/ruleng/ethport.json'

View File

@@ -1,59 +0,0 @@
#
# Copyright (C) 2022-2024 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=firewallmngr
PKG_VERSION:=1.0.0
#LOCAL_DEV:=1
#ifneq ($(LOCAL_DEV),1)
#PKG_SOURCE_PROTO:=git
#PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/firewallmngr.git
#PKG_SOURCE_VERSION:=4f429e25c6e7a69c5171186731bc560befa5a660
#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:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +firewall
TITLE:=Package to add Device.Firewall data model support.
endef
define Package/firewallmngr/description
Package to add Device.Firewall data model support.
endef
#ifeq ($(LOCAL_DEV),0)
#define Build/Prepare
# $(CP) -rf ./src/* $(PKG_BUILD_DIR)/
#endef
#endif
define Package/firewallmngr/install
$(INSTALL_DIR) $(1)/etc/firewallmngr
$(INSTALL_DIR) $(1)/etc/firewallmngr/plugins
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/lib/fwmngr
$(INSTALL_DATA) ./files/etc/config/firewallmngr $(1)/etc/config/
$(INSTALL_DATA) ./files/etc/init.d/firewallmngr $(1)/etc/init.d/
$(INSTALL_DATA) ./files/lib/fwmngr/fwmngr.sh $(1)/lib/fwmngr/
$(call BbfdmInstallPluginInMicroservice, $(1)/etc/firewallmngr,./files/etc/firewallmngr/nat.json)
$(call BbfdmInstallPluginInMicroservice, $(1)/etc/firewallmngr/plugins,$(PKG_BUILD_DIR)/libfirewallmngr.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/bbfdm/micro_services/firewallmngr.json)
endef
$(eval $(call BuildPackage,firewallmngr))

View File

@@ -1,18 +0,0 @@
{
"daemon": {
"config": {
"loglevel": "4"
},
"input": {
"type": "JSON",
"name": "/etc/firewallmngr/nat.json",
"plugin_dir": "/etc/firewallmngr/plugins"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",
"root_obj": "bbfdm",
"multiple_objects": ["NAT","Firewall"]
}
}
}

View File

@@ -1,133 +0,0 @@
config firewall 'firewall'
option config 'Advanced'
option Advanced_level 'level1'
config level 'level1'
option name 'level1'
option chain 'chain1'
option port_mapping_enabled '1'
option default_policy 'reject'
option default_log_policy '0'
option enable '1'
config chain 'chain1'
option enable '1'
option name 'chain1'
config rule 'rule1'
option chain 'chain1'
option enable '1'
option order '1'
option target 'accept'
option source_interface 'lan'
config rule 'rule2'
option chain 'chain1'
option enable '1'
option order '2'
option description 'Allow-DHCP-Renew'
option target 'accept'
option source_interface 'wan'
option ip_version '4'
option protocol '17'
option dest_port '68'
config rule 'rule3'
option chain 'chain1'
option enable '1'
option order '3'
option description 'Allow-Ping'
option target 'accept'
option source_interface 'wan'
option ip_version '4'
option protocol '1'
config rule 'rule4'
option chain 'chain1'
option enable '1'
option order '4'
option description 'Allow-IGMP'
option target 'accept'
option source_interface 'wan'
option ip_version '4'
option protocol '2'
config rule 'rule5'
option chain 'chain1'
option enable '1'
option order '5'
option description 'Allow-DHCPv6'
option target 'accept'
option source_interface 'wan'
option ip_version '6'
option protocol '17'
option dest_port '546'
config rule 'rule6'
option chain 'chain1'
option enable '1'
option order '6'
option description 'Allow-MLD'
option target 'accept'
option source_interface 'wan'
option ip_version '6'
option source_ip 'fe80::'
option source_mask 'fe80::/10'
option protocol '1'
config rule 'rule7'
option chain 'chain1'
option enable '1'
option order '7'
option description 'Allow-ICMPv6-Input'
option target 'accept'
option source_interface 'wan'
option ip_version '6'
option protocol '1'
config rule 'rule8'
option chain 'chain1'
option enable '1'
option order '8'
option description 'Allow-ICMPv6-Forward'
option target 'accept'
option source_interface 'wan'
option dest_all_interface '1'
option ip_version '6'
option protocol '1'
config rule 'rule9'
option chain 'chain1'
option enable '1'
option order '9'
option description 'Allow-IPSec-ESP'
option target 'accept'
option source_interface 'wan'
option dest_interface 'lan'
option protocol '50'
config rule 'rule10'
option chain 'chain1'
option enable '1'
option order '10'
option description 'Allow-ISAKMP'
option target 'accept'
option source_interface 'wan'
option dest_interface 'lan'
option protocol '17'
option dest_port '500'
config rule 'rule11'
option chain 'chain1'
option enable '1'
option order '11'
option description 'Support-UDP-Traceroute'
option target 'reject'
option source_interface 'wan'
option ip_version '4'
option protocol '17'
option dest_port '33434'
option dest_port_range_max '33689'

View File

@@ -1,566 +0,0 @@
{
"json_plugin_version": 2,
"Device.NAT.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"access": false,
"array": false,
"InterfaceSettingNumberOfEntries": {
"type": "unsignedInt",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"mapping": [
{
"type": "uci",
"uci": {
"object": "firewallmngr",
"section": {
"type": "nat_interface_setting"
},
"option": {
"name": "@Count"
}
}
}
]
},
"PortMappingNumberOfEntries": {
"type": "unsignedInt",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"mapping": [
{
"type": "uci",
"uci": {
"object": "firewallmngr",
"section": {
"type": "nat_portmapping"
},
"option": {
"name": "@Count"
}
}
}
]
},
"MaxNumberOfPortMappings": {
"type": "unsignedInt",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"default": "32"
},
"Device.NAT.InterfaceSetting.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"uniqueKeys": [
"Alias",
"Interface"
],
"access": true,
"array": true,
"mapping": [
{
"type": "uci",
"uci": {
"file": "firewallmngr",
"section": {
"type": "nat_interface_setting"
},
"dmmapfile": "dmmap_nat"
}
}
],
"Enable": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"default": "false",
"datatype": "boolean",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "enable"
}
]
},
"Status": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "Disabled",
"datatype": "string",
"enumerations": [
"Disabled",
"Enabled",
"Enabled_NATForcedDisabled",
"Enabled_PortMappingDisabled",
"Error_Misconfigured",
"Error"
]
},
"Alias": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "Alias",
"range": [
{
"max": 64
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "alias"
}
]
},
"Interface": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"flags": [
"Reference"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "interface",
"linker_obj": "Device.IP.Interface.[Name==@key]."
}
]
},
"SourceNetwork": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"list": {
"datatype": "string",
"range": [
{
"max": 256
}
]
}
},
"TCPTranslationTimeout": {
"type": "int",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"default": "300",
"datatype": "int",
"range": [
{
"min": -1
}
],
"unit": "seconds"
},
"UDPTranslationTimeout": {
"type": "int",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"default": "30",
"datatype": "int",
"range": [
{
"min": -1
}
],
"unit": "seconds"
}
},
"Device.NAT.PortMapping.{i}.": {
"type": "object",
"protocols": [
"cwmp",
"usp"
],
"uniqueKeys": [
"Alias",
"RemoteHost",
"ExternalPort",
"Protocol"
],
"access": true,
"array": true,
"mapping": [
{
"type": "uci",
"uci": {
"file": "firewallmngr",
"section": {
"type": "nat_portmapping"
},
"dmmapfile": "dmmap_nat"
}
}
],
"Enable": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"default": "false",
"datatype": "boolean",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "enable"
}
]
},
"Status": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "Disabled",
"datatype": "string",
"enumerations": [
"Disabled",
"Enabled",
"Error_Misconfigured",
"Error"
]
},
"Origin": {
"type": "string",
"read": true,
"write": false,
"protocols": [
"cwmp",
"usp"
],
"default": "Controller",
"datatype": "string",
"enumerations": [
"User",
"System",
"UPnP",
"Controller"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "origin"
}
]
},
"Alias": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "Alias",
"range": [
{
"max": 64
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "alias"
}
]
},
"Interface": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"flags": [
"Reference"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "interface",
"linker_obj": "Device.IP.Interface.*.Name"
}
]
},
"AllInterfaces": {
"type": "boolean",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"default": "false",
"datatype": "boolean",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "all_interfaces"
}
]
},
"LeaseDuration": {
"type": "unsignedInt",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"unit": "seconds",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "lease_duration"
}
]
},
"RemoteHost": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "remote_host"
}
]
},
"ExternalPort": {
"type": "unsignedInt",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"range": [
{
"min": 0,
"max": 65535
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "external_port"
}
]
},
"ExternalPortEndRange": {
"type": "unsignedInt",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"default": "0",
"datatype": "unsignedInt",
"range": [
{
"min": 0,
"max": 65535
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "external_port_end"
}
]
},
"InternalPort": {
"type": "unsignedInt",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "unsignedInt",
"range": [
{
"min": 0,
"max": 65535
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "internal_port"
}
]
},
"Protocol": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"enumerations": [
"TCP",
"UDP"
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "protocol"
}
]
},
"InternalClient": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "internal_client"
}
]
},
"Description": {
"type": "string",
"read": true,
"write": true,
"protocols": [
"cwmp",
"usp"
],
"datatype": "string",
"range": [
{
"max": 256
}
],
"mapping": [
{
"data": "@Parent",
"type": "uci_sec",
"key": "description"
}
]
}
}
}
}

View File

@@ -1,16 +0,0 @@
#!/bin/sh /etc/rc.common
START=18
USE_PROCD=1
. /lib/fwmngr/fwmngr.sh
. /etc/bbfdm/bbfdm_services.sh
start_service() {
configure_firewall
}
service_triggers() {
procd_add_reload_trigger firewallmngr
}

View File

@@ -1,300 +0,0 @@
#!/bin/sh
#set -x
. /lib/functions.sh
TEMP_UCI_PATH="/tmp/firewall"
INPUT="REJECT"
OUTPUT="ACCEPT"
FORWARD="REJECT"
zone_list=""
get_rule_ip_family() {
if [ "$1" == "4" ]; then
echo "ipv4"
elif [ "$1" == "6" ]; then
echo "ipv6"
else
echo "-1"
fi
}
set_rule_target() {
local rule_sec="$1"
local target="$2"
local targetchain="$3"
if [ "$target" == "Accept" ] || [ "$target" == "accept" ] || [ "$target" == "Reject" ] || [ "$target" == "reject" ] || [ "$target" == "Drop" ] || [ "$target" == "drop" ]; then
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.target="$(echo $target | awk '{ print toupper($target) }')"
elif [ "$target" == "Retrun" ]; then
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.target="MARK"
elif [ "$target" == "TargetChain" ]; then
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.target="$targetchain"
else
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.target="DROP"
fi
}
set_rule_protocol() {
local rule_sec="$1"
local protocol="$protocol"
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.proto="$protocol"
#TODO implementaton to configure icmpType
}
create_firewall_zone_config() {
local intf="$1"
local masq="$2"
local zone_exist="false"
local is_bridge="false"
local intf_dev=""
local dev=""
local zn=""
is_device_type_bridge() {
config_get dev $1 "name"
config_get dev_type $1 "type"
if [ "$dev" == "$intf_dev" ] && [ "$dev_type" == "bridge" ]; then
is_bridge="true"
fi
}
for zn in $zone_list; do
if [ "$zn" == "$intf" ]; then
zone_exist="true"
fi
done
if [ "$zone_exist" == "false" ]; then
zone_list="$zone_list $intf"
#default masq is set to 1 for zone wan
if [ "$intf" == "wan" ]; then
masq="1"
fi
zone_sec=$(uci -p "$TEMP_UCI_PATH" add "firewall" "zone")
uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.enabled="1"
uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.name="$intf"
intf_dev=$(uci -q get network.$intf.device)
config_load network
config_foreach is_device_type_bridge device
uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.output="$OUTPUT"
if [ "$is_bridge" == "true" ]; then
uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.input="ACCEPT"
uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.forward="ACCEPT"
else
uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.input="REJECT"
uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.forward="REJECT"
fi
uci -p "$TEMP_UCI_PATH" add_list firewall.$zone_sec.network="$intf"
[ "$masq" == "1" ] && uci -p "$TEMP_UCI_PATH" set firewall.$zone_sec.masq="1"
uci -p "$TEMP_UCI_PATH" rename firewall.$zone_sec="$intf"
else
[ "$masq" == "1" ] && uci -p "$TEMP_UCI_PATH" add_list firewall.${intf}.masq="1"
fi
}
#create_redirect_config() {
#}
handle_firewall_rule() {
local rule="$1"
local chain_name="$2"
local chain=""
local is_enable=""
local src_intf=""
local ip_version=""
local ip_famiexitproto=""
local protocol=""
local dest_intf=""
local target=""
local targetchain=""
local desc=""
local dest_port=""
local src_port=""
local src_port_range_max=""
local dest_port_range_max=""
local src_ip=""
local dest_ip=""
config_get is_enable "$rule" "enable" 0
[ "$is_enable" == "1" ] || return
config_get chain "$rule" "chain"
[ "$chain" == "$chain_name" ] || return
config_get src_intf "$rule" "source_interface"
config_get dest_intf "$rule" "dest_interface"
if [ -n "$src_intf" ]; then
create_firewall_zone_config "$src_intf" "0"
fi
if [ -n "$dest_intf" ]; then
create_firewall_zone_config "$dest_intf" "0"
fi
config_get ip_version "$rule" "ip_version"
ip_family="$(get_rule_ip_family $ip_version)"
config_get protocol "$rule" "protocol"
config_get src_port "$rule" "src_port"
config_get dest_port "$rule" "dest_port"
config_get src_ip "$rule" "src_ip"
config_get dest_ip "$rule" "dest_ip"
config_get dest_port_range_max "$rule" "dest_port_range_max"
config_get src_port_range_max "$rule" "src_port_range_max"
config_get target "$rule" "target"
config_get targetchain "$rule" "targetchain"
config_get desc "$rule" "description"
rule_sec=$(uci -p "$TEMP_UCI_PATH" add firewall rule)
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.enabled="1"
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.name="$desc"
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.src="$src_intf"
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.dst="$dst_intf"
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.family="$ip_family"
set_rule_target "$rule_sec" "$target" "$tagetchain"
set_rule_protocol "$rule_sec" "$protocol"
if [ -z "$dest_port_range_max" ]; then
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.dest_port="$dest_port"
else
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.dest_port="$dest_port:$dest_port_range_max"
fi
if [ -z "$src_port_range_max" ]; then
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.src_port="$src_port"
else
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.src_port="$src_port:$src_port_range_max"
fi
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.src_ip="$src_ip"
uci -p "$TEMP_UCI_PATH" set firewall.$rule_sec.dest_ip="$dest_ip"
uci -p "$TEMP_UCI_PATH" rename firewall.$rule_sec="$rule"
}
handle_nat_interface_setting() {
local nat_intf_cfg="$1"
local interface=""
local enable=""
config_get enable $nat_intf_cfg "enable"
[ -z "$enable" ] && return
config_get interface $nat_intf_cfg "interface"
if [ "$enable" == "1" ] && [ -n "$interface" ]; then
create_firewall_zone_config "$interface" "1"
fi
}
handle_nat_port_mapping() {
local nat_port_cfg="$1"
local enable=""
local interface=""
local all_interface=""
local lease_duration=""
local remote_host=""
local external_port=""
local external_port_end=""
local internal_port=""
local protocol=""
local internal_client=""
local description=""
local redirect_sec=""
local epoch_sec=""
local stop_epoch=""
local stop_ymd=""
local stop_hms=""
config_get enable $nat_port_cfg "enable"
masq=$(uci -q get firewall.$interface.masq)
if [ -z "$enable" ] && ! [ "$masq" == "1" ]; then
return
fi
config_get interface $nat_port_cfg "interface"
config_get internal_client $nat_port_cfg "internal_client"
if [ -z "$interface" ] || [ -z "$internal_client" ]; then
return
fi
config_get all_interface $nat_port_cfg "all_interface"
config_get lease_duration $nat_port_cfg "lease_duration"
config_get remote_host $nat_port_cfg "remote_host"
config_get external_port $nat_port_cfg "external_port" "0"
config_get external_port_end $nat_port_cfg "external_port_end" "0"
config_get internal_port $nat_port_cfg "internal_port"
config_get protocol $nat_port_cfg "protocol"
protocol=$(echo $protocol | awk '{print tolower($0)}')
config_get description $nat_port_cfg "description"
redirect_sec=$(uci -p "$TEMP_UCI_PATH" add firewall redirect)
uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.src="$interface"
uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.enabled="1"
uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.dest_ip="$internal_client"
[ -z "$protocol" ] || uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.protocol="$protocol"
[ -z "$remote_host" ] || uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.src_ip="$remote_host"
if [ -n "$lease_duration" ] && ! [ "$lease_duration" == "0" ]; then
epoch_sec=$(date +%s)
stop_epoch=$(( epoch_sec + lease_duration ))
stop_ymd=$(date -d @${stop_epoch} +%Y-%m-%d)
stop_hms=$(date -d @${stop_epoch} +%H:%M:%S)
uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.stop_date="$stop_ymd"
uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.stop_time="$stop_hms"
fi
if [ "$external_port_end" == "0" ]; then
if ! [ "$external_port" == "0" ]; then
uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.src_dport="$external_port"
fi
else
uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.src_dport="$external_port-$external_port_end"
fi
[ -z "$internal_port" ] || uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.dest_port="$internal_port"
[ -z "$description" ] || uci -p "$TEMP_UCI_PATH" set firewall.$redirect_sec.description="$description"
uci -p "$TEMP_UCI_PATH" rename firewall.$redirect_sec="$nat_port_cfg"
}
configure_firewall() {
rm -rf "$TEMP_UCI_PATH"/firewall 2>/dev/null
mkdir -p "$TEMP_UCI_PATH"
touch "$TEMP_UCI_PATH"/firewall
zone_list=""
config_load firewallmngr
fw_config="$(uci -q get firewallmngr.firewall.config)"
[ -z "$fw_config" ] && return
[ "$fw_config" == "Advanced" ] || return
fw_level="$(uci -q get firewallmngr.firewall.${fw_config}_level)"
[ -z "$fw_level" ] && return
enabled="$(uci -q get firewallmngr.${fw_level}.enable)"
[ "$enabled" == "1" ] || exit
chain="$(uci -q get firewallmngr.${fw_level}.chain)"
[ -z "$chain" ] && exit
enabled="$(uci -q get firewallmngr.${chain}.enable)"
chain_name="$(uci -q get firewallmngr.${chain}.name)"
#configure firewall global config
global_sec=$(uci -p "$TEMP_UCI_PATH" add firewall globals)
uci -p "$TEMP_UCI_PATH" set firewall.$global_sec.enabled="1"
uci -p "$TEMP_UCI_PATH" rename firewall.$global_sec="globals"
#configure firewall default config
default_sec=$(uci -p "$TEMP_UCI_PATH" add firewall default)
uci -p "$TEMP_UCI_PATH" set firewall.$default_sec.syn_flood="1"
uci -p "$TEMP_UCI_PATH" set firewall.$default_sec.input="$INPUT"
uci -p "$TEMP_UCI_PATH" set firewall.$default_sec.output="$OUTPUT"
uci -p "$TEMP_UCI_PATH" set firewall.$default_sec.forward="$FORWARD"
config_foreach handle_firewall_rule rule "$chain_name"
config_load firewallmngr
config_foreach handle_nat_interface_setting nat_interface_setting
config_foreach handle_nat_port_mapping nat_portmapping
uci -c "$TEMP_UCI_PATH" commit firewall
cp "$TEMP_UCI_PATH"/firewall /etc/config/
}

View File

@@ -1,17 +0,0 @@
LIB = libfirewallmngr.so
LIB_OBJS = firewallmngr.o
PROG_CFLAGS = $(CFLAGS) -Wall -Werror -fPIC
LIB_LDFLAGS = $(LDFLAGS)
%.o: %.c
$(CC) $(PROG_CFLAGS) -c -o $@ $<
all: $(LIB)
$(LIB): $(LIB_OBJS)
$(CC) $(PROG_CFLAGS) -shared -o $@ $^ $(LIB_LDFLAGS)
clean:
rm -f *.o $(LIB)

View File

@@ -1,12 +0,0 @@
char *Config[] = {"High", "Low", "Off", "Advanced", "Policy", NULL};
char *DefaultPolicy[] = {"Drop", "Accept", "Reject", NULL};
char *TargetChain[] = {"Drop", "Accept", "Reject", "Chain", NULL};
char *ReverseTargetChain[] = {"Drop", "Accept", "Reject", "Chain", NULL};
char *Target[] = {"Drop", "Accept", "Reject", "Return", "TargetChain", NULL};
char *ConnectionState[] = {"INVALID", "NEW", "RELATED", "ESTABLISHED", NULL};
char *MACAddress[] = {"^$", "^([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])$", NULL};
char *MACAddress[] = {"^$", "^([0-9A-Fa-f][0-9A-Fa-f]:){5}([0-9A-Fa-f][0-9A-Fa-f])$", NULL};
char *Origin[] = {"User", "System", "Controller", NULL};
char *IPv4Address[] = {"^$", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])$", NULL};
char *IPv4Prefix[] = {"^$", "^/(3[0-2]|[012]?[0-9])$", "^((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])/(3[0-2]|[012]?[0-9])$", NULL};
char *Action[] = {"Drop", "Accept", "Reject", NULL};

File diff suppressed because it is too large Load Diff

View File

@@ -1,26 +0,0 @@
/*
* Copyright (C) 2024 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Husaam Mehdi <husaam.mehdi@iopsys.eu>
*/
#ifndef __FIREWALLMNGR_H
#define __FIREWALLMNGR_H
#include <libbbfdm-api/dmcommon.h>
#include <libbbfdm_api.h>
extern DMOBJ tFirewallObj[];
extern DMLEAF tFirewallParams[];
extern DMLEAF tFirewallLevelParams[];
extern DMOBJ tFirewallChainObj[];
extern DMLEAF tFirewallChainParams[];
extern DMLEAF tFirewallChainRuleParams[];
extern DMLEAF tFirewallDMZParams[];
extern DMLEAF tFirewallServiceParams[];
#endif //__FIREWALLMNGR_H

View File

@@ -22,6 +22,7 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/hostmngr
@@ -58,13 +59,18 @@ endif
MAKE_PATH:=src
define Package/hostmngr/install
$(CP) ./files/etc $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/hostmngr/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(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/
$(INSTALL_BIN) ./files/scripts/hosts_acl.sh $(1)/usr/share/hostmngr/
$(INSTALL_DATA) ./files/etc/config/hosts $(1)/etc/config/
$(INSTALL_BIN) ./files/etc/init.d/hostmngr $(1)/etc/init.d/
$(INSTALL_BIN) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
$(call BbfdmInstallMicroServiceDMInputFile, ./files/bbfdm/input.json, $(1))
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so, $(1))
endef
ifeq ($(LOCAL_DEV),1)

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "hostmngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/hostmngr/libhostmngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=9.7.3
PKG_VERSION:=9.7.4
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
PKG_SOURCE_VERSION:=d1caec840201824b590a4aa98766d0aa94a409b0
PKG_SOURCE_VERSION:=1a5ed79a014ff3e9633b70b310bf3f21dea6f036
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -59,9 +59,9 @@ 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)
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/libcwmpdm.so, $(1))
$(call BbfdmInstallMicroServicePlugin, ./files/etc/bbfdm/json/CWMPManagementServer.json, $(1), icwmp)
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/icwmpd/input.json, $(1))
endef
$(eval $(call BuildPackage,icwmp))

View File

@@ -1,13 +1,9 @@
{
"daemon": {
"service_name": "icwmp",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/icwmpd/libcwmpdm.so",
"plugin_dir": "/etc/icwmpd/plugins/"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=8.3.9
PKG_VERSION:=8.3.12
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=00322a24b4f5bf0dff768db965200295f52e32d7
PKG_SOURCE_VERSION:=4f94b73ac3e9472bbcd84c6c8f91118aa6ca9f6b
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

View File

@@ -4,7 +4,7 @@ PKG_NAME:=iopsys-analytics
PKG_RELEASE:=$(COMMITCOUNT)
PKG_LICENSE:=PROPRIETARY
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=88dd7997ed78b1ab02c2904ed90518c46a8fa26b
PKG_SOURCE_VERSION:=1a749bdebd142a83ba0733f1644a6241403c9097
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

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libdpp
PKG_VERSION:=2.0.0
PKG_VERSION:=2.1.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=f22959b107a8bf443d04d6261d00074b5514dfe8
PKG_SOURCE_VERSION:=1f82436531d4bb094b0b74e99613e0dfc84eada3
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/libdpp.git
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libeasy
PKG_VERSION:=7.4.3
PKG_VERSION:=7.4.4
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=ba80dcc51056772c906cac8022a2537b74959e6a
PKG_SOURCE_VERSION:=7a9e69c413c2d0b950a1a2e0f2964439fb797f48
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

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libethernet
PKG_VERSION:=7.2.108
PKG_VERSION:=7.2.109
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=df0181ae4e8391901a8005ffa17ff28fbce8ec64
PKG_SOURCE_VERSION:=cc72f5ab0171cd0fc29bb48dafff6751ab2f0d9c
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_MIRROR_HASH:=skip

View File

@@ -10,7 +10,7 @@ PKG_VERSION:=7.2.106
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=02dba6571fddd9b4c5b4b671270604b4c0faf9ae
PKG_SOURCE_VERSION:=0e54d7a992c506d6302d7cc32a39eb64e9b2c42e
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

View File

@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libvoice-d2
PKG_RELEASE:=1
PKG_VERSION:=1.1.5
PKG_VERSION:=1.1.6
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:=0a7a3219bf0d90b1f1a31b0deaf9a6d78b6420f1
PKG_SOURCE_VERSION:=054cbe19186dbc3682f6977e7856cdac1226f17a
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libwifi
PKG_VERSION:=7.4.49
PKG_VERSION:=7.4.54
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=be3df63b06bc0d7af5997fd999d0a996c89316cd
PKG_SOURCE_VERSION:=89db12dd11025fd4b6d7dfa3ec497a4b9b2d1ab8
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

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=4.5.2.3
PKG_VERSION:=4.6.0.3
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=9f3a56d86c844b45c896abfdf885f4c197c3cf81
PKG_SOURCE_VERSION:=4ecb56d8069896c1ca555e2acdbac94126002add
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
PKG_LICENSE:=BSD-3-Clause

View File

@@ -1,5 +1,5 @@
config agent 'agent'
option enabled '0'
option enabled '1'
option debug '0'
option profile '3'
option al_bridge 'br-lan'

View File

@@ -5,8 +5,8 @@
generate_mapagent_config=0
generate_wireless_sta_config=0
network_mode="$(fw_printenv -n netmode)"
multiap_mode="$(fw_printenv -n multiap_mode)"
network_mode="$(fw_printenv -n netmode)" # default is layer3
multiap_mode="$(fw_printenv -n multiap_mode)" # default is full
is_airoha() {
[ -f /proc/device-tree/compatible ] || return
@@ -175,16 +175,15 @@ map_genconf () {
elif [ "$multiap_mode" == "auto" ]; then
uci -q set mapagent.@controller_select[0].autostart=1
uci -q set mapagent.@controller_select[0].local=0
elif [ "$multiap_mode" == "full" ]; then
uci -q set mapagent.@controller_select[0].autostart=1
uci -q set mapagent.@controller_select[0].local=1
elif [ "$multiap_mode" == "none" ]; then
uci set mapagent.agent.enabled="0"
else # default to full
uci -q set mapagent.@controller_select[0].autostart=1
uci -q set mapagent.@controller_select[0].local=1
fi
uci -q commit mapagent
fi
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
uci set mapcontroller.controller.enabled="0"
else

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=4.6.1.0
PKG_VERSION:=4.7.0.2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=96b5b249ddd12828726ab14310011f39727253ef
PKG_SOURCE_VERSION:=433218c312cde4e72e77de307172e899fa0f58a1
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
LOCAL_DEV=0

View File

@@ -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.0
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:=5d5b42f5b46457ed938765f29994471485e7de81
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,8 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
else
$(CP) ./files/linux/* $(1)/
endif
$(call BbfdmInstallPluginInMicroservice, $(1)/etc/mcastmngr,$(PKG_BUILD_DIR)/bbf_plugin/libmcast_bbf.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/common/etc/mcastmngr/input.json)
endef
$(eval $(call BuildPackage,mcastmngr))

View File

@@ -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

View File

@@ -0,0 +1,14 @@
{
"daemon": {
"input": {
"type": "DotSo",
"name": "/etc/mcastmngr/libmcast_bbf.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",
"root_obj": "bbfdm",
"multiple_objects": ["X_IOPSYS_EU_IGMP","X_IOPSYS_EU_MLD"]
}
}
}

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=7.0.5.19
PKG_VERSION:=7.0.5.20
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
PKG_SOURCE_VERSION:=83e4608de2dd316efbe336b93dab90aa47a2b4a6
PKG_SOURCE_VERSION:=8706169718211848d85af9aa6bcdb7b97db2b9b8
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -108,7 +108,7 @@ define Package/obuspa/install
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/USPAgent.json)
$(call BbfdmInstallCorePlugin, ./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/

View File

@@ -0,0 +1,95 @@
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
index 04a1a9c..00b95a4 100644
--- a/src/core/mqtt.c
+++ b/src/core/mqtt.c
@@ -2124,6 +2124,75 @@ exit:
}
}
+static int _check_host_rechability(CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
+{
+ bool *palive = (bool *)userp;
+
+ USP_ASSERT(palive != NULL);
+ switch(type) {
+ case CURLINFO_HEADER_OUT:
+ case CURLINFO_HEADER_IN:
+ *palive = true;
+ break;
+ case CURLINFO_TEXT:
+ {
+ USP_LOG_Debug("CURL DATA:: [%s]", data);
+ if (strstr(data, "Connected to ") != NULL) {
+ *palive = true;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+int check_mqtt_host_reachability(mqtt_client_t *client)
+{
+ CURL *curl;
+ mqtt_conn_params_t *cparam = &client->conn_params;
+ char buffer[128] = {0};
+ int ret = USP_ERR_INTERNAL_ERROR;
+ bool is_alive = false;
+
+ curl = curl_easy_init();
+ if(curl) {
+ USP_SNPRINTF(buffer, 128, "mqtt://%s:%d", cparam->host, cparam->port);
+ curl_easy_setopt(curl, CURLOPT_URL, buffer);
+
+ if (strlen(cparam->username) > 0) {
+ curl_easy_setopt(curl, CURLOPT_USERNAME, cparam->username);
+ }
+
+ if (strlen(cparam->password) > 0) {
+ curl_easy_setopt(curl, CURLOPT_PASSWORD, cparam->password);
+ }
+
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &is_alive);
+ curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, _check_host_rechability);
+
+ /* complete within 2 seconds */
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, 2L);
+
+ ret = curl_easy_perform(curl);
+ /* Check for errors */
+ if(ret == CURLE_OK || ret == CURLE_URL_MALFORMAT || is_alive == true) {
+ USP_LOG_Debug("CURL MQTT host %s, ret %d, alive %d ...", buffer, ret, is_alive);
+ ret = USP_ERR_OK;
+ } else {
+ USP_LOG_Info("# CURL MQTT host %s unreachable: %d=>%s ...", buffer, ret, curl_easy_strerror(ret));
+ }
+
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+ }
+
+ return ret;
+}
+
/*********************************************************************//**
**
** PerformMqttClientConnect
@@ -2193,6 +2262,14 @@ int PerformMqttClientConnect(mqtt_client_t *client)
keep_alive = 5;
}
+ // Below function is a workaround to check the host reachability with a timeout
+ // mosquitto_connect_* API block the thread for 2 mins if host is not reachable,
+ // which halts other clients connectivity
+ err = check_mqtt_host_reachability(client);
+ if (err != USP_ERR_OK) {
+ err = USP_ERR_INTERNAL_ERROR;
+ goto exit;
+ }
// Release the access mutex temporarily whilst performing the connect call
// We do this to prevent the data model thread from potentially being blocked, whilst the connect call is taking place
OS_UTILS_UnlockMutex(&mqtt_access_mutex);

View File

@@ -20,6 +20,7 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/periodicstats
SECTION:=utils
@@ -39,12 +40,14 @@ endef
endif
define Package/periodicstats/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/periodicstatsd $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/periodicstats
$(CP) $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so $(1)/etc/periodicstats
$(INSTALL_DATA) ./files/etc/config/periodicstats $(1)/etc/config/
$(INSTALL_BIN) ./files/etc/init.d/periodicstats $(1)/etc/init.d/
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/libperiodicstats.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bbfdm/micro_services/periodicstats.json, $(1))
endef
$(eval $(call BuildPackage,periodicstats))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "periodicstats",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/periodicstats/libperiodicstats.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -40,7 +40,8 @@ ifneq ($(CONFIG_TARGET_brcmbca),)
else ifneq ($(CONFIG_TARGET_airoha),)
$(CP) ./files/airoha/* $(1)/
endif
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/xpon.json)
$(call BbfdmInstallMicroServiceDM, ./files/etc/ponmngr/xpon.json, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/ponmngr/input.json, $(1))
endef
$(eval $(call BuildPackage,ponmngr))

View File

@@ -0,0 +1,14 @@
{
"daemon": {
"service_name": "ponmngr",
"config": {
"loglevel": "1"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",
"object": "XPON",
"root_obj": "bbfdm"
}
}
}

View File

@@ -26,7 +26,7 @@ define Package/port-trigger
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Port Trigger Daemon
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +kmod-ipt-trigger +kmod-ip6t-trigger +iptables-mod-nfqueue +firewallmngr
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +kmod-ipt-trigger +kmod-ip6t-trigger +iptables-mod-nfqueue
endef
define Package/port-trigger/description
@@ -43,11 +43,13 @@ define Package/port-trigger/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/lib/port-trigger
$(INSTALL_DIR) $(1)/etc/firewallmngr/plugins
$(CP) ./files/* $(1)/
$(INSTALL_BIN) ./files/etc/init.d/port-trigger $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/port-trigger $(1)/etc/config/
$(INSTALL_DATA) ./files/lib/port-trigger/port_trigger.sh $(1)/lib/port-trigger/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/bbf_plugin/libporttrigger.so $(1)/etc/firewallmngr/plugins/
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/libporttrigger.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/bbfdm/micro_services/port-trigger.json, $(1))
endef
$(eval $(call BuildPackage,port-trigger))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "port-trigger",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/port-trigger/libporttrigger.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.NAT.",

View File

@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qosmngr
PKG_VERSION:=1.0.7
PKG_VERSION:=1.0.8
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=4179d88a94d8d5989c67504228f9d61ec8a57aac
PKG_SOURCE_VERSION:=c07b4631e42191a45426e3a7dd1e000700c48edc
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
@@ -22,12 +22,13 @@ PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
define Package/qosmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=QoS Manager
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
DEPENDS:=+libbbfdm-api +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos +!(TARGET_brcmbca||TARGET_airoha):tc-full
endef
define Package/qosmngr/description
@@ -41,6 +42,7 @@ endef
endif
define Package/qosmngr/install
$(INSTALL_DIR) $(1)/etc/qos_bbf
$(CP) ./files/common/* $(1)/
ifneq ($(CONFIG_TARGET_brcmbca),)
$(CP) ./files/broadcom/* $(1)/
@@ -51,6 +53,8 @@ else
endif
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qosmngr $(1)/usr/sbin
$(call BbfdmInstallMicroServiceDM, $(PKG_BUILD_DIR)/bbf_plugin/libqos_bbf.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/common/etc/qos_bbf/input.json, $(1))
endef
$(eval $(call BuildPackage,qosmngr))

View File

@@ -101,7 +101,7 @@ handle_policer() {
# Configure policer based on UCI subtree 'qos.policer'
configure_policer() {
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
if [ -n "${intf}" ] ; then
hw_policer_set_ingress_rate "$intf" 0 0
fi

View File

@@ -8,7 +8,7 @@ pre_configure_queue() {
# Delete queues
hw_queue_init_all
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
hw_intf_init "${intf}"
done
}

View File

@@ -35,7 +35,7 @@ handle_shaper() {
# Configure shaper based on options saved to UCI tree 'qos.shaper'
configure_shaper() {
# Delete existing shaper
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
hw_shaper_set "$intf" del
done

View File

@@ -80,7 +80,7 @@ sort_q_by_precedence() {
}
sort_by_precedence() {
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
sort_q_by_precedence $interf
done
}
@@ -335,7 +335,7 @@ handle_shaper() {
assign_policer_to_port() {
local ifname="$1"
local pindex="$2"
local portorder="$(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs)"
local portorder="$(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs)"
for port in $portorder; do
if [ "$ifname" == "$port" ]; then
@@ -421,7 +421,7 @@ config_ingress_rate_limit() {
configure_shaper() {
# Delete existing shaper
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
tmctl setportshaper --devtype 0 --if $intf --shapingrate 0 --burstsize -1
done
# Load UCI file
@@ -432,7 +432,7 @@ configure_shaper() {
pre_configure_queue() {
# Delete queues
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
rm -rf /tmp/qos/$intf
mkdir -p /tmp/qos/$intf
@@ -452,7 +452,7 @@ pre_configure_queue() {
configure_queue_shaping_rate() {
# Load UCI file
config_load qos
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
Q_COUNT=0
config_foreach handle_queue_shapingrate queue $interf
done
@@ -463,7 +463,7 @@ configure_queue() {
config_load qos
config_foreach handle_q_order queue
sort_by_precedence
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
Q_COUNT=0
# sp queue have max priority value = no. of queue configured on the port
# hence read and update SP_Q_PRIO here
@@ -476,7 +476,7 @@ configure_queue() {
configure_policer() {
# The policer object is not available on non BCM968* chips, just clean up
# the old config if any and return
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
local unitport="$(get_port_number $intf)"
local unit=$(echo $unitport | cut -d ' ' -f 1)
local port=$(echo $unitport | cut -d ' ' -f 2)

View File

@@ -0,0 +1,14 @@
{
"daemon": {
"service_name": "qosmngr",
"config": {
"loglevel": "1"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",
"object": "QoS",
"root_obj": "bbfdm"
}
}
}

View File

@@ -242,7 +242,7 @@ handle_ebtables_rules() {
if [ "$all_interfaces" == "1" ]; then
is_l2_rule=1
elif [ -n "$src_if" ]; then
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
if [ "$src_if" == "$interf" ]; then
src_if="$src_if+"
broute_filter_on_src_if "$src_if"

View File

@@ -82,7 +82,7 @@ sort_q_by_precedence() {
}
sort_by_precedence() {
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
sort_q_by_precedence $interf
done
}
@@ -384,7 +384,7 @@ config_ingress_rate_limit() {
pre_configure_queue() {
# Delete queues
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for intf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
rm -rf /tmp/qos/$intf
mkdir -p /tmp/qos/$intf
@@ -463,7 +463,7 @@ configure_queue() {
bs=$(( bs / 1000 ))
}
local wanport="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.wan.device | xargs); do
for interf in $(jsonfilter -i /etc/board.json -e @.network.lan.ports[*] -e @.network.lan.device -e @.network.wan.device | xargs); do
Q_COUNT=0
rate=0
# sp queue have max priority value = no. of queue configured on the port

View File

@@ -0,0 +1,3 @@
for radio_if in $(ubus list 'wifi.radio.*'); do
ubus call "${radio_if}" status
done

View File

@@ -12,9 +12,13 @@
"cmd": "ubus call network.wireless status"
},
{
"description": "Wireless Radio Status",
"description": "WiFi Status",
"cmd": "ubus call wifi status"
},
{
"description": "WiFi Radio Status",
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_status.sh"
},
{
"description": "Get radio scan",
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_radio_scan.sh"
@@ -23,6 +27,10 @@
"description": "Get Assoc List",
"cmd": "sh /usr/share/self-diagnostics/helper/wifi_assoclist.sh"
},
{
"description": "List Wireless Devices",
"cmd": "iw dev"
},
{
"description": "iwinfo interface details",
"cmd": "/usr/bin/iwinfo"

25
sshmngr/Config.in Normal file
View File

@@ -0,0 +1,25 @@
if PACKAGE_sshmngr
choice
prompt "Select backend for SSH management"
default SSHMNGR_BACKEND_OPENSSH
depends on PACKAGE_sshmngr
help
Select which backend daemon to use for SSH
config SSHMNGR_BACKEND_OPENSSH
bool "Use openssh for ssh"
help
Enable this option to use openssh for ssh.
config SSHMNGR_BACKEND_OPENSSH_PAM
bool "Use openssh with PAM for ssh"
help
Enable this option to use PAM for ssh.
config SSHMNGR_BACKEND_DROPBEAR
bool "Use dropbear for ssh"
help
Enable this option to use dropbear for ssh.
endchoice
endif

70
sshmngr/Makefile Normal file
View File

@@ -0,0 +1,70 @@
#
# Copyright (C) 2022-2024 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=sshmngr
PKG_VERSION:=1.0.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/sshmngr.git
PKG_SOURCE_VERSION:=9758a7a0f798ad2b19597f4ec161e82edbdb2753
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/sshmngr
SECTION:=net
CATEGORY:=Network
TITLE:=Package to add Device.SSH data model support.
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api
DEPENDS+=+SSHMNGR_BACKEND_OPENSSH:openssh-server +SSHMNGR_BACKEND_OPENSSH:openssh-client-utils
DEPENDS+=+SSHMNGR_BACKEND_OPENSSH_PAM:openssh-server-pam +SSHMNGR_BACKEND_OPENSSH_PAM:openssh-client-utils
DEPENDS+=+SSHMNGR_BACKEND_DROPBEAR:dropbear
endef
define Package/sshmngr/description
Package to add Device.SSH data model support.
endef
define Package/$(PKG_NAME)/config
source "$(SOURCE)/Config.in"
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ./sshmngr/* $(PKG_BUILD_DIR)/
endef
endif
define Package/sshmngr/install
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/lib/sshmngr
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
$(INSTALL_DATA) ./files/common/etc/config/sshmngr $(1)/etc/config/
$(INSTALL_BIN) ./files/common/etc/init.d/sshmngr $(1)/etc/init.d/
$(INSTALL_DATA) ./files/common/lib/sshmngr/sshmngr.sh $(1)/lib/sshmngr/
$(INSTALL_BIN) ./files/common/usr/libexec/rpcd/sshmngr $(1)/usr/libexec/rpcd/
ifeq ($(CONFIG_SSHMNGR_BACKEND_DROPBEAR),y)
$(INSTALL_DATA) ./files/dropbear_backend/lib/sshmngr/backend.sh $(1)/lib/sshmngr/
else
$(INSTALL_DATA) ./files/openssh_backend/lib/sshmngr/backend.sh $(1)/lib/sshmngr/
endif
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/src/libsshmngr.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile, ./files/common/etc/sshmngr/input.json, $(1))
endef
$(eval $(call BuildPackage,sshmngr))

View File

@@ -0,0 +1,7 @@
config server 'ssh1'
option enable '1'
option PasswordAuth '1'
option RootPasswordAuth '1'
option RootLogin '1'
option Port '22'
option MaxAuthTries '10'

View File

@@ -0,0 +1,11 @@
#!/bin/sh /etc/rc.common
START=18
USE_PROCD=1
. /lib/sshmngr/sshmngr.sh
service_triggers() {
configure_ssh
procd_add_reload_trigger sshmngr
}

View File

@@ -0,0 +1,14 @@
{
"daemon": {
"service_name": "sshmngr",
"config": {
"loglevel": "1"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",
"object": "SSH",
"root_obj": "bbfdm"
}
}
}

View File

@@ -0,0 +1,64 @@
#!/bin/sh
. /lib/sshmngr/backend.sh
TEMP_UCI_PATH="/tmp/sshmngr"
handle_server_section()
{
local cfg="$1"
local enable
local PasswordAuth=""
local Port=""
local RootPasswordAuth=""
local RootLogin=""
local Interface=""
local SSHKeepAlive=""
local IdleTimeout=""
local MaxAuthTries=""
local ServerName="${cfg}"
config_get_bool enable $cfg enable 0
[ $enable -eq 0 ] && return
config_get PasswordAuth $cfg PasswordAuth
config_get Port $cfg Port
config_get RootPasswordAuth $cfg RootPasswordAuth
config_get RootLogin $cfg RootLogin
config_get Interface $cfg Interface
config_get SSHKeepAlive $cfg SSHKeepAlive
config_get IdleTimeout $cfg IdleTimeout
config_get MaxAuthTries $cfg MaxAuthTries
# add section
uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName=$CONFIG
# set options
[ -n "$PasswordAuth" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.PasswordAuth=$PasswordAuth
[ -n "$Port" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.Port=$Port
[ -n "$RootPasswordAuth" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.RootPasswordAuth=$RootPasswordAuth
[ -n "$RootLogin" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.RootLogin=$RootLogin
[ -n "$Interface" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.Interface=$Interface
[ -n "$SSHKeepAlive" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.SSHKeepAlive=$SSHKeepAlive
[ -n "$IdleTimeout" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.IdleTimeout=$IdleTimeout
[ -n "$MaxAuthTries" ] && uci -c "$TEMP_UCI_PATH" set $CONFIG.$ServerName.MaxAuthTries=$MaxAuthTries
}
configure_ssh()
{
# remove temp UCI
rm -rf "$TEMP_UCI_PATH"/$CONFIG 2>/dev/null
mkdir -p "$TEMP_UCI_PATH"
touch "$TEMP_UCI_PATH"/$CONFIG
# read all sshmngr server sections and then apply them to $CONFIG UCI
config_load sshmngr
config_foreach handle_server_section server
uci -c "$TEMP_UCI_PATH" commit $CONFIG
cp "$TEMP_UCI_PATH"/$CONFIG /etc/config/$CONFIG
/etc/init.d/$CONFIG reload
}

View File

@@ -0,0 +1,222 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/sshmngr/backend.sh
TEMP_KEY_FILE="/tmp/tempkeyfile"
add_server_name()
{
local server_sec="${1}"
config_get_bool enable "${server_sec}" enable 0
if [ "${enable}" -eq 0 ]; then
return
fi
server_names="${server_names} ${server_sec}"
}
get_all_servers()
{
server_names=""
config_load sshmngr
config_foreach add_server_name server
echo "${server_names}"
}
get_pid()
{
local server_name="$1"
local pid_file="$(get_pid_file "$server_name")"
local server_pid=0
# if proper file exists
if [ -f "${pid_file}" ] && [ -s "${pid_file}" ]; then
server_pid="$(cat "${pid_file}")"
fi
echo "$server_pid"
}
case "$1" in
list)
echo '{ "dump" : {"server_name":"string"}, "kill_session" : {"session_pid":"string","server_name":"string"}, "list_keys" : {}, "add_pubkey" : {"current_key":"string","new_key":"string"}, "remove_pubkey" : {"key":"string"} }'
;;
call)
case "$2" in
dump)
read -r input
json_load "${input}"
json_get_var server_name "server_name"
json_cleanup
if [ -z "$server_name" ]; then
servers="$(get_all_servers)"
else
servers="$server_name"
fi
json_init
for server in $servers; do
json_add_object "$server"
pid_file="$(get_pid_file "$server")"
server_pid="$(get_pid "$server")"
if [ "$server_pid" -eq 0 ]; then
return
fi
# get all current sessions
session_pids="$(get_session_pids "$pid_file")"
json_add_string "pid" "$server_pid"
json_add_array "sessions"
for session_pid in $session_pids; do
# if pid equals server pid then skip
[ "$session_pid" -eq "$server_pid" ] && continue
# get this session's ppid
session_ppid="$(grep PPid /proc/$session_pid/status | awk '{print $2}')"
# if session's parent is this server
if [ "$session_ppid" -eq "$server_pid" ]; then
session="$(netstat -ntp | grep $session_pid/ | awk '{print $5,$7}' | cut -d'/' -f 1)"
# return session IP, Port, PID
ip=$(echo "$session" | cut -d ':' -f 1)
port=$(echo "$session" | cut -d ':' -f 2 | cut -d ' ' -f 1)
pid=$(echo "$session" | cut -d ':' -f 2 | cut -d ' ' -f 2)
json_add_object
json_add_string "ip" "$ip"
json_add_string "port" "$port"
json_add_string "pid" "$pid"
json_close_object
fi
done
json_close_array
json_close_object
done
json_dump
;;
kill_session)
read -r input
json_load "${input}"
json_get_var session_pid "session_pid"
json_get_var server_name "server_name"
json_cleanup
if [ "$session_pid" -gt 0 ]; then
kill -15 "$session_pid"
else
[ -n "$server_name" ] || return
# if server_name is present
# get all current sessions
pid_file="$(get_pid_file "$server_name")"
server_pid="$(get_pid "$server_name")"
if [ "$server_pid" -eq 0 ]; then
return
fi
# get all current sessions
session_pids="$(get_session_pids "$pid_file")"
for session_pid in $session_pids; do
# if pid equals server pid then skip
[ "$session_pid" -eq "$server_pid" ] && continue
# get this session's ppid
session_ppid="$(grep PPid /proc/$session_pid/status | awk '{print $2}')"
# if session's parent is this server
if [ "$session_ppid" -eq "$server_pid" ]; then
kill -15 "$session_pid"
fi
done
fi
;;
list_keys)
# remove empty lines from file
sed -i '/^[[:space:]]*$/d' "$KEY_FILE"
json_init
json_add_array "keys"
while read line; do
json_add_string "key" "${line}"
done < "$KEY_FILE"
json_close_array
json_dump
;;
add_pubkey)
read -r input
json_load "${input}"
json_get_var current_key "current_key"
json_get_var new_key "new_key"
json_cleanup
if [ -n "${new_key}" ]; then
if [ -n "${current_key}" ]; then
rm -rf TEMP_KEY_FILE
touch TEMP_KEY_FILE
# sed -i "s/${current_key}/${new_key}/g" ${KEY_FILE}
# sed is not advisable because the separator ("/") or anything else
# can be present in the string
while read line; do
if [ "${line}" == "${current_key}" ]; then
echo "${new_key}" >> TEMP_KEY_FILE
else
echo "${line}" >> TEMP_KEY_FILE
fi
done < "$KEY_FILE"
mv TEMP_KEY_FILE "$KEY_FILE"
else
echo "${new_key}" >> ${KEY_FILE}
fi
fi
;;
remove_pubkey)
read -r input
json_load "${input}"
json_get_var key "key"
json_cleanup
if [ -n "${key}" ]; then
rm -rf TEMP_KEY_FILE
touch TEMP_KEY_FILE
# sed -i "/${key}/d" ${KEY_FILE}
# sed -i "s/${current_key}/${new_key}/g" ${KEY_FILE}
# sed is not advisable because the separator ("/") or anything else
# can be present in the string
while read line; do
if [ "${line}" != "${key}" ]; then
echo "${line}" >> TEMP_KEY_FILE
fi
done < "$KEY_FILE"
mv TEMP_KEY_FILE "$KEY_FILE"
fi
;;
esac
;;
esac

View File

@@ -0,0 +1,20 @@
#!/bin/sh
. /lib/functions.sh
KEY_FILE="/etc/dropbear/authorized_keys"
CONFIG="dropbear"
get_pid_file()
{
local ServerName="$1"
echo "/var/run/$CONFIG.$ServerName.pid"
}
get_session_pids()
{
local PidFile="$1"
echo "$(ps -w | grep $PidFile | grep -v grep | awk '{print $1}')"
}

View File

@@ -0,0 +1,18 @@
#!/bin/sh
. /lib/functions.sh
CONFIG="sshd"
KEY_FILE="/root/.ssh/authorized_keys"
get_pid_file()
{
local ServerName="$1"
echo "/var/run/$CONFIG.$ServerName.pid"
}
get_session_pids()
{
echo "$(ps -w | grep sshd | grep pts | awk '{print $1}')"
}

View File

@@ -23,6 +23,7 @@ PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include ../bbfdm/bbfdm.mk
MAKE_PATH:=src
@@ -52,7 +53,7 @@ define Package/stunc/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/stunc $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/stunc $(1)/etc/init.d/stunc
$(INSTALL_DATA) ./files/etc/config/stunc $(1)/etc/config/stunc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/libstunc.so $(1)/etc/icwmpd/plugins/
$(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/src/libstunc.so, $(1), icwmp)
endef
$(eval $(call BuildPackage,stunc))

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-base
PKG_VERSION:=3.1.54
PKG_VERSION:=3.1.59
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
PKG_SOURCE_VERSION:=92483c2b45cbfff59ef46c645deb7b2f06f5186f
PKG_SOURCE_VERSION:=729253b3864edc3dfbb10c839f5b6e3db7a26cc1
PKG_MIRROR_HASH:=skip
SULU_MOD:=core

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=sulu-builder
PKG_VERSION:=3.1.54
PKG_VERSION:=3.1.59
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
PKG_SOURCE_VERSION:=c32e4dafe6ace5a17e1a0077e4212063c648e036
PKG_SOURCE_VERSION:=51c0d46343b3b1122b4f1df73399526160f968dd
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/sulu-$(PKG_VERSION)/sulu-builder-$(PKG_SOURCE_VERSION)

View File

@@ -96,8 +96,8 @@ ifeq ($(CONFIG_PACKAGE_crun),y)
$(INSTALL_BIN) ./files/etc/config/crun $(1)/etc/config/crun
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/crun_create $(1)/usr/sbin/crun_create
endif
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/swmodd,$(PKG_BUILD_DIR)/libswmodd.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/swmodd/input.json)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/libswmodd.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/swmodd/input.json, $(1))
endef
define Package/swmodd-cgroup/install

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "swmodd",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/swmodd/libswmodd.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -19,5 +19,5 @@ start_service() {
}
reload_service() {
[ -n "$TESTNET" ] && procd_running testnet && "$TESTNET" once
procd_send_signal testnet
}

View File

@@ -1,6 +1,7 @@
#!/bin/sh
. /lib/functions.sh
RELOAD=0
WAITING=0
NETCON=0
LASTSTATUS=""
@@ -13,32 +14,32 @@ test_connection() {
local defroute="$(ip r | grep default | awk '{print$3}' | head -1)"
local def6route="$(ip -f inet6 r | grep default | awk '{print$3}')"
local ping6dev="$(ip -f inet6 r | grep default | awk '{print$5}')"
local resolvfile="$(uci -q get dhcp.@dnsmasq[0].resolvfile)"
local resolvfile="$(uci -q get 'dhcp.@dnsmasq[0].resolvfile')"
if [ -n "$addr" ]; then
ping -q -w 5 -c 1 $addr >/dev/null 2>&1 && return 0
ping -q -w 5 -c 1 "$addr" >/dev/null 2>&1 && return 0
elif [ -n "$defroute" ]; then
ping -q -w 5 -c 1 $defroute >/dev/null 2>&1 && return 0
ping -q -w 5 -c 1 "$defroute" >/dev/null 2>&1 && return 0
if [ -e "$resolvfile" ]; then
for nmsrv in $(grep nameserver "$resolvfile" | awk '{print$2}'); do
ping -q -w 5 -c 1 $nmsrv >/dev/null 2>&1 && return 0
ping -q -w 5 -c 1 "$nmsrv" >/dev/null 2>&1 && return 0
done
fi
elif [ -n "$def6route" -a -n "$ping6dev" ]; then
ndisc6 -w 5 -1 $def6route $ping6dev >/dev/null 2>&1 && return 0
ndisc6 -w 5 -1 "$def6route" "$ping6dev" >/dev/null 2>&1 && return 0
fi
return 1
}
internet_test() {
local link dest
local dest
# use the destination address given in config for connectivity check
dest="$(uci -q get testnet.global.destination)"
# for backwards compatibility
[ -n "$dest" ] || dest="$(uci -q get system.@system[0].netping_addr)"
[ -n "$dest" ] || dest="$(uci -q get 'system.@system[0].netping_addr')"
test_connection $dest
test_connection "$dest"
if [ "$?" -eq 0 ]; then
NETCON=1
@@ -52,7 +53,7 @@ internet_test() {
connectivity_test() {
internet_test
if [ $NETCON -eq 1 ]; then
if [ "$NETCON" -eq 1 ]; then
CURSTATUS=1
[ "$CURSTATUS" == "$LASTSTATUS" ] || ubus send internet '{"status" : "online"}'
LASTSTATUS=1
@@ -63,12 +64,14 @@ connectivity_test() {
fi
}
if [ "$1" == "once" ]; then
connectivity_test
exit 0
fi
trap RELOAD=1 HUP
while true; do
if [ "$WAITING" -eq 0 ]; then
sleep "$SLEEP_TIME" &
WAITING=1
fi
RELOAD=0
connectivity_test
sleep $SLEEP_TIME
[ "$RELOAD" -eq 0 ] && wait && WAITING=0
done

View File

@@ -57,8 +57,8 @@ define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/timemngr $(1)/usr/sbin/timemngr
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/timemngr,$(PKG_BUILD_DIR)/src/libtimemngr.so)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/timemngr/input.json)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/src/libtimemngr.so, $(1))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/timemngr/input.json, $(1))
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/21-timemngr $(1)/etc/hotplug.d/iface/
$(INSTALL_BIN) ./files/etc/hotplug.d/ntp/40-firstUseDate $(1)/etc/hotplug.d/ntp/
$(INSTALL_BIN) ./files/etc/init.d/timemngr $(1)/etc/init.d/

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "timemngr",
"config": {
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/timemngr/libtimemngr.so"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -72,12 +72,12 @@ define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/tr104/plugins/
$(INSTALL_DIR) $(1)/etc/uci-defaults/
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/tr104,$(PKG_BUILD_DIR)/libdm/tr104/libtr104.so)
$(call BbfdmInstallMicroServiceDM,$(PKG_BUILD_DIR)/libdm/tr104/libtr104.so, $(1))
ifeq ($(CONFIG_TR104_VENDOR_EXTENSIONS),y)
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/tr104/plugins,$(PKG_BUILD_DIR)/libdm/extensions/iowrt/libtr104ext.so)
$(call BbfdmInstallMicroServicePlugin, $(PKG_BUILD_DIR)/libdm/extensions/iowrt/libtr104ext.so, $(1), tr104)
endif
ifeq ($(CONFIG_TR104_RUNAS_BBFDM_MICROSERVICE),y)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/tr104/input.json)
$(call BbfdmInstallMicroServiceDMInputFile, ./files/etc/tr104/bbfdm_input.json, $(1))
else
$(INSTALL_BIN) ./files/etc/tr104/input.json $(1)/etc/tr104/input.json
$(INSTALL_DIR) $(1)/usr/sbin

View File

@@ -0,0 +1,14 @@
{
"daemon": {
"service_name": "tr104",
"config": {
"loglevel": "1"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.Services.",
"object": "VoiceService",
"root_obj": "bbfdm"
}
}
}

View File

@@ -1,14 +1,12 @@
{
"daemon": {
"config": {
"loglevel": "1",
"refresh_time": "10",
"transaction_timeout": "30"
"loglevel": "1"
},
"input": {
"type": "DotSo",
"name": "/etc/tr104/libtr104.so",
"plugin_dir": "/etc/tr104/plugins/"
"name": "/usr/share/bbfdm/tr104.so",
"plugin_dir": "/usr/share/bbfdm/tr104/"
},
"output": {
"type": "UBUS",

View File

@@ -56,7 +56,7 @@ define Package/$(PKG_NAME)/install
$(INSTALL_BIN) ./files/etc/firewall.twamp $(1)/etc/firewall.twamp
$(INSTALL_BIN) ./files/etc/uci-defaults/92-twampfirewall $(1)/etc/uci-defaults/92-twampfirewall
$(INSTALL_BIN) ./files/etc/uci-defaults/93-twamp_fix_reflector $(1)/etc/uci-defaults/93-twamp_fix_reflector
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libtwamp.so)
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/libtwamp.so, $(1))
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -70,7 +70,7 @@ define Package/$(PKG_NAME)-server/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/udpechoserverd $(1)/usr/sbin/
$(INSTALL_DATA) ./files/etc/config/udpechoserver $(1)/etc/config/udpechoserver
$(INSTALL_BIN) ./files/etc/init.d/udpechoserverd $(1)/etc/init.d/udpechoserverd
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libudpechoserver.so)
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/src/libudpechoserver.so, $(1))
endef
define Package/$(PKG_NAME)-client/install

View File

@@ -52,8 +52,8 @@ define Package/urlfilter/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/urlfilter $(1)/usr/sbin
$(INSTALL_BIN) ./files/etc/init.d/urlfilter $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/urlfilter $(1)/etc/config/
$(call BbfdmInstallPluginInMicroservice,$(1)/etc/urlfilter,./files/etc/urlfilter/urlfilter.json)
$(call BbfdmInstallMicroServiceInputFile,$(1),./files/etc/urlfilter/input.json)
$(call BbfdmInstallMicroServiceDM,./files/etc/urlfilter/urlfilter.json, $(1))
$(call BbfdmInstallMicroServiceDMInputFile,./files/etc/urlfilter/input.json, $(1))
endef
$(eval $(call BuildPackage,urlfilter))

View File

@@ -1,12 +1,9 @@
{
"daemon": {
"service_name": "urlfilter",
"config": {
"loglevel": "1"
},
"input": {
"type": "JSON",
"name": "/etc/urlfilter/urlfilter.json"
},
"output": {
"type": "UBUS",
"parent_dm": "Device.",

View File

@@ -1,9 +0,0 @@
#
# Copyright (C) 2023 IOPSYS
#
define BbfdmInstallPlugin
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
endef

View File

@@ -5,13 +5,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=usermngr
PKG_VERSION:=1.2.12
PKG_VERSION:=1.2.13
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/usermngr.git
PKG_SOURCE_VERSION:=b09414824b95f2a73e6f02b06d4efd15bfab77e0
PKG_SOURCE_VERSION:=497148226e0ada16656a6971c5e66a023c740e87
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -50,7 +50,7 @@ define Package/usermngr/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/90-indicate-bootstrap $(1)/etc/uci-defaults/90-indicate-bootstrap
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/uci-defaults/91-sync-shells $(1)/etc/uci-defaults/91-sync-shells
$(INSTALL_BIN) ./files/etc/config/users $(1)/etc/config/users
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/src/libusermngr.so)
$(call BbfdmInstallCorePlugin, $(PKG_BUILD_DIR)/src/libusermngr.so, $(1))
endef
$(eval $(call BuildPackage,usermngr))

View File

@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=voicemngr
PKG_RELEASE:=1
PKG_VERSION:=1.1.9
PKG_VERSION:=1.1.11
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
@@ -19,7 +19,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:=10476ca2acd5bdad8062eb355d9c3558845c85cb
PKG_SOURCE_VERSION:=33db1b82fbb161d5a4dc253ecb6e0fb0648de3c8
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MIRROR_HASH:=skip
endif
@@ -48,7 +48,7 @@ define Package/$(PKG_NAME)
ifeq ($(CONFIG_TARGET_brcmbca),y)
include $(TOPDIR)/feeds/broadcom/bcmkernel/bcm-toolchain.mk
TARGET_CFLAGS := -I$(STAGING_DIR)/usr/include/bcm963xx/ -L$(STAGING_DIR)/root-brcmbca/usr/lib/broadcom -L$(STAGING_DIR)/usr/lib/broadcom
TARGET_CFLAGS := -I$(STAGING_DIR)/usr/include/bcm963xx/
TARGET_CPPFLAGS :=
TARGET_CXXFLAGS :=
EXTRA_CFLAGS :=
@@ -89,4 +89,3 @@ define Package/$(PKG_NAME)/install
$(CP) $(PKG_BUILD_DIR)/libvoice/libvoice.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

View File

@@ -9,12 +9,10 @@ NAME=voicemngr
start_service() {
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
[ -d "/usr/lib/broadcom" ] && BCM_LIBS=LD_LIBRARY_PATH=/lib/broadcom:/usr/lib/broadcom
procd_open_instance
procd_set_param env hw_board_hasDect="$(db get hw.board.hasDect)" \
hw_board_VoicePortNames="$(db get hw.board.VoicePortNames)" \
$BCM_LIBS
procd_set_param command $NAME
procd_set_param respawn "5" "0" "3"
procd_set_param nice -12

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