mirror of
https://github.com/safing/portmaster
synced 2025-04-22 03:49:09 +00:00
28 lines
592 B
Go
28 lines
592 B
Go
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...,
|
|
)
|
|
}
|