diff options
| author | FearlessTobi <thm.frey@gmail.com> | 2022-07-30 05:58:23 +0200 |
|---|---|---|
| committer | FearlessTobi <thm.frey@gmail.com> | 2022-08-15 20:25:42 +0200 |
| commit | f80c7c4cd5c090b9a31f89a0eb3d86cbe928c50b (patch) | |
| tree | ad359908ba2d3cd003082b39cc7217b61e5b18f6 /src/common/socket_types.h | |
| parent | 035ca99b023ee776bc13c79f96a5c6b1bc049739 (diff) | |
core, network: Add ability to proxy socket packets
Diffstat (limited to 'src/common/socket_types.h')
| -rw-r--r-- | src/common/socket_types.h | 52 |
1 files changed, 52 insertions, 0 deletions
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<u8, 4>; + +/// 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 |
