blob: a42725c424fa863ca4834258c4bb9dc4b286f513 [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"
Jonas Olssona4d87372019-07-05 19:08:33 +020012
Steve Anton10542f22019-01-11 09:11:00 -080013#include "rtc_base/net_helper.h"
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000014
15namespace rtc {
16
Qingsi Wang6e641e62018-04-11 20:14:17 -070017PacketTimeUpdateParams::PacketTimeUpdateParams() = default;
18
19PacketTimeUpdateParams::PacketTimeUpdateParams(
20 const PacketTimeUpdateParams& other) = default;
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000021
22PacketTimeUpdateParams::~PacketTimeUpdateParams() = default;
23
Qingsi Wang6e641e62018-04-11 20:14:17 -070024PacketOptions::PacketOptions() = default;
25PacketOptions::PacketOptions(DiffServCodePoint dscp) : dscp(dscp) {}
26PacketOptions::PacketOptions(const PacketOptions& other) = default;
27PacketOptions::~PacketOptions() = default;
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000028
Qingsi Wang6e641e62018-04-11 20:14:17 -070029AsyncPacketSocket::AsyncPacketSocket() = default;
30
31AsyncPacketSocket::~AsyncPacketSocket() = default;
32
33void CopySocketInformationToPacketInfo(size_t packet_size_bytes,
34 const AsyncPacketSocket& socket_from,
Qingsi Wang4ea53b32018-04-16 18:22:31 -070035 bool is_connectionless,
Qingsi Wang6e641e62018-04-11 20:14:17 -070036 rtc::PacketInfo* info) {
37 info->packet_size_bytes = packet_size_bytes;
Sebastian Janssone8038e92018-10-11 16:43:58 +020038 // TODO(srte): Make sure that the family of the local socket is always set
39 // in the VirtualSocket implementation and remove this check.
40 int family = socket_from.GetLocalAddress().family();
41 if (family != 0) {
42 info->ip_overhead_bytes = cricket::GetIpOverhead(family);
43 }
kwiberg@webrtc.org67186fe2015-03-09 22:21:53 +000044}
45
Nico Weber22f99252019-02-20 10:13:16 -050046} // namespace rtc