mirror of
https://github.com/g4klx/ircDDBGateway.git
synced 2026-02-20 22:24:19 +01:00
Adding more IPv6 support.
This commit is contained in:
parent
b0bf79fc21
commit
e550499242
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2013 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2013,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -29,8 +29,8 @@ m_band1(0x00U),
|
|||
m_band2(0x02U),
|
||||
m_band3(0x01U),
|
||||
m_data(NULL),
|
||||
m_yourAddress(),
|
||||
m_yourPort(0U),
|
||||
m_yourAddr(),
|
||||
m_yourAddrLen(0U),
|
||||
m_myPort(0U),
|
||||
m_errors(0U),
|
||||
m_text(),
|
||||
|
|
@ -47,8 +47,8 @@ m_band1(data.m_band1),
|
|||
m_band2(data.m_band2),
|
||||
m_band3(data.m_band3),
|
||||
m_data(NULL),
|
||||
m_yourAddress(data.m_yourAddress),
|
||||
m_yourPort(data.m_yourPort),
|
||||
m_yourAddr(data.m_yourAddr),
|
||||
m_yourAddrLen(data.m_yourAddrLen),
|
||||
m_myPort(data.m_myPort),
|
||||
m_errors(data.m_errors),
|
||||
m_text(data.m_text),
|
||||
|
|
@ -63,7 +63,7 @@ CAMBEData::~CAMBEData()
|
|||
delete[] m_data;
|
||||
}
|
||||
|
||||
bool CAMBEData::setIcomRepeaterData(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort)
|
||||
bool CAMBEData::setIcomRepeaterData(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 29U);
|
||||
|
|
@ -83,13 +83,13 @@ bool CAMBEData::setIcomRepeaterData(const unsigned char *data, unsigned int leng
|
|||
::memcpy(m_data, data + 17U, DV_FRAME_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAMBEData::setHBRepeaterData(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort)
|
||||
bool CAMBEData::setHBRepeaterData(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 21U);
|
||||
|
|
@ -106,13 +106,13 @@ bool CAMBEData::setHBRepeaterData(const unsigned char *data, unsigned int length
|
|||
::memcpy(m_data, data + 9U, DV_FRAME_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAMBEData::setG2Data(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort)
|
||||
bool CAMBEData::setG2Data(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 27U);
|
||||
|
|
@ -125,13 +125,13 @@ bool CAMBEData::setG2Data(const unsigned char *data, unsigned int length, const
|
|||
|
||||
::memcpy(m_data, data + 15U, DV_FRAME_LENGTH_BYTES);
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAMBEData::setDExtraData(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CAMBEData::setDExtraData(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 27U);
|
||||
|
|
@ -144,14 +144,14 @@ bool CAMBEData::setDExtraData(const unsigned char *data, unsigned int length, co
|
|||
|
||||
::memcpy(m_data, data + 15U, DV_FRAME_LENGTH_BYTES);
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAMBEData::setDPlusData(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CAMBEData::setDPlusData(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 29U);
|
||||
|
|
@ -174,19 +174,19 @@ bool CAMBEData::setDPlusData(const unsigned char *data, unsigned int length, con
|
|||
::memcpy(m_data, data + 17U, DV_FRAME_LENGTH_BYTES);
|
||||
}
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAMBEData::setDCSData(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CAMBEData::setDCSData(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 100U);
|
||||
|
||||
m_header.setDCSData(data, length, yourAddress, yourPort, myPort);
|
||||
m_header.setDCSData(data, length, yourAddr, yourAddrLen, myPort);
|
||||
|
||||
m_id = data[44] * 256U + data[43];
|
||||
|
||||
|
|
@ -196,19 +196,19 @@ bool CAMBEData::setDCSData(const unsigned char *data, unsigned int length, const
|
|||
|
||||
m_rptSeq = data[60] * 65536U + data[59] * 256U + data[58];
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CAMBEData::setCCSData(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CAMBEData::setCCSData(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 100U);
|
||||
|
||||
m_header.setCCSData(data, length, yourAddress, yourPort, myPort);
|
||||
m_header.setCCSData(data, length, yourAddr, yourAddrLen, myPort);
|
||||
|
||||
m_id = data[44] * 256U + data[43];
|
||||
|
||||
|
|
@ -218,8 +218,8 @@ bool CAMBEData::setCCSData(const unsigned char *data, unsigned int length, const
|
|||
|
||||
m_rptSeq = data[60] * 65536U + data[59] * 256U + data[58];
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
|
|
@ -552,10 +552,10 @@ bool CAMBEData::isSync() const
|
|||
return (m_outSeq & 0x1FU) == 0x00U;
|
||||
}
|
||||
|
||||
void CAMBEData::setDestination(const in_addr& address, unsigned int port)
|
||||
void CAMBEData::setDestination(const sockaddr_storage& addr, unsigned int addrLen)
|
||||
{
|
||||
m_yourAddress = address;
|
||||
m_yourPort = port;
|
||||
m_yourAddr = addr;
|
||||
m_yourAddrLen = addrLen;
|
||||
}
|
||||
|
||||
void CAMBEData::setText(const wxString& text)
|
||||
|
|
@ -563,14 +563,14 @@ void CAMBEData::setText(const wxString& text)
|
|||
m_text = text;
|
||||
}
|
||||
|
||||
in_addr CAMBEData::getYourAddress() const
|
||||
sockaddr_storage CAMBEData::getYourAddr() const
|
||||
{
|
||||
return m_yourAddress;
|
||||
return m_yourAddr;
|
||||
}
|
||||
|
||||
unsigned int CAMBEData::getYourPort() const
|
||||
unsigned int CAMBEData::getYourAddrLen() const
|
||||
{
|
||||
return m_yourPort;
|
||||
return m_yourAddrLen;
|
||||
}
|
||||
|
||||
unsigned int CAMBEData::getMyPort() const
|
||||
|
|
@ -615,8 +615,8 @@ CAMBEData& CAMBEData::operator=(const CAMBEData& data)
|
|||
m_band1 = data.m_band1;
|
||||
m_band2 = data.m_band2;
|
||||
m_band3 = data.m_band3;
|
||||
m_yourAddress = data.m_yourAddress;
|
||||
m_yourPort = data.m_yourPort;
|
||||
m_yourAddr = data.m_yourAddr;
|
||||
m_yourAddrLen = data.m_yourAddrLen;
|
||||
m_myPort = data.m_myPort;
|
||||
m_errors = data.m_errors;
|
||||
m_text = data.m_text;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2013 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2013,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -31,8 +31,8 @@ m_description1(description1),
|
|||
m_description2(description2),
|
||||
m_url(url),
|
||||
m_type(type),
|
||||
m_yourAddress(),
|
||||
m_yourPort(0U),
|
||||
m_yourAddr(),
|
||||
m_yourAddrLen(0U),
|
||||
m_myPort(0U)
|
||||
{
|
||||
}
|
||||
|
|
@ -48,8 +48,8 @@ m_description1(),
|
|||
m_description2(),
|
||||
m_url(),
|
||||
m_type(type),
|
||||
m_yourAddress(),
|
||||
m_yourPort(0U),
|
||||
m_yourAddr(),
|
||||
m_yourAddrLen(0U),
|
||||
m_myPort(0U)
|
||||
{
|
||||
}
|
||||
|
|
@ -65,8 +65,8 @@ m_description1(),
|
|||
m_description2(),
|
||||
m_url(),
|
||||
m_type(),
|
||||
m_yourAddress(),
|
||||
m_yourPort(0U),
|
||||
m_yourAddr(),
|
||||
m_yourAddrLen(0U),
|
||||
m_myPort(0U)
|
||||
{
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ CCCSData::~CCCSData()
|
|||
{
|
||||
}
|
||||
|
||||
bool CCCSData::setCCSData(const unsigned char *data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CCCSData::setCCSData(const unsigned char *data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
|
||||
|
|
@ -118,8 +118,8 @@ bool CCCSData::setCCSData(const unsigned char *data, unsigned int length, const
|
|||
return false;
|
||||
}
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
|
|
@ -170,20 +170,20 @@ CC_TYPE CCCSData::getType() const
|
|||
return m_type;
|
||||
}
|
||||
|
||||
void CCCSData::setDestination(const in_addr& address, unsigned int port)
|
||||
void CCCSData::setDestination(const sockaddr_storage& addr, unsigned int addrLen)
|
||||
{
|
||||
m_yourAddress = address;
|
||||
m_yourPort = port;
|
||||
m_yourAddr = addr;
|
||||
m_yourAddrLen = addrLen;
|
||||
}
|
||||
|
||||
in_addr CCCSData::getYourAddress() const
|
||||
sockaddr_storage CCCSData::getYourAddr() const
|
||||
{
|
||||
return m_yourAddress;
|
||||
return m_yourAddr;
|
||||
}
|
||||
|
||||
unsigned int CCCSData::getYourPort() const
|
||||
unsigned int CCCSData::getYourAddrLen() const
|
||||
{
|
||||
return m_yourPort;
|
||||
return m_yourAddrLen;
|
||||
}
|
||||
|
||||
unsigned int CCCSData::getMyPort() const
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2013 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2013,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -30,8 +30,8 @@ m_socket(addr, port),
|
|||
m_type(CT_NONE),
|
||||
m_buffer(NULL),
|
||||
m_length(0U),
|
||||
m_yourAddress(),
|
||||
m_yourPort(0U),
|
||||
m_yourAddr(),
|
||||
m_yourAddrLen(0U),
|
||||
m_myPort(port)
|
||||
{
|
||||
m_buffer = new unsigned char[BUFFER_LENGTH];
|
||||
|
|
@ -61,7 +61,7 @@ bool CCCSProtocolHandler::writeData(const CAMBEData& data)
|
|||
CUtils::dump(wxT("Sending Data"), buffer, length);
|
||||
#endif
|
||||
|
||||
return m_socket.write(buffer, length, data.getYourAddress(), data.getYourPort());
|
||||
return m_socket.write(buffer, length, data.getYourAddr(), data.getYourAddrLen());
|
||||
}
|
||||
|
||||
bool CCCSProtocolHandler::writePoll(const CPollData& poll)
|
||||
|
|
@ -73,7 +73,7 @@ bool CCCSProtocolHandler::writePoll(const CPollData& poll)
|
|||
CUtils::dump(wxT("Sending Poll"), buffer, length);
|
||||
#endif
|
||||
|
||||
return m_socket.write(buffer, length, poll.getYourAddress(), poll.getYourPort());
|
||||
return m_socket.write(buffer, length, poll.getYourAddr(), poll.getYourAddrLen());
|
||||
}
|
||||
|
||||
bool CCCSProtocolHandler::writeHeard(const CHeardData& heard)
|
||||
|
|
@ -85,7 +85,7 @@ bool CCCSProtocolHandler::writeHeard(const CHeardData& heard)
|
|||
CUtils::dump(wxT("Sending Heard"), buffer, length);
|
||||
#endif
|
||||
|
||||
return m_socket.write(buffer, length, heard.getAddress(), heard.getPort());
|
||||
return m_socket.write(buffer, length, heard.getAddr(), heard.getAddrLen());
|
||||
}
|
||||
|
||||
bool CCCSProtocolHandler::writeConnect(const CConnectData& connect)
|
||||
|
|
@ -97,7 +97,7 @@ bool CCCSProtocolHandler::writeConnect(const CConnectData& connect)
|
|||
CUtils::dump(wxT("Sending Connect"), buffer, length);
|
||||
#endif
|
||||
|
||||
return m_socket.write(buffer, length, connect.getYourAddress(), connect.getYourPort());
|
||||
return m_socket.write(buffer, length, connect.getYourAddr(), connect.getYourAddrLen());
|
||||
}
|
||||
|
||||
bool CCCSProtocolHandler::writeMisc(const CCCSData& data)
|
||||
|
|
@ -109,7 +109,7 @@ bool CCCSProtocolHandler::writeMisc(const CCCSData& data)
|
|||
CUtils::dump(wxT("Sending Misc"), buffer, length);
|
||||
#endif
|
||||
|
||||
return m_socket.write(buffer, length, data.getYourAddress(), data.getYourPort());
|
||||
return m_socket.write(buffer, length, data.getYourAddr(), data.getYourAddrLen());
|
||||
}
|
||||
|
||||
CCS_TYPE CCCSProtocolHandler::read()
|
||||
|
|
@ -128,7 +128,7 @@ bool CCCSProtocolHandler::readPackets()
|
|||
m_type = CT_NONE;
|
||||
|
||||
// No more data?
|
||||
int length = m_socket.read(m_buffer, BUFFER_LENGTH, m_yourAddress, m_yourPort);
|
||||
int length = m_socket.read(m_buffer, BUFFER_LENGTH, m_yourAddr, m_yourAddrLen);
|
||||
if (length <= 0)
|
||||
return false;
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ CAMBEData* CCCSProtocolHandler::readData()
|
|||
|
||||
CAMBEData* data = new CAMBEData;
|
||||
|
||||
bool res = data->setCCSData(m_buffer, m_length, m_yourAddress, m_yourPort, m_myPort);
|
||||
bool res = data->setCCSData(m_buffer, m_length, m_yourAddr, m_yourAddrLen, m_myPort);
|
||||
if (!res) {
|
||||
delete data;
|
||||
return NULL;
|
||||
|
|
@ -188,7 +188,7 @@ CConnectData* CCCSProtocolHandler::readConnect()
|
|||
|
||||
CConnectData* connect = new CConnectData;
|
||||
|
||||
bool res = connect->setCCSData(m_buffer, m_length, m_yourAddress, m_yourPort, m_myPort);
|
||||
bool res = connect->setCCSData(m_buffer, m_length, m_yourAddr, m_yourAddrLen, m_myPort);
|
||||
if (!res) {
|
||||
delete connect;
|
||||
return NULL;
|
||||
|
|
@ -204,7 +204,7 @@ CPollData* CCCSProtocolHandler::readPoll()
|
|||
|
||||
CPollData* poll = new CPollData;
|
||||
|
||||
bool res = poll->setCCSData(m_buffer, m_length, m_yourAddress, m_yourPort, m_myPort);
|
||||
bool res = poll->setCCSData(m_buffer, m_length, m_yourAddr, m_yourAddrLen, m_myPort);
|
||||
if (!res) {
|
||||
delete poll;
|
||||
return NULL;
|
||||
|
|
@ -220,7 +220,7 @@ CCCSData* CCCSProtocolHandler::readMisc()
|
|||
|
||||
CCCSData* data = new CCCSData;
|
||||
|
||||
bool res = data->setCCSData(m_buffer, m_length, m_yourAddress, m_yourPort, m_myPort);
|
||||
bool res = data->setCCSData(m_buffer, m_length, m_yourAddr, m_yourAddrLen, m_myPort);
|
||||
if (!res) {
|
||||
delete data;
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ private:
|
|||
CCS_TYPE m_type;
|
||||
unsigned char* m_buffer;
|
||||
unsigned int m_length;
|
||||
sockadd_storage m_yourAddr;
|
||||
sockaddr_storage m_yourAddr;
|
||||
unsigned int m_yourAddrLen;
|
||||
unsigned int m_myPort;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010,2011,2012,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -54,7 +54,7 @@ CUserData* CCacheManager::findUser(const wxString& user)
|
|||
if (gr == NULL)
|
||||
return NULL;
|
||||
|
||||
return new CUserData(user, ur->getRepeater(), gr->getGateway(), gr->getAddress());
|
||||
return new CUserData(user, ur->getRepeater(), gr->getGateway(), gr->getAddr(), gr->getAddrLen());
|
||||
}
|
||||
|
||||
CGatewayData* CCacheManager::findGateway(const wxString& gateway)
|
||||
|
|
@ -65,7 +65,7 @@ CGatewayData* CCacheManager::findGateway(const wxString& gateway)
|
|||
if (gr == NULL)
|
||||
return NULL;
|
||||
|
||||
return new CGatewayData(gateway, gr->getAddress(), gr->getProtocol());
|
||||
return new CGatewayData(gateway, gr->getAddr(), gr->getAddrLen(), gr->getProtocol());
|
||||
}
|
||||
|
||||
CRepeaterData* CCacheManager::findRepeater(const wxString& repeater)
|
||||
|
|
@ -87,7 +87,7 @@ CRepeaterData* CCacheManager::findRepeater(const wxString& repeater)
|
|||
if (gr == NULL)
|
||||
return NULL;
|
||||
|
||||
return new CRepeaterData(repeater, gr->getGateway(), gr->getAddress(), gr->getProtocol());
|
||||
return new CRepeaterData(repeater, gr->getGateway(), gr->getAddr(), gr->getAddrLen(), gr->getProtocol());
|
||||
}
|
||||
|
||||
void CCacheManager::updateUser(const wxString& user, const wxString& repeater, const wxString& gateway, const wxString& address, const wxString& timestamp, DSTAR_PROTOCOL protocol, bool addrLock, bool protoLock)
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
|
||||
unsigned int getAddrLen() const
|
||||
{
|
||||
return m_addLen;
|
||||
return m_addrLen;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2012,2013 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010,2012,2013,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -24,75 +24,75 @@
|
|||
|
||||
const wxChar* HTML = wxT("<table border=\"0\" width=\"95%%\"><tr><td width=\"4%%\"><img border=\"0\" src=%s></td><td width=\"96%%\"><font size=\"2\"><b>%s</b> ircDDB Gateway %s</font></td></tr></table>");
|
||||
|
||||
CConnectData::CConnectData(GATEWAY_TYPE gatewayType, const wxString& repeater, const wxString& reflector, CD_TYPE type, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort) :
|
||||
CConnectData::CConnectData(GATEWAY_TYPE gatewayType, const wxString& repeater, const wxString& reflector, CD_TYPE type, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort) :
|
||||
m_gatewayType(gatewayType),
|
||||
m_repeater(repeater),
|
||||
m_reflector(reflector),
|
||||
m_type(type),
|
||||
m_locator(),
|
||||
m_yourAddress(yourAddress),
|
||||
m_yourPort(yourPort),
|
||||
m_yourAddr(yourAddr),
|
||||
m_yourAddrLen(yourAddrLen),
|
||||
m_myPort(myPort)
|
||||
{
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
wxASSERT(!repeater.IsEmpty());
|
||||
wxASSERT(!reflector.IsEmpty());
|
||||
}
|
||||
|
||||
CConnectData::CConnectData(const wxString& repeater, const wxString& reflector, CD_TYPE type, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort) :
|
||||
CConnectData::CConnectData(const wxString& repeater, const wxString& reflector, CD_TYPE type, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort) :
|
||||
m_gatewayType(GT_REPEATER),
|
||||
m_repeater(repeater),
|
||||
m_reflector(reflector),
|
||||
m_type(type),
|
||||
m_locator(),
|
||||
m_yourAddress(yourAddress),
|
||||
m_yourPort(yourPort),
|
||||
m_yourAddr(yourAddr),
|
||||
m_yourAddrLen(yourAddrLen),
|
||||
m_myPort(myPort)
|
||||
{
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
wxASSERT(!repeater.IsEmpty());
|
||||
wxASSERT(!reflector.IsEmpty());
|
||||
}
|
||||
|
||||
CConnectData::CConnectData(const wxString& repeater, CD_TYPE type, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort) :
|
||||
CConnectData::CConnectData(const wxString& repeater, CD_TYPE type, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort) :
|
||||
m_gatewayType(GT_REPEATER),
|
||||
m_repeater(repeater),
|
||||
m_reflector(),
|
||||
m_type(type),
|
||||
m_locator(),
|
||||
m_yourAddress(yourAddress),
|
||||
m_yourPort(yourPort),
|
||||
m_yourAddr(yourAddr),
|
||||
m_yourAddrLen(yourAddrLen),
|
||||
m_myPort(myPort)
|
||||
{
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
wxASSERT(!repeater.IsEmpty());
|
||||
}
|
||||
|
||||
CConnectData::CConnectData(const wxString& repeater, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort) :
|
||||
CConnectData::CConnectData(const wxString& repeater, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort) :
|
||||
m_gatewayType(GT_REPEATER),
|
||||
m_repeater(repeater),
|
||||
m_reflector(),
|
||||
m_type(CT_UNLINK),
|
||||
m_locator(),
|
||||
m_yourAddress(yourAddress),
|
||||
m_yourPort(yourPort),
|
||||
m_yourAddr(yourAddr),
|
||||
m_yourAddrLen(yourAddrLen),
|
||||
m_myPort(myPort)
|
||||
{
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
wxASSERT(!repeater.IsEmpty());
|
||||
}
|
||||
|
||||
CConnectData::CConnectData(CD_TYPE type, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort) :
|
||||
CConnectData::CConnectData(CD_TYPE type, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort) :
|
||||
m_gatewayType(GT_REPEATER),
|
||||
m_repeater(),
|
||||
m_reflector(),
|
||||
m_type(type),
|
||||
m_locator(),
|
||||
m_yourAddress(yourAddress),
|
||||
m_yourPort(yourPort),
|
||||
m_yourAddr(yourAddr),
|
||||
m_yourAddrLen(yourAddrLen),
|
||||
m_myPort(myPort)
|
||||
{
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
}
|
||||
|
||||
CConnectData::CConnectData() :
|
||||
|
|
@ -101,8 +101,8 @@ m_repeater(wxT(" ")),
|
|||
m_reflector(),
|
||||
m_type(CT_LINK1),
|
||||
m_locator(),
|
||||
m_yourAddress(),
|
||||
m_yourPort(0U),
|
||||
m_yourAddr(),
|
||||
m_yourAddrLen(0U),
|
||||
m_myPort(0U)
|
||||
{
|
||||
}
|
||||
|
|
@ -111,11 +111,11 @@ CConnectData::~CConnectData()
|
|||
{
|
||||
}
|
||||
|
||||
bool CConnectData::setDExtraData(const unsigned char* data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CConnectData::setDExtraData(const unsigned char* data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 11U);
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
|
||||
m_repeater = wxString((const char*)data, wxConvLocal, LONG_CALLSIGN_LENGTH);
|
||||
m_repeater.SetChar(LONG_CALLSIGN_LENGTH - 1U, data[LONG_CALLSIGN_LENGTH + 0U]);
|
||||
|
|
@ -149,18 +149,18 @@ bool CConnectData::setDExtraData(const unsigned char* data, unsigned int length,
|
|||
return false;
|
||||
}
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CConnectData::setDCSData(const unsigned char* data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CConnectData::setDCSData(const unsigned char* data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 11U);
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
|
||||
m_repeater = wxString((const char*)data, wxConvLocal, LONG_CALLSIGN_LENGTH);
|
||||
m_repeater.SetChar(LONG_CALLSIGN_LENGTH - 1U, data[LONG_CALLSIGN_LENGTH + 0U]);
|
||||
|
|
@ -196,18 +196,18 @@ bool CConnectData::setDCSData(const unsigned char* data, unsigned int length, co
|
|||
return false;
|
||||
}
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CConnectData::setCCSData(const unsigned char* data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CConnectData::setCCSData(const unsigned char* data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 14U);
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
|
||||
m_repeater = wxString((const char*)data, wxConvLocal, LONG_CALLSIGN_LENGTH);
|
||||
m_repeater.SetChar(LONG_CALLSIGN_LENGTH - 1U, data[LONG_CALLSIGN_LENGTH + 0U]);
|
||||
|
|
@ -223,18 +223,18 @@ bool CConnectData::setCCSData(const unsigned char* data, unsigned int length, co
|
|||
else
|
||||
return false;
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CConnectData::setDPlusData(const unsigned char* data, unsigned int length, const in_addr& yourAddress, unsigned int yourPort, unsigned int myPort)
|
||||
bool CConnectData::setDPlusData(const unsigned char* data, unsigned int length, const sockaddr_storage& yourAddr, unsigned int yourAddrLen, unsigned int myPort)
|
||||
{
|
||||
wxASSERT(data != NULL);
|
||||
wxASSERT(length >= 5U);
|
||||
wxASSERT(yourPort > 0U);
|
||||
wxASSERT(yourAddrLen > 0U);
|
||||
|
||||
switch (length) {
|
||||
case 5U:
|
||||
|
|
@ -268,8 +268,8 @@ bool CConnectData::setDPlusData(const unsigned char* data, unsigned int length,
|
|||
return false;
|
||||
}
|
||||
|
||||
m_yourAddress = yourAddress;
|
||||
m_yourPort = yourPort;
|
||||
m_yourAddr = yourAddr;
|
||||
m_yourAddrLen = yourAddrLen;
|
||||
m_myPort = myPort;
|
||||
|
||||
return true;
|
||||
|
|
@ -507,14 +507,14 @@ unsigned int CConnectData::getDPlusData(unsigned char *data, unsigned int length
|
|||
}
|
||||
}
|
||||
|
||||
in_addr CConnectData::getYourAddress() const
|
||||
sockaddr_storage CConnectData::getYourAddr() const
|
||||
{
|
||||
return m_yourAddress;
|
||||
return m_yourAddr;
|
||||
}
|
||||
|
||||
unsigned int CConnectData::getYourPort() const
|
||||
unsigned int CConnectData::getYourAddrLen() const
|
||||
{
|
||||
return m_yourPort;
|
||||
return m_yourAddrLen;
|
||||
}
|
||||
|
||||
unsigned int CConnectData::getMyPort() const
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ private:
|
|||
wxString m_reflector;
|
||||
CD_TYPE m_type;
|
||||
wxString m_locator;
|
||||
sockaddr_storage m_yourAddress;
|
||||
sockaddr_storage m_yourAddr;
|
||||
unsigned int m_yourAddrLen;
|
||||
unsigned int m_myPort;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2015 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2012-2015,2020 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -37,14 +37,14 @@ CCallsignList* CDCSHandler::m_whiteList = NULL;
|
|||
CCallsignList* CDCSHandler::m_blackList = NULL;
|
||||
|
||||
|
||||
CDCSHandler::CDCSHandler(IReflectorCallback* handler, const wxString& reflector, const wxString& repeater, CDCSProtocolHandler* protoHandler, const in_addr& address, unsigned int port, DIRECTION direction) :
|
||||
CDCSHandler::CDCSHandler(IReflectorCallback* handler, const wxString& reflector, const wxString& repeater, CDCSProtocolHandler* protoHandler, const sockaddr_storage& addr, unsigned int addrLen, DIRECTION direction) :
|
||||
m_reflector(reflector.Clone()),
|
||||
m_xlxReflector(),
|
||||
m_isXlx(false),
|
||||
m_repeater(repeater.Clone()),
|
||||
m_handler(protoHandler),
|
||||
m_yourAddress(address),
|
||||
m_yourPort(port),
|
||||
m_yourAddr(addr),
|
||||
m_yourAddrLen(addrLen),
|
||||
m_myPort(0U),
|
||||
m_direction(direction),
|
||||
m_linkState(DCS_LINKING),
|
||||
|
|
@ -181,9 +181,9 @@ void CDCSHandler::getInfo(IReflectorCallback* handler, CRemoteRepeaterData& data
|
|||
|
||||
void CDCSHandler::process(CAMBEData& data)
|
||||
{
|
||||
in_addr yourAddress = data.getYourAddress();
|
||||
unsigned int yourPort = data.getYourPort();
|
||||
unsigned int myPort = data.getMyPort();
|
||||
sockaddr_storage yourAddr = data.getYourAddr();
|
||||
unsigned int yourAddrLen = data.getYourAddrLen();
|
||||
unsigned int myPort = data.getMyPort();
|
||||
|
||||
for (unsigned int i = 0U; i < m_maxReflectors; i++) {
|
||||
CDCSHandler* reflector = m_reflectors[i];
|
||||
|
|
@ -200,12 +200,12 @@ void CDCSHandler::process(CAMBEData& data)
|
|||
|
||||
void CDCSHandler::process(CPollData& poll)
|
||||
{
|
||||
wxString reflector = poll.getData1();
|
||||
wxString repeater = poll.getData2();
|
||||
in_addr yourAddress = poll.getYourAddress();
|
||||
unsigned int yourPort = poll.getYourPort();
|
||||
unsigned int myPort = poll.getMyPort();
|
||||
unsigned int length = poll.getLength();
|
||||
wxString reflector = poll.getData1();
|
||||
wxString repeater = poll.getData2();
|
||||
sockaddr_storage yourAddr = poll.getYourAddr();
|
||||
unsigned int yourAddrLen = poll.getYourAddrLen();
|
||||
unsigned int myPort = poll.getMyPort();
|
||||
unsigned int length = poll.getLength();
|
||||
|
||||
// Check to see if we already have a link
|
||||
for (unsigned int i = 0U; i < m_maxReflectors; i++) {
|
||||
|
|
@ -221,7 +221,7 @@ void CDCSHandler::process(CPollData& poll)
|
|||
handler->m_linkState == DCS_LINKED &&
|
||||
length == 22U) {
|
||||
handler->m_pollInactivityTimer.start();
|
||||
CPollData reply(handler->m_repeater, handler->m_reflector, handler->m_direction, handler->m_yourAddress, handler->m_yourPort);
|
||||
CPollData reply(handler->m_repeater, handler->m_reflector, handler->m_direction, handler->m_yourAddr, handler->m_yourAddrLen);
|
||||
handler->m_handler->writePoll(reply);
|
||||
return;
|
||||
} else if (handler->m_reflector.Left(LONG_CALLSIGN_LENGTH - 1U).IsSameAs(reflector.Left(LONG_CALLSIGN_LENGTH - 1U)) &&
|
||||
|
|
@ -259,9 +259,9 @@ void CDCSHandler::process(CConnectData& connect)
|
|||
}
|
||||
|
||||
// else if type == CT_LINK1 or type == CT_LINK2
|
||||
in_addr yourAddress = connect.getYourAddress();
|
||||
unsigned int yourPort = connect.getYourPort();
|
||||
unsigned int myPort = connect.getMyPort();
|
||||
in_addr yourAddr = connect.getYourAddr();
|
||||
unsigned int yourAddrLen = connect.getYourAddrLen();
|
||||
unsigned int myPort = connect.getMyPort();
|
||||
|
||||
wxString repeaterCallsign = connect.getRepeater();
|
||||
wxString reflectorCallsign = connect.getReflector();
|
||||
|
|
@ -270,8 +270,7 @@ void CDCSHandler::process(CConnectData& connect)
|
|||
for (unsigned int i = 0U; i < m_maxReflectors; i++) {
|
||||
if (m_reflectors[i] != NULL) {
|
||||
if (m_reflectors[i]->m_direction == DIR_INCOMING &&
|
||||
m_reflectors[i]->m_yourAddress.s_addr == yourAddress.s_addr &&
|
||||
m_reflectors[i]->m_yourPort == yourPort &&
|
||||
CUDPReaderWriter::match(m_yourAddr, yourAddr) &&
|
||||
m_reflectors[i]->m_myPort == myPort &&
|
||||
m_reflectors[i]->m_repeater.IsSameAs(reflectorCallsign) &&
|
||||
m_reflectors[i]->m_reflector.IsSameAs(repeaterCallsign))
|
||||
|
|
@ -291,7 +290,7 @@ void CDCSHandler::process(CConnectData& connect)
|
|||
// A new connect packet indicates the need for a new entry
|
||||
wxLogMessage(wxT("New incoming DCS link to %s from %s"), reflectorCallsign.c_str(), repeaterCallsign.c_str());
|
||||
|
||||
CDCSHandler* dcs = new CDCSHandler(handler, repeaterCallsign, reflectorCallsign, m_incoming, yourAddress, yourPort, DIR_INCOMING);
|
||||
CDCSHandler* dcs = new CDCSHandler(handler, repeaterCallsign, reflectorCallsign, m_incoming, yourAddr, yourAddrLen, DIR_INCOMING);
|
||||
|
||||
bool found = false;
|
||||
for (unsigned int i = 0U; i < m_maxReflectors; i++) {
|
||||
|
|
@ -303,10 +302,10 @@ void CDCSHandler::process(CConnectData& connect)
|
|||
}
|
||||
|
||||
if (found) {
|
||||
CConnectData reply(repeaterCallsign, reflectorCallsign, CT_ACK, yourAddress, yourPort);
|
||||
CConnectData reply(repeaterCallsign, reflectorCallsign, CT_ACK, yourAddr, yourAddrLen);
|
||||
m_incoming->writeConnect(reply);
|
||||
} else {
|
||||
CConnectData reply(repeaterCallsign, reflectorCallsign, CT_NAK, yourAddress, yourPort);
|
||||
CConnectData reply(repeaterCallsign, reflectorCallsign, CT_NAK, yourAddr, yourAddrLen);
|
||||
m_incoming->writeConnect(reply);
|
||||
|
||||
wxLogError(wxT("No space to add new DCS link, ignoring"));
|
||||
|
|
@ -361,7 +360,7 @@ void CDCSHandler::unlink(IReflectorCallback* handler, const wxString& callsign,
|
|||
wxLogMessage(wxT("Removing outgoing DCS link %s, %s"), reflector->m_repeater.c_str(), reflector->m_reflector.c_str());
|
||||
|
||||
if (reflector->m_linkState == DCS_LINKING || reflector->m_linkState == DCS_LINKED) {
|
||||
CConnectData connect(reflector->m_repeater, reflector->m_reflector, CT_UNLINK, reflector->m_yourAddress, reflector->m_yourPort);
|
||||
CConnectData connect(reflector->m_repeater, reflector->m_reflector, CT_UNLINK, reflector->m_yourAddr, reflector->m_yourAddrLen);
|
||||
reflector->m_handler->writeConnect(connect);
|
||||
|
||||
reflector->m_linkState = DCS_UNLINKING;
|
||||
|
|
@ -376,7 +375,7 @@ void CDCSHandler::unlink(IReflectorCallback* handler, const wxString& callsign,
|
|||
wxLogMessage(wxT("Removing DCS link %s, %s"), reflector->m_repeater.c_str(), reflector->m_reflector.c_str());
|
||||
|
||||
if (reflector->m_linkState == DCS_LINKING || reflector->m_linkState == DCS_LINKED) {
|
||||
CConnectData connect(reflector->m_repeater, reflector->m_reflector, CT_UNLINK, reflector->m_yourAddress, reflector->m_yourPort);
|
||||
CConnectData connect(reflector->m_repeater, reflector->m_reflector, CT_UNLINK, reflector->m_yourAddr, reflector->m_yourAddrLen);
|
||||
reflector->m_handler->writeConnect(connect);
|
||||
|
||||
reflector->m_linkState = DCS_UNLINKING;
|
||||
|
|
@ -419,7 +418,7 @@ void CDCSHandler::unlink()
|
|||
if (!reflector->m_repeater.IsEmpty()) {
|
||||
wxLogMessage(wxT("Unlinking from DCS reflector %s"), reflector->m_reflector.c_str());
|
||||
|
||||
CConnectData connect(reflector->m_repeater, reflector->m_reflector, CT_UNLINK, reflector->m_yourAddress, reflector->m_yourPort);
|
||||
CConnectData connect(reflector->m_repeater, reflector->m_reflector, CT_UNLINK, reflector->m_yourAddr, reflector->m_yourAddrLen);
|
||||
reflector->m_handler->writeConnect(connect);
|
||||
|
||||
reflector->m_linkState = DCS_UNLINKING;
|
||||
|
|
@ -627,10 +626,10 @@ void CDCSHandler::processInt(CAMBEData& data)
|
|||
|
||||
bool CDCSHandler::processInt(CConnectData& connect, CD_TYPE type)
|
||||
{
|
||||
in_addr yourAddress = connect.getYourAddress();
|
||||
unsigned int yourPort = connect.getYourPort();
|
||||
unsigned int myPort = connect.getMyPort();
|
||||
wxString repeater = connect.getRepeater();
|
||||
sockaddr_storage yourAddr = connect.getYourAddr();
|
||||
unsigned int yourAddrLen = connect.getYourAddrLen();
|
||||
unsigned int myPort = connect.getMyPort();
|
||||
wxString repeater = connect.getRepeater();
|
||||
|
||||
if (m_yourAddress.s_addr != yourAddress.s_addr || m_yourPort != yourPort || m_myPort != myPort)
|
||||
return false;
|
||||
|
|
@ -728,7 +727,7 @@ bool CDCSHandler::clockInt(unsigned int ms)
|
|||
if (m_direction == DIR_OUTGOING) {
|
||||
bool reconnect = m_destination->linkFailed(DP_DCS, GET_DISP_REFLECTOR(this), true);
|
||||
if (reconnect) {
|
||||
CConnectData reply(m_gatewayType, m_repeater, m_reflector, CT_LINK1, m_yourAddress, m_yourPort);
|
||||
CConnectData reply(m_gatewayType, m_repeater, m_reflector, CT_LINK1, m_yourAddr, m_yourAddrLen);
|
||||
m_handler->writeConnect(reply);
|
||||
m_linkState = DCS_LINKING;
|
||||
m_tryTimer.start(1U);
|
||||
|
|
@ -749,13 +748,13 @@ bool CDCSHandler::clockInt(unsigned int ms)
|
|||
if (m_pollTimer.isRunning() && m_pollTimer.hasExpired()) {
|
||||
m_pollTimer.start();
|
||||
|
||||
CPollData poll(m_repeater, m_reflector, m_direction, m_yourAddress, m_yourPort);
|
||||
CPollData poll(m_repeater, m_reflector, m_direction, m_yourAddr, m_yourAddrLen);
|
||||
m_handler->writePoll(poll);
|
||||
}
|
||||
|
||||
if (m_linkState == DCS_LINKING) {
|
||||
if (m_tryTimer.isRunning() && m_tryTimer.hasExpired()) {
|
||||
CConnectData reply(m_gatewayType, m_repeater, m_reflector, CT_LINK1, m_yourAddress, m_yourPort);
|
||||
CConnectData reply(m_gatewayType, m_repeater, m_reflector, CT_LINK1, m_yourAddr, m_yourAddrLen);
|
||||
m_handler->writeConnect(reply);
|
||||
|
||||
unsigned int timeout = calcBackoff();
|
||||
|
|
@ -765,7 +764,7 @@ bool CDCSHandler::clockInt(unsigned int ms)
|
|||
|
||||
if (m_linkState == DCS_UNLINKING) {
|
||||
if (m_tryTimer.isRunning() && m_tryTimer.hasExpired()) {
|
||||
CConnectData connect(m_repeater, m_reflector, CT_UNLINK, m_yourAddress, m_yourPort);
|
||||
CConnectData connect(m_repeater, m_reflector, CT_UNLINK, m_yourAddr, m_yourAddrLen);
|
||||
m_handler->writeConnect(connect);
|
||||
|
||||
unsigned int timeout = calcBackoff();
|
||||
|
|
@ -825,7 +824,7 @@ void CDCSHandler::writeAMBEInt(IReflectorCallback* handler, CAMBEData& data, DIR
|
|||
header.setCQCQCQ();
|
||||
|
||||
data.setRptSeq(m_seqNo++);
|
||||
data.setDestination(m_yourAddress, m_yourPort);
|
||||
data.setDestination(m_yourAddr, m_yourAddrLen);
|
||||
m_handler->writeData(data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ public:
|
|||
|
||||
void setDestination(const sockaddr_storage& addr, unsigned int addrLen);
|
||||
|
||||
// sockaddr_storage getAddr() const;
|
||||
// unsigned int getAddrLen() const;
|
||||
sockaddr_storage getAddr() const;
|
||||
unsigned int getAddrLen() const;
|
||||
|
||||
private:
|
||||
wxString m_reflector;
|
||||
|
|
|
|||
Loading…
Reference in a new issue