mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-15 21:58:21 +00:00
Better encode/decode code for control bus.
This commit is contained in:
@ -40,6 +40,45 @@ namespace ZeroTier {
|
||||
class Node
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Client for controlling a local ZeroTier One node
|
||||
*/
|
||||
class LocalClient
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Create a new node config client
|
||||
*
|
||||
* The result handler will be called from a different thread. Its
|
||||
* arguments are the request ID generated by send() and each line
|
||||
* of output. It may be called more than once per request result
|
||||
* if the command generates more than one line of output.
|
||||
*
|
||||
* @param authToken Authentication token
|
||||
* @param resultHandler Function to call when commands provide results
|
||||
*/
|
||||
LocalClient(const char *authToken,void (*resultHandler)(void *,unsigned long,const char *),void *arg)
|
||||
throw();
|
||||
|
||||
~LocalClient();
|
||||
|
||||
/**
|
||||
* Send a command to the local node
|
||||
*
|
||||
* @param command
|
||||
* @return Request ID that will be provided to result handler when/if results are sent back
|
||||
*/
|
||||
unsigned long send(const char *command)
|
||||
throw();
|
||||
|
||||
private:
|
||||
// LocalClient is not copyable
|
||||
LocalClient(const LocalClient&);
|
||||
const LocalClient& operator=(const LocalClient&);
|
||||
|
||||
void *_impl;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returned by node main if/when it terminates
|
||||
*/
|
||||
@ -108,6 +147,10 @@ public:
|
||||
static unsigned int versionRevision() throw();
|
||||
|
||||
private:
|
||||
// Nodes are not copyable
|
||||
Node(const Node&);
|
||||
const Node& operator=(const Node&);
|
||||
|
||||
void *const _impl; // private implementation
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user