natpmp

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: 7 Imported by: 2

Documentation

Overview

Package natpmp implements a NAT-PMP (RFC 6886) 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 a NAT-PMP client instance.

func (*Client) AddPortMapping

func (c *Client) AddPortMapping(description 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. A 0 duration will request a 7200 second lease.

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)

Jump to

Keyboard shortcuts

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