You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Joseph Henry 38545ebe27 Deleted AAR left in build directory 7 years ago
examples Deleted AAR left in build directory 7 years ago
ext Added lwIP 2.1.2 errno patch 7 years ago
include Added ZTS_ERR_GENERAL, also minor updates to JNI layer 7 years ago
ports Promoted dist.sh to top-level directory, updated .gitignore 7 years ago
src Moved Java sources to src/java 7 years ago
test Re-work of thread model 7 years ago
.gitignore Promoted dist.sh to top-level directory, updated .gitignore 7 years ago
.gitmodules Added lwip, lwip-contrib, ZeroTierOne submodules to ext 8 years ago
API.md Updated documentation 7 years ago
CMakeLists.txt Build script improvements (merging, wrapping), added build-specific clean targets 7 years ago
LICENSE.GPL-3 Added license files for libzt and lwip 9 years ago
Makefile Promoted dist.sh to top-level directory, updated .gitignore 7 years ago
README.md Updated documentation 7 years ago
clean.bat Promoted dist.sh to top-level directory, updated .gitignore 7 years ago
dist.bat Promoted dist.sh to top-level directory, updated .gitignore 7 years ago
dist.sh Promoted dist.sh to top-level directory, updated .gitignore 7 years ago

README.md

ZeroTier SDK (libzt, libztcore)

Library edition of ZeroTier


The ZeroTier SDK is composed of two libraries: libztcore which is the platform-agnostic network hypervisor, and libzt which is the network hypervisor paired with a userspace network stack. libzt is a superset of libztcore and is distinguished by the fact that it exposes a standard socket API and simple network control API. With these libraries the stack and virtual link are exclusive to your app and traffic is fully encrypted via the Salsa20 cipher. For a more in-depth discussion on the technical side of ZeroTier, check out our Manual



For a complete example, see test/simple.cpp, and anything in the examples directory. With no error checking, a paraphrased example is as follows:

#include "ZeroTier.h"

void myZeroTierEventCallback(struct zts_callback_msg *msg)
{
    switch (msg->eventCode)
    {
        //
    }
}

int main()
{
    zts_start("yourConfig/key/path", &myZeroTierEventCallback, 9994);
    zts_join(0x0123456789abcdef);
    zts_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0);
    zts_connect(fd, (const struct sockaddr *)&addr, sizeof(addr));
    zts_write(fd, "welcome to the machine", strlen(str));
    zts_close(fd);
    zts_stop();
    return 0;
}

...

Build

Build scripts use a combination of make, and cmake. To retrieve sources for all submodules, patch them, and build all targets (debug and release) for your host machine, issue the following:

make update
make patch
make all

All build targets can be seen by using make list.

Resultant libraries will be placed in lib, test and example programs will be placed in bin.


Commercial License

If you want a commercial license to use the ZeroTier SDK in your product contact us directly via contact@zerotier.com