|
|
|
@ -12,6 +12,7 @@
|
|
|
|
|
|
|
|
|
|
#include "srsran/upper/gtpu.h"
|
|
|
|
|
#include "srsenb/hdr/stack/upper/gtpu.h"
|
|
|
|
|
#include "srsran/common/common_nr.h"
|
|
|
|
|
#include "srsran/common/network_utils.h"
|
|
|
|
|
#include "srsran/common/standard_streams.h"
|
|
|
|
|
#include "srsran/common/string_helpers.h"
|
|
|
|
@ -32,9 +33,12 @@ namespace srsenb {
|
|
|
|
|
#define TEID_IN_FMT "TEID In=0x%x"
|
|
|
|
|
#define TEID_OUT_FMT "TEID Out=0x%x"
|
|
|
|
|
|
|
|
|
|
gtpu_tunnel_manager::gtpu_tunnel_manager(srsran::task_sched_handle task_sched_, srslog::basic_logger& logger) :
|
|
|
|
|
logger(logger), task_sched(task_sched_), tunnels(1)
|
|
|
|
|
{}
|
|
|
|
|
gtpu_tunnel_manager::gtpu_tunnel_manager(srsran::task_sched_handle task_sched_,
|
|
|
|
|
srslog::basic_logger& logger,
|
|
|
|
|
bool is_nr_) :
|
|
|
|
|
logger(logger), is_nr(is_nr_), task_sched(task_sched_), tunnels(1)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gtpu_tunnel_manager::init(const gtpu_args_t& args, pdcp_interface_gtpu* pdcp_)
|
|
|
|
|
{
|
|
|
|
@ -57,7 +61,7 @@ gtpu_tunnel_manager::ue_bearer_tunnel_list* gtpu_tunnel_manager::find_rnti_tunne
|
|
|
|
|
srsran::span<gtpu_tunnel_manager::bearer_teid_pair>
|
|
|
|
|
gtpu_tunnel_manager::find_rnti_bearer_tunnels(uint16_t rnti, uint32_t eps_bearer_id)
|
|
|
|
|
{
|
|
|
|
|
if (not is_eps_bearer_id(eps_bearer_id)) {
|
|
|
|
|
if ((not is_nr and not is_eps_bearer_id(eps_bearer_id)) or (is_nr and not is_nr_lcid(eps_bearer_id))) {
|
|
|
|
|
logger.warning("Searching for bearer with invalid eps-BearerID=%d", eps_bearer_id);
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
@ -74,7 +78,7 @@ gtpu_tunnel_manager::find_rnti_bearer_tunnels(uint16_t rnti, uint32_t eps_bearer
|
|
|
|
|
const gtpu_tunnel*
|
|
|
|
|
gtpu_tunnel_manager::add_tunnel(uint16_t rnti, uint32_t eps_bearer_id, uint32_t teidout, uint32_t spgw_addr)
|
|
|
|
|
{
|
|
|
|
|
if (not is_eps_bearer_id(eps_bearer_id)) {
|
|
|
|
|
if ((not is_nr and not is_eps_bearer_id(eps_bearer_id)) or (is_nr and not is_nr_lcid(eps_bearer_id))) {
|
|
|
|
|
logger.warning("Adding TEID with invalid eps-BearerID=%d", eps_bearer_id);
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
@ -351,11 +355,14 @@ void gtpu_tunnel_manager::setup_forwarding(uint32_t rx_teid, uint32_t tx_teid)
|
|
|
|
|
|
|
|
|
|
gtpu::gtpu(srsran::task_sched_handle task_sched_,
|
|
|
|
|
srslog::basic_logger& logger,
|
|
|
|
|
bool is_nr_,
|
|
|
|
|
srsran::socket_manager_itf* rx_socket_handler_) :
|
|
|
|
|
m1u(this),
|
|
|
|
|
task_sched(task_sched_),
|
|
|
|
|
logger(logger),
|
|
|
|
|
tunnels(task_sched_, logger),
|
|
|
|
|
is_nr(is_nr_),
|
|
|
|
|
tunnels(task_sched_, logger, is_nr),
|
|
|
|
|
|
|
|
|
|
rx_socket_handler(rx_socket_handler_)
|
|
|
|
|
{
|
|
|
|
|
gtpu_queue = task_sched.make_task_queue();
|
|
|
|
|