Skip to content
Snippets Groups Projects
Commit 49d9497d authored by Suvendhu Hansa's avatar Suvendhu Hansa :speech_balloon: Committed by Vivek Dutta
Browse files

Move Device.GatewayInfo to gateway-info package

parent 64e898c4
No related branches found
No related tags found
1 merge request!1135Move Device.GatewayInfo to gateway-info package
Pipeline #195999 passed
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "device.h" #include "device.h"
#include "lanconfigsecurity.h" #include "lanconfigsecurity.h"
#include "security.h" #include "security.h"
#include "gatewayinfo.h"
#include "schedules.h" #include "schedules.h"
/************************************************************* /*************************************************************
...@@ -95,7 +94,6 @@ DMOBJ tDMRootObj[] = { ...@@ -95,7 +94,6 @@ DMOBJ tDMRootObj[] = {
{"LANConfigSecurity", &DMREAD, NULL, NULL, "file:/etc/config/users", NULL, NULL, NULL, NULL, tLANConfigSecurityParams, NULL, BBFDM_BOTH}, {"LANConfigSecurity", &DMREAD, NULL, NULL, "file:/etc/config/users", NULL, NULL, NULL, NULL, tLANConfigSecurityParams, NULL, BBFDM_BOTH},
{"Schedules", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tSchedulesObj, tSchedulesParams, NULL, BBFDM_BOTH}, {"Schedules", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tSchedulesObj, tSchedulesParams, NULL, BBFDM_BOTH},
{"Security", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tSecurityObj, tSecurityParams, NULL, BBFDM_CWMP}, {"Security", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, tSecurityObj, tSecurityParams, NULL, BBFDM_CWMP},
{"GatewayInfo", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tGatewayInfoParams, NULL, BBFDM_CWMP},
{0} {0}
}; };
......
/*
* Copyright (C) 2022 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author: Suvendhu Hansa <suvendhu.hansa@iopsys.eu>
*/
#include "gatewayinfo.h"
static int get_manufacturer_oui(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_option_value_string_varstate("icwmp", "gatewayinfo", "oui", value);
if (*value[0] == '\0') {
dmuci_get_option_value_string("cwmp", "cpe", "manufacturer_oui", value);
if (*value[0] == '\0')
db_get_value_string("device", "deviceinfo", "ManufacturerOUI", value);
}
return 0;
}
static int get_product_class(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_option_value_string_varstate("icwmp", "gatewayinfo", "class", value);
if (*value[0] == '\0') {
dmuci_get_option_value_string("cwmp", "cpe", "product_class", value);
if (*value[0] == '\0')
db_get_value_string("device", "deviceinfo", "ProductClass", value);
}
return 0;
}
static int get_serial_number(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_option_value_string_varstate("icwmp", "gatewayinfo", "serial", value);
if (*value[0] == '\0') {
dmuci_get_option_value_string("cwmp", "cpe", "serial_number", value);
if (*value[0] == '\0')
db_get_value_string("device", "deviceinfo", "SerialNumber", value);
}
return 0;
}
/**********************************************************************************************************************************
* OBJ & PARAM DEFINITION
***********************************************************************************************************************************/
/* *** Device.GatewayInfo. *** */
DMLEAF tGatewayInfoParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type, version*/
{"ManufacturerOUI", &DMREAD, DMT_STRING, get_manufacturer_oui, NULL, BBFDM_CWMP},
{"ProductClass", &DMREAD, DMT_STRING, get_product_class, NULL, BBFDM_CWMP},
{"SerialNumber", &DMREAD, DMT_STRING, get_serial_number, NULL, BBFDM_CWMP},
{0}
};
/*
* Copyright (C) 2022 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author Suvendhu Hansa <suvendhu.hansa@iopsys.eu>
*
*/
#ifndef __GATEWAYINFO_H
#define __GATEWAYINFO_H
#include "libbbfdm-api/legacy/dmcommon.h"
extern DMLEAF tGatewayInfoParams[];
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment