Documentation
¶
Overview ¶
Package portforward reads and changes a unit's port forwarding rules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRules ¶
DeleteRules deletes rules by ID.
func UpdateRule ¶
UpdateRule changes rule id. It reads all rules, applies u to that one and writes them all back with SetPortForwardingConfig.
Types ¶
type Mapping ¶
type Mapping struct {
ID int `json:"id"`
Protocol Protocol `json:"protocol"`
WANPort int `json:"wan_port"`
LANPort int `json:"lan_port"`
WANCount int `json:"wan_count"`
LANCount int `json:"lan_count"`
}
Mapping is one port range of a forwarding rule. WANCount and LANCount are the number of ports in each range (the router's *PortRangeLength); 0 and 1 both mean a single port. LANPort 0 means the same as WANPort.
type Protocol ¶
type Protocol int
Protocol is the IP protocol of a mapping, by its IP protocol number.
func ParseProtocol ¶
ParseProtocol parses "tcp" or "udp".
func (Protocol) MarshalText ¶
MarshalText renders the protocol by name.
Click to show internal directories.
Click to hide internal directories.