tendermint: github.com/tendermint/tendermint/p2p/upnp Index | Files

package upnp

import "github.com/tendermint/tendermint/p2p/upnp"

Taken from taipei-torrent. Just enough UPnP to be able to forward ports For more information, see: http://www.upnp-hacks.org/upnp.html


Package Files

probe.go upnp.go

type Capabilities Uses

type Capabilities struct {
    PortMapping bool
    Hairpin     bool

func Probe Uses

func Probe(logger log.Logger) (caps Capabilities, err error)

type Device Uses

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

type DeviceList Uses

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

type Envelope Uses

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

type ExternalIPAddress Uses

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

type ExternalIPAddressResponse Uses

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

type NAT Uses

type NAT interface {
    GetExternalAddress() (addr net.IP, err error)
        protocol string,
        internalPort int,
        description string,
        timeout int) (mappedExternalPort int, err error)
    DeletePortMapping(protocol string, externalPort, internalPort int) (err error)

protocol is either "udp" or "tcp"

func Discover Uses

func Discover() (nat NAT, err error)

type Root Uses

type Root struct {
    Device Device

type Service Uses

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

type ServiceList Uses

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

type SoapBody Uses

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

Package upnp imports 11 packages (graph) and is imported by 7 packages. Updated 2019-12-06. Refresh now. Tools for package owners.