Commit ceaddf9e authored by SreeshmaShiv's avatar SreeshmaShiv

changes -feb5

parent a53a73c7
...@@ -1173,6 +1173,76 @@ NR_MeasConfig_t *get_defaultMeasConfig(uint32_t ssb_arfcn, int band, int scs) ...@@ -1173,6 +1173,76 @@ NR_MeasConfig_t *get_defaultMeasConfig(uint32_t ssb_arfcn, int band, int scs)
// message, a single ID and related measurements are included in the message. // message, a single ID and related measurements are included in the message.
mc->measIdToAddModList = calloc(1, sizeof(*mc->measIdToAddModList)); mc->measIdToAddModList = calloc(1, sizeof(*mc->measIdToAddModList));
NR_MeasIdToAddMod_t *measid = calloc(1, sizeof(*measid)); NR_MeasIdToAddMod_t *measid = calloc(1, sizeof(*measid));
measid->measId = 1;
measid->measObjectId = 1;
measid->reportConfigId = 1;
asn1cSeqAdd(&mc->measIdToAddModList->list, measid);
/*Imran*/ /*Requires Verification*/
/*Event A3*/
NR_ReportConfigToAddMod_t *rc_event_A3 = calloc(1, sizeof(*rc_event_A3));
rc_event_A3->reportConfigId = 3;
rc_event_A3->reportConfig.present = NR_ReportConfigToAddMod__reportConfig_PR_reportConfigNR;
NR_EventTriggerConfig_t *etrc_event_A3 = calloc(1, sizeof(*etrc_event_A3));
etrc_event_A3->eventId.present = NR_EventTriggerConfig__eventId_PR_eventA3;
etrc_event_A3->eventId.choice.eventA3 = calloc(1, sizeof(*etrc_event_A3->eventId.choice.eventA3));
etrc_event_A3->eventId.choice.eventA3->a3_Offset.present = NR_MeasTriggerQuantityOffset_PR_rsrp;
etrc_event_A3->eventId.choice.eventA3->a3_Offset.choice.rsrp = 0; //
etrc_event_A3->eventId.choice.eventA3->reportOnLeave = true;
etrc_event_A3->eventId.choice.eventA3->hysteresis = 0;
etrc_event_A3->eventId.choice.eventA3->timeToTrigger = NR_TimeToTrigger_ms2560;
etrc_event_A3->rsType = NR_NR_RS_Type_ssb;
etrc_event_A3->reportInterval = NR_ReportInterval_ms1024;
etrc_event_A3->reportAmount = NR_EventTriggerConfig__reportAmount_infinity;
etrc_event_A3->reportQuantityCell.rsrp = true;
etrc_event_A3->reportQuantityCell.rsrq = false;
etrc_event_A3->reportQuantityCell.sinr = false;
asn1cCallocOne(etrc_event_A3->maxNrofRS_IndexesToReport, 4);
etrc_event_A3->maxReportCells = 4;
etrc_event_A3->includeBeamMeasurements = false;
NR_ReportConfigNR_t *rcnr_event_A3 = calloc(1, sizeof(*rcnr_event_A3));
rcnr_event_A3->reportType.present = NR_ReportConfigNR__reportType_PR_eventTriggered;
rcnr_event_A3->reportType.choice.eventTriggered = etrc_event_A3;
rc_event_A3->reportConfig.choice.reportConfigNR = rcnr_event_A3;
asn1cSeqAdd(&mc->reportConfigToAddModList->list, rc_event_A3);
/*Event A5*/
// NR_ReportConfigToAddMod_t *rc_event_A5 = calloc(1, sizeof(*rc_event_A5));
// rc_event_A5->reportConfigId = 5;
// rc_event_A5->reportConfig.present = NR_ReportConfigToAddMod__reportConfig_PR_reportConfigNR;
// NR_EventTriggerConfig_t *etrc_event_A5 = calloc(1, sizeof(*etrc_event_A5));
// etrc_event_A5->eventId.present = NR_EventTriggerConfig__eventId_PR_eventA5;
// etrc_event_A5->eventId.choice.eventA5 = calloc(1, sizeof(*etrc_event_A5->eventId.choice.eventA5));
// etrc_event_A5->eventId.choice.eventA5->a5_Threshold1.present = NR_MeasTriggerQuantityOffset_PR_rsrp;
// etrc_event_A5->eventId.choice.eventA5->a5_Threshold1.choice.rsrp = 10; // 10 means 5 dB
//etrc_event_A5->eventId.choice.eventA5->a5_Threshold2.present = NR_MeasTriggerQuantityOffset_PR_rsrp;
// etrc_event_A5->eventId.choice.eventA5->a5_Threshold2.choice.rsrp = 10; // 10 means 5 dB
// etrc_event_A5->eventId.choice.eventA5->reportOnLeave = true;
// etrc_event_A5->eventId.choice.eventA5->hysteresis = 0;
// etrc_event_A5->eventId.choice.eventA5->timeToTrigger = NR_TimeToTrigger_ms2560;
// etrc_event_A5->rsType = NR_NR_RS_Type_ssb;
// etrc_event_A5->reportInterval = NR_ReportInterval_ms1024;
// etrc_event_A5->reportAmount = NR_EventTriggerConfig__reportAmount_infinity;
// etrc_event_A53->reportQuantityCell.rsrp = true;
// etrc_event_A5->reportQuantityCell.rsrq = false;
// etrc_event_A5->reportQuantityCell.sinr = false;
// asn1cCallocOne(etrc_event_A5->maxNrofRS_IndexesToReport, 4);
// etrc_event_A5->maxReportCells = 4;
// etrc_event_A5->includeBeamMeasurements = false;
// NR_ReportConfigNR_t *rcnr_event_A5 = calloc(1, sizeof(*rcnr_event_A5));
// rcnr_event_A5->reportType.present = NR_ReportConfigNR__reportType_PR_eventTriggered;
// rcnr_event_A5->reportType.choice.eventTriggered = etrc_event_A5;
// rc_evet_A5->reportConfig.choice.reportConfigNR = rcnr_event_A5;
// asn1cSeqAdd(&mc->reportConfigToAddModList->list, rc_event_A5);
/*Imran*/
// Measurement ID: Identifies how to report measurements of a specific object. This is a many-to-many mapping: a
// measurement object could have multiple reporting configurations, a reporting configuration could apply to multiple
// objects. A unique ID is used for each object-to-report-config association. When UE sends a MeasurementReport
// message, a single ID and related measurements are included in the message.
mc->measIdToAddModList = calloc(1, sizeof(*mc->measIdToAddModList));
// NR_MeasIdToAddMod_t *measid = calloc(1, sizeof(*measid));
measid->measId = 1; measid->measId = 1;
measid->measObjectId = 1; measid->measObjectId = 1;
measid->reportConfigId = 1; measid->reportConfigId = 1;
...@@ -1188,6 +1258,28 @@ NR_MeasConfig_t *get_defaultMeasConfig(uint32_t ssb_arfcn, int band, int scs) ...@@ -1188,6 +1258,28 @@ NR_MeasConfig_t *get_defaultMeasConfig(uint32_t ssb_arfcn, int band, int scs)
asn1cCallocOne(qcnr3->quantityConfigCell.csi_RS_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6); asn1cCallocOne(qcnr3->quantityConfigCell.csi_RS_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6);
asn1cSeqAdd(&mc->quantityConfig->quantityConfigNR_List->list, qcnr3); asn1cSeqAdd(&mc->quantityConfig->quantityConfigNR_List->list, qcnr3);
/*Imran*/
NR_QuantityConfigNR_t *qcnr_event_a3 = calloc(1, sizeof(*qcnr_event_a3));
asn1cCallocOne(qcnr_event_a3->quantityConfigCell.ssb_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6);
asn1cCallocOne(qcnr_event_a3->quantityConfigCell.csi_RS_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6);
asn1cSeqAdd(&mc->quantityConfig->quantityConfigNR_List->list, qcnr_event_a3);
NR_QuantityConfigNR_t *qcnr_event_a5 = calloc(1, sizeof(*qcnr_event_a5));
asn1cCallocOne(qcnr_event_a5->quantityConfigCell.ssb_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6);
asn1cCallocOne(qcnr_event_a5->quantityConfigCell.csi_RS_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6);
asn1cSeqAdd(&mc->quantityConfig->quantityConfigNR_List->list, qcnr_event_a5);
/*Imran*/
// Quantity Configuration: Specifies parameters for layer 3 filtering of measurements. Only after filtering, reporting
// criteria are evaluated. The formula used is F_n = (1-a)F_(n-1) + a*M_n, where M is the latest measurement, F is the
// filtered measurement, and ais based on configured filter coefficient.
/* mc->quantityConfig = calloc(1, sizeof(*mc->quantityConfig));
mc->quantityConfig->quantityConfigNR_List = calloc(1, sizeof(*mc->quantityConfig->quantityConfigNR_List));
NR_QuantityConfigNR_t *qcnr3 = calloc(1, sizeof(*qcnr3));
asn1cCallocOne(qcnr3->quantityConfigCell.ssb_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6);
asn1cCallocOne(qcnr3->quantityConfigCell.csi_RS_FilterConfig.filterCoefficientRSRP, NR_FilterCoefficient_fc6);
asn1cSeqAdd(&mc->quantityConfig->quantityConfigNR_List->list, qcnr3); */
return mc; return mc;
} }
......
...@@ -388,6 +388,12 @@ typedef struct nr_rrc_cuup_container_t { ...@@ -388,6 +388,12 @@ typedef struct nr_rrc_cuup_container_t {
sctp_assoc_t assoc_id; sctp_assoc_t assoc_id;
} nr_rrc_cuup_container_t; } nr_rrc_cuup_container_t;
typedef struct nr_xnap_container_t {
RB_ENTRY(nr_xnap_container_t) entries;
xnap_setup_req_t *setup_req;
sctp_assoc_t assoc_id;
} nr_xnap_container_t;
//---NR---(completely change)--------------------- //---NR---(completely change)---------------------
typedef struct gNB_RRC_INST_s { typedef struct gNB_RRC_INST_s {
...@@ -425,6 +431,9 @@ typedef struct gNB_RRC_INST_s { ...@@ -425,6 +431,9 @@ typedef struct gNB_RRC_INST_s {
RB_HEAD(rrc_cuup_tree, nr_rrc_cuup_container_t) cuups; // CU-UPs, indexed by assoc_id RB_HEAD(rrc_cuup_tree, nr_rrc_cuup_container_t) cuups; // CU-UPs, indexed by assoc_id
size_t num_cuups; size_t num_cuups;
RB_HEAD(xnap_tree, nr_xnap_container_t) xnapids; // XNAP IDs, indexed by assoc_id
size_t num_xnapids;
/* KgNB as computed from parameters within USIM card */ /* KgNB as computed from parameters within USIM card */
uint8_t kgnb[32]; uint8_t kgnb[32];
uint8_t nh[32]; uint8_t nh[32];
......
...@@ -1357,6 +1357,18 @@ static inline uint64_t bitStr_to_uint64(const BIT_STRING_t *asn) { ...@@ -1357,6 +1357,18 @@ static inline uint64_t bitStr_to_uint64(const BIT_STRING_t *asn) {
return result; return result;
} }
void rrc_gNB_process_HandoverPreparationInformation(//// why is this here? should be in RRC
rrc_gNB_ue_context_t *ue_context_p,
uint8_t *buffer,
int *size)
{
memset(buffer, 0, 8192);
char *ho_buf = (char *) buffer;
int ho_size;
ho_size = do_NRHandoverPreparation(ho_buf, 8192, ue_context_p->ue_context.UE_Capability_nr, ue_context_p->ue_context.UE_Capability_size);
*size = ho_size;
}
void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_MeasurementReport_t *measurementReport) void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_MeasurementReport_t *measurementReport)
{ {
...@@ -1367,8 +1379,8 @@ void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_Me ...@@ -1367,8 +1379,8 @@ void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_Me
&& measurementReport->criticalExtensions.choice.measurementReport != NULL); && measurementReport->criticalExtensions.choice.measurementReport != NULL);
gNB_RRC_UE_t *ue_ctxt = &ue_context_p->ue_context; gNB_RRC_UE_t *ue_ctxt = &ue_context_p->ue_context;
ASN_STRUCT_FREE(asn_DEF_NR_MeasResults, ue_ctxt->measResults); ////what is ue_ctxt? ASN_STRUCT_FREE(asn_DEF_NR_MeasResults, ue_ctxt->measResults);
ue_ctxt->measResults = NULL; ////same as above ue_ctxt->measResults = NULL;
const NR_MeasId_t id = measurementReport->criticalExtensions.choice.measurementReport->measResults.measId; const NR_MeasId_t id = measurementReport->criticalExtensions.choice.measurementReport->measResults.measId;
/*Imran*/ /*Imran*/
...@@ -1463,7 +1475,7 @@ void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_Me ...@@ -1463,7 +1475,7 @@ void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_Me
NR_MeasResultServMO_t *measresultservmo = ik_measResults->measResultServingMOList.list.array[0]; //getting only first NR_MeasResultServMO_t *measresultservmo = ik_measResults->measResultServingMOList.list.array[0]; //getting only first
NR_MeasResultNR_t *measresultnr = &measresultservmo->measResultServingCell; NR_MeasResultNR_t *measresultnr = &measresultservmo->measResultServingCell;
NR_MeasQuantityResults_t *mqr = measresultnr->measResult.cellResults.resultsSSB_Cell; NR_MeasQuantityResults_t *mqr = measresultnr->measResult.cellResults.resultsSSB_Cell;
int ncell_index=0; // int ncell_index=0;
if (mqr != NULL){ if (mqr != NULL){
const long rrsrp = *mqr->rsrp - 156; const long rrsrp = *mqr->rsrp - 156;
...@@ -1483,7 +1495,7 @@ void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_Me ...@@ -1483,7 +1495,7 @@ void rrc_gNB_process_MeasurementReport(rrc_gNB_ue_context_t *ue_context_p, NR_Me
LOG_D(RRC, "NR MeasID %ld\n", id); LOG_D(RRC, "NR MeasID %ld\n", id);
/*ALL NeighbourCell*/ /*ALL NeighbourCell*/
NR_MeasResultNR_t *neighbour_measresult = ik_measResults->measResultNeighCells->choice.measResultListNR->list.array[0] ; // NR_MeasResultNR_t *neighbour_measresult = ik_measResults->measResultNeighCells->choice.measResultListNR->list.array[0] ; /* Need to review this whether to retain */
/*Imran*/ /*Imran*/
MessageDef *msg; MessageDef *msg;
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "XNAP_NRModeInfoFDD.h" #include "XNAP_NRModeInfoFDD.h"
#include "XNAP_NRModeInfoTDD.h" #include "XNAP_NRModeInfoTDD.h"
#include "openair2/RRC/NR/nr_rrc_defs.h" #include "openair2/RRC/NR/nr_rrc_defs.h"
#include "xnap_gNB_defs.h"
int xnap_gNB_generate_xn_setup_request(sctp_assoc_t assoc_id, xnap_setup_req_t *req) int xnap_gNB_generate_xn_setup_request(sctp_assoc_t assoc_id, xnap_setup_req_t *req)
{ {
...@@ -752,21 +753,31 @@ int xnap_gNB_generate_xn_setup_response(sctp_assoc_t assoc_id, xnap_setup_resp_t ...@@ -752,21 +753,31 @@ int xnap_gNB_generate_xn_setup_response(sctp_assoc_t assoc_id, xnap_setup_resp_t
return ret; return ret;
} }
int xnap_gNB_generate_xn_handover_request (instance_t instance, //int xnap_gNB_generate_xn_handover_request (sctp_assoc_t assoc_id, instance_t instance,
xnap_handover_req_t *xnap_handover_req, int ue_id) // xnap_handover_req_t *xnap_handover_req, int ue_id)
int xnap_gNB_generate_xn_handover_request (sctp_assoc_t assoc_id, xnap_handover_req_t *xnap_handover_req)
{ {
XNAP_XnAP_PDU_t pdu; XNAP_XnAP_PDU_t pdu;
XNAP_HandoverRequest_t *out; XNAP_HandoverRequest_t *xnhandoverreq;
XNAP_HandoverRequest_IEs_t *ie; XNAP_HandoverRequest_IEs_t *ie;
instance_t instance;
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
int ret = 0; int ret = 0;
sctp_assoc_t assoc_id;
//get intance from tree if needed //get intance from tree if needed
//DevAssert(instance_p != NULL); //not pointer DevAssert(instance != NULL); //not pointer
// DevAssert(xnap_gNB_data_p != NULL);// not defined // DevAssert(xnap_gNB_data_p != NULL);// not defined
// DevAssert(pdu != NULL);
xnhandoverreq = &pdu.choice.initiatingMessage->value.choice.HandoverRequest;
/* Send a xn setup failure with protocol cause unspecified */
MessageDef *message_p = itti_alloc_new_message(TASK_XNAP, 0, XNAP_HANDOVER_REQ);
message_p->ittiMsgHeader.originInstance = assoc_id;
itti_send_msg_to_task(TASK_XNAP, 0, message_p);
LOG_D(XNAP, "Received a new XN setup request\n");
/* Prepare the XnAP handover message to encode */ /* Prepare the XnAP handover message to encode */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
...@@ -774,7 +785,7 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance, ...@@ -774,7 +785,7 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance,
pdu.choice.initiatingMessage->procedureCode = XNAP_ProcedureCode_id_handoverPreparation; pdu.choice.initiatingMessage->procedureCode = XNAP_ProcedureCode_id_handoverPreparation;
pdu.choice.initiatingMessage->criticality = XNAP_Criticality_reject; pdu.choice.initiatingMessage->criticality = XNAP_Criticality_reject;
pdu.choice.initiatingMessage->value.present = XNAP_InitiatingMessage__value_PR_HandoverRequest; pdu.choice.initiatingMessage->value.present = XNAP_InitiatingMessage__value_PR_HandoverRequest;
out = &pdu.choice.initiatingMessage->value.choice.HandoverRequest; xnhandoverreq = &pdu.choice.initiatingMessage->value.choice.HandoverRequest;
/* mandatory */ /* mandatory */
ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t)); ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t));
...@@ -782,7 +793,7 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance, ...@@ -782,7 +793,7 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance,
ie->criticality = XNAP_Criticality_reject; ie->criticality = XNAP_Criticality_reject;
ie->value.present = XNAP_HandoverRequest_IEs__value_PR_NG_RANnodeUEXnAPID; ie->value.present = XNAP_HandoverRequest_IEs__value_PR_NG_RANnodeUEXnAPID;
// ie->value.choice.UE_XnAP_ID = xnap_id_get_id_source(&instance_p->id_manager, ue_id); // ie->value.choice.UE_XnAP_ID = xnap_id_get_id_source(&instance_p->id_manager, ue_id);
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&xnhandoverreq->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t)); ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t));
...@@ -791,22 +802,22 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance, ...@@ -791,22 +802,22 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance,
ie->value.present = XNAP_HandoverRequest_IEs__value_PR_Cause; ie->value.present = XNAP_HandoverRequest_IEs__value_PR_Cause;
ie->value.choice.Cause.present = XNAP_Cause_PR_radioNetwork; ie->value.choice.Cause.present = XNAP_Cause_PR_radioNetwork;
ie->value.choice.Cause.choice.radioNetwork = 1; //Xnap_CauseRadioNetwork_handover_desirable_for_radio_reasons; ie->value.choice.Cause.choice.radioNetwork = 1; //Xnap_CauseRadioNetwork_handover_desirable_for_radio_reasons;
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&xnhandoverreq->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/** ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t)); ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t));
ie->id = XNAP_ProtocolIE_ID_id_TargetCellCGI; ie->id = XNAP_ProtocolIE_ID_id_TargetCellCGI;
ie->criticality = XNAP_Criticality_reject; ie->criticality = XNAP_Criticality_reject;
ie->value.present = XNAP_HandoverRequest_IEs__value_PR_Target_CGI; ie->value.present = XNAP_HandoverRequest_IEs__value_PR_Target_CGI;
ie->value.choice.XNAP_Target_CGI_u.present = XNAP_Target_CGI_PR_nr; ie->value.choice.Target_CGI.present = XNAP_Target_CGI_PR_nr;
ie->value.choice.nr = (XNAP_NR_CGI_t *)calloc(1, sizeof(XNAP_NR_CGI_t)); ie->value.choice.Target_CGI.choice.nr = (XNAP_NR_CGI_t *)calloc(1, sizeof(XNAP_NR_CGI_t));
MCC_MNC_TO_PLMNID(xnap_handover_req->plmn_id.mcc, MCC_MNC_TO_PLMNID(xnap_handover_req->plmn_id.mcc,
xnap_handover_req->plmn_id.mnc, xnap_handover_req->plmn_id.mnc,
xnap_handover_req->plmn_id.mnc_digit_length, xnap_handover_req->plmn_id.mnc_digit_length,
&ie->value.choice.nr.plmn_id); **/ &ie->value.choice.Target_CGI.choice.nr->plmn_id);
//nr_CI to be filled. // NR_CELL_ID_TO_BIT_STRING(xnap_handover_req->plmn_id,
//NR_CELL_ID_TO_BIT_STRING(xnap_handover_req->target_cgi.cgi, &ie-> // &ie->value.choice.Target_CGI.choice.nr->nr_CI); // bit string
/** asn1cSeqAdd(&out->protocolIEs.list, ie); **/ asn1cSeqAdd(&xnhandoverreq->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/** ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t)); /** ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t));
...@@ -863,7 +874,7 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance, ...@@ -863,7 +874,7 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance,
OCTET_STRING_fromBuf(&ie->value.choice.UEContextInfoHORequest.rrc_Context, (char*) xnap_handover_req->ue_context.rrc_buffer, 8192);// added 8192- need to remove hard coding OCTET_STRING_fromBuf(&ie->value.choice.UEContextInfoHORequest.rrc_Context, (char*) xnap_handover_req->ue_context.rrc_buffer, 8192);// added 8192- need to remove hard coding
asn1cSeqAdd(&out->protocolIEs.list, ie); asn1cSeqAdd(&xnhandoverreq->protocolIEs.list, ie);
/* mandatory */ /* mandatory */
/** ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t)); /** ie = (XNAP_HandoverRequest_IEs_t *)calloc(1, sizeof(XNAP_HandoverRequest_IEs_t));
...@@ -894,6 +905,16 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance, ...@@ -894,6 +905,16 @@ int xnap_gNB_generate_xn_handover_request (instance_t instance,
return ret; return ret;
} }
/** getting assoc-id- sharing this clip from F1AP
* int f1ap_assoc_id(F1_t isCu, instance_t instanceP) {
f1ap_setup_req_t *f1_inst=f1ap_req(isCu, instanceP);
return f1_inst->assoc_id;
}
If method that we have implemented to fetch assoc_id is not correct, need to try this
**/
/**
void rrc_gNB_process_HandoverPreparationInformation(//// why is this here? should be in RRC void rrc_gNB_process_HandoverPreparationInformation(//// why is this here? should be in RRC
rrc_gNB_ue_context_t ue_context_p, rrc_gNB_ue_context_t ue_context_p,
uint8_t *buffer, uint8_t *buffer,
...@@ -906,4 +927,4 @@ void rrc_gNB_process_HandoverPreparationInformation(//// why is this here? shoul ...@@ -906,4 +927,4 @@ void rrc_gNB_process_HandoverPreparationInformation(//// why is this here? shoul
*size = ho_size; *size = ho_size;
} } **/
...@@ -39,6 +39,6 @@ int xnap_gNB_generate_xn_setup_failure(sctp_assoc_t assoc_id, xnap_setup_failure ...@@ -39,6 +39,6 @@ int xnap_gNB_generate_xn_setup_failure(sctp_assoc_t assoc_id, xnap_setup_failure
int xnap_gNB_set_cause(XNAP_Cause_t *cause_p, XNAP_Cause_PR cause_type, long cause_value); int xnap_gNB_set_cause(XNAP_Cause_t *cause_p, XNAP_Cause_PR cause_type, long cause_value);
int xnap_gNB_generate_xn_handover_request(instance_t instance, xnap_handover_req_t *xnap_handover_req, int ue_id); //int xnap_gNB_generate_xn_handover_request(instance_t instance, xnap_handover_req_t *xnap_handover_req, int ue_id);
int xnap_gNB_generate_xn_handover_request(sctp_assoc_t assoc_id, xnap_handover_req_t *xnap_handover_req);
#endif /* XNAP_GNB_GENERATE_MESSAGES_H_ */ #endif /* XNAP_GNB_GENERATE_MESSAGES_H_ */
...@@ -90,6 +90,13 @@ const char *xnap_direction2String(int xnap_dir) ...@@ -90,6 +90,13 @@ const char *xnap_direction2String(int xnap_dir)
return (xnap_direction_String[xnap_dir]); return (xnap_direction_String[xnap_dir]);
} }
/** Commented it for now **
int xnap_assoc_id(F1_t isXNAP, instance_t instanceP) {
xnap_setup_req_t *xnap_inst=xnap_req(isXNAP, instanceP);
return xnap_inst->assoc_id;
} **/
int xnap_gNB_handle_message(instance_t instance, int xnap_gNB_handle_message(instance_t instance,
sctp_assoc_t assoc_id, sctp_assoc_t assoc_id,
int32_t stream, int32_t stream,
......
...@@ -213,7 +213,7 @@ void xnap_gNB_handle_handover_req(instance_t instance, ...@@ -213,7 +213,7 @@ void xnap_gNB_handle_handover_req(instance_t instance,
xnap_gNB_data_t *target; xnap_gNB_data_t *target;
xnap_id_manager *id_manager; xnap_id_manager *id_manager;
int ue_id; int ue_id;
sctp_assoc_t assoc_id;
//int target_pci = xnap_handover_req->target_physCellId; //pci or cgi? //int target_pci = xnap_handover_req->target_physCellId; //pci or cgi?
instance_p = xnap_gNB_get_instance(instance); instance_p = xnap_gNB_get_instance(instance);
...@@ -225,6 +225,9 @@ void xnap_gNB_handle_handover_req(instance_t instance, ...@@ -225,6 +225,9 @@ void xnap_gNB_handle_handover_req(instance_t instance,
/* allocate xnap ID */ /* allocate xnap ID */
id_manager = &instance_p->id_manager; id_manager = &instance_p->id_manager;
ue_id = xnap_allocate_new_id(id_manager); ue_id = xnap_allocate_new_id(id_manager);
MessageDef *message_p = itti_alloc_new_message(TASK_XNAP, 0, XNAP_HANDOVER_REQ);
message_p->ittiMsgHeader.originInstance = assoc_id;
xnap_handover_req_t *req = &XNAP_HANDOVER_REQ(message_p);
if (ue_id == -1) { if (ue_id == -1) {
LOG_E(XNAP,"could not allocate a new XNAP UE ID\n"); LOG_E(XNAP,"could not allocate a new XNAP UE ID\n");
/* TODO: cancel handover: send (to be defined) message to RRC */ /* TODO: cancel handover: send (to be defined) message to RRC */
...@@ -238,7 +241,7 @@ void xnap_gNB_handle_handover_req(instance_t instance, ...@@ -238,7 +241,7 @@ void xnap_gNB_handle_handover_req(instance_t instance,
//xnap_id_set_target(id_manager, ue_id, target); //xnap_id_set_target(id_manager, ue_id, target);
// xnap_gNB_generate_xn_handover_request(instance_p, target, xnap_handover_req, ue_id); //Review removed target here but needs it // xnap_gNB_generate_xn_handover_request(instance_p, target, xnap_handover_req, ue_id); //Review removed target here but needs it
xnap_gNB_generate_xn_handover_request(instance, xnap_handover_req, ue_id); xnap_gNB_generate_xn_handover_request(assoc_id, xnap_handover_req);
} }
void *xnap_task(void *arg) void *xnap_task(void *arg)
......
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