mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 05:13:58 -07:00
Rename topology/ to be more descriptive, and some more updates.
This commit is contained in:
parent
f0ebb0b0f1
commit
dd58006d65
12 changed files with 14 additions and 19 deletions
17
root-topology/Makefile
Normal file
17
root-topology/Makefile
Normal file
|
@ -0,0 +1,17 @@
|
|||
all: FORCE
|
||||
g++ -o mktopology mktopology.cpp ../node/Utils.cpp ../node/Identity.cpp ../node/C25519.cpp ../node/Salsa20.cpp ../node/Dictionary.cpp ../node/SHA512.cpp
|
||||
gcc -o bin2c bin2c.c
|
||||
|
||||
official: all
|
||||
rm -f root_topology.out
|
||||
./mktopology >root_topology.out
|
||||
./bin2c ZT_DEFAULT_ROOT_TOPOLOGY < root_topology.out > ZT_DEFAULT_ROOT_TOPOLOGY.c
|
||||
ls -l ZT_DEFAULT_ROOT_TOPOLOGY.c
|
||||
|
||||
clean:
|
||||
rm -f *.o mktopology bin2c root_topology.out
|
||||
|
||||
realclean: clean
|
||||
rm -f ZT_DEFAULT_ROOT_TOPOLOGY.c
|
||||
|
||||
FORCE:
|
7
root-topology/README.md
Normal file
7
root-topology/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
This folder contains the source files to compile the signed network root topology dictionary. Users outside ZeroTier won't find this useful except for testing, since the root topology must be signed by the root topology authority (public identity in root-topology-authority.public) to be considered valid.
|
||||
|
||||
ZT_DEFAULT_ROOT_TOPOLOGY.c contains the current default value, and this URL is periodically checked for updates:
|
||||
|
||||
http://download.zerotier.com/sys/topology
|
||||
|
||||
Obviously nothing prevents OSS users from replacing this topology with their own, changing the hard coded topology signing identity and update URL in Defaults, and signing their own dictionary. But doing so would yield a network that would have a tough(ish) time talking to the main one. Since the main network is a free service, why bother? (Except for building testnets, which ZeroTier already does for internal testing.)
|
99
root-topology/ZT_DEFAULT_ROOT_TOPOLOGY.c
Normal file
99
root-topology/ZT_DEFAULT_ROOT_TOPOLOGY.c
Normal file
|
@ -0,0 +1,99 @@
|
|||
static unsigned char ZT_DEFAULT_ROOT_TOPOLOGY[] = {
|
||||
0x73, 0x75, 0x70, 0x65, 0x72, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x3d, 0x33, 0x36, 0x66, 0x36, 0x33,
|
||||
0x64, 0x36, 0x35, 0x37, 0x34, 0x5c, 0x3d, 0x69, 0x64, 0x5c, 0x5c, 0x5c, 0x3d, 0x33, 0x36, 0x66,
|
||||
0x36, 0x33, 0x64, 0x36, 0x35, 0x37, 0x34, 0x3a, 0x30, 0x3a, 0x36, 0x37, 0x61, 0x37, 0x37, 0x36,
|
||||
0x34, 0x38, 0x37, 0x61, 0x31, 0x61, 0x39, 0x39, 0x62, 0x33, 0x32, 0x66, 0x34, 0x31, 0x33, 0x33,
|
||||
0x32, 0x39, 0x66, 0x32, 0x62, 0x36, 0x37, 0x63, 0x34, 0x33, 0x66, 0x62, 0x66, 0x36, 0x31, 0x35,
|
||||
0x32, 0x65, 0x34, 0x32, 0x63, 0x36, 0x62, 0x36, 0x36, 0x65, 0x38, 0x39, 0x30, 0x34, 0x33, 0x65,
|
||||
0x36, 0x39, 0x64, 0x39, 0x33, 0x65, 0x34, 0x38, 0x33, 0x31, 0x34, 0x63, 0x37, 0x64, 0x37, 0x30,
|
||||
0x39, 0x62, 0x35, 0x38, 0x61, 0x38, 0x33, 0x30, 0x31, 0x36, 0x62, 0x64, 0x32, 0x36, 0x31, 0x32,
|
||||
0x64, 0x64, 0x38, 0x39, 0x34, 0x30, 0x30, 0x62, 0x38, 0x35, 0x36, 0x65, 0x31, 0x38, 0x63, 0x35,
|
||||
0x35, 0x33, 0x64, 0x61, 0x39, 0x34, 0x38, 0x39, 0x32, 0x66, 0x37, 0x64, 0x33, 0x63, 0x61, 0x31,
|
||||
0x36, 0x62, 0x66, 0x32, 0x63, 0x39, 0x32, 0x63, 0x32, 0x34, 0x5c, 0x5c, 0x6e, 0x75, 0x64, 0x70,
|
||||
0x5c, 0x5c, 0x5c, 0x3d, 0x31, 0x39, 0x38, 0x2e, 0x32, 0x31, 0x31, 0x2e, 0x31, 0x32, 0x37, 0x2e,
|
||||
0x31, 0x37, 0x32, 0x2f, 0x39, 0x39, 0x39, 0x33, 0x5c, 0x5c, 0x6e, 0x74, 0x63, 0x70, 0x5c, 0x5c,
|
||||
0x5c, 0x3d, 0x31, 0x39, 0x38, 0x2e, 0x32, 0x31, 0x31, 0x2e, 0x31, 0x32, 0x37, 0x2e, 0x31, 0x37,
|
||||
0x32, 0x2f, 0x34, 0x34, 0x33, 0x5c, 0x5c, 0x6e, 0x64, 0x65, 0x73, 0x63, 0x5c, 0x5c, 0x5c, 0x3d,
|
||||
0x41, 0x6d, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x6d, 0x2c, 0x20, 0x4e, 0x65, 0x74, 0x68, 0x65,
|
||||
0x72, 0x6c, 0x61, 0x6e, 0x64, 0x73, 0x5c, 0x5c, 0x6e, 0x64, 0x6e, 0x73, 0x5c, 0x5c, 0x5c, 0x3d,
|
||||
0x73, 0x68, 0x75, 0x62, 0x2d, 0x6e, 0x69, 0x67, 0x67, 0x75, 0x72, 0x61, 0x74, 0x68, 0x2e, 0x7a,
|
||||
0x65, 0x72, 0x6f, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x5c, 0x5c, 0x6e, 0x5c, 0x6e,
|
||||
0x37, 0x65, 0x31, 0x39, 0x38, 0x37, 0x36, 0x61, 0x62, 0x61, 0x5c, 0x3d, 0x69, 0x64, 0x5c, 0x5c,
|
||||
0x5c, 0x3d, 0x37, 0x65, 0x31, 0x39, 0x38, 0x37, 0x36, 0x61, 0x62, 0x61, 0x3a, 0x30, 0x3a, 0x32,
|
||||
0x61, 0x36, 0x65, 0x32, 0x62, 0x32, 0x33, 0x31, 0x38, 0x39, 0x33, 0x30, 0x66, 0x36, 0x30, 0x65,
|
||||
0x62, 0x30, 0x39, 0x37, 0x66, 0x37, 0x30, 0x64, 0x30, 0x66, 0x34, 0x62, 0x30, 0x32, 0x38, 0x62,
|
||||
0x32, 0x63, 0x64, 0x36, 0x64, 0x33, 0x64, 0x30, 0x63, 0x36, 0x33, 0x63, 0x30, 0x31, 0x34, 0x62,
|
||||
0x39, 0x30, 0x33, 0x39, 0x66, 0x66, 0x33, 0x35, 0x33, 0x39, 0x30, 0x65, 0x34, 0x31, 0x31, 0x38,
|
||||
0x31, 0x66, 0x32, 0x31, 0x36, 0x66, 0x62, 0x32, 0x65, 0x36, 0x66, 0x61, 0x38, 0x64, 0x39, 0x35,
|
||||
0x63, 0x31, 0x65, 0x65, 0x39, 0x36, 0x36, 0x37, 0x31, 0x35, 0x36, 0x34, 0x31, 0x31, 0x39, 0x30,
|
||||
0x35, 0x63, 0x33, 0x64, 0x63, 0x63, 0x66, 0x65, 0x61, 0x37, 0x38, 0x64, 0x38, 0x63, 0x36, 0x64,
|
||||
0x66, 0x61, 0x66, 0x62, 0x61, 0x36, 0x38, 0x38, 0x31, 0x37, 0x30, 0x62, 0x33, 0x66, 0x61, 0x5c,
|
||||
0x5c, 0x6e, 0x75, 0x64, 0x70, 0x5c, 0x5c, 0x5c, 0x3d, 0x31, 0x39, 0x38, 0x2e, 0x31, 0x39, 0x39,
|
||||
0x2e, 0x39, 0x37, 0x2e, 0x32, 0x32, 0x30, 0x2f, 0x39, 0x39, 0x39, 0x33, 0x5c, 0x5c, 0x6e, 0x74,
|
||||
0x63, 0x70, 0x5c, 0x5c, 0x5c, 0x3d, 0x31, 0x39, 0x38, 0x2e, 0x31, 0x39, 0x39, 0x2e, 0x39, 0x37,
|
||||
0x2e, 0x32, 0x32, 0x30, 0x2f, 0x34, 0x34, 0x33, 0x5c, 0x5c, 0x6e, 0x64, 0x65, 0x73, 0x63, 0x5c,
|
||||
0x5c, 0x5c, 0x3d, 0x53, 0x61, 0x6e, 0x20, 0x46, 0x72, 0x61, 0x6e, 0x63, 0x69, 0x73, 0x63, 0x6f,
|
||||
0x2c, 0x20, 0x43, 0x61, 0x6c, 0x69, 0x66, 0x6f, 0x72, 0x6e, 0x69, 0x61, 0x2c, 0x20, 0x55, 0x53,
|
||||
0x41, 0x5c, 0x5c, 0x6e, 0x64, 0x6e, 0x73, 0x5c, 0x5c, 0x5c, 0x3d, 0x6e, 0x79, 0x61, 0x72, 0x6c,
|
||||
0x61, 0x74, 0x68, 0x6f, 0x74, 0x65, 0x70, 0x2e, 0x7a, 0x65, 0x72, 0x6f, 0x74, 0x69, 0x65, 0x72,
|
||||
0x2e, 0x63, 0x6f, 0x6d, 0x5c, 0x5c, 0x6e, 0x5c, 0x6e, 0x38, 0x61, 0x63, 0x66, 0x30, 0x35, 0x39,
|
||||
0x66, 0x65, 0x33, 0x5c, 0x3d, 0x69, 0x64, 0x5c, 0x5c, 0x5c, 0x3d, 0x38, 0x61, 0x63, 0x66, 0x30,
|
||||
0x35, 0x39, 0x66, 0x65, 0x33, 0x3a, 0x30, 0x3a, 0x34, 0x38, 0x32, 0x66, 0x36, 0x65, 0x65, 0x35,
|
||||
0x64, 0x66, 0x65, 0x39, 0x30, 0x32, 0x33, 0x31, 0x39, 0x62, 0x34, 0x31, 0x39, 0x64, 0x65, 0x35,
|
||||
0x62, 0x64, 0x63, 0x37, 0x36, 0x35, 0x32, 0x30, 0x39, 0x63, 0x30, 0x65, 0x63, 0x64, 0x61, 0x33,
|
||||
0x38, 0x63, 0x34, 0x64, 0x36, 0x65, 0x34, 0x66, 0x63, 0x66, 0x30, 0x64, 0x33, 0x33, 0x36, 0x35,
|
||||
0x38, 0x33, 0x39, 0x38, 0x62, 0x34, 0x35, 0x32, 0x37, 0x64, 0x63, 0x64, 0x32, 0x32, 0x66, 0x39,
|
||||
0x33, 0x31, 0x31, 0x32, 0x66, 0x62, 0x39, 0x62, 0x65, 0x66, 0x64, 0x30, 0x32, 0x66, 0x64, 0x37,
|
||||
0x38, 0x62, 0x66, 0x37, 0x32, 0x36, 0x31, 0x62, 0x33, 0x33, 0x33, 0x66, 0x63, 0x31, 0x30, 0x35,
|
||||
0x64, 0x31, 0x39, 0x32, 0x61, 0x36, 0x32, 0x33, 0x63, 0x61, 0x39, 0x65, 0x35, 0x30, 0x66, 0x63,
|
||||
0x36, 0x30, 0x62, 0x33, 0x37, 0x34, 0x61, 0x35, 0x5c, 0x5c, 0x6e, 0x75, 0x64, 0x70, 0x5c, 0x5c,
|
||||
0x5c, 0x3d, 0x31, 0x36, 0x32, 0x2e, 0x32, 0x34, 0x33, 0x2e, 0x37, 0x37, 0x2e, 0x31, 0x31, 0x31,
|
||||
0x2f, 0x39, 0x39, 0x39, 0x33, 0x5c, 0x5c, 0x6e, 0x74, 0x63, 0x70, 0x5c, 0x5c, 0x5c, 0x3d, 0x31,
|
||||
0x36, 0x32, 0x2e, 0x32, 0x34, 0x33, 0x2e, 0x37, 0x37, 0x2e, 0x31, 0x31, 0x31, 0x2f, 0x34, 0x34,
|
||||
0x33, 0x5c, 0x5c, 0x6e, 0x64, 0x65, 0x73, 0x63, 0x5c, 0x5c, 0x5c, 0x3d, 0x4e, 0x65, 0x77, 0x20,
|
||||
0x59, 0x6f, 0x72, 0x6b, 0x2c, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x59, 0x6f, 0x72, 0x6b, 0x2c, 0x20,
|
||||
0x55, 0x53, 0x41, 0x5c, 0x5c, 0x6e, 0x64, 0x6e, 0x73, 0x5c, 0x5c, 0x5c, 0x3d, 0x63, 0x74, 0x68,
|
||||
0x75, 0x6c, 0x68, 0x75, 0x2e, 0x7a, 0x65, 0x72, 0x6f, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x63, 0x6f,
|
||||
0x6d, 0x5c, 0x5c, 0x6e, 0x5c, 0x6e, 0x39, 0x64, 0x32, 0x31, 0x39, 0x30, 0x33, 0x39, 0x66, 0x33,
|
||||
0x5c, 0x3d, 0x69, 0x64, 0x5c, 0x5c, 0x5c, 0x3d, 0x39, 0x64, 0x32, 0x31, 0x39, 0x30, 0x33, 0x39,
|
||||
0x66, 0x33, 0x3a, 0x30, 0x3a, 0x30, 0x31, 0x66, 0x30, 0x39, 0x32, 0x32, 0x61, 0x39, 0x38, 0x65,
|
||||
0x33, 0x62, 0x33, 0x34, 0x65, 0x62, 0x63, 0x62, 0x66, 0x66, 0x33, 0x33, 0x33, 0x32, 0x36, 0x39,
|
||||
0x64, 0x63, 0x32, 0x36, 0x35, 0x64, 0x37, 0x61, 0x30, 0x32, 0x30, 0x61, 0x61, 0x62, 0x36, 0x39,
|
||||
0x64, 0x37, 0x32, 0x62, 0x65, 0x34, 0x64, 0x34, 0x61, 0x63, 0x63, 0x39, 0x63, 0x38, 0x63, 0x39,
|
||||
0x32, 0x39, 0x34, 0x37, 0x38, 0x35, 0x37, 0x37, 0x31, 0x32, 0x35, 0x36, 0x63, 0x64, 0x31, 0x64,
|
||||
0x39, 0x34, 0x32, 0x61, 0x39, 0x30, 0x64, 0x31, 0x62, 0x64, 0x31, 0x64, 0x32, 0x64, 0x63, 0x61,
|
||||
0x33, 0x65, 0x61, 0x38, 0x34, 0x65, 0x66, 0x37, 0x64, 0x38, 0x35, 0x61, 0x66, 0x65, 0x36, 0x36,
|
||||
0x31, 0x31, 0x66, 0x62, 0x34, 0x33, 0x66, 0x66, 0x30, 0x62, 0x37, 0x34, 0x31, 0x32, 0x36, 0x64,
|
||||
0x39, 0x30, 0x61, 0x36, 0x65, 0x5c, 0x5c, 0x6e, 0x75, 0x64, 0x70, 0x5c, 0x5c, 0x5c, 0x3d, 0x31,
|
||||
0x32, 0x38, 0x2e, 0x31, 0x39, 0x39, 0x2e, 0x31, 0x39, 0x37, 0x2e, 0x32, 0x31, 0x37, 0x2f, 0x39,
|
||||
0x39, 0x39, 0x33, 0x5c, 0x5c, 0x6e, 0x74, 0x63, 0x70, 0x5c, 0x5c, 0x5c, 0x3d, 0x31, 0x32, 0x38,
|
||||
0x2e, 0x31, 0x39, 0x39, 0x2e, 0x31, 0x39, 0x37, 0x2e, 0x32, 0x31, 0x37, 0x2f, 0x34, 0x34, 0x33,
|
||||
0x5c, 0x5c, 0x6e, 0x64, 0x65, 0x73, 0x63, 0x5c, 0x5c, 0x5c, 0x3d, 0x53, 0x69, 0x6e, 0x67, 0x61,
|
||||
0x70, 0x6f, 0x72, 0x65, 0x5c, 0x5c, 0x6e, 0x68, 0x6e, 0x5c, 0x5c, 0x5c, 0x3d, 0x6d, 0x69, 0x2d,
|
||||
0x67, 0x6f, 0x2e, 0x7a, 0x65, 0x72, 0x6f, 0x74, 0x69, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x5c,
|
||||
0x5c, 0x6e, 0x5c, 0x6e, 0x0a, 0x7e, 0x21, 0x65, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x3d, 0x64,
|
||||
0x37, 0x35, 0x32, 0x38, 0x30, 0x66, 0x30, 0x31, 0x39, 0x39, 0x32, 0x63, 0x32, 0x36, 0x38, 0x36,
|
||||
0x66, 0x38, 0x34, 0x31, 0x65, 0x64, 0x32, 0x62, 0x39, 0x37, 0x63, 0x62, 0x34, 0x38, 0x64, 0x63,
|
||||
0x64, 0x66, 0x35, 0x37, 0x35, 0x37, 0x64, 0x66, 0x31, 0x37, 0x37, 0x36, 0x34, 0x66, 0x33, 0x31,
|
||||
0x33, 0x37, 0x30, 0x64, 0x66, 0x63, 0x37, 0x36, 0x64, 0x30, 0x35, 0x63, 0x61, 0x31, 0x35, 0x32,
|
||||
0x39, 0x35, 0x62, 0x63, 0x33, 0x62, 0x62, 0x32, 0x64, 0x61, 0x64, 0x63, 0x63, 0x65, 0x63, 0x38,
|
||||
0x61, 0x63, 0x36, 0x30, 0x37, 0x61, 0x31, 0x64, 0x34, 0x35, 0x33, 0x38, 0x30, 0x39, 0x64, 0x38,
|
||||
0x62, 0x65, 0x62, 0x66, 0x38, 0x64, 0x31, 0x31, 0x63, 0x61, 0x30, 0x37, 0x63, 0x65, 0x66, 0x66,
|
||||
0x35, 0x64, 0x62, 0x66, 0x33, 0x31, 0x32, 0x30, 0x36, 0x64, 0x66, 0x38, 0x31, 0x30, 0x35, 0x64,
|
||||
0x63, 0x34, 0x39, 0x38, 0x32, 0x62, 0x65, 0x64, 0x30, 0x31, 0x30, 0x35, 0x37, 0x66, 0x63, 0x32,
|
||||
0x66, 0x65, 0x64, 0x64, 0x34, 0x39, 0x38, 0x64, 0x35, 0x64, 0x63, 0x61, 0x63, 0x30, 0x37, 0x34,
|
||||
0x62, 0x32, 0x65, 0x30, 0x36, 0x37, 0x30, 0x62, 0x66, 0x38, 0x33, 0x36, 0x37, 0x32, 0x39, 0x37,
|
||||
0x36, 0x30, 0x61, 0x39, 0x64, 0x33, 0x62, 0x37, 0x37, 0x64, 0x33, 0x61, 0x62, 0x63, 0x39, 0x0a,
|
||||
0x7e, 0x21, 0x73, 0x69, 0x67, 0x69, 0x64, 0x3d, 0x37, 0x37, 0x37, 0x39, 0x32, 0x62, 0x31, 0x63,
|
||||
0x30, 0x32, 0x3a, 0x30, 0x3a, 0x62, 0x35, 0x63, 0x33, 0x36, 0x31, 0x65, 0x38, 0x65, 0x39, 0x63,
|
||||
0x32, 0x31, 0x35, 0x34, 0x65, 0x38, 0x32, 0x63, 0x33, 0x65, 0x39, 0x30, 0x32, 0x66, 0x64, 0x66,
|
||||
0x63, 0x33, 0x33, 0x37, 0x34, 0x36, 0x38, 0x62, 0x30, 0x39, 0x32, 0x61, 0x37, 0x63, 0x34, 0x64,
|
||||
0x38, 0x64, 0x63, 0x36, 0x38, 0x35, 0x63, 0x33, 0x37, 0x65, 0x62, 0x31, 0x30, 0x65, 0x65, 0x34,
|
||||
0x66, 0x33, 0x63, 0x31, 0x37, 0x63, 0x63, 0x30, 0x62, 0x62, 0x31, 0x64, 0x30, 0x32, 0x34, 0x31,
|
||||
0x36, 0x37, 0x65, 0x38, 0x63, 0x62, 0x30, 0x38, 0x32, 0x34, 0x64, 0x31, 0x32, 0x32, 0x36, 0x33,
|
||||
0x34, 0x32, 0x38, 0x33, 0x37, 0x33, 0x35, 0x38, 0x32, 0x64, 0x61, 0x33, 0x64, 0x30, 0x61, 0x39,
|
||||
0x61, 0x31, 0x34, 0x62, 0x33, 0x36, 0x65, 0x34, 0x35, 0x34, 0x36, 0x63, 0x33, 0x31, 0x37, 0x65,
|
||||
0x38, 0x31, 0x31, 0x65, 0x36, 0x0a, 0x7e, 0x21, 0x73, 0x69, 0x67, 0x74, 0x73, 0x3d, 0x31, 0x34,
|
||||
0x37, 0x62, 0x32, 0x66, 0x62, 0x65, 0x66, 0x38, 0x35, 0x0a
|
||||
};
|
||||
#define ZT_DEFAULT_ROOT_TOPOLOGY_LEN 1530
|
57
root-topology/bin2c.c
Normal file
57
root-topology/bin2c.c
Normal file
|
@ -0,0 +1,57 @@
|
|||
/**
|
||||
Converts input from stdin into an array of binary data for use in C.
|
||||
|
||||
License: Public Domain
|
||||
|
||||
Usage: app VariableName < input > output.c
|
||||
*/
|
||||
|
||||
#include <stdint.h> /* uintXX_t */
|
||||
#include <inttypes.h> /* PRIuXX macros */
|
||||
#include <stdio.h>
|
||||
|
||||
static char const * appName = 0;
|
||||
|
||||
static void usage()
|
||||
{
|
||||
printf("Usage: %s OBJECT_NAME < input > output.c\n\n", appName );
|
||||
}
|
||||
|
||||
int main( int argc, char const ** argv )
|
||||
{
|
||||
appName = argv[0];
|
||||
if( (argc != 2) || (argv[1][0] == '-') )
|
||||
{
|
||||
usage();
|
||||
return 1;
|
||||
}
|
||||
char const * varname = argv[1];
|
||||
enum { bufSize = 1024 * 8 };
|
||||
unsigned char buf[bufSize];
|
||||
size_t rd = 0;
|
||||
size_t i = 0;
|
||||
size_t flip = 0;
|
||||
|
||||
printf( "static unsigned char %s[] = {\n\t", varname);
|
||||
uint32_t size = 0;
|
||||
while( 0 != (rd = fread( buf, 1, bufSize, stdin ) ) )
|
||||
{
|
||||
size += rd;
|
||||
for(i = 0; i < rd; ++i )
|
||||
{
|
||||
printf( "0x%02x", buf[i] );
|
||||
if( !( (rd < bufSize) && (i == rd-1)) ) putchar(',');
|
||||
if( 16 == ++flip )
|
||||
{
|
||||
flip = 0;
|
||||
printf("\n\t");
|
||||
}
|
||||
else putchar(' ');
|
||||
}
|
||||
}
|
||||
printf("\n};\n", varname );
|
||||
printf("#define %s_LEN %llu\n",varname,(unsigned long long)size);
|
||||
//printf( "enum { %s_length = %"PRIu32"%s }; ", varname, size,"UL");
|
||||
//printf("enum { %s_length = sizeof(%s) };\n", varname, varname );
|
||||
return 0;
|
||||
}
|
48
root-topology/mktopology.cpp
Normal file
48
root-topology/mktopology.cpp
Normal file
|
@ -0,0 +1,48 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
#include "../node/Utils.hpp"
|
||||
#include "../node/Identity.hpp"
|
||||
#include "../node/Dictionary.hpp"
|
||||
|
||||
using namespace ZeroTier;
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
std::string buf;
|
||||
|
||||
if (!Utils::readFile("root-topology-authority.secret",buf)) {
|
||||
std::cerr << "Cannot read root-topology-authority.secret" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
Identity topologyAuthority(buf);
|
||||
|
||||
Dictionary topology;
|
||||
|
||||
Dictionary supernodes;
|
||||
std::map<std::string,bool> supernodeDictionaries(Utils::listDirectory("supernodes"));
|
||||
for(std::map<std::string,bool>::iterator sn(supernodeDictionaries.begin());sn!=supernodeDictionaries.end();++sn) {
|
||||
if ((sn->first.length() == 10)&&(!sn->second)) {
|
||||
buf.clear();
|
||||
if (!Utils::readFile((std::string("supernodes/")+sn->first).c_str(),buf)) {
|
||||
std::cerr << "Cannot read supernodes/" << sn->first << std::endl;
|
||||
return 1;
|
||||
}
|
||||
supernodes[sn->first] = buf;
|
||||
}
|
||||
}
|
||||
topology["supernodes"] = supernodes.toString();
|
||||
|
||||
if (!topology.sign(topologyAuthority)) {
|
||||
std::cerr << "Unable to sign!" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::cout << topology.toString();
|
||||
return 0;
|
||||
}
|
1
root-topology/root-topology-authority.public
Normal file
1
root-topology/root-topology-authority.public
Normal file
|
@ -0,0 +1 @@
|
|||
77792b1c02:0:b5c361e8e9c2154e82c3e902fdfc337468b092a7c4d8dc685c37eb10ee4f3c17cc0bb1d024167e8cb0824d12263428373582da3d0a9a14b36e4546c317e811e6
|
5
root-topology/supernodes/36f63d6574
Normal file
5
root-topology/supernodes/36f63d6574
Normal file
|
@ -0,0 +1,5 @@
|
|||
id=36f63d6574:0:67a776487a1a99b32f413329f2b67c43fbf6152e42c6b66e89043e69d93e48314c7d709b58a83016bd2612dd89400b856e18c553da94892f7d3ca16bf2c92c24
|
||||
udp=198.211.127.172/9993
|
||||
tcp=198.211.127.172/443
|
||||
desc=Amsterdam, Netherlands
|
||||
dns=shub-niggurath.zerotier.com
|
5
root-topology/supernodes/7e19876aba
Normal file
5
root-topology/supernodes/7e19876aba
Normal file
|
@ -0,0 +1,5 @@
|
|||
id=7e19876aba:0:2a6e2b2318930f60eb097f70d0f4b028b2cd6d3d0c63c014b9039ff35390e41181f216fb2e6fa8d95c1ee9667156411905c3dccfea78d8c6dfafba688170b3fa
|
||||
udp=198.199.97.220/9993
|
||||
tcp=198.199.97.220/443
|
||||
desc=San Francisco, California, USA
|
||||
dns=nyarlathotep.zerotier.com
|
5
root-topology/supernodes/8acf059fe3
Normal file
5
root-topology/supernodes/8acf059fe3
Normal file
|
@ -0,0 +1,5 @@
|
|||
id=8acf059fe3:0:482f6ee5dfe902319b419de5bdc765209c0ecda38c4d6e4fcf0d33658398b4527dcd22f93112fb9befd02fd78bf7261b333fc105d192a623ca9e50fc60b374a5
|
||||
udp=162.243.77.111/9993
|
||||
tcp=162.243.77.111/443
|
||||
desc=New York, New York, USA
|
||||
dns=cthulhu.zerotier.com
|
5
root-topology/supernodes/9d219039f3
Normal file
5
root-topology/supernodes/9d219039f3
Normal file
|
@ -0,0 +1,5 @@
|
|||
id=9d219039f3:0:01f0922a98e3b34ebcbff333269dc265d7a020aab69d72be4d4acc9c8c9294785771256cd1d942a90d1bd1d2dca3ea84ef7d85afe6611fb43ff0b74126d90a6e
|
||||
udp=128.199.197.217/9993
|
||||
tcp=128.199.197.217/443
|
||||
desc=Singapore
|
||||
hn=mi-go.zerotier.com
|
Loading…
Add table
Add a link
Reference in a new issue