parent
5d7004ad92
commit
dbd81e9462
6
args.go
6
args.go
|
@ -3,7 +3,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.wit.org/wit/gui"
|
"git.wit.org/wit/gui"
|
||||||
"git.wit.org/jcarr/dnssecsocket"
|
// "git.wit.org/jcarr/dnssecsocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LogOptions struct {
|
type LogOptions struct {
|
||||||
|
@ -17,10 +17,10 @@ type LogOptions struct {
|
||||||
|
|
||||||
var args struct {
|
var args struct {
|
||||||
LogOptions
|
LogOptions
|
||||||
dnssecsocket.Args
|
// dnssecsocket.Args
|
||||||
gui.GuiArgs
|
gui.GuiArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
func parsedown () {
|
func parsedown () {
|
||||||
dnssecsocket.Parse(args.VerboseDnssec)
|
// dnssecsocket.Parse(args.VerboseDnssec)
|
||||||
}
|
}
|
||||||
|
|
6
gui.go
6
gui.go
|
@ -17,7 +17,7 @@ import (
|
||||||
func setupControlPanelWindow() {
|
func setupControlPanelWindow() {
|
||||||
// me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
|
// me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
|
||||||
me.window = myGui.NewWindow("DNS and IPv6 Control Panel").Standard()
|
me.window = myGui.NewWindow("DNS and IPv6 Control Panel").Standard()
|
||||||
me.window.Dump(true)
|
me.window.Dump()
|
||||||
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
addDNSTab("DNS")
|
addDNSTab("DNS")
|
||||||
|
@ -100,12 +100,14 @@ func addDNSTab(title string) {
|
||||||
|
|
||||||
nsupdateGroup(me.tab)
|
nsupdateGroup(me.tab)
|
||||||
|
|
||||||
|
/*
|
||||||
tmp := me.tab.NewGroup("output")
|
tmp := me.tab.NewGroup("output")
|
||||||
me.output = tmp.NewTextbox("some output")
|
me.output = tmp.NewTextbox("some output")
|
||||||
me.output.Custom = func() {
|
me.output.Custom = func() {
|
||||||
s := me.output.GetText()
|
s := me.output.GetText()
|
||||||
log("output text =", s)
|
log("output text =", s)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
func myDefaultExit(n *gui.Node) {
|
func myDefaultExit(n *gui.Node) {
|
||||||
|
@ -149,6 +151,7 @@ func nsupdateGroup(w *gui.Node) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
var outJunk string
|
var outJunk string
|
||||||
func output(s string, a bool) {
|
func output(s string, a bool) {
|
||||||
if (a) {
|
if (a) {
|
||||||
|
@ -159,6 +162,7 @@ func output(s string, a bool) {
|
||||||
me.output.SetText(outJunk)
|
me.output.SetText(outJunk)
|
||||||
log(outJunk)
|
log(outJunk)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func updateDNS() {
|
func updateDNS() {
|
||||||
var aaaa []string
|
var aaaa []string
|
||||||
|
|
22
main.go
22
main.go
|
@ -25,36 +25,23 @@ func main() {
|
||||||
me.ifmap = make(map[int]*IFtype)
|
me.ifmap = make(map[int]*IFtype)
|
||||||
me.dnsTTL = 5 // recheck DNS is working every 2 minutes // TODO: watch rx packets?
|
me.dnsTTL = 5 // recheck DNS is working every 2 minutes // TODO: watch rx packets?
|
||||||
|
|
||||||
|
log("Toolkit = ", args.GuiToolkit)
|
||||||
log()
|
for i, t := range args.GuiToolkit {
|
||||||
log(true, "this is true")
|
|
||||||
log(false, "this is false")
|
|
||||||
sleep(.4)
|
|
||||||
sleep(.3)
|
|
||||||
sleep(.2)
|
|
||||||
sleep("done scanning net")
|
|
||||||
|
|
||||||
// Example_listLink()
|
|
||||||
|
|
||||||
log("Toolkit = ", args.Toolkit)
|
|
||||||
for i, t := range args.Toolkit {
|
|
||||||
log("trying to load plugin", i, t)
|
log("trying to load plugin", i, t)
|
||||||
myGui.LoadToolkit(t)
|
myGui.LoadToolkit(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// will set all debugging flags
|
// will set all debugging flags
|
||||||
gui.SetDebug(true)
|
// gui.SetDebug(true)
|
||||||
|
|
||||||
myGui = gui.New().LoadToolkit("gocui")
|
myGui = gui.New().LoadToolkit("gocui")
|
||||||
sleep(1)
|
sleep(1)
|
||||||
setupControlPanelWindow()
|
setupControlPanelWindow()
|
||||||
sleep(1)
|
sleep(1)
|
||||||
// sleep(1)
|
|
||||||
if (args.GuiDebug) {
|
if (args.GuiDebug) {
|
||||||
gui.DebugWindow()
|
gui.DebugWindow()
|
||||||
}
|
}
|
||||||
gui.ShowDebugValues()
|
gui.ShowDebugValues()
|
||||||
go gui.Watchdog()
|
|
||||||
|
|
||||||
// forever monitor for network and dns changes
|
// forever monitor for network and dns changes
|
||||||
checkNetworkChanges()
|
checkNetworkChanges()
|
||||||
|
@ -102,10 +89,7 @@ func dnsTTL() {
|
||||||
|
|
||||||
if (me.changed) {
|
if (me.changed) {
|
||||||
stamp := time.Now().Format("2006/01/02 15:04:05")
|
stamp := time.Now().Format("2006/01/02 15:04:05")
|
||||||
s := stamp + " Network things changed"
|
|
||||||
log(logError, "Network things changed on", stamp)
|
log(logError, "Network things changed on", stamp)
|
||||||
updateDNS()
|
updateDNS()
|
||||||
me.output.SetText(s)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@ type Host struct {
|
||||||
window *gui.Node // the main window
|
window *gui.Node // the main window
|
||||||
tab *gui.Node // the main dns tab
|
tab *gui.Node // the main dns tab
|
||||||
notes *gui.Node // using this to put notes here
|
notes *gui.Node // using this to put notes here
|
||||||
output *gui.Node // Textbox for dumping output
|
|
||||||
uid *gui.Node // user
|
uid *gui.Node // user
|
||||||
fqdn *gui.Node // display the full hostname
|
fqdn *gui.Node // display the full hostname
|
||||||
IPv4 *gui.Node // show valid IPv4 addresses
|
IPv4 *gui.Node // show valid IPv4 addresses
|
||||||
|
|
Loading…
Reference in New Issue