Commit 32c682a7 authored by Raymond Knopp's avatar Raymond Knopp

Preliminary work for integration of F1AP UE Context Setup Request/Response

- Encoding of UE Context Setup Request is failing. Problem seems to be with SST encoding
parent 763f0341
......@@ -316,7 +316,7 @@ typedef struct f1ap_up_tnl_s {
} f1ap_up_tnl_t;
typedef struct f1ap_drb_to_be_setup_s {
uint8_t drb_id;
long drb_id;
f1ap_up_tnl_t up_ul_tnl[2];
uint8_t up_ul_tnl_length;
rlc_mode_t rlc_mode;
......
......@@ -98,11 +98,11 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(f1ap_ue_context_setup_req->mcc,
f1ap_ue_context_setup_req->mnc,
f1ap_ue_context_setup_req->mnc_digit_length,
MCC_MNC_TO_PLMNID(f1ap_du_data_from_du->mcc[0],//f1ap_ue_context_setup_req->mcc,
f1ap_du_data_from_du->mnc[0],//f1ap_ue_context_setup_req->mnc,
f1ap_du_data_from_du->mnc_digit_length[0],//f1ap_ue_context_setup_req->mnc_digit_length,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_ue_context_setup_req->nr_cellid, &nRCGI.nRCellIdentity);
NR_CELL_ID_TO_BIT_STRING(f1ap_du_data_from_du->nr_cellid[0], &nRCGI.nRCellIdentity);
ie->value.choice.NRCGI = nRCGI;
......@@ -153,9 +153,10 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
if (0) {
//if (0) {
/* mandatory */
/* c7. Candidate_SpCell_List */
if (0) {
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Candidate_SpCell_List; //90
ie->criticality = F1AP_Criticality_ignore;
......@@ -192,6 +193,7 @@ if (0) {
candidate_spCell_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* optional */
/* c8. DRXCycle */
......@@ -240,6 +242,7 @@ if (0) {
/* mandatory */
/* c10. SCell_ToBeSetup_List */
if(0){
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_SCell_ToBeSetup_List;
ie->criticality = F1AP_Criticality_ignore;
......@@ -286,6 +289,7 @@ if (0) {
scell_toBeSetup_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* mandatory */
......@@ -296,7 +300,7 @@ if (0) {
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_SRBs_ToBeSetup_List;
for (i=0;
i<0;
i<1;
i++) {
//
F1AP_SRBs_ToBeSetup_ItemIEs_t *srbs_toBeSetup_item_ies;
......@@ -314,10 +318,11 @@ if (0) {
/* OPTIONAL */
/* 11.1.2 duplicationIndication */
if (0) {
//if (0) {
srbs_toBeSetup_item.duplicationIndication = (F1AP_DuplicationIndication_t *)calloc(1, sizeof(F1AP_DuplicationIndication_t));
srbs_toBeSetup_item.duplicationIndication = F1AP_DuplicationIndication_true; // enum
}
//}
/* ADD */
srbs_toBeSetup_item_ies->value.choice.SRBs_ToBeSetup_Item = srbs_toBeSetup_item;
......@@ -333,6 +338,7 @@ if (0) {
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_DRBs_ToBeSetup_List;
LOG_I(F1AP, "Length of drbs_to_be_setup: %d \n", f1ap_ue_context_setup_req->drbs_to_be_setup_length);
for (i = 0; i < f1ap_ue_context_setup_req->drbs_to_be_setup_length; i++) {
//
F1AP_DRBs_ToBeSetup_ItemIEs_t *drbs_toBeSetup_item_ies;
......@@ -349,7 +355,7 @@ if (0) {
drbs_toBeSetup_item.dRBID = f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id; // 9
/* 12.1.2 qoSInformation */
int some_decide_qos = 1; // BK: Need Check
int some_decide_qos = 0; // BK: Need Check
if (some_decide_qos) {
drbs_toBeSetup_item.qoSInformation.present = F1AP_QoSInformation_PR_eUTRANQoS;
......@@ -710,7 +716,7 @@ if (0) {
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
//}
/* OPTIONAL */
/* InactivityMonitoringRequest */
if (0) {
......@@ -743,6 +749,7 @@ if (0) {
/* OPTIONAL */
/* RRCContainer */
if(f1ap_ue_context_setup_req->rrc_container_length > 0){
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
ie->criticality = F1AP_Criticality_reject;
......@@ -750,6 +757,7 @@ if (0) {
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_ue_context_setup_req->rrc_container,
f1ap_ue_context_setup_req->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
/* OPTIONAL */
/* MaskedIMEISV */
......@@ -762,6 +770,7 @@ if (0) {
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
//xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, &pdu); //(void *)pdu
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT SETUP REQUEST\n");
......
......@@ -1280,7 +1280,7 @@ rrc_gNB_process_RRCReconfigurationComplete(
NR_SRB_ToAddModList_t *SRB_configList = ue_context_pP->ue_context.SRB_configList2[xid];
NR_DRB_ToReleaseList_t *DRB_Release_configList2 = ue_context_pP->ue_context.DRB_Release_configList2[xid];
NR_DRB_Identity_t *drb_id_p = NULL;
// uint8_t nr_DRB2LCHAN[8];
// uint8_t nr_DRB2LCHAN[8];
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
ue_context_pP->ue_context.ue_reestablishment_timer = 0;
......@@ -1340,6 +1340,31 @@ rrc_gNB_process_RRCReconfigurationComplete(
ue_context_pP->ue_context.masterCellGroup->rlc_BearerToAddModList,
NULL);
}
else {
/*gtpv1u_gnb_create_tunnel_req_t create_tunnel_req;
gtpv1u_gnb_create_tunnel_resp_t create_tunnel_resp;
memset(&create_tunnel_req, 0, sizeof(gtpv1u_gnb_create_tunnel_req_t));
create_tunnel_req.upf_NGu_teid[0] = 1;*/
if(DRB_configList!=NULL){
MessageDef *message_p;
message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_SETUP_REQ);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup = malloc(DRB_configList->list.count*sizeof(f1ap_drb_to_be_setup_t));
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup_length = DRB_configList->list.count;
LOG_I(RRC, "Length of DRB list:%d, %d \n", DRB_configList->list.count, F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup_length);
for (int i = 0; i < DRB_configList->list.count; i++){
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup[i].drb_id = DRB_configList->list.array[i]->drb_Identity;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup[i].rlc_mode = RLC_MODE_AM;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup[i].up_ul_tnl[0].gtp_teid = 1;
memcpy(&F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup[i].up_ul_tnl[0].tl_address,rrc->eth_params_s.my_addr,4);
F1AP_UE_CONTEXT_SETUP_REQ (message_p).drbs_to_be_setup[i].up_ul_tnl_length = 1;
}
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_CU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).gNB_DU_ue_id = 0;
F1AP_UE_CONTEXT_SETUP_REQ (message_p).rnti = ue_context_pP->ue_context.rnti;
itti_send_msg_to_task (TASK_CU_F1, ctxt_pP->module_id, message_p);
LOG_I(RRC, "Send F1AP_UE_CONTEXT_SETUP_REQ with ITTI\n");
}
}
#endif
/* Set the SRB active in UE context */
......
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