You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
2.8 KiB

  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. */
  14. import "C"
  15. const (
  16. sysAF_UNSPEC = C.AF_UNSPEC
  17. sysAF_INET = C.AF_INET
  18. sysAF_ROUTE = C.AF_ROUTE
  19. sysAF_LINK = C.AF_LINK
  20. sysAF_INET6 = C.AF_INET6
  21. sysSOCK_RAW = C.SOCK_RAW
  22. sysNET_RT_DUMP = C.NET_RT_DUMP
  23. sysNET_RT_FLAGS = C.NET_RT_FLAGS
  24. sysNET_RT_IFLIST = C.NET_RT_IFLIST
  25. sysNET_RT_MAXID = C.NET_RT_MAXID
  26. )
  27. const (
  28. sysCTL_MAXNAME = C.CTL_MAXNAME
  29. sysCTL_UNSPEC = C.CTL_UNSPEC
  30. sysCTL_KERN = C.CTL_KERN
  31. sysCTL_VM = C.CTL_VM
  32. sysCTL_VFS = C.CTL_VFS
  33. sysCTL_NET = C.CTL_NET
  34. sysCTL_DEBUG = C.CTL_DEBUG
  35. sysCTL_HW = C.CTL_HW
  36. sysCTL_MACHDEP = C.CTL_MACHDEP
  37. sysCTL_USER = C.CTL_USER
  38. sysCTL_DDB = C.CTL_DDB
  39. sysCTL_PROC = C.CTL_PROC
  40. sysCTL_VENDOR = C.CTL_VENDOR
  41. sysCTL_EMUL = C.CTL_EMUL
  42. sysCTL_SECURITY = C.CTL_SECURITY
  43. sysCTL_MAXID = C.CTL_MAXID
  44. )
  45. const (
  46. sysRTM_VERSION = C.RTM_VERSION
  47. sysRTM_ADD = C.RTM_ADD
  48. sysRTM_DELETE = C.RTM_DELETE
  49. sysRTM_CHANGE = C.RTM_CHANGE
  50. sysRTM_GET = C.RTM_GET
  51. sysRTM_LOSING = C.RTM_LOSING
  52. sysRTM_REDIRECT = C.RTM_REDIRECT
  53. sysRTM_MISS = C.RTM_MISS
  54. sysRTM_LOCK = C.RTM_LOCK
  55. sysRTM_OLDADD = C.RTM_OLDADD
  56. sysRTM_OLDDEL = C.RTM_OLDDEL
  57. sysRTM_RESOLVE = C.RTM_RESOLVE
  58. sysRTM_NEWADDR = C.RTM_NEWADDR
  59. sysRTM_DELADDR = C.RTM_DELADDR
  60. sysRTM_IFANNOUNCE = C.RTM_IFANNOUNCE
  61. sysRTM_IEEE80211 = C.RTM_IEEE80211
  62. sysRTM_SETGATE = C.RTM_SETGATE
  63. sysRTM_LLINFO_UPD = C.RTM_LLINFO_UPD
  64. sysRTM_IFINFO = C.RTM_IFINFO
  65. sysRTM_CHGADDR = C.RTM_CHGADDR
  66. sysRTA_DST = C.RTA_DST
  67. sysRTA_GATEWAY = C.RTA_GATEWAY
  68. sysRTA_NETMASK = C.RTA_NETMASK
  69. sysRTA_GENMASK = C.RTA_GENMASK
  70. sysRTA_IFP = C.RTA_IFP
  71. sysRTA_IFA = C.RTA_IFA
  72. sysRTA_AUTHOR = C.RTA_AUTHOR
  73. sysRTA_BRD = C.RTA_BRD
  74. sysRTA_TAG = C.RTA_TAG
  75. sysRTAX_DST = C.RTAX_DST
  76. sysRTAX_GATEWAY = C.RTAX_GATEWAY
  77. sysRTAX_NETMASK = C.RTAX_NETMASK
  78. sysRTAX_GENMASK = C.RTAX_GENMASK
  79. sysRTAX_IFP = C.RTAX_IFP
  80. sysRTAX_IFA = C.RTAX_IFA
  81. sysRTAX_AUTHOR = C.RTAX_AUTHOR
  82. sysRTAX_BRD = C.RTAX_BRD
  83. sysRTAX_TAG = C.RTAX_TAG
  84. sysRTAX_MAX = C.RTAX_MAX
  85. )
  86. const (
  87. sizeofIfMsghdrNetBSD7 = C.sizeof_struct_if_msghdr
  88. sizeofIfaMsghdrNetBSD7 = C.sizeof_struct_ifa_msghdr
  89. sizeofIfAnnouncemsghdrNetBSD7 = C.sizeof_struct_if_announcemsghdr
  90. sizeofRtMsghdrNetBSD7 = C.sizeof_struct_rt_msghdr
  91. sizeofRtMetricsNetBSD7 = C.sizeof_struct_rt_metrics
  92. sizeofSockaddrStorage = C.sizeof_struct_sockaddr_storage
  93. sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
  94. sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
  95. )