Skip to content

Commit c20be7b

Browse files
FabianEckermanncodebot
authored andcommitted
cu_cp,f1ap: add function to return 5g-s-tmsi as number
1 parent d7048d5 commit c20be7b

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

include/srsran/cu_cp/cu_cp_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ struct cu_cp_five_g_s_tmsi {
150150
return (five_g_s_tmsi.value().to_uint64() & 0xffffffff);
151151
};
152152

153+
uint64_t to_number() const { return five_g_s_tmsi->to_uint64(); }
154+
153155
std::optional<bounded_bitset<48>> five_g_s_tmsi;
154156
};
155157

lib/f1ap/cu_cp/f1ap_asn1_converters.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -557,14 +557,6 @@ f1ap_rrc_recfg_complete_ind_to_asn1(const f1ap_rrc_recfg_complete_ind& rrc_recfg
557557
return asn1_rrc_recfg_complete_ind;
558558
}
559559

560-
/// \brief Calculate the 5G-S-TMSI from the common type 5G-S-TMSI struct.
561-
inline uint64_t five_g_s_tmsi_struct_to_number(const cu_cp_five_g_s_tmsi& five_g_s_tmsi)
562-
{
563-
// 5G-S-TMSI is a 48 bit string consisting of <aMFSetId (10 bit)><aMFPointer (6 bit)><5G-TMSI (32 bit)>
564-
return ((uint64_t)five_g_s_tmsi.get_amf_set_id() << 38) + ((uint64_t)five_g_s_tmsi.get_amf_pointer() << 32) +
565-
five_g_s_tmsi.get_five_g_tmsi();
566-
}
567-
568560
/// \brief Convert F1AP ASN.1 to \c cu_cp_tx_bw.
569561
/// \param[in] asn1_tx_bw The ASN.1 type tx bw.
570562
/// \return The common type tx bw.

lib/f1ap/cu_cp/f1ap_asn1_helpers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ inline void fill_f1ap_ue_context_modification_response(f1ap_ue_context_modificat
468468
inline void fill_asn1_paging_message(asn1::f1ap::paging_s& asn1_paging, const cu_cp_paging_message& paging)
469469
{
470470
// Add ue id idx value
471-
uint64_t five_g_s_tmsi = five_g_s_tmsi_struct_to_number(paging.ue_paging_id);
471+
uint64_t five_g_s_tmsi = paging.ue_paging_id.to_number();
472472

473473
// UE Identity Index value is defined as: UE_ID 5G-S-TMSI mod 1024 (see TS 38.304 section 7.1)
474474
asn1_paging->ue_id_idx_value.set_idx_len10().from_number(five_g_s_tmsi % 1024);

0 commit comments

Comments
 (0)