Documentation
¶
Overview ¶
Package linux implements the snix Backend using Linux netfilter NFQUEUE plus managed iptables rules.
Safety invariants:
- Installed rules are narrowly scoped to a single (remoteIP, remotePort) pair and never touch the SSH control plane.
- All rules use `--queue-bypass` so a crashed or wedged snix never blackholes user traffic.
- installRules and removeRules are idempotent. Close() is safe to call multiple times.
- We record the exact rule specs we added and only delete those; we never flush chains.
Index ¶
Constants ¶
View Source
const ( // DefaultQueueNum is the default NFQUEUE number we install rules for. // Picked high to avoid collisions with common systems. DefaultQueueNum = 42 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements platform.Backend on Linux.
func (*Backend) Inject ¶
Inject writes a fully formed IPv4 packet to the raw socket. The destination address is read from the IP header (bytes 16:20).
Click to show internal directories.
Click to hide internal directories.