RDKB-65730: Integrate Dynamic Table Support - Build Time Disabled#396
Open
yogeswaransky wants to merge 4 commits into
Open
RDKB-65730: Integrate Dynamic Table Support - Build Time Disabled#396yogeswaransky wants to merge 4 commits into
yogeswaransky wants to merge 4 commits into
Conversation
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a build-time toggle for Dynamic Table (TR-181 table traversal) support, defaulting the feature to disabled, and gates the related code paths behind ENABLE_DYNAMIC_TABLE_SUPPORT.
Changes:
- Introduces
--enable-dynamic-table-supportinconfigure.ac, defining-DENABLE_DYNAMIC_TABLE_SUPPORTwhen enabled. - Wraps Dynamic Table structs/APIs and related logic in
#ifdef ENABLE_DYNAMIC_TABLE_SUPPORTacross parser/reportgen/profile/util code. - Adjusts runtime behavior to ignore
dataModelTableparameters when the feature is disabled.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
configure.ac |
Adds configure-time option and defines ENABLE_DYNAMIC_TABLE_SUPPORT macro via CPPFLAGS. |
source/utils/t2common.h |
Conditionally exposes DataModelParam/DataModelTable and related APIs only when enabled. |
source/utils/t2common.c |
Conditionally compiles Dynamic Table free helpers and matchesParameter(). |
source/t2parser/t2parser.c |
Conditionally compiles DataModelTable parsing helpers and ignores dataModelTable when disabled. |
source/reportgen/reportgen.c |
Conditionally compiles Dynamic Table JSON encoding helpers/branch. |
source/bulkdata/profile.h |
Makes Profile::dataModelTableList conditional on the feature flag. |
source/bulkdata/profile.c |
Conditionally frees/uses dataModelTableList when enabled. |
Comment on lines
+97
to
+99
| #ifdef ENABLE_DYNAMIC_TABLE_SUPPORT | ||
| Vector *dataModelTableList; // List of DataModelTable | ||
| #endif |
Comment on lines
150
to
+164
| @@ -160,12 +161,15 @@ typedef struct _DataModelTable | |||
| char *index; | |||
| Vector *paramList; // List of DataModelParam | |||
| } DataModelTable; | |||
| #endif | |||
Comment on lines
+222
to
+239
| ENABLE_DYNAMIC_TABLE_SUPPORT=false | ||
| AC_ARG_ENABLE([dynamic-table-support], | ||
| AS_HELP_STRING([--enable-dynamic-table-support],[enable dynamic TR-181 table traversal support (default is no)]), | ||
| [ | ||
| case "${enableval}" in | ||
| yes) ENABLE_DYNAMIC_TABLE_SUPPORT=true ;; | ||
| no) ENABLE_DYNAMIC_TABLE_SUPPORT=false ;; | ||
| *) AC_MSG_ERROR([bad value ${enableval} for --enable-dynamic-table-support]) ;; | ||
| esac | ||
| ], | ||
| [echo "dynamic table support is disabled"]) | ||
| AM_CONDITIONAL([ENABLE_DYNAMIC_TABLE_SUPPORT], [test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue]) | ||
|
|
||
| if test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue; then | ||
| CPPFLAGS="$CPPFLAGS -DENABLE_DYNAMIC_TABLE_SUPPORT" | ||
| fi | ||
|
|
||
| AC_MSG_NOTICE([Dynamic table support: $ENABLE_DYNAMIC_TABLE_SUPPORT]) |
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Comment on lines
+97
to
+99
| #ifdef ENABLE_DYNAMIC_TABLE_SUPPORT | ||
| Vector *dataModelTableList; // List of DataModelTable | ||
| #endif |
Comment on lines
+222
to
+240
| ENABLE_DYNAMIC_TABLE_SUPPORT=false | ||
| AC_ARG_ENABLE([dynamic-table-support], | ||
| AS_HELP_STRING([--enable-dynamic-table-support],[enable dynamic TR-181 table traversal support (default is no)]), | ||
| [ | ||
| case "${enableval}" in | ||
| yes) ENABLE_DYNAMIC_TABLE_SUPPORT=true ;; | ||
| no) ENABLE_DYNAMIC_TABLE_SUPPORT=false ;; | ||
| *) AC_MSG_ERROR([bad value ${enableval} for --enable-dynamic-table-support]) ;; | ||
| esac | ||
| ], | ||
| [echo "dynamic table support is disabled"]) | ||
| AM_CONDITIONAL([ENABLE_DYNAMIC_TABLE_SUPPORT], [test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue]) | ||
|
|
||
| if test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue; then | ||
| CPPFLAGS="$CPPFLAGS -DENABLE_DYNAMIC_TABLE_SUPPORT" | ||
| fi | ||
|
|
||
| AC_MSG_NOTICE([Dynamic table support: $ENABLE_DYNAMIC_TABLE_SUPPORT]) | ||
|
|
Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Comment on lines
+222
to
+239
| ENABLE_DYNAMIC_TABLE_SUPPORT=false | ||
| AC_ARG_ENABLE([dynamic-table-support], | ||
| AS_HELP_STRING([--enable-dynamic-table-support],[enable dynamic TR-181 table traversal support (default is no)]), | ||
| [ | ||
| case "${enableval}" in | ||
| yes) ENABLE_DYNAMIC_TABLE_SUPPORT=true ;; | ||
| no) ENABLE_DYNAMIC_TABLE_SUPPORT=false ;; | ||
| *) AC_MSG_ERROR([bad value ${enableval} for --enable-dynamic-table-support]) ;; | ||
| esac | ||
| ], | ||
| [echo "dynamic table support is disabled"]) | ||
| AM_CONDITIONAL([ENABLE_DYNAMIC_TABLE_SUPPORT], [test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue]) | ||
|
|
||
| if test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue; then | ||
| CPPFLAGS="$CPPFLAGS -DENABLE_DYNAMIC_TABLE_SUPPORT" | ||
| fi | ||
|
|
||
| AC_MSG_NOTICE([Dynamic table support: $ENABLE_DYNAMIC_TABLE_SUPPORT]) |
Comment on lines
112
to
115
| if(profile->dataModelTableList) | ||
| { | ||
| Vector_Destroy(profile->dataModelTableList, NULL); | ||
| } |
Comment on lines
+252
to
254
| #ifdef ENABLE_DYNAMIC_TABLE_SUPPORT | ||
| //Function to get the basePath like Device.WiFi.AccessPoint. | ||
| int getBasePath(const char *input, char *basePath, size_t maxLength) |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
configure.ac:239
- With dynamic table support disabled by default, build-time hiding of DataModelTable/Profile::dataModelTableList causes the existing *_dynamictable_gtest.bin test sources (e.g., source/test/t2parser/t2parser_dynamictable_Test.cpp, source/test/reportgen/reportgen_dynamictable_Test.cpp) to fail to compile because they reference these symbols without #ifdef guards. The new AM_CONDITIONAL is defined here but those test binaries are still built unconditionally in their Makefile.am files; they should be wrapped in
if ENABLE_DYNAMIC_TABLE_SUPPORT(or the test sources should be made to compile/skip like profile_dynamictable_Test.cpp).
ENABLE_DYNAMIC_TABLE_SUPPORT=false
AC_ARG_ENABLE([dynamic-table-support],
AS_HELP_STRING([--enable-dynamic-table-support],[enable dynamic TR-181 table traversal support (default is no)]),
[
case "${enableval}" in
yes) ENABLE_DYNAMIC_TABLE_SUPPORT=true ;;
no) ENABLE_DYNAMIC_TABLE_SUPPORT=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-dynamic-table-support]) ;;
esac
],
[echo "dynamic table support is disabled"])
AM_CONDITIONAL([ENABLE_DYNAMIC_TABLE_SUPPORT], [test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue])
if test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue; then
CPPFLAGS="$CPPFLAGS -DENABLE_DYNAMIC_TABLE_SUPPORT"
fi
AC_MSG_NOTICE([Dynamic table support: $ENABLE_DYNAMIC_TABLE_SUPPORT])
source/test/mocks/profileStub.c:115
- When dynamic table support is enabled, dataModelTableList elements are DataModelTable allocations (with nested paramList). Destroying the vector with a NULL element free function leaks those allocations and can break valgrind-based tests; use freeDataModelTable here to match production cleanup.
if(profile->dataModelTableList)
{
Vector_Destroy(profile->dataModelTableList, NULL);
}
| esac | ||
| ], | ||
| [echo "dynamic table support is disabled"]) | ||
| AM_CONDITIONAL([ENABLE_DYNAMIC_TABLE_SUPPORT], [test x$ENABLE_DYNAMIC_TABLE_SUPPORT = xtrue]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.