mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-03-10 19:27:32 +01:00
log update
This commit is contained in:
parent
0af1e5825f
commit
aa9b100769
5 changed files with 25 additions and 35 deletions
|
|
@ -173,7 +173,7 @@ int cwmp_schedule_rpc (struct cwmp *cwmp, struct session *session)
|
|||
int error=0,e;
|
||||
|
||||
if (http_client_init(cwmp)) {
|
||||
CWMP_LOG(INFO, "initializing http client failed\n");
|
||||
CWMP_LOG(INFO, "Initializing http client failed");
|
||||
goto retry;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
#include "md5.h"
|
||||
#include "digestauth.h"
|
||||
|
||||
#undef DIGEST_DEBUG
|
||||
|
||||
#define HASH_MD5_HEX_LEN (2 * MD5_DIGEST_SIZE)
|
||||
|
||||
/**
|
||||
|
|
@ -318,9 +316,8 @@ int http_digest_auth_fail_response(FILE *fp, const char *http_method,
|
|||
"Digest realm=\"%s\",qop=\"auth\",nonce=\"%s\",opaque=\"%s\"%s",
|
||||
realm, nonce, opaque, signal_stale ? ",stale=\"true\"" : "");
|
||||
|
||||
#ifdef DIGEST_DEBUG
|
||||
printf("%s: header: %s\n", __FUNCTION__, header);
|
||||
#endif
|
||||
DD(DEBUG, "%s: header: %s", __FUNCTION__, header);
|
||||
|
||||
fputs("WWW-Authenticate: ", fp);
|
||||
fputs(header, fp);
|
||||
return MHD_YES;
|
||||
|
|
@ -362,9 +359,7 @@ int http_digest_auth_check(const char *http_method, const char *url,
|
|||
size_t left; /* number of characters left in 'header' for 'uri' */
|
||||
unsigned long int nci;
|
||||
|
||||
#ifdef DIGEST_DEBUG
|
||||
printf("%s: header: %s\n", __FUNCTION__, header);
|
||||
#endif
|
||||
DD(DEBUG, "%s: header: %s", __FUNCTION__, header);
|
||||
|
||||
left = strlen(header);
|
||||
|
||||
|
|
@ -410,9 +405,8 @@ int http_digest_auth_check(const char *http_method, const char *url,
|
|||
|
||||
if (0 != strncmp(uri, url, strlen(url)))
|
||||
{
|
||||
#ifdef DIGEST_DEBUG
|
||||
printf("Authentication failed: URI does not match.\n");
|
||||
#endif
|
||||
DD(DEBUG, "Authentication failed: URI does not match.");
|
||||
|
||||
return MHD_NO;
|
||||
}
|
||||
|
||||
|
|
@ -440,17 +434,13 @@ int http_digest_auth_check(const char *http_method, const char *url,
|
|||
== lookup_sub_value(response, sizeof(response), header,
|
||||
"response")))
|
||||
{
|
||||
#ifdef DIGEST_DEBUG
|
||||
printf("Authentication failed, invalid format.\n");
|
||||
#endif
|
||||
DD(DEBUG, "Authentication failed, invalid format.");
|
||||
return MHD_NO;
|
||||
}
|
||||
nci = strtoul(nc, &end, 16);
|
||||
if (('\0' != *end) || ((LONG_MAX == nci) && (ERANGE == errno)))
|
||||
{
|
||||
#ifdef DIGEST_DEBUG
|
||||
printf("Authentication failed, invalid format.\n");
|
||||
#endif
|
||||
DD(DEBUG, "Authentication failed, invalid format.");
|
||||
return MHD_NO; /* invalid nonce format */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ http_client_init(struct cwmp *cwmp)
|
|||
return -1;
|
||||
#endif
|
||||
|
||||
CWMP_LOG(INFO, "ACS url: %s\n", http_c.url);
|
||||
CWMP_LOG(INFO, "ACS url: %s", http_c.url);
|
||||
|
||||
/* TODO debug ssl config from freecwmp*/
|
||||
|
||||
|
|
@ -278,7 +278,7 @@ static void http_new_client(struct uloop_fd *ufd, unsigned events)
|
|||
|
||||
/* set one minute timeout */
|
||||
if (setsockopt(ufd->fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&t, sizeof t)) {
|
||||
CWMP_LOG(ERROR,"setsockopt() failed\n");
|
||||
CWMP_LOG(ERROR,"setsockopt() failed");
|
||||
}
|
||||
|
||||
if (client == -1)
|
||||
|
|
|
|||
|
|
@ -92,13 +92,13 @@ cwmp_handle_command(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
char *info;
|
||||
|
||||
if (!strcmp("reload_end_session", cmd)) {
|
||||
CWMP_LOG(INFO, "triggered ubus reload_end_session\n");
|
||||
CWMP_LOG(INFO, "triggered ubus reload_end_session");
|
||||
cwmp_set_end_session(END_SESSION_RELOAD);
|
||||
blobmsg_add_u32(&b, "status", 0);
|
||||
if (asprintf(&info, "freecwmpd config will reload at the end of the session") == -1)
|
||||
return -1;
|
||||
} else if (!strcmp("reload", cmd)) {
|
||||
CWMP_LOG(INFO, "triggered ubus reload\n");
|
||||
CWMP_LOG(INFO, "triggered ubus reload");
|
||||
cwmp_apply_acs_changes();
|
||||
blobmsg_add_u32(&b, "status", 0);
|
||||
if (asprintf(&info, "freecwmp config reloaded") == -1)
|
||||
|
|
|
|||
26
src/xml.c
26
src/xml.c
|
|
@ -74,19 +74,19 @@ struct FAULT_CPE FAULT_CPE_ARRAY [] = {
|
|||
};
|
||||
|
||||
const struct rpc_cpe_method rpc_cpe_methods[] = {
|
||||
[RPC_CPE_GET_RPC_METHODS] = {"GetRPCMethods", cwmp_handle_rpc_cpe_get_rpc_methods},
|
||||
[RPC_CPE_SET_PARAMETER_VALUES] = {"SetParameterValues", cwmp_handle_rpc_cpe_set_parameter_values},
|
||||
[RPC_CPE_GET_PARAMETER_VALUES] = {"GetParameterValues", cwmp_handle_rpc_cpe_get_parameter_values},
|
||||
[RPC_CPE_GET_PARAMETER_NAMES] = {"GetParameterNames", cwmp_handle_rpc_cpe_get_parameter_names},
|
||||
[RPC_CPE_SET_PARAMETER_ATTRIBUTES] = {"SetParameterAttributes", cwmp_handle_rpc_cpe_set_parameter_attributes},
|
||||
[RPC_CPE_GET_PARAMETER_ATTRIBUTES] = {"GetParameterAttributes", cwmp_handle_rpc_cpe_get_parameter_attributes},
|
||||
[RPC_CPE_ADD_OBJECT] = {"AddObject", cwmp_handle_rpc_cpe_add_object},
|
||||
[RPC_CPE_DELETE_OBJECT] = {"DeleteObject", cwmp_handle_rpc_cpe_delete_object},
|
||||
[RPC_CPE_REBOOT] = {"Reboot", cwmp_handle_rpc_cpe_reboot},
|
||||
[RPC_CPE_DOWNLOAD] = {"Download", cwmp_handle_rpc_cpe_download},
|
||||
[RPC_CPE_FACTORY_RESET] = {"FactoryReset", cwmp_handle_rpc_cpe_factory_reset},
|
||||
[RPC_CPE_SCHEDULE_INFORM] = {"ScheduleInform", cwmp_handle_rpc_cpe_schedule_inform},
|
||||
[RPC_CPE_FAULT] = {NULL, cwmp_handle_rpc_cpe_fault}
|
||||
[RPC_CPE_GET_RPC_METHODS] = {"GetRPCMethods", cwmp_handle_rpc_cpe_get_rpc_methods},
|
||||
[RPC_CPE_SET_PARAMETER_VALUES] = {"SetParameterValues", cwmp_handle_rpc_cpe_set_parameter_values},
|
||||
[RPC_CPE_GET_PARAMETER_VALUES] = {"GetParameterValues", cwmp_handle_rpc_cpe_get_parameter_values},
|
||||
[RPC_CPE_GET_PARAMETER_NAMES] = {"GetParameterNames", cwmp_handle_rpc_cpe_get_parameter_names},
|
||||
[RPC_CPE_SET_PARAMETER_ATTRIBUTES] = {"SetParameterAttributes", cwmp_handle_rpc_cpe_set_parameter_attributes},
|
||||
[RPC_CPE_GET_PARAMETER_ATTRIBUTES] = {"GetParameterAttributes", cwmp_handle_rpc_cpe_get_parameter_attributes},
|
||||
[RPC_CPE_ADD_OBJECT] = {"AddObject", cwmp_handle_rpc_cpe_add_object},
|
||||
[RPC_CPE_DELETE_OBJECT] = {"DeleteObject", cwmp_handle_rpc_cpe_delete_object},
|
||||
[RPC_CPE_REBOOT] = {"Reboot", cwmp_handle_rpc_cpe_reboot},
|
||||
[RPC_CPE_DOWNLOAD] = {"Download", cwmp_handle_rpc_cpe_download},
|
||||
[RPC_CPE_FACTORY_RESET] = {"FactoryReset", cwmp_handle_rpc_cpe_factory_reset},
|
||||
[RPC_CPE_SCHEDULE_INFORM] = {"ScheduleInform", cwmp_handle_rpc_cpe_schedule_inform},
|
||||
[RPC_CPE_FAULT] = {"Fault", cwmp_handle_rpc_cpe_fault}
|
||||
};
|
||||
|
||||
const struct rpc_acs_method rpc_acs_methods[] = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue