feat(libSceNet): implement sceNetShowIfconfigWithMemory #8234

Merged
jagrat04 merged 3 commits from upstream-pr/8234 into main 2026-10-24 16:46:54 +00:00
jagrat04 commented 2026-10-20 05:10:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-20T05:10:26Z.


What

Implement sceNetShowIfconfigWithMemory in core/libs/prx/libSceNet/Export.cpp:

  • Validates the provided memory pool ID against active pools (g_pools) under g_mutex, returning NET_EBADF if invalid.
  • Throws std::runtime_error(__func__) for a valid pool once the net library is initialized, aligning with sibling diagnostics (sceNetShowIfconfig and sceNetShowNetstat) per 04f2d9a60f.
  • Adds guest unit tests in core/libs/tests/GuestSceNet.cpp verifying invalid pool failure, destroyed pool failure, and throwing on valid active pool.
  • Documents the function in docs/dev/debt/libSceNet.md folded into sceNetShowIfconfig, sceNetShowNetstat.

Tested

  • Linux (Ubuntu 24.04 via WSL2, GCC 15): ninja -C build-linux libSceNet guest_sce_net_tests built cleanly; ctest --test-dir build-linux -V -R guest_sce_net passed (1/1 tests passed 100%).
  • python tools/check_conventions.py --base origin/main: passed with 0 violations.

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:4931308559 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8234). Originally posted by [jagrat04](https://github.com/jagrat04) on 2026-10-20T05:10:26Z. --- ### What Implement `sceNetShowIfconfigWithMemory` in `core/libs/prx/libSceNet/Export.cpp`: - Validates the provided memory pool ID against active pools (`g_pools`) under `g_mutex`, returning `NET_EBADF` if invalid. - Throws `std::runtime_error(__func__)` for a valid pool once the net library is initialized, aligning with sibling diagnostics (`sceNetShowIfconfig` and `sceNetShowNetstat`) per `04f2d9a60f`. - Adds guest unit tests in `core/libs/tests/GuestSceNet.cpp` verifying invalid pool failure, destroyed pool failure, and throwing on valid active pool. - Documents the function in `docs/dev/debt/libSceNet.md` folded into `sceNetShowIfconfig, sceNetShowNetstat`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> - Linux (Ubuntu 24.04 via WSL2, GCC 15): `ninja -C build-linux libSceNet guest_sce_net_tests` built cleanly; `ctest --test-dir build-linux -V -R guest_sce_net` passed (1/1 tests passed 100%). - `python tools/check_conventions.py --base origin/main`: passed with 0 violations. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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 - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-22 02:07:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T02:07:05Z.


I am reviewing #9506, which adds sceNetSetDnsInfo, sceNetSetDns6Info and sceNetGetDns6Info plus a new registered test and debt entry. The overlap bot could not compare some of these branches because of base conflicts, and this PR author has not yet recorded an agreed merge order. Please confirm whether your current changes overlap these exact exports, CMake/test insertion, or debt section, and whether #9506 can land before your PR or should depend on yours. The #9506 author is being asked to record the agreed order in Depends on and the overlap note.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6330952785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8234#issuecomment-6330952785). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T02:07:05Z. --- I am reviewing #9506, which adds `sceNetSetDnsInfo`, `sceNetSetDns6Info` and `sceNetGetDns6Info` plus a new registered test and debt entry. The overlap bot could not compare some of these branches because of base conflicts, and this PR author has not yet recorded an agreed merge order. Please confirm whether your current changes overlap these exact exports, CMake/test insertion, or debt section, and whether #9506 can land before your PR or should depend on yours. The #9506 author is being asked to record the agreed order in `Depends on` and the overlap note.
jagrat04 commented 2026-10-22 08:18:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jagrat04 on 2026-10-22T08:18:01Z.


@MarcZX10 Thanks for checking! There is no overlap with #9506:

  • Exports: This PR implements sceNetShowIfconfigWithMemory only. It does not touch sceNetSetDnsInfo, sceNetSetDns6Info, or sceNetGetDns6Info.
  • Tests & CMake: Tests are in GuestSceNet.cpp and do not touch CMakeLists.txt or GuestNetDnsInfo.cpp.
  • Debt documentation: Touches Silent stubs in docs/dev/debt/libSceNet.md without affecting the DNS entries in Unknown function info.
  • Merge Order: Either PR can land first without issues (Depends on: none). This branch has also been cleanly rebased onto latest main.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336129350 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8234#issuecomment-6336129350). Originally posted by [jagrat04](https://github.com/jagrat04) on 2026-10-22T08:18:01Z. --- @MarcZX10 Thanks for checking! There is no overlap with #9506: - **Exports**: This PR implements `sceNetShowIfconfigWithMemory` only. It does not touch `sceNetSetDnsInfo`, `sceNetSetDns6Info`, or `sceNetGetDns6Info`. - **Tests & CMake**: Tests are in `GuestSceNet.cpp` and do not touch `CMakeLists.txt` or `GuestNetDnsInfo.cpp`. - **Debt documentation**: Touches `Silent stubs` in `docs/dev/debt/libSceNet.md` without affecting the DNS entries in `Unknown function info`. - **Merge Order**: Either PR can land first without issues (`Depends on: none`). This branch has also been cleanly rebased onto latest `main`.
adriadam10 commented 2026-10-24 08:12:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-24T08:12:06Z.

Review: CHANGES_REQUESTED


Since this was opened, main changed the sibling diagnostics (04f2d9a60f, "reject unsupported diagnostic output after initialization"): sceNetShowIfconfig and sceNetShowNetstat now throw once the net library is initialized, because the native output is not implemented, and GuestSceNet.cpp pins that (Failed(sceNetShowIfconfig(), 200)). Returning 0 from sceNetShowIfconfigWithMemory for a valid pool is the plausible-success-where-main-threw case we reject.

  • core/libs/prx/libSceNet/Export.cpp:2289: keep the pool check (NET_EBADF for an unknown pool), but for a valid pool throw like sceNetShowIfconfig (throw std::runtime_error(__func__)) instead of return 0.
  • core/libs/tests/GuestSceNet.cpp:280: drop sceNetShowIfconfigWithMemory(pool) == 0; the invalid-pool rows (-1, destroyed pool) stay and still fail without the change. Pin the valid-pool case as a throw if the harness has a way to (see how line 1690 handles sceNetShowIfconfig).
  • docs/dev/debt/libSceNet.md:5: this is no longer a silent stub. Fold it into the existing sceNetShowIfconfig, sceNetShowNetstat line (initialized calls throw).

Rebase onto current main when you push.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5637467975 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8234#pullrequestreview-5637467975). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-24T08:12:06Z. **Review:** CHANGES_REQUESTED --- Since this was opened, main changed the sibling diagnostics (04f2d9a60f, "reject unsupported diagnostic output after initialization"): `sceNetShowIfconfig` and `sceNetShowNetstat` now throw once the net library is initialized, because the native output is not implemented, and `GuestSceNet.cpp` pins that (`Failed(sceNetShowIfconfig(), 200)`). Returning 0 from `sceNetShowIfconfigWithMemory` for a valid pool is the plausible-success-where-main-threw case we reject. - `core/libs/prx/libSceNet/Export.cpp:2289`: keep the pool check (`NET_EBADF` for an unknown pool), but for a valid pool throw like `sceNetShowIfconfig` (`throw std::runtime_error(__func__)`) instead of `return 0`. - `core/libs/tests/GuestSceNet.cpp:280`: drop `sceNetShowIfconfigWithMemory(pool) == 0`; the invalid-pool rows (-1, destroyed pool) stay and still fail without the change. Pin the valid-pool case as a throw if the harness has a way to (see how line 1690 handles `sceNetShowIfconfig`). - `docs/dev/debt/libSceNet.md:5`: this is no longer a silent stub. Fold it into the existing `sceNetShowIfconfig, sceNetShowNetstat` line (initialized calls throw). Rebase onto current main when you push.
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!8234
No description provided.