diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-21 16:11:16 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-09-26 13:26:18 -0700 |
| commit | 86a96e5bf1b207a8b1aa925e1d9f73ce834505b8 (patch) | |
| tree | 53e7d9042cf8d72c723767cf31ef950594cbf736 /src/core | |
| parent | 52118e4dcbc105d2b83c774e001926aceb978488 (diff) | |
| download | nng-86a96e5bf1b207a8b1aa925e1d9f73ce834505b8.tar.gz nng-86a96e5bf1b207a8b1aa925e1d9f73ce834505b8.tar.bz2 nng-86a96e5bf1b207a8b1aa925e1d9f73ce834505b8.zip | |
ZeroTier transport implementation (work funded by Capitar IT Group BV)
The ZeroTier transport is experimental at this point, and not enabled
by default. It does not work with Windows yet (the Windows platform
needs UDP support first.)
Configure with -DNNG_ENABLE_ZEROTIER=yes -DNNG_ZEROTIER_SOUCE=<path>
The <path> must point to a dev branch of the ZeroTierOne source tree,
checked out, and built with a libzerotiercore.a in the top directory,
and a ZeroTierOne.h header located at include. The build will add
-lc++ to the compile, as the ZeroTier core functionality is written in
C++ and needs some runtime support (e.g. new, delete, etc.)
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/platform.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/core/platform.h b/src/core/platform.h index 02ea9a11..7bfb370a 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -350,6 +350,33 @@ extern void nni_plat_pipe_clear(int); // routine. extern void nni_plat_pipe_close(int, int); +// +// File/Store Support +// +// Some transports require a persistent storage for things like +// key material, etc. Generally, these are all going to be relatively +// small objects (such as certificates), so we ony require a synchronous +// implementation from platforms. This Key-Value API is intended to +// to support using the Key's as filenames, and keys will consist of +// only these characters: [0-9a-zA-Z._-]. The directory used should be +// determined by using an environment variable (NNG_STATE_DIR), or +// using some other application-specific method. +// + +// nni_plat_file_put writes the named file, with the provided data, +// and the given size. If the file already exists it is overwritten. +// The permissions on the file should be limited to read and write +// access by the entity running the application only. +extern int nni_plat_file_put(const char *, const void *, int); + +// nni_plat_file_get reads the entire named file, allocating storage +// to receive the data and returning the data and the size in the +// reference arguments. +extern int nni_plat_file_get(const char *, void **, int *); + +// nni_plat_file_delete deletes the named file. +extern int nni_plat_file_delete(const char *); + // Actual platforms we support. This is included up front so that we can // get the specific types that are supplied by the platform. #if defined(NNG_PLATFORM_POSIX) |
