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>
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>
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>
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>
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>
_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>
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>
- 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>
- use less memory
- decrease lookup time
- make read only variables const
- remove unused variables / macros
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
- 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>
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>