mirror of
https://github.com/safing/portmaster
synced 2025-09-09 22:04:56 +00:00
Add debug interfaces for wfp and iptables
This commit is contained in:
parent
b0b2fff5d7
commit
45339ce0c2
9 changed files with 56957 additions and 1 deletions
28
compat/debug_linux.go
Normal file
28
compat/debug_linux.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
package compat
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/safing/portbase/utils/debug"
|
||||
)
|
||||
|
||||
// AddToDebugInfo adds compatibility data to the given debug.Info.
|
||||
func AddToDebugInfo(di *debug.Info) {
|
||||
// Get iptables state and add error info if it fails.
|
||||
chains, err := GetIPTablesChains()
|
||||
if err != nil {
|
||||
di.AddSection(
|
||||
"Compatibility: IPTables Chains (failed)",
|
||||
debug.UseCodeSection,
|
||||
err.Error(),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Add data as section.
|
||||
di.AddSection(
|
||||
fmt.Sprintf("Compatibility: IPTables Chains (%d)", len(chains)-10),
|
||||
debug.UseCodeSection|debug.AddContentLineBreaks,
|
||||
chains...,
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue