Commit graph

493 commits

Author SHA1 Message Date
Amin Ben Ramdhane
234d0f8f33 Update code generation 2020-03-17 16:21:48 +01:00
Amin Ben Ramdhane
389ae8cdb7 add get value of Device.IP.Interface.{i}.IPv4Address.{i}.Staus parameter 2020-03-17 16:20:59 +01:00
Amin Ben Ramdhane
bf8737c49e Update the time format according to the standard 2020-03-17 14:11:52 +01:00
Daniel Danzberger
17e255c450 Only link SSL libraries when selected by config
This commit fixes '-lssl' and '-lmbedtls' being linked even when they
haven't been selected by --enable-libmbedtls or --enable-libopenssl

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-17 12:54:26 +01:00
Daniel Danzberger
ff759d2cca tr181: Add OS specific implementations
When code is build with --enable-generic-openwrt,
the tr181 implementations from dmtree/tr181/.*-openwrt.c are used.
Otherwise for IOPSYS-WRT, dmtree/tr181/*-iopsyswrt.c sources are used.

Note that all functions that have OS specific handlers, are prefixed
with 'os__' and are implemented in their OS specific file.

Functions that are only available in IOPSYS-WRT are prefixed with
'os_iopsys_*'.

More OpenWrt OS impelementations will follow in future commits.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-17 12:54:26 +01:00
Amin Ben Ramdhane
ce8bf4e319 Update the time format according to the standard 2020-03-16 23:29:02 +01:00
Amin Ben Ramdhane
65f38dccb1 DeviceInfo: Update parameters according to new ubus format 2020-03-16 18:05:17 +01:00
Amin Ben Ramdhane
faf175823b ManagementServer: fix some issues according to the standard
- Fix the value of Device.ManagementServer.PeriodicInformTime parameter
2020-03-16 17:59:59 +01:00
Amin Ben Ramdhane
0205794276 PTM: fix some issues according to the standard
- Device.PTM.Link.{i}.Enable : add set value function
 - Device.PTM.Link.{i}.Status : add get value function
 - Fix the value of some parameters
2020-03-16 17:58:33 +01:00
Amin Ben Ramdhane
0b6a9b2f12 ATM: fix some issues according to the standard
- Device.ATM.Link.{i}.Enable : add set value function
 - Device.ATM.Link.{i}.Status : add get value function
 - Fix the value of some parameters
2020-03-16 17:57:14 +01:00
Amin Ben Ramdhane
198c207e6e VoiceService: fix some issues according to the standard
- VoiceService.{i}.VoiceProfile.{i}.Name : add set value
 - Fix the value of some parameters
2020-03-16 17:50:55 +01:00
Omar Kallel
e92a4d81b2 Improve dmasprintf function: dynamic allocation instead of buffer fix size 2020-03-16 17:02:54 +01:00
Amin Ben Ramdhane
a1f7ce98cf Ticket refs #1254: Improvement validation parameters 2020-03-13 16:28:32 +01:00
Jeff Lyons
1f9c6b08d3 add default response to get_value_security_mode to prevent SEGV 2020-03-13 08:19:16 +00:00
Amin Ben Ramdhane
488066671c tr104,tr157: Remove unused functions 2020-03-10 23:43:37 +01:00
Amin Ben Ramdhane
323b40d8aa Only export symbols to the library that belong to the API interface (complement: tr104, tr143 and tr157) 2020-03-10 23:32:03 +01:00
Amin Ben Ramdhane
69fc84cc37 Remove static definitions of functions used by other packages
These functions are called in icwmp package.
2020-03-10 22:25:48 +01:00
Daniel Danzberger
26ec85f20e Fix warnings when neither mbedtls nor openssl is build
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-10 17:44:23 +01:00
Daniel Danzberger
521e38a853 Fix snprintf destination buffer sizes
Fixes snprintf truncated output compiler warnings.

Example:
--
../dmentrylibrary.c:31:38: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
   31 |     snprintf(buf, sizeof(buf), "%s/%s", folder_path, entry->d_name);
      |                                      ^
../dmentrylibrary.c:31:5: note: ‘snprintf’ output 2 or more bytes (assuming 257) into a destination of size 256
   31 |     snprintf(buf, sizeof(buf), "%s/%s", folder_path, entry->d_name);
--

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-10 14:34:08 +01:00
Daniel Danzberger
a377f7dfd2 tr181: Remove unused functions
This fixes 'defined but not used' compiler warnings

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-10 13:36:37 +01:00
Daniel Danzberger
0460307fb4 Only export symbols to the library that belong to the API interface
This commit makes all symbols that are not part of the API Interface,
or used only in the object files where they are defined, static.

Causing the following benefits:
 - The compiler can resolve functions for better performance
 - The library size is decreased

NOTE: Spec file generators need to be adjusted for newer spec's to not do the same mistakes again

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-09 21:23:57 +01:00
Daniel Danzberger
9b8a2de146 Add --enable-generic-openwrt configure option
This option allows selecting between a build with IOPSYS WRT features,
like the "router.*" ubus objects and a generic OpenWrt.

When GENERIC_OPENWRT is defined, only features that are available on a
generic openwrt build should be used.

This option is disabled by default.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-09 12:53:02 +01:00
Daniel Danzberger
43b4cff541 Don't define _XOPEN_SOURCE when compiling with _GNU_SOURCE
_XOPEN_SOURCE is included by _GNU_SOURCE.
This fixes redefinition errors of _XOPEN_SOURCE when the libc
implementations define it because of _GNU_SOURCE.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-03-09 12:25:13 +01:00
Omar Kallel
fbedd21f07 Ticket refs #1835: Device.Security. object (code style review) 2020-03-04 12:06:11 +01:00
Omar Kallel
5b0bc22622 Ticket Refs #1835: TR-181: Device.Security object 2020-03-03 15:30:08 +01:00
Amin Ben Ramdhane
2b7ead2d60 Improvement of the excel generator 2020-03-03 00:01:23 +01:00
Amin Ben Ramdhane
e15bb5d2c9 Update DeviceInfo.ProcessStatus.Process. object 2020-03-02 19:31:26 +01:00
Amin Ben Ramdhane
862c54780e Update WiFi object with new ubus calls: wifi, wifi.radio, wifi.ap 2020-03-02 19:28:07 +01:00
Amin Ben Ramdhane
1cc121df01 Excel generator: add new column for protocols 2020-03-02 11:17:32 +01:00
Amin Ben Ramdhane
fa7642d9cd Ticket refs #1845: bbf-tools: generate supported USP operate commands 2020-02-27 17:13:39 +01:00
Amin Ben Ramdhane
be7204e16e Update json file + upnp: add mapping parameters 2020-02-21 18:49:28 +01:00
Amin Ben Ramdhane
29b85e3edd Add a comment for unsupported parameters 2020-02-21 18:48:27 +01:00
Amin Ben Ramdhane
d80716634a Ticket refs #1254: validation parameters: add the missing objects 2020-02-21 11:47:42 +01:00
Amin Ben Ramdhane
905d78844c Ticket refs #1254: TR-x69: add support for parameter validation 2020-02-20 23:25:49 +01:00
Amin Ben Ramdhane
3848bac3aa WiFi Object: use new wifi.radio and wifi.ap ubus objects
- read WiFi.Radio and WiFi.SSID from iopsys wifi.radio and wifi.ap ubus objects instead of reading them from sysfs or ifconfig
2020-02-20 10:13:10 +01:00
Daniel Danzberger
1ea3b384d6 tr181: dynamicdns: fix invalid call to snprintf
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
dd31072c40 dmubus: remove deprectated is_error macro
This fixes undefined reference erros when linking against newer
libjson-c versions.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
84f3354f5c tr181: dhcpv4: Use uint64_t for lease timestamp
The timestamp written by dnsmasq in the dhcp.leases file has 64 bit.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
234ab4e70d Add missing library libdl when linking
This fixes undefined reference errors for libdl functions
when linking against -libbbfdm

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
c0f6b6d08a Add libbbf_api includes to automake
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
2351a47144 dmbbf: don't call undefined functions
The function enabled_notify_check_value_change_param() calls these 2
functions that have no definition or decleration:

- add_list_value_change()
- send_active_value_change()

This commit comments them out.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
fe370c6ae5 dmcommon: avoid memory duplication when fusion dup_list
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
c0729c7e2d tr181: dhcpv4: fix invalid bit shift when calculating netmask
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
eee74363db tr181: fix segfault on random stack value
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
bae3028d48 tr181: dhcpv4: fix segfault on interface_get_ipv4
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
4ebedcf707 tr181: dhcpv4: fixes and improvements
- don't export symbols that are not used ouside of dhcpv4.c
- make read only values const
- remove uneceessary memory allocations and duplications
- avoid "router.network" calls for compatibitliy with generic openwrt builds
- move redundand code to functions
- remove tab indents on empty lines
- avoid opening and parsing DHCP_LEASE_FILE multiple times

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
7779fc6928 dmubus: improve chache handling
- use less memory
- decrease lookup time
- make read only variables const
- remove unused variables / macros

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
588db7e54f dmubus: fixes and improvements
- use libubus instead of fork and exec ubus program
- move redundant code to static functions
- don't export ubus_ctx. It's only used in dmubus.c
- mark static gobals static
- remove unecessary json to blobmsg conversions/allocations when preparing parameters for ubus_invoke
- fix memleaks on not freeing ubus_ctx from ubus_connect
- fix invoking requests on random stack value id when ubus_lookup_id failed
- don't connect/disconnect on every request
- don't reallocate blob_buf on every request

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
ef30a322a0 Fix invalid logic when checking datamodel type
This fixes BBFDM_CWMP values not shown when BBFDM_BOTH is set as bbfdatamodel_type.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
ff77bdaebc tr181: wifi: remove invalid Radio statistics
There are no radio device (phy) statistic counters in linux.
To implement this, it would be necessary to collect stats from all
wirless interfaces on this phy.
Maybe this can be implemented in the future.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00