Managed Routes now supported, with automatic add/remove

This commit is contained in:
Joseph Henry
2017-08-14 11:25:44 -07:00
parent 0098842b09
commit 8e192c0ee8
20 changed files with 596 additions and 299 deletions

View File

@@ -32,6 +32,11 @@
#include <net/if.h>
#include <stdlib.h>
#include <stdint.h>
#include <vector>
#include "ZeroTierOne.h"
// See test/selftest.cpp for examples
/****************************************************************************/
/* For SOCK_RAW support, it will initially be modeled after linux's API, so */
@@ -463,6 +468,11 @@ int zts_write(ZT_WRITE_SIG);
*/
int zts_shutdown(ZT_SHUTDOWN_SIG);
/*
* Returns a vector of network routes { target, via, metric, etc... }
*/
std::vector<ZT_VirtualNetworkRoute> *zts_get_network_routes(char *nwid);
/****************************************************************************/
/* SDK Socket API Helper functions/objects --- DONT CALL THESE DIRECTLY */
/****************************************************************************/
@@ -515,6 +525,10 @@ ZeroTier::SocketTap *getTapByNWID(uint64_t nwid);
ZeroTier::SocketTap *getTapByAddr(ZeroTier::InetAddress &addr);
ZeroTier::SocketTap *getTapByName(char *ifname);
ZeroTier::SocketTap *getTapByIndex(int index);
/*
* Destroys all virtual tap devices
*/
void dismantleTaps();
/**

View File

@@ -45,14 +45,12 @@
#include "lwip/debug.h"
// IP Protocol version
// It seems using ipv6/ipv4 in the same stack is problematic, for this reason we
// compile for only one or the other using the SDK_IPV4=1/SDK_IPV6=1 flags for now
#if defined(SDK_IPV6)
#if defined(LIBZT_IPV6)
#define LWIP_IPV6 1
#define LWIP_IPV4 0
#endif
#if defined(SDK_IPV4)
#if defined(LIBZT_IPV4)
#define LWIP_IPV4 1
#define LWIP_IPV6 0
#endif