libnetwork ipvs godeps
This commit is contained in:
17
vendor/github.com/vishvananda/netlink/addr.go
generated
vendored
17
vendor/github.com/vishvananda/netlink/addr.go
generated
vendored
@@ -10,12 +10,18 @@ import (
|
||||
// include a mask, so it stores the address as a net.IPNet.
|
||||
type Addr struct {
|
||||
*net.IPNet
|
||||
Label string
|
||||
Label string
|
||||
Flags int
|
||||
Scope int
|
||||
Peer *net.IPNet
|
||||
Broadcast net.IP
|
||||
PreferedLft int
|
||||
ValidLft int
|
||||
}
|
||||
|
||||
// String returns $ip/$netmask $label
|
||||
func (a Addr) String() string {
|
||||
return fmt.Sprintf("%s %s", a.IPNet, a.Label)
|
||||
return strings.TrimSpace(fmt.Sprintf("%s %s", a.IPNet, a.Label))
|
||||
}
|
||||
|
||||
// ParseAddr parses the string representation of an address in the
|
||||
@@ -41,3 +47,10 @@ func (a Addr) Equal(x Addr) bool {
|
||||
// ignore label for comparison
|
||||
return a.IP.Equal(x.IP) && sizea == sizeb
|
||||
}
|
||||
|
||||
func (a Addr) PeerEqual(x Addr) bool {
|
||||
sizea, _ := a.Peer.Mask.Size()
|
||||
sizeb, _ := x.Peer.Mask.Size()
|
||||
// ignore label for comparison
|
||||
return a.Peer.IP.Equal(x.Peer.IP) && sizea == sizeb
|
||||
}
|
||||
|
Reference in New Issue
Block a user