Files
citron/src/core/hle/service/sockets/sfdnsres.h
Zephyron dc51851b67 feat(HLE): Implement sfdnsres service functions and align with docs
Adds implementations for missing `sfdnsres` (nn::socket::resolver::IResolver) service functions and corrects command ID mappings to align with Switchbrew documentation.

Key changes:
- Implemented stubs for the following `sfdnsres` functions:
    - `SetDnsAddresses` (Cmd 0)
    - `GetDnsAddressList` (Cmd 1)
    - `GetHostByAddrRequest` (Cmd 4, deprecated)
    - `GetHostStringError` (Cmd 5)
    - `CancelRequest` (Cmd 7)
    - `GetOptions` (Cmd 9)
    - `GetAddrInfoRequestRaw` (Cmd 11)
- Updated the command registration table in the `SFDNSRES` constructor to use correct Switchbrew command IDs and map them to the appropriate existing or new (stubbed) implementations.
- Retained and stubbed `GetNameInfoRequest` and `GetNameInfoRequestWithOptions` with placeholder IDs, as they were present in the previous command table.
- Corrected usage of `GetAddrInfoError` constants in stubs to use valid members (e.g., `GetAddrInfoError::AGAIN` instead of a non-standard `INTERNAL`).

This significantly expands the implemented interface for the `sfdnsres` service, bringing it closer to the documented functionality and resolving related compilation errors.

Signed-off-by: Zephyron <zephyron@citron-emu.org>
2025-05-16 18:21:01 +10:00

39 lines
1.3 KiB
C++

// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "core/hle/service/service.h"
namespace Core {
class System;
}
namespace Service::Sockets {
class SFDNSRES final : public ServiceFramework<SFDNSRES> {
public:
explicit SFDNSRES(Core::System& system_);
~SFDNSRES() override;
private:
void GetHostByNameRequest(HLERequestContext& ctx);
void GetGaiStringErrorRequest(HLERequestContext& ctx);
void GetHostByNameRequestWithOptions(HLERequestContext& ctx);
void GetAddrInfoRequest(HLERequestContext& ctx);
void GetAddrInfoRequestWithOptions(HLERequestContext& ctx);
void ResolverSetOptionRequest(HLERequestContext& ctx);
void SetDnsAddresses(HLERequestContext& ctx);
void GetDnsAddressList(HLERequestContext& ctx);
void GetHostByAddrRequest(HLERequestContext& ctx);
void GetHostStringError(HLERequestContext& ctx);
void CancelRequest(HLERequestContext& ctx);
void GetOptions(HLERequestContext& ctx);
void GetAddrInfoRequestRaw(HLERequestContext& ctx);
void GetNameInfoRequest(HLERequestContext& ctx);
void GetNameInfoRequestWithOptions(HLERequestContext& ctx);
};
} // namespace Service::Sockets