Skip to content

Commit 32b7ec3

Browse files
FabianEckermannandrepuschmann
authored andcommitted
cu_cp,f1ap: Add srb id to ue context release request with rrc container
1 parent 78aa129 commit 32b7ec3

File tree

7 files changed

+22
-6
lines changed

7 files changed

+22
-6
lines changed

include/srsran/f1ap/cu_cp/f1ap_cu.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ class f1ap_connection_manager
6060
};
6161

6262
struct f1ap_ue_context_release_command {
63-
ue_index_t ue_index = ue_index_t::invalid;
64-
cause_t cause;
65-
byte_buffer rrc_release_pdu;
63+
ue_index_t ue_index = ue_index_t::invalid;
64+
cause_t cause;
65+
byte_buffer rrc_release_pdu;
66+
optional<srb_id_t> srb_id;
6667
};
6768

6869
struct f1ap_ue_context_release_complete {

include/srsran/rrc/rrc_ue.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ class rrc_ue_reestablishment_proc_notifier
170170
};
171171

172172
struct rrc_ue_context_release_command {
173-
ue_index_t ue_index = ue_index_t::invalid;
174-
cause_t cause = cause_t::nulltype;
175-
byte_buffer rrc_release_pdu;
173+
ue_index_t ue_index = ue_index_t::invalid;
174+
cause_t cause = cause_t::nulltype;
175+
byte_buffer rrc_release_pdu;
176+
optional<srb_id_t> srb_id;
176177
};
177178

178179
/// Interface to notify about RRC UE Context messages.
@@ -265,6 +266,7 @@ class rrc_ue_dl_nas_message_handler
265266
struct rrc_ue_release_context {
266267
cu_cp_user_location_info_nr user_location_info;
267268
byte_buffer rrc_release_pdu;
269+
srb_id_t srb_id = srb_id_t::nulltype;
268270
};
269271

270272
/// Handle control messages.

lib/cu_cp/du_processor_impl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@ du_processor_impl::handle_new_ue_context_release_command(const cu_cp_ngap_ue_con
465465
release_command.ue_index = cmd.ue_index;
466466
release_command.cause = cmd.cause;
467467
release_command.rrc_release_pdu = release_context.rrc_release_pdu.copy();
468+
release_command.srb_id = release_context.srb_id;
468469

469470
handle_ue_context_release_command(release_command);
470471

lib/cu_cp/routines/ue_context_release_routine.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ void ue_context_release_routine::operator()(coro_context<async_task<void>>& ctx)
5252
f1ap_ue_context_release_cmd.ue_index = command.ue_index;
5353
f1ap_ue_context_release_cmd.cause = command.cause;
5454
f1ap_ue_context_release_cmd.rrc_release_pdu = command.rrc_release_pdu.copy();
55+
f1ap_ue_context_release_cmd.srb_id = command.srb_id;
5556

5657
CORO_AWAIT_VALUE(f1ap_ue_context_release_result,
5758
f1ap_ue_ctxt_notifier.on_ue_context_release_command(f1ap_ue_context_release_cmd));

lib/f1ap/cu_cp/procedures/ue_context_release_procedure.cpp

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

1111
#include "ue_context_release_procedure.h"
1212
#include "../f1ap_asn1_converters.h"
13+
#include "srsran/ran/lcid.h"
14+
#include "srsran/support/srsran_assert.h"
1315

1416
using namespace srsran;
1517
using namespace srsran::srs_cu_cp;
@@ -27,6 +29,11 @@ ue_context_release_procedure::ue_context_release_procedure(f1ap_ue_context_list&
2729
if (!cmd_.rrc_release_pdu.empty()) {
2830
command->rrc_container_present = true;
2931
command->rrc_container = cmd_.rrc_release_pdu.copy();
32+
33+
srsran_assert(cmd_.srb_id.has_value(), "SRB-ID for UE Context Release Command with RRC Container must be set.");
34+
35+
command->srb_id_present = true;
36+
command->srb_id = srb_id_to_uint(cmd_.srb_id.value());
3037
}
3138
}
3239

lib/rrc/ue/rrc_ue_message_handlers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "rrc_asn1_helpers.h"
1616
#include "rrc_ue_impl.h"
1717
#include "srsran/asn1/rrc_nr/nr_ue_variables.h"
18+
#include "srsran/ran/lcid.h"
1819
#include "srsran/security/integrity.h"
1920

2021
using namespace srsran;
@@ -302,6 +303,7 @@ rrc_ue_release_context rrc_ue_impl::get_rrc_ue_release_context()
302303

303304
// pack DL CCCH msg
304305
release_context.rrc_release_pdu = pack_into_pdu(dl_dcch_msg);
306+
release_context.srb_id = srb_id_t::srb1;
305307

306308
return release_context;
307309
}

tests/unittests/cu_cp/cu_cp_test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ TEST_F(cu_cp_test, when_release_command_received_then_release_command_is_sent_to
498498
ASSERT_EQ(f1ap_pdu_notifier.last_f1ap_msg.pdu.init_msg().value.type().value,
499499
asn1::f1ap::f1ap_elem_procs_o::init_msg_c::types_opts::ue_context_release_cmd);
500500
ASSERT_TRUE(f1ap_pdu_notifier.last_f1ap_msg.pdu.init_msg().value.ue_context_release_cmd()->rrc_container_present);
501+
// check that the SRB ID is set if the RRC Container is included
502+
ASSERT_TRUE(f1ap_pdu_notifier.last_f1ap_msg.pdu.init_msg().value.ue_context_release_cmd()->srb_id_present);
501503
}
502504

503505
//////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)