neigh.go 656 B

123456789101112131415161718192021222324252627282930313233
  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. FlagsExt int
  14. IP net.IP
  15. HardwareAddr net.HardwareAddr
  16. LLIPAddr net.IP //Used in the case of NHRP
  17. Vlan int
  18. VNI int
  19. MasterIndex int
  20. }
  21. // String returns $ip/$hwaddr $label
  22. func (neigh *Neigh) String() string {
  23. return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr)
  24. }
  25. // NeighUpdate is sent when a neighbor changes - type is RTM_NEWNEIGH or RTM_DELNEIGH.
  26. type NeighUpdate struct {
  27. Type uint16
  28. Neigh
  29. }