Mercurial > hg > freeDiameter
changeset 827:a8ed055a9253
Fix name of the constant errors used for rescode
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Thu, 20 Sep 2012 08:15:54 +0200 |
parents | d38c8ce61e4e |
children | 78307a61c578 |
files | libfdcore/p_ce.c libfdcore/peers.c |
diffstat | 2 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libfdcore/p_ce.c Tue Sep 18 22:33:02 2012 +0200 +++ b/libfdcore/p_ce.c Thu Sep 20 08:15:54 2012 +0200 @@ -307,7 +307,7 @@ peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, NULL)) { TRACE_DEBUG(INFO, "Received a message with Origin-Host set to '%.*s' while expecting '%s'\n", hdr->avp_value->os.len, hdr->avp_value->os.data, peer->p_hdr.info.pi_diamid); - error->pei_errcode = "ER_DIAMETER_AVP_NOT_ALLOWED"; + error->pei_errcode = "DIAMETER_AVP_NOT_ALLOWED"; error->pei_message = "Your Origin-Host value does not match my configuration."; error->pei_avp = avp; return EINVAL; @@ -327,7 +327,7 @@ /* In case of multiple AVPs */ if (peer->p_hdr.info.runtime.pir_realm) { TRACE_DEBUG(INFO, "Multiple instances of the Origin-Realm AVP"); - error->pei_errcode = "ER_DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; + error->pei_errcode = "DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; error->pei_message = "I found several Origin-Realm AVPs"; error->pei_avp = avp; return EINVAL; @@ -335,7 +335,7 @@ /* If the octet string contains a \0 */ if (!fd_os_is_valid_DiameterIdentity(hdr->avp_value->os.data, hdr->avp_value->os.len)) { - error->pei_errcode = "ER_DIAMETER_INVALID_AVP_VALUE"; + error->pei_errcode = "DIAMETER_INVALID_AVP_VALUE"; error->pei_message = "Your Origin-Realm contains invalid characters."; error->pei_avp = avp; return EINVAL; @@ -362,7 +362,7 @@ CHECK_FCT_DO( fd_msg_avp_value_interpret( avp, &ss), { /* in case of error, assume the AVP value was wrong */ - error->pei_errcode = "ER_DIAMETER_INVALID_AVP_VALUE"; + error->pei_errcode = "DIAMETER_INVALID_AVP_VALUE"; error->pei_avp = avp; return EINVAL; } ); @@ -384,7 +384,7 @@ /* In case of multiple AVPs */ if (peer->p_hdr.info.runtime.pir_vendorid) { TRACE_DEBUG(INFO, "Multiple instances of the Vendor-Id AVP"); - error->pei_errcode = "ER_DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; + error->pei_errcode = "DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; error->pei_message = "I found several Vendor-Id AVPs"; error->pei_avp = avp; return EINVAL; @@ -405,7 +405,7 @@ /* In case of multiple AVPs */ if (peer->p_hdr.info.runtime.pir_prodname) { TRACE_DEBUG(INFO, "Multiple instances of the Product-Name AVP"); - error->pei_errcode = "ER_DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; + error->pei_errcode = "DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; error->pei_message = "I found several Product-Name AVPs"; error->pei_avp = avp; return EINVAL; @@ -427,7 +427,7 @@ /* In case of multiple AVPs */ if (peer->p_hdr.info.runtime.pir_orstate) { TRACE_DEBUG(INFO, "Multiple instances of the Origin-State-Id AVP"); - error->pei_errcode = "ER_DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; + error->pei_errcode = "DIAMETER_AVP_OCCURS_TOO_MANY_TIMES"; error->pei_message = "I found several Origin-State-Id AVPs"; error->pei_avp = avp; return EINVAL; @@ -502,7 +502,7 @@ if (auth + acct != 1) { TRACE_DEBUG(FULL, "Invalid Vendor-Specific-Application-Id AVP received, ignored"); fd_msg_dump_one(FULL, avp); - error->pei_errcode = "ER_DIAMETER_INVALID_AVP_VALUE"; + error->pei_errcode = "DIAMETER_INVALID_AVP_VALUE"; error->pei_avp = avp; return EINVAL; } else { @@ -566,7 +566,7 @@ goto next; } if (hdr->avp_value->u32 >= 32 ) { - error->pei_errcode = "ER_DIAMETER_INVALID_AVP_VALUE"; + error->pei_errcode = "DIAMETER_INVALID_AVP_VALUE"; error->pei_message = "I don't support this Inband-Security-Id value (yet)."; error->pei_avp = avp; return EINVAL; @@ -693,7 +693,7 @@ CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, msg, MSGFL_ANSW_ERROR ) ); /* Set the error code */ - CHECK_FCT( fd_msg_rescode_set(*msg, "ER_DIAMETER_UNABLE_TO_COMPLY", "No CER allowed in current state", NULL, 1 ) ); + CHECK_FCT( fd_msg_rescode_set(*msg, "DIAMETER_UNABLE_TO_COMPLY", "No CER allowed in current state", NULL, 1 ) ); /* msg now contains an answer message to send back */ CHECK_FCT_DO( fd_out_send(msg, NULL, peer, FD_CNX_ORDERED), /* In case of error the message has already been dumped */ );
--- a/libfdcore/peers.c Tue Sep 18 22:33:02 2012 +0200 +++ b/libfdcore/peers.c Thu Sep 20 08:15:54 2012 +0200 @@ -474,7 +474,7 @@ if (!fd_os_is_valid_DiameterIdentity(avp_hdr->avp_value->os.data, avp_hdr->avp_value->os.len)) { TRACE_DEBUG(INFO, "Received new CER with invalid Origin-Host"); CHECK_FCT( fd_msg_new_answer_from_req ( fd_g_config->cnf_dict, cer, MSGFL_ANSW_ERROR ) ); - CHECK_FCT( fd_msg_rescode_set(*cer, "ER_DIAMETER_INVALID_AVP_VALUE", + CHECK_FCT( fd_msg_rescode_set(*cer, "DIAMETER_INVALID_AVP_VALUE", "Your Origin-Host contains invalid characters.", avp_oh, 1 ) ); CHECK_FCT( fd_out_send(cer, *cnx, NULL, FD_CNX_ORDERED) ); return EINVAL;