Path.cpp 805 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. #include "Path.hpp"
  14. #include "RuntimeEnvironment.hpp"
  15. #include "Node.hpp"
  16. namespace ZeroTier {
  17. bool Path::send(const RuntimeEnvironment *const RR, void *const tPtr, const void *const data, const unsigned int len, const int64_t now) noexcept
  18. {
  19. if (likely(RR->node->putPacket(tPtr, m_localSocket, m_addr, data, len))) {
  20. m_lastOut = now;
  21. m_outMeter.log(now, len);
  22. return true;
  23. }
  24. return false;
  25. }
  26. } // namespace ZeroTier