Documentation
¶
Index ¶
Constants ¶
const BlockMark = 0x4d475442 // "MGTB"
BlockMark is the packet mark of the runtime's block verdict (NF_REPEAT): on the repeat the guard's nft chain stores it as the connection's ct mark and drops the packet, and the kernel drops every later packet of that connection, in both directions, without queueing it. An unusual constant, so no other software's marks match it.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detection ¶
type Detection struct {
L4Protocol string
Signature torrentguard.Protocol
Evidence torrentguard.Evidence
DstPort uint16
TunnelIface string
TunnelIP netip.Addr
}
Detection is one BitTorrent request a tunnel client sent. It names who (the tunnel address, which the agent maps to a user and does not report), what matched and the destination port; never the destination address.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime owns one kernel queue and a bounded userspace flow table. The nft rules that reference it must always use queue bypass.
func Start ¶
Start binds a fail-open netfilter queue and starts its packet and event loops. The caller must install nft rules with queue bypass after this succeeds and remove those rules before Close.
func (*Runtime) Close ¶
Close unbinds the owned queue and closes its netlink socket. Callers should remove the nft table first; its queue statements use bypass as a second fail-open safeguard.
func (*Runtime) SetCallback ¶
SetCallback replaces the current event callback without interrupting packet inspection. Callback execution is isolated from the NFQUEUE receive loop.
func (*Runtime) SetInterfaces ¶
SetInterfaces refreshes the exact active interface-index mapping and drops flow state only for interfaces whose identity changed or was removed.