IPv6 fixes.
This commit is contained in:
parent
7c318ca402
commit
f7ef0bbb25
|
@ -2,7 +2,7 @@ CC = cc
|
||||||
CXX = c++
|
CXX = c++
|
||||||
|
|
||||||
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -DHAVE_LOG_H -std=c++0x -pthread
|
CFLAGS = -g -O3 -Wall -DHAVE_LOG_H -DUDP_SOCKET_MAX=2 -std=c++0x -pthread
|
||||||
LIBS = -lpthread
|
LIBS = -lpthread
|
||||||
|
|
||||||
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>HAVE_LOG_H;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>HAVE_LOG_H;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>HAVE_LOG_H;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>HAVE_LOG_H;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>HAVE_LOG_H;UDP_SOCKET_MAX=2;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
|
|
@ -26,9 +26,12 @@
|
||||||
|
|
||||||
CNXDNNetwork::CNXDNNetwork(unsigned int port, const std::string& callsign, bool debug) :
|
CNXDNNetwork::CNXDNNetwork(unsigned int port, const std::string& callsign, bool debug) :
|
||||||
m_callsign(callsign),
|
m_callsign(callsign),
|
||||||
m_socket(port),
|
m_socket(),
|
||||||
|
m_port(port),
|
||||||
m_debug(debug)
|
m_debug(debug)
|
||||||
{
|
{
|
||||||
|
assert(port > 0U);
|
||||||
|
|
||||||
m_callsign.resize(10U, ' ');
|
m_callsign.resize(10U, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +43,11 @@ bool CNXDNNetwork::open()
|
||||||
{
|
{
|
||||||
LogInfo("Opening NXDN network connection");
|
LogInfo("Opening NXDN network connection");
|
||||||
|
|
||||||
return m_socket.open();
|
bool ret = m_socket.open(0, PF_INET, "", m_port);
|
||||||
|
if (!ret)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return m_socket.open(1, PF_INET6, "", m_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CNXDNNetwork::writeData(const unsigned char* data, unsigned int length, unsigned short srcId, unsigned short dstId, bool grp, const sockaddr_storage& addr, unsigned int addrLen)
|
bool CNXDNNetwork::writeData(const unsigned char* data, unsigned int length, unsigned short srcId, unsigned short dstId, bool grp, const sockaddr_storage& addr, unsigned int addrLen)
|
||||||
|
|
|
@ -42,9 +42,10 @@ public:
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_callsign;
|
std::string m_callsign;
|
||||||
CUDPSocket m_socket;
|
CUDPSocket m_socket;
|
||||||
bool m_debug;
|
unsigned int m_port;
|
||||||
|
bool m_debug;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,6 +19,6 @@
|
||||||
#if !defined(VERSION_H)
|
#if !defined(VERSION_H)
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
const char* VERSION = "20201102";
|
const char* VERSION = "20201104";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue