aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-25 10:25:01 +0100
committerHarald Welte <laforge@gnumonks.org>2015-12-25 10:25:01 +0100
commit23058e114497355475e6645a16c723bb0829a45b (patch)
tree78dc3822e7f3f3ad5d773193c0669c8b0ae2bdfc
parentc3ca7eba180a784af75e98f5dada9e8c441d1a90 (diff)
hnbgw_ranap: Print RANAP Cause in RESET and ERROR INDICATION
-rw-r--r--src/hnbgw_ranap.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/hnbgw_ranap.c b/src/hnbgw_ranap.c
index 1513099..7e3cfaf 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: