mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-25 01:07:49 +00:00
Merge pull request #86 from neilalexander/youraddresses
Show IPv6 address and subnet on startup
This commit is contained in:
commit
14b2dd0c61
@ -62,3 +62,11 @@ func (c *Core) GetNodeID() *NodeID {
|
|||||||
func (c *Core) GetTreeID() *TreeID {
|
func (c *Core) GetTreeID() *TreeID {
|
||||||
return getTreeID(&c.sigPub)
|
return getTreeID(&c.sigPub)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Core) GetAddress() *address {
|
||||||
|
return address_addrForNodeID(c.GetNodeID())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Core) GetSubnet() *subnet {
|
||||||
|
return address_subnetForNodeID(c.GetNodeID())
|
||||||
|
}
|
||||||
|
@ -272,6 +272,11 @@ func main() {
|
|||||||
n.core.DEBUG_stopTun()
|
n.core.DEBUG_stopTun()
|
||||||
}()
|
}()
|
||||||
logger.Println("Started...")
|
logger.Println("Started...")
|
||||||
|
address := (*n.core.GetAddress())[:]
|
||||||
|
subnet := (*n.core.GetSubnet())[:]
|
||||||
|
subnet = append(subnet, 0, 0, 0, 0, 0, 0, 0, 0)
|
||||||
|
logger.Printf("Your IPv6 address is %s", net.IP(address).String())
|
||||||
|
logger.Printf("Your IPv6 subnet is %s/64", net.IP(subnet).String())
|
||||||
if cfg.Multicast {
|
if cfg.Multicast {
|
||||||
addr, err := net.ResolveUDPAddr("udp", multicastAddr)
|
addr, err := net.ResolveUDPAddr("udp", multicastAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user