Documentation ¶
Index ¶
- func GetLocalIPs() ([]*net.IP, error)
- func GetLocalIntenetIp() string
- type AddPortMapping
- type Body
- type DelPortMapping
- type DeviceDesc
- type ExternalIPAddress
- type Gateway
- type GenericBody
- type GenericRespEnvelope
- type GetGenericPortMappingEntry
- type GetListOfPortMappings
- type MappingPortStruct
- type MyRespEnvelope
- type NewPortListing
- type Node
- type PortMapList
- type PortMappingEntry
- type SearchGateway
- type SearchGatewayReq
- type Upnp
- func (u *Upnp) AddPortMapping(localPort, remotePort, duration int, internalClient string, protocol string, ...) (err error)
- func (u *Upnp) DelPortMapping(remotePort int, protocol string) bool
- func (u *Upnp) ExternalIPAddr() (err error)
- func (u *Upnp) GetAllMapping() map[string][][]int
- func (u *Upnp) GetGenericPortMappingEntry(index string) PortMappingEntry
- func (u *Upnp) GetListOfPortMappings(protocol string) []PortMappingEntry
- func (u *Upnp) Reclaim()
- func (u *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 Body ¶
type Body struct { XMLName xml.Name GetResponse NewPortListing `xml:"GetListOfPortMappingsResponse"` }
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 GenericBody ¶
type GenericBody struct { XMLName xml.Name GetResponse PortMappingEntry `xml:"GetGenericPortMappingEntryResponse"` }
type GenericRespEnvelope ¶
type GenericRespEnvelope struct { XMLName xml.Name Body GenericBody }
type GetGenericPortMappingEntry ¶
type GetGenericPortMappingEntry struct {
// contains filtered or unexported fields
}
func (*GetGenericPortMappingEntry) Send ¶
func (this *GetGenericPortMappingEntry) Send(index string) PortMappingEntry
type GetListOfPortMappings ¶
type GetListOfPortMappings struct {
// contains filtered or unexported fields
}
func (*GetListOfPortMappings) Send ¶
func (this *GetListOfPortMappings) Send(protocol string) []PortMappingEntry
type MappingPortStruct ¶
type MappingPortStruct struct {
// contains filtered or unexported fields
}
MappingPortStruct Manage all Ports
func (*MappingPortStruct) GetAllMapping ¶
func (m *MappingPortStruct) GetAllMapping() map[string][][]int
type MyRespEnvelope ¶
type NewPortListing ¶
type PortMapList ¶
type PortMapList struct { XMLName xml.Name PortMappingEntry []PortMappingEntry `xml:"PortMappingEntry"` }
type PortMappingEntry ¶
type PortMappingEntry struct { NewRemoteHost string `xml:"NewRemoteHost"` NewExternalPort string `xml:"NewExternalPort"` NewProtocol string `xml:"NewProtocol"` NewInternalPort string `xml:"NewInternalPort"` NewInternalClient string `xml:"NewInternalClient"` NewEnabled string `xml:"NewEnabled"` NewDescription string `xml:"NewDescription"` NewLeaseTime string `xml:"NewLeaseTime"` }
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 (s SearchGatewayReq) BuildRequest() *http.Request
func (SearchGatewayReq) Send ¶
func (s 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 (u *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) GetGenericPortMappingEntry ¶
func (u *Upnp) GetGenericPortMappingEntry(index string) PortMappingEntry
func (*Upnp) GetListOfPortMappings ¶
func (u *Upnp) GetListOfPortMappings(protocol string) []PortMappingEntry
func (*Upnp) SearchGateway ¶
SearchGateway gets the Gateway's LAN IP address
Source Files ¶
Click to show internal directories.
Click to hide internal directories.