From b653e9e6411ce05181e0721c6e44134589399182 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 1 Aug 2017 14:18:21 -0700 Subject: [PATCH] Updated README.md --- README.md | 4 +++- include/libzt.h | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 31dbc96..319544d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ -**ZeroTier** makes it easy to securely connect devices, servers, cloud VMs, containers, and apps everywhere and manage them at scale. Now, with **libzt** you can bake this ability directly into your app or service using your preferred language or framework. We provide a BSD socket-like API to make the integration simple and there's no longer any need for system-wide virtual interfaces. This connection is exclusive to your app. +**ZeroTier** makes it easy to securely connect devices, servers, cloud VMs, containers, and apps everywhere and manage them at scale. Now, with **libzt** you can bake this ability directly into your app or service using your preferred language or framework. We provide a BSD socket-like API supporting `SOCK_STREAM`, `SOCK_DGRAM`, and `SOCK_RAW` to make the integration simple. There's also no longer any need for system-wide virtual interfaces. This connection is exclusive to your app and fully encrypted via the [Salsa20](https://en.wikipedia.org/wiki/Salsa20) cipher.
@@ -39,6 +39,8 @@ zts_close(fd); Bindings for various [languages](examples) +For an example using only the Virtual Layer 2, see [test/layer2.cpp](test/layer2.cpp) + *** ### Building (linux, macos, bsd, win, ios) diff --git a/include/libzt.h b/include/libzt.h index ec77738..3f88eba 100644 --- a/include/libzt.h +++ b/include/libzt.h @@ -29,6 +29,18 @@ #include #include +#include + +/****************************************************************************/ +/* For SOCK_RAW support, it will initially be modeled after linux's API, so */ +/* below are the various things we need to define in order to make this API */ +/* work on other platforms. Mayber later down the road we will customize */ +/* this for each different platform. Maybe. */ +/****************************************************************************/ +#if !defined(__linux__) +#define SIOCGIFINDEX 101 +#define SIOCGIFHWADDR 102 +#endif /****************************************************************************/ /* LWIP */ @@ -140,6 +152,7 @@ #define ZT_GETSOCKNAME_SIG int fd, struct sockaddr *addr, socklen_t *addrlen #define ZT_GETPEERNAME_SIG int fd, struct sockaddr *addr, socklen_t *addrlen #define ZT_FCNTL_SIG int fd, int cmd, int flags +#define ZT_IOCTL_SIG int fd, unsigned long request, void *argp #define ZT_SYSCALL_SIG long number, ... /****************************************************************************/ @@ -367,6 +380,11 @@ int zts_select(ZT_SELECT_SIG); */ int zts_fcntl(ZT_FCNTL_SIG); +/** + * Control a device + */ +int zts_ioctl(ZT_IOCTL_SIG); + /** * Send data to a remote host */