You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Copyright 2015 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #include "rtc_base/async_packet_socket.h"
  11. #include "rtc_base/net_helper.h"
  12. namespace rtc {
  13. PacketTimeUpdateParams::PacketTimeUpdateParams() = default;
  14. PacketTimeUpdateParams::PacketTimeUpdateParams(
  15. const PacketTimeUpdateParams& other) = default;
  16. PacketTimeUpdateParams::~PacketTimeUpdateParams() = default;
  17. PacketOptions::PacketOptions() = default;
  18. PacketOptions::PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {}
  19. PacketOptions::PacketOptions(const PacketOptions& other) = default;
  20. PacketOptions::~PacketOptions() = default;
  21. AsyncPacketSocket::AsyncPacketSocket() = default;
  22. AsyncPacketSocket::~AsyncPacketSocket() = default;
  23. void CopySocketInformationToPacketInfo(size_t packet_size_bytes,
  24. const AsyncPacketSocket& socket_from,
  25. bool is_connectionless,
  26. rtc::PacketInfo* info) {
  27. info->packet_size_bytes = packet_size_bytes;
  28. // TODO(srte): Make sure that the family of the local socket is always set
  29. // in the VirtualSocket implementation and remove this check.
  30. int family = socket_from.GetLocalAddress().family();
  31. if (family != 0) {
  32. info->ip_overhead_bytes = cricket::GetIpOverhead(family);
  33. }
  34. }
  35. } // namespace rtc