Commit 6a076c84 authored by Robert Schmidt's avatar Robert Schmidt

F1 UE Context Modif Req: Implement DRB Release

- Add necessary fields to F1 message
- Add F1AP encoding/decoding of UE Ctxt Modif Req DRB Release
parent c4f3d6d7
...@@ -301,6 +301,10 @@ typedef struct f1ap_rb_failed_to_be_setup_s { ...@@ -301,6 +301,10 @@ typedef struct f1ap_rb_failed_to_be_setup_s {
long rb_id; long rb_id;
} f1ap_rb_failed_to_be_setup_t; } f1ap_rb_failed_to_be_setup_t;
typedef struct f1ap_drb_to_be_released_t {
long rb_id;
} f1ap_drb_to_be_released_t;
typedef struct cu_to_du_rrc_information_s { typedef struct cu_to_du_rrc_information_s {
uint8_t * cG_ConfigInfo; uint8_t * cG_ConfigInfo;
uint32_t cG_ConfigInfo_length; uint32_t cG_ConfigInfo_length;
...@@ -354,6 +358,8 @@ typedef struct f1ap_ue_context_setup_s { ...@@ -354,6 +358,8 @@ typedef struct f1ap_ue_context_setup_s {
f1ap_srb_to_be_setup_t *srbs_to_be_setup; f1ap_srb_to_be_setup_t *srbs_to_be_setup;
uint8_t srbs_to_be_setup_length; uint8_t srbs_to_be_setup_length;
uint8_t srbs_failed_to_be_setup_length; uint8_t srbs_failed_to_be_setup_length;
uint8_t drbs_to_be_released_length;
f1ap_drb_to_be_released_t *drbs_to_be_released;
f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup; f1ap_rb_failed_to_be_setup_t *srbs_failed_to_be_setup;
ReconfigurationCompl_t ReconfigComplOutcome; ReconfigurationCompl_t ReconfigComplOutcome;
uint8_t *rrc_container; uint8_t *rrc_container;
......
...@@ -1531,14 +1531,14 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -1531,14 +1531,14 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
} }
/* optional */ /* optional */
if(0){ if (f1ap_ue_context_modification_req->drbs_to_be_released_length > 0) {
/* c15. DRBs_ToBeReleased_List */ /* c15. DRBs_ToBeReleased_List */
asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie15); asn1cSequenceAdd(out->protocolIEs.list, F1AP_UEContextModificationRequestIEs_t, ie15);
ie15->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List; ie15->id = F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List;
ie15->criticality = F1AP_Criticality_reject; ie15->criticality = F1AP_Criticality_reject;
ie15->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List; ie15->value.present = F1AP_UEContextModificationRequestIEs__value_PR_DRBs_ToBeReleased_List;
for (int i=0; i<1; i++) { for (int i = 0; i < f1ap_ue_context_modification_req->drbs_to_be_released_length; i++) {
// //
asn1cSequenceAdd(ie15->value.choice.DRBs_ToBeReleased_List.list, asn1cSequenceAdd(ie15->value.choice.DRBs_ToBeReleased_List.list,
F1AP_DRBs_ToBeReleased_ItemIEs_t, drbs_toBeReleased_item_ies); F1AP_DRBs_ToBeReleased_ItemIEs_t, drbs_toBeReleased_item_ies);
...@@ -1549,7 +1549,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -1549,7 +1549,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
F1AP_DRBs_ToBeReleased_Item_t *drbs_toBeReleased_item= F1AP_DRBs_ToBeReleased_Item_t *drbs_toBeReleased_item=
&drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item; &drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item;
/* dRBID */ /* dRBID */
drbs_toBeReleased_item->dRBID = 30L; drbs_toBeReleased_item->dRBID = f1ap_ue_context_modification_req->drbs_to_be_released[i].rb_id;
} }
} }
......
...@@ -881,6 +881,23 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t ...@@ -881,6 +881,23 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t
} }
} }
} }
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextModificationRequestIEs_t, ieDrb, container,
F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_List, false);
if (ieDrb != NULL) {
f1ap_ue_context_modification_req->drbs_to_be_released_length = ieDrb->value.choice.DRBs_ToBeReleased_List.list.count;
f1ap_ue_context_modification_req->drbs_to_be_released =
calloc(f1ap_ue_context_modification_req->drbs_to_be_released_length, sizeof(f1ap_drb_to_be_released_t));
AssertFatal(f1ap_ue_context_modification_req->drbs_to_be_released,
"could not allocate memory for f1ap_ue_context_released_req->drbs_to_be_released\n");
for (i = 0; i < f1ap_ue_context_modification_req->drbs_to_be_released_length; ++i) {
F1AP_DRBs_ToBeReleased_ItemIEs_t *tbrel = (F1AP_DRBs_ToBeReleased_ItemIEs_t *)ieDrb->value.choice.DRBs_ToBeReleased_List.list.array[i];
DevAssert(tbrel->id == F1AP_ProtocolIE_ID_id_DRBs_ToBeReleased_Item);
DevAssert(tbrel->value.present == F1AP_DRBs_ToBeReleased_ItemIEs__value_PR_DRBs_ToBeReleased_Item);
f1ap_ue_context_modification_req->drbs_to_be_released[i].rb_id = tbrel->value.choice.DRBs_ToBeReleased_Item.dRBID;
}
}
/* RRC Reconfiguration Complete indicator */ /* RRC Reconfiguration Complete indicator */
F1AP_UEContextModificationRequestIEs_t *ieReconf; F1AP_UEContextModificationRequestIEs_t *ieReconf;
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextModificationRequestIEs_t, ieReconf, container, F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextModificationRequestIEs_t, ieReconf, container,
......
...@@ -94,6 +94,13 @@ static void ue_context_modification_request_f1ap(const f1ap_ue_context_modif_req ...@@ -94,6 +94,13 @@ static void ue_context_modification_request_f1ap(const f1ap_ue_context_modif_req
AssertFatal(f1ap_msg->srbs_to_be_setup != NULL, "out of memory\n"); AssertFatal(f1ap_msg->srbs_to_be_setup != NULL, "out of memory\n");
memcpy(f1ap_msg->srbs_to_be_setup, req->srbs_to_be_setup, n * sizeof(*f1ap_msg->srbs_to_be_setup)); memcpy(f1ap_msg->srbs_to_be_setup, req->srbs_to_be_setup, n * sizeof(*f1ap_msg->srbs_to_be_setup));
} }
if (req->drbs_to_be_released_length > 0) {
int n = req->drbs_to_be_released_length;
f1ap_msg->drbs_to_be_released_length = n;
f1ap_msg->drbs_to_be_released = calloc(n, sizeof(*f1ap_msg->drbs_to_be_released));
AssertFatal(f1ap_msg->drbs_to_be_released != NULL, "out of memory\n");
memcpy(f1ap_msg->drbs_to_be_released, req->drbs_to_be_released, n * sizeof(*f1ap_msg->drbs_to_be_released));
}
if (req->rrc_container_length > 0) { if (req->rrc_container_length > 0) {
f1ap_msg->rrc_container = calloc(req->rrc_container_length, sizeof(*f1ap_msg->rrc_container)); f1ap_msg->rrc_container = calloc(req->rrc_container_length, sizeof(*f1ap_msg->rrc_container));
AssertFatal(f1ap_msg->rrc_container != NULL, "out of memory\n"); AssertFatal(f1ap_msg->rrc_container != NULL, "out of memory\n");
......
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