Ticket refs #2584: TR-181: Device.LANConfigSecurity. object

This commit is contained in:
Omar Kallel 2020-05-18 12:01:02 +01:00
parent 85b5f603b5
commit 8473242c46
5 changed files with 53 additions and 1 deletions

View file

@ -80,7 +80,8 @@ libbbfdm_la_SOURCES += \
../dmtree/tr181/datamodelversion.c \
../dmtree/tr181/gre.c \
../dmtree/tr181/dynamicdns.c \
../dmtree/tr181/security.c
../dmtree/tr181/security.c \
../dmtree/tr181/lanconfigsecurity.c
endif
if GENERIC_OPENWRT

View file

@ -45,6 +45,7 @@
#include "datamodelversion.h"
#include "gre.h"
#include "dynamicdns.h"
#include "lanconfigsecurity.h"
#include "security.h"
#ifdef BBF_TR104
#include "voice_services.h"
@ -106,6 +107,7 @@ DMOBJ tRoot_181_Obj[] = {
{"DynamicDNS", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tDynamicDNSObj, tDynamicDNSParams, NULL, BBFDM_BOTH},
{"QoS", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tQoSObj, tQoSParams, NULL, BBFDM_BOTH},
{"XMPP", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tXMPPObj, tXMPPParams, NULL, BBFDM_BOTH},
{"LANConfigSecurity", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tLANConfigSecurityParams, NULL, BBFDM_BOTH},
#ifdef BBF_TR157
{"BulkData", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tBulkDataObj, tBulkDataParams, NULL, BBFDM_BOTH},
{"SoftwareModules", &DMREAD, NULL, NULL, NULL, NULL, NULL, &DMNONE, NULL, tSoftwareModulesObj, tSoftwareModulesParams, NULL, BBFDM_BOTH},

View file

@ -0,0 +1,26 @@
#include "lanconfigsecurity.h"
static int get_LANConfigSecurity_ConfigPassword(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value="";
return 0;
}
static int set_LANConfigSecurity_ConfigPassword(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 64, NULL, 0, NULL, 0))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value("users", "user", "password", value);
break;
}
return 0;
}
DMLEAF tLANConfigSecurityParams[] = {
{"ConfigPassword", &DMWRITE, DMT_STRING, get_LANConfigSecurity_ConfigPassword, set_LANConfigSecurity_ConfigPassword, NULL, NULL, BBFDM_BOTH},
{0}
};

View file

@ -0,0 +1,8 @@
#ifndef __LANCONFIGSECURITY_H
#define __LANCONFIGSECURITY_H
#include <libbbf_api/dmcommon.h>
extern DMLEAF tLANConfigSecurityParams[];
#endif

View file

@ -52212,6 +52212,21 @@
{
"max": 64
}
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "users",
"section": {
"type": "user",
"name": "user"
},
"option": {
"name": "password"
}
}
}
]
}
},