Commit 24884bfb authored by Bing-Kai Hong's avatar Bing-Kai Hong

Update complete elements with ue context setup request

parent 144a0a37
...@@ -247,6 +247,7 @@ typedef struct f1ap_initial_ul_rrc_message_s { ...@@ -247,6 +247,7 @@ typedef struct f1ap_initial_ul_rrc_message_s {
typedef struct f1ap_ul_rrc_message_s { typedef struct f1ap_ul_rrc_message_s {
uint32_t gNB_CU_ue_id; uint32_t gNB_CU_ue_id;
uint32_t gNB_DU_ue_id; uint32_t gNB_DU_ue_id;
uint16_t rnti;
uint8_t srb_id; uint8_t srb_id;
uint8_t *rrc_container; uint8_t *rrc_container;
int rrc_container_length; int rrc_container_length;
...@@ -265,18 +266,25 @@ typedef struct f1ap_drb_to_be_setup_s { ...@@ -265,18 +266,25 @@ typedef struct f1ap_drb_to_be_setup_s {
} f1ap_drb_to_be_setup_t; } f1ap_drb_to_be_setup_t;
typedef struct f1ap_ue_context_setup_req_s { typedef struct f1ap_ue_context_setup_req_s {
uint32_t gNB_CU_ue_id; uint32_t gNB_CU_ue_id; // BK: need to replace by use from rnti
uint32_t *gNB_DU_ue_id; uint32_t *gNB_DU_ue_id;
uint16_t rnti;
// SpCell Info // SpCell Info
uint16_t mcc; uint16_t mcc;
uint16_t mnc; uint16_t mnc;
uint8_t mnc_digit_length; uint8_t mnc_digit_length;
uint64_t nr_cellid; uint64_t nr_cellid;
uint8_t servCellIndex;
uint8_t cellULConfigured;
uint32_t servCellId; uint32_t servCellId;
uint8_t *cu_to_du_rrc_information; uint8_t *cu_to_du_rrc_information;
uint8_t cu_to_du_rrc_information_length; uint8_t cu_to_du_rrc_information_length;
f1ap_drb_to_be_setup_t *drbs_to_be_setup; f1ap_drb_to_be_setup_t *drbs_to_be_setup; // BK: need to replace by s1ap_initial_context_setup_req
uint8_t drbs_to_be_setup_length; uint8_t drbs_to_be_setup_length; // BK: need to replace by s1ap_initial_context_setup_req
s1ap_initial_context_setup_req_t *s1ap_initial_context_setup_req;
// coniatner for the rrc_eNB_generate_SecurityModeCommand message
uint8_t *rrc_container;
int rrc_container_length;
} f1ap_ue_context_setup_req_t; } f1ap_ue_context_setup_req_t;
#endif /* F1AP_MESSAGES_TYPES_H_ */ #endif /* F1AP_MESSAGES_TYPES_H_ */
...@@ -56,10 +56,13 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -56,10 +56,13 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
container = &pdu->choice.initiatingMessage->value.choice.UEContextSetupRequest; container = &pdu->choice.initiatingMessage->value.choice.UEContextSetupRequest;
/* GNB_CU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true); F1AP_ProtocolIE_ID_id_gNB_CU_UE_F1AP_ID, true);
f1ap_ue_context_setup_req->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID; f1ap_ue_context_setup_req->gNB_CU_ue_id = ie->value.choice.GNB_CU_UE_F1AP_ID;
/* optional */
/* GNB_DU_UE_F1AP_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, false); F1AP_ProtocolIE_ID_id_gNB_DU_UE_F1AP_ID, false);
if (ie) { if (ie) {
...@@ -70,6 +73,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -70,6 +73,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->gNB_DU_ue_id = NULL; f1ap_ue_context_setup_req->gNB_DU_ue_id = NULL;
} }
/* SpCell_ID */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SpCell_ID, true); F1AP_ProtocolIE_ID_id_SpCell_ID, true);
PLMNID_TO_MCC_MNC(&ie->value.choice.NRCGI.pLMN_Identity, PLMNID_TO_MCC_MNC(&ie->value.choice.NRCGI.pLMN_Identity,
...@@ -78,15 +82,42 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -78,15 +82,42 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->mnc_digit_length); f1ap_ue_context_setup_req->mnc_digit_length);
BIT_STRING_TO_NR_CELL_IDENTITY(&ie->value.choice.NRCGI.nRCellIdentity, f1ap_ue_context_setup_req->nr_cellid); BIT_STRING_TO_NR_CELL_IDENTITY(&ie->value.choice.NRCGI.nRCellIdentity, f1ap_ue_context_setup_req->nr_cellid);
/* TODO: decode candidate SpCell */
/* TODO: decode CUtoDURRCInformation */ /* ServCellIndex */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_ServCellndex, true);
f1ap_ue_context_setup_req->servCellIndex = ie->value.choice.ServCellIndex;
/* optional */
/* CellULConfigured */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
F1AP_ProtocolIE_ID_id_SpCellULConfigured, false); // SpCellULConfigured
if (ie) {
f1ap_ue_context_setup_req->cellULConfigured = malloc(sizeof(uint32_t));
if (f1ap_ue_context_setup_req->cellULConfigured)
f1ap_ue_context_setup_req->cellULConfigured = ie->value.choice.CellULConfigured;
} else {
f1ap_ue_context_setup_req->cellULConfigured = NULL;
}
/* CUtoDURRCInformation */
/* Candidate_SpCell_List */
/* optional */
/* DRXCycle */
/* optional */
/* ResourceCoordinationTransferContainer */
/* TODO: Candidate_SpCell_List */ /* SCell_ToBeSetup_List */
/* TODO: SCell_ToBeSetup_List */ /* SRBs_ToBeSetup_List */
/* TODO: SRBs_ToBeSetup_List */ /* DRBs_ToBeSetup_List */
/* Decode DRBs_ToBeSetup_List */ /* Decode DRBs_ToBeSetup_List */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include "f1ap_du_interface_management.h" #include "f1ap_du_interface_management.h"
#include "f1ap_cu_rrc_message_transfer.h" #include "f1ap_cu_rrc_message_transfer.h"
#include "f1ap_du_rrc_message_transfer.h" #include "f1ap_du_rrc_message_transfer.h"
#include "f1ap_cu_ue_context_management.h"
#include "f1ap_du_ue_context_management.h"
extern f1ap_setup_req_t *f1ap_du_data_from_du; extern f1ap_setup_req_t *f1ap_du_data_from_du;
...@@ -49,7 +51,7 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = { ...@@ -49,7 +51,7 @@ f1ap_message_decoded_callback f1ap_messages_callback[][3] = {
{ 0, 0, 0 }, /* ErrorIndication */ { 0, 0, 0 }, /* ErrorIndication */
{ 0, 0, 0 }, /* gNBDUConfigurationUpdate */ { 0, 0, 0 }, /* gNBDUConfigurationUpdate */
{ 0, 0, 0 }, /* gNBCUConfigurationUpdate */ { 0, 0, 0 }, /* gNBCUConfigurationUpdate */
{ 0, 0, 0 }, /* UEContextSetup */ { DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0 }, /* UEContextSetup */
{ 0, 0, 0 }, /* UEContextRelease */ { 0, 0, 0 }, /* UEContextRelease */
{ 0, 0, 0 }, /* UEContextModification */ { 0, 0, 0 }, /* UEContextModification */
{ 0, 0, 0 }, /* UEContextModificationRequired */ { 0, 0, 0 }, /* UEContextModificationRequired */
......
...@@ -283,7 +283,7 @@ do { \ ...@@ -283,7 +283,7 @@ do { \
} while(0) } while(0)
/* TS 38.473 v15.1.1 section 9.3.2.3: /* TS 38.473 v15.2.1 section 9.3.2.3:
* TRANSPORT LAYER ADDRESS for IPv4 is 32bit (TS 38.414) * TRANSPORT LAYER ADDRESS for IPv4 is 32bit (TS 38.414)
*/ */
#define TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(mACRO, bITsTRING) \ #define TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(mACRO, bITsTRING) \
...@@ -323,6 +323,38 @@ do { \ ...@@ -323,6 +323,38 @@ do { \
(bITsTRING)->bits_unused = 4; \ (bITsTRING)->bits_unused = 4; \
} while(0) } while(0)
/* TS 38.473 v15.2.1 section 9.3.1.55:
* MaskedIMEISV is BIT_STRING(64)
*/
#define MaskedIMEISV_TO_BIT_STRING(mACRO, bITsTRING) \
do { \
(bITsTRING)->buf = calloc(8, sizeof(uint8_t)); \
(bITsTRING)->buf[0] = (mACRO) >> 56 & 0xFF; \
(bITsTRING)->buf[1] = (mACRO) >> 48 & 0xFF; \
(bITsTRING)->buf[2] = (mACRO) >> 40 & 0xFF; \
(bITsTRING)->buf[3] = (mACRO) >> 32 & 0xFF; \
(bITsTRING)->buf[4] = (mACRO) >> 24 & 0xFF; \
(bITsTRING)->buf[5] = (mACRO) >> 16 & 0xFF; \
(bITsTRING)->buf[6] = (mACRO) >> 8 & 0xFF; \
(bITsTRING)->buf[7] = (mACRO) >> 4 & 0xFF; \
(bITsTRING)->size = 8; \
(bITsTRING)->bits_unused = 0; \
} while(0)
#define BIT_STRING_TO_MaskedIMEISV(bITsTRING, mACRO) \
do { \
DevCheck((bITsTRING)->size == 8, (bITsTRING)->size, 8, 0); \
DevCheck((bITsTRING)->bits_unused == 0, (bITsTRING)->bits_unused, 0, 0); \
mACRO = ((bITsTRING)->buf[0] << 56) + \
((bITsTRING)->buf[1] << 48) + \
((bITsTRING)->buf[2] << 40) + \
((bITsTRING)->buf[3] << 32) + \
((bITsTRING)->buf[4] << 24) + \
((bITsTRING)->buf[5] << 16) + \
((bITsTRING)->buf[6] << 8) + \
((bITsTRING)->buf[7]); \
} while (0)
/* TS 36.413 v10.9.0 section 9.2.1.37: /* TS 36.413 v10.9.0 section 9.2.1.37:
* Macro eNB ID: * Macro eNB ID:
* Equal to the 20 leftmost bits of the Cell * Equal to the 20 leftmost bits of the Cell
......
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