Path.cpp 613 B

12345678910111213141516171819202122232425
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  4. *
  5. * (c) ZeroTier, Inc.
  6. * https://www.zerotier.com/
  7. */
  8. #include "Path.hpp"
  9. #include "Node.hpp"
  10. #include "RuntimeEnvironment.hpp"
  11. namespace ZeroTier {
  12. bool Path::send(const RuntimeEnvironment* RR, void* tPtr, const void* data, unsigned int len, int64_t now)
  13. {
  14. if (RR->node->putPacket(tPtr, _localSocket, _addr, data, len)) {
  15. _lastOut = now;
  16. return true;
  17. }
  18. return false;
  19. }
  20. } // namespace ZeroTier