Commit 7491e611 authored by Omar Kallel's avatar Omar Kallel
Browse files

Merge branch '4.3_17388' into 'release-4.3'

Refs #17338: tr-98...

See merge request !15
parents 82edb081 8d8a24b4
......@@ -56,6 +56,7 @@ DMLEAF X_IOPSYS_EU_ListenObjParams[] = {
{"UbusCert", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_ubus_cert, set_x_iopsys_eu_owsd_ubus_cert, NULL, NULL},
{"UbusKey", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_ubus_key, set_x_iopsys_eu_owsd_ubus_key, NULL, NULL},
{"UbusCa", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_ubus_ca, set_x_iopsys_eu_owsd_ubus_ca, NULL, NULL},
{"UserSupport", &DMWRITE, DMT_STRING, get_x_iopsys_eu_owsd_user_support, set_x_iopsys_eu_owsd_user_support, NULL, NULL},
{0}
};
......@@ -525,6 +526,36 @@ int set_x_iopsys_eu_owsd_ubus_ca(char *refparam, struct dmctx *ctx, void *data,
return 0;
}
int get_x_iopsys_eu_owsd_user_support(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value){
struct uci_section *owsd_listensection = (struct uci_section *)data;
struct uci_list *val;
dmuci_get_value_by_section_list(owsd_listensection, "user", &val);
if (val)
*value = dmuci_list_to_string(val, " ");
else
*value = "";
return 0;
}
int set_x_iopsys_eu_owsd_user_support(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action){
struct uci_section *owsd_listensection = (struct uci_section *)data;
char *pch=NULL, *spch=NULL;
switch (action) {
case VALUECHECK:
return 0;
case VALUESET:
dmuci_delete_by_section(owsd_listensection, "user", NULL);
pch = strtok_r(value, " ", &spch);
while (pch != NULL) {
dmuci_add_list_value_by_section(owsd_listensection, "user", pch);
pch = strtok_r(NULL, " ", &spch);
}
return 0;
}
return 0;
}
/***** ADD DEL OBJ *******/
int add_owsd_listen(char *refparam, struct dmctx *ctx, void *data, char **instancepara)
{
......@@ -588,4 +619,4 @@ int delete_owsd_listen_instance(char *refparam, struct dmctx *ctx, void *data, c
return 0;
}
return 0;
}
}
\ No newline at end of file
......@@ -35,6 +35,8 @@ int get_x_iopsys_eu_owsd_ubus_key(char *refparam, struct dmctx *ctx, void *data,
int set_x_iopsys_eu_owsd_ubus_key(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int get_x_iopsys_eu_owsd_ubus_ca(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int set_x_iopsys_eu_owsd_ubus_ca(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int get_x_iopsys_eu_owsd_user_support(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value);
int set_x_iopsys_eu_owsd_user_support(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action);
int add_owsd_listen(char *refparam, struct dmctx *ctx, void *data, char **instancepara);
int delete_owsd_listen_instance(char *refparam, struct dmctx *ctx, void *data, char *instance, unsigned char del_action);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment