mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
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:
8
Conf.cpp
8
Conf.cpp
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user