Documentation
¶
Overview ¶
Package l3stack terminates raw IP flows from a virtual interface and hands their payload to l3session. It is an optional adapter: the rendr root module and target graph do not depend on a userspace IP stack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Device virtualif.FullDuplexCancellableDevice
Router l3ingress.FlowDecisionFunc
Starter *l3session.Starter
// FlowTable is optional. When nil, Gateway creates one around Router.
FlowTable *l3ingress.FlowTable
OnParseError l3ingress.ParseErrorHandler
OnFlowError FlowErrorHandler
TCPMaxInFlight int
LinkQueue int
// TCPPeerReadyTimeout bounds each SYN's wait for the remote egress. Zero
// uses l3session.DefaultTCPPeerReadyTimeout.
TCPPeerReadyTimeout time.Duration
// FlowLifetime controls automatic active-flow and closed-history reaping.
// New normalizes and retains an immutable value copy.
FlowLifetime FlowLifetimeTuning
}
Config assembles one virtual-interface ingress gateway.
type FlowErrorHandler ¶
type FlowErrorHandler func(l3ingress.L3Identity, error)
FlowErrorHandler observes a flow-local failure. One rejected or failed flow does not terminate unrelated sessions or the virtual interface pump.
type FlowLifetimeTuning ¶
type FlowLifetimeTuning struct {
// UDPIdle is the maximum interval without ingress or a delivered reply.
// Zero selects 30 seconds.
UDPIdle time.Duration
// TCPUnestablishedIdle bounds pending, denied, orphan, and otherwise
// unestablished TCP state. Zero selects 10 seconds. Established TCP is
// retained until its own transport lifecycle closes it.
TCPUnestablishedIdle time.Duration
// ClosedRetention bounds diagnostic closed-flow snapshots. Zero selects
// five minutes.
ClosedRetention time.Duration
}
FlowLifetimeTuning controls bounded L3 flow retention. Every duration is mandatory: zero selects its default and negative values are rejected.
func DefaultFlowLifetimeTuning ¶
func DefaultFlowLifetimeTuning() FlowLifetimeTuning
DefaultFlowLifetimeTuning returns the immutable defaults copied by New.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway owns one gVisor TCP endpoint domain plus the rendr per-flow relays. It does not own Device; the embedding application controls interface policy and lifetime.
func (*Gateway) HandlePacket ¶
HandlePacket implements l3ingress.PacketHandler.
func (*Gateway) ReapIdle ¶
func (g *Gateway) ReapIdle(cutoff time.Time) []l3ingress.FlowSnapshot
ReapIdle applies protocol-aware idle semantics with one explicit cutoff. It is retained as a deterministic administrative hook; Run owns automatic scheduling with the configured protocol-specific lifetimes.