diff options
-rw-r--r-- | cli/README.md | 6 | ||||
-rw-r--r-- | controller/schema.sql | 5 | ||||
-rw-r--r-- | controller/schema.sql.c | 5 | ||||
-rw-r--r-- | node/Switch.cpp | 18 |
4 files changed, 17 insertions, 17 deletions
diff --git a/cli/README.md b/cli/README.md new file mode 100644 index 00000000..dabbd302 --- /dev/null +++ b/cli/README.md @@ -0,0 +1,6 @@ +ZeroTier Newer-Spiffier Command Line Interface +====== + +This will be the future home of our new unified CLI for ZeroTier One, controllers, and Central (my.zerotier.com etc.). + +IT IS NOT DONE AND DOES NOT WORK EVEN A LITTLE BIT. GO AWAY. diff --git a/controller/schema.sql b/controller/schema.sql index be0bb399..2f079c64 100644 --- a/controller/schema.sql +++ b/controller/schema.sql @@ -9,12 +9,11 @@ CREATE TABLE Network ( private integer NOT NULL DEFAULT(1), enableBroadcast integer NOT NULL DEFAULT(1), allowPassiveBridging integer NOT NULL DEFAULT(0), - v4AssignMode varchar(8) NOT NULL DEFAULT('none'), - 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), - memberRevisionCounter integer NOT NULL DEFAULT(1) + memberRevisionCounter integer NOT NULL DEFAULT(1), + flags integer NOT NULL DEFAULT(0) ); CREATE TABLE AuthToken ( diff --git a/controller/schema.sql.c b/controller/schema.sql.c index 9e3515d1..73e553ec 100644 --- a/controller/schema.sql.c +++ b/controller/schema.sql.c @@ -10,12 +10,11 @@ " private integer NOT NULL DEFAULT(1),\n"\ " enableBroadcast integer NOT NULL DEFAULT(1),\n"\ " allowPassiveBridging integer NOT NULL DEFAULT(0),\n"\ -" v4AssignMode varchar(8) NOT NULL DEFAULT('none'),\n"\ -" 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"\ -" memberRevisionCounter integer NOT NULL DEFAULT(1)\n"\ +" memberRevisionCounter integer NOT NULL DEFAULT(1),\n"\ +" flags integer NOT NULL DEFAULT(0)\n"\ ");\n"\ "\n"\ "CREATE TABLE AuthToken (\n"\ diff --git a/node/Switch.cpp b/node/Switch.cpp index d2f482d6..b134cc69 100644 --- a/node/Switch.cpp +++ b/node/Switch.cpp @@ -357,9 +357,9 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c const uint8_t *const pkt6 = reinterpret_cast<const uint8_t *>(data) + 40 + 8; const uint8_t *my6 = (const uint8_t *)0; - // ZT-rfc4193 address: fdNN:NNNN:NNNN:NNNN:NN99:93DD:DDDD:DDDD / 88 (one /128 per actual host) + // ZT-RFC4193 address: fdNN:NNNN:NNNN:NNNN:NN99:93DD:DDDD:DDDD / 88 (one /128 per actual host) - // ZT-6plane address: fcXX:XXXX:XXDD:DDDD:DDDD:####:####:#### / 40 (one /80 per actual host) + // ZT-6PLANE address: fcXX:XXXX:XXDD:DDDD:DDDD:####:####:#### / 40 (one /80 per actual host) // (XX - lower 32 bits of network ID XORed with higher 32 bits) // For these to work, we must have a ZT-managed address assigned in one of the @@ -369,31 +369,27 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c if (sip->ss_family == AF_INET6) { my6 = reinterpret_cast<const uint8_t *>(reinterpret_cast<const struct sockaddr_in6 *>(&(*sip))->sin6_addr.s6_addr); const unsigned int sipNetmaskBits = Utils::ntoh((uint16_t)reinterpret_cast<const struct sockaddr_in6 *>(&(*sip))->sin6_port); - if ((sipNetmaskBits == 88)&&(my6[0] == 0xfd)&&(my6[9] == 0x99)&&(my6[10] == 0x93)) { + if ((sipNetmaskBits == 88)&&(my6[0] == 0xfd)&&(my6[9] == 0x99)&&(my6[10] == 0x93)) { // ZT-RFC4193 /88 ??? unsigned int ptr = 0; while (ptr != 11) { if (pkt6[ptr] != my6[ptr]) break; ++ptr; } - if (ptr == 11) { + if (ptr == 11) { // prefix match! v6EmbeddedAddress.setTo(pkt6 + ptr,5); break; } - } else if (sipNetmaskBits == 40) { + } else if (sipNetmaskBits == 40) { // ZT-6PLANE /40 ??? const uint32_t nwid32 = (uint32_t)((network->id() ^ (network->id() >> 32)) & 0xffffffff); - if ((my6[0] == 0xfc) && - (my6[1] == (uint8_t)((nwid32 >> 24) & 0xff)) && - (my6[2] == (uint8_t)((nwid32 >> 16) & 0xff)) && - (my6[3] == (uint8_t)((nwid32 >> 8) & 0xff)) && - (my6[4] == (uint8_t)(nwid32 & 0xff))) { + if ( (my6[0] == 0xfc) && (my6[1] == (uint8_t)((nwid32 >> 24) & 0xff)) && (my6[2] == (uint8_t)((nwid32 >> 16) & 0xff)) && (my6[3] == (uint8_t)((nwid32 >> 8) & 0xff)) && (my6[4] == (uint8_t)(nwid32 & 0xff))) { unsigned int ptr = 0; while (ptr != 5) { if (pkt6[ptr] != my6[ptr]) break; ++ptr; } - if (ptr == 5) { + if (ptr == 5) { // prefix match! v6EmbeddedAddress.setTo(pkt6 + ptr,5); break; } |