Commit Graph
53 Commits
Author SHA1 Message Date
Dean 7ef094f7d4 Merge pull request #8222 from jagrat04/feat/libSceNet-show-route
feat(libSceNet): implement sceNetShowRoute
2026-10-21 20:19:56 +13:00
Ondra97 401dee24b6 docs(net): keep transfer polling debt concise 2026-10-21 02:01:58 +02:00
Ondra97 c415375041 fix(net): finish blocking stream sends after short writes 2026-10-21 01:53:43 +02: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
Ondra97 1b182e7fb2 fix(net): keep MSG_DONTWAIT transfers nonblocking on Windows 2026-10-20 21:47:08 +02:00
Dean 587bb343e8 Merge pull request #8106 from juanpimg/feat/prx-declare-ps5-3.20-exports
feat(prx): declare the missing PS5 3.20 system exports
2026-10-20 21:13:30 +13:00
Allan JohnandClaude Opus 5.5 8ab6ecb17a feat(libSceNet): implement sceNetGetDnsInfo
Report the host IPv4 DNS servers of the interface sceNetCtlGetInfo
uses, through a helper libSceNetCtl exports, and return their count.
The signature and layout follow the OpenOrbis musl resolver and Net.h.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 13:19:12 +05:30
Dean 26f157ba15 Merge pull request #7959 from Lindamea1/fix/libscenet-getsockinfo-fill
fix(libSceNet): fill the address and port fields in sceNetGetSockInfo
2026-10-20 20:07:23 +13:00
Dean 138351d714 Merge pull request #8056 from ntamas94/fix/sce-net-inet-pton-ex-aton
fix(libSceNet): parse sceNetInetPtonEx IPv4 text as the PS4 does
2026-10-20 19:31:57 +13:00
Lindamea1andClaude Opus 5.5 a05db60c87 fix(libSceNet): fill the address and port fields in sceNetGetSockInfo
sceNetGetSockInfo returned 0 for a known socket and wrote nothing, so
callers read uninitialised bytes as the socket's endpoints. Monster
Hunter Wilds (PPSA24191) calls it after bind, connect and accept and
stores the local and remote address and port it reads back.

It now writes one 0xA0-byte record in the layout SharpProspero and
shadPS4 give: the socket id, the socket type, the local and remote
IPv4 address and port of the host socket in network byte order, the
SELF and NONBLOCK status flags, and the receive and send buffer sizes
sceNetGetsockopt reports for the socket. The other fields are 0. It
returns 1, the number of records written, and EINVAL for a null record
or an n below 1, as shadPS4 does.

An s below 0 lists the sockets as shadPS4 does: with a null record it
returns their number, otherwise it writes up to n records in socket
order and returns how many it wrote. Unlike shadPS4, which lists IPv6
sockets with zero addresses and ignores flags, an IPv6 socket fails
with EAFNOSUPPORT and is left out of the count and the list, and a
flags bit other than 0x40 fails with EINVAL. SharpProspero names 0x40
SockInfoTimeWait; closed sockets leave the table at once, so it lists
the same sockets. docs/dev/debt/libSceNet.md lists the fields left 0
and these differences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:23:51 +01:00
Dean df56570fe2 Merge pull request #8054 from HQasper/feat/net-interface-names
feat(libSceNet): implement interface names, random values and net memory
2026-10-20 18:31:02 +13:00
Dean Galvin eeff77c380 Merge main into pr-8106
# Conflicts:
#	docs/dev/debt/libSceAcm.md
#	docs/dev/debt/libScePlayGo.md
#	docs/dev/debt/libSceSystemGesture.md
#	docs/dev/debt/libSceWebBrowserDialog.md
2026-10-20 17:58:28 +13:00
Dean 9d6470ea21 Merge pull request #7991 from MarrasFederico/feat/sce-net-resolver-aton6
feat(libSceNet): reverse-resolve IPv6 addresses in sceNetResolverStartAton6
2026-10-20 17:50:03 +13:00
Dean ca5cd3128b Merge pull request #8013 from MarrasFederico/feat/sce-net-clear-dns-cache
feat(libSceNet): accept sceNetClearDnsCache with no library DNS cache to drop
2026-10-20 17:46:56 +13:00
jagrat Singh 50375074d0 feat(libSceNet): implement sceNetShowRoute
Implement sceNetShowRoute as a silent stub returning 0, matching the (void) signature in shadPS4 and the behavior of sceNetShowIfconfig and sceNetShowNetstat. Adds guest unit tests in GuestSceNet.cpp and updates technical debt documentation.
2026-10-20 09:51:48 +05:30
xXPBSXxandClaude Sonnet 5.5 a39effcef9 fix(libSceNet): honour MSG_DONTWAIT in the send and receive calls on Windows
sceNetSend, sceNetSendto, sceNetSendmsg, sceNetRecv, sceNetRecvfrom and
sceNetRecvmsg failed with EOPNOTSUPP for MSG_DONTWAIT on Windows, where
FreeBSD 11.4 sosend_generic and soreceive_generic make the one call
non-blocking and fail with EWOULDBLOCK when it would wait. Winsock has no
per-call flag, so the call now asks WSAPoll with a zero timeout whether the
socket is ready and fails with EAGAIN when it is not. The Windows branch of
the test that expected EOPNOTSUPP now runs the checks of the other hosts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 06:05:03 +02:00
Adrià 9f9cf38bb0 Merge pull request #7493 from Lindamea1/fix/scenet-tcp-nodelay
fix(libSceNet): support TCP_NODELAY in sceNetSetsockopt and sceNetGetsockopt
2026-10-20 01:01:26 +02:00
juanpimg 148e5024b7 feat(prx): drop the exports that main and open pull requests provide
The overlap audit against origin/main and the open pull requests found 39 of
the 193 declared exports that must not be declared here:

