NetworkConfig.hpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. /*
  2. * ZeroTier One - Network Virtualization Everywhere
  3. * Copyright (C) 2011-2017 ZeroTier, Inc. https://www.zerotier.com/
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. * --
  19. *
  20. * You can be released from the requirements of the license by purchasing
  21. * a commercial license. Buying such a license is mandatory as soon as you
  22. * develop commercial closed-source software that incorporates or links
  23. * directly against ZeroTier software without disclosing the source code
  24. * of your own application.
  25. */
  26. #ifndef ZT_NETWORKCONFIG_HPP
  27. #define ZT_NETWORKCONFIG_HPP
  28. #include <stdint.h>
  29. #include <string.h>
  30. #include <stdlib.h>
  31. #include <vector>
  32. #include <stdexcept>
  33. #include <algorithm>
  34. #include "../include/ZeroTierOne.h"
  35. #include "Constants.hpp"
  36. #include "Buffer.hpp"
  37. #include "InetAddress.hpp"
  38. #include "MulticastGroup.hpp"
  39. #include "Address.hpp"
  40. #include "CertificateOfMembership.hpp"
  41. #include "CertificateOfOwnership.hpp"
  42. #include "Capability.hpp"
  43. #include "Tag.hpp"
  44. #include "Dictionary.hpp"
  45. #include "Identity.hpp"
  46. #include "Utils.hpp"
  47. /**
  48. * Default maximum time delta for COMs, tags, and capabilities
  49. *
  50. * The current value is two hours, providing ample time for a controller to
  51. * experience fail-over, etc.
  52. */
  53. #define ZT_NETWORKCONFIG_DEFAULT_CREDENTIAL_TIME_MAX_MAX_DELTA 7200000ULL
  54. /**
  55. * Default minimum credential TTL and maxDelta for COM timestamps
  56. *
  57. * This is just slightly over three minutes and provides three retries for
  58. * all currently online members to refresh.
  59. */
  60. #define ZT_NETWORKCONFIG_DEFAULT_CREDENTIAL_TIME_MIN_MAX_DELTA 185000ULL
  61. /**
  62. * Flag: allow passive bridging (experimental)
  63. */
  64. #define ZT_NETWORKCONFIG_FLAG_ALLOW_PASSIVE_BRIDGING 0x0000000000000001ULL
  65. /**
  66. * Flag: enable broadcast
  67. */
  68. #define ZT_NETWORKCONFIG_FLAG_ENABLE_BROADCAST 0x0000000000000002ULL
  69. /**
  70. * Flag: enable IPv6 NDP emulation for certain V6 address patterns
  71. */
  72. #define ZT_NETWORKCONFIG_FLAG_ENABLE_IPV6_NDP_EMULATION 0x0000000000000004ULL
  73. /**
  74. * Flag: result of unrecognized MATCH entries in a rules table: match if set, no-match if clear
  75. */
  76. #define ZT_NETWORKCONFIG_FLAG_RULES_RESULT_OF_UNSUPPORTED_MATCH 0x0000000000000008ULL
  77. /**
  78. * Flag: disable frame compression
  79. */
  80. #define ZT_NETWORKCONFIG_FLAG_DISABLE_COMPRESSION 0x0000000000000010ULL
  81. /**
  82. * Device is an active bridge
  83. */
  84. #define ZT_NETWORKCONFIG_SPECIALIST_TYPE_ACTIVE_BRIDGE 0x0000020000000000ULL
  85. /**
  86. * Anchors are stable devices on this network that can cache multicast info, etc.
  87. */
  88. #define ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR 0x0000040000000000ULL
  89. /**
  90. * Device can send CIRCUIT_TESTs for this network
  91. */
  92. #define ZT_NETWORKCONFIG_SPECIALIST_TYPE_CIRCUIT_TESTER 0x0000080000000000ULL
  93. namespace ZeroTier {
  94. // Dictionary capacity needed for max size network config
  95. #define ZT_NETWORKCONFIG_DICT_CAPACITY (1024 + (sizeof(ZT_VirtualNetworkRule) * ZT_MAX_NETWORK_RULES) + (sizeof(Capability) * ZT_MAX_NETWORK_CAPABILITIES) + (sizeof(Tag) * ZT_MAX_NETWORK_TAGS) + (sizeof(CertificateOfOwnership) * ZT_MAX_CERTIFICATES_OF_OWNERSHIP))
  96. // Dictionary capacity needed for max size network meta-data
  97. #define ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY 1024
  98. // Network config version
  99. #define ZT_NETWORKCONFIG_VERSION 7
  100. // Fields for meta-data sent with network config requests
  101. // Network config version
  102. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_VERSION "v"
  103. // Protocol version (see Packet.hpp)
  104. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_PROTOCOL_VERSION "pv"
  105. // Software vendor
  106. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_NODE_VENDOR "vend"
  107. // Software major version
  108. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_NODE_MAJOR_VERSION "majv"
  109. // Software minor version
  110. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_NODE_MINOR_VERSION "minv"
  111. // Software revision
  112. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_NODE_REVISION "revv"
  113. // Rules engine revision
  114. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_RULES_ENGINE_REV "revr"
  115. // Maximum number of rules per network this node can accept
  116. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_MAX_NETWORK_RULES "mr"
  117. // Maximum number of capabilities this node can accept
  118. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_MAX_NETWORK_CAPABILITIES "mc"
  119. // Maximum number of rules per capability this node can accept
  120. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_MAX_CAPABILITY_RULES "mcr"
  121. // Maximum number of tags this node can accept
  122. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_MAX_NETWORK_TAGS "mt"
  123. // Network join authorization token (if any)
  124. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_AUTH "a"
  125. // Network configuration meta-data flags
  126. #define ZT_NETWORKCONFIG_REQUEST_METADATA_KEY_FLAGS "f"
  127. // These dictionary keys are short so they don't take up much room.
  128. // By convention we use upper case for binary blobs, but it doesn't really matter.
  129. // network config version
  130. #define ZT_NETWORKCONFIG_DICT_KEY_VERSION "v"
  131. // network ID
  132. #define ZT_NETWORKCONFIG_DICT_KEY_NETWORK_ID "nwid"
  133. // integer(hex)
  134. #define ZT_NETWORKCONFIG_DICT_KEY_TIMESTAMP "ts"
  135. // integer(hex)
  136. #define ZT_NETWORKCONFIG_DICT_KEY_REVISION "r"
  137. // address of member
  138. #define ZT_NETWORKCONFIG_DICT_KEY_ISSUED_TO "id"
  139. // flags(hex)
  140. #define ZT_NETWORKCONFIG_DICT_KEY_FLAGS "f"
  141. // integer(hex)
  142. #define ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_LIMIT "ml"
  143. // network type (hex)
  144. #define ZT_NETWORKCONFIG_DICT_KEY_TYPE "t"
  145. // text
  146. #define ZT_NETWORKCONFIG_DICT_KEY_NAME "n"
  147. // network MTU
  148. #define ZT_NETWORKCONFIG_DICT_KEY_MTU "mtu"
  149. // credential time max delta in ms
  150. #define ZT_NETWORKCONFIG_DICT_KEY_CREDENTIAL_TIME_MAX_DELTA "ctmd"
  151. // binary serialized certificate of membership
  152. #define ZT_NETWORKCONFIG_DICT_KEY_COM "C"
  153. // specialists (binary array of uint64_t)
  154. #define ZT_NETWORKCONFIG_DICT_KEY_SPECIALISTS "S"
  155. // routes (binary blob)
  156. #define ZT_NETWORKCONFIG_DICT_KEY_ROUTES "RT"
  157. // static IPs (binary blob)
  158. #define ZT_NETWORKCONFIG_DICT_KEY_STATIC_IPS "I"
  159. // rules (binary blob)
  160. #define ZT_NETWORKCONFIG_DICT_KEY_RULES "R"
  161. // capabilities (binary blobs)
  162. #define ZT_NETWORKCONFIG_DICT_KEY_CAPABILITIES "CAP"
  163. // tags (binary blobs)
  164. #define ZT_NETWORKCONFIG_DICT_KEY_TAGS "TAG"
  165. // tags (binary blobs)
  166. #define ZT_NETWORKCONFIG_DICT_KEY_CERTIFICATES_OF_OWNERSHIP "COO"
  167. // curve25519 signature
  168. #define ZT_NETWORKCONFIG_DICT_KEY_SIGNATURE "C25519"
  169. // Legacy fields -- these are obsoleted but are included when older clients query
  170. // boolean (now a flag)
  171. #define ZT_NETWORKCONFIG_DICT_KEY_ALLOW_PASSIVE_BRIDGING_OLD "pb"
  172. // boolean (now a flag)
  173. #define ZT_NETWORKCONFIG_DICT_KEY_ENABLE_BROADCAST_OLD "eb"
  174. // IP/bits[,IP/bits,...]
  175. // Note that IPs that end in all zeroes are routes with no assignment in them.
  176. #define ZT_NETWORKCONFIG_DICT_KEY_IPV4_STATIC_OLD "v4s"
  177. // IP/bits[,IP/bits,...]
  178. // Note that IPs that end in all zeroes are routes with no assignment in them.
  179. #define ZT_NETWORKCONFIG_DICT_KEY_IPV6_STATIC_OLD "v6s"
  180. // 0/1
  181. #define ZT_NETWORKCONFIG_DICT_KEY_PRIVATE_OLD "p"
  182. // integer(hex)[,integer(hex),...]
  183. #define ZT_NETWORKCONFIG_DICT_KEY_ALLOWED_ETHERNET_TYPES_OLD "et"
  184. // string-serialized CertificateOfMembership
  185. #define ZT_NETWORKCONFIG_DICT_KEY_CERTIFICATE_OF_MEMBERSHIP_OLD "com"
  186. // node[,node,...]
  187. #define ZT_NETWORKCONFIG_DICT_KEY_ACTIVE_BRIDGES_OLD "ab"
  188. // node;IP/port[,node;IP/port]
  189. #define ZT_NETWORKCONFIG_DICT_KEY_RELAYS_OLD "rl"
  190. // End legacy fields
  191. /**
  192. * Network configuration received from network controller nodes
  193. *
  194. * This is a memcpy()'able structure and is safe (in a crash sense) to modify
  195. * without locks.
  196. */
  197. class NetworkConfig
  198. {
  199. public:
  200. NetworkConfig()
  201. {
  202. memset(this,0,sizeof(NetworkConfig));
  203. }
  204. NetworkConfig(const NetworkConfig &nc)
  205. {
  206. memcpy(this,&nc,sizeof(NetworkConfig));
  207. }
  208. inline NetworkConfig &operator=(const NetworkConfig &nc)
  209. {
  210. memcpy(this,&nc,sizeof(NetworkConfig));
  211. return *this;
  212. }
  213. /**
  214. * Write this network config to a dictionary for transport
  215. *
  216. * @param d Dictionary
  217. * @param includeLegacy If true, include legacy fields for old node versions
  218. * @return True if dictionary was successfully created, false if e.g. overflow
  219. */
  220. bool toDictionary(Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> &d,bool includeLegacy) const;
  221. /**
  222. * Read this network config from a dictionary
  223. *
  224. * @param d Dictionary (non-const since it might be modified during parse, should not be used after call)
  225. * @return True if dictionary was valid and network config successfully initialized
  226. */
  227. bool fromDictionary(const Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> &d);
  228. /**
  229. * @return True if passive bridging is allowed (experimental)
  230. */
  231. inline bool allowPassiveBridging() const throw() { return ((this->flags & ZT_NETWORKCONFIG_FLAG_ALLOW_PASSIVE_BRIDGING) != 0); }
  232. /**
  233. * @return True if broadcast (ff:ff:ff:ff:ff:ff) address should work on this network
  234. */
  235. inline bool enableBroadcast() const throw() { return ((this->flags & ZT_NETWORKCONFIG_FLAG_ENABLE_BROADCAST) != 0); }
  236. /**
  237. * @return True if IPv6 NDP emulation should be allowed for certain "magic" IPv6 address patterns
  238. */
  239. inline bool ndpEmulation() const throw() { return ((this->flags & ZT_NETWORKCONFIG_FLAG_ENABLE_IPV6_NDP_EMULATION) != 0); }
  240. /**
  241. * @return True if frames should not be compressed
  242. */
  243. inline bool disableCompression() const throw() { return ((this->flags & ZT_NETWORKCONFIG_FLAG_DISABLE_COMPRESSION) != 0); }
  244. /**
  245. * @return Network type is public (no access control)
  246. */
  247. inline bool isPublic() const throw() { return (this->type == ZT_NETWORK_TYPE_PUBLIC); }
  248. /**
  249. * @return Network type is private (certificate access control)
  250. */
  251. inline bool isPrivate() const throw() { return (this->type == ZT_NETWORK_TYPE_PRIVATE); }
  252. /**
  253. * @return ZeroTier addresses of devices on this network designated as active bridges
  254. */
  255. inline std::vector<Address> activeBridges() const
  256. {
  257. std::vector<Address> r;
  258. for(unsigned int i=0;i<specialistCount;++i) {
  259. if ((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_ACTIVE_BRIDGE) != 0)
  260. r.push_back(Address(specialists[i]));
  261. }
  262. return r;
  263. }
  264. /**
  265. * @return ZeroTier addresses of "anchor" devices on this network
  266. */
  267. inline std::vector<Address> anchors() const
  268. {
  269. std::vector<Address> r;
  270. for(unsigned int i=0;i<specialistCount;++i) {
  271. if ((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR) != 0)
  272. r.push_back(Address(specialists[i]));
  273. }
  274. return r;
  275. }
  276. /**
  277. * @param a Address to check
  278. * @return True if address is an anchor
  279. */
  280. inline bool isAnchor(const Address &a) const
  281. {
  282. for(unsigned int i=0;i<specialistCount;++i) {
  283. if ((a == specialists[i])&&((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR) != 0))
  284. return true;
  285. }
  286. return false;
  287. }
  288. /**
  289. * @param fromPeer Peer attempting to bridge other Ethernet peers onto network
  290. * @return True if this network allows bridging
  291. */
  292. inline bool permitsBridging(const Address &fromPeer) const
  293. {
  294. if ((flags & ZT_NETWORKCONFIG_FLAG_ALLOW_PASSIVE_BRIDGING) != 0)
  295. return true;
  296. for(unsigned int i=0;i<specialistCount;++i) {
  297. if ((fromPeer == specialists[i])&&((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_ACTIVE_BRIDGE) != 0))
  298. return true;
  299. }
  300. return false;
  301. }
  302. /**
  303. * @param byPeer Address to check
  304. * @return True if this peer is allowed to do circuit tests on this network (controller is always true)
  305. */
  306. inline bool circuitTestingAllowed(const Address &byPeer) const
  307. {
  308. if (byPeer.toInt() == ((networkId >> 24) & 0xffffffffffULL))
  309. return true;
  310. for(unsigned int i=0;i<specialistCount;++i) {
  311. if ((byPeer == specialists[i])&&((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_CIRCUIT_TESTER) != 0))
  312. return true;
  313. }
  314. return false;
  315. }
  316. /**
  317. * @return True if this network config is non-NULL
  318. */
  319. inline operator bool() const throw() { return (networkId != 0); }
  320. inline bool operator==(const NetworkConfig &nc) const { return (memcmp(this,&nc,sizeof(NetworkConfig)) == 0); }
  321. inline bool operator!=(const NetworkConfig &nc) const { return (!(*this == nc)); }
  322. /**
  323. * Add a specialist or mask flags if already present
  324. *
  325. * This masks the existing flags if the specialist is already here or adds
  326. * it otherwise.
  327. *
  328. * @param a Address of specialist
  329. * @param f Flags (OR of specialist role/type flags)
  330. * @return True if successfully masked or added
  331. */
  332. inline bool addSpecialist(const Address &a,const uint64_t f)
  333. {
  334. const uint64_t aint = a.toInt();
  335. for(unsigned int i=0;i<specialistCount;++i) {
  336. if ((specialists[i] & 0xffffffffffULL) == aint) {
  337. specialists[i] |= f;
  338. return true;
  339. }
  340. }
  341. if (specialistCount < ZT_MAX_NETWORK_SPECIALISTS) {
  342. specialists[specialistCount++] = f | aint;
  343. return true;
  344. }
  345. return false;
  346. }
  347. const Capability *capability(const uint32_t id) const
  348. {
  349. for(unsigned int i=0;i<capabilityCount;++i) {
  350. if (capabilities[i].id() == id)
  351. return &(capabilities[i]);
  352. }
  353. return (Capability *)0;
  354. }
  355. const Tag *tag(const uint32_t id) const
  356. {
  357. for(unsigned int i=0;i<tagCount;++i) {
  358. if (tags[i].id() == id)
  359. return &(tags[i]);
  360. }
  361. return (Tag *)0;
  362. }
  363. /*
  364. inline void dump() const
  365. {
  366. printf("networkId==%.16llx\n",networkId);
  367. printf("timestamp==%llu\n",timestamp);
  368. printf("credentialTimeMaxDelta==%llu\n",credentialTimeMaxDelta);
  369. printf("revision==%llu\n",revision);
  370. printf("issuedTo==%.10llx\n",issuedTo.toInt());
  371. printf("multicastLimit==%u\n",multicastLimit);
  372. printf("flags=%.8lx\n",(unsigned long)flags);
  373. printf("specialistCount==%u\n",specialistCount);
  374. for(unsigned int i=0;i<specialistCount;++i)
  375. printf(" specialists[%u]==%.16llx\n",i,specialists[i]);
  376. printf("routeCount==%u\n",routeCount);
  377. for(unsigned int i=0;i<routeCount;++i) {
  378. printf(" routes[i].target==%s\n",reinterpret_cast<const InetAddress *>(&(routes[i].target))->toString().c_str());
  379. printf(" routes[i].via==%s\n",reinterpret_cast<const InetAddress *>(&(routes[i].via))->toIpString().c_str());
  380. printf(" routes[i].flags==%.4x\n",(unsigned int)routes[i].flags);
  381. printf(" routes[i].metric==%u\n",(unsigned int)routes[i].metric);
  382. }
  383. printf("staticIpCount==%u\n",staticIpCount);
  384. for(unsigned int i=0;i<staticIpCount;++i)
  385. printf(" staticIps[i]==%s\n",staticIps[i].toString().c_str());
  386. printf("ruleCount==%u\n",ruleCount);
  387. printf("name==%s\n",name);
  388. printf("com==%s\n",com.toString().c_str());
  389. }
  390. */
  391. /**
  392. * Network ID that this configuration applies to
  393. */
  394. uint64_t networkId;
  395. /**
  396. * Controller-side time of config generation/issue
  397. */
  398. uint64_t timestamp;
  399. /**
  400. * Max difference between timestamp and tag/capability timestamp
  401. */
  402. uint64_t credentialTimeMaxDelta;
  403. /**
  404. * Controller-side revision counter for this configuration
  405. */
  406. uint64_t revision;
  407. /**
  408. * Address of device to which this config is issued
  409. */
  410. Address issuedTo;
  411. /**
  412. * Flags (64-bit)
  413. */
  414. uint64_t flags;
  415. /**
  416. * Network MTU
  417. */
  418. unsigned int mtu;
  419. /**
  420. * Maximum number of recipients per multicast (not including active bridges)
  421. */
  422. unsigned int multicastLimit;
  423. /**
  424. * Number of specialists
  425. */
  426. unsigned int specialistCount;
  427. /**
  428. * Number of routes
  429. */
  430. unsigned int routeCount;
  431. /**
  432. * Number of ZT-managed static IP assignments
  433. */
  434. unsigned int staticIpCount;
  435. /**
  436. * Number of rule table entries
  437. */
  438. unsigned int ruleCount;
  439. /**
  440. * Number of capabilities
  441. */
  442. unsigned int capabilityCount;
  443. /**
  444. * Number of tags
  445. */
  446. unsigned int tagCount;
  447. /**
  448. * Number of certificates of ownership
  449. */
  450. unsigned int certificateOfOwnershipCount;
  451. /**
  452. * Specialist devices
  453. *
  454. * For each entry the least significant 40 bits are the device's ZeroTier
  455. * address and the most significant 24 bits are flags indicating its role.
  456. */
  457. uint64_t specialists[ZT_MAX_NETWORK_SPECIALISTS];
  458. /**
  459. * Statically defined "pushed" routes (including default gateways)
  460. */
  461. ZT_VirtualNetworkRoute routes[ZT_MAX_NETWORK_ROUTES];
  462. /**
  463. * Static IP assignments
  464. */
  465. InetAddress staticIps[ZT_MAX_ZT_ASSIGNED_ADDRESSES];
  466. /**
  467. * Base network rules
  468. */
  469. ZT_VirtualNetworkRule rules[ZT_MAX_NETWORK_RULES];
  470. /**
  471. * Capabilities for this node on this network, in ascending order of capability ID
  472. */
  473. Capability capabilities[ZT_MAX_NETWORK_CAPABILITIES];
  474. /**
  475. * Tags for this node on this network, in ascending order of tag ID
  476. */
  477. Tag tags[ZT_MAX_NETWORK_TAGS];
  478. /**
  479. * Certificates of ownership for this network member
  480. */
  481. CertificateOfOwnership certificatesOfOwnership[ZT_MAX_CERTIFICATES_OF_OWNERSHIP];
  482. /**
  483. * Network type (currently just public or private)
  484. */
  485. ZT_VirtualNetworkType type;
  486. /**
  487. * Network short name or empty string if not defined
  488. */
  489. char name[ZT_MAX_NETWORK_SHORT_NAME_LENGTH + 1];
  490. /**
  491. * Certficiate of membership (for private networks)
  492. */
  493. CertificateOfMembership com;
  494. };
  495. } // namespace ZeroTier
  496. #endif