mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-09-22 15:29:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42c3474223 | ||
|
|
aee742e767 | ||
|
|
c9294c1a78 | ||
|
|
b117ff5435 | ||
|
|
119ef5ecbf | ||
|
|
8fb442d81a | ||
|
|
73153b89b4 | ||
|
|
d9836adbf6 | ||
|
|
420edf23ad | ||
|
|
6c5f6feb5e | ||
|
|
a1c1c82b0d | ||
|
|
83a0d988ec | ||
|
|
a8c12369fd | ||
|
|
28a6d328a5 | ||
|
|
dd404b8ba3 | ||
|
|
1c636afe3f | ||
|
|
48a1799f49 | ||
|
|
bf24de43fe | ||
|
|
76d9ea911d | ||
|
|
ff773def26 | ||
|
|
5abfb11813 | ||
|
|
0b8d6c7f4a | ||
|
|
6c60305a96 | ||
|
|
19c4d82512 | ||
|
|
e11149bcae | ||
|
|
fe85426df6 | ||
|
|
158002d2d1 | ||
|
|
c96d3ebf8c | ||
|
|
b1088a6bd7 | ||
|
|
f0223490be | ||
|
|
81e5690410 | ||
|
|
700a450806 | ||
|
|
0e1fc06a6f | ||
|
|
c3b41c289d | ||
|
|
6ab95e0391 | ||
|
|
67b3fa9311 | ||
|
|
316e8d1939 | ||
|
|
f13493edb2 | ||
|
|
595b386afc | ||
|
|
8e587ae481 | ||
|
|
acb056e3b1 | ||
|
|
5ef2c6fd6f | ||
|
|
1a0572d7e7 | ||
|
|
7957ab6b1d | ||
|
|
e8b613e625 | ||
|
|
9c68a343f6 | ||
|
|
881ff08269 | ||
|
|
e3239d23f4 | ||
|
|
f9c92b0351 | ||
|
|
b73c36acbf | ||
|
|
181369964f | ||
|
|
d2c5d71502 | ||
|
|
c231510f8b | ||
|
|
2ac56fd120 | ||
|
|
e6b23059ac | ||
|
|
04169b5150 | ||
|
|
daaec84c6b | ||
|
|
73c1d43f2f | ||
|
|
ab5a460177 | ||
|
|
67a85221d5 | ||
|
|
328be8f846 | ||
|
|
d9b91758e0 | ||
|
|
4e26ade2df | ||
|
|
8d3eb1a258 | ||
|
|
33ad3deaee | ||
|
|
ba3f04deed | ||
|
|
45e823d27c | ||
|
|
70b736f440 | ||
|
|
97e6b38144 | ||
|
|
7a45ff460d | ||
|
|
6f5a4d7e29 | ||
|
|
4d0ad9abb6 | ||
|
|
15e8c18106 | ||
|
|
1c555e4b96 | ||
|
|
6fdb360e2a | ||
|
|
0d847d9410 | ||
|
|
abc82d6a52 | ||
|
|
acf7d70d24 | ||
|
|
3be4c38946 | ||
|
|
6a1bd52854 | ||
|
|
0b75992737 | ||
|
|
91fef21973 | ||
|
|
dc0f3559be | ||
|
|
bb25128406 | ||
|
|
bf5d8de999 | ||
|
|
1a0a6755b1 | ||
|
|
8adbbe092d | ||
|
|
bd749e040d | ||
|
|
7e80d7e551 | ||
|
|
ce09d00679 | ||
|
|
dbd7a06ea9 | ||
|
|
74c2e644a9 | ||
|
|
dfee7e0389 | ||
|
|
60f25ccdf9 | ||
|
|
2b0dbead17 | ||
|
|
d0b506c12b | ||
|
|
742261c7fc | ||
|
|
939cdc82a2 |
No files matched your search
+38
-30
@@ -12,16 +12,20 @@ mac:QMAKE_INFO_PLIST = Info.plist
|
||||
mac:LIBS += -framework Cocoa
|
||||
|
||||
SOURCES += main.cpp \
|
||||
mainwindow.cpp \
|
||||
aboutwindow.cpp \
|
||||
mainwindow.cpp \
|
||||
aboutwindow.cpp \
|
||||
networkwidget.cpp \
|
||||
installdialog.cpp \
|
||||
licensedialog.cpp \
|
||||
onetimedialog.cpp \
|
||||
../node/C25519.cpp \
|
||||
../node/CertificateOfMembership.cpp \
|
||||
../node/Defaults.cpp \
|
||||
../node/Demarc.cpp \
|
||||
../node/EthernetTap.cpp \
|
||||
../node/HttpClient.cpp \
|
||||
../node/Identity.cpp \
|
||||
../node/InetAddress.cpp \
|
||||
../node/IpcConnection.cpp \
|
||||
../node/IpcListener.cpp \
|
||||
../node/Logger.cpp \
|
||||
../node/Multicaster.cpp \
|
||||
../node/Network.cpp \
|
||||
@@ -35,24 +39,25 @@ SOURCES += main.cpp \
|
||||
../node/Salsa20.cpp \
|
||||
../node/Service.cpp \
|
||||
../node/SHA512.cpp \
|
||||
../node/SocketManager.cpp \
|
||||
../node/SoftwareUpdater.cpp \
|
||||
../node/Switch.cpp \
|
||||
../node/SysEnv.cpp \
|
||||
../node/TcpSocket.cpp \
|
||||
../node/Topology.cpp \
|
||||
../node/UdpSocket.cpp \
|
||||
../node/Utils.cpp \
|
||||
../ext/lz4/lz4.c \
|
||||
../ext/lz4/lz4hc.c \
|
||||
networkwidget.cpp \
|
||||
installdialog.cpp \
|
||||
licensedialog.cpp \
|
||||
onetimedialog.cpp
|
||||
../ext/lz4/lz4hc.c
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
aboutwindow.h \
|
||||
../node/Node.hpp \
|
||||
../node/Utils.hpp \
|
||||
../node/Defaults.hpp \
|
||||
aboutwindow.h \
|
||||
networkwidget.h \
|
||||
installdialog.h \
|
||||
mac_doprivileged.h \
|
||||
licensedialog.h \
|
||||
main.h \
|
||||
onetimedialog.h \
|
||||
../node/Address.hpp \
|
||||
../node/Array.hpp \
|
||||
../node/AtomicCounter.hpp \
|
||||
@@ -61,14 +66,14 @@ HEADERS += mainwindow.h \
|
||||
../node/C25519.hpp \
|
||||
../node/CertificateOfMembership.hpp \
|
||||
../node/CMWC4096.hpp \
|
||||
../node/Condition.hpp \
|
||||
../node/Constants.hpp \
|
||||
../node/Demarc.hpp \
|
||||
../node/Defaults.hpp \
|
||||
../node/Dictionary.hpp \
|
||||
../node/EthernetTap.hpp \
|
||||
../node/HttpClient.hpp \
|
||||
../node/Identity.hpp \
|
||||
../node/InetAddress.hpp \
|
||||
../node/IpcConnection.hpp \
|
||||
../node/IpcListener.hpp \
|
||||
../node/Logger.hpp \
|
||||
../node/MAC.hpp \
|
||||
../node/Multicaster.hpp \
|
||||
@@ -76,10 +81,12 @@ HEADERS += mainwindow.h \
|
||||
../node/Mutex.hpp \
|
||||
../node/Network.hpp \
|
||||
../node/NetworkConfig.hpp \
|
||||
../node/Node.hpp \
|
||||
../node/NodeConfig.hpp \
|
||||
../node/NonCopyable.hpp \
|
||||
../node/Packet.hpp \
|
||||
../node/PacketDecoder.hpp \
|
||||
../node/Path.hpp \
|
||||
../node/Peer.hpp \
|
||||
../node/Poly1305.hpp \
|
||||
../node/RuntimeEnvironment.hpp \
|
||||
@@ -87,28 +94,29 @@ HEADERS += mainwindow.h \
|
||||
../node/Service.hpp \
|
||||
../node/SHA512.hpp \
|
||||
../node/SharedPtr.hpp \
|
||||
../node/Socket.hpp \
|
||||
../node/SocketManager.hpp \
|
||||
../node/SoftwareUpdater.hpp \
|
||||
../node/Switch.hpp \
|
||||
../node/SysEnv.hpp \
|
||||
../node/TcpSocket.hpp \
|
||||
../node/Thread.hpp \
|
||||
../node/Topology.hpp \
|
||||
../node/UdpSocket.hpp \
|
||||
../node/Utils.hpp \
|
||||
../ext/lz4/lz4.h \
|
||||
../ext/lz4/lz4hc.h \
|
||||
networkwidget.h \
|
||||
installdialog.h \
|
||||
mac_doprivileged.h \
|
||||
licensedialog.h \
|
||||
main.h \
|
||||
onetimedialog.h
|
||||
../ext/lz4/lz4hc.h
|
||||
|
||||
win32:SOURCES += ../node/WindowsEthernetTap.cpp
|
||||
mac:SOURCES += ../node/UnixEthernetTap.cpp
|
||||
|
||||
FORMS += mainwindow.ui \
|
||||
aboutwindow.ui \
|
||||
networkwidget.ui \
|
||||
installdialog.ui \
|
||||
licensedialog.ui \
|
||||
quickstartdialog.ui \
|
||||
onetimedialog.ui
|
||||
aboutwindow.ui \
|
||||
networkwidget.ui \
|
||||
installdialog.ui \
|
||||
licensedialog.ui \
|
||||
quickstartdialog.ui \
|
||||
onetimedialog.ui
|
||||
|
||||
RESOURCES += \
|
||||
resources.qrc
|
||||
@@ -117,4 +125,4 @@ mac:OBJECTIVE_SOURCES += \
|
||||
mac_doprivileged.mm
|
||||
|
||||
OTHER_FILES += \
|
||||
stylesheet.css
|
||||
stylesheet.css
|
||||
@@ -39,7 +39,19 @@ AboutWindow::AboutWindow(QWidget *parent) :
|
||||
ui(new Ui::AboutWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->aboutTextLabel->setText(QString("ZeroTier One\nVersion ")+ZeroTier::Node::versionString()+"\nQt Graphical User Interface\n\n(c)2011-2014 ZeroTier Networks LLC\n\nReleased under the terms of the GNU\nGeneral Public License v3.0, see: http://gplv3.fsf.org for terms.\n\nAuthor(s): Adam Ierymenko");
|
||||
ui->aboutTextLabel->setText(QString("ZeroTier One\nVersion ")+ZeroTier::Node::versionString()+"\nDesktop Graphical User Interface\n\n(c)2011-2014 ZeroTier Networks LLC\n\nReleased under the terms of the GNU\nGeneral Public License v3.0, see: http://gplv3.fsf.org for terms.\n\nAuthor(s): Adam Ierymenko");
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
/*
|
||||
QWidgetList widgets = this->findChildren<QWidget*>();
|
||||
foreach(QWidget *widget, widgets) {
|
||||
QFont font(widget->font());
|
||||
font.setPointSizeF(font.pointSizeF() * 0.75);
|
||||
widget->setFont(font);
|
||||
}
|
||||
*/
|
||||
this->raise();
|
||||
#endif
|
||||
}
|
||||
|
||||
AboutWindow::~AboutWindow()
|
||||
|
||||
@@ -20,6 +20,7 @@ LicenseDialog::LicenseDialog(QWidget *parent) :
|
||||
font.setPointSizeF(font.pointSizeF() * 0.75);
|
||||
widget->setFont(font);
|
||||
}
|
||||
this->raise();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+80
-81
@@ -63,32 +63,32 @@
|
||||
#endif
|
||||
|
||||
// Globally visible
|
||||
ZeroTier::Node::LocalClient *zeroTierClient = (ZeroTier::Node::LocalClient *)0;
|
||||
ZeroTier::Node::NodeControlClient *zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
|
||||
|
||||
// Main window instance for app
|
||||
QMainWindow *mainWindow = (MainWindow *)0;
|
||||
|
||||
// Handles message from ZeroTier One service
|
||||
static void handleZTMessage(void *arg,unsigned long id,const char *line)
|
||||
static void handleZTMessage(void *arg,const char *line)
|
||||
{
|
||||
static std::map< unsigned long,std::vector<std::string> > ztReplies;
|
||||
static std::vector<std::string> ztReplies;
|
||||
static QMutex ztReplies_m;
|
||||
|
||||
ztReplies_m.lock();
|
||||
if (*line) {
|
||||
ztReplies[id].push_back(std::string(line));
|
||||
ztReplies_m.unlock();
|
||||
} else { // empty lines conclude transmissions
|
||||
std::map< unsigned long,std::vector<std::string> >::iterator r(ztReplies.find(id));
|
||||
if (r != ztReplies.end()) {
|
||||
|
||||
if (line) {
|
||||
if ((line[0] == '.')&&(line[1] == (char)0)) {
|
||||
// The message is packed into an event and sent to the main window where
|
||||
// the actual parsing code lives.
|
||||
MainWindow::ZTMessageEvent *event = new MainWindow::ZTMessageEvent(r->second);
|
||||
ztReplies.erase(r);
|
||||
ztReplies_m.unlock();
|
||||
MainWindow::ZTMessageEvent *event = new MainWindow::ZTMessageEvent(ztReplies);
|
||||
ztReplies.clear();
|
||||
QCoreApplication::postEvent(mainWindow,event); // must post since this may be another thread
|
||||
} else ztReplies_m.unlock();
|
||||
} else if (line[0]) {
|
||||
ztReplies.push_back(std::string(line));
|
||||
}
|
||||
}
|
||||
|
||||
ztReplies_m.unlock();
|
||||
}
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
@@ -109,14 +109,17 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
#endif
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
// Windows operates at a different DPI, so we have to rescale the default Qt
|
||||
// font sizes so everything isn't huge. Yeah.
|
||||
QWidgetList widgets = this->findChildren<QWidget*>();
|
||||
foreach(QWidget *widget, widgets) {
|
||||
if ((typeid(*widget) != typeid(ui->menuBar))&&(typeid(*widget) != typeid(ui->menuFile))) {
|
||||
if (typeid(*widget) != typeid(*ui->menuFile)) { // menus don't need the DPI shift apparently
|
||||
QFont font(widget->font());
|
||||
font.setPointSizeF(font.pointSizeF() * 0.75);
|
||||
widget->setFont(font);
|
||||
}
|
||||
}
|
||||
this->raise();
|
||||
#endif
|
||||
|
||||
ui->noNetworksLabel->setVisible(true);
|
||||
@@ -133,7 +136,7 @@ MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
delete zeroTierClient;
|
||||
zeroTierClient = (ZeroTier::Node::LocalClient *)0;
|
||||
zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
|
||||
mainWindow = (MainWindow *)0;
|
||||
}
|
||||
|
||||
@@ -144,75 +147,72 @@ void MainWindow::timerEvent(QTimerEvent *event) // event can be null since code
|
||||
if (this->pollServiceTimerId < 0)
|
||||
return;
|
||||
|
||||
// Show quick start dialog on first launch, then reset timer to normal rate
|
||||
if (this->firstTimerTick) {
|
||||
this->firstTimerTick = false;
|
||||
this->killTimer(this->pollServiceTimerId);
|
||||
|
||||
if (!settings->value("shown_quickStart",false).toBool()) {
|
||||
on_actionQuick_Start_triggered();
|
||||
settings->setValue("shown_quickStart",true);
|
||||
settings->sync();
|
||||
}
|
||||
|
||||
this->pollServiceTimerId = this->startTimer(1500);
|
||||
this->pollServiceTimerId = this->startTimer(2000);
|
||||
}
|
||||
|
||||
if (!zeroTierClient) {
|
||||
std::string authToken;
|
||||
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
|
||||
#ifdef __APPLE__
|
||||
if (QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one")) {
|
||||
// Authorize user by copying auth token into local home directory
|
||||
QMessageBox::information(this,"Authorization Needed","Administrator privileges are required to allow the current user to control ZeroTier One on this computer. (You only have to do this once.)",QMessageBox::Ok,QMessageBox::NoButton);
|
||||
if ((!QFile::exists(ZeroTier::Node::NodeControlClient::authTokenDefaultUserPath()))&&(QFile::exists("/Library/Application Support/ZeroTier/One/zerotier-one"))) {
|
||||
// Authorize user by copying auth token into local home directory
|
||||
QMessageBox::information(this,"Authorization Needed","Administrator privileges are required to allow the current user to control ZeroTier One on this computer. (You only have to do this once.)",QMessageBox::Ok,QMessageBox::NoButton);
|
||||
|
||||
std::string homePath(QDir::homePath().toStdString());
|
||||
QString zt1Caches(QDir::homePath() + "/Library/Caches/ZeroTier/One");
|
||||
QDir::root().mkpath(zt1Caches);
|
||||
std::string tmpPath((zt1Caches + "/auth.sh").toStdString());
|
||||
std::string homePath(QDir::homePath().toStdString());
|
||||
QString zt1Caches(QDir::homePath() + "/Library/Caches/ZeroTier/One");
|
||||
QDir::root().mkpath(zt1Caches);
|
||||
std::string tmpPath((zt1Caches + "/auth.sh").toStdString());
|
||||
|
||||
FILE *scr = fopen(tmpPath.c_str(),"w");
|
||||
if (!scr) {
|
||||
QMessageBox::critical(this,"Cannot Authorize","Unable to authorize this user to administrate ZeroTier One. (Cannot write to temporary Library/Caches/ZeroTier/One folder.)",QMessageBox::Ok,QMessageBox::NoButton);
|
||||
QApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(scr,"#!/bin/bash\n");
|
||||
fprintf(scr,"export PATH=\"/bin:/usr/bin:/sbin:/usr/sbin\"\n");
|
||||
fprintf(scr,"if [ -f '/Library/Application Support/ZeroTier/One/authtoken.secret' ]; then\n");
|
||||
fprintf(scr," mkdir -p '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
|
||||
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier'\n",(int)getuid(),homePath.c_str());
|
||||
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier'\n",(int)getgid(),homePath.c_str());
|
||||
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier'\n",homePath.c_str());
|
||||
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getuid(),homePath.c_str());
|
||||
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getgid(),homePath.c_str());
|
||||
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
|
||||
fprintf(scr," cp -f '/Library/Application Support/ZeroTier/One/authtoken.secret' '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
|
||||
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getuid(),homePath.c_str());
|
||||
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getgid(),homePath.c_str());
|
||||
fprintf(scr," chmod 0600 '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
|
||||
fprintf(scr,"fi\n");
|
||||
fprintf(scr,"exit 0\n");
|
||||
|
||||
fclose(scr);
|
||||
chmod(tmpPath.c_str(),0755);
|
||||
|
||||
macExecutePrivilegedShellCommand((std::string("'")+tmpPath+"' >>/dev/null 2>&1").c_str());
|
||||
|
||||
unlink(tmpPath.c_str());
|
||||
FILE *scr = fopen(tmpPath.c_str(),"w");
|
||||
if (!scr) {
|
||||
QMessageBox::critical(this,"Cannot Authorize","Unable to authorize this user to administrate ZeroTier One. (Cannot write to temporary Library/Caches/ZeroTier/One folder.)",QMessageBox::Ok,QMessageBox::NoButton);
|
||||
QApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
|
||||
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultSystemPath().c_str(),authToken)) {
|
||||
QMessageBox::critical(this,"Cannot Authorize","Unable to authorize this user to administrate ZeroTier One. (Did you enter your password correctly?)",QMessageBox::Ok,QMessageBox::NoButton);
|
||||
QApplication::exit(1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
fprintf(scr,"#!/bin/bash\n");
|
||||
fprintf(scr,"export PATH=\"/bin:/usr/bin:/sbin:/usr/sbin\"\n");
|
||||
fprintf(scr,"if [ -f '/Library/Application Support/ZeroTier/One/authtoken.secret' ]; then\n");
|
||||
fprintf(scr," mkdir -p '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
|
||||
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier'\n",(int)getuid(),homePath.c_str());
|
||||
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier'\n",(int)getgid(),homePath.c_str());
|
||||
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier'\n",homePath.c_str());
|
||||
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getuid(),homePath.c_str());
|
||||
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One'\n",(int)getgid(),homePath.c_str());
|
||||
fprintf(scr," chmod 0700 '%s/Library/Application Support/ZeroTier/One'\n",homePath.c_str());
|
||||
fprintf(scr," cp -f '/Library/Application Support/ZeroTier/One/authtoken.secret' '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
|
||||
fprintf(scr," chown %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getuid(),homePath.c_str());
|
||||
fprintf(scr," chgrp %d '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",(int)getgid(),homePath.c_str());
|
||||
fprintf(scr," chmod 0600 '%s/Library/Application Support/ZeroTier/One/authtoken.secret'\n",homePath.c_str());
|
||||
fprintf(scr,"fi\n");
|
||||
fprintf(scr,"exit 0\n");
|
||||
|
||||
fclose(scr);
|
||||
chmod(tmpPath.c_str(),0755);
|
||||
|
||||
macExecutePrivilegedShellCommand((std::string("'")+tmpPath+"' >>/dev/null 2>&1").c_str());
|
||||
|
||||
unlink(tmpPath.c_str());
|
||||
}
|
||||
#endif // __APPLE__
|
||||
|
||||
zeroTierClient = new ZeroTier::Node::LocalClient(authToken.c_str(),0,&handleZTMessage,this);
|
||||
try {
|
||||
zeroTierClient = new ZeroTier::Node::NodeControlClient((const char *)0,&handleZTMessage,this);
|
||||
const char *err = zeroTierClient->error();
|
||||
if (err) {
|
||||
delete zeroTierClient;
|
||||
zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
|
||||
}
|
||||
} catch ( ... ) {
|
||||
zeroTierClient = (ZeroTier::Node::NodeControlClient *)0;
|
||||
}
|
||||
}
|
||||
|
||||
if (++this->cyclesSinceResponseFromService >= 3) {
|
||||
@@ -224,9 +224,11 @@ void MainWindow::timerEvent(QTimerEvent *event) // event can be null since code
|
||||
ui->networkListWidget->setVisible(false);
|
||||
}
|
||||
|
||||
zeroTierClient->send("info");
|
||||
zeroTierClient->send("listnetworks");
|
||||
zeroTierClient->send("listpeers");
|
||||
if (zeroTierClient) {
|
||||
zeroTierClient->send("info");
|
||||
zeroTierClient->send("listnetworks");
|
||||
zeroTierClient->send("listpeers");
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::customEvent(QEvent *event)
|
||||
@@ -234,15 +236,14 @@ void MainWindow::customEvent(QEvent *event)
|
||||
ZTMessageEvent *m = (ZTMessageEvent *)event; // only one custom event type so far
|
||||
if (m->ztMessage.size() == 0)
|
||||
return;
|
||||
|
||||
this->cyclesSinceResponseFromService = 0;
|
||||
|
||||
std::vector<std::string> hdr(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[0]));
|
||||
std::vector<std::string> hdr(ZeroTier::Node::NodeControlClient::splitLine(m->ztMessage[0]));
|
||||
if (hdr.size() < 2)
|
||||
return;
|
||||
if (hdr[0] != "200")
|
||||
return;
|
||||
|
||||
this->cyclesSinceResponseFromService = 0;
|
||||
|
||||
if (hdr[1] == "info") {
|
||||
if (hdr.size() >= 3)
|
||||
this->myAddress = hdr[2].c_str();
|
||||
@@ -253,7 +254,7 @@ void MainWindow::customEvent(QEvent *event)
|
||||
} else if (hdr[1] == "listnetworks") {
|
||||
std::map< std::string,std::vector<std::string> > newNetworks;
|
||||
for(unsigned long i=1;i<m->ztMessage.size();++i) {
|
||||
std::vector<std::string> l(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[i]));
|
||||
std::vector<std::string> l(ZeroTier::Node::NodeControlClient::splitLine(m->ztMessage[i]));
|
||||
// 200 listnetworks <nwid> <name> <status> <config age> <type> <dev> <ips>
|
||||
if ((l.size() == 9)&&(l[2].length() == 16))
|
||||
newNetworks[l[2]] = l;
|
||||
@@ -306,12 +307,10 @@ void MainWindow::customEvent(QEvent *event)
|
||||
}
|
||||
} else if (hdr[1] == "listpeers") {
|
||||
this->numPeers = 0;
|
||||
for(unsigned long i=1;i<m->ztMessage.size();++i) {
|
||||
std::vector<std::string> l(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[i]));
|
||||
if ((l.size() >= 5)&&((l[3] != "-")||(l[4] != "-")))
|
||||
++this->numPeers; // number of direct peers online -- check for active IPv4 and/or IPv6 address
|
||||
}
|
||||
}
|
||||
for(unsigned long i=1;i<m->ztMessage.size();++i)
|
||||
++this->numPeers;
|
||||
} else
|
||||
return;
|
||||
|
||||
if (!ui->networkListWidget->count()) {
|
||||
ui->noNetworksLabel->setText("You Have Not Joined Any Networks");
|
||||
@@ -332,7 +331,7 @@ void MainWindow::customEvent(QEvent *event)
|
||||
st += this->myVersion;
|
||||
st += ", ";
|
||||
st += QString::number(this->numPeers);
|
||||
st += " direct links to peers";
|
||||
st += " peers";
|
||||
ui->statusLabel->setText(st);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class MainWindow;
|
||||
|
||||
// Globally visible instance of local client for communicating with ZT1
|
||||
// Can be null if not connected, or will point to current
|
||||
extern ZeroTier::Node::LocalClient *zeroTierClient;
|
||||
extern ZeroTier::Node::NodeControlClient *zeroTierClient;
|
||||
|
||||
// Globally visible pointer to main app window
|
||||
extern QMainWindow *mainWindow;
|
||||
|
||||
@@ -80,9 +80,6 @@ NetworkWidget::~NetworkWidget()
|
||||
void NetworkWidget::setStatus(const std::string &status,const std::string &age)
|
||||
{
|
||||
ui->statusLabel->setText(QString(status.c_str()));
|
||||
if (status == "OK")
|
||||
ui->ageLabel->setText(QString("[") + age.c_str() + "s ago]");
|
||||
else ui->ageLabel->setText(QString());
|
||||
}
|
||||
|
||||
void NetworkWidget::setNetworkName(const std::string &name)
|
||||
|
||||
+47
-95
@@ -178,12 +178,6 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="networkStatsWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<property name="fieldGrowthPolicy">
|
||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||
@@ -232,6 +226,12 @@
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="networkTypeLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
@@ -265,6 +265,32 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="statusLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Status of this network.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>?</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="font">
|
||||
@@ -280,101 +306,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="deviceLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="statusLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Status of this network.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>?</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="ageLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>How recently did this network refresh its settings?</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>[0s ago]</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::NoTextInteraction</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="deviceLabel">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
@@ -396,6 +335,19 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -1,36 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<DOCUMENT Type="Advanced Installer" CreateVersion="10.9" version="10.9.1" Modules="professional" RootPath="." Language="en" Id="{DC564647-6BF0-4550-87F4-89C938D0159C}">
|
||||
<DOCUMENT Type="Advanced Installer" CreateVersion="10.9" version="11.0" Modules="professional" RootPath="." Language="en" Id="{DC564647-6BF0-4550-87F4-89C938D0159C}">
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.ProjectOptionsComponent">
|
||||
<ROW Name="HiddenItems" Value="UpdaterComponent;MsiExtComponent;MsiAssemblyComponent;ActSyncAppComponent;MsiThemeComponent;BackgroundImagesComponent;DictionaryComponent;CPLAppletComponent;MsiClassComponent;WebApplicationsComponent;MsiOdbcDataSrcComponent;MsiAppSearchComponent"/>
|
||||
<ROW Name="HiddenItems" Value="UpdaterComponent;SerValComponent;PreReqComponent;MsiMergeModsComponent;MsiRegsComponent;MsiExtComponent;MsiAssemblyComponent;ActSyncAppComponent;MsiThemeComponent;BackgroundImagesComponent;DictionaryComponent;MsiEnvComponent;CPLAppletComponent;MsiClassComponent;WebApplicationsComponent;MsiOdbcDataSrcComponent;MsiAppSearchComponent"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">
|
||||
<ROW Property="AI_BITMAP_DISPLAY_MODE" Value="0"/>
|
||||
<ROW Property="AI_EXTERNALUIUNINSTALLERNAME" MultiBuildValue="DefaultBuild:aiui"/>
|
||||
<ROW Property="AI_PRODUCTNAME_ARP" Value="ZeroTier One"/>
|
||||
<ROW Property="AI_UNINSTALLER" Value="msiexec.exe"/>
|
||||
<ROW Property="ALLUSERS" Value="1"/>
|
||||
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/>
|
||||
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]."/>
|
||||
<ROW Property="ARPCONTACT" Value="contact@zerotier.com"/>
|
||||
<ROW Property="ARPNOMODIFY" MultiBuildValue="DefaultBuild:1"/>
|
||||
<ROW Property="ARPNOREPAIR" Value="1"/>
|
||||
<ROW Property="ARPPRODUCTICON" Value="zt1icon.exe" Type="8"/>
|
||||
<ROW Property="ARPSYSTEMCOMPONENT" Value="1"/>
|
||||
<ROW Property="ARPURLINFOABOUT" Value="https://www.zerotier.com/"/>
|
||||
<ROW Property="ARPURLUPDATEINFO" Value="https://www.zerotier.com/download.html"/>
|
||||
<ROW Property="CTRLS" Value="2"/>
|
||||
<ROW Property="MSIFASTINSTALL" MultiBuildValue="DefaultBuild:2"/>
|
||||
<ROW Property="Manufacturer" Value="ZeroTier Networks LLC"/>
|
||||
<ROW Property="ProductCode" Value="1033:{24DFCEE7-3AC9-4D39-BD53-974220C12043} " Type="16"/>
|
||||
<ROW Property="ProductCode" Value="1033:{743D434E-12E1-4A25-860E-76F92B076204} " Type="16"/>
|
||||
<ROW Property="ProductLanguage" Value="1033"/>
|
||||
<ROW Property="ProductName" Value="ZeroTier One"/>
|
||||
<ROW Property="ProductVersion" Value="0.7.0" Type="32"/>
|
||||
<ROW Property="ProductVersion" Value="0.8.2" Type="32"/>
|
||||
<ROW Property="REBOOT" MultiBuildValue="DefaultBuild:ReallySuppress"/>
|
||||
<ROW Property="RUNAPPLICATION" Value="1" Type="4"/>
|
||||
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
|
||||
<ROW Property="UpgradeCode" Value="{B0E2A5F3-88B6-4E77-B922-CB4739B4C4C8}"/>
|
||||
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
|
||||
<ROW Property="WindowsType9XDisplay" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT" MultiBuildValue="DefaultBuild:Windows 2000, Windows 2000 Service Pack 1, Windows 2000 Service Pack 2, Windows 2000 Service Pack 3, Windows 2000 Service Pack 4, Windows XP x86, Windows XP x86 Service Pack 1, Windows XP x86 Service Pack 2, Windows XP x86 Service Pack 3" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT" MultiBuildValue="DefaultBuild:Windows 2000, Windows 2000 Service Pack 1, Windows 2000 Service Pack 2, Windows 2000 Service Pack 3, Windows 2000 Service Pack 4, Windows XP x86, Windows XP x86 Service Pack 1, Windows XP x86 Service Pack 2, Windows XP x86 Service Pack 3, Windows Server 2003 x86, Windows Server 2003 x86 Service Pack 1, Windows Server 2003 x86 Service Pack 2, Windows Vista x86, Windows Vista x86 Service Pack 1, Windows Vista x86 Service Pack 2" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT40" MultiBuildValue="DefaultBuild:Windows NT 4.0" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT40Display" MultiBuildValue="DefaultBuild:Windows NT 4.0" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT64" MultiBuildValue="DefaultBuild:Windows XP x64, Windows XP x64 Service Pack 1, Windows XP x64 Service Pack 2" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT64Display" MultiBuildValue="DefaultBuild:Windows XP x64" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNTDisplay" MultiBuildValue="DefaultBuild:Windows 2000, Windows XP x86" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT64" MultiBuildValue="DefaultBuild:Windows XP x64, Windows XP x64 Service Pack 1, Windows XP x64 Service Pack 2, Windows Server 2003 x64, Windows Server 2003 x64 Service Pack 1, Windows Server 2003 x64 Service Pack 2, Windows Vista x64, Windows Vista x64 Service Pack 1, Windows Vista x64 Service Pack 2" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNT64Display" MultiBuildValue="DefaultBuild:Windows XP x64, Windows Server 2003 x64, Windows Vista x64" ValueLocId="-"/>
|
||||
<ROW Property="WindowsTypeNTDisplay" MultiBuildValue="DefaultBuild:Windows 2000, Windows XP x86, Windows Server 2003 x86, Windows Vista x86" ValueLocId="-"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiDirsComponent">
|
||||
<ROW Directory="APPDIR" Directory_Parent="TARGETDIR" DefaultDir="APPDIR:." IsPseudoRoot="1"/>
|
||||
@@ -48,6 +53,8 @@
|
||||
<ROW Directory="x86_Dir" Directory_Parent="tapwindows_Dir" DefaultDir="x86"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiCompsComponent">
|
||||
<ROW Component="AI_CustomARPName" ComponentId="{1CA26B88-CA04-448B-8DF1-7848E80EC15D}" Directory_="APPDIR" Attributes="4" KeyPath="DisplayName" Options="1"/>
|
||||
<ROW Component="AI_DisableModify" ComponentId="{020DCABD-5D56-49B9-AF48-F07F0B55E590}" Directory_="APPDIR" Attributes="4" KeyPath="NoModify" Options="1"/>
|
||||
<ROW Component="ProductInformation" ComponentId="{DB078D04-EA8E-4A7C-9001-89BAD932F9D9}" Directory_="APPDIR" Attributes="4" KeyPath="Version"/>
|
||||
<ROW Component="WdfCoinstaller01011.dll" ComponentId="{A417293D-AA26-447A-9A16-E0BCB2084CBA}" Directory_="x64_Dir" Attributes="256" Condition="VersionNT64" KeyPath="WdfCoinstaller01011.dll"/>
|
||||
<ROW Component="WdfCoinstaller01011.dll_1" ComponentId="{C629091A-4845-4BD8-9E49-3A051FDDBEF9}" Directory_="x86_Dir" Attributes="0" Condition="NOT VersionNT64" KeyPath="WdfCoinstaller01011.dll_1"/>
|
||||
@@ -63,7 +70,7 @@
|
||||
<ROW Component="zttap200.cat_1" ComponentId="{BA0FB826-479C-46E8-AB2C-9017D40A99D8}" Directory_="x86_Dir" Attributes="0" Condition="NOT VersionNT64" KeyPath="zttap200.cat_1" Type="0"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiFeatsComponent">
|
||||
<ROW Feature="ZeroTierOne" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="ProductInformation WdfCoinstaller01011.dll WdfCoinstaller01011.dll_1 ZeroTierOne.exe devcon_x64.exe devcon_x86.exe networks.d regid.201001.com.zerotier updates.d zerotierone_x64.exe zerotierone_x86.exe zttap200.cat zttap200.cat_1"/>
|
||||
<ROW Feature="ZeroTierOne" Title="MainFeature" Description="Description" Display="1" Level="1" Directory_="APPDIR" Attributes="0" Components="AI_CustomARPName AI_DisableModify ProductInformation WdfCoinstaller01011.dll WdfCoinstaller01011.dll_1 ZeroTierOne.exe devcon_x64.exe devcon_x86.exe networks.d regid.201001.com.zerotier updates.d zerotierone_x64.exe zerotierone_x86.exe zttap200.cat zttap200.cat_1"/>
|
||||
<ATTRIBUTE name="CurrentFeature" value="ZeroTierOne"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiFilesComponent">
|
||||
@@ -82,7 +89,7 @@
|
||||
<ROW File="zttap200.sys_1" Component_="zttap200.cat_1" FileName="zttap200.sys" Attributes="0" SourcePath="..\..\bin\tap-windows\x86\zttap200.sys" SelfReg="false" NextFile="devcon_x64.exe"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">
|
||||
<ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" Languages="en" InstallationType="4" ExtUI="true" UseLargeSchema="true"/>
|
||||
<ROW BuildKey="DefaultBuild" BuildName="MSI" BuildOrder="1" BuildType="0" PackageFolder="..\..\..\windows\Build" PackageFileName="ZeroTier One" Languages="en" InstallationType="4" ExtUI="true" UseLargeSchema="true"/>
|
||||
<ATTRIBUTE name="CurrentBuild" value="DefaultBuild"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.CacheComponent">
|
||||
@@ -93,7 +100,7 @@
|
||||
<ROW Path="<AI_DICTS>ui_en.ail"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.DigCertStoreComponent">
|
||||
<ROW TimeStampUrl="http://timestamp.digicert.com" SignerDescription="ZeroTier One" SignOptions="7" SignTool="0" Thumbprint="5809bb3255b4f32dd93619c1cf26a7df6c282a89 Subject: ZeroTier Networks LLC Issuer: DigiCert High Assurance Code Signing CA-1 Valid from 12/23/2013 to 02/02/2015"/>
|
||||
<ROW TimeStampUrl="http://timestamp.verisign.com/scripts/timstamp.dll" SignerDescription="ZeroTier One" SignOptions="7" SignTool="0" Thumbprint="5809bb3255b4f32dd93619c1cf26a7df6c282a89 Subject: ZeroTier Networks LLC Issuer: DigiCert High Assurance Code Signing CA-1 Valid from 12/23/2013 to 02/02/2015"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.FragmentComponent">
|
||||
<ROW Fragment="CommonUI.aip" Path="<AI_FRAGS>CommonUI.aip"/>
|
||||
@@ -117,6 +124,7 @@
|
||||
<ROW Action="AI_XmlUninstall" Description="Generating actions to configure XML files" DescriptionLocId="ActionText.Description.AI_XmlUninstall"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiBinaryComponent">
|
||||
<ROW Name="ExternalUICleaner.dll" SourcePath="<AI_CUSTACTS>ExternalUICleaner.dll"/>
|
||||
<ROW Name="ShortcutFlags.dll" SourcePath="<AI_CUSTACTS>ShortcutFlags.dll"/>
|
||||
<ROW Name="aicustact.dll" SourcePath="<AI_CUSTACTS>aicustact.dll"/>
|
||||
<ROW Name="xmlCfg.dll" SourcePath="<AI_CUSTACTS>xmlCfg.dll"/>
|
||||
@@ -127,10 +135,10 @@
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiControlEventComponent">
|
||||
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="EndDialog" Argument="Return" Condition="AI_INSTALL" Ordering="1"/>
|
||||
<ROW Dialog_="MaintenanceWelcomeDlg" Control_="Next" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="99"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_MAINT" Ordering="198"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="202"/>
|
||||
<ROW Dialog_="CustomizeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_MAINT" Ordering="101"/>
|
||||
<ROW Dialog_="CustomizeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceTypeDlg" Condition="AI_MAINT" Ordering="1"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_MAINT" Ordering="198"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="202"/>
|
||||
<ROW Dialog_="MaintenanceTypeDlg" Control_="ChangeButton" Event="NewDialog" Argument="CustomizeDlg" Condition="AI_MAINT" Ordering="501"/>
|
||||
<ROW Dialog_="MaintenanceTypeDlg" Control_="Back" Event="NewDialog" Argument="MaintenanceWelcomeDlg" Condition="AI_MAINT" Ordering="1"/>
|
||||
<ROW Dialog_="MaintenanceTypeDlg" Control_="RemoveButton" Event="NewDialog" Argument="VerifyRemoveDlg" Condition="AI_MAINT AND InstallMode="Remove"" Ordering="601"/>
|
||||
@@ -140,6 +148,8 @@
|
||||
<ROW Dialog_="VerifyRepairDlg" Control_="Repair" Event="EndDialog" Argument="Return" Condition="AI_MAINT AND InstallMode="Repair"" Ordering="399" Options="1"/>
|
||||
<ROW Dialog_="VerifyRemoveDlg" Control_="Remove" Event="EndDialog" Argument="Return" Condition="AI_MAINT AND InstallMode="Remove"" Ordering="299" Options="1"/>
|
||||
<ROW Dialog_="PatchWelcomeDlg" Control_="Next" Event="NewDialog" Argument="VerifyReadyDlg" Condition="AI_PATCH" Ordering="201"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_PATCH" Ordering="199"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="PatchWelcomeDlg" Condition="AI_PATCH" Ordering="203"/>
|
||||
<ROW Dialog_="ResumeDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_RESUME" Ordering="299"/>
|
||||
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="SpawnDialog" Argument="OutOfRbDiskDlg" Condition="AI_INSTALL AND OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)" Ordering="2" Options="2"/>
|
||||
<ROW Dialog_="WelcomeDlg" Control_="Next" Event="EnableRollback" Argument="False" Condition="AI_INSTALL AND OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"" Ordering="3" Options="2"/>
|
||||
@@ -149,8 +159,6 @@
|
||||
<ROW Dialog_="WelcomeDlg" Control_="WelcomeDlgDialogInitializer" Event="[AI_Text_Next_Orig]" Argument="[Text_Next]" Condition="AI_INSTALL" Ordering="2" Options="2"/>
|
||||
<ROW Dialog_="WelcomeDlg" Control_="WelcomeDlgDialogInitializer" Event="[Text_Next]" Argument="[Text_Install]" Condition="AI_INSTALL" Ordering="3" Options="2"/>
|
||||
<ROW Dialog_="WelcomeDlg" Control_="Back" Event="[ButtonText_Next]" Argument="[AI_ButtonText_Next_Orig]" Condition="AI_INSTALL" Ordering="0" Options="2"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Install" Event="EndDialog" Argument="Return" Condition="AI_PATCH" Ordering="199"/>
|
||||
<ROW Dialog_="VerifyReadyDlg" Control_="Back" Event="NewDialog" Argument="PatchWelcomeDlg" Condition="AI_PATCH" Ordering="203"/>
|
||||
<ROW Dialog_="WelcomeDlg" Control_="Back" Event="[Text_Next]" Argument="[AI_Text_Next_Orig]" Condition="AI_INSTALL" Ordering="1" Options="2"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiCreateFolderComponent">
|
||||
@@ -165,15 +173,17 @@
|
||||
<ROW Action="AI_DATA_SETTER_1" Type="51" Source="CustomActionData" Target="[~]"/>
|
||||
<ROW Action="AI_DATA_SETTER_2" Type="51" Source="MakeSureServiceIsStopped" Target="ZeroTierOneService"/>
|
||||
<ROW Action="AI_DOWNGRADE" Type="19" Target="4010"/>
|
||||
<ROW Action="AI_DoRemoveExternalUIStub" Type="3585" Source="ExternalUICleaner.dll" Target="DoRemoveExternalUIStub" WithoutSeq="true"/>
|
||||
<ROW Action="AI_DpiContentScale" Type="1" Source="aicustact.dll" Target="DpiContentScale"/>
|
||||
<ROW Action="AI_GetArpIconPath" Type="1" Source="aicustact.dll" Target="GetArpIconPath"/>
|
||||
<ROW Action="AI_InstallModeCheck" Type="1" Source="aicustact.dll" Target="UpdateInstallMode" WithoutSeq="true"/>
|
||||
<ROW Action="AI_LaunchApp" Type="1" Source="aicustact.dll" Target="[#ZeroTierOne.exe]"/>
|
||||
<ROW Action="AI_PREPARE_UPGRADE" Type="65" Source="aicustact.dll" Target="PrepareUpgrade"/>
|
||||
<ROW Action="AI_PrepareShortcutFlags" Type="1" Source="ShortcutFlags.dll" Target="PrepareActionData"/>
|
||||
<ROW Action="AI_RESTORE_AI_SETUPEXEPATH" Type="51" Source="AI_SETUPEXEPATH" Target="[AI_SETUPEXEPATH_ORIGINAL]"/>
|
||||
<ROW Action="AI_RESTORE_LOCATION" Type="65" Source="aicustact.dll" Target="RestoreLocation"/>
|
||||
<ROW Action="AI_RemoveExternalUIStub" Type="1" Source="ExternalUICleaner.dll" Target="RemoveExternalUIStub"/>
|
||||
<ROW Action="AI_ResolveKnownFolders" Type="1" Source="aicustact.dll" Target="AI_ResolveKnownFolders"/>
|
||||
<ROW Action="AI_ResolveLocalizedCredentials" Type="1" Source="aicustact.dll" Target="GetLocalizedCredentials"/>
|
||||
<ROW Action="AI_SHOW_LOG" Type="65" Source="aicustact.dll" Target="LaunchLogFile" WithoutSeq="true"/>
|
||||
<ROW Action="AI_STORE_LOCATION" Type="51" Source="ARPINSTALLLOCATION" Target="[APPDIR]"/>
|
||||
<ROW Action="AI_XmlCommit" Type="11777" Source="xmlCfg.dll" Target="OnXmlCommit" WithoutSeq="true"/>
|
||||
@@ -197,10 +207,9 @@
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstExSeqComponent">
|
||||
<ROW Action="AI_DOWNGRADE" Condition="AI_NEWERPRODUCTFOUND AND (UILevel <> 5)" Sequence="210"/>
|
||||
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=""" Sequence="749"/>
|
||||
<ROW Action="AI_STORE_LOCATION" Condition="(Not Installed) OR REINSTALL" Sequence="1503"/>
|
||||
<ROW Action="AI_STORE_LOCATION" Condition="(Not Installed) OR REINSTALL" Sequence="1504"/>
|
||||
<ROW Action="AI_PREPARE_UPGRADE" Condition="AI_UPGRADE="No" AND (Not Installed)" Sequence="1399"/>
|
||||
<ROW Action="AI_ResolveKnownFolders" Sequence="52"/>
|
||||
<ROW Action="AI_ResolveLocalizedCredentials" Sequence="51"/>
|
||||
<ROW Action="AI_PrepareShortcutFlags" Condition="(VersionNT > 501) AND ((NOT Installed) OR (Installed AND (REMOVE<>"ALL") AND (AI_INSTALL_MODE<>"Remove")))" Sequence="4501"/>
|
||||
<ROW Action="AI_XmlInstall" Condition="(REMOVE <> "ALL")" Sequence="5102"/>
|
||||
<ROW Action="AI_DATA_SETTER" Condition="(REMOVE <> "ALL")" Sequence="5101"/>
|
||||
@@ -211,27 +220,47 @@
|
||||
<ROW Action="TapDeviceRemove64" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( VersionNT64 )" Sequence="1601"/>
|
||||
<ROW Action="TapDeviceRemove32" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE ) AND ( NOT VersionNT64 )" Sequence="1602"/>
|
||||
<ROW Action="TapDriverInstall32" Condition="( NOT Installed AND NOT OLDPRODUCTS ) AND ( NOT VersionNT64 )" Sequence="6402"/>
|
||||
<ROW Action="MakeSureServiceIsStopped" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE )" Sequence="1502"/>
|
||||
<ROW Action="AI_DATA_SETTER_2" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE )" Sequence="1501"/>
|
||||
<ROW Action="MakeSureServiceIsStopped" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE )" Sequence="1503"/>
|
||||
<ROW Action="AI_DATA_SETTER_2" Condition="( Installed AND ( REMOVE = "ALL" OR AI_INSTALL_MODE = "Remove" ) AND NOT UPGRADINGPRODUCTCODE )" Sequence="1502"/>
|
||||
<ROW Action="AI_GetArpIconPath" Sequence="51"/>
|
||||
<ROW Action="AI_RemoveExternalUIStub" Condition="(REMOVE="ALL") AND ((VersionNT > 500) OR((VersionNT = 500) AND (ServicePackLevel >= 4)))" Sequence="1501"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiInstallUISequenceComponent">
|
||||
<ROW Action="AI_RESTORE_LOCATION" Condition="APPDIR=""" Sequence="749"/>
|
||||
<ROW Action="AI_ResolveKnownFolders" Sequence="53"/>
|
||||
<ROW Action="AI_ResolveLocalizedCredentials" Sequence="52"/>
|
||||
<ROW Action="AI_ResolveKnownFolders" Sequence="52"/>
|
||||
<ROW Action="AI_DpiContentScale" Sequence="51"/>
|
||||
<ROW Action="AI_BACKUP_AI_SETUPEXEPATH" Sequence="99"/>
|
||||
<ROW Action="AI_RESTORE_AI_SETUPEXEPATH" Condition="AI_SETUPEXEPATH_ORIGINAL" Sequence="101"/>
|
||||
<ROW Action="ExecuteAction" Sequence="1299" SeqType="0" MsiKey="ExecuteAction"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiLaunchConditionsComponent">
|
||||
<ROW Condition="( Version9X OR ( NOT VersionNT64 ) OR ( VersionNT64 AND ((VersionNT64 <> 502) OR (((VersionNT64 = 502) AND (ServicePackLevel >= 1)) OR (MsiNTProductType <> 1))) AND ((VersionNT64 <> 502) OR (((VersionNT64 = 502) AND (ServicePackLevel <> 1)) OR (MsiNTProductType <> 1))) AND ((VersionNT64 <> 502) OR (((VersionNT64 = 502) AND (ServicePackLevel <> 2)) OR (MsiNTProductType <> 1))) ) )" Description="[ProductName] cannot be installed on the following Windows versions: [WindowsTypeNT64Display]" DescriptionLocId="AI.LaunchCondition.NoSpecificNT64" IsPredefined="true" Builds="DefaultBuild"/>
|
||||
<ROW Condition="( Version9X OR VersionNT64 OR ( VersionNT AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel >= 1))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 1))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 2))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 3))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 4))) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel >= 1))) OR VersionNT64) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel <> 1))) OR VersionNT64) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel <> 2))) OR VersionNT64) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel <> 3))) OR VersionNT64) ) )" Description="[ProductName] cannot be installed on the following Windows versions: [WindowsTypeNTDisplay]" DescriptionLocId="AI.LaunchCondition.NoSpecificNT" IsPredefined="true" Builds="DefaultBuild"/>
|
||||
<ROW Condition="( Version9X OR ( NOT VersionNT64 ) OR ( VersionNT64 AND ((VersionNT64 <> 502) OR (((VersionNT64 = 502) AND (ServicePackLevel >= 1)) OR (MsiNTProductType <> 1))) AND ((VersionNT64 <> 502) OR (((VersionNT64 = 502) AND (ServicePackLevel <> 1)) OR (MsiNTProductType <> 1))) AND ((VersionNT64 <> 502) OR (((VersionNT64 = 502) AND (ServicePackLevel <> 2)) OR (MsiNTProductType <> 1))) AND ((VersionNT64 <> 502) OR ((VersionNT64 = 502) AND ((MsiNTProductType = 1) OR (ServicePackLevel >= 1)))) AND ((VersionNT64 <> 502) OR ((VersionNT64 = 502) AND ((MsiNTProductType = 1) OR (ServicePackLevel <> 1)))) AND ((VersionNT64 <> 502) OR ((VersionNT64 = 502) AND ((MsiNTProductType = 1) OR (ServicePackLevel <> 2)))) AND ((VersionNT64 <> 600) OR (((VersionNT64 = 600) AND (ServicePackLevel >= 1)) OR (MsiNTProductType <> 1))) AND ((VersionNT64 <> 600) OR (((VersionNT64 = 600) AND (ServicePackLevel <> 1)) OR (MsiNTProductType <> 1))) AND ((VersionNT64 <> 600) OR (((VersionNT64 = 600) AND (ServicePackLevel <> 2)) OR (MsiNTProductType <> 1))) ) )" Description="[ProductName] cannot be installed on the following Windows versions: [WindowsTypeNT64Display]" DescriptionLocId="AI.LaunchCondition.NoSpecificNT64" IsPredefined="true" Builds="DefaultBuild"/>
|
||||
<ROW Condition="( Version9X OR VersionNT64 OR ( VersionNT AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel >= 1))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 1))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 2))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 3))) AND ((VersionNT <> 500) OR ((VersionNT = 500) AND (ServicePackLevel <> 4))) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel >= 1))) OR VersionNT64) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel <> 1))) OR VersionNT64) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel <> 2))) OR VersionNT64) AND (((VersionNT <> 501) OR ((VersionNT = 501) AND (ServicePackLevel <> 3))) OR VersionNT64) AND (((VersionNT <> 502) OR ((VersionNT = 502) AND (ServicePackLevel >= 1))) OR VersionNT64) AND (((VersionNT <> 502) OR ((VersionNT = 502) AND (ServicePackLevel <> 1))) OR VersionNT64) AND (((VersionNT <> 502) OR ((VersionNT = 502) AND (ServicePackLevel <> 2))) OR VersionNT64) AND (((VersionNT <> 600) OR (((VersionNT = 600) AND (ServicePackLevel >= 1)) OR (MsiNTProductType <> 1))) OR VersionNT64) AND (((VersionNT <> 600) OR (((VersionNT = 600) AND (ServicePackLevel <> 1)) OR (MsiNTProductType <> 1))) OR VersionNT64) AND (((VersionNT <> 600) OR (((VersionNT = 600) AND (ServicePackLevel <> 2)) OR (MsiNTProductType <> 1))) OR VersionNT64) ) )" Description="[ProductName] cannot be installed on the following Windows versions: [WindowsTypeNTDisplay]" DescriptionLocId="AI.LaunchCondition.NoSpecificNT" IsPredefined="true" Builds="DefaultBuild"/>
|
||||
<ROW Condition="(VersionNT <> 400)" Description="[ProductName] cannot be installed on the following Windows versions: [WindowsTypeNT40Display]" DescriptionLocId="AI.LaunchCondition.NoNT40" IsPredefined="true" Builds="DefaultBuild"/>
|
||||
<ROW Condition="Privileged" Description="[ProductName] requires administrative privileges to install." DescriptionLocId="AI.LaunchCondition.Privileged" IsPredefined="true" Builds="DefaultBuild"/>
|
||||
<ROW Condition="VersionNT" Description="[ProductName] cannot be installed on [WindowsType9XDisplay]" DescriptionLocId="AI.LaunchCondition.No9X" IsPredefined="true" Builds="DefaultBuild"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiRegsComponent">
|
||||
<ROW Registry="Comments" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="Comments" Value="[ARPCOMMENTS]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="Contact" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="Contact" Value="[ARPCONTACT]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="DisplayIcon" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="DisplayIcon" Value="[ARP_ICON_PATH]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="DisplayName" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="DisplayName" Value="[AI_PRODUCTNAME_ARP]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="DisplayVersion" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="DisplayVersion" Value="[ProductVersion]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="HelpLink" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="HelpLink" Value="[ARPHELPLINK]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="HelpTelephone" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="HelpTelephone" Value="[ARPHELPTELEPHONE]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="InstallLocation" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="InstallLocation" Value="[APPDIR]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="ModifyPath" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="ModifyPath" Value="[AI_UNINSTALLER] /I [ProductCode]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="NoModify" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="NoModify" Value="#1" Component_="AI_DisableModify"/>
|
||||
<ROW Registry="NoRepair" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="NoRepair" Value="#1" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="Path" Root="-1" Key="Software\[Manufacturer]\[ProductName]" Name="Path" Value="[APPDIR]" Component_="ProductInformation"/>
|
||||
<ROW Registry="Publisher" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="Publisher" Value="[Manufacturer]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="URLInfoAbout" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="URLInfoAbout" Value="[ARPURLINFOABOUT]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="URLUpdateInfo" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="URLUpdateInfo" Value="[ARPURLUPDATEINFO]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="UninstallPath" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="UninstallPath" Value="[AI_UNINSTALLER] /x [ProductCode]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="UninstallString" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="UninstallString" Value="[AI_UNINSTALLER] /x [ProductCode]" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="Version" Root="-1" Key="Software\[Manufacturer]\[ProductName]" Name="Version" Value="[ProductVersion]" Component_="ProductInformation"/>
|
||||
<ROW Registry="VersionMajor" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="VersionMajor" Value="#0" Component_="AI_CustomARPName"/>
|
||||
<ROW Registry="VersionMinor" Root="-1" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\[ProductName] [ProductVersion]" Name="VersionMinor" Value="#7" Component_="AI_CustomARPName"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.MsiServCtrlComponent">
|
||||
<ROW ServiceControl="zerotierone_x64.exe" Name="ZeroTierOneService" Event="161" Wait="1" Component_="zerotierone_x64.exe"/>
|
||||
@@ -262,10 +291,10 @@
|
||||
<ROW XmlAttribute="xsischemaLocation" XmlElement="swidsoftware_identification_tag" Name="xsi:schemaLocation" Flags="14" Order="3" Value="http://standards.iso.org/iso/19770/-2/2008/schema.xsd software_identification_tag.xsd"/>
|
||||
</COMPONENT>
|
||||
<COMPONENT cid="caphyon.advinst.msicomp.XmlElementComponent">
|
||||
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Order="2" Flags="14" Text="0"/>
|
||||
<ROW XmlElement="swidbuild" ParentElement="swidnumeric" Name="swid:build" Order="2" Flags="14" Text="2"/>
|
||||
<ROW XmlElement="swidentitlement_required_indicator" ParentElement="swidsoftware_identification_tag" Name="swid:entitlement_required_indicator" Order="0" Flags="14" Text="false"/>
|
||||
<ROW XmlElement="swidmajor" ParentElement="swidnumeric" Name="swid:major" Order="0" Flags="14" Text="0"/>
|
||||
<ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Order="1" Flags="14" Text="7"/>
|
||||
<ROW XmlElement="swidminor" ParentElement="swidnumeric" Name="swid:minor" Order="1" Flags="14" Text="8"/>
|
||||
<ROW XmlElement="swidname" ParentElement="swidproduct_version" Name="swid:name" Order="0" Flags="14" Text="[ProductVersion]"/>
|
||||
<ROW XmlElement="swidname_1" ParentElement="swidsoftware_creator" Name="swid:name" Order="0" Flags="14" Text="ZeroTier Networks LLC"/>
|
||||
<ROW XmlElement="swidname_2" ParentElement="swidsoftware_licensor" Name="swid:name" Order="0" Flags="14" Text="ZeroTier Networks LLC"/>
|
||||
|
||||
@@ -59,9 +59,9 @@
|
||||
#include "node/Defaults.hpp"
|
||||
#include "node/Utils.hpp"
|
||||
#include "node/Node.hpp"
|
||||
#include "node/Condition.hpp"
|
||||
#include "node/C25519.hpp"
|
||||
#include "node/Identity.hpp"
|
||||
#include "node/Thread.hpp"
|
||||
|
||||
using namespace ZeroTier;
|
||||
|
||||
@@ -93,13 +93,13 @@ static void printHelp(const char *cn,FILE *out)
|
||||
fprintf(out,"Available switches:"ZT_EOL_S);
|
||||
fprintf(out," -h - Display this help"ZT_EOL_S);
|
||||
fprintf(out," -v - Show version"ZT_EOL_S);
|
||||
fprintf(out," -p<port> - Bind to this port for network I/O"ZT_EOL_S);
|
||||
fprintf(out," -c<port> - Bind to this port for local control packets"ZT_EOL_S);
|
||||
fprintf(out," -p<port> - Port for UDP (default: 9993)"ZT_EOL_S);
|
||||
fprintf(out," -t<port> - Port for TCP (default: disabled)"ZT_EOL_S);
|
||||
#ifdef __UNIX_LIKE__
|
||||
fprintf(out," -d - Fork and run as daemon (Unix-ish OSes)"ZT_EOL_S);
|
||||
#endif
|
||||
fprintf(out," -q - Send a query to a running service (zerotier-cli)"ZT_EOL_S);
|
||||
fprintf(out," -i - Run idtool command (zerotier-idtool)"ZT_EOL_S);
|
||||
fprintf(out," -i - Generate and manage identities (zerotier-idtool)"ZT_EOL_S);
|
||||
#ifdef __WINDOWS__
|
||||
fprintf(out," -C - Run from command line instead of as service (Windows)"ZT_EOL_S);
|
||||
fprintf(out," -I - Install Windows service (Windows)"ZT_EOL_S);
|
||||
@@ -110,111 +110,68 @@ static void printHelp(const char *cn,FILE *out)
|
||||
|
||||
namespace ZeroTierCLI { // ---------------------------------------------------
|
||||
|
||||
static void printHelp(FILE *out,const char *exename)
|
||||
static void printHelp(FILE *out,const char *cn)
|
||||
{
|
||||
fprintf(out,"Usage: %s [-switches] <command>"ZT_EOL_S,exename);
|
||||
fprintf(out,ZT_EOL_S);
|
||||
fprintf(out,"Available switches:"ZT_EOL_S);
|
||||
fprintf(out," -c<port> - Communicate with daemon over this local port"ZT_EOL_S);
|
||||
fprintf(out," -t<token> - Specify token on command line"ZT_EOL_S);
|
||||
fprintf(out," -T<file> - Read token from file"ZT_EOL_S);
|
||||
fprintf(out,ZT_EOL_S);
|
||||
fprintf(out,"Use the 'help' command to get help from ZeroTier One itself."ZT_EOL_S);
|
||||
fprintf(out,"Usage: %s <command> (use 'help' for help)"ZT_EOL_S,cn);
|
||||
}
|
||||
|
||||
static volatile unsigned int numResults = 0;
|
||||
static Condition doneCondition;
|
||||
|
||||
static void resultHandler(void *arg,unsigned long id,const char *line)
|
||||
static void _CBresultHandler(void *arg,const char *line)
|
||||
{
|
||||
++numResults;
|
||||
if (strlen(line))
|
||||
fprintf(stdout,"%s"ZT_EOL_S,line);
|
||||
else doneCondition.signal();
|
||||
if (line) {
|
||||
if ((line[0] == '.')&&(line[1] == (char)0))
|
||||
*((bool *)arg) = true;
|
||||
else fprintf(stdout,"%s"ZT_EOL_S,line);
|
||||
}
|
||||
}
|
||||
|
||||
// Runs instead of rest of main() if process is called zerotier-cli or if
|
||||
// -q is specified as an option.
|
||||
#ifdef __WINDOWS__
|
||||
static int main(int argc,_TCHAR* argv[])
|
||||
#else
|
||||
static int main(int argc,char **argv)
|
||||
#endif
|
||||
{
|
||||
if (argc <= 1) {
|
||||
if (argc < 2) {
|
||||
printHelp(stdout,argv[0]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string authToken;
|
||||
std::string command;
|
||||
bool pastSwitches = false;
|
||||
unsigned int controlPort = 0;
|
||||
const char *hp = (const char *)0;
|
||||
std::string query;
|
||||
for(int i=1;i<argc;++i) {
|
||||
if ((argv[i][0] == '-')&&(!pastSwitches)) {
|
||||
if (strlen(argv[i]) <= 1) {
|
||||
printHelp(stdout,argv[0]);
|
||||
return -1;
|
||||
}
|
||||
if (argv[i][0] == '-') {
|
||||
switch(argv[i][1]) {
|
||||
case 'q': // does nothing, for invocation without binary path name aliasing
|
||||
if (argv[i][2]) {
|
||||
printHelp(argv[0],stderr);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
controlPort = Utils::strToUInt(argv[i] + 2);
|
||||
break;
|
||||
case 't':
|
||||
authToken.assign(argv[i] + 2);
|
||||
break;
|
||||
case 'T':
|
||||
if (!Utils::readFile(argv[i] + 2,authToken)) {
|
||||
fprintf(stdout,"FATAL ERROR: unable to read token from '%s'"ZT_EOL_S,argv[i] + 2);
|
||||
return -2;
|
||||
}
|
||||
case 'q': // ignore -q since it's used to invoke this
|
||||
break;
|
||||
case 'h':
|
||||
printHelp(stdout,argv[0]);
|
||||
return 0;
|
||||
default:
|
||||
return -1;
|
||||
printHelp(stdout,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
pastSwitches = true;
|
||||
if (command.length())
|
||||
command.push_back(' ');
|
||||
command.append(argv[i]);
|
||||
if (query.length())
|
||||
query.push_back(' ');
|
||||
query.append(argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!command.length()) {
|
||||
if (!query.length()) {
|
||||
printHelp(stdout,argv[0]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!authToken.length()) {
|
||||
if (!Utils::readFile(Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {
|
||||
if (!Utils::readFile(Node::LocalClient::authTokenDefaultSystemPath().c_str(),authToken)) {
|
||||
fprintf(stdout,"FATAL ERROR: no token specified on command line and could not read '%s' or '%s'"ZT_EOL_S,Node::LocalClient::authTokenDefaultSystemPath().c_str(),Node::LocalClient::authTokenDefaultUserPath().c_str());
|
||||
return -2;
|
||||
}
|
||||
try {
|
||||
volatile bool done = false;
|
||||
Node::NodeControlClient client(hp,&_CBresultHandler,(void *)&done);
|
||||
const char *err = client.error();
|
||||
if (err) {
|
||||
fprintf(stderr,"%s: fatal error: unable to connect (is ZeroTier One running?) (%s)"ZT_EOL_S,argv[0],err);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (!authToken.length()) {
|
||||
fprintf(stdout,"FATAL ERROR: could not find auth token"ZT_EOL_S);
|
||||
return -2;
|
||||
}
|
||||
|
||||
Node::LocalClient client(authToken.c_str(),controlPort,&resultHandler,(void *)0);
|
||||
client.send(command.c_str());
|
||||
|
||||
doneCondition.wait(1000);
|
||||
|
||||
if (!numResults) {
|
||||
fprintf(stdout,"ERROR: no results received. Is ZeroTier One running?"ZT_EOL_S);
|
||||
return -1;
|
||||
client.send(query.c_str());
|
||||
while (!done)
|
||||
Thread::sleep(100); // ghetto
|
||||
} catch ( ... ) {
|
||||
fprintf(stderr,"%s: fatal error: unable to connect (is ZeroTier One running?)"ZT_EOL_S,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -250,8 +207,6 @@ static Identity getIdFromArg(char *arg)
|
||||
return Identity();
|
||||
}
|
||||
|
||||
// Runs instead of rest of main() if process is called zerotier-idtool or if
|
||||
// -i is specified as an option.
|
||||
#ifdef __WINDOWS__
|
||||
static int main(int argc,_TCHAR* argv[])
|
||||
#else
|
||||
@@ -259,8 +214,8 @@ static int main(int argc,char **argv)
|
||||
#endif
|
||||
{
|
||||
if (argc < 2) {
|
||||
printHelp(stderr,argv[0]);
|
||||
return -1;
|
||||
printHelp(stdout,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1],"generate")) {
|
||||
@@ -270,85 +225,85 @@ static int main(int argc,char **argv)
|
||||
if (argc >= 3) {
|
||||
if (!Utils::writeFile(argv[2],idser)) {
|
||||
fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[2]);
|
||||
return -1;
|
||||
return 1;
|
||||
} else printf("%s written"ZT_EOL_S,argv[2]);
|
||||
if (argc >= 4) {
|
||||
idser = id.toString(false);
|
||||
if (!Utils::writeFile(argv[3],idser)) {
|
||||
fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[3]);
|
||||
return -1;
|
||||
return 1;
|
||||
} else printf("%s written"ZT_EOL_S,argv[3]);
|
||||
}
|
||||
} else printf("%s",idser.c_str());
|
||||
} else if (!strcmp(argv[1],"validate")) {
|
||||
if (argc < 3) {
|
||||
printHelp(stderr,argv[0]);
|
||||
return -1;
|
||||
printHelp(stdout,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Identity id = getIdFromArg(argv[2]);
|
||||
if (!id) {
|
||||
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!id.locallyValidate()) {
|
||||
fprintf(stderr,"%s FAILED validation."ZT_EOL_S,argv[2]);
|
||||
return -1;
|
||||
return 1;
|
||||
} else printf("%s is a valid identity"ZT_EOL_S,argv[2]);
|
||||
} else if (!strcmp(argv[1],"getpublic")) {
|
||||
if (argc < 3) {
|
||||
printHelp(stderr,argv[0]);
|
||||
return -1;
|
||||
printHelp(stdout,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Identity id = getIdFromArg(argv[2]);
|
||||
if (!id) {
|
||||
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s",id.toString(false).c_str());
|
||||
} else if (!strcmp(argv[1],"sign")) {
|
||||
if (argc < 4) {
|
||||
printHelp(stderr,argv[0]);
|
||||
return -1;
|
||||
printHelp(stdout,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Identity id = getIdFromArg(argv[2]);
|
||||
if (!id) {
|
||||
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!id.hasPrivate()) {
|
||||
fprintf(stderr,"%s does not contain a private key (must use private to sign)"ZT_EOL_S,argv[2]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string inf;
|
||||
if (!Utils::readFile(argv[3],inf)) {
|
||||
fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
C25519::Signature signature = id.sign(inf.data(),(unsigned int)inf.length());
|
||||
printf("%s",Utils::hex(signature.data,(unsigned int)signature.size()).c_str());
|
||||
} else if (!strcmp(argv[1],"verify")) {
|
||||
if (argc < 4) {
|
||||
printHelp(stderr,argv[0]);
|
||||
return -1;
|
||||
printHelp(stdout,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Identity id = getIdFromArg(argv[2]);
|
||||
if (!id) {
|
||||
fprintf(stderr,"Identity argument invalid or file unreadable: %s"ZT_EOL_S,argv[2]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string inf;
|
||||
if (!Utils::readFile(argv[3],inf)) {
|
||||
fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string signature(Utils::unhex(argv[4]));
|
||||
@@ -356,17 +311,16 @@ static int main(int argc,char **argv)
|
||||
printf("%s signature valid"ZT_EOL_S,argv[3]);
|
||||
} else {
|
||||
fprintf(stderr,"%s signature check FAILED"ZT_EOL_S,argv[3]);
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
printHelp(stderr,argv[0]);
|
||||
return -1;
|
||||
printHelp(stdout,argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
} // namespace ZeroTierIdTool ------------------------------------------------
|
||||
|
||||
#ifdef __UNIX_LIKE__
|
||||
@@ -508,6 +462,17 @@ int main(int argc,char **argv)
|
||||
signal(SIGINT,&sighandlerQuit);
|
||||
signal(SIGTERM,&sighandlerQuit);
|
||||
signal(SIGQUIT,&sighandlerQuit);
|
||||
|
||||
/* Ensure that there are no inherited file descriptors open from a previous
|
||||
* incarnation. This is a hack to ensure that GitHub issue #61 or variants
|
||||
* of it do not return, and should not do anything otherwise bad. */
|
||||
{
|
||||
int mfd = STDIN_FILENO;
|
||||
if (STDOUT_FILENO > mfd) mfd = STDOUT_FILENO;
|
||||
if (STDERR_FILENO > mfd) mfd = STDERR_FILENO;
|
||||
for(int f=mfd+1;f<1024;++f)
|
||||
::close(f);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
@@ -521,8 +486,8 @@ int main(int argc,char **argv)
|
||||
return ZeroTierIdTool::main(argc,argv);
|
||||
|
||||
const char *homeDir = (const char *)0;
|
||||
unsigned int port = 0;
|
||||
unsigned int controlPort = 0;
|
||||
unsigned int udpPort = ZT_DEFAULT_UDP_PORT;
|
||||
unsigned int tcpPort = 0;
|
||||
#ifdef __UNIX_LIKE__
|
||||
bool runAsDaemon = false;
|
||||
#endif
|
||||
@@ -533,9 +498,16 @@ int main(int argc,char **argv)
|
||||
if (argv[i][0] == '-') {
|
||||
switch(argv[i][1]) {
|
||||
case 'p':
|
||||
port = Utils::strToUInt(argv[i] + 2);
|
||||
if (port > 65535) {
|
||||
printHelp(argv[0],stderr);
|
||||
udpPort = Utils::strToUInt(argv[i] + 2);
|
||||
if (udpPort > 65535) {
|
||||
printHelp(argv[0],stdout);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 't':
|
||||
tcpPort = Utils::strToUInt(argv[i] + 2);
|
||||
if (tcpPort > 65535) {
|
||||
printHelp(argv[0],stdout);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
@@ -547,21 +519,14 @@ int main(int argc,char **argv)
|
||||
case 'v':
|
||||
printf("%s"ZT_EOL_S,Node::versionString());
|
||||
return 0;
|
||||
case 'c':
|
||||
controlPort = Utils::strToUInt(argv[i] + 2);
|
||||
if (controlPort > 65535) {
|
||||
printHelp(argv[0],stderr);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'q':
|
||||
if (argv[i][2]) {
|
||||
printHelp(argv[0],stderr);
|
||||
printHelp(argv[0],stdout);
|
||||
return 0;
|
||||
} else return ZeroTierCLI::main(argc,argv);
|
||||
case 'i':
|
||||
if (argv[i][2]) {
|
||||
printHelp(argv[0],stderr);
|
||||
printHelp(argv[0],stdout);
|
||||
return 0;
|
||||
} else return ZeroTierIdTool::main(argc,argv);
|
||||
#ifdef __WINDOWS__
|
||||
@@ -599,12 +564,13 @@ int main(int argc,char **argv)
|
||||
#else
|
||||
pathToInf = ZT_DEFAULTS.defaultHomePath + "\\tap-windows\\x86\\zttap200.inf";
|
||||
#endif
|
||||
printf("Installing ZeroTier One virtual Ethernet port driver."ZT_EOL_S""ZT_EOL_S"NOTE: If you don't see a confirmation window to allow driver installation,"ZT_EOL_S"check to make sure it didn't appear under the installer."ZT_EOL_S);
|
||||
BOOL needReboot = FALSE;
|
||||
if (DiInstallDriverA(NULL,pathToInf.c_str(),DIIRFLAG_FORCE_INF,&needReboot)) {
|
||||
fprintf(stderr,"%s: driver successfully installed from %s"ZT_EOL_S,argv[0],pathToInf.c_str());
|
||||
printf("%s: driver successfully installed from %s"ZT_EOL_S,argv[0],pathToInf.c_str());
|
||||
return 0;
|
||||
} else {
|
||||
fprintf(stderr,"%s: failed installing %s: %d"ZT_EOL_S,argv[0],pathToInf.c_str(),(int)GetLastError());
|
||||
printf("%s: failed installing %s: %d"ZT_EOL_S,argv[0],pathToInf.c_str(),(int)GetLastError());
|
||||
return 3;
|
||||
}
|
||||
} break;
|
||||
@@ -612,12 +578,12 @@ int main(int argc,char **argv)
|
||||
case 'h':
|
||||
case '?':
|
||||
default:
|
||||
printHelp(argv[0],stderr);
|
||||
printHelp(argv[0],stdout);
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (homeDir) {
|
||||
printHelp(argv[0],stderr);
|
||||
printHelp(argv[0],stdout);
|
||||
return 0;
|
||||
}
|
||||
homeDir = argv[i];
|
||||
@@ -679,8 +645,9 @@ int main(int argc,char **argv)
|
||||
#endif
|
||||
|
||||
int exitCode = 0;
|
||||
bool needsReset = false;
|
||||
try {
|
||||
node = new Node(homeDir,port,controlPort);
|
||||
node = new Node(homeDir,udpPort,tcpPort,needsReset);
|
||||
switch(node->run()) {
|
||||
#ifdef __WINDOWS__
|
||||
case Node::NODE_RESTART_FOR_UPGRADE: {
|
||||
|
||||
+10
-11
@@ -18,15 +18,18 @@ endif
|
||||
#DEFS+=-DZT_TRACE -DZT_LOG_STDOUT
|
||||
|
||||
# Uncomment for a release optimized build
|
||||
CFLAGS=-Wall -O3 -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
CFLAGS=-Wall -O3 -fPIE -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
LDFLAGS=-pie -Wl,-z,relro,-z,now
|
||||
STRIP=strip --strip-all
|
||||
|
||||
# Uncomment for a debug build
|
||||
#CFLAGS=-Wall -g -pthread $(INCLUDES) -DZT_TRACE $(DEFS)
|
||||
#CFLAGS=-Wall -g -pthread $(INCLUDES) -DZT_TRACE -DZT_LOG_STDOUT $(DEFS)
|
||||
#LDFLAGS=
|
||||
#STRIP=echo
|
||||
|
||||
# Uncomment for gprof profile build
|
||||
#CFLAGS=-Wall -g -pg -pthread $(INCLUDES) $(DEFS)
|
||||
#LDFLAGS=
|
||||
#STRIP=echo
|
||||
|
||||
CXXFLAGS=$(CFLAGS) -fno-rtti
|
||||
@@ -35,25 +38,21 @@ include objects.mk
|
||||
|
||||
all: one
|
||||
|
||||
one: $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o zerotier-one main.cpp $(OBJS) $(LIBS)
|
||||
one: $(OBJS) main.o
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-one main.o $(OBJS) $(LIBS)
|
||||
$(STRIP) zerotier-one
|
||||
ln -sf zerotier-one zerotier-cli
|
||||
ln -sf zerotier-one zerotier-idtool
|
||||
|
||||
selftest: $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o zerotier-selftest selftest.cpp $(OBJS) $(LIBS)
|
||||
selftest: $(OBJS) selftest.o
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o zerotier-selftest selftest.o $(OBJS) $(LIBS)
|
||||
$(STRIP) zerotier-selftest
|
||||
|
||||
idtool: $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o zerotier-idtool idtool.cpp $(OBJS) $(LIBS)
|
||||
$(STRIP) zerotier-idtool
|
||||
|
||||
installer: one FORCE
|
||||
./buildinstaller.sh
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJS) zerotier-* build-* ZeroTierOneInstaller-*
|
||||
rm -rf $(OBJS) *.o node/*.o zerotier-* build-* ZeroTierOneInstaller-*
|
||||
|
||||
official: FORCE
|
||||
make -j 4 ZT_OFFICIAL_RELEASE=1
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ endif
|
||||
#DEFS+=-DZT_TRACE -DZT_LOG_STDOUT
|
||||
|
||||
# Uncomment for a release optimized universal binary build
|
||||
CFLAGS=-arch i386 -arch x86_64 -Wall -O4 -fstack-protector -pthread -mmacosx-version-min=10.6 -DNDEBUG -Wno-unused-private-field $(INCLUDES) $(DEFS)
|
||||
CFLAGS=-arch i386 -arch x86_64 -Wall -O3 -flto -fPIE -fvectorize -fstack-protector -pthread -mmacosx-version-min=10.6 -DNDEBUG -Wno-unused-private-field $(INCLUDES) $(DEFS)
|
||||
STRIP=strip
|
||||
|
||||
# Uncomment for a debug build
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* ZeroTier One - Global Peer to Peer Ethernet
|
||||
* Copyright (C) 2011-2014 ZeroTier Networks LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#ifndef ZT_ANTIRECURSION_HPP
|
||||
#define ZT_ANTIRECURSION_HPP
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "Constants.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
#define ZT_ANTIRECURSION_TAIL_LEN 256
|
||||
|
||||
/**
|
||||
* Filter to prevent recursion (ZeroTier-over-ZeroTier)
|
||||
*
|
||||
* This works by logging ZeroTier packets that we send. It's then invoked
|
||||
* again against packets read from local Ethernet taps. If the last N
|
||||
* bytes representing the ZeroTier packet match in the tap frame, then
|
||||
* the frame is a re-injection of a frame that we sent and is rejected.
|
||||
*
|
||||
* This means that ZeroTier packets simply will not traverse ZeroTier
|
||||
* networks, which would cause all sorts of weird problems.
|
||||
*
|
||||
* NOTE: this is applied to low-level packets before they are sent to
|
||||
* SocketManager and/or sockets, not to fully assembled packets before
|
||||
* (possible) fragmentation.
|
||||
*/
|
||||
class AntiRecursion
|
||||
{
|
||||
public:
|
||||
AntiRecursion()
|
||||
throw()
|
||||
{
|
||||
memset(_history,0,sizeof(_history));
|
||||
_ptr = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an outgoing ZeroTier packet to the circular log
|
||||
*
|
||||
* @param data ZT packet data
|
||||
* @param len Length of packet
|
||||
*/
|
||||
inline void logOutgoingZT(const void *data,unsigned int len)
|
||||
throw()
|
||||
{
|
||||
ArItem *i = &(_history[_ptr++ % ZT_ANTIRECURSION_HISTORY_SIZE]);
|
||||
const unsigned int tl = (len > ZT_ANTIRECURSION_TAIL_LEN) ? ZT_ANTIRECURSION_TAIL_LEN : len;
|
||||
memcpy(i->tail,((const unsigned char *)data) + (len - tl),tl);
|
||||
i->len = tl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check an ethernet frame from a local tap against anti-recursion history
|
||||
*
|
||||
* @param data Raw frame data
|
||||
* @param len Length of frame
|
||||
* @return True if frame is OK to be passed, false if it's a ZT frame that we sent
|
||||
*/
|
||||
inline bool checkEthernetFrame(const void *data,unsigned int len)
|
||||
throw()
|
||||
{
|
||||
for(unsigned int h=0;h<ZT_ANTIRECURSION_HISTORY_SIZE;++h) {
|
||||
ArItem *i = &(_history[h]);
|
||||
if ((i->len > 0)&&(len >= i->len)&&(!memcmp(((const unsigned char *)data) + (len - i->len),i->tail,i->len)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
struct ArItem
|
||||
{
|
||||
unsigned char tail[ZT_ANTIRECURSION_TAIL_LEN];
|
||||
unsigned int len;
|
||||
};
|
||||
ArItem _history[ZT_ANTIRECURSION_HISTORY_SIZE];
|
||||
volatile unsigned int _ptr;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
throw()
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
return __sync_or_and_fetch(&_v,0);
|
||||
return __sync_or_and_fetch(const_cast <volatile int *>(&_v),0);
|
||||
#else
|
||||
#ifdef __WINDOWS__
|
||||
return (int)_v;
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Global Peer to Peer Ethernet
|
||||
* Copyright (C) 2011-2014 ZeroTier Networks LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#ifndef ZT_CONDITION_HPP
|
||||
#define ZT_CONDITION_HPP
|
||||
|
||||
#include "Constants.hpp"
|
||||
#include "NonCopyable.hpp"
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
|
||||
#include <Windows.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "Utils.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
class Condition : NonCopyable
|
||||
{
|
||||
public:
|
||||
Condition()
|
||||
throw()
|
||||
{
|
||||
_sem = CreateSemaphore(NULL,0,1,NULL);
|
||||
}
|
||||
|
||||
~Condition()
|
||||
{
|
||||
CloseHandle(_sem);
|
||||
}
|
||||
|
||||
inline void wait() const
|
||||
throw()
|
||||
{
|
||||
WaitForSingleObject(_sem,INFINITE);
|
||||
}
|
||||
|
||||
inline void wait(unsigned long ms) const
|
||||
throw()
|
||||
{
|
||||
WaitForSingleObject(_sem,(DWORD)ms);
|
||||
}
|
||||
|
||||
inline void signal() const
|
||||
throw()
|
||||
{
|
||||
ReleaseSemaphore(_sem,1,NULL);
|
||||
}
|
||||
|
||||
private:
|
||||
HANDLE _sem;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#else // !__WINDOWS__
|
||||
|
||||
#include <time.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include "Utils.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
class Condition : NonCopyable
|
||||
{
|
||||
public:
|
||||
Condition()
|
||||
throw()
|
||||
{
|
||||
pthread_mutex_init(&_mh,(const pthread_mutexattr_t *)0);
|
||||
pthread_cond_init(&_cond,(const pthread_condattr_t *)0);
|
||||
}
|
||||
|
||||
~Condition()
|
||||
{
|
||||
pthread_cond_destroy(&_cond);
|
||||
pthread_mutex_destroy(&_mh);
|
||||
}
|
||||
|
||||
inline void wait() const
|
||||
throw()
|
||||
{
|
||||
pthread_mutex_lock(const_cast <pthread_mutex_t *>(&_mh));
|
||||
pthread_cond_wait(const_cast <pthread_cond_t *>(&_cond),const_cast <pthread_mutex_t *>(&_mh));
|
||||
pthread_mutex_unlock(const_cast <pthread_mutex_t *>(&_mh));
|
||||
}
|
||||
|
||||
inline void wait(unsigned long ms) const
|
||||
throw()
|
||||
{
|
||||
uint64_t when = Utils::now() + (uint64_t)ms;
|
||||
struct timespec ts;
|
||||
ts.tv_sec = (unsigned long)(when / 1000);
|
||||
ts.tv_nsec = (unsigned long)(when % 1000) * 1000000;
|
||||
pthread_mutex_lock(const_cast <pthread_mutex_t *>(&_mh));
|
||||
pthread_cond_timedwait(const_cast <pthread_cond_t *>(&_cond),const_cast <pthread_mutex_t *>(&_mh),&ts);
|
||||
pthread_mutex_unlock(const_cast <pthread_mutex_t *>(&_mh));
|
||||
}
|
||||
|
||||
inline void signal() const
|
||||
throw()
|
||||
{
|
||||
pthread_cond_signal(const_cast <pthread_cond_t *>(&_cond));
|
||||
}
|
||||
|
||||
private:
|
||||
pthread_cond_t _cond;
|
||||
pthread_mutex_t _mh;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif // !__WINDOWS__
|
||||
|
||||
#endif
|
||||
+74
-40
@@ -114,15 +114,10 @@ error_no_byte_order_defined;
|
||||
#define ZT_ADDRESS_RESERVED_PREFIX 0xff
|
||||
|
||||
/**
|
||||
* Default local UDP port
|
||||
* Default local port for ZeroTier UDP traffic
|
||||
*/
|
||||
#define ZT_DEFAULT_UDP_PORT 9993
|
||||
|
||||
/**
|
||||
* Local control port, also used for multiple invocation check
|
||||
*/
|
||||
#define ZT_DEFAULT_CONTROL_UDP_PORT 39393
|
||||
|
||||
/**
|
||||
* Default payload MTU for UDP packets
|
||||
*
|
||||
@@ -163,7 +158,7 @@ error_no_byte_order_defined;
|
||||
* The actual spec allows 16, but this is the most we'll support right
|
||||
* now. Packets with more than this many fragments are dropped.
|
||||
*/
|
||||
#define ZT_MAX_PACKET_FRAGMENTS 3
|
||||
#define ZT_MAX_PACKET_FRAGMENTS 4
|
||||
|
||||
/**
|
||||
* Timeout for receipt of fragmented packets in ms
|
||||
@@ -184,7 +179,7 @@ error_no_byte_order_defined;
|
||||
#define ZT_MAC_FIRST_OCTET 0x32
|
||||
|
||||
/**
|
||||
* Length of secret key in bytes
|
||||
* Length of secret key in bytes -- 256-bit for Salsa20
|
||||
*/
|
||||
#define ZT_PEER_SECRET_KEY_LENGTH 32
|
||||
|
||||
@@ -194,17 +189,17 @@ error_no_byte_order_defined;
|
||||
#define ZT_DB_CLEAN_PERIOD 300000
|
||||
|
||||
/**
|
||||
* How long to remember peers in RAM if they haven't been used
|
||||
* How long to remember peer records in RAM if they haven't been used
|
||||
*/
|
||||
#define ZT_PEER_IN_MEMORY_EXPIRATION 600000
|
||||
|
||||
/**
|
||||
* Delay between WHOIS retries in ms
|
||||
*/
|
||||
#define ZT_WHOIS_RETRY_DELAY 350
|
||||
#define ZT_WHOIS_RETRY_DELAY 500
|
||||
|
||||
/**
|
||||
* Maximum identity WHOIS retries
|
||||
* Maximum identity WHOIS retries (each attempt tries consulting a different peer)
|
||||
*/
|
||||
#define ZT_MAX_WHOIS_RETRIES 3
|
||||
|
||||
@@ -219,7 +214,7 @@ error_no_byte_order_defined;
|
||||
#define ZT_RECEIVE_QUEUE_TIMEOUT (ZT_WHOIS_RETRY_DELAY * (ZT_MAX_WHOIS_RETRIES + 1))
|
||||
|
||||
/**
|
||||
* Maximum number of ZT hops allowed
|
||||
* Maximum number of ZT hops allowed (this is not IP hops/TTL)
|
||||
*
|
||||
* The protocol allows up to 7, but we limit it to something smaller.
|
||||
*/
|
||||
@@ -253,14 +248,14 @@ error_no_byte_order_defined;
|
||||
#define ZT_MULTICAST_LIKE_EXPIRE 120000
|
||||
|
||||
/**
|
||||
* Time between polls of local taps for multicast membership changes
|
||||
* Time between polls of local tap devices for multicast membership changes
|
||||
*/
|
||||
#define ZT_MULTICAST_LOCAL_POLL_PERIOD 10000
|
||||
|
||||
/**
|
||||
* Delay between scans of the topology active peer DB for peers that need ping
|
||||
*/
|
||||
#define ZT_PING_CHECK_DELAY 7000
|
||||
#define ZT_PING_CHECK_DELAY 10000
|
||||
|
||||
/**
|
||||
* Delay between checks of network configuration fingerprint
|
||||
@@ -268,7 +263,7 @@ error_no_byte_order_defined;
|
||||
#define ZT_NETWORK_FINGERPRINT_CHECK_DELAY 5000
|
||||
|
||||
/**
|
||||
* Delay between pings (actually HELLOs) to direct links
|
||||
* Delay between ordinary case pings of direct links
|
||||
*/
|
||||
#define ZT_PEER_DIRECT_PING_DELAY 120000
|
||||
|
||||
@@ -278,7 +273,18 @@ error_no_byte_order_defined;
|
||||
* This should be lower than the UDP conversation entry timeout in most
|
||||
* stateful firewalls.
|
||||
*/
|
||||
#define ZT_FIREWALL_OPENER_DELAY 50000
|
||||
#define ZT_FIREWALL_OPENER_DELAY 30000
|
||||
|
||||
/**
|
||||
* Number of hops to open via firewall opener packets
|
||||
*
|
||||
* The firewall opener code iterates from 1 to this value (inclusive), sending
|
||||
* a tiny packet with each TTL value.
|
||||
*
|
||||
* 2 should permit traversal of double-NAT configurations, such as from inside
|
||||
* a VM running behind local NAT on a host that is itself behind NAT.
|
||||
*/
|
||||
#define ZT_FIREWALL_OPENER_HOPS 2
|
||||
|
||||
/**
|
||||
* Delay between requests for updated network autoconf information
|
||||
@@ -288,40 +294,49 @@ error_no_byte_order_defined;
|
||||
/**
|
||||
* Delay in core loop between checks of network autoconf newness
|
||||
*/
|
||||
#define ZT_NETWORK_AUTOCONF_CHECK_DELAY 7000
|
||||
#define ZT_NETWORK_AUTOCONF_CHECK_DELAY 10000
|
||||
|
||||
/**
|
||||
* Minimum delay in Node service loop
|
||||
*
|
||||
* This is the shortest of the check delays/periods.
|
||||
* Time since a ping was sent to be considered unanswered
|
||||
*/
|
||||
#define ZT_MIN_SERVICE_LOOP_INTERVAL ZT_NETWORK_FINGERPRINT_CHECK_DELAY
|
||||
#define ZT_PING_UNANSWERED_AFTER 1500
|
||||
|
||||
/**
|
||||
* Activity timeout for links
|
||||
*
|
||||
* A link that hasn't spoken in this long is simply considered inactive.
|
||||
* Try to ping supernodes this often until we get something from them
|
||||
*/
|
||||
#define ZT_PEER_LINK_ACTIVITY_TIMEOUT ((ZT_PEER_DIRECT_PING_DELAY * 2) + 1000)
|
||||
#define ZT_STARTUP_AGGRO (ZT_PING_UNANSWERED_AFTER * 2)
|
||||
|
||||
/**
|
||||
* Stop relaying via peers that have not responded to direct sends in this long
|
||||
* Maximum delay between runs of the main loop in Node.cpp
|
||||
*/
|
||||
#define ZT_MAX_SERVICE_LOOP_INTERVAL ZT_STARTUP_AGGRO
|
||||
|
||||
/**
|
||||
* Try TCP tunnels if nothing received for this long
|
||||
*/
|
||||
#define ZT_TCP_TUNNEL_FAILOVER_TIMEOUT (ZT_STARTUP_AGGRO * 5)
|
||||
|
||||
/**
|
||||
* Path activity timeout (for non-fixed paths)
|
||||
*/
|
||||
#define ZT_PEER_PATH_ACTIVITY_TIMEOUT ((ZT_PEER_DIRECT_PING_DELAY * 2) + ZT_PING_CHECK_DELAY)
|
||||
|
||||
/**
|
||||
* Close TCP sockets if unused for this long (SocketManager)
|
||||
*/
|
||||
#define ZT_TCP_TUNNEL_ACTIVITY_TIMEOUT ZT_PEER_PATH_ACTIVITY_TIMEOUT
|
||||
|
||||
/**
|
||||
* Stop relaying via peers that have not responded to direct sends
|
||||
*
|
||||
* When we send something (including frames), we generally expect a response.
|
||||
* Switching relays if no response in a short period of time causes more
|
||||
* rapid failover if a supernode goes down or becomes unreachable. In the
|
||||
* mistaken case, little harm is done as it'll pick the next-fastest
|
||||
* supernode and will switch back eventually.
|
||||
*/
|
||||
#define ZT_PEER_RELAY_CONVERSATION_LATENCY_THRESHOLD 10000
|
||||
|
||||
/**
|
||||
* Number of outgoing verb/packetId pairs to keep for sends expecting responses
|
||||
*/
|
||||
#define ZT_PEER_REQUEST_HISTORY_LENGTH 8
|
||||
|
||||
/**
|
||||
* IP hops (a.k.a. TTL) to set for firewall opener packets
|
||||
*
|
||||
* 2 should permit traversal of double-NAT configurations, such as from inside
|
||||
* a VM running behind local NAT on a host that is itself behind NAT.
|
||||
*/
|
||||
#define ZT_FIREWALL_OPENER_HOPS 2
|
||||
|
||||
/**
|
||||
* Delay sleep overshoot for detection of a probable sleep/wake event
|
||||
*/
|
||||
@@ -334,6 +349,10 @@ error_no_byte_order_defined;
|
||||
|
||||
/**
|
||||
* Minimum interval between attempts by relays to unite peers
|
||||
*
|
||||
* When a relay gets a packet destined for another peer, it sends both peers
|
||||
* a RENDEZVOUS message no more than this often. This instructs the peers
|
||||
* to attempt NAT-t and gives each the other's corresponding IP:port pair.
|
||||
*/
|
||||
#define ZT_MIN_UNITE_INTERVAL 30000
|
||||
|
||||
@@ -342,6 +361,21 @@ error_no_byte_order_defined;
|
||||
*/
|
||||
#define ZT_RENDEZVOUS_NAT_T_DELAY 500
|
||||
|
||||
/**
|
||||
* Size of anti-recursion history (see AntiRecursion.hpp)
|
||||
*/
|
||||
#define ZT_ANTIRECURSION_HISTORY_SIZE 16
|
||||
|
||||
/**
|
||||
* How often to broadcast beacons over physical local LANs
|
||||
*/
|
||||
#define ZT_BEACON_INTERVAL ZT_PEER_DIRECT_PING_DELAY
|
||||
|
||||
/**
|
||||
* Do not respond to any beacon more often than this
|
||||
*/
|
||||
#define ZT_MIN_BEACON_RESPONSE_INTERVAL (ZT_BEACON_INTERVAL / 64)
|
||||
|
||||
/**
|
||||
* Minimum interval between attempts to do a software update
|
||||
*/
|
||||
@@ -353,7 +387,7 @@ error_no_byte_order_defined;
|
||||
#define ZT_UPDATE_MAX_INTERVAL 7200000
|
||||
|
||||
/**
|
||||
* Update HTTP timeout in seconds
|
||||
* Software update HTTP timeout in seconds
|
||||
*/
|
||||
#define ZT_UPDATE_HTTP_TIMEOUT 30
|
||||
|
||||
|
||||
+15
-9
@@ -43,11 +43,11 @@ namespace ZeroTier {
|
||||
|
||||
const Defaults ZT_DEFAULTS;
|
||||
|
||||
static inline std::map< Identity,std::vector<InetAddress> > _mkSupernodeMap()
|
||||
static inline std::map< Identity,std::vector< std::pair<InetAddress,bool> > > _mkSupernodeMap()
|
||||
{
|
||||
std::map< Identity,std::vector<InetAddress> > sn;
|
||||
std::map< Identity,std::vector< std::pair<InetAddress,bool> > > sn;
|
||||
Identity id;
|
||||
std::vector<InetAddress> addrs;
|
||||
std::vector< std::pair<InetAddress,bool> > addrs;
|
||||
|
||||
// Nothing special about a supernode... except that they are
|
||||
// designated as such and trusted to provide WHOIS lookup.
|
||||
@@ -56,35 +56,40 @@ static inline std::map< Identity,std::vector<InetAddress> > _mkSupernodeMap()
|
||||
addrs.clear();
|
||||
if (!id.fromString("8acf059fe3:0:482f6ee5dfe902319b419de5bdc765209c0ecda38c4d6e4fcf0d33658398b4527dcd22f93112fb9befd02fd78bf7261b333fc105d192a623ca9e50fc60b374a5"))
|
||||
throw std::runtime_error("invalid identity in Defaults");
|
||||
addrs.push_back(InetAddress("162.243.77.111",ZT_DEFAULT_UDP_PORT));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("162.243.77.111",ZT_DEFAULT_UDP_PORT),false));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("162.243.77.111",443),true));
|
||||
sn[id] = addrs;
|
||||
|
||||
// nyarlathotep.zerotier.com - San Francisco, California, USA
|
||||
addrs.clear();
|
||||
if (!id.fromString("7e19876aba:0:2a6e2b2318930f60eb097f70d0f4b028b2cd6d3d0c63c014b9039ff35390e41181f216fb2e6fa8d95c1ee9667156411905c3dccfea78d8c6dfafba688170b3fa"))
|
||||
throw std::runtime_error("invalid identity in Defaults");
|
||||
addrs.push_back(InetAddress("198.199.97.220",ZT_DEFAULT_UDP_PORT));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("198.199.97.220",ZT_DEFAULT_UDP_PORT),false));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("198.199.97.220",443),true));
|
||||
sn[id] = addrs;
|
||||
|
||||
// shub-niggurath.zerotier.com - Amsterdam, Netherlands
|
||||
addrs.clear();
|
||||
if (!id.fromString("36f63d6574:0:67a776487a1a99b32f413329f2b67c43fbf6152e42c6b66e89043e69d93e48314c7d709b58a83016bd2612dd89400b856e18c553da94892f7d3ca16bf2c92c24"))
|
||||
throw std::runtime_error("invalid identity in Defaults");
|
||||
addrs.push_back(InetAddress("198.211.127.172",ZT_DEFAULT_UDP_PORT));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("198.211.127.172",ZT_DEFAULT_UDP_PORT),false));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("198.211.127.172",443),true));
|
||||
sn[id] = addrs;
|
||||
|
||||
// mi-go.zerotier.com - Singapore
|
||||
addrs.clear();
|
||||
if (!id.fromString("abbb7f4622:0:89d2c6b2062b10f4ce314dfcb914c082566247090a6f74c8ba1c15c63b205f540758f0abae85287397152c9d8cf463cfe51e7a480946cd6a31495b24ca13253c"))
|
||||
throw std::runtime_error("invalid identity in Defaults");
|
||||
addrs.push_back(InetAddress("128.199.254.204",ZT_DEFAULT_UDP_PORT));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("128.199.254.204",ZT_DEFAULT_UDP_PORT),false));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("128.199.254.204",443),true));
|
||||
sn[id] = addrs;
|
||||
|
||||
// shoggoth.zerotier.com - Tokyo, Japan
|
||||
addrs.clear();
|
||||
if (!id.fromString("48e8f875cb:0:5ca54f55e1094f65589f3e6d74158b6964d418ddac3570757128f1c6a2498322d92fcdcd47de459f4d1f9b38df2afd0c7b3fc247ba3d773c38ba35288f24988e"))
|
||||
throw std::runtime_error("invalid identity in Defaults");
|
||||
addrs.push_back(InetAddress("108.61.200.101",ZT_DEFAULT_UDP_PORT));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("108.61.200.101",ZT_DEFAULT_UDP_PORT),false));
|
||||
addrs.push_back(std::pair<InetAddress,bool>(InetAddress("108.61.200.101",443),true));
|
||||
sn[id] = addrs;
|
||||
|
||||
return sn;
|
||||
@@ -169,7 +174,8 @@ Defaults::Defaults() :
|
||||
defaultHomePath(_mkDefaultHomePath()),
|
||||
supernodes(_mkSupernodeMap()),
|
||||
updateAuthorities(_mkUpdateAuth()),
|
||||
updateLatestNfoURL(_mkUpdateUrl())
|
||||
updateLatestNfoURL(_mkUpdateUrl()),
|
||||
v4Broadcast(((uint32_t)0xffffffff),ZT_DEFAULT_UDP_PORT)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+7
-2
@@ -64,9 +64,9 @@ public:
|
||||
const std::string defaultHomePath;
|
||||
|
||||
/**
|
||||
* Supernodes on the ZeroTier network
|
||||
* Supernodes on the ZeroTier network (identity, address/tcp?)
|
||||
*/
|
||||
const std::map< Identity,std::vector<InetAddress> > supernodes;
|
||||
const std::map< Identity,std::vector< std::pair<InetAddress,bool> > > supernodes;
|
||||
|
||||
/**
|
||||
* Identities permitted to sign software updates
|
||||
@@ -83,6 +83,11 @@ public:
|
||||
* URL to latest .nfo for software updates
|
||||
*/
|
||||
const std::string updateLatestNfoURL;
|
||||
|
||||
/**
|
||||
* Address for IPv4 LAN auto-location broadcasts: 255.255.255.255:9993
|
||||
*/
|
||||
const InetAddress v4Broadcast;
|
||||
};
|
||||
|
||||
extern const Defaults ZT_DEFAULTS;
|
||||
|
||||
-216
@@ -1,216 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Global Peer to Peer Ethernet
|
||||
* Copyright (C) 2011-2014 ZeroTier Networks LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "Constants.hpp"
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#include <WinSock2.h>
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
#include "Demarc.hpp"
|
||||
#include "RuntimeEnvironment.hpp"
|
||||
#include "Logger.hpp"
|
||||
#include "UdpSocket.hpp"
|
||||
#include "InetAddress.hpp"
|
||||
#include "Switch.hpp"
|
||||
#include "Buffer.hpp"
|
||||
#include "CMWC4096.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
const Demarc::Port Demarc::ANY_PORT = (Port)0xffffffffffffffffULL;
|
||||
const Demarc::Port Demarc::NULL_PORT = (Port)0;
|
||||
|
||||
Demarc::Demarc(const RuntimeEnvironment *renv) :
|
||||
_r(renv)
|
||||
{
|
||||
}
|
||||
|
||||
Demarc::~Demarc()
|
||||
{
|
||||
for(std::map< Port,DemarcPortObj >::iterator pe(_ports.begin());pe!=_ports.end();++pe) {
|
||||
switch (pe->second.type) {
|
||||
case PORT_TYPE_UDP_SOCKET_V4:
|
||||
case PORT_TYPE_UDP_SOCKET_V6:
|
||||
delete ((UdpSocket *)pe->second.obj);
|
||||
break;
|
||||
case PORT_TYPE_LOCAL_ETHERNET:
|
||||
case PORT_TYPE_RELAY_TUNNEL:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string Demarc::describe(Demarc::Port p)
|
||||
{
|
||||
char buf[64];
|
||||
switch ((DemarcPortType)(((uint64_t)p) >> 60)) {
|
||||
case PORT_TYPE_UDP_SOCKET_V4:
|
||||
Utils::snprintf(buf,sizeof(buf),"udp/4/%d",(int)((uint64_t)p & 0xffff));
|
||||
return std::string(buf);
|
||||
case PORT_TYPE_UDP_SOCKET_V6:
|
||||
Utils::snprintf(buf,sizeof(buf),"udp/6/%d",(int)((uint64_t)p & 0xffff));
|
||||
return std::string(buf);
|
||||
case PORT_TYPE_LOCAL_ETHERNET:
|
||||
return std::string("ethernet");
|
||||
case PORT_TYPE_RELAY_TUNNEL:
|
||||
return std::string("relay");
|
||||
}
|
||||
return std::string("(null)");
|
||||
}
|
||||
|
||||
bool Demarc::has(Port p) const
|
||||
throw()
|
||||
{
|
||||
Mutex::Lock _l(_ports_m);
|
||||
return (_ports.count(p) != 0);
|
||||
}
|
||||
|
||||
bool Demarc::bindLocalUdp(unsigned int localPort)
|
||||
{
|
||||
Mutex::Lock _l(_ports_m);
|
||||
|
||||
uint64_t v4p = ((uint64_t)PORT_TYPE_UDP_SOCKET_V4 << 60) | (uint64_t)localPort;
|
||||
uint64_t v6p = ((uint64_t)PORT_TYPE_UDP_SOCKET_V6 << 60) | (uint64_t)localPort;
|
||||
if ((_ports.count((Port)v4p))||(_ports.count((Port)v6p)))
|
||||
return true; // port already bound
|
||||
|
||||
UdpSocket *v4 = (UdpSocket *)0;
|
||||
try {
|
||||
DemarcPortObj *v4r = &(_ports[(Port)v4p]);
|
||||
v4r->port = (Port)v4p;
|
||||
v4r->parent = this;
|
||||
v4r->obj = v4 = new UdpSocket(false,localPort,false,&Demarc::_CBudpSocketPacketHandler,v4r);
|
||||
v4r->type = PORT_TYPE_UDP_SOCKET_V4;
|
||||
} catch ( ... ) {
|
||||
_ports.erase((Port)v4p);
|
||||
v4 = (UdpSocket *)0;
|
||||
}
|
||||
|
||||
UdpSocket *v6 = (UdpSocket *)0;
|
||||
try {
|
||||
DemarcPortObj *v6r = &(_ports[(Port)v6p]);
|
||||
v6r->port = (Port)v6p;
|
||||
v6r->parent = this;
|
||||
v6r->obj = v6 = new UdpSocket(false,localPort,true,&Demarc::_CBudpSocketPacketHandler,v6r);
|
||||
v6r->type = PORT_TYPE_UDP_SOCKET_V6;
|
||||
} catch ( ... ) {
|
||||
_ports.erase((Port)v6p);
|
||||
v6 = (UdpSocket *)0;
|
||||
}
|
||||
|
||||
return ((v4)||(v6));
|
||||
}
|
||||
|
||||
Demarc::Port Demarc::pick(const InetAddress &to) const
|
||||
throw()
|
||||
{
|
||||
Mutex::Lock _l(_ports_m);
|
||||
try {
|
||||
std::vector< std::map< Port,DemarcPortObj >::const_iterator > possibilities;
|
||||
for(std::map< Port,DemarcPortObj >::const_iterator pe(_ports.begin());pe!=_ports.end();++pe) {
|
||||
switch (pe->second.type) {
|
||||
case PORT_TYPE_UDP_SOCKET_V4:
|
||||
if (to.isV4())
|
||||
possibilities.push_back(pe);
|
||||
break;
|
||||
case PORT_TYPE_UDP_SOCKET_V6:
|
||||
if (to.isV6())
|
||||
possibilities.push_back(pe);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (possibilities.size())
|
||||
return possibilities[_r->prng->next32() % possibilities.size()]->first;
|
||||
else return NULL_PORT;
|
||||
} catch ( ... ) {
|
||||
return NULL_PORT;
|
||||
}
|
||||
}
|
||||
|
||||
Demarc::Port Demarc::send(Demarc::Port fromPort,const InetAddress &to,const void *data,unsigned int len,int hopLimit) const
|
||||
throw()
|
||||
{
|
||||
_ports_m.lock();
|
||||
|
||||
std::map< Port,DemarcPortObj >::const_iterator pe(_ports.find(fromPort));
|
||||
if (pe == _ports.end()) {
|
||||
try {
|
||||
std::vector< std::map< Port,DemarcPortObj >::const_iterator > possibilities;
|
||||
for(pe=_ports.begin();pe!=_ports.end();++pe) {
|
||||
switch (pe->second.type) {
|
||||
case PORT_TYPE_UDP_SOCKET_V4:
|
||||
if (to.isV4())
|
||||
possibilities.push_back(pe);
|
||||
break;
|
||||
case PORT_TYPE_UDP_SOCKET_V6:
|
||||
if (to.isV6())
|
||||
possibilities.push_back(pe);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (possibilities.size())
|
||||
pe = possibilities[_r->prng->next32() % possibilities.size()];
|
||||
else {
|
||||
_ports_m.unlock();
|
||||
return NULL_PORT;
|
||||
}
|
||||
} catch ( ... ) {
|
||||
_ports_m.unlock();
|
||||
return NULL_PORT;
|
||||
}
|
||||
}
|
||||
|
||||
switch (pe->second.type) {
|
||||
case PORT_TYPE_UDP_SOCKET_V4:
|
||||
case PORT_TYPE_UDP_SOCKET_V6:
|
||||
_ports_m.unlock();
|
||||
if (((UdpSocket *)pe->second.obj)->send(to,data,len,hopLimit))
|
||||
return pe->first;
|
||||
return NULL_PORT;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_ports_m.unlock();
|
||||
return NULL_PORT;
|
||||
}
|
||||
|
||||
void Demarc::_CBudpSocketPacketHandler(UdpSocket *sock,void *arg,const InetAddress &from,const void *data,unsigned int len)
|
||||
{
|
||||
if (!((DemarcPortObj *)arg)->parent->_r->shutdownInProgress)
|
||||
((DemarcPortObj *)arg)->parent->_r->sw->onRemotePacket(((DemarcPortObj *)arg)->port,from,Buffer<4096>(data,len));
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
||||
-174
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
* ZeroTier One - Global Peer to Peer Ethernet
|
||||
* Copyright (C) 2011-2014 ZeroTier Networks LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* --
|
||||
*
|
||||
* ZeroTier may be used and distributed under the terms of the GPLv3, which
|
||||
* are available at: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* If you would like to embed ZeroTier into a commercial application or
|
||||
* redistribute it in a modified binary form, please contact ZeroTier Networks
|
||||
* LLC. Start here: http://www.zerotier.com/
|
||||
*/
|
||||
|
||||
#ifndef ZT_DEMARC_HPP
|
||||
#define ZT_DEMARC_HPP
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "Mutex.hpp"
|
||||
#include "InetAddress.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
class RuntimeEnvironment;
|
||||
class UdpSocket;
|
||||
|
||||
/**
|
||||
* Local demarcation point
|
||||
*
|
||||
* This holds and provides unique identifiers for all local communication
|
||||
* endpoints, such as UDP sockets, raw Ethernet sockets, tunnels to a relay
|
||||
* server, etc. It permits other code to refer to these via Port and forget
|
||||
* about what they actually are.
|
||||
*
|
||||
* All ports are closed when this class is destroyed.
|
||||
*
|
||||
* Its name "demarcation point" comes from the telco/cable terminology for
|
||||
* the box where wires terminate at a customer's property.
|
||||
*/
|
||||
class Demarc
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Local demarcation port
|
||||
*
|
||||
* NULL_PORT is zero so this can be used in if(port) to check for
|
||||
* a valid/known port.
|
||||
*/
|
||||
typedef uint64_t Port;
|
||||
|
||||
/**
|
||||
* Port identifier used to refer to any port
|
||||
*/
|
||||
static const Port ANY_PORT;
|
||||
|
||||
/**
|
||||
* Port identifier used to refer to null port / port not found
|
||||
*/
|
||||
static const Port NULL_PORT;
|
||||
|
||||
Demarc(const RuntimeEnvironment *renv);
|
||||
~Demarc();
|
||||
|
||||
/**
|
||||
* Describe a port
|
||||
*
|
||||
* This can describe even ports that are not bound, e.g. from serialized
|
||||
* data.
|
||||
*
|
||||
* @param p Port
|
||||
* @return Human-readable description of port
|
||||
*/
|
||||
static std::string describe(Port p);
|
||||
|
||||
/**
|
||||
* @param p Port to check
|
||||
* @return True if this port is bound/connected/etc.
|
||||
*/
|
||||
bool has(Port p) const
|
||||
throw();
|
||||
|
||||
/**
|
||||
* Bind local UDP port for both IPv4 and IPv6 traffic
|
||||
*
|
||||
* @param localPort Local IP port
|
||||
* @return True if successfully bound, or if already bound
|
||||
*/
|
||||
bool bindLocalUdp(unsigned int localPort);
|
||||
|
||||
/**
|
||||
* Pick a port to send to an address of a given type
|
||||
*
|
||||
* @param to Destination address
|
||||
* @return Port or NULL_PORT if none
|
||||
*/
|
||||
Port pick(const InetAddress &to) const
|
||||
throw();
|
||||
|
||||
/**
|
||||
* Send a packet
|
||||
*
|
||||
* If fromPort is ANY_PORT or if the port is not found, a random port is
|
||||
* chosen from those available matching the characteristics of the address
|
||||
* in 'to'.
|
||||
*
|
||||
* @param fromPort Port to send from
|
||||
* @param to Destination IP/port
|
||||
* @param data Data to send
|
||||
* @param len Length of data in bytes
|
||||
* @param hopLimit IP hop limit for UDP packets or -1 for max/unlimited
|
||||
* @return Port actually sent from or NULL_PORT on failure
|
||||
*/
|
||||
Port send(Port fromPort,const InetAddress &to,const void *data,unsigned int len,int hopLimit) const
|
||||
throw();
|
||||
|
||||
/**
|
||||
* @param p Port
|
||||
* @return 64-bit integer suitable for serialization
|
||||
*/
|
||||
static inline uint64_t portToInt(const Port p) throw() { return (uint64_t)p; }
|
||||
|
||||
/**
|
||||
* @param p 64-bit integer from serialized representation
|
||||
* @return Port suitable for use in code
|
||||
*/
|
||||
static inline Port intToPort(const uint64_t p) throw() { return (Port)p; }
|
||||
|
||||
private:
|
||||
const RuntimeEnvironment *_r;
|
||||
|
||||
static void _CBudpSocketPacketHandler(UdpSocket *sock,void *arg,const InetAddress &from,const void *data,unsigned int len);
|
||||
|
||||
enum DemarcPortType
|
||||
{
|
||||
PORT_TYPE_UDP_SOCKET_V4 = 1,
|
||||
PORT_TYPE_UDP_SOCKET_V6 = 2,
|
||||
PORT_TYPE_LOCAL_ETHERNET = 3,
|
||||
PORT_TYPE_RELAY_TUNNEL = 4
|
||||
};
|
||||
|
||||
// Variant holding instances of UdpSocket, etc.
|
||||
struct DemarcPortObj
|
||||
{
|
||||
Demarc::Port port;
|
||||
Demarc *parent;
|
||||
void *obj;
|
||||
DemarcPortType type;
|
||||
};
|
||||
|
||||
std::map< Port,DemarcPortObj > _ports;
|
||||
Mutex _ports_m;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
Loaded 20 of 65 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user