defs_dragonfly.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build ignore
  5. package route
  6. /*
  7. #include <sys/socket.h>
  8. #include <sys/sysctl.h>
  9. #include <net/if.h>
  10. #include <net/if_dl.h>
  11. #include <net/route.h>
  12. #include <netinet/in.h>
  13. struct ifa_msghdr_dfly4 {
  14. u_short ifam_msglen;
  15. u_char ifam_version;
  16. u_char ifam_type;
  17. int ifam_addrs;
  18. int ifam_flags;
  19. u_short ifam_index;
  20. int ifam_metric;
  21. };
  22. struct ifa_msghdr_dfly58 {
  23. u_short ifam_msglen;
  24. u_char ifam_version;
  25. u_char ifam_type;
  26. u_short ifam_index;
  27. int ifam_flags;
  28. int ifam_addrs;
  29. int ifam_addrflags;
  30. int ifam_metric;
  31. };
  32. */
  33. import "C"
  34. const (
  35. sysAF_UNSPEC = C.AF_UNSPEC
  36. sysAF_INET = C.AF_INET
  37. sysAF_ROUTE = C.AF_ROUTE
  38. sysAF_LINK = C.AF_LINK
  39. sysAF_INET6 = C.AF_INET6
  40. sysSOCK_RAW = C.SOCK_RAW
  41. sysNET_RT_DUMP = C.NET_RT_DUMP
  42. sysNET_RT_FLAGS = C.NET_RT_FLAGS
  43. sysNET_RT_IFLIST = C.NET_RT_IFLIST
  44. sysNET_RT_MAXID = C.NET_RT_MAXID
  45. )
  46. const (
  47. sysCTL_MAXNAME = C.CTL_MAXNAME
  48. sysCTL_UNSPEC = C.CTL_UNSPEC
  49. sysCTL_KERN = C.CTL_KERN
  50. sysCTL_VM = C.CTL_VM
  51. sysCTL_VFS = C.CTL_VFS
  52. sysCTL_NET = C.CTL_NET
  53. sysCTL_DEBUG = C.CTL_DEBUG
  54. sysCTL_HW = C.CTL_HW
  55. sysCTL_MACHDEP = C.CTL_MACHDEP
  56. sysCTL_USER = C.CTL_USER
  57. sysCTL_P1003_1B = C.CTL_P1003_1B
  58. sysCTL_LWKT = C.CTL_LWKT
  59. sysCTL_MAXID = C.CTL_MAXID
  60. )
  61. const (
  62. sysRTM_VERSION = C.RTM_VERSION
  63. sysRTM_ADD = C.RTM_ADD
  64. sysRTM_DELETE = C.RTM_DELETE
  65. sysRTM_CHANGE = C.RTM_CHANGE
  66. sysRTM_GET = C.RTM_GET
  67. sysRTM_LOSING = C.RTM_LOSING
  68. sysRTM_REDIRECT = C.RTM_REDIRECT
  69. sysRTM_MISS = C.RTM_MISS
  70. sysRTM_LOCK = C.RTM_LOCK
  71. sysRTM_RESOLVE = C.RTM_RESOLVE
  72. sysRTM_NEWADDR = C.RTM_NEWADDR
  73. sysRTM_DELADDR = C.RTM_DELADDR
  74. sysRTM_IFINFO = C.RTM_IFINFO
  75. sysRTM_NEWMADDR = C.RTM_NEWMADDR
  76. sysRTM_DELMADDR = C.RTM_DELMADDR
  77. sysRTM_IFANNOUNCE = C.RTM_IFANNOUNCE
  78. sysRTM_IEEE80211 = C.RTM_IEEE80211
  79. sysRTA_DST = C.RTA_DST
  80. sysRTA_GATEWAY = C.RTA_GATEWAY
  81. sysRTA_NETMASK = C.RTA_NETMASK
  82. sysRTA_GENMASK = C.RTA_GENMASK
  83. sysRTA_IFP = C.RTA_IFP
  84. sysRTA_IFA = C.RTA_IFA
  85. sysRTA_AUTHOR = C.RTA_AUTHOR
  86. sysRTA_BRD = C.RTA_BRD
  87. sysRTA_MPLS1 = C.RTA_MPLS1
  88. sysRTA_MPLS2 = C.RTA_MPLS2
  89. sysRTA_MPLS3 = C.RTA_MPLS3
  90. sysRTAX_DST = C.RTAX_DST
  91. sysRTAX_GATEWAY = C.RTAX_GATEWAY
  92. sysRTAX_NETMASK = C.RTAX_NETMASK
  93. sysRTAX_GENMASK = C.RTAX_GENMASK
  94. sysRTAX_IFP = C.RTAX_IFP
  95. sysRTAX_IFA = C.RTAX_IFA
  96. sysRTAX_AUTHOR = C.RTAX_AUTHOR
  97. sysRTAX_BRD = C.RTAX_BRD
  98. sysRTAX_MPLS1 = C.RTAX_MPLS1
  99. sysRTAX_MPLS2 = C.RTAX_MPLS2
  100. sysRTAX_MPLS3 = C.RTAX_MPLS3
  101. sysRTAX_MAX = C.RTAX_MAX
  102. )
  103. const (
  104. sizeofIfMsghdrDragonFlyBSD4 = C.sizeof_struct_if_msghdr
  105. sizeofIfaMsghdrDragonFlyBSD4 = C.sizeof_struct_ifa_msghdr_dfly4
  106. sizeofIfmaMsghdrDragonFlyBSD4 = C.sizeof_struct_ifma_msghdr
  107. sizeofIfAnnouncemsghdrDragonFlyBSD4 = C.sizeof_struct_if_announcemsghdr
  108. sizeofIfaMsghdrDragonFlyBSD58 = C.sizeof_struct_ifa_msghdr_dfly58
  109. sizeofRtMsghdrDragonFlyBSD4 = C.sizeof_struct_rt_msghdr
  110. sizeofRtMetricsDragonFlyBSD4 = C.sizeof_struct_rt_metrics
  111. sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
  112. sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
  113. sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
  114. )