diff options
author | Daniel Willmann <dwillmann@sysmocom.de> | 2015-12-15 20:30:12 +0100 |
---|---|---|
committer | Daniel Willmann <dwillmann@sysmocom.de> | 2015-12-17 13:09:18 +0100 |
commit | efceb187aa141b5e0c5894eab12f2fdd1017fbcb (patch) | |
tree | 1faca1d675110ef8cad6cac14c83600db6377f62 /src | |
parent | 4267a29ee0d301a653aa04c5b94488a5282a80c4 (diff) |
hnbgw_hnbap: Process UEDeRegister and try to free correct UE
Diffstat (limited to 'src')
-rw-r--r-- | src/hnbgw_hnbap.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index b74cdad..d08cadb 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -170,6 +170,29 @@ static int hnbgw_rx_ue_register_req(struct hnb_context *ctx, ANY_t *in) return hnbgw_tx_ue_register_acc(ue); } +static int hnbgw_rx_ue_deregister(struct hnb_context *ctx, ANY_t *in) +{ + UEDe_RegisterIEs_t ies; + struct ue_context *ue; + int rc; + uint32_t ctxid; + + rc = hnbap_decode_uede_registeries(&ies, in); + if (rc < 0) + return rc; + + ctxid = asn1bitstr_to_u24(&ies.context_ID); + + DEBUGP(DMAIN, "UE-DE-REGSITER context=%ld cause=%ld\n", + ctxid, ies.cause); + + ue = ue_context_by_id(ctxid); + if (ue) + ue_context_free(ue); + + return 0; +} + static int hnbgw_rx_err_ind(struct hnb_context *hnb, ANY_t *in) { ErrorIndicationIEs_t ies; @@ -199,6 +222,7 @@ static int hnbgw_rx_initiating_msg(struct hnb_context *hnb, InitiatingMessage_t rc = hnbgw_rx_ue_register_req(hnb, &imsg->value); break; case ProcedureCode_id_UEDe_Register: /* 8.5 */ + rc = hnbgw_rx_ue_deregister(hnb, &imsg->value); break; case ProcedureCode_id_ErrorIndication: /* 8.6 */ rc = hnbgw_rx_err_ind(hnb, &imsg->value); |