- 14 that origin/main already exports. The nid_patcher computes the NID of a
  symbol from its name, and a name ending in _nid_postfix exports the NID of
  the base name, so scePadOpen, sceNetInit and the rest are already there.
- 23 that an open pull request provides: #6832, #6847, #6852, #7846, #7881,
  #7889, #7890, #6977 and #7690.
- 2 whose technical-debt file an open pull request creates: #7463 and #8094.

The scope is now 30 libraries and 154 exports.
2026-10-19 23:37:57 +02:00
juanpimg 2f0ed638dc feat(prx): declare the missing PS5 3.20 system exports
AnyPS5 resolves a title's imports by NID, so a title that imports a system
function no library provides fails to load with an unresolved import. The
PS5 3.20 export inventory lists 193 such exports across 37 PS5 system
libraries AnyPS5 implements but does not provide.

Declare them as throwing stubs so those titles load and reach their next
blocker. Each declaration calls NotImplemented_nid_no_patch and returns 0;
none of them implements the function. Declarations with a credible
prototype use it and cite the source with a pinned commit, and the rest
are declared without parameters, which resolves the import without making
an ABI claim. The technical-debt files record the limitation per library.

libSceMbus and libSceSystemService are left out because pull request #7821
declares them. libSceAgc is left out because its exports are versioned, so
the 3.20 NID names a different symbol from the one AnyPS5 ships.
libSceAvPlayer.native is left out because it compiles libSceAvPlayer's
Export.cpp.

Names and NIDs come from the PS5 3.20 export inventory at
https://github.com/DNNDHH/PS5-3.20_Libs/tree/b2a77c09cd71c01f34c790cfbe98c751a13262ad
2026-10-19 23:16:55 +02:00
ntamas94andClaude Opus 5.5 ad52647cd9 fix(libSceNet): parse sceNetInetPtonEx IPv4 text as the PS4 does
On PS4 firmware 10.71 sceNetInetPtonEx reads IPv4 text the way
inet_aton does, not the way sceNetInetPton does: "1.2.3" is 1.2.0.3,
"127.1" is 127.0.0.1, hex and octal parts are accepted, a part value
wraps at 32 bits ("1.4294967296" is 1.0.0.0) and the text ends at the
first whitespace. Two differences from BSD inet_aton were measured: a
part starting with "09" is decimal ("0989" is 989), and an octal part
containing 8 or 9 fails.

