Refactor E1AP Bearer Context Setup Request struct members
* cleanup struct members not compliant to specs 3GPP TS 38.463 * add defines whenever necessary
This commit is contained in:
@@ -35,10 +35,11 @@
|
||||
#define E1AP_MAX_NUM_PLMNS 4
|
||||
#define E1AP_MAX_NUM_SLICES 1024
|
||||
#define E1AP_MAX_NUM_CELL_GROUPS 4
|
||||
#define E1AP_MAX_NUM_QOS_FLOWS 4
|
||||
#define E1AP_MAX_NUM_QOS_FLOWS 64
|
||||
#define E1AP_MAX_NUM_PDU_SESSIONS 4
|
||||
#define E1AP_MAX_NUM_DRBS 32
|
||||
#define E1AP_MAX_NUM_UP_PARAM 4
|
||||
#define E1AP_SECURITY_KEY_SIZE 16 // keys have 128 bits length
|
||||
|
||||
#define E1AP_REGISTER_REQ(mSGpTR) (mSGpTR)->ittiMsg.e1ap_register_req
|
||||
#define E1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_req
|
||||
@@ -60,6 +61,17 @@ typedef enum BEARER_CONTEXT_STATUS_e {
|
||||
BEARER_RESUME,
|
||||
} BEARER_CONTEXT_STATUS_t;
|
||||
|
||||
typedef enum activity_notification_level_e {
|
||||
ANL_DRB = 0,
|
||||
ANL_PDU_SESSION,
|
||||
ANL_UE,
|
||||
} activity_notification_level_t;
|
||||
|
||||
typedef enum cell_group_id_e {
|
||||
MCG = 0,
|
||||
SCG,
|
||||
} cell_group_id_t;
|
||||
|
||||
typedef struct PLMN_ID_s {
|
||||
int mcc;
|
||||
int mnc;
|
||||
@@ -107,7 +119,7 @@ typedef struct e1ap_setup_fail_s {
|
||||
} e1ap_setup_fail_t;
|
||||
|
||||
typedef struct cell_group_s {
|
||||
long id;
|
||||
cell_group_id_t id;
|
||||
} cell_group_t;
|
||||
|
||||
typedef struct up_params_s {
|
||||
@@ -149,16 +161,21 @@ typedef struct drb_to_setup_s {
|
||||
typedef struct qos_characteristics_s {
|
||||
union {
|
||||
struct {
|
||||
long fiveqi;
|
||||
long qos_priority_level;
|
||||
uint16_t fiveqi;
|
||||
uint8_t qos_priority_level;
|
||||
} non_dynamic;
|
||||
struct {
|
||||
long fiveqi; // -1 -> optional
|
||||
long qos_priority_level;
|
||||
long packet_delay_budget;
|
||||
// Range 5QI [0 - 255]
|
||||
uint16_t fiveqi;
|
||||
/* Range [0 - 15]
|
||||
15 = "no priority," 1-14 = decreasing priority (1 highest), 0 = logical error if received */
|
||||
uint8_t qos_priority_level;
|
||||
// Range [0, 1023]: Upper bound for packet delay in 0.5ms units
|
||||
uint16_t packet_delay_budget;
|
||||
struct {
|
||||
long per_scalar;
|
||||
long per_exponent;
|
||||
// PER = Scalar x 10^-k (k: 0-9)
|
||||
uint8_t per_scalar;
|
||||
uint8_t per_exponent;
|
||||
} packet_error_rate;
|
||||
} dynamic;
|
||||
};
|
||||
@@ -167,8 +184,10 @@ typedef struct qos_characteristics_s {
|
||||
|
||||
typedef struct ngran_allocation_retention_priority_s {
|
||||
uint16_t priority_level;
|
||||
long preemption_capability;
|
||||
long preemption_vulnerability;
|
||||
// Pre-emption capability on other QoS flows
|
||||
uint8_t preemption_capability;
|
||||
// Vulnerability of the QoS flow to pre-emption of other QoS flows
|
||||
uint8_t preemption_vulnerability;
|
||||
} ngran_allocation_retention_priority_t;
|
||||
|
||||
typedef struct qos_flow_level_qos_parameters_s {
|
||||
@@ -209,6 +228,24 @@ typedef struct DRB_nGRAN_to_setup_s {
|
||||
qos_flow_to_setup_t qosFlows[E1AP_MAX_NUM_QOS_FLOWS];
|
||||
} DRB_nGRAN_to_setup_t, DRB_nGRAN_to_mod_t;
|
||||
|
||||
typedef enum e1ap_indication_e {
|
||||
SECURITY_REQUIRED = 0,
|
||||
SECURITY_PREFERRED,
|
||||
SECURITY_NOT_NEEDED
|
||||
} e1ap_indication_t;
|
||||
|
||||
typedef struct security_indication_s {
|
||||
e1ap_indication_t integrityProtectionIndication;
|
||||
e1ap_indication_t confidentialityProtectionIndication;
|
||||
// Maximum Integrity Protected Data Rate
|
||||
long maxIPrate;
|
||||
} security_indication_t;
|
||||
|
||||
typedef struct UP_TL_information_s {
|
||||
in_addr_t tlAddress;
|
||||
int32_t teId;
|
||||
} UP_TL_information_t;
|
||||
|
||||
/**
|
||||
* PDU Session Resource To Setup List (clause 9.3.3.10)
|
||||
* PDU Session Resource To Modify List (clause 9.3.3.11)
|
||||
@@ -217,14 +254,8 @@ typedef struct pdu_session_to_setup_s {
|
||||
long sessionId;
|
||||
long sessionType;
|
||||
e1ap_nssai_t nssai;
|
||||
long integrityProtectionIndication;
|
||||
long confidentialityProtectionIndication;
|
||||
in_addr_t tlAddress;
|
||||
in_addr_t tlAddress_dl;
|
||||
int32_t teId;
|
||||
int32_t teId_dl;
|
||||
int tl_port;
|
||||
int tl_port_dl;
|
||||
security_indication_t securityIndication;
|
||||
UP_TL_information_t UP_TL_information;
|
||||
long numDRB2Setup;
|
||||
DRB_nGRAN_to_setup_t DRBnGRanList[E1AP_MAX_NUM_DRBS];
|
||||
long numDRB2Modify;
|
||||
@@ -238,15 +269,15 @@ typedef struct pdu_session_to_setup_s {
|
||||
*/
|
||||
typedef struct e1ap_bearer_setup_req_s {
|
||||
uint32_t gNB_cu_cp_ue_id;
|
||||
uint32_t gNB_cu_up_ue_id;
|
||||
uint32_t gNB_cu_up_ue_id; // Bearer Context Modification Request only
|
||||
uint64_t cipheringAlgorithm;
|
||||
uint64_t integrityProtectionAlgorithm;
|
||||
char encryptionKey[128];
|
||||
char integrityProtectionKey[128];
|
||||
char encryptionKey[E1AP_SECURITY_KEY_SIZE];
|
||||
char integrityProtectionKey[E1AP_SECURITY_KEY_SIZE];
|
||||
long ueDlAggMaxBitRate;
|
||||
PLMN_ID_t servingPLMNid;
|
||||
BEARER_CONTEXT_STATUS_t bearerContextStatus;
|
||||
long activityNotificationLevel;
|
||||
activity_notification_level_t activityNotificationLevel;
|
||||
int numPDUSessions;
|
||||
pdu_session_to_setup_t pduSession[E1AP_MAX_NUM_PDU_SESSIONS];
|
||||
int numPDUSessionsMod;
|
||||
|
||||
+11
-8
@@ -652,13 +652,13 @@ static int fill_BEARER_CONTEXT_SETUP_REQUEST(e1ap_bearer_setup_req_t *const bear
|
||||
INT24_TO_OCTET_STRING(i->nssai.sd, ieC6_1->sNSSAI.sD);
|
||||
}
|
||||
|
||||
ieC6_1->securityIndication.integrityProtectionIndication = i->integrityProtectionIndication;
|
||||
ieC6_1->securityIndication.confidentialityProtectionIndication = i->confidentialityProtectionIndication;
|
||||
ieC6_1->securityIndication.integrityProtectionIndication = i->securityIndication.integrityProtectionIndication;
|
||||
ieC6_1->securityIndication.confidentialityProtectionIndication = i->securityIndication.confidentialityProtectionIndication;
|
||||
|
||||
ieC6_1->nG_UL_UP_TNL_Information.present = E1AP_UP_TNL_Information_PR_gTPTunnel;
|
||||
asn1cCalloc(ieC6_1->nG_UL_UP_TNL_Information.choice.gTPTunnel, gTPTunnel);
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(i->tlAddress, &gTPTunnel->transportLayerAddress);
|
||||
INT32_TO_OCTET_STRING(i->teId, &gTPTunnel->gTP_TEID);
|
||||
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(i->UP_TL_information.tlAddress, &gTPTunnel->transportLayerAddress);
|
||||
INT32_TO_OCTET_STRING(i->UP_TL_information.teId, &gTPTunnel->gTP_TEID);
|
||||
|
||||
for (DRB_nGRAN_to_setup_t *j = i->DRBnGRanList; j < i->DRBnGRanList + i->numDRB2Setup; j++) {
|
||||
asn1cSequenceAdd(ieC6_1->dRB_To_Setup_List_NG_RAN.list, E1AP_DRB_To_Setup_Item_NG_RAN_t, ieC6_1_1);
|
||||
@@ -951,15 +951,18 @@ static void extract_BEARER_CONTEXT_SETUP_REQUEST(const E1AP_E1AP_PDU_t *pdu, e1a
|
||||
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;
|
||||
pdu_session->securityIndication.integrityProtectionIndication =
|
||||
pdu2Setup->securityIndication.integrityProtectionIndication;
|
||||
pdu_session->securityIndication.confidentialityProtectionIndication =
|
||||
pdu2Setup->securityIndication.confidentialityProtectionIndication;
|
||||
|
||||
if (pdu2Setup->nG_UL_UP_TNL_Information.choice.gTPTunnel) { // Optional IE
|
||||
DevAssert(pdu2Setup->nG_UL_UP_TNL_Information.present ==
|
||||
E1AP_UP_TNL_Information_PR_gTPTunnel);
|
||||
BIT_STRING_TO_TRANSPORT_LAYER_ADDRESS_IPv4(&pdu2Setup->nG_UL_UP_TNL_Information.choice.gTPTunnel->transportLayerAddress,
|
||||
pdu_session->tlAddress);
|
||||
OCTET_STRING_TO_INT32(&pdu2Setup->nG_UL_UP_TNL_Information.choice.gTPTunnel->gTP_TEID, pdu_session->teId);
|
||||
pdu_session->UP_TL_information.tlAddress);
|
||||
OCTET_STRING_TO_INT32(&pdu2Setup->nG_UL_UP_TNL_Information.choice.gTPTunnel->gTP_TEID,
|
||||
pdu_session->UP_TL_information.teId);
|
||||
}
|
||||
|
||||
E1AP_DRB_To_Setup_List_NG_RAN_t *drb2SetupList = &pdu2Setup->dRB_To_Setup_List_NG_RAN;
|
||||
|
||||
@@ -88,11 +88,12 @@ static void fill_DRB_configList_e1(NR_DRB_ToAddModList_t *DRB_configList, const
|
||||
pdcp_config->t_Reordering = calloc(1, sizeof(*pdcp_config->t_Reordering));
|
||||
*pdcp_config->t_Reordering = drb->pdcp_config.reorderingTimer;
|
||||
pdcp_config->ext1 = NULL;
|
||||
if (pdu->integrityProtectionIndication == 0 || // Required
|
||||
pdu->integrityProtectionIndication == 1) { // Preferred
|
||||
asn1cCallocOne(drbCfg->integrityProtection, NR_PDCP_Config__drb__integrityProtection_enabled);
|
||||
const security_indication_t *sec = &pdu->securityIndication;
|
||||
if (sec->integrityProtectionIndication == SECURITY_REQUIRED ||
|
||||
sec->integrityProtectionIndication == SECURITY_PREFERRED) {
|
||||
asn1cCallocOne(drbCfg->integrityProtection, NR_PDCP_Config__drb__integrityProtection_enabled);
|
||||
}
|
||||
if (pdu->confidentialityProtectionIndication == 2) { // Not Needed
|
||||
if (sec->confidentialityProtectionIndication == SECURITY_NOT_NEEDED) {
|
||||
asn1cCalloc(pdcp_config->ext1, ext1);
|
||||
asn1cCallocOne(ext1->cipheringDisabled, NR_PDCP_Config__ext1__cipheringDisabled_true);
|
||||
}
|
||||
@@ -188,8 +189,8 @@ void e1_bearer_context_setup(const e1ap_bearer_setup_req_t *req)
|
||||
req_drb->id,
|
||||
req_pdu->sessionId,
|
||||
qfi,
|
||||
req_pdu->tlAddress,
|
||||
req_pdu->teId,
|
||||
req_pdu->UP_TL_information.tlAddress,
|
||||
req_pdu->UP_TL_information.teId,
|
||||
nr_pdcp_data_req_drb,
|
||||
sdap_data_req,
|
||||
&resp_n3);
|
||||
|
||||
@@ -349,11 +349,13 @@ void trigger_bearer_setup(gNB_RRC_INST *rrc, gNB_RRC_UE_t *UE, int n, pdusession
|
||||
if (cuup_nssai.sst == 0)
|
||||
cuup_nssai = pdu->nssai; /* for CU-UP selection below */
|
||||
|
||||
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;
|
||||
pdu->teId = session->gtp_teid;
|
||||
memcpy(&pdu->tlAddress, session->upf_addr.buffer, 4); // Fixme: dirty IPv4 target
|
||||
security_indication_t *sec = &pdu->securityIndication;
|
||||
sec->integrityProtectionIndication = rrc->security.do_drb_integrity ? SECURITY_REQUIRED
|
||||
: SECURITY_NOT_NEEDED;
|
||||
sec->confidentialityProtectionIndication = rrc->security.do_drb_ciphering ? SECURITY_REQUIRED
|
||||
: SECURITY_NOT_NEEDED;
|
||||
pdu->UP_TL_information.teId = session->gtp_teid;
|
||||
memcpy(&pdu->UP_TL_information.tlAddress, session->upf_addr.buffer, 4); // Fixme: dirty IPv4 target
|
||||
|
||||
/* we assume for the moment one DRB per PDU session. Activate the bearer,
|
||||
* and configure in RRC. */
|
||||
|
||||
Reference in New Issue
Block a user