github.com/vishvananda/netlink@v1.3.1/neigh.go (about) 1 package netlink 2 3 import ( 4 "fmt" 5 "net" 6 ) 7 8 // Neigh represents a link layer neighbor from netlink. 9 type Neigh struct { 10 LinkIndex int 11 Family int 12 State int 13 Type int 14 Flags int 15 FlagsExt int 16 IP net.IP 17 HardwareAddr net.HardwareAddr 18 LLIPAddr net.IP //Used in the case of NHRP 19 Vlan int 20 VNI int 21 MasterIndex int 22 23 // These values are expressed as "clock ticks ago". To 24 // convert these clock ticks to seconds divide by sysconf(_SC_CLK_TCK). 25 // When _SC_CLK_TCK is 100, for example, the ndm_* times are expressed 26 // in centiseconds. 27 Confirmed uint32 // The last time ARP/ND succeeded OR higher layer confirmation was received 28 Used uint32 // The last time ARP/ND took place for this neighbor 29 Updated uint32 // The time when the current NUD state was entered 30 } 31 32 // String returns $ip/$hwaddr $label 33 func (neigh *Neigh) String() string { 34 return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr) 35 } 36 37 // NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH. 38 type NeighUpdate struct { 39 Type uint16 40 Neigh 41 }