The flags argument changed nothing for 0, every single bit up to
0x100, 0x10000, 0x80000000 and -1, so it is ignored instead of
throwing. IPv6 still converts as sceNetInetPton does, which matches
the console.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 21:10:55 +02:00
Claude b0a9676844 feat(libSceNet): implement interface names, random values and net memory
Implement sceNetGetIfName, sceNetGetRandom, sceNetMemoryAllocate and
sceNetMemoryFree with the signatures shadPS4 uses, and cover them in
guest_sce_net_tests.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-19 18:29:29 +00:00
Federico Marras 1537dff78b feat(libSceNet): accept sceNetClearDnsCache with no library DNS cache to drop 2026-10-19 19:41:49 +02:00
Federico Marras 87bd71d64c feat(libSceNet): reverse-resolve IPv6 addresses in sceNetResolverStartAton6 2026-10-19 18:57:12 +02:00
Dean 240255fcf8 Merge pull request #7924 from realshinmalphur/feat/net-process-time
feat(net): implement process-relative system time
2026-10-20 05:53:14 +13:00
Adrià Franch 0f16c25f79 docs(libSceNet): record the TCP_NODELAY option and its deviations from FreeBSD 2026-10-19 18:01:15 +02:00
ShinMalphur 41fe91a13b docs(net): state hardware validation gap first 2026-10-19 20:41:43 +06:30
ShinMalphur 905fa532af docs(net): record process-time behavior source 2026-10-19 20:41:03 +06:30
ntamas94andClaude Opus 5.5 be7068bd81 fix(libSceNet): end IPv4 sceNetInetPton text at whitespace as the PS4 does
PS4 firmware 10.71 converts "1.2.3.4" followed by a space, tab, LF,
VT, FF or CR, and anything after it ("1.2.3.4 x"), to 1.2.3.4 and
returns 1, where host inet_pton returns 0. Leading whitespace, other
trailing bytes (0x01, 0xa0), "1.2.3 " and IPv6 text with whitespace
still fail there.

A failed conversion leaves the destination and sceNetErrnoLoc
unchanged on the console; Winsock inet_pton writes the parsed prefix
before failing, so the conversion now goes through a local buffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:05:36 +02:00
Chikimaro a84a2b1240 feat(libSceNet): implement sceNetUsleep and sceNetInetPtonEx
sceNetUsleep fails with EINVAL for a negative count and otherwise sleeps
through libkernel's sceKernelUsleep, a cancellation point. sceNetInetPtonEx
converts as sceNetInetPton does when its flags are 0 and throws for any
other flags, whose meaning is unknown. The signatures follow shadPS4 and
are recorded as unverified in the libSceNet technical debt.
2026-10-19 09:01:14 +00:00
Yuri Olive 4d6942f1e6 feat(libSceNet): export missing firmware network interfaces 2026-10-19 08:42:01 +02:00
Adrià 25648aa121 Merge pull request #6494 from Ondra97/codex/fix-net-accept-inherited-mode
fix(libSceNet): inherit nonblocking mode on accepted sockets
2026-10-19 04:30:22 +02:00
Alexandros Pournaras 4b656882ba fix(libSceNet): store SO_ONESBCAST in sceNetSetsockopt 2026-10-17 11:29:25 +02:00
Adrià c47a4dca52 Merge pull request #5967 from EagleBearerYS/fix/libscenet-timeval-timeouts
fix(libSceNet): read SO_RCVTIMEO and SO_SNDTIMEO as a timeval in sceNetSetsockopt
2026-10-17 06:53:19 +02:00
Adrià bb6bea8093 Merge pull request #5966 from EagleBearerYS/fix/libscenet-unbound-datagram-receive
fix(libSceNet): let a datagram receive on an unbound socket wait on Windows
2026-10-17 06:51:29 +02:00
Kurenaiiiii 0e329fc649 docs: move loader import debt to its library files 2026-10-16 20:51:06 +02:00
Kurenaiiiii f00b2ef833 feat(libSceNet): return success from ShowIfconfig and ShowNetstat 2026-10-16 20:51:06 +02:00
Ondra97 1fee29b6ad fix(libSceNet): inherit nonblocking mode on accepted sockets 2026-10-15 19:29:41 +02:00
Yunus Shaikh 896b737700 fix(libSceNet): keep one receive timeout across the wait for a local address
When the address came during the wait, the host receive that followed
waited its whole SO_RCVTIMEO again, so a receive could take up to twice
the timeout. FreeBSD's soreceive_dgram sleeps once per timeout. Now the
receive waits for a datagram with WSAPoll only for what is left of the
timeout, and fails with EAGAIN when it runs out, as before. Nothing
changes when the socket already had an address or has no timeout.
2026-10-15 02:34:12 -07:00
Yunus Shaikh a9c2717fd0 fix(libSceNet): return 0 from an unbound datagram receive after shutdown or for zero bytes
On Windows a receive on a datagram socket with no local address waits
for one. A sceNetShutdown of the receive side now ends that wait, and
later receives return 0 at once; a zero-length receive returns 0 without
waiting. FreeBSD's soreceive_dgram returns 0 in both cases. Before, a
thread blocked in such a receive kept waiting after the socket was shut
down.
2026-10-15 01:54:10 -07:00
Yunus Shaikh 85ff7136d0 docs(libSceNet): record the wait for a datagram socket's local address on Windows 2026-10-14 09:07:56 -07:00
Yunus Shaikh 7f82da1080 docs(libSceNet): record which timeout options take a timeval 2026-10-14 08:37:49 -07:00
Adrià Franch 188de5b17f fix(libSceJson2): drop setNullAccessCallBack from the not-implemented export test and debt line 2026-10-14 13:44:02 +02:00
Dean e2cd7f49db Merge pull request #3897 from eliasbruno124-dev/fix/ssl-certificate-import
fix(ssl): retain loaded certificate authorities
2026-10-14 23:55:30 +13:00
eliasbruno124-dev b737308eed fix(ssl): retain loaded certificate authorities 2026-10-14 22:34:22 +13:00
Dean 9858d27be7 Merge pull request #4673 from milescoviello/fix/scenet-msg-dontwait
fix(libSceNet): accept MSG_DONTWAIT in the send and receive calls
2026-10-14 19:06:13 +13:00
milescovielloandClaude Opus 5.5 65d56b3147 fix(libSceNet): dissolve a datagram association on connect to AF_UNSPEC
sceNetConnect() on a connected datagram socket rejected an address
whose family is AF_UNSPEC (a null address) with EINVAL before touching
the socket, so the socket stayed connected: sceNetGetpeername() still
reported the old peer and datagrams from any other sender were dropped
by the host.

