Commit graph

52 commits

Author SHA1 Message Date
vdutta
720ebfa873 Build cpack release for downstream job 2022-06-10 14:31:42 +00:00
suvendhu
889c15feeb Fix ticket#7333 fix cppcheck warnings 2022-02-22 18:24:19 +05:30
Amin Ben Ramdhane
080f7b4f85 Ticket refs #7333: fix warnings, code analysis and clean up the code
- Fix all errors catched by cppcheck threadsafety (cppcheck --error-exitcode=0 --addon=threadsafety bbf)
 - Fix some errors catched by cppcheck cert (cppcheck --error-exitcode=0 --addon=cert bbf)
 - Add new str-protected macros instead of using str functions directly to avoid crashes
2022-02-16 10:33:59 +00:00
Amin Ben Ramdhane
c3ea9e5597 Ticket refs #6892: Parameters used for pathname reference cannot be set to empty 2022-01-10 10:20:03 +01:00
Neeraj Bijalwan
2864ddeacd Add version in parameters 2021-11-03 09:30:12 +01:00
Amin Ben Ramdhane
42bc8e95a7 Ticket refs #5773: improve and simplify handle instance in browser and add functions 2021-09-09 16:56:02 +00:00
Amin Ben Ramdhane
0d76a55d25 fix compiler warnings on x86 2021-04-23 11:42:08 +01:00
Amin Ben Ramdhane
5e97bdb5e4 bbf: add support for vendor extension 2021-03-25 16:06:31 +01:00
Amin Ben Ramdhane
cdad11d92d Ticket refs #4386: dm_validate_string in libbbf_api requires length of enumeration and pattern arrays to be hardcoded at caller
- use NULL-terminated arrays instead of providing length by the caller
2021-02-15 21:13:18 +01:00
Amin Ben Ramdhane
92d1f62cab bbf: cleanup
- fix flawfinder and cppcheck issues
 - remove all unused functions
2021-02-10 17:31:55 +01:00
Amin Ben Ramdhane
b9a12b057b remove tr064 feature and cleanup 2020-12-16 10:03:25 +01:00
Amin Ben Ramdhane
3906faa12d Ticket refs #3730: bbf: fix Static Code Analysis 2020-12-16 10:00:19 +01:00
Amin Ben Ramdhane
5d10fba083 bbf: improve and cleanup the code
- update_instance_alias: read config and type section from the passed section in handle_update_instance
 - remove append_dot_to_string() function
2020-12-06 22:18:18 +01:00
Amin Ben Ramdhane
18643f29b3 bbf: enhance the code
- remove unused argument from dmuci_add_section() and dmuci_add_section_bbfdm() functions
 - use snprintf instead of dmasptintf
 - change function name: add_list_paramameter -> add_list_parameter
2020-11-23 10:58:48 +01:00
Amin Ben Ramdhane
954c8d0bbd Device.USB.USBHosts.Host.{i}.Device.{i}.VendorID: converts its value from hex to unsigned int 2020-11-19 11:25:31 +01:00
Omar Kallel
c8de221c11 Ticket refs #3725: bbf: remove unnecessary arguments from object/parameter definition 2020-11-17 16:21:11 +01:00
Amin Ben Ramdhane
437273a254 Ticket refs #3489: TR181: Invalid enumeration parameter values 2020-11-11 11:32:14 +01:00
Amin Ben Ramdhane
8ba74d624b bbf: add unique_keys argument to the comment
-  change (const char *[]) -> LIST_KEY
2020-10-17 14:54:33 +01:00
Amin Ben Ramdhane
5839164c29 TR-181: Fixed invalid int && unsignedInt && hexBinary parameter values 2020-10-17 14:08:40 +01:00
Shubham Sharma
a9fc190ed1 get_schema: Get unique keys from multi instance objects
- As per TR181, there could be one or more unique keys for each
   multi-instance object. Added support to get the unique keys
   associated with the multi-instance object.
 - Changes for generate_source_code.sh to have unique keys as
   extra object parameter.
2020-10-13 10:51:47 +01:00
Amin Ben Ramdhane
027d8fb599 bbf: save diagnostics data under '/etc/bbfdm/dmmap_diagnostics' instead of '/vat/state/cwmp' 2020-09-28 10:08:13 +01:00
Omar Kallel
92cdf363f5 Ticket refs #3228: QEMU - ICWMP is segfaulting 2020-09-21 17:48:26 +01:00
Amin Ben Ramdhane
bbecdd7444 Ticket refs #2845: bbf: add support the case uci config is updated manually 2020-08-22 16:37:32 +01:00
Amin Ben Ramdhane
efe2ca135b Device.IP: fix the get/set of IPv4Capable and IPv6Capable parameters 2020-05-31 20:57:52 +01:00
Amin Ben Ramdhane
00c60187fb Ticket refs #2483: TR-181: most Alias values are empty 2020-04-20 00:18:52 +01:00
Amin Ben Ramdhane
8f500aab97 Revert "Ticket refs #2483: TR-181: most Alias values are empty" 2020-04-17 13:45:45 +01:00
Amin Ben Ramdhane
4c4d298b0d Ticket refs #2483: TR-181: most Alias values are empty 2020-04-17 13:04:51 +01:00
Amin Ben Ramdhane
159a2607b9 change sprintf -> snprintf 2020-04-16 12:03:12 +01:00
Omar Kallel
3094867d3e Ticket refs #2337: Device.USB. TR181 object: fix issues related to Set/Get of some parameters 2020-04-02 10:52:40 +01:00
Omar Kallel
e3788f3400 Fix bugs: Device.USB object 2020-04-01 06:01:09 +01:00
Amin Ben Ramdhane
a1f7ce98cf Ticket refs #1254: Improvement validation parameters 2020-03-13 16:28:32 +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
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
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
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
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
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
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
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
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
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
Sukru Senli
1e11720828 Change License to LGPLv2.1 2019-12-04 09:52:05 +01:00
Amin Ben Ramdhane
8ab504585c Fix memory leaks and all warnings 2019-11-11 10:46:10 +01:00
Amin Ben Ramdhane
d4298475a3 Ticket refs #1262: bbf-datamodels: dynamic addition of datamodel parameters 2019-10-17 15:58:22 +01:00
Amin Ben Ramdhane
4777b9166f change cwmp -> bbfdm 2019-09-15 11:52:54 +01:00