Compare commits

..

105 Commits

Author SHA1 Message Date
Suru Dissanaike
b1216b27d3 Revert "Update Makefile"
This reverts commit 8d205a9cfc
2020-11-18 10:48:18 +01:00
Suru Dissanaike
b969f9a373 Revert "Update Makefile"
This reverts commit a92443b42c
2020-11-18 10:47:32 +01:00
Suru Dissanaike
52dcdd8c07 Revert "IOP: Update config"
This reverts commit e756afd3e3
2020-11-18 10:46:03 +01:00
Amin Ben Ramdhane
cb38e87f39 bbf: 2.6-2020-11-13 2020-11-18 10:41:20 +01:00
Anjan Chanda
bff68b2211 ieee1905: 2.1.0 2020-11-18 10:41:20 +01:00
Suru Dissanaike
e756afd3e3 IOP: Update config 2020-11-03 21:33:12 +01:00
Suru Dissanaike
a92443b42c Update Makefile 2020-11-03 20:26:19 +01:00
Suru Dissanaike
8d205a9cfc Update Makefile 2020-11-03 17:15:19 +01:00
Jakob Olsson
1cc58b55e4 ieee1905: 20.0.30 - release-5.3 branch 2020-10-29 13:55:36 +01:00
Jakob Olsson
b5b5aab523 Revert "ieee1905: 20.0.30"
This reverts commit f01bd18ffc.
2020-10-29 13:54:46 +01:00
Jakob Olsson
f01bd18ffc ieee1905: 20.0.30 2020-10-29 13:45:09 +01:00
Omar Kallel
dcf2c78f55 icwmp: 5.0-2020-10-13 2020-10-28 12:54:57 +01:00
Amin Ben Ramdhane
33eb93c5a6 bbf: 2.5-2020-10-26 2020-10-28 12:52:39 +01:00
Arun Muthusamy
883b5bd0fa Add Libreswan package 2020-10-26 14:21:33 +01:00
Amin Ben Ramdhane
60f201d04f bbf: 2.5-2020-10-23 2020-10-23 12:01:19 +01:00
Sukru Senli
fe8857f271 iop: config: selectm miniupnpc by default 2020-10-19 13:48:47 +02:00
Jakob Olsson
94e9f52f74 map-1905: 0.0.13 2020-10-15 12:32:15 +02:00
Rahul
c2f8359a71 qosmngr: add log
Syslog added to log non-availability of traffic policing on the wan
port on 63138, this is a chip level limitation.
2020-10-14 14:58:13 +05:30
Rahul
7bbae7a4ac qosmngr: add support for dhcp option as classification criteria
DHCP option value 60, 61 and 77 can now be used to identify lan
clients. Details of UCI as follows:

config classify
    option src_vendor_class_id 'abc' // DHCP option 60.
    option dst_vendor_class_id 'abc' // DHCP option 60.
    option src_client_id 'xyz'       // DHCP option 61
    option dst_client_id 'xyz'       // DHCP option 61
    option src_user_class_id 'dfg'   // DHCP option 77
    option dst_user_class_id 'dfg'   // DHCP option 77
2020-10-14 11:24:18 +05:30
Rahul
baea8f9b5b qosmngr: add support for upstream policing on dg400prime
This patch adds support for upstream policing on dg400prime.
Downstream policing still seems to be an issue for which ticket
has been re-opened on broadcom.

Test:
Upstream policing test script passes on both panther and dg400prime.
2020-10-12 22:13:43 +05:30
Amin Ben Ramdhane
907e111bf2 bbf: fix SentOption segfault issue 2020-10-10 13:22:26 +02:00
Amin Ben Ramdhane
f4c0f9f4e6 bbf: fix DHCPv4 MaxAddress 2020-10-10 12:29:48 +02:00
Sukru Senli
9766cea180 bbf: 2.4-2020-10-10 2020-10-10 12:03:29 +02:00
Sukru Senli
2284fcabbd icwmp: keep cwmp session backup xml file over upgrade 2020-10-09 21:52:33 +02:00
Omar Kallel
b0166c10c0 Rename uci notify options && remove ubus call tr069 notify from the init 2020-10-09 20:06:55 +01:00
Omar Kallel
e744ed1619 icwmp: 09-10-2020 2020-10-09 18:52:30 +01:00
Omar Kallel
37865ab486 Add new notification feature & delete icwmp_notifd 2020-10-09 18:47:54 +01:00
Sukru Senli
c401361389 iop: select rsync; needed by upgrade script
rsync is GPLv3 so we need to make upgrade script independent of it
2020-10-09 18:44:01 +02:00
Amin Ben Ramdhane
f75c6e6be3 bbf: 2.4-2020-10-09 2020-10-09 18:03:40 +02:00
Omar
e658747f5c icwmp: 5.0-2020-10-09 2020-10-09 12:39:34 +02:00
sverma
57fe67db18 wfadatad: Misc Fixes.
* Added mandatory profile-2 tlvs
	* Topology query responded only when it's having map-2 provile TLV
	* Added support for ieee1905.neighbor event
2020-10-09 13:59:01 +05:30
Raphael Derensy
ea0a900205 iop: select atftp and atftpd as modules 2020-10-08 14:11:15 +02:00
vdutta
790fe1360d map-1905: Fix parsing of channel preference tlv 2020-10-08 17:27:31 +05:30
nevadita.chatterjee
a5c45e19bb map-topology:Added version 2020-10-07 20:32:35 +02:00
Omar Kallel
d9d62aa292 icwmp: 5.0-2020-10-07 2020-10-07 19:29:19 +02:00
Omar Kallel
9972c46622 bbf: 2.4-2020-10-07 2020-10-07 19:28:39 +02:00
Sukru Senli
9bd7a6d840 iop: deselect some gplv3 packages 2020-10-07 17:59:02 +02:00
Jakob Olsson
d0024fcc39 rulengd: add regex match to event name 2020-10-07 15:04:56 +02:00
Sukru Senli
dd22c6ca12 icwmp: remove unnecessary parts from init script 2020-10-07 13:57:53 +02:00
vdutta
78700807de ieee1905: Fix crash in ex400 2020-10-07 16:44:33 +05:30
vdutta
3f689b5ed6 map-1905: Multiple fixes
- Change structure for countrycode in CAC capability
 - Fix segfault in timestamp tlv
2020-10-07 16:42:08 +05:30
Omar Kallel
cfa27af769 bbf: 2020-10-02 2020-10-02 11:37:43 +01:00
Omar Kallel
be5a00249e icwmp: 2020-10-02 2020-10-02 11:36:03 +01:00
Jakob Olsson
e22739cc8c wifimngr: 8.2.9 2020-10-01 15:29:20 +02:00
Jakob Olsson
239d1633e1 easy-soc-libs: 5.3.15 2020-10-01 10:46:17 +02:00
Rahul
342bec0b25 qosmngr: add support for traffic policing
Support for traffic policing added to allow configuration of
ingress rate limiting.

Test (on panther):
- ingress rate limiting on per lan port basis for US traffic.
- ingress rate limiting on wan port for DS traffic.
- when ingress rate limiting is applied on traffic in one direction,
  then traffic in other direction remains un-affected, that is, if
  ingress rate limiting is applied in DS, then US traffic on the port
  is unaffected

Note: Autotest are ready and will be merge for now with the tag not_ready.
Once devel is ready or if we decide to merge this to release-5.3, the same
can be tagged ready and executed as part of nightly suite.
2020-09-30 09:10:39 +02:00
Anjan Chanda
3942b33e1e wifimngr: 8.2.8 2020-09-29 21:51:19 +02:00
Anjan Chanda
3c3608e87c easy-soc-libs: 5.3.14 2020-09-29 21:51:04 +02:00
Amin Ben Ramdhane
aaf0029500 bbf: 2.4-2020-09-29 2020-09-29 19:20:14 +01:00
Amin Ben Ramdhane
7b80bcf104 icwmp: 5.0-2020-09-29 2020-09-29 19:18:18 +01:00
Raphael Derensy
f419a955f6 iop: select vsftpd-tls as module 2020-09-29 11:40:08 +02:00
Suru Dissanaike
d644ce7be6 iop: config, change rsync to module 2020-09-28 11:10:32 +02:00
Amin Ben Ramdhane
887ff49b95 bbf: 2.3-2020-09-26 2020-09-26 17:30:01 +01:00
Amin Ben Ramdhane
9c6533f45f bbf: 2.2-2020-09-24 2020-09-24 16:15:38 +01:00
Jakob Olsson
08f903e2c1 wifimngr: 8.2.7 2020-09-24 15:02:56 +02:00
Jakob Olsson
833837cea1 easy-soc-libs: 5.3.9 2020-09-24 15:01:22 +02:00
vdutta
dabf83ea1d uspd: B#3272 improvements in resolving paths 2020-09-24 13:48:33 +05:30
Anjan Chanda
0e6146f105 map-topology: 1.5.5 - notify topology change event 2020-09-24 09:33:04 +02:00
Amin Ben Ramdhane
220a4efbf7 Ticket refs #3228: QEMU - ICWMP is segfaulting
Fix missing objects
2020-09-23 19:21:14 +01:00
vdutta
e5d8d81019 ieee1905: Get auth mode from bss.security 2020-09-23 19:07:59 +05:30
vdutta
70442e891f ieee1905: Remove redundant info from ubus objects 2020-09-22 19:52:21 +05:30
Sukru Senli
ec021d54f5 iop: genconfig: comment out mediatek open parts 2020-09-22 12:33:08 +02:00
Amin Ben Ramdhane
421e633094 bbf: 2.1-2020-09-21 2020-09-21 18:16:25 +01:00
Jakob Olsson
068308f052 rearrange start orders for topology and ieee1905 2020-09-21 16:15:39 +02:00
Omar Kallel
8809a7aba7 bbf: fix segfault 2020-09-21 14:05:15 +02:00
Omar Kallel
7575dccbc0 icwmp: 5.0-2020-09-21 2020-09-21 14:04:53 +02:00
Jakob Olsson
871831fdac wfadatad: use service_running hook to wait for ieee1905 object 2020-09-21 09:12:27 +02:00
Amin Ben Ramdhane
db41d298c3 bbf: 2.0-2020-09-21 2020-09-21 09:09:54 +02:00
Jakob Olsson
ad372152d5 ieee1905: config trigger to reload 2020-09-21 09:01:11 +02:00
Jakob Olsson
926648b090 ieee1905: change start order from 99 to 13 2020-09-21 08:49:34 +02:00
Jakob Olsson
240bdc5bb8 wfadatad: wait up to 2 seconds if ieee1905 is not up before start 2020-09-21 08:49:14 +02:00
Amin Ben Ramdhane
45e0b4f2ed bbf: 2.0-2020-09-18 2020-09-18 15:19:14 +01:00
Jakob Olsson
332a90d087 map-topology: iterate til ieee1905 object is up 2020-09-18 16:13:32 +02:00
Anjan Chanda
09937f540a ieee1905d: enable map plugin in default config 2020-09-18 15:17:57 +02:00
Anjan Chanda
af8f27ef65 wfadatad: 2.3.0 2020-09-18 15:13:12 +02:00
Jakob Olsson
8a799f183b easy-soc-libs: libeasy: include debug.h 2020-09-18 14:34:00 +02:00
sverma
2dbf38c06c wfadatad: Changes UBUS objects name 2020-09-18 13:35:17 +02:00
Anjan Chanda
b1fcc12599 wifimngr: 8.2.3 2020-09-18 13:31:04 +02:00
Anjan Chanda
9041f616e7 easy-soc-libs: 5.3.3 2020-09-18 13:30:32 +02:00
Anjan Chanda
dc14b18428 map-topology: 1.5.1 2020-09-18 13:29:33 +02:00
Amin Ben Ramdhane
e41f973953 xmpp, udpecho, twamp: compile with fPIC 2020-09-18 12:07:17 +02:00
vdutta
9889814f0b uspd: Optimizations to reduce high cpu usages 2020-09-17 16:22:17 +05:30
Sukru Senli
2922f211f7 bulkdata: compile with fPIC 2020-09-16 10:02:59 +02:00
Sukru Senli
22dd43c79e icwmp: set userid empty in cwmp config; it will be filled by uci-default 2020-09-16 08:22:07 +02:00
Omar Kallel
478c34d48f icwmp: add the file /lib/upgrade/keep.d/icwmp when installing icwmp 2020-09-15 16:25:26 +02:00
Sukru Senli
49f46ef075 icwmp: 5.0-2020-09-15 2020-09-15 16:18:16 +02:00
Sukru Senli
03dc0ebb72 bbf: 2.0-2020-09-15 2020-09-15 16:11:15 +02:00
Sukru Senli
fa44657557 move trx69 packages out of trx69 folder 2020-09-14 18:28:00 +02:00
nevadita.chatterjee
42a3ed939a map-topology: Config file change 2020-09-14 18:27:00 +02:00
Markus Gothe
6e35356954 Fix gryphon LED module crash.
Update gryphon LED module to work with Linux 4.1
and not to crash when 'gpiod_get_index()' fails.

Change-Id: I27fcbe3ad9dbc755eabdd3f2120544b171b07885
2020-09-14 18:26:58 +02:00
Roman Azarenko
7978a656a7 iop: generate_tarballs: bcmkernel: add symlink if missing, partially fix shellcheck warnings 2020-09-14 18:26:56 +02:00
Sukru Senli
17322c3cba iop: config: select icwmp and bulkdata 2020-09-14 18:26:43 +02:00
Amin Ben Ramdhane
890b627139 icwmp: 5.0-2020-09-10 2020-09-14 18:22:21 +02:00
Amin Ben Ramdhane
0ad28b756b Ticket #2910: Separate BBF packages to their own packages with their own config files 2020-09-14 18:22:21 +02:00
Omar Kallel
309c26f4b0 icwmp: 09-09-2020 2020-09-14 18:22:21 +02:00
Omar Kallel
df4e11ae30 icwmp: Active notification 08/09/2020 2020-09-14 18:22:21 +02:00
Amin Ben Ramdhane
9de4a18a20 bbf: 2.0-2020-09-08 2020-09-14 18:22:21 +02:00
Sukru Senli
bfcc877a6a Revert "bbf: 1.9-2020-09-07"
This reverts commit 24a82ab61c.
2020-09-14 18:22:21 +02:00
Suru Dissanaike
d9527a5a1a icwmp: userid fix release, missing check if value is already present 2020-09-14 11:44:38 +02:00
Jakob Olsson
e707922d29 map-topology: override log func to supress prints 2020-09-14 09:06:53 +02:00
vdutta
cfc2e6d9eb obsupa: Increase ubus timeout to 10s 2020-09-11 16:52:41 +05:30
Jakob Olsson
0ec3e0eae8 map-topology: implement service discovery via dns-sd 2020-09-10 17:09:38 +02:00
Sukru Senli
38c4c7ded0 questd: 5.1.12: MAX_CLIENT increased to 256 2020-09-08 16:29:33 +02:00
Sukru Senli
24a82ab61c bbf: 1.9-2020-09-07 2020-09-08 12:55:20 +02:00
vdutta
5977ec807c uspd: Align with new gitlab ci 2020-09-08 15:47:23 +05:30
100 changed files with 2198 additions and 10789 deletions

View File

@@ -16,4 +16,12 @@ config BBF_TR143
bool "Compile with tr143 diagnostics features"
default y
config BBF_TR157
bool "Compile with tr157 bulkdata collector features"
default y
config BBF_TR064
bool "Compile with tr064 features"
default n
endif

View File

