mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Small method rename.
This commit is contained in:
parent
5885c6186d
commit
75471ee0e0
2 changed files with 6 additions and 6 deletions
|
@ -136,8 +136,8 @@ Network::~Network()
|
||||||
delete _tap;
|
delete _tap;
|
||||||
|
|
||||||
if (_destroyOnDelete) {
|
if (_destroyOnDelete) {
|
||||||
std::string confPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + toString() + ".conf");
|
std::string confPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + idString() + ".conf");
|
||||||
std::string mcdbPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + toString() + ".mcerts");
|
std::string mcdbPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + idString() + ".mcerts");
|
||||||
Utils::rm(confPath);
|
Utils::rm(confPath);
|
||||||
Utils::rm(mcdbPath);
|
Utils::rm(mcdbPath);
|
||||||
} else {
|
} else {
|
||||||
|
@ -192,7 +192,7 @@ void Network::setConfiguration(const Network::Config &conf)
|
||||||
for(std::set<unsigned int>::const_iterator t(wl.begin());t!=wl.end();++t)
|
for(std::set<unsigned int>::const_iterator t(wl.begin());t!=wl.end();++t)
|
||||||
_etWhitelist[*t / 8] |= (unsigned char)(1 << (*t % 8));
|
_etWhitelist[*t / 8] |= (unsigned char)(1 << (*t % 8));
|
||||||
|
|
||||||
std::string confPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + toString() + ".conf");
|
std::string confPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + idString() + ".conf");
|
||||||
if (!Utils::writeFile(confPath.c_str(),conf.toString())) {
|
if (!Utils::writeFile(confPath.c_str(),conf.toString())) {
|
||||||
LOG("error: unable to write network configuration file at: %s",confPath.c_str());
|
LOG("error: unable to write network configuration file at: %s",confPath.c_str());
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ bool Network::isAllowed(const Address &peer) const
|
||||||
|
|
||||||
void Network::clean()
|
void Network::clean()
|
||||||
{
|
{
|
||||||
std::string mcdbPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + toString() + ".mcerts");
|
std::string mcdbPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + idString() + ".mcerts");
|
||||||
|
|
||||||
Mutex::Lock _l(_lock);
|
Mutex::Lock _l(_lock);
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ void Network::_CBhandleTapData(void *arg,const MAC &from,const MAC &to,unsigned
|
||||||
|
|
||||||
void Network::_restoreState()
|
void Network::_restoreState()
|
||||||
{
|
{
|
||||||
std::string confPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + toString() + ".conf");
|
std::string confPath(_r->homePath + ZT_PATH_SEPARATOR_S + "networks.d" + ZT_PATH_SEPARATOR_S + idString() + ".conf");
|
||||||
std::string confs;
|
std::string confs;
|
||||||
if (Utils::readFile(confPath.c_str(),confs)) {
|
if (Utils::readFile(confPath.c_str(),confs)) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -456,7 +456,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @return Network ID in hexadecimal form
|
* @return Network ID in hexadecimal form
|
||||||
*/
|
*/
|
||||||
inline std::string toString()
|
inline std::string idString()
|
||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
Utils::snprintf(buf,sizeof(buf),"%.16llx",(unsigned long long)_id);
|
Utils::snprintf(buf,sizeof(buf),"%.16llx",(unsigned long long)_id);
|
||||||
|
|
Loading…
Add table
Reference in a new issue