mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-09-22 15:29:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5db538d85e | ||
|
|
a9176d7b62 | ||
|
|
b4487cefc9 | ||
|
|
867258de8b | ||
|
|
5fcef91278 | ||
|
|
2aa1b5d9b7 | ||
|
|
9a5be0a092 | ||
|
|
4da794b389 | ||
|
|
0a5429cab0 | ||
|
|
b75bdedaee | ||
|
|
085734aaba | ||
|
|
bf193dd3cf | ||
|
|
facb009a1d | ||
|
|
8d09c37140 | ||
|
|
f6ced547be | ||
|
|
c826cec1d4 | ||
|
|
620562f7cf | ||
|
|
922d9657b9 | ||
|
|
499b2dccad | ||
|
|
1e3d5c4d87 | ||
|
|
6f46f0e0e1 | ||
|
|
8169b35482 | ||
|
|
7cd3c419ee | ||
|
|
fa03d50e90 | ||
|
|
0dff741310 | ||
|
|
fcc5bf1e66 | ||
|
|
7578b56298 | ||
|
|
2599b1bacc | ||
|
|
e3983f8a57 | ||
|
|
14264c2d6f | ||
|
|
3c54187c40 | ||
|
|
7df4eb69b5 | ||
|
|
559e384130 | ||
|
|
ebe5c526bb | ||
|
|
5097aae716 | ||
|
|
569c5e77fd | ||
|
|
9c87decba6 | ||
|
|
fe6d5b1402 | ||
|
|
eea8d58afa | ||
|
|
21e6850722 | ||
|
|
5986d83738 | ||
|
|
4564dd95ff | ||
|
|
d2bfdfa6e7 | ||
|
|
b69afa010e | ||
|
|
708aac1ea7 | ||
|
|
17bfd4d55e | ||
|
|
b31071463c | ||
|
|
dda376c9eb | ||
|
|
40d5c79b62 | ||
|
|
1537109514 | ||
|
|
66c74f0ad9 | ||
|
|
821f1f366e | ||
|
|
e99eda4a4a | ||
|
|
fadb291962 | ||
|
|
f0003ea922 | ||
|
|
e30ba3e138 | ||
|
|
7a15d8a7e3 | ||
|
|
dba91eaa09 | ||
|
|
d57ea671d7 | ||
|
|
d647a587a1 | ||
|
|
a493fc23f4 | ||
|
|
b3516c599b | ||
|
|
3ba54c7e35 | ||
|
|
b41079ddf9 | ||
|
|
e2a2993b18 | ||
|
|
8ca885d27c | ||
|
|
7c761dea72 | ||
|
|
3f8a5b8b76 | ||
|
|
a061aa3d87 | ||
|
|
b343eac10d | ||
|
|
649a12472b | ||
|
|
cac6be87ba | ||
|
|
38d34a7495 | ||
|
|
fb4c3dd8d4 | ||
|
|
1ffd67e014 | ||
|
|
8c18c60c00 | ||
|
|
bca8886ff8 | ||
|
|
1f7bb67069 | ||
|
|
712e2785f2 | ||
|
|
5515909c1e | ||
|
|
5ef806c43c | ||
|
|
0db7c94c90 | ||
|
|
99969b186b | ||
|
|
f9f7de0ec7 | ||
|
|
d27c14af48 | ||
|
|
88949a750f | ||
|
|
547b1c6157 | ||
|
|
0b354803f3 | ||
|
|
0b9524f23d | ||
|
|
4bf3bcbd55 | ||
|
|
3f0eca72f7 | ||
|
|
fe20f0d7cd | ||
|
|
d78e3bb307 | ||
|
|
a297e4a5bf | ||
|
|
412389ec75 | ||
|
|
cf6f30963c | ||
|
|
3f567a07ca | ||
|
|
41fc08b330 | ||
|
|
07ea4fd4f9 | ||
|
|
778c7e6e70 | ||
|
|
c863ff3f02 | ||
|
|
f398952a6c | ||
|
|
56285ec0d4 | ||
|
|
25a067c8c3 | ||
|
|
91fa643131 | ||
|
|
6da9d2d36f | ||
|
|
f881cdd767 | ||
|
|
84ba365c77 | ||
|
|
f9f4dd5276 | ||
|
|
cac55105c3 | ||
|
|
a87cd2d094 | ||
|
|
235f4762b7 | ||
|
|
79e9a8bcc2 | ||
|
|
fad9dff2db | ||
|
|
1632aec102 | ||
|
|
255320e2a6 | ||
|
|
93bb934d4e | ||
|
|
feddd946f9 | ||
|
|
6bfbc43e3c | ||
|
|
35b5dcf89d | ||
|
|
9743db3538 | ||
|
|
e5f7c55c54 | ||
|
|
df08c2cfab | ||
|
|
21cdfb96de | ||
|
|
53c7f61f98 | ||
|
|
532f413472 | ||
|
|
235d4aba9a | ||
|
|
cfdf4e3a49 | ||
|
|
f19c3c51d3 | ||
|
|
7c9949eea3 | ||
|
|
0cbbcf2884 | ||
|
|
30e4a188d0 | ||
|
|
5c9411a671 | ||
|
|
48a2ad032a | ||
|
|
f05e62deae | ||
|
|
dbee1b38b3 | ||
|
|
3f71afd0fb | ||
|
|
221df51875 | ||
|
|
f33f3fcb72 | ||
|
|
57c7992c78 | ||
|
|
c287ae4d1d | ||
|
|
3eca5d9c29 | ||
|
|
8a68624dae | ||
|
|
daebce4994 | ||
|
|
def9cf2a6a | ||
|
|
4aa8449fe1 | ||
|
|
53aad7f6bd | ||
|
|
787608b568 | ||
|
|
2b04ac5e9b | ||
|
|
50d4f66d73 | ||
|
|
7bae95836c | ||
|
|
07f84a99b4 | ||
|
|
f89f02ce9e | ||
|
|
be4f08a548 | ||
|
|
0073d0f694 | ||
|
|
16eae132fa | ||
|
|
6fc150bddb | ||
|
|
87bb0086de | ||
|
|
1d0654bd14 | ||
|
|
463442eb6f | ||
|
|
4affa10ca0 | ||
|
|
2e1d363a86 | ||
|
|
1cbdae65fe | ||
|
|
dcbae5f313 | ||
|
|
845955dea5 | ||
|
|
8aa68cd5f1 | ||
|
|
edbc5d3588 | ||
|
|
96a58becf8 | ||
|
|
8a9715f183 | ||
|
|
1b122cddbd | ||
|
|
42390e662b | ||
|
|
494681a482 | ||
|
|
dbf40f30f9 | ||
|
|
dc50e8ae5b | ||
|
|
7a55c6b388 | ||
|
|
c2ce018202 | ||
|
|
0d0af07ce9 | ||
|
|
de697a1c45 | ||
|
|
00aa115898 | ||
|
|
17ca5be4c1 | ||
|
|
ab720a6f1e | ||
|
|
e5e11c1b24 | ||
|
|
a425bbc673 |
No files matched your search
+44
@@ -0,0 +1,44 @@
|
||||
## Authors
|
||||
|
||||
* ZeroTier protocol design and core network virtualization engine, ZeroTier One service, React web UI, packaging for most platforms, kitchen sink...<br>
|
||||
Adam Ierymenko / adam.ierymenko@zerotier.com
|
||||
|
||||
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)<br>
|
||||
Grant Limberg / glimberg@gmail.com
|
||||
|
||||
## Contributors
|
||||
|
||||
* A number of fixes and improvements to the new controller, other stuff.<br>
|
||||
Kees Bos / https://github.com/keesbos
|
||||
|
||||
* Debugging and testing, OpenWRT support fixes.<br>
|
||||
Moritz Warning / moritzwarning@web.de
|
||||
|
||||
* Several others made smaller contributions, which GitHub tracks here:<br>
|
||||
https://github.com/zerotier/ZeroTierOne/graphs/contributors
|
||||
|
||||
## Third Party Code
|
||||
|
||||
* LZ4 compression algorithm by Yann Collet (BSD license)<br>
|
||||
http://code.google.com/p/lz4/
|
||||
|
||||
* http-parser by many authors (MIT license)<br>
|
||||
https://github.com/joyent/http-parser
|
||||
|
||||
* json-parser by James McLaughlin (BSD license)<br>
|
||||
https://github.com/udp/json-parser
|
||||
|
||||
* TunTapOSX by Mattias Nissler (BSD license)<br>
|
||||
http://tuntaposx.sourceforge.net
|
||||
|
||||
* tap-windows and tap-windows6 by the OpenVPN project (GPL)<br>
|
||||
https://github.com/OpenVPN/tap-windows<br>
|
||||
https://github.com/OpenVPN/tap-windows6
|
||||
|
||||
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519
|
||||
digital signature algorithm, and Poly1305 MAC algorithm, all by
|
||||
Daniel J. Bernstein (public domain)<br>
|
||||
http://cr.yp.to/
|
||||
|
||||
* MiniUPNPC by Thomas Bernard [BSD]
|
||||
http://miniupnp.free.fr
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
ZeroTier One is designed and written by Adam Ierymenko, with a few bug
|
||||
fixes and other contributions from other users. Information about all
|
||||
contributors can be found on the GitHub home page at:
|
||||
|
||||
https://github.com/zerotier/ZeroTierOne
|
||||
|
||||
ZeroTier One includes the following third party code:
|
||||
|
||||
* LZ4 compression algorithm by Yann Collet (BSD license)
|
||||
http://code.google.com/p/lz4/
|
||||
|
||||
* http-parser by many authors (MIT license)
|
||||
https://github.com/joyent/http-parser
|
||||
|
||||
* json-parser by James McLaughlin (BSD license)
|
||||
https://github.com/udp/json-parser
|
||||
|
||||
* TunTapOSX by Mattias Nissler (forked for ZT1) (BSD license)
|
||||
http://tuntaposx.sourceforge.net
|
||||
|
||||
* tap-windows by the OpenVPN project (forked for ZT1) (GPL)
|
||||
https://github.com/OpenVPN/tap-windows
|
||||
|
||||
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519
|
||||
digital signature algorithm, and Poly1305 MAC algorithm, all by
|
||||
Daniel J. Bernstein (public domain)
|
||||
http://cr.yp.to/
|
||||
@@ -164,7 +164,7 @@ Users behind certain types of firewalls and "symmetric" NAT devices may not able
|
||||
|
||||
If you're interested, there's a [technical deep dive about NAT traversal on our blog](https://www.zerotier.com/blog/?p=226). A troubleshooting tool to help you diagnose NAT issues is planned for the future as are uPnP/IGD/NAT-PMP and IPv6 transport.
|
||||
|
||||
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to supernodes over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
|
||||
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
|
||||
|
||||
### License
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
File renamed without changes.
File diff suppressed because it is too large.
Load diff
@@ -80,6 +80,13 @@ public:
|
||||
std::string &responseContentType);
|
||||
|
||||
private:
|
||||
enum IpAssignmentType {
|
||||
// IP assignment is a static IP address
|
||||
ZT_IP_ASSIGNMENT_TYPE_ADDRESS = 0,
|
||||
// IP assignment is a network -- a route via this interface, not an address
|
||||
ZT_IP_ASSIGNMENT_TYPE_NETWORK = 1
|
||||
};
|
||||
|
||||
unsigned int _doCPGet(
|
||||
const std::vector<std::string> &path,
|
||||
const std::map<std::string,std::string> &urlArgs,
|
||||
@@ -89,6 +96,10 @@ private:
|
||||
std::string &responseContentType);
|
||||
|
||||
std::string _dbPath;
|
||||
std::string _instanceId;
|
||||
|
||||
std::map< std::pair<Address,uint64_t>,uint64_t > _lastRequestTime;
|
||||
|
||||
sqlite3 *_db;
|
||||
|
||||
sqlite3_stmt *_sGetNetworkById;
|
||||
@@ -99,13 +110,14 @@ private:
|
||||
sqlite3_stmt *_sUpdateNode;
|
||||
sqlite3_stmt *_sUpdateNode2;
|
||||
sqlite3_stmt *_sGetEtherTypesFromRuleTable;
|
||||
sqlite3_stmt *_sGetMulticastRates;
|
||||
sqlite3_stmt *_sGetActiveBridges;
|
||||
sqlite3_stmt *_sGetIpAssignmentsForNode;
|
||||
sqlite3_stmt *_sGetIpAssignmentPools;
|
||||
sqlite3_stmt *_sGetLocalRoutes;
|
||||
sqlite3_stmt *_sCheckIfIpIsAllocated;
|
||||
sqlite3_stmt *_sAllocateIp;
|
||||
sqlite3_stmt *_sDeleteIpAllocations;
|
||||
sqlite3_stmt *_sDeleteLocalRoutes;
|
||||
sqlite3_stmt *_sGetRelays;
|
||||
sqlite3_stmt *_sListNetworks;
|
||||
sqlite3_stmt *_sListNetworkMembers;
|
||||
@@ -122,8 +134,19 @@ private:
|
||||
sqlite3_stmt *_sDeleteIpAssignmentPoolsForNetwork;
|
||||
sqlite3_stmt *_sDeleteRulesForNetwork;
|
||||
sqlite3_stmt *_sCreateIpAssignmentPool;
|
||||
sqlite3_stmt *_sUpdateMemberAuthorized;
|
||||
sqlite3_stmt *_sUpdateMemberActiveBridge;
|
||||
sqlite3_stmt *_sDeleteMember;
|
||||
sqlite3_stmt *_sDeleteNetworkAndRelated;
|
||||
sqlite3_stmt *_sDeleteNetwork;
|
||||
sqlite3_stmt *_sGetGateways;
|
||||
sqlite3_stmt *_sDeleteGateways;
|
||||
sqlite3_stmt *_sCreateGateway;
|
||||
sqlite3_stmt *_sIncrementMemberRevisionCounter;
|
||||
sqlite3_stmt *_sGetConfig;
|
||||
sqlite3_stmt *_sSetConfig;
|
||||
sqlite3_stmt *_sPutLog;
|
||||
sqlite3_stmt *_sGetMemberLog;
|
||||
sqlite3_stmt *_sGetRecentMemberLog;
|
||||
|
||||
Mutex _lock;
|
||||
};
|
||||
|
||||
+82
-63
@@ -3,53 +3,6 @@ CREATE TABLE Config (
|
||||
v varchar(1024) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IpAssignment (
|
||||
networkId char(16) NOT NULL,
|
||||
nodeId char(10) NOT NULL,
|
||||
ip blob(16) NOT NULL,
|
||||
ipNetmaskBits integer NOT NULL DEFAULT(0),
|
||||
ipVersion integer NOT NULL DEFAULT(4)
|
||||
);
|
||||
|
||||
CREATE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
|
||||
|
||||
CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);
|
||||
|
||||
CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);
|
||||
|
||||
CREATE TABLE IpAssignmentPool (
|
||||
networkId char(16) NOT NULL,
|
||||
ipNetwork blob(16) NOT NULL,
|
||||
ipNetmaskBits integer NOT NULL,
|
||||
ipVersion integer NOT NULL DEFAULT(4)
|
||||
);
|
||||
|
||||
CREATE INDEX IpAssignmentPool_networkId ON IpAssignmentPool (networkId);
|
||||
|
||||
CREATE TABLE Member (
|
||||
networkId char(16) NOT NULL,
|
||||
nodeId char(10) NOT NULL,
|
||||
authorized integer NOT NULL DEFAULT(0),
|
||||
activeBridge integer NOT NULL DEFAULT(0)
|
||||
);
|
||||
|
||||
CREATE INDEX Member_networkId ON Member (networkId);
|
||||
|
||||
CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);
|
||||
|
||||
CREATE UNIQUE INDEX Member_networkId_nodeId ON Member (networkId, nodeId);
|
||||
|
||||
CREATE TABLE MulticastRate (
|
||||
networkId char(16) NOT NULL,
|
||||
mgMac char(12) NOT NULL,
|
||||
mgAdi integer NOT NULL DEFAULT(0),
|
||||
preload integer NOT NULL,
|
||||
maxBalance integer NOT NULL,
|
||||
accrual integer NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);
|
||||
|
||||
CREATE TABLE Network (
|
||||
id char(16) PRIMARY KEY NOT NULL,
|
||||
name varchar(128) NOT NULL,
|
||||
@@ -60,31 +13,97 @@ CREATE TABLE Network (
|
||||
v6AssignMode varchar(8) NOT NULL DEFAULT('none'),
|
||||
multicastLimit integer NOT NULL DEFAULT(32),
|
||||
creationTime integer NOT NULL DEFAULT(0),
|
||||
revision integer NOT NULL DEFAULT(1)
|
||||
revision integer NOT NULL DEFAULT(1),
|
||||
memberRevisionCounter integer NOT NULL DEFAULT(1)
|
||||
);
|
||||
|
||||
CREATE TABLE Relay (
|
||||
networkId char(16) NOT NULL,
|
||||
nodeId char(10) NOT NULL,
|
||||
phyAddress varchar(64) NOT NULL
|
||||
CREATE TABLE AuthToken (
|
||||
id integer PRIMARY KEY NOT NULL,
|
||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||
authMode integer NOT NULL DEFAULT(1),
|
||||
useCount integer NOT NULL DEFAULT(0),
|
||||
maxUses integer NOT NULL DEFAULT(0),
|
||||
expiresAt integer NOT NULL DEFAULT(0),
|
||||
token varchar(256) NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX Relay_networkId ON Relay (networkId);
|
||||
|
||||
CREATE UNIQUE INDEX Relay_networkId_nodeId ON Relay (networkId, nodeId);
|
||||
CREATE INDEX AuthToken_networkId_token ON AuthToken(networkId,token);
|
||||
|
||||
CREATE TABLE Node (
|
||||
id char(10) PRIMARY KEY NOT NULL,
|
||||
identity varchar(4096) NOT NULL,
|
||||
lastAt varchar(64),
|
||||
lastSeen integer NOT NULL DEFAULT(0),
|
||||
firstSeen integer NOT NULL DEFAULT(0)
|
||||
identity varchar(4096) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE Rule (
|
||||
CREATE TABLE Gateway (
|
||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||
ip blob(16) NOT NULL,
|
||||
ipVersion integer NOT NULL DEFAULT(4),
|
||||
metric integer NOT NULL DEFAULT(0)
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX Gateway_networkId_ip ON Gateway (networkId, ip);
|
||||
|
||||
CREATE TABLE IpAssignment (
|
||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||
nodeId char(10) REFERENCES Node(id) ON DELETE CASCADE,
|
||||
type integer NOT NULL DEFAULT(0),
|
||||
ip blob(16) NOT NULL,
|
||||
ipNetmaskBits integer NOT NULL DEFAULT(0),
|
||||
ipVersion integer NOT NULL DEFAULT(4)
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);
|
||||
|
||||
CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);
|
||||
|
||||
CREATE TABLE IpAssignmentPool (
|
||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||
ipRangeStart blob(16) NOT NULL,
|
||||
ipRangeEnd blob(16) NOT NULL,
|
||||
ipVersion integer NOT NULL DEFAULT(4)
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IpAssignmentPool_networkId_ipRangeStart ON IpAssignmentPool (networkId,ipRangeStart);
|
||||
|
||||
CREATE TABLE Member (
|
||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||
nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,
|
||||
authorized integer NOT NULL DEFAULT(0),
|
||||
activeBridge integer NOT NULL DEFAULT(0),
|
||||
memberRevision integer NOT NULL DEFAULT(0),
|
||||
PRIMARY KEY (networkId, nodeId)
|
||||
);
|
||||
|
||||
CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);
|
||||
CREATE INDEX Member_networkId_memberRevision ON Member(networkId, memberRevision);
|
||||
|
||||
CREATE TABLE Log (
|
||||
networkId char(16) NOT NULL,
|
||||
ruleId integer NOT NULL,
|
||||
nodeId char(10),
|
||||
nodeId char(10) NOT NULL,
|
||||
ts integer NOT NULL,
|
||||
authorized integer NOT NULL,
|
||||
authTokenId integer,
|
||||
version varchar(16),
|
||||
fromAddr varchar(64)
|
||||
);
|
||||
|
||||
CREATE INDEX Log_networkId_nodeId ON Log(networkId, nodeId);
|
||||
CREATE INDEX Log_ts ON Log(ts);
|
||||
|
||||
CREATE TABLE Relay (
|
||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||
address char(10) NOT NULL,
|
||||
phyAddress varchar(64) NOT NULL
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX Relay_networkId_address ON Relay (networkId,address);
|
||||
|
||||
CREATE TABLE Rule (
|
||||
networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,
|
||||
ruleNo integer NOT NULL,
|
||||
nodeId char(10) REFERENCES Node(id),
|
||||
sourcePort char(10),
|
||||
destPort char(10),
|
||||
vlanId integer,
|
||||
vlanPcp integer,
|
||||
etherType integer,
|
||||
@@ -101,4 +120,4 @@ CREATE TABLE Rule (
|
||||
"action" varchar(4096) NOT NULL DEFAULT('accept')
|
||||
);
|
||||
|
||||
CREATE INDEX Rule_networkId ON Rule (networkId);
|
||||
CREATE UNIQUE INDEX Rule_networkId_ruleNo ON Rule (networkId, ruleNo);
|
||||
+82
-63
@@ -4,53 +4,6 @@
|
||||
" v varchar(1024) NOT NULL\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE IpAssignment (\n"\
|
||||
" networkId char(16) NOT NULL,\n"\
|
||||
" nodeId char(10) NOT NULL,\n"\
|
||||
" ip blob(16) NOT NULL,\n"\
|
||||
" ipNetmaskBits integer NOT NULL DEFAULT(0),\n"\
|
||||
" ipVersion integer NOT NULL DEFAULT(4)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX IpAssignment_networkId ON IpAssignment (networkId);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE IpAssignmentPool (\n"\
|
||||
" networkId char(16) NOT NULL,\n"\
|
||||
" ipNetwork blob(16) NOT NULL,\n"\
|
||||
" ipNetmaskBits integer NOT NULL,\n"\
|
||||
" ipVersion integer NOT NULL DEFAULT(4)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX IpAssignmentPool_networkId ON IpAssignmentPool (networkId);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Member (\n"\
|
||||
" networkId char(16) NOT NULL,\n"\
|
||||
" nodeId char(10) NOT NULL,\n"\
|
||||
" authorized integer NOT NULL DEFAULT(0),\n"\
|
||||
" activeBridge integer NOT NULL DEFAULT(0)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX Member_networkId ON Member (networkId);\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);\n"\
|
||||
"\n"\
|
||||
"CREATE UNIQUE INDEX Member_networkId_nodeId ON Member (networkId, nodeId);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE MulticastRate (\n"\
|
||||
" networkId char(16) NOT NULL,\n"\
|
||||
" mgMac char(12) NOT NULL,\n"\
|
||||
" mgAdi integer NOT NULL DEFAULT(0),\n"\
|
||||
" preload integer NOT NULL,\n"\
|
||||
" maxBalance integer NOT NULL,\n"\
|
||||
" accrual integer NOT NULL\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX MulticastRate_networkId ON MulticastRate (networkId);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Network (\n"\
|
||||
" id char(16) PRIMARY KEY NOT NULL,\n"\
|
||||
" name varchar(128) NOT NULL,\n"\
|
||||
@@ -61,31 +14,97 @@
|
||||
" v6AssignMode varchar(8) NOT NULL DEFAULT('none'),\n"\
|
||||
" multicastLimit integer NOT NULL DEFAULT(32),\n"\
|
||||
" creationTime integer NOT NULL DEFAULT(0),\n"\
|
||||
" revision integer NOT NULL DEFAULT(1)\n"\
|
||||
" revision integer NOT NULL DEFAULT(1),\n"\
|
||||
" memberRevisionCounter integer NOT NULL DEFAULT(1)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Relay (\n"\
|
||||
" networkId char(16) NOT NULL,\n"\
|
||||
" nodeId char(10) NOT NULL,\n"\
|
||||
" phyAddress varchar(64) NOT NULL\n"\
|
||||
"CREATE TABLE AuthToken (\n"\
|
||||
" id integer PRIMARY KEY NOT NULL,\n"\
|
||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||
" authMode integer NOT NULL DEFAULT(1),\n"\
|
||||
" useCount integer NOT NULL DEFAULT(0),\n"\
|
||||
" maxUses integer NOT NULL DEFAULT(0),\n"\
|
||||
" expiresAt integer NOT NULL DEFAULT(0),\n"\
|
||||
" token varchar(256) NOT NULL\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX Relay_networkId ON Relay (networkId);\n"\
|
||||
"\n"\
|
||||
"CREATE UNIQUE INDEX Relay_networkId_nodeId ON Relay (networkId, nodeId);\n"\
|
||||
"CREATE INDEX AuthToken_networkId_token ON AuthToken(networkId,token);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Node (\n"\
|
||||
" id char(10) PRIMARY KEY NOT NULL,\n"\
|
||||
" identity varchar(4096) NOT NULL,\n"\
|
||||
" lastAt varchar(64),\n"\
|
||||
" lastSeen integer NOT NULL DEFAULT(0),\n"\
|
||||
" firstSeen integer NOT NULL DEFAULT(0)\n"\
|
||||
" identity varchar(4096) NOT NULL\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Rule (\n"\
|
||||
"CREATE TABLE Gateway (\n"\
|
||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||
" ip blob(16) NOT NULL,\n"\
|
||||
" ipVersion integer NOT NULL DEFAULT(4),\n"\
|
||||
" metric integer NOT NULL DEFAULT(0)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE UNIQUE INDEX Gateway_networkId_ip ON Gateway (networkId, ip);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE IpAssignment (\n"\
|
||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||
" nodeId char(10) REFERENCES Node(id) ON DELETE CASCADE,\n"\
|
||||
" type integer NOT NULL DEFAULT(0),\n"\
|
||||
" ip blob(16) NOT NULL,\n"\
|
||||
" ipNetmaskBits integer NOT NULL DEFAULT(0),\n"\
|
||||
" ipVersion integer NOT NULL DEFAULT(4)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE UNIQUE INDEX IpAssignment_networkId_ip ON IpAssignment (networkId, ip);\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX IpAssignment_networkId_nodeId ON IpAssignment (networkId, nodeId);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE IpAssignmentPool (\n"\
|
||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||
" ipRangeStart blob(16) NOT NULL,\n"\
|
||||
" ipRangeEnd blob(16) NOT NULL,\n"\
|
||||
" ipVersion integer NOT NULL DEFAULT(4)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE UNIQUE INDEX IpAssignmentPool_networkId_ipRangeStart ON IpAssignmentPool (networkId,ipRangeStart);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Member (\n"\
|
||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||
" nodeId char(10) NOT NULL REFERENCES Node(id) ON DELETE CASCADE,\n"\
|
||||
" authorized integer NOT NULL DEFAULT(0),\n"\
|
||||
" activeBridge integer NOT NULL DEFAULT(0),\n"\
|
||||
" memberRevision integer NOT NULL DEFAULT(0),\n"\
|
||||
" PRIMARY KEY (networkId, nodeId)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX Member_networkId_activeBridge ON Member(networkId, activeBridge);\n"\
|
||||
"CREATE INDEX Member_networkId_memberRevision ON Member(networkId, memberRevision);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Log (\n"\
|
||||
" networkId char(16) NOT NULL,\n"\
|
||||
" ruleId integer NOT NULL,\n"\
|
||||
" nodeId char(10),\n"\
|
||||
" nodeId char(10) NOT NULL,\n"\
|
||||
" ts integer NOT NULL,\n"\
|
||||
" authorized integer NOT NULL,\n"\
|
||||
" authTokenId integer,\n"\
|
||||
" version varchar(16),\n"\
|
||||
" fromAddr varchar(64)\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX Log_networkId_nodeId ON Log(networkId, nodeId);\n"\
|
||||
"CREATE INDEX Log_ts ON Log(ts);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Relay (\n"\
|
||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||
" address char(10) NOT NULL,\n"\
|
||||
" phyAddress varchar(64) NOT NULL\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE UNIQUE INDEX Relay_networkId_address ON Relay (networkId,address);\n"\
|
||||
"\n"\
|
||||
"CREATE TABLE Rule (\n"\
|
||||
" networkId char(16) NOT NULL REFERENCES Network(id) ON DELETE CASCADE,\n"\
|
||||
" ruleNo integer NOT NULL,\n"\
|
||||
" nodeId char(10) REFERENCES Node(id),\n"\
|
||||
" sourcePort char(10),\n"\
|
||||
" destPort char(10),\n"\
|
||||
" vlanId integer,\n"\
|
||||
" vlanPcp integer,\n"\
|
||||
" etherType integer,\n"\
|
||||
@@ -102,5 +121,5 @@
|
||||
" \"action\" varchar(4096) NOT NULL DEFAULT('accept')\n"\
|
||||
");\n"\
|
||||
"\n"\
|
||||
"CREATE INDEX Rule_networkId ON Rule (networkId);\n"\
|
||||
"CREATE UNIQUE INDEX Rule_networkId_ruleNo ON Rule (networkId, ruleNo);\n"\
|
||||
""
|
||||
@@ -1,7 +0,0 @@
|
||||
This is the Microsoft "devcon" utility, which as far as I know is
|
||||
fair game to redistribute. It's packaged with OpenVPN and several
|
||||
other things and also distributed in source code form as an example
|
||||
program by Microsoft.
|
||||
|
||||
It's called by zerotier-one.exe to automagically install and remove
|
||||
instances of the tap device.
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,27 @@
|
||||
MiniUPnPc
|
||||
Copyright (c) 2005-2015, Thomas BERNARD
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
libminiupnpc binaries
|
||||
======
|
||||
|
||||
This is a binary build of [libminiupnpc](http://miniupnp.free.fr) for certain architectures to faciliate easy building. Where possible the build flags were set for improved security by enabling options like stack protector (a.k.a. stack canary), ASLR support, etc.
|
||||
@@ -0,0 +1 @@
|
||||
1.9
|
||||
@@ -0,0 +1,54 @@
|
||||
/* $Id: codelength.h,v 1.5 2015/07/09 12:40:18 nanard Exp $ */
|
||||
/* Project : miniupnp
|
||||
* Author : Thomas BERNARD
|
||||
* copyright (c) 2005-2015 Thomas Bernard
|
||||
* This software is subjet to the conditions detailed in the
|
||||
* provided LICENCE file. */
|
||||
#ifndef CODELENGTH_H_INCLUDED
|
||||
#define CODELENGTH_H_INCLUDED
|
||||
|
||||
/* Encode length by using 7bit per Byte :
|
||||
* Most significant bit of each byte specifies that the
|
||||
* following byte is part of the code */
|
||||
|
||||
/* n : unsigned
|
||||
* p : unsigned char *
|
||||
*/
|
||||
#define DECODELENGTH(n, p) n = 0; \
|
||||
do { n = (n << 7) | (*p & 0x7f); } \
|
||||
while((*(p++)&0x80) && (n<(1<<25)));
|
||||
|
||||
/* n : unsigned
|
||||
* READ : function/macro to read one byte (unsigned char)
|
||||
*/
|
||||
#define DECODELENGTH_READ(n, READ) \
|
||||
n = 0; \
|
||||
do { \
|
||||
unsigned char c; \
|
||||
READ(c); \
|
||||
n = (n << 7) | (c & 0x07f); \
|
||||
if(!(c&0x80)) break; \
|
||||
} while(n<(1<<25));
|
||||
|
||||
/* n : unsigned
|
||||
* p : unsigned char *
|
||||
* p_limit : unsigned char *
|
||||
*/
|
||||
#define DECODELENGTH_CHECKLIMIT(n, p, p_limit) \
|
||||
n = 0; \
|
||||
do { \
|
||||
if((p) >= (p_limit)) break; \
|
||||
n = (n << 7) | (*(p) & 0x7f); \
|
||||
} while((*((p)++)&0x80) && (n<(1<<25)));
|
||||
|
||||
|
||||
/* n : unsigned
|
||||
* p : unsigned char *
|
||||
*/
|
||||
#define CODELENGTH(n, p) if(n>=268435456) *(p++) = (n >> 28) | 0x80; \
|
||||
if(n>=2097152) *(p++) = (n >> 21) | 0x80; \
|
||||
if(n>=16384) *(p++) = (n >> 14) | 0x80; \
|
||||
if(n>=128) *(p++) = (n >> 7) | 0x80; \
|
||||
*(p++) = n & 0x7f;
|
||||
|
||||
#endif /* CODELENGTH_H_INCLUDED */
|
||||
@@ -0,0 +1,18 @@
|
||||
/* $Id: connecthostport.h,v 1.3 2012/09/27 15:42:10 nanard Exp $ */
|
||||
/* Project: miniupnp
|
||||
* http://miniupnp.free.fr/
|
||||
* Author: Thomas Bernard
|
||||
* Copyright (c) 2010-2012 Thomas Bernard
|
||||
* This software is subjects to the conditions detailed
|
||||
* in the LICENCE file provided within this distribution */
|
||||
#ifndef CONNECTHOSTPORT_H_INCLUDED
|
||||
#define CONNECTHOSTPORT_H_INCLUDED
|
||||
|
||||
/* connecthostport()
|
||||
* return a socket connected (TCP) to the host and port
|
||||
* or -1 in case of error */
|
||||
int connecthostport(const char * host, unsigned short port,
|
||||
unsigned int scope_id);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/* $Id: igd_desc_parse.h,v 1.12 2014/11/17 17:19:13 nanard Exp $ */
|
||||
/* Project : miniupnp
|
||||
* http://miniupnp.free.fr/
|
||||
* Author : Thomas Bernard
|
||||
* Copyright (c) 2005-2014 Thomas Bernard
|
||||
* This software is subject to the conditions detailed in the
|
||||
* LICENCE file provided in this distribution.
|
||||
* */
|
||||
#ifndef IGD_DESC_PARSE_H_INCLUDED
|
||||
#define IGD_DESC_PARSE_H_INCLUDED
|
||||
|
||||
/* Structure to store the result of the parsing of UPnP
|
||||
* descriptions of Internet Gateway Devices */
|
||||
#define MINIUPNPC_URL_MAXSIZE (128)
|
||||
struct IGDdatas_service {
|
||||
char controlurl[MINIUPNPC_URL_MAXSIZE];
|
||||
char eventsuburl[MINIUPNPC_URL_MAXSIZE];
|
||||
char scpdurl[MINIUPNPC_URL_MAXSIZE];
|
||||
char servicetype[MINIUPNPC_URL_MAXSIZE];
|
||||
/*char devicetype[MINIUPNPC_URL_MAXSIZE];*/
|
||||
};
|
||||
|
||||
struct IGDdatas {
|
||||
char cureltname[MINIUPNPC_URL_MAXSIZE];
|
||||
char urlbase[MINIUPNPC_URL_MAXSIZE];
|
||||
char presentationurl[MINIUPNPC_URL_MAXSIZE];
|
||||
int level;
|
||||
/*int state;*/
|
||||
/* "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" */
|
||||
struct IGDdatas_service CIF;
|
||||
/* "urn:schemas-upnp-org:service:WANIPConnection:1"
|
||||
* "urn:schemas-upnp-org:service:WANPPPConnection:1" */
|
||||
struct IGDdatas_service first;
|
||||
/* if both WANIPConnection and WANPPPConnection are present */
|
||||
struct IGDdatas_service second;
|
||||
/* "urn:schemas-upnp-org:service:WANIPv6FirewallControl:1" */
|
||||
struct IGDdatas_service IPv6FC;
|
||||
/* tmp */
|
||||
struct IGDdatas_service tmp;
|
||||
};
|
||||
|
||||
void IGDstartelt(void *, const char *, int);
|
||||
void IGDendelt(void *, const char *, int);
|
||||
void IGDdata(void *, const char *, int);
|
||||
#ifdef DEBUG
|
||||
void printIGD(struct IGDdatas *);
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif /* IGD_DESC_PARSE_H_INCLUDED */
|
||||
Loaded 20 of 135 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user