add IPv6 support for RemoteControl

To specify IP(v4/v6) address for RemoteControl port,
add Address parameter in [RemoteControl] section to MMDVM.ini.

Different from other Address(es), the default IP address of RemoteControl
is 127.0.0.1 for security.
This commit is contained in:
SASANO Takayoshi
2020-04-11 13:12:19 +09:00
parent 88bbb0cd0f
commit 5df1fe551f
6 changed files with 18 additions and 5 deletions

View File

@@ -250,6 +250,7 @@ m_mobileGPSEnabled(false),
m_mobileGPSAddress(),
m_mobileGPSPort(0U),
m_remoteControlEnabled(false),
m_remoteControlAddress("127.0.0.1"),
m_remoteControlPort(0U)
{
}
@@ -838,6 +839,8 @@ bool CConf::read()
} else if (section == SECTION_REMOTE_CONTROL) {
if (::strcmp(key, "Enable") == 0)
m_remoteControlEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Address") == 0)
m_remoteControlAddress = value;
else if (::strcmp(key, "Port") == 0)
m_remoteControlPort = (unsigned int)::atoi(value);
}
@@ -1794,6 +1797,11 @@ bool CConf::getRemoteControlEnabled() const
return m_remoteControlEnabled;
}
std::string CConf::getRemoteControlAddress() const
{
return m_remoteControlAddress;
}
unsigned int CConf::getRemoteControlPort() const
{
return m_remoteControlPort;