wip: migrate to mono-repo. SPN has already been moved to spn/
This commit is contained in:
28
service/compat/debug_linux.go
Normal file
28
service/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...,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user