Skip to content

feat: Add network connection retrieval for AIX platform#1983

Closed
Dylan-M wants to merge 6 commits into
shirou:masterfrom
Dylan-M:dylanmyers/aix_net
Closed

feat: Add network connection retrieval for AIX platform#1983
Dylan-M wants to merge 6 commits into
shirou:masterfrom
Dylan-M:dylanmyers/aix_net

Conversation

@Dylan-M
Copy link
Copy Markdown
Contributor

@Dylan-M Dylan-M commented Dec 23, 2025

Description

Implement network connection retrieval functionality for AIX platform using netstat and rmsock commands.

Part 5 of splitting #1969: net package
Depends on #1979 #1980 #1981 #1982

Changes

  • Add errors import for error handling
  • Implement connectionsPidMaxWithoutUidsWithContext() to retrieve network connections
  • Add getAIXConnections() helper function to get all network connections
  • Add getAIXConnectionsForPid() helper function to get connections for a specific process
  • Add resolveAIXSockToConnection() helper function to resolve socket addresses to connection info
  • Add comprehensive test suite in net_aix_test.go

Testing

All new code has been tested with comprehensive unit tests covering:

  • Retrieval of all network connections
  • Filtering by process ID
  • TCP and UDP connection handling
  • Connection maximum limits

Platform

  • AIX

@Dylan-M Dylan-M changed the title Add network connection retrieval for AIX platform feat: Add network connection retrieval for AIX platform Dec 23, 2025
@Dylan-M Dylan-M marked this pull request as ready for review December 23, 2025 18:07
@Dylan-M Dylan-M force-pushed the dylanmyers/aix_net branch from 2e34db0 to e24f8fb Compare January 24, 2026 14:42
@Dylan-M Dylan-M force-pushed the dylanmyers/aix_net branch 2 times, most recently from 75f1291 to 4f9c81c Compare February 16, 2026 14:34
@Dylan-M Dylan-M force-pushed the dylanmyers/aix_net branch 3 times, most recently from c9c9625 to 753fba3 Compare February 27, 2026 17:31
@Dylan-M Dylan-M force-pushed the dylanmyers/aix_net branch from 4d39083 to 1204bb7 Compare March 20, 2026 21:19
@Dylan-M Dylan-M force-pushed the dylanmyers/aix_net branch from 1204bb7 to 3eedb93 Compare March 20, 2026 21:33
@shirou
Copy link
Copy Markdown
Owner

shirou commented Mar 21, 2026

This PR is relatively small compared to the others, so I could review it. However, there are two concerns:

  1. Two independent features bundled together: ProtoCounters and Connections are separate functionalities and should be in separate PRs.
  2. Root privilege requirement: rmsock, which is used for resolving socket-to-PID mapping in the Connections implementation, requires root privileges. Almost every function in gopsutil works without root privileges. If a function does require elevated permissions, that needs to be well-documented and discussed before merging — it affects the expectations of all users of this library.

I'm closing this along with your other open PRs for the reasons described in #1980. I'd welcome resubmission as smaller, focused PRs with the root privilege concern addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants