neigh.go 620 B

12345678910111213141516171819202122232425262728293031
  1. package netlink
  2. import (
  3. "fmt"
  4. "net"
  5. )
  6. // Neigh represents a link layer neighbor from netlink.
  7. type Neigh struct {
  8. LinkIndex int
  9. Family int
  10. State int
  11. Type int
  12. Flags int
  13. IP net.IP
  14. HardwareAddr net.HardwareAddr
  15. LLIPAddr net.IP //Used in the case of NHRP
  16. Vlan int
  17. VNI int
  18. }
  19. // String returns $ip/$hwaddr $label
  20. func (neigh *Neigh) String() string {
  21. return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr)
  22. }
  23. // NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH.
  24. type NeighUpdate struct {
  25. Type uint16
  26. Neigh
  27. }