import (
"flag"
+ "fmt"
"log"
"net"
"os"
encless = flag.Bool("encless", false, "Encryptionless mode")
cpr = flag.Int("cpr", 0, "Enable constant KiB/sec out traffic rate")
egdPath = flag.String("egd", "", "Optional path to EGD socket")
+ syslog = flag.Bool("syslog", false, "Enable logging to syslog")
+ warranty = flag.Bool("warranty", false, "Print warranty information")
conf *govpn.PeerConf
tap *govpn.TAP
timeout int
firstUpCall bool = true
knownPeers govpn.KnownPeers
- idsCache *govpn.CipherCache
+ idsCache *govpn.MACCache
)
func main() {
flag.Parse()
+ if *warranty {
+ fmt.Println(govpn.Warranty)
+ return
+ }
timeout = *timeoutP
var err error
log.SetFlags(log.Ldate | log.Lmicroseconds | log.Lshortfile)
Verifier: verifier,
DSAPriv: priv,
}
- idsCache = govpn.NewCipherCache()
+ idsCache = govpn.NewMACCache()
confs := map[govpn.PeerId]*govpn.PeerConf{*verifier.Id: conf}
idsCache.Update(&confs)
log.Println(govpn.VersionGet())
go govpn.StatsProcessor(statsPort, &knownPeers)
}
+ if *syslog {
+ govpn.SyslogEnable()
+ }
+
termSignal := make(chan os.Signal, 1)
signal.Notify(termSignal, os.Interrupt, os.Kill)
}
select {
case <-termSignal:
- log.Fatalln("Finishing")
+ govpn.BothPrintf(`[finish remote="%s"]`, *remoteAddr)
termination <- struct{}{}
break MainCycle
case <-timeouted:
close(rehandshaking)
close(termination)
}
- govpn.ScriptCall(*downPath, *ifaceName)
+ govpn.ScriptCall(*downPath, *ifaceName, *remoteAddr)
}