mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-19 04:57:53 +00:00
Add MAC to listnetworks, and some other make stuff.
This commit is contained in:
parent
282114e96c
commit
721625d512
@ -48,7 +48,8 @@ SOURCES += main.cpp \
|
|||||||
../node/UdpSocket.cpp \
|
../node/UdpSocket.cpp \
|
||||||
../node/Utils.cpp \
|
../node/Utils.cpp \
|
||||||
../ext/lz4/lz4.c \
|
../ext/lz4/lz4.c \
|
||||||
../ext/lz4/lz4hc.c
|
../ext/lz4/lz4hc.c \
|
||||||
|
../node/Dictionary.cpp
|
||||||
|
|
||||||
HEADERS += mainwindow.h \
|
HEADERS += mainwindow.h \
|
||||||
aboutwindow.h \
|
aboutwindow.h \
|
||||||
@ -105,7 +106,9 @@ HEADERS += mainwindow.h \
|
|||||||
../node/UdpSocket.hpp \
|
../node/UdpSocket.hpp \
|
||||||
../node/Utils.hpp \
|
../node/Utils.hpp \
|
||||||
../ext/lz4/lz4.h \
|
../ext/lz4/lz4.h \
|
||||||
../ext/lz4/lz4hc.h
|
../ext/lz4/lz4hc.h \
|
||||||
|
../node/EthernetTap.hpp \
|
||||||
|
../node/EthernetTapFactory.hpp
|
||||||
|
|
||||||
win32:SOURCES += ../node/WindowsEthernetTap.cpp
|
win32:SOURCES += ../node/WindowsEthernetTap.cpp
|
||||||
mac:SOURCES += ../node/UnixEthernetTap.cpp
|
mac:SOURCES += ../node/UnixEthernetTap.cpp
|
||||||
|
@ -38,12 +38,12 @@ endif
|
|||||||
CXXFLAGS=$(CFLAGS) -fno-rtti
|
CXXFLAGS=$(CFLAGS) -fno-rtti
|
||||||
|
|
||||||
include objects.mk
|
include objects.mk
|
||||||
OBJS+=main.o osnet/LinuxRoutingTable.o osnet/LinuxEthernetTap.o osnet/LinuxEthernetTapFactory.o
|
OBJS+=osnet/LinuxRoutingTable.o osnet/LinuxEthernetTap.o osnet/LinuxEthernetTapFactory.o
|
||||||
|
|
||||||
all: one
|
all: one
|
||||||
|
|
||||||
one: $(OBJS)
|
one: $(OBJS) main.o
|
||||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one $(OBJS) $(LIBS)
|
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one main.o $(OBJS) $(LIBS)
|
||||||
$(STRIP) zerotier-one
|
$(STRIP) zerotier-one
|
||||||
ln -sf zerotier-one zerotier-cli
|
ln -sf zerotier-one zerotier-cli
|
||||||
ln -sf zerotier-one zerotier-idtool
|
ln -sf zerotier-one zerotier-idtool
|
||||||
|
@ -35,12 +35,12 @@ endif
|
|||||||
CXXFLAGS=$(CFLAGS) -fno-rtti
|
CXXFLAGS=$(CFLAGS) -fno-rtti
|
||||||
|
|
||||||
include objects.mk
|
include objects.mk
|
||||||
OBJS+=main.o osnet/BSDRoutingTable.o osnet/OSXEthernetTap.o osnet/OSXEthernetTapFactory.o
|
OBJS+=osnet/BSDRoutingTable.o osnet/OSXEthernetTap.o osnet/OSXEthernetTapFactory.o
|
||||||
|
|
||||||
all: one
|
all: one
|
||||||
|
|
||||||
one: $(OBJS)
|
one: $(OBJS) main.o
|
||||||
$(CXX) $(CXXFLAGS) -o zerotier-one $(OBJS) $(LIBS)
|
$(CXX) $(CXXFLAGS) -o zerotier-one main.o $(OBJS) $(LIBS)
|
||||||
$(STRIP) zerotier-one
|
$(STRIP) zerotier-one
|
||||||
ln -sf zerotier-one zerotier-cli
|
ln -sf zerotier-one zerotier-cli
|
||||||
ln -sf zerotier-one zerotier-idtool
|
ln -sf zerotier-one zerotier-idtool
|
||||||
|
@ -416,7 +416,7 @@ static void _cbHandleGetRootTopology(void *arg,int code,const std::string &url,c
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if ((code != 200)||(body.length() == 0)) {
|
if ((code != 200)||(body.length() == 0)) {
|
||||||
TRACE("failed to retrieve %s",ZT_DEFAULTS.rootTopologyUpdateURL.c_str());
|
TRACE("failed to retrieve %s",url.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -433,7 +433,7 @@ static void _cbHandleGetRootTopology(void *arg,int code,const std::string &url,c
|
|||||||
if (Utils::readFile(rootTopologyPath.c_str(),rootTopology)) {
|
if (Utils::readFile(rootTopologyPath.c_str(),rootTopology)) {
|
||||||
Dictionary alreadyHave(rootTopology);
|
Dictionary alreadyHave(rootTopology);
|
||||||
if (alreadyHave == rt) {
|
if (alreadyHave == rt) {
|
||||||
TRACE("retrieved root topology from %s but no change (same)",url.c_str());
|
TRACE("retrieved root topology from %s but no change (same as on disk)",url.c_str());
|
||||||
return;
|
return;
|
||||||
} else if (alreadyHave.signatureTimestamp() > rt.signatureTimestamp()) {
|
} else if (alreadyHave.signatureTimestamp() > rt.signatureTimestamp()) {
|
||||||
TRACE("retrieved root topology from %s but no change (ours is newer)",url.c_str());
|
TRACE("retrieved root topology from %s but no change (ours is newer)",url.c_str());
|
||||||
@ -763,6 +763,7 @@ Node::ReasonForTermination Node::run()
|
|||||||
|
|
||||||
if ((now - lastRootTopologyFetch) >= ZT_UPDATE_ROOT_TOPOLOGY_CHECK_INTERVAL) {
|
if ((now - lastRootTopologyFetch) >= ZT_UPDATE_ROOT_TOPOLOGY_CHECK_INTERVAL) {
|
||||||
lastRootTopologyFetch = now;
|
lastRootTopologyFetch = now;
|
||||||
|
TRACE("fetching root topology from %s",ZT_DEFAULTS.rootTopologyUpdateURL.c_str());
|
||||||
_r->http->GET(ZT_DEFAULTS.rootTopologyUpdateURL,HttpClient::NO_HEADERS,60,&_cbHandleGetRootTopology,_r);
|
_r->http->GET(ZT_DEFAULTS.rootTopologyUpdateURL,HttpClient::NO_HEADERS,60,&_cbHandleGetRootTopology,_r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ void NodeConfig::_doCommand(IpcConnection *ipcc,const char *commandLine)
|
|||||||
_r->topology->eachPeer(_DumpPeerStatistics(ipcc));
|
_r->topology->eachPeer(_DumpPeerStatistics(ipcc));
|
||||||
} else if (cmd[0] == "listnetworks") {
|
} else if (cmd[0] == "listnetworks") {
|
||||||
Mutex::Lock _l(_networks_m);
|
Mutex::Lock _l(_networks_m);
|
||||||
ipcc->printf("200 listnetworks <nwid> <name> <status> <config age> <type> <dev> <ips>"ZT_EOL_S);
|
ipcc->printf("200 listnetworks <nwid> <name> <mac> <status> <config age> <type> <dev> <ips>"ZT_EOL_S);
|
||||||
for(std::map< uint64_t,SharedPtr<Network> >::const_iterator nw(_networks.begin());nw!=_networks.end();++nw) {
|
for(std::map< uint64_t,SharedPtr<Network> >::const_iterator nw(_networks.begin());nw!=_networks.end();++nw) {
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
std::set<InetAddress> ips(nw->second->ips());
|
std::set<InetAddress> ips(nw->second->ips());
|
||||||
@ -244,9 +244,10 @@ void NodeConfig::_doCommand(IpcConnection *ipcc,const char *commandLine)
|
|||||||
age /= 1000;
|
age /= 1000;
|
||||||
|
|
||||||
std::string dn(nw->second->tapDeviceName());
|
std::string dn(nw->second->tapDeviceName());
|
||||||
ipcc->printf("200 listnetworks %.16llx %s %s %lld %s %s %s"ZT_EOL_S,
|
ipcc->printf("200 listnetworks %.16llx %s %s %s %lld %s %s %s"ZT_EOL_S,
|
||||||
(unsigned long long)nw->first,
|
(unsigned long long)nw->first,
|
||||||
((nconf) ? nconf->name().c_str() : "?"),
|
((nconf) ? nconf->name().c_str() : "?"),
|
||||||
|
nw->second->mac().toString().c_str(),
|
||||||
Network::statusString(nw->second->status()),
|
Network::statusString(nw->second->status()),
|
||||||
age,
|
age,
|
||||||
((nconf) ? (nconf->isPublic() ? "public" : "private") : "?"),
|
((nconf) ? (nconf->isPublic() ? "public" : "private") : "?"),
|
||||||
|
Loading…
Reference in New Issue
Block a user