diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-06 15:51:04 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-07-06 15:51:04 -0700 |
commit | 235f4762b700174c795b28de7d4fe2f70cddbcd8 (patch) | |
tree | 2acca7f20487cf20eac76466debdfa60424128da /include | |
parent | 79e9a8bcc26491a43577082ec7edb86020f7ec00 (diff) | |
download | infinitytier-235f4762b700174c795b28de7d4fe2f70cddbcd8.tar.gz infinitytier-235f4762b700174c795b28de7d4fe2f70cddbcd8.zip |
Plumbing for local interface addresses -- GitHub issue #180
Diffstat (limited to 'include')
-rw-r--r-- | include/ZeroTierOne.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h index b6ff69ab..4790795e 100644 --- a/include/ZeroTierOne.h +++ b/include/ZeroTierOne.h @@ -629,6 +629,15 @@ typedef struct } 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) */ typedef void ZT1_Node; @@ -959,6 +968,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 * * Normal nodes should not need to use this. This is for nodes with |