diff options
author | FearlessTobi <thm.frey@gmail.com> | 2022-07-31 04:46:26 +0200 |
---|---|---|
committer | FearlessTobi <thm.frey@gmail.com> | 2022-09-09 14:30:22 +0200 |
commit | f5e635addaef59159bf6bc529b17954eda3684a1 (patch) | |
tree | 6d6b518611b377b6bd79e3156eb16f60f5045698 /src/core/hle/service/ldn/ldn_types.h | |
parent | Merge pull request #8819 from liamwhite/cash-money (diff) | |
download | yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.gz yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.bz2 yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.lz yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.xz yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.tar.zst yuzu-f5e635addaef59159bf6bc529b17954eda3684a1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/ldn/ldn_types.h | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/src/core/hle/service/ldn/ldn_types.h b/src/core/hle/service/ldn/ldn_types.h index 6231e936d..d6609fff5 100644 --- a/src/core/hle/service/ldn/ldn_types.h +++ b/src/core/hle/service/ldn/ldn_types.h @@ -31,6 +31,14 @@ enum class NodeStateChange : u8 { DisconnectAndConnect, }; +inline NodeStateChange operator|(NodeStateChange a, NodeStateChange b) { + return static_cast<NodeStateChange>(static_cast<u8>(a) | static_cast<u8>(b)); +} + +inline NodeStateChange operator|=(NodeStateChange& a, NodeStateChange b) { + return a = a | b; +} + enum class ScanFilterFlag : u32 { None = 0, LocalCommunicationId = 1 << 0, @@ -100,13 +108,13 @@ enum class AcceptPolicy : u8 { enum class WifiChannel : s16 { Default = 0, - wifi24_1 = 1, - wifi24_6 = 6, - wifi24_11 = 11, - wifi50_36 = 36, - wifi50_40 = 40, - wifi50_44 = 44, - wifi50_48 = 48, + Wifi24_1 = 1, + Wifi24_6 = 6, + Wifi24_11 = 11, + Wifi50_36 = 36, + Wifi50_40 = 40, + Wifi50_44 = 44, + Wifi50_48 = 48, }; enum class LinkLevel : s8 { @@ -116,6 +124,11 @@ enum class LinkLevel : s8 { Excellent, }; +enum class NodeStatus : u8 { + Disconnected, + Connected, +}; + struct NodeLatestUpdate { NodeStateChange state_change; INSERT_PADDING_BYTES(0x7); // Unknown @@ -159,19 +172,14 @@ struct Ssid { std::string GetStringValue() const { return std::string(raw.data()); } -}; -static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size"); - -struct Ipv4Address { - union { - u32 raw{}; - std::array<u8, 4> bytes; - }; - std::string GetStringValue() const { - return fmt::format("{}.{}.{}.{}", bytes[3], bytes[2], bytes[1], bytes[0]); + bool operator==(const Ssid& b) const { + return (length == b.length) && (std::memcmp(raw.data(), b.raw.data(), length) == 0); } }; +static_assert(sizeof(Ssid) == 0x22, "Ssid is an invalid size"); + +using Ipv4Address = std::array<u8, 4>; static_assert(sizeof(Ipv4Address) == 0x4, "Ipv4Address is an invalid size"); struct MacAddress { @@ -181,6 +189,14 @@ struct MacAddress { }; static_assert(sizeof(MacAddress) == 0x6, "MacAddress is an invalid size"); +struct MACAddressHash { + size_t operator()(const MacAddress& address) const { + u64 value{}; + std::memcpy(&value, address.raw.data(), sizeof(address.raw)); + return value; + } +}; + struct ScanFilter { NetworkId network_id; NetworkType network_type; |