Commit 4c2bfe7a authored by Robert Schmidt's avatar Robert Schmidt

F1AP: send() functions take assoc_id

To allow to send F1 messages to multiple DUs from the CU, we need to
send these messages via different assoc_id (SCTP association ID,
basically akin to a file descriptor). Currently, the assoc_id is stored
in a context at the F1 module and retrieved in
f1ap_itti_send_sctp_data_req().

To facilitate a later change towards indicating (from the RRC) to which
assoc_id (hence, DU) to send a message, we refactor all
CU_send_*()/DU_send_*() functions to take the assoc_id as a parameter to
which to send messages. In this commit, we then pass the assoc_id from
the context. A later commit changes this (at the CU) to pass the
assoc_id from the message to be sent.
parent 474c3507
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
#include "f1ap_itti_messaging.h" #include "f1ap_itti_messaging.h"
#include "f1ap_cu_interface_management.h" #include "f1ap_cu_interface_management.h"
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) { int CU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset)
{
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -49,11 +50,11 @@ int CU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, ...@@ -49,11 +50,11 @@ int CU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream,
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge) { int CU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge)
{
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
/* /*
Error Indication Error Indication
*/ */
...@@ -62,7 +63,7 @@ int CU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint3 ...@@ -62,7 +63,7 @@ int CU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint3
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorIndication) { int CU_send_ERROR_INDICATION(sctp_assoc_t assoc_id, F1AP_ErrorIndication_t *ErrorIndication) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -198,7 +199,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3 ...@@ -198,7 +199,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3
if (req->num_cells_available > 0) { if (req->num_cells_available > 0) {
itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p); itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p);
} else { } else {
CU_send_F1_SETUP_FAILURE(instance); CU_send_F1_SETUP_FAILURE(assoc_id);
itti_free(TASK_CU_F1,message_p); itti_free(TASK_CU_F1,message_p);
return -1; return -1;
} }
...@@ -206,7 +207,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3 ...@@ -206,7 +207,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint3
return 0; return 0;
} }
int CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp) int CU_send_F1_SETUP_RESPONSE(sctp_assoc_t assoc_id, f1ap_setup_resp_t *f1ap_setup_resp)
{ {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
...@@ -304,11 +305,12 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup ...@@ -304,11 +305,12 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup
} }
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
int CU_send_F1_SETUP_FAILURE(instance_t instance) { int CU_send_F1_SETUP_FAILURE(sctp_assoc_t assoc_id)
{
LOG_D(F1AP, "CU_send_F1_SETUP_FAILURE\n"); LOG_D(F1AP, "CU_send_F1_SETUP_FAILURE\n");
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
...@@ -371,7 +373,7 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) { ...@@ -371,7 +373,7 @@ int CU_send_F1_SETUP_FAILURE(instance_t instance) {
} }
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -384,12 +386,12 @@ int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso ...@@ -384,12 +386,12 @@ int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, int CU_send_gNB_DU_CONFIGURATION_FAILURE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) { F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) { F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -398,8 +400,8 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -398,8 +400,8 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
gNB-CU Configuration Update gNB-CU Configuration Update
*/ */
//void CU_send_gNB_CU_CONFIGURATION_UPDATE(F1AP_GNBCUConfigurationUpdate_t *GNBCUConfigurationUpdate) { int CU_send_gNB_CU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update)
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update) { {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer; uint8_t *buffer;
uint32_t len; uint32_t len;
...@@ -485,7 +487,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu ...@@ -485,7 +487,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-CU CONFIGURATION UPDATE : "); LOG_DUMPMSG(F1AP, LOG_DUMP_CHAR, buffer, len, "F1AP gNB-CU CONFIGURATION UPDATE : ");
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -511,7 +513,7 @@ int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, ...@@ -511,7 +513,7 @@ int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
AssertFatal(0, "Not implemented yet\n"); AssertFatal(0, "Not implemented yet\n");
} }
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance, int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(sctp_assoc_t assoc_id,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) { F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse) {
AssertFatal(0, "Not implemented yet\n"); AssertFatal(0, "Not implemented yet\n");
} }
...@@ -36,41 +36,41 @@ ...@@ -36,41 +36,41 @@
/* /*
* Reset * Reset
*/ */
int CU_send_RESET(instance_t instance, F1AP_Reset_t *Reset); int CU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset);
int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_RESET_ACKKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_RESET_ACKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge); int CU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge);
/* /*
* Error Indication * Error Indication
*/ */
int CU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_ERROR_INDICATION(instance_t instance, F1AP_ErrorIndication_t *ErrorIndication); int CU_send_ERROR_INDICATION(sctp_assoc_t assoc_id, F1AP_ErrorIndication_t *ErrorIndication);
/* /*
* F1 Setup * F1 Setup
*/ */
int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_F1_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_F1_SETUP_RESPONSE(instance_t instance, f1ap_setup_resp_t *f1ap_setup_resp); int CU_send_F1_SETUP_RESPONSE(sctp_assoc_t assoc_id, f1ap_setup_resp_t *f1ap_setup_resp);
int CU_send_F1_SETUP_FAILURE(instance_t instance); int CU_send_F1_SETUP_FAILURE(sctp_assoc_t assoc_id);
/* /*
* gNB-DU Configuration Update * gNB-DU Configuration Update
*/ */
int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, int CU_send_gNB_DU_CONFIGURATION_FAILURE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure); F1AP_GNBDUConfigurationUpdateFailure_t *GNBDUConfigurationUpdateFailure);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id,
F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge); F1AP_GNBDUConfigurationUpdateAcknowledge_t *GNBDUConfigurationUpdateAcknowledge);
/* /*
* gNB-CU Configuration Update * gNB-CU Configuration Update
*/ */
int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update); int CU_send_gNB_CU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_gnb_cu_configuration_update_t *f1ap_gnb_cu_configuration_update);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
sctp_assoc_t assoc_id, sctp_assoc_t assoc_id,
uint32_t stream, uint32_t stream,
...@@ -89,7 +89,7 @@ int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, ...@@ -89,7 +89,7 @@ int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
uint32_t stream, uint32_t stream,
F1AP_F1AP_PDU_t *pdu); F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance, int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(sctp_assoc_t assoc_id,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse); F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */ #endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
...@@ -37,7 +37,8 @@ ...@@ -37,7 +37,8 @@
extern f1ap_setup_req_t *f1ap_du_data_from_du; extern f1ap_setup_req_t *f1ap_du_data_from_du;
int CU_send_Paging(instance_t instance, f1ap_paging_ind_t *paging) { int CU_send_Paging(sctp_assoc_t assoc_id, f1ap_paging_ind_t *paging)
{
F1AP_F1AP_PDU_t pdu = {0}; F1AP_F1AP_PDU_t pdu = {0};
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage; pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
...@@ -114,6 +115,6 @@ int CU_send_Paging(instance_t instance, f1ap_paging_ind_t *paging) { ...@@ -114,6 +115,6 @@ int CU_send_Paging(instance_t instance, f1ap_paging_ind_t *paging) {
return -1; return -1;
} }
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -32,5 +32,5 @@ ...@@ -32,5 +32,5 @@
#ifndef F1AP_CU_PAGING_H_ #ifndef F1AP_CU_PAGING_H_
#define F1AP_CU_PAGING_H_ #define F1AP_CU_PAGING_H_
int CU_send_Paging(instance_t instance, f1ap_paging_ind_t *paging); int CU_send_Paging(sctp_assoc_t assoc_id, f1ap_paging_ind_t *paging);
#endif /* F1AP_DU_PAGING_H_ */ #endif /* F1AP_DU_PAGING_H_ */
...@@ -107,9 +107,8 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t ...@@ -107,9 +107,8 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t
/* /*
DL RRC Message Transfer. DL RRC Message Transfer.
*/ */
//void CU_send_DL_RRC_MESSAGE_TRANSFER(F1AP_DLRRCMessageTransfer_t *DLRRCMessageTransfer) { int CU_send_DL_RRC_MESSAGE_TRANSFER(sctp_assoc_t assoc_id, f1ap_dl_rrc_message_t *f1ap_dl_rrc)
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance, {
f1ap_dl_rrc_message_t *f1ap_dl_rrc) {
LOG_D(F1AP, "CU send DL_RRC_MESSAGE_TRANSFER \n"); LOG_D(F1AP, "CU send DL_RRC_MESSAGE_TRANSFER \n");
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_DLRRCMessageTransfer_t *out; F1AP_DLRRCMessageTransfer_t *out;
...@@ -207,7 +206,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance, ...@@ -207,7 +206,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance, f1ap_dl_rrc_message_t *f1ap_dl_rrc); int CU_send_DL_RRC_MESSAGE_TRANSFER(sctp_assoc_t assoc_id, f1ap_dl_rrc_message_t *f1ap_dl_rrc);
int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
......
...@@ -145,8 +145,9 @@ void *F1AP_CU_task(void *arg) { ...@@ -145,8 +145,9 @@ void *F1AP_CU_task(void *arg) {
while (1) { while (1) {
itti_receive_msg(TASK_CU_F1, &received_msg); itti_receive_msg(TASK_CU_F1, &received_msg);
LOG_D(F1AP, "CU Task Received %s for instance %ld\n", sctp_assoc_t assoc_id = getCxt(0) != NULL ? getCxt(0)->assoc_id : 0;
ITTI_MSG_NAME(received_msg), ITTI_MSG_DESTINATION_INSTANCE(received_msg)); LOG_D(F1AP, "CU Task Received %s for instance %ld: sending SCTP message via assoc_id %d\n",
ITTI_MSG_NAME(received_msg), ITTI_MSG_DESTINATION_INSTANCE(received_msg), assoc_id);
switch (ITTI_MSG_ID(received_msg)) { switch (ITTI_MSG_ID(received_msg)) {
case SCTP_NEW_ASSOCIATION_IND: case SCTP_NEW_ASSOCIATION_IND:
cu_task_handle_sctp_association_ind(ITTI_MSG_ORIGIN_INSTANCE(received_msg), cu_task_handle_sctp_association_ind(ITTI_MSG_ORIGIN_INSTANCE(received_msg),
...@@ -165,48 +166,48 @@ void *F1AP_CU_task(void *arg) { ...@@ -165,48 +166,48 @@ void *F1AP_CU_task(void *arg) {
break; break;
case F1AP_SETUP_RESP: // from rrc case F1AP_SETUP_RESP: // from rrc
CU_send_F1_SETUP_RESPONSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_F1_SETUP_RESPONSE(assoc_id,
&F1AP_SETUP_RESP(received_msg)); &F1AP_SETUP_RESP(received_msg));
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc case F1AP_GNB_CU_CONFIGURATION_UPDATE: // from rrc
CU_send_gNB_CU_CONFIGURATION_UPDATE(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_gNB_CU_CONFIGURATION_UPDATE(assoc_id,
&F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg)); &F1AP_GNB_CU_CONFIGURATION_UPDATE(received_msg));
break; break;
case F1AP_DL_RRC_MESSAGE: // from rrc case F1AP_DL_RRC_MESSAGE: // from rrc
CU_send_DL_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_DL_RRC_MESSAGE_TRANSFER(assoc_id,
&F1AP_DL_RRC_MESSAGE(received_msg)); &F1AP_DL_RRC_MESSAGE(received_msg));
free(F1AP_DL_RRC_MESSAGE(received_msg).rrc_container); free(F1AP_DL_RRC_MESSAGE(received_msg).rrc_container);
break; break;
case F1AP_UE_CONTEXT_SETUP_REQ: // from rrc case F1AP_UE_CONTEXT_SETUP_REQ: // from rrc
CU_send_UE_CONTEXT_SETUP_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_UE_CONTEXT_SETUP_REQUEST(assoc_id,
&F1AP_UE_CONTEXT_SETUP_REQ(received_msg)); &F1AP_UE_CONTEXT_SETUP_REQ(received_msg));
break; break;
case F1AP_UE_CONTEXT_MODIFICATION_REQ: case F1AP_UE_CONTEXT_MODIFICATION_REQ:
CU_send_UE_CONTEXT_MODIFICATION_REQUEST(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_UE_CONTEXT_MODIFICATION_REQUEST(assoc_id,
&F1AP_UE_CONTEXT_MODIFICATION_REQ(received_msg)); &F1AP_UE_CONTEXT_MODIFICATION_REQ(received_msg));
break; break;
case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc case F1AP_UE_CONTEXT_RELEASE_CMD: // from rrc
CU_send_UE_CONTEXT_RELEASE_COMMAND(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_UE_CONTEXT_RELEASE_COMMAND(assoc_id,
&F1AP_UE_CONTEXT_RELEASE_CMD(received_msg)); &F1AP_UE_CONTEXT_RELEASE_CMD(received_msg));
break; break;
case F1AP_PAGING_IND: case F1AP_PAGING_IND:
CU_send_Paging(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_Paging(assoc_id,
&F1AP_PAGING_IND(received_msg)); &F1AP_PAGING_IND(received_msg));
break; break;
case F1AP_UE_CONTEXT_MODIFICATION_CONFIRM: case F1AP_UE_CONTEXT_MODIFICATION_CONFIRM:
CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(assoc_id,
&F1AP_UE_CONTEXT_MODIFICATION_CONFIRM(received_msg)); &F1AP_UE_CONTEXT_MODIFICATION_CONFIRM(received_msg));
break; break;
case F1AP_UE_CONTEXT_MODIFICATION_REFUSE: case F1AP_UE_CONTEXT_MODIFICATION_REFUSE:
CU_send_UE_CONTEXT_MODIFICATION_REFUSE(ITTI_MSG_DESTINATION_INSTANCE(received_msg), CU_send_UE_CONTEXT_MODIFICATION_REFUSE(assoc_id,
&F1AP_UE_CONTEXT_MODIFICATION_REFUSE(received_msg)); &F1AP_UE_CONTEXT_MODIFICATION_REFUSE(received_msg));
break; break;
......
...@@ -65,8 +65,8 @@ static void setQos(F1AP_NonDynamic5QIDescriptor_t *toFill) { ...@@ -65,8 +65,8 @@ static void setQos(F1AP_NonDynamic5QIDescriptor_t *toFill) {
} }
} }
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setup_t *f1ap_ue_context_setup_req)
f1ap_ue_context_setup_t *f1ap_ue_context_setup_req) { {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
/* Create */ /* Create */
/* 0. Message Type */ /* 0. Message Type */
...@@ -509,7 +509,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -509,7 +509,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
/*Use a dummy teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU*/ /*Use a dummy teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU*/
/* Use a dummy address and teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU */ /* Use a dummy address and teid for the outgoing GTP-U tunnel (DU) which will be updated once we get the UE context setup response from the DU */
transport_layer_addr_t addr = { .length= 32, .buffer= { 0 } }; transport_layer_addr_t addr = { .length= 32, .buffer= { 0 } };
f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid = newGtpuCreateTunnel(getCxt(instance)->gtpInst, f1ap_ue_context_setup_req->drbs_to_be_setup[i].up_ul_tnl[j].teid = newGtpuCreateTunnel(getCxt(0)->gtpInst,
f1ap_ue_context_setup_req->gNB_CU_ue_id, f1ap_ue_context_setup_req->gNB_CU_ue_id,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id, f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id, f1ap_ue_context_setup_req->drbs_to_be_setup[i].drb_id,
...@@ -628,7 +628,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, ...@@ -628,7 +628,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
// return -1; // return -1;
// } // }
LOG_D(F1AP,"F1AP UEContextSetupRequest Encoded %u bits\n", len); LOG_D(F1AP,"F1AP UEContextSetupRequest Encoded %u bits\n", len);
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -825,9 +825,8 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, sctp_assoc_t assoc ...@@ -825,9 +825,8 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, sctp_assoc_t assoc
return 0; return 0;
} }
int CU_send_UE_CONTEXT_RELEASE_COMMAND(sctp_assoc_t assoc_id, f1ap_ue_context_release_cmd_t *cmd)
int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, {
f1ap_ue_context_release_cmd_t *cmd) {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_UEContextReleaseCommand_t *out; F1AP_UEContextReleaseCommand_t *out;
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
...@@ -912,7 +911,7 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, ...@@ -912,7 +911,7 @@ int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -951,7 +950,7 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, sctp_assoc_t asso ...@@ -951,7 +950,7 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, sctp_assoc_t asso
return 0; return 0;
} }
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context_modif_req_t *f1ap_ue_context_modification_req) int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_modif_req_t *f1ap_ue_context_modification_req)
{ {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_UEContextModificationRequest_t *out; F1AP_UEContextModificationRequest_t *out;
...@@ -1555,7 +1554,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -1555,7 +1554,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
&drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item; &drbs_toBeReleased_item_ies->value.choice.DRBs_ToBeReleased_Item;
/* dRBID */ /* dRBID */
drbs_toBeReleased_item->dRBID = f1ap_ue_context_modification_req->drbs_to_be_released[i].rb_id; drbs_toBeReleased_item->dRBID = f1ap_ue_context_modification_req->drbs_to_be_released[i].rb_id;
newGtpuDeleteOneTunnel(getCxt(instance)->gtpInst, newGtpuDeleteOneTunnel(getCxt(0)->gtpInst,
f1ap_ue_context_modification_req->gNB_CU_ue_id, f1ap_ue_context_modification_req->gNB_CU_ue_id,
f1ap_ue_context_modification_req->drbs_to_be_released[i].rb_id); f1ap_ue_context_modification_req->drbs_to_be_released[i].rb_id);
} }
...@@ -1566,7 +1565,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context ...@@ -1566,7 +1565,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context
LOG_E(F1AP, "Failed to encode F1 UE CONTEXT_MODIFICATION REQUEST\n"); LOG_E(F1AP, "Failed to encode F1 UE CONTEXT_MODIFICATION REQUEST\n");
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -1833,7 +1832,7 @@ int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, sctp_assoc_t ...@@ -1833,7 +1832,7 @@ int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, sctp_assoc_t
return 0; return 0;
} }
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, f1ap_ue_context_modif_confirm_t *confirm) int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(sctp_assoc_t assoc_id, f1ap_ue_context_modif_confirm_t *confirm)
{ {
F1AP_F1AP_PDU_t pdu = {0}; F1AP_F1AP_PDU_t pdu = {0};
pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome; pdu.present = F1AP_F1AP_PDU_PR_successfulOutcome;
...@@ -1891,11 +1890,11 @@ int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, f1ap_ue_context ...@@ -1891,11 +1890,11 @@ int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, f1ap_ue_context
LOG_E(F1AP, "Failed to encode F1 UE Context Modification Confirm\n"); LOG_E(F1AP, "Failed to encode F1 UE Context Modification Confirm\n");
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
int CU_send_UE_CONTEXT_MODIFICATION_REFUSE(instance_t instance, f1ap_ue_context_modif_refuse_t *refuse) int CU_send_UE_CONTEXT_MODIFICATION_REFUSE(sctp_assoc_t assoc_id, f1ap_ue_context_modif_refuse_t *refuse)
{ {
F1AP_F1AP_PDU_t pdu = {0}; F1AP_F1AP_PDU_t pdu = {0};
pdu.present = F1AP_F1AP_PDU_PR_unsuccessfulOutcome; pdu.present = F1AP_F1AP_PDU_PR_unsuccessfulOutcome;
...@@ -1958,6 +1957,6 @@ int CU_send_UE_CONTEXT_MODIFICATION_REFUSE(instance_t instance, f1ap_ue_context_ ...@@ -1958,6 +1957,6 @@ int CU_send_UE_CONTEXT_MODIFICATION_REFUSE(instance_t instance, f1ap_ue_context_
LOG_E(F1AP, "Failed to encode F1 UE Context Modification Refuse\n"); LOG_E(F1AP, "Failed to encode F1 UE Context Modification Refuse\n");
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
/* /*
* UE Context Setup * UE Context Setup
*/ */
int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance, int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id,
f1ap_ue_context_setup_t *f1ap_ue_context_setup_req); f1ap_ue_context_setup_t *f1ap_ue_context_setup_req);
int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
...@@ -51,7 +51,7 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, sctp_assoc_t assoc ...@@ -51,7 +51,7 @@ int CU_handle_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, sctp_assoc_t assoc
/* /*
* UE Context Release (gNB-CU initiated) * UE Context Release (gNB-CU initiated)
*/ */
int CU_send_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, int CU_send_UE_CONTEXT_RELEASE_COMMAND(sctp_assoc_t assoc_id,
f1ap_ue_context_release_cmd_t *cmd); f1ap_ue_context_release_cmd_t *cmd);
int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
...@@ -59,7 +59,7 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, sctp_assoc_t asso ...@@ -59,7 +59,7 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, sctp_assoc_t asso
/* /*
* UE Context Modification (gNB-CU initiated) * UE Context Modification (gNB-CU initiated)
*/ */
int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, f1ap_ue_context_modif_req_t *f1ap_ue_context_modification_req); int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_modif_req_t *f1ap_ue_context_modification_req);
int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
...@@ -68,9 +68,9 @@ int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance, sctp_assoc_t ...@@ -68,9 +68,9 @@ int CU_handle_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance, sctp_assoc_t
*/ */
int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int CU_handle_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, f1ap_ue_context_modif_confirm_t *confirm); int CU_send_UE_CONTEXT_MODIFICATION_CONFIRM(sctp_assoc_t assoc_id, f1ap_ue_context_modif_confirm_t *confirm);
int CU_send_UE_CONTEXT_MODIFICATION_REFUSE(instance_t instance, f1ap_ue_context_modif_refuse_t *refuse); int CU_send_UE_CONTEXT_MODIFICATION_REFUSE(sctp_assoc_t assoc_id, f1ap_ue_context_modif_refuse_t *refuse);
/* /*
* UE Inactivity Notification * UE Inactivity Notification
......
...@@ -55,11 +55,12 @@ int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, ...@@ -55,11 +55,12 @@ int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream,
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int DU_send_RESET_ACKKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge) { int DU_send_RESET_ACKKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int DU_send_RESET(instance_t instance, F1AP_Reset_t *Reset) { int DU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset)
{
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -72,7 +73,8 @@ int DU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint ...@@ -72,7 +73,8 @@ int DU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint
Error Indication Error Indication
*/ */
int DU_send_ERROR_INDICATION(instance_t instance, F1AP_F1AP_PDU_t *pdu_p) { int DU_send_ERROR_INDICATION(sctp_assoc_t assoc_id, F1AP_F1AP_PDU_t *pdu_p)
{
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
...@@ -86,7 +88,7 @@ int DU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint3 ...@@ -86,7 +88,7 @@ int DU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint3
*/ */
// SETUP REQUEST // SETUP REQUEST
int DU_send_F1_SETUP_REQUEST(instance_t instance, f1ap_setup_req_t *setup_req) int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_setup_req_t *setup_req)
{ {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer; uint8_t *buffer;
...@@ -298,7 +300,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance, f1ap_setup_req_t *setup_req) ...@@ -298,7 +300,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance, f1ap_setup_req_t *setup_req)
} }
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -494,10 +496,8 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3 ...@@ -494,10 +496,8 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3
gNB-DU Configuration Update gNB-DU Configuration Update
*/ */
//void DU_send_gNB_DU_CONFIGURATION_UPDATE(F1AP_GNBDUConfigurationUpdate_t *GNBDUConfigurationUpdate) { int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_setup_req_t *f1ap_setup_req)
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, {
instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_setup_req) {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
uint32_t len=0; uint32_t len=0;
...@@ -893,14 +893,16 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso ...@@ -893,14 +893,16 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t asso
return 0; return 0;
} }
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id,
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) { f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure) {
AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n", AssertFatal(1==0,"received gNB CU CONFIGURATION UPDATE FAILURE with cause %d\n",
GNBCUConfigurationUpdateFailure->cause); GNBCUConfigurationUpdateFailure->cause);
} }
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge) { sctp_assoc_t assoc_id,
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge)
{
AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0, AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0,
"%d cells failed to activate\n", "%d cells failed to activate\n",
GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated); GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated);
...@@ -939,13 +941,13 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -939,13 +941,13 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
} }
ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu); ASN_STRUCT_RESET(asn_DEF_F1AP_F1AP_PDU, &pdu);
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(sctp_assoc_t assoc_id,
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest)
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest) { {
AssertFatal(0, "Not implemented yet\n"); AssertFatal(0, "Not implemented yet\n");
} }
......
...@@ -37,20 +37,20 @@ ...@@ -37,20 +37,20 @@
* Reset * Reset
*/ */
int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_send_RESET_ACKKNOWLEDGE(instance_t instance, F1AP_ResetAcknowledge_t *ResetAcknowledge); int DU_send_RESET_ACKKNOWLEDGE(sctp_assoc_t assoc_id, F1AP_ResetAcknowledge_t *ResetAcknowledge);
int DU_send_RESET(instance_t instance, F1AP_Reset_t *Reset); int DU_send_RESET(sctp_assoc_t assoc_id, F1AP_Reset_t *Reset);
int DU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_RESET_ACKNOWLEDGE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
/* /*
* Error Indication * Error Indication
*/ */
int DU_send_ERROR_INDICATION(instance_t instance, F1AP_F1AP_PDU_t *pdu_p); int DU_send_ERROR_INDICATION(sctp_assoc_t assoc_id, F1AP_F1AP_PDU_t *pdu_p);
int DU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_ERROR_INDICATION(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
/* /*
* F1 Setup * F1 Setup
*/ */
int DU_send_F1_SETUP_REQUEST(instance_t instance, f1ap_setup_req_t *setup_req); int DU_send_F1_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_setup_req_t *setup_req);
int DU_handle_F1_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_F1_SETUP_RESPONSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
...@@ -59,8 +59,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3 ...@@ -59,8 +59,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3
/* /*
* gNB-DU Configuration Update * gNB-DU Configuration Update
*/ */
int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance, int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id,
instance_t du_mod_idP,
f1ap_setup_req_t *f1ap_du_data); f1ap_setup_req_t *f1ap_du_data);
int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_gNB_DU_CONFIGURATION_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
...@@ -75,10 +74,10 @@ int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -75,10 +74,10 @@ int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
*/ */
int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id,
f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure); f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id,
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge); f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
...@@ -86,7 +85,7 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance, ...@@ -86,7 +85,7 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
/* /*
* gNB-DU Resource Coordination * gNB-DU Resource Coordination
*/ */
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance, int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(sctp_assoc_t assoc_id,
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest); F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance, int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
......
...@@ -141,7 +141,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id ...@@ -141,7 +141,7 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id
} }
/* UL RRC Message Transfer */ /* UL RRC Message Transfer */
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP, const f1ap_initial_ul_rrc_message_t *msg) int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(sctp_assoc_t assoc_id, const f1ap_initial_ul_rrc_message_t *msg)
{ {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_InitialULRRCMessageTransfer_t *out; F1AP_InitialULRRCMessageTransfer_t *out;
...@@ -170,7 +170,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP, const f1ap_ini ...@@ -170,7 +170,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP, const f1ap_ini
ie2->criticality = F1AP_Criticality_reject; ie2->criticality = F1AP_Criticality_reject;
ie2->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI; ie2->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_NRCGI;
//Fixme: takes always the first cell //Fixme: takes always the first cell
addnRCGI(ie2->value.choice.NRCGI, &getCxt(instanceP)->setupReq.cell[0].info); addnRCGI(ie2->value.choice.NRCGI, &getCxt(0)->setupReq.cell[0].info);
/* mandatory */ /* mandatory */
/* c3. C_RNTI */ // 16 /* c3. C_RNTI */ // 16
asn1cSequenceAdd(out->protocolIEs.list, F1AP_InitialULRRCMessageTransferIEs_t, ie3); asn1cSequenceAdd(out->protocolIEs.list, F1AP_InitialULRRCMessageTransferIEs_t, ie3);
...@@ -211,20 +211,18 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP, const f1ap_ini ...@@ -211,20 +211,18 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP, const f1ap_ini
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instanceP, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg) int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(sctp_assoc_t assoc_id, const f1ap_ul_rrc_message_t *msg)
{ {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_ULRRCMessageTransfer_t *out; F1AP_ULRRCMessageTransfer_t *out;
uint8_t *buffer = NULL; uint8_t *buffer = NULL;
uint32_t len; uint32_t len;
LOG_D(F1AP, LOG_D(F1AP,
"[DU %ld] %s: size %d UE RNTI %x in SRB %d\n", "size %d UE RNTI %x in SRB %d\n",
instance,
__func__,
msg->rrc_container_length, msg->rrc_container_length,
msg->gNB_DU_ue_id, msg->gNB_DU_ue_id,
msg->srb_id); msg->srb_id);
...@@ -277,6 +275,6 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_me ...@@ -277,6 +275,6 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_me
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance, const f1ap_ul_rrc_message_t *msg); int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(sctp_assoc_t assoc_id, const f1ap_ul_rrc_message_t *msg);
int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instanceP, const f1ap_initial_ul_rrc_message_t *msg); int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(sctp_assoc_t assoc_id, const f1ap_initial_ul_rrc_message_t *msg);
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */ #endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
...@@ -80,7 +80,7 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat ...@@ -80,7 +80,7 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams; f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams; f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
/* setup parameters for F1U and start the server */ /* setup parameters for F1U and start the server */
DU_send_F1_SETUP_REQUEST(instance, &f1ap_du_data->setupReq); DU_send_F1_SETUP_REQUEST(f1ap_du_data->assoc_id, &f1ap_du_data->setupReq);
} }
void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) { void du_task_handle_sctp_data_ind(instance_t instance, sctp_data_ind_t *sctp_data_ind) {
...@@ -102,8 +102,8 @@ void *F1AP_DU_task(void *arg) { ...@@ -102,8 +102,8 @@ void *F1AP_DU_task(void *arg) {
MessageDef *msg = NULL; MessageDef *msg = NULL;
itti_receive_msg(TASK_DU_F1, &msg); itti_receive_msg(TASK_DU_F1, &msg);
instance_t myInstance=ITTI_MSG_DESTINATION_INSTANCE(msg); instance_t myInstance=ITTI_MSG_DESTINATION_INSTANCE(msg);
LOG_D(F1AP, "DU Task Received %s for instance %ld\n", sctp_assoc_t assoc_id = getCxt(0) != NULL ? getCxt(0)->assoc_id : 0;
ITTI_MSG_NAME(msg),myInstance); LOG_D(F1AP, "DU Task Received %s for instance %ld: sending SCTP messages via assoc_id %d\n", ITTI_MSG_NAME(msg), myInstance, assoc_id);
switch (ITTI_MSG_ID(msg)) { switch (ITTI_MSG_ID(msg)) {
case F1AP_SETUP_REQ: case F1AP_SETUP_REQ:
AssertFatal(false, "the F1AP_SETUP_REQ should not be received; use the F1AP_DU_REGISTER_REQ instead\n"); AssertFatal(false, "the F1AP_SETUP_REQ should not be received; use the F1AP_DU_REGISTER_REQ instead\n");
...@@ -121,12 +121,12 @@ void *F1AP_DU_task(void *arg) { ...@@ -121,12 +121,12 @@ void *F1AP_DU_task(void *arg) {
} break; } break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE: case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_ORIGIN_INSTANCE(msg), DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(assoc_id,
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg)); &F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg));
break; break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE: case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE:
DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(myInstance, DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(assoc_id,
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(msg)); &F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(msg));
break; break;
...@@ -144,34 +144,32 @@ void *F1AP_DU_task(void *arg) { ...@@ -144,34 +144,32 @@ void *F1AP_DU_task(void *arg) {
break; break;
case F1AP_INITIAL_UL_RRC_MESSAGE: // from rrc case F1AP_INITIAL_UL_RRC_MESSAGE: // from rrc
{ DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(assoc_id, &F1AP_INITIAL_UL_RRC_MESSAGE(msg));
f1ap_initial_ul_rrc_message_t *msgRrc = &F1AP_INITIAL_UL_RRC_MESSAGE(msg); break;
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(myInstance, msgRrc);
} break;
case F1AP_UL_RRC_MESSAGE: // to rrc case F1AP_UL_RRC_MESSAGE: // to rrc
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(myInstance, &F1AP_UL_RRC_MESSAGE(msg)); DU_send_UL_NR_RRC_MESSAGE_TRANSFER(assoc_id, &F1AP_UL_RRC_MESSAGE(msg));
break; break;
case F1AP_UE_CONTEXT_SETUP_RESP: case F1AP_UE_CONTEXT_SETUP_RESP:
DU_send_UE_CONTEXT_SETUP_RESPONSE(myInstance, &F1AP_UE_CONTEXT_SETUP_RESP(msg)); DU_send_UE_CONTEXT_SETUP_RESPONSE(assoc_id, &F1AP_UE_CONTEXT_SETUP_RESP(msg));
break; break;
case F1AP_UE_CONTEXT_MODIFICATION_RESP: case F1AP_UE_CONTEXT_MODIFICATION_RESP:
DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(myInstance, &F1AP_UE_CONTEXT_MODIFICATION_RESP(msg)); DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(assoc_id, &F1AP_UE_CONTEXT_MODIFICATION_RESP(msg));
break; break;
case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC case F1AP_UE_CONTEXT_RELEASE_REQ: // from MAC
DU_send_UE_CONTEXT_RELEASE_REQUEST(myInstance, DU_send_UE_CONTEXT_RELEASE_REQUEST(assoc_id,
&F1AP_UE_CONTEXT_RELEASE_REQ(msg)); &F1AP_UE_CONTEXT_RELEASE_REQ(msg));
break; break;
case F1AP_UE_CONTEXT_RELEASE_COMPLETE: case F1AP_UE_CONTEXT_RELEASE_COMPLETE:
DU_send_UE_CONTEXT_RELEASE_COMPLETE(myInstance, &F1AP_UE_CONTEXT_RELEASE_COMPLETE(msg)); DU_send_UE_CONTEXT_RELEASE_COMPLETE(assoc_id, &F1AP_UE_CONTEXT_RELEASE_COMPLETE(msg));
break; break;
case F1AP_UE_CONTEXT_MODIFICATION_REQUIRED: case F1AP_UE_CONTEXT_MODIFICATION_REQUIRED:
DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(myInstance, &F1AP_UE_CONTEXT_MODIFICATION_REQUIRED(msg)); DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(assoc_id, &F1AP_UE_CONTEXT_MODIFICATION_REQUIRED(msg));
break; break;
case TERMINATE_MESSAGE: case TERMINATE_MESSAGE:
......
...@@ -205,7 +205,8 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_i ...@@ -205,7 +205,8 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_i
return 0; return 0;
} }
int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup_t *resp) { int DU_send_UE_CONTEXT_SETUP_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_context_setup_t *resp)
{
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_UEContextSetupResponse_t *out; F1AP_UEContextSetupResponse_t *out;
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
...@@ -329,7 +330,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup ...@@ -329,7 +330,7 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,gTPTunnel); asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,gTPTunnel);
/* transportLayerAddress */ /* transportLayerAddress */
struct sockaddr_in addr= {0}; struct sockaddr_in addr= {0};
inet_pton(AF_INET, getCxt(instance)->net_config.DU_f1_ip_address.ipv4_address, &addr.sin_addr.s_addr); inet_pton(AF_INET, getCxt(0)->net_config.DU_f1_ip_address.ipv4_address, &addr.sin_addr.s_addr);
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(addr.sin_addr.s_addr, TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(addr.sin_addr.s_addr,
&gTPTunnel->transportLayerAddress); &gTPTunnel->transportLayerAddress);
/* gTP_TEID */ /* gTP_TEID */
...@@ -542,15 +543,17 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup ...@@ -542,15 +543,17 @@ int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
int DU_send_UE_CONTEXT_SETUP_FAILURE(instance_t instance) { int DU_send_UE_CONTEXT_SETUP_FAILURE(sctp_assoc_t assoc_id)
{
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
f1ap_ue_context_release_req_t *req) { int DU_send_UE_CONTEXT_RELEASE_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_release_req_t *req)
{
F1AP_F1AP_PDU_t pdu; F1AP_F1AP_PDU_t pdu;
F1AP_UEContextReleaseRequest_t *out; F1AP_UEContextReleaseRequest_t *out;
uint8_t *buffer=NULL; uint8_t *buffer=NULL;
...@@ -617,7 +620,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, ...@@ -617,7 +620,7 @@ int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance,
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -681,7 +684,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, sctp_assoc_t assoc ...@@ -681,7 +684,7 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, sctp_assoc_t assoc
return 0; return 0;
} }
int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, f1ap_ue_context_release_complete_t *complete) int DU_send_UE_CONTEXT_RELEASE_COMPLETE(sctp_assoc_t assoc_id, f1ap_ue_context_release_complete_t *complete)
{ {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_UEContextReleaseComplete_t *out; F1AP_UEContextReleaseComplete_t *out;
...@@ -764,7 +767,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, f1ap_ue_context_rel ...@@ -764,7 +767,7 @@ int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, f1ap_ue_context_rel
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
...@@ -965,8 +968,7 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t ...@@ -965,8 +968,7 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t
return 0; return 0;
} }
//void DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(F1AP_UEContextModificationResponse_t *UEContextModificationResponse) { int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_context_modif_resp_t *resp)
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_context_modif_resp_t *resp)
{ {
F1AP_F1AP_PDU_t pdu= {0}; F1AP_F1AP_PDU_t pdu= {0};
F1AP_UEContextModificationResponse_t *out; F1AP_UEContextModificationResponse_t *out;
...@@ -1058,7 +1060,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex ...@@ -1058,7 +1060,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex
transport_layer_addr_t tl_addr = {0}; transport_layer_addr_t tl_addr = {0};
memcpy(tl_addr.buffer, &drb->up_ul_tnl[0].tl_address, sizeof(drb->up_ul_tnl[0].tl_address)); memcpy(tl_addr.buffer, &drb->up_ul_tnl[0].tl_address, sizeof(drb->up_ul_tnl[0].tl_address));
tl_addr.length = sizeof(drb->up_ul_tnl[0].tl_address) * 8; tl_addr.length = sizeof(drb->up_ul_tnl[0].tl_address) * 8;
drb->up_dl_tnl[j].teid = newGtpuCreateTunnel(getCxt(instance)->gtpInst, drb->up_dl_tnl[j].teid = newGtpuCreateTunnel(getCxt(0)->gtpInst,
resp->gNB_DU_ue_id, resp->gNB_DU_ue_id,
drb->drb_id, drb->drb_id,
drb->drb_id, drb->drb_id,
...@@ -1077,7 +1079,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex ...@@ -1077,7 +1079,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,gTPTunnel); asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel,gTPTunnel);
/* transportLayerAddress */ /* transportLayerAddress */
struct sockaddr_in addr= {0}; struct sockaddr_in addr= {0};
inet_pton(AF_INET, getCxt(instance)->net_config.DU_f1_ip_address.ipv4_address, &addr.sin_addr.s_addr); inet_pton(AF_INET, getCxt(0)->net_config.DU_f1_ip_address.ipv4_address, &addr.sin_addr.s_addr);
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(addr.sin_addr.s_addr, TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(addr.sin_addr.s_addr,
&gTPTunnel->transportLayerAddress); &gTPTunnel->transportLayerAddress);
/* gTP_TEID */ /* gTP_TEID */
...@@ -1115,7 +1117,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex ...@@ -1115,7 +1117,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex
asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel, gTPTunnel); asn1cCalloc(dLUPTNLInformation_ToBeSetup_Item->dLUPTNLInformation.choice.gTPTunnel, gTPTunnel);
/* transportLayerAddress */ /* transportLayerAddress */
struct sockaddr_in addr= {0}; struct sockaddr_in addr= {0};
inet_pton(AF_INET, getCxt(instance)->net_config.DU_f1_ip_address.ipv4_address, &addr.sin_addr.s_addr); inet_pton(AF_INET, getCxt(0)->net_config.DU_f1_ip_address.ipv4_address, &addr.sin_addr.s_addr);
TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(addr.sin_addr.s_addr, &gTPTunnel->transportLayerAddress); TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(addr.sin_addr.s_addr, &gTPTunnel->transportLayerAddress);
/* gTP_TEID */ /* gTP_TEID */
INT32_TO_OCTET_STRING(resp->drbs_to_be_modified[i].up_dl_tnl[j].teid, &gTPTunnel->gTP_TEID); INT32_TO_OCTET_STRING(resp->drbs_to_be_modified[i].up_dl_tnl[j].teid, &gTPTunnel->gTP_TEID);
...@@ -1190,7 +1192,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex ...@@ -1190,7 +1192,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex
/* 8.1 SCell_ToBeSetup_Item */ /* 8.1 SCell_ToBeSetup_Item */
F1AP_SCell_FailedtoSetupMod_Item_t *scell_failedtoSetupMod_item=&scell_failedtoSetupMod_item_ies->value.choice.SCell_FailedtoSetupMod_Item; F1AP_SCell_FailedtoSetupMod_Item_t *scell_failedtoSetupMod_item=&scell_failedtoSetupMod_item_ies->value.choice.SCell_FailedtoSetupMod_Item;
/* - sCell_ID */ /* - sCell_ID */
addnRCGI(scell_failedtoSetupMod_item->sCell_ID, &getCxt(instance)->setupReq.cell[i].info); addnRCGI(scell_failedtoSetupMod_item->sCell_ID, &getCxt(0)->setupReq.cell[i].info);
asn1cCalloc(scell_failedtoSetupMod_item->cause, tmp); asn1cCalloc(scell_failedtoSetupMod_item->cause, tmp);
tmp->present = F1AP_Cause_PR_radioNetwork; tmp->present = F1AP_Cause_PR_radioNetwork;
tmp->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id; tmp->choice.radioNetwork = F1AP_CauseRadioNetwork_unknown_or_already_allocated_gnb_du_ue_f1ap_id;
...@@ -1299,15 +1301,15 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex ...@@ -1299,15 +1301,15 @@ int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_contex
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance) { int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(sctp_assoc_t assoc_id) {
AssertFatal(1==0,"Not implemented yet\n"); AssertFatal(1==0,"Not implemented yet\n");
} }
int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, f1ap_ue_context_modif_required_t *required) int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(sctp_assoc_t assoc_id, f1ap_ue_context_modif_required_t *required)
{ {
/* 0. Message Type */ /* 0. Message Type */
F1AP_F1AP_PDU_t pdu = {0}; F1AP_F1AP_PDU_t pdu = {0};
...@@ -1423,7 +1425,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, f1ap_ue_contex ...@@ -1423,7 +1425,7 @@ int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, f1ap_ue_contex
return -1; return -1;
} }
f1ap_itti_send_sctp_data_req(instance, buffer, len); f1ap_itti_send_sctp_data_req(assoc_id, buffer, len);
return 0; return 0;
} }
......
...@@ -36,16 +36,16 @@ ...@@ -36,16 +36,16 @@
/* /*
* UE Context Setup * UE Context Setup
*/ */
int DU_send_UE_CONTEXT_SETUP_RESPONSE(instance_t instance, f1ap_ue_context_setup_t *req); int DU_send_UE_CONTEXT_SETUP_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_context_setup_t *req);
int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_SETUP_FAILURE(instance_t instance); int DU_send_UE_CONTEXT_SETUP_FAILURE(sctp_assoc_t assoc_id);
/* /*
* UE Context Release Request (gNB-DU initiated) * UE Context Release Request (gNB-DU initiated)
*/ */
int DU_send_UE_CONTEXT_RELEASE_REQUEST(instance_t instance, int DU_send_UE_CONTEXT_RELEASE_REQUEST(sctp_assoc_t assoc_id,
f1ap_ue_context_release_req_t *req); f1ap_ue_context_release_req_t *req);
...@@ -57,20 +57,20 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, sctp_assoc_t assoc ...@@ -57,20 +57,20 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance, sctp_assoc_t assoc
/* /*
* UE Context Release Complete (gNB-DU initiated) * UE Context Release Complete (gNB-DU initiated)
*/ */
int DU_send_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance, f1ap_ue_context_release_complete_t *complete); int DU_send_UE_CONTEXT_RELEASE_COMPLETE(sctp_assoc_t assoc_id, f1ap_ue_context_release_complete_t *complete);
/* /*
* UE Context Modification (gNB-CU initiated) * UE Context Modification (gNB-CU initiated)
*/ */
int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(instance_t instance, f1ap_ue_context_modif_resp_t *resp); int DU_send_UE_CONTEXT_MODIFICATION_RESPONSE(sctp_assoc_t assoc_id, f1ap_ue_context_modif_resp_t *resp);
int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(instance_t instance); int DU_send_UE_CONTEXT_MODIFICATION_FAILURE(sctp_assoc_t assoc_id);
/* /*
* UE Context Modification Required (gNB-DU initiated) * UE Context Modification Required (gNB-DU initiated)
*/ */
int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(instance_t instance, f1ap_ue_context_modif_required_t *required); int DU_send_UE_CONTEXT_MODIFICATION_REQUIRED(sctp_assoc_t assoc_id, f1ap_ue_context_modif_required_t *required);
int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_UE_CONTEXT_MODIFICATION_CONFIRM(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_handle_UE_CONTEXT_MODIFICATION_REFUSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu); int DU_handle_UE_CONTEXT_MODIFICATION_REFUSE(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
......
...@@ -22,27 +22,14 @@ ...@@ -22,27 +22,14 @@
#include "f1ap_common.h" #include "f1ap_common.h"
#include "f1ap_itti_messaging.h" #include "f1ap_itti_messaging.h"
void f1ap_itti_send_sctp_data_req(instance_t instance, uint8_t *buffer, uint32_t buffer_length) void f1ap_itti_send_sctp_data_req(sctp_assoc_t assoc_id, uint8_t *buffer, uint32_t buffer_length)
{ {
MessageDef *message_p; instance_t instance = 0; // we have only one instance
sctp_data_req_t *sctp_data_req; MessageDef *message_p = itti_alloc_new_message(TASK_CU_F1, instance, SCTP_DATA_REQ);
message_p = itti_alloc_new_message(TASK_CU_F1, 0, SCTP_DATA_REQ); sctp_data_req_t *sctp_data_req = &message_p->ittiMsg.sctp_data_req;
sctp_data_req = &message_p->ittiMsg.sctp_data_req; sctp_data_req->assoc_id = assoc_id;
sctp_data_req->assoc_id = getCxt(instance)->assoc_id; sctp_data_req->buffer = buffer;
sctp_data_req->buffer = buffer;
sctp_data_req->buffer_length = buffer_length; sctp_data_req->buffer_length = buffer_length;
sctp_data_req->stream = 0; sctp_data_req->stream = 0;
LOG_D(F1AP, "Sending ITTI message to SCTP Task\n");
itti_send_msg_to_task(TASK_SCTP, instance, message_p); itti_send_msg_to_task(TASK_SCTP, instance, message_p);
} }
void f1ap_itti_send_sctp_close_association(instance_t instance)
{
MessageDef *message_p = NULL;
sctp_close_association_t *sctp_close_association_p = NULL;
message_p = itti_alloc_new_message(TASK_S1AP, 0, SCTP_CLOSE_ASSOCIATION);
sctp_close_association_p = &message_p->ittiMsg.sctp_close_association;
sctp_close_association_p->assoc_id = getCxt(instance)->assoc_id;
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
...@@ -22,6 +22,6 @@ ...@@ -22,6 +22,6 @@
#ifndef F1AP_ITTI_MESSAGING_H_ #ifndef F1AP_ITTI_MESSAGING_H_
#define F1AP_ITTI_MESSAGING_H_ #define F1AP_ITTI_MESSAGING_H_
void f1ap_itti_send_sctp_data_req(instance_t instance, uint8_t *buffer, uint32_t buffer_length); void f1ap_itti_send_sctp_data_req(sctp_assoc_t assoc_id, uint8_t *buffer, uint32_t buffer_length);
#endif /* F1AP_ITTI_MESSAGING_H_ */ #endif /* F1AP_ITTI_MESSAGING_H_ */
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