aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-05-11 21:59:38 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-05-11 22:26:07 +0200
commit520c406b850a9d2ef306e870cf4357726fcd9116 (patch)
treed7aed9efc456c4cc6e7bf84102cb7a9babddecac
parentd90552df8a537b411643130907ce495dc280c579 (diff)
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
-rw-r--r--include/osmocom/ranap/ranap_msg_factory.h3
-rw-r--r--src/ranap_msg_factory.c16
2 files changed, 19 insertions, 0 deletions
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 @@ struct msgb *ranap_new_msg_rab_assign_data(uint8_t rab_id, uint32_t gtp_ip,
/*! \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 @@ static long *new_long(long in)
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 @@ struct msgb *ranap_new_msg_reset(RANAP_CN_DomainIndicator_t domain,
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) {