@@ -5,11 +5,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libbbfdm
PKG_VERSION:=3.6.0
PKG_VERSION:=2.6-2020-11-13
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=a528164bad24d3ce8fd2f5bc34f9afd574003be7
PKG_SOURCE_VERSION:=192a2f48b0d066e182e2bbe193a826487c90f11f
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@@ -32,7 +32,7 @@ define Package/libbbfdm
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for broadband-forum data model
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls +libcurl
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls
endef
define Package/libbbfdm/config
@@ -44,7 +44,7 @@ define Package/libbbf_api/description
endef
define Package/libbbfdm/description
Library contains the data model tree. It includes TR181, TR104 and TR143 data models
Library contains the data model tree. It includes TR181, TR104, TR143, TR157 and TR064 data models
endef
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
@@ -74,6 +74,16 @@ CONFIGURE_ARGS += \
--enable-tr143
endif
ifeq ($(CONFIG_BBF_TR157),y)
CONFIGURE_ARGS += \
--enable-tr157
endif
ifeq ($(CONFIG_BBF_TR064),y)
CONFIGURE_ARGS += \
--enable-tr064
endif
ifeq ($(CONFIG_PACKAGE_libopenssl),y)
CONFIGURE_ARGS += \
--enable-libopenssl
@@ -92,23 +102,20 @@ endef
define Package/libbbfdm/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/etc/bbfdm/json
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/bbfdm
$(INSTALL_DIR) $(1)/usr/share/bbfdm
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/bbfdm
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
endef
define Package/libbbfdm/prerm
#!/bin/sh
rm -rf /etc/bbfdm/*
exit 0
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
$(CP) $(PKG_BUILD_DIR)/dmtree/tr181/*.h $(1)/usr/include/libbbfdm/
$(CP) $(PKG_BUILD_DIR)/dmtree/tr157/*.h $(1)/usr/include/libbbfdm/
$(CP) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/

View File

@@ -5,7 +5,7 @@ PROG_OBJS = bulkdata.o common.o config.o http.o log.o report.o times.o buci.o
LIB_OBJS = datamodel.o
PROG_CFLAGS = $(CFLAGS) -Wall -Werror -fPIC
PROG_LDFLAGS = $(LDFLAGS) -lubus -luci -lubox -ljson-c -lcurl -lblobmsg_json -lbbfdm -lbbf_api
PROG_LDFLAGS = $(LDFLAGS) -lubus -luci -lubox -ljson-c -lcurl -lblobmsg_json -lbbfdm
LIB_LDFLAGS = $(LDFLAGS) -lbbf_api
%.o: %.c

View File

@@ -17,7 +17,7 @@ static pathnode *temphead = NULL;
int bulkdata_dm_ctx_init(struct dmctx *ctx)
{
struct bulkdata *bulkdata = &bulkdata_main;
dm_ctx_init(ctx, bulkdata->instance_mode);
dm_ctx_init(ctx, DM_CWMP, bulkdata->amd_version, bulkdata->instance_mode);
return 0;
}

View File

@@ -14,6 +14,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <libbbfdm/deviceinfo.h>
#include "log.h"
#include "config.h"
@@ -76,9 +77,9 @@ int get_device_id_config(struct bulkdata *bulkdata)
struct dmctx dmctx = {0};
bulkdata_dm_ctx_init(&dmctx);
bulkdata->device_id.manufacturer_oui = bulkdata_get_value_param("Device.DeviceInfo.ManufacturerOUI");
bulkdata->device_id.product_class = bulkdata_get_value_param("Device.DeviceInfo.ProductClass");
bulkdata->device_id.serial_number = bulkdata_get_value_param("Device.DeviceInfo.SerialNumber");
bulkdata->device_id.manufacturer_oui = strdup(get_deviceid_manufactureroui());
bulkdata->device_id.product_class = strdup(get_deviceid_productclass());
bulkdata->device_id.serial_number = strdup(get_deviceid_serialnumber());
bulkdata_dm_ctx_clean(&dmctx);
return 0;

View File

@@ -36,8 +36,8 @@ static int browseBulkDataProfileInst(struct dmctx *dmctx, DMNODE *parent_node, v
synchronize_specific_config_sections_with_dmmap("bulkdata", "profile", "dmmap_bulkdata", &dup_list);
list_for_each_entry(p, &dup_list, list) {
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 3,
p->dmmap_section, "profile_instance", "profile_alias");
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 5,
p->dmmap_section, "profile_instance", "profile_alias", "dmmap_bulkdata", "profile");
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p->config_section, inst) == DM_STOP)
break;
@@ -65,8 +65,8 @@ static int browseBulkDataProfileParameterInst(struct dmctx *dmctx, DMNODE *paren
browse_args.option = "profile_id";
browse_args.value = prev_profile_id;
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 5,
p->dmmap_section, "parameter_instance", "parameter_alias",
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 7,
p->dmmap_section, "parameter_instance", "parameter_alias", "dmmap_bulkdata", "profile_parameter",
check_browse_section, (void *)&browse_args);
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p->config_section, inst) == DM_STOP)
@@ -95,8 +95,8 @@ static int browseBulkDataProfileHTTPRequestURIParameterInst(struct dmctx *dmctx,
browse_args.option = "profile_id";
browse_args.value = prev_profile_id;
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 5,
p->dmmap_section, "requesturiparameter_instance", "requesturiparameter_alias",
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 7,
p->dmmap_section, "requesturiparameter_instance", "requesturiparameter_alias", "dmmap_bulkdata", "profile_http_request_uri_parameter",
check_browse_section, (void *)&browse_args);
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p->config_section, inst) == DM_STOP)
@@ -112,12 +112,13 @@ static int browseBulkDataProfileHTTPRequestURIParameterInst(struct dmctx *dmctx,
static int addObjBulkDataProfile(char *refparam, struct dmctx *ctx, void *data, char **instance)
{
struct uci_section *profile, *dmmap_bulkdata;
char prof_id[16], *last_inst = NULL;
char prof_id[16], *last_inst = NULL, *value, *v;
check_create_dmmap_package("dmmap_bulkdata");
last_inst = get_last_instance_bbfdm("dmmap_bulkdata", "profile", "profile_instance");
snprintf(prof_id, sizeof(prof_id), "%d", last_inst ? atoi(last_inst)+1 : 1);
dmuci_add_section("bulkdata", "profile", &profile);
dmuci_add_section_and_rename("bulkdata", "profile", &profile, &value);
dmuci_set_value_by_section(profile, "profile_id", prof_id);
dmuci_set_value_by_section(profile, "enable", "0");
dmuci_set_value_by_section(profile, "nbre_of_retained_failed_reports", "0");
@@ -138,9 +139,9 @@ static int addObjBulkDataProfile(char *refparam, struct dmctx *ctx, void *data,
dmuci_set_value_by_section(profile, "http_retry_minimum_wait_interval", "5");
dmuci_set_value_by_section(profile, "http_persist_across_reboot", "0");
dmuci_add_section_bbfdm("dmmap_bulkdata", "profile", &dmmap_bulkdata);
dmuci_add_section_bbfdm("dmmap_bulkdata", "profile", &dmmap_bulkdata, &v);
dmuci_set_value_by_section(dmmap_bulkdata, "section_name", section_name(profile));
*instance = update_instance(last_inst, 2, dmmap_bulkdata, "profile_instance");
*instance = update_instance(last_inst, 4, dmmap_bulkdata, "profile_instance", "dmmap_bulkdata", "profile");
return 0;
}
@@ -220,24 +221,24 @@ static int delObjBulkDataProfile(char *refparam, struct dmctx *ctx, void *data,
static int addObjBulkDataProfileParameter(char *refparam, struct dmctx *ctx, void *data, char **instance)
{
struct uci_section *profile_parameter, *dmmap_bulkdata;
char *last_inst, *prev_profile_id;
char *value, *last_inst, *prev_profile_id, *v;
struct browse_args browse_args = {0};
dmuci_get_value_by_section_string((struct uci_section *)data, "profile_id", &prev_profile_id);
last_inst = get_last_instance_lev2_bbfdm_dmmap_opt("dmmap_bulkdata", "profile_parameter", "parameter_instance", "profile_id", prev_profile_id);
dmuci_add_section("bulkdata", "profile_parameter", &profile_parameter);
dmuci_add_section_and_rename("bulkdata", "profile_parameter", &profile_parameter, &value);
dmuci_set_value_by_section(profile_parameter, "profile_id", prev_profile_id);
browse_args.option = "profile_id";
browse_args.value = prev_profile_id;
dmuci_add_section_bbfdm("dmmap_bulkdata", "profile_parameter", &dmmap_bulkdata);
dmuci_add_section_bbfdm("dmmap_bulkdata", "profile_parameter", &dmmap_bulkdata, &v);
dmuci_set_value_by_section(dmmap_bulkdata, "section_name", section_name(profile_parameter));
dmuci_set_value_by_section(dmmap_bulkdata, "profile_id", prev_profile_id);
*instance = update_instance(last_inst, 5, dmmap_bulkdata, "parameter_instance", NULL, check_browse_section, (void *)&browse_args);
*instance = update_instance(last_inst, 6, dmmap_bulkdata, "parameter_instance", "dmmap_bulkdata", "profile_parameter", check_browse_section, (void *)&browse_args);
return 0;
}
@@ -274,24 +275,24 @@ static int delObjBulkDataProfileParameter(char *refparam, struct dmctx *ctx, voi
static int addObjBulkDataProfileHTTPRequestURIParameter(char *refparam, struct dmctx *ctx, void *data, char **instance)
{
struct uci_section *profile_http_request_uri_parameter, *dmmap_bulkdata;
char *last_inst, *prev_profile_id;
char *value, *last_inst, *prev_profile_id, *v;
struct browse_args browse_args = {0};
dmuci_get_value_by_section_string((struct uci_section *)data, "profile_id", &prev_profile_id);
last_inst = get_last_instance_lev2_bbfdm_dmmap_opt("dmmap_bulkdata", "profile_http_request_uri_parameter", "requesturiparameter_instance", "profile_id", prev_profile_id);
dmuci_add_section("bulkdata", "profile_http_request_uri_parameter", &profile_http_request_uri_parameter);
dmuci_add_section_and_rename("bulkdata", "profile_http_request_uri_parameter", &profile_http_request_uri_parameter, &value);
dmuci_set_value_by_section(profile_http_request_uri_parameter, "profile_id", prev_profile_id);
browse_args.option = "profile_id";
browse_args.value = prev_profile_id;
dmuci_add_section_bbfdm("dmmap_bulkdata", "profile_http_request_uri_parameter", &dmmap_bulkdata);
dmuci_add_section_bbfdm("dmmap_bulkdata", "profile_http_request_uri_parameter", &dmmap_bulkdata, &v);
dmuci_set_value_by_section(dmmap_bulkdata, "section_name", section_name(profile_http_request_uri_parameter));
dmuci_set_value_by_section(dmmap_bulkdata, "profile_id", prev_profile_id);
*instance = update_instance(last_inst, 5, dmmap_bulkdata, "requesturiparameter_instance", NULL, check_browse_section, (void *)&browse_args);
*instance = update_instance(last_inst, 6, dmmap_bulkdata, "requesturiparameter_instance", "dmmap_bulkdata", "profile_http_request_uri_parameter", check_browse_section, (void *)&browse_args);
return 0;
}
@@ -331,7 +332,7 @@ static int delObjBulkDataProfileHTTPRequestURIParameter(char *refparam, struct d
/*#Device.BulkData.Enable!UCI:bulkdata/bulkdata,bulkdata/enable*/
static int get_BulkData_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("bulkdata", "bulkdata", "enable", "1");
dmuci_get_option_value_string("bulkdata", "bulkdata", "enable", value);
return 0;
}
@@ -415,7 +416,7 @@ static int get_BulkData_ProfileNumberOfEntries(char *refparam, struct dmctx *ctx
/*#Device.BulkData.Profile.{i}.Enable!UCI:bulkdata/profile,@i-1/enable*/
static int get_BulkDataProfile_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "enable", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value);
return 0;
}
@@ -562,7 +563,7 @@ static int set_BulkDataProfile_EncodingType(char *refparam, struct dmctx *ctx, v
/*#Device.BulkData.Profile.{i}.ReportingInterval!UCI:bulkdata/profile,@i-1/reporting_interval*/
static int get_BulkDataProfile_ReportingInterval(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "reporting_interval", "86400");
dmuci_get_value_by_section_string((struct uci_section *)data, "reporting_interval", value);
return 0;
}
@@ -1000,7 +1001,7 @@ static int set_BulkDataProfileHTTP_Method(char *refparam, struct dmctx *ctx, voi
/*#Device.BulkData.Profile.{i}.HTTP.UseDateHeader!UCI:bulkdata/profile,@i-1/http_use_date_header*/
static int get_BulkDataProfileHTTP_UseDateHeader(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "http_use_date_header", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "http_use_date_header", value);
return 0;
}
@@ -1024,7 +1025,7 @@ static int set_BulkDataProfileHTTP_UseDateHeader(char *refparam, struct dmctx *c
/*#Device.BulkData.Profile.{i}.HTTP.RetryEnable!UCI:bulkdata/profile,@i-1/http_retry_enable*/
static int get_BulkDataProfileHTTP_RetryEnable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "http_retry_enable", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "http_retry_enable", value);
return 0;
}
@@ -1048,7 +1049,7 @@ static int set_BulkDataProfileHTTP_RetryEnable(char *refparam, struct dmctx *ctx
/*#Device.BulkData.Profile.{i}.HTTP.RetryMinimumWaitInterval!UCI:bulkdata/profile,@i-1/http_retry_minimum_wait_interval*/
static int get_BulkDataProfileHTTP_RetryMinimumWaitInterval(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "http_retry_minimum_wait_interval", "5");
dmuci_get_value_by_section_string((struct uci_section *)data, "http_retry_minimum_wait_interval", value);
return 0;
}
@@ -1069,7 +1070,7 @@ static int set_BulkDataProfileHTTP_RetryMinimumWaitInterval(char *refparam, stru
/*#Device.BulkData.Profile.{i}.HTTP.RetryIntervalMultiplier!UCI:bulkdata/profile,@i-1/http_retry_interval_multiplier*/
static int get_BulkDataProfileHTTP_RetryIntervalMultiplier(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "http_retry_interval_multiplier", "2000");
dmuci_get_value_by_section_string((struct uci_section *)data, "http_retry_interval_multiplier", value);
return 0;
}
@@ -1108,7 +1109,7 @@ static int get_BulkDataProfileHTTP_RequestURIParameterNumberOfEntries(char *refp
/*#Device.BulkData.Profile.{i}.HTTP.PersistAcrossReboot!UCI:bulkdata/profile,@i-1/http_persist_across_reboot*/
static int get_BulkDataProfileHTTP_PersistAcrossReboot(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "http_persist_across_reboot", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "http_persist_across_reboot", value);
return 0;
}
@@ -1173,120 +1174,120 @@ static int set_BulkDataProfileHTTPRequestURIParameter_Reference(char *refparam,
/* *** Device.BulkData. *** */
DMOBJ tDeviceBulkDataObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"BulkData", &DMREAD, NULL, NULL, NULL, NULL, NULL, tBulkDataObj, tBulkDataParams, NULL, BBFDM_BOTH},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"BulkData", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tBulkDataObj, tBulkDataParams, NULL, BBFDM_BOTH},
{0}
};
DMOBJ tBulkDataObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"Profile", &DMWRITE, addObjBulkDataProfile, delObjBulkDataProfile, NULL, browseBulkDataProfileInst, NULL, tBulkDataProfileObj, tBulkDataProfileParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", NULL}},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"Profile", &DMWRITE, addObjBulkDataProfile, delObjBulkDataProfile, NULL, browseBulkDataProfileInst, NULL, NULL, NULL, tBulkDataProfileObj, tBulkDataProfileParams, NULL, BBFDM_BOTH},
{0}
};
DMLEAF tBulkDataParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_BulkData_Enable, set_BulkData_Enable, BBFDM_BOTH},
{"Status", &DMREAD, DMT_STRING, get_BulkData_Status, NULL, BBFDM_BOTH},
{"MinReportingInterval", &DMREAD, DMT_UNINT, get_BulkData_MinReportingInterval, NULL, BBFDM_BOTH},
{"Protocols", &DMREAD, DMT_STRING, get_BulkData_Protocols, NULL, BBFDM_BOTH},
{"EncodingTypes", &DMREAD, DMT_STRING, get_BulkData_EncodingTypes, NULL, BBFDM_BOTH},
{"ParameterWildCardSupported", &DMREAD, DMT_BOOL, get_BulkData_ParameterWildCardSupported, NULL, BBFDM_BOTH},
{"MaxNumberOfProfiles", &DMREAD, DMT_INT, get_BulkData_MaxNumberOfProfiles, NULL, BBFDM_BOTH},
{"MaxNumberOfParameterReferences", &DMREAD, DMT_INT, get_BulkData_MaxNumberOfParameterReferences, NULL, BBFDM_BOTH},
{"ProfileNumberOfEntries", &DMREAD, DMT_UNINT, get_BulkData_ProfileNumberOfEntries, NULL, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_BulkData_Enable, set_BulkData_Enable, NULL, NULL, BBFDM_BOTH},
{"Status", &DMREAD, DMT_STRING, get_BulkData_Status, NULL, NULL, NULL, BBFDM_BOTH},
{"MinReportingInterval", &DMREAD, DMT_UNINT, get_BulkData_MinReportingInterval, NULL, NULL, NULL, BBFDM_BOTH},
{"Protocols", &DMREAD, DMT_STRING, get_BulkData_Protocols, NULL, NULL, NULL, BBFDM_BOTH},
{"EncodingTypes", &DMREAD, DMT_STRING, get_BulkData_EncodingTypes, NULL, NULL, NULL, BBFDM_BOTH},
{"ParameterWildCardSupported", &DMREAD, DMT_BOOL, get_BulkData_ParameterWildCardSupported, NULL, NULL, NULL, BBFDM_BOTH},
{"MaxNumberOfProfiles", &DMREAD, DMT_INT, get_BulkData_MaxNumberOfProfiles, NULL, NULL, NULL, BBFDM_BOTH},
{"MaxNumberOfParameterReferences", &DMREAD, DMT_INT, get_BulkData_MaxNumberOfParameterReferences, NULL, NULL, NULL, BBFDM_BOTH},
{"ProfileNumberOfEntries", &DMREAD, DMT_UNINT, get_BulkData_ProfileNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.BulkData.Profile.{i}. *** */
DMOBJ tBulkDataProfileObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"Parameter", &DMWRITE, addObjBulkDataProfileParameter, delObjBulkDataProfileParameter, NULL, browseBulkDataProfileParameterInst, NULL, NULL, tBulkDataProfileParameterParams, NULL, BBFDM_BOTH},
{"CSVEncoding", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tBulkDataProfileCSVEncodingParams, NULL, BBFDM_BOTH},
{"JSONEncoding", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tBulkDataProfileJSONEncodingParams, NULL, BBFDM_BOTH},
{"HTTP", &DMREAD, NULL, NULL, NULL, NULL, NULL, tBulkDataProfileHTTPObj, tBulkDataProfileHTTPParams, NULL, BBFDM_BOTH},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"Parameter", &DMWRITE, addObjBulkDataProfileParameter, delObjBulkDataProfileParameter, NULL, browseBulkDataProfileParameterInst, NULL, NULL, NULL, NULL, tBulkDataProfileParameterParams, NULL, BBFDM_BOTH},
{"CSVEncoding", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tBulkDataProfileCSVEncodingParams, NULL, BBFDM_BOTH},
{"JSONEncoding", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tBulkDataProfileJSONEncodingParams, NULL, BBFDM_BOTH},
{"HTTP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tBulkDataProfileHTTPObj, tBulkDataProfileHTTPParams, NULL, BBFDM_BOTH},
{0}
};
DMLEAF tBulkDataProfileParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_BulkDataProfile_Enable, set_BulkDataProfile_Enable, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_BulkDataProfile_Alias, set_BulkDataProfile_Alias, BBFDM_BOTH},
{"Name", &DMWRITE, DMT_STRING, get_BulkDataProfile_Name, set_BulkDataProfile_Name, BBFDM_BOTH},
{"NumberOfRetainedFailedReports", &DMWRITE, DMT_INT, get_BulkDataProfile_NumberOfRetainedFailedReports, set_BulkDataProfile_NumberOfRetainedFailedReports, BBFDM_BOTH},
{"Protocol", &DMWRITE, DMT_STRING, get_BulkDataProfile_Protocol, set_BulkDataProfile_Protocol, BBFDM_BOTH},
{"EncodingType", &DMWRITE, DMT_STRING, get_BulkDataProfile_EncodingType, set_BulkDataProfile_EncodingType, BBFDM_BOTH},
{"ReportingInterval", &DMWRITE, DMT_UNINT, get_BulkDataProfile_ReportingInterval, set_BulkDataProfile_ReportingInterval, BBFDM_BOTH},
{"TimeReference", &DMWRITE, DMT_TIME, get_BulkDataProfile_TimeReference, set_BulkDataProfile_TimeReference, BBFDM_BOTH},
{"ParameterNumberOfEntries", &DMREAD, DMT_UNINT, get_BulkDataProfile_ParameterNumberOfEntries, NULL, BBFDM_BOTH},
//{"StreamingHost", &DMWRITE, DMT_STRING, get_BulkDataProfile_StreamingHost, set_BulkDataProfile_StreamingHost, BBFDM_BOTH},
//{"StreamingPort", &DMWRITE, DMT_UNINT, get_BulkDataProfile_StreamingPort, set_BulkDataProfile_StreamingPort, BBFDM_BOTH},
//{"StreamingSessionID", &DMWRITE, DMT_UNINT, get_BulkDataProfile_StreamingSessionID, set_BulkDataProfile_StreamingSessionID, BBFDM_BOTH},
//{"FileTransferURL", &DMWRITE, DMT_STRING, get_BulkDataProfile_FileTransferURL, set_BulkDataProfile_FileTransferURL, BBFDM_BOTH},
//{"FileTransferUsername", &DMWRITE, DMT_STRING, get_BulkDataProfile_FileTransferUsername, set_BulkDataProfile_FileTransferUsername, BBFDM_BOTH},
//{"FileTransferPassword", &DMWRITE, DMT_STRING, get_BulkDataProfile_FileTransferPassword, set_BulkDataProfile_FileTransferPassword, BBFDM_BOTH},
//{"ControlFileFormat", &DMWRITE, DMT_STRING, get_BulkDataProfile_ControlFileFormat, set_BulkDataProfile_ControlFileFormat, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_BulkDataProfile_Enable, set_BulkDataProfile_Enable, NULL, NULL, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_BulkDataProfile_Alias, set_BulkDataProfile_Alias, NULL, NULL, BBFDM_BOTH},
{"Name", &DMWRITE, DMT_STRING, get_BulkDataProfile_Name, set_BulkDataProfile_Name, NULL, NULL, BBFDM_BOTH},
{"NumberOfRetainedFailedReports", &DMWRITE, DMT_INT, get_BulkDataProfile_NumberOfRetainedFailedReports, set_BulkDataProfile_NumberOfRetainedFailedReports, NULL, NULL, BBFDM_BOTH},
{"Protocol", &DMWRITE, DMT_STRING, get_BulkDataProfile_Protocol, set_BulkDataProfile_Protocol, NULL, NULL, BBFDM_BOTH},
{"EncodingType", &DMWRITE, DMT_STRING, get_BulkDataProfile_EncodingType, set_BulkDataProfile_EncodingType, NULL, NULL, BBFDM_BOTH},
{"ReportingInterval", &DMWRITE, DMT_UNINT, get_BulkDataProfile_ReportingInterval, set_BulkDataProfile_ReportingInterval, NULL, NULL, BBFDM_BOTH},
{"TimeReference", &DMWRITE, DMT_TIME, get_BulkDataProfile_TimeReference, set_BulkDataProfile_TimeReference, NULL, NULL, BBFDM_BOTH},
{"ParameterNumberOfEntries", &DMREAD, DMT_UNINT, get_BulkDataProfile_ParameterNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH},
//{"StreamingHost", &DMWRITE, DMT_STRING, get_BulkDataProfile_StreamingHost, set_BulkDataProfile_StreamingHost, NULL, NULL, BBFDM_BOTH},
//{"StreamingPort", &DMWRITE, DMT_UNINT, get_BulkDataProfile_StreamingPort, set_BulkDataProfile_StreamingPort, NULL, NULL, BBFDM_BOTH},
//{"StreamingSessionID", &DMWRITE, DMT_UNINT, get_BulkDataProfile_StreamingSessionID, set_BulkDataProfile_StreamingSessionID, NULL, NULL, BBFDM_BOTH},
//{"FileTransferURL", &DMWRITE, DMT_STRING, get_BulkDataProfile_FileTransferURL, set_BulkDataProfile_FileTransferURL, NULL, NULL, BBFDM_BOTH},
//{"FileTransferUsername", &DMWRITE, DMT_STRING, get_BulkDataProfile_FileTransferUsername, set_BulkDataProfile_FileTransferUsername, NULL, NULL, BBFDM_BOTH},
//{"FileTransferPassword", &DMWRITE, DMT_STRING, get_BulkDataProfile_FileTransferPassword, set_BulkDataProfile_FileTransferPassword, NULL, NULL, BBFDM_BOTH},
//{"ControlFileFormat", &DMWRITE, DMT_STRING, get_BulkDataProfile_ControlFileFormat, set_BulkDataProfile_ControlFileFormat, NULL, NULL, BBFDM_BOTH},
//{"Controller", &DMREAD, DMT_STRING, get_BulkDataProfile_Controller, NULL, NULL, NULL, BBFDM_USP},
{0}
};
/* *** Device.BulkData.Profile.{i}.Parameter.{i}. *** */
DMLEAF tBulkDataProfileParameterParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Name", &DMWRITE, DMT_STRING, get_BulkDataProfileParameter_Name, set_BulkDataProfileParameter_Name, BBFDM_BOTH},
{"Reference", &DMWRITE, DMT_STRING, get_BulkDataProfileParameter_Reference, set_BulkDataProfileParameter_Reference, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Name", &DMWRITE, DMT_STRING, get_BulkDataProfileParameter_Name, set_BulkDataProfileParameter_Name, NULL, NULL, BBFDM_BOTH},
{"Reference", &DMWRITE, DMT_STRING, get_BulkDataProfileParameter_Reference, set_BulkDataProfileParameter_Reference, NULL, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.BulkData.Profile.{i}.CSVEncoding. *** */
DMLEAF tBulkDataProfileCSVEncodingParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"FieldSeparator", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_FieldSeparator, set_BulkDataProfileCSVEncoding_FieldSeparator, BBFDM_BOTH},
{"RowSeparator", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_RowSeparator, set_BulkDataProfileCSVEncoding_RowSeparator, BBFDM_BOTH},
{"EscapeCharacter", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_EscapeCharacter, set_BulkDataProfileCSVEncoding_EscapeCharacter, BBFDM_BOTH},
{"ReportFormat", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_ReportFormat, set_BulkDataProfileCSVEncoding_ReportFormat, BBFDM_BOTH},
{"RowTimestamp", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_RowTimestamp, set_BulkDataProfileCSVEncoding_RowTimestamp, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"FieldSeparator", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_FieldSeparator, set_BulkDataProfileCSVEncoding_FieldSeparator, NULL, NULL, BBFDM_BOTH},
{"RowSeparator", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_RowSeparator, set_BulkDataProfileCSVEncoding_RowSeparator, NULL, NULL, BBFDM_BOTH},
{"EscapeCharacter", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_EscapeCharacter, set_BulkDataProfileCSVEncoding_EscapeCharacter, NULL, NULL, BBFDM_BOTH},
{"ReportFormat", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_ReportFormat, set_BulkDataProfileCSVEncoding_ReportFormat, NULL, NULL, BBFDM_BOTH},
{"RowTimestamp", &DMWRITE, DMT_STRING, get_BulkDataProfileCSVEncoding_RowTimestamp, set_BulkDataProfileCSVEncoding_RowTimestamp, NULL, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.BulkData.Profile.{i}.JSONEncoding. *** */
DMLEAF tBulkDataProfileJSONEncodingParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"ReportFormat", &DMWRITE, DMT_STRING, get_BulkDataProfileJSONEncoding_ReportFormat, set_BulkDataProfileJSONEncoding_ReportFormat, BBFDM_BOTH},
{"ReportTimestamp", &DMWRITE, DMT_STRING, get_BulkDataProfileJSONEncoding_ReportTimestamp, set_BulkDataProfileJSONEncoding_ReportTimestamp, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"ReportFormat", &DMWRITE, DMT_STRING, get_BulkDataProfileJSONEncoding_ReportFormat, set_BulkDataProfileJSONEncoding_ReportFormat, NULL, NULL, BBFDM_BOTH},
{"ReportTimestamp", &DMWRITE, DMT_STRING, get_BulkDataProfileJSONEncoding_ReportTimestamp, set_BulkDataProfileJSONEncoding_ReportTimestamp, NULL, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.BulkData.Profile.{i}.HTTP. *** */
DMOBJ tBulkDataProfileHTTPObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"RequestURIParameter", &DMWRITE, addObjBulkDataProfileHTTPRequestURIParameter, delObjBulkDataProfileHTTPRequestURIParameter, NULL, browseBulkDataProfileHTTPRequestURIParameterInst, NULL, NULL, tBulkDataProfileHTTPRequestURIParameterParams, NULL, BBFDM_BOTH},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"RequestURIParameter", &DMWRITE, addObjBulkDataProfileHTTPRequestURIParameter, delObjBulkDataProfileHTTPRequestURIParameter, NULL, browseBulkDataProfileHTTPRequestURIParameterInst, NULL, NULL, NULL, NULL, tBulkDataProfileHTTPRequestURIParameterParams, NULL, BBFDM_BOTH},
{0}
};
DMLEAF tBulkDataProfileHTTPParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"URL", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_URL, set_BulkDataProfileHTTP_URL, BBFDM_BOTH},
{"Username", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Username, set_BulkDataProfileHTTP_Username, BBFDM_BOTH},
{"Password", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Password, set_BulkDataProfileHTTP_Password, BBFDM_BOTH},
{"CompressionsSupported", &DMREAD, DMT_STRING, get_BulkDataProfileHTTP_CompressionsSupported, NULL, BBFDM_BOTH},
{"Compression", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Compression, set_BulkDataProfileHTTP_Compression, BBFDM_BOTH},
{"MethodsSupported", &DMREAD, DMT_STRING, get_BulkDataProfileHTTP_MethodsSupported, NULL, BBFDM_BOTH},
{"Method", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Method, set_BulkDataProfileHTTP_Method, BBFDM_BOTH},
{"UseDateHeader", &DMWRITE, DMT_BOOL, get_BulkDataProfileHTTP_UseDateHeader, set_BulkDataProfileHTTP_UseDateHeader, BBFDM_BOTH},
{"RetryEnable", &DMWRITE, DMT_BOOL, get_BulkDataProfileHTTP_RetryEnable, set_BulkDataProfileHTTP_RetryEnable, BBFDM_BOTH},
{"RetryMinimumWaitInterval", &DMWRITE, DMT_UNINT, get_BulkDataProfileHTTP_RetryMinimumWaitInterval, set_BulkDataProfileHTTP_RetryMinimumWaitInterval, BBFDM_BOTH},
{"RetryIntervalMultiplier", &DMWRITE, DMT_UNINT, get_BulkDataProfileHTTP_RetryIntervalMultiplier, set_BulkDataProfileHTTP_RetryIntervalMultiplier, BBFDM_BOTH},
{"RequestURIParameterNumberOfEntries", &DMREAD, DMT_UNINT, get_BulkDataProfileHTTP_RequestURIParameterNumberOfEntries, NULL, BBFDM_BOTH},
{"PersistAcrossReboot", &DMWRITE, DMT_BOOL, get_BulkDataProfileHTTP_PersistAcrossReboot, set_BulkDataProfileHTTP_PersistAcrossReboot, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"URL", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_URL, set_BulkDataProfileHTTP_URL, NULL, NULL, BBFDM_BOTH},
{"Username", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Username, set_BulkDataProfileHTTP_Username, NULL, NULL, BBFDM_BOTH},
{"Password", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Password, set_BulkDataProfileHTTP_Password, NULL, NULL, BBFDM_BOTH},
{"CompressionsSupported", &DMREAD, DMT_STRING, get_BulkDataProfileHTTP_CompressionsSupported, NULL, NULL, NULL, BBFDM_BOTH},
{"Compression", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Compression, set_BulkDataProfileHTTP_Compression, NULL, NULL, BBFDM_BOTH},
{"MethodsSupported", &DMREAD, DMT_STRING, get_BulkDataProfileHTTP_MethodsSupported, NULL, NULL, NULL, BBFDM_BOTH},
{"Method", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTP_Method, set_BulkDataProfileHTTP_Method, NULL, NULL, BBFDM_BOTH},
{"UseDateHeader", &DMWRITE, DMT_BOOL, get_BulkDataProfileHTTP_UseDateHeader, set_BulkDataProfileHTTP_UseDateHeader, NULL, NULL, BBFDM_BOTH},
{"RetryEnable", &DMWRITE, DMT_BOOL, get_BulkDataProfileHTTP_RetryEnable, set_BulkDataProfileHTTP_RetryEnable, NULL, NULL, BBFDM_BOTH},
{"RetryMinimumWaitInterval", &DMWRITE, DMT_UNINT, get_BulkDataProfileHTTP_RetryMinimumWaitInterval, set_BulkDataProfileHTTP_RetryMinimumWaitInterval, NULL, NULL, BBFDM_BOTH},
{"RetryIntervalMultiplier", &DMWRITE, DMT_UNINT, get_BulkDataProfileHTTP_RetryIntervalMultiplier, set_BulkDataProfileHTTP_RetryIntervalMultiplier, NULL, NULL, BBFDM_BOTH},
{"RequestURIParameterNumberOfEntries", &DMREAD, DMT_UNINT, get_BulkDataProfileHTTP_RequestURIParameterNumberOfEntries, NULL, NULL, NULL, BBFDM_BOTH},
{"PersistAcrossReboot", &DMWRITE, DMT_BOOL, get_BulkDataProfileHTTP_PersistAcrossReboot, set_BulkDataProfileHTTP_PersistAcrossReboot, NULL, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.BulkData.Profile.{i}.HTTP.RequestURIParameter.{i}. *** */
DMLEAF tBulkDataProfileHTTPRequestURIParameterParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Name", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTPRequestURIParameter_Name, set_BulkDataProfileHTTPRequestURIParameter_Name, BBFDM_BOTH},
{"Reference", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTPRequestURIParameter_Reference, set_BulkDataProfileHTTPRequestURIParameter_Reference, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Name", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTPRequestURIParameter_Name, set_BulkDataProfileHTTPRequestURIParameter_Name, NULL, NULL, BBFDM_BOTH},
{"Reference", &DMWRITE, DMT_STRING, get_BulkDataProfileHTTPRequestURIParameter_Reference, set_BulkDataProfileHTTPRequestURIParameter_Reference, NULL, NULL, BBFDM_BOTH},
{0}
};

View File

@@ -48,7 +48,7 @@ static size_t http_get_response(void *buffer, size_t size, size_t rxed, char **m
{
char *c;
if (asprintf(&c, "%s%.*s", *msg_in, (int) (size * rxed), (char *)buffer) == -1) {
if (asprintf(&c, "%s%.*s", *msg_in, size * rxed, (char *)buffer) == -1) {
FREE(*msg_in);
return -1;
}

View File

@@ -53,7 +53,7 @@ static void create_json_bulkdata_report_object_hierarchy(struct profile *profile
strcpy(buf, param_name);
for (pch = strtok_r(buf, ".", &pchr); pch != NULL; pch = strtok_r(NULL, ".", &pchr)) {
argv[j] = pch;
json_obj1 = (json_object *)bbf_api_dmjson_select_obj(json_obj, argv);
json_obj1 = (json_object *)dmjson_select_obj(json_obj, argv);
if (json_obj1)
json_obj2 = json_obj1;
else {

View File

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

53
cifsd-tools/Makefile Normal file
View File

@@ -0,0 +1,53 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=cifsd-tools
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/namjaejeon/cifsd-tools.git
PKG_SOURCE_DATE:=2019-02-14
PKG_SOURCE_VERSION:=a7d7dfc40524b88dbcb2052034a75f446b3cefdd
PKG_MIRROR_HASH:=a74f95a79c3cdcc78e66c080729141abee0d821e21a326d88b11d849738314fb
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/cifsd-tools
SECTION:=net
CATEGORY:=Network
SUBMENU:=Filesystem
TITLE:=Kernel CIFS/SMB server support and userspace tools
DEPENDS:=+kmod-fs-cifsd +glib2 +libnl-core +libnl-genl $(ICONV_DEPENDS)
endef
define Package/cifsd-tools/description
Userspace tools (cifsd, cifsadmin) for the CIFS/SMB kernel fileserver.
The config file location is /etc/cifs/smb.conf
endef
define Package/cifsd-tools/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcifsdtools.so* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/etc/cifs
$(INSTALL_CONF) $(PKG_BUILD_DIR)/smb.conf.example $(1)/etc/cifs
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/cifsd.config $(1)/etc/config/cifsd
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/cifsd.init $(1)/etc/init.d/cifsd
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{cifsadmin,cifsd} $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,cifsd-tools))

View File

@@ -0,0 +1,9 @@
config global 'global'
option server_string 'CIFSD on OpenWRT'
option ipc_timeout '8' # IPC timeout is used as a workaround for uninterruptible sleep until this is fixed upstream.
config share
option name 'share'
option comment 'Default guest share'
option path '/mnt'
option guest_ok 'yes'

View File

@@ -0,0 +1,161 @@
#!/bin/sh /etc/rc.common
START=90
USE_PROCD=1
PROG=/usr/sbin/cifsd
USER_DB=/etc/cifs/cifsdpwd.db
CIFS_ADMIN=cifsadmin
EXTRA_COMMANDS="users"
EXTRA_HELP=" users Show list of users created by cifsadmin"
users() {
[ -f "$USER_DB" ] && cut -d ':' $USER_DB -f1 || \
printf "No users available.\n"
}
validate_cifsd_global() {
uci_validate_section cifsd global global \
'server_string:string' \
'workgroup:string' \
'netbios_name:string' \
'interface:string' \
'ipc_timeout:uinteger'
}
validate_cifsd_share() {
uci_validate_section cifsd share "${1}" \
'name:string' \
'comment:string' \
'path:string' \
'guest_ok:bool' \
'read_only:bool' \
'allow_hosts:list' \
'deny_hosts:list' \
'users:string' \
'invalid_users:string' \
'create_mask:string' \
'dir_mask:string' \
'max_connections:uinteger' \
'veto_files:list'
}
validate_cifsd_users() {
uci_validate_section cifsd users "${1}" \
'user:string' \
'password:string' \
'desc:string'
}
load_cifsd_global() {
local server_string
local workgroup
local netbios_name
local ipc_timeout
validate_cifsd_global
echo -e "[global]" >> /var/etc/cifsd.conf
[ -n "$server_string" ] && echo -e "\tserver string = $server_string" >> /var/etc/cifsd.conf
[ -n "$workgroup" ] && echo -e "\tworkgroup = $workgroup" >> /var/etc/cifsd.conf
[ -n "$netbios_name" ] && echo -e "\tnetbios name = $netbios_name" >> /var/etc/cifsd.conf
[ -n "$ipc_timeout" ] && echo -e "\tipc timeout name = $ipc_timeout" >> /var/etc/cifsd.conf || \
echo -e "\tipc timeout name = 8" >> /var/etc/cifsd.conf
}
load_cifsd_share() {
local name
local comment
local path
local guest_ok
local allow_hosts
local deny_hosts
local users
local invalid_users
local max_connections
local veto_files
local dir_mask
local create_mask
local read_only
validate_cifsd_share ${1}
if [ -z "$name" -o -z "$path" ]; then
logread -t ${0} "Missing name or path."
return
fi
echo -e "\n[$name]\n\tpath = $path" >> /var/etc/cifsd.conf
[ -n "$comment" ] && echo -e "\tcomment = $comment" >> /var/etc/cifsd.conf
[ -n "$guest_ok" ] && echo -e "\tguest ok = $guest_ok" >> /var/etc/cifsd.conf
[ -n "$allow_hosts" ] && echo -e "\tallow hosts = $allow_hosts" >> /var/etc/cifsd.conf
[ -n "$deny_hosts" ] && echo -e "\tdeny hosts = $deny_hosts" >> /var/etc/cifsd.conf
[ -n "$users" ] && echo -e "\tvalid users = $users" >> /var/etc/cifsd.conf
[ -n "$invalid_users" ] && echo -e "\tinvalid users = $invalid_users" >> /var/etc/cifsd.conf
[ -n "$max_connections" ] && echo -e "\tmax connections = $max_connections" >> /var/etc/cifsd.conf
[ -n "$create_mask" ] && echo -e "\tcreate mask = $create_mask" >> /var/etc/cifsd.conf
[ -n "$dir_mask" ] && echo -e "\tdirectory mask = $dir_mask" >> /var/etc/cifsd.conf
if [ -n "$read_only" ]; then
echo -e "\tread only = $read_only" >> /var/etc/cifsd.conf
if [ "${read_only}" -eq "0" ]; then
echo -e "\twrite ok = 1" >> /var/etc/cifsd.conf
fi
else
echo -e "\twrite ok = 1" >> /var/etc/cifsd.conf
fi
[ -n "$veto_files" ] && echo -e "\tveto files = $veto_files" >> /var/etc/cifsd.conf
}
load_cifsd_users() {
local user
local password
local desc
validate_cifsd_users ${1}
[ $(which ${CIFS_ADMIN}) ] || {
logread -t ${0} "${CIFS_ADMIN} tools is not available"
return;
}
cifsadmin -a "${user}" -p "${password}"
if [ "$?" -ne 0 ]; then
logread -t ${0} "Failed to create/update ${user}"
fi
}
service_triggers()
{
procd_add_config_trigger "config.change" "cifsd" /etc/init.d/cifsd restart
}
init_config() {
[ -f "/var/etc/cifsd.conf" ] && rm /var/etc/cifsd.conf
config_load cifsd
load_cifsd_global
# Delete existing users
[ -f "${USER_DB}" ] && {
rm -f "${USER_DB}"
}
config_foreach load_cifsd_users users
config_foreach load_cifsd_share share
}
start_service() {
. /lib/functions.sh
init_config
[ ! "$(grep cifsd /proc/modules)" ] && modprobe cifsd
procd_open_instance
procd_set_param command /usr/bin/env LANG=en_US.UTF-8 $PROG -c /var/etc/cifsd.conf
procd_set_param respawn
procd_close_instance
}
stop_service() {
killall cifsd
# IPC timeout will kill the remaining processes.
}

View File

@@ -0,0 +1,73 @@
For some reason, fs.h on Inteno kernel is missing inode->i_mutex nesting subclasses for the lock validator
which is triggering implicit declaration error. To workaround this hardcore use of mutex_lock by removing
kernel version check.
---
--- a/vfs.c
+++ b/vfs.c
@@ -544,15 +544,9 @@ int cifsd_vfs_setattr(struct cifsd_work
attrs->ia_valid |= ATTR_CTIME;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(inode);
- err = notify_change(dentry, attrs, NULL);
- inode_unlock(inode);
-#else
mutex_lock(&inode->i_mutex);
err = notify_change(dentry, attrs, NULL);
mutex_unlock(&inode->i_mutex);
-#endif
if (update_size)
put_write_access(inode);
@@ -753,11 +747,8 @@ int cifsd_vfs_remove_file(char *name)
if (!dir->d_inode)
goto out;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock_nested(dir->d_inode, I_MUTEX_PARENT);
-#else
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
-#endif
+
dentry = lookup_one_len(last, dir, strlen(last));
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
@@ -783,11 +774,7 @@ int cifsd_vfs_remove_file(char *name)
dput(dentry);
out_err:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
out:
path_put(&parent);
return err;
@@ -1302,11 +1289,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
int err = 0;
dget(dentry);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(dir->d_inode);
-#else
mutex_lock(&dir->d_inode->i_mutex);
-#endif
+
if (!dentry->d_inode || !dentry->d_inode->i_nlink) {
err = -ENOENT;
goto out;
@@ -1318,11 +1302,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
err = vfs_unlink(dir->d_inode, dentry, NULL);
out:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
+
dput(dentry);
if (err)
cifsd_debug("failed to delete, err %d\n", err);

60
cifsd/Makefile Normal file
View File

@@ -0,0 +1,60 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=cifsd
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/namjaejeon/cifsd.git
PKG_SOURCE_DATE:=2019-03-05
PKG_SOURCE_VERSION:=e1715ce125d55b125b1b58a6f1819ef8e54cc3ba
PKG_MIRROR_HASH:=521585ebfda0ecc02372b1a38ebf762fbbcead6d0b754a47599a5bf6bfdb3fb6
PKG_MAINTAINER:=Andy Walsh <andy.walsh44+github@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
define KernelPackage/fs-cifsd
SUBMENU:=Filesystems
TITLE:=CIFS/SMB kernel server support
FILES:=$(PKG_BUILD_DIR)/cifsd.$(LINUX_KMOD_SUFFIX)
DEPENDS+= \
+kmod-nls-base \
+kmod-nls-utf8 \
+kmod-crypto-md4 \
+kmod-crypto-md5 \
+kmod-crypto-hmac \
+kmod-crypto-ecb \
+kmod-crypto-des \
+kmod-crypto-sha256 \
+kmod-crypto-cmac \
+kmod-crypto-sha512 \
+kmod-crypto-aead \
+kmod-crypto-ccm
KCONFIG:= \
CONFIG_KEYS=y \
CONFIG_CRYPTO_ARC4=y
endef
define KernelPackage/fs-cifsd/description
Kernel module for a CIFS/SMBv2,3 fileserver.
endef
TARGET_CFLAGS+= -DCONFIG_CIFSD_ACL
MAKE_OPTS:=\
ARCH="$(LINUX_KARCH)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
M="$(PKG_BUILD_DIR)"
define Build/Compile
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
CONFIG_CIFS_SERVER=m \
modules
endef
$(eval $(call KernelPackage,fs-cifsd))

View File

@@ -0,0 +1,69 @@
--- a/vfs.c
+++ b/vfs.c
@@ -544,15 +544,9 @@ int cifsd_vfs_setattr(struct cifsd_work
attrs->ia_valid |= ATTR_CTIME;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(inode);
- err = notify_change(dentry, attrs, NULL);
- inode_unlock(inode);
-#else
mutex_lock(&inode->i_mutex);
err = notify_change(dentry, attrs, NULL);
mutex_unlock(&inode->i_mutex);
-#endif
if (update_size)
put_write_access(inode);
@@ -753,11 +747,8 @@ int cifsd_vfs_remove_file(char *name)
if (!dir->d_inode)
goto out;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock_nested(dir->d_inode, I_MUTEX_PARENT);
-#else
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
-#endif
+
dentry = lookup_one_len(last, dir, strlen(last));
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
@@ -783,11 +774,7 @@ int cifsd_vfs_remove_file(char *name)
dput(dentry);
out_err:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
out:
path_put(&parent);
return err;
@@ -1302,11 +1289,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
int err = 0;
dget(dentry);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_lock(dir->d_inode);
-#else
mutex_lock(&dir->d_inode->i_mutex);
-#endif
+
if (!dentry->d_inode || !dentry->d_inode->i_nlink) {
err = -ENOENT;
goto out;
@@ -1318,11 +1302,8 @@ int cifsd_vfs_unlink(struct dentry *dir,
err = vfs_unlink(dir->d_inode, dentry, NULL);
out:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
- inode_unlock(dir->d_inode);
-#else
mutex_unlock(&dir->d_inode->i_mutex);
-#endif
+
dput(dentry);
if (err)
cifsd_debug("failed to delete, err %d\n", err);

View File

@@ -24,7 +24,7 @@ What we need is the public key for the clients.
For dropbear "dropbearkey -y -f files/etc/dropbear/logid" will generate the public key.
----------
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwn9RaDAzxW1dTmIhXgFBnpi1lhj8xhYpCVQiPxxdk9IEmH8zjo4y9j3sPkqKOlRnkwjpZIpLEKBnpQTwVIMCU/AG7nDJX3OH9RfS9mLJQLfFL8HyGCyqDezFWldbyovhJZvdUeK4tAXJWv2W3OVHiz2L8IlncBgP/E9DJElsyhhQHsM96UE6tBkXsvXkoDbMSYXFcLbgiUwBKfmM2BF/aPDL45iznGur7/2j9v95PwJ0gtMu9jjNRq+pXCXhTh3bsnczm0MpZC1aiRc9nJAeGIMmhrf15E4jBKgTnrstzJxGVAdajKeR954KcNsS33cS2Wmui2YjmPbBXjqf1frzJ log@iopsys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwn9RaDAzxW1dTmIhXgFBnpi1lhj8xhYpCVQiPxxdk9IEmH8zjo4y9j3sPkqKOlRnkwjpZIpLEKBnpQTwVIMCU/AG7nDJX3OH9RfS9mLJQLfFL8HyGCyqDezFWldbyovhJZvdUeK4tAXJWv2W3OVHiz2L8IlncBgP/E9DJElsyhhQHsM96UE6tBkXsvXkoDbMSYXFcLbgiUwBKfmM2BF/aPDL45iznGur7/2j9v95PwJ0gtMu9jjNRq+pXCXhTh3bsnczm0MpZC1aiRc9nJAeGIMmhrf15E4jBKgTnrstzJxGVAdajKeR954KcNsS33cS2Wmui2YjmPbBXjqf1frzJ log@inteno
----------
The public key should be just one line. Add that line to the

View File

@@ -1,61 +0,0 @@
#
# Copyright (C) 2021 IOPSYS Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dectmngr
PKG_RELEASE:=3
PKG_VERSION:=3.0.3
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=004098272e7b9518c25d746c93b2d1d88936379b
endif
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
RSTRIP:=true
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
CATEGORY:=Utilities
TITLE:=DECT Manager
DEPENDS:= +libubox +ubus
endef
define Package/$(PKG_NAME)/description
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
endef
endif
MAKE_FLAGS += \
CFLAGS+="-Wall"
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
$(STRIP) $(1)/usr/sbin/dectmngr
$(CP) ./files/etc/* $(1)/etc/
endef
$(eval $(call BuildPackage,$(PKG_NAME)))

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,61 +0,0 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2021 OpenWrt.org
#
source /lib/functions/uci-defaults.sh
START=70
STOP=12
USE_PROCD=1
NAME=dectmngr
PROG=/usr/sbin/dectmngr
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
stop_and_wait_dectmngr() {
pidof $NAME && killall -q $NAME
pidof $NAME && sleep 2 # wait for the process to stop gracefully
while pidof $NAME; do
killall -q -9 $NAME
sleep 1
done
}
start_service() {
test $(db get hw.board.hasDect) = "0" && return
echo 1 > /sys/class/gpio/gpio14/value
procd_open_instance
procd_set_param command $PROG -comname ttyH0
procd_set_param respawn 6 2 3
procd_set_param term_timeout 20
procd_set_param triggers asterisk
procd_close_instance
}
stop_service() {
test $(db get hw.board.hasDect) = "0" && return
echo 0 > /sys/class/gpio/gpio14/value
stop_and_wait_dectmngr
}
reload_service() {
stop_and_wait_dectmngr
start
}
service_triggers()
{
procd_add_reload_trigger asterisk
}
boot() {
echo 14 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio14/direction
start
}

View File

@@ -1,27 +0,0 @@
#!/bin/sh
SOUND_BASE=/lib/modules/$(uname -r)/kernel/sound
SOUND_MODULES="$SOUND_BASE/soundcore.ko $SOUND_BASE/core/snd.ko $SOUND_BASE/core/snd-timer.ko"
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/core/snd-pcm.ko $SOUND_BASE/core/snd-hwdep.ko"
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/core/seq/snd-seq-device.ko"
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/core/seq/snd-seq.ko $SOUND_BASE/core/snd-rawmidi.ko "
SOUND_MODULES="$SOUND_MODULES $SOUND_BASE/usb/snd-usbmidi-lib.ko $SOUND_BASE/usb/snd-usb-audio.ko"
load_sound_modules() {
for mod in $SOUND_MODULES; do
insmod $mod
done
}
unload_sound_modules() {
local modules=
# reverse the order
for mod in $SOUND_MODULES; do
modules="$mod $modules"
done
for mod in $modules; do
rmmod $mod
done
}

56
dectmngr2/Makefile Normal file
View File

@@ -0,0 +1,56 @@
#
# Copyright (C) 2019 iopsys Software Solutions AB
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=1.3.0
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=2c8990fd5275d469e8ab6c7a99e17fe0a56052ea
PKG_NAME:=dectmngr2
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/dectmngr2
CATEGORY:=Utilities
TITLE:=Dectmngr2
URL:=
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus +libpicoevent endptmngr
endef
define Package/dectmngr2/description
Dectmngr2
endef
define Package/dectmngr2/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/etc/dect/
$(INSTALL_DIR) $(1)/etc/config/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/etc/uci-defaults/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dectmngr2 $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/nvs_default $(1)/etc/dect/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dectmngr-wrapper.sh $(1)/usr/sbin/
$(CP) ./files/dect.config $(1)/etc/config/dect
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
endef
$(eval $(call BuildPackage,dectmngr2))

View File

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

View File

@@ -0,0 +1,23 @@
#!/bin/sh
# Workaround for product DG400 which has an
# incorrect value in nvram from factory.
if [ -e "/proc/nvram/BoardId" ]; then
boardid=$(cat /proc/nvram/BoardId)
ulBoardStuffOption=$(cat /proc/nvram/ulBoardStuffOption)
if [ "$boardid" = "DG400R0" -a "$ulBoardStuffOption" = "0xffffffff" ]; then
echo "0xfffffff2" >/proc/nvram/ulBoardStuffOption
db -q batch <<-EOT
set hw.board.has_dect=1
commit hw.board
EOT
fi
fi
exit 0

View File

@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dslmngr
PKG_VERSION:=1.1.0
PKG_VERSION:=1.0.1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=1fa1cee62c52c69c321ddf93399fef9483520996
PKG_SOURCE_VERSION:=63525fe43aa57a710bb097e4c0ed496c4032db6d
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
endif
@@ -25,7 +25,9 @@ PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
TARGET_PLATFORM=BROADCOM
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
TARGET_PLATFORM=BROADCOM
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
TARGET_PLATFORM=MEDIATEK

View File

@@ -19,7 +19,7 @@ define Package/easy-qos
SECTION:=net
CATEGORY:=Network
TITLE:=Easy QoS
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm)
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_brcm63xx_mips)
endef
define Package/easy-qos/description

23
easy-soc-libs/Config.in Normal file
View File

@@ -0,0 +1,23 @@
if (PACKAGE_libwifi || PACKAGE_libdsl || PACKAGE_libethernet)
menu "configurations"
config IOP_LLA_LIBS_DEBUG
bool "Enable debugging support"
default n
config LIBWIFI_DEBUG
depends on PACKAGE_libwifi
bool "Enable wifi debugging"
default n
config LIBDSL_DEBUG
depends on PACKAGE_libdsl
bool "Enable xdsl debugging"
default n
config LIBDSL_TEST
depends on PACKAGE_libdsl
bool "Libdsl test program"
default n
endmenu
endif

View File

@@ -7,13 +7,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=easy-soc-libs
PKG_VERSION:=6.1.20
PKG_VERSION:=5.3.15
PKG_RELEASE:=1
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c69171f8025a92c3224fd7eb0f6569126b86832e
PKG_SOURCE_VERSION:=a2289131c5d1f602568a2e8cac1295442504827f
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
@@ -29,18 +29,52 @@ include $(INCLUDE_DIR)/package.mk
define Package/easy-soc-libs
SECTION:=libs
CATEGORY:=Libraries
TITLE:=IOPSYS Easy SoC libraries
SUBMENU:=IOPSYS Easy SoC libraries
TITLE:=IOPSYS easy SoC libraries
SUBMENU:=IOPSYS easy SoC libraries
DEPENDS:=+libopenssl
MENU:=1
endef
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
define Package/libwifi/config
source "$(SOURCE)/Config.in"
endef
define Package/libeasy
$(call Package/easy-soc-libs)
TITLE:= Common helper functions library (libeasy)
DEPENDS+=+libnl +libnl-route
endef
define Package/libwifi
$(call Package/easy-soc-libs)
TITLE:= WiFi library (libwifi)
DEPENDS+=+libnl +libnl-route +libeasy
endef
define Package/libethernet
$(call Package/easy-soc-libs)
TITLE:= Ethernet library (libethernet)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig
endef
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_mips),y)
TARGET_PLATFORM=BROADCOM
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCONFIG_BCM963138 \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
KERNEL_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
TARGET_PLATFORM=BROADCOM
TARGET_CFLAGS +=-DIOPSYS_BROADCOM \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm_panther),y)
TARGET_CFLAGS +=-DCONFIG_BCM96846
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm_tiger),y)
TARGET_CFLAGS +=-DCONFIG_BCM96858
else ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm_eagle),y)
TARGET_CFLAGS +=-DCONFIG_BCM963178
else
TARGET_CFLAGS +=-DCONFIG_BCM963138
endif
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
TARGET_PLATFORM=MEDIATEK
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
@@ -62,20 +96,21 @@ endif
export TARGET_PLATFORM
ifdef CONFIG_IOP_LLA_LIBS_DEBUG
TARGET_CFLAGS += -DIOP_LLA_LIBS_DEBUG
endif
define Package/libdsl
$(call Package/easy-soc-libs)
TITLE:= XDSL library (libdsl)
DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi +TARGET_intel_mips:kmod-ppa-drv
endef
subdirs := \
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
$(if $(CONFIG_PACKAGE_libethernet),libethernet) \
$(if $(CONFIG_PACKAGE_libqos),libqos)
EASY_SOC_LIBS := \
libeasy \
libwifi \
libdsl \
libethernet \
libqos
$(if $(CONFIG_PACKAGE_libethernet),libethernet)
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
@@ -95,36 +130,79 @@ define Build/Prepare
endef
endif
include easy.mk
include wifi.mk
include dsl.mk
include ethernet.mk
include qos.mk
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),\
$(PKG_BUILD_DIR)/.config_$(patsubst "%",%,$(CONFIG_TARGET_PROFILE)))
define Build/Compile/rebuild
$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.so\* | $(XARGS) rm -f;
$(if $(wildcard $(PKG_BUILD_DIR)/config_*), \
rm -f $(PKG_BUILD_DIR)/.config_*)
define Build/InstallDev/libeasy
$(INSTALL_DIR) $(1)/usr/include/easy
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
endef
endif
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(TARGET_CFLAGS) | mkhash md5)
define Build/InstallDev/libwifi
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
endef
define Build/InstallDev/libdsl
$(INSTALL_DIR) $(1)/usr/include/xdsl
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl
$(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl
$(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
endef
define Build/InstallDev/libethernet
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
endef
define Build/Compile
$(Build/Compile/rebuild)
touch $(PKG_BUILD_DIR)/.config_$(CONFIG_TARGET_PROFILE)
$(call Build/Compile/Default)
$(foreach dir,$(subdirs),$(call Build/Compile/$(dir)))
ifeq ($(CONFIG_LIBDSL_TEST),y)
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
endif
endef
define Build/InstallDev
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
endef
define Package/libeasy/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
endef
define Package/libwifi/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
endef
define Package/libethernet/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/
endef
define Package/libdsl/install
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
ifeq ($(CONFIG_LIBDSL_TEST),y)
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
endif
endef
define Package/easy-soc-libs/install
:
endef
$(eval $(foreach e,$(EASY_SOC_LIBS),$(call BuildPackage,$(e))))
$(eval $(call BuildPackage,libeasy))
$(eval $(call BuildPackage,libwifi))
$(eval $(call BuildPackage,libdsl))
$(eval $(call BuildPackage,libethernet))

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,29 +0,0 @@
define Package/libwifi
$(call Package/easy-soc-libs)
TITLE:= WiFi library (libwifi)
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_brcm63xx_arm:bcmkernel
endef
define Package/libwifi/config
if PACKAGE_libdsl
config LIBWIFI_DEBUG
depends on PACKAGE_libwifi
bool "Enable wifi debugging"
default n
endif
endef
define Build/InstallDev/libwifi
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
endef
define Package/libwifi/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
endef

View File

@@ -7,15 +7,15 @@
include $(TOPDIR)/rules.mk
PKG_RELEASE:=1
PKG_VERSION:=0.4
PKG_SOURCE_VERSION:=510b885c049b8ba06772dae59e64b370d0fded3e
PKG_VERSION:=0.3
PKG_SOURCE_VERSION:=34ae1996beda98691d779e49f231bd662fc87cda
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
ifeq ($(CONFIG_ENDPT_OPEN),y)
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
PKG_SOURCE:=endptmngr-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=https://download.iopsys.eu/iopsys/opensdk/
PKG_SOURCE_URL:=http://download.iopsys.eu/iopsys/opensdk/
PKG_NAME:=endptmngr-open
PATCH_DIR:=
PKG_HASH:=skip
@@ -31,16 +31,6 @@ export BUILD_DIR
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
# All config variable that are passed to the make invocation, directly or
# indirectly. This ensures that the package is rebuilt on config-changes.
PKG_CONFIG_DEPENDS := \
CONFIG_TARGET_BOARD
export CONFIG_BRCM_SDK_VER_504001
export CONFIG_BRCM_SDK_VER_504002
export CONFIG_BRCM_SDK_VER_504003
export CONFIG_BRCM_SDK_VER_504004
export CONFIG_BRCM_SDK_VER_504005
include $(INCLUDE_DIR)/package.mk
@@ -53,7 +43,7 @@ define Package/endptmngr
CATEGORY:=Utilities
TITLE:=Brcmslic
URL:=
DEPENDS:= +libubox +ubus +libpicoevent +uci +bcmkernel @TARGET_HAS_VOICE @BCM_VOICE
DEPENDS:= +libubox +ubus +libpicoevent +bcmkernel @TARGET_HAS_VOICE @!TARGET_NO_VOICE
endef
define Package/endptmngr/description

View File

@@ -5,10 +5,10 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethmngr
PKG_VERSION:=2.0.1
PKG_VERSION:=1.0.4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
PKG_SOURCE_VERSION:=b7135381aedf1bde6f7ab10b41be372a9bd7d155
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz

View File

@@ -46,10 +46,9 @@ static ssize_t get_led_color(struct device *dev,
/* [ln] todo: dummy implementation */
int len;
len = scnprintf(buf, PAGE_SIZE, "%d\n", 123);
len = sprintf(buf, "%d\n", 123);
if (len <= 0) {
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
return -EIO;
}
return len;
@@ -100,69 +99,8 @@ static ssize_t set_led_color(struct device *dev,
}
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
static ssize_t get_led_brightness(struct device *dev,
struct device_attribute *attr, char *buf)
{
int len;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
len = scnprintf(buf, PAGE_SIZE, "%x\n", sk9822->led_brightness);
if (len <= 0) {
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
return -EIO;
}
return len;
}
/**
* @brief Set LED brightness
* @retval count number of bytes written
* @retval -EINVAL if the message is not a valid hexadecimal number
* @retval -EIO for all other errors (e.g. leds cannot be configured)
*/
static ssize_t set_led_brightness(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int ret = 0;
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
unsigned long val = SK9822_DEFAULT_BRIGHTNESS;
if (IS_ERR(sk9822)) {
printk(KERN_ERR "Platform get drvdata returned NULL\n");
return -EIO;
}
if (kstrtoul(buf, 16, &val)) {
return -EINVAL;
}
if(val > SK9822_DEFAULT_BRIGHTNESS) {
val = SK9822_DEFAULT_BRIGHTNESS;
}
sk9822->led_brightness = (uint8_t)val;
// Now push to the HW
ret = sk9822_update(sk9822);
if (ret != 0) {
printk(KERN_ERR "Failed to update led\n");
return -EIO;
}
return count;
}
static DEVICE_ATTR(led_brightness, S_IRUGO | S_IWUSR, get_led_brightness, set_led_brightness);
static struct attribute *sk9822_dev_attrs[] = {
&dev_attr_led_color.attr,
&dev_attr_led_brightness.attr,
NULL
};

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=6.4.6-2021-02-09
PKG_VERSION:=5.0-2020-10-13
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=196ae20ae8156aa01a4fb893031d3fcfb0481457
PKG_SOURCE_VERSION:=85ffabf799f769f9100068e887ed4f5ca8286620
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
@@ -32,12 +32,20 @@ CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
include $(INCLUDE_DIR)/package.mk
define Package/icwmp-tr098
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=CWMP client for TR-098 Data Model
DEPENDS:=+PACKAGE_icwmp-tr098:libuci +PACKAGE_icwmp-tr098:libmicroxml +PACKAGE_icwmp-tr098:libubox +PACKAGE_icwmp-tr098:jshn +PACKAGE_icwmp-tr098:libubus +PACKAGE_icwmp-tr098:libblobmsg-json +PACKAGE_icwmp-tr098:libpthread +PACKAGE_icwmp-tr098:ubusd +PACKAGE_icwmp-tr098:shflags +PACKAGE_icwmp-tr098:getopt +PACKAGE_icwmp-tr098:zlib +PACKAGE_icwmp-tr098:libjson-c +PACKAGE_icwmp-tr098:libopenssl +PACKAGE_icwmp-tr098:curl +PACKAGE_icwmp-tr098:libcurl +PACKAGE_icwmp-tr098:libtr098
endef
define Package/$(PKG_NAME)
SECTION:=utils
CATEGORY:=Utilities
SUBMENU:=TRx69
TITLE:=CWMP client
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl +libbbfdm +libbbf_api
endef
define Package/$(PKG_NAME)/description
@@ -58,6 +66,11 @@ endif
TARGET_CFLAGS += \
-D_GNU_SOURCE -D_AADJ
ifeq ($(CONFIG_PACKAGE_icwmp-tr098),y)
CONFIGURE_ARGS += \
--enable-icwmp_tr098
endif
ifneq ($(CWMP_REVISION)_,_)
ifneq ($(CWMP_REVISION),exported)
ifneq ($(CWMP_REVISION),Unversioned directory)
@@ -109,6 +122,11 @@ endif
$(CP) ./files/* $(1)/
endef
define Package/icwmp-tr098/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/bin/icwmp_tr098d $(1)/usr/sbin
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
@@ -128,3 +146,4 @@ define Package/$(PKG_NAME)/prerm
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,icwmp-tr098))

View File

@@ -15,7 +15,6 @@ config acs 'acs'
option retry_interval_multiplier '2000'
option https_ssl_capath ''
option ipv6_enable '0'
option ip_version '4'
config cpe 'cpe'
option interface 'eth0.1'

View File

@@ -11,6 +11,7 @@ STOP=10
USE_PROCD=1
PROG="/usr/sbin/icwmpd"
EXTRA_COMMANDS="notify"
EXTRA_HELP=" start [GetRPCMethods] Start icwmpd service and send GetRPCMethods"
validate_url() {
@@ -27,6 +28,10 @@ validate_url() {
return 1
}
build_dmmap_instance() {
[ ! -e /etc/icwmpd/.icwmpd_backup_session.xml ] && /usr/sbin/icwmp get name "" 0 >/dev/null 2>&1
}
get_acs_url() {
local default_acs="http://10.10.1.6:8000/openacs/acs"
local acs_dhcp_discovery="$(uci -q get cwmp.acs.dhcp_discovery)"
@@ -123,6 +128,17 @@ wait_for_option43() {
fi
}
wait_for_wifi() {
local time=$1
local tm=1
while [ ! -f /tmp/wifi.started ]; do
sleep 1
[ $tm -ge $time ] && break
tm=$((tm+1))
done
}
wait_for_resolvfile() {
local time=$1
local tm=1
@@ -137,6 +153,17 @@ wait_for_resolvfile() {
done
}
wait_for_asterisk() {
local time=$1
local tm=1
while [ -z "$(pidof asterisk)" ]; do
sleep 1
[ $tm -ge $time ] && break
tm=$((tm+1))
done
}
set_wan_interface() {
local l3_device=""
local default_wan_interface=""
@@ -156,12 +183,13 @@ start_service() {
touch /tmp/.icwmpd_boot
else
[ -f /sbin/netifd ] && echo "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
[ -f /etc/config/wireless ] && echo "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless
[ -f /etc/config/wireless ] && echo "Waiting for WiFi to be started ..." && wait_for_wifi 20
[ -f /usr/sbin/dnsmasq ] && echo "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
[ -f /etc/config/dhcp ] && echo "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
[ -f /usr/sbin/asterisk ] && echo "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk
[ -f /usr/sbin/asterisk ] && echo "Waiting for Voice to be started ..." && wait_for_asterisk 5
config_load cwmp
build_dmmap_instance
set_wan_interface
wait_for_option43 20
get_acs_url
@@ -175,6 +203,9 @@ start_service() {
fi
procd_set_param respawn "3" "7" "0"
procd_close_instance
#procd_open_instance
#[ "$(uci -q get cwmp.cpe.notification)" == "1" ] && procd_append_param command "/usr/sbin/icwmp_notifd"
#procd_close_instance
fi
}
@@ -183,6 +214,10 @@ reload_service() {
start
}
notify() {
ubus -t 1 call tr069 notify >/dev/null 2>&1 &
}
service_triggers() {
procd_add_config_trigger "config.change" "cwmp" /etc/init.d/icwmpd reload
}

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ieee1905
PKG_VERSION:=2.1.37
PKG_VERSION:=2.1.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=65bed80b42fa4e339fe20a638a58009858edf11f
PKG_SOURCE_VERSION:=5b712be46aadc0b54cdb72464150ab58892e9c3f
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
endif
@@ -40,22 +40,12 @@ define Package/libieee1905
TITLE:=IEEE1905 cmdu tlv utility library
endef
define Package/libwsc
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Wifi Simple Configuration building and processing library
DEPENDS= +libopenssl +libuci +libubus
endef
define Package/lib1905hle
SECTION:=utils
CATEGORY:=Utilities
TITLE:=IEEE1905 hle stack library
endef
LIBS := \
$(if $(CONFIG_PACKAGE_libwsc),libwsc.so)
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-D_GNU_SOURCE \
@@ -63,9 +53,6 @@ TARGET_CFLAGS += \
-Wall \
-Wextra
MAKE_FLAGS += \
LIBS="$(LIBS)"
ifeq ($(CONFIG_IEEE1905_SPEED_UP_DISCOVERY),y)
TARGET_CFLAGS += -DSPEED_UP_DISCOVERY
endif
@@ -110,18 +97,6 @@ define Package/libieee1905/install
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib/libieee1905.so
endef
define Package/libwsc/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/libwsc.so
endef
define Build/InstallDev/libwsc.so
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libwsc/include/wsc.h $(1)/usr/include/
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/ieee1905
@@ -132,10 +107,8 @@ define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/lib1905hle/include/*.h $(1)/usr/include/lib1905hle/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib
$(foreach lib,$(LIBS),$(call Build/InstallDev/$(lib),$(1),$(2));)
endef
$(eval $(call BuildPackage,libieee1905))
$(eval $(call BuildPackage,lib1905hle))
$(eval $(call BuildPackage,libwsc))
$(eval $(call BuildPackage,ieee1905))

View File

@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=inbd
PKG_VERSION:=1.2.1
PKG_VERSION:=1.0.1
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=dac9d6ceaabf7bf5a2c11b0f9e865d086c5732e1
PKG_SOURCE_VERSION:=3135944f3357a7a2c1c206be7b65bbb7ac6d1e58
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd

View File

@@ -23,12 +23,10 @@ CONFIG_PACKAGE_icwmp=y
CONFIG_PACKAGE_ieee1905=y
CONFIG_PACKAGE_map-1905=y
CONFIG_PACKAGE_map-topology=y
CONFIG_PACKAGE_mosquitto-client-ssl=y
CONFIG_PACKAGE_mosquitto-ssl=y
CONFIG_PACKAGE_wfadatad=y
CONFIG_PACKAGE_imonitor=m
CONFIG_PACKAGE_inbd=y
CONFIG_PACKAGE_iopupgrade=y
CONFIG_PACKAGE_iopupgrade=m
CONFIG_PACKAGE_ip-full=y
CONFIG_PACKAGE_iperf3=y
CONFIG_PACKAGE_ipset=y
@@ -37,7 +35,6 @@ CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-filter=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
# CONFIG_PACKAGE_iwatchdog is not set
CONFIG_PACKAGE_jq=y
CONFIG_PACKAGE_juci=y
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
CONFIG_PACKAGE_juci-firewall-fw3=y
@@ -56,6 +53,7 @@ CONFIG_PACKAGE_libreswan=m
CONFIG_PACKAGE_libwifi=y
CONFIG_PACKAGE_lscpu=y
CONFIG_PACKAGE_map=y
CONFIG_PACKAGE_miniupnpc=y
CONFIG_PACKAGE_miniupnpd=y
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_nand-utils=y
@@ -87,21 +85,21 @@ CONFIG_PACKAGE_relayd=y
CONFIG_PACKAGE_resolveip=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
CONFIG_PACKAGE_rsync=y
CONFIG_PACKAGE_rulengd=y
CONFIG_PACKAGE_rsync=y
CONFIG_PACKAGE_strace=y
CONFIG_PACKAGE_swmodd=m
CONFIG_PACKAGE_tc=y
CONFIG_PACKAGE_tcpdump=y
CONFIG_PACKAGE_terminfo=y
CONFIG_PACKAGE_traceroute6=y
CONFIG_PACKAGE_uledd=y
CONFIG_PACKAGE_umbim=y
CONFIG_PACKAGE_uqmi=y
CONFIG_PACKAGE_usb-modeswitch=y
CONFIG_PACKAGE_usbreset=y
CONFIG_PACKAGE_uspd=y
CONFIG_PACKAGE_vsftpd-tls=m
CONFIG_PACKAGE_wget=y
CONFIG_PACKAGE_wwan=y
CONFIG_PACKAGE_wifimngr=y
CONFIG_PACKAGE_xl2tpd=y
@@ -200,7 +198,7 @@ CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
CONFIG_KERNEL_DEVTMPFS=y
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
# CONFIG_BUSYBOX_CONFIG_IP is not set
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
CONFIG_LOCALMIRROR="http://download.iopsys.eu/iopsys/mirror/"
# Generation of /etc/banner.
CONFIG_IMAGEOPT=y
@@ -220,9 +218,6 @@ CONFIG_TARGET_PREINIT_IP=""
CONFIG_TARGET_PREINIT_NETMASK=""
CONFIG_TARGET_PREINIT_BROADCAST=""
# Generate rootfs tar file
CONFIG_TARGET_ROOTFS_TARGZ=y
# The urandom-seed package is very strange. It seeds urandom with urandom...
# Disable it. Most SoCs nowadays has HW random generators anyway.
# CONFIG_PACKAGE_urandom-seed is not set

View File

@@ -35,7 +35,7 @@ _iop()
iopcmds="bootstrap cfe_upgrade cfe_upgrade_latest extract_core \
feeds_update genconfig generate_tarballs install_key \
scp_changes setup_host ssh_install_key status \
update_package update_feed_branches ssh_upgrade smoketest"
update_package update_feed_branches ssh_upgrade"
if [ $COMP_CWORD -eq 1 ] ; then

View File

@@ -32,7 +32,7 @@ function feeds_update {
fi
# targets need to be installed explicitly
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx"
targets="iopsys-brcm63xx-mips iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt"
for target in $targets
do
rm -f target/linux/$target

View File

@@ -5,7 +5,7 @@ function genconfig {
export IMPORT=1
export SRCTREEOVERR=0
export FILEDIR="files/"
export THEMEDIR="tmp/juci-themes"
export THEMEDIR="themes"
CURRENT_CONFIG_FILE=".current_config_file"
export CONFIGPATH="package/feeds/iopsys/iop"
CUSTPATH="customerconfigs"
@@ -13,8 +13,8 @@ function genconfig {
export VERBOSE=0
export DEVELOPER=0
target="bogus"
target_config_path=""
bcm27xx="target/linux/iopsys-bcm27xx"
config_path=""
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
ramips="target/linux/iopsys-ramips"
intel_mips="target/linux/intel_mips"
@@ -103,12 +103,14 @@ function genconfig {
if [ $pfound -eq 1 ]; then
target="$(echo $TARGET | tr '-' '_')"
target_config_path="$targetpath/config"
config_path="$targetpath/config"
fi
return
fi
[ -e $brcm63xx_mips/genconfig ] &&
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
[ -e $brcm63xx_arm/genconfig ] &&
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
[ -e $ramips/genconfig ] &&
@@ -119,11 +121,9 @@ function genconfig {
iopsys_x86=$(cd $x86; ./genconfig)
[ -e $armvirt/genconfig ] &&
iopsys_armvirt=$(cd $armvirt; ./genconfig)
[ -e $bcm27xx/genconfig ] &&
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
if [ "$profile" == "LIST" ]; then
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt; do
echo "$list based boards:"
for b in ${!list}; do
echo -e "\t$b"
@@ -132,10 +132,18 @@ function genconfig {
return
fi
for p in $iopsys_brcm63xx_mips; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_mips"
config_path="$brcm63xx_mips/config"
return
fi
done
for p in $iopsys_brcm63xx_arm; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_arm"
target_config_path="$brcm63xx_arm/config"
config_path="$brcm63xx_arm/config"
return
fi
done
@@ -143,7 +151,7 @@ function genconfig {
for p in $iopsys_ramips; do
if [ $p == $profile ]; then
target="iopsys_ramips"
target_config_path="$ramips/config"
config_path="$ramips/config"
return
fi
done
@@ -151,7 +159,7 @@ function genconfig {
for p in $iopsys_intel_mips; do
if [ $p == $profile ]; then
target="intel_mips"
target_config_path="$intel_mips/config"
config_path="$intel_mips/config"
return
fi
done
@@ -159,7 +167,7 @@ function genconfig {
for p in $iopsys_x86; do
if [ $p == $profile ]; then
target="iopsys_x86"
target_config_path="$x86/config"
config_path="$x86/config"
return
fi
done
@@ -167,15 +175,7 @@ function genconfig {
for p in $iopsys_armvirt; do
if [ $p == $profile ]; then
target="iopsys_armvirt"
target_config_path="$armvirt/config"
return
fi
done
for p in $iopsys_bcm27xx; do
if [ $p == $profile ]; then
target="iopsys_bcm27xx"
target_config_path="$bcm27xx/config"
config_path="$armvirt/config"
return
fi
done
@@ -187,8 +187,12 @@ function genconfig {
bcmAllowed=0
endptAllowed=0
natalieAllowed=0
#mediatekAllowed=0
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
#git ls-remote git@dev.iopsys.eu:mediatek/linux.git -q 2>/dev/null && mediatekAllowed=1
git ls-remote git@dev.iopsys.eu:dialog/natalie-dect-12.26.git -q 2>/dev/null && natalieAllowed=1
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
}
@@ -335,13 +339,11 @@ function genconfig {
v "cp $CONFIGPATH/config .config"
cp $CONFIGPATH/config .config
if [ -f $target_config_path/config ]; then
cat $target_config_path/config >> .config
echo "" >> .config
if [ -f $config_path/config ]; then
cat $config_path/config >> .config
fi
if [ -f $target_config_path/$BOARDTYPE/config ]; then
cat $target_config_path/$BOARDTYPE/config >> .config
echo "" >> .config
if [ -f $config_path/$BOARDTYPE/config ]; then
cat $config_path/$BOARDTYPE/config >> .config
fi
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
@@ -358,13 +360,6 @@ function genconfig {
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
elif [ "$target" = "iopsys_bcm27xx" ]; then
subtarget="iopsys_bcm2711"
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
else
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
@@ -391,12 +386,10 @@ function genconfig {
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
echo "" >> .config
fi
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
echo "" >> .config
fi
done
fi
@@ -417,10 +410,14 @@ function genconfig {
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
[ $bcmAllowed -eq 0 ] && echo "CONFIG_BCM_OPEN=y" >> .config
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
[ $natalieAllowed -eq 0 ] && echo "CONFIG_NATALIE_OPEN=y" >> .config
#[ $mediatekAllowed -eq 0 ] && echo "CONFIG_MEDIATEK_OPEN=y" >> .config
else
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
echo "CONFIG_BCM_OPEN=y" >> .config
echo "CONFIG_ENDPT_OPEN=y" >> .config
echo "CONFIG_NATALIE_OPEN=y" >> .config
#echo "CONFIG_MEDIATEK_OPEN=y" >> .config
fi
if [ -n "$BRCM_MAX_JOBS" ]
@@ -436,7 +433,7 @@ function genconfig {
touch package/kernel/linux/Makefile
# we need to signal to bradcom SDK that we have changed the board id
# currently boardparms.c and boardparms_voice.c is the only place that is depending on boardid name
# currently boardparms.c and boardparms_voice.c is the only place that is depending on inteno boardid name
# so just touch that file.
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null

View File

@@ -13,7 +13,7 @@ function genconfig_min {
export DEVELOPER=0
target="bogus"
config_path=""
bcm27xx="target/linux/iopsys-bcm27xx"
brcm63xx_mips="target/linux/iopsys-brcm63xx-mips"
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
ramips="target/linux/iopsys-ramips"
intel_mips="target/linux/intel_mips"
@@ -108,6 +108,8 @@ function genconfig_min {
return
fi
[ -e $brcm63xx_mips/genconfig ] &&
iopsys_brcm63xx_mips=$(cd $brcm63xx_mips; ./genconfig)
[ -e $brcm63xx_arm/genconfig ] &&
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
[ -e $ramips/genconfig ] &&
@@ -118,11 +120,9 @@ function genconfig_min {
iopsys_x86=$(cd $x86; ./genconfig)
[ -e $armvirt/genconfig ] &&
iopsys_armvirt=$(cd $armvirt; ./genconfig)
[ -e $bcm27xx/genconfig ] &&
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
if [ "$profile" == "LIST" ]; then
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
for list in iopsys_brcm63xx_mips iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt; do
echo "$list based boards:"
for b in ${!list}; do
echo -e "\t$b"
@@ -131,6 +131,14 @@ function genconfig_min {
return
fi
for p in $iopsys_brcm63xx_mips; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_mips"
config_path="$brcm63xx_mips/config"
return
fi
done
for p in $iopsys_brcm63xx_arm; do
if [ $p == $profile ]; then
target="iopsys_brcm63xx_arm"
@@ -171,14 +179,6 @@ function genconfig_min {
fi
done
for p in $iopsys_bcm27xx; do
if [ $p == $profile ]; then
target="iopsys_bcm27xx"
config_path="$bcm27xx/config"
return
fi
done
}
git remote -v | grep -q http || {
@@ -186,8 +186,12 @@ function genconfig_min {
bcmAllowed=0
endptAllowed=0
natalieAllowed=0
mediatekAllowed=0
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
git ls-remote git@dev.iopsys.eu:mediatek/linux.git -q 2>/dev/null && mediatekAllowed=1
git ls-remote git@dev.iopsys.eu:dialog/natalie-dect-12.26.git -q 2>/dev/null && natalieAllowed=1
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
}
@@ -333,14 +337,6 @@ function genconfig_min {
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
elif [ "$target" = "iopsys_bcm27xx" ]; then
subtarget="iopsys_bcm2711"
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
device=$(echo $BOARDTYPE | tr a-z A-Z)
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
else
echo "CONFIG_TARGET_${target}=y" >> .config
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
@@ -393,7 +389,7 @@ function genconfig_min {
touch package/kernel/linux/Makefile
# we need to signal to bradcom SDK that we have changed the board id
# currently boardparms.c and boardparms_voice.c is the only place that is depending on boardid name
# currently boardparms.c and boardparms_voice.c is the only place that is depending on inteno boardid name
# so just touch that file.
[ -d ./build_dir ] && find build_dir/ -name "boardparms*c" -print0 2>/dev/null | xargs -0 touch 2>/dev/null

View File

@@ -30,6 +30,25 @@ build_bcmkernel_consumer() {
cd "$curdir"
}
build_natalie_consumer() {
# create natalie-dect open version tar file
local natalieversion nataliecommith
grep -q "CONFIG_TARGET_NO_DECT=y" .config && return
natalieversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
nataliecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
[ -n "$profile" ] && [ -n "$natalieversion" ] && [ -n "$nataliecommith" ] || return
ssh $SERVER "test -f $FPATH/natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz" && return
cd ./build_dir/target-*/natalie-dect-$natalieversion/
mkdir natalie-dect-open-$natalieversion
cp -f ipkg-*/natalie-dect/lib/modules/*/extra/dect.ko natalie-dect-open-$natalieversion/dect.ko
tar -czv natalie-dect-open-$natalieversion/ -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
scp -pv natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $SERVER:$FPATH/
cp natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $curdir/
rm -rf natalie-dect-open-$natalieversion
rm -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
cd "$curdir"
}
build_endptmngr_consumer() {
# create endptmngr open version tar file
local endptversion endptcommith
@@ -51,6 +70,46 @@ build_endptmngr_consumer() {
cd "$curdir"
}
build_mediatek_kernel() {
local mediatek_commit kernel
mediatek_commit=$(grep CONFIG_KERNEL_GIT_COMMIT .config | cut -d '=' -f2 | tr -d '"')
kernel=linux-git*
[ -n "$mediatek_commit" ] || return
ssh $SERVER "test -f $FPATH/mediatek-kernel-open-$mediatek_commit.tar.gz" && return
echo "Building mediatek kernel tarball from kernel commit:"
echo $mediatek_commit
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/linux-git*
# remove git repo
rm -rf .git
cd ..
tar -czv $kernel -f mediatek-kernel-open-$mediatek_commit.tar.gz
scp -pv mediatek-kernel-open-$mediatek_commit.tar.gz $SERVER:$FPATH/
cd "$curdir"
}
build_mediatek_wifi_consumer() {
local ver commit
local chip=$1
ver=$(grep -w "PKG_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
[ -n "$ver" ] && [ -n "$commit" ] || return
ssh $SERVER "test -f $FPATH/mtk${chip}e-${ver}_${commit}.tar.xz" && return
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/mtk${chip}e-$ver/ipkg-*
mkdir -p mtk${chip}e-$ver/src
cp -rf kmod-mtk${chip}e/etc mtk${chip}e-$ver/src/
cp -rf kmod-mtk${chip}e/lib mtk${chip}e-$ver/src/
tar Jcf mtk${chip}e-${ver}_${commit}.tar.xz mtk${chip}e-$ver
scp -pv mtk${chip}e-${ver}_${commit}.tar.xz $SERVER:$FPATH/
cp mtk${chip}e-${ver}_${commit}.tar.xz $curdir/
rm -rf mtk${chip}e-$ver
rm -f mtk${chip}e-${ver}_${commit}.tar.xz
cd "$curdir"
}
function print_usage {
echo "Usage: $0 generate_tarballs"
echo " -t <target>"
@@ -95,7 +154,12 @@ function generate_tarballs {
if [ "$stk_target" == "broadcom" ]; then
build_bcmkernel_consumer
build_natalie_consumer
build_endptmngr_consumer
elif [ "$stk_target" == "mediatek" ]; then
build_mediatek_kernel
build_mediatek_wifi_consumer 7603
build_mediatek_wifi_consumer 7615
else
echo "Invalid target: $stk_target"
print_usage

View File

@@ -230,7 +230,7 @@ function ssh_upgrade {
upd_fw_base=""
upd_fw=""
upd_host="192.168.1.1"
upd_sysupgrade=1
upd_sysupgrade=0
do_dialog=0
while getopts "f:hnxt:iscb" opt; do
@@ -280,14 +280,6 @@ function ssh_upgrade {
set_config_string CONFIG_TARGET_BOARD
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t *[0-9].y[3])
# if target uses pkgtb
if [ -z "$firmwares"]
then
# pkgtb files can not be streamed so copy over the file witch scp
use_scp=1
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t last.pkgtb)
fi
for upd_fw_base in $firmwares
do
#echo "firmware $upd_fw"
@@ -321,20 +313,10 @@ function ssh_upgrade {
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args -b"
file_size_kb=`du -k "$upd_fw" | cut -f1`
if [ "$use_scp" == "1" ]
then
scp $upd_fw root@$upd_host:/tmp/ &&
ssh -o ConnectTimeout=60 root@$upd_host "iopu $extra_arg -f /tmp/$upd_fw_base"
else
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
fi
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
else
extra_args=""
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -d"
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
scp $upd_fw root@$upd_host:/tmp/ &&
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $extra_args /tmp/$upd_fw_base" &&
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $3 /tmp/$upd_fw_base" &&
echo "sysupgrade done!"
fi
}

View File

@@ -0,0 +1,70 @@
# this is a developer helper script to SCP changed files to remote host
ROOT=build_dir/target-mips_uClibc-0.9.33.2/root-iopsys-brcm63xx-mips/
ROOT_OLD=tmp/root_old/
ROOT_TMP=tmp/root_tmp/
function scp_changes_reset {
{ cd `dirname $0`
rm -rf "$ROOT_OLD"
mkdir -p "$ROOT_OLD"
cp -a "$ROOT"* "$ROOT_OLD"
}
}
function scp_changes {
if [ -z "$1" ] ; then
echo "usage: $0 scp_changes <host/-r(eset)/-p(retend)>"
echo "Error: host required"
exit 1
fi
{ cd `dirname $0`
if [ ! -d $ROOT ]; then
echo "$ROOT does not exist"
echo "please build the project first"
exit 1;
fi
if [ "$1" = "-r" ]; then
echo "reset changes"
scp_changes_reset
exit 0
fi
if [ ! -d $ROOT_OLD ]; then
echo "$ROOT_OLD does not exist"
echo "you didn't store state of previous buildroot"
#echo "please run ./scp_changes_reset.sh"
echo "doing it now"
scp_changes_reset
exit 1;
fi
FILES=`diff -rq "$ROOT" "$ROOT_OLD" 2>&1 | sed -ne "s?^Files .* and $ROOT_OLD\\(.*\\) differ?\\1?p" -ne "s?^Only in $ROOT\\(.*\\): \\(.*\\)?\\1/\\2?p"`
if [ "$1" = "-p" ]; then
echo "files that would be copied:"
echo $FILES
exit 0
fi
for f in $FILES
do
mkdir -p "$ROOT_TMP`dirname $f`"
cp -af "$ROOT$f" "$ROOT_TMP$f"
done
if [ -d "$ROOT_TMP" ]; then
echo "scp changed files to $1"
pushd "$ROOT_TMP" 2>&1 >/dev/null
scp -r * root@$1:/
RETVAL=$?
popd 2>&1 >/dev/null
rm -rf "$ROOT_TMP"
if [ "$RETVAL" -eq 0 ]; then
scp_changes_reset
else
echo "scp error"
exit $RETVAL
fi
else
echo "no change"
fi
}
}
register_command "scp_changes" "<host/-r(eset)/-p(retend)> SCP only changed files to device"

View File

@@ -1,95 +0,0 @@
# Shorthand command for doing a HIL runtime smoketest on the
# latest built image. Does the image boot up correctly?
# More info here:
# https://dev.iopsys.eu/iopsys/iopsys-taas
#--------------------------------------------------------------
function taas-init() {
local f
# Path to TaaS binarys. Try some likely ones.
if ! which taas-smoketest >/dev/null; then
PATH="${PATH}:${PWD}/../iopsys-taas/bin"
PATH="${PATH}:${PWD}/../taas/bin"
PATH="${PATH}:${HOME}/iopsys-taas/bin"
PATH="${PATH}:${HOME}/taas/bin"
PATH="${PATH}:${HOME}/bin"
PATH="${PATH}:/opt/iopsys-taas/bin"
PATH="${PATH}:/opt/taas/bin"
fi
if ! which taas-smoketest >/dev/null; then
echo "Error; TaaS is missing! Install it with:"
echo "git clone git@dev.iopsys.eu:iopsys/iopsys-taas.git ../iopsys-taas"
exit 1
fi
# NAND erase block size.
nandBlkSz=$(grep CONFIG_TARGET_NAND_BLOCKSZ .config | \
tr -s "=\"" " " | cut -d " " -f 2)
nandBlkSz=$((nandBlkSz / 1024))
# Create a list of all images which might be of use.
for f in ${PWD}/bin/targets/iopsys-*/generic/last.* \
${PWD}/build_dir/target-arm*/bcmkernel/bcm963xx/targets/9*/bcm*_linux_raw_image_${nandBlkSz}.bin; do
[[ -s "$f" ]] && images+=("$f")
done
# Convert Iopsys target name to the TaaS product name format
# according to what is available in the remote lab for HIL.
# Also find a suitable image.
product=$(grep CONFIG_TARGET_PROFILE .config | \
tr -s "=\"" " " | cut -d " " -f 2) || exit
case "$product" in
smarthub3)
export product="SmartHub3a"
;;
dg400prime|eg400|ex600)
export product=$(echo -n "$product" | tr [[:lower:]] [[:upper:]])
;;
*)
echo "Unsupported target; skipping!"
exit 0
;;
esac
if [[ ${#images[@]} -eq 0 ]]; then
echo "No image found"
exit 1
fi
}
#--------------------------------------------------------------
function taas-smoketest {
declare -a images
taas-init || return
echo "Testing a $product with ${images[@]}..."
command taas-smoketest "${images[@]}" "$product" "$@"
}
#--------------------------------------------------------------
function taas-bootstrap {
declare -a images
if [[ -n "$1" ]]; then
taas-init || return
echo "Flashing $1..."
command taas-bootstrap "${images[@]}" "$@"
else
echo "Usage: ./iop taas-bootstrap dutX"
exit 1
fi
}
register_command "taas-bootstrap" "Write image to a remote lab device."
register_command "taas-smoketest" "Write image to a remote lab device and test it."

View File

@@ -163,7 +163,6 @@ function usage {
echo " -x Force install even if firmware is not for this board"
echo " -b Force install of bootloader regardless of version installed"
echo " -r Jump into chroot env of other system"
echo " -f Firmware file to use"
echo " -C \"command\" Execute command in chroot env of other system"
}
@@ -178,64 +177,6 @@ function newroot_exec {
}
function system_is_y_image {
# find out what rootfs volume is active.
cur_vol=$(get_flashbank_current)
upd_vol=$(get_flashbank_next)
# convert volume name "rootfs_$upd_vol" into ubi volume id
upd_ubi_id=$(ubinfo -d 0 -N rootfs_$upd_vol | awk "/Volume ID:/ {print \$3}")
log "installing Root Fileystem into UBI volume rootfs_$upd_vol"
# prepare to match dsl.
function_call upd_conf_dsl
log "now starting writing data to flash with [ iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id ]"
run_cleanup=1 # When we start to actually write data there might be some
# things that need cleanup if we get an error/crash
if ! iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id; then
log "iopupgrade program Failed"
exit 1
fi
log "Firmware programmed to flash."
# Force upgrade of boot loader
[ $upd_forceboot -eq 1 ] && chroot_cmdline="$chroot_cmdline -b"
if [ $upd_keepconfig -eq 1 ]; then
log "Transfering configuration to new system."
chroot_cmdline="$chroot_cmdline -c"
fi
mount_newroot
if ! chroot /tmp/newroot_overlay /sbin/iopu_chroot $chroot_cmdline; then
log "Configuration migration failed!"
exit 1
fi
umount_newroot
log "New firmware fully installed."
run_cleanup=0
# Now make sure that we actually boot the new system on the next reboot
upd_finnish
}
function system_is_FIT_image {
# prepare to match dsl.
#function_call upd_conf_dsl
#here we write data
bcm_flasher $firmware_file
bcm_bootstate 1
log "Firmware programmed to flash."
}
###############################################################################
# just one instance
@@ -253,7 +194,7 @@ trap ctrl_c INT
trap timeout SIGALRM
trap sig_pipe SIGPIPE
while getopts "nrxbhcC:f:" opt; do
while getopts "nrxbhcC:" opt; do
case $opt in
n)
upd_noreboot=1
@@ -275,9 +216,6 @@ while getopts "nrxbhcC:f:" opt; do
newroot_exec "${OPTARG}"
exit
;;
f)
firmware_file="${OPTARG}"
;;
h)
usage
exit 1
@@ -297,18 +235,59 @@ log "Firmware upgrade started"
# Should board name be checked
if [ $upd_forceimage -eq 0 ]
then
board=$(db get hw.board.model_name)
board=$(db get hw.board.iopVerBoard)
cmdline_match="board=$board"
fi
# BUG: should probably read a config file.
if [ -f /proc/nvram/boardid ]
then
system_is_FIT_image
else
system_is_y_image
# find out what rootfs volume is active.
cur_vol=$(get_flashbank_current)
upd_vol=$(get_flashbank_next)
# convert volume name "rootfs_$upd_vol" into ubi volume id
upd_ubi_id=$(ubinfo -d 0 -N rootfs_$upd_vol | awk "/Volume ID:/ {print \$3}")
log "installing Root Fileystem into UBI volume rootfs_$upd_vol"
# prepare to match dsl.
function_call upd_conf_dsl
# prepare to update CFE if it exists
function_call upd_conf_cfe
# prepare to update kernel if it is stored in MTD/JFFS2
function_call upd_conf_kernel
log "now starting writing data to flash with [ iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id ]"
run_cleanup=1 # When we start to actually write data there might be some
# things that need cleanup if we get an error/crash
if ! iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id; then
log "iopupgrade program Failed"
exit 1
fi
log "Firmware programmed to flash."
# Force upgrade of boot loader
[ $upd_forceboot -eq 1 ] && chroot_cmdline="$chroot_cmdline -b"
if [ $upd_keepconfig -eq 1 ]; then
log "Transfering configuration to new system."
chroot_cmdline="$chroot_cmdline -c"
fi
mount_newroot
if ! chroot /tmp/newroot_overlay /sbin/iopu_chroot $chroot_cmdline; then
log "Configuration migration failed!"
exit 1
fi
umount_newroot
log "New firmware fully installed."
run_cleanup=0
# Now make sure that we actually boot the new system on the next reboot
upd_finnish
# spawn the reboot to a subshell to allow the main program to quit before reset
# to avoid any hanged network connection like ssh
if [ $upd_noreboot -eq 0 ]

View File

@@ -11,7 +11,7 @@ PKG_RELEASE:=1
PKG_VERSION:=0.3
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libpicoevent.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=f446f186102539cceedaa15a95a33547ac3c1fd7
PKG_SOURCE_VERSION:=f4ab03b22fca57cec6c959fb5c54bcdd64c32467
PKG_NAME:=libpicoevent
PKG_LICENSE:=LGPL-2.1-only

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-1905
PKG_VERSION:=0.0.16
PKG_VERSION:=0.0.13
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=08363369ba225facad7485d5b1a6a502e620ac21
PKG_SOURCE_VERSION:=31e30c589cb2a522fb66261640ff1a5f8ff58ac4
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-1905.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
endif

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-agent
PKG_VERSION:=3.4.2
PKG_VERSION:=2.0.1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=9edf3ac509a2cf8301a50b38185734d70818262a
PKG_SOURCE_VERSION:=362ddbaf2b9a5510c89b740fcc23d8425770da3d
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_LICENSE:=PROPRIETARY IOPSYS
@@ -23,7 +23,7 @@ define Package/map-agent
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
DEPENDS:=+libwifi +libuci +libubox +ubus +libmaputils +libwsc +libeasy
DEPENDS:=+libwifi +libuci +libubox +ubus
endef
define Package/map-agent/description
@@ -51,7 +51,6 @@ endef
define Package/map-agent/install
$(INSTALL_DIR) $(1)/etc
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/src/utils/*.so* $(1)/usr/lib/

View File

@@ -1,62 +0,0 @@
config wifiagent
option enabled '1'
option debug '6'
option profile '2'
config fh-iface
option ifname 'wl0'
option steer 'rssi bssload'
list exclude '00:11:22:33:44:55'
list exclude_btm '00:aa:bb:cc:dd:ee'
list assoc_ctrl '00:10:20:30:40:50'
option btm_retry '3'
option btm_retry_secs '180'
option fallback_legacy '1'
option steer_legacy_reassoc_secs '30'
option steer_legacy_retry_secs '3600'
option assoc_ctrl_secs '30'
option band '2'
config fh-iface
option ifname 'wl1'
option steer 'rssi bssload'
list exclude '00:11:22:33:44:55'
list exclude_btm '00:aa:bb:cc:dd:ee'
option band '5'
#config bk-iface
# option ifname 'apclii0'
# option enabled '1'
# option onboarded '0'
# option disallow_bsta '1 # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
config steer-param 'rssi'
option priority '0'
option rssi_threshold '-68'
option hysteresis '5'
option margin '3'
option diffsnr '8'
config steer-param 'bssload'
option priority '0'
option bssload_threshold '80'
### custom rules follows ###
config rule-custom
option action steer
option sta 'd8:32:e3:4d:35:d2'
option bss '00:22:07:11:22:33'
config rule-custom
option action restrict
option sta 'd8:32:e3:4d:35:d2'
option bss '00:22:07:11:22:33'
#config bk-iface
# option ifname 'wlan1_1'
#
#config fh-iface
# option ifname 'wlan0'
#
#config fh-iface
# option ifname 'wlan1'

View File

@@ -1,31 +0,0 @@
#!/bin/sh /etc/rc.common
START=98
STOP=20
USE_PROCD=1
start_service() {
config_load "mapagent"
local enabled
config_get_bool enabled agent enabled 1
[ "$enabled" -eq 0 ] && return 1
procd_open_instance
procd_set_param command "/usr/sbin/mapagent" "-d"
procd_set_param respawn
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "ieee1905"
}
reload_service() {
stop
start
}

View File

@@ -5,9 +5,9 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=map-controller
PKG_VERSION:=2.3.1
PKG_VERSION:=1.0.1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=e8afbab1030189b99356aba3f1bfc4adf2d81d5d
PKG_SOURCE_VERSION:=3a55c1f41f0e2c233c28834dea0e881cd2cd0c22
PKG_LICENSE:=PROPRIETARY IOPSYS
PKG_LICENSE_FILES:=LICENSE
@@ -22,7 +22,7 @@ define Package/map-controller
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
DEPENDS:=+libuci +libubox +ubus +libmaputils +libwsc +libeasy
DEPENDS:=+libuci +libubox +ubus
endef
define Package/map-controller/description
@@ -42,7 +42,6 @@ MAKE_PATH:=src
define Package/map-controller/install
$(INSTALL_DIR) $(1)/etc
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapcontroller $(1)/usr/sbin/
endef

View File

@@ -1,111 +0,0 @@
config wificntlr
option enabled '1'
option registrar '5 2' #bands on which wps registrar supported
option debug '6'
config fh-credentials
option band '5'
option encryption 'psk2'
option key '1234567890'
option ssid 'map-net5'
option vlan '101'
config fh-credentials
option band '2'
option encryption 'psk2'
option key '1234567890'
option ssid 'map-net2'
option vlan '0' # 0 - 2 rsvd, 3 - 4094 => vlan id
config bk-credentials
option band '5'
option encryption 'psk2'
option key '5555555555'
option ssid 'map-bkhaul-5'
option multi_ap '2'
# option multi_ap_backhaul_sta '1' # possible future TODO
# option multi_ap_backhaul_key 'multiap_key123' # possible future TODO
# option multi_ap_backhaul_ssid 'MultiAP-0022077E9CD6' # possible future TODO
option disallow_bsta '1' # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
config bk-credentials
option band '2'
option encryption 'psk2'
option key '2222222222'
option ssid 'map-bkhaul-2'
option multi_ap '2'
# option multi_ap_backhaul_sta '1' # possible future TODO
# option multi_ap_backhaul_key 'multiap_key123' # possible future TODO
# option multi_ap_backhaul_ssid 'MultiAP-0022077E9CD6' # possible future TODO
option disallow_bsta '0' # 0 or 1 profile-1 bSTA
config agent-policy
option agent_id '00:22:07:7E:9C:D6' # 1905al macaddress of agent
list steer_exclude '00:11:22:33:44:55'
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
option util_threshold '200' # channel-util as in BSS load
option rcpi_threshold '30' # 0 - 220 valid range
option report_scan '0' # 0 or 1 for independent sc include_sta_metric '0' # sta metric in AP metric resp
option pvid '100' # primary vlan id
option pcp_default '5' # default vlan pcp
option disallow_bsta_p1 '0' # 0 or 1 profile20 valid range
option report_scan '0' # 0 or 1 for independent scans
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
option report_metric_periodic '0' # 0, or 1 - 255 in secs
option report_rcpi_threshold '30' # 0 - 220 valid range
option report_scan '0' # 0 or 1 for independent scans
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
option report_metric_periodic '0' # 0, or 1 - 255 in secs
option report_rcpi_threshold '0' # 0, or 1 - 220
option report_util_threshold '0' # 0, or channel-util value
option include_sta_stats '0' # sta stats in AP metric resp
option include_sta_metric '0' # sta metric in AP metric resp
option pvid '100' # primary vlan id
option pcp_default '5' # default vlan pcp
option disallow_bsta_p1 '0' # 0 or 1 profile-1 bSTA
option disallow_bsta_p2 '0' # 0 or 1 profile-2 bSTA
config agent-policy
option agent_id '00:00:00:00:00:00'
list steer_exclude '00:11:22:33:44:55'
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
option util_threshold '200' # channel-util as in BSS load
option rcpi_threshold '30' # 0 - 220 valid range
option report_scan '0' # 0 or 1 for independent sc include_sta_metric '0' # sta metric in AP metric resp
option pvid '100' # primary vlan id
option pcp_default '5' # default vlan pcp
option disallow_bsta_p1 '0' # 0 or 1 profile20 valid range
option report_scan '0' # 0 or 1 for independent scans
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
option report_metric_periodic '0' # 0, or 1 - 255 in secs
option report_rcpi_threshold '30' # 0 - 220 valid range
option report_scan '0' # 0 or 1 for independent scans
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
option report_metric_periodic '0' # 0, or 1 - 255 in secs
option report_rcpi_threshold '0' # 0, or 1 - 220
option report_util_threshold '0' # 0, or channel-util value
option include_sta_stats '0' # sta stats in AP metric resp
option include_sta_metric '0' # sta metric in AP metric resp
option pvid '100' # primary vlan id
option pcp_default '5' # default vlan pcp
option disallow_bsta_p1 '0' # 0 or 1 profile-1 bSTA
option disallow_bsta_p2 '0' # 0 or 1 profile-2 bSTA
config agent-policy
option agent_id '00:22:07:A3:6C:DA' # 1905al macaddress of agent
list steer_exclude '00:11:22:33:44:55'
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
option util_threshold '200' # channel-util as in BSS load
option report_metric_periodic '0' # 0, or 1 - 255 in secs
option report_rcpi_threshold '0' # 0, or 1 - 220
option report_util_threshold '0' # 0, or channel-util value
option include_sta_stats '0' # sta stats in 3:4d:35:d2'
option bss '00:22:07:11:22:33'
config rule-custom
option action restrict
option sta 'd8:32:e3:4d:35:d2'
option bss '00:22:07:11:22:33'

View File

@@ -1,31 +0,0 @@
#!/bin/sh /etc/rc.common
START=98
STOP=20
USE_PROCD=1
start_service() {
config_load "mapcontroller"
local enabled
config_get_bool enabled controller enabled 1
[ "$enabled" -eq 0 ] && return 1
procd_open_instance
procd_set_param command "/usr/sbin/mapcontroller" "-d"
procd_set_param respawn
# procd_set_param stdout 1
# procd_set_param stderr 1
procd_close_instance
}
service_triggers()
{
procd_add_reload_trigger "ieee1905"
}
reload_service() {
stop
start
}

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2020 IOPSYS
# Copyright (C) 2013 Inteno
#
include $(TOPDIR)/rules.mk

42
natalie-dect-h/Makefile Normal file
View File

@@ -0,0 +1,42 @@
#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=natalie-dect-h
PKG_VERSION:=12.26
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=https://dev.iopsys.eu/dialog/natalie-dect-h.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=f3889dc3f80bed10374f46430009aca24448bdcc
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=PROPRIETARY RTX
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/image.mk
include $(INCLUDE_DIR)/kernel.mk
define Package/natalie-dect-h
SECTION:=net
CATEGORY:=Base system
TITLE:=Dect stack headers
URL:=
endef
define Package/natalie-dect-h/description
Kernel dect driver headers
endef
define Package/natalie-dect-h/install
$(INSTALL_DIR) $(STAGING_DIR)/usr/include/natalie-dect
$(CP) -r $(PKG_BUILD_DIR)/SrcHeaders/* $(STAGING_DIR)/usr/include/natalie-dect/
endef
$(eval $(call BuildPackage,natalie-dect-h))

4
natalie-dect/Config.in Normal file
View File

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

73
natalie-dect/Makefile Normal file
View File

@@ -0,0 +1,73 @@
#
# Copyright (C) 2019 IOPSYS Software Solutions AB
#
include $(TOPDIR)/rules.mk
PKG_NAME:=natalie-dect
PKG_VERSION:=12.26
PKG_SOURCE_VERSION:=378c404fba3efc8f1bcde54370a5370670fa1853
ifeq ($(CONFIG_NATALIE_OPEN),y)
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
PKG_SOURCE:=$(PKG_NAME)-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.iopsys.eu/iopsys/opensdk/
PKG_NAME:=natalie-dect-open
else
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_URL:=https://dev.iopsys.eu/dialog/natalie-dect-12.26.git
PKG_SOURCE_PROTO:=git
endif
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=PROPRIETARY
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/image.mk
include $(INCLUDE_DIR)/kernel.mk
BCM_KERNEL_VERSION=`cat $(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-*/include/config/kernel.release`
export BUILD_DIR
export BCM_KERNEL_VERSION
export CONFIG_BCM_CHIP_ID := $(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
export CONFIG_BCM_KERNEL_PROFILE := $(patsubst "%",%,$(CONFIG_BCM_KERNEL_PROFILE))
export CONFIG_ARCH := $(patsubst "%",%,$(CONFIG_ARCH))
export TOOLS := $(CONFIG_BCM_TOOLCHAIN)/usr/bin/
export TOOLPREFIX := $(CONFIG_BCM_TOOLTUPLE)
export BRCM_MAX_JOBS := $(patsubst "%",%,$(CONFIG_BRCM_MAX_JOBS))
export MAKE_J
export BRCM_VERBOSE := $(if $(findstring c,$(OPENWRT_VERBOSE)),1,)
export PKG_BUILD_DIR
export BCM_SDK_PATH := $(BUILD_DIR)/bcmkernel/bcm963xx
define Package/natalie-dect
SECTION:=net
CATEGORY:=Base system
TITLE:=Dect stack
URL:=
DEPENDS:=bcmkernel
endef
define Package/natalie-dect/config
source "$(SOURCE)/Config.in"
endef
define Package/natalie-dect/description
Kernel dect driver
endef
ifeq ($(CONFIG_NATALIE_OPEN),y)
define Build/Compile
endef
endif
define Package/natalie-dect/install
$(INSTALL_DIR) $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra
$(CP) $(PKG_BUILD_DIR)/dect.ko $(1)/lib/modules/$(BCM_KERNEL_VERSION)/extra/dect.ko
endef
$(eval $(call BuildPackage,natalie-dect))

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=obuspa
PKG_VERSION:=3.0.0.12
PKG_VERSION:=2.0.22
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=bc1dba1efe9ec49f468592359d03895f45699abf
PKG_SOURCE_VERSION:=06270b7a45b77d6d883eb244e6d854efce10f17f
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
endif
@@ -22,13 +22,14 @@ PKG_FIXUP:=autoreconf
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/obuspa
SECTION:=utils
CATEGORY:=Utilities
TITLE:=USP agent
DEPENDS:=+libopenssl +libcurl +libsqlite3 +libubox +libubus +uspd +libmosquitto
DEPENDS:=+libcoap +libopenssl +libcurl +libsqlite3 +libcares +libubox +libubus +libblobmsg-json +uspd
endef
define Package/obuspa/description
@@ -37,7 +38,18 @@ endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-D_GNU_SOURCE
-D_GNU_SOURCE \
-Wall \
-Wextra \
-fstrict-aliasing \
-Werror=format-overflow \
-Wno-error=unused-parameter \
-Wno-error=sign-compare
ifneq ($(CONFIG_USE_MUSL),)
TARGET_CFLAGS += -DUSE_MUSL
endif
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
@@ -50,11 +62,9 @@ define Package/obuspa/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/obuspa
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-obuspa $(1)/etc/hotplug.d/iface/
endef
$(eval $(call BuildPackage,obuspa))

View File

@@ -1,43 +1,44 @@
config obuspa 'global'
option enabled 'true'
# controller, mtp, connection makes a group and related to one another
# ex: first controller will be mapped to first mtp and first connection
# details, always defined in groups
config obuspa
option enable 'true'
option cert '/etc/obuspa/rootCA.pem'
option interface 'wan'
#option ifname 'eth0.1'
option debug 'false'
option log_level '1'
#option db_file '/tmp/usp.db'
#option trust_cert '/etc/obuspa/rootCA.pem'
#option client_cert '/etc/obuspa/client.pem'
#option log_dest '/var/log/obuspa'
config localagent 'localagent'
option Enable 'true'
config controller
option endpointid 'self::usp-controller.com'
option enable 'true'
# Trust cerificate number
option AssignedRole 1
option PeriodicNotifInterval "86400"
option PeriodicNotifTime "0001-01-01T00:00:00Z"
option USPRetryMinimumWaitInterval "5"
option USPRetryIntervalMultiplier "2000"
option ControllerCode ""
option protocol 'STOMP'
# Adds Device.LocalAgent.Controller.
config controller 'localcontroller'
option EndpointID 'proto::interop-usp-controller'
option Protocol 'MQTT'
option Topic '/usp/controller'
option mqtt 'localmqtt'
# Adds Device.LocalAgent.MTP.
config mtp
option Protocol 'MQTT'
option ResponseTopicConfigured '/usp/endpoint'
option mqtt 'localmqtt'
option enable 'true'
option protocol 'STOMP'
option destination ''
# Adds Device.MQTT.Client.
config mqtt 'localmqtt'
option BrokerAddress '127.0.0.1'
option BrokerPort '1883'
option TransportProtocol 'TCP/IP'
option Username 'admin'
option Password 'admin'
# Add Device.LocalAgent.Subscription.
config subscription
option ID 'default-boot-event-ACS'
option NotifType 'Event'
option ReferenceList 'Device.Boot!'
option Persistent 'true'
option controller 'localcontroller'
config connection
option host 'usp-controller.com'
option username 'username'
option password 'password'
option encryption 'true'
option enable 'true'
option port 61613
option virtualhost '/'
option EnableHeartbeats "true"
option OutgoingHeartbeat "30000"
option IncomingHeartbeat "300000"
option ServerRetryInitialInterval "60"
option ServerRetryIntervalMultiplier "2000"
option ServerRetryMaxInterval "30720"

View File

@@ -1,9 +0,0 @@
#!/bin/sh
[ "$(uci -q get obuspa.global.interface)" == "$INTERFACE" ] || exit 0
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" ] && exit 0
/etc/init.d/obuspa reload

View File

@@ -2,23 +2,14 @@
START=99
USE_PROCD=1
PROG=/usr/sbin/obuspa
EXTRA_COMMANDS="remove_db"
EXTRA_HELP=" remove_db Removes obuspa persistent db before restarting"
l3device=""
certificate=""
PARAM_FILE="/tmp/obuspa_param_reset.txt"
CONFIGURATION=obuspa
KEEP_FILES="/lib/upgrade/keep.d/obuspa"
USP_TEMP_FILE="/tmp/usp.tmp"
controller_num=0
mtp_num=0
stomp_num=0
mqtt_num=0
subs_num=0
index=0
. /lib/functions/network.sh
conn_num=1
mtp_num=1
stomp_num=1
log() {
echo "${@}"|logger -t obuspa -p debug
@@ -32,113 +23,54 @@ db_set() {
fi
}
get_index() {
index=$(( index + 1 ))
if [ "$1" = "$2" ]; then
echo "${index}" > ${USP_TEMP_FILE}
fi
}
get_uci_ref_index() {
local val;
[ -f ${USP_TEMP_FILE} ] && rm -f ${USP_TEMP_FILE}
index=0
config_load $CONFIGURATION
config_foreach get_index $1 $2
val=$(cat ${USP_TEMP_FILE})
if [ -z $val ]; then
val=0
fi
rm -f ${USP_TEMP_FILE}
echo $val
}
validate_obuspa_section()
{
uci_validate_section ${CONFIGURATION} obuspa "${1}" \
'enabled:bool:true' \
'trust_cert:string' \
'client_cert:string' \
'interface:string' \
'ifname:string:"br-lan"' \
uci_validate_section obuspa obuspa "${1}" \
'enable:bool:true' \
'cert:string:"/etc/obuspa/rootCA.pem"' \
'interface:string:wan' \
'debug:bool:false' \
'log_level:uinteger' \
'log_dest:string' \
'db_file:string'
}
validate_localagent_section()
{
uci_validate_section ${CONFIGURATION} localagent "${1}" \
'Enable:bool:true' \
'ParameterName:string:Device.DeviceInfo.SoftwareVersion' \
'EndpointID:string'
'log_level:uinteger:2' \
'log_dest:string:stdout'
}
validate_controller_section()
{
uci_validate_section ${CONFIGURATION} controller "${1}" \
'EndpointID:string' \
'Enable:bool:true' \
'AssignedRole:string:Device.LocalAgent.ControllerTrust.Role.1' \
uci_validate_section obuspa controller "${1}" \
'endpointid:string:"self:usp-controller.com"' \
'enable:bool:true' \
'AssignedRole:uinteger:1' \
'PeriodicNotifInterval:uinteger:86400' \
'PeriodicNotifTime:string' \
'USPNotifRetryMinimumWaitInterval:uinteger:5' \
'USPNotifRetryIntervalMultiplier:uinteger:2000' \
'PeriodicNotifTime:string:"0001-01-01T00:00:00Z"' \
'USPRetryMinimumWaitInterval:uinteger:5' \
'USPRetryIntervalMultiplier:uinteger:2000' \
'ControllerCode:string' \
'Protocol:or("STOMP","CoAP","MQTT")' \
'Reference:string' \
'Destination:string:controller-notify-dest' \
'Topic:string' \
'coap_host:string' \
'coap_path:string' \
'coap_port:uinteger' \
'mqtt:string' \
'stomp:string'
}
validate_subscription_section()
{
uci_validate_section ${CONFIGURATION} subscription "${1}" \
'Enable:bool:true' \
'ID:string' \
'NotifType:string' \
'ReferenceList:string' \
'Persistent:bool:true' \
'Recipient:string' \
'controller:string'
'protocol:or("STOMP","CoAP")' \
'CoAPHost:string' \
'CoAPPath:string' \
'CoAPPort:uinteger'
}
validate_mtp_section()
{
uci_validate_section ${CONFIGURATION} mtp "${1}" \
'Enable:bool:true' \
'Protocol:or("STOMP","CoAP","MQTT")' \
'Reference:string' \
'ResponseTopicConfigured:string' \
'PublishQoS:uinteger' \
'Destination:string' \
'coap_path:string' \
'coap_port:uinteger' \
'mqtt:string' \
'stomp:string'
uci_validate_section obuspa mtp "${1}" \
'enable:bool:true' \
'protocol:or("STOMP","CoAP")' \
'destination:string' \
'CoAPPath:string' \
'CoAPPort:uinteger'
}
validate_stomp_connection_section()
validate_connection_section()
{
uci_validate_section ${CONFIGURATION} stomp "${1}" \
'Host:string:usp-controller.com' \
'Username:string' \
'Password:string' \
uci_validate_section obuspa connection "${1}" \
'host:string:"usp-controller.com"' \
'username:string:""' \
'password:string:""' \
'encryption:bool:true' \
'Enable:bool:true' \
'Port:uinteger:61613' \
'VirtualHost:string:/' \
'enable:bool:true' \
'port:uinteger:61613' \
'virtualhost:string:"/"' \
'EnableHeartbeats:bool:true' \
'OutgoingHeartbeat:uinteger:30000' \
'IncomingHeartbeat:uinteger:300000' \
@@ -147,227 +79,82 @@ validate_stomp_connection_section()
'ServerRetryMaxInterval:uinteger:30720'
}
validate_mqtt_client_section()
{
uci_validate_section ${CONFIGURATION} mqtt "${1}" \
'BrokerAddress:string' \
'BrokerPort:uinteger:1883' \
'Enable:bool:true' \
'Username:string' \
'Password:string' \
'ProtocolVersion:string:5.0' \
'TransportProtocol:string:TCP/IP' \
'KeepAliveTime:uinteger:60' \
'ClientID:string' \
'ConnectRetryTime:uinteger:5' \
'ConnectRetryIntervalMultiplier:uinteger:2000' \
'ConnectRetryMaxInterval:uinteger:60'
}
configure_localagent() {
local Enable ParameterName EndpointID
local _num
validate_localagent_section 'localagent' || {
log "Validation of localagent section failed"
return 1;
}
if [ -n "${EndpointID}" ]; then
db_set Device.LocalAgent.EndpointID "${EndpointID}"
fi
_num=1
while [ ${_num} -le ${controller_num} ]
do
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.Alias "cpe-1"
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.Enable "${Enable}"
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.ParameterName "${ParameterName}"
_num=$(( ${_num} + 1 ))
done
db_set
}
configure_controller() {
local EndpointID Enable AssignedRole PeriodicNotifInterval PeriodicNotifTime USPNotifRetryMinimumWaitInterval
local USPNotifRetryIntervalMultiplier ControllerCode Protocol Destination coap_host coap_path coap_port
local Reference Topic mqtt stomp
local endpointid enable AssignedRole PeriodicNotifInterval PeriodicNotifTime USPRetryMinimumWaitInterval
local USPRetryIntervalMultiplier ControllerCode protocol CoAPHost CoAPPath CoAPPort
validate_controller_section "${1}" || {
log "Validation of controller section failed"
log "Validation of section failed"
return 1;
}
if [ -z ${EndpointID} -o -z ${Protocol} ]; then
log "controller:: EndpointID id and Protocol cannot be empty"
return 1;
fi
if [ -z "${stomp}" -a -z "${Reference}" -a -z "${mqtt}" -a -z "${coap_path}" ]; then
log "controller:: Invalid configuration"
return 1;
fi
if [ -z ${Reference} ]; then
if [ ${Protocol} = "STOMP" ]; then
val=$(get_uci_ref_index stomp ${stomp})
if [ ${val} -eq 0 ]; then
log "Not able to find the referred stomp section"
return 1;
fi
Reference="Device.STOMP.Connection.${val}"
elif [ ${Protocol} = "MQTT" ]; then
val=$(get_uci_ref_index mqtt ${mqtt})
if [ ${val} -eq 0 ]; then
log "Not able to find the referred mqtt section"
return 1;
fi
Reference="Device.MQTT.Client.${val}"
fi
fi
controller_num=$(( controller_num + 1 ))
db_set Device.LocalAgent.Controller.${controller_num}.Alias "cpe-${controller_num}"
db_set Device.LocalAgent.Controller.${controller_num}.Enable "${Enable}"
db_set Device.LocalAgent.Controller.${controller_num}.EndpointID "${EndpointID}"
#db_set Device.LocalAgent.Controller.${controller_num}.AssignedRole "${AssignedRole}"
db_set Device.LocalAgent.Controller.${controller_num}.PeriodicNotifInterval "${PeriodicNotifInterval}"
if [ -n "${PeriodicNotifTime}" ]; then
db_set Device.LocalAgent.Controller.${controller_num}.PeriodicNotifTime "${PeriodicNotifTime}"
db_set Device.LocalAgent.Controller.${conn_num}.EndpointID "${endpointid}"
db_set Device.LocalAgent.Controller.${conn_num}.Alias "cpe-${conn_num}"
db_set Device.LocalAgent.Controller.${conn_num}.Enable "true"
db_set Device.LocalAgent.Controller.${conn_num}.AssignedRole "Device.LocalAgent.ControllerTrust.Role.${AssignedRole}"
db_set Device.LocalAgent.Controller.${conn_num}.PeriodicNotifInterval "${PeriodicNotifInterval}"
db_set Device.LocalAgent.Controller.${conn_num}.PeriodicNotifTime "${PeriodicNotifTime}"
db_set Device.LocalAgent.Controller.${conn_num}.USPRetryMinimumWaitInterval "${USPRetryMinimumWaitInterval}"
db_set Device.LocalAgent.Controller.${conn_num}.USPRetryIntervalMultiplier "${USPRetryIntervalMultiplier}"
db_set Device.LocalAgent.Controller.${conn_num}.ControllerCode "${ControllerCode}"
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.Alias "cpe-${conn_num}"
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.Enable "${enable}"
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.Protocol "${protocol}"
if [ "${protocol}"=="STOMP" ]; then
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.STOMP.Reference "Device.STOMP.Connection.${conn_num}"
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.STOMP.Destination "controller-notify-dest"
elif [ "${protocol}"=="CoAP" ]; then
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.CoAP.Host "${CoAPHost}"
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.CoAP.Path "${CoAPPath}"
db_set Device.LocalAgent.Controller.${conn_num}.MTP.${conn_num}.CoAP.Port "${CoAPPort}"
else
db_set Device.LocalAgent.Controller.${controller_num}.PeriodicNotifTime "0001-01-01T00:00:00Z"
log "Unsupported protocol ${protocol}"
fi
db_set Device.LocalAgent.Controller.${controller_num}.USPNotifRetryMinimumWaitInterval "${USPNotifRetryMinimumWaitInterval}"
db_set Device.LocalAgent.Controller.${controller_num}.USPNotifRetryIntervalMultiplier "${USPNotifRetryIntervalMultiplier}"
db_set Device.LocalAgent.Controller.${controller_num}.ControllerCode "${ControllerCode}"
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.Alias "cpe-${controller_num}"
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.Enable "${Enable}"
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.Protocol "${Protocol}"
# only support configuration of one mtp path per controller using uci
if [ "${Protocol}" = "MQTT" ]; then
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.MQTT.Reference "${Reference}"
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.MQTT.Topic "${Topic}"
elif [ "${Protocol}" = "STOMP" ]; then
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.STOMP.Reference "${Reference}"
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.STOMP.Destination "${Destination}"
elif [ "${Protocol}" = "CoAP" ]; then
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Host "${coap_host}"
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Path "${coap_path}"
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Port "${coap_port}"
else
log "Unsupported Protocol ${Protocol}"
fi
db_set
}
configure_subscription(){
local ID Enable NotifType ReferenceList Persistent Recipient
local controller
validate_subscription_section "${1}" || {
log "Validation of subscription section failed"
return 1;
}
if [ -z "${Recipient}" -a -z "${controller}" ]; then
log "No recipient for subscription"
fi
if [ -z ${Recipient} ]; then
val=$(get_uci_ref_index controller ${controller})
if [ ${val} -eq 0 ]; then
log "Not able to find the referred controller section"
return 1;
fi
Recipient="Device.LocalAgent.Controller.${val}"
fi
subs_num=$(( subs_num + 1))
db_set Device.LocalAgent.Subscription.${subs_num}.Alias "cpe-${subs_num}"
db_set Device.LocalAgent.Subscription.${subs_num}.Enable "${Enable}"
db_set Device.LocalAgent.Subscription.${subs_num}.ID "${ID}"
db_set Device.LocalAgent.Subscription.${subs_num}.NotifType "${NotifType}"
db_set Device.LocalAgent.Subscription.${subs_num}.ReferenceList "${ReferenceList}"
db_set Device.LocalAgent.Subscription.${subs_num}.Persistent "${Persistent}"
db_set Device.LocalAgent.Subscription.${subs_num}.Recipient "${Recipient}"
conn_num=$((conn_num+1))
}
configure_mtp() {
local Enable Protocol Reference ResponseTopicConfigured PublishQoS
local stomp mqtt
local protocol enable destination CoAPPath CoAPPort
validate_mtp_section "${1}" || {
log "Validation of mtp section failed"
log "Validation of section failed"
return 1;
}
if [ -z ${Reference} ]; then
if [ ${Protocol} = "STOMP" ]; then
val=$(get_uci_ref_index stomp ${stomp})
if [ ${val} -eq 0 ]; then
log "Referred stomp section not found"
return 1;
fi
Reference="Device.STOMP.Connection.${val}"
elif [ ${Protocol} = "MQTT" ]; then
val=$(get_uci_ref_index mqtt ${mqtt})
if [ ${val} -eq 0 ]; then
log "Referred mqtt section not found"
return 1;
fi
Reference="Device.MQTT.Client.${val}"
fi
fi
mtp_num=$(( mtp_num + 1 ))
db_set Device.LocalAgent.MTP.${mtp_num}.Alias "cpe-${mtp_num}"
db_set Device.LocalAgent.MTP.${mtp_num}.Enable "${Enable}"
db_set Device.LocalAgent.MTP.${mtp_num}.Protocol "${Protocol}"
if [ "${Protocol}" = "MQTT" ]; then
db_set Device.LocalAgent.MTP.${mtp_num}.MQTT.Reference "${Reference}"
db_set Device.LocalAgent.MTP.${mtp_num}.MQTT.ResponseTopicConfigured "${ResponseTopicConfigured}"
if [ -n "${PublishQoS}" ]; then
db_set Device.LocalAgent.MTP.${mtp_num}.MQTT.PublishQoS "${PublishQoS}"
fi
elif [ "${Protocol}" = "STOMP" ]; then
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Reference "${Reference}"
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Destination "${Destination}"
elif [ "${Protocol}" = "CoAP" ]; then
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Path "${coap_path}"
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Port "${coap_port}"
db_set Device.LocalAgent.MTP.${mtp_num}.Enable "${enable}"
db_set Device.LocalAgent.MTP.${mtp_num}.Protocol "${protocol}"
if [ "${protocol}"=="STOMP" ]; then
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Reference "Device.STOMP.Connection.${mtp_num}"
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Destination "${destination}"
elif [ "${protocol}"=="CoAP" ]; then
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Path "${CoAPPath}"
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Port "${CoAPPort}"
else
log "Unsupported Protocol ${Protocol} in mtp"
log "Unsupported protocol ${protocol}"
fi
db_set
mtp_num=$((mtp_num+1))
}
configure_stomp_connection() {
local Host Username Password Enable Port VirtualHost EnableHeartbeats
configure_connection() {
local host username password encryption enable port virtualhost EnableHeartbeats
local OutgoingHeartbeat IncomingHeartbeat ServerRetryInitialInterval
local ServerRetryIntervalMultiplier ServerRetryMaxInterval
local encryption
validate_stomp_connection_section "${1}" || {
log "Validation of stomp section failed"
validate_connection_section "${1}" || {
log "Validation of section failed"
return 1;
}
stomp_num=$(( stomp_num + 1 ))
db_set Device.STOMP.Connection.${stomp_num}.Host "${Host}"
db_set Device.STOMP.Connection.${stomp_num}.Username "${Username}"
db_set Device.STOMP.Connection.${stomp_num}.Password "${Password}"
db_set Device.STOMP.Connection.${stomp_num}.Host "${host}"
db_set Device.STOMP.Connection.${stomp_num}.Username "${username}"
db_set Device.STOMP.Connection.${stomp_num}.Password "${password}"
db_set Device.STOMP.Connection.${stomp_num}.Alias "cpe-${stomp_num}"
db_set Device.STOMP.Connection.${stomp_num}.Enable "${Enable}"
db_set Device.STOMP.Connection.${stomp_num}.Port "${Port}"
db_set Device.STOMP.Connection.${stomp_num}.Enable "${enable}"
db_set Device.STOMP.Connection.${stomp_num}.Port "${port}"
db_set Device.STOMP.Connection.${stomp_num}.X_ARRIS-COM_EnableEncryption "${encryption}"
db_set Device.STOMP.Connection.${stomp_num}.VirtualHost "${VirtualHost}"
db_set Device.STOMP.Connection.${stomp_num}.VirtualHost "${virtualhost}"
db_set Device.STOMP.Connection.${stomp_num}.EnableHeartbeats "${EnableHeartbeats}"
db_set Device.STOMP.Connection.${stomp_num}.OutgoingHeartbeat "${OutgoingHeartbeat}"
db_set Device.STOMP.Connection.${stomp_num}.IncomingHeartbeat "${IncomingHeartbeat}"
@@ -375,51 +162,20 @@ configure_stomp_connection() {
db_set Device.STOMP.Connection.${stomp_num}.ServerRetryIntervalMultiplier "${ServerRetryIntervalMultiplier}"
db_set Device.STOMP.Connection.${stomp_num}.ServerRetryMaxInterval "${ServerRetryMaxInterval}"
db_set
stomp_num=$((stomp_num+1))
}
configure_mqtt_client(){
local BrokerAddress BrokerPort Enable Username Password ProtocolVersion KeepAliveTime
local TransportProtocol ConnectRetryTime ConnectRetryMaxInterval ConnectRetryIntervalMultiplier
validate_mqtt_client_section "${1}" || {
log "Validation of mqtt section failed"
return 1;
}
if [ -z "${BrokerAddress}" ]; then
log "Broker address can not be empty for mqtt"
return 1;
fi
mqtt_num=$(( mqtt_num + 1 ))
db_set Device.MQTT.Client.${mqtt_num}.Alias "cpe-${mqtt_num}"
db_set Device.MQTT.Client.${mqtt_num}.Enable "${Enable}"
db_set Device.MQTT.Client.${mqtt_num}.BrokerAddress "${BrokerAddress}"
db_set Device.MQTT.Client.${mqtt_num}.BrokerPort "${BrokerPort}"
db_set Device.MQTT.Client.${mqtt_num}.Username "${Username}"
db_set Device.MQTT.Client.${mqtt_num}.Password "${Password}"
db_set Device.MQTT.Client.${mqtt_num}.ProtocolVersion "${ProtocolVersion}"
db_set Device.MQTT.Client.${mqtt_num}.TransportProtocol "${TransportProtocol}"
db_set Device.MQTT.Client.${mqtt_num}.KeepAliveTime "${KeepAliveTime}"
db_set Device.MQTT.Client.${mqtt_num}.ClientID "${ClientID}"
db_set Device.MQTT.Client.${mqtt_num}.ConnectRetryTime "${ConnectRetryTime}"
db_set Device.MQTT.Client.${mqtt_num}.ConnectRetryIntervalMultiplier "${ConnectRetryIntervalMultiplier}"
db_set Device.MQTT.Client.${mqtt_num}.ConnectRetryMaxInterval "${ConnectRetryMaxInterval}"
db_set
}
configure_obuspa() {
local enabled trust_cert ifname interface debug log_level db_file log_dest
local enable cert interface debug log_level log_dest
validate_obuspa_section "global" || {
log "Validation of global section failed"
validate_obuspa_section "${1}" || {
log "Validation of section failed"
return 1;
}
[ ${enabled} -eq 0 ] && exit 0
[ ${enable} -eq 0 ] && \
echo "obuspa not enabled" >>/dev/console && \
exit
if [ ${debug} -eq 1 ]; then
# Forward stdout of the command to logd
@@ -428,112 +184,42 @@ configure_obuspa() {
procd_set_param stderr 1
procd_append_param command -p
fi
procd_append_param command -v ${log_level} -l ${log_dest}
if [ -n ${log_level} ]; then
procd_append_param command -v ${log_level}
fi
# Get wan L3 interface
json_load "$(ubus -t 2 call network.interface.${interface} status)"
json_get_var l3device l3_device
export USP_BOARD_IFNAME=${l3device}
if [ -n "${log_dest}" ]; then
procd_append_param command -l ${log_dest}
fi
# Set this variable for root user
grep -q USP_BOARD_IFNAME /root/.profile || \
echo "export USP_BOARD_IFNAME=${l3device}" >> /root/.profile
if [ -n "${interface}" ]; then
network_get_device ifname ${interface}
log "ifname from ${interface} is ${ifname}"
fi
[ -f $cert ] && certificate=$cert
# Set this variable for root user and obuspa -c tool
grep -q "export USP_BOARD_IFNAME=${ifname}" /root/.profile || \
echo "export USP_BOARD_IFNAME=${ifname}" >> /root/.profile
if [ -n "${db_file}" ]; then
echo "${db_file}" >>${KEEP_FILES}
procd_append_param command -f ${db_file}
fi
if [ -n "${trust_cert}" ]; then
echo "${trust_cert}" >>${KEEP_FILES}
if [ -f "${trust_cert}" ]; then
procd_append_param command -t ${trust_cert}
fi
fi
if [ -n "${client_cert}" ]; then
echo "${client_cert}" >>${KEEP_FILES}
if [ -f "${client_cert}" ]; then
procd_append_param command -a ${client_cert}
fi
fi
procd_set_param env USP_BOARD_IFNAME=${ifname}
}
# Create factory reset file
db_init() {
[ -f ${PARAM_FILE} ] && rm -f ${PARAM_FILE}
[ -f /tmp/usp.db ] && rm -f /tmp/usp.db
[ -f ${KEEP_FILES} ] && rm -f ${KEEP_FILES}
# Load configuration
config_load $CONFIGURATION
config_load obuspa
config_foreach configure_obuspa obuspa
config_foreach configure_controller controller
config_foreach configure_localagent localagent
config_foreach configure_connection connection
config_foreach configure_mtp mtp
config_foreach configure_stomp_connection stomp
config_foreach configure_mqtt_client mqtt
config_foreach configure_subscription subscription
db_set Internal.Reboot.Cause "LocalFactoryReset"
}
# if uci changes for obuspa remove persistent db and then reload
remove_db() {
local db_file
config_load obuspa
config_get db_file global db_file
log "Removing db file (${db_file})"
[ -f ${db_file} ] && rm -f ${db_file}
sed -i "g/export USP_BOARD_IFNAME/d" /root/.profile
log "Restarting service"
stop
start
}
service_running() {
local AgentEndpointID serial oui
ubus -t 10 wait_for usp.raw
config_load obuspa
config_get AgentEndpointID localagent EndpointID ""
if [ -z "${AgentEndpointID}" ]; then
serial=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.SerialNumber"}'|jsonfilter -e '@["parameters"][0].value')
oui=$(ubus -t 1 call usp.raw get '{"path":"Device.DeviceInfo.ManufacturerOUI"}'|jsonfilter -e '@["parameters"][0].value')
AgentEndpointID="os::${oui}-${serial}"
fi
# publish Agent's EndpointID in mosquito broker for discovery
# This is a work around till obuspa does not support advertising
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}"
procd_running ${CONFIGURATION}
}
start_service() {
procd_open_instance ${CONFIGURATION}
procd_open_instance obuspa
procd_set_param env USP_BOARD_IFNAME=${l3device}
procd_set_param command ${PROG}
db_init
procd_append_param command -r ${PARAM_FILE}
procd_set_param respawn \
${respawn_threshold:-5} \
${respawn_timeout:-10} ${respawn_retry:-3}
procd_set_param watch usp.raw
if [ -f "${certificate}" ]; then
procd_append_param command -t ${certificate}
fi
procd_set_param respawn
procd_close_instance
}
@@ -547,33 +233,5 @@ reload_service() {
}
service_triggers() {
procd_add_reload_trigger "uspd" "mosquitto"
procd_add_config_trigger "config.change" "${CONFIGURATION}" /etc/init.d/obuspa remove_db
# Create a reload trigger if schema update avaialble
procd_open_trigger
json_add_array
json_add_string "" "usp.raw"
json_add_array
json_add_string "" "if"
json_add_array
json_add_string "" "eq"
json_add_string "" "action"
json_add_string "" "schema_update_available"
json_close_array
json_add_array
json_add_string "" "run_script"
json_add_string "" "/etc/init.d/obuspa"
json_add_string "" "reload"
json_close_array
json_close_array
json_add_int "" "1000"
json_close_array
procd_close_trigger
# local interface
# config_load obuspa
# config_get interface global interface
# [ -n "$interface" ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/obuspa reload
procd_add_config_trigger "config.change" "obuspa" /etc/init.d/obuspa restart
}

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2020 IOPSYS
# Copyright (C) 2013 Inteno
#
include $(TOPDIR)/rules.mk

View File

@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
PKG_VERSION:=1.0.5
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=dd4a72aca663bf3c9a57f20e889e43a55d3da1b3
PKG_SOURCE_VERSION:=0513e171013512bc14ef8b650c715e3fd9c59820
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
@@ -51,7 +51,7 @@ TARGET_CFLAGS := \
PERIPHERAL_OPTONS:=-DSELECT_BRCM_BOARD=0
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm)$(CONFIG_TARGET_iopsys_brcm63xx_mips),)
PERIPHERAL_OPTONS:= -DSELECT_BRCM_BOARD=1
endif

View File

@@ -33,6 +33,8 @@ populate_config(){
done
uci commit ports
[ $DEBUG ] && cat /etc/config/ports
}
[ -f /sbin/db -a -f /etc/board-db/config/hw ] && populate_config
[ -f /sbin/db -a -f /lib/db/config/hw ] && populate_config

View File

@@ -1,54 +0,0 @@
#
# Copyright (C) 2020 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=prj-unish
PKG_VERSION:=0.1.0
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=3180908081492a6cfc11adbcf80845dbba12633a
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/prj-unish.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/prj-unish
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Project unish
DEPENDS:=+libwifi +libuci +libubox +ubus +libpthread +libnl-genl
endef
define Package/prj-unish/description
This package provides unish-paanch.
endef
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
MAKE_PATH:=src
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/prj-unish/ $(PKG_BUILD_DIR)/
endef
endif
define Package/prj-unish/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/i1905d $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,prj-unish))

View File

@@ -1,23 +0,0 @@
config ieee1905 'ieee1905'
option enabled '1'
option extension 0
#option macaddress 'ba:c9:a6:90:6c:b0'
option registrar '2 5'
config ap
option band '2'
option ssid 'TestSSID'
option encryption 'psk2'
option key '1234567890'
config ap
option band '5'
option ssid 'TestSSID'
option encryption 'psk2'
option key '1234567890'
config al-iface
option enabled 1
option ifname 'br-lan'
option type 'bridge'

View File

@@ -8,15 +8,8 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=qosmngr
PKG_VERSION:=1.0.0
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=03df56c6eb7c6737ce95576e89c915df77396953
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
endif
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
@@ -26,24 +19,22 @@ define Package/qosmngr
SECTION:=utils
CATEGORY:=Utilities
TITLE:=QoS Manager
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm) +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm)
endef
define Package/qosmngr/description
Configures L2 QoS and collects queue statistics
endef
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
$(CP) -rf ./qosmngr/* $(PKG_BUILD_DIR)/
#define Build/Prepare
# $(CP) -rf ./qosmngr/* $(PKG_BUILD_DIR)/
#endef
define Build/Compile
endef
endif
define Package/qosmngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/qosmngr $(1)/usr/sbin
endef
$(eval $(call BuildPackage,qosmngr))

View File

@@ -4,23 +4,18 @@
# include /lib/qos
START=21
STOP=10
USE_PROCD=1
NAME=qosmngr
PROG=/usr/sbin/qosmngr
. /lib/functions.sh
include /lib/qos
start_service() {
if [ -f "/etc/config/qos" ]; then
reload_qos
procd_open_instance qosmngr
procd_set_param command ${PROG}
procd_set_param respawn
procd_close_instance
ubus -S call qos reload
fi
}
stop() {

View File

@@ -24,17 +24,15 @@ generate_queue(){
fi
i=0
local total_q=$((${no_of_q##* } + 1))
for i in $no_of_q; do
order=$((total_q - i))
uci add qos queue
uci rename qos.@queue[-1]="q_${i}_${ifname}"
uci set qos.@queue[-1].enable="1"
uci set qos.@queue[-1].ifname="$ifname"
uci set qos.@queue[-1].precedence="$order"
uci set qos.@queue[-1].precedence="$i"
uci set qos.@queue[-1].scheduling="SP"
uci set qos.@queue[-1].rate="0"
uci set qos.@queue[-1].burst_size="0"
uci set qos.@queue[-1].burst_size="-1"
uci set qos.@queue[-1].weight="1"
done

View File

@@ -3,144 +3,30 @@
IP_RULE=""
BR_RULE=""
is_bcm968=0
POLICER_SKIP=0
POLICER_COUNT=0
INTF_NAME=""
Q_COUNT=0
ITER=0
PREV_ORDER=""
CURR_ORDER=""
MAX_ORDER=""
# Function to handle a queue order and
# update total number of queues
handle_q_order() {
qid="$1" #queue section ID
config_get is_enable "$qid" "enable"
# No need to configure disabled queues
if [ $is_enable == '0' ]; then
return
fi
config_get ifname "$qid" "ifname"
# If ifname is empty that is good enough to break
if [ -z "$ifname" ];then
return
fi
# Create precedence file containing queue order per
# interface.
local precedence_file="/tmp/qos/$ifname/q_order"
local q_no=$(cat /tmp/qos/queue_stats/$ifname/q_idx)
config_get precedence "$qid" "precedence"
value=${precedence}_q${q_no}
echo $value >> $precedence_file
# Update the number of queues per interface.
q_no=$((q_no + 1))
echo $q_no > /tmp/qos/queue_stats/$ifname/q_idx
}
# Function to check if values are greater than (total number
# of queue -1) and map them to corresponding value.
configure_precedence_to_file() {
order="$1"
line="$2"
order_file="$3"
if [ $order == $PREV_ORDER ]; then
queue_id=${line#*_}
val=${CURR_ORDER}_${queue_id}
echo $val >> $order_file
else
PREV_ORDER=$order
queue_id=${line#*_}
val=${MAX_ORDER}_${queue_id}
echo $val >> $order_file
CURR_ORDER=$MAX_ORDER
MAX_ORDER=$((MAX_ORDER - 1))
fi
}
# Fucntion to map queue precedence per interface
# ranging from 1-X to 0-(no of queues -1)
map_queue_precedence() {
ifname="$1"
total_q=$(cat /tmp/qos/queue_stats/$ifname/q_idx)
q_no=`expr $total_q - 1`
MAX_ORDER=$q_no
local precedence_file="/tmp/qos/$ifname/q_precedence"
local order_file="/tmp/qos/$ifname/q_order"
sort -n -r -k1 $order_file >> $precedence_file
rm $order_file
while read line
do
order=${line%_*}
if [ $order -gt $q_no ]; then
ITER=$((ITER + 1))
configure_precedence_to_file $order $line $order_file
else
if [ $ITER == '0' ]; then
echo $line >> $order_file
else
configure_precedence_to_file $order $line $order_file
fi
fi
done < $precedence_file
}
map_precedence() {
for interf in $(db -q get hw.board.ethernetPortOrder); do
map_queue_precedence $interf
done
}
# function to handle a queue section
#function to handle a queue section
handle_queue() {
qid="$1" #queue section ID
config_get is_enable "$qid" "enable"
# no need to configure disabled queues
#no need to configure disabled queues
if [ $is_enable == '0' ]; then
return
fi
config_get ifname "$qid" "ifname"
# if ifname is empty that is good enough to break
#if ifname is empty that is good enough to break
if [ -z "$ifname" ];then
return
fi
# This is to get the qid per interface.
if [ $INTF_NAME == $ifname ]; then
Q_COUNT=$((Q_COUNT + 1))
else
Q_COUNT='0'
fi
INTF_NAME=$ifname
local total_q=$(cat /tmp/qos/queue_stats/$ifname/q_idx)
q_no=`expr $total_q - 1` local
precedence_file="/tmp/qos/$ifname/q_order"
# TR181 suggests lower the precedence value higher the priority
# but in the chip its the opposite ie lower the value, lower
# the priority of queue on this chip. So we need to reverse the
# precedence value.
precedence="$(grep -i q${Q_COUNT} $precedence_file)"
precedence=${precedence%_*}
order=`expr $q_no - $precedence`
local q_no=$(cat /tmp/qos/queue_stats/$ifname/q_idx)
#lower the value, lower the priority of queue on this chip
config_get order "$qid" "precedence"
config_get sc_alg "$qid" "scheduling"
config_get wgt "$qid" "weight"
@@ -161,17 +47,12 @@ handle_queue() {
;;
esac
# ignore precedence value in case of WRR
if [ $salg -eq 2 ]; then
order=0
fi
# Call tmctl which is a broadcomm command to configure queues on a port.
tmctl setqcfg --devtype 0 --if $ifname --qid $Q_COUNT --priority $order --qsize $qsize --weight $wgt --schedmode $salg --shapingrate $rate --burstsize $bs
tmctl setqcfg --devtype 0 --if $ifname --qid $q_no --priority $order --qsize $qsize --weight $wgt --schedmode $salg --shapingrate $rate --burstsize $bs
# In BCM968 chips, the counters for queues are read, on other model, its read and reset. So, to maintain counter
# value and uniform behaviour, we are storing counter value for each queue in files
local d_name="/tmp/qos/queue_stats/${ifname}/q_${Q_COUNT}"
local d_name="/tmp/qos/queue_stats/${ifname}/q_${q_no}"
mkdir $d_name
local f_name="$d_name/txPackets"
touch $f_name
@@ -186,6 +67,8 @@ handle_queue() {
touch $f_name
echo 0 > $f_name
q_no=$((q_no + 1))
echo $q_no > /tmp/qos/queue_stats/$ifname/q_idx
}
#function to handle a policer section
@@ -645,27 +528,18 @@ assign_policer_to_port() {
local pindex="$2"
local portorder="$(db -q get hw.board.ethernetPortOrder)"
local wanport="$(db -q get hw.board.ethernetWanPort)"
local board="$(db -q get hw.board.model_name | cut -c 1-2)"
local i=0
if [ "$board" == "FT" ]; then
i=3
fi
for port in $portorder; do
if [ "$ifname" == "$port" ]; then
if [ "$wanport" == "$port" ]; then
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
bs /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
else
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=lan$i ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
bs /b/configure port/index=lan$i ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
fi
break
fi
if [ "$board" == "FT" ]; then
i=$((i - 1))
else
i=$((i + 1))
fi
i=$((i + 1))
done
}
@@ -715,7 +589,7 @@ handle_policer_rules() {
fi
# The policer object is not available on non BCM968* chips
if [ $POLICER_SKIP -eq 1 ]; then
if [ $is_bcm968 -eq 1 ]; then
assign_policer_to_port $ifname $pindex
else
config_ingress_rate_limit $ifname $ingress_rate $in_burst_size
@@ -811,8 +685,6 @@ configure_queue() {
rm -rf /tmp/qos/queue_stats
for intf in $(db get hw.board.ethernetPortOrder); do
rm -rf /tmp/qos/$intf
mkdir -p /tmp/qos/queue_stats/$intf
touch /tmp/qos/queue_stats/$intf/q_idx
echo 0 > /tmp/qos/queue_stats/$intf/q_idx
@@ -820,23 +692,17 @@ configure_queue() {
for i in 0 1 2 3 4 5 6 7; do
tmctl delqcfg --devtype 0 --if $intf --qid $i &>/dev/null
done
mkdir -p /tmp/qos/$intf
touch /tmp/qos/$intf/q_order
touch /tmp/qos/$intf/q_precedence
done
# Load UCI file
config_load qos
config_foreach handle_q_order queue
map_precedence
config_foreach handle_queue queue
}
configure_policer() {
# The policer object is not available on non BCM968* chips, just clean up
# the old config if any and return
if [ $POLICER_SKIP -eq 0 ]; then
if [ $is_bcm968 -eq 0 ]; then
for intf in $(db get hw.board.ethernetPortOrder); do
# setting rate and burst size to 0 disables rate limiting
ethswctl -c rxratectrl -n 1 -p $intf -x 0 -y 0
@@ -877,10 +743,10 @@ configure_qos() {
reload_qos() {
local service_name="$1"
local cpu_model="$(brcm_fw_tool -k info)"
local cpu_model="$(grep Hardware /proc/cpuinfo | awk '{print$NF}')"
case $cpu_model in
68*|6755) POLICER_SKIP=1 ;;
BCM968*) is_bcm968=1 ;;
esac
if [ -z "$service_name" ]; then
@@ -895,3 +761,228 @@ reload_qos() {
configure_policer
fi
}
get_queue_stats() {
local ifname
local f_name
local tmp_val
local q_index=0
local max_q_index=0
json_init
json_add_array "queues"
if [ -n "$1" ]; then
ifname=$1
max_q_index=$(cat /tmp/qos/queue_stats/${ifname}/q_idx)
while :
do
if [ $q_index -eq $max_q_index ]; then
break
fi
stats="$(tmctl getqstats --devtype 0 --if $ifname --qid $q_index)"
ret="$(echo $stats | awk '{print substr($0,0,5)}')"
#check tmctl ERROR condition
if [ $ret == 'ERROR' ]; then
q_index=$((q_index + 1))
continue
fi
json_add_object ""
json_add_int "qid" "$q_index"
json_add_string "iface" "$ifname"
IFS=$'\n'
for stat in $stats; do
pname="$(echo $stat | awk '{print$1}')"
if [ $pname == 'ret' ]; then
continue
fi
val="$(echo $stat | awk '{print$2}')"
# remove trailing : from the name
pname="${pname::-1}"
local f_name="/tmp/qos/queue_stats/${ifname}/q_${q_index}/${pname}"
# In non BCM968* chips, read operation on queues is actually a read and reset,
# so values need to be maintained to present cumulative value
if [ $is_bcm968 -eq 0 ]; then
tmp_val=$(cat $f_name)
val=$((val + tmp_val))
fi
echo $val > $f_name
# convert to iopsyswrt names
case "$pname" in
txPackets)
json_add_int "tx_packets" "$val"
;;
txBytes)
json_add_int "tx_bytes" "$val"
;;
droppedPackets)
json_add_int "tx_dropped_packets" "$val"
;;
droppedBytes)
json_add_int "tx_dropped_bytes" "$val"
;;
esac
done
json_close_object
q_index=$((q_index + 1))
done
else
for intf in $(db get hw.board.ethernetPortOrder); do
ifname=$intf
q_index=0
max_q_index=$(cat /tmp/qos/queue_stats/${ifname}/q_idx)
while :
do
if [ $q_index -eq $max_q_index ]; then
break
fi
stats="$(tmctl getqstats --devtype 0 --if $ifname --qid $q_index)"
ret="$(echo $stats | awk '{print substr($0,0,5)}')"
#check tmctl ERROR condition
if [ $ret == 'ERROR' ]; then
q_index=$((q_index + 1))
continue
fi
json_add_object ""
json_add_int "qid" "$q_index"
json_add_string "iface" "$ifname"
IFS=$'\n'
for stat in $stats; do
pname="$(echo $stat | awk '{print$1}')"
if [ $pname == 'ret' ]; then
continue
fi
val="$(echo $stat | awk '{print$2}')"
# remove trailing : from the name
pname="${pname::-1}"
local f_name="/tmp/qos/queue_stats/${ifname}/q_${q_index}/${pname}"
# In non BCM968* chips, read operation on queues is actually a read and reset,
# so values need to be maintained to present cumulative value
if [ $is_bcm968 -eq 0 ]; then
tmp_val=$(cat $f_name)
val=$((val + tmp_val))
fi
echo $val > $f_name
# convert to iopsyswrt names
case "$pname" in
txPackets)
json_add_int "tx_packets" "$val"
;;
txBytes)
json_add_int "tx_bytes" "$val"
;;
droppedPackets)
json_add_int "tx_dropped_packets" "$val"
;;
droppedBytes)
json_add_int "tx_dropped_bytes" "$val"
;;
esac
done
json_close_object
q_index=$((q_index + 1))
done
done
fi
json_close_array
json_dump
}
get_eth_q_stats() {
json_init
json_add_array "queues"
ifname="$1"
local tmp_val=0
# if ifname is empty that is good enough to break
if [ -z "$ifname" ];then
return
fi
qid="$2"
if [ -z "$qid" ];then
return
fi
stats="$(tmctl getqstats --devtype 0 --if $ifname --qid $qid)"
ret="$(echo $stats | awk '{print substr($0,0,5)}')"
#check tmctl ERROR condition
if [ $ret == 'ERROR' ]; then
return
fi
json_add_object ""
json_add_int "qid" "$qid"
json_add_string "iface" "$ifname"
IFS=$'\n'
for stat in $stats; do
pname="$(echo $stat | awk '{print$1}')"
if [ $pname == 'ret' ]; then
continue
fi
val="$(echo $stat | awk '{print$2}')"
# remove trailing : from the name
pname="${pname::-1}"
local f_name="/tmp/qos/queue_stats/${ifname}/q_${qid}/${pname}"
# In non BCM968* chips, read operation on queues is actually a read and reset,
# so values need to be maintained to present cumulative value
if [ $is_bcm968 -eq 0 ]; then
tmp_val=$(cat $f_name)
val=$((val + tmp_val))
fi
echo $val > $f_name
# convert to iopsyswrt names
case "$pname" in
txPackets)
json_add_int "tx_packets" "$val"
;;
txBytes)
json_add_int "tx_bytes" "$val"
;;
droppedPackets)
json_add_int "tx_dropped_packets" "$val"
;;
droppedBytes)
json_add_int "tx_dropped_bytes" "$val"
;;
esac
done
json_close_object
json_close_array
json_dump
}
read_queue_stats() {
itf="$1"
q_idx="$2"
local cpu_model="$(grep Hardware /proc/cpuinfo | awk '{print$NF}')"
case $cpu_model in
BCM968*) is_bcm968=1 ;;
esac
if [ -n "$itf" -a -n "$q_idx" ]; then
get_eth_q_stats $itf $q_idx
else
get_queue_stats $itf
fi
}

View File

@@ -0,0 +1,30 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
. /lib/functions.sh
include /lib/qos
case "$1" in
list)
echo '{ "queue_stats": { "ifname":"String", "qid":"Integer" }, "reload": { "section":"String" } }'
;;
call)
case "$2" in
queue_stats)
read input;
json_load "$input"
json_get_var iface ifname
json_get_var qid qid
read_queue_stats $iface $qid
;;
reload)
read input;
json_load "$input"
json_get_var service section
reload_qos $service
;;
esac
;;
esac

View File

@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=questd
PKG_VERSION:=5.2.1
PKG_VERSION:=5.1.12
PKG_SOURCE_VERSION:=d554541ac6fb8ef14431fcec9a31dbcb52181279
PKG_SOURCE_VERSION:=5de841c629d13bd8a5b90081343aaf5b75afc7c2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd

View File

@@ -12,7 +12,7 @@ PKG_INSTALL:=1
PKG_SOURCE_PROTO=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
PKG_SOURCE_VERSION:=ad94ccdd82b22527ab32937ca1a2682030319ed3
PKG_SOURCE_VERSION:=d7a4d24e653ea0dc02679e24f8ec3c817aafdb37
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
PKG_INSTALL:=1

View File

@@ -6,10 +6,10 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=swmodd
PKG_VERSION:=1.1.0
PKG_VERSION:=1.0.2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c8cc4a3b332ea931dbf2fe7e6b94bebf5c4bcc33
PKG_SOURCE_VERSION:=3bfc97cd6f8e22f561601c47b79203b17fdb0fbe
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/swmodd.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
@@ -21,7 +21,7 @@ define Package/swmodd
SECTION:=utils
CATEGORY:=Utilities
TITLE:=SWMOD - software modules ubus backend
DEPENDS:=+libuci +libubox +ubus +libuuid +PACKAGE_liblxc:liblxc
DEPENDS:=+libuci +libubox +ubus +libuuid
endef
define Package/swmodd/description
@@ -32,11 +32,6 @@ TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
-D_GNU_SOURCE
ifeq ($(CONFIG_PACKAGE_liblxc),y)
MAKE_FLAGS += \
SWMOD_LXC="yes"
endif
define Package/swmodd/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/swmodd.init $(1)/etc/init.d/swmodd

107
tr064/.cproject Normal file
View File

@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.debug.1423203916">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.debug.1423203916" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.debug.1423203916" name="Debug" parent="cdt.managedbuild.config.gnu.cross.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.debug.1423203916." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.debug.482080998" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.debug">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1864775892" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/tr064}/Debug" id="cdt.managedbuild.builder.gnu.cross.84968765" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.912678595" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.732187738" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.406132207" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.656190220" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.894741631" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.1987025848" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.1506505331" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.1176314661" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1134635640" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1076025733" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.862614592" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.638528350" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.390953300" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cross.exe.release.517635632">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cross.exe.release.517635632" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cross.exe.release.517635632" name="Release" parent="cdt.managedbuild.config.gnu.cross.exe.release">
<folderInfo id="cdt.managedbuild.config.gnu.cross.exe.release.517635632." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cross.exe.release.2086871607" name="Cross GCC" superClass="cdt.managedbuild.toolchain.gnu.cross.exe.release">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.targetPlatform.gnu.cross.1691338213" isAbstract="false" osList="all" superClass="cdt.managedbuild.targetPlatform.gnu.cross"/>
<builder buildPath="${workspace_loc:/tr064}/Release" id="cdt.managedbuild.builder.gnu.cross.2045398730" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.builder.gnu.cross"/>
<tool id="cdt.managedbuild.tool.gnu.cross.c.compiler.804948441" name="Cross GCC Compiler" superClass="cdt.managedbuild.tool.gnu.cross.c.compiler">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.422910401" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.1240870180" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.118715116" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.compiler.119838407" name="Cross G++ Compiler" superClass="cdt.managedbuild.tool.gnu.cross.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.198417757" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.380023243" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.c.linker.751400281" name="Cross GCC Linker" superClass="cdt.managedbuild.tool.gnu.cross.c.linker">
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.398459196" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cross.cpp.linker.1354328537" name="Cross G++ Linker" superClass="cdt.managedbuild.tool.gnu.cross.cpp.linker"/>
<tool id="cdt.managedbuild.tool.gnu.cross.archiver.1258554594" name="Cross GCC Archiver" superClass="cdt.managedbuild.tool.gnu.cross.archiver"/>
<tool id="cdt.managedbuild.tool.gnu.cross.assembler.2022763402" name="Cross GCC Assembler" superClass="cdt.managedbuild.tool.gnu.cross.assembler">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1223740654" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="tr064.cdt.managedbuild.target.gnu.cross.exe.1457888368" name="Executable" projectType="cdt.managedbuild.target.gnu.cross.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.debug.1423203916;cdt.managedbuild.config.gnu.cross.exe.debug.1423203916.;cdt.managedbuild.tool.gnu.cross.c.compiler.912678595;cdt.managedbuild.tool.gnu.c.compiler.input.656190220">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cross.exe.release.517635632;cdt.managedbuild.config.gnu.cross.exe.release.517635632.;cdt.managedbuild.tool.gnu.cross.c.compiler.804948441;cdt.managedbuild.tool.gnu.c.compiler.input.118715116">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
</cproject>

27
tr064/.project Executable file
View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tr064</name>
<comment></comment>
<projects>
<project>openssl-1.0.2i</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.config.gnu.cross.exe.debug.1423203916" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1404192411374960532" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
<configuration id="cdt.managedbuild.config.gnu.cross.exe.release.517635632" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1404192411374960532" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
</project>

82
tr064/Makefile Executable file
View File

@@ -0,0 +1,82 @@
# Copyright (C) 2017 PIVA Software <www.pivasoftware.com>
# Author: OMAR Kallel <omar.kallel@pivasoftware.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=tr064
PKG_VERSION:=1.0
PKG_SOURCE_URL:=https://dev.iopsys.eu/suite/tr-064.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=e53d492a09c433718a520987c419cb6a4d4ae8dc
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=LGPL-2.1-only Apache-2.0
PKG_CONFIG_DEPENDS:= \
CONFIG_TR064_DEBUG \
CONFIG_TR064_DEVEL
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/tr064
SECTION:=utils
CATEGORY:=Utilities
TITLE:=tr064
DEPENDS:=+libubus +libuci +libubox +libmicroxml +libjson-c +libpthread +libopenssl +libubus +libubox
endef
define Package/tr064/description
TR-064 protocol
endef
TARGET_CFLAGS += \
-D_GNU_SOURCE
TARGET_LDFLAGS += \
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
CONFIGURE_ARGS += \
--with-uci-include-path=$(STAGING_DIR)/usr/include \
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
--with-libubus-include-path=$(STAGING_DIR)/usr/include
ifeq ($(CONFIG_TR064_DEBUG),y)
CONFIGURE_ARGS += \
--enable-debug
endif
ifeq ($(CONFIG_TR064_DEVEL),y)
CONFIGURE_ARGS += \
--enable-devel
endif
CONFIGURE_ARGS += \
--enable-jsonc=1
define Package/tr064/conffiles
/etc/config/tr064
endef
define Package/tr064/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DIR) $(1)/etc/upnp-md
$(INSTALL_DIR) $(1)/etc/upnp-md/web
$(INSTALL_DIR) $(1)/etc/upnp-md/x509
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/upnp-md-pupnp/upnp-md $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/web/*.xml $(1)/etc/upnp-md/web
$(CP) $(PKG_BUILD_DIR)/tools/parse_ftp_server_log.sh $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/tools/kill_child.sh $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/x509/*.pem $(1)/etc/upnp-md/x509
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/upnp-md.conf $(1)/etc/upnp-md
$(CP) $(PKG_BUILD_DIR)/conf/DMconf.xml $(1)/etc/upnp-md
$(CP) $(PKG_BUILD_DIR)/conf/CPID.csv $(1)/etc/upnp-md
$(CP) $(PKG_BUILD_DIR)/conf/tr064 $(1)/etc/config
$(CP) $(PKG_BUILD_DIR)/conf/tr064d $(1)/etc/init.d
chmod 0744 $(1)/etc/init.d/tr064d
endef
$(eval $(call BuildPackage,tr064))

11
tr098/Config.in Normal file
View File

@@ -0,0 +1,11 @@
if PACKAGE_libtr098
config LIBTR098_VENDOR_PREFIX
string "TR-098 Vendor Prefix"
default "X_IOPSYS_EU_"
config UPNP_TR064
bool "Compile with tr064 features"
default n
endif

73
tr098/Makefile Normal file
View File

@@ -0,0 +1,73 @@
#
# Copyright (C) 2019 Iopsys
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libtr098
PKG_VERSION:=1.0-2020-05-31
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/tr-098
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=dca7ba5ef0c5829ab0f450893cdd7aa077ccc2a8
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
define Package/libtr098
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Library for broadband-forum data model
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace
endef
define Package/libtr098/config
source "$(SOURCE)/Config.in"
endef
define Package/libtr098/description
Test description will update later.
endef
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
ifneq ($(USE_LOCAL),)
define Build/Prepare
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
endif
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBTR098_VENDOR_PREFIX)\\\"
TARGET_CFLAGS += \
-D_GNU_SOURCE -D_AADJ
ifeq ($(CONFIG_UPNP_TR064),y)
CONFIGURE_ARGS += \
--enable-tr064
endif
define Package/libtr098/install
$(INSTALL_DIR) $(1)/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libtr098.so* $(1)/lib/
$(INSTALL_DIR) $(1)/etc/tr098
$(INSTALL_CONF) $(PKG_BUILD_DIR)/config/dmmap $(1)/etc/tr098
$(INSTALL_DIR) $(1)/usr/share/tr098
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/tr098
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/include/libtr098
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libtr098/
$(CP) $(PKG_BUILD_DIR)/tr098/*.h $(1)/usr/include/libtr098/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libtr098.{a,so*} $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libtr098))

View File

@@ -29,7 +29,7 @@ static char *get_last_instance_with_option(char *package, char *section, char *o
char *inst = NULL;
uci_foreach_option_eq(package, section, option, val, s) {
inst = update_instance(inst, 2, s, opt_inst);
inst = update_instance(inst, 4, s, opt_inst, package, section);
}
return inst;
}
@@ -47,19 +47,25 @@ static char *get_last_id(char *package, char *section)
return id;
}
struct ip_args
{
struct uci_section *ip_sec;
char *ip_4address;
};
static int addObjIPInterfaceTWAMPReflector(char *refparam, struct dmctx *ctx, void *data, char **instance)
{
struct uci_section *connection = NULL;
struct uci_section *connection;
char *value1, *last_inst, *id;
char *last_inst = get_last_instance_with_option("twamp", "twamp_reflector", "interface", section_name((struct uci_section *)data), "twamp_inst");
char *id = get_last_id("twamp", "twamp_reflector");
dmuci_add_section("twamp", "twamp_reflector", &connection);
dmasprintf(instance, "%d", last_inst ? atoi(last_inst)+1 : 1);
last_inst = get_last_instance_with_option("twamp", "twamp_reflector", "interface", section_name(((struct ip_args *)data)->ip_sec), "twamp_inst");
id = get_last_id("twamp", "twamp_reflector");
dmuci_add_section("twamp", "twamp_reflector", &connection, &value1);
dmasprintf(instance, "%d", last_inst?atoi(last_inst)+1:1);
dmuci_set_value_by_section(connection, "twamp_inst", *instance);
dmuci_set_value_by_section(connection, "id", id);
dmuci_set_value_by_section(connection, "enable", "0");
dmuci_set_value_by_section(connection, "interface", section_name((struct uci_section *)data));
dmuci_set_value_by_section(connection, "interface", section_name(((struct ip_args *)data)->ip_sec));
dmuci_set_value_by_section(connection, "port", "862");
dmuci_set_value_by_section(connection, "max_ttl", "1");
return 0;
@@ -70,15 +76,16 @@ static int delObjIPInterfaceTWAMPReflector(char *refparam, struct dmctx *ctx, vo
int found = 0;
struct uci_section *s, *ss = NULL;
char *interface;
struct uci_section *section = (struct uci_section *)data;
switch (del_action) {
case DEL_INST:
dmuci_delete_by_section((struct uci_section *)data, NULL, NULL);
dmuci_delete_by_section(section, NULL, NULL);
return 0;
case DEL_ALL:
uci_foreach_sections("twamp", "twamp_reflector", s) {
dmuci_get_value_by_section_string(s, "interface", &interface);
if (strcmp(interface, section_name((struct uci_section *)data)) != 0)
if(strcmp(interface, section_name(((struct ip_args *)data)->ip_sec)) != 0)
continue;
if (found != 0) {
dmuci_delete_by_section(ss, NULL, NULL);
@@ -96,7 +103,7 @@ static int delObjIPInterfaceTWAMPReflector(char *refparam, struct dmctx *ctx, vo
static int get_IPInterfaceTWAMPReflector_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "enable", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value);
return 0;
}
@@ -187,7 +194,7 @@ static int set_IPInterfaceTWAMPReflector_Alias(char *refparam, struct dmctx *ctx
static int get_IPInterfaceTWAMPReflector_Port(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "port", "862");
dmuci_get_value_by_section_string((struct uci_section *)data, "port", value);
return 0;
}
@@ -207,7 +214,7 @@ static int set_IPInterfaceTWAMPReflector_Port(char *refparam, struct dmctx *ctx,
static int get_IPInterfaceTWAMPReflector_MaximumTTL(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "max_ttl", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "max_ttl", value);
return 0;
}
@@ -270,10 +277,10 @@ static int browseIPInterfaceTWAMPReflectorInst(struct dmctx *dmctx, DMNODE *pare
struct uci_section *s = NULL;
char *inst = NULL, *max_inst = NULL;
uci_foreach_option_eq("twamp", "twamp_reflector", "interface", section_name((struct uci_section *)prev_data), s) {
uci_foreach_option_eq("twamp", "twamp_reflector", "interface", section_name(((struct ip_args *)prev_data)->ip_sec), s) {
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 3,
s, "twamp_inst", "twamp_alias");
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 5,
s, "twamp_inst", "twamp_alias", "twamp", "twamp_reflector");
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)s, inst) == DM_STOP)
break;
@@ -283,20 +290,20 @@ static int browseIPInterfaceTWAMPReflectorInst(struct dmctx *dmctx, DMNODE *pare
/* *** Device.IP.Interface. *** */
DMOBJ tDeviceTWAMPReflectorObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"TWAMPReflector", &DMWRITE, addObjIPInterfaceTWAMPReflector, delObjIPInterfaceTWAMPReflector, NULL, browseIPInterfaceTWAMPReflectorInst, NULL, NULL, tIPInterfaceTWAMPReflectorParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Port", NULL}},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"TWAMPReflector", &DMWRITE, addObjIPInterfaceTWAMPReflector, delObjIPInterfaceTWAMPReflector, NULL, browseIPInterfaceTWAMPReflectorInst, NULL, NULL, NULL, NULL, tIPInterfaceTWAMPReflectorParams, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.IP.Interface.{i}.TWAMPReflector.{i}. *** */
DMLEAF tIPInterfaceTWAMPReflectorParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_IPInterfaceTWAMPReflector_Enable, set_IPInterfaceTWAMPReflector_Enable, BBFDM_BOTH},
{"Status", &DMREAD, DMT_STRING, get_IPInterfaceTWAMPReflector_Status, NULL, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_IPInterfaceTWAMPReflector_Alias, set_IPInterfaceTWAMPReflector_Alias, BBFDM_BOTH},
{"Port", &DMWRITE, DMT_UNINT, get_IPInterfaceTWAMPReflector_Port, set_IPInterfaceTWAMPReflector_Port, BBFDM_BOTH},
{"MaximumTTL", &DMWRITE, DMT_UNINT, get_IPInterfaceTWAMPReflector_MaximumTTL, set_IPInterfaceTWAMPReflector_MaximumTTL, BBFDM_BOTH},
{"IPAllowedList", &DMWRITE, DMT_STRING, get_IPInterfaceTWAMPReflector_IPAllowedList, set_IPInterfaceTWAMPReflector_IPAllowedList, BBFDM_BOTH},
{"PortAllowedList", &DMWRITE, DMT_STRING, get_IPInterfaceTWAMPReflector_PortAllowedList, set_IPInterfaceTWAMPReflector_PortAllowedList, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_IPInterfaceTWAMPReflector_Enable, set_IPInterfaceTWAMPReflector_Enable, NULL, NULL, BBFDM_BOTH},
{"Status", &DMREAD, DMT_STRING, get_IPInterfaceTWAMPReflector_Status, NULL, NULL, NULL, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_IPInterfaceTWAMPReflector_Alias, set_IPInterfaceTWAMPReflector_Alias, NULL, NULL, BBFDM_BOTH},
{"Port", &DMWRITE, DMT_UNINT, get_IPInterfaceTWAMPReflector_Port, set_IPInterfaceTWAMPReflector_Port, NULL, NULL, BBFDM_BOTH},
{"MaximumTTL", &DMWRITE, DMT_UNINT, get_IPInterfaceTWAMPReflector_MaximumTTL, set_IPInterfaceTWAMPReflector_MaximumTTL, NULL, NULL, BBFDM_BOTH},
{"IPAllowedList", &DMWRITE, DMT_STRING, get_IPInterfaceTWAMPReflector_IPAllowedList, set_IPInterfaceTWAMPReflector_IPAllowedList, NULL, NULL, BBFDM_BOTH},
{"PortAllowedList", &DMWRITE, DMT_STRING, get_IPInterfaceTWAMPReflector_PortAllowedList, set_IPInterfaceTWAMPReflector_PortAllowedList, NULL, NULL, BBFDM_BOTH},
{0}
};
};

View File

@@ -25,7 +25,7 @@ LIB_MAP_OBJ tRootDynamicObj[] = {
static int get_IPDiagnosticsUDPEchoConfig_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("udpechoserver", "udpechoserver", "enable", "1");
dmuci_get_option_value_string("udpechoserver", "udpechoserver", "enable", value);
return 0;
}
@@ -94,7 +94,7 @@ static int set_IPDiagnosticsUDPEchoConfig_SourceIPAddress(char *refparam, struct
static int get_IPDiagnosticsUDPEchoConfig_UDPPort(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("udpechoserver", "udpechoserver", "server_port", "0");
dmuci_get_option_value_string("udpechoserver", "udpechoserver", "server_port", value);
return 0;
}
@@ -114,7 +114,7 @@ static int set_IPDiagnosticsUDPEchoConfig_UDPPort(char *refparam, struct dmctx *
static int get_IPDiagnosticsUDPEchoConfig_EchoPlusEnabled(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("udpechoserver", "udpechoserver", "plus", "1");
dmuci_get_option_value_string("udpechoserver", "udpechoserver", "plus", value);
return 0;
}
@@ -144,7 +144,7 @@ static int get_IPDiagnosticsUDPEchoConfig_EchoPlusSupported(char *refparam, stru
static inline char *udpechoconfig_get(char *option, char *def)
{
char *tmp;
varstate_get_value_string("udpechoserver", "udpechoserver", option, &tmp);
dmuci_get_varstate_string("udpechoserver", "udpechoserver", option, &tmp);
if(tmp && tmp[0] == '\0')
return dmstrdup(def);
else
@@ -177,37 +177,37 @@ static int get_IPDiagnosticsUDPEchoConfig_BytesResponded(char *refparam, struct
static int get_IPDiagnosticsUDPEchoConfig_TimeFirstPacketReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = udpechoconfig_get("TimeFirstPacketReceived", "0001-01-01T00:00:00.000000Z");
*value = udpechoconfig_get("TimeFirstPacketReceived", "0");
return 0;
}
static int get_IPDiagnosticsUDPEchoConfig_TimeLastPacketReceived(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = udpechoconfig_get("TimeLastPacketReceived", "0001-01-01T00:00:00.000000Z");
*value = udpechoconfig_get("TimeLastPacketReceived", "0");
return 0;
}
/* *** Device.IP.Diagnostics. *** */
DMOBJ tDeviceUDPEchoConfigObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"UDPEchoConfig", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsUDPEchoConfigParams, NULL, BBFDM_BOTH},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"UDPEchoConfig", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tIPDiagnosticsUDPEchoConfigParams, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.IP.Diagnostics.UDPEchoConfig. *** */
DMLEAF tIPDiagnosticsUDPEchoConfigParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_IPDiagnosticsUDPEchoConfig_Enable, set_IPDiagnosticsUDPEchoConfig_Enable, BBFDM_BOTH},
{"Interface", &DMWRITE, DMT_STRING, get_IPDiagnosticsUDPEchoConfig_Interface, set_IPDiagnosticsUDPEchoConfig_Interface, BBFDM_BOTH},
{"SourceIPAddress", &DMWRITE, DMT_STRING, get_IPDiagnosticsUDPEchoConfig_SourceIPAddress, set_IPDiagnosticsUDPEchoConfig_SourceIPAddress, BBFDM_BOTH},
{"UDPPort", &DMWRITE, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_UDPPort, set_IPDiagnosticsUDPEchoConfig_UDPPort, BBFDM_BOTH},
{"EchoPlusEnabled", &DMWRITE, DMT_BOOL, get_IPDiagnosticsUDPEchoConfig_EchoPlusEnabled, set_IPDiagnosticsUDPEchoConfig_EchoPlusEnabled, BBFDM_BOTH},
{"EchoPlusSupported", &DMREAD, DMT_BOOL, get_IPDiagnosticsUDPEchoConfig_EchoPlusSupported, NULL, BBFDM_BOTH},
{"PacketsReceived", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_PacketsReceived, NULL, BBFDM_BOTH},
{"PacketsResponded", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_PacketsResponded, NULL, BBFDM_BOTH},
{"BytesReceived", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_BytesReceived, NULL, BBFDM_BOTH},
{"BytesResponded", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_BytesResponded, NULL, BBFDM_BOTH},
{"TimeFirstPacketReceived", &DMREAD, DMT_TIME, get_IPDiagnosticsUDPEchoConfig_TimeFirstPacketReceived, NULL, BBFDM_BOTH},
{"TimeLastPacketReceived", &DMREAD, DMT_TIME, get_IPDiagnosticsUDPEchoConfig_TimeLastPacketReceived, NULL, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_IPDiagnosticsUDPEchoConfig_Enable, set_IPDiagnosticsUDPEchoConfig_Enable, NULL, NULL, BBFDM_BOTH},
{"Interface", &DMWRITE, DMT_STRING, get_IPDiagnosticsUDPEchoConfig_Interface, set_IPDiagnosticsUDPEchoConfig_Interface, NULL, NULL, BBFDM_BOTH},
{"SourceIPAddress", &DMWRITE, DMT_STRING, get_IPDiagnosticsUDPEchoConfig_SourceIPAddress, set_IPDiagnosticsUDPEchoConfig_SourceIPAddress, NULL, NULL, BBFDM_BOTH},
{"UDPPort", &DMWRITE, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_UDPPort, set_IPDiagnosticsUDPEchoConfig_UDPPort, NULL, NULL, BBFDM_BOTH},
{"EchoPlusEnabled", &DMWRITE, DMT_BOOL, get_IPDiagnosticsUDPEchoConfig_EchoPlusEnabled, set_IPDiagnosticsUDPEchoConfig_EchoPlusEnabled, NULL, NULL, BBFDM_BOTH},
{"EchoPlusSupported", &DMREAD, DMT_BOOL, get_IPDiagnosticsUDPEchoConfig_EchoPlusSupported, NULL, NULL, NULL, BBFDM_BOTH},
{"PacketsReceived", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_PacketsReceived, NULL, NULL, NULL, BBFDM_BOTH},
{"PacketsResponded", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_PacketsResponded, NULL, NULL, NULL, BBFDM_BOTH},
{"BytesReceived", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_BytesReceived, NULL, NULL, NULL, BBFDM_BOTH},
{"BytesResponded", &DMREAD, DMT_UNINT, get_IPDiagnosticsUDPEchoConfig_BytesResponded, NULL, NULL, NULL, BBFDM_BOTH},
{"TimeFirstPacketReceived", &DMREAD, DMT_TIME, get_IPDiagnosticsUDPEchoConfig_TimeFirstPacketReceived, NULL, NULL, NULL, BBFDM_BOTH},
{"TimeLastPacketReceived", &DMREAD, DMT_TIME, get_IPDiagnosticsUDPEchoConfig_TimeLastPacketReceived, NULL, NULL, NULL, BBFDM_BOTH},
{0}
};
};

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uspd
PKG_VERSION:=2.1.11
PKG_VERSION:=2.0.6
LOCAL_DEV:=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=68c23cead0aeb07887d23dea4cdae3c4d794edda
PKG_SOURCE_VERSION:=f4cb4407c275befee87cf761a51687d3b9869e99
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
endif

View File

@@ -1,4 +1,3 @@
config uspd 'usp'
option granularitylevel '0'
option debug '0'
option loglevel '1'

View File

@@ -1,53 +1,14 @@
#!/bin/sh /etc/rc.common
START=98
START=94
STOP=10
USE_PROCD=1
PROG=/usr/sbin/uspd
validate_uspd_usp_section()
{
uci_validate_section uspd uspd "usp" \
'enabled:bool:true' \
'granularitylevel:uinteger' \
'debug:bool:false' \
'loglevel:uinteger' \
'sock:string' \
'transaction_timeout:string'
}
configure_uspd()
{
local enabled debug sock transaction_timeout
config_load uspd
validate_uspd_usp_section || {
log "Validation of usp section failed"
return 1;
}
[ ${enabled} -eq 0 ] && exit 0
if [ ${debug} -eq 1 ]; then
procd_set_param stdout 1
procd_set_param stderr 1
fi
if [ -n "${sock}" ]; then
procd_append_param command -s ${sock}
fi
if [ -n "${transaction_timeout}" ]; then
procd_append_param command -t ${transaction_timeout}
fi
}
start_service() {
procd_open_instance usp
procd_open_instance
procd_set_param command ${PROG}
configure_uspd
procd_set_param respawn
procd_close_instance
}

View File

@@ -5,10 +5,10 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wfadatad
PKG_VERSION:=3.1.0
PKG_VERSION:=2.3.1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=6ee86bf2138edd680cc13f9d364f3e272a9e1e7c
PKG_SOURCE_VERSION:=bdcf390f970facc20d7ac51fbb59ac4912b7fbfc
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wfadatad.git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
@@ -21,7 +21,7 @@ include $(INCLUDE_DIR)/package.mk
define Package/wfadatad
SECTION:=utils
CATEGORY:=Utilities
TITLE:=WiFi Data Elements-1.0 Agent and Collector
TITLE:=WiFi Data Elements-1.0 Agent
DEPENDS:=+libwifi +libuci +libubox +ubus +libpthread +libnl-genl \
+!WFA_DELM_STANDALONE:map-agent +WFA_DELM_MULTIAP_MODE:libmaputils
endef
@@ -59,7 +59,7 @@ define Package/wfadatad/install
ifeq ($(CONFIG_WFA_DELM_STANDALONE),y)
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) ./files/wfadatad.init $(1)/etc/init.d/wfadatad
$(INSTALL_BIN) ./files/wfa_delm.init $(1)/etc/init.d/wfadatad
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wfadatad $(1)/usr/sbin/
else
$(INSTALL_DIR) $(1)/usr/lib/map-plugins

View File

@@ -0,0 +1,28 @@
#!/bin/sh /etc/rc.common
START=98
STOP=11
USE_PROCD=1
PROG=/usr/sbin/wfadatad
service_running() {
ubus -t 2 wait_for ieee1905
}
start_service() {
procd_open_instance
procd_set_param command ${PROG}
procd_set_param respawn
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger wireless
}

View File

@@ -1,41 +0,0 @@
#!/bin/sh /etc/rc.common
START=98
STOP=11
USE_PROCD=1
PROG=/usr/sbin/wfadatad
service_running() {
ubus -t 2 wait_for ieee1905 map.1905
}
start_service() {
procd_open_instance
procd_set_param command "$PROG" "-d"
#procd_set_param respawn
procd_close_instance
[ -e "/etc/config/mapcontroller" ] && {
local en
config_load mapcontroller
config_get en controller enabled "0"
[ $en -gt 0 ] && {
procd_open_instance
procd_set_param command "$PROG" "-d -C"
procd_close_instance
}
}
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_reload_trigger wireless
}

View File

@@ -5,17 +5,14 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=wifimngr
PKG_VERSION:=8.5.5
PKG_VERSION:=8.2.9
LOCAL_DEV=0
ifneq ($(LOCAL_DEV),1)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=c41e2aeb5189a04bc2eee8e5943c7fddd2e3eb24
PKG_SOURCE_VERSION:=ff879d814caba6807f64288de22db6f78c03438c
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
endif
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=LICENSE
@@ -41,16 +38,15 @@ TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl3 \
-D_GNU_SOURCE
ifeq ($(LOCAL_DEV),1)
define Build/Prepare
rsync -r --exclude=.* ~/git/wifimngr/ $(PKG_BUILD_DIR)/
endef
endif
define Package/wifimngr/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/wifimngr.init $(1)/etc/init.d/wifimngr
# $(INSTALL_DIR) $(1)/lib/upgrade/post-rootfs-fixup.d
# $(INSTALL_BIN) ./files/*-uci-wireless $(1)/lib/upgrade/post-rootfs-fixup.d
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wifimngr $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/hotplug.d/button
$(INSTALL_BIN) ./files/wifi.button.hotplug $(1)/etc/hotplug.d/button/05-wifi
endef
$(eval $(call BuildPackage,wifimngr))

View File

@@ -0,0 +1,34 @@
#!/bin/sh
# As part of sysupgrade we migrate the users custom changes to the
# new fs. (Those which differ from the first boot defaults.)
# Abort on any error.
set -e
# Do nothing if user want to discard old settings.
if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then
exit 0
fi
# Source functions.
for f in /lib/upgrade/iopsys*.sh; do
[ -r "$f" -a -s "$f" ] || continue
source $f
done
# Does this system has WiFi?
hasWifi=$(chroot "${2}" db -q get hw.board.hasWifi)
[ "$hasWifi" = "1" ] || exit 0
uci_possibly_migrate_package "wireless" "$2" || exit
# Report success.
log "post-hooks" "UCI wireless migrated."
exit 0

View File

@@ -1,47 +0,0 @@
#!/bin/sh
. /usr/share/libubox/jshn.sh
if [ -f /tmp/wps-monitor.pid ]; then
kill -9 $(cat /tmp/wps-monitor.pid) 2>/dev/null
rm -f /tmp/wps-monitor.pid
fi
[ "$1" == "stop" ] && exit
WPSENABLED=0
for vif in $(uci show wireless | grep wifi-iface | awk -F[.,=] '{print$2}'); do
[ "$(uci -q get wireless.$vif.wps_pushbutton)" == "1" ] && WPSENABLED=1
done
if [ $WPSENABLED -eq 0 ]; then
ubus call led.wps set '{"state":"off"}'
exit
fi
ubus listen wifi.ap wifi.bsta | \
while read wpsevent ; do
#echo "wps-monitor got event: $event" >/dev/console
json_load "$wpsevent"
if json_select wifi.ap >/dev/null; then
json_get_var event event
if [ "$event" == "wps-pbc-active" ]; then
ubus call led.wps set '{"state":"notice"}'
elif [ "$event" == "wps-reg-success" ]; then
ubus call led.wps set '{"state":"ok","timeout":30}'
elif [ "$event" == "wps-timeout" ]; then
ubus call led.wps set '{"state":"off"}'
fi
elif json_select wifi.bsta >/dev/null; then
json_get_var event event
if [ "$event" == "wps-pbc-active" ]; then
ubus call led.wps set '{"state":"notice"}'
elif [ "$event" == "wps-success" ]; then
ubus call led.wps set '{"state":"ok","timeout":30}'
elif [ "$event" == "wps-timeout" ]; then
ubus call led.wps set '{"state":"off"}'
fi
fi
done &
echo $(($!-1)) $! >/tmp/wps-monitor.pid

View File

@@ -30,15 +30,7 @@ case "$ACTION" in
[ "wpsbutton" == "$INTERFACE" ] && {
[ -e "/tmp/wps_active" ] && return
echo "WPS button is pressed" > /dev/console
# TODO: Proper implementation
#ubus call wifi.wps start
wpasupp="$(ubus list wpa_supplicant.* | head -1)"
if [ -n "$wpasupp" ]; then
ubus -t 1 call $wpasupp wps_start
else
dev5g="$(uci show wireless | grep 'hwmode=.11a' | head -1 | cut -d '.' -f2)"
[ -n "$dev5g" ] && ubus -t 1 call hostapd.$dev5g wps_start
fi
ubus call wifi.wps start
}
;;
esac

View File

@@ -9,19 +9,13 @@ PROG=/usr/sbin/wifimngr
start_service() {
procd_open_instance
procd_set_param command ${PROG}
procd_set_param env LIBWIFI_DEBUG_LEVEL=3 #for debugging only
# procd_set_param env IOP_LLA_LIBS_DEBUG=3 #for debugging only
# procd_set_param stderr 1 #for debugging only
procd_set_param respawn
procd_close_instance
wps-monitor
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "wireless"
}

View File

@@ -25,31 +25,32 @@ LIB_MAP_OBJ tRootDynamicObj[] = {
static int add_xmpp_connection(char *refparam, struct dmctx *ctx, void *data, char **instance)
{
struct uci_section *xmpp_con = NULL, *xmpp_con_srv = NULL, *dmmap_xmpp = NULL;
char id[16];
struct uci_section *xmpp_con, *xmpp_con_srv, *dmmap_xmpp;
char *con_name, *con_srv_name, *last_inst, *v, *id;
char *last_inst = get_last_instance_bbfdm("dmmap_xmpp", "connection", "con_inst");
snprintf(id, sizeof(id), "%d", (last_inst) ? atoi(last_inst) + 1 : 1);
check_create_dmmap_package("dmmap_xmpp");
last_inst = get_last_instance_bbfdm("dmmap_xmpp", "connection", "con_inst");
dmasprintf(&id, "%d", (last_inst) ? atoi(last_inst) + 1 : 1);
dmuci_add_section("xmpp", "connection", &xmpp_con);
dmuci_add_section_and_rename("xmpp", "connection", &xmpp_con, &con_name);
dmuci_set_value_by_section(xmpp_con, "xmpp_id", id);
dmuci_set_value_by_section(xmpp_con, "enable", "0");
dmuci_set_value_by_section(xmpp_con, "interval", "30");
dmuci_set_value_by_section(xmpp_con, "attempt", "16");
dmuci_set_value_by_section(xmpp_con, "serveralgorithm", "DNS-SRV");
dmuci_add_section("xmpp", "connection_server", &xmpp_con_srv);
dmuci_add_section_and_rename("xmpp", "connection_server", &xmpp_con_srv, &con_srv_name);
dmuci_set_value_by_section(xmpp_con_srv, "con_id", id);
dmuci_set_value_by_section(xmpp_con_srv, "enable", "0");
dmuci_set_value_by_section(xmpp_con_srv, "port", "5222");
dmuci_add_section_bbfdm("dmmap_xmpp", "connection_server", &dmmap_xmpp);
dmuci_add_section_bbfdm("dmmap_xmpp", "connection_server", &dmmap_xmpp, &v);
dmuci_set_value_by_section(dmmap_xmpp, "section_name", section_name(xmpp_con_srv));
dmuci_set_value_by_section(dmmap_xmpp, "con_srv_inst", "1");
dmuci_add_section_bbfdm("dmmap_xmpp", "connection", &dmmap_xmpp);
dmuci_add_section_bbfdm("dmmap_xmpp", "connection", &dmmap_xmpp, &v);
dmuci_set_value_by_section(dmmap_xmpp, "section_name", section_name(xmpp_con));
*instance = update_instance(last_inst, 2, dmmap_xmpp, "con_inst");
*instance = update_instance(last_inst, 4, dmmap_xmpp, "con_inst", "dmmap_xmpp", "connection");
return 0;
}
@@ -132,7 +133,7 @@ static int get_xmpp_connection_supported_server_connect_algorithms(char *refpara
/*#Device.XMPP.Connection.{i}.Enable!UCI:xmpp/xmpp_connection,@i-1/enable*/
static int get_connection_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "enable", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value);
return 0;
}
@@ -290,7 +291,7 @@ static int set_xmpp_connection_server_connect_algorithm(char *refparam, struct d
/*#Device.XMPP.Connection.{i}.KeepAliveInterval!UCI:xmpp/xmpp_connection,@i-1/interval*/
static int get_xmpp_connection_keepalive_interval(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "interval", "-1");
dmuci_get_value_by_section_string((struct uci_section *)data, "interval", value);
return 0;
}
@@ -311,7 +312,7 @@ static int set_xmpp_connection_keepalive_interval(char *refparam, struct dmctx *
/*#Device.XMPP.Connection.{i}.ServerConnectAttempts!UCI:xmpp/xmpp_connection,@i-1/attempt*/
static int get_xmpp_connection_server_attempts(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "attempt", "16");
dmuci_get_value_by_section_string((struct uci_section *)data, "attempt", value);
return 0;
}
@@ -332,7 +333,7 @@ static int set_xmpp_connection_server_attempts(char *refparam, struct dmctx *ctx
/*#Device.XMPP.Connection.{i}.ServerRetryInitialInterval!UCI:xmpp/xmpp_connection,@i-1/initial_retry_interval*/
static int get_xmpp_connection_retry_initial_interval(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "initial_retry_interval", "60");
dmuci_get_value_by_section_string((struct uci_section *)data, "initial_retry_interval", value);
return 0;
}
@@ -353,7 +354,7 @@ static int set_xmpp_connection_retry_initial_interval(char *refparam, struct dmc
/*#Device.XMPP.Connection.{i}.ServerRetryIntervalMultiplier!UCI:xmpp/xmpp_connection,@i-1/retry_interval_multiplier*/
static int get_xmpp_connection_retry_interval_multiplier(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "retry_interval_multiplier", "2000");
dmuci_get_value_by_section_string((struct uci_section *)data, "retry_interval_multiplier", value);
return 0;
}
@@ -374,7 +375,7 @@ static int set_xmpp_connection_retry_interval_multiplier(char *refparam, struct
/*#Device.XMPP.Connection.{i}.ServerRetryMaxInterval!UCI:xmpp/xmpp_connection,@i-1/retry_max_interval*/
static int get_xmpp_connection_retry_max_interval(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "retry_max_interval", "30720");
dmuci_get_value_by_section_string((struct uci_section *)data, "retry_max_interval", value);
return 0;
}
@@ -395,7 +396,7 @@ static int set_xmpp_connection_retry_max_interval(char *refparam, struct dmctx *
/*#Device.XMPP.Connection.{i}.UseTLS!UCI:xmpp/xmpp_connection,@i-1/usetls*/
static int get_xmpp_connection_server_usetls(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "usetls", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "usetls", value);
return 0;
}
@@ -449,7 +450,7 @@ static int get_xmpp_connection_server_number_of_entries(char *refparam, struct d
/*#Device.XMPP.Connection.{i}.Server.{i}.Enable!UCI:xmpp/xmpp_connection,@i-1/enable*/
static int get_xmpp_connection_server_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "enable", "1");
dmuci_get_value_by_section_string((struct uci_section *)data, "enable", value);
return 0;
}
@@ -523,7 +524,7 @@ static int set_xmpp_connection_server_server_address(char *refparam, struct dmct
/*#Device.XMPP.Connection.{i}.Server.{i}.Port!UCI:xmpp/xmpp_connection,@i-1/port*/
static int get_xmpp_connection_server_port(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def((struct uci_section *)data, "port", "5222");
dmuci_get_value_by_section_string((struct uci_section *)data, "port", value);
return 0;
}
@@ -554,8 +555,8 @@ static int browsexmpp_connectionInst(struct dmctx *dmctx, DMNODE *parent_node, v
synchronize_specific_config_sections_with_dmmap("xmpp", "connection", "dmmap_xmpp", &dup_list);
list_for_each_entry(p, &dup_list, list) {
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 3,
p->dmmap_section, "con_inst", "con_alias");
inst = handle_update_instance(1, dmctx, &max_inst, update_instance_alias, 5,
p->dmmap_section, "con_inst", "con_alias", "dmmap_xmpp", "connection");
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p->config_section, inst) == DM_STOP)
break;
@@ -577,8 +578,8 @@ static int browsexmpp_connection_serverInst(struct dmctx *dmctx, DMNODE *parent_
list_for_each_entry(p, &dup_list, list) {
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 3,
p->dmmap_section, "con_srv_inst", "con_srv_alias");
inst = handle_update_instance(2, dmctx, &max_inst, update_instance_alias, 5,
p->dmmap_section, "con_srv_inst", "con_srv_alias", "xmpp", "connection_server");
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p->config_section, inst) == DM_STOP)
break;
@@ -589,58 +590,58 @@ static int browsexmpp_connection_serverInst(struct dmctx *dmctx, DMNODE *parent_
/* *** Device.XMPP. *** */
DMOBJ tDeviceXMPPObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"XMPP", &DMREAD, NULL, NULL, NULL, NULL, NULL, tXMPPObj, tXMPPParams, NULL, BBFDM_BOTH},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"XMPP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tXMPPObj, tXMPPParams, NULL, BBFDM_BOTH},
{0}
};
DMOBJ tXMPPObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"Connection", &DMWRITE, add_xmpp_connection, delete_xmpp_connection, NULL, browsexmpp_connectionInst, NULL, tXMPPConnectionObj, tXMPPConnectionParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "Username", "Domain", "Resource", NULL}},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"Connection", &DMWRITE, add_xmpp_connection, delete_xmpp_connection, NULL, browsexmpp_connectionInst, NULL, NULL, NULL, tXMPPConnectionObj, tXMPPConnectionParams, NULL, BBFDM_BOTH},
{0}
};
DMLEAF tXMPPParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"ConnectionNumberOfEntries", &DMREAD, DMT_UNINT, get_xmpp_connection_nbr_entry, NULL, BBFDM_BOTH},
{"SupportedServerConnectAlgorithms", &DMREAD, DMT_STRING, get_xmpp_connection_supported_server_connect_algorithms, NULL, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"ConnectionNumberOfEntries", &DMREAD, DMT_UNINT, get_xmpp_connection_nbr_entry, NULL, NULL, NULL, BBFDM_BOTH},
{"SupportedServerConnectAlgorithms", &DMREAD, DMT_STRING, get_xmpp_connection_supported_server_connect_algorithms, NULL, NULL, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.XMPP.Connection.{i}. *** */
DMOBJ tXMPPConnectionObj[] = {
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
{"Server", &DMREAD, NULL, NULL, NULL, browsexmpp_connection_serverInst, NULL, NULL, tXMPPConnectionServerParams, NULL, BBFDM_BOTH, LIST_KEY{"Alias", "ServerAddress", "Port", NULL}},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"Server", &DMREAD, NULL, NULL, NULL, browsexmpp_connection_serverInst, NULL, NULL, NULL, NULL, tXMPPConnectionServerParams, NULL, BBFDM_BOTH},
{0}
};
DMLEAF tXMPPConnectionParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_connection_enable, set_connection_enable, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_xmpp_connection_alias, set_xmpp_connection_alias, BBFDM_BOTH},
{"Username", &DMWRITE, DMT_STRING, get_xmpp_connection_username, set_xmpp_connection_username, BBFDM_BOTH},
{"Password", &DMWRITE, DMT_STRING, get_xmpp_connection_password, set_xmpp_connection_password, BBFDM_BOTH},
{"Domain", &DMWRITE, DMT_STRING, get_xmpp_connection_domain, set_xmpp_connection_domain, BBFDM_BOTH},
{"Resource", &DMWRITE, DMT_STRING, get_xmpp_connection_resource, set_xmpp_connection_resource, BBFDM_BOTH},
{"ServerConnectAlgorithm", &DMWRITE, DMT_STRING, get_xmpp_connection_server_connect_algorithm, set_xmpp_connection_server_connect_algorithm, BBFDM_BOTH},
{"KeepAliveInterval", &DMWRITE, DMT_LONG, get_xmpp_connection_keepalive_interval, set_xmpp_connection_keepalive_interval, BBFDM_BOTH},
{"ServerConnectAttempts", &DMWRITE, DMT_UNINT, get_xmpp_connection_server_attempts, set_xmpp_connection_server_attempts, BBFDM_BOTH},
{"ServerRetryInitialInterval", &DMWRITE, DMT_UNINT, get_xmpp_connection_retry_initial_interval, set_xmpp_connection_retry_initial_interval, BBFDM_BOTH},
{"ServerRetryIntervalMultiplier", &DMWRITE, DMT_UNINT, get_xmpp_connection_retry_interval_multiplier, set_xmpp_connection_retry_interval_multiplier, BBFDM_BOTH},
{"ServerRetryMaxInterval", &DMWRITE, DMT_UNINT, get_xmpp_connection_retry_max_interval, set_xmpp_connection_retry_max_interval, BBFDM_BOTH},
{"UseTLS", &DMWRITE, DMT_BOOL, get_xmpp_connection_server_usetls, set_xmpp_connection_server_usetls, BBFDM_BOTH},
{"JabberID", &DMREAD, DMT_STRING, get_xmpp_connection_jabber_id, NULL, BBFDM_BOTH},
{"Status", &DMREAD, DMT_STRING, get_xmpp_connection_status, NULL, BBFDM_BOTH},
{"ServerNumberOfEntries", &DMREAD, DMT_UNINT, get_xmpp_connection_server_number_of_entries, NULL, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_connection_enable, set_connection_enable, NULL, NULL, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_xmpp_connection_alias, set_xmpp_connection_alias, NULL, NULL, BBFDM_BOTH},
{"Username", &DMWRITE, DMT_STRING, get_xmpp_connection_username, set_xmpp_connection_username, NULL, NULL, BBFDM_BOTH},
{"Password", &DMWRITE, DMT_STRING, get_xmpp_connection_password, set_xmpp_connection_password, NULL, NULL, BBFDM_BOTH},
{"Domain", &DMWRITE, DMT_STRING, get_xmpp_connection_domain, set_xmpp_connection_domain, NULL, NULL, BBFDM_BOTH},
{"Resource", &DMWRITE, DMT_STRING, get_xmpp_connection_resource, set_xmpp_connection_resource, NULL, NULL, BBFDM_BOTH},
{"ServerConnectAlgorithm", &DMWRITE, DMT_STRING, get_xmpp_connection_server_connect_algorithm, set_xmpp_connection_server_connect_algorithm, NULL, NULL, BBFDM_BOTH},
{"KeepAliveInterval", &DMWRITE, DMT_LONG, get_xmpp_connection_keepalive_interval, set_xmpp_connection_keepalive_interval, NULL, NULL, BBFDM_BOTH},
{"ServerConnectAttempts", &DMWRITE, DMT_UNINT, get_xmpp_connection_server_attempts, set_xmpp_connection_server_attempts, NULL, NULL, BBFDM_BOTH},
{"ServerRetryInitialInterval", &DMWRITE, DMT_UNINT, get_xmpp_connection_retry_initial_interval, set_xmpp_connection_retry_initial_interval, NULL, NULL, BBFDM_BOTH},
{"ServerRetryIntervalMultiplier", &DMWRITE, DMT_UNINT, get_xmpp_connection_retry_interval_multiplier, set_xmpp_connection_retry_interval_multiplier, NULL, NULL, BBFDM_BOTH},
{"ServerRetryMaxInterval", &DMWRITE, DMT_UNINT, get_xmpp_connection_retry_max_interval, set_xmpp_connection_retry_max_interval, NULL, NULL, BBFDM_BOTH},
{"UseTLS", &DMWRITE, DMT_BOOL, get_xmpp_connection_server_usetls, set_xmpp_connection_server_usetls, NULL, NULL, BBFDM_BOTH},
{"JabberID", &DMREAD, DMT_STRING, get_xmpp_connection_jabber_id, NULL, NULL, NULL, BBFDM_BOTH},
{"Status", &DMREAD, DMT_STRING, get_xmpp_connection_status, NULL, NULL, NULL, BBFDM_BOTH},
{"ServerNumberOfEntries", &DMREAD, DMT_UNINT, get_xmpp_connection_server_number_of_entries, NULL, NULL, NULL, BBFDM_BOTH},
{0}
};
/* *** Device.XMPP.Connection.{i}.Server.{i}. *** */
DMLEAF tXMPPConnectionServerParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_xmpp_connection_server_enable, set_xmpp_connection_server_enable, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_xmpp_connection_server_alias, set_xmpp_connection_server_alias, BBFDM_BOTH},
{"ServerAddress", &DMWRITE, DMT_STRING, get_xmpp_connection_server_server_address, set_xmpp_connection_server_server_address, BBFDM_BOTH},
{"Port", &DMWRITE, DMT_UNINT, get_xmpp_connection_server_port, set_xmpp_connection_server_port, BBFDM_BOTH},
/* PARAM, permission, type, getvalue, setvalue, forced_inform, notification, bbfdm_type*/
{"Enable", &DMWRITE, DMT_BOOL, get_xmpp_connection_server_enable, set_xmpp_connection_server_enable, NULL, NULL, BBFDM_BOTH},
{"Alias", &DMWRITE, DMT_STRING, get_xmpp_connection_server_alias, set_xmpp_connection_server_alias, NULL, NULL, BBFDM_BOTH},
{"ServerAddress", &DMWRITE, DMT_STRING, get_xmpp_connection_server_server_address, set_xmpp_connection_server_server_address, NULL, NULL, BBFDM_BOTH},
{"Port", &DMWRITE, DMT_UNINT, get_xmpp_connection_server_port, set_xmpp_connection_server_port, NULL, NULL, BBFDM_BOTH},
{0}
};