From b80c229d873ca51bf679ff9df90c8360dca5d0d7 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 31 Jul 2014 14:09:32 -0700 Subject: Tons of code cleanup, refactor Network to use EthernetTapFactory, probably also fix GitHub issue #90 --- node/Node.hpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'node/Node.hpp') diff --git a/node/Node.hpp b/node/Node.hpp index cc2886e7..6cc3ef40 100644 --- a/node/Node.hpp +++ b/node/Node.hpp @@ -33,6 +33,9 @@ namespace ZeroTier { +class EthernetTapFactory; +class RoutingTable; + /** * A ZeroTier One node * @@ -150,14 +153,25 @@ public: /** * Create a new node * - * The node is not executed until run() is called. + * The node is not executed until run() is called. The supplied tap factory + * and routing table must not be freed until the node is no longer + * executing. Node does not delete these objects, so the caller still owns + * them. * - * @param hp Home directory path or NULL for system-wide default for this platform (default: NULL) - * @param udpPort UDP port or 0 to disable (default: 9993) - * @param tcpPort TCP port or 0 to disable (default: 0) - * @param resetIdentity If true, delete identity before starting and regenerate (default: false) + * @param hp Home directory path or NULL for system-wide default for this platform + * @param tf Ethernet tap factory for platform network stack + * @param rt Routing table interface for platform network stack + * @param udpPort UDP port or 0 to disable + * @param tcpPort TCP port or 0 to disable + * @param resetIdentity If true, delete identity before starting and regenerate */ - Node(const char *hp = (const char *)0,unsigned int udpPort = 9993,unsigned int tcpPort = 0,bool resetIdentity = false) + Node( + const char *hp, + EthernetTapFactory *tf, + RoutingTable *rt, + unsigned int udpPort, + unsigned int tcpPort, + bool resetIdentity) throw(); ~Node(); -- cgit v1.2.3