Documentation ¶
Index ¶
- Variables
- func CmpNet(a, b net.IPNet) int
- func CmpUDPAddr(a, b *net.UDPAddr) int
- func ContainsNet(outer, inner *net.IPNet) bool
- func FindNextPortToListen(network string, start, end int) (int, error)
- func FindRandomPortToListen(network string, min, max int) (int, error)
- func NewPacketPipeConn(l1 net.Addr, l2 net.Addr, depth int) (*PacketPipeConn, *PacketPipeConn)
- func NewSplitConn(recv ReceivePacketConn, send SendPacketConn) net.PacketConn
- func OffsetIP(ip net.IP, off int) net.IP
- type FilteredConn
- type PacketHandler
- type PacketHandlerConn
- type PacketPipe
- func (p *PacketPipe) Close() error
- func (p *PacketPipe) LocalAddr() net.Addr
- func (p *PacketPipe) ReadFrom(buf []byte) (int, net.Addr, error)
- func (p *PacketPipe) SetReadDeadline(t time.Time) error
- func (p *PacketPipe) SetWriteDeadline(t time.Time) error
- func (p *PacketPipe) WriteFrom(buf []byte, addr net.Addr) (int, error)
- type PacketPipeConn
- func (c *PacketPipeConn) Close() error
- func (c *PacketPipeConn) LocalAddr() net.Addr
- func (c *PacketPipeConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *PacketPipeConn) SetDeadline(t time.Time) error
- func (c *PacketPipeConn) SetReadDeadline(t time.Time) error
- func (c *PacketPipeConn) SetWriteDeadline(t time.Time) error
- func (c *PacketPipeConn) WriteTo(p []byte, _ net.Addr) (n int, err error)
- type ReceivePacketConn
- type STUNPacketHandler
- type SendPacketConn
- type SplitConn
- func (c *SplitConn) Close() error
- func (c *SplitConn) LocalAddr() net.Addr
- func (c *SplitConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (c *SplitConn) SetDeadline(t time.Time) error
- func (c *SplitConn) SetReadDeadline(t time.Time) error
- func (c *SplitConn) SetWriteDeadline(t time.Time) error
- func (c *SplitConn) WriteTo(p []byte, addr net.Addr) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFiltered = errors.New("packet has been filtered")
Functions ¶
func CmpUDPAddr ¶
func ContainsNet ¶
func FindRandomPortToListen ¶
func NewPacketPipeConn ¶
func NewPacketPipeConn(l1 net.Addr, l2 net.Addr, depth int) (*PacketPipeConn, *PacketPipeConn)
func NewSplitConn ¶
func NewSplitConn(recv ReceivePacketConn, send SendPacketConn) net.PacketConn
Types ¶
type FilteredConn ¶
type FilteredConn struct { net.PacketConn // contains filtered or unexported fields }
FilteredConn wraps a net.PacketConn
func NewFilteredConn ¶
func NewFilteredConn(c net.PacketConn, logger *log.Logger) *FilteredConn
func (*FilteredConn) AddPacketReadHandler ¶
func (c *FilteredConn) AddPacketReadHandler(h PacketHandler)
func (*FilteredConn) AddPacketReadHandlerConn ¶
func (c *FilteredConn) AddPacketReadHandlerConn(h PacketHandler) net.PacketConn
func (*FilteredConn) RemovePacketReadHandler ¶
func (c *FilteredConn) RemovePacketReadHandler(h PacketHandler)
type PacketHandler ¶
PacketHandler is a handler interface
type PacketHandlerConn ¶
type PacketHandlerConn struct { PacketHandler // contains filtered or unexported fields }
PacketHandlerConn implements a PacketHandler which forwards filtered reads to a pipe connection
func (*PacketHandlerConn) OnPacketRead ¶
type PacketPipe ¶
type PacketPipe struct {
// contains filtered or unexported fields
}
func NewPacketPipe ¶
func NewPacketPipe(lAddr net.Addr, depth int) *PacketPipe
func (*PacketPipe) Close ¶
func (p *PacketPipe) Close() error
func (*PacketPipe) LocalAddr ¶
func (p *PacketPipe) LocalAddr() net.Addr
func (*PacketPipe) SetReadDeadline ¶
func (p *PacketPipe) SetReadDeadline(t time.Time) error
func (*PacketPipe) SetWriteDeadline ¶
func (p *PacketPipe) SetWriteDeadline(t time.Time) error
type PacketPipeConn ¶
type PacketPipeConn struct {
// contains filtered or unexported fields
}
func (*PacketPipeConn) Close ¶
func (c *PacketPipeConn) Close() error
func (*PacketPipeConn) LocalAddr ¶
func (c *PacketPipeConn) LocalAddr() net.Addr
func (*PacketPipeConn) SetDeadline ¶
func (c *PacketPipeConn) SetDeadline(t time.Time) error
func (*PacketPipeConn) SetReadDeadline ¶
func (c *PacketPipeConn) SetReadDeadline(t time.Time) error
func (*PacketPipeConn) SetWriteDeadline ¶
func (c *PacketPipeConn) SetWriteDeadline(t time.Time) error
type ReceivePacketConn ¶
type STUNPacketHandler ¶
func (*STUNPacketHandler) OnPacketRead ¶
type SendPacketConn ¶
Click to show internal directories.
Click to hide internal directories.