mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Configure the maximum number of instances in build time
This commit is contained in:
parent
b6c15564ae
commit
26326b5b57
5 changed files with 12 additions and 5 deletions
|
|
@ -6,6 +6,10 @@ ADD_DEFINITIONS(-Wall -Werror)
|
|||
ADD_DEFINITIONS(-D_GNU_SOURCE)
|
||||
ADD_DEFINITIONS(-DBBF_VENDOR_PREFIX="${BBF_VENDOR_PREFIX}")
|
||||
|
||||
IF(${BBF_MAX_OBJECT_INSTANCES})
|
||||
ADD_DEFINITIONS(-DBBF_MAX_OBJECT_INSTANCES=${BBF_MAX_OBJECT_INSTANCES})
|
||||
ENDIF()
|
||||
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${PROJECT_SOURCE_DIR} -I${PROJECT_SOURCE_DIR}/dmtree")
|
||||
|
||||
OPTION(BBF_TR181 "build with tr181 datamodel" ON)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ function install_libbbf()
|
|||
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake ../ -DCMAKE_C_FLAGS="$COV_CFLAGS " -DCMAKE_EXE_LINKER_FLAGS="$COV_LDFLAGS" -DBBF_TR181=ON -DBBF_TR104=ON -DBBF_TR143=ON -DWITH_OPENSSL=ON -DBBF_JSON_PLUGIN=ON -DBBF_DOTSO_PLUGIN=ON -DBBF_VENDOR_EXTENSION=ON -DBBF_VENDOR_LIST="$VENDOR_LIST" -DBBF_VENDOR_PREFIX="$VENDOR_PREFIX" -DCMAKE_INSTALL_PREFIX=/
|
||||
cmake ../ -DCMAKE_C_FLAGS="$COV_CFLAGS " -DCMAKE_EXE_LINKER_FLAGS="$COV_LDFLAGS" -DBBF_TR181=ON -DBBF_TR104=ON -DBBF_TR143=ON -DWITH_OPENSSL=ON -DBBF_JSON_PLUGIN=ON -DBBF_DOTSO_PLUGIN=ON -DBBF_VENDOR_EXTENSION=ON -DBBF_VENDOR_LIST="$VENDOR_LIST" -DBBF_VENDOR_PREFIX="$VENDOR_PREFIX" -DBBF_MAX_OBJECT_INSTANCES=255 -DCMAKE_INSTALL_PREFIX=/
|
||||
exec_cmd_verbose make
|
||||
|
||||
echo "installing libbbf"
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ extern int bbfdatamodel_type;
|
|||
#endif
|
||||
#define UNDEF -1
|
||||
|
||||
#ifndef BBF_MAX_OBJECT_INSTANCES
|
||||
#define BBF_MAX_OBJECT_INSTANCES (255)
|
||||
#endif
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -413,10 +413,9 @@ int dm_link_inst_obj(struct dmctx *dmctx, DMNODE *parent_node, void *data, char
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (parent_node->browse_type == BROWSE_NUM_OF_ENTRIES) {
|
||||
parent_node->num_of_entries++;
|
||||
parent_node->num_of_entries++;
|
||||
if (parent_node->browse_type == BROWSE_NUM_OF_ENTRIES)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DMOBJ *prevobj = parent_node->obj;
|
||||
DMOBJ *nextobj = prevobj->nextobj;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ __attribute__ ((deprecated)) char *handle_update_instance(int instance_ranck, st
|
|||
static inline int DM_LINK_INST_OBJ(struct dmctx *dmctx, DMNODE *parent_node, void *data, char *instance)
|
||||
{
|
||||
dmctx->faultcode = dm_link_inst_obj(dmctx, parent_node, data, instance);
|
||||
if (dmctx->stop)
|
||||
if (dmctx->stop || parent_node->num_of_entries >= BBF_MAX_OBJECT_INSTANCES)
|
||||
return DM_STOP;
|
||||
return DM_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue