Documentation
¶
Index ¶
- func Close[T any](ch chan T) (ok bool)
- func ConnBGP(s *core.StageBase, conn net.Conn, in *pipe.Input) error
- func ConnPublish(s *core.StageBase, conn net.Conn)
- func DialRetry(s *core.StageBase, dialer *net.Dialer, network, address string) (net.Conn, error)
- func Send[T any](ch chan T, v T) (ok bool)
- type ControlFunc
- type Stdlog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Close ¶
Close closes channel ch if ch != nil. It recovers from panic if the channel is already closed. It returns ok=true if the channel was closed successfully.
func ConnPublish ¶
ConnPublish publishes connection information to stage s's pipe KV store, for the benefit of other stages. It sets L_LOCAL_ADDR, L_LOCAL_PORT, L_REMOTE_ADDR, L_REMOTE_PORT for the first stage, and R_LOCAL_ADDR, R_LOCAL_PORT, R_REMOTE_ADDR, R_REMOTE_PORT for the last stage.
Types ¶
type ControlFunc ¶ added in v0.21.0
ControlFunc is a net.Dialer / net.ListenConfig socket control callback.
func Chain ¶ added in v0.21.0
func Chain(fns ...ControlFunc) ControlFunc
Chain composes control funcs into one, skipping nils and stopping on the first error.
func TcpMd5 ¶
func TcpMd5(md5pass string) ControlFunc
TcpMd5 returns a control func installing the TCP-MD5 signature password.
func Transparent ¶ added in v0.21.0
func Transparent() ControlFunc
Transparent returns a control func enabling IP_TRANSPARENT (Linux TPROXY): it lets a listener accept connections destined to a foreign address, and a dialer bind to (spoof) a non-local source address.
func Ttl ¶ added in v0.21.0
func Ttl(ttl int) ControlFunc
Ttl returns a control func setting the outgoing IP TTL / hop limit (0 leaves the kernel default; 255 satisfies GTSM / RFC 5082).