diff --git a/srsenb/hdr/upper/gtpu.h b/srsenb/hdr/upper/gtpu.h index b25139a17..a71f187f6 100644 --- a/srsenb/hdr/upper/gtpu.h +++ b/srsenb/hdr/upper/gtpu.h @@ -70,8 +70,6 @@ private: bool enable_mbsfn; std::string gtp_bind_addr; std::string mme_addr; - std::string m1u_multiaddr; - std::string m1u_if_addr; srsenb::pdcp_interface_gtpu *pdcp; srslte::log *gtpu_log; @@ -79,7 +77,7 @@ private: class mch_thread : public thread { public: mch_thread() : initiated(false),running(false),run_enable(false),pool(NULL) {} - bool init(pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_); + bool init(std::string m1u_multiaddr_, std::string m1u_if_addr_, pdcp_interface_gtpu *pdcp_, srslte::log *gtpu_log_); void stop(); private: void run_thread(); @@ -94,6 +92,8 @@ private: srslte::log *gtpu_log; int m1u_sd; int lcid_counter; + std::string m1u_multiaddr; + std::string m1u_if_addr; srslte::byte_buffer_pool *pool; }; diff --git a/srsenb/src/upper/gtpu.cc b/srsenb/src/upper/gtpu.cc index 4f4df81b5..a1262956f 100644 --- a/srsenb/src/upper/gtpu.cc +++ b/srsenb/src/upper/gtpu.cc @@ -49,9 +49,6 @@ bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, std::string m gtpu_log = gtpu_log_; gtp_bind_addr = gtp_bind_addr_; mme_addr = mme_addr_; - m1u_multiaddr = m1u_multiaddr_; - m1u_if_addr = m1u_if_addr_; - pool = byte_buffer_pool::get_instance(); // Set up socket @@ -88,7 +85,7 @@ bool gtpu::init(std::string gtp_bind_addr_, std::string mme_addr_, std::string m // Start MCH thread if enabled this->enable_mbsfn = enable_mbsfn; if(enable_mbsfn) { - mchthread.init(pdcp, gtpu_log); + mchthread.init(m1u_multiaddr_, m1u_if_addr_, pdcp, gtpu_log); } return true; } @@ -322,16 +319,14 @@ void gtpu::rntilcid_to_teidin(uint16_t rnti, uint16_t lcid, uint32_t *teidin) /**************************************************************************** * Class to run the MCH thread ***************************************************************************/ -bool gtpu::mch_thread::init(pdcp_interface_gtpu *pdcp, srslte::log *gtpu_log) +bool gtpu::mch_thread::init(std::string m1u_multiaddr_, std::string m1u_if_addr_, pdcp_interface_gtpu *pdcp, srslte::log *gtpu_log) { pool = byte_buffer_pool::get_instance(); this->pdcp = pdcp; this->gtpu_log = gtpu_log; + m1u_multiaddr = m1u_multiaddr_; + m1u_if_addr = m1u_if_addr_; - -gtpu_log->info("M1-U initialized\n"); -return true; -} struct sockaddr_in bindaddr; // Set up sink socket