Commit graph

20 commits

Author SHA1 Message Date
Amin Ben Ramdhane
3589aabbc4 Cleanup + remove unused function and struct + improvement the source code 2020-03-29 14:24:51 +01:00
Jomily K Joseph
fa07b8c3b6 bbf: Layer2 Vlan Deployment changes
- Changes done in IP.Interface, Device.Ethernet, Bridging.Bridge objects.
2020-03-25 11:45:10 +01:00
Omar Kallel
a25b8584cb Fix bugs: Device.WiFi.Radio 2020-03-19 09:45:26 +01:00
Amin Ben Ramdhane
a1f7ce98cf Ticket refs #1254: Improvement validation parameters 2020-03-13 16:28:32 +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
5b0bc22622 Ticket Refs #1835: TR-181: Device.Security object 2020-03-03 15:30:08 +01:00
Amin Ben Ramdhane
905d78844c Ticket refs #1254: TR-x69: add support for parameter validation 2020-02-20 23:25:49 +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
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
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
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
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
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
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
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
Omar Kallel
dd91c79319 Ticket refs #1334: TR-181: Device.UPnP. object 2020-02-07 16:36:11 +01:00
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
Renamed from dmcommon.h (Browse further)