upnp

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)

Functions

This section is empty.

Types

type NAT

type NAT interface {
	// GetExternalAddress - Get the external address from outside the NAT.
	GetExternalAddress() (addr net.IP, e error)
	// AddPortMapping - Add a port mapping for protocol (
	//  "udp" or "tcp") from external port to internal port with description lasting
	// for timeout.
	AddPortMapping(
		protocol string, externalPort, internalPort int,
		description string, timeout int,
	) (mappedExternalPort int, e error)
	// DeletePortMapping - Remove a previously added port mapping from external
	// port to internal port.
	DeletePortMapping(
		protocol string, externalPort,
		internalPort int,
	) (e error)
}

NAT is an interface representing a NAT traversal options for example UPNP or NAT-PMP. It provides methods to query and manipulate this traversal to allow access to services.

func Discover

func Discover() (nat NAT, e error)

Discover searches the local network for a UPnP router returning a NAT for the network if so, nil if not.

Jump to

Keyboard shortcuts

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