summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGrant Limberg <glimberg@gmail.com>2015-07-07 19:24:02 -0700
committerGrant Limberg <glimberg@gmail.com>2015-07-07 19:24:02 -0700
commit1ad2cfeedfa2a9f4fc1f512e1009e5bb1b0630cb (patch)
treed8264c9bd4f6b9dce3f5237b94fe1f2fc521cf19 /include
parent6d398beefddb48d91f27e5f41bf39f40eb77222f (diff)
parent412389ec755528108e0254e75a9cf43fc53e331a (diff)
downloadinfinitytier-1ad2cfeedfa2a9f4fc1f512e1009e5bb1b0630cb.tar.gz
infinitytier-1ad2cfeedfa2a9f4fc1f512e1009e5bb1b0630cb.zip
Merge branch 'adamierymenko-dev' into android-jni
Diffstat (limited to 'include')
-rw-r--r--include/ZeroTierOne.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h
index b6ff69ab..446bbc77 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,36 @@ 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.
+ *
+ * This returns a boolean indicating whether or not the address was
+ * accepted. ZeroTier will only communicate over certain address types
+ * and (for IP) address classes. Thus it's safe to just dump your OS's
+ * entire remote IP list (excluding ZeroTier interface IPs) into here
+ * and let ZeroTier determine which addresses it will use.
+ *
+ * @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
+ * @return Boolean: non-zero if address was accepted and added
+ */
+int 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