mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
bbfdm: cleanup
This commit is contained in:
parent
e028ab8fda
commit
1300dedbe0
15 changed files with 33 additions and 160 deletions
|
|
@ -35,7 +35,7 @@ static int bbfdm_add_object(bbfdm_data_t *data)
|
|||
|
||||
void *array = blobmsg_open_array(&data->bb, "results");
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_ADD_OBJECT);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_ADD_OBJECT);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
@ -64,7 +64,7 @@ static int bbfdm_del_object(bbfdm_data_t *data)
|
|||
|
||||
INFO("Req to delete object |%s|", data->bbf_ctx.in_param);
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_DEL_OBJECT);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_DEL_OBJECT);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <libubox/uloop.h>
|
||||
#include <libubus.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "bbfdmd.h"
|
||||
#include "set.h"
|
||||
|
|
@ -35,7 +36,6 @@
|
|||
#include "get_helper.h"
|
||||
#include "operate.h"
|
||||
#include "add_delete.h"
|
||||
#include "ipc.h"
|
||||
#include "events.h"
|
||||
#include "pretty_print.h"
|
||||
#include "get_helper.h"
|
||||
|
|
@ -64,21 +64,6 @@ static json_object *deamon_json_obj = NULL;
|
|||
char UBUS_METHOD_NAME[32] = "bbfdm";
|
||||
bool enable_plugins = true;
|
||||
|
||||
static void sig_handler(int sig)
|
||||
{
|
||||
if (sig == SIGSEGV) {
|
||||
handle_pending_signal(sig);
|
||||
} else if (sig == SIGUSR1) {
|
||||
print_last_dm_object();
|
||||
}
|
||||
}
|
||||
|
||||
static void signal_init(void)
|
||||
{
|
||||
signal(SIGSEGV, sig_handler);
|
||||
signal(SIGUSR1, sig_handler);
|
||||
}
|
||||
|
||||
static void usage(char *prog)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [options]\n", prog);
|
||||
|
|
@ -230,8 +215,6 @@ static int bbfdm_start_deferred(bbfdm_data_t *data, void (*EXEC_CB)(bbfdm_data_t
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// child initialise signal to prevent segfaults
|
||||
signal_init();
|
||||
/* free fd's and memory inherited from parent */
|
||||
ubus_shutdown(data->ctx);
|
||||
uloop_done();
|
||||
|
|
@ -527,7 +510,7 @@ int bbfdm_set_handler(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
struct blob_attr *tb[__DM_SET_MAX] = {NULL};
|
||||
char path[PATH_MAX] = {'\0'};
|
||||
bbfdm_data_t data;
|
||||
int fault = bbfdm_ERR_OK;
|
||||
int fault = 0;
|
||||
int trans_id = 0;
|
||||
LIST_HEAD(pv_list);
|
||||
|
||||
|
|
@ -1064,7 +1047,7 @@ static void update_instances_list(struct list_head *inst)
|
|||
|
||||
bbf_init(&bbf_ctx);
|
||||
|
||||
if (0 == bbfdm_dm_exec(&bbf_ctx, BBF_INSTANCES)) {
|
||||
if (0 == bbf_entry_method(&bbf_ctx, BBF_INSTANCES)) {
|
||||
struct dm_parameter *nptr_dp;
|
||||
|
||||
list_for_each_entry(nptr_dp, &bbf_ctx.list_parameter, list) {
|
||||
|
|
@ -1132,8 +1115,6 @@ static int fork_instance_checker(struct bbfdm_context *u)
|
|||
child = fork();
|
||||
if (child == 0) {
|
||||
prctl(PR_SET_NAME, (unsigned long) "bbfdm_instance");
|
||||
// child initialise signal to prevent segfaults
|
||||
signal_init();
|
||||
/* free fd's and memory inherited from parent */
|
||||
ubus_shutdown(&u->ubus_ctx);
|
||||
uloop_done();
|
||||
|
|
@ -1327,8 +1308,6 @@ int main(int argc, char **argv)
|
|||
return -1;
|
||||
}
|
||||
|
||||
signal_init();
|
||||
|
||||
err = register_events_to_ubus(&bbfdm_ctx.ubus_ctx, &bbfdm_ctx.event_handlers);
|
||||
if (err != 0)
|
||||
goto exit;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "ipc.h"
|
||||
#include "get_helper.h"
|
||||
|
||||
#define DEFAULT_LOG_LEVEL (2)
|
||||
|
|
|
|||
|
|
@ -27,12 +27,16 @@
|
|||
#define DM_VALUE_SEP ","
|
||||
#define DELIM '.'
|
||||
|
||||
#ifdef BBFDM_MAX_MSG_LEN
|
||||
#define DEF_IPC_DATA_LEN (BBFDM_MAX_MSG_LEN - 128) // Configured Len - 128 bytes
|
||||
#else
|
||||
#define DEF_IPC_DATA_LEN (10 * 1024 * 1024 - 128) // 10M - 128 bytes
|
||||
#endif
|
||||
|
||||
#define GLOB_CHAR "[[+*]+"
|
||||
#define GLOB_EXPR "[=><]+"
|
||||
#define GLOB_bbfdm_PATH "[+#=><]+"
|
||||
|
||||
#define bbfdm_ERR_OK 0
|
||||
|
||||
extern DMOBJ *DEAMON_DM_ROOT_OBJ;
|
||||
extern DM_MAP_VENDOR *DEAMON_DM_VENDOR_EXTENSION[2];
|
||||
extern DM_MAP_VENDOR_EXCLUDE *DEAMON_DM_VENDOR_EXTENSION_EXCLUDE;
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ bool is_registered_event(char *name)
|
|||
|
||||
bbf_init(&bbf_ctx);
|
||||
|
||||
if (0 == bbfdm_dm_exec(&bbf_ctx, BBF_SCHEMA)) {
|
||||
if (0 == bbf_entry_method(&bbf_ctx, BBF_SCHEMA)) {
|
||||
struct dm_parameter *param;
|
||||
|
||||
list_for_each_entry(param, &bbf_ctx.list_parameter, list) {
|
||||
|
|
|
|||
|
|
@ -24,14 +24,13 @@
|
|||
#include "get.h"
|
||||
#include "get_helper.h"
|
||||
#include "pretty_print.h"
|
||||
#include "ipc.h"
|
||||
#include "libbbfdm-api/dmentry.h"
|
||||
|
||||
#include <libubus.h>
|
||||
|
||||
void bbfdm_get_value_async(bbfdm_data_t *data, void *output)
|
||||
{
|
||||
int fault = bbfdm_ERR_OK;
|
||||
int fault = 0;
|
||||
struct pathNode *pn;
|
||||
void *array = NULL;
|
||||
|
||||
|
|
@ -46,7 +45,7 @@ void bbfdm_get_value_async(bbfdm_data_t *data, void *output)
|
|||
|
||||
data->bbf_ctx.in_param = pn->path;
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_GET_VALUE);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_GET_VALUE);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
@ -90,7 +89,7 @@ void bbfdm_get_value_async(bbfdm_data_t *data, void *output)
|
|||
|
||||
void bbfdm_get_value(bbfdm_data_t *data)
|
||||
{
|
||||
int fault = bbfdm_ERR_OK;
|
||||
int fault = 0;
|
||||
struct pathNode *pn;
|
||||
void *array = NULL;
|
||||
|
||||
|
|
@ -107,7 +106,7 @@ void bbfdm_get_value(bbfdm_data_t *data)
|
|||
|
||||
data->bbf_ctx.in_param = pn->path;
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_GET_VALUE);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_GET_VALUE);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
@ -152,7 +151,7 @@ void bbfdm_get_value(bbfdm_data_t *data)
|
|||
|
||||
void bbfdm_get_names(bbfdm_data_t *data)
|
||||
{
|
||||
int fault = bbfdm_ERR_OK;
|
||||
int fault = 0;
|
||||
struct pathNode *pn;
|
||||
|
||||
bbf_init(&data->bbf_ctx);
|
||||
|
|
@ -164,7 +163,7 @@ void bbfdm_get_names(bbfdm_data_t *data)
|
|||
|
||||
data->bbf_ctx.in_param = pn->path;
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_GET_NAME);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_GET_NAME);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
@ -194,7 +193,7 @@ void bbfdm_get_names(bbfdm_data_t *data)
|
|||
|
||||
void bbfdm_get_instances(bbfdm_data_t *data)
|
||||
{
|
||||
int fault = bbfdm_ERR_OK;
|
||||
int fault = 0;
|
||||
struct pathNode *pn;
|
||||
|
||||
bbf_init(&data->bbf_ctx);
|
||||
|
|
@ -206,7 +205,7 @@ void bbfdm_get_instances(bbfdm_data_t *data)
|
|||
|
||||
data->bbf_ctx.in_param = pn->path;
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_INSTANCES);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_INSTANCES);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
@ -324,7 +323,7 @@ int bbf_dm_get_supported_dm(bbfdm_data_t *data)
|
|||
{
|
||||
struct dm_parameter *param;
|
||||
struct pathNode *pn;
|
||||
int fault = bbfdm_ERR_OK;
|
||||
int fault = 0;
|
||||
|
||||
bbf_init(&data->bbf_ctx);
|
||||
|
||||
|
|
@ -335,7 +334,7 @@ int bbf_dm_get_supported_dm(bbfdm_data_t *data)
|
|||
|
||||
data->bbf_ctx.in_param = pn->path;
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_SCHEMA);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_SCHEMA);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -47,27 +47,6 @@ static struct {
|
|||
int timeout_ms;
|
||||
} g_current_trans = {.trans_id=0, .timeout_ms=10000};
|
||||
|
||||
static jmp_buf gs_jump_location;
|
||||
static bool gs_jump_called_by_bbf = false;
|
||||
|
||||
void print_last_dm_object(void)
|
||||
{
|
||||
char buff[MAX_DM_PATH];
|
||||
|
||||
bbf_debug_browse_path(buff, MAX_DM_PATH);
|
||||
ERR("# PID[%ld] Last DM path [%s] #", getpid(), buff);
|
||||
}
|
||||
|
||||
void handle_pending_signal(int sig)
|
||||
{
|
||||
if (gs_jump_called_by_bbf) {
|
||||
siglongjmp(gs_jump_location, 1);
|
||||
}
|
||||
|
||||
ERR("Exception [%d] not cause by bbf dm, exit with error", sig);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void bb_add_string(struct blob_buf *bb, const char *name, const char *value)
|
||||
{
|
||||
blobmsg_add_string(bb, name, value ? value : "");
|
||||
|
|
@ -167,30 +146,6 @@ void free_path_list(struct list_head *plist)
|
|||
}
|
||||
}
|
||||
|
||||
int bbfdm_dm_exec(struct dmctx *bbf_ctx, int cmd)
|
||||
{
|
||||
int fault = 0;
|
||||
|
||||
if (bbf_ctx->in_param == NULL)
|
||||
return bbfdm_FAULT_INTERNAL_ERROR;
|
||||
|
||||
if (sigsetjmp(gs_jump_location, 1) == 0) {
|
||||
gs_jump_called_by_bbf = true;
|
||||
fault = bbf_entry_method(bbf_ctx, cmd);
|
||||
} else {
|
||||
ERR("PID [%ld]::Exception on [%d => %s]", getpid(), cmd, bbf_ctx->in_param);
|
||||
print_last_dm_object();
|
||||
fault = bbfdm_FAULT_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
gs_jump_called_by_bbf = false;
|
||||
|
||||
if (fault)
|
||||
WARNING("Fault [%d => %d => %s]", fault, cmd, bbf_ctx->in_param);
|
||||
|
||||
return fault;
|
||||
}
|
||||
|
||||
void fill_err_code_table(bbfdm_data_t *data, int fault)
|
||||
{
|
||||
void *table = blobmsg_open_table(&data->bb, NULL);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "bbfdmd.h"
|
||||
#include "common.h"
|
||||
#include "libbbfdm-api/dmbbf.h"
|
||||
#include "libbbfdm-api/dmentry.h"
|
||||
|
||||
#include <libubus.h>
|
||||
|
||||
|
|
@ -19,9 +20,6 @@ struct pathNode {
|
|||
char path[MAX_DM_PATH];
|
||||
};
|
||||
|
||||
void handle_pending_signal(int sig);
|
||||
void print_last_dm_object(void);
|
||||
|
||||
void bbf_init(struct dmctx *dm_ctx);
|
||||
void bbf_cleanup(struct dmctx *dm_ctx);
|
||||
void bbf_sub_init(struct dmctx *dm_ctx);
|
||||
|
|
@ -29,8 +27,6 @@ void bbf_sub_cleanup(struct dmctx *dm_ctx);
|
|||
|
||||
bool present_in_path_list(struct list_head *plist, char *entry);
|
||||
|
||||
int bbfdm_dm_exec(struct dmctx *bbf_ctx, int cmd);
|
||||
|
||||
void add_pv_list(char *para, char *val, char *type, struct list_head *pv_list);
|
||||
void free_pv_list(struct list_head *pv_list);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#include "operate.h"
|
||||
#include "get_helper.h"
|
||||
#include "pretty_print.h"
|
||||
#include "ipc.h"
|
||||
|
||||
#include <libubus.h>
|
||||
|
||||
|
|
@ -36,7 +35,7 @@ static int bbfdm_dm_operate(bbfdm_data_t *data)
|
|||
|
||||
bbf_init(&data->bbf_ctx);
|
||||
|
||||
ret = bbfdm_dm_exec(&data->bbf_ctx, BBF_OPERATE);
|
||||
ret = bbf_entry_method(&data->bbf_ctx, BBF_OPERATE);
|
||||
// This switch should be removed in the future and will be treated internally
|
||||
switch (ret) {
|
||||
case CMD_NOT_FOUND:
|
||||
|
|
@ -49,7 +48,7 @@ static int bbfdm_dm_operate(bbfdm_data_t *data)
|
|||
fault = bbfdm_FAULT_COMMAND_FAILURE;
|
||||
break;
|
||||
case CMD_SUCCESS:
|
||||
fault = bbfdm_ERR_OK;
|
||||
fault = 0;
|
||||
DEBUG("command executed successfully");
|
||||
break;
|
||||
default:
|
||||
|
|
@ -99,12 +98,12 @@ static int bbfdm_dm_operate(bbfdm_data_t *data)
|
|||
|
||||
bbf_cleanup(&data->bbf_ctx);
|
||||
|
||||
if (fault != bbfdm_ERR_OK) {
|
||||
if (fault != 0) {
|
||||
WARNING("Fault(%d) path(%s) input(%s)", fault, data->bbf_ctx.in_param, data->bbf_ctx.in_value);
|
||||
return fault;
|
||||
}
|
||||
|
||||
return bbfdm_ERR_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bbfdm_operate_cmd(bbfdm_data_t *data)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ int bbfdm_set_value(bbfdm_data_t *data)
|
|||
{
|
||||
struct pvNode *pv = NULL;
|
||||
void *array = NULL;
|
||||
int fault = bbfdm_ERR_OK;
|
||||
int fault = 0;
|
||||
|
||||
array = blobmsg_open_array(&data->bb, "results");
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ int bbfdm_set_value(bbfdm_data_t *data)
|
|||
data->bbf_ctx.in_param = pv->param;
|
||||
data->bbf_ctx.in_value = pv->val;
|
||||
|
||||
fault = bbfdm_dm_exec(&data->bbf_ctx, BBF_SET_VALUE);
|
||||
fault = bbf_entry_method(&data->bbf_ctx, BBF_SET_VALUE);
|
||||
if (fault) {
|
||||
fill_err_code_table(data, fault);
|
||||
} else {
|
||||
|
|
@ -75,7 +75,7 @@ int fill_pvlist_set(char *param_name, char *param_value, struct blob_attr *blob_
|
|||
blob__table:
|
||||
|
||||
if (!blob_table)
|
||||
return bbfdm_ERR_OK;
|
||||
return 0;
|
||||
|
||||
size_t tlen = (size_t)blobmsg_data_len(blob_table);
|
||||
|
||||
|
|
@ -107,5 +107,5 @@ blob__table:
|
|||
add_pv_list(path, value, NULL, pv_list);
|
||||
}
|
||||
|
||||
return bbfdm_ERR_OK;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ bbf_ctx_clean
|
|||
bbf_ctx_clean_sub
|
||||
bbf_entry_restart_services
|
||||
bbf_entry_revert_changes
|
||||
bbf_debug_browse_path
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
|
@ -154,19 +153,3 @@ input
|
|||
return
|
||||
None
|
||||
```
|
||||
|
||||
### bbf_debug_browse_path
|
||||
|
||||
This method returns the last accessed path in the data model
|
||||
|
||||
```
|
||||
int bbf_debug_browse_path(char *buff, size_t len)
|
||||
input
|
||||
char *buff
|
||||
pointer to the buffer in which the path will be returned
|
||||
size_t len
|
||||
length of the buffer
|
||||
return
|
||||
int
|
||||
returns 0 on success.
|
||||
```
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
#define MAX_DM_PATH (1024)
|
||||
|
||||
static char dm_browse_path[MAX_DM_PATH];
|
||||
|
||||
static int dm_browse(struct dmctx *dmctx, DMNODE *parent_node, DMOBJ *entryobj, void *data, char *instance);
|
||||
|
||||
char *DMT_TYPE[] = {
|
||||
|
|
@ -378,7 +376,6 @@ static int dm_browse_leaf(struct dmctx *dmctx, DMNODE *parent_node, DMLEAF *leaf
|
|||
continue;
|
||||
}
|
||||
|
||||
snprintf(dm_browse_path, MAX_DM_PATH, "%s%s", parent_node->current_object, leaf->parameter);
|
||||
err = dmctx->method_param(dmctx, parent_node, leaf, data, instance);
|
||||
if (dmctx->stop)
|
||||
return err;
|
||||
|
|
@ -401,7 +398,6 @@ static int dm_browse_leaf(struct dmctx *dmctx, DMNODE *parent_node, DMLEAF *leaf
|
|||
continue;
|
||||
}
|
||||
|
||||
snprintf(dm_browse_path, MAX_DM_PATH, "%s%s", parent_node->current_object, jleaf->parameter);
|
||||
err = dmctx->method_param(dmctx, parent_node, jleaf, data, instance);
|
||||
if (dmctx->stop)
|
||||
return err;
|
||||
|
|
@ -460,7 +456,6 @@ static void dm_browse_entry(struct dmctx *dmctx, DMNODE *parent_node, DMOBJ *ent
|
|||
else
|
||||
dmasprintf(&(node.current_object), "%s%s.", parent_obj, entryobj->obj);
|
||||
|
||||
snprintf(dm_browse_path, MAX_DM_PATH, "%s", node.current_object);
|
||||
if (dmctx->checkobj) {
|
||||
*err = dmctx->checkobj(dmctx, &node, entryobj->permission, entryobj->addobj, entryobj->delobj, entryobj->get_linker, data, instance);
|
||||
if (*err)
|
||||
|
|
@ -504,7 +499,6 @@ static int dm_browse(struct dmctx *dmctx, DMNODE *parent_node, DMOBJ *entryobj,
|
|||
int err = 0;
|
||||
|
||||
for (; (entryobj && entryobj->obj); entryobj++) {
|
||||
snprintf(dm_browse_path, MAX_DM_PATH, "%s%s", parent_obj, entryobj->obj);
|
||||
dm_browse_entry(dmctx, parent_node, entryobj, data, instance, parent_obj, &err);
|
||||
if (dmctx->stop)
|
||||
return err;
|
||||
|
|
@ -518,7 +512,6 @@ static int dm_browse(struct dmctx *dmctx, DMNODE *parent_node, DMOBJ *entryobj,
|
|||
for (int j = 0; next_dyn_array->nextobj[j]; j++) {
|
||||
DMOBJ *jentryobj = next_dyn_array->nextobj[j];
|
||||
for (; (jentryobj && jentryobj->obj); jentryobj++) {
|
||||
snprintf(dm_browse_path, MAX_DM_PATH, "%s%s", parent_obj, jentryobj->obj);
|
||||
if (i == INDX_SERVICE_MOUNT)
|
||||
dm_browse_service(dmctx, parent_node, jentryobj, data, instance, parent_obj, &err);
|
||||
else
|
||||
|
|
@ -1356,6 +1349,8 @@ static int operate_ubus(struct dmctx *dmctx, struct dmnode *node)
|
|||
|
||||
json_object_put(in_args);
|
||||
|
||||
dmctx->stop = 1;
|
||||
|
||||
if (!res)
|
||||
return FAULT_9005;
|
||||
|
||||
|
|
@ -2173,9 +2168,3 @@ int dm_entry_operate(struct dmctx *dmctx)
|
|||
|
||||
return (dmctx->stop) ? err : CMD_NOT_FOUND;
|
||||
}
|
||||
|
||||
int dm_browse_last_access_path(char *path, size_t len)
|
||||
{
|
||||
snprintf(path, len, "%s", dm_browse_path);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ int dm_entry_set_value(struct dmctx *dmctx);
|
|||
int dm_entry_operate(struct dmctx *dmctx);
|
||||
int dm_entry_get_linker(struct dmctx *dmctx);
|
||||
int dm_entry_get_linker_value(struct dmctx *dmctx);
|
||||
int dm_browse_last_access_path(char *path, size_t len);
|
||||
int dm_link_inst_obj(struct dmctx *dmctx, DMNODE *parent_node, void *data, char *instance);
|
||||
|
||||
char *update_instance_alias(int action, char **last_inst, char **max_inst, void *argv[]);
|
||||
|
|
|
|||
|
|
@ -317,14 +317,3 @@ void bbf_entry_revert_changes(struct blob_buf *bb)
|
|||
|
||||
free_all_list_package_change(&head_package_change);
|
||||
}
|
||||
|
||||
int bbf_debug_browse_path(char *buff, size_t len)
|
||||
{
|
||||
if (!buff)
|
||||
return -1;
|
||||
|
||||
// initialise with default value
|
||||
buff[0] = '\0';
|
||||
|
||||
return dm_browse_last_access_path(buff, len);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,22 +40,4 @@ int adm_entry_get_linker_value(struct dmctx *ctx, char *param, char **value);
|
|||
void bbf_entry_restart_services(struct blob_buf *bb, bool restart_services);
|
||||
void bbf_entry_revert_changes(struct blob_buf *bb);
|
||||
|
||||
|
||||
/**
|
||||
* @brief bbf_debug_browse_path
|
||||
*
|
||||
* Debug API to get the last datamodel access object by datamodel browse
|
||||
* function.
|
||||
*
|
||||
* @param buff Memory address to store the last access object, ownership
|
||||
* of the address belongs to caller.
|
||||
* @param len maximum size of buffer.
|
||||
*
|
||||
* @return 0, on success and -1, in case of error.
|
||||
*
|
||||
* @note This is debug API, mostly be useful in debugging in last datamodel
|
||||
* object illegal access.
|
||||
*/
|
||||
int bbf_debug_browse_path(char *buff, size_t len);
|
||||
|
||||
#endif //__DMENTRY_H__
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue