Commit graph

493 commits

Author SHA1 Message Date
Daniel Danzberger
cda2d2a61c tr181: wifi: fix invalid SSID stats
There is not always an "ifname" option in the wifi-iface section.
This commit uses ubus to resolve the right interface for the SSID.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
b135d0b5ae Remove get_stats_from_ifconfig_command function
This function was only used to query interface statistics,
which are now read direclty from sysfs.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
a3f395926f tr181: ppp: read stats from sysfs instead of ubus
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
405a55318d tr181: wifi: read stats from sysfs instead of ubus
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
ba1ab53f9f tr181: bridging: read statistics from sysfs
NOTE:
Current ifname resolution for the bridge port isn't working.
Hence Ports stats are not getting set.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
2a34538a94 tr181: usb: read usb net stats from sysfs
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
3e903fc731 tr181: ethernet: Fixes and cleanups
- use sysfs instread of ubus and ifconfig command execution for Inteface stats.
  This reduces uneccessary memory and cpu overhead and speeds up the query time for
  IP.Interface queries by a multiple.

- move redundant code to static functions
- fix rx/tx multicast/broadcast stats can never be obtained from ifconfig
- fix invalid stats for unknownprotopackets.
- fix stats not correclty reported when counters exceed 32bit int values.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:53:48 +01:00
Daniel Danzberger
219d9b4984 tr181: ip: Fixes and cleanups
- use sysfs instread of ubus and ifconfig command execution for Inteface stats.
  This reduces uneccessary memory and cpu overhead and speeds up the query time for
  IP.Interface queries by a multiple.

- move redundant code to static functions
- fix rx/tx multicast/broadcast stats can never be obtained from ifconfig
- fix invalid stats for unknownprotopackets.
- fix stats not correclty reported when counters exceed 32bit int values.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
8708940709 Read mac address from sysfs instead of ubus
This is much faster

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
7ce4410723 dmuci: fix some const compiler warnings
Read-only values should be marked with const to help the compiler
optimize code. But this would requrire a bigger rewirte of all the code,
hence the original code did not use const at all.

This should be done in the future to ensure good code quality
and performance.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
994897a70d dmcommon.c: use const on read only value
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
d744cc4832 tr181: bridge: Fix use of uninitalized meomory
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
345c466875 tr181: USB: Fixes and cleanups
- avoid uneccessary memory allocations
- move {read,write}FileContent functions to usb source file where they are used exclusively and make them static
- fix bad logic in readFileContent
- move redundant code to static functions
- fix get_USBUSBHostsHostDevice_MaxChildren never returning any value
- fix no interface instances being created
- make some functions that are not exported static
- fix segfault on get_USBInterface_Enable when the interface is down
- fix segfault on get_USBInterface_Status when the interface is down.
- fix segfault on missing format character in get_USBInterface_LowerLayers.
- fix segfault and double frees on recrusive browseUSBUSBHostsHostInst() calls.
- reduce overall memory usage
- use const on read-only values
- fix invalid comparision on strstr return value

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
fb12136904 dmuci: fix returning of invalid pointers
This fixes segfaults and pointers with invalid strings for:
 - dmuci_add_section
 - dmuci_set_value_by_section
 - dmuci_set_value

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
1cec0190fd tr181: fix return of uninitalized pointer
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
f9a9896005 dmentryjson.c: Fix use of uninitialized memory
next_obj wasn't initialized when the object number was zero.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
033380161d Fix memleak from not freed uci_list_configs pointers
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
95e1f34a7f Fix memleaks from unclosed opendir calls
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
258331fdd5 Fix memleaks from not freed regcomp allocations
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
65cacf7f49 Fix memleaks created by calls to strsplit
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
313cb9921c Fix get_USB_InterfaceNumberOfEntries memory issues
- Fix Leaking on buffer allocation by using stack buffer
- Fix access on uninitalized and not zero terminated string returnd from
readlink()

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
ef6f0cafe4 Add missing format string character
This fixes segfaults on get_IPInterfaceIPv6Prefix_ParentPrefix calls.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
e7084843b8 Fix segfaults on returned NULL pointers
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
cdf945ac57 Avoid strlen on uninitialized memory
Update fsize by the actual read bytes from fread,
because ftell will always return 4k on sysfs files.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
ddf03e43c7 Fix segfault when /etc/bbfm/[pkg] can't be created
Use unified function 'dmmap_file_path_get' and reuse it in
every function where the segfault occured.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:28 +01:00
Daniel Danzberger
2c118cd2b3 Fix several segfaults when UCI values are not available
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:27 +01:00
Daniel Danzberger
e113575168 Fix undefined reference errors when linking aginst libbbfdm.so
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:27 +01:00
Daniel Danzberger
4913850a10 Add install include files to automake
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:27 +01:00
Daniel Danzberger
8fb844f970 Fix memory issues on 64bit systems
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2020-02-19 11:51:27 +01:00
Jomily K Joseph
c0bb8e7f24 Revert "Layer2 Deployment : Changes done to support VLAN deployments for layer 2"
This reverts commit 1f3e1d8744
2020-02-19 06:04:37 +01:00
jjoseph
1f3e1d8744 Layer2 Deployment : Changes done to support VLAN deployments for layer 2
- Changes done in Bridging.Bridge.X.Port, Bridging.Bridge.X.VLAN Objects
- Changes done in IP.Interface Objects
- Changes done in Ethernet Objects

