Skip to content

Commit cd214b5

Browse files
frankistcodebot
authored andcommitted
f1ap: remove asn1 f1ap from the public f1ap interfaces
1 parent 8082587 commit cd214b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+262
-204
lines changed

apps/examples/du/du_example.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "radio_notifier_sample.h"
1717
#include "srsran/asn1/rrc_nr/msg_common.h"
1818
#include "srsran/du/du_cell_config_helpers.h"
19+
#include "srsran/f1ap/common/f1ap_message.h"
1920
#include "srsran/fapi/logging_decorator_factories.h"
2021
#include "srsran/fapi_adaptor/mac/mac_fapi_adaptor_factory.h"
2122
#include "srsran/fapi_adaptor/phy/phy_fapi_adaptor_factory.h"

apps/gnb/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# the distribution.
77
#
88

9-
add_subdirectory(adapters)
10-
119
add_executable(gnb
1210
gnb.cpp
1311
gnb_appconfig_cli11_schema.cpp
@@ -18,6 +16,7 @@ add_executable(gnb
1816
helpers/metrics_plotter_stdout.cpp
1917
helpers/gnb_console_helper.cpp
2018
helpers/metrics_hub.cpp
19+
adapters/f1ap_adapter.cpp
2120
)
2221

2322
install(TARGETS gnb

apps/gnb/adapters/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

apps/gnb/adapters/f1ap_adapter.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
*
3+
* Copyright 2021-2023 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#include "f1ap_adapter.h"
12+
#include "srsran/f1ap/common/f1ap_message.h"
13+
14+
using namespace srsran;
15+
16+
f1ap_local_adapter::f1ap_local_adapter(const std::string& log_name, dlt_pcap& f1ap_pcap_) :
17+
logger(srslog::fetch_basic_logger(log_name)), f1ap_pcap(f1ap_pcap_)
18+
{
19+
}
20+
21+
void f1ap_local_adapter::on_new_message(const f1ap_message& msg)
22+
{
23+
report_fatal_error_if_not(handler, "F1AP message handler not set");
24+
logger.debug("Received a PDU of type {}", msg.pdu.type().to_string());
25+
26+
if (f1ap_pcap.is_write_enabled()) {
27+
byte_buffer buf;
28+
asn1::bit_ref bref(buf);
29+
if (msg.pdu.pack(bref) != asn1::SRSASN_SUCCESS) {
30+
logger.error("Failed to pack PDU");
31+
} else {
32+
f1ap_pcap.push_pdu(std::move(buf));
33+
}
34+
}
35+
handler->handle_message(msg);
36+
}

apps/gnb/adapters/f1ap_adapter.h

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,11 @@ namespace srsran {
1919
class f1ap_local_adapter : public f1ap_message_notifier
2020
{
2121
public:
22-
explicit f1ap_local_adapter(const std::string& log_name, dlt_pcap& f1ap_pcap_) :
23-
logger(srslog::fetch_basic_logger(log_name)), f1ap_pcap(f1ap_pcap_)
24-
{
25-
}
22+
explicit f1ap_local_adapter(const std::string& log_name, dlt_pcap& f1ap_pcap_);
2623

2724
void attach_handler(f1ap_message_handler* handler_) { handler = handler_; }
28-
void on_new_message(const f1ap_message& msg) override
29-
{
30-
report_fatal_error_if_not(handler, "F1AP message handler not set");
31-
logger.debug("Received a PDU of type {}", msg.pdu.type().to_string());
32-
33-
if (f1ap_pcap.is_write_enabled()) {
34-
byte_buffer buf;
35-
asn1::bit_ref bref(buf);
36-
if (msg.pdu.pack(bref) != asn1::SRSASN_SUCCESS) {
37-
logger.error("Failed to pack PDU");
38-
} else {
39-
f1ap_pcap.push_pdu(std::move(buf));
40-
}
41-
}
42-
handler->handle_message(msg);
43-
}
25+
26+
void on_new_message(const f1ap_message& msg) override;
4427

4528
private:
4629
srslog::basic_logger& logger;

include/srsran/f1ap/common/f1ap_common.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@
1010

1111
#pragma once
1212

13-
#include "srsran/asn1/f1ap/f1ap.h"
14-
1513
namespace srsran {
1614

17-
struct f1ap_message {
18-
asn1::f1ap::f1ap_pdu_c pdu;
19-
};
15+
// Forward declaration.
16+
struct f1ap_message;
2017

2118
/// This interface is used to push F1AP messages to the F1 interface.
2219
class f1ap_message_handler
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
*
3+
* Copyright 2021-2023 Software Radio Systems Limited
4+
*
5+
* By using this file, you agree to the terms and conditions set
6+
* forth in the LICENSE file which can be found at the top level of
7+
* the distribution.
8+
*
9+
*/
10+
11+
#pragma once
12+
13+
#include "srsran/asn1/f1ap/f1ap.h"
14+
15+
namespace srsran {
16+
17+
/// \brief F1AP message transferred between a CU-CP and a DU.
18+
struct f1ap_message {
19+
asn1::f1ap::f1ap_pdu_c pdu;
20+
};
21+
22+
} // namespace srsran

include/srsran/f1ap/cu_cp/f1ap_cu_ue_context_update.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#pragma once
1212

13+
#include "srsran/asn1/f1ap/f1ap_pdu_contents_ue.h"
1314
#include "srsran/cu_cp/cu_cp_types.h"
1415
#include <vector>
1516

include/srsran/f1ap/du/f1ap_du.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ class f1ap_du_paging_notifier
147147
};
148148

149149
/// Combined entry point for F1AP handling.
150-
class f1ap_interface : public f1ap_message_handler,
151-
public f1ap_event_handler,
152-
public f1ap_rrc_message_transfer_procedure_handler,
153-
public f1ap_connection_manager,
154-
public f1ap_ue_context_manager
150+
class f1ap_du : public f1ap_message_handler,
151+
public f1ap_event_handler,
152+
public f1ap_rrc_message_transfer_procedure_handler,
153+
public f1ap_connection_manager,
154+
public f1ap_ue_context_manager
155155
{
156156
public:
157-
virtual ~f1ap_interface() = default;
157+
virtual ~f1ap_du() = default;
158158
};
159159

160160
} // namespace srs_du

include/srsran/f1ap/du/f1ap_du_factory.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ namespace srsran {
88
namespace srs_du {
99

1010
/// Creates an instance of an F1AP DU interface, notifying outgoing packets on the specified listener object.
11-
std::unique_ptr<f1ap_interface> create_f1ap(f1ap_message_notifier& event_notifier,
12-
f1ap_du_configurator& du_mng,
13-
task_executor& ctrl_exec,
14-
du_high_ue_executor_mapper& ue_exec_mapper,
15-
f1ap_du_paging_notifier& paging_notifier);
11+
std::unique_ptr<f1ap_du> create_f1ap(f1ap_message_notifier& event_notifier,
12+
f1ap_du_configurator& du_mng,
13+
task_executor& ctrl_exec,
14+
du_high_ue_executor_mapper& ue_exec_mapper,
15+
f1ap_du_paging_notifier& paging_notifier);
1616

1717
} // namespace srs_du
1818
} // namespace srsran

0 commit comments

Comments
 (0)