From 235f4762b700174c795b28de7d4fe2f70cddbcd8 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 6 Jul 2015 15:51:04 -0700 Subject: Plumbing for local interface addresses -- GitHub issue #180 --- include/ZeroTierOne.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'include') diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h index b6ff69ab..4790795e 100644 --- a/include/ZeroTierOne.h +++ b/include/ZeroTierOne.h @@ -628,6 +628,15 @@ typedef struct unsigned long peerCount; } ZT1_PeerList; +/** + * Local interface trust levels + */ +typedef enum { + ZT1_LOCAL_INTERFACE_ADDRESS_TRUST_NORMAL = 0, + ZT1_LOCAL_INTERFACE_ADDRESS_TRUST_PRIVACY = 1, + ZT1_LOCAL_INTERFACE_ADDRESS_TRUST_ULTIMATE = 2 +} ZT1_LocalInterfaceAddressTrust; + /** * An instance of a ZeroTier One node (opaque) */ @@ -958,6 +967,29 @@ ZT1_VirtualNetworkList *ZT1_Node_networks(ZT1_Node *node); */ void ZT1_Node_freeQueryResult(ZT1_Node *node,void *qr); +/** + * Add a local interface address + * + * Local interface addresses may be added if you want remote peers + * with whom you have a trust relatinship (e.g. common network membership) + * to receive information about these endpoints as potential endpoints for + * direct communication. + * + * Take care that these are never ZeroTier interface addresses, otherwise + * strange things might happen or they simply won't work. + * + * @param addr Local interface address + * @param metric Local interface metric + * @param trust How much do you trust the local network under this interface? + * @param reliable If nonzero, this interface doesn't link to anything behind a NAT or stateful firewall + */ +void ZT1_Node_addLocalInterfaceAddress(ZT1_Node *node,const struct sockaddr_storage *addr,int metric,ZT1_LocalInterfaceAddressTrust trust,int reliable); + +/** + * Clear local interface addresses + */ +void ZT1_Node_clearLocalInterfaceAddresses(ZT1_Node *node); + /** * Set a network configuration master instance for this node * -- cgit v1.2.3