Documentation
¶
Overview ¶
Package forwarder provides a network session forwarder.
Index ¶
- type Forwarder
- func (f *Forwarder) Close() error
- func (f *Forwarder) ICMPv4ProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
- func (f *Forwarder) ICMPv6ProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
- func (f *Forwarder) TCPProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
- func (f *Forwarder) UDPProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
- func (f *Forwarder) ValidDestination(addr netip.Addr) bool
- type ForwarderConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
Forwarder is a network session forwarder.
func (*Forwarder) ICMPv4ProtocolHandler ¶ added in v0.9.0
func (f *Forwarder) ICMPv4ProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
ICMPv4ProtocolHandler forwards ICMPv4 sessions.
func (*Forwarder) ICMPv6ProtocolHandler ¶ added in v0.9.0
func (f *Forwarder) ICMPv6ProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
ICMPv6ProtocolHandler forwards ICMPv6 sessions.
func (*Forwarder) TCPProtocolHandler ¶
func (f *Forwarder) TCPProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
TCPProtocolHandler forwards TCP sessions.
func (*Forwarder) UDPProtocolHandler ¶
func (f *Forwarder) UDPProtocolHandler(id stack.TransportEndpointID, pkt *stack.PacketBuffer) bool
UDPProtocolHandler forwards UDP sessions.
type ForwarderConfig ¶
type ForwarderConfig struct {
// Allowed destination prefixes.
AllowedDestinations []netip.Prefix
// Denied destination prefixes.
DeniedDestinations []netip.Prefix
// Maximum number of in-flight TCP connections.
MaxInFlightTCPConnections *int
// How long to wait for activity on a UDP session before considering it dead.
UDPIdleTimeout *time.Duration
// How long to wait for an ICMP echo reply before considering it timed out.
PingTimeout *time.Duration
// Enable NAT64.
EnableNAT64 *bool
// NAT64 prefix.
NAT64Prefix *netip.Prefix
}
ForwarderConfig is the configuration for the network session forwarder.
Click to show internal directories.
Click to hide internal directories.