blob: a708faecea0d2fe6b71981b4225ac6fa6d85bfad [file] [log] [blame]
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +00001/*
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
Steve Anton10542f22019-01-11 09:11:00 -080011#include "rtc_base/async_packet_socket.h"
12#include "rtc_base/net_helper.h"
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000013
14namespace rtc {
15
Qingsi Wang6e641e62018-04-11 20:14:17 -070016PacketTimeUpdateParams::PacketTimeUpdateParams() = default;
17
18PacketTimeUpdateParams::PacketTimeUpdateParams(
19 const PacketTimeUpdateParams& other) = default;
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000020
21PacketTimeUpdateParams::~PacketTimeUpdateParams() = default;
22
Qingsi Wang6e641e62018-04-11 20:14:17 -070023PacketOptions::PacketOptions() = default;
24PacketOptions::PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {}
25PacketOptions::PacketOptions(const PacketOptions& other) = default;
26PacketOptions::~PacketOptions() = default;
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000027
Qingsi Wang6e641e62018-04-11 20:14:17 -070028AsyncPacketSocket::AsyncPacketSocket() = default;
29
30AsyncPacketSocket::~AsyncPacketSocket() = default;
31
32void CopySocketInformationToPacketInfo(size_t packet_size_bytes,
33 const AsyncPacketSocket& socket_from,
Qingsi Wang4ea53b32018-04-16 18:22:31 -070034 bool is_connectionless,
Qingsi Wang6e641e62018-04-11 20:14:17 -070035 rtc::PacketInfo* info) {
36 info->packet_size_bytes = packet_size_bytes;
Sebastian Janssone8038e92018-10-11 16:43:58 +020037 // 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.org67186fe2015-03-09 22:21:53 +000043}
44
Nico Weber22f99252019-02-20 10:13:16 -050045} // namespace rtc