Giter Site home page Giter Site logo

banben / libzt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gdamore/libzt

0.0 1.0 0.0 39.75 MB

Library version of ZeroTier

License: GNU General Public License v3.0

Makefile 0.40% Shell 3.15% C 24.78% C++ 58.72% Batchfile 0.42% CMake 2.63% Java 9.64% Ruby 0.26%

libzt's Introduction

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



Downloads / Installation

Tarballs:

Homebrew

brew install libzt


Example

#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", 22);
    zts_close(fd);
    zts_stop();
    return 0;
}

...

After you've created a virtual network and added its nwid to the sample code, run:

clang++ example.cpp -o example -lzt
./example

The complete API specification can be found here: API.md


Build from source

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 [email protected]

libzt's People

Contributors

joseph-henry avatar gdamore avatar janjaapbos avatar pmajumdar-ixia avatar adamierymenko avatar evan-olcott avatar psarna avatar laduke avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.