upnp

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	XMLName     xml.Name    `xml:"device"`
	DeviceType  string      `xml:"deviceType"`
	DeviceList  DeviceList  `xml:"deviceList"`
	ServiceList ServiceList `xml:"serviceList"`
}

type DeviceList

type DeviceList struct {
	Device []Device `xml:"device"`
}

type Envelope

type Envelope struct {
	XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
	Soap    *SoapBody
}

type ExternalIPAddress

type ExternalIPAddress struct {
	XMLName xml.Name `xml:"NewExternalIPAddress"`
	IP      string
}

type ExternalIPAddressResponse

type ExternalIPAddressResponse struct {
	XMLName   xml.Name `xml:"GetExternalIPAddressResponse"`
	IPAddress string   `xml:"NewExternalIPAddress"`
}

type Root

type Root struct {
	Device Device
}

type Service

type Service struct {
	ServiceType string `xml:"serviceType"`
	ControlURL  string `xml:"controlURL"`
}

type ServiceList

type ServiceList struct {
	Service []Service `xml:"service"`
}

type SoapBody

type SoapBody struct {
	XMLName    xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"`
	ExternalIP *ExternalIPAddressResponse
}

type UPnPNAT

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

UPnPNAT Just enough UPnP to be able to forward ports

func Discover

func Discover() (nat *UPnPNAT, err error)

func (*UPnPNAT) AddPortMapping

func (n *UPnPNAT) AddPortMapping(protocol string, externalPort, internalPort int, description string, timeout int) (mappedExternalPort int, err error)

func (*UPnPNAT) DeletePortMapping

func (n *UPnPNAT) DeletePortMapping(protocol string, externalPort, internalPort int) (err error)

func (*UPnPNAT) GetExternalAddress

func (n *UPnPNAT) GetExternalAddress() (addr net.IP, err error)

Jump to

Keyboard shortcuts

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