Documentation ¶
Index ¶
- func GetLocalIPs() ([]*net.IP, error)
- func GetLocalIntenetIp() string
- type AddPortMapping
- type DelPortMapping
- type DeviceDesc
- type ExternalIPAddress
- type Gateway
- type MappingPortStruct
- type Node
- type SearchGateway
- type SearchGatewayReq
- type Upnp
- func (this *Upnp) AddPortMapping(localPort, remotePort, duration int, internalClient string, protocol string, ...) (err error)
- func (this *Upnp) DelPortMapping(remotePort int, protocol string) bool
- func (this *Upnp) ExternalIPAddr() (err error)
- func (this *Upnp) GetAllMapping() map[string][][]int
- func (this *Upnp) Reclaim()
- func (this *Upnp) SearchGateway() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalIPs ¶
This returns the list of local ip addresses which other hosts can connect to (NOTE: Loopback ip is ignored).
func GetLocalIntenetIp ¶
func GetLocalIntenetIp() string
GetLocalIntenetIp returns all local addresses, checks internet connectivity
Types ¶
type AddPortMapping ¶
type AddPortMapping struct {
// contains filtered or unexported fields
}
type DelPortMapping ¶
type DelPortMapping struct {
// contains filtered or unexported fields
}
type DeviceDesc ¶
type DeviceDesc struct {
// contains filtered or unexported fields
}
func (*DeviceDesc) BuildRequest ¶
func (this *DeviceDesc) BuildRequest() *http.Request
func (*DeviceDesc) Send ¶
func (this *DeviceDesc) Send() bool
type ExternalIPAddress ¶
type ExternalIPAddress struct {
// contains filtered or unexported fields
}
func (*ExternalIPAddress) BuildRequest ¶
func (this *ExternalIPAddress) BuildRequest() *http.Request
func (*ExternalIPAddress) Send ¶
func (this *ExternalIPAddress) Send() bool
type MappingPortStruct ¶
type MappingPortStruct struct {
// contains filtered or unexported fields
}
Manage all Ports
func (*MappingPortStruct) GetAllMapping ¶
func (this *MappingPortStruct) GetAllMapping() map[string][][]int
type SearchGateway ¶
type SearchGateway struct {
// contains filtered or unexported fields
}
func (*SearchGateway) Send ¶
func (this *SearchGateway) Send() bool
type SearchGatewayReq ¶
type SearchGatewayReq struct {
// contains filtered or unexported fields
}
func (SearchGatewayReq) BuildRequest ¶
func (this SearchGatewayReq) BuildRequest() *http.Request
func (SearchGatewayReq) Send ¶
func (this SearchGatewayReq) Send()
type Upnp ¶
type Upnp struct { Active bool // is this upnp protocol available? DurationUnsupported bool LocalHost string // local (our) IP Address GatewayInsideIP string // LAN Gateway IP GatewayOutsideIP string // Gateway Public IP OutsideMappingPort map[string]int // Map the external port InsideMappingPort map[string]int // Map local port Gateway *Gateway // Gateway information CtrlUrl string // Control request URL MappingPort MappingPortStruct // Existing mappings, e.g {"TCP":[1990],"UDP":[1991]} }
func (*Upnp) AddPortMapping ¶
func (this *Upnp) AddPortMapping(localPort, remotePort, duration int, internalClient string, protocol string, desc string) (err error)
AddPortMapping adds a port mapping TODO: accept an IP address to port forward to another LAN host(internalClient)
func (*Upnp) DelPortMapping ¶
DelPortMapping probably deletes a port mapping
func (*Upnp) ExternalIPAddr ¶
ExternalIPAddr gets our external IP address
func (*Upnp) GetAllMapping ¶
GetAllMapping returns all active mappings TODO: for this host only?
func (*Upnp) SearchGateway ¶
SearchGateway gets the Gateway's LAN IP address
Source Files ¶
Click to show internal directories.
Click to hide internal directories.