File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,20 @@ struct cu_cp_amf_identifier_t {
132132};
133133
134134struct cu_cp_five_g_s_tmsi {
135+ cu_cp_five_g_s_tmsi () = default ;
136+
137+ cu_cp_five_g_s_tmsi (const bounded_bitset<48 >& five_g_s_tmsi_) : five_g_s_tmsi(five_g_s_tmsi_)
138+ {
139+ srsran_assert (five_g_s_tmsi_.size () == 48 , " Invalid size for 5G-S-TMSI ({})" , five_g_s_tmsi_.size ());
140+ }
141+
142+ cu_cp_five_g_s_tmsi (uint64_t amf_set_id, uint64_t amf_pointer, uint64_t five_g_tmsi)
143+ {
144+ five_g_s_tmsi.emplace ();
145+ five_g_s_tmsi->resize (48 );
146+ five_g_s_tmsi->from_uint64 ((amf_set_id << 38U ) + (amf_pointer << 32U ) + five_g_tmsi);
147+ }
148+
135149 uint16_t get_amf_set_id () const
136150 {
137151 srsran_assert (five_g_s_tmsi.has_value (), " five_g_s_tmsi is not set" );
@@ -152,6 +166,7 @@ struct cu_cp_five_g_s_tmsi {
152166
153167 uint64_t to_number () const { return five_g_s_tmsi->to_uint64 (); }
154168
169+ private:
155170 std::optional<bounded_bitset<48 >> five_g_s_tmsi;
156171};
157172
Original file line number Diff line number Diff line change @@ -844,13 +844,9 @@ inline cu_cp_five_g_s_tmsi ngap_asn1_to_ue_paging_id(const asn1::ngap::ue_paging
844844 srsran_assert (asn1_ue_id.type () == asn1::ngap::ue_paging_id_c::types_opts::five_g_s_tmsi,
845845 " Invalid UE paging ID type" );
846846
847- bounded_bitset<48 > five_g_s_tmsi (48 );
848-
849- five_g_s_tmsi.from_uint64 (((uint64_t )asn1_ue_id.five_g_s_tmsi ().amf_set_id .to_number () << 38U ) +
850- ((uint64_t )asn1_ue_id.five_g_s_tmsi ().amf_pointer .to_number () << 32U ) +
851- asn1_ue_id.five_g_s_tmsi ().five_g_tmsi .to_number ());
852-
853- return cu_cp_five_g_s_tmsi{five_g_s_tmsi};
847+ return cu_cp_five_g_s_tmsi{asn1_ue_id.five_g_s_tmsi ().amf_set_id .to_number (),
848+ asn1_ue_id.five_g_s_tmsi ().amf_pointer .to_number (),
849+ asn1_ue_id.five_g_s_tmsi ().five_g_tmsi .to_number ()};
854850}
855851
856852} // namespace srs_cu_cp
You can’t perform that action at this time.
0 commit comments