blob: 0f91a9fcc0d5a9e1eacdd39d541ebdd9351f0d2b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
// This creates a simple hello world window
package main
import (
"net"
"git.wit.org/wit/gui"
)
// It's probably a terrible idea to call this 'me'
var me Host
type Host struct {
hostname string // mirrors
domainname string // kernel.org
// fqdn string // mirrors.kernel.org
dnsTTL int // Recheck DNS is working every TTL (in seconds)
changed bool // set to true if things changed
user string // name of the user
ipmap map[string]*IPtype // the current ip addresses
dnsmap map[string]*IPtype // the current dns addresses
ifmap map[int]*IFtype // the current interfaces
window *gui.Node // the main window
tab *gui.Node // the main dns tab
notes *gui.Node // using this to put notes here
output *gui.Node // Textbox for dumping output
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
Interfaces *gui.Node // Interfaces
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
}
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
}
|