mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-08 04:50:11 +02:00
26 lines
484 B
Go
26 lines
484 B
Go
package netlink
|
|
|
|
import (
|
|
"github.com/qdm12/gluetun/internal/mod"
|
|
"github.com/qdm12/log"
|
|
)
|
|
|
|
type NetLink struct {
|
|
debugLogger DebugLogger
|
|
|
|
// Fixed state
|
|
conntrackNetlink bool
|
|
}
|
|
|
|
func New(debugLogger DebugLogger) *NetLink {
|
|
conntrackNetlink := mod.Probe("nf_conntrack_netlink") == nil
|
|
return &NetLink{
|
|
debugLogger: debugLogger,
|
|
conntrackNetlink: conntrackNetlink,
|
|
}
|
|
}
|
|
|
|
func (n *NetLink) PatchLoggerLevel(level log.Level) {
|
|
n.debugLogger.Patch(log.SetLevel(level))
|
|
}
|