diff options
author | Grant Limberg <glimberg@gmail.com> | 2015-05-21 19:14:49 -0700 |
---|---|---|
committer | Grant Limberg <glimberg@gmail.com> | 2015-05-21 19:14:49 -0700 |
commit | c430d88bd40d178685ac0a2e648d8c4ea675996c (patch) | |
tree | f69f497428fa34c6389173d39c889563dea9506c /service/ControlPlane.hpp | |
parent | 9a00366b18bc2bdb3ddf4345edcc7a459eb5ed60 (diff) | |
parent | d9006712f6ffc975d97097caf2d2b4264405b32c (diff) | |
download | infinitytier-c430d88bd40d178685ac0a2e648d8c4ea675996c.tar.gz infinitytier-c430d88bd40d178685ac0a2e648d8c4ea675996c.zip |
Merge branch 'adamierymenko-dev' into android-jni
Conflicts:
.gitignore
Diffstat (limited to 'service/ControlPlane.hpp')
-rw-r--r-- | service/ControlPlane.hpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/service/ControlPlane.hpp b/service/ControlPlane.hpp index fc8a0182..75cd8cac 100644 --- a/service/ControlPlane.hpp +++ b/service/ControlPlane.hpp @@ -52,30 +52,26 @@ public: ControlPlane(OneService *svc,Node *n,const char *uiStaticPath); ~ControlPlane(); +#ifdef ZT_ENABLE_NETWORK_CONTROLLER /** - * Add an authentication token for API access + * Set controller, which will be available under /controller + * + * @param c Network controller instance */ - inline void addAuthToken(const char *tok) + inline void setController(SqliteNetworkController *c) { Mutex::Lock _l(_lock); - _authTokens.insert(std::string(tok)); + _controller = c; } +#endif /** - * Mount a subsystem under a prefix - * - * Note that the prefix must not contain a dot -- this is reserved for - * static pages -- and must not be a reserved prefix such as /peer - * or /network. Do not include path / characters in the prefix. Example - * would be 'controller' for SqliteNetworkController. - * - * @param prefix First element in URI path - * @param subsys Object to call for results of GET and POST/PUT operations + * Add an authentication token for API access */ - inline void mount(const char *prefix,SqliteNetworkController *subsys) + inline void addAuthToken(const char *tok) { Mutex::Lock _l(_lock); - _subsystems[std::string(prefix)] = subsys; + _authTokens.insert(std::string(tok)); } /** @@ -102,9 +98,11 @@ public: private: OneService *const _svc; Node *const _node; +#ifdef ZT_ENABLE_NETWORK_CONTROLLER + SqliteNetworkController *_controller; +#endif std::string _uiStaticPath; std::set<std::string> _authTokens; - std::map<std::string,SqliteNetworkController *> _subsystems; Mutex _lock; }; |