Versions in this module Expand all Collapse all v0 v0.0.2 May 14, 2024 Changes in this version + var ErrBindAlreadyOpen = errors.New("bind is already open") + var ErrWrongEndpointType = errors.New("endpoint type does not correspond with bind type") + type Bind interface + Close func() error + Open func(port uint16) (fns []ReceiveFunc, actualPort uint16, err error) + ParseEndpoint func(s string) (Endpoint, error) + Send func(b []byte, ep Endpoint) error + SetMark func(mark uint32) error + func NewDefaultBind() Bind + func NewLinuxSocketBind() Bind + func NewStdNetBind() Bind + func NewWinRingBind() Bind + type BindSocketToInterface interface + BindSocketToInterface4 func(interfaceIndex uint32, blackhole bool) error + BindSocketToInterface6 func(interfaceIndex uint32, blackhole bool) error + type Endpoint interface + ClearSrc func() + DstIP func() netip.Addr + DstToBytes func() []byte + DstToString func() string + SrcIP func() netip.Addr + SrcToString func() string + type LinuxSocketBind struct — linux/amd64 + func (*LinuxSocketBind) ParseEndpoint(s string) (Endpoint, error) + func (bind *LinuxSocketBind) Close() error + func (bind *LinuxSocketBind) Open(port uint16) ([]ReceiveFunc, uint16, error) + func (bind *LinuxSocketBind) Send(buff []byte, end Endpoint) error + func (bind *LinuxSocketBind) SetMark(value uint32) error + type LinuxSocketEndpoint struct — linux/amd64 + func (end *LinuxSocketEndpoint) ClearDst() + func (end *LinuxSocketEndpoint) ClearSrc() + func (end *LinuxSocketEndpoint) DstIP() netip.Addr + func (end *LinuxSocketEndpoint) DstToBytes() []byte + func (end *LinuxSocketEndpoint) DstToString() string + func (end *LinuxSocketEndpoint) SrcIP() netip.Addr + func (end *LinuxSocketEndpoint) SrcToString() string + func (endpoint *LinuxSocketEndpoint) Dst4() *unix.SockaddrInet4 + func (endpoint *LinuxSocketEndpoint) IsV6() bool + func (endpoint *LinuxSocketEndpoint) Src4() *ipv4Source + type PeekLookAtSocketFd interface + PeekLookAtSocketFd4 func() (fd int, err error) + PeekLookAtSocketFd6 func() (fd int, err error) + type ReceiveFunc func(b []byte) (n int, ep Endpoint, err error) + func (fn ReceiveFunc) PrettyName() string + type StdNetBind struct + func (*StdNetBind) ParseEndpoint(s string) (Endpoint, error) + func (bind *StdNetBind) BindSocketToInterface4(interfaceIndex uint32, blackhole bool) error + func (bind *StdNetBind) BindSocketToInterface6(interfaceIndex uint32, blackhole bool) error + func (bind *StdNetBind) Close() error + func (bind *StdNetBind) Open(uport uint16) ([]ReceiveFunc, uint16, error) + func (bind *StdNetBind) Send(buff []byte, endpoint Endpoint) error + func (bind *StdNetBind) SetMark(mark uint32) error + type StdNetEndpoint netip.AddrPort + func (StdNetEndpoint) ClearSrc() + func (e StdNetEndpoint) DstIP() netip.Addr + func (e StdNetEndpoint) DstToBytes() []byte + func (e StdNetEndpoint) DstToString() string + func (e StdNetEndpoint) SrcIP() netip.Addr + func (e StdNetEndpoint) SrcToString() string + type WinRingBind struct — windows/amd64 + func (*WinRingBind) ParseEndpoint(s string) (Endpoint, error) + func (bind *WinRingBind) BindSocketToInterface4(interfaceIndex uint32, blackhole bool) error + func (bind *WinRingBind) BindSocketToInterface6(interfaceIndex uint32, blackhole bool) error + func (bind *WinRingBind) Close() error + func (bind *WinRingBind) Open(port uint16) (recvFns []ReceiveFunc, selectedPort uint16, err error) + func (bind *WinRingBind) Send(buf []byte, endpoint Endpoint) error + func (bind *WinRingBind) SetMark(mark uint32) error + type WinRingEndpoint struct — windows/amd64 + func (*WinRingEndpoint) ClearSrc() + func (e *WinRingEndpoint) DstIP() netip.Addr + func (e *WinRingEndpoint) DstToBytes() []byte + func (e *WinRingEndpoint) DstToString() string + func (e *WinRingEndpoint) SrcIP() netip.Addr + func (e *WinRingEndpoint) SrcToString() string