2024-01-06 05:24:11 -06:00
|
|
|
/*
|
|
|
|
figures out if your hostname is valid
|
|
|
|
then checks if your DNS is setup correctly
|
|
|
|
*/
|
|
|
|
|
|
|
|
package linuxstatus
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"go.wit.com/gui/gui"
|
|
|
|
"go.wit.com/gui/gadgets"
|
|
|
|
)
|
|
|
|
|
|
|
|
var me *LinuxStatus
|
|
|
|
|
|
|
|
type LinuxStatus struct {
|
2024-01-06 05:55:51 -06:00
|
|
|
ready bool
|
|
|
|
hidden bool
|
|
|
|
changed bool
|
2024-01-06 05:24:11 -06:00
|
|
|
|
2024-01-06 05:55:51 -06:00
|
|
|
parent *gui.Node
|
|
|
|
|
|
|
|
ifmap map[int]*IFtype // the current interfaces
|
|
|
|
ipmap map[string]*IPtype // the current ip addresses
|
2024-01-06 05:24:11 -06:00
|
|
|
|
|
|
|
window *gadgets.BasicWindow
|
|
|
|
group *gui.Node
|
|
|
|
grid *gui.Node
|
|
|
|
|
|
|
|
hostshort *gadgets.OneLiner
|
|
|
|
domainname *gadgets.OneLiner
|
|
|
|
fqdn *gadgets.OneLiner
|
2024-01-06 14:57:51 -06:00
|
|
|
resolver *gadgets.OneLiner
|
2024-01-06 05:24:11 -06:00
|
|
|
uid *gadgets.OneLiner
|
|
|
|
IPv4 *gadgets.OneLiner
|
|
|
|
IPv6 *gadgets.OneLiner
|
|
|
|
workingIPv6 *gadgets.OneLiner
|
|
|
|
Interfaces *gui.Node
|
2024-01-06 11:12:10 -06:00
|
|
|
speed *gadgets.OneLiner
|
2024-01-06 05:24:11 -06:00
|
|
|
speedActual *gadgets.OneLiner
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
type IPtype struct {
|
|
|
|
gone bool // used to track if the ip exists
|
|
|
|
ipv6 bool // the future
|
|
|
|
ipv4 bool // the past
|
|
|
|
LinkLocal bool
|
|
|
|
iface *net.Interface
|
|
|
|
ip net.IP
|
|
|
|
ipnet *net.IPNet
|
|
|
|
}
|
|
|
|
|
|
|
|
type IFtype struct {
|
|
|
|
gone bool // used to track if the interface exists
|
|
|
|
name string // just a shortcut to the name. maybe this is dumb
|
|
|
|
// up bool // could be used to track ifup/ifdown
|
|
|
|
iface *net.Interface
|
|
|
|
}
|