Commit b911e9db authored by Sakthivel Velumani's avatar Sakthivel Velumani

Bearer context setup c structs

parent d0f4d5f3
...@@ -497,7 +497,7 @@ int e1ap_handle_RELEASE_ACKNOWLEDGE(instance_t instance, ...@@ -497,7 +497,7 @@ int e1ap_handle_RELEASE_ACKNOWLEDGE(instance_t instance,
int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) { int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) {
E1AP_E1AP_PDU_t pdu = {0}; E1AP_E1AP_PDU_t pdu = {0};
e1ap_bearer_setup_req_t bearerCxt = &getCxt(instance)->bearerSetupReq; e1ap_bearer_setup_req_t bearerCxt = &getCxt(CPtype, instance)->bearerSetupReq;
/* Create */ /* Create */
/* 0. pdu Type */ /* 0. pdu Type */
pdu.present = E1AP_E1AP_PDU_PR_initiatingMessage; pdu.present = E1AP_E1AP_PDU_PR_initiatingMessage;
...@@ -505,7 +505,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) { ...@@ -505,7 +505,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) {
msg->procedureCode = E1AP_ProcedureCode_id_bearerContextSetup; msg->procedureCode = E1AP_ProcedureCode_id_bearerContextSetup;
msg->criticality = E1AP_Criticality_reject; msg->criticality = E1AP_Criticality_reject;
msg->value.present = E1AP_InitiatingMessage__value_PR_BearerContextSetupRequest; msg->value.present = E1AP_InitiatingMessage__value_PR_BearerContextSetupRequest;
E1AP_BearerContextSetupRequest_t *out = &pdu.choice.successfulOutcome->value.choice.BearerContextSetupRequest; E1AP_BearerContextSetupRequest_t *out = &pdu.choice.initiatingMessage->value.choice.BearerContextSetupRequest;
/* mandatory */ /* mandatory */
/* c1. gNB-CU-UP UE E1AP ID */ /* c1. gNB-CU-UP UE E1AP ID */
asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC1); asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC1);
...@@ -520,7 +520,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) { ...@@ -520,7 +520,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) {
ieC2->criticality = E1AP_Criticality_reject; ieC2->criticality = E1AP_Criticality_reject;
ieC2->value.present = E1AP_BearerContextSetupRequestIEs__value_PR_SecurityInformation; ieC2->value.present = E1AP_BearerContextSetupRequestIEs__value_PR_SecurityInformation;
ieC2->value.choice.SecurityInformation.securityAlgorithm.cipheringAlgorithm = bearerCxt->cipheringAlgorithm; ieC2->value.choice.SecurityInformation.securityAlgorithm.cipheringAlgorithm = bearerCxt->cipheringAlgorithm;
OCTET_STRING_fromBuf(&ieC2->value.choice.SecurityInformation.uPSecuritykey.encryptionKey, bearerCxt->cipheringAlgorithm, strlen(bearerCxt->cipheringAlgorithm)); OCTET_STRING_fromBuf(&ieC2->value.choice.SecurityInformation.uPSecuritykey.encryptionKey, bearerCxt->encryptionKey, strlen(bearerCxt->encryptionKey));
/* mandatory */ /* mandatory */
/* c3. UE DL Aggregate Maximum Bit Rate */ /* c3. UE DL Aggregate Maximum Bit Rate */
asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC3); asn1cSequenceAdd(out->protocolIEs.list, E1AP_BearerContextSetupRequestIEs_t, ieC3);
...@@ -555,7 +555,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) { ...@@ -555,7 +555,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) {
msgEUTRAN->value.present = E1AP_EUTRAN_BearerContextSetupRequest__value_PR_DRB_To_Setup_List_EUTRAN; msgEUTRAN->value.present = E1AP_EUTRAN_BearerContextSetupRequest__value_PR_DRB_To_Setup_List_EUTRAN;
E1AP_DRB_To_Setup_List_EUTRAN_t *drb2Setup = &msgEUTRAN->value.choice.DRB_To_Setup_List_EUTRAN; E1AP_DRB_To_Setup_List_EUTRAN_t *drb2Setup = &msgEUTRAN->value.choice.DRB_To_Setup_List_EUTRAN;
for (int i=0; i < bearerCxt->maxNumDRBs; i++) { for (int i=0; i < bearerCxt->numDRBs; i++) {
asn1cSequenceAdd(drb2Setup->list, E1AP_DRB_To_Setup_Item_EUTRAN, ieC6_1); asn1cSequenceAdd(drb2Setup->list, E1AP_DRB_To_Setup_Item_EUTRAN, ieC6_1);
ieC6_1->dRB_ID = bearerCxt->DRBList[i].drbId; ieC6_1->dRB_ID = bearerCxt->DRBList[i].drbId;
...@@ -573,7 +573,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) { ...@@ -573,7 +573,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) {
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(bearerCxt->DRBList[i].tlAddress, &gTPTunnel->transportLayerAddress); TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(bearerCxt->DRBList[i].tlAddress, &gTPTunnel->transportLayerAddress);
INT32_TO_OCTET_STRING(bearerCxt->DRBList[i].teId, &gTPTunnel->gTP_TEID); INT32_TO_OCTET_STRING(bearerCxt->DRBList[i].teId, &gTPTunnel->gTP_TEID);
for (int j=0; j < bearerCxt->DRBList[i].maxNumCellGroups; j++) { for (int j=0; j < bearerCxt->DRBList[i].numCellGroups; j++) {
asn1cSequenceAdd(ieC6_1->cell_Group_Information.list, E1AP_Cell_Group_Information_Item, ieC6_1_1); asn1cSequenceAdd(ieC6_1->cell_Group_Information.list, E1AP_Cell_Group_Information_Item, ieC6_1_1);
ieC6_1_1->cell_Group_ID = bearerCxt->DRBList[i].cellGroupList[j].id; ieC6_1_1->cell_Group_ID = bearerCxt->DRBList[i].cellGroupList[j].id;
} }
...@@ -588,7 +588,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) { ...@@ -588,7 +588,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) {
msgNGRAN->value.present = E1AP_NG_RAN_BearerContextSetupRequest__value_PR_PDU_Session_Resource_To_Setup_List; msgNGRAN->value.present = E1AP_NG_RAN_BearerContextSetupRequest__value_PR_PDU_Session_Resource_To_Setup_List;
E1AP_PDU_Session_Resource_To_Setup_List_t *pdu2Setup = &msgNGRAN->value.choice.PDU_Session_Resource_To_Setup_List; E1AP_PDU_Session_Resource_To_Setup_List_t *pdu2Setup = &msgNGRAN->value.choice.PDU_Session_Resource_To_Setup_List;
for(int i=0; i < bearerCxt->maxNumPDUSessions; i++) { for(int i=0; i < bearerCxt->numPDUSessions; i++) {
asn1cSequenceAdd(pdu2Setup->list, E1AP_PDU_Session_Resource_To_Setup_Item, ieC6_1); asn1cSequenceAdd(pdu2Setup->list, E1AP_PDU_Session_Resource_To_Setup_Item, ieC6_1);
ieC6_1->pDU_Session_ID = bearerCxt->pduSession[i].sessionId; ieC6_1->pDU_Session_ID = bearerCxt->pduSession[i].sessionId;
...@@ -612,7 +612,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) { ...@@ -612,7 +612,7 @@ int e1apCUCP_send_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance) {
ieC6_1_1->sDAP_Configuration.sDAP_Header_UL = bearerCxt->pduSession[i].DRBnGRanList[j].sDAP_Header_UL; ieC6_1_1->sDAP_Configuration.sDAP_Header_UL = bearerCxt->pduSession[i].DRBnGRanList[j].sDAP_Header_UL;
ieC6_1_1->sDAP_Configuration.sDAP_Header_DL = bearerCxt->pduSession[i].DRBnGRanList[j].sDAP_Header_DL; ieC6_1_1->sDAP_Configuration.sDAP_Header_DL = bearerCxt->pduSession[i].DRBnGRanList[j].sDAP_Header_DL;
for (int k=0; k < bearerCxt->pduSession[i].DRBnGRanList[j].maxNumCellGroups; k++) { for (int k=0; k < bearerCxt->pduSession[i].DRBnGRanList[j].numCellGroups; k++) {
asn1cSequenceAdd(ieC6_1_1->cell_Group_Information.list, E1AP_Cell_Group_Information_Item, ieC6_1_1_1); asn1cSequenceAdd(ieC6_1_1->cell_Group_Information.list, E1AP_Cell_Group_Information_Item, ieC6_1_1_1);
ieC6_1_1_1->cell_Group_ID = bearerCxt->pduSession[i].DRBnGRanList[j].cellGroupList[k].id; ieC6_1_1_1->cell_Group_ID = bearerCxt->pduSession[i].DRBnGRanList[j].cellGroupList[k].id;
} }
...@@ -658,7 +658,76 @@ int e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -658,7 +658,76 @@ int e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
uint32_t stream, uint32_t stream,
E1AP_E1AP_PDU_t *pdu) { E1AP_E1AP_PDU_t *pdu) {
AssertFatal(false,"Not implemented yet\n"); DevAssert(pdu != NULL);
AssertFatal(pdu->present == E1AP_E1AP_PDU_PR_initiatingMessage,
"pdu->present != E1AP_E1AP_PDU_PR_initiatingMessage\n");
AssertFatal(pdu->choice.initiatingMessage->procedureCode == E1AP_ProcedureCode_id_bearerContextSetup,
"procedureCode != E1AP_ProcedureCode_id_bearerContextSetup\n");
AssertFatal(pdu->choice.initiatingMessage->criticality == E1AP_Criticality_reject,
"criticality != E1AP_Criticality_reject\n");
AssertFatal(pdu->choice.initiatingMessage->value.present == E1AP_InitiatingMessage__value_PR_BearerContextSetupRequest,
"initiatingMessage->value.present != E1AP_InitiatingMessage__value_PR_BearerContextSetupRequest\n");
E1AP_GNB_CU_CP_E1SetupRequest_t *in = pdu->choice.initiatingMessage->value.choice.BearerContextSetupRequest;
E1AP_GNB_CU_CP_E1SetupRequestIEs_t *ie;
e1ap_bearer_setup_req_t bearerCxt = &getCxt(CPtype, instance)->bearerSetupReq;
MessageDef *msg = itti_alloc_new_message(TASK_CUUP_E1, 0, E1AP_BEARER_CONTEXT_SETUP_REQ);
LOG_I(E1AP, "Bearer context setup number of IEs %d\n", in.protocolIEs.list.count);
for (int i=0; i < in.protocolIEs.list.count; i++) {
ie = in.protocolIEs.list.array[i];
switch(ie->id) {
case E1AP_ProtocolIE_ID_id_gNB_CU_CP_UE_E1AP_ID:
AssertFatal(ie->criticality == E1AP_Criticality_reject,
"ie->criticality != E1AP_Criticality_reject\n");
AssertFatal(ie->value.present == E1AP_BearerContextSetupRequestIEs__value_PR_GNB_CU_CP_UE_E1AP_ID,
"ie->value.present != E1AP_BearerContextSetupRequestIEs__value_PR_GNB_CU_CP_UE_E1AP_ID\n");
bearerCxt.gNB_cu_cp_ue_id = ie->value.choice.GNB_CU_CP_UE_E1AP_ID;
break;
case E1AP_ProtocolIE_ID_id_SecurityInformation:
AssertFatal(ie->criticality == E1AP_Criticality_reject,
"ie->criticality != E1AP_Criticality_reject\n");
AssertFatal(ie->value.present == E1AP_BearerContextSetupRequestIEs__value_PR_SecurityInformation,
"ie->value.present != E1AP_BearerContextSetupRequestIEs__value_PR_SecurityInformation\n");
bearerCxt->cipheringAlgorithm = ie->value.choice.SecurityInformation.securityAlgorithm.cipheringAlgorithm;
OCTET_STRING_TO_INT32(&ie->value.choice.SecurityInformation.uPSecuritykey.encryptionKey, bearerCxt->encryptionKey);
break;
case E1AP_ProtocolIE_ID_id_UEDLAggregateMaximumBitRate:
AssertFatal(ie->criticality == E1AP_Criticality_reject,
"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);
break;
case E1AP_ProtocolIE_ID_id_Serving_PLMN:
AssertFatal(ie->criticality == E1AP_Criticality_ignore,
"ie->criticality != E1AP_Criticality_ignore\n");
AssertFatal(ie->value.present == E1AP_BearerContextSetupRequestIEs__value_PR_PLMN_Identity,
"ie->value.present != E1AP_BearerContextSetupRequestIEs__value_PR_PLMN_Identity\n");
//TODO
break;
case E1AP_ProtocolIE_ID_id_ActivityNotificationLevel:
AssertFatal(ie->criticality == E1AP_Criticality_reject,
"ie->criticality != E1AP_Criticality_reject\n");
AssertFatal(ie->value.present == E1AP_BearerContextSetupRequestIEs__value_PR_ActivityNotificationLevel,
"ie->value.present != E1AP_BearerContextSetupRequestIEs__value_PR_ActivityNotificationLevel\n");
bearerCxt->activityNotificationLevel = ie->value.choice.ActivityNotificationLevel;
break;
// TODO: remaining IE handlers
}
}
init_send_msg_to_task(TASK_RRC_GNB, instance, msg);
} }
int e1apCUCP_handle_BEARER_CONTEXT_SETUP_RESPONSE(instance_t instance, int e1apCUCP_handle_BEARER_CONTEXT_SETUP_RESPONSE(instance_t instance,
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <common/utils/LOG/log.h> #include <common/utils/LOG/log.h>
#include "openairinterface5g_limits.h" #include "openairinterface5g_limits.h"
#include <openair2/RRC/NR/MESSAGES/asn1_msg.h> #include <openair2/RRC/NR/MESSAGES/asn1_msg.h>
#include "e1ap_common.h"
#include <E1AP_Cause.h> #include <E1AP_Cause.h>
#include <E1AP_InitiatingMessage.h> #include <E1AP_InitiatingMessage.h>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
#include "E1AP_TransactionID.h" #include "E1AP_TransactionID.h"
#include "E1AP_PriorityLevel.h"
#define MAX_NUM_TRANSAC_IDS 8 #define MAX_NUM_TRANSAC_IDS 8
#define E1AP_MAX_NUM_PLMNS #define E1AP_MAX_NUM_PLMNS
...@@ -29,6 +30,8 @@ ...@@ -29,6 +30,8 @@
#define E1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_req #define E1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_req
#define E1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_resp #define E1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_resp
typedef f1ap_net_ip_address_t e1ap_net_ip_address_t;
typedef int (*e1ap_message_processing_t)( typedef int (*e1ap_message_processing_t)(
instance_t instance, instance_t instance,
uint32_t assoc_id, uint32_t assoc_id,
...@@ -54,12 +57,70 @@ typedef struct e1ap_setup_req_s { ...@@ -54,12 +57,70 @@ typedef struct e1ap_setup_req_s {
f1ap_net_ip_address_t CUCP_e1_ip_address; f1ap_net_ip_address_t CUCP_e1_ip_address;
} e1ap_setup_req_t; } e1ap_setup_req_t;
typedef struct cell_group_s {
long id;
} cell_group_t;
typedef struct drb_to_setup_s {
long drbId;
long pDCP_SN_Size_UL;
long pDCP_SN_Size_DL;
long rLC_Mode;
long qci;
E1AP_PriorityLevel_t qosPriorityLevel;
E1AP_Pre_emptionCapability_t pre_emptionCapability;
E1AP_Pre_emptionVulnerability_t pre_emptionVulnerability;
in_addr_t tlAddress;
long teId;
int numCellGroups;
cell_group_t cellGroupList[MAX_NUM_CELL_GROUPS];
} drb_to_setup_t;
typedef struct qos_flow_to_setup_s {
long id;
long fiveQI;
long qoSPriorityLevel;
long packetDelayBudget;
long packetError_scalar;
long packetError_exponent;
} qos_flow_to_setup_t;
typedef struct DRB_nGRAN_to_setup_s {
long id;
E1AP_DefaultDRB_t defaultDRB;
E1AP_SDAP_Header_UL_t sDAP_Header_UL;
E1AP_SDAP_Header_DL_t sDAP_Header_DL;
int numCellGroups;
cell_group_t cellGroupList[MAX_NUM_CELL_GROUPS];
int numQosFlowSetup;
qos_flow_to_setup_t qosFlows[MAX_NUM_QOS_FLOWS];
E1AP_PriorityLevel_t priorityLevel;
E1AP_Pre_emptionCapability_t pre_emptionCapability;
E1AP_Pre_emptionVulnerability_t pre_emptionVulnerability;
} DRB_nGRAN_to_setup_t;
typedef struct pdu_session_to_setup_s {
long sessionId;
E1AP_PDU_Session_Type_t sessionType;
int32_t sst;
E1AP_IntegrityProtectionIndication_t integrityProtectionIndication;
E1AP_ConfidentialityProtectionIndication_t confidentialityProtectionIndication;
in_addr_t tlAddress;
long teId;
long numDRB2Setup;
DRB_nGRAN_to_setup_t DRBnGRanList[MAX_NUM_NGRAN_DRB];
} pdu_session_to_setup_t;
typedef struct e1ap_bearer_setup_req_s { typedef struct e1ap_bearer_setup_req_s {
uint64_t gNB_cu_cp_ue_id; uint64_t gNB_cu_cp_ue_id;
uint64_t cipheringAlgorithm; uint64_t cipheringAlgorithm;
char encryptionKey[128]; char encryptionKey[128];
uint64_t bitRate; uint64_t bitRate;
E1AP_ActivityNotificationLevel_t activityNotificationLevel; E1AP_ActivityNotificationLevel_t activityNotificationLevel;
int numDRBs;
drb_to_setup_t DRBList[MAX_NUM_DRBS];
int numPDUSessions;
pdu_session_to_setup_t pduSession[MAX_NUM_PDU_SESSIONS];
} e1ap_bearer_setup_req_t; } e1ap_bearer_setup_req_t;
typedef struct e1ap_upcp_inst_s { typedef struct e1ap_upcp_inst_s {
......
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