MCPcopy Create free account
hub / github.com/SamNet-dev/snix / Backend

Struct Backend

platform/linux/nfqueue.go:51–66  ·  view source on GitHub ↗

Backend implements platform.Backend on Linux.

Source from the content-addressed store, hash-verified

49
50// Backend implements platform.Backend on Linux.
51type Backend struct {
52 cfg Config
53
54 mu sync.Mutex
55 opened bool
56 scope platform.Scope
57 nfq *nfqueue.Nfqueue
58 rawSock int
59 packets chan platform.Packet
60 closed chan struct{}
61 // cancelReader cancels the context passed to nfqueue.Register. nfqueue's
62 // internal reader goroutine only exits when this context is Done, so
63 // Close() must call it before invoking nfq.Close() or Close hangs.
64 cancelReader context.CancelFunc
65 addedRules [][]string // exact args we passed to iptables -A, for safe cleanup
66}
67
68// New returns an unopened Backend.
69func New(cfg Config) *Backend {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected