diffrent interface names
This commit is contained in:
parent
948bfb291f
commit
756d9e3697
@ -11,19 +11,18 @@ type NodeInfo struct {
|
||||
Hardware Hardware `json:"hardware"`
|
||||
VPN bool `json:"vpn"`
|
||||
}
|
||||
|
||||
type Network struct {
|
||||
Mac string `json:"mac"`
|
||||
Addresses []string `json:"addresses"`
|
||||
Mesh struct {
|
||||
Bat0 struct {
|
||||
type BatInterface struct {
|
||||
Interfaces struct {
|
||||
Wireless []string `json:"wireless,omitempty"`
|
||||
Other []string `json:"other,omitempty"`
|
||||
Tunnel []string `json:"tunnel,omitempty"`
|
||||
} `json:"interfaces"`
|
||||
} `json:"bat0"`
|
||||
} `json:"mesh"`
|
||||
}
|
||||
|
||||
type Network struct {
|
||||
Mac string `json:"mac"`
|
||||
Addresses []string `json:"addresses"`
|
||||
Mesh map[string]*BatInterface `json:"mesh"`
|
||||
MeshInterfaces []string `json:"mesh_interfaces"`
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,8 @@ func (builder *GraphBuilder) readNodes(nodes map[string]*Node) {
|
||||
// Fill mac->id map
|
||||
for sourceId, node := range nodes {
|
||||
if nodeinfo := node.Nodeinfo; nodeinfo != nil {
|
||||
interfaces := nodeinfo.Network.Mesh.Bat0.Interfaces
|
||||
for _,batinterface := range nodeinfo.Network.Mesh {
|
||||
interfaces := batinterface.Interfaces
|
||||
addresses := append(append(interfaces.Other, interfaces.Tunnel...), interfaces.Wireless...)
|
||||
|
||||
for _, sourceAddress := range addresses {
|
||||
@ -57,6 +58,7 @@ func (builder *GraphBuilder) readNodes(nodes map[string]*Node) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add links
|
||||
for sourceId, node := range nodes {
|
||||
|
Loading…
Reference in New Issue
Block a user