/*
GoVPN -- simple secure free software virtual private network daemon
-Copyright (C) 2014-2016 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2017 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
proxy = flag.String("proxy", "", "Enable HTTP proxy on host:port")
egdPath = flag.String("egd", "", "Optional path to EGD socket")
syslog = flag.Bool("syslog", false, "Enable logging to syslog")
+ version = flag.Bool("version", false, "Print version information")
warranty = flag.Bool("warranty", false, "Print warranty information")
)
fmt.Println(govpn.Warranty)
return
}
+ if *version {
+ fmt.Println(govpn.VersionGet())
+ return
+ }
timeout := time.Second * time.Duration(govpn.TimeoutDefault)
log.SetFlags(log.Ldate | log.Lmicroseconds | log.Lshortfile)
log.Println(govpn.VersionGet())
govpn.BothPrintf(`[terminating bind="%s"]`, *bindAddr)
for _, ps := range peers {
govpn.ScriptCall(
- confs[*ps.peer.Id].Down,
+ confs[*ps.peer.ID].Down,
ps.tap.Name,
ps.peer.Addr,
)
}
}
peersLock.Lock()
- peersByIdLock.Lock()
+ peersByIDLock.Lock()
kpLock.Lock()
for addr, ps := range peers {
ps.peer.BusyR.Lock()
govpn.Printf(`[peer-delete bind="%s" peer="%s"]`, *bindAddr, ps.peer)
delete(peers, addr)
delete(knownPeers, addr)
- delete(peersById, *ps.peer.Id)
+ delete(peersByID, *ps.peer.ID)
go govpn.ScriptCall(
- confs[*ps.peer.Id].Down,
+ confs[*ps.peer.ID].Down,
ps.tap.Name,
ps.peer.Addr,
)
}
hsLock.Unlock()
peersLock.Unlock()
- peersByIdLock.Unlock()
+ peersByIDLock.Unlock()
kpLock.Unlock()
}
}