mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
Ticket #8245: bbf: Add support for InformParameter
This commit is contained in:
parent
95c7459bce
commit
7ca14a3fcd
8 changed files with 186 additions and 185 deletions
|
|
@ -14,6 +14,8 @@
|
|||
#include "managementserver.h"
|
||||
#include "dmbbfcommon.h"
|
||||
|
||||
char *CWMP_EVENTS[] = {"0 BOOTSTRAP", "1 BOOT", "2 PERIODIC", "3 SCHEDULED", "5 KICKED", "6 CONNECTION REQUEST", "7 TRANSFER COMPLETE", "8 DIAGNOSTICS COMPLETE", "9 REQUEST DOWNLOAD", "10 AUTONOMOUS TRANSFER COMPLETE", "11 DU STATE CHANGE COMPLETE", "M Reboot", "M ScheduleInform", "M Download", "M ScheduleDownload", "M Upload", "M ChangeDUState", "14 HEARTBEAT"};
|
||||
|
||||
/*#Device.ManagementServer.URL!UCI:cwmp/acs,acs/url*/
|
||||
static int get_management_server_url(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
|
|
@ -606,7 +608,6 @@ static int get_nat_detected(char *refparam, struct dmctx *ctx, void *data, char
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int get_heart_beat_policy_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_option_value_fallback_def("cwmp", "acs", "heartbeat_enable", "0");
|
||||
|
|
@ -671,12 +672,168 @@ static int set_heart_beat_policy_initiation_time(char *refparam, struct dmctx *c
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int browseInformParameterInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
struct uci_section *s = NULL, *dmmap_sect = NULL;
|
||||
char *inst = NULL;
|
||||
uci_path_foreach_sections(varstate, "cwmp", "inform_parameter", s) {
|
||||
if ((dmmap_sect = get_dup_section_in_dmmap("dmmap_mgt_server", "inform_parameter", section_name(s))) == NULL) {
|
||||
dmuci_add_section_bbfdm("dmmap_mgt_server", "inform_parameter", &dmmap_sect);
|
||||
dmuci_set_value_by_section_bbfdm(dmmap_sect, "section_name", section_name(s));
|
||||
}
|
||||
inst = handle_instance(dmctx, parent_node, dmmap_sect, "informparam_instance", "informparam_alias");
|
||||
struct dmmap_dup inform_param_afgs = { .config_section = s, .dmmap_section = dmmap_sect };
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)&inform_param_afgs, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int add_inform_parameter(char *refparam, struct dmctx *ctx, void *data, char **instance)
|
||||
{
|
||||
struct uci_section *s = NULL, *dmmap_sect = NULL;
|
||||
char inf_param[32] = {0};
|
||||
|
||||
snprintf(inf_param, sizeof(inf_param), "inf_param_%s", *instance);
|
||||
|
||||
dmuci_add_section_varstate("cwmp", "inform_parameter", &s);
|
||||
dmuci_rename_section_by_section(s, inf_param);
|
||||
dmuci_set_value_by_section(s, "enable", "0");
|
||||
|
||||
dmuci_add_section_bbfdm("dmmap_mgt_server", "inform_parameter", &dmmap_sect);
|
||||
dmuci_set_value_by_section(dmmap_sect, "section_name", section_name(s));
|
||||
dmuci_set_value_by_section(dmmap_sect, "informparam_instance", *instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int delete_inform_parameter(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action)
|
||||
{
|
||||
struct uci_section *s = NULL, *stmp = NULL;
|
||||
switch (del_action) {
|
||||
case DEL_INST:
|
||||
dmuci_delete_by_section(((struct dmmap_dup *)data)->dmmap_section, NULL, NULL);
|
||||
dmuci_delete_by_section(((struct dmmap_dup *)data)->config_section, NULL, NULL);
|
||||
break;
|
||||
case DEL_ALL:
|
||||
uci_path_foreach_sections_safe(varstate, "cwmp", "inform_parameter", stmp, s) {
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
get_dmmap_section_of_config_section("dmmap_mgt_server", "inform_parameter", section_name(s), &dmmap_section);
|
||||
|
||||
dmuci_delete_by_section(dmmap_section, NULL, NULL);
|
||||
|
||||
dmuci_delete_by_section_varstate(s, NULL, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_inform_parameter_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
dmuci_get_value_by_section_string(inform_param_args->config_section, "enable", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_inform_parameter_enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_boolean(value))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section_varstate(inform_param_args->config_section, "enable", value);
|
||||
bbf_set_end_session_flag(ctx, BBF_END_SESSION_RELOAD);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_inform_parameter_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
dmuci_get_value_by_section_string(inform_param_args->dmmap_section, "informparam_alias", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_inform_parameter_alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section_varstate(inform_param_args->dmmap_section, "informparam_alias", value);
|
||||
bbf_set_end_session_flag(ctx, BBF_END_SESSION_RELOAD);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_inform_parameter_parameter_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
dmuci_get_value_by_section_string(inform_param_args->config_section, "parameter_name", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_inform_parameter_parameter_name(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 256, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section_varstate(inform_param_args->config_section, "parameter_name", value);
|
||||
bbf_set_end_session_flag(ctx, BBF_END_SESSION_RELOAD);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_inform_parameter_event_list(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
dmuci_get_value_by_section_string(inform_param_args->config_section, "events_list", value); return 0;
|
||||
}
|
||||
|
||||
static int set_inform_parameter_event_list(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct dmmap_dup *inform_param_args = (struct dmmap_dup *)data;
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, -1, CWMP_EVENTS, NULL))
|
||||
return FAULT_9007;
|
||||
return 0;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section_varstate(inform_param_args->config_section, "events_list", value);
|
||||
bbf_set_end_session_flag(ctx, BBF_END_SESSION_RELOAD);
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_inform_parameter_number_of_entries(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
int cnt = get_number_of_entries(ctx, data, instance, browseInformParameterInst);
|
||||
dmasprintf(value, "%d", cnt);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
DMOBJ tManagementServerObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys, version*/
|
||||
{"HeartbeatPolicy", &DMREAD, NULL, NULL, NULL, NULL, NULL, NULL, NULL, tHeartbeatPolicyParams, NULL, BBFDM_CWMP, NULL, "2.12"},
|
||||
{"InformParameter", &DMWRITE, add_inform_parameter, delete_inform_parameter, NULL, browseInformParameterInst, NULL, NULL, NULL, tInformParameterParams, NULL, BBFDM_CWMP, NULL, "2.8"},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -711,6 +868,7 @@ DMLEAF tManagementServerParams[] = {
|
|||
{"EnableCWMP", &DMWRITE, DMT_BOOL, get_management_server_enable_cwmp, set_management_server_enable_cwmp, BBFDM_CWMP, "2.12"},
|
||||
{"UDPConnectionRequestAddress", &DMREAD, DMT_STRING, get_upd_cr_address, NULL, BBFDM_CWMP, "2.0"},
|
||||
{"NATDetected", &DMREAD, DMT_BOOL, get_nat_detected, NULL, BBFDM_CWMP, "2.0"},
|
||||
{"InformParameterNumberOfEntries", &DMREAD, DMT_UNINT, get_inform_parameter_number_of_entries, NULL, BBFDM_CWMP, "2.0"},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
@ -720,3 +878,12 @@ DMLEAF tHeartbeatPolicyParams[] = {
|
|||
{"InitiationTime", &DMWRITE, DMT_TIME, get_heart_beat_policy_initiation_time, set_heart_beat_policy_initiation_time, BBFDM_CWMP, "2.12"},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tInformParameterParams[] = {
|
||||
{"Enable", &DMWRITE, DMT_BOOL, get_inform_parameter_enable, set_inform_parameter_enable, BBFDM_CWMP, "2.8"},
|
||||
{"Alias", &DMWRITE, DMT_STRING, get_inform_parameter_alias, set_inform_parameter_alias, BBFDM_CWMP, "2.8"},
|
||||
{"ParameterName", &DMWRITE, DMT_STRING, get_inform_parameter_parameter_name, set_inform_parameter_parameter_name, BBFDM_CWMP, "2.8"},
|
||||
{"EventList", &DMWRITE, DMT_STRING, get_inform_parameter_event_list, set_inform_parameter_event_list, BBFDM_CWMP, "2.8"},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@
|
|||
|
||||
extern DMLEAF tManagementServerParams[];
|
||||
extern DMLEAF tHeartbeatPolicyParams[];
|
||||
extern DMLEAF tInformParameterParams[];
|
||||
extern DMOBJ tManagementServerObj[];
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -353,10 +353,12 @@ struct uci_section *dmuci_walk_section(char *package, char *stype, void *arg1, v
|
|||
int dmuci_get_option_value_string_bbfdm(char *package, char *section, char *option, char **value);
|
||||
int dmuci_set_value_bbfdm(char *package, char *section, char *option, char *value);
|
||||
int dmuci_set_value_by_section_bbfdm(struct uci_section *s, char *option, char *value);
|
||||
int dmuci_set_value_by_section_varstate(struct uci_section *s, char *option, char *value);
|
||||
int dmuci_add_section_bbfdm(char *package, char *stype, struct uci_section **s);
|
||||
int dmuci_delete_bbfdm(char *package, char *section, char *option, char *value);
|
||||
int dmuci_delete_by_section_unnamed_bbfdm(struct uci_section *s, char *option, char *value);
|
||||
int dmuci_delete_by_section_bbfdm(struct uci_section *s, char *option, char *value);
|
||||
int dmuci_delete_by_section_varstate(struct uci_section *s, char *option, char *value);
|
||||
int dmuci_commit_package_bbfdm(char *package);
|
||||
int dmuci_commit_bbfdm(void);
|
||||
int dmuci_revert_bbfdm(void);
|
||||
|
|
@ -364,11 +366,11 @@ int dmuci_commit_package_varstate(char *package);
|
|||
int dmuci_save_package_varstate(char *package);
|
||||
int dmuci_revert_package_varstate(char *package);
|
||||
struct uci_section *dmuci_walk_section_bbfdm(char *package, char *stype, void *arg1, void *arg2, int cmp , int (*filter)(struct uci_section *s, void *value), struct uci_section *prev_section, int walk);
|
||||
|
||||
struct uci_section *dmuci_walk_section_varstate(char *package, char *stype, void *arg1, void *arg2, int cmp , int (*filter)(struct uci_section *s, void *value), struct uci_section *prev_section, int walk);
|
||||
int dmuci_init_bbfdm(void);
|
||||
void dmuci_exit_bbfdm(void);
|
||||
void commit_and_free_uci_ctx_bbfdm(char *dmmap_config);
|
||||
|
||||
int dmuci_add_section_varstate(char *package, char *stype, struct uci_section **s);
|
||||
int dmuci_init_varstate(void);
|
||||
void dmuci_exit_varstate(void);
|
||||
int db_get_value_string(char *package, char *section, char *option, char **value);
|
||||
|
|
|
|||
|
|
@ -19,70 +19,11 @@
|
|||
/* ********** DynamicObj ********** */
|
||||
DM_MAP_OBJ tDynamicObj[] = {
|
||||
/* parentobj, nextobject, parameter */
|
||||
{"Device.ManagementServer.", tDynamicManagementServerObj, tDynamicManagementServerParams},
|
||||
{"Device.ManagementServer.", NULL, tDynamicManagementServerParams},
|
||||
{"Device.", tDynamicDeviceObj, tDynamicDeviceParams},
|
||||
{0}
|
||||
};
|
||||
|
||||
/*************************************************************
|
||||
* ENTRY METHOD
|
||||
**************************************************************/
|
||||
static int browseManagementServerInformParameterInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
|
||||
{
|
||||
struct dmmap_dup *p = NULL;
|
||||
char *inst = NULL;
|
||||
LIST_HEAD(dup_list);
|
||||
|
||||
synchronize_specific_config_sections_with_dmmap("cwmp", "inform_extra", "dmmap_cwmp", &dup_list);
|
||||
list_for_each_entry(p, &dup_list, list) {
|
||||
|
||||
inst = handle_instance(dmctx, parent_node, p->dmmap_section, "inform_instance", "inform_alias");
|
||||
|
||||
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p, inst) == DM_STOP)
|
||||
break;
|
||||
}
|
||||
free_dmmap_config_dup_list(&dup_list);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* ADD & DEL OBJ
|
||||
**************************************************************/
|
||||
static int addObjManagementServerInformParameter(char *refparam, struct dmctx *ctx, void *data, char **instance)
|
||||
{
|
||||
struct uci_section *s = NULL, *dmmap_s = NULL;
|
||||
|
||||
dmuci_add_section("cwmp", "inform_extra", &s);
|
||||
|
||||
dmuci_add_section_bbfdm("dmmap_cwmp", "inform_extra", &dmmap_s);
|
||||
dmuci_set_value_by_section(dmmap_s, "section_name", section_name(s));
|
||||
dmuci_set_value_by_section(dmmap_s, "inform_instance", *instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int delObjManagementServerInformParameter(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action)
|
||||
{
|
||||
struct uci_section *s = NULL, *stmp = NULL;
|
||||
|
||||
switch (del_action) {
|
||||
case DEL_INST:
|
||||
dmuci_delete_by_section(((struct dmmap_dup *)data)->config_section, NULL, NULL);
|
||||
dmuci_delete_by_section(((struct dmmap_dup *)data)->dmmap_section, NULL, NULL);
|
||||
break;
|
||||
case DEL_ALL:
|
||||
uci_foreach_sections_safe("cwmp", "inform_extra", stmp, s) {
|
||||
struct uci_section *dmmap_s = NULL;
|
||||
|
||||
get_dmmap_section_of_config_section("dmmap_cwmp", "inform_extra", section_name(s), &dmmap_s);
|
||||
dmuci_delete_by_section(dmmap_s, NULL, NULL);
|
||||
|
||||
dmuci_delete_by_section(s, NULL, NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************
|
||||
* GET & SET PARAM
|
||||
**************************************************************/
|
||||
|
|
@ -109,97 +50,6 @@ static int set_ManagementServer_EnableCWMP(char *refparam, struct dmctx *ctx, vo
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int get_ManagementServerInformParameter_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "enabled", "1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_ManagementServerInformParameter_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
bool b;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_boolean(value))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
string_to_bool(value, &b);
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "enabled", b ? "1" : "0");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_ManagementServerInformParameter_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
get_dmmap_section_of_config_section("dmmap_cwmp", "inform_extra", section_name(((struct dmmap_dup *)data)->config_section), &dmmap_section);
|
||||
dmuci_get_value_by_section_string(dmmap_section, "inform_alias", value);
|
||||
if ((*value)[0] == '\0')
|
||||
dmasprintf(value, "cpe-%s", instance);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_ManagementServerInformParameter_Alias(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
struct uci_section *dmmap_section = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 64, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
get_dmmap_section_of_config_section("dmmap_cwmp", "inform_extra", section_name(((struct dmmap_dup *)data)->config_section), &dmmap_section);
|
||||
dmuci_set_value_by_section(dmmap_section, "inform_alias", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_ManagementServerInformParameter_ParameterName(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "parameter", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_ManagementServerInformParameter_ParameterName(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string(value, -1, 256, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "parameter", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_ManagementServerInformParameter_EventList(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "events", value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int set_ManagementServerInformParameter_EventList(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (dm_validate_string_list(value, -1, -1, -1, -1, -1, NULL, NULL))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "events", value);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int get_X_IOPSYS_EU_Syslog_ServerIPAddress(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||
{
|
||||
dmuci_get_option_value_string("system", "@system[0]", "log_ip", value);
|
||||
|
|
@ -334,29 +184,12 @@ static int get_event_args_XIOPSYSEU_Boot(char *refparam, struct dmctx *ctx, void
|
|||
/**********************************************************************************************************************************
|
||||
* OBJ & PARAM DEFINITION
|
||||
***********************************************************************************************************************************/
|
||||
/* *** Device.ManagementServer. *** */
|
||||
DMOBJ tDynamicManagementServerObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
{"InformParameter", &DMWRITE, addObjManagementServerInformParameter, delObjManagementServerInformParameter, NULL, browseManagementServerInformParameterInst, NULL, NULL, NULL, tManagementServerInformParameterParams, NULL, BBFDM_CWMP, LIST_KEY{"Alias", "ParameterName", NULL}},
|
||||
{0}
|
||||
};
|
||||
|
||||
DMLEAF tDynamicManagementServerParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"EnableCWMP", &DMWRITE, DMT_BOOL, get_ManagementServer_EnableCWMP, set_ManagementServer_EnableCWMP, BBFDM_CWMP},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device.ManagementServer.InformParameter.{i}. *** */
|
||||
DMLEAF tManagementServerInformParameterParams[] = {
|
||||
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
|
||||
{"Enable", &DMWRITE, DMT_BOOL, get_ManagementServerInformParameter_Enable, set_ManagementServerInformParameter_Enable, BBFDM_CWMP},
|
||||
{"Alias", &DMWRITE, DMT_STRING, get_ManagementServerInformParameter_Alias, set_ManagementServerInformParameter_Alias, BBFDM_CWMP},
|
||||
{"ParameterName", &DMWRITE, DMT_STRING, get_ManagementServerInformParameter_ParameterName, set_ManagementServerInformParameter_ParameterName, BBFDM_CWMP},
|
||||
{"EventList", &DMWRITE, DMT_STRING, get_ManagementServerInformParameter_EventList, set_ManagementServerInformParameter_EventList, BBFDM_CWMP},
|
||||
{0}
|
||||
};
|
||||
|
||||
/* *** Device. *** */
|
||||
DMOBJ tDynamicDeviceObj[] = {
|
||||
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, nextdynamicobj, dynamicleaf, nextobj, leaf, linker, bbfdm_type, uniqueKeys*/
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@
|
|||
#ifndef __LIBBBFD_TEST_H
|
||||
#define __LIBBBFD_TEST_H
|
||||
|
||||
extern DMOBJ tDynamicManagementServerObj[];
|
||||
extern DMLEAF tDynamicManagementServerParams[];
|
||||
extern DMLEAF tManagementServerInformParameterParams[];
|
||||
extern DMOBJ tDynamicDeviceObj[];
|
||||
extern DMLEAF tDynamicDeviceParams[];
|
||||
extern DMLEAF tX_IOPSYS_EU_SyslogParam[];
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ static void test_bbf_api_uci(void **state)
|
|||
assert_string_equal(value, "");
|
||||
|
||||
// dmuci_get_section_type: test with correct config/section
|
||||
uci_res = dmuci_get_section_type("cwmp", "@inform_extra[0]", &value);
|
||||
uci_res = dmuci_get_section_type("firewall", "@rule[0]", &value);
|
||||
assert_int_equal(uci_res, 0);
|
||||
assert_string_not_equal(value, "");
|
||||
|
||||
|
|
|
|||
|
|
@ -43,16 +43,6 @@ config lwn 'lwn'
|
|||
option enable '1'
|
||||
option hostname ''
|
||||
option port '0'
|
||||
|
||||
config inform_extra
|
||||
option enabled '0'
|
||||
option parameter 'Device.DeviceInfo.Manufacturer'
|
||||
option events '0 BOOTSTRAP,2 PERIODIC'
|
||||
|
||||
config inform_extra
|
||||
option enabled '0'
|
||||
option parameter 'Device.DeviceInfo.SerialNumber'
|
||||
option events '0 BOOTSTRAP'
|
||||
|
||||
config test 'test'
|
||||
option enable '0'
|
||||
|
|
|
|||
|
|
@ -1,2 +1,12 @@
|
|||
config acs 'acs'
|
||||
option dhcp_url 'http://192.168.1.123:8080/openacs'
|
||||
option dhcp_url 'http://192.168.1.123:8080/openacs'
|
||||
|
||||
config inform_parameter
|
||||
option informparam_instance '1'
|
||||
option enable 'true'
|
||||
option parameter_name 'Device.DeviceInfo.UpTime'
|
||||
option events_list '1 BOOT'
|
||||
|
||||
config inform_parameter
|
||||
option enable '0'
|
||||
option informparam_instance '2'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue