Commit 7be2a165 authored by Jaroslava Fiedlerova's avatar Jaroslava Fiedlerova

Merge remote-tracking branch 'origin/f1ap-msg-encdec-tests' into integration_2024_w40b

parents d8a6c5c9 5daad21c
......@@ -435,20 +435,18 @@ add_library(f1ap
${F1AP_DIR}/f1ap_cu_rrc_message_transfer.c
${F1AP_DIR}/f1ap_cu_task.c
${F1AP_DIR}/f1ap_cu_ue_context_management.c
${F1AP_DIR}/f1ap_cu_warning_message_transmission.c
${F1AP_DIR}/f1ap_du_interface_management.c
${F1AP_DIR}/f1ap_du_paging.c
${F1AP_DIR}/f1ap_du_rrc_message_transfer.c
${F1AP_DIR}/f1ap_du_system_information.c
${F1AP_DIR}/f1ap_du_task.c
${F1AP_DIR}/f1ap_du_ue_context_management.c
${F1AP_DIR}/f1ap_du_warning_message_transmission.c
${F1AP_DIR}/f1ap_encoder.c
${F1AP_DIR}/f1ap_handlers.c
${F1AP_DIR}/f1ap_itti_messaging.c)
target_include_directories(f1ap PUBLIC F1AP_DIR)
target_link_libraries(f1ap PUBLIC asn1_f1ap L2_NR)
target_link_libraries(f1ap PRIVATE ngap nr_rrc HASHTABLE)
target_link_libraries(f1ap PRIVATE ngap nr_rrc HASHTABLE f1ap_lib)
target_include_directories(f1ap PRIVATE ${F1AP_DIR}/lib)
# LPP
##############
......@@ -1438,6 +1436,8 @@ add_library(L2_NR
${GNB_APP_SRC}
)
target_link_libraries(L2_NR PRIVATE ds alg)
target_link_libraries(L2_NR PRIVATE f1ap_lib)
target_include_directories(L2_NR PRIVATE ${F1AP_DIR}/lib)
add_library(e1_if
${NR_RRC_DIR}/cucp_cuup_direct.c
......
......@@ -19,13 +19,16 @@
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
#ifndef FIVEG_PLATFORM_TYPES_H__
#define FIVEG_PLATFORM_TYPES_H__
#include <stdint.h>
typedef struct nssai_s {
uint8_t sst;
uint32_t sd;
} nssai_t;
typedef enum { NON_DYNAMIC, DYNAMIC } fiveQI_t;
#endif
......@@ -55,5 +55,4 @@ typedef enum { CPtype = 0, UPtype } E1_t;
#define NODE_IS_MBMS(nOdE_TyPe) ((nOdE_TyPe) == ngran_eNB_MBMS_STA)
#define GTPV1_U_PORT_NUMBER (2152)
typedef enum { non_dynamic, dynamic } fiveQI_type_t;
#endif
......@@ -79,7 +79,7 @@ More details about the E1AP procedures in OAI are available in this document: [E
# 2. Running the E1 Split
The setup is assuming that all modules are running on the same machine. The user can refer to the [F1 design document](./../F1-design.md) for local deployment of the DU.
The setup is assuming that all modules are running on the same machine. The user can refer to the [F1 design document](./../F1AP/F1-design.md) for local deployment of the DU.
## 2.1 Configuration File
......
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">F1AP Messages Encoding & Decoding Library</font></b>
</td>
</tr>
</table>
[[_TOC_]]
# Intro
This library is for the encoding, decoding and testing of F1AP (F1 Application Protocol) messages.
# Implementation Details
The library includes the following components:
1. **Common Functions**:
This file [f1ap_lib_common.c](../../openair2/F1AP/lib/f1ap_lib_common.c) and its corresponding header contain utility functions and macros shared across different F1AP functions.
2. **Message-Specific Modules**:
Each F1AP message (e.g., DL RRC, UL RRC, etc.) has its corresponding modules and each module will include the encoder, decoder, equality check, and memory management functions specific to that message type. Specifically, the goal is to achieve the following:
* **Encoder & Decoder**: Implement encoding and decoding functions for each F1AP message. These functions will convert F1AP messages coming from upper or lower layers into an F1AP PDU to be sent over F1 interface.
* **Equality Check (eq_X)**: `eq_X()` function that compares two messages for equality. This function is useful for testing purposes, ensuring that encoded and decoded messages match.
* **Deep Copy (cp_X)**: `cp_X()` function that performs a deep copy of a message. This function is beneficial when sending ITTI messages, as it avoids manual copying.
* **Memory Management (free_X)**: `free_X()` function to release memory associated with a message. Proper memory management helps prevent memory leaks.
e.g. The following module contains functions that performs the encoding/decoding, equality check, deep copy and memory management for DL/UL RRC message transfer:
* [f1ap_rrc_message_transfer.c](../../openair2/F1AP/lib/f1ap_rrc_message_transfer.c)
# Testing
The functions in the file [f1ap_lib_common.c](../../openair2/F1AP/tests/f1ap_lib_test.c) are used to test F1AP message encoding and decoding functionalities, according to the following steps:
* call the encoder function for the message to be transferred into a F1AP PDU
* use `f1ap_encode_decode` to perform the following steps:
- Validates the input encoded PDU against constraints.
- Encodes the PDU using APER into a binary buffer.
- Decodes the binary buffer back into a PDU.
- Returns the decoded PDU.
* call the decoder function for the decoded F1AP PDU to obtain the decoded message
* call `eq_dl_rrc_message_transfer` to compare the original message with the decoded one
* call `cp_dl_rrc_message_transfer` to deep copy the original message, then compare the with the original one
* free all messages and PDUs
A flowchart for a function testing F1AP messages, such as `test_f1ap_setup_request`, would look like this:
```mermaid
flowchart TD
create[Create F1AP message]-->|f1ap_setup_req_t msg|enc[encode_f1ap_setup_request]
enc-->|F1AP_F1AP_PDU_t *f1enc|encdec[f1ap_encode_decode]
encdec-->|F1AP_F1AP_PDU_t *f1dec|dec[decode_f1ap_setup_request]
create-->|f1ap_setup_req_t msg|eq
dec-->|f1ap_setup_req_t decoded|eq[eq_f1ap_setup_request]
create-->|f1ap_setup_req_t msg|cp[cp_f1ap_setup_request]
cp-->|f1ap_setup_req_t cp|eq[eq_f1ap_setup_request]
```
......@@ -65,7 +65,7 @@ Legacy unmaintained files:
- General software architecture notes: [SW_archi.md](./SW_archi.md)
- [Information on E1](./E1AP/E1-design.md)
- [Information on F1](./F1-design.md)
- [Information on F1](./F1AP/F1-design.md)
- [Information on how NR nFAPI works](./NR_NFAPI_archi.md)
- [Flow graph of the L1 in gNB](SW-archi-graph.md)
- [L1 threads in NR-UE](./nr-ue-design.md)
......
......@@ -24,6 +24,10 @@ cmake .. -GNinja -DENABLE_TESTS=ON
ninja tests
```
The user can use either `ninja` or `make`.
# Run unit tests
Then, you can run `ctest` to run all tests:
```bash
......
......@@ -163,7 +163,7 @@ typedef struct qos_characteristics_s {
} packet_error_rate;
} dynamic;
};
fiveQI_type_t qos_type;
fiveQI_t qos_type;
} qos_characteristics_t;
typedef struct ngran_allocation_retention_priority_s {
......
......@@ -24,8 +24,7 @@
#include <netinet/in.h>
#include <netinet/sctp.h>
#include "s1ap_messages_types.h"
#include "ngap_messages_types.h"
#include "common/5g_platform_types.h"
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
......@@ -82,12 +81,12 @@
#define F1AP_MAX_NO_UE_ID 1024
#define F1AP_MAX_NO_OF_INDIVIDUAL_CONNECTIONS_TO_RESET 65536
typedef net_ip_address_t f1ap_net_ip_address_t;
/* 9.3.1.42 of 3GPP TS 38.473 - gNB-CU System Information */
#define F1AP_MAX_NO_SIB_TYPES 32
typedef struct f1ap_net_config_t {
f1ap_net_ip_address_t CU_f1_ip_address;
f1ap_net_ip_address_t DU_f1c_ip_address;
char *CU_f1_ip_address;
char *DU_f1c_ip_address;
char *DU_f1u_ip_address;
uint16_t CUport;
uint16_t DUport;
......@@ -99,6 +98,11 @@ typedef struct f1ap_plmn_t {
uint8_t mnc_digit_length;
} f1ap_plmn_t;
typedef struct f1ap_cp_tnl_s {
in_addr_t tl_address; // currently only IPv4 supported
uint16_t port;
} f1ap_cp_tnl_t;
typedef enum f1ap_mode_t { F1AP_MODE_TDD = 0, F1AP_MODE_FDD = 1 } f1ap_mode_t;
typedef struct f1ap_nr_frequency_info_t {
......@@ -179,18 +183,24 @@ typedef struct f1ap_du_register_req_t {
f1ap_net_config_t net_config;
} f1ap_du_register_req_t;
typedef struct f1ap_sib_msg_t {
/// RRC container with system information owned by gNB-CU
uint8_t *SI_container;
int SI_container_length;
/// SIB block type, e.g. 2 for sibType2
int SI_type;
} f1ap_sib_msg_t;
typedef struct served_cells_to_activate_s {
f1ap_plmn_t plmn;
// NR Global Cell Id
uint64_t nr_cellid;
/// NRPCI
/// NRPCI [int 0..1007]
uint16_t nrpci;
/// num SI messages per DU cell
uint8_t num_SI;
/// SI message containers (up to 21 messages per cell)
uint8_t *SI_container[21];
int SI_container_length[21];
int SI_type[21];
/// gNB-CU System Information message (up to 32 messages per cell)
f1ap_sib_msg_t SI_msg[F1AP_MAX_NO_SIB_TYPES];
} served_cells_to_activate_t;
typedef struct f1ap_setup_resp_s {
......@@ -208,18 +218,8 @@ typedef struct f1ap_setup_resp_s {
} f1ap_setup_resp_t;
typedef struct f1ap_gnb_cu_configuration_update_s {
/* Connexion id used between SCTP/F1AP */
uint16_t cnx_id;
/* SCTP association id */
sctp_assoc_t assoc_id;
/* Number of SCTP streams used for a mme association */
uint16_t sctp_in_streams;
uint16_t sctp_out_streams;
/// string holding gNB_CU_name
char *gNB_CU_name;
/// Transaction ID
uint64_t transaction_id;
/// number of DU cells to activate
uint16_t num_cells_to_activate; //0< num_cells_to_activate/mod <= 512;
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
......@@ -228,26 +228,37 @@ typedef struct f1ap_gnb_cu_configuration_update_s {
typedef struct f1ap_setup_failure_s {
uint16_t cause;
uint16_t time_to_wait;
uint16_t criticality_diagnostics;
uint16_t criticality_diagnostics;
/// Transaction ID (M)
uint64_t transaction_id;
} f1ap_setup_failure_t;
typedef struct f1ap_gnb_cu_configuration_update_acknowledge_s {
uint64_t transaction_id;
// Cells Failed to be Activated List
uint16_t num_cells_failed_to_be_activated;
f1ap_plmn_t plmn[F1AP_MAX_NB_CELLS];
uint64_t nr_cellid[F1AP_MAX_NB_CELLS];
uint16_t cause[F1AP_MAX_NB_CELLS];
struct {
// NR CGI
f1ap_plmn_t plmn;
uint64_t nr_cellid;
uint16_t cause;
} cells_failed_to_be_activated[F1AP_MAX_NB_CELLS];
int have_criticality;
uint16_t criticality_diagnostics;
uint16_t criticality_diagnostics;
// gNB-CU TNL Association Setup List
uint16_t noofTNLAssociations_to_setup;
uint16_t have_port[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
in_addr_t tl_address[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
f1ap_cp_tnl_t tnlAssociations_to_setup[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
// gNB-CU TNL Association Failed to Setup List
uint16_t noofTNLAssociations_failed;
in_addr_t tl_address_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS]; // currently only IPv4 supported
uint16_t cause_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
f1ap_cp_tnl_t tnlAssociations_failed[F1AP_MAX_NO_OF_TNL_ASSOCIATIONS];
// Dedicated SI Delivery Needed UE List
uint16_t noofDedicatedSIDeliveryNeededUEs;
uint32_t gNB_CU_ue_id[F1AP_MAX_NO_UE_ID];
f1ap_plmn_t ue_plmn[F1AP_MAX_NO_UE_ID];
uint64_t ue_nr_cellid[F1AP_MAX_NO_UE_ID];
struct {
uint32_t gNB_CU_ue_id;
// NR CGI
f1ap_plmn_t ue_plmn;
uint64_t ue_nr_cellid;
} dedicatedSIDeliveryNeededUEs[F1AP_MAX_NO_UE_ID];
} f1ap_gnb_cu_configuration_update_acknowledge_t;
typedef struct f1ap_gnb_cu_configuration_update_failure_s {
......@@ -285,16 +296,13 @@ typedef struct f1ap_gnb_du_configuration_update_s {
f1ap_plmn_t plmn;
uint64_t nr_cellid; // NR Global Cell Id
} cell_to_delete[F1AP_MAX_NB_CELLS];
/// string holding gNB_CU_name
/// gNB-DU unique ID, at least within a gNB-CU (0 .. 2^36 - 1)
uint64_t *gNB_DU_ID;
} f1ap_gnb_du_configuration_update_t;
typedef struct f1ap_gnb_du_configuration_update_acknowledge_s {
/// ulong transaction id
uint64_t transaction_id;
/// string holding gNB_CU_name
char *gNB_CU_name;
/// number of DU cells to activate
uint16_t num_cells_to_activate; // 0< num_cells_to_activate <= 512;
served_cells_to_activate_t cells_to_activate[F1AP_MAX_NB_CELLS];
......@@ -334,6 +342,7 @@ typedef struct f1ap_initial_ul_rrc_message_s {
int rrc_container_length;
uint8_t *du2cu_rrc_container;
int du2cu_rrc_container_length;
uint8_t transaction_id;
} f1ap_initial_ul_rrc_message_t;
typedef struct f1ap_ul_rrc_message_s {
......@@ -346,7 +355,7 @@ typedef struct f1ap_ul_rrc_message_s {
typedef struct f1ap_up_tnl_s {
in_addr_t tl_address; // currently only IPv4 supported
teid_t teid;
uint32_t teid;
uint16_t port;
} f1ap_up_tnl_t;
......@@ -376,7 +385,7 @@ typedef struct f1ap_qos_characteristics_s {
} packet_error_rate;
} dynamic;
};
fiveQI_type_t qos_type;
fiveQI_t qos_type;
} f1ap_qos_characteristics_t;
typedef struct f1ap_ngran_allocation_retention_priority_s {
......@@ -401,6 +410,7 @@ typedef struct f1ap_drb_information_s {
uint8_t flows_to_be_setup_length;
} f1ap_drb_information_t;
typedef enum f1ap_rlc_mode_t { F1AP_RLC_MODE_AM, F1AP_RLC_MODE_UM_BIDIR, F1AP_RLC_UM_UNI_UL, F1AP_RLC_UM_UNI_DL } f1ap_rlc_mode_t;
typedef struct f1ap_drb_to_be_setup_s {
long drb_id;
f1ap_up_tnl_t up_ul_tnl[2];
......@@ -408,7 +418,7 @@ typedef struct f1ap_drb_to_be_setup_s {
f1ap_up_tnl_t up_dl_tnl[2];
uint8_t up_dl_tnl_length;
f1ap_drb_information_t drb_info;
rlc_mode_t rlc_mode;
f1ap_rlc_mode_t rlc_mode;
nssai_t nssai;
} f1ap_drb_to_be_setup_t;
......
......@@ -31,8 +31,9 @@
#define NGAP_MESSAGES_TYPES_H_
#include "common/platform_constants.h"
#include "common/platform_types.h"
#include "common/ngran_types.h"
#include "common/5g_platform_types.h"
#include "LTE_asn_constant.h"
#include "s1ap_messages_types.h"
//-------------------------------------------------------------------------------------------//
// Defines to access message fields.
......@@ -196,16 +197,11 @@ typedef enum ngap_rrc_establishment_cause_e {
NGAP_RRC_CAUSE_LAST
} ngap_rrc_establishment_cause_t;
typedef struct nssai_s {
uint8_t sst;
uint32_t sd;
} nssai_t;
typedef struct pdusession_level_qos_parameter_s {
uint8_t qfi;
uint64_t fiveQI;
uint64_t qos_priority;
fiveQI_type_t fiveQI_type;
fiveQI_t fiveQI_type;
ngap_allocation_retention_priority_t allocation_retention_priority;
} pdusession_level_qos_parameter_t;
......
......@@ -686,7 +686,7 @@ static int fill_BEARER_CONTEXT_SETUP_REQUEST(e1ap_bearer_setup_req_t *const bear
ieC6_1_1_1->qoS_Flow_Identifier = k->qfi;
/* QoS Characteristics */
qos_characteristics_t *qos_char_in = &k->qos_params.qos_characteristics;
if (qos_char_in->qos_type == non_dynamic) { // non Dynamic 5QI
if (qos_char_in->qos_type == NON_DYNAMIC) { // non Dynamic 5QI
ieC6_1_1_1->qoSFlowLevelQoSParameters.qoS_Characteristics.present = E1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
asn1cCalloc(ieC6_1_1_1->qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI, non_Dynamic_5QI);
non_Dynamic_5QI->fiveQI = qos_char_in->non_dynamic.fiveqi;
......@@ -1002,12 +1002,12 @@ static void extract_BEARER_CONTEXT_SETUP_REQUEST(const E1AP_E1AP_PDU_t *pdu, e1a
qos_characteristics_t *qos_char = &qos_flow->qos_params.qos_characteristics;
if (qos2Setup->qoSFlowLevelQoSParameters.qoS_Characteristics.present == E1AP_QoS_Characteristics_PR_non_Dynamic_5QI) {
qos_char->qos_type = non_dynamic;
qos_char->qos_type = NON_DYNAMIC;
qos_char->non_dynamic.fiveqi =
qos2Setup->qoSFlowLevelQoSParameters.qoS_Characteristics.choice.non_Dynamic_5QI->fiveQI;
} else {
E1AP_Dynamic5QIDescriptor_t *dynamic5QI = qos2Setup->qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI;
qos_char->qos_type = dynamic;
qos_char->qos_type = DYNAMIC;
qos_char->dynamic.qos_priority_level = dynamic5QI->qoSPriorityLevel;
qos_char->dynamic.packet_delay_budget = dynamic5QI->packetDelayBudget;
qos_char->dynamic.packet_error_rate.per_scalar = dynamic5QI->packetErrorRate.pER_Scalar;
......
add_subdirectory(lib)
add_subdirectory(MESSAGES)
if(ENABLE_TESTS)
......@@ -5,4 +6,6 @@ if(ENABLE_TESTS)
target_link_libraries(f1ap_ids_test UTIL HASHTABLE minimal_lib)
add_dependencies(tests f1ap_ids_test)
add_test(NAME F1AP_ID_test COMMAND f1ap_ids_test)
add_subdirectory(tests)
endif()
......@@ -411,8 +411,6 @@ typedef struct f1ap_cudu_inst_s {
instance_t gtpInst;
} f1ap_cudu_inst_t;
static const int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273};
uint8_t F1AP_get_next_transaction_identifier(instance_t mod_idP, instance_t cu_mod_idP);
f1ap_cudu_inst_t *getCxt(instance_t instanceP);
......
......@@ -36,17 +36,9 @@
/*
* Reset
*/
int CU_send_RESET(sctp_assoc_t assoc_id, const f1ap_reset_t *reset);
int CU_handle_RESET_ACKNOWLEDGE(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(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack);
/*
* 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_send_ERROR_INDICATION(sctp_assoc_t assoc_id, F1AP_ErrorIndication_t *ErrorIndication);
/*
* F1 Setup
*/
......@@ -61,9 +53,6 @@ int CU_send_F1_SETUP_FAILURE(sctp_assoc_t assoc_id, const f1ap_setup_failure_t *
*/
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(sctp_assoc_t assoc_id,
f1ap_gnb_du_configuration_update_failure_t *GNBDUConfigurationUpdateFailure);
int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(
sctp_assoc_t assoc_id,
f1ap_gnb_du_configuration_update_acknowledge_t *GNBDUConfigurationUpdateAcknowledge);
......@@ -72,25 +61,10 @@ int CU_send_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(
* 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,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
/*
* gNB-DU Resource Coordination
*/
int CU_handle_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int CU_send_gNB_DU_RESOURCE_COORDINATION_RESPONSE(sctp_assoc_t assoc_id,
F1AP_GNBDUResourceCoordinationResponse_t *GNBDUResourceCoordinationResponse);
#endif /* F1AP_CU_INTERFACE_MANAGEMENT_H_ */
......@@ -44,7 +44,7 @@ static void f1ap_write_drb_qos_param(const f1ap_qos_flow_level_qos_parameters_t
int type = drb_qos_in->qos_characteristics.qos_type;
const f1ap_qos_characteristics_t *drb_qos_char_in = &drb_qos_in->qos_characteristics;
if (type == non_dynamic) {
if (type == NON_DYNAMIC) {
asn1_qosparam->qoS_Characteristics.present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
asn1cCalloc(asn1_qosparam->qoS_Characteristics.choice.non_Dynamic_5QI, tmp);
......@@ -130,7 +130,7 @@ static void f1ap_write_flows_mapped(const f1ap_flows_mapped_to_drb_t *flows_mapp
const f1ap_qos_characteristics_t *flow_qos_char_in = &flow_qos_params_in->qos_characteristics;
int type = flow_qos_params_in->qos_characteristics.qos_type;
if (type == non_dynamic) {
if (type == NON_DYNAMIC) {
QosParams->present = F1AP_QoS_Characteristics_PR_non_Dynamic_5QI;
asn1cCalloc(QosParams->choice.non_Dynamic_5QI, tmp);
......@@ -483,12 +483,15 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_context_setu
/* 12.1.4 rLCMode */
/* TODO use rlc_mode from f1ap_drb_to_be_setup */
switch (f1ap_ue_context_setup_req->drbs_to_be_setup[i].rlc_mode) {
case RLC_MODE_AM:
case F1AP_RLC_MODE_AM:
drbs_toBeSetup_item->rLCMode = F1AP_RLCMode_rlc_am;
break;
default:
case F1AP_RLC_MODE_UM_BIDIR:
drbs_toBeSetup_item->rLCMode = F1AP_RLCMode_rlc_um_bidirectional;
break;
default:
AssertFatal(false, "modes other than AM/UM-Bidir not supported\n");
break;
}
/* OPTIONAL */
......@@ -1218,12 +1221,15 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(sctp_assoc_t assoc_id, f1ap_ue_conte
/* 12.1.4 rLCMode */
/* TODO use rlc_mode from f1ap_drb_to_be_setup */
switch (f1ap_ue_context_modification_req->drbs_to_be_setup[i].rlc_mode) {
case RLC_MODE_AM:
case F1AP_RLC_MODE_AM:
drbs_toBeSetupMod_item->rLCMode = F1AP_RLCMode_rlc_am;
break;
default:
case F1AP_RLC_MODE_UM_BIDIR:
drbs_toBeSetupMod_item->rLCMode = F1AP_RLCMode_rlc_um_bidirectional;
break;
default:
AssertFatal(false, "modes other than AM/UM-Bidir not supported\n");
break;
}
/* OPTIONAL */
......
......@@ -38,14 +38,6 @@
*/
int DU_handle_RESET(instance_t instance, sctp_assoc_t assoc_id, uint32_t stream, F1AP_F1AP_PDU_t *pdu);
int DU_send_RESET_ACKNOWLEDGE(sctp_assoc_t assoc_id, const f1ap_reset_ack_t *ack);
int DU_send_RESET(sctp_assoc_t assoc_id, const 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);
/*
* Error Indication
*/
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);
/*
* F1 Setup
......@@ -59,14 +51,7 @@ int DU_handle_F1_SETUP_FAILURE(instance_t instance, sctp_assoc_t assoc_id, uint3
/*
* gNB-DU Configuration Update
*/
int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, const f1ap_gnb_du_configuration_update_t *upd);
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_UPDATE_ACKNOWLEDGE(instance_t instance,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_DU_CONFIGURATION_UPDATE(sctp_assoc_t assoc_id, f1ap_gnb_du_configuration_update_t *msg);
/*
* gNB-CU Configuration Update
......@@ -79,17 +64,9 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(sctp_assoc_t assoc_id,
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(sctp_assoc_t assoc_id,
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
/*
* gNB-DU Resource Coordination
*/
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(sctp_assoc_t assoc_id,
F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
int DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
sctp_assoc_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu);
#endif /* F1AP_DU_INTERFACE_MANAGEMENT_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
......@@ -44,7 +44,7 @@ static instance_t du_create_gtpu_instance_to_cu(const f1ap_net_config_t *nc)
{
openAddr_t tmp = {0};
strncpy(tmp.originHost, nc->DU_f1u_ip_address, sizeof(tmp.originHost) - 1);
strncpy(tmp.destinationHost, nc->CU_f1_ip_address.ipv4_address, sizeof(tmp.destinationHost) - 1);
strncpy(tmp.destinationHost, nc->CU_f1_ip_address, sizeof(tmp.destinationHost) - 1);
sprintf(tmp.originService, "%d", nc->DUport);
sprintf(tmp.destinationService, "%d", nc->CUport);
return gtpv1Init(tmp);
......@@ -63,9 +63,20 @@ void du_task_send_sctp_association_req(instance_t instance, f1ap_net_config_t *n
sctp_new_association_req_p->in_streams = 2; //du_inst->sctp_in_streams;
sctp_new_association_req_p->out_streams = 2; //du_inst->sctp_out_streams;
// remote
memcpy(&sctp_new_association_req_p->remote_address, &nc->CU_f1_ip_address, sizeof(nc->CU_f1_ip_address));
sctp_new_association_req_p->remote_address.ipv4 = 1;
strncpy(sctp_new_association_req_p->remote_address.ipv4_address,
nc->CU_f1_ip_address,
sizeof(sctp_new_association_req_p->remote_address.ipv4_address) - 1);
// local
memcpy(&sctp_new_association_req_p->local_address, &nc->DU_f1c_ip_address, sizeof(nc->DU_f1c_ip_address));
sctp_new_association_req_p->local_address.ipv4 = 1;
strncpy(sctp_new_association_req_p->local_address.ipv4_address,
nc->DU_f1c_ip_address,
sizeof(sctp_new_association_req_p->local_address.ipv4_address) - 1);
LOG_D(F1AP,
"Local IPv4 Address: %s, Remote IPv4 Address: %s\n",
sctp_new_association_req_p->local_address.ipv4_address,
sctp_new_association_req_p->remote_address.ipv4_address);
// du_f1ap_register_to_sctp
itti_send_msg_to_task(TASK_SCTP, instance, message_p);
}
......@@ -89,6 +100,8 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data->du.assoc_id = sctp_new_association_resp->assoc_id;
f1ap_du_data->sctp_in_streams = sctp_new_association_resp->in_streams;
f1ap_du_data->sctp_out_streams = sctp_new_association_resp->out_streams;
/* next transaction ID */
f1ap_du_data->setupReq.transaction_id = F1AP_get_next_transaction_identifier(0, 0);
/* setup parameters for F1U and start the server */
DU_send_F1_SETUP_REQUEST(f1ap_du_data->du.assoc_id, &f1ap_du_data->setupReq);
}
......
......@@ -45,13 +45,13 @@ static void f1ap_read_drb_qos_param(const F1AP_QoSFlowLevelQoSParameters_t *asn1
const F1AP_QoS_Characteristics_t *dRB_QoS_Char = &asn1_qos->qoS_Characteristics;
if (dRB_QoS_Char->present == F1AP_QoS_Characteristics_PR_non_Dynamic_5QI) {
drb_qos_char->qos_type = non_dynamic;
drb_qos_char->qos_type = NON_DYNAMIC;
drb_qos_char->non_dynamic.fiveqi = dRB_QoS_Char->choice.non_Dynamic_5QI->fiveQI;
drb_qos_char->non_dynamic.qos_priority_level = (dRB_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel != NULL)
? *dRB_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel
: -1;
} else {
drb_qos_char->qos_type = dynamic;
drb_qos_char->qos_type = DYNAMIC;
drb_qos_char->dynamic.fiveqi =
(dRB_QoS_Char->choice.dynamic_5QI->fiveQI != NULL) ? *dRB_QoS_Char->choice.dynamic_5QI->fiveQI : -1;
drb_qos_char->dynamic.qos_priority_level = dRB_QoS_Char->choice.dynamic_5QI->qoSPriorityLevel;
......@@ -84,13 +84,13 @@ static void f1ap_read_flows_mapped(const F1AP_Flows_Mapped_To_DRB_List_t *asn1_f
const F1AP_QoS_Characteristics_t *Flow_QoS_Char = &Flow_QoS->qoS_Characteristics;
if (Flow_QoS_Char->present == F1AP_QoS_Characteristics_PR_non_Dynamic_5QI) {
flow_qos_char->qos_type = non_dynamic;
flow_qos_char->qos_type = NON_DYNAMIC;
flow_qos_char->non_dynamic.fiveqi = Flow_QoS_Char->choice.non_Dynamic_5QI->fiveQI;
flow_qos_char->non_dynamic.qos_priority_level = (Flow_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel != NULL)
? *Flow_QoS_Char->choice.non_Dynamic_5QI->qoSPriorityLevel
: -1;
} else {
flow_qos_char->qos_type = dynamic;
flow_qos_char->qos_type = DYNAMIC;
flow_qos_char->dynamic.fiveqi =
(Flow_QoS_Char->choice.dynamic_5QI->fiveQI != NULL) ? *Flow_QoS_Char->choice.dynamic_5QI->fiveQI : -1;
flow_qos_char->dynamic.qos_priority_level = Flow_QoS_Char->choice.dynamic_5QI->qoSPriorityLevel;
......@@ -209,11 +209,14 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance, sctp_assoc_t assoc_i
switch (drbs_tobesetup_item_p->rLCMode) {
case F1AP_RLCMode_rlc_am:
drb_p->rlc_mode = RLC_MODE_AM;
drb_p->rlc_mode = F1AP_RLC_MODE_AM;
break;
case F1AP_RLCMode_rlc_um_bidirectional:
drb_p->rlc_mode = F1AP_RLC_MODE_UM_BIDIR;
break;
default:
drb_p->rlc_mode = RLC_MODE_TM;
LOG_W(F1AP, "unsupported RLC Mode %ld received: setting UM bidir\n", drbs_tobesetup_item_p->rLCMode);
drb_p->rlc_mode = F1AP_RLC_MODE_UM_BIDIR;
break;
}
......@@ -930,13 +933,16 @@ int DU_handle_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance, sctp_assoc_t
drb_p->up_ul_tnl[0].port = getCxt(instance)->net_config.CUport;
switch (drbs_tobesetupmod_item_p->rLCMode) {
case F1AP_RLCMode_rlc_am:
drb_p->rlc_mode = RLC_MODE_AM;
break;
default:
drb_p->rlc_mode = RLC_MODE_TM;
break;
case F1AP_RLCMode_rlc_am:
drb_p->rlc_mode = F1AP_RLC_MODE_AM;
break;
case F1AP_RLCMode_rlc_um_bidirectional:
drb_p->rlc_mode = F1AP_RLC_MODE_UM_BIDIR;
break;
default:
LOG_W(F1AP, "unsupported RLC Mode %ld received: setting UM bidir\n", drbs_tobesetupmod_item_p->rLCMode);
drb_p->rlc_mode = F1AP_RLC_MODE_UM_BIDIR;
break;
}
if (drbs_tobesetupmod_item_p->qoSInformation.present == F1AP_QoSInformation_PR_eUTRANQoS) {
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
......@@ -48,10 +48,8 @@ static const f1ap_message_processing_t f1ap_messages_processing[][3] = {
// {CU_handle_RESET, DU_handle_RESET_ACKNOWLEDGE, 0}, /* Reset */
{CU_handle_F1_SETUP_REQUEST, DU_handle_F1_SETUP_RESPONSE, DU_handle_F1_SETUP_FAILURE}, /* F1Setup */
{0, 0, 0}, /* ErrorIndication */
{CU_handle_gNB_DU_CONFIGURATION_UPDATE, 0, 0}, /* gNBDUConfigurationUpdate */
{DU_handle_gNB_CU_CONFIGURATION_UPDATE,
CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE,
CU_handle_gNB_CU_CONFIGURATION_UPDATE_FAILURE}, /* gNBCUConfigurationUpdate */
{CU_handle_gNB_DU_CONFIGURATION_UPDATE, DU_handle_gNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE, 0}, /* gNBDUConfigurationUpdate */
{DU_handle_gNB_CU_CONFIGURATION_UPDATE, CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE, 0}, /* gNBCUConfigurationUpdate */
{DU_handle_UE_CONTEXT_SETUP_REQUEST, CU_handle_UE_CONTEXT_SETUP_RESPONSE, 0}, /* UEContextSetup */
{DU_handle_UE_CONTEXT_RELEASE_COMMAND, CU_handle_UE_CONTEXT_RELEASE_COMPLETE, 0}, /* UEContextRelease */
{DU_handle_UE_CONTEXT_MODIFICATION_REQUEST, CU_handle_UE_CONTEXT_MODIFICATION_RESPONSE, 0}, /* UEContextModification */
......
add_library(f1ap_lib OBJECT
f1ap_lib_common.c
f1ap_rrc_message_transfer.c
f1ap_interface_management.c
)
target_link_libraries(f1ap_lib PRIVATE asn1_f1ap)
target_include_directories(f1ap_lib PUBLIC
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef F1AP_INTERFACE_MANAGEMENT_H_
#define F1AP_INTERFACE_MANAGEMENT_H_
#include <stdbool.h>
#include "f1ap_messages_types.h"
struct F1AP_F1AP_PDU;
struct F1AP_F1AP_PDU *encode_f1ap_setup_request(const f1ap_setup_req_t *msg);
bool decode_f1ap_setup_request(const struct F1AP_F1AP_PDU *pdu, f1ap_setup_req_t *out);
f1ap_setup_req_t cp_f1ap_setup_request(const f1ap_setup_req_t *msg);
bool eq_f1ap_setup_request(const f1ap_setup_req_t *a, const f1ap_setup_req_t *b);
void free_f1ap_setup_request(const f1ap_setup_req_t *msg);
/* F1 Setup Response */
struct F1AP_F1AP_PDU *encode_f1ap_setup_response(const f1ap_setup_resp_t *msg);
bool decode_f1ap_setup_response(const struct F1AP_F1AP_PDU *pdu, f1ap_setup_resp_t *out);
void free_f1ap_setup_response(const f1ap_setup_resp_t *msg);
f1ap_setup_resp_t cp_f1ap_setup_response(const f1ap_setup_resp_t *msg);
bool eq_f1ap_setup_response(const f1ap_setup_resp_t *a, const f1ap_setup_resp_t *b);
/* F1 Setup Failure */
struct F1AP_F1AP_PDU *encode_f1ap_setup_failure(const f1ap_setup_failure_t *msg);
bool decode_f1ap_setup_failure(const struct F1AP_F1AP_PDU *pdu, f1ap_setup_failure_t *out);
bool eq_f1ap_setup_failure(const f1ap_setup_failure_t *a, const f1ap_setup_failure_t *b);
f1ap_setup_failure_t cp_f1ap_setup_failure(const f1ap_setup_failure_t *msg);
/* F1 gNB-DU Configuration Update */
struct F1AP_F1AP_PDU *encode_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *msg);
bool decode_f1ap_du_configuration_update(const struct F1AP_F1AP_PDU *pdu, f1ap_gnb_du_configuration_update_t *out);
bool eq_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *a, const f1ap_gnb_du_configuration_update_t *b);
f1ap_gnb_du_configuration_update_t cp_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *msg);
void free_f1ap_du_configuration_update(const f1ap_gnb_du_configuration_update_t *msg);
/* F1 gNB-CU Configuration Update */
struct F1AP_F1AP_PDU *encode_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t *msg);
bool decode_f1ap_cu_configuration_update(const struct F1AP_F1AP_PDU *pdu, f1ap_gnb_cu_configuration_update_t *out);
bool eq_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t *a, const f1ap_gnb_cu_configuration_update_t *b);
f1ap_gnb_cu_configuration_update_t cp_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t *msg);
void free_f1ap_cu_configuration_update(const f1ap_gnb_cu_configuration_update_t *msg);
/* F1 gNB-CU Configuration Update Acknowledge */
struct F1AP_F1AP_PDU *encode_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration_update_acknowledge_t *msg);
bool decode_f1ap_cu_configuration_update_acknowledge(const struct F1AP_F1AP_PDU *pdu,
f1ap_gnb_cu_configuration_update_acknowledge_t *out);
bool eq_f1ap_cu_configuration_update_acknowledge(const f1ap_gnb_cu_configuration_update_acknowledge_t *a,
const f1ap_gnb_cu_configuration_update_acknowledge_t *b);
f1ap_gnb_cu_configuration_update_acknowledge_t cp_f1ap_cu_configuration_update_acknowledge(
const f1ap_gnb_cu_configuration_update_acknowledge_t *msg);
/* F1 gNB-DU Configuration Update Acknowledge */
struct F1AP_F1AP_PDU *encode_f1ap_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration_update_acknowledge_t *msg);
bool decode_f1ap_du_configuration_update_acknowledge(const struct F1AP_F1AP_PDU *pdu,
f1ap_gnb_du_configuration_update_acknowledge_t *out);
bool eq_f1ap_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration_update_acknowledge_t *a,
const f1ap_gnb_du_configuration_update_acknowledge_t *b);
f1ap_gnb_du_configuration_update_acknowledge_t cp_f1ap_du_configuration_update_acknowledge(
const f1ap_gnb_du_configuration_update_acknowledge_t *msg);
void free_f1ap_du_configuration_update_acknowledge(const f1ap_gnb_du_configuration_update_acknowledge_t *msg);
#endif /* F1AP_INTERFACE_MANAGEMENT_H_ */
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "f1ap_lib_common.h"
#include "f1ap_messages_types.h"
#include "OCTET_STRING.h"
#include "common/utils/utils.h"
#include "common/utils/assertions.h"
#include "common/utils/utils.h"
bool eq_f1ap_plmn(const f1ap_plmn_t *a, const f1ap_plmn_t *b)
{
_F1_EQ_CHECK_INT(a->mcc, b->mcc);
_F1_EQ_CHECK_INT(a->mnc, b->mnc);
_F1_EQ_CHECK_INT(a->mnc_digit_length, b->mnc_digit_length);
return true;
}
bool eq_f1ap_freq_info(const f1ap_nr_frequency_info_t *a, const f1ap_nr_frequency_info_t *b)
{
if (a->arfcn != b->arfcn)
return false;
if (a->band != b->band)
return false;
return true;
}
bool eq_f1ap_tx_bandwidth(const f1ap_transmission_bandwidth_t *a, const f1ap_transmission_bandwidth_t *b)
{
if (a->nrb != b->nrb)
return false;
if (a->scs != b->scs)
return false;
return true;
}
bool eq_f1ap_cell_info(const f1ap_served_cell_info_t *a, const f1ap_served_cell_info_t *b)
{
if (a->nr_cellid != b->nr_cellid)
return false;
if (a->nr_pci != b->nr_pci)
return false;
if (*a->tac != *b->tac)
return false;
if (a->mode != b->mode)
return false;
if (a->mode == F1AP_MODE_TDD) {
/* TDD */
if (!eq_f1ap_tx_bandwidth(&a->tdd.tbw, &b->tdd.tbw))
return false;
if (!eq_f1ap_freq_info(&a->tdd.freqinfo, &b->tdd.freqinfo))
return false;
} else if (a->mode == F1AP_MODE_FDD) {
/* FDD */
if (!eq_f1ap_tx_bandwidth(&a->fdd.dl_tbw, &b->fdd.dl_tbw))
return false;
if (!eq_f1ap_freq_info(&a->fdd.dl_freqinfo, &b->fdd.dl_freqinfo))
return false;
if (!eq_f1ap_tx_bandwidth(&a->fdd.ul_tbw, &b->fdd.ul_tbw))
return false;
if (!eq_f1ap_freq_info(&a->fdd.ul_freqinfo, &b->fdd.ul_freqinfo))
return false;
}
if (a->measurement_timing_config_len != b->measurement_timing_config_len)
return false;
if (*a->measurement_timing_config != *b->measurement_timing_config)
return false;
if (!eq_f1ap_plmn(&a->plmn, &b->plmn))
return false;
return true;
}
bool eq_f1ap_sys_info(const f1ap_gnb_du_system_info_t *a, const f1ap_gnb_du_system_info_t *b)
{
/* MIB */
if (a->mib_length != b->mib_length)
return false;
for (int i = 0; i < a->mib_length; i++) {
if (a->mib[i] != b->mib[i])
return false;
}
/* SIB1 */
if (a->sib1_length != b->sib1_length)
return false;
for (int i = 0; i < a->sib1_length; i++) {
if (a->sib1[i] != b->sib1[i])
return false;
}
return true;
}
uint8_t *cp_octet_string(const OCTET_STRING_t *os, int *len)
{
uint8_t *buf = calloc_or_fail(os->size, sizeof(*buf));
memcpy(buf, os->buf, os->size);
*len = os->size;
return buf;
}
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef F1AP_LIB_COMMON_H_
#define F1AP_LIB_COMMON_H_
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include "openair3/UTILS/conversions.h"
#ifdef ENABLE_TESTS
#define PRINT_ERROR(...) fprintf(stderr, ##__VA_ARGS__)
#else
#define PRINT_ERROR(...) // Do nothing
#endif
#define _F1_EQ_CHECK_GENERIC(condition, fmt, ...) \
do { \
if (!(condition)) { \
PRINT_ERROR("F1 Equality Check failure: %s:%d: Condition '%s' failed: " fmt " != " fmt "\n", \
__FILE__, \
__LINE__, \
#condition, \
##__VA_ARGS__); \
return false; \
} \
} while (0)
#define _F1_EQ_CHECK_LONG(A, B) _F1_EQ_CHECK_GENERIC(A == B, "%ld", A, B);
#define _F1_EQ_CHECK_INT(A, B) _F1_EQ_CHECK_GENERIC(A == B, "%d", A, B);
#define _F1_EQ_CHECK_STR(A, B) _F1_EQ_CHECK_GENERIC(strcmp(A, B) == 0, "'%s'", A, B);
/* macro to look up IE. If mandatory and not found, macro will print
* descriptive debug message to stderr and force exit in calling function */
#define F1AP_LIB_FIND_IE(IE_TYPE, ie, container, IE_ID, mandatory) \
do { \
ie = NULL; \
for (IE_TYPE **ptr = container->protocolIEs.list.array; \
ptr < &container->protocolIEs.list.array[container->protocolIEs.list.count]; \
ptr++) { \
if ((*ptr)->id == IE_ID) { \
ie = *ptr; \
break; \
} \
} \
if (mandatory && ie == NULL) { \
fprintf(stderr, "%s(): could not find element " #IE_ID " with type " #IE_TYPE "\n", __func__); \
return false; \
} \
} while (0)
struct f1ap_plmn_t;
bool eq_f1ap_plmn(const struct f1ap_plmn_t *a, const struct f1ap_plmn_t *b);
struct f1ap_served_cell_info_t;
bool eq_f1ap_cell_info(const struct f1ap_served_cell_info_t *a, const struct f1ap_served_cell_info_t *b);
struct f1ap_gnb_du_system_info_t;
bool eq_f1ap_sys_info(const struct f1ap_gnb_du_system_info_t *a, const struct f1ap_gnb_du_system_info_t *b);
struct f1ap_nr_frequency_info_t;
bool eq_f1ap_freq_info(const struct f1ap_nr_frequency_info_t *a, const struct f1ap_nr_frequency_info_t *b);
struct f1ap_transmission_bandwidth_t;
bool eq_f1ap_tx_bandwidth(const struct f1ap_transmission_bandwidth_t *a, const struct f1ap_transmission_bandwidth_t *b);
struct OCTET_STRING;
uint8_t *cp_octet_string(const struct OCTET_STRING *os, int *len);
#endif /* F1AP_LIB_COMMON_H_ */
......@@ -19,13 +19,9 @@
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
#ifndef F1AP_LIB_EXTERN_H_
#define F1AP_LIB_EXTERN_H_
#include "f1ap_rrc_message_transfer.h"
#endif /* F1AP_LIB_EXTERN_H_ */
......@@ -19,13 +19,26 @@
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
#ifndef F1AP_LIB_INCLUDES_H_
#define F1AP_LIB_INCLUDES_H_
#include "F1AP_F1AP-PDU.h"
#include "F1AP_InitialULRRCMessageTransfer.h"
#include "F1AP_InitiatingMessage.h"
#include "F1AP_NRCellIdentity.h"
#include "F1AP_ProtocolIE-Field.h"
#include "F1AP_ServedPLMNs-Item.h"
#include "F1AP_ProtocolExtensionContainer.h"
#include "F1AP_ProtocolExtensionField.h"
#include "F1AP_ProtocolIE-Field.h"
#include "F1AP_SliceSupportItem.h"
#include "F1AP_NR-Mode-Info.h"
#include "F1AP_GNB-DU-System-Information.h"
#include "F1AP_FDD-Info.h"
#include "F1AP_TDD-Info.h"
#include "F1AP_FreqBandNrItem.h"
#include "F1AP_SuccessfulOutcome.h"
#include "F1AP_SibtypetobeupdatedListItem.h"
#include "F1AP_UnsuccessfulOutcome.h"
#endif /* F1AP_LIB_INCLUDES_H_ */
This diff is collapsed.
......@@ -19,13 +19,32 @@
* contact@openairinterface.org
*/
/*! \file f1ap_du_interface_management.h
* \brief f1ap interface management for DU
* \author EURECOM/NTUST
* \date 2018
* \version 0.1
* \company Eurecom
* \email: navid.nikaein@eurecom.fr, bing-kai.hong@eurecom.fr
* \note
* \warning
*/
\ No newline at end of file
#ifndef F1AP_RRC_MESSAGE_TRANSFER_H_
#define F1AP_RRC_MESSAGE_TRANSFER_H_
#include <stdbool.h>
#include "f1ap_messages_types.h"
struct F1AP_F1AP_PDU;
struct F1AP_F1AP_PDU *encode_initial_ul_rrc_message_transfer(const f1ap_initial_ul_rrc_message_t *msg);
bool decode_initial_ul_rrc_message_transfer(const struct F1AP_F1AP_PDU *pdu, f1ap_initial_ul_rrc_message_t *out);
f1ap_initial_ul_rrc_message_t cp_initial_ul_rrc_message_transfer(const f1ap_initial_ul_rrc_message_t *msg);
bool eq_initial_ul_rrc_message_transfer(const f1ap_initial_ul_rrc_message_t *a, const f1ap_initial_ul_rrc_message_t *b);
void free_initial_ul_rrc_message_transfer(const f1ap_initial_ul_rrc_message_t *msg);
/* DL RRC Message transfer */
struct F1AP_F1AP_PDU *encode_dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *msg);
bool decode_dl_rrc_message_transfer(const struct F1AP_F1AP_PDU *pdu, f1ap_dl_rrc_message_t *out);
f1ap_dl_rrc_message_t cp_dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *msg);
bool eq_dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *a, const f1ap_dl_rrc_message_t *b);
void free_dl_rrc_message_transfer(const f1ap_dl_rrc_message_t *msg);
/* UL RRC Message transfer */
struct F1AP_F1AP_PDU *encode_ul_rrc_message_transfer(const f1ap_ul_rrc_message_t *msg);
bool decode_ul_rrc_message_transfer(const struct F1AP_F1AP_PDU *pdu, f1ap_ul_rrc_message_t *out);
f1ap_ul_rrc_message_t cp_ul_rrc_message_transfer(const f1ap_ul_rrc_message_t *msg);
bool eq_ul_rrc_message_transfer(const f1ap_ul_rrc_message_t *a, const f1ap_ul_rrc_message_t *b);
void free_ul_rrc_message_transfer(const f1ap_ul_rrc_message_t *msg);
#endif /* F1AP_RRC_MESSAGE_TRANSFER_H_ */
add_executable(f1ap_lib_test f1ap_lib_test.c)
add_dependencies(tests f1ap_lib_test)
add_test(NAME f1ap_lib_test COMMAND f1ap_lib_test)
target_link_libraries(f1ap_lib_test PRIVATE f1ap_lib)
target_link_libraries(f1ap_lib_test PRIVATE asn1_f1ap)
target_include_directories(f1ap_lib_test PRIVATE ${CMAKE_SOURCE_DIR})
This diff is collapsed.
......@@ -236,10 +236,10 @@ void *gNB_app_task(void *args_p)
case F1AP_GNB_CU_CONFIGURATION_UPDATE:
AssertFatal(NODE_IS_DU(node_type), "Should not have received F1AP_GNB_CU_CONFIGURATION_UPDATE in CU/gNB\n");
LOG_I(GNB_APP, "Received %s: associated ngran_gNB_CU %s with %d cells to activate\n", ITTI_MSG_NAME (msg_p),
F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).gNB_CU_name,F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate);
LOG_I(GNB_APP,
"Received %s: associated with %d cells to activate\n",
ITTI_MSG_NAME(msg_p),
F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate);
cell_to_activate += F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p).num_cells_to_activate;
gNB_app_handle_f1ap_gnb_cu_configuration_update(&F1AP_GNB_CU_CONFIGURATION_UPDATE(msg_p));
......@@ -247,6 +247,11 @@ void *gNB_app_task(void *args_p)
AssertFatal(cell_to_activate == 1,"No cells to activate or cells > 1 %d\n",cell_to_activate);
break;
case F1AP_GNB_DU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
LOG_E(GNB_APP, "[gNB %ld] Handling of %s message not implemented yet\n", instance, msg_name);
break;
case NGAP_DEREGISTERED_GNB_IND:
LOG_W(GNB_APP, "[gNB %ld] Received %s: associated AMF %d\n", instance, msg_name,
NGAP_DEREGISTERED_GNB_IND(msg_p).nb_amf);
......
......@@ -94,6 +94,7 @@
#ifdef ENABLE_AERIAL
#include "nfapi/oai_integration/aerial/fapi_vnf_p5.h"
#endif
#include "lib/f1ap_interface_management.h"
extern uint16_t sf_ahead;
......@@ -2396,7 +2397,6 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
ret++;
mac->f1_config.setup_resp = malloc(sizeof(*mac->f1_config.setup_resp));
AssertFatal(mac->f1_config.setup_resp != NULL, "out of memory\n");
mac->f1_config.setup_resp->gNB_CU_name = gnb_cu_cfg_update->gNB_CU_name;
mac->f1_config.setup_resp->num_cells_to_activate = gnb_cu_cfg_update->num_cells_to_activate;
mac->f1_config.setup_resp->cells_to_activate[0] = gnb_cu_cfg_update->cells_to_activate[0];
} else {
......@@ -2405,6 +2405,8 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
}
}
NR_SCHED_UNLOCK(&mac->sched_lock);
/* Free F1AP struct after use */
free_f1ap_cu_configuration_update(gnb_cu_cfg_update);
MessageDef *msg_ack_p = NULL;
if (ret > 0) {
// generate gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE
......@@ -2414,6 +2416,7 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0;
F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).transaction_id = F1AP_get_next_transaction_identifier(0, 0);
itti_send_msg_to_task (TASK_DU_F1, INSTANCE_DEFAULT, msg_ack_p);
}
......
......@@ -28,6 +28,7 @@
#include "F1AP_CauseRadioNetwork.h"
#include "openair3/ocp-gtpu/gtp_itf.h"
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
#include "lib/f1ap_interface_management.h"
#include "executables/softmodem-common.h"
......@@ -169,10 +170,10 @@ void f1_setup_response(const f1ap_setup_resp_t *resp)
mac->f1_config.setup_resp = malloc(sizeof(*mac->f1_config.setup_resp));
AssertFatal(mac->f1_config.setup_resp != NULL, "out of memory\n");
*mac->f1_config.setup_resp = *resp;
if (resp->gNB_CU_name)
mac->f1_config.setup_resp->gNB_CU_name = strdup(resp->gNB_CU_name);
// Copy F1AP message
*mac->f1_config.setup_resp = cp_f1ap_setup_response(resp);
// free F1AP message after copy
free_f1ap_setup_response(resp);
NR_SCHED_UNLOCK(&mac->sched_lock);
// NOTE: Before accepting any UEs, we should initialize the UE states.
......@@ -244,7 +245,7 @@ static int handle_ue_context_srbs_setup(NR_UE_info_t *UE,
static NR_RLC_BearerConfig_t *get_bearerconfig_from_drb(const f1ap_drb_to_be_setup_t *drb)
{
const NR_RLC_Config_PR rlc_conf = drb->rlc_mode == RLC_MODE_UM ? NR_RLC_Config_PR_um_Bi_Directional : NR_RLC_Config_PR_am;
const NR_RLC_Config_PR rlc_conf = drb->rlc_mode == F1AP_RLC_MODE_AM ? NR_RLC_Config_PR_am : NR_RLC_Config_PR_um_Bi_Directional;
long priority = 13; // hardcoded for the moment
return get_DRB_RLC_BearerConfig(get_lcid_from_drbid(drb->drb_id), drb->drb_id, rlc_conf, priority);
}
......@@ -262,11 +263,11 @@ static NR_QoS_config_t get_qos_config(const f1ap_qos_characteristics_t *qos_char
{
NR_QoS_config_t qos_c = {0};
switch (qos_char->qos_type) {
case dynamic:
case DYNAMIC:
qos_c.priority = qos_char->dynamic.qos_priority_level;
qos_c.fiveQI = qos_char->dynamic.fiveqi > 0 ? qos_char->dynamic.fiveqi : 0;
break;
case non_dynamic:
case NON_DYNAMIC:
qos_c.fiveQI = qos_char->non_dynamic.fiveqi;
qos_c.priority = get_non_dynamic_priority(qos_char->non_dynamic.fiveqi);
break;
......
......@@ -23,6 +23,8 @@
#include "intertask_interface.h"
#include "mac_rrc_ul.h"
#include "f1ap_lib_extern.h"
#include "lib/f1ap_interface_management.h"
static void f1_reset_du_initiated_direct(const f1ap_reset_t *reset)
{
......@@ -40,47 +42,8 @@ static void f1_setup_request_direct(const f1ap_setup_req_t *req)
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_SETUP_REQ);
msg->ittiMsgHeader.originInstance = -1; // means monolithic
f1ap_setup_req_t *f1ap_msg = &F1AP_SETUP_REQ(msg);
f1ap_msg->gNB_DU_id = req->gNB_DU_id;
f1ap_msg->gNB_DU_name = strdup(req->gNB_DU_name);
f1ap_msg->num_cells_available = req->num_cells_available;
for (int n = 0; n < req->num_cells_available; ++n) {
f1ap_msg->cell[n].info = req->cell[n].info; // copy most fields
if (req->cell[n].info.tac) {
f1ap_msg->cell[n].info.tac = malloc(sizeof(*f1ap_msg->cell[n].info.tac));
AssertFatal(f1ap_msg->cell[n].info.tac != NULL, "out of memory\n");
*f1ap_msg->cell[n].info.tac = *req->cell[n].info.tac;
}
if (req->cell[n].info.measurement_timing_config_len > 0) {
f1ap_msg->cell[n].info.measurement_timing_config = calloc(req->cell[n].info.measurement_timing_config_len, sizeof(uint8_t));
AssertFatal(f1ap_msg->cell[n].info.measurement_timing_config != NULL, "out of memory\n");
memcpy(f1ap_msg->cell[n].info.measurement_timing_config,
req->cell[n].info.measurement_timing_config,
req->cell[n].info.measurement_timing_config_len);
f1ap_msg->cell[n].info.measurement_timing_config_len = req->cell[n].info.measurement_timing_config_len;
}
if (req->cell[n].sys_info) {
f1ap_gnb_du_system_info_t *orig_sys_info = req->cell[n].sys_info;
f1ap_gnb_du_system_info_t *copy_sys_info = calloc(1, sizeof(*copy_sys_info));
AssertFatal(copy_sys_info, "out of memory\n");
f1ap_msg->cell[n].sys_info = copy_sys_info;
copy_sys_info->mib = calloc(orig_sys_info->mib_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->mib, "out of memory\n");
memcpy(copy_sys_info->mib, orig_sys_info->mib, orig_sys_info->mib_length);
copy_sys_info->mib_length = orig_sys_info->mib_length;
if (orig_sys_info->sib1_length > 0) {
copy_sys_info->sib1 = calloc(orig_sys_info->sib1_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->sib1, "out of memory\n");
memcpy(copy_sys_info->sib1, orig_sys_info->sib1, orig_sys_info->sib1_length);
copy_sys_info->sib1_length = orig_sys_info->sib1_length;
}
}
}
memcpy(f1ap_msg->rrc_ver, req->rrc_ver, sizeof(req->rrc_ver));
f1ap_setup_req_t cp = cp_f1ap_setup_request(req);
F1AP_SETUP_REQ(msg) = cp;
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg);
}
......@@ -88,51 +51,8 @@ static void gnb_du_configuration_update_direct(const f1ap_gnb_du_configuration_u
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_GNB_DU_CONFIGURATION_UPDATE);
msg->ittiMsgHeader.originInstance = -1; // means monolithic
f1ap_gnb_du_configuration_update_t *f1ap_msg = &F1AP_GNB_DU_CONFIGURATION_UPDATE(msg);
DevAssert(upd->gNB_DU_ID == NULL);
f1ap_msg->transaction_id = upd->transaction_id;
DevAssert(upd->num_cells_to_add == 0);
DevAssert(upd->num_cells_to_delete == 0);
f1ap_msg->num_cells_to_modify = upd->num_cells_to_modify;
for (int n = 0; n < upd->num_cells_to_modify; ++n) {
f1ap_msg->cell_to_modify[n].old_nr_cellid = upd->cell_to_modify[n].old_nr_cellid;
f1ap_msg->cell_to_modify[n].info = upd->cell_to_modify[n].info; // copy most fields
if (upd->cell_to_modify[n].info.tac) {
f1ap_msg->cell_to_modify[n].info.tac = malloc(sizeof(*f1ap_msg->cell_to_modify[n].info.tac));
AssertFatal(f1ap_msg->cell_to_modify[n].info.tac != NULL, "out of memory\n");
*f1ap_msg->cell_to_modify[n].info.tac = *upd->cell_to_modify[n].info.tac;
}
if (upd->cell_to_modify[n].info.measurement_timing_config_len > 0) {
f1ap_msg->cell_to_modify[n].info.measurement_timing_config =
calloc(upd->cell_to_modify[n].info.measurement_timing_config_len, sizeof(uint8_t));
AssertFatal(f1ap_msg->cell_to_modify[n].info.measurement_timing_config != NULL, "out of memory\n");
memcpy(f1ap_msg->cell_to_modify[n].info.measurement_timing_config,
upd->cell_to_modify[n].info.measurement_timing_config,
upd->cell_to_modify[n].info.measurement_timing_config_len);
f1ap_msg->cell_to_modify[n].info.measurement_timing_config_len = upd->cell_to_modify[n].info.measurement_timing_config_len;
}
if (upd->cell_to_modify[n].sys_info) {
f1ap_gnb_du_system_info_t *orig_sys_info = upd->cell_to_modify[n].sys_info;
f1ap_gnb_du_system_info_t *copy_sys_info = calloc(1, sizeof(*copy_sys_info));
AssertFatal(copy_sys_info != NULL, "out of memory\n");
f1ap_msg->cell_to_modify[n].sys_info = copy_sys_info;
copy_sys_info->mib = calloc(orig_sys_info->mib_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->mib != NULL, "out of memory\n");
memcpy(copy_sys_info->mib, orig_sys_info->mib, orig_sys_info->mib_length);
copy_sys_info->mib_length = orig_sys_info->mib_length;
if (orig_sys_info->sib1_length > 0) {
copy_sys_info->sib1 = calloc(orig_sys_info->sib1_length, sizeof(uint8_t));
AssertFatal(copy_sys_info->sib1 != NULL, "out of memory\n");
memcpy(copy_sys_info->sib1, orig_sys_info->sib1, orig_sys_info->sib1_length);
copy_sys_info->sib1_length = orig_sys_info->sib1_length;
}
}
}
/* transfer to RRC via ITTI */
F1AP_GNB_DU_CONFIGURATION_UPDATE(msg) = cp_f1ap_du_configuration_update(upd);
itti_send_msg_to_task(TASK_RRC_GNB, 0, msg);
}
......@@ -277,20 +197,8 @@ static void initial_ul_rrc_message_transfer_direct(module_id_t module_id, const
{
MessageDef *msg = itti_alloc_new_message(TASK_MAC_GNB, 0, F1AP_INITIAL_UL_RRC_MESSAGE);
msg->ittiMsgHeader.originInstance = -1; // means monolithic
/* copy all fields, but reallocate rrc_containers! */
f1ap_initial_ul_rrc_message_t *f1ap_msg = &F1AP_INITIAL_UL_RRC_MESSAGE(msg);
*f1ap_msg = *ul_rrc;
f1ap_msg->rrc_container = malloc(ul_rrc->rrc_container_length);
DevAssert(f1ap_msg->rrc_container);
memcpy(f1ap_msg->rrc_container, ul_rrc->rrc_container, ul_rrc->rrc_container_length);
f1ap_msg->rrc_container_length = ul_rrc->rrc_container_length;
f1ap_msg->du2cu_rrc_container = malloc(ul_rrc->du2cu_rrc_container_length);
DevAssert(f1ap_msg->du2cu_rrc_container);
memcpy(f1ap_msg->du2cu_rrc_container, ul_rrc->du2cu_rrc_container, ul_rrc->du2cu_rrc_container_length);
f1ap_msg->du2cu_rrc_container_length = ul_rrc->du2cu_rrc_container_length;
*f1ap_msg = cp_initial_ul_rrc_message_transfer(ul_rrc);
itti_send_msg_to_task(TASK_RRC_GNB, module_id, msg);
}
......
......@@ -23,6 +23,8 @@
#include "mac_rrc_dl.h"
#include "nr_rrc_defs.h"
#include "openair2/F1AP/lib/f1ap_rrc_message_transfer.h"
#include "openair2/F1AP/lib/f1ap_interface_management.h"
static void f1_reset_cu_initiated_f1ap(sctp_assoc_t assoc_id, const f1ap_reset_t *reset)
{
......@@ -44,6 +46,7 @@ static void f1_setup_response_f1ap(sctp_assoc_t assoc_id, const f1ap_setup_resp_
*f1ap_msg = *resp;
if (resp->gNB_CU_name != NULL)
f1ap_msg->gNB_CU_name = strdup(resp->gNB_CU_name);
free_f1ap_setup_response(resp);
itti_send_msg_to_task(TASK_CU_F1, 0, msg);
}
......@@ -210,18 +213,7 @@ static void dl_rrc_message_transfer_f1ap(sctp_assoc_t assoc_id, const f1ap_dl_rr
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_DL_RRC_MESSAGE);
message_p->ittiMsgHeader.originInstance = assoc_id;
f1ap_dl_rrc_message_t *msg = &F1AP_DL_RRC_MESSAGE(message_p);
*msg = *dl_rrc;
if (dl_rrc->old_gNB_DU_ue_id) {
msg->old_gNB_DU_ue_id = malloc(sizeof(*msg->old_gNB_DU_ue_id));
AssertFatal(msg->old_gNB_DU_ue_id != NULL, "out of memory\n");
*msg->old_gNB_DU_ue_id = *dl_rrc->old_gNB_DU_ue_id;
}
if (dl_rrc->rrc_container) {
msg->rrc_container = malloc(dl_rrc->rrc_container_length);
AssertFatal(msg->rrc_container != NULL, "out of memory\n");
msg->rrc_container_length = dl_rrc->rrc_container_length;
memcpy(msg->rrc_container, dl_rrc->rrc_container, dl_rrc->rrc_container_length);
}
*msg = cp_dl_rrc_message_transfer(dl_rrc);
itti_send_msg_to_task (TASK_CU_F1, 0, message_p);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -394,7 +394,7 @@ static void sctp_handle_new_association_req(const instance_t instance,
struct addrinfo *serv;
int status = getaddrinfo(local, NULL, &hints, &serv);
AssertFatal(status == 0, "getaddrinfo() failed: %s\n", gai_strerror(status));
AssertFatal(status == 0, "getaddrinfo(%s) failed: %s\n", local, gai_strerror(status));
int sd;
struct addrinfo *p = NULL;
......
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