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.

90 lines
2.3 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. // +godefs map struct_in_addr [4]byte /* in_addr */
  6. // +godefs map struct_in6_addr [16]byte /* in6_addr */
  7. package lif
  8. /*
  9. #include <sys/socket.h>
  10. #include <sys/sockio.h>
  11. #include <net/if.h>
  12. #include <net/if_types.h>
  13. */
  14. import "C"
  15. const (
  16. sysAF_UNSPEC = C.AF_UNSPEC
  17. sysAF_INET = C.AF_INET
  18. sysAF_INET6 = C.AF_INET6
  19. sysSOCK_DGRAM = C.SOCK_DGRAM
  20. )
  21. type sockaddrStorage C.struct_sockaddr_storage
  22. const (
  23. sysLIFC_NOXMIT = C.LIFC_NOXMIT
  24. sysLIFC_EXTERNAL_SOURCE = C.LIFC_EXTERNAL_SOURCE
  25. sysLIFC_TEMPORARY = C.LIFC_TEMPORARY
  26. sysLIFC_ALLZONES = C.LIFC_ALLZONES
  27. sysLIFC_UNDER_IPMP = C.LIFC_UNDER_IPMP
  28. sysLIFC_ENABLED = C.LIFC_ENABLED
  29. sysSIOCGLIFADDR = C.SIOCGLIFADDR
  30. sysSIOCGLIFDSTADDR = C.SIOCGLIFDSTADDR
  31. sysSIOCGLIFFLAGS = C.SIOCGLIFFLAGS
  32. sysSIOCGLIFMTU = C.SIOCGLIFMTU
  33. sysSIOCGLIFNETMASK = C.SIOCGLIFNETMASK
  34. sysSIOCGLIFMETRIC = C.SIOCGLIFMETRIC
  35. sysSIOCGLIFNUM = C.SIOCGLIFNUM
  36. sysSIOCGLIFINDEX = C.SIOCGLIFINDEX
  37. sysSIOCGLIFSUBNET = C.SIOCGLIFSUBNET
  38. sysSIOCGLIFLNKINFO = C.SIOCGLIFLNKINFO
  39. sysSIOCGLIFCONF = C.SIOCGLIFCONF
  40. sysSIOCGLIFHWADDR = C.SIOCGLIFHWADDR
  41. )
  42. const (
  43. sysIFF_UP = C.IFF_UP
  44. sysIFF_BROADCAST = C.IFF_BROADCAST
  45. sysIFF_DEBUG = C.IFF_DEBUG
  46. sysIFF_LOOPBACK = C.IFF_LOOPBACK
  47. sysIFF_POINTOPOINT = C.IFF_POINTOPOINT
  48. sysIFF_NOTRAILERS = C.IFF_NOTRAILERS
  49. sysIFF_RUNNING = C.IFF_RUNNING
  50. sysIFF_NOARP = C.IFF_NOARP
  51. sysIFF_PROMISC = C.IFF_PROMISC
  52. sysIFF_ALLMULTI = C.IFF_ALLMULTI
  53. sysIFF_INTELLIGENT = C.IFF_INTELLIGENT
  54. sysIFF_MULTICAST = C.IFF_MULTICAST
  55. sysIFF_MULTI_BCAST = C.IFF_MULTI_BCAST
  56. sysIFF_UNNUMBERED = C.IFF_UNNUMBERED
  57. sysIFF_PRIVATE = C.IFF_PRIVATE
  58. )
  59. const (
  60. sizeofLifnum = C.sizeof_struct_lifnum
  61. sizeofLifreq = C.sizeof_struct_lifreq
  62. sizeofLifconf = C.sizeof_struct_lifconf
  63. sizeofLifIfinfoReq = C.sizeof_struct_lif_ifinfo_req
  64. )
  65. type lifnum C.struct_lifnum
  66. type lifreq C.struct_lifreq
  67. type lifconf C.struct_lifconf
  68. type lifIfinfoReq C.struct_lif_ifinfo_req
  69. const (
  70. sysIFT_IPV4 = C.IFT_IPV4
  71. sysIFT_IPV6 = C.IFT_IPV6
  72. sysIFT_6TO4 = C.IFT_6TO4
  73. )