38 Commits
Author SHA1 Message Date
jagrat Singh 3db0e5deb3 feat(libSceNetCtl): implement ForLib internal callbacks 2026-10-28 22:26:29 +05:30
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 9b34409537 test(libSceNetCtl): expect IPv6 IPC callback delivery 2026-10-27 03:31:05 +08: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 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
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
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 3551a22670 test(libSceNetCtl): drop the checks that unimplemented event types throw
The loops over event types 0, 4 and -1 for sceNetCtlGetResult and sceNetCtlGetResultV6 required the not-implemented throw, so they would fail once those events are implemented. Events 1 to 3, initialization and the null-pointer checks stay.
2026-10-23 19:38:45 -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
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
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
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
Federico Marras 8a7d16b001 feat(libSceNetCtl): report no error for IPv6 events in sceNetCtlGetResultV6 2026-10-20 12:03:19 +02:00
Luis Gerardo Aguilar 1b33f14c8c feat(netctl): add sceNetCtlGetInfoV6 argument and connection checks
Titles import sceNetCtlGetInfoV6, and a missing import stops them at
load. The checks that need no answer layout are implemented; every code
throws when the host has IPv6, since the layout of the answer is not
verified.
2026-10-19 20:17:26 -05:00
Adrià b7a75819f3 Merge pull request #6720 from AdvaitPalve11/feat-netctl-info-codes
feat(netctl): implement remaining info codes in sceNetCtlGetInfo
2026-10-19 12:10:02 +02:00
Advait Palve d4fdc030e1 feat(netctl): implement Wi-Fi info codes in sceNetCtlGetInfo 2026-10-19 10:02:07 +02:00
David 9f4cd87a61 Merge remote-tracking branch 'origin/main' into fix/netctl-default-route-macos
# Conflicts:
#	core/libs/tests/GuestNetCtl.cpp
2026-10-19 00:56:11 +04:00
David 306229d940 Merge remote-tracking branch 'origin/main' into fix/netctl-default-route-macos
# Conflicts:
#	core/libs/tests/GuestNetCtl.cpp
#	docs/dev/debt/libSceNetCtl.md
2026-10-19 00:18:16 +04:00
Dean Galvin eeeaf7e40f Merge main into pr-6691
# Conflicts:
#	core/libs/tests/GuestNetCtl.cpp
2026-10-19 07:15:56 +13:00
fdfawef324andClaude Opus 5.5 2ae7896b6d fix(libSceNetCtl): keep the callback argument and deliver the state from sceNetCtlCheckCallback
sceNetCtlRegisterCallback and sceNetCtlRegisterCallbackV6 stored only
the function and dropped its argument, and sceNetCtlCheckCallback
returned 0 without calling anything, so a title that polls
sceNetCtlCheckCallback until its callback reports IPOBTAINED never
got the event.

Each callback slot now keeps the function, its argument and the last
event it received; unregistration clears the slot. With no IPv4
callback registered, sceNetCtlCheckCallback returns 0 without querying
the host. Otherwise it takes the state from the same host-interface
predicate as sceNetCtlGetState, IPOBTAINED (3) or DISCONNECTED (1)
(shadPS4 src/core/libraries/network/net_ctl_codes.h L27-29
@15abf68c9b52), marks the IPv4 slots whose last event differs and
calls them on the calling thread with their argument after the lock is
released, so a callback can unregister itself. Delivery once per state
change and slot follows KytyPS5 src/libs/network.cpp @9e41d8320a27
(NetCtlCallbackSlot L3447-3451, NetCtlCheckCallback L3648-3661,
NetCtlRegisterCallback L3687-3707); shadPS4 net_ctl_obj.cpp L47-57
delivers on every check instead, and the debt entry records the
difference and that KytyPS5 calls the callbacks under its lock.
sceNetCtlTerm clears both tables, as KytyPS5 NetCtlTerm (L3625-3633)
does. V6 slots keep their argument but get no event, since no source
says which call delivers them.

NetCtlCallback is now an APS5_VABI pointer, so the Windows build calls
the guest function with the System V ABI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 18:31:00 +02:00
David f3bf216868 Merge remote-tracking branch 'origin/main' into fix/netctl-default-route-macos
# Conflicts:
#	docs/dev/debt/libSceNetCtl.md
2026-10-18 09:37:31 +04:00
Nithishvelan M aaba312e6d feat(libSceNetCtl): support NET_CTL_INFO_HTTP_PROXY_PORT and validate null in sceNetCtlGetNatInfo 2026-10-18 00:06:43 +05:30
David 26bc5ce87c Merge remote-tracking branch 'origin/main' into fix/netctl-default-route-macos
# Conflicts:
#	docs/dev/debt/libSceNetCtl.md
2026-10-17 19:31:46 +04:00
xXPBSXxandClaude Sonnet 5.5 72471f5c68 test(libSceNetCtl): cover GetStateV6, GetResult and GetNatInfo in guest_net_ctl
sceNetCtlGetStateV6, sceNetCtlGetResult and sceNetCtlGetNatInfo are
exported and called by titles but no test calls them. The checks pin what
the code does today: a null output is refused with the invalid-address
error, GetStateV6 reports disconnected or IP obtained, GetResult writes
0, and GetNatInfo reports not connected.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-16 06:57:25 +02:00
David 6d4cde8e40 test(libSceNetCtl): check which macOS routing messages give a default route
A routing table built by hand with an unscoped default route, a host
route, a host route to 0.0.0.0, a rejecting default route, an
interface-scoped default route, one that is down, one on an interface
that does not exist and a truncated last message must give the unscoped
route first and the scoped one after it, and must count every match
while writing only as many as fit.
2026-10-16 08:42:35 +04:00
Celegans12 625525de79 fix(libSceNetCtl): answer the DHCP host name, PPPoE name and proxy server as empty strings
Since #5056, sceNetCtlGetInfo throws for every info code it does not
model. Ghost of Yotei (PPSA26344) asks for code 12, the DHCP host name,
during boot and now aborts one second in.

The configuration #5056 reports (wired, DHCP, HTTP proxy off) sets no
DHCP host name, no PPPoE user name and no proxy server, so codes 12, 13
and 20 now return 0 with an empty string. The Wi-Fi codes (5-10) and
the proxy port (21) still throw. GuestNetCtl checks the three empty
answers and keeps the throw check for the rest; the libSceNetCtl debt
line says the same.
2026-10-15 06:00:49 +02:00
RickandClaude Opus 5.5 3065b892f2 fix(libSceNetCtl): answer sceNetCtlGetInfo from the host IPv4 interface
sceNetCtlGetState reports IPOBTAINED from the host's addresses, but
sceNetCtlGetInfo returned NOT_CONNECTED for every code. It now answers
from the host interface that holds an IPv4 address, preferring the one
with the default route: its address, netmask, gateway, MTU and DNS
servers. The link is presented as wired, connected, configured by DHCP
and without a proxy, with the Ethernet address sceNetGetMacAddress
reports. A null info returns INVALID_ADDR and a code outside 1..21
INVALID_CODE; the Wi-Fi, DHCP host name, PPPoE and proxy server codes
throw.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-13 16:44:06 +02:00