neels has uploaded this change for review.
add ranap_new_msg_reset2() with GlobalRNC-ID
So far we are omitting the GlobalRNC-ID from all of our RANAP RESET
messages, because clearly, in 3GPP TS 25.413 9.1.39, the Global RNC-ID
is listed as optional.
OTOH, section 8.26.2.1 says
"The RNC shall include the Global RNC-ID IE in the RESET message."
Apparently an RNC must include this ID, while a CN omits it.
Related: SYS#6441
Change-Id: Iec70c3054333f01bc27ca0e69bfa325bbe36edd0
---
M include/osmocom/ranap/ranap_msg_factory.h
M src/ranap_msg_factory.c
2 files changed, 37 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/92/32692/1
diff --git a/include/osmocom/ranap/ranap_msg_factory.h b/include/osmocom/ranap/ranap_msg_factory.h
index d89a1ae..4b42d05 100644
--- a/include/osmocom/ranap/ranap_msg_factory.h
+++ b/include/osmocom/ranap/ranap_msg_factory.h
@@ -47,6 +47,9 @@
/*! \brief generate RANAP RESET message */
struct msgb *ranap_new_msg_reset(RANAP_CN_DomainIndicator_t domain,
const RANAP_Cause_t *cause);
+struct msgb *ranap_new_msg_reset2(RANAP_CN_DomainIndicator_t domain,
+ const RANAP_Cause_t *cause,
+ RANAP_GlobalRNC_ID_t *rnc_id);
/*! \brief generate RANAP RESET ACK message */
struct msgb *ranap_new_msg_reset_ack(RANAP_CN_DomainIndicator_t domain,
diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c
index b871343..44b879f 100644
--- a/src/ranap_msg_factory.c
+++ b/src/ranap_msg_factory.c
@@ -43,6 +43,14 @@
struct msgb *ranap_new_msg_reset(RANAP_CN_DomainIndicator_t domain,
const RANAP_Cause_t *cause)
{
+ return ranap_new_msg_reset2(domain, cause, NULL);
+}
+
+/*! generate RANAP RESET message. Like ranap_new_msg_reset(), but allows passing a Global-RNC-ID. */
+struct msgb *ranap_new_msg_reset2(RANAP_CN_DomainIndicator_t domain,
+ const RANAP_Cause_t *cause,
+ RANAP_GlobalRNC_ID_t *rnc_id)
+{
RANAP_ResetIEs_t ies;
RANAP_Reset_t out;
struct msgb *msg;
@@ -53,6 +61,14 @@
if (cause)
memcpy(&ies.cause, cause, sizeof(ies.cause));
+ if (rnc_id) {
+ ies.presenceMask = RESETIES_RANAP_GLOBALRNC_ID_PRESENT;
+ OCTET_STRING_noalloc(&ies.globalRNC_ID.pLMNidentity,
+ rnc_id->pLMNidentity.buf,
+ rnc_id->pLMNidentity.size);
+ ies.globalRNC_ID.rNC_ID = rnc_id->rNC_ID;
+ }
+
memset(&out, 0, sizeof(out));
rc = ranap_encode_reseties(&out, &ies);
if (rc < 0) {
To view, visit change 32692. To unsubscribe, or for help writing mail filters, visit settings.