Commit Graph
77 Commits
Author SHA1 Message Date
camezaro-intc f4594f90d3 feat(libSceNetCtl): support APS5_NET_DISCONNECTED for simulated offline state 2026-11-02 21:58:28 -06:00
Dean 9dc910f515 Merge pull request #11042 from EagleBearerYS/fix/count-throwing-done-net-kernel
fix: report five always-throwing network and kernel exports as not implemented
2026-11-02 23:26:36 +13:00
Dean 459f61ea02 Merge pull request #9578 from EagleBearerYS/feat/libscenet-ex-forwards
feat(libSceNet): implement the Ex and Internal socket forms, sceNetSysctl, scope-ID text and the default route
2026-11-02 23:25:39 +13:00
Yunus Shaikh 49a05d8769 Merge main into fix/count-throwing-done-net-kernel
The conflict in core/libs/tests/GuestRudpContextLifecycle.cpp with #13799 keeps both changes: this branch's removal of the check that sceRudpActivate throws, and main's sceRudpBind(ctx, 5, 0, 2) call after it.
2026-10-31 18:38:17 -07:00
Oleg 413a0d2d95 test(libSceNetCtl): cover the ApRp exports' constant success and statelessness 2026-11-01 03:00:01 +05:00
Kyon 52be1be8cf feat(libSceNetCtl): declare 20 callable exports 2026-10-30 06:24:29 +00:00
jagrat Singh 3db0e5deb3 feat(libSceNetCtl): implement ForLib internal callbacks 2026-10-28 22:26:29 +05:30
Yunus Shaikh 0efa1a8697 Merge main into fix/count-throwing-done-net-kernel
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-28 02:49:58 -07:00
Yunus Shaikh 8c13ac3865 Merge main into feat/libscenet-ex-forwards
# Conflicts:
#	core/libs/prx/libSceNet/Export.cpp
2026-10-28 01:57:32 -07:00
frankea 2129d1f7b5 fix(libSceNet): print the interface and socket tables from sceNetShowIfconfig and sceNetShowNetstat
Since #9137 both throw after sceNetInit. A PS5 on firmware 13.40
returns 0 from each and prints plain-text tables to stdout. They now
print the console's layout with what the emulator knows: ifconfig an
eth0 block from the host interface sceNetCtlGetInfo reports (the same
MAC, address, netmask and MTU), the console's lo0 block and the DNS
servers; netstat the header and one entry per socket and epoll of the
title, with the self and non-blocking flags, addresses, buffer sizes and
the names given to sceNetSocket and sceNetEpollCreate, which are now
kept. The debt entry lists what the console prints that is left out.

