/*
* Copyright (c) 2018-2020 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#pragma once
#include
#include "htcs_manager_service_object.hpp"
namespace ams::htcs::server {
class SocketServiceObject {
private:
sf::SharedPointer m_manager;
s32 m_desc;
public:
SocketServiceObject(ManagerServiceObject *manager, s32 desc);
~SocketServiceObject();
public:
Result Close(sf::Out out_err, sf::Out out_res);
Result Connect(sf::Out out_err, sf::Out out_res, const htcs::SockAddrHtcs &address);
Result Bind(sf::Out out_err, sf::Out out_res, const htcs::SockAddrHtcs &address);
Result Listen(sf::Out out_err, sf::Out out_res, s32 backlog_count);
Result Accept(sf::Out out_err, sf::Out> out, sf::Out out_address);
Result Recv(sf::Out out_err, sf::Out out_size, const sf::OutAutoSelectBuffer &buffer, s32 flags);
Result Send(sf::Out out_err, sf::Out out_size, const sf::InAutoSelectBuffer &buffer, s32 flags);
Result Shutdown(sf::Out out_err, sf::Out out_res, s32 how);
Result Fcntl(sf::Out out_err, sf::Out out_res, s32 command, s32 value);
Result AcceptStart(sf::Out out_task_id, sf::OutCopyHandle out_event);
Result AcceptResults(sf::Out out_err, sf::Out> out, sf::Out out_address, u32 task_id);
Result RecvStart(sf::Out out_task_id, sf::OutCopyHandle out_event, s32 mem_size, s32 flags);
Result RecvResults(sf::Out out_err, sf::Out out_size, const sf::OutAutoSelectBuffer &buffer, u32 task_id);
Result RecvLargeStart(sf::Out out_task_id, sf::OutCopyHandle out_event, s32 unaligned_size_start, s32 unaligned_size_end, s64 aligned_size, sf::CopyHandle mem_handle, s32 flags);
Result SendStartOld(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &buffer, s32 flags);
Result SendLargeStart(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InAutoSelectBuffer &start_buffer, const sf::InAutoSelectBuffer &end_buffer, sf::CopyHandle mem_handle, s64 aligned_size, s32 flags);
Result SendResults(sf::Out out_err, sf::Out out_size, u32 task_id);
Result StartSend(sf::Out out_task_id, sf::OutCopyHandle out_event, sf::Out out_max_size, s64 size, s32 flags);
Result ContinueSendOld(sf::Out out_size, sf::Out out_wait, const sf::InAutoSelectBuffer &buffer, u32 task_id);
Result EndSend(sf::Out out_err, sf::Out out_size, u32 task_id);
Result StartRecv(sf::Out out_task_id, sf::OutCopyHandle out_event, s64 size, s32 flags);
Result EndRecv(sf::Out out_err, sf::Out out_size, const sf::OutAutoSelectBuffer &buffer, u32 task_id);
Result SendStart(sf::Out out_task_id, sf::OutCopyHandle out_event, const sf::InNonSecureAutoSelectBuffer &buffer, s32 flags);
Result ContinueSend(sf::Out out_size, sf::Out out_wait, const sf::InNonSecureAutoSelectBuffer &buffer, u32 task_id);
Result GetPrimitive(sf::Out out);
};
static_assert(tma::IsISocket);
}