From 33c8d3c50b1645cad8f36c4f9116fa6fb00ff329 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 15 Apr 2015 18:36:32 -0700 Subject: [PATCH] Compile fixes. --- objects.mk | 1 - one.cpp | 20 +++++++++----------- service/OneService.cpp | 6 +++--- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/objects.mk b/objects.mk index 05d6fd7c2..269d8e155 100644 --- a/objects.mk +++ b/objects.mk @@ -22,7 +22,6 @@ OBJS=\ node/Switch.o \ node/Topology.o \ node/Utils.o \ - osdep/HttpClient.o \ osdep/OSUtils.o \ service/ControlPlane.o \ service/OneService.o diff --git a/one.cpp b/one.cpp index 73c4f3294..c8e009d10 100644 --- a/one.cpp +++ b/one.cpp @@ -61,6 +61,7 @@ #include "node/Identity.hpp" #include "node/CertificateOfMembership.hpp" #include "node/Utils.hpp" +#include "node/NetworkController.hpp" #include "osdep/OSUtils.hpp" #include "service/OneService.hpp" #ifdef ZT_ENABLE_NETWORK_CONTROLLER @@ -110,7 +111,7 @@ static Identity getIdFromArg(char *arg) return id; } else { // identity is to be read from a file std::string idser; - if (Utils::readFile(arg,idser)) { + if (OSUtils::readFile(arg,idser)) { if (id.fromString(idser)) return id; } @@ -134,13 +135,13 @@ int idtool(int argc,char **argv) id.generate(); std::string idser = id.toString(true); if (argc >= 3) { - if (!Utils::writeFile(argv[2],idser)) { + if (!OSUtils::writeFile(argv[2],idser)) { fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[2]); return 1; } else printf("%s written"ZT_EOL_S,argv[2]); if (argc >= 4) { idser = id.toString(false); - if (!Utils::writeFile(argv[3],idser)) { + if (!OSUtils::writeFile(argv[3],idser)) { fprintf(stderr,"Error writing to %s"ZT_EOL_S,argv[3]); return 1; } else printf("%s written"ZT_EOL_S,argv[3]); @@ -193,7 +194,7 @@ int idtool(int argc,char **argv) } std::string inf; - if (!Utils::readFile(argv[3],inf)) { + if (!OSUtils::readFile(argv[3],inf)) { fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]); return 1; } @@ -212,7 +213,7 @@ int idtool(int argc,char **argv) } std::string inf; - if (!Utils::readFile(argv[3],inf)) { + if (!OSUtils::readFile(argv[3],inf)) { fprintf(stderr,"%s is not readable"ZT_EOL_S,argv[3]); return 1; } @@ -267,15 +268,12 @@ int idtool(int argc,char **argv) #ifdef __UNIX_LIKE__ static void _sighandlerHup(int sig) { - Node *n = node; - if (n) - n->resync(); } static void _sighandlerQuit(int sig) { - Node *n = node; - if (n) - n->terminate(Node::NODE_NORMAL_TERMINATION,"terminated by signal"); + OneService *s = zt1Service; + if (s) + s->terminate(); else exit(0); } #endif diff --git a/service/OneService.cpp b/service/OneService.cpp index 38f6e1166..f84af0ae3 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -129,7 +129,7 @@ struct HttpConnection class OneServiceImpl : public OneService { public: - OneServiceImpl(const char *hp,unsigned int port,NetworkConfigMaster *master,const char *overrideRootTopology) : + OneServiceImpl(const char *hp,unsigned int port,NetworkController *master,const char *overrideRootTopology) : _homePath((hp) ? hp : "."), _phy(this,true), _master(master), @@ -613,7 +613,7 @@ private: const std::string _homePath; Phy _phy; - NetworkConfigMaster *_master; + NetworkController *_master; std::string _overrideRootTopology; Node *_node; PhySocket *_v4UdpSocket; @@ -772,7 +772,7 @@ std::string OneService::platformDefaultHomePath() #endif // __UNIX_LIKE__ or not... } -OneService *OneService::newInstance(const char *hp,unsigned int port,NetworkConfigMaster *master,const char *overrideRootTopology) { return new OneServiceImpl(hp,port,master,overrideRootTopology); } +OneService *OneService::newInstance(const char *hp,unsigned int port,NetworkController *master,const char *overrideRootTopology) { return new OneServiceImpl(hp,port,master,overrideRootTopology); } OneService::~OneService() {} } // namespace ZeroTier