FreeBSD 11.4 disconnects a connected datagram socket first and only then
looks at the address. sys/kern/uipc_socket.c, soconnectat():

	 * If protocol is connection-based, can only connect once.
	 * Otherwise, if connected, try to disconnect first.  This allows
	 * user to disconnect by connecting to, e.g., a null address.
	 */
	if (so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING) &&
	    ((so->so_proto->pr_flags & PR_CONNREQUIRED) ||
	    (error = sodisconnect(so)))) {

udp_disconnect() (sys/netinet/udp_usrreq.c) clears the peer and keeps
the local port. connect(2): "Datagram sockets may dissolve the
association by connecting to an invalid address, such as a null
address." libkernel's connect gets the same change in #4498.

A connected datagram socket given an address whose family byte is 0 is
now disconnected on the host first (AF_UNSPEC on Linux, a zeroed
address of the socket's family on Windows), and the call then fails
with EINVAL as before. Linux also drops an ephemeral local port on that
disconnect, so the port is bound again on the wildcard address, which
is what FreeBSD leaves. A host failure during the disconnect is
returned as the call's error. Stream sockets keep the previous path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 02:58:42 +00:00
Dean 0fb2f6c89a Merge pull request #4988 from babyhuey/feat/scenet-so-error
fix(libSceNet): report SO_ERROR from sceNetGetsockopt
2026-10-14 15:53:49 +13:00
ps54allandClaude Opus 5.5 df32a44f79 feat(libSceNet): implement sceNetResolverStartNtoa6
Resolve a host name to its first IPv6 address through the host resolver
(getaddrinfo with AF_INET6) and write the 16-byte address. The lookup
shares the IPv4 path's resolver bookkeeping (abort preservation, error
state); a name without an IPv6 address fails with RESOLVER_ENODNS like a
failed lookup. Nonzero flags throw.

Metal Gear Solid 4 Master Collection (PPSA18194) imports it and failed to
load without it (unresolved zl35YNs9jnI from libSceNet.prx).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:13:34 +02:00
babyhuey 0daf1d5ba3 fix(libSceNet): report SO_ERROR from sceNetGetsockopt 2026-10-13 03:15:45 -04:00
Adrià FranchandClaude b7c67a3364 fix(libkernel): accept NOTE_EXTEND on a directory watch on Windows
FreeBSD's vfs_kqfilter checks neither the vnode type nor fflags, so the
registration is valid; it is only delivered for a move between directories,
which the Windows directory handle cannot tell from a removal plus an addition.
Also moves the TechnicalDebt entries to docs/dev/debt after main split the file.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 22:37:31 +02:00