2019-01-12 04:58:27 +00:00
|
|
|
package netlink
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Neigh represents a link layer neighbor from netlink.
|
|
|
|
type Neigh struct {
|
|
|
|
LinkIndex int
|
|
|
|
Family int
|
|
|
|
State int
|
|
|
|
Type int
|
|
|
|
Flags int
|
|
|
|
IP net.IP
|
|
|
|
HardwareAddr net.HardwareAddr
|
|
|
|
LLIPAddr net.IP //Used in the case of NHRP
|
2019-09-27 21:51:53 +00:00
|
|
|
Vlan int
|
|
|
|
VNI int
|
2020-08-10 17:43:49 +00:00
|
|
|
MasterIndex int
|
2019-01-12 04:58:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// String returns $ip/$hwaddr $label
|
|
|
|
func (neigh *Neigh) String() string {
|
|
|
|
return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr)
|
|
|
|
}
|
2020-08-10 17:43:49 +00:00
|
|
|
|
|
|
|
// NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH.
|
|
|
|
type NeighUpdate struct {
|
|
|
|
Type uint16
|
|
|
|
Neigh
|
|
|
|
}
|