stdnet

package
v0.66.2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: BSD-3-Clause Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stdnet is an extension of the pion's stdnet. With it the list of the interface can come from external source. More info: https://github.com/golang/go/issues/40569

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InterfaceFilter added in v0.16.0

func InterfaceFilter(disallowList []string) func(string) bool

InterfaceFilter is a function passed to ICE Agent to filter out not allowed interfaces to avoid building tunnel over them.

Types

type ExternalIFaceDiscover added in v0.16.0

type ExternalIFaceDiscover interface {
	// IFaces return with the description of the interfaces
	IFaces() (string, error)
}

ExternalIFaceDiscover provide an option for external services (mobile) to collect network interface information

type Net

type Net struct {
	stdnet.Net
	// contains filtered or unexported fields
}

Net is an implementation of the net.Net interface based on functions of the standard net package.

func NewNet

func NewNet(ctx context.Context, disallowList []string) (*Net, error)

NewNet creates a new StdNet instance.

func NewNetWithDiscover added in v0.16.0

func NewNetWithDiscover(ctx context.Context, iFaceDiscover ExternalIFaceDiscover, disallowList []string) (*Net, error)

NewNetWithDiscover creates a new StdNet instance.

func (*Net) Dial added in v0.26.4

func (n *Net) Dial(network, address string) (net.Conn, error)

Dial connects to the address on the named network.

func (*Net) DialTCP added in v0.26.4

func (n *Net) DialTCP(network string, laddr, raddr *net.TCPAddr) (transport.TCPConn, error)

DialTCP connects to the address on the named TCP network.

func (*Net) DialUDP added in v0.26.4

func (n *Net) DialUDP(network string, laddr, raddr *net.UDPAddr) (transport.UDPConn, error)

DialUDP connects to the address on the named UDP network.

func (*Net) InterfaceByIndex

func (n *Net) InterfaceByIndex(index int) (*transport.Interface, error)

InterfaceByIndex returns the interface specified by index.

On Solaris, it returns one of the logical network interfaces sharing the logical data link; for more precision use InterfaceByName.

func (*Net) InterfaceByName

func (n *Net) InterfaceByName(name string) (*transport.Interface, error)

InterfaceByName returns the interface specified by name.

func (*Net) Interfaces

func (n *Net) Interfaces() ([]*transport.Interface, error)

Interfaces returns a slice of interfaces which are available on the system

func (*Net) ListenPacket added in v0.26.4

func (n *Net) ListenPacket(network, address string) (net.PacketConn, error)

ListenPacket listens for incoming packets on the given network and address.

func (*Net) ListenUDP added in v0.26.4

func (n *Net) ListenUDP(network string, locAddr *net.UDPAddr) (transport.UDPConn, error)

ListenUDP acts like ListenPacket for UDP networks.

func (*Net) ResolveTCPAddr added in v0.59.13

func (n *Net) ResolveTCPAddr(network, address string) (*net.TCPAddr, error)

ResolveTCPAddr resolves TCP addresses with context support and timeout.

func (*Net) ResolveUDPAddr added in v0.59.13

func (n *Net) ResolveUDPAddr(network, address string) (*net.UDPAddr, error)

ResolveUDPAddr resolves UDP addresses with context support and timeout.

func (*Net) UpdateInterfaces

func (n *Net) UpdateInterfaces() (err error)

UpdateInterfaces updates the internal list of network interfaces and associated addresses filtering them by name. The interfaces are discovered by an external iFaceDiscover function or by a default discoverer if the external one wasn't specified.

Jump to

Keyboard shortcuts

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