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
This commit is contained in:
Neels Hofmeyr 2023-05-11 21:59:38 +02:00
parent d90552df8a
commit 520c406b85
2 changed files with 19 additions and 0 deletions

View File

@ -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,

View File

@ -42,6 +42,14 @@ static long *new_long(long in)
/*! \brief generate RANAP RESET message */
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;
@ -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) {