feat(libSceNet): implement Show*WithMemory diagnostics and sceNetGetStatisticsInfo #12288

Merged
MarcZX10 merged 2 commits from upstream-pr/12288 into main 2026-10-28 23:12:42 +00:00
MarcZX10 commented 2026-10-28 07:39:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T07:39:31Z.


What

Implements four libSceNet exports that threw NotImplemented_nid_no_patch:

  • sceNetShowIfconfigWithMemory, sceNetShowPolicyWithMemory, sceNetShowRoute6WithMemory: validate the memory pool id (NET_EBADF with errno for an unknown or destroyed pool) and return success without printing, exactly as the existing sceNetShowRouteWithMemory does. Reference for the behaviour: shadPS4 src/core/libraries/net/net.cpp.
  • sceNetGetStatisticsInfo: the 24-byte statistics block (NetStatisticsInfo, six int32) is filled with "plenty free, nothing queued"; a null pointer fails with NET_EFAULT and errno. Layout and values follow shadPS4 net.cpp / net_types.h; not measured on a console.

Everything else in the library that still throws was left untouched on purpose. I could not find a credible public source for its prototype and behaviour (shadPS4 only has LOG_ERROR(STUBBED) bodies with no signatures for the Sync, Dump, EventCallback, Dhcp, Wlan, route/ARP/interface-table and sceNetCtl*IpcInt groups), and sceNetGetsockoptEx, sceNetSetsockoptEx, sceNetSocketInternal, sceNetSysctl, sceNetInetNtopWithScopeId, sceNetInetPtonWithScopeId and sceNetConfigGetDefaultRoute are already implemented by open PR #9578. The new silent stubs are listed in docs/dev/debt/libSceNet.md.

Tested

  • guest_sce_net (ctest) passes with the new cases in core/libs/tests/GuestSceNet.cpp (invalid pool, live pool, destroyed pool for the three diagnostics; null pointer, field invariants and ignored flags for the statistics call).
  • python3 tools/check_conventions.py --base upstream/main, test_public_headers.py --audit-only and git diff --check pass.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5046950189 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12288). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T07:39:31Z. --- ### What Implements four libSceNet exports that threw `NotImplemented_nid_no_patch`: - `sceNetShowIfconfigWithMemory`, `sceNetShowPolicyWithMemory`, `sceNetShowRoute6WithMemory`: validate the memory pool id (`NET_EBADF` with errno for an unknown or destroyed pool) and return success without printing, exactly as the existing `sceNetShowRouteWithMemory` does. Reference for the behaviour: shadPS4 `src/core/libraries/net/net.cpp`. - `sceNetGetStatisticsInfo`: the 24-byte statistics block (`NetStatisticsInfo`, six `int32`) is filled with "plenty free, nothing queued"; a null pointer fails with `NET_EFAULT` and errno. Layout and values follow shadPS4 `net.cpp` / `net_types.h`; not measured on a console. Everything else in the library that still throws was left untouched on purpose. I could not find a credible public source for its prototype and behaviour (shadPS4 only has `LOG_ERROR(STUBBED)` bodies with no signatures for the Sync, Dump, EventCallback, Dhcp, Wlan, route/ARP/interface-table and `sceNetCtl*IpcInt` groups), and `sceNetGetsockoptEx`, `sceNetSetsockoptEx`, `sceNetSocketInternal`, `sceNetSysctl`, `sceNetInetNtopWithScopeId`, `sceNetInetPtonWithScopeId` and `sceNetConfigGetDefaultRoute` are already implemented by open PR #9578. The new silent stubs are listed in `docs/dev/debt/libSceNet.md`. ### Tested - `guest_sce_net` (ctest) passes with the new cases in `core/libs/tests/GuestSceNet.cpp` (invalid pool, live pool, destroyed pool for the three diagnostics; null pointer, field invariants and ignored flags for the statistics call). - `python3 tools/check_conventions.py --base upstream/main`, `test_public_headers.py --audit-only` and `git diff --check` pass. ### Checklist - [x] Based on current main; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation .md files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - Depends on: none - Fixes: none - Unblocks: none - GPUs tested: n/a - AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12288
No description provided.