Files
AnyPS5/docs/dev/debt/libSceNetCtl.md
T
Lindamea1andClaude Opus 5.5 d8baccc195 feat(libSceNetCtl): declare sceNetCtlGetInfoV6
libSceNetCtl exports sceNetCtlGetStateV6, sceNetCtlRegisterCallbackV6
and sceNetCtlUnregisterCallbackV6 but not sceNetCtlGetInfoV6 (NID
Jy1EO5GdlcM). Dragon Ball Xenoverse 2 (PPSA08587) imports it, and an
import that no system library exports stops a title before its entry
point: on Linux ld.so refuses the relinked executable with "undefined
symbol: Jy1EO5GdlcM", and on Windows the entry stub prints "FAIL:
unresolved ELF import Jy1EO5GdlcM from libSceNetCtl.prx" and raises
0xC0000139. The title's tester reports that it does not call the
function before its loading screen.

It is a Sony network-control call with no FreeBSD counterpart, and
neither its parameters nor the IPv6 info layout are known, so it is
declared without parameters and throws through
NotImplemented_nid_no_patch, as CONTRIBUTING.md asks of exports that
cannot be implemented. The gap is recorded in
docs/dev/debt/libSceNetCtl.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:07:45 +01:00

3.6 KiB

libSceNetCtl technical debt

Silent stubs

  • sceNetCtlGetNatInfo (libSceNetCtl) - sceNetCtlGetNatInfo validates null pointers and returns SCE_NET_CTL_ERROR_NOT_CONNECTED (0x80412108) without performing NAT discovery.

Unknown function info

  • sceNetCtlGetInfoV6 (libSceNetCtl, NID Jy1EO5GdlcM) - imported by PPSA08587, which fails to load without it, and not called before its loading screen; declared without parameters as a throwing stub, signature unknown. Name from the aerolib NID list
  • sceNetCtlGetInfo (libSceNetCtl) - answers from the host interface that holds an IPv4 address, preferring the one that carries the default route: its address, netmask, gateway, MTU and first two IPv4 DNS servers. The device is reported as wired, the link as connected, the IP configuration as DHCP and the HTTP proxy as off, whatever the host uses, and the Ethernet address is the one sceNetGetMacAddress reports. A gateway or DNS server the interface does not have is reported as 0.0.0.0; what a console reports then is unknown. The DHCP host name (12), the PPPoE user name (13), the HTTP proxy server (20) and the Wi-Fi BSSID and SSID (5, 6) are empty strings, as that configuration sets none of them; the remaining Wi-Fi codes (7-10) and the HTTP proxy port (21) report 0; this follows KytyPS5 and is not measured on hardware

Functional

  • sceNetCtlCheckCallback (libSceNetCtl) - the state comes from the host interfaces, as in sceNetCtlGetState: IPOBTAINED (3) while the host has a non-loopback IPv4 or IPv6 address, DISCONNECTED (1) otherwise; the event values follow shadPS4, and no other event is delivered. Each callback registered with sceNetCtlRegisterCallback is called on the checking thread with its registration argument when the state differs from the last one it received, so a new registration receives the current state at the next check. This edge-triggered model follows KytyPS5; shadPS4 delivers the state on every check instead, and neither is measured on hardware. KytyPS5 calls the callbacks under its lock; here they are called after the lock is released, from a copy of their slots, so a sceNetCtlUnregisterCallback or sceNetCtlTerm on another thread that returns while a check is in flight does not stop that check from calling the callback once more with its old argument. Callbacks registered with sceNetCtlRegisterCallbackV6 keep their argument but receive no event, because no source says which call delivers them
  • sceNetCtlGetInfo (libSceNetCtl) finds the host's default route in /proc/net/route on Linux and, on macOS, in the routing table read with sysctl(NET_RT_FLAGS, RTF_GATEWAY), where an interface-scoped default route ranks after the unscoped one
  • sceNetCtlGetIfStat (libSceNetCtl) throws on macOS: an unprivileged process reads the interface byte counters (getifaddrs and sysctl(NET_RT_IFLIST2) alike) reduced to their low 32 bits, so a total would wrap every 4 GiB