Documentation
¶
Overview ¶
Package wake is the RemoHop Wake-on-LAN service: the magic packet itself, a host handler that sends it on the host's LAN, a client API, and the `remohop wake` / `remohop <ID> wol` commands.
The useful form is the remote one. A sleeping PC cannot be reached over the internet, but a small always-on machine on the same LAN can broadcast the magic packet for it.
Index ¶
Constants ¶
const DefaultPort = 9
DefaultPort is the UDP "discard" port most network cards listen on.
Variables ¶
This section is empty.
Functions ¶
func Packet ¶
func Packet(mac net.HardwareAddr) []byte
Packet builds the magic packet: six 0xFF bytes then the MAC sixteen times.
Types ¶
type Options ¶
type Options struct {
// Broadcast is the destination IPv4 address, usually a subnet broadcast
// address such as 192.168.1.255. Empty means every broadcast-capable
// interface of this machine. Only the local (CLI) path honours it: a host
// never lets a remote peer pick where it sends packets.
Broadcast string `json:"-"`
// Port is the UDP destination port; 0 means DefaultPort.
Port int `json:"port,omitempty"`
}
Options tune a send. The zero value broadcasts on every IPv4 interface to port 9.
type Result ¶
type Result struct {
MAC string `json:"mac"`
Port int `json:"port"`
Targets []string `json:"targets"` // destinations the packet was sent to
}
Result reports what was sent.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store remembers MAC addresses under short names, in a 0600 JSON file in the config directory.