- Upgrade the gtpu class in lib dir to srslog.

- Propagate old log elimination through all the dependencies of gtpu.
master
faluco 4 years ago committed by faluco
parent 62fcf04083
commit 6359a2d948

@ -70,35 +70,35 @@ struct gtpu_header_t {
std::vector<uint8_t> ext_buffer; std::vector<uint8_t> ext_buffer;
}; };
bool gtpu_read_header(srslte::byte_buffer_t* pdu, gtpu_header_t* header, srslte::log_ref gtpu_log); bool gtpu_read_header(srslte::byte_buffer_t* pdu, gtpu_header_t* header, srslog::basic_logger& logger);
bool gtpu_write_header(gtpu_header_t* header, srslte::byte_buffer_t* pdu, srslte::log_ref gtpu_log); bool gtpu_write_header(gtpu_header_t* header, srslte::byte_buffer_t* pdu, srslog::basic_logger& logger);
std::string gtpu_ntoa(uint32_t addr); std::string gtpu_ntoa(uint32_t addr);
inline bool gtpu_supported_flags_check(gtpu_header_t* header, srslte::log_ref gtpu_log) inline bool gtpu_supported_flags_check(gtpu_header_t* header, srslog::basic_logger& logger)
{ {
// flags // flags
if ((header->flags & GTPU_FLAGS_VERSION_MASK) != GTPU_FLAGS_VERSION_V1) { if ((header->flags & GTPU_FLAGS_VERSION_MASK) != GTPU_FLAGS_VERSION_V1) {
gtpu_log->error("gtpu_header - Unhandled GTP-U Version. Flags: 0x%x\n", header->flags); logger.error("gtpu_header - Unhandled GTP-U Version. Flags: 0x%x", header->flags);
return false; return false;
} }
if (!(header->flags & GTPU_FLAGS_GTP_PROTOCOL)) { if (!(header->flags & GTPU_FLAGS_GTP_PROTOCOL)) {
gtpu_log->error("gtpu_header - Unhandled Protocol Type. Flags: 0x%x\n\n", header->flags); logger.error("gtpu_header - Unhandled Protocol Type. Flags: 0x%x", header->flags);
return false; return false;
} }
if (header->flags & GTPU_FLAGS_PACKET_NUM) { if (header->flags & GTPU_FLAGS_PACKET_NUM) {
gtpu_log->error("gtpu_header - Unhandled Packet Number. Flags: 0x%x\n\n", header->flags); logger.error("gtpu_header - Unhandled Packet Number. Flags: 0x%x", header->flags);
return false; return false;
} }
return true; return true;
} }
inline bool gtpu_supported_msg_type_check(gtpu_header_t* header, srslte::log_ref gtpu_log) inline bool gtpu_supported_msg_type_check(gtpu_header_t* header, srslog::basic_logger& logger)
{ {
// msg_tpye // msg_tpye
if (header->message_type != GTPU_MSG_DATA_PDU && header->message_type != GTPU_MSG_ECHO_REQUEST && if (header->message_type != GTPU_MSG_DATA_PDU && header->message_type != GTPU_MSG_ECHO_REQUEST &&
header->message_type != GTPU_MSG_ECHO_RESPONSE && header->message_type != GTPU_MSG_ERROR_INDICATION && header->message_type != GTPU_MSG_ECHO_RESPONSE && header->message_type != GTPU_MSG_ERROR_INDICATION &&
header->message_type != GTPU_MSG_END_MARKER) { header->message_type != GTPU_MSG_END_MARKER) {
gtpu_log->error("gtpu_header - Unhandled message type: 0x%x\n", header->message_type); logger.error("gtpu_header - Unhandled message type: 0x%x", header->message_type);
return false; return false;
} }
return true; return true;

@ -23,24 +23,24 @@ const static size_t HEADER_PDCP_PDU_NUMBER_SIZE = 4;
* Header pack/unpack helper functions * Header pack/unpack helper functions
* Ref: 3GPP TS 29.281 v10.1.0 Section 5 * Ref: 3GPP TS 29.281 v10.1.0 Section 5
***************************************************************************/ ***************************************************************************/
bool gtpu_write_header(gtpu_header_t* header, srslte::byte_buffer_t* pdu, srslte::log_ref gtpu_log) bool gtpu_write_header(gtpu_header_t* header, srslte::byte_buffer_t* pdu, srslog::basic_logger& logger)
{ {
// flags // flags
if (!gtpu_supported_flags_check(header, gtpu_log)) { if (!gtpu_supported_flags_check(header, logger)) {
gtpu_log->error("gtpu_write_header - Unhandled GTP-U Flags. Flags: 0x%x\n", header->flags); logger.error("gtpu_write_header - Unhandled GTP-U Flags. Flags: 0x%x", header->flags);
return false; return false;
} }
// msg type // msg type
if (!gtpu_supported_msg_type_check(header, gtpu_log)) { if (!gtpu_supported_msg_type_check(header, logger)) {
gtpu_log->error("gtpu_write_header - Unhandled GTP-U Message Type. Message Type: 0x%x\n", header->message_type); logger.error("gtpu_write_header - Unhandled GTP-U Message Type. Message Type: 0x%x", header->message_type);
return false; return false;
} }
// If E, S or PN are set, the header is longer // If E, S or PN are set, the header is longer
if (header->flags & (GTPU_FLAGS_EXTENDED_HDR | GTPU_FLAGS_SEQUENCE | GTPU_FLAGS_PACKET_NUM)) { if (header->flags & (GTPU_FLAGS_EXTENDED_HDR | GTPU_FLAGS_SEQUENCE | GTPU_FLAGS_PACKET_NUM)) {
if (pdu->get_headroom() < GTPU_EXTENDED_HEADER_LEN) { if (pdu->get_headroom() < GTPU_EXTENDED_HEADER_LEN) {
gtpu_log->error("gtpu_write_header - No room in PDU for header\n"); logger.error("gtpu_write_header - No room in PDU for header");
return false; return false;
} }
pdu->msg -= GTPU_EXTENDED_HEADER_LEN; pdu->msg -= GTPU_EXTENDED_HEADER_LEN;
@ -51,7 +51,7 @@ bool gtpu_write_header(gtpu_header_t* header, srslte::byte_buffer_t* pdu, srslte
} }
} else { } else {
if (pdu->get_headroom() < GTPU_BASE_HEADER_LEN) { if (pdu->get_headroom() < GTPU_BASE_HEADER_LEN) {
gtpu_log->error("gtpu_write_header - No room in PDU for header\n"); logger.error("gtpu_write_header - No room in PDU for header");
return false; return false;
} }
pdu->msg -= GTPU_BASE_HEADER_LEN; pdu->msg -= GTPU_BASE_HEADER_LEN;
@ -101,7 +101,10 @@ bool gtpu_write_header(gtpu_header_t* header, srslte::byte_buffer_t* pdu, srslte
return true; return true;
} }
bool gtpu_read_ext_header(srslte::byte_buffer_t* pdu, uint8_t** ptr, gtpu_header_t* header, srslte::log_ref gtpu_log) bool gtpu_read_ext_header(srslte::byte_buffer_t* pdu,
uint8_t** ptr,
gtpu_header_t* header,
srslog::basic_logger& logger)
{ {
if ((header->flags & GTPU_FLAGS_EXTENDED_HDR) == 0 or header->next_ext_hdr_type == 0) { if ((header->flags & GTPU_FLAGS_EXTENDED_HDR) == 0 or header->next_ext_hdr_type == 0) {
return true; return true;
@ -116,13 +119,13 @@ bool gtpu_read_ext_header(srslte::byte_buffer_t* pdu, uint8_t** ptr, gtpu_header
(*ptr)++; (*ptr)++;
} }
} else { } else {
gtpu_log->error("gtpu_read_header - Unhandled GTP-U Extension Header Type: 0x%x\n", header->next_ext_hdr_type); logger.error("gtpu_read_header - Unhandled GTP-U Extension Header Type: 0x%x", header->next_ext_hdr_type);
return false; return false;
} }
return true; return true;
} }
bool gtpu_read_header(srslte::byte_buffer_t* pdu, gtpu_header_t* header, srslte::log_ref gtpu_log) bool gtpu_read_header(srslte::byte_buffer_t* pdu, gtpu_header_t* header, srslog::basic_logger& logger)
{ {
uint8_t* ptr = pdu->msg; uint8_t* ptr = pdu->msg;
@ -136,14 +139,14 @@ bool gtpu_read_header(srslte::byte_buffer_t* pdu, gtpu_header_t* header, srslte:
ptr += 4; ptr += 4;
// flags // flags
if (!gtpu_supported_flags_check(header, gtpu_log)) { if (!gtpu_supported_flags_check(header, logger)) {
gtpu_log->error("gtpu_read_header - Unhandled GTP-U Flags. Flags: 0x%x\n", header->flags); logger.error("gtpu_read_header - Unhandled GTP-U Flags. Flags: 0x%x", header->flags);
return false; return false;
} }
// message_type // message_type
if (!gtpu_supported_msg_type_check(header, gtpu_log)) { if (!gtpu_supported_msg_type_check(header, logger)) {
gtpu_log->error("gtpu_read_header - Unhandled GTP-U Message Type. Flags: 0x%x\n", header->message_type); logger.error("gtpu_read_header - Unhandled GTP-U Message Type. Flags: 0x%x", header->message_type);
return false; return false;
} }
@ -161,7 +164,7 @@ bool gtpu_read_header(srslte::byte_buffer_t* pdu, gtpu_header_t* header, srslte:
header->next_ext_hdr_type = *ptr; header->next_ext_hdr_type = *ptr;
ptr++; ptr++;
if (not gtpu_read_ext_header(pdu, &ptr, header, gtpu_log)) { if (not gtpu_read_ext_header(pdu, &ptr, header, logger)) {
return false; return false;
} }
} else { } else {

@ -69,7 +69,6 @@ private:
std::string gtp_bind_addr; std::string gtp_bind_addr;
std::string mme_addr; std::string mme_addr;
srsenb::pdcp_interface_gtpu* pdcp = nullptr; srsenb::pdcp_interface_gtpu* pdcp = nullptr;
srslte::log_ref gtpu_log;
srslog::basic_logger& logger; srslog::basic_logger& logger;
// Class to create // Class to create
@ -88,7 +87,6 @@ private:
private: private:
gtpu* parent = nullptr; gtpu* parent = nullptr;
pdcp_interface_gtpu* pdcp = nullptr; pdcp_interface_gtpu* pdcp = nullptr;
srslte::log_ref gtpu_log;
srslog::basic_logger& logger; srslog::basic_logger& logger;
std::string m1u_multiaddr; std::string m1u_multiaddr;
std::string m1u_if_addr; std::string m1u_if_addr;

@ -21,7 +21,7 @@
using namespace srslte; using namespace srslte;
namespace srsenb { namespace srsenb {
gtpu::gtpu(srslog::basic_logger& logger) : m1u(this), gtpu_log("GTPU"), logger(logger) {} gtpu::gtpu(srslog::basic_logger& logger) : m1u(this), logger(logger) {}
int gtpu::init(std::string gtp_bind_addr_, int gtpu::init(std::string gtp_bind_addr_,
std::string mme_addr_, std::string mme_addr_,
@ -128,7 +128,7 @@ void gtpu::send_pdu_to_tunnel(tunnel& tx_tun, srslte::unique_byte_buffer_t pdu,
servaddr.sin_addr.s_addr = htonl(tx_tun.spgw_addr); servaddr.sin_addr.s_addr = htonl(tx_tun.spgw_addr);
servaddr.sin_port = htons(GTPU_PORT); servaddr.sin_port = htons(GTPU_PORT);
if (!gtpu_write_header(&header, pdu.get(), gtpu_log)) { if (!gtpu_write_header(&header, pdu.get(), logger)) {
logger.error("Error writing GTP-U Header. Flags 0x%x, Message Type 0x%x", header.flags, header.message_type); logger.error("Error writing GTP-U Header. Flags 0x%x, Message Type 0x%x", header.flags, header.message_type);
return; return;
} }
@ -225,12 +225,12 @@ void gtpu::mod_bearer_rnti(uint16_t old_rnti, uint16_t new_rnti)
logger.info("Modifying bearer rnti. Old rnti: 0x%x, new rnti: 0x%x", old_rnti, new_rnti); logger.info("Modifying bearer rnti. Old rnti: 0x%x, new rnti: 0x%x", old_rnti, new_rnti);
if (ue_teidin_db.count(new_rnti) != 0) { if (ue_teidin_db.count(new_rnti) != 0) {
gtpu_log->error("New rnti already exists, aborting.\n"); logger.error("New rnti already exists, aborting.");
return; return;
} }
auto old_it = ue_teidin_db.find(old_rnti); auto old_it = ue_teidin_db.find(old_rnti);
if (old_it == ue_teidin_db.end()) { if (old_it == ue_teidin_db.end()) {
gtpu_log->error("Old rnti does not exist, aborting.\n"); logger.error("Old rnti does not exist, aborting.");
return; return;
} }
@ -285,7 +285,7 @@ void gtpu::handle_gtpu_s1u_rx_packet(srslte::unique_byte_buffer_t pdu, const soc
pdu->set_timestamp(); pdu->set_timestamp();
gtpu_header_t header; gtpu_header_t header;
if (not gtpu_read_header(pdu.get(), &header, gtpu_log)) { if (not gtpu_read_header(pdu.get(), &header, logger)) {
return; return;
} }
@ -416,7 +416,7 @@ void gtpu::error_indication(in_addr_t addr, in_port_t port, uint32_t err_teid)
header.n_pdu = 0; header.n_pdu = 0;
header.next_ext_hdr_type = 0; header.next_ext_hdr_type = 0;
gtpu_write_header(&header, pdu.get(), gtpu_log); gtpu_write_header(&header, pdu.get(), logger);
struct sockaddr_in servaddr; struct sockaddr_in servaddr;
servaddr.sin_family = AF_INET; servaddr.sin_family = AF_INET;
@ -446,7 +446,7 @@ void gtpu::echo_response(in_addr_t addr, in_port_t port, uint16_t seq)
header.n_pdu = 0; header.n_pdu = 0;
header.next_ext_hdr_type = 0; header.next_ext_hdr_type = 0;
gtpu_write_header(&header, pdu.get(), gtpu_log); gtpu_write_header(&header, pdu.get(), logger);
struct sockaddr_in servaddr; struct sockaddr_in servaddr;
servaddr.sin_family = AF_INET; servaddr.sin_family = AF_INET;
@ -473,7 +473,7 @@ void gtpu::end_marker(uint32_t teidin)
header.teid = tunnel.teid_out; header.teid = tunnel.teid_out;
header.length = 0; header.length = 0;
gtpu_write_header(&header, pdu.get(), gtpu_log); gtpu_write_header(&header, pdu.get(), logger);
struct sockaddr_in servaddr = {}; struct sockaddr_in servaddr = {};
servaddr.sin_family = AF_INET; servaddr.sin_family = AF_INET;
@ -502,7 +502,7 @@ srslte::span<uint32_t> gtpu::get_lcid_teids(uint16_t rnti, uint32_t lcid)
auto ue_it = ue_teidin_db.find(rnti); auto ue_it = ue_teidin_db.find(rnti);
if (ue_it == ue_teidin_db.end() or lcid < SRSENB_N_SRB or lcid >= SRSENB_N_RADIO_BEARERS or if (ue_it == ue_teidin_db.end() or lcid < SRSENB_N_SRB or lcid >= SRSENB_N_RADIO_BEARERS or
ue_it->second[lcid].empty()) { ue_it->second[lcid].empty()) {
logger.error("Could not find bearer rnti=0x%x, lcid=%d\n", rnti, lcid); logger.error("Could not find bearer rnti=0x%x, lcid=%d", rnti, lcid);
return {}; return {};
} }
return ue_it->second[lcid]; return ue_it->second[lcid];
@ -572,7 +572,6 @@ bool gtpu::m1u_handler::init(std::string m1u_multiaddr_, std::string m1u_if_addr
m1u_multiaddr = std::move(m1u_multiaddr_); m1u_multiaddr = std::move(m1u_multiaddr_);
m1u_if_addr = std::move(m1u_if_addr_); m1u_if_addr = std::move(m1u_if_addr_);
pdcp = parent->pdcp; pdcp = parent->pdcp;
gtpu_log = parent->gtpu_log;
// Set up sink socket // Set up sink socket
struct sockaddr_in bindaddr = {}; struct sockaddr_in bindaddr = {};
@ -616,7 +615,7 @@ void gtpu::m1u_handler::handle_rx_packet(srslte::unique_byte_buffer_t pdu, const
logger.debug("Received %d bytes from M1-U interface", pdu->N_bytes); logger.debug("Received %d bytes from M1-U interface", pdu->N_bytes);
gtpu_header_t header; gtpu_header_t header;
gtpu_read_header(pdu.get(), &header, gtpu_log); gtpu_read_header(pdu.get(), &header, logger);
pdcp->write_sdu(SRSLTE_MRNTI, lcid_counter, std::move(pdu)); pdcp->write_sdu(SRSLTE_MRNTI, lcid_counter, std::move(pdu));
} }

@ -98,7 +98,7 @@ srslte::unique_byte_buffer_t encode_gtpu_packet(srslte::span<uint8_t> data,
header.length = pdu->N_bytes; header.length = pdu->N_bytes;
header.teid = teid; header.teid = teid;
gtpu_write_header(&header, pdu.get(), srslte::log_ref("GTPU")); gtpu_write_header(&header, pdu.get(), srslog::fetch_basic_logger("GTPU"));
return pdu; return pdu;
} }
@ -113,7 +113,7 @@ srslte::unique_byte_buffer_t encode_end_marker(uint32_t teid)
header.length = 0; header.length = 0;
header.teid = teid; header.teid = teid;
gtpu_write_header(&header, pdu.get(), srslte::log_ref("GTPU")); gtpu_write_header(&header, pdu.get(), srslog::fetch_basic_logger("GTPU"));
return pdu; return pdu;
} }
@ -247,17 +247,16 @@ int test_gtpu_direct_tunneling()
int main() int main()
{ {
// Setup logging. // Setup logging.
srslog::sink& log_sink = srslog::fetch_stdout_sink(); auto& logger = srslog::fetch_basic_logger("GTPU", false);
srslog::log_channel* chan = srslog::create_log_channel("gtpu_test", log_sink); logger.set_level(srslog::basic_levels::debug);
srslte::srslog_wrapper log_wrapper(*chan); logger.set_hex_dump_max_size(-1);
// Start the log backend. // Start the log backend.
srslog::init(); srslog::init();
srslte::logmap::set_default_log_level(srslte::LOG_LEVEL_DEBUG);
srslte::logmap::set_default_hex_limit(100000);
TESTASSERT(srsenb::test_gtpu_direct_tunneling() == SRSLTE_SUCCESS); TESTASSERT(srsenb::test_gtpu_direct_tunneling() == SRSLTE_SUCCESS);
srslog::flush(); srslog::flush();
srslte::console("Success"); srslte::console("Success");
} }

@ -55,7 +55,7 @@ class mbms_gw : public srslte::thread
public: public:
static mbms_gw* get_instance(void); static mbms_gw* get_instance(void);
static void cleanup(void); static void cleanup(void);
int init(mbms_gw_args_t* args, srslte::log_ref mbms_gw_log); int init(mbms_gw_args_t* args);
void stop(); void stop();
void run_thread(); void run_thread();
@ -72,7 +72,6 @@ private:
/* Members */ /* Members */
bool m_running; bool m_running;
srslte::log_ref m_mbms_gw_log;
srslog::basic_logger& m_logger = srslog::fetch_basic_logger("MBMS"); srslog::basic_logger& m_logger = srslog::fetch_basic_logger("MBMS");
bool m_sgi_mb_up; bool m_sgi_mb_up;

@ -29,7 +29,7 @@ class spgw::gtpu : public gtpu_interface_gtpc
public: public:
gtpu(); gtpu();
virtual ~gtpu(); virtual ~gtpu();
int init(spgw_args_t* args, spgw* spgw, gtpc_interface_gtpu* gtpc, srslte::log_ref gtpu_log); int init(spgw_args_t* args, spgw* spgw, gtpc_interface_gtpu* gtpc);
void stop(); void stop();
int init_sgi(spgw_args_t* args); int init_sgi(spgw_args_t* args);
@ -65,8 +65,6 @@ public:
// for downlink notifications. // for downlink notifications.
srslog::basic_logger& m_logger = srslog::fetch_basic_logger("GTPU"); srslog::basic_logger& m_logger = srslog::fetch_basic_logger("GTPU");
//:TODO: remove this once srslte common code loggers have been upgraded.
srslte::log_ref m_gtpu_log;
}; };
inline int spgw::gtpu::get_sgi() inline int spgw::gtpu::get_sgi()

@ -61,7 +61,7 @@ class spgw : public srslte::thread
public: public:
static spgw* get_instance(void); static spgw* get_instance(void);
static void cleanup(void); static void cleanup(void);
int init(spgw_args_t* args, srslte::log_ref gtpu_log, const std::map<std::string, uint64_t>& ip_to_imsi); int init(spgw_args_t* args, const std::map<std::string, uint64_t>& ip_to_imsi);
void stop(); void stop();
void run_thread(); void run_thread();

@ -472,7 +472,7 @@ int main(int argc, char* argv[])
} }
spgw* spgw = spgw::get_instance(); spgw* spgw = spgw::get_instance();
if (spgw->init(&args.spgw_args, gtpu_log, hss->get_ip_to_imsi())) { if (spgw->init(&args.spgw_args, hss->get_ip_to_imsi())) {
cout << "Error initializing SP-GW" << endl; cout << "Error initializing SP-GW" << endl;
exit(1); exit(1);
} }

@ -67,7 +67,6 @@ string config_file;
void parse_args(all_args_t* args, int argc, char* argv[]) void parse_args(all_args_t* args, int argc, char* argv[])
{ {
string mbms_gw_name; string mbms_gw_name;
string mbms_gw_sgi_mb_if_name; string mbms_gw_sgi_mb_if_name;
string mbms_gw_sgi_mb_if_addr; string mbms_gw_sgi_mb_if_addr;
@ -216,7 +215,7 @@ int main(int argc, char* argv[])
mbms_gw_logger.set_hex_dump_max_size(args.log_args.mbms_gw_hex_limit); mbms_gw_logger.set_hex_dump_max_size(args.log_args.mbms_gw_hex_limit);
mbms_gw* mbms_gw = mbms_gw::get_instance(); mbms_gw* mbms_gw = mbms_gw::get_instance();
if (mbms_gw->init(&args.mbms_gw_args, mbms_gw_log)) { if (mbms_gw->init(&args.mbms_gw_args)) {
cout << "Error initializing MBMS-GW" << endl; cout << "Error initializing MBMS-GW" << endl;
exit(1); exit(1);
} }

@ -60,13 +60,10 @@ void mbms_gw::cleanup(void)
pthread_mutex_unlock(&mbms_gw_instance_mutex); pthread_mutex_unlock(&mbms_gw_instance_mutex);
} }
int mbms_gw::init(mbms_gw_args_t* args, srslte::log_ref mbms_gw_log) int mbms_gw::init(mbms_gw_args_t* args)
{ {
int err; int err;
// Init log
m_mbms_gw_log = mbms_gw_log;
err = init_sgi_mb_if(args); err = init_sgi_mb_if(args);
if (err != SRSLTE_SUCCESS) { if (err != SRSLTE_SUCCESS) {
srslte::console("Error initializing SGi-MB.\n"); srslte::console("Error initializing SGi-MB.\n");
@ -275,7 +272,7 @@ void mbms_gw::handle_sgi_md_pdu(srslte::byte_buffer_t* msg)
} }
// Write GTP-U header into packet // Write GTP-U header into packet
if (!srslte::gtpu_write_header(&header, msg, m_mbms_gw_log)) { if (!srslte::gtpu_write_header(&header, msg, m_logger)) {
srslte::console("Error writing GTP-U header on PDU\n"); srslte::console("Error writing GTP-U header on PDU\n");
} }

@ -43,13 +43,10 @@ spgw::gtpu::~gtpu()
return; return;
} }
int spgw::gtpu::init(spgw_args_t* args, spgw* spgw, gtpc_interface_gtpu* gtpc, srslte::log_ref gtpu_log) int spgw::gtpu::init(spgw_args_t* args, spgw* spgw, gtpc_interface_gtpu* gtpc)
{ {
int err; int err;
// Init log
m_gtpu_log = gtpu_log;
// Store interfaces // Store interfaces
m_spgw = spgw; m_spgw = spgw;
m_gtpc = gtpc; m_gtpc = gtpc;
@ -243,7 +240,7 @@ void spgw::gtpu::handle_sgi_pdu(srslte::unique_byte_buffer_t msg)
void spgw::gtpu::handle_s1u_pdu(srslte::byte_buffer_t* msg) void spgw::gtpu::handle_s1u_pdu(srslte::byte_buffer_t* msg)
{ {
srslte::gtpu_header_t header; srslte::gtpu_header_t header;
srslte::gtpu_read_header(msg, &header, m_gtpu_log); srslte::gtpu_read_header(msg, &header, m_logger);
m_logger.debug("Received PDU from S1-U. Bytes=%d", msg->N_bytes); m_logger.debug("Received PDU from S1-U. Bytes=%d", msg->N_bytes);
m_logger.debug("TEID 0x%x. Bytes=%d", header.teid, msg->N_bytes); m_logger.debug("TEID 0x%x. Bytes=%d", header.teid, msg->N_bytes);
@ -276,7 +273,7 @@ void spgw::gtpu::send_s1u_pdu(srslte::gtp_fteid_t enb_fteid, srslte::byte_buffer
// Write header into packet // Write header into packet
int n; int n;
if (!srslte::gtpu_write_header(&header, msg, m_gtpu_log)) { if (!srslte::gtpu_write_header(&header, msg, m_logger)) {
m_logger.error("Error writing GTP-U header on PDU"); m_logger.error("Error writing GTP-U header on PDU");
goto out; goto out;
} }

@ -56,12 +56,12 @@ void spgw::cleanup()
pthread_mutex_unlock(&spgw_instance_mutex); pthread_mutex_unlock(&spgw_instance_mutex);
} }
int spgw::init(spgw_args_t* args, srslte::log_ref gtpu_log, const std::map<std::string, uint64_t>& ip_to_imsi) int spgw::init(spgw_args_t* args, const std::map<std::string, uint64_t>& ip_to_imsi)
{ {
int err; int err;
// Init GTP-U // Init GTP-U
if (m_gtpu->init(args, this, m_gtpc, gtpu_log) != SRSLTE_SUCCESS) { if (m_gtpu->init(args, this, m_gtpc) != SRSLTE_SUCCESS) {
srslte::console("Could not initialize the SPGW's GTP-U.\n"); srslte::console("Could not initialize the SPGW's GTP-U.\n");
return SRSLTE_ERROR_CANT_START; return SRSLTE_ERROR_CANT_START;
} }

Loading…
Cancel
Save