mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-10 07:44:41 +01:00
Make the enable/disable of GetRPCMethods ACS methods done via cwmp uci option
This commit is contained in:
parent
3d157a4418
commit
cb601366e6
6 changed files with 20 additions and 8 deletions
7
config.c
7
config.c
|
|
@ -356,6 +356,13 @@ int get_global_config(struct config *conf)
|
||||||
return CWMP_GEN_ERR;
|
return CWMP_GEN_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((error = uci_get_value(UCI_ACS_GETRPC, &value)) == CWMP_OK) {
|
||||||
|
conf->acs_getrpc = uci_str_to_bool(value);
|
||||||
|
FREE(value);
|
||||||
|
} else {
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
if ((error = uci_get_value(UCI_ACS_USERID_PATH, &value)) == CWMP_OK) {
|
if ((error = uci_get_value(UCI_ACS_USERID_PATH, &value)) == CWMP_OK) {
|
||||||
if (value != NULL) {
|
if (value != NULL) {
|
||||||
FREE(conf->acs_userid);
|
FREE(conf->acs_userid);
|
||||||
|
|
|
||||||
2
event.c
2
event.c
|
|
@ -329,7 +329,7 @@ int cwmp_root_cause_get_rpc_method(struct cwmp *cwmp)
|
||||||
}
|
}
|
||||||
cwmp_save_event_container(event_container);
|
cwmp_save_event_container(event_container);
|
||||||
session = list_entry(cwmp->head_event_container, struct session, head_event_container);
|
session = list_entry(cwmp->head_event_container, struct session, head_event_container);
|
||||||
if (cwmp_add_session_rpc_acs(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
if (cwmp->conf.acs_getrpc && cwmp_add_session_rpc_acs(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
||||||
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
|
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
|
||||||
return CWMP_MEM_ERR;
|
return CWMP_MEM_ERR;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ typedef struct config {
|
||||||
bool insecure_enable;
|
bool insecure_enable;
|
||||||
bool ipv6_enable;
|
bool ipv6_enable;
|
||||||
bool heart_beat_enable;
|
bool heart_beat_enable;
|
||||||
|
bool acs_getrpc;
|
||||||
int retry_min_wait_interval;
|
int retry_min_wait_interval;
|
||||||
int retry_interval_multiplier;
|
int retry_interval_multiplier;
|
||||||
bool lw_notification_enable;
|
bool lw_notification_enable;
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
#define UCI_ACS_COMPRESSION "cwmp.acs.compression"
|
#define UCI_ACS_COMPRESSION "cwmp.acs.compression"
|
||||||
#define UCI_ACS_RETRY_MIN_WAIT_INTERVAL "cwmp.acs.retry_min_wait_interval"
|
#define UCI_ACS_RETRY_MIN_WAIT_INTERVAL "cwmp.acs.retry_min_wait_interval"
|
||||||
#define UCI_ACS_RETRY_INTERVAL_MULTIPLIER "cwmp.acs.retry_interval_multiplier"
|
#define UCI_ACS_RETRY_INTERVAL_MULTIPLIER "cwmp.acs.retry_interval_multiplier"
|
||||||
|
#define UCI_ACS_GETRPC "cwmp.acs.get_rpc_methods"
|
||||||
#define UCI_CPE_USERID_PATH "cwmp.cpe.userid"
|
#define UCI_CPE_USERID_PATH "cwmp.cpe.userid"
|
||||||
#define UCI_CPE_PASSWD_PATH "cwmp.cpe.passwd"
|
#define UCI_CPE_PASSWD_PATH "cwmp.cpe.passwd"
|
||||||
#define UCI_CPE_CWMP_ENABLE "cwmp.cpe.enable"
|
#define UCI_CPE_CWMP_ENABLE "cwmp.cpe.enable"
|
||||||
|
|
|
||||||
|
|
@ -112,11 +112,14 @@ struct session *cwmp_add_queue_session(struct cwmp *cwmp)
|
||||||
/*
|
/*
|
||||||
* Set Required methods as initial value of
|
* Set Required methods as initial value of
|
||||||
*/
|
*/
|
||||||
|
if (cwmp->conf.acs_getrpc) {
|
||||||
rpc_acs = cwmp_add_session_rpc_acs_head(session, RPC_ACS_GET_RPC_METHODS);
|
rpc_acs = cwmp_add_session_rpc_acs_head(session, RPC_ACS_GET_RPC_METHODS);
|
||||||
if (rpc_acs == NULL) {
|
if (rpc_acs == NULL) {
|
||||||
FREE(session);
|
FREE(session);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rpc_acs = cwmp_add_session_rpc_acs_head(session, RPC_ACS_INFORM);
|
rpc_acs = cwmp_add_session_rpc_acs_head(session, RPC_ACS_INFORM);
|
||||||
if (rpc_acs == NULL) {
|
if (rpc_acs == NULL) {
|
||||||
FREE(session);
|
FREE(session);
|
||||||
|
|
@ -176,7 +179,7 @@ int cwmp_move_session_to_session_queue(struct cwmp *cwmp, struct session *sessio
|
||||||
if (session->head_rpc_acs.next != &(session->head_rpc_acs)) {
|
if (session->head_rpc_acs.next != &(session->head_rpc_acs)) {
|
||||||
rpc_acs = list_entry(session->head_rpc_acs.next, struct rpc, list);
|
rpc_acs = list_entry(session->head_rpc_acs.next, struct rpc, list);
|
||||||
if (rpc_acs->type != RPC_ACS_INFORM) {
|
if (rpc_acs->type != RPC_ACS_INFORM) {
|
||||||
if (cwmp_add_session_rpc_acs_head(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
if (cwmp->conf.acs_getrpc && cwmp_add_session_rpc_acs_head(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
||||||
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
|
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
|
||||||
return CWMP_MEM_ERR;
|
return CWMP_MEM_ERR;
|
||||||
}
|
}
|
||||||
|
|
@ -186,7 +189,7 @@ int cwmp_move_session_to_session_queue(struct cwmp *cwmp, struct session *sessio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (cwmp_add_session_rpc_acs_head(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
if (cwmp->conf.acs_getrpc && cwmp_add_session_rpc_acs_head(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
||||||
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
|
pthread_mutex_unlock(&(cwmp->mutex_session_queue));
|
||||||
return CWMP_MEM_ERR;
|
return CWMP_MEM_ERR;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ static void icwmp_inform_get_rpc_method(struct ubus_context *ctx, struct ubus_re
|
||||||
|
|
||||||
cwmp_save_event_container(event_container);
|
cwmp_save_event_container(event_container);
|
||||||
session = list_entry(cwmp_main.head_event_container, struct session, head_event_container);
|
session = list_entry(cwmp_main.head_event_container, struct session, head_event_container);
|
||||||
if (cwmp_add_session_rpc_acs(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
if (cwmp_main.conf.acs_getrpc && cwmp_add_session_rpc_acs(session, RPC_ACS_GET_RPC_METHODS) == NULL) {
|
||||||
pthread_mutex_unlock(&(cwmp_main.mutex_session_queue));
|
pthread_mutex_unlock(&(cwmp_main.mutex_session_queue));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue