wololo

package
v0.0.0-...-15077f1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBcastAddr

func CheckBcastAddr(bcastAddr string) error

func CheckMACAddr

func CheckMACAddr(macAddr string) error

func InterfaceToIp

func InterfaceToIp(iface string) (*net.UDPAddr, error)

Extract the IPv4 address from a specified interface

func SetupLog

func SetupLog() *syslog.Writer

Connect to the syslog daemon if possible

func WriteToLog

func WriteToLog(log *syslog.Writer, msg string)

Write a message to the syslog daemon if a connection was established

Types

type MACAddress

type MACAddress [6]byte

MAC address byte array

func ParseMAC

func ParseMAC(macAddr string) (*MACAddress, error)

Convert a MAC address string from the configuration file to the MACAddress data structure

type WolPacket

type WolPacket struct {
	// contains filtered or unexported fields
}

Byte sequence for WOL, global variable for handler and main

func BuildWolPacket

func BuildWolPacket(macAddr MACAddress) *WolPacket

Construct the raw WOL packet

type WololoConfig

type WololoConfig struct {
	ListenAddr   string `json:"listenAddr"`
	ListenPort   string `json:"listenPort"`
	UdpBcastAddr string `json:"udpBcastAddr"`
	Iface        string `json:"iface"`
	MacAddrStr   string `json:"macAddr"`
	MacAddr      MACAddress
}

Configuration information for the application

func ReadConfig

func ReadConfig(path string) (*WololoConfig, error)

Read the configuration file and extract all relevant information to fill a WololoConfig structure

Jump to

Keyboard shortcuts

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