|
|
@ -39,22 +39,17 @@ namespace srsenb {
|
|
|
|
class x2_adapter final : public x2_interface
|
|
|
|
class x2_adapter final : public x2_interface
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
x2_adapter() = default;
|
|
|
|
x2_adapter(enb_stack_lte* eutra_stack_, gnb_stack_nr* nr_stack_) : nr_stack(nr_stack_), eutra_stack(eutra_stack_) {}
|
|
|
|
|
|
|
|
|
|
|
|
// init functions to set handle to stacks
|
|
|
|
|
|
|
|
void set_eutra_stack(enb_stack_lte* eutra_stack_) { eutra_stack = eutra_stack_; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void set_nr_stack(gnb_stack_nr* nr_stack_) { nr_stack = nr_stack_; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// rrc_nr_interface_rrc
|
|
|
|
/// rrc_nr_interface_rrc
|
|
|
|
int sgnb_addition_request(uint16_t eutra_rnti, const sgnb_addition_req_params_t& params)
|
|
|
|
int sgnb_addition_request(uint16_t eutra_rnti, const sgnb_addition_req_params_t& params) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nr_stack->sgnb_addition_request(eutra_rnti, params);
|
|
|
|
return nr_stack->sgnb_addition_request(eutra_rnti, params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int sgnb_reconfiguration_complete(uint16_t eutra_rnti, asn1::dyn_octstring reconfig_response)
|
|
|
|
int sgnb_reconfiguration_complete(uint16_t eutra_rnti, asn1::dyn_octstring reconfig_response) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
return SRSRAN_ERROR;
|
|
|
|
return SRSRAN_ERROR;
|
|
|
@ -63,21 +58,21 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// rrc_eutra_interface_rrc_nr
|
|
|
|
/// rrc_eutra_interface_rrc_nr
|
|
|
|
void sgnb_addition_ack(uint16_t eutra_rnti, sgnb_addition_ack_params_t params)
|
|
|
|
void sgnb_addition_ack(uint16_t eutra_rnti, sgnb_addition_ack_params_t params) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eutra_stack->sgnb_addition_ack(eutra_rnti, params);
|
|
|
|
eutra_stack->sgnb_addition_ack(eutra_rnti, params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void sgnb_addition_reject(uint16_t eutra_rnti)
|
|
|
|
void sgnb_addition_reject(uint16_t eutra_rnti) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eutra_stack->sgnb_addition_reject(eutra_rnti);
|
|
|
|
eutra_stack->sgnb_addition_reject(eutra_rnti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void sgnb_addition_complete(uint16_t eutra_rnti, uint16_t nr_rnti)
|
|
|
|
void sgnb_addition_complete(uint16_t eutra_rnti, uint16_t nr_rnti) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -85,7 +80,7 @@ public:
|
|
|
|
eutra_stack->sgnb_addition_complete(eutra_rnti, nr_rnti);
|
|
|
|
eutra_stack->sgnb_addition_complete(eutra_rnti, nr_rnti);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void set_activity_user(uint16_t eutra_rnti)
|
|
|
|
void set_activity_user(uint16_t eutra_rnti) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -94,14 +89,14 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// pdcp_interface_gtpu
|
|
|
|
// pdcp_interface_gtpu
|
|
|
|
void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu, int pdcp_sn = -1)
|
|
|
|
void write_sdu(uint16_t rnti, uint32_t lcid, srsran::unique_byte_buffer_t sdu, int pdcp_sn = -1) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
nr_stack->write_sdu(rnti, lcid, std::move(sdu), pdcp_sn);
|
|
|
|
nr_stack->write_sdu(rnti, lcid, std::move(sdu), pdcp_sn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::map<uint32_t, srsran::unique_byte_buffer_t> get_buffered_pdus(uint16_t rnti, uint32_t lcid)
|
|
|
|
std::map<uint32_t, srsran::unique_byte_buffer_t> get_buffered_pdus(uint16_t rnti, uint32_t lcid) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
if (nr_stack == nullptr) {
|
|
|
|
return {};
|
|
|
|
return {};
|
|
|
@ -110,7 +105,7 @@ public:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// gtpu_interface_pdcp
|
|
|
|
// gtpu_interface_pdcp
|
|
|
|
void write_pdu(uint16_t rnti, uint32_t bearer_id, srsran::unique_byte_buffer_t pdu)
|
|
|
|
void write_pdu(uint16_t rnti, uint32_t bearer_id, srsran::unique_byte_buffer_t pdu) override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
if (eutra_stack == nullptr) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|