TODO : Few more deployments needs to be covered. Also to add supoort for
	VLANPort and VLANTermination.
2020-02-18 16:05:29 +05:30
Amin Ben Ramdhane
4f8a100d7a Update README.md 2020-02-16 23:00:48 +01:00
Amin Ben Ramdhane
ff14c27fc3 clean up the source code
- remove unused variables
- fix coding style of most function (Indentation, Tabulation, ..)
- check the source code using cppcheck tool
- change sprintf by snprintf
2020-02-12 19:08:49 +01:00
Amin Ben Ramdhane
c76b2f3354 Add a comment for unsupported parameters 2020-02-11 13:57:07 +01:00
Omar Kallel
142e830426 Fix compiling errors when TR064 is activated 2020-02-10 18:56:13 +01:00
Omar Kallel
3ca094e06f Device.UPnP. object code review: LGPL License comment, remove unused variables, segmentation fault 2020-02-10 12:40:23 +01:00
Omar Kallel
dd91c79319 Ticket refs #1334: TR-181: Device.UPnP. object 2020-02-07 16:36:11 +01:00
vdutta
fdb4b9ab76 bbf: Update db parameters 2020-02-04 12:19:19 +05:30
Amin Ben Ramdhane
4ab526b9f2 Ticket refs#1598: libbbfdm: plug-in based with support for dynamic loading of libraries + separate libbbfdm into two libraries: libbbf_api (API) and libbbfdm (data model) 2020-01-21 22:43:37 +01:00
Amin Ben Ramdhane
bb70a0129c Fix the 9005 issue of GetParameterValue 'Device.WiFi.NeighboringWiFiDiagnostic.Result.' parameters 2020-01-16 16:35:45 +01:00
Amin Ben Ramdhane
87df704882 Fix memory leak in 'Device.ManagementServer.ConnReqJabberID' parameter 2019-12-28 14:29:21 +01:00
Amin Ben Ramdhane
fc96c5f78b change 'twamp_refector' to 'twamp_reflector' 2019-12-28 12:57:49 +01:00
Omar Kallel
64b64bcaa9 Device.User segfault 2019-12-27 18:30:33 +01:00
Amin Ben Ramdhane
ed50a21c79 Change the value of 'Device.Users.User.{i}.Password' parameter to empty according to the standard 2019-12-20 23:50:30 +01:00
Amin Ben Ramdhane
8eed245614 Change the value of 'Device.ManagementServer.STUNPassword' parameter to empty according to the standard
Change the value of 'Device.ManagementServer.ConnReqXMPPConnection' parameter to empty if xmpp config is not supported
2019-12-20 23:49:35 +01:00
Amin Ben Ramdhane
31b2dc70ca Change License to LGPLv2.1 in the generator code file 2019-12-20 23:19:25 +01:00
Amin Ben Ramdhane
1c4ac9eb9e Fix of missing parameters in Excel file 2019-12-20 23:08:44 +01:00
Omar Kallel
b46d5e05ac Device.Ethernet.Link. DeleteObject 2019-12-19 15:47:21 +01:00
Omar Kallel
aacf209044 Fix VLANTermination LowerLayers 2019-12-19 10:14:49 +01:00
Amin Ben Ramdhane
6441cc6001 Fix the value of Device.Services.VoiceService.{i}.VoiceProfile.{i}.Line.{i}.SIP.URI parameter 2019-12-17 17:52:46 +01:00