mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-01 18:40:57 -06:00
Merge 4da1b3a4a9 into a87abee8e3
This commit is contained in:
commit
687100276d
@ -158,4 +158,4 @@ void InitHLELibs(Core::Loader::SymbolsResolver* sym) {
|
||||
// Libraries::Ssl::RegisterLib(sym);
|
||||
}
|
||||
|
||||
} // namespace Libraries
|
||||
} // namespace Libraries
|
||||
@ -6,6 +6,7 @@
|
||||
#include "core/libraries/error_codes.h"
|
||||
|
||||
// For error codes shared between multiple Np libraries.
|
||||
constexpr int ORBIS_NP_ERROR_NOT_INITIALIZED = 0x80550002;
|
||||
constexpr int ORBIS_NP_ERROR_INVALID_ARGUMENT = 0x80550003;
|
||||
constexpr int ORBIS_NP_ERROR_SIGNED_OUT = 0x80550006;
|
||||
constexpr int ORBIS_NP_ERROR_USER_NOT_FOUND = 0x80550007;
|
||||
|
||||
@ -711,6 +711,9 @@ struct NpStateCallback {
|
||||
NpStateCallback NpStateCb;
|
||||
|
||||
s32 PS4_SYSV_ABI sceNpCheckCallback() {
|
||||
if (!g_signed_in) {
|
||||
return ORBIS_NP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
LOG_DEBUG(Lib_NpManager, "(STUBBED) called");
|
||||
|
||||
std::scoped_lock lk{g_np_callbacks_mutex};
|
||||
|
||||
@ -1,39 +1,64 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <atomic>
|
||||
#include <cstring>
|
||||
#include <mutex>
|
||||
#include "common/logging/log.h"
|
||||
#include "core/libraries/error_codes.h"
|
||||
#include "core/libraries/libs.h"
|
||||
#include "core/libraries/network/net.h"
|
||||
#include "core/libraries/rudp/rudp.h"
|
||||
#include "core/libraries/rudp/rudp_error.h"
|
||||
|
||||
namespace Libraries::Rudp {
|
||||
|
||||
static OrbisRudpStatus g_rudpStatusInternal = {0};
|
||||
|
||||
void* g_RudpContext = nullptr;
|
||||
|
||||
struct RudpInternalState {
|
||||
std::atomic<s32> current_contexts{0};
|
||||
std::atomic<s32> allocs{0};
|
||||
std::atomic<s32> frees{0};
|
||||
std::atomic<s32> rcvdQualityLevel4Packets{0};
|
||||
std::atomic<s32> sentQualityLevel4Packets{0};
|
||||
};
|
||||
|
||||
static RudpInternalState g_state;
|
||||
|
||||
std::recursive_mutex g_RudpMutex;
|
||||
bool g_isRudpInitialized = false;
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpAccept() {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpActivate() {
|
||||
s32 PS4_SYSV_ABI sceRudpActivate(int context_id, Net::OrbisNetSockaddr* to,
|
||||
OrbisNetSocklen_t toLen) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpBind() {
|
||||
s32 PS4_SYSV_ABI sceRudpBind(int context_id, int soc, u16 virtualPort, u8 muxMode) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpCreateContext() {
|
||||
s32 PS4_SYSV_ABI sceRudpCreateContext(OrbisRudpContextEventHandler handler, void* arg,
|
||||
int* context_id) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread() {
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread(u32 stackSize, u32 priority) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread2() {
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread2(u32 stackSize, u32 priority,
|
||||
OrbisKernelCpumask affinityMask) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
@ -43,62 +68,102 @@ s32 PS4_SYSV_ABI sceRudpEnd() {
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpFlush() {
|
||||
s32 PS4_SYSV_ABI sceRudpFlush(int context_id) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetContextStatus() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetContextStatus(int context_id, OrbisRudpContextStatus* status,
|
||||
size_t statusSize) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetLocalInfo() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetLocalInfo(int context_id, int* soc, Net::OrbisNetSockaddr* addr,
|
||||
u32* addrlen, u16* virtualPort, u8* muxMode) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetMaxSegmentSize() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetMaxSegmentSize(u16* mss) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetNumberOfPacketsToRead() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetNumberOfPacketsToRead(int context_id) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetOption() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetOption(int context_id, Option option, void* optVal, size_t optLen) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetRemoteInfo() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetRemoteInfo(int context_id, Net::OrbisNetSockaddr* addr, u32* addrlen,
|
||||
u16* virtualPort) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeReadable() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeReadable(int context_id) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeWritable() {
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeWritable(int context_id) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetStatus() {
|
||||
u32 RudpGetContextCount(uintptr_t globalContextListPtr) {
|
||||
if (globalContextListPtr == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32* countPtr = reinterpret_cast<u32*>(globalContextListPtr + 8);
|
||||
return *countPtr;
|
||||
}
|
||||
|
||||
void RudpFillStatusCounters(s32* sentQualityLevel4Packets, s32* rcvdQualityLevel4Packets, s32* allocs,
|
||||
s32* frees) {
|
||||
if (sentQualityLevel4Packets)
|
||||
*sentQualityLevel4Packets = g_state.sentQualityLevel4Packets.load();
|
||||
if (rcvdQualityLevel4Packets)
|
||||
*rcvdQualityLevel4Packets = g_state.rcvdQualityLevel4Packets.load();
|
||||
if (allocs)
|
||||
*allocs = g_state.allocs.load();
|
||||
if (frees)
|
||||
*frees = g_state.frees.load();
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpGetStatus(OrbisRudpStatus* status, size_t statusSize) {
|
||||
std::lock_guard lock(g_RudpMutex);
|
||||
|
||||
if (!g_isRudpInitialized) {
|
||||
return ORBIS_RUDP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
int result = ORBIS_RUDP_ERROR_INVALID_ARGUMENT;
|
||||
if ((status != (OrbisRudpStatus *)0) && (statusSize - 1 < 0xf8)) {
|
||||
std::memcpy(status, &g_rudpStatusInternal, statusSize);
|
||||
|
||||
status->currentContexts = static_cast<s32>(RudpGetContextCount(reinterpret_cast<uintptr_t>(g_RudpContext)));
|
||||
RudpFillStatusCounters(&status->sentQualityLevel4Packets, &status->rcvdQualityLevel4Packets,
|
||||
&status->allocs, &status->frees);
|
||||
|
||||
return ORBIS_OK;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpInit(void* memPool, int memPoolSize) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpInit() {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpInitiate() {
|
||||
s32 PS4_SYSV_ABI sceRudpInitiate(int context_id, Net::OrbisNetSockaddr* to, OrbisNetSocklen_t toLen,
|
||||
u16 virtualPort) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
@ -113,67 +178,70 @@ s32 PS4_SYSV_ABI sceRudpNetFlush() {
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpNetReceived() {
|
||||
s32 PS4_SYSV_ABI sceRudpNetReceived(int soc, u8* data, size_t dataLen, Net::OrbisNetSockaddr* from,
|
||||
OrbisNetSocklen_t fromLen) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpPollCancel() {
|
||||
s32 PS4_SYSV_ABI sceRudpPollCancel(PollEvent poll) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpPollControl() {
|
||||
s32 PS4_SYSV_ABI sceRudpPollControl(PollEvent poll, PollOp op, int context_id, PollEvent events) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpPollCreate() {
|
||||
s32 PS4_SYSV_ABI sceRudpPollCreate(size_t size) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpPollDestroy() {
|
||||
s32 PS4_SYSV_ABI sceRudpPollDestroy(PollEvent poll) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpPollWait() {
|
||||
s32 PS4_SYSV_ABI sceRudpPollWait(PollEvent poll, OrbisRudpPollEvent* events, size_t eventLen,
|
||||
OrbisRudpUsec timeout) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpProcessEvents() {
|
||||
s32 PS4_SYSV_ABI sceRudpProcessEvents(OrbisRudpUsec timeout) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpRead() {
|
||||
s32 PS4_SYSV_ABI sceRudpRead(int context_id, void* data, size_t len, u8 flags,
|
||||
OrbisRudpReadInfo* info) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpSetEventHandler() {
|
||||
s32 PS4_SYSV_ABI sceRudpSetEventHandler(OrbisRudpEventHandler handler, void* arg) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpSetMaxSegmentSize() {
|
||||
s32 PS4_SYSV_ABI sceRudpSetMaxSegmentSize(u16 mss) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpSetOption() {
|
||||
s32 PS4_SYSV_ABI sceRudpSetOption(int context_id, Option option, void* optVal, size_t optLen) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpTerminate() {
|
||||
s32 PS4_SYSV_ABI sceRudpTerminate(int context_id) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpWrite() {
|
||||
s32 PS4_SYSV_ABI sceRudpWrite(int context_id, void* data, size_t len, Message msg) {
|
||||
LOG_ERROR(Lib_Rudp, "(STUBBED) called");
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
@ -11,40 +11,214 @@ class SymbolsResolver;
|
||||
|
||||
namespace Libraries::Rudp {
|
||||
|
||||
enum class State : int {
|
||||
IDLE = 0,
|
||||
CLOSED = 1,
|
||||
SYN_SENT = 2,
|
||||
SYN_RCVD = 3,
|
||||
ESTABLISHED = 4,
|
||||
CLOSE_WAIT = 5,
|
||||
};
|
||||
|
||||
enum class Event : int {
|
||||
SEND = 1,
|
||||
SOCKET_RELEASED = 2,
|
||||
DIAGNOSTIC_SENT = 100,
|
||||
DIAGNOSTIC_RCVD = 101,
|
||||
};
|
||||
|
||||
enum class ContextEvent : int {
|
||||
CLOSED = 1,
|
||||
ESTABLISHED = 2,
|
||||
CONTEXT_ERROR = 3,
|
||||
WRITEABLE = 4,
|
||||
READABLE = 5,
|
||||
FLUSHED = 6
|
||||
};
|
||||
|
||||
enum class PollOp : int { ADD = 1, MODIFY = 2, REMOVE = 3 };
|
||||
|
||||
enum class PollEvent : int { READ = 0x0001, WRITE = 0x0002, FLUSH = 0x0004, POLL_ERROR = 0x0008 };
|
||||
|
||||
enum class Option : int {
|
||||
MAX_PAYLOAD = 1,
|
||||
OPTION_SEND_BUFFER_SIZE = 2,
|
||||
OPTION_RECEIVE_BUFFER_SIZE = 3,
|
||||
OPTION_NO_DELAY = 4,
|
||||
OPTION_CRITICAL_DELIVERY = 5,
|
||||
OPTION_CRITICAL_ORDER = 6,
|
||||
OPTION_NONBLOCK = 7,
|
||||
STREAM = 8,
|
||||
CONN_TIMEOUT = 9,
|
||||
CLOSE_WAIT_TIMEOUT = 10,
|
||||
AGGREGATION_TIMEOUT = 11,
|
||||
LAST_ERROR = 14,
|
||||
READ_TIMEOUT = 15,
|
||||
WRITE_TIMEOUT = 16,
|
||||
FLUSH_TIMEOUT = 17,
|
||||
KEEPALIVE_INTERVAL = 18,
|
||||
KEEPALIVE_TIMEOUT = 19,
|
||||
AGGREGATION_BUFFER = 20,
|
||||
};
|
||||
|
||||
enum class Message : int {
|
||||
DONTWAIT = 0x01,
|
||||
LATENCY_CRITICAL = 0x08,
|
||||
ALIGN32 = 0x10,
|
||||
ALIGN64 = 0x20,
|
||||
WITH_TIMESTAMP = 0x40,
|
||||
};
|
||||
|
||||
struct OrbisRudpStatus {
|
||||
s64 sentUdpBytes;
|
||||
s64 rcvdUdpBytes;
|
||||
s32 sentUdpPackets;
|
||||
s32 rcvdUdpPackets;
|
||||
|
||||
s64 sentUserBytes;
|
||||
s32 sentUserPackets;
|
||||
s32 sentLatencyCriticalPackets;
|
||||
|
||||
s64 rcvdUserBytes;
|
||||
s32 rcvdUserPackets;
|
||||
s32 rcvdLatencyCriticalPackets;
|
||||
|
||||
s32 sentSynPackets;
|
||||
s32 rcvdSynPackets;
|
||||
s32 sentUsrPackets;
|
||||
s32 rcvdUsrPackets;
|
||||
s32 sentPrbPackets;
|
||||
s32 rcvdPrbPackets;
|
||||
s32 sentRstPackets;
|
||||
s32 rcvdRstPackets;
|
||||
|
||||
s32 lostPackets;
|
||||
s32 retransmittedPackets;
|
||||
s32 reorderedPackets;
|
||||
|
||||
s32 currentContexts;
|
||||
|
||||
s64 sentQualityLevel1Bytes;
|
||||
s64 rcvdQualityLevel1Bytes;
|
||||
s32 sentQualityLevel1Packets;
|
||||
s32 rcvdQualityLevel1Packets;
|
||||
|
||||
s64 sentQualityLevel2Bytes;
|
||||
s64 rcvdQualityLevel2Bytes;
|
||||
s32 sentQualityLevel2Packets;
|
||||
s32 rcvdQualityLevel2Packets;
|
||||
|
||||
s64 sentQualityLevel3Bytes;
|
||||
s64 rcvdQualityLevel3Bytes;
|
||||
s32 sentQualityLevel3Packets;
|
||||
s32 rcvdQualityLevel3Packets;
|
||||
|
||||
s64 sentQualityLevel4Bytes;
|
||||
s64 rcvdQualityLevel4Bytes;
|
||||
s32 sentQualityLevel4Packets;
|
||||
s32 rcvdQualityLevel4Packets;
|
||||
|
||||
s32 allocs;
|
||||
s32 frees;
|
||||
s32 memCurrent;
|
||||
s32 memPeak;
|
||||
|
||||
s32 establishedConnections;
|
||||
s32 failedConnections;
|
||||
|
||||
s32 failedConnectionsReset;
|
||||
s32 failedConnectionsRefused;
|
||||
s32 failedConnectionsTimeout;
|
||||
s32 failedConnectionsVersionMismatch;
|
||||
s32 failedConnectionsTransportTypeMismatch;
|
||||
s32 failedConnectionsQualityLevelMismatch;
|
||||
};
|
||||
|
||||
struct OrbisRudpContextStatus {
|
||||
State state;
|
||||
int parentId;
|
||||
u32 children;
|
||||
u32 lostPackets;
|
||||
u32 sentPackets;
|
||||
u32 rcvdPackets;
|
||||
u64 sentBytes;
|
||||
u64 rcvdBytes;
|
||||
u32 retransmissions;
|
||||
u32 rtt;
|
||||
};
|
||||
|
||||
struct OrbisRudpPollEvent {
|
||||
int ctxId;
|
||||
u16 reqEvents;
|
||||
u16 rtnEvents;
|
||||
};
|
||||
|
||||
struct OrbisRudpReadInfo {
|
||||
u8 size;
|
||||
u8 retransmissionCount;
|
||||
u16 retransmissionDelay;
|
||||
u8 retransmissionDelay2;
|
||||
u8 flags;
|
||||
u16 sequenceNumber;
|
||||
u32 timestamp;
|
||||
};
|
||||
typedef s32 OrbisKernelCpumask;
|
||||
|
||||
typedef u32 OrbisNetSocklen_t;
|
||||
|
||||
typedef void (*OrbisRudpContextEventHandler)(int context_id, ContextEvent event_id, int errorCode,
|
||||
void* arg);
|
||||
|
||||
typedef u64 OrbisRudpUsec;
|
||||
|
||||
typedef int (*OrbisRudpEventHandler)(Event event_id, int soc, u8 const* data, size_t dataLen,
|
||||
Net::OrbisNetSockaddr const* addr, OrbisNetSocklen_t addrLen,
|
||||
void* arg);
|
||||
|
||||
s32 PS4_SYSV_ABI sceRudpAccept();
|
||||
s32 PS4_SYSV_ABI sceRudpActivate();
|
||||
s32 PS4_SYSV_ABI sceRudpBind();
|
||||
s32 PS4_SYSV_ABI sceRudpCreateContext();
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread();
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread2();
|
||||
s32 PS4_SYSV_ABI sceRudpActivate(int context_id, Net::OrbisNetSockaddr* to,
|
||||
OrbisNetSocklen_t toLen);
|
||||
s32 PS4_SYSV_ABI sceRudpBind(int context_id, int soc, u16 vport, u8 muxMode);
|
||||
s32 PS4_SYSV_ABI sceRudpCreateContext(OrbisRudpContextEventHandler handler, void* arg,
|
||||
int* context_id);
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread(u32 stackSize, u32 priority);
|
||||
s32 PS4_SYSV_ABI sceRudpEnableInternalIOThread2(u32 stackSize, u32 priority,
|
||||
OrbisKernelCpumask affinityMask);
|
||||
s32 PS4_SYSV_ABI sceRudpEnd();
|
||||
s32 PS4_SYSV_ABI sceRudpFlush();
|
||||
s32 PS4_SYSV_ABI sceRudpGetContextStatus();
|
||||
s32 PS4_SYSV_ABI sceRudpGetLocalInfo();
|
||||
s32 PS4_SYSV_ABI sceRudpGetMaxSegmentSize();
|
||||
s32 PS4_SYSV_ABI sceRudpGetNumberOfPacketsToRead();
|
||||
s32 PS4_SYSV_ABI sceRudpGetOption();
|
||||
s32 PS4_SYSV_ABI sceRudpGetRemoteInfo();
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeReadable();
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeWritable();
|
||||
s32 PS4_SYSV_ABI sceRudpGetStatus();
|
||||
s32 PS4_SYSV_ABI sceRudpInit();
|
||||
s32 PS4_SYSV_ABI sceRudpInitiate();
|
||||
s32 PS4_SYSV_ABI sceRudpFlush(int context_id);
|
||||
s32 PS4_SYSV_ABI sceRudpGetContextStatus(int context_id, OrbisRudpContextStatus* status,
|
||||
size_t statusSize);
|
||||
s32 PS4_SYSV_ABI sceRudpGetLocalInfo(int context_id, int* soc, Net::OrbisNetSockaddr* addr,
|
||||
OrbisNetSocklen_t* addrLen, u16* vport, u8* muxMode);
|
||||
s32 PS4_SYSV_ABI sceRudpGetMaxSegmentSize(u16* mss);
|
||||
s32 PS4_SYSV_ABI sceRudpGetNumberOfPacketsToRead(int context_id);
|
||||
s32 PS4_SYSV_ABI sceRudpGetOption(int context_id, Option option, void* optVal, size_t optLen);
|
||||
s32 PS4_SYSV_ABI sceRudpGetRemoteInfo(int context_id, Net::OrbisNetSockaddr* addr,
|
||||
OrbisNetSocklen_t* addrLen, u16* vport);
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeReadable(int context_id);
|
||||
s32 PS4_SYSV_ABI sceRudpGetSizeWritable(int context_id);
|
||||
s32 PS4_SYSV_ABI sceRudpGetStatus(OrbisRudpStatus* status, size_t statusSize);
|
||||
s32 PS4_SYSV_ABI sceRudpInit(void* memPool, int memPoolSize);
|
||||
s32 PS4_SYSV_ABI sceRudpInitiate(int context_id, Net::OrbisNetSockaddr* to, OrbisNetSocklen_t toLen,
|
||||
u16 vport);
|
||||
s32 PS4_SYSV_ABI sceRudpListen();
|
||||
s32 PS4_SYSV_ABI sceRudpNetFlush();
|
||||
s32 PS4_SYSV_ABI sceRudpNetReceived();
|
||||
s32 PS4_SYSV_ABI sceRudpPollCancel();
|
||||
s32 PS4_SYSV_ABI sceRudpPollControl();
|
||||
s32 PS4_SYSV_ABI sceRudpPollCreate();
|
||||
s32 PS4_SYSV_ABI sceRudpPollDestroy();
|
||||
s32 PS4_SYSV_ABI sceRudpPollWait();
|
||||
s32 PS4_SYSV_ABI sceRudpProcessEvents();
|
||||
s32 PS4_SYSV_ABI sceRudpRead();
|
||||
s32 PS4_SYSV_ABI sceRudpSetEventHandler();
|
||||
s32 PS4_SYSV_ABI sceRudpSetMaxSegmentSize();
|
||||
s32 PS4_SYSV_ABI sceRudpSetOption();
|
||||
s32 PS4_SYSV_ABI sceRudpTerminate();
|
||||
s32 PS4_SYSV_ABI sceRudpWrite();
|
||||
s32 PS4_SYSV_ABI sceRudpNetReceived(int soc, u8* data, size_t dataLen, Net::OrbisNetSockaddr* from,
|
||||
OrbisNetSocklen_t fromLen);
|
||||
s32 PS4_SYSV_ABI sceRudpPollCancel(PollEvent poll);
|
||||
s32 PS4_SYSV_ABI sceRudpPollControl(PollEvent poll, PollOp op, int context_id, PollEvent events);
|
||||
s32 PS4_SYSV_ABI sceRudpPollCreate(size_t size);
|
||||
s32 PS4_SYSV_ABI sceRudpPollDestroy(PollEvent poll);
|
||||
s32 PS4_SYSV_ABI sceRudpPollWait(PollEvent poll, OrbisRudpPollEvent* events, size_t eventLen,
|
||||
OrbisRudpUsec timeout);
|
||||
s32 PS4_SYSV_ABI sceRudpProcessEvents(OrbisRudpUsec timeout);
|
||||
s32 PS4_SYSV_ABI sceRudpRead(int context_id, void* data, size_t len, u8 flags,
|
||||
OrbisRudpReadInfo* info);
|
||||
s32 PS4_SYSV_ABI sceRudpSetEventHandler(OrbisRudpEventHandler handler, void* arg);
|
||||
s32 PS4_SYSV_ABI sceRudpSetMaxSegmentSize(u16 mss);
|
||||
s32 PS4_SYSV_ABI sceRudpSetOption(int context_id, Option option, void* optVal, size_t optLen);
|
||||
s32 PS4_SYSV_ABI sceRudpTerminate(int context_id);
|
||||
s32 PS4_SYSV_ABI sceRudpWrite(int context_id, void* data, size_t len, Message msg);
|
||||
|
||||
void RegisterLib(Core::Loader::SymbolsResolver* sym);
|
||||
} // namespace Libraries::Rudp
|
||||
44
src/core/libraries/rudp/rudp_error.h
Normal file
44
src/core/libraries/rudp/rudp_error.h
Normal file
@ -0,0 +1,44 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
constexpr int ORBIS_RUDP_ERROR_NOT_INITIALIZED = 0x80770001;
|
||||
constexpr int ORBIS_RUDP_ERROR_ALREADY_INITIALIZED = 0x80770002;
|
||||
constexpr int ORBIS_RUDP_ERROR_INVALID_CONTEXT_ID = 0x80770003;
|
||||
constexpr int ORBIS_RUDP_ERROR_INVALID_ARGUMENT = 0x80770004;
|
||||
constexpr int ORBIS_RUDP_ERROR_INVALID_OPTION = 0x80770005;
|
||||
constexpr int ORBIS_RUDP_ERROR_INVALID_MUXMODE = 0x80770006;
|
||||
constexpr int ORBIS_RUDP_ERROR_MEMORY = 0x80770007;
|
||||
constexpr int ORBIS_RUDP_ERROR_INTERNAL = 0x80770008;
|
||||
constexpr int ORBIS_RUDP_ERROR_CONN_RESET = 0x80770009;
|
||||
constexpr int ORBIS_RUDP_ERROR_CONN_REFUSED = 0x8077000A;
|
||||
constexpr int ORBIS_RUDP_ERROR_CONN_TIMEOUT = 0x8077000B;
|
||||
constexpr int ORBIS_RUDP_ERROR_CONN_VERSION_MISMATCH = 0x8077000C;
|
||||
constexpr int ORBIS_RUDP_ERROR_CONN_TRANSPORT_TYPE_MISMATCH = 0x8077000D;
|
||||
constexpr int ORBIS_RUDP_ERROR_CONN_QUALITY_LEVEL_MISMATCH = 0x8077000E;
|
||||
constexpr int ORBIS_RUDP_ERROR_THREAD = 0x8077000F;
|
||||
constexpr int ORBIS_RUDP_ERROR_THREAD_IN_USE = 0x80770010;
|
||||
constexpr int ORBIS_RUDP_ERROR_NOT_ACCEPTABLE = 0x80770011;
|
||||
constexpr int ORBIS_RUDP_ERROR_MSG_TOO_LARGE = 0x80770012;
|
||||
constexpr int ORBIS_RUDP_ERROR_NOT_BOUND = 0x80770013;
|
||||
constexpr int ORBIS_RUDP_ERROR_CANCELLED = 0x80770014;
|
||||
constexpr int ORBIS_RUDP_ERROR_INVALID_VPORT = 0x80770015;
|
||||
constexpr int ORBIS_RUDP_ERROR_WOULDBLOCK = 0x80770016;
|
||||
constexpr int ORBIS_RUDP_ERROR_VPORT_IN_USE = 0x80770017;
|
||||
constexpr int ORBIS_RUDP_ERROR_VPORT_EXHAUSTED = 0x80770018;
|
||||
constexpr int ORBIS_RUDP_ERROR_INVALID_SOCKET = 0x80770019;
|
||||
constexpr int ORBIS_RUDP_ERROR_BUFFER_TOO_SMALL = 0x8077001A;
|
||||
constexpr int ORBIS_RUDP_ERROR_MSG_MALFORMED = 0x8077001B;
|
||||
constexpr int ORBIS_RUDP_ERROR_ADDR_IN_USE = 0x8077001C;
|
||||
constexpr int ORBIS_RUDP_ERROR_ALREADY_BOUND = 0x8077001D;
|
||||
constexpr int ORBIS_RUDP_ERROR_ALREADY_EXISTS = 0x8077001E;
|
||||
constexpr int ORBIS_RUDP_ERROR_INVALID_POLL_ID = 0x8077001F;
|
||||
constexpr int ORBIS_RUDP_ERROR_TOO_MANY_CONTEXTS = 0x80770020;
|
||||
constexpr int ORBIS_RUDP_ERROR_IN_PROGRESS = 0x80770021;
|
||||
constexpr int ORBIS_RUDP_ERROR_NO_EVENT_HANDLER = 0x80770022;
|
||||
constexpr int ORBIS_RUDP_ERROR_PAYLOAD_TOO_LARGE = 0x80770023;
|
||||
constexpr int ORBIS_RUDP_ERROR_END_OF_DATA = 0x80770024;
|
||||
constexpr int ORBIS_RUDP_ERROR_ALREADY_ESTABLISHED = 0x80770025;
|
||||
constexpr int ORBIS_RUDP_ERROR_KEEP_ALIVE_FAILURE = 0x80770026;
|
||||
constexpr int ORBIS_RUDP_ERROR_MEMLEAK = 0x807700FF;
|
||||
Loading…
Reference in New Issue
Block a user