guest_sce_net captures both outputs: the lo0 block and DNS section, a
named unbound UDP socket, a non-blocking listening TCP socket bound to
127.0.0.1, an epoll, a 40-character name cut to 31, and the entries gone
after close.
2026-10-28 09:05:58 +01:00
Yunus Shaikh f051532324 Merge main into feat/libscenet-ex-internal-scope
# Conflicts:
#	core/libs/prx/libSceNetCtl/Export.cpp
2026-10-27 20:25:19 -07:00
Yunus Shaikh 06e6e107a1 Merge main into fix/count-throwing-done-net-kernel
# Conflicts:
#	core/libs/prx/libkernel/Time/Time.cpp
#	core/libs/tests/GuestMlock.cpp
#	docs/dev/debt/libkernel.md
2026-10-27 20:23:15 -07:00
Dean 99eebd9437 Merge pull request #10951 from AZLisme/feat/netctl-v6-callbacks
feat(libSceNetCtl): dispatch IPv6 state callbacks
2026-10-27 21:16:16 +13:00
Adrià e5779c0a84 Merge pull request #10790 from leorossi2005/feat/netctl-get-nat-info
feat(libSceNetCtl): implement sceNetCtlGetNatInfo
2026-10-27 08:38:33 +01:00
Leonardo 82fa4474c1 feat(libSceNetCtl): bound sceNetCtlGetNatInfo probe time and cache only on success 2026-10-27 00:18:19 +01:00
AZLisme 61e16da2c5 feat(libSceNetCtl): deliver IPv6 state callbacks 2026-10-27 03:30:16 +08:00
Leonardo 93eb9d304a feat(libSceNetCtl): classify NAT type from multi-endpoint STUN probes 2026-10-26 18:46:40 +01:00
Yunus Shaikh 7ace2fe514 Merge main into fix/count-throwing-done-net-kernel 2026-10-26 09:06:45 -07:00
Yunus Shaikh f88835a37e fix(libSceNetCtl): report sceNetCtlGetInfoV6 on an IPv6 host as not implemented
On a host with an IPv6 address, sceNetCtlGetInfoV6 threw a bare runtime_error for every valid code, so progress.py counted it as done. The layout of each answer is unverified, so that path now goes through NotImplemented_nid_no_patch. The INVALID_ADDR, INVALID_CODE and IPv6-less NOT_CONNECTED answers are unchanged.
2026-10-25 12:53:43 +00:00
Yunus Shaikh 404d3812c0 fix(libSceNetCtl): leave the ForLib IpcInt callback calls unimplemented
No source establishes whether the console keeps the callback table of
sceNetCtlRegisterCallbackForLibIpcInt, UnregisterCallbackForLibIpcInt and
CheckCallbackForLibIpcInt apart from the NpToolkit one or shares it. The
three throw again, as on main, and their table, test and debt entry go.
2026-10-25 01:57:42 -07:00
Yunus Shaikh b19382a492 feat(libSceNetCtl): answer the IpcInt calls as their public twins and add the ForLib callback table
The ten IpcInt getters and callback forms forward to sceNetCtlGetState,
GetStateV6, GetResult, GetResultV6, GetInfo, GetInfoV6 and the IPv4 and
IPv6 callback registration, whose recovered argument registers they
share. The three ForLib calls keep a fourth table of eight callbacks with
the register, unregister and dispatch the NpToolkit forms use. Both are
recorded as unmeasured in the debt file.
2026-10-25 07:39:35 +00:00
Leonardo ba3f730421 fix(libSceNetCtl): use cryptographic entropy for STUN transaction IDs 2026-10-25 06:34:41 +01:00
Leonardo a0ee2ca7fb fix(libSceNetCtl): leave nat_type unclassified in sceNetCtlGetNatInfo 2026-10-25 03:52:28 +01:00
Leonardo a4747ed8ef feat(libSceNetCtl): perform STUN discovery and NAT classification in sceNetCtlGetNatInfo 2026-10-25 02:24:05 +01:00
Yunus Shaikh 6c938db3ce Merge #9515's main merge into feat/libscenet-ex-forwards
Main's #10706 declares the libSceNet functions this branch implements, and libkernel's sysctl, __inet_pton and __inet_ntop, in the libraries' public headers, so this branch's local declarations of them in GuestSceNet.cpp and libSceNet's Export.cpp go.
2026-10-24 17:41:13 -07:00
Leonardo d6aeceab3d feat(libSceNetCtl): implement sceNetCtlGetNatInfo
Declare the NetCtlNatInfo structure layout (size, stun_status,
nat_type, mapped_addr) and implement sceNetCtlGetNatInfo.
When the host has an IPv4 interface, reports STUN status OK (2),
NAT type 2 (moderate), and the host's IPv4 address as the mapped
address. Returns SCE_NET_CTL_ERROR_NOT_CONNECTED when no interface
is found. Unblocks session creation in Aliens: Fireteam Elite (PPSA03393).
2026-10-25 02:30:01 +02:00
boykopovar 35cf8d56cd refactor(sdk): add canonical headers for core libraries 2026-10-24 23:17:37 +03:00
Yunus Shaikh 5cffcf56d1 Merge #9515's main merge into feat/libscenet-ex-forwards 2026-10-24 10:41:54 -07:00
Adrià 8f2e9cd077 Merge pull request #8398 from Chikimaro/feat/libscenetctl-nptoolkit-callbacks
feat(libSceNetCtl): implement the NpToolkit callback register, unregister and check
2026-10-24 18:42:46 +02:00
Yunus Shaikh dda8c45be7 Merge #9515's main merge into feat/libscenet-ex-forwards 2026-10-23 06:50:35 -07:00
Yunus Shaikh 92de1c6a76 feat(libSceNetCtl): report no error from sceNetCtlGetResult for IPv4 events
sceNetCtlGetResult threw for every event after its initialization and
address checks, and Worms Armageddon: Anniversary Edition (PPSA20052)
and Monster Hunter Wilds (PPSA24191) stop on it at boot; MHW's first
call asks about event 1, a disconnection.

It now answers as sceNetCtlGetResultV6 does: for event types 1 to 3,
disconnected to IP obtained (the numbers sceNetCtlCheckCallback
delivers), it writes 0 to the result and returns 0. Other event types
throw, naming the type. The initialization and null checks come first,
as before. The error code a console reports per event is unconfirmed,
which the library's debt page now records.

