mirror of https://github.com/PentHertz/srsLTE.git
create typedef for circular map of rntis. check return of gtpu ue creation
This commit is contained in:
parent
9464f36714
commit
1677abce8d
|
@ -17,6 +17,7 @@
|
||||||
INCLUDES
|
INCLUDES
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
#include "srsran/adt/circular_map.h"
|
||||||
#include "srsran/common/common_lte.h"
|
#include "srsran/common/common_lte.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
@ -48,6 +49,10 @@ constexpr uint32_t drb_to_lcid(lte_drb drb_id)
|
||||||
#define SRSENB_MAX_BUFFER_SIZE_BYTES 12756
|
#define SRSENB_MAX_BUFFER_SIZE_BYTES 12756
|
||||||
#define SRSENB_BUFFER_HEADER_OFFSET 1024
|
#define SRSENB_BUFFER_HEADER_OFFSET 1024
|
||||||
|
|
||||||
|
/// Typedef of circular map container which key corresponding to rnti value and that can be used across layers
|
||||||
|
template <typename UEObject>
|
||||||
|
using rnti_map_t = srsran::static_circular_map<uint16_t, UEObject, SRSENB_MAX_UES>;
|
||||||
|
|
||||||
} // namespace srsenb
|
} // namespace srsenb
|
||||||
|
|
||||||
#endif // SRSENB_COMMON_ENB_H
|
#endif // SRSENB_COMMON_ENB_H
|
||||||
|
|
|
@ -136,7 +136,7 @@ private:
|
||||||
sched_interface::dl_pdu_mch_t mch = {};
|
sched_interface::dl_pdu_mch_t mch = {};
|
||||||
|
|
||||||
/* Map of active UEs */
|
/* Map of active UEs */
|
||||||
srsran::static_circular_map<uint16_t, std::unique_ptr<ue>, 64> ue_db;
|
rnti_map_t<std::unique_ptr<ue> > ue_db;
|
||||||
std::map<uint16_t, std::unique_ptr<ue> > ues_to_rem;
|
std::map<uint16_t, std::unique_ptr<ue> > ues_to_rem;
|
||||||
uint16_t last_rnti = 70;
|
uint16_t last_rnti = 70;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ private:
|
||||||
uint32_t ul_nof_samples = 0;
|
uint32_t ul_nof_samples = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
srsran::static_circular_map<uint16_t, ue_ctxt, SRSENB_MAX_UES> ue_history_db;
|
rnti_map_t<ue_ctxt> ue_history_db;
|
||||||
|
|
||||||
struct ue_dl_prio_compare {
|
struct ue_dl_prio_compare {
|
||||||
bool operator()(const ue_ctxt* lhs, const ue_ctxt* rhs) const;
|
bool operator()(const ue_ctxt* lhs, const ue_ctxt* rhs) const;
|
||||||
|
|
|
@ -36,7 +36,6 @@ struct gtpu_header_t;
|
||||||
namespace srsenb {
|
namespace srsenb {
|
||||||
|
|
||||||
class pdcp_interface_gtpu;
|
class pdcp_interface_gtpu;
|
||||||
class stack_interface_gtpu_lte;
|
|
||||||
|
|
||||||
class gtpu_tunnel_manager
|
class gtpu_tunnel_manager
|
||||||
{
|
{
|
||||||
|
@ -120,7 +119,7 @@ private:
|
||||||
pdcp_interface_gtpu* pdcp = nullptr;
|
pdcp_interface_gtpu* pdcp = nullptr;
|
||||||
srslog::basic_logger& logger;
|
srslog::basic_logger& logger;
|
||||||
|
|
||||||
srsran::static_circular_map<uint16_t, ue_lcid_tunnel_list, SRSENB_MAX_UES> ue_teidin_db;
|
rnti_map_t<ue_lcid_tunnel_list> ue_teidin_db;
|
||||||
tunnel_list_t tunnels;
|
tunnel_list_t tunnels;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,11 @@ const gtpu_tunnel* gtpu_tunnel_manager::add_tunnel(uint16_t rnti, uint32_t lcid,
|
||||||
tun->spgw_addr = spgw_addr;
|
tun->spgw_addr = spgw_addr;
|
||||||
|
|
||||||
if (not ue_teidin_db.contains(rnti)) {
|
if (not ue_teidin_db.contains(rnti)) {
|
||||||
ue_teidin_db.insert(rnti, ue_lcid_tunnel_list());
|
auto ret = ue_teidin_db.insert(rnti, ue_lcid_tunnel_list());
|
||||||
|
if (ret.is_error()) {
|
||||||
|
logger.error("Failed to allocate rnti=0x%x", rnti);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
auto& ue_tunnels = ue_teidin_db[rnti];
|
auto& ue_tunnels = ue_teidin_db[rnti];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue