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 int, 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).
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
}
对所有的端口进行管理
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 //这个upnp协议是否可用 LocalHost string //本机ip地址 GatewayInsideIP string //局域网网关ip GatewayOutsideIP string //网关公网ip OutsideMappingPort map[string]int //映射外部端口 InsideMappingPort map[string]int //映射本机端口 Gateway *Gateway //网关信息 CtrlUrl string //控制请求url MappingPort MappingPortStruct //已经添加了的映射 {"TCP":[1990],"UDP":[1991]} }
func (*Upnp) AddPortMapping ¶
添加一个端口映射
func (*Upnp) DelPortMapping ¶
func (*Upnp) GetAllMapping ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.