Commit f721b139 authored by Robert Schmidt's avatar Robert Schmidt

Fix: E1 PDU Session has NSSAI, not only SST

parent c3927fa6
......@@ -55,6 +55,11 @@ typedef struct PLMN_ID_s {
int mnc_digit_length;
} PLMN_ID_t;
typedef struct e1ap_nssai_t {
uint8_t sst;
uint32_t sd; // optional: "No SD" is 0xffffff, see 23.003 Sec 28.4.2
} e1ap_nssai_t;
typedef struct e1ap_net_config_t {
net_ip_address_t CUUP_e1_ip_address;
net_ip_address_t CUCP_e1_ip_address;
......@@ -144,7 +149,7 @@ typedef struct DRB_nGRAN_to_setup_s {
typedef struct pdu_session_to_setup_s {
long sessionId;
long sessionType;
int8_t sst;
e1ap_nssai_t nssai;
long integrityProtectionIndication;
long confidentialityProtectionIndication;
in_addr_t tlAddress;
......
......@@ -562,7 +562,12 @@ static int fill_BEARER_CONTEXT_SETUP_REQUEST(e1ap_bearer_setup_req_t *const bear
ieC6_1->pDU_Session_ID = i->sessionId;
ieC6_1->pDU_Session_Type = i->sessionType;
INT8_TO_OCTET_STRING(i->sst, &ieC6_1->sNSSAI.sST);
INT8_TO_OCTET_STRING(i->nssai.sst, &ieC6_1->sNSSAI.sST);
if (i->nssai.sd != 0xffffff) {
ieC6_1->sNSSAI.sD = malloc(sizeof(*ieC6_1->sNSSAI.sD));
AssertFatal(ieC6_1->sNSSAI.sD != NULL, "out of memory\n");
INT24_TO_OCTET_STRING(i->nssai.sd, ieC6_1->sNSSAI.sD);
}
ieC6_1->securityIndication.integrityProtectionIndication = i->integrityProtectionIndication;
ieC6_1->securityIndication.confidentialityProtectionIndication = i->confidentialityProtectionIndication;
......@@ -841,7 +846,10 @@ void extract_BEARER_CONTEXT_SETUP_REQUEST(const E1AP_E1AP_PDU_t *pdu,
pdu_session->sessionId = pdu2Setup->pDU_Session_ID;
pdu_session->sessionType = pdu2Setup->pDU_Session_Type;
OCTET_STRING_TO_INT8(&pdu2Setup->sNSSAI.sST, pdu_session->sst);
OCTET_STRING_TO_INT8(&pdu2Setup->sNSSAI.sST, pdu_session->nssai.sst);
pdu_session->nssai.sd = 0xffffff;
if (pdu2Setup->sNSSAI.sD != NULL)
OCTET_STRING_TO_INT24(pdu2Setup->sNSSAI.sD, pdu_session->nssai.sd);
pdu_session->integrityProtectionIndication = pdu2Setup->securityIndication.integrityProtectionIndication;
pdu_session->confidentialityProtectionIndication = pdu2Setup->securityIndication.confidentialityProtectionIndication;
......
......@@ -775,7 +775,11 @@ void rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(MessageDef *msg_p, instance_t ins
pdu_session_to_setup_t *pdu = bearer_req.pduSession + bearer_req.numPDUSessions;
bearer_req.numPDUSessions++;
pdu->sessionId = session->pdusession_id;
pdu->sst = msg->allowed_nssai[i].sST;
ngap_allowed_NSSAI_t *nssai = &msg->allowed_nssai[i];
pdu->nssai.sst = nssai->sST;
pdu->nssai.sd = 0xffffff;
if (nssai->sD_flag)
pdu->nssai.sd = nssai->sD[0] << 16 | nssai->sD[1] << 8 | nssai->sD[0];
pdu->integrityProtectionIndication = rrc->security.do_drb_integrity ? E1AP_IntegrityProtectionIndication_required : E1AP_IntegrityProtectionIndication_not_needed;
pdu->confidentialityProtectionIndication = rrc->security.do_drb_ciphering ? E1AP_ConfidentialityProtectionIndication_required : E1AP_ConfidentialityProtectionIndication_not_needed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment