Skip to content

Commit

Permalink
Added whitelist and blacklist config
Browse files Browse the repository at this point in the history
  • Loading branch information
hacknix committed Jun 7, 2016
1 parent 9dfba50 commit 03c938a
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion Conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 03c938a

Please sign in to comment.