-
-
Notifications
You must be signed in to change notification settings - Fork 707
[client] Add output similar to wg show to the debug package #3922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- add interface to status recorder - fix usp parse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds WireGuard interface statistics to the debug bundle by introducing a FullStats method across the interface layers and wiring its output into the debug generator.
- Define a new
WGIfaceStatus
interface and expose it viaStatus.PeersStatus()
- Implement
FullStats()
for all WireGuard backends (kernel, userspace, configurer) - Generate and include a
wg show
–style output in the debug archive
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
client/internal/peer/status.go | Introduce WGIfaceStatus , SetWgIface , and PeersStatus |
client/internal/iface_common.go | Add FullStats() to wgIfaceBase interface |
client/internal/engine.go | Call statusRecorder.SetWgIface(...) on interface start/stop |
client/internal/debug/wgshow.go | Generate WireGuard stats in toWGShowFormat and add to bundle |
client/internal/debug/debug.go | Hook addWgShow() into bundle creation |
client/iface/iface.go | Implement FullStats() proxy on WGIface |
client/iface/device/interface.go | Add FullStats() to WGConfigurer interface |
client/iface/configurer/wgshow.go | Define Stats and Peer types for WG stats |
client/iface/configurer/usp.go | Implement FullStats() and parseStatus() for userspace configurer |
client/iface/configurer/kernel_unix.go | Implement FullStats() using wgctrl for kernel configurer |
Comments suppressed due to low confidence (3)
client/iface/configurer/usp.go:22
- [nitpick] This constant lacks the
ipcKey
prefix used by other IPC-related keys, which may confuse readers. Consider renaming toipcKeyPrivateKey
.
privateKey = "private_key"
client/internal/peer/status.go:1050
- [nitpick] The error message references the internal variable name
wgInterface
. It would be clearer to say something like "WireGuard interface not set".
return nil, fmt.Errorf("wgInterface is nil, cannot retrieve peers status")
client/internal/peer/status.go:35
- [nitpick] The name
WGIfaceStatus
mixes abbreviations and may be unclear; considerWireGuardInterfaceStatus
orWGInterfaceStatsProvider
for clarity.
type WGIfaceStatus interface {
Introduced a mechanism to anonymize peer endpoint addresses in wgshow debug output when anonymization is enabled. Added a new method, AnonymizeUDPAddr, to handle UDP address anonymization in the Anonymizer module.
Replaces IP-only endpoint formatting with full endpoint string for improved clarity. This ensures the debug output provides more comprehensive information about peer endpoints.
Updated the debug output of the fwmark field to display in hexadecimal format instead of decimal. This improves readability and consistency with common representations of such values.
|
Describe your changes
Add output similar to wg show to the debug package.
Issue ticket number and link
Stack
Checklist