internal

package
v0.0.0-...-f0f9546 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func NewConn

func NewConn(mAddr, lAddr, rAddr *net.UDPAddr, lFactory, rFactory PacketConnFactory, ttl int) *Conn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Listen

func (c *Conn) Listen(packets chan Packet, quit chan struct{})

func (*Conn) MakeUDPSocket

func (c *Conn) MakeUDPSocket(ifaces []net.Interface) (err error)

func (*Conn) Multicast

func (c *Conn) Multicast(b []byte) error

func (*Conn) SendTo

func (c *Conn) SendTo(b []byte, dst *net.UDPAddr) error

func (*Conn) SetMulticastTTL

func (c *Conn) SetMulticastTTL(ttl int) error

func (*Conn) SetPort

func (c *Conn) SetPort(mPort, lPort, rPort int)

type IPv4PacketConnFactory

type IPv4PacketConnFactory struct {
	Group *net.UDPAddr
}

func (*IPv4PacketConnFactory) MakeUDPSocket

func (f *IPv4PacketConnFactory) MakeUDPSocket(ifaces []net.Interface, addr *net.UDPAddr, ttl int) (net.PacketConn, error)

type IPv6PacketConnFactory

type IPv6PacketConnFactory struct {
	Group *net.UDPAddr
}

func (*IPv6PacketConnFactory) MakeUDPSocket

func (f *IPv6PacketConnFactory) MakeUDPSocket(ifaces []net.Interface, addr *net.UDPAddr, ttl int) (net.PacketConn, error)

type Packet

type Packet struct {
	Addr  net.Addr
	Error error
	Data  []byte
}

Packet A small struct used to send received UDP packets and information about their interface / source address through a channel.

type PacketConnFactory

type PacketConnFactory interface {
	MakeUDPSocket(iface []net.Interface, addr *net.UDPAddr, ttl int) (net.PacketConn, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL