2014-09-16 00:44:20 +00:00
|
|
|
package netlink
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Neigh represents a link layer neighbor from netlink.
|
|
|
|
type Neigh struct {
|
2014-10-13 23:09:09 +00:00
|
|
|
LinkIndex int
|
2014-09-16 00:44:20 +00:00
|
|
|
Family int
|
|
|
|
State int
|
|
|
|
Type int
|
|
|
|
Flags int
|
2021-10-26 10:04:16 +00:00
|
|
|
FlagsExt int
|
2014-09-16 00:44:20 +00:00
|
|
|
IP net.IP
|
|
|
|
HardwareAddr net.HardwareAddr
|
2017-08-29 00:59:25 +00:00
|
|
|
LLIPAddr net.IP //Used in the case of NHRP
|
2017-05-04 13:15:30 +00:00
|
|
|
Vlan int
|
|
|
|
VNI int
|
2018-12-21 08:18:13 +00:00
|
|
|
MasterIndex int
|
2014-09-16 00:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// String returns $ip/$hwaddr $label
|
|
|
|
func (neigh *Neigh) String() string {
|
|
|
|
return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr)
|
|
|
|
}
|
2018-09-21 03:03:18 +00:00
|
|
|
|
|
|
|
// NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH.
|
|
|
|
type NeighUpdate struct {
|
|
|
|
Type uint16
|
|
|
|
Neigh
|
|
|
|
}
|