Projects
osmocom:master
osmo-hnbgw
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 85
View file
osmo-hnbgw.spec
Changed
@@ -18,13 +18,13 @@ Name: osmo-hnbgw Requires: osmocom-master -Version: 1.5.0.45.a3c0 +Version: 1.5.0.51.0606 Release: 0 Summary: OsmoHNBGW: Osmocom's Base Station Controller for 2G CS mobile networks License: AGPL-3.0-or-later AND GPL-2.0-or-later Group: Hardware/Mobile URL: https://osmocom.org/projects/osmohnbgw -Source: osmo-hnbgw_1.5.0.45.a3c0.tar.xz +Source: osmo-hnbgw_1.5.0.51.0606.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.9 BuildRequires: libtool >= 2
View file
commit_060619b811a5f792bf8827e7311f96c900291050.txt
Added
View file
commit_a3c02651db70521dc70bf9c0f3196bc35139f95b.txt
Deleted
View file
osmo-hnbgw_1.5.0.45.a3c0.dsc -> osmo-hnbgw_1.5.0.51.0606.dsc
Changed
@@ -2,7 +2,7 @@ Source: osmo-hnbgw Binary: osmo-hnbgw, osmo-hnbgw-dbg, osmo-hnbgw-doc Architecture: any all -Version: 1.5.0.45.a3c0 +Version: 1.5.0.51.0606 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/osmo-hnbgw Standards-Version: 3.9.8 @@ -14,8 +14,8 @@ osmo-hnbgw-dbg deb debug extra arch=any osmo-hnbgw-doc deb doc optional arch=all Checksums-Sha1: - 8648a8b184fcc48a92a72f3e8d3a15e290f74e0e 107020 osmo-hnbgw_1.5.0.45.a3c0.tar.xz + 609466fc86cfa429b20d2adcc9357c7a284d008c 107500 osmo-hnbgw_1.5.0.51.0606.tar.xz Checksums-Sha256: - 0e1c0e249520cf4529e775a85b8e036a0b33076c75e399987ccd28c451e06c93 107020 osmo-hnbgw_1.5.0.45.a3c0.tar.xz + f2ff9f11e3d70a0f58d91912c8445ce3747287049cfca5d68c0cd1e045013dac 107500 osmo-hnbgw_1.5.0.51.0606.tar.xz Files: - b05f103d4919925ffceec9ac05e44285 107020 osmo-hnbgw_1.5.0.45.a3c0.tar.xz + eb5327d9f8c3834723e8c4693a51fe31 107500 osmo-hnbgw_1.5.0.51.0606.tar.xz
View file
osmo-hnbgw_1.5.0.45.a3c0.tar.xz/.tarball-version -> osmo-hnbgw_1.5.0.51.0606.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.5.0.45-a3c0 +1.5.0.51-0606
View file
osmo-hnbgw_1.5.0.45.a3c0.tar.xz/debian/changelog -> osmo-hnbgw_1.5.0.51.0606.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -osmo-hnbgw (1.5.0.45.a3c0) unstable; urgency=medium +osmo-hnbgw (1.5.0.51.0606) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Wed, 27 Mar 2024 17:50:52 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Fri, 29 Mar 2024 09:58:34 +0000 osmo-hnbgw (1.5.0) unstable; urgency=medium
View file
osmo-hnbgw_1.5.0.45.a3c0.tar.xz/src/osmo-hnbgw/hnbgw_hnbap.c -> osmo-hnbgw_1.5.0.51.0606.tar.xz/src/osmo-hnbgw/hnbgw_hnbap.c
Changed
@@ -49,16 +49,61 @@ return 0; } -static int hnbgw_tx_hnb_register_rej(struct hnb_context *ctx) +static int hnbgw_tx_error_ind(struct hnb_context *ctx, const HNBAP_Cause_t *cause, + HNBAP_ProcedureCode_t proc_code, HNBAP_Criticality_t criticality, + HNBAP_TriggeringMessage_t trig_msg) +{ + HNBAP_ErrorIndication_t err_ind; + HNBAP_ErrorIndicationIEs_t err_ind_ies; + struct msgb *msg; + int rc; + + LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Tx ErrorIndication cause=%s\n", hnbap_cause_str(cause)); + + err_ind_ies.presenceMask = 0; + err_ind_ies.cause = *cause; + + if (proc_code != -1 || trig_msg != -1 || criticality != -1) { + err_ind_ies.presenceMask |= ERRORINDICATIONIES_HNBAP_CRITICALITYDIAGNOSTICS_PRESENT; + if (proc_code != -1) + err_ind_ies.criticalityDiagnostics.procedureCode = &proc_code; + if (trig_msg != -1) + err_ind_ies.criticalityDiagnostics.triggeringMessage = &trig_msg; + if (criticality != -1) + err_ind_ies.criticalityDiagnostics.procedureCriticality = &criticality; + } + + memset(&err_ind, 0, sizeof(err_ind)); + rc = hnbap_encode_errorindicationies(&err_ind, &err_ind_ies); + if (rc < 0) { + LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Failure to encode ERROR-INDICATION to %s: rc=%d\n", + ctx->identity_info, rc); + return rc; + } + + msg = hnbap_generate_initiating_message(HNBAP_ProcedureCode_id_ErrorIndication, + HNBAP_Criticality_ignore, + &asn_DEF_HNBAP_ErrorIndication, + &err_ind); + + ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_HNBAP_ErrorIndication, &err_ind); + + return hnbgw_hnbap_tx(ctx, msg); +} + +static int hnbgw_tx_hnb_register_rej(struct hnb_context *ctx, const HNBAP_Cause_t *cause) { HNBAP_HNBRegisterReject_t reject_out; HNBAP_HNBRegisterRejectIEs_t reject; struct msgb *msg; int rc; - reject.presenceMask = 0, - reject.cause.present = HNBAP_Cause_PR_radioNetwork; - reject.cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_unspecified; + OSMO_ASSERT(cause); + + LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Rejecting HNB Register Request cause=%s\n", hnbap_cause_str(cause)); + + reject.presenceMask = 0; + reject.cause = *cause; /* encode the Information Elements */ memset(&reject_out, 0, sizeof(reject_out)); @@ -161,13 +206,15 @@ return hnbgw_hnbap_tx(ue->hnb, msg); } -static int hnbgw_tx_ue_register_rej_tmsi(struct hnb_context *hnb, HNBAP_UE_Identity_t *ue_id) +static int hnbgw_tx_ue_register_rej(struct hnb_context *hnb, HNBAP_UE_Identity_t *ue_id, const struct HNBAP_Cause *cause) { HNBAP_UERegisterReject_t reject_out; HNBAP_UERegisterRejectIEs_t reject; struct msgb *msg; int rc; + OSMO_ASSERT(cause); + memset(&reject, 0, sizeof(reject)); reject.uE_Identity.present = ue_id->present; @@ -229,10 +276,9 @@ return -1; } - LOGHNB(hnb, DHNBAP, LOGL_ERROR, "Rejecting UE Register Request: TMSI identity registration is switched off\n"); + LOGHNB(hnb, DHNBAP, LOGL_ERROR, "Rejecting UE Register Request cause=%s\n", hnbap_cause_str(cause)); - reject.cause.present = HNBAP_Cause_PR_radioNetwork; - reject.cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_invalid_UE_identity; + reject.cause = *cause; memset(&reject_out, 0, sizeof(reject_out)); rc = hnbap_encode_ueregisterrejecties(&reject_out, &reject); @@ -388,11 +434,16 @@ static int hnbgw_rx_hnb_deregister(struct hnb_context *ctx, ANY_t *in) { HNBAP_HNBDe_RegisterIEs_t ies; + HNBAP_Cause_t cause; int rc; rc = hnbap_decode_hnbde_registeries(&ies, in); - if (rc < 0) - return rc; + if (rc < 0) { + cause.present = HNBAP_Cause_PR_protocol; + cause.choice.radioNetwork = HNBAP_CauseProtocol_unspecified; + return hnbgw_tx_error_ind(ctx, &cause, HNBAP_ProcedureCode_id_HNBDe_Register, HNBAP_Criticality_ignore, + HNBAP_TriggeringMessage_initiating_message); + } LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "HNB-DE-REGISTER cause=%s\n", hnbap_cause_str(&ies.cause)); @@ -413,11 +464,14 @@ char identity_str256; const char *cell_id_str; struct timespec tp; + HNBAP_Cause_t cause; rc = hnbap_decode_hnbregisterrequesties(&ies, in); if (rc < 0) { LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ: rc=%d\n", rc); - return rc; + cause.present = HNBAP_Cause_PR_protocol; + cause.choice.radioNetwork = HNBAP_CauseProtocol_unspecified; + return hnbgw_tx_hnb_register_rej(ctx, &cause); } asn1_strncpy(identity_str, &ies.hnB_Identity.hNB_Identity_Info, sizeof(identity_str)); @@ -439,7 +493,9 @@ if (!hnbp) { LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "Rejecting unknonwn HNB with identity %s\n", identity_str); hnbap_free_hnbregisterrequesties(&ies); - return hnbgw_tx_hnb_register_rej(ctx); + cause.present = HNBAP_Cause_PR_radioNetwork; + cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_unauthorised_HNB; + return hnbgw_tx_hnb_register_rej(ctx, &cause); } ctx->persistent = hnbp; hnbp->ctx = ctx; @@ -479,7 +535,9 @@ * misconfigurations or someone trying to impersonate an already working HNB: */ LOGHNB(ctx, DHNBAP, LOGL_ERROR, "rejecting HNB-REGISTER-REQ with duplicate cell identity %s\n", cell_id_str); hnbap_free_hnbregisterrequesties(&ies); - return hnbgw_tx_hnb_register_rej(ctx); + cause.present = HNBAP_Cause_PR_radioNetwork; + cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_hNB_parameter_mismatch; + return hnbgw_tx_hnb_register_rej(ctx, &cause); } } @@ -503,14 +561,28 @@ static int hnbgw_rx_ue_register_req(struct hnb_context *ctx, ANY_t *in) { HNBAP_UERegisterRequestIEs_t ies; + HNBAP_Cause_t cause; struct ue_context *ue; struct ue_context *ue_allocated = NULL; char imsi16; int rc; rc = hnbap_decode_ueregisterrequesties(&ies, in); - if (rc < 0) - return rc; + if (rc < 0) { + LOGHNB(ctx, DHNBAP, LOGL_ERROR, "Failure to decode UE-REGISTER-REQ: rc=%d\n", rc); + cause.present = HNBAP_Cause_PR_protocol; + cause.choice.radioNetwork = HNBAP_CauseProtocol_unspecified; + return hnbgw_tx_error_ind(ctx, &cause, HNBAP_ProcedureCode_id_UERegister, HNBAP_Criticality_reject, + HNBAP_TriggeringMessage_initiating_message); + } + + if (!ctx->hnb_registered) { + /* UE registration requires prior HNB registration; reject with proper cause */ + cause.present = HNBAP_Cause_PR_radioNetwork; + cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_hNB_not_registered; + rc = hnbgw_tx_ue_register_rej(ctx, &ies.uE_Identity, &cause); + goto free_and_return_rc; + } switch (ies.uE_Identity.present) { case HNBAP_UE_Identity_PR_iMSI: @@ -527,16 +599,21 @@ break; case HNBAP_UE_Identity_PR_tMSILAI: case HNBAP_UE_Identity_PR_pTMSIRAI: - if (g_hnbgw->config.hnbap_allow_tmsi) + if (g_hnbgw->config.hnbap_allow_tmsi) { rc = hnbgw_tx_ue_register_acc_tmsi(ctx, &ies.uE_Identity); - else - rc = hnbgw_tx_ue_register_rej_tmsi(ctx, &ies.uE_Identity); + } else { + cause.present = HNBAP_Cause_PR_radioNetwork; + cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_invalid_UE_identity; + rc = hnbgw_tx_ue_register_rej(ctx, &ies.uE_Identity, &cause); + } /* all has been handled by TMSI, skip the IMSI code below */ goto free_and_return_rc; default: LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "UE-REGISTER-REQ with unsupported UE Id type %d\n", ies.uE_Identity.present); - rc = -ENOTSUP; + cause.present = HNBAP_Cause_PR_radioNetwork; + cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_invalid_UE_identity; + rc = hnbgw_tx_ue_register_rej(ctx, &ies.uE_Identity, &cause); goto free_and_return_rc; } @@ -563,21 +640,34 @@ static int hnbgw_rx_ue_deregister(struct hnb_context *ctx, ANY_t *in) { HNBAP_UEDe_RegisterIEs_t ies; + HNBAP_Cause_t cause; struct ue_context *ue; int rc; uint32_t ctxid; rc = hnbap_decode_uede_registeries(&ies, in); - if (rc < 0) - return rc; + if (rc < 0) { + cause.present = HNBAP_Cause_PR_protocol; + cause.choice.protocol = HNBAP_CauseProtocol_unspecified; + return hnbgw_tx_error_ind(ctx, &cause, HNBAP_ProcedureCode_id_UEDe_Register, + HNBAP_Criticality_ignore, HNBAP_TriggeringMessage_initiating_message); + } ctxid = asn1bitstr_to_u24(&ies.context_ID); - LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "UE-DE-REGISTER context=%u cause=%s\n", ctxid, hnbap_cause_str(&ies.cause)); - - ue = ue_context_by_id(ctxid); - if (ue) - ue_context_free(ue); + if (!ctx->hnb_registered) { + LOGHNB(ctx, DHNBAP, LOGL_NOTICE, "UE-DE-REGISTER context=%u cause=%s not permitted; HNB not registered\n", + ctxid, hnbap_cause_str(&ies.cause)); + cause.present = HNBAP_Cause_PR_radioNetwork; + cause.choice.radioNetwork = HNBAP_CauseRadioNetwork_hNB_not_registered; + hnbgw_tx_error_ind(ctx, &cause, HNBAP_ProcedureCode_id_UEDe_Register, + HNBAP_Criticality_ignore, HNBAP_TriggeringMessage_initiating_message); + } else { + LOGHNB(ctx, DHNBAP, LOGL_DEBUG, "UE-DE-REGISTER context=%u cause=%s\n", ctxid, hnbap_cause_str(&ies.cause)); + ue = ue_context_by_id(ctxid); + if (ue) + ue_context_free(ue); + } hnbap_free_uede_registeries(&ies); return 0; @@ -600,49 +690,40 @@ static int hnbgw_rx_initiating_msg(struct hnb_context *hnb, HNBAP_InitiatingMessage_t *imsg) { + HNBAP_Cause_t cause = { + .present = HNBAP_Cause_PR_protocol, + .choice.protocol = HNBAP_CauseProtocol_unspecified, + }; int rc = 0; - if (!hnb->hnb_registered) { - switch (imsg->procedureCode) { - case HNBAP_ProcedureCode_id_HNBRegister: /* 8.2 */ - rc = hnbgw_rx_hnb_register_req(hnb, &imsg->value); - break; - case HNBAP_ProcedureCode_id_HNBDe_Register: /* 8.3 */ - rc = hnbgw_rx_hnb_deregister(hnb, &imsg->value); - break; - default: - LOGHNB(hnb, DHNBAP, LOGL_NOTICE, "HNBAP Procedure %ld not permitted for de-registered HNB\n", - imsg->procedureCode); - break; - } - } else { - switch (imsg->procedureCode) { - case HNBAP_ProcedureCode_id_HNBRegister: /* 8.2.4: Abnormal Condition, Accept. */ - rc = hnbgw_rx_hnb_register_req(hnb, &imsg->value); - break; - case HNBAP_ProcedureCode_id_HNBDe_Register: /* 8.3 */ - rc = hnbgw_rx_hnb_deregister(hnb, &imsg->value); - break; - case HNBAP_ProcedureCode_id_UERegister: /* 8.4 */ - rc = hnbgw_rx_ue_register_req(hnb, &imsg->value); - break; - case HNBAP_ProcedureCode_id_UEDe_Register: /* 8.5 */ - rc = hnbgw_rx_ue_deregister(hnb, &imsg->value); - break; - case HNBAP_ProcedureCode_id_ErrorIndication: /* 8.6 */ - rc = hnbgw_rx_err_ind(hnb, &imsg->value); - break; - case HNBAP_ProcedureCode_id_TNLUpdate: /* 8.9 */ - case HNBAP_ProcedureCode_id_HNBConfigTransfer: /* 8.10 */ - case HNBAP_ProcedureCode_id_RelocationComplete: /* 8.11 */ - case HNBAP_ProcedureCode_id_U_RNTIQuery: /* 8.12 */ - case HNBAP_ProcedureCode_id_privateMessage: - LOGHNB(hnb, DHNBAP, LOGL_NOTICE, "Unimplemented HNBAP Procedure %ld\n", imsg->procedureCode); - break; - default: - LOGHNB(hnb, DHNBAP, LOGL_NOTICE, "Unknown HNBAP Procedure %ld\n", imsg->procedureCode); - break; - } + switch (imsg->procedureCode) { + case HNBAP_ProcedureCode_id_HNBRegister: /* 8.2 */ + rc = hnbgw_rx_hnb_register_req(hnb, &imsg->value); + break; + case HNBAP_ProcedureCode_id_HNBDe_Register: /* 8.3 */ + rc = hnbgw_rx_hnb_deregister(hnb, &imsg->value); + break; + case HNBAP_ProcedureCode_id_UERegister: /* 8.4 */ + rc = hnbgw_rx_ue_register_req(hnb, &imsg->value); + break; + case HNBAP_ProcedureCode_id_UEDe_Register: /* 8.5 */ + rc = hnbgw_rx_ue_deregister(hnb, &imsg->value); + break; + case HNBAP_ProcedureCode_id_ErrorIndication: /* 8.6 */ + rc = hnbgw_rx_err_ind(hnb, &imsg->value); + break; + case HNBAP_ProcedureCode_id_TNLUpdate: /* 8.9 */ + case HNBAP_ProcedureCode_id_HNBConfigTransfer: /* 8.10 */ + case HNBAP_ProcedureCode_id_RelocationComplete: /* 8.11 */ + case HNBAP_ProcedureCode_id_U_RNTIQuery: /* 8.12 */ + case HNBAP_ProcedureCode_id_privateMessage: + LOGHNB(hnb, DHNBAP, LOGL_NOTICE, "Unimplemented HNBAP Procedure %ld\n", imsg->procedureCode); + rc = hnbgw_tx_error_ind(hnb, &cause, imsg->procedureCode, -1, HNBAP_TriggeringMessage_initiating_message); + break; + default: + LOGHNB(hnb, DHNBAP, LOGL_NOTICE, "Unknown HNBAP Procedure %ld\n", imsg->procedureCode); + rc = hnbgw_tx_error_ind(hnb, &cause, imsg->procedureCode, -1, HNBAP_TriggeringMessage_initiating_message); + break; } return rc;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.