summaryrefslogtreecommitdiff
path: root/structs.go
blob: 42fd4207215a3434e857ef4f044c075f8db86941 (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
52
53
54
55
56
57
58
59
60
61
/* 
	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 {
	ready	bool
	hidden	bool
	changed	bool

	parent	*gui.Node

	ifmap	map[int]*IFtype		// the current interfaces
	ipmap	map[string]*IPtype	// the current ip addresses

	window	*gadgets.BasicWindow
	group	*gui.Node
	grid	*gui.Node

	hostnameStatus	*gadgets.OneLiner
	hostname	*gadgets.OneLiner
	hostshort	*gadgets.OneLiner
	domainname	*gadgets.OneLiner
	resolver	*gadgets.OneLiner
	uid		*gadgets.OneLiner
	IPv4		*gadgets.OneLiner
	IPv6		*gadgets.OneLiner
	workingIPv4	*gadgets.OneLiner
	workingIPv6	*gadgets.OneLiner
	Interfaces	*gui.Node
	speed		*gadgets.OneLiner
	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
}