mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-06 04:51:46 -07:00
clang-format
This commit is contained in:
parent
d45f280cb7
commit
ba2a4a605c
140 changed files with 19214 additions and 17403 deletions
|
@ -22,7 +22,9 @@ namespace ZeroTier {
|
|||
#ifdef ZT_SDK
|
||||
class VirtualTap;
|
||||
// Use the virtual libzt endpoint instead of a tun/tap port driver
|
||||
namespace ZeroTier { typedef VirtualTap EthernetTap; }
|
||||
namespace ZeroTier {
|
||||
typedef VirtualTap EthernetTap;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Forward declaration so we can avoid dragging everything in
|
||||
|
@ -32,14 +34,12 @@ class Node;
|
|||
/**
|
||||
* Local service for ZeroTier One as system VPN/NFV provider
|
||||
*/
|
||||
class OneService
|
||||
{
|
||||
public:
|
||||
class OneService {
|
||||
public:
|
||||
/**
|
||||
* Returned by node main if/when it terminates
|
||||
*/
|
||||
enum ReasonForTermination
|
||||
{
|
||||
enum ReasonForTermination {
|
||||
/**
|
||||
* Instance is still running
|
||||
*/
|
||||
|
@ -64,8 +64,7 @@ public:
|
|||
/**
|
||||
* Local settings for each network
|
||||
*/
|
||||
struct NetworkSettings
|
||||
{
|
||||
struct NetworkSettings {
|
||||
/**
|
||||
* Allow this network to configure IP addresses and routes?
|
||||
*/
|
||||
|
@ -111,7 +110,7 @@ public:
|
|||
* @param hp Home path
|
||||
* @param port TCP and UDP port for packets and HTTP control (if 0, pick random port)
|
||||
*/
|
||||
static OneService *newInstance(const char *hp,unsigned int port);
|
||||
static OneService* newInstance(const char* hp, unsigned int port);
|
||||
|
||||
virtual ~OneService();
|
||||
|
||||
|
@ -147,11 +146,11 @@ public:
|
|||
/**
|
||||
* @return Reference to the Node
|
||||
*/
|
||||
virtual Node * getNode() = 0;
|
||||
virtual Node* getNode() = 0;
|
||||
/**
|
||||
* Fills out a structure with network-specific route information
|
||||
*/
|
||||
virtual void getRoutes(uint64_t nwid, void *routeArray, unsigned int *numRoutes) = 0;
|
||||
virtual void getRoutes(uint64_t nwid, void* routeArray, unsigned int* numRoutes) = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -166,7 +165,7 @@ public:
|
|||
* @param settings Buffer to fill with local network settings
|
||||
* @return True if network was found and settings is filled
|
||||
*/
|
||||
virtual bool getNetworkSettings(const uint64_t nwid,NetworkSettings &settings) const = 0;
|
||||
virtual bool getNetworkSettings(const uint64_t nwid, NetworkSettings& settings) const = 0;
|
||||
|
||||
/**
|
||||
* Set local settings for a network
|
||||
|
@ -175,21 +174,31 @@ public:
|
|||
* @param settings New network local settings
|
||||
* @return True if network was found and setting modified
|
||||
*/
|
||||
virtual bool setNetworkSettings(const uint64_t nwid,const NetworkSettings &settings) = 0;
|
||||
virtual bool setNetworkSettings(const uint64_t nwid, const NetworkSettings& settings) = 0;
|
||||
|
||||
/**
|
||||
* @return True if service is still running
|
||||
*/
|
||||
inline bool isRunning() const { return (this->reasonForTermination() == ONE_STILL_RUNNING); }
|
||||
inline bool isRunning() const
|
||||
{
|
||||
return (this->reasonForTermination() == ONE_STILL_RUNNING);
|
||||
}
|
||||
|
||||
protected:
|
||||
OneService() {}
|
||||
protected:
|
||||
OneService()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
OneService(const OneService &one) {}
|
||||
inline OneService &operator=(const OneService &one) { return *this; }
|
||||
private:
|
||||
OneService(const OneService& one)
|
||||
{
|
||||
}
|
||||
inline OneService& operator=(const OneService& one)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
} // namespace ZeroTier
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue