Commit 81c5da5f authored by Raymond Knopp's avatar Raymond Knopp Committed by magounak

ENDC X2AP: Corrections at setup generation message and logs addition

parent d605e5ff
...@@ -44,9 +44,9 @@ int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len) ...@@ -44,9 +44,9 @@ int x2ap_eNB_encode_pdu(X2AP_X2AP_PDU_t *pdu, uint8_t **buffer, uint32_t *len)
DevAssert(buffer != NULL); DevAssert(buffer != NULL);
DevAssert(len != NULL); DevAssert(len != NULL);
if (asn1_xer_print) { //if (asn1_xer_print) {
xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)pdu); xer_fprint(stdout, &asn_DEF_X2AP_X2AP_PDU, (void *)pdu);
} //}
encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, pdu, (void **)buffer); encoded = aper_encode_to_new_buffer(&asn_DEF_X2AP_X2AP_PDU, 0, pdu, (void **)buffer);
......
...@@ -323,6 +323,10 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN ...@@ -323,6 +323,10 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN
&servedCellMember->servedCellInfo.cellId.eUTRANcellIdentifier); &servedCellMember->servedCellInfo.cellId.eUTRANcellIdentifier);
INT16_TO_OCTET_STRING(instance_p->tac, &servedCellMember->servedCellInfo.tAC); INT16_TO_OCTET_STRING(instance_p->tac, &servedCellMember->servedCellInfo.tAC);
X2AP_INFO("TAC: %d -> %02x%02x\n", instance_p->tac,
servedCellMember->servedCellInfo.tAC.buf[0],
servedCellMember->servedCellInfo.tAC.buf[1]);
plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t)); plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t));
{ {
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn); MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, plmn);
...@@ -1341,7 +1345,7 @@ int x2ap_eNB_generate_ENDC_x2_setup_request( ...@@ -1341,7 +1345,7 @@ int x2ap_eNB_generate_ENDC_x2_setup_request(
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) { if (x2ap_eNB_encode_pdu(&pdu, &buffer, &len) < 0) {
X2AP_ERROR("Failed to encode X2 setup request\n"); X2AP_ERROR("Failed to encode X2 setup response\n");
return -1; return -1;
} }
...@@ -1357,6 +1361,7 @@ int x2ap_eNB_generate_ENDC_x2_setup_request( ...@@ -1357,6 +1361,7 @@ int x2ap_eNB_generate_ENDC_x2_setup_request(
int x2ap_gNB_generate_ENDC_x2_setup_response( int x2ap_gNB_generate_ENDC_x2_setup_response(
x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p) x2ap_eNB_instance_t *instance_p, x2ap_eNB_data_t *x2ap_eNB_data_p)
{ {
X2AP_INFO("In x2ap_gNB_generate_ENDC_x2_setup_response ()!\n");
X2AP_X2AP_PDU_t pdu; X2AP_X2AP_PDU_t pdu;
X2AP_ENDCX2SetupResponse_t *out; X2AP_ENDCX2SetupResponse_t *out;
X2AP_ENDCX2SetupResponse_IEs_t *ie; X2AP_ENDCX2SetupResponse_IEs_t *ie;
...@@ -1375,7 +1380,7 @@ int x2ap_gNB_generate_ENDC_x2_setup_response( ...@@ -1375,7 +1380,7 @@ int x2ap_gNB_generate_ENDC_x2_setup_response(
/* Prepare the X2AP message to encode */ /* Prepare the X2AP message to encode */
memset(&pdu, 0, sizeof(pdu)); memset(&pdu, 0, sizeof(pdu));
pdu.present = X2AP_X2AP_PDU_PR_initiatingMessage; pdu.present = X2AP_X2AP_PDU_PR_successfulOutcome;
pdu.choice.successfulOutcome.procedureCode = X2AP_ProcedureCode_id_endcX2Setup; pdu.choice.successfulOutcome.procedureCode = X2AP_ProcedureCode_id_endcX2Setup;
pdu.choice.successfulOutcome.criticality = X2AP_Criticality_reject; pdu.choice.successfulOutcome.criticality = X2AP_Criticality_reject;
pdu.choice.successfulOutcome.value.present = X2AP_SuccessfulOutcome__value_PR_ENDCX2SetupResponse; pdu.choice.successfulOutcome.value.present = X2AP_SuccessfulOutcome__value_PR_ENDCX2SetupResponse;
...@@ -1394,6 +1399,12 @@ int x2ap_gNB_generate_ENDC_x2_setup_response( ...@@ -1394,6 +1399,12 @@ int x2ap_gNB_generate_ENDC_x2_setup_response(
INT32_TO_OCTET_STRING(instance_p->eNB_id, INT32_TO_OCTET_STRING(instance_p->eNB_id,
&ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID); &ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID);
X2AP_INFO("%d -> %02x%02x%02x\n", instance_p->eNB_id,
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[0],
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[1],
ie_GNB_ENDC->value.choice.GlobalGNB_ID.gNB_ID.choice.gNB_ID.buf[2]);
MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length, MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length,
&ie_GNB_ENDC->value.choice.GlobalGNB_ID.pLMN_Identity); &ie_GNB_ENDC->value.choice.GlobalGNB_ID.pLMN_Identity);
...@@ -1414,6 +1425,12 @@ int x2ap_gNB_generate_ENDC_x2_setup_response( ...@@ -1414,6 +1425,12 @@ int x2ap_gNB_generate_ENDC_x2_setup_response(
&servedCellMember->servedNRCellInfo.nrCellID.pLMN_Identity); &servedCellMember->servedNRCellInfo.nrCellID.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(instance_p->eNB_id, NR_CELL_ID_TO_BIT_STRING(instance_p->eNB_id,
&servedCellMember->servedNRCellInfo.nrCellID.nRcellIdentifier); &servedCellMember->servedNRCellInfo.nrCellID.nRcellIdentifier);
NR_EXTENDED_TAC_ID_TO_BIT_STRING(instance_p->tac, &servedCellMember->servedNRCellInfo.eXtended_TAC);
X2AP_INFO("TAC: %d -> %02x%02x%02x\n", instance_p->tac,
servedCellMember->servedNRCellInfo.eXtended_TAC.buf[0],
servedCellMember->servedNRCellInfo.eXtended_TAC.buf[1],
servedCellMember->servedNRCellInfo.eXtended_TAC.buf[2]);
plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t)); plmn = (X2AP_PLMN_Identity_t *)calloc(1,sizeof(X2AP_PLMN_Identity_t));
{ {
...@@ -1421,9 +1438,9 @@ int x2ap_gNB_generate_ENDC_x2_setup_response( ...@@ -1421,9 +1438,9 @@ int x2ap_gNB_generate_ENDC_x2_setup_response(
ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.broadcastPLMNs.list, plmn); ASN_SEQUENCE_ADD(&servedCellMember->servedNRCellInfo.broadcastPLMNs.list, plmn);
} }
if (instance_p->frame_type[i] == TDD) { if (instance_p->frame_type[i] == TDD) { // Panos: Remember to change that to TDD
servedCellMember->servedNRCellInfo.nrModeInfo.present = X2AP_ServedNRCell_Information__nrModeInfo_PR_tdd; servedCellMember->servedNRCellInfo.nrModeInfo.present = X2AP_ServedNRCell_Information__nrModeInfo_PR_tdd;
servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_ARFCN = instance_p->tdd_nRARFCN[i]; servedCellMember->servedNRCellInfo.nrModeInfo.choice.tdd.nR_ARFCN = 0; //instance_p->tdd_nRARFCN[i];
/*Missing addition of Frequency Band List item here, can't find it... */ /*Missing addition of Frequency Band List item here, can't find it... */
switch (instance_p->N_RB_DL[i]) { switch (instance_p->N_RB_DL[i]) {
case 50: case 50:
...@@ -1470,7 +1487,7 @@ int x2ap_gNB_generate_ENDC_x2_setup_response( ...@@ -1470,7 +1487,7 @@ int x2ap_gNB_generate_ENDC_x2_setup_response(
AssertFatal(0,"nr_X2Setupresponse not supported for FDD!"); AssertFatal(0,"nr_X2Setupresponse not supported for FDD!");
} }
/*Don't know where to extract the value of measurementTimingConfiguration from. Set it to 0 for now */ /*Don't know where to extract the value of measurementTimingConfiguration from. Set it to 0 for now */
INT16_TO_OCTET_STRING(0, &servedCellMember->servedNRCellInfo.measurementTimingConfiguration); INT8_TO_OCTET_STRING(0, &servedCellMember->servedNRCellInfo.measurementTimingConfiguration);
} }
ASN_SEQUENCE_ADD(&ie_GNB_ENDC->value.choice.ServedNRcellsENDCX2ManagementList.list, servedCellMember); ASN_SEQUENCE_ADD(&ie_GNB_ENDC->value.choice.ServedNRcellsENDCX2ManagementList.list, servedCellMember);
......
...@@ -1463,7 +1463,8 @@ x2ap_gNB_handle_ENDC_x2_setup_request(instance_t instance, ...@@ -1463,7 +1463,8 @@ x2ap_gNB_handle_ENDC_x2_setup_request(instance_t instance,
DevAssert(instance_p != NULL); DevAssert(instance_p != NULL);
// Panos: Here we should be calling an ENDC specific setup response function // Panos: Here we should be calling an ENDC specific setup response function
return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data); return x2ap_gNB_generate_ENDC_x2_setup_response(instance_p, x2ap_eNB_data);
//return x2ap_eNB_generate_x2_setup_response(instance_p, x2ap_eNB_data);
} }
int int
......
...@@ -371,6 +371,26 @@ do { \ ...@@ -371,6 +371,26 @@ do { \
(bITsTRING)->bits_unused = 4; \ (bITsTRING)->bits_unused = 4; \
} while(0) } while(0)
/*
#define INT16_TO_3_BYTE_BUFFER(x, buf) \
do { \
(buf)[0] = 0x00; \
(buf)[1] = (x) >> 8; \
(buf)[2] = (x); \
} while(0)
*/
#define NR_EXTENDED_TAC_ID_TO_BIT_STRING(x, aSN) \
do { \
(aSN)->buf = calloc(3, sizeof(uint8_t)); \
(aSN)->size = 3; \
(aSN)->buf[0] = 0x00; \
(aSN)->buf[1] = (x) >> 8; \
(aSN)->buf[2] = (x); \
} while(0)
/* TS 38.473 v15.2.1 section 9.3.1.55: /* TS 38.473 v15.2.1 section 9.3.1.55:
* MaskedIMEISV is BIT_STRING(64) * MaskedIMEISV is BIT_STRING(64)
*/ */
......
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