chromium/net/third_party/quiche/src/quiche/quic/core/quic_udp_socket.cc

// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#if defined(__APPLE__) && !defined(__APPLE_USE_RFC_3542)
// This must be defined before including any system headers.
#define __APPLE_USE_RFC_3542
#endif  // defined(__APPLE__) && !defined(__APPLE_USE_RFC_3542)

#include "quiche/quic/core/quic_udp_socket.h"

#include <string>

#include "absl/base/optimization.h"
#include "quiche/quic/core/io/socket.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_flag_utils.h"

// Common cmsg-related functions are defined below.
// Windows and POSIX cmsg formats are actually fairly similar, except the
// Windows ones have all of the macros prefixed with WSA_ and all the type names
// are different.

namespace quic {
namespace {

#if defined(_WIN32)
using PlatformCmsghdr = ::WSACMSGHDR;
#if !defined(CMSG_DATA)
#define CMSG_DATA
#endif  // !defined(CMSG_DATA)
#else
PlatformCmsghdr;
#endif  // defined(_WIN32)

void PopulatePacketInfoFromControlMessageBase(
    PlatformCmsghdr* cmsg, QuicUdpPacketInfo* packet_info,
    QuicUdpPacketInfoBitMask packet_info_interested) {}

}  // namespace
}  // namespace quic

#if defined(_WIN32)
#include "quiche/quic/core/quic_udp_socket_win.inc"
#else
#include "quiche/quic/core/quic_udp_socket_posix.inc"
#endif

namespace quic {

QuicUdpSocketFd QuicUdpSocketApi::Create(int address_family,
                                         int receive_buffer_size,
                                         int send_buffer_size, bool ipv6_only) {}

void QuicUdpSocketApi::Destroy(QuicUdpSocketFd fd) {}

bool QuicUdpSocketApi::Bind(QuicUdpSocketFd fd, QuicSocketAddress address) {}

bool QuicUdpSocketApi::BindInterface(QuicUdpSocketFd fd,
                                     const std::string& interface_name) {}

bool QuicUdpSocketApi::EnableDroppedPacketCount(QuicUdpSocketFd fd) {}

bool QuicUdpSocketApi::EnableReceiveSelfIpAddressForV4(QuicUdpSocketFd fd) {}

bool QuicUdpSocketApi::EnableReceiveSelfIpAddressForV6(QuicUdpSocketFd fd) {}

bool QuicUdpSocketApi::EnableReceiveTimestamp(QuicUdpSocketFd fd) {}

bool QuicUdpSocketApi::EnableReceiveTtlForV4(QuicUdpSocketFd fd) {}

bool QuicUdpSocketApi::EnableReceiveTtlForV6(QuicUdpSocketFd fd) {}

}  // namespace quic