diff options
author | comex <comexk@gmail.com> | 2023-06-20 03:17:43 +0200 |
---|---|---|
committer | comex <comexk@gmail.com> | 2023-06-25 21:53:31 +0200 |
commit | 8e703e08dfcf735a08df2ceff6a05221b7cc981f (patch) | |
tree | 771ebe71883ff9e179156f2b38b21b05070d7667 /src/core/internal_network/network.h | |
parent | Merge pull request #10825 from 8bitDream/vcpkg-zlib (diff) | |
download | yuzu-8e703e08dfcf735a08df2ceff6a05221b7cc981f.tar yuzu-8e703e08dfcf735a08df2ceff6a05221b7cc981f.tar.gz yuzu-8e703e08dfcf735a08df2ceff6a05221b7cc981f.tar.bz2 yuzu-8e703e08dfcf735a08df2ceff6a05221b7cc981f.tar.lz yuzu-8e703e08dfcf735a08df2ceff6a05221b7cc981f.tar.xz yuzu-8e703e08dfcf735a08df2ceff6a05221b7cc981f.tar.zst yuzu-8e703e08dfcf735a08df2ceff6a05221b7cc981f.zip |
Diffstat (limited to 'src/core/internal_network/network.h')
-rw-r--r-- | src/core/internal_network/network.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/core/internal_network/network.h b/src/core/internal_network/network.h index 1e09a007a..96319bfc8 100644 --- a/src/core/internal_network/network.h +++ b/src/core/internal_network/network.h @@ -16,6 +16,11 @@ #include <netinet/in.h> #endif +namespace Common { +template <typename T, typename E> +class Expected; +} + namespace Network { class SocketBase; @@ -36,6 +41,26 @@ enum class Errno { NETUNREACH, TIMEDOUT, MSGSIZE, + INPROGRESS, + OTHER, +}; + +enum class GetAddrInfoError { + SUCCESS, + ADDRFAMILY, + AGAIN, + BADFLAGS, + FAIL, + FAMILY, + MEMORY, + NODATA, + NONAME, + SERVICE, + SOCKTYPE, + SYSTEM, + BADHINTS, + PROTOCOL, + OVERFLOW_, OTHER, }; @@ -49,6 +74,9 @@ enum class PollEvents : u16 { Err = 1 << 3, Hup = 1 << 4, Nval = 1 << 5, + RdNorm = 1 << 6, + RdBand = 1 << 7, + WrBand = 1 << 8, }; DECLARE_ENUM_FLAG_OPERATORS(PollEvents); @@ -82,4 +110,10 @@ constexpr IPv4Address TranslateIPv4(in_addr addr) { /// @return human ordered IPv4 address (e.g. 192.168.0.1) as an array std::optional<IPv4Address> GetHostIPv4Address(); +std::string IPv4AddressToString(IPv4Address ip_addr); +u32 IPv4AddressToInteger(IPv4Address ip_addr); + +Common::Expected<std::vector<AddrInfo>, GetAddrInfoError> GetAddrInfo( + const std::string& host, const std::optional<std::string>& service); + } // namespace Network |