kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "rtc_base/asyncpacketsocket.h" |
Sebastian Jansson | e8038e9 | 2018-10-11 16:43:58 +0200 | [diff] [blame] | 12 | #include "rtc_base/nethelper.h" |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 13 | |
| 14 | namespace rtc { |
| 15 | |
Qingsi Wang | 6e641e6 | 2018-04-11 20:14:17 -0700 | [diff] [blame] | 16 | PacketTimeUpdateParams::PacketTimeUpdateParams() = default; |
| 17 | |
| 18 | PacketTimeUpdateParams::PacketTimeUpdateParams( |
| 19 | const PacketTimeUpdateParams& other) = default; |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 20 | |
| 21 | PacketTimeUpdateParams::~PacketTimeUpdateParams() = default; |
| 22 | |
Qingsi Wang | 6e641e6 | 2018-04-11 20:14:17 -0700 | [diff] [blame] | 23 | PacketOptions::PacketOptions() = default; |
| 24 | PacketOptions::PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {} |
| 25 | PacketOptions::PacketOptions(const PacketOptions& other) = default; |
| 26 | PacketOptions::~PacketOptions() = default; |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 27 | |
Qingsi Wang | 6e641e6 | 2018-04-11 20:14:17 -0700 | [diff] [blame] | 28 | AsyncPacketSocket::AsyncPacketSocket() = default; |
| 29 | |
| 30 | AsyncPacketSocket::~AsyncPacketSocket() = default; |
| 31 | |
| 32 | void CopySocketInformationToPacketInfo(size_t packet_size_bytes, |
| 33 | const AsyncPacketSocket& socket_from, |
Qingsi Wang | 4ea53b3 | 2018-04-16 18:22:31 -0700 | [diff] [blame] | 34 | bool is_connectionless, |
Qingsi Wang | 6e641e6 | 2018-04-11 20:14:17 -0700 | [diff] [blame] | 35 | rtc::PacketInfo* info) { |
| 36 | info->packet_size_bytes = packet_size_bytes; |
Sebastian Jansson | e8038e9 | 2018-10-11 16:43:58 +0200 | [diff] [blame] | 37 | // TODO(srte): Make sure that the family of the local socket is always set |
| 38 | // in the VirtualSocket implementation and remove this check. |
| 39 | int family = socket_from.GetLocalAddress().family(); |
| 40 | if (family != 0) { |
| 41 | info->ip_overhead_bytes = cricket::GetIpOverhead(family); |
| 42 | } |
kwiberg@webrtc.org | 67186fe | 2015-03-09 22:21:53 +0000 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | }; // namespace rtc |