From e333d3e7411adf5574efe55c94e1a062d7253fb5 Mon Sep 17 00:00:00 2001 From: Vivek Kumar Dutta <vivek.dutta@iopsys.eu> Date: Mon, 16 Sep 2024 14:53:40 +0530 Subject: [PATCH] Fix datamodel path --- bbf_plugin/atm.c | 9 +++++++-- bbf_plugin/fast.c | 2 +- bbf_plugin/plugin.c | 2 +- bbf_plugin/ptm.c | 9 +++++++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bbf_plugin/atm.c b/bbf_plugin/atm.c index 56d4bf4..b3da116 100644 --- a/bbf_plugin/atm.c +++ b/bbf_plugin/atm.c @@ -369,7 +369,6 @@ DMLEAF tATMLinkParams[] = { {"Status", &DMREAD, DMT_STRING, get_atm_status, NULL, BBFDM_BOTH}, {"LowerLayers", &DMWRITE, DMT_STRING, get_atm_lower_layer, set_atm_lower_layer, BBFDM_BOTH, DM_FLAG_REFERENCE}, {"LinkType", &DMWRITE, DMT_STRING, get_atm_link_type, set_atm_link_type, BBFDM_BOTH}, -{"LinkNumberOfEntries", &DMREAD, DMT_UNINT, get_atm_LinkNumberOfEntries, NULL, BBFDM_BOTH}, {"DestinationAddress", &DMWRITE, DMT_STRING, get_atm_destination_address, set_atm_destination_address, BBFDM_BOTH}, {"Encapsulation", &DMWRITE, DMT_STRING, get_atm_encapsulation, set_atm_encapsulation, BBFDM_BOTH}, {0} @@ -399,7 +398,13 @@ DMOBJ tATMObj[] = { {0} }; +DMLEAF tATMParams[] = { +/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ +{"LinkNumberOfEntries", &DMREAD, DMT_UNINT, get_atm_LinkNumberOfEntries, NULL, BBFDM_BOTH}, +{0} +}; + DMOBJ tDeviceATMObj[] = { -{"ATM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tATMObj, NULL, NULL, BBFDM_BOTH, NULL}, +{"ATM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tATMObj, tATMParams, NULL, BBFDM_BOTH, NULL}, {0} }; diff --git a/bbf_plugin/fast.c b/bbf_plugin/fast.c index 7ec5514..a9909ee 100644 --- a/bbf_plugin/fast.c +++ b/bbf_plugin/fast.c @@ -162,7 +162,7 @@ static int get_FASTLine_AllowedProfiles(char *refparam, struct dmctx *ctx, void { json_object *res = NULL, *allowed_profiles = NULL; char list_profile[16], *profile = NULL; - unsigned pos = 0, idx = 0; + size_t pos = 0, idx = 0; res = ((struct dm_data *)data)->json_object; DM_ASSERT(res, *value = ""); diff --git a/bbf_plugin/plugin.c b/bbf_plugin/plugin.c index 3b80002..ef3a110 100644 --- a/bbf_plugin/plugin.c +++ b/bbf_plugin/plugin.c @@ -36,7 +36,7 @@ void remove_device_from_interface(struct uci_section *interface_s, char *device) { char *curr_device = NULL; char new_device[64] = {0}; - unsigned pos = 0; + size_t pos = 0; if (!interface_s || !device) return; diff --git a/bbf_plugin/ptm.c b/bbf_plugin/ptm.c index f71c768..118639a 100644 --- a/bbf_plugin/ptm.c +++ b/bbf_plugin/ptm.c @@ -268,7 +268,6 @@ DMLEAF tPTMLinkParams[] = { {"Alias", &DMWRITE, DMT_STRING, get_ptm_alias, set_ptm_alias, BBFDM_BOTH, DM_FLAG_UNIQUE}, {"Name", &DMREAD, DMT_STRING, get_ptm_link_name, NULL, BBFDM_BOTH, DM_FLAG_UNIQUE|DM_FLAG_LINKER}, {"LowerLayers", &DMWRITE, DMT_STRING, get_ptm_lower_layer, set_ptm_lower_layer, BBFDM_BOTH, DM_FLAG_REFERENCE}, -{"LinkNumberOfEntries", &DMREAD, DMT_UNINT, get_ptm_LinkNumberOfEntries, NULL, BBFDM_BOTH}, {0} }; @@ -286,7 +285,13 @@ DMOBJ tPTMObj[] = { {0} }; +DMLEAF tPTMParams[] = { +/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/ +{"LinkNumberOfEntries", &DMREAD, DMT_UNINT, get_ptm_LinkNumberOfEntries, NULL, BBFDM_BOTH}, +{0} +}; + DMOBJ tDevicePTMObj[] = { -{"PTM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tPTMObj, NULL, NULL, BBFDM_BOTH, NULL}, +{"PTM", &DMREAD, NULL, NULL, "file:/etc/config/dsl", NULL, NULL, NULL, tPTMObj, tPTMParams, NULL, BBFDM_BOTH, NULL}, {0} }; -- GitLab