#if defined(__APPLE__) && !defined(__APPLE_USE_RFC_3542)
#define __APPLE_USE_RFC_3542
#endif
#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"
namespace quic {
namespace {
#if defined(_WIN32)
using PlatformCmsghdr = ::WSACMSGHDR;
#if !defined(CMSG_DATA)
#define CMSG_DATA …
#endif
#else
PlatformCmsghdr;
#endif
void PopulatePacketInfoFromControlMessageBase(
PlatformCmsghdr* cmsg, QuicUdpPacketInfo* packet_info,
QuicUdpPacketInfoBitMask packet_info_interested) { … }
}
}
#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) { … }
}