/*
 * Copyright (C) 2026 iopsys Software Solutions AB
 *
 * See LICENSE file for license related information.
 */

#include "security.h"

/*
 * Re-create the Device.Security. node (with its Certificate children and
 * parameters) that used to live in bbfdm's core tree, so it can be mounted
 * under the existing Device. parent below.
 */
static DMOBJ tSecurityDeviceObj[] = {
/* OBJ,        permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj,      leaf,            linker, bbfdm_type */
{"Security", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tSecurityObj, tSecurityParams, NULL, BBFDM_BOTH},
{0}
};

/*
 * Plugin entry point: the bbfdm dynamic loader resolves the "tDynamicObj"
 * symbol via dlsym() and mounts the listed objects into the data-model tree.
 * 'path' is the existing parent node to attach under, so mount under
 * "Device." and add Security as a child object.
 */
DM_MAP_OBJ tDynamicObj[] = {
/* path,      root_obj,           root_leaf, init_module, clean_module, uci_sync_handler */
{"Device.",   tSecurityDeviceObj, NULL,      NULL,        NULL,         NULL},
{0}
};
