NetworkConfig.hpp 17 KB

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