The guest NetCtl test covers each supported event, three unsupported
ones with the new message and the result left untouched, and a null
result answered before the event is looked at.
2026-10-23 04:53:12 -07:00
Yunus Shaikh 43ea7772bb Merge main into feat/libscenet-ex-forwards 2026-10-22 06:35:18 -07:00
Chikimaro 7854d19936 Merge main into feat/libscenetctl-nptoolkit-callbacks
main now starts libSceNetCtl initialized, so GuestNetCtl's checks before
sceNetCtlInit expect argument errors; the NpToolkit register, unregister
and check join them with the errors and result their IPv4 counterparts give.
2026-10-22 09:56:31 +00:00
memob 3f698c1016 perf(libSceNetCtl): reuse host interface queries until Windows reports a change
PPSA34501 calls sceNetCtlGetInfo often enough that GetAdaptersAddresses and its
RPC took about a fifth of a game thread at the Kino der Toten spawn. The
answers are now kept per address family and for the IPv4 interface, and
dropped when an address, interface or route change notification arrives.
2026-10-22 02:23:54 -04:00
Yunus Shaikh a19d110222 feat(libSceNet): report the IPv4 default route in sceNetConfigGetDefaultRoute
sceNetConfigGetDefaultRoute threw. It now writes the IPv4 gateway of the
host interface that libSceNetCtl's sceNetCtlGetInfo already describes as
DEFAULT_ROUTE, in network byte order, the order sceNetInetPton writes an
AF_INET address in, and returns 0. libSceNetCtl exports
NetCtlHostIpv4Gateway_nid_no_patch for it, next to the DNS helper
sceNetGetDnsInfo uses. Without a gateway, or for a null pointer, it
still throws: the console's answer for a missing route is not measured.

Tested: guest_sce_net_tests, after sceNetCtlInit, prints the gateway
with sceNetInetNtop and compares it with sceNetCtlGetInfo's
DEFAULT_ROUTE text (192.0.2.1 on this host); a null pointer throws.
On a host without a default route the case checks that the call
throws and leaves the output untouched.
2026-10-22 01:44:35 +00:00
hugodearaujo 25b7991c6a fix(netctl): start the library initialized, as titles find it
Titles register and check NetCtl callbacks without importing
sceNetCtlInit: libSceNetCtl is an internal sysmodule the system has
started before the title runs. 007 First Light traps at start-up when
sceNetCtlRegisterCallback answers NOT_INITIALIZED.
2026-10-21 18:56:52 -03:00
Chikimaro 6e2fbcda84 Merge main into feat/libscenetctl-nptoolkit-callbacks
Resolve the conflicts with main's libSceNetCtl initialization and
callback validation: the shared check now returns NOT_INITIALIZED before
sceNetCtlInit, as sceNetCtlCheckCallback does on main, so the NpToolkit
check does too; sceNetCtlTerm stays the no-op main measured; the NpToolkit
register and unregister keep their implementations with main's parameter
names. The NpToolkit entry joins main's rewritten debt file, and
GuestNetCtl checks the three before initialization.
2026-10-21 21:39:23 +00:00
boykopovar 5888cf3cb2 fix(net): align merged ipv6 and rudp argument types 2026-10-21 21:56:07 +03:00
boykopovar ea086b2374 fix(netctl): restore initialization and callback validation 2026-10-21 21:51:41 +03:00
boykopovar ce8ee3f598 fix(netctl): restore scan and network query signatures 2026-10-21 21:50:44 +03:00
boykopovar 4cb4905c29 fix(netctl): recover connection test result signature 2026-10-21 21:47:53 +03:00
boykopovar 7525726c14 fix(netctl): recover access point retry signatures 2026-10-21 21:47:40 +03:00
boykopovar e5a43c86bc fix(netctl): recover state and result query signatures 2026-10-21 21:45:06 +03:00
boykopovar 419a34cadb fix(netctl): recover callback and event stub signatures 2026-10-21 21:45:05 +03:00
Dean 1bcaa14234 Merge pull request #8307 from hypermoist/fix/libs-console-results-part2
fix(libs): return what the firmware returns from 31 more calls it does not implement
2026-10-21 20:57:00 +13:00
Dean 16c7e76761 Merge pull request #8321 from MarrasFederico/feat/netctl-get-result-v6
feat(libSceNetCtl): report no error for IPv6 events in sceNetCtlGetResultV6
2026-10-21 17:54:21 +13:00
Dean 7e6830ec55 Merge pull request #8268 from Athen2045/feat/net-dns-info
feat(libSceNet): implement sceNetGetDnsInfo
2026-10-21 11:50:31 +13:00
Dean 407d0d8df3 Merge pull request #8100 from LuisAguilarDev/feat/netctl-get-info-v6
feat(netctl): add sceNetCtlGetInfoV6 argument and connection checks
2026-10-21 06:18:12 +13:00
Chikimaro de2fd5bf6a feat(libSceNetCtl): implement the NpToolkit callback register, unregister and check
sceNetCtlRegisterCallbackForNpToolkit, sceNetCtlUnregisterCallbackForNpToolkit
and sceNetCtlCheckCallbackForNpToolkit keep their own table of eight
callbacks next to the IPv4 and IPv6 ones and share the existing register,
unregister and event delivery, which sceNetCtlCheckCallback now also goes
through. sceNetCtlTerm clears the new table. The register signature and the
separate table follow shadPS4; the rest follows the IPv4 functions and is
recorded as unverified in the libSceNetCtl technical debt.
2026-10-20 12:14:24 +00:00
Federico Marras 8a7d16b001 feat(libSceNetCtl): report no error for IPv6 events in sceNetCtlGetResultV6 2026-10-20 12:03:19 +02:00