2023-02-18 23:37:11 -06:00
|
|
|
// This creates a simple hello world window
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
2023-03-01 11:21:47 -06:00
|
|
|
"git.wit.org/wit/gui"
|
2023-02-18 23:37:11 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// It's probably a terrible idea to call this 'me'
|
|
|
|
var me Host
|
|
|
|
|
|
|
|
type Host struct {
|
|
|
|
hostname string // mirrors
|
|
|
|
domainname string // kernel.org
|
2023-03-09 14:21:34 -06:00
|
|
|
// fqdn string // mirrors.kernel.org
|
2023-03-01 11:21:47 -06:00
|
|
|
dnsTTL int // Recheck DNS is working every TTL (in seconds)
|
2023-03-26 16:17:32 -05:00
|
|
|
changed bool // set to true if things changed
|
2023-03-01 11:21:47 -06:00
|
|
|
user string // name of the user
|
2023-02-18 23:37:11 -06:00
|
|
|
ipmap map[string]*IPtype // the current ip addresses
|
2023-03-01 11:21:47 -06:00
|
|
|
dnsmap map[string]*IPtype // the current dns addresses
|
2023-02-18 23:37:11 -06:00
|
|
|
ifmap map[int]*IFtype // the current interfaces
|
2023-03-01 11:21:47 -06:00
|
|
|
window *gui.Node // the main window
|
|
|
|
tab *gui.Node // the main dns tab
|
|
|
|
notes *gui.Node // using this to put notes here
|
2023-03-09 14:21:34 -06:00
|
|
|
uid *gui.Node // user
|
|
|
|
fqdn *gui.Node // display the full hostname
|
|
|
|
IPv4 *gui.Node // show valid IPv4 addresses
|
|
|
|
IPv6 *gui.Node // show valid IPv6 addresses
|
2023-03-25 08:09:34 -05:00
|
|
|
Interfaces *gui.Node // Interfaces
|
2023-03-25 15:43:24 -05:00
|
|
|
DnsAAAA *gui.Node // the actual DNS AAAA results
|
|
|
|
DnsA *gui.Node // the actual DNS A results (ignore for status since mostly never happens?)
|
|
|
|
DnsStatus *gui.Node // the current state of DNS
|
2023-12-16 09:02:59 -06:00
|
|
|
fix *gui.Node // button for the user to click
|
2023-02-18 23:37:11 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|