|
|
@ -5,7 +5,6 @@
|
|
|
|
package controlclient
|
|
|
|
package controlclient
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
|
|
|
|
"encoding/json"
|
|
|
|
"encoding/json"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"log"
|
|
|
@ -55,26 +54,6 @@ type NetworkMap struct {
|
|
|
|
// TODO(crawshaw): Capabilities []tailcfg.Capability
|
|
|
|
// TODO(crawshaw): Capabilities []tailcfg.Capability
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (n *NetworkMap) Equal(n2 *NetworkMap) bool {
|
|
|
|
|
|
|
|
if n == nil && n2 == nil {
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if n == nil || n2 == nil {
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(crawshaw): this is crude, but is an easy way to avoid bugs.
|
|
|
|
|
|
|
|
b, err := json.Marshal(n)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
panic(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
b2, err := json.Marshal(n2)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
panic(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return bytes.Equal(b, b2)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (nm NetworkMap) String() string {
|
|
|
|
func (nm NetworkMap) String() string {
|
|
|
|
return nm.Concise()
|
|
|
|
return nm.Concise()
|
|
|
|
}
|
|
|
|
}
|
|
|
|