mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 17:31:53 +00:00
More root topology stuff.
This commit is contained in:
parent
8c9d3146df
commit
f0ebb0b0f1
@ -1,5 +1,14 @@
|
|||||||
all:
|
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
|
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:
|
clean:
|
||||||
rm -f *.o mktopology
|
rm -f *.o mktopology bin2c root_topology.out
|
||||||
|
|
||||||
|
FORCE:
|
||||||
|
99
topology/ZT_DEFAULT_ROOT_TOPOLOGY.c
Normal file
99
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, 0x37, 0x30, 0x34, 0x37, 0x34, 0x0a
|
||||||
|
};
|
||||||
|
#define ZT_DEFAULT_ROOT_TOPOLOGY_LEN 1530
|
57
topology/bin2c.c
Normal file
57
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;
|
||||||
|
}
|
@ -23,7 +23,7 @@ int main(int argc,char **argv)
|
|||||||
std::string buf;
|
std::string buf;
|
||||||
|
|
||||||
if (!Utils::readFile("topology.secret",buf)) {
|
if (!Utils::readFile("topology.secret",buf)) {
|
||||||
std::cout << "Cannot read topology.secret" << std::endl;
|
std::cerr << "Cannot read topology.secret" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
Identity topologyAuthority(buf);
|
Identity topologyAuthority(buf);
|
||||||
@ -36,7 +36,7 @@ int main(int argc,char **argv)
|
|||||||
if ((sn->first.length() == 10)&&(!sn->second)) {
|
if ((sn->first.length() == 10)&&(!sn->second)) {
|
||||||
buf.clear();
|
buf.clear();
|
||||||
if (!Utils::readFile((std::string("supernodes/")+sn->first).c_str(),buf)) {
|
if (!Utils::readFile((std::string("supernodes/")+sn->first).c_str(),buf)) {
|
||||||
std::cout << "Cannot read supernodes/" << sn->first << std::endl;
|
std::cerr << "Cannot read supernodes/" << sn->first << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
supernodes[sn->first] = buf;
|
supernodes[sn->first] = buf;
|
||||||
@ -45,7 +45,7 @@ int main(int argc,char **argv)
|
|||||||
topology["supernodes"] = supernodes.toString();
|
topology["supernodes"] = supernodes.toString();
|
||||||
|
|
||||||
if (!topology.sign(topologyAuthority)) {
|
if (!topology.sign(topologyAuthority)) {
|
||||||
std::cout << "Unable to sign!" << std::endl;
|
std::cerr << "Unable to sign!" << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user