mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
icwmp UCI adjustment
This commit is contained in:
parent
6d8b66092a
commit
4a8d286201
6 changed files with 10 additions and 19 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,3 +7,4 @@ install_manifest.txt
|
||||||
*.so
|
*.so
|
||||||
bbfdmd/src/bbfdmd
|
bbfdmd/src/bbfdmd
|
||||||
docs/index.md
|
docs/index.md
|
||||||
|
__pycache__
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ static bool is_update_process_allowed(void)
|
||||||
|
|
||||||
if (dmubus_object_exist("tr069")) {
|
if (dmubus_object_exist("tr069")) {
|
||||||
struct uci_section *s = NULL, *stmp = NULL;
|
struct uci_section *s = NULL, *stmp = NULL;
|
||||||
uci_path_foreach_sections_safe(varstate, "cwmp", "sess_status", stmp, s) {
|
uci_path_foreach_sections_safe(varstate, "icwmp", "sess_status", stmp, s) {
|
||||||
dmuci_get_value_by_section_string(s, "current_status", &tr069_status);
|
dmuci_get_value_by_section_string(s, "current_status", &tr069_status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
static int get_manufacturer_oui(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
static int get_manufacturer_oui(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||||
{
|
{
|
||||||
dmuci_get_option_value_string_varstate("cwmp", "gatewayinfo", "oui", value);
|
dmuci_get_option_value_string_varstate("icwmp", "gatewayinfo", "oui", value);
|
||||||
if (*value[0] == '\0') {
|
if (*value[0] == '\0') {
|
||||||
dmuci_get_option_value_string("cwmp", "cpe", "manufacturer_oui", value);
|
dmuci_get_option_value_string("cwmp", "cpe", "manufacturer_oui", value);
|
||||||
if (*value[0] == '\0')
|
if (*value[0] == '\0')
|
||||||
|
|
@ -24,7 +24,7 @@ static int get_manufacturer_oui(char *refparam, struct dmctx *ctx, void *data, c
|
||||||
|
|
||||||
static int get_product_class(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
static int get_product_class(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||||
{
|
{
|
||||||
dmuci_get_option_value_string_varstate("cwmp", "gatewayinfo", "class", value);
|
dmuci_get_option_value_string_varstate("icwmp", "gatewayinfo", "class", value);
|
||||||
if (*value[0] == '\0') {
|
if (*value[0] == '\0') {
|
||||||
dmuci_get_option_value_string("cwmp", "cpe", "product_class", value);
|
dmuci_get_option_value_string("cwmp", "cpe", "product_class", value);
|
||||||
if (*value[0] == '\0')
|
if (*value[0] == '\0')
|
||||||
|
|
@ -36,7 +36,7 @@ static int get_product_class(char *refparam, struct dmctx *ctx, void *data, char
|
||||||
|
|
||||||
static int get_serial_number(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
static int get_serial_number(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
|
||||||
{
|
{
|
||||||
dmuci_get_option_value_string_varstate("cwmp", "gatewayinfo", "serial", value);
|
dmuci_get_option_value_string_varstate("icwmp", "gatewayinfo", "serial", value);
|
||||||
if (*value[0] == '\0') {
|
if (*value[0] == '\0') {
|
||||||
dmuci_get_option_value_string("cwmp", "cpe", "serial_number", value);
|
dmuci_get_option_value_string("cwmp", "cpe", "serial_number", value);
|
||||||
if (*value[0] == '\0')
|
if (*value[0] == '\0')
|
||||||
|
|
|
||||||
|
|
@ -140,17 +140,17 @@ static void test_bbf_api_uci(void **state)
|
||||||
assert_string_equal(value, "");
|
assert_string_equal(value, "");
|
||||||
|
|
||||||
// dmuci_get_option_value_string_varstate: test with correct config/option and wrong section name
|
// dmuci_get_option_value_string_varstate: test with correct config/option and wrong section name
|
||||||
uci_res = dmuci_get_option_value_string_varstate("cwmp", "acss", "dhcp_url", &value);
|
uci_res = dmuci_get_option_value_string_varstate("icwmp", "acss", "dhcp_url", &value);
|
||||||
assert_int_equal(uci_res, -1);
|
assert_int_equal(uci_res, -1);
|
||||||
assert_string_equal(value, "");
|
assert_string_equal(value, "");
|
||||||
|
|
||||||
// dmuci_get_option_value_string_varstate: test with correct config/section and wrong option name
|
// dmuci_get_option_value_string_varstate: test with correct config/section and wrong option name
|
||||||
uci_res = dmuci_get_option_value_string_varstate("cwmp", "acs", "hcp_url", &value);
|
uci_res = dmuci_get_option_value_string_varstate("icwmp", "acs", "hcp_url", &value);
|
||||||
assert_int_equal(uci_res, -1);
|
assert_int_equal(uci_res, -1);
|
||||||
assert_string_equal(value, "");
|
assert_string_equal(value, "");
|
||||||
|
|
||||||
// dmuci_get_option_value_string_varstate: test correct config/section/option
|
// dmuci_get_option_value_string_varstate: test correct config/section/option
|
||||||
uci_res = dmuci_get_option_value_string_varstate("cwmp", "acs", "dhcp_url", &value);
|
uci_res = dmuci_get_option_value_string_varstate("icwmp", "acs", "dhcp_url", &value);
|
||||||
assert_int_equal(uci_res, 0);
|
assert_int_equal(uci_res, 0);
|
||||||
assert_string_equal(value, "http://192.168.1.123:8080/openacs");
|
assert_string_equal(value, "http://192.168.1.123:8080/openacs");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
config acs 'acs'
|
|
||||||
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'
|
|
||||||
2
test/files/var/state/icwmp
Normal file
2
test/files/var/state/icwmp
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
config acs 'acs'
|
||||||
|
option dhcp_url 'http://192.168.1.123:8080/openacs'
|
||||||
Loading…
Add table
Reference in a new issue