upnp

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCtrlUrl

func GetCtrlUrl(host, device string) string

func Testaaa

func Testaaa()

Types

type Node

type Node struct {
	Name    string
	Content string
	Attr    map[string]string
	Child   []Node
}

func (*Node) AddChild

func (n *Node) AddChild(node Node)

func (*Node) BuildXML

func (n *Node) BuildXML() string

type Upnp

type Upnp struct {
	LocalHost     string `json:"local_host"`
	GatewayName   string `json:"gateway_name"`    //网关名称
	GatewayHost   string `json:"gateway_host"`    //网关ip和端口
	DeviceDescUrl string `json:"device_desc_url"` //设备描述url
	CtrlUrl       string `json:"ctrl_url"`        //控制请求url
}

func Gateway

func Gateway() (*Upnp, error)

func (*Upnp) AddPortMapping

func (n *Upnp) AddPortMapping(localPort, remotePort int, protocol string) (err error)

//添加一个端口映射

func (*Upnp) DelPortMapping

func (n *Upnp) DelPortMapping(remotePort int, protocol string) bool

Jump to

Keyboard shortcuts

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