From 23058e114497355475e6645a16c723bb0829a45b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 25 Dec 2015 10:25:01 +0100 Subject: [PATCH] hnbgw_ranap: Print RANAP Cause in RESET and ERROR INDICATION --- src/hnbgw_ranap.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/hnbgw_ranap.c b/src/hnbgw_ranap.c index 15130995..7e3cfaf0 100644 --- a/src/hnbgw_ranap.c +++ b/src/hnbgw_ranap.c @@ -64,7 +64,8 @@ static int ranap_rx_init_reset(struct hnb_context *hnb, ANY_t *in) if (ies.cN_DomainIndicator == RANAP_CN_DomainIndicator_ps_domain) is_ps=1; - DEBUGP(DRANAP, "RESET.req(%s)\n", is_ps ? "ps" : "cs"); + LOGP(DRANAP, LOGL_INFO, "Rx RESET.req(%s,%s)\n", is_ps ? "ps" : "cs", + ranap_cause_str(&ies.cause)); /* FIXME: Actually we have to wait for some guard time? */ /* FIXME: Reset all resources related to this HNB/RNC */ @@ -73,6 +74,24 @@ static int ranap_rx_init_reset(struct hnb_context *hnb, ANY_t *in) return 0; } +static int ranap_rx_error_ind(struct hnb_context *hnb, ANY_t *in) +{ + RANAP_ErrorIndicationIEs_t ies; + int rc, is_ps = 0; + + rc = ranap_decode_errorindicationies(&ies, in); + if (rc < 0) + return rc; + + if (ies.presenceMask & ERRORINDICATIONIES_RANAP_CAUSE_PRESENT) { + LOGP(DRANAP, LOGL_ERROR, "Rx ERROR.ind(%s)\n", + ranap_cause_str(&ies.cause)); + } else + LOGP(DRANAP, LOGL_ERROR, "Rx ERROR.ind\n"); + + return 0; +} + int ranap_parse_lai(struct gprs_ra_id *ra_id, const RANAP_LAI_t *lai) { uint8_t *ptr = lai->pLMNidentity.buf; @@ -143,6 +162,7 @@ static int ranap_rx_initiating_msg(struct hnb_context *hnb, RANAP_InitiatingMess case RANAP_ProcedureCode_id_OverloadControl: /* Overload ind */ break; case RANAP_ProcedureCode_id_ErrorIndication: /* Error ind */ + rc = ranap_rx_error_ind(hnb, &imsg->value); break; case RANAP_ProcedureCode_id_ResetResource: /* request */ case RANAP_ProcedureCode_id_InformationTransfer: