From f80c7c4cd5c090b9a31f89a0eb3d86cbe928c50b Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Sat, 30 Jul 2022 05:58:23 +0200 Subject: core, network: Add ability to proxy socket packets --- src/common/socket_types.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/common/socket_types.h (limited to 'src/common/socket_types.h') diff --git a/src/common/socket_types.h b/src/common/socket_types.h new file mode 100644 index 000000000..5bb309a44 --- /dev/null +++ b/src/common/socket_types.h @@ -0,0 +1,52 @@ +// Copyright 2022 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" + +namespace Network { + +/// Address families +enum class Domain : u8 { + INET, ///< Address family for IPv4 +}; + +/// Socket types +enum class Type { + STREAM, + DGRAM, + RAW, + SEQPACKET, +}; + +/// Protocol values for sockets +enum class Protocol : u8 { + ICMP, + TCP, + UDP, +}; + +/// Shutdown mode +enum class ShutdownHow { + RD, + WR, + RDWR, +}; + +/// Array of IPv4 address +using IPv4Address = std::array; + +/// Cross-platform sockaddr structure +struct SockAddrIn { + Domain family; + IPv4Address ip; + u16 portno; +}; + +constexpr u32 FLAG_MSG_PEEK = 0x2; +constexpr u32 FLAG_MSG_DONTWAIT = 0x80; +constexpr u32 FLAG_O_NONBLOCK = 0x800; + +} // namespace Network -- cgit v1.2.3 From bb84f5353927e473f39fc5fac741a623b48a1ef1 Mon Sep 17 00:00:00 2001 From: FearlessTobi Date: Sat, 30 Jul 2022 20:16:47 +0200 Subject: Make copyright headers SPDX-compliant --- src/common/socket_types.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/common/socket_types.h') diff --git a/src/common/socket_types.h b/src/common/socket_types.h index 5bb309a44..0a801a443 100644 --- a/src/common/socket_types.h +++ b/src/common/socket_types.h @@ -1,6 +1,5 @@ -// Copyright 2022 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later #pragma once -- cgit v1.2.3