upnp

package
v0.0.0-...-481599e Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2015 License: BSD-3-Clause Imports: 17 Imported by: 2

Documentation

Overview

Package upnp implements a simple UPnP client suitable for NAT traversal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is UPnP client instance.

func (*Client) AddPortMapping

func (c *Client) AddPortMapping(descr string, internalPort, externalPort, duration int) error

AddPortMapping adds a new TCP/IP port mapping. The internal IP address of the client is used as the destination. Per the UPnP spec, duration can range from 0 to 604800, with the behavior on 0 changing depending on the version of the spec.

func (*Client) Close

func (c *Client) Close()

func (*Client) DeletePortMapping

func (c *Client) DeletePortMapping(internalPort, externalPort int) error

DeletePortMapping removes an existing TCP/IP port forwarding entry between clientIP:internalPort and 0.0.0.0:externalPort.

func (*Client) GetExternalIPAddress

func (c *Client) GetExternalIPAddress() (net.IP, error)

GetExternalIPAddress queries the router's external IP address.

func (*Client) GetListOfPortMappings

func (c *Client) GetListOfPortMappings() ([]string, error)

GetListOfPortMappings queries the router for the list of port forwarding entries.

func (*Client) Vlogf

func (c *Client) Vlogf(f string, a ...interface{})

type ClientFactory

type ClientFactory struct{}

func (*ClientFactory) Name

func (f *ClientFactory) Name() string

func (*ClientFactory) New

func (f *ClientFactory) New(verbose bool) (base.Client, error)

Directories

Path Synopsis
Package httpu implements a HTTP(M)U client as specified in the IETF draft "Multicast and Unicast UDP HTTP Messages".
Package httpu implements a HTTP(M)U client as specified in the IETF draft "Multicast and Unicast UDP HTTP Messages".

Jump to

Keyboard shortcuts

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