path.go 808 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (C)2013-2020 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: 2025-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. // #include "../../serviceiocore/GoGlue.h"
  15. import "C"
  16. // Path is a path to another peer on the network
  17. type Path struct {
  18. Endpoint Endpoint `json:"endpoint"`
  19. LastSend int64 `json:"lastSend"`
  20. LastReceive int64 `json:"lastReceive"`
  21. }
  22. func (p *Path) setFromCPath(cp *C.ZT_Path) {
  23. p.Endpoint.setFromCEndpoint(&(cp.endpoint))
  24. p.LastSend = int64(cp.lastSend)
  25. p.LastReceive = int64(cp.lastReceive)
  26. }