Commit 7c067095 authored by Sakthivel Velumani's avatar Sakthivel Velumani

Populate PDU and DRB paramenters from NGAP

parent c4ada56a
......@@ -27,6 +27,7 @@
#include "E1AP_E1AP-PDU.h"
#include "E1AP_TransactionID.h"
#include "E1AP_PriorityLevel.h"
#include "ngap_messages_types.h"
#define E1AP_MAX_NUM_TRANSAC_IDS 4
#define E1AP_MAX_NUM_PLMNS 4
......@@ -44,7 +45,7 @@
#define E1AP_BEARER_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.e1ap_bearer_setup_resp
#define E1AP_PORT_NUMBER 25
#define E1AP_SCTP_PPID 63
#define E1AP_SCTP_PPID 64
typedef f1ap_net_ip_address_t e1ap_net_ip_address_t;
......@@ -101,6 +102,7 @@ typedef struct drb_to_setup_s {
typedef struct qos_flow_to_setup_s {
long id;
fiveQI_type_t fiveQI_type;
long fiveQI;
long qoSPriorityLevel;
long packetDelayBudget;
......@@ -116,6 +118,9 @@ typedef struct DRB_nGRAN_to_setup_s {
long defaultDRB;
long sDAP_Header_UL;
long sDAP_Header_DL;
long pDCP_SN_Size_UL;
long pDCP_SN_Size_DL;
long rLC_Mode;
int numCellGroups;
cell_group_t cellGroupList[E1AP_MAX_NUM_CELL_GROUPS];
int numQosFlow2Setup;
......@@ -138,7 +143,7 @@ typedef struct e1ap_bearer_setup_req_s {
uint64_t gNB_cu_cp_ue_id;
uint64_t cipheringAlgorithm;
char encryptionKey[128];
long bitRate;
long ueDlAggMaxBitRate;
PLMN_ID_t servingPLMNid;
long activityNotificationLevel;
int numDRBs;
......
......@@ -262,9 +262,15 @@ typedef struct ngap_transport_layer_addr_s {
dEST.length = sOURCE.length; \
} while (0)
typedef enum {
non_dynamic,
dynamic
} fiveQI_type_t;
typedef struct pdusession_level_qos_parameter_s {
uint8_t qfi;
uint64_t fiveQI;
fiveQI_type_t fiveQI_type;
ngap_allocation_retention_priority_t allocation_retention_priority;
} pdusession_level_qos_parameter_t;
......@@ -692,12 +698,21 @@ typedef struct ngap_pdusession_setup_req_s {
/* gNB ue ngap id as initialized by NGAP layer */
uint32_t gNB_ue_ngap_id;
/* S-NSSAI */
ngap_allowed_NSSAI_t allowed_nssai[8];
/* Number of pdusession to be setup in the list */
uint8_t nb_pdusessions_tosetup;
/* E RAB setup request */
pdusession_t pdusession_setup_params[NGAP_MAX_PDUSESSION];
/* UE Uplink Aggregated Max Bitrates */
uint64_t ueAggMaxBitRateUplink;
/* UE Downlink Aggregated Max Bitrates */
uint64_t ueAggMaxBitRateDownlink;
} ngap_pdusession_setup_req_t;
typedef struct ngap_pdusession_setup_resp_s {
......
......@@ -175,6 +175,7 @@ int e1apCUUP_send_SETUP_REQUEST(instance_t instance) {
ieC1->value.present = E1AP_GNB_CU_UP_E1SetupRequestIEs__value_PR_TransactionID;
setup->transac_id = E1AP_get_next_transaction_identifier();
ieC1->value.choice.TransactionID = setup->transac_id;
LOG_I(E1AP, "Transaction ID of setup request %ld\n", setup->transac_id);
/* mandatory */
/* c2. GNB_CU_ID (integer value) */
asn1cSequenceAdd(e1SetupUP->protocolIEs.list, E1AP_GNB_CU_UP_E1SetupRequestIEs_t, ieC2);
......@@ -341,11 +342,17 @@ int e1apCUUP_handle_SETUP_RESPONSE(instance_t instance,
E1AP_GNB_CU_UP_E1SetupResponseIEs_t *ie;
/* transac_id */
int transaction_id;
long transaction_id;
long old_transaction_id = getCxtE1(UPtype, instance)->setupReq.transac_id;
F1AP_FIND_PROTOCOLIE_BY_ID(E1AP_GNB_CU_UP_E1SetupResponseIEs_t, ie, in,
E1AP_ProtocolIE_ID_id_TransactionID, true);
transaction_id = ie->value.choice.TransactionID;
LOG_D(E1AP, "gNB CU UP E1 setup response transaction ID: %d\n", transaction_id);
LOG_D(E1AP, "gNB CU UP E1 setup response transaction ID: %ld\n", transaction_id);
if (old_transaction_id != transaction_id)
LOG_E(E1AP, "Transaction IDs do not match %ld != %ld\n", old_transaction_id, transaction_id);
E1AP_free_transaction_identifier(transaction_id);
/* do the required processing */
......@@ -527,21 +534,23 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance,
ieC3->id = E1AP_ProtocolIE_ID_id_UEDLAggregateMaximumBitRate;
ieC3->criticality = E1AP_Criticality_reject;
ieC3->value.present = E1AP_BearerContextSetupRequestIEs__value_PR_BitRate;
asn_long2INTEGER(&ieC3->value.choice.BitRate, bearerCxt->bitRate);
asn_long2INTEGER(&ieC3->value.choice.BitRate, bearerCxt->ueDlAggMaxBitRate);
/* mandatory */
/* c4. Serving PLMN */
asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC4);
ieC4->id = E1AP_ProtocolIE_ID_id_Serving_PLMN;
ieC4->criticality = E1AP_Criticality_ignore;
ieC4->value.present = E1AP_BearerContextSetupRequestIEs__value_PR_PLMN_Identity;
MCC_MNC_TO_PLMNID(bearerCxt->servingPLMNid.mcc, bearerCxt->servingPLMNid.mnc, bearerCxt->servingPLMNid.mnc_digit_length, &ieC4->value.choice.PLMN_Identity);
e1ap_setup_req_t *setup = &getCxtE1(CPtype, instance)->setupReq;
PLMN_ID_t *servingPLMN = setup->plmns; // First PLMN is serving PLMN. TODO: Remove hard coding here
MCC_MNC_TO_PLMNID(servingPLMN->mcc, servingPLMN->mnc, servingPLMN->mnc_digit_length, &ieC4->value.choice.PLMN_Identity);
/* mandatory */
/* Activity Notification Level */
asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC5);
ieC5->id = E1AP_ProtocolIE_ID_id_ActivityNotificationLevel;
ieC5->criticality = E1AP_Criticality_reject;
ieC5->value.present = E1AP_BearerContextSetupRequestIEs__value_PR_ActivityNotificationLevel;
ieC5->value.choice.ActivityNotificationLevel = bearerCxt->activityNotificationLevel;
ieC5->value.choice.ActivityNotificationLevel = 2;// TODO: Remove hard coding
/* mandatory */
/* */
asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC6);
......@@ -612,6 +621,10 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance,
ieC6_1_1->sDAP_Configuration.sDAP_Header_UL = j->sDAP_Header_UL;
ieC6_1_1->sDAP_Configuration.sDAP_Header_DL = j->sDAP_Header_DL;
ieC6_1_1->pDCP_Configuration.pDCP_SN_Size_UL = j->pDCP_SN_Size_UL;
ieC6_1_1->pDCP_Configuration.pDCP_SN_Size_DL = j->pDCP_SN_Size_DL;
ieC6_1_1->pDCP_Configuration.rLC_Mode = j->rLC_Mode;
for (cell_group_t *k=j->cellGroupList; k < j->cellGroupList+j->numCellGroups; k++) {
asn1cSequenceAdd(ieC6_1_1->cell_Group_Information.list, E1AP_Cell_Group_Information_Item_t, ieC6_1_1_1);
ieC6_1_1_1->cell_Group_ID = k->id;
......@@ -621,7 +634,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance,
asn1cSequenceAdd(ieC6_1_1->qos_flow_Information_To_Be_Setup, E1AP_QoS_Flow_QoS_Parameter_Item_t, ieC6_1_1_1);
ieC6_1_1_1->qoS_Flow_Identifier = k->id;
if (0) { // non Dynamic 5QI
if (k->fiveQI_type == non_dynamic) { // non Dynamic 5QI
ieC6_1_1_1->qoSFlowLevelQoSParameters.qoS_Characteristics.present = E1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
asn1cCalloc(ieC6_1_1_1->qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI, non_Dynamic_5QI);
non_Dynamic_5QI->fiveQI = k->fiveQI;
......@@ -825,7 +838,7 @@ int e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance,
"ie->criticality != E1AP_Criticality_reject\n");
AssertFatal(ie->value.present == E1AP_BearerContextSetupRequestIEs__value_PR_BitRate,
"ie->value.present != E1AP_BearerContextSetupRequestIEs__value_PR_BitRate\n");
asn_INTEGER2long(&ie->value.choice.BitRate, &bearerCxt->bitRate);
asn_INTEGER2long(&ie->value.choice.BitRate, &bearerCxt->ueDlAggMaxBitRate);
break;
case E1AP_ProtocolIE_ID_id_Serving_PLMN:
......
......@@ -96,6 +96,17 @@ E1AP_TransactionID_t E1AP_get_next_transaction_identifier() {
return genTransacId;
}
void E1AP_free_transaction_identifier(E1AP_TransactionID_t id) {
for (int i=0; i < E1AP_MAX_NUM_TRANSAC_IDS; i++) {
if (id == transacID[i]) {
transacID[i] = 0;
return;
}
}
LOG_E(E1AP, "Couldn't find transaction ID %ld in list\n", id);
}
int e1ap_decode_initiating_message(E1AP_E1AP_PDU_t *pdu) {
DevAssert(pdu != NULL);
......
......@@ -41,4 +41,6 @@ int e1ap_assoc_id(E1_t type, instance_t instance);
int e1ap_encode_send(E1_t type, instance_t instance, E1AP_E1AP_PDU_t *pdu, uint16_t stream, const char *func);
void e1ap_common_init();
void E1AP_free_transaction_identifier(E1AP_TransactionID_t id);
#endif /* E1AP_COMMON_H_ */
......@@ -3876,7 +3876,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
}
}
void rrc_gNB_process_e1_setup_req(e1ap_setup_req_t *req, instance_t instance) {
int rrc_gNB_process_e1_setup_req(e1ap_setup_req_t *req, instance_t instance) {
AssertFatal(req->supported_plmns <= PLMN_LIST_MAX_SIZE, "Supported PLMNs is more than PLMN_LIST_MAX_SIZE\n");
gNB_RRC_INST *rrc = RC.nrrrc[0]; //TODO: remove hardcoding of RC index here
......@@ -3890,10 +3890,13 @@ void rrc_gNB_process_e1_setup_req(e1ap_setup_req_t *req, instance_t instance) {
rrc->configuration.mnc[i] == req->plmns[i].mnc) {
LOG_E(NR_RRC, "PLMNs received from CUUP (mcc:%d, mnc:%d) did not match with PLMNs in RRC (mcc:%d, mnc:%d)\n",
req->plmns[i].mcc, req->plmns[i].mnc, rrc->configuration.mcc[i], rrc->configuration.mnc[i]);
return -1;
}
}
itti_send_msg_to_task(TASK_CUCP_E1, instance, msg_p);
return 0;
}
///---------------------------------------------------------------------------------------------------------------///
......
This diff is collapsed.
......@@ -1321,6 +1321,14 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
NGAP_PDUSESSION_SETUP_REQ(message_p).gNB_ue_ngap_id = ue_desc_p->gNB_ue_ngap_id;
NGAP_PDUSESSION_SETUP_REQ(message_p).amf_ue_ngap_id = ue_desc_p->amf_ue_ngap_id;
/* UE Aggregated Maximum Bitrate */
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUSessionResourceSetupRequestIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_UEAggregateMaximumBitRate, true);
asn_INTEGER2ulong(&(ie->value.choice.UEAggregateMaximumBitRate.uEAggregateMaximumBitRateUL),
&NGAP_PDUSESSION_SETUP_REQ(message_p).ueAggMaxBitRateUplink);
asn_INTEGER2ulong(&(ie->value.choice.UEAggregateMaximumBitRate.uEAggregateMaximumBitRateDL),
&NGAP_PDUSESSION_SETUP_REQ(message_p).ueAggMaxBitRateDownlink);
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_PDUSessionResourceSetupRequestIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListSUReq, true);
......@@ -1334,9 +1342,13 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
NGAP_PDUSessionResourceSetupRequestTransfer_t *pdusessionTransfer_p = NULL;
NGAP_PDUSessionResourceSetupRequestTransferIEs_t *pdusessionTransfer_ies = NULL;
// PDU session ID
item_p = (NGAP_PDUSessionResourceSetupItemSUReq_t *)ie->value.choice.PDUSessionResourceSetupListSUReq.list.array[i];
NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].pdusession_id = item_p->pDUSessionID;
// S-NSSAI
OCTET_STRING_TO_INT32(&item_p->s_NSSAI.sST, NGAP_PDUSESSION_SETUP_REQ(message_p).allowed_nssai[i].sST);
OCTET_STRING_TO_INT32(item_p->s_NSSAI.sD, *NGAP_PDUSESSION_SETUP_REQ(message_p).allowed_nssai[i].sD);
// check for the NAS PDU
if (item_p->pDUSessionNAS_PDU->size > 0 ) {
......@@ -1422,10 +1434,14 @@ int ngap_gNB_handle_pdusession_setup_request(uint32_t assoc_id,
/* Set the QOS informations */
NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].qfi = (uint8_t)qosFlowItem_p->qosFlowIdentifier;
if(qosFlowItem_p->qosFlowLevelQosParameters.qosCharacteristics.present == NGAP_QosCharacteristics_PR_nonDynamic5QI){
NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].fiveQI_type = non_dynamic;
if(qosFlowItem_p->qosFlowLevelQosParameters.qosCharacteristics.choice.nonDynamic5QI != NULL){
NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].fiveQI =
(uint64_t)qosFlowItem_p->qosFlowLevelQosParameters.qosCharacteristics.choice.nonDynamic5QI->fiveQI;
}
} else if (qosFlowItem_p->qosFlowLevelQosParameters.qosCharacteristics.present == NGAP_QosCharacteristics_PR_dynamic5QI)
{
NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].fiveQI_type = dynamic;
}
NGAP_PDUSESSION_SETUP_REQ(message_p).pdusession_setup_params[i].qos[qosIdx].allocation_retention_priority.priority_level =
qosFlowItem_p->qosFlowLevelQosParameters.allocationAndRetentionPriority.priorityLevelARP;
......
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