root.go 836 B

123456789101112131415161718192021222324252627282930
  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. package zerotier
  14. // Root describes a root server used to find and establish communication with other nodes.
  15. type Root struct {
  16. DNSName string
  17. Identity *Identity
  18. Addresses []InetAddress
  19. Locator []byte
  20. Preferred bool
  21. Online bool
  22. }
  23. // Static returns true if this is a static root
  24. func (r *Root) Static() bool { return len(r.DNSName) == 0 }
  25. // Dynamic returns true if this is a dynamic root
  26. func (r *Root) Dynamic() bool { return len(r.DNSName) > 0 }