Documentation ¶
Overview ¶
Package natpmp implements a NAT-PMP (RFC 6886) client suitable for NAT traversal.
Index ¶
- type Client
- func (c *Client) AddPortMapping(description string, internalPort, externalPort, duration int) error
- func (c *Client) Close()
- func (c *Client) DeletePortMapping(internalPort, externalPort int) error
- func (c *Client) GetExternalIPAddress() (net.IP, error)
- func (c *Client) GetListOfPortMappings() ([]string, error)
- func (c *Client) Vlogf(f string, a ...interface{})
- type ClientFactory
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 ¶
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) DeletePortMapping ¶
DeletePortMapping removes an existing TCP/IP port forwarding entry between clientIP:internalPort and 0.0.0.0:externalPort.
func (*Client) GetExternalIPAddress ¶
GetExternalIPAddress queries the router's external IP address.
func (*Client) GetListOfPortMappings ¶
GetListOfPortMappings queries the router for the list of port forwarding entries.
type ClientFactory ¶
type ClientFactory struct{}
func (*ClientFactory) Name ¶
func (f *ClientFactory) Name() string
Click to show internal directories.
Click to hide internal directories.