mirror of
https://github.com/vishvananda/netlink
synced 2024-12-18 04:34:42 +00:00
b08d99c0d0
This allows to set NTF_EXT_MANAGED neighbor flag for managed neighbor entries as per kernel commit 7482e3841d52 ("net, neigh: Add NTF_MANAGED flag for managed neighbor entries"). The flag then indicates to the kernel that the neighbor entry should be periodically probed for keeping the entry in NUD_REACHABLE state iff possible. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
34 lines
656 B
Go
34 lines
656 B
Go
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
|
|
FlagsExt int
|
|
IP net.IP
|
|
HardwareAddr net.HardwareAddr
|
|
LLIPAddr net.IP //Used in the case of NHRP
|
|
Vlan int
|
|
VNI int
|
|
MasterIndex int
|
|
}
|
|
|
|
// String returns $ip/$hwaddr $label
|
|
func (neigh *Neigh) String() string {
|
|
return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr)
|
|
}
|
|
|
|
// NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH.
|
|
type NeighUpdate struct {
|
|
Type uint16
|
|
Neigh
|
|
}
|