Commit 6106207b authored by Sakthivel Velumani's avatar Sakthivel Velumani

Fixing build issues

parent 67235fac
......@@ -1325,6 +1325,8 @@ add_library(NFAPI_COMMON_LIB ${NFAPI_COMMON_SRC})
include_directories(${NFAPI_DIR}/common/public_inc)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/openair2/E1AP/MESSAGES/)
set(NFAPI_SRC
${NFAPI_DIR}/nfapi/src/nfapi.c
${NFAPI_DIR}/nfapi/src/nfapi_p4.c
......
......@@ -79,6 +79,7 @@ typedef struct IttiMsgText_s {
#include <openair2/COMMON/as_message.h>
#include <openair2/RRC/LTE/rrc_types.h>
#include <openair2/COMMON/rrc_messages_types.h>
#include <openair2/COMMON/e1ap_messages_types.h>
#include <openair3/NAS/COMMON/UTIL/OctetString.h>
#include <openair3/NAS/COMMON/IES/AccessPointName.h>
......
......@@ -19,13 +19,13 @@
* contact@openairinterface.org
*/
#ifndef E1AP_MESSAGES_DEF_H_
#define E1AP_MESSAGES_DEF_H_
/* gNB_CUUP application layer -> E1AP messages */
MESSAGE_DEF(E1AP_SETUP_REQ , MESSAGE_PRIORITY_MED , e1ap_setup_req_t , e1ap_setup_req)
/* E1AP -> eNB_DU or eNB_CU_RRC -> E1AP application layer messages */
MESSAGE_DEF(E1AP_SETUP_RESP , MESSAGE_PRIORITY_MED, e1ap_setup_resp_t , e1ap_setup_resp)
#endif /* E1AP_MESSAGES_DEF_H_ */
MESSAGE_DEF(E1AP_BEARER_CONTEXT_SETUP_REQ , MESSAGE_PRIORITY_MED , e1ap_bearer_setup_req_t , e1ap_bearer_setup_req)
MESSAGE_DEF(E1AP_BEARER_CONTEXT_SETUP_RESP , MESSAGE_PRIORITY_MED , e1ap_bearer_setup_resp_t , e1ap_bearer_setup_resp)
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Author and copyright: Laurent Thomas, open-cells.com
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef E1AP_MESSAGES_TYPES_H
#define E1AP_MESSAGES_TYPES_H
#include "E1AP_E1AP-PDU.h"
#include "E1AP_TransactionID.h"
#include "E1AP_PriorityLevel.h"
#define E1AP_MAX_NUM_TRANSAC_IDS 4
#define E1AP_MAX_NUM_PLMNS 4
#define E1AP_MAX_NUM_CELL_GROUPS 4
#define E1AP_MAX_NUM_QOS_FLOWS 4
#define E1AP_MAX_NUM_NGRAN_DRB 4
#define E1AP_MAX_NUM_PDU_SESSIONS 4
#define E1AP_MAX_NUM_DRBS 4
#define E1AP_MAX_NUM_DRBS 4
#define E1AP_MAX_NUM_UP_PARAM 4
#define E1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_req
#define E1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_resp
#define E1AP_BEARER_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.e1ap_bearer_setup_req
#define E1AP_BEARER_CONTEXT_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.e1ap_bearer_setup_resp
#define E1AP_PORT_NUMBER 25
#define E1AP_SCTP_PPID 63
typedef f1ap_net_ip_address_t e1ap_net_ip_address_t;
typedef int (*e1ap_message_processing_t)(
instance_t instance,
E1AP_E1AP_PDU_t *message_p
);
typedef struct PLMN_ID_s {
int mcc;
int mnc;
int mnc_digit_length;
} PLMN_ID_t;
typedef struct e1ap_setup_req_s {
uint64_t gNB_cu_up_id;
char * gNB_cu_up_name;
int assoc_id;
uint64_t transac_id;
int supported_plmns;
PLMN_ID_t plmns[E1AP_MAX_NUM_PLMNS];
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
uint16_t default_sctp_stream_id;
e1ap_net_ip_address_t CUUP_e1_ip_address;
e1ap_net_ip_address_t CUCP_e1_ip_address;
long cn_support;
int port_cuup;
int port_cucp;
} e1ap_setup_req_t;
typedef struct e1ap_setup_resp_s {
long transac_id;
} e1ap_setup_resp_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;
long qosPriorityLevel;
long pre_emptionCapability;
long pre_emptionVulnerability;
in_addr_t tlAddress;
long teId;
int numCellGroups;
cell_group_t cellGroupList[E1AP_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;
long priorityLevel;
long pre_emptionCapability;
long pre_emptionVulnerability;
} qos_flow_to_setup_t;
typedef struct DRB_nGRAN_to_setup_s {
long id;
long defaultDRB;
long sDAP_Header_UL;
long sDAP_Header_DL;
int numCellGroups;
cell_group_t cellGroupList[E1AP_MAX_NUM_CELL_GROUPS];
int numQosFlow2Setup;
qos_flow_to_setup_t qosFlows[E1AP_MAX_NUM_QOS_FLOWS];
} DRB_nGRAN_to_setup_t;
typedef struct pdu_session_to_setup_s {
long sessionId;
long sessionType;
int32_t sst;
long integrityProtectionIndication;
long confidentialityProtectionIndication;
in_addr_t tlAddress;
int32_t teId;
long numDRB2Setup;
DRB_nGRAN_to_setup_t DRBnGRanList[E1AP_MAX_NUM_NGRAN_DRB];
} pdu_session_to_setup_t;
typedef struct e1ap_bearer_setup_req_s {
uint64_t gNB_cu_cp_ue_id;
uint64_t cipheringAlgorithm;
char encryptionKey[128];
long bitRate;
PLMN_ID_t servingPLMNid;
long activityNotificationLevel;
int numDRBs;
drb_to_setup_t DRBList[E1AP_MAX_NUM_DRBS];
int numPDUSessions;
pdu_session_to_setup_t pduSession[E1AP_MAX_NUM_PDU_SESSIONS];
} e1ap_bearer_setup_req_t;
typedef struct up_params_s {
in_addr_t tlAddress;
long teId;
} up_params_t;
typedef struct drb_setup_s {
int drbId;
in_addr_t tlAddress;
int teId;
int numUpParam;
up_params_t UpParamList[E1AP_MAX_NUM_UP_PARAM];
} drb_setup_t;
typedef struct qos_flow_setup_s {
long id;
} qos_flow_setup_t;
typedef struct DRB_nGRAN_setup_s {
long id;
int numUpParam;
up_params_t UpParamList[E1AP_MAX_NUM_UP_PARAM];
int numQosFlowSetup;
qos_flow_setup_t qosFlows[E1AP_MAX_NUM_QOS_FLOWS];
} DRB_nGRAN_setup_t;
typedef struct DRB_nGRAN_failed_s {
long id;
long cause_type;
long cause;
} DRB_nGRAN_failed_t;
typedef struct pdu_session_setup_s {
long id;
in_addr_t tlAddress;
long teId;
int numDRBSetup;
DRB_nGRAN_setup_t DRBnGRanList[E1AP_MAX_NUM_NGRAN_DRB];
int numDRBFailed;
DRB_nGRAN_failed_t DRBnGRanFailedList[E1AP_MAX_NUM_NGRAN_DRB];
} pdu_session_setup_t;
typedef struct e1ap_bearer_setup_resp_s {
uint64_t gNB_cu_cp_ue_id;
uint64_t gNB_cu_up_ue_id;
int numDRBs;
drb_setup_t DRBList[E1AP_MAX_NUM_DRBS];
int numPDUSessions;
pdu_session_setup_t pduSession[E1AP_MAX_NUM_PDU_SESSIONS];
} e1ap_bearer_setup_resp_t;
typedef struct e1ap_upcp_inst_s {
uint32_t assoc_id;
e1ap_setup_req_t setupReq;
e1ap_bearer_setup_req_t bearerSetupReq;
e1ap_bearer_setup_resp_t bearerSetupResp;
} e1ap_upcp_inst_t;
typedef enum {
CPtype = 0,
UPtype
} E1_t;
#endif /* E1AP_MESSAGES_TYPES_H */
......@@ -42,4 +42,4 @@
#include "udp_messages_def.h"
#include "gtpv1_u_messages_def.h"
#include "flexran_messages_def.h"
#include "e1ap_message_types.h"
#include "e1ap_messages_def.h"
add_subdirectory(MESSAGES)
add_library(E1AP e1ap.c)
add_library(E1AP e1ap.c e1ap_common.c)
target_link_libraries(E1AP
PUBLIC ASN1_E1AP_LIB
PRIVATE UTIL)
......
This diff is collapsed.
......@@ -27,9 +27,61 @@
#include <common/utils/LOG/log.h>
#include "openairinterface5g_limits.h"
#include <openair2/RRC/NR/MESSAGES/asn1_msg.h>
#include "e1ap_common.h"
#include "openair2/COMMON/e1ap_messages_types.h"
#include "openair3/UTILS/conversions.h"
#include "openair2/F1AP/f1ap_common.h"
#include <E1AP_Cause.h>
#include <E1AP_InitiatingMessage.h>
#include <E1AP_E1AP-PDU.h>
#include <E1AP_ProtocolIE-Field.h>
#include <E1AP_SupportedPLMNs-Item.h>
#include <E1AP_SuccessfulOutcome.h>
#include <E1AP_ProtocolIE-Field.h>
#include <E1AP_UnsuccessfulOutcome.h>
#include <E1AP_GNB-CU-UP-E1SetupFailure.h>
#include <E1AP_GNB-CU-UP-ConfigurationUpdate.h>
#include <E1AP_GNB-CU-UP-TNLA-To-Remove-Item.h>
#include <E1AP_CP-TNL-Information.h>
#include <E1AP_UP-Parameters-Item.h>
#include <E1AP_UP-TNL-Information.h>
#include <E1AP_PDU-Session-Resource-Setup-Item.h>
#include <E1AP_DRB-Setup-Item-EUTRAN.h>
#include <E1AP_DRB-Setup-Item-NG-RAN.h>
#include <E1AP_QoS-Flow-QoS-Parameter-Item.h>
#include <E1AP_QoS-Flow-Item.h>
#include <E1AP_DRB-Failed-List-NG-RAN.h>
#include <E1AP_DRB-Failed-Item-NG-RAN.h>
#include <E1AP_BearerContextSetupResponse.h>
#include <E1AP_BearerContextSetupRequest.h>
#include <E1AP_DRB-To-Setup-Item-EUTRAN.h>
#include <E1AP_DRB-To-Setup-Item-NG-RAN.h>
#include <E1AP_Cell-Group-Information-Item.h>
#include <E1AP_PDU-Session-Resource-To-Setup-Item.h>
#include <E1AP_GTPTunnel.h>
#include <E1AP_Non-Dynamic5QIDescriptor.h>
#include <E1AP_Dynamic5QIDescriptor.h>
#endif
int e1apCUCP_handle_SETUP_REQUEST(instance_t instance,
E1AP_E1AP_PDU_t *pdu);
int e1apCUUP_handle_SETUP_RESPONSE(instance_t instance,
E1AP_E1AP_PDU_t *pdu);
int e1apCUUP_handle_SETUP_FAILURE(instance_t instance,
E1AP_E1AP_PDU_t *pdu);
int e1apCUUP_handle_BEARER_CONTEXT_SETUP_REQUEST(instance_t instance,
E1AP_E1AP_PDU_t *pdu);
int e1apCUCP_handle_BEARER_CONTEXT_SETUP_RESPONSE(instance_t instance,
E1AP_E1AP_PDU_t *pdu);
int e1apCUCP_handle_BEARER_CONTEXT_SETUP_FAILURE(instance_t instance,
E1AP_E1AP_PDU_t *pdu);
void *E1AP_CUUP_task(void *arg);
void *E1AP_CUCP_task(void *arg);
......@@ -23,34 +23,42 @@
#include <time.h>
#include <stdlib.h>
#include "e1ap.h"
#include "e1ap_common.h"
static e1ap_upcp_inst_t *e1_cp_inst[NUMBER_OF_gNB_MAX] = {0};
static e1ap_upcp_inst_t *e1_up_inst[NUMBER_OF_gNB_MAX] = {0};
static e1ap_upcp_inst_t *e1ap_cp_inst[NUMBER_OF_gNB_MAX] = {0};
static e1ap_upcp_inst_t *e1ap_up_inst[NUMBER_OF_gNB_MAX] = {0};
e1ap_upcp_inst_t *getCxt(E1_t type, instance_t instance) {
AssertFatal( instance < sizeofArray(e1_cp_inst), "instance exceeds limit\n");
return type ? e1_up_inst[instance] : e1_cp_inst[instance];
e1ap_upcp_inst_t *getCxtE1(E1_t type, instance_t instance) {
AssertFatal( instance < sizeofArray(e1ap_cp_inst), "instance exceeds limit\n");
return type ? e1ap_up_inst[instance] : e1ap_cp_inst[instance];
}
int e1ap_assoc_id(bool isCu, instance_t instance) {
return 0;
}
void createE1inst(E1_t type, instance_t instance, e1ap_setup_req_t *req) {
if (type == CPtype) {
AssertFatal(e1_cp_inst[instance] == NULL, "Double call to E1 CP instance %d\n", instance);
e1_cp_inst[instance] = (e1_upcp_inst_t *) calloc(1, sizeof(e1_upcp_inst_t));
AssertFatal(e1ap_cp_inst[instance] == NULL, "Double call to E1 CP instance %d\n", (int)instance);
e1ap_cp_inst[instance] = (e1ap_upcp_inst_t *) calloc(1, sizeof(e1ap_upcp_inst_t));
} else {
AssertFatal(e1_up_inst[instance] == NULL, "Double call to E1 UP instance %d\n", instance);
e1_up_inst[instance] = (e1_upcp_inst_t *) calloc(1, sizeof(e1_upcp_inst_t));
memcpy(&e1_up_inst[instance]->setupReq, req, sizeof(e1ap_setup_req_t));
AssertFatal(e1ap_up_inst[instance] == NULL, "Double call to E1 UP instance %d\n", (int)instance);
e1ap_up_inst[instance] = (e1ap_upcp_inst_t *) calloc(1, sizeof(e1ap_upcp_inst_t));
memcpy(&e1ap_up_inst[instance]->setupReq, req, sizeof(e1ap_setup_req_t));
}
}
E1AP_TransactionID_t transacID[MAX_NUM_TRANSAC_IDS] = {0};
srand(time(NULL));
E1AP_TransactionID_t transacID[E1AP_MAX_NUM_TRANSAC_IDS] = {0};
void e1ap_common_init() {
srand(time(NULL));
}
bool check_transac_id(E1AP_TransactionID_t id, int *freeIdx) {
bool isFreeIdxSet = false;
for (int i=0; i < MAX_NUM_TRANSAC_IDS; i++) {
for (int i=0; i < E1AP_MAX_NUM_TRANSAC_IDS; i++) {
if (id == transacID[i])
return false;
else if (!isFreeIdxSet && (transacID[i] == 0)) {
......@@ -69,14 +77,68 @@ E1AP_TransactionID_t E1AP_get_next_transaction_identifier() {
while (!isTransacIdValid) {
genTransacId = rand();
isTransacIdValid = check_transac_Id(genTransacId, &freeIdx);
isTransacIdValid = check_transac_id(genTransacId, &freeIdx);
}
AssertFatal(freeIdx < MAX_NUM_TRANSAC_IDS, "Free Index exceeds array length\n");
AssertFatal(freeIdx < E1AP_MAX_NUM_TRANSAC_IDS, "Free Index exceeds array length\n");
transacID[freeIdx] = genTransacId;
return genTransacId;
}
int e1ap_decode_initiating_message(E1AP_E1AP_PDU_t *pdu) {
DevAssert(pdu != NULL);
switch(pdu->choice.initiatingMessage->procedureCode) {
case E1AP_ProcedureCode_id_gNB_CU_UP_E1Setup:
break;
case E1AP_ProcedureCode_id_gNB_CU_UP_ConfigurationUpdate:
break;
case E1AP_ProcedureCode_id_bearerContextSetup:
break;
default:
LOG_E(E1AP, "Unsupported procedure code (%d) for initiating message\n",
(int)pdu->choice.initiatingMessage->procedureCode);
return -1;
}
return 0;
}
int e1ap_decode_successful_outcome(E1AP_E1AP_PDU_t *pdu) {
DevAssert(pdu != NULL);
switch(pdu->choice.successfulOutcome->procedureCode) {
case E1AP_ProcedureCode_id_gNB_CU_UP_E1Setup:
break;
case E1AP_ProcedureCode_id_bearerContextSetup:
break;
default:
LOG_E(E1AP, "Unsupported procedure code (%d) for successful message\n",
(int)pdu->choice.successfulOutcome->procedureCode);
return -1;
}
return 0;
}
int e1ap_decode_unsuccessful_outcome(E1AP_E1AP_PDU_t *pdu) {
DevAssert(pdu != NULL);
switch(pdu->choice.unsuccessfulOutcome->procedureCode) {
case E1AP_ProcedureCode_id_gNB_CU_UP_E1Setup:
break;
default:
LOG_E(E1AP, "Unsupported procedure code (%d) for unsuccessful message\n",
(int)pdu->choice.unsuccessfulOutcome->procedureCode);
return -1;
}
return 0;
}
int asn1_xer_print_e1ap = 1;
int e1ap_decode_pdu(E1AP_E1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length) {
asn_dec_rval_t dec_ret;
DevAssert(buffer != NULL);
......@@ -88,7 +150,7 @@ int e1ap_decode_pdu(E1AP_E1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
0,
0);
if (asn1_decoder_xer_print) {
if (asn1_xer_print_e1ap) {
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT START----------------- \n");
xer_fprint(stdout, &asn_DEF_E1AP_E1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
......@@ -116,3 +178,41 @@ int e1ap_decode_pdu(E1AP_E1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
return -1;
}
int e1ap_encode_send(bool isCu, instance_t instance, E1AP_E1AP_PDU_t *pdu, uint16_t stream, const char *func) {
DevAssert(pdu != NULL);
if (asn1_xer_print_e1ap) {
LOG_E(E1AP, "----------------- ASN1 ENCODER PRINT START ----------------- \n");
xer_fprint(stdout, &asn_DEF_E1AP_E1AP_PDU, pdu);
LOG_E(E1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
}
char errbuf[2048]; /* Buffer for error message */
size_t errlen = sizeof(errbuf); /* Size of the buffer */
int ret = asn_check_constraints(&asn_DEF_E1AP_E1AP_PDU, pdu, errbuf, &errlen);
if(ret) {
LOG_E(E1AP, "%s: Constraint validation failed: %s\n", func, errbuf);
}
void *buffer = NULL;
ssize_t encoded = aper_encode_to_new_buffer(&asn_DEF_E1AP_E1AP_PDU, 0, pdu, buffer);
if (encoded < 0) {
LOG_E(E1AP, "%s: Failed to encode E1AP message\n", func);
return -1;
} else {
MessageDef *message = itti_alloc_new_message(isCu?TASK_CUCP_E1:TASK_CUUP_E1, 0, SCTP_DATA_REQ);
sctp_data_req_t *s = &message->ittiMsg.sctp_data_req;
s->assoc_id = e1ap_assoc_id(isCu,instance);
s->buffer = buffer;
s->buffer_length = encoded;
s->stream = stream;
LOG_I(E1AP, "%s: Sending ITTI message to SCTP Task\n", func);
itti_send_msg_to_task(TASK_SCTP, instance, message);
}
return encoded;
}
......@@ -24,153 +24,21 @@
#ifndef E1AP_COMMON_H_
#define E1AP_COMMON_H_
#include "E1AP_E1AP-PDU.h"
#include "E1AP_TransactionID.h"
#include "E1AP_PriorityLevel.h"
#include "openair2/COMMON/e1ap_messages_types.h"
#define MAX_NUM_TRANSAC_IDS 8
int e1ap_decode_pdu(E1AP_E1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t length);
#define E1AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_req
#define E1AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.e1ap_setup_resp
e1ap_upcp_inst_t *getCxtE1(E1_t type, instance_t instance);
#define E1AP_PORT_NUMBER 25
#define E1AP_SCTP_PPID 63
E1AP_TransactionID_t E1AP_get_next_transaction_identifier();
typedef f1ap_net_ip_address_t e1ap_net_ip_address_t;
void createE1inst(E1_t type, instance_t instance, e1ap_setup_req_t *req);
typedef int (*e1ap_message_processing_t)(
instance_t instance;
uint32_t assoc_id;
uint32_t stream;
E1AP_E1AP_PDU_t *message_p;
};
bool check_transac_id(E1AP_TransactionID_t id, int *freeIdx);
typedef struct cell_group_s {
long id;
} cell_group_t;
int e1ap_assoc_id(bool isCu, instance_t instance);
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;
E1AP_PriorityLevel_t priorityLevel;
E1AP_Pre_emptionCapability_t pre_emptionCapability;
E1AP_Pre_emptionVulnerability_t pre_emptionVulnerability;
} 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];
} 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 {
uint64_t gNB_cu_cp_ue_id;
uint64_t cipheringAlgorithm;
char encryptionKey[128];
uint64_t bitRate;
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;
typedef struct up_params_s {
in_addr_t tlAddress;
long teId;
} up_params_t;
typedef struct drb_setup_s {
int drbId;
in_addr_t tlAddress;
ling teId;
int numUpParam;
up_params_t UpParamList[MAX_NUM_UP_PARAM];
} drb_setup_t;
typedef struct qos_flow_setup_s {
long id;
} qos_flow_setup_t;
typedef struct DRB_nGRAN_setup_s {
long id;
int numUpParam;
up_params_t UpParamList[MAX_NUM_UP_PARAM];
int numQosFlowSetup;
qos_flow_setup_t qosFlows[MAX_NUM_QOS_FLOWS];
} DRB_nGRAN_setup_t;
typedef struct DRB_nGRAN_failed_s {
long id;
long cause_type;
long cause;
} DRB_nGRAN_failed_t;
typedef struct pdu_session_setup_s {
long id;
in_addr_t tlAddress;
long teId;
int numDRBSetup;
DRB_nGRAN_setup_t DRBnGRanList[MAX_NUM_NGRAN_DRB];
int numDRBFailed;
DRB_nGRAN_failed_t DRBnGRanFailedList[MAX_NUM_NGRAN_DRB];
} pdu_session_setup_t;
typedef struct e1ap_bearer_setup_resp_s {
uint64_t gNB_cu_cp_ue_id;
uint64_t gNB_cu_up_ue_id;
int numDRBs;
drb_setup_t DRBList[MAX_NUM_DRBS];
int numPDUSessions;
} e1ap_bearer_setup_resp_t;
typedef struct e1ap_upcp_inst_s {
uint32_t assoc_id;
e1ap_setup_req_t setupReq;
e1ap_bearer_setup_req_t bearerSetupReq;
e1ap_bearer_setup_resp_t bearerSetupResp;
} e1ap_upcp_inst_t;
typedef enum {
CPtype = 0,
UPtype
} E1_t;
int e1ap_encode_send(bool isCu, instance_t instance, E1AP_E1AP_PDU_t *pdu, uint16_t stream, const char *func);
void e1ap_common_init();
#endif /* E1AP_COMMON_H_ */
......@@ -52,6 +52,7 @@
#include "nfapi/oai_integration/vendor_ext.h"
#include <openair2/LAYER2/nr_pdcp/nr_pdcp.h>
#include "openair2/LAYER2/PDCP_v10.1.0/pdcp.h"
#include "openair2/E1AP/e1ap.h"
extern unsigned char NB_gNB_INST;
extern RAN_CONTEXT_t RC;
......
......@@ -1845,7 +1845,7 @@ int RCconfig_NR_CU_E1(MessageDef *msg_p, uint32_t i) {
"gNB id %u is not defined in configuration file\n",i);
config_getlist(&GNBE1ParamList, GNBE1Params, sizeof(GNBE1Params)/sizeof(paramdef_t), NULL);
e1ap_setup_req_t *e1Setup = &E1AP_SETUP_REQ(msg_p);
e1setup->gNB_cu_up_id = *(GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr);
e1Setup->gNB_cu_up_id = *(GNBParamList.paramarray[0][GNB_GNB_ID_IDX].uptr);
paramdef_t PLMNParams[] = GNBPLMNPARAMS_DESC;
paramlist_def_t PLMNParamList = {GNB_CONFIG_STRING_PLMN_LIST, NULL, 0};
......@@ -1855,7 +1855,7 @@ int RCconfig_NR_CU_E1(MessageDef *msg_p, uint32_t i) {
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
config_getlist(&PLMNParamList, PLMNParams, sizeof(PLMNParams)/sizeof(paramdef_t), aprefix);
config_getlist(&PLMNParamList, PLMNParams, sizeof(PLMNParams)/sizeof(paramdef_t), NULL);
int numPLMNs = PLMNParamList.numelt;
e1Setup->supported_plmns = numPLMNs;
......@@ -1865,12 +1865,12 @@ int RCconfig_NR_CU_E1(MessageDef *msg_p, uint32_t i) {
e1Setup->plmns[I].mnc = *PLMNParamList.paramarray[I][GNB_MNC_DIGIT_LENGTH].u8ptr;
}
strcpy(e1Setup->CUCP_e1_ip_address.ipv4_address, GNBE1PARAMList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_CUCP].strptr);
e1Setup->port_cucp = *GNBE1PARAMList.paramarray[0][GNB_CONFIG_E1_PORT_CUCP].uptr;
strcpy(e1Setup->CUUP_e1_ip_address.ipv4_address, GNBE1PARAMList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_CUUP].strptr);
e1Setup->port_cuup = *GNBE1PARAMList.paramarray[0][GNB_CONFIG_E1_PORT_CUUP].uptr;
strcpy(e1Setup->CUCP_e1_ip_address.ipv4_address, *(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_CUCP].strptr));
e1Setup->port_cucp = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_PORT_CUCP].uptr;
strcpy(e1Setup->CUUP_e1_ip_address.ipv4_address, *(GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_IPV4_ADDRESS_CUUP].strptr));
e1Setup->port_cuup = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_PORT_CUUP].uptr;
e1Setup->cn_support = *GNBE1PARAMList.Paramarray[0][GNB_CONFIG_E1_CN_SUPPORT].uptr;
e1Setup->cn_support = *GNBE1ParamList.paramarray[0][GNB_CONFIG_E1_CN_SUPPORT].uptr;
}
return 0;
......
......@@ -41,6 +41,7 @@
#include "s1ap_messages_types.h"
#include "ngap_messages_types.h"
#include "f1ap_messages_types.h"
#include "e1ap_messages_types.h"
#include "rrc_messages_types.h"
#include "intertask_interface.h"
......@@ -107,6 +108,8 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i);
int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp);
int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_update_t *gnb_cu_cfg_update);
void nr_read_config_and_init(void);
void set_node_type(void);
int RCconfig_NR_CU_E1(MessageDef *msg_p, uint32_t i);
#endif /* GNB_CONFIG_H_ */
/** @} */
......@@ -387,8 +387,8 @@ typedef enum {
{GNB_CONFIG_STRING_E1_IPV4_ADDRESS_CUCP, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_E1_PORT_CUCP, NULL, 0, uptr :NULL, defintval:25L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_E1_IPV4_ADDRESS_CUUP, NULL, 0, strptr:NULL, defstrval:NULL, TYPE_STRING, 0}, \
{GNB_CONFIG_STRING_E1_PORT_CUUP, NULL, 0, uptr :NULL, defintval:25L, TYPE_UINT, 0} \
{GNB_CONFIG_STRING_E1_CN_SUPPORT, NULL, 0, uptr :NULL, defintval:1L, TYPE_UNIT, 0} \
{GNB_CONFIG_STRING_E1_PORT_CUUP, NULL, 0, uptr :NULL, defintval:25L, TYPE_UINT, 0}, \
{GNB_CONFIG_STRING_E1_CN_SUPPORT, NULL, 0, uptr :NULL, defintval:1L, TYPE_UINT, 0} \
}
/* L1 configuration section names */
......
......@@ -476,6 +476,7 @@ typedef struct nr_mac_rrc_dl_if_s {
typedef struct gNB_RRC_INST_s {
ngran_node_t node_type;
int cu_type;
uint32_t node_id;
char *node_name;
int module_id;
......
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