diff --git a/P25Gateway/Conf.cpp b/P25Gateway/Conf.cpp index 2828979..063ce13 100644 --- a/P25Gateway/Conf.cpp +++ b/P25Gateway/Conf.cpp @@ -41,7 +41,6 @@ m_file(file), m_callsign(), m_rptAddress(), m_rptPort(0U), -m_myAddress(), m_myPort(0U), m_debug(false), m_daemon(false), @@ -143,8 +142,6 @@ bool CConf::read() m_rptAddress = value; else if (::strcmp(key, "RptPort") == 0) m_rptPort = (unsigned int)::atoi(value); - else if (::strcmp(key, "LocalAddress") == 0) - m_myAddress = value; else if (::strcmp(key, "LocalPort") == 0) m_myPort = (unsigned int)::atoi(value); else if (::strcmp(key, "Debug") == 0) @@ -232,11 +229,6 @@ unsigned int CConf::getRptPort() const return m_rptPort; } -std::string CConf::getMyAddress() const -{ - return m_myAddress; -} - unsigned int CConf::getMyPort() const { return m_myPort; diff --git a/P25Gateway/Conf.h b/P25Gateway/Conf.h index 5e0d444..23c2624 100644 --- a/P25Gateway/Conf.h +++ b/P25Gateway/Conf.h @@ -34,7 +34,6 @@ public: std::string getCallsign() const; std::string getRptAddress() const; unsigned int getRptPort() const; - std::string getMyAddress() const; unsigned int getMyPort() const; bool getDebug() const; bool getDaemon() const; @@ -78,7 +77,6 @@ private: std::string m_callsign; std::string m_rptAddress; unsigned int m_rptPort; - std::string m_myAddress; unsigned int m_myPort; bool m_debug; bool m_daemon; diff --git a/P25Gateway/P25Gateway.cpp b/P25Gateway/P25Gateway.cpp index 41f5707..225967b 100644 --- a/P25Gateway/P25Gateway.cpp +++ b/P25Gateway/P25Gateway.cpp @@ -189,7 +189,7 @@ void CP25Gateway::run() return; } - CRptNetwork localNetwork(m_conf.getMyAddress(), m_conf.getMyPort(), rptAddr, rptAddrLen, m_conf.getCallsign(), m_conf.getDebug()); + CRptNetwork localNetwork(m_conf.getMyPort(), rptAddr, rptAddrLen, m_conf.getCallsign(), m_conf.getDebug()); ret = localNetwork.open(); if (!ret) { ::LogFinalise(); diff --git a/P25Gateway/P25Gateway.ini b/P25Gateway/P25Gateway.ini index 51fb785..16ab7ba 100644 --- a/P25Gateway/P25Gateway.ini +++ b/P25Gateway/P25Gateway.ini @@ -2,7 +2,6 @@ Callsign=G4KLX RptAddress=127.0.0.1 RptPort=32010 -LocalAddress=127.0.0.1 LocalPort=42020 Debug=0 Daemon=1 diff --git a/P25Gateway/RptNetwork.cpp b/P25Gateway/RptNetwork.cpp index c828133..7f777ff 100644 --- a/P25Gateway/RptNetwork.cpp +++ b/P25Gateway/RptNetwork.cpp @@ -24,21 +24,17 @@ #include #include -CRptNetwork::CRptNetwork(const std::string& myAddr, unsigned int myPort, const sockaddr_storage& rptAddr, unsigned int rptAddrLen, const std::string& callsign, bool debug) : -m_myAddr(), -m_myAddrLen(0U), +CRptNetwork::CRptNetwork(unsigned int myPort, const sockaddr_storage& rptAddr, unsigned int rptAddrLen, const std::string& callsign, bool debug) : m_rptAddr(rptAddr), m_rptAddrLen(rptAddrLen), m_callsign(callsign), -m_socket(myAddr, myPort), +m_socket(myPort), m_debug(debug), m_timer(1000U, 5U) { assert(myPort > 0U); assert(rptAddrLen > 0U); - CUDPSocket::lookup(myAddr, myPort, m_myAddr, m_myAddrLen); - m_callsign.resize(10U, ' '); } @@ -48,14 +44,9 @@ CRptNetwork::~CRptNetwork() bool CRptNetwork::open() { - if (m_myAddrLen == 0U) { - LogError("Unable to resolve the local address and port"); - return false; - } - LogInfo("Opening Rpt network connection"); - bool ret = m_socket.open(m_myAddr); + bool ret = m_socket.open(m_rptAddr); if (ret) { m_timer.start(); diff --git a/P25Gateway/RptNetwork.h b/P25Gateway/RptNetwork.h index b918e2d..e373305 100644 --- a/P25Gateway/RptNetwork.h +++ b/P25Gateway/RptNetwork.h @@ -27,7 +27,7 @@ class CRptNetwork { public: - CRptNetwork(const std::string& myAddr, unsigned int myPort, const sockaddr_storage& rptAddr, unsigned int rptAddrLen, const std::string& callsign, bool debug); + CRptNetwork(unsigned int myPort, const sockaddr_storage& rptAddr, unsigned int rptAddrLen, const std::string& callsign, bool debug); ~CRptNetwork(); bool open(); @@ -41,8 +41,6 @@ public: void close(); private: - sockaddr_storage m_myAddr; - unsigned int m_myAddrLen; sockaddr_storage m_rptAddr; unsigned int m_rptAddrLen; std::string m_callsign;