mirror of
https://github.com/g4klx/MMDVMHost
synced 2026-02-05 14:15:43 +08:00
Added whitelist and blacklist config
This commit is contained in:
48
Conf.cpp
48
Conf.cpp
@@ -308,6 +308,38 @@ bool CConf::read()
|
||||
m_dmrBlackList.push_back(id);
|
||||
p = ::strtok(NULL, ",\r\n");
|
||||
}
|
||||
} else if (::strcmp(key, "DstIdBlackListSlot1") == 0) {
|
||||
char* p = ::strtok(value, ",\r\n");
|
||||
while (p != NULL) {
|
||||
unsigned int id = (unsigned int)::atoi(p);
|
||||
if (id > 0U)
|
||||
m_dmrDstIdBlacklistSlot1.push_back(id);
|
||||
p = ::strtok(NULL, ",\r\n");
|
||||
}
|
||||
} else if (::strcmp(key, "DstIdBlackListSlot2") == 0) {
|
||||
char* p = ::strtok(value, ",\r\n");
|
||||
while (p != NULL) {
|
||||
unsigned int id = (unsigned int)::atoi(p);
|
||||
if (id > 0U)
|
||||
m_dmrDstIdBlacklistSlot2.push_back(id);
|
||||
p = ::strtok(NULL, ",\r\n");
|
||||
}
|
||||
} else if (::strcmp(key, "DstIdWhiteListSlot1") == 0) {
|
||||
char* p = ::strtok(value, ",\r\n");
|
||||
while (p != NULL) {
|
||||
unsigned int id = (unsigned int)::atoi(p);
|
||||
if (id > 0U)
|
||||
m_dmrDstIdWhitelistSlot1.push_back(id);
|
||||
p = ::strtok(NULL, ",\r\n");
|
||||
}
|
||||
} else if (::strcmp(key, "DstIdWhiteListSlot2") == 0) {
|
||||
char* p = ::strtok(value, ",\r\n");
|
||||
while (p != NULL) {
|
||||
unsigned int id = (unsigned int)::atoi(p);
|
||||
if (id > 0U)
|
||||
m_dmrDstIdWhitelistSlot2.push_back(id);
|
||||
p = ::strtok(NULL, ",\r\n");
|
||||
}
|
||||
} else if (::strcmp(key, "LookupFile") == 0)
|
||||
m_dmrLookupFile = value;
|
||||
else if (::strcmp(key, "TXHang") == 0)
|
||||
@@ -608,7 +640,21 @@ std::vector<unsigned int> CConf::getDMRBlackList() const
|
||||
{
|
||||
return m_dmrBlackList;
|
||||
}
|
||||
|
||||
std::vector<unsigned int> CConf::getDMRDstIdBlacklistSlot1() const
|
||||
{
|
||||
return m_dmrDstIdBlacklistSlot1;
|
||||
}
|
||||
std::vector<unsigned int> CConf::getDMRDstIdBlacklistSlot2() const
|
||||
{
|
||||
return m_dmrDstIdBlacklistSlot2;
|
||||
}
|
||||
std::vector<unsigned int> CConf::getDMRDstIdWhitelistSlot1() const
|
||||
{
|
||||
return m_dmrDstIdWhitelistSlot1;
|
||||
}std::vector<unsigned int> CConf::getDMRDstIdWhitelistSlot2() const
|
||||
{
|
||||
return m_dmrDstIdWhitelistSlot2;
|
||||
}
|
||||
std::string CConf::getDMRLookupFile() const
|
||||
{
|
||||
return m_dmrLookupFile;
|
||||
|
||||
Reference in New Issue
Block a user