defs_linux.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Copyright 2014 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. package ipv4
  7. /*
  8. #include <time.h>
  9. #include <linux/errqueue.h>
  10. #include <linux/icmp.h>
  11. #include <linux/in.h>
  12. #include <linux/filter.h>
  13. #include <sys/socket.h>
  14. */
  15. import "C"
  16. const (
  17. sysIP_TOS = C.IP_TOS
  18. sysIP_TTL = C.IP_TTL
  19. sysIP_HDRINCL = C.IP_HDRINCL
  20. sysIP_OPTIONS = C.IP_OPTIONS
  21. sysIP_ROUTER_ALERT = C.IP_ROUTER_ALERT
  22. sysIP_RECVOPTS = C.IP_RECVOPTS
  23. sysIP_RETOPTS = C.IP_RETOPTS
  24. sysIP_PKTINFO = C.IP_PKTINFO
  25. sysIP_PKTOPTIONS = C.IP_PKTOPTIONS
  26. sysIP_MTU_DISCOVER = C.IP_MTU_DISCOVER
  27. sysIP_RECVERR = C.IP_RECVERR
  28. sysIP_RECVTTL = C.IP_RECVTTL
  29. sysIP_RECVTOS = C.IP_RECVTOS
  30. sysIP_MTU = C.IP_MTU
  31. sysIP_FREEBIND = C.IP_FREEBIND
  32. sysIP_TRANSPARENT = C.IP_TRANSPARENT
  33. sysIP_RECVRETOPTS = C.IP_RECVRETOPTS
  34. sysIP_ORIGDSTADDR = C.IP_ORIGDSTADDR
  35. sysIP_RECVORIGDSTADDR = C.IP_RECVORIGDSTADDR
  36. sysIP_MINTTL = C.IP_MINTTL
  37. sysIP_NODEFRAG = C.IP_NODEFRAG
  38. sysIP_UNICAST_IF = C.IP_UNICAST_IF
  39. sysIP_MULTICAST_IF = C.IP_MULTICAST_IF
  40. sysIP_MULTICAST_TTL = C.IP_MULTICAST_TTL
  41. sysIP_MULTICAST_LOOP = C.IP_MULTICAST_LOOP
  42. sysIP_ADD_MEMBERSHIP = C.IP_ADD_MEMBERSHIP
  43. sysIP_DROP_MEMBERSHIP = C.IP_DROP_MEMBERSHIP
  44. sysIP_UNBLOCK_SOURCE = C.IP_UNBLOCK_SOURCE
  45. sysIP_BLOCK_SOURCE = C.IP_BLOCK_SOURCE
  46. sysIP_ADD_SOURCE_MEMBERSHIP = C.IP_ADD_SOURCE_MEMBERSHIP
  47. sysIP_DROP_SOURCE_MEMBERSHIP = C.IP_DROP_SOURCE_MEMBERSHIP
  48. sysIP_MSFILTER = C.IP_MSFILTER
  49. sysMCAST_JOIN_GROUP = C.MCAST_JOIN_GROUP
  50. sysMCAST_LEAVE_GROUP = C.MCAST_LEAVE_GROUP
  51. sysMCAST_JOIN_SOURCE_GROUP = C.MCAST_JOIN_SOURCE_GROUP
  52. sysMCAST_LEAVE_SOURCE_GROUP = C.MCAST_LEAVE_SOURCE_GROUP
  53. sysMCAST_BLOCK_SOURCE = C.MCAST_BLOCK_SOURCE
  54. sysMCAST_UNBLOCK_SOURCE = C.MCAST_UNBLOCK_SOURCE
  55. sysMCAST_MSFILTER = C.MCAST_MSFILTER
  56. sysIP_MULTICAST_ALL = C.IP_MULTICAST_ALL
  57. //sysIP_PMTUDISC_DONT = C.IP_PMTUDISC_DONT
  58. //sysIP_PMTUDISC_WANT = C.IP_PMTUDISC_WANT
  59. //sysIP_PMTUDISC_DO = C.IP_PMTUDISC_DO
  60. //sysIP_PMTUDISC_PROBE = C.IP_PMTUDISC_PROBE
  61. //sysIP_PMTUDISC_INTERFACE = C.IP_PMTUDISC_INTERFACE
  62. //sysIP_PMTUDISC_OMIT = C.IP_PMTUDISC_OMIT
  63. sysICMP_FILTER = C.ICMP_FILTER
  64. sysSO_EE_ORIGIN_NONE = C.SO_EE_ORIGIN_NONE
  65. sysSO_EE_ORIGIN_LOCAL = C.SO_EE_ORIGIN_LOCAL
  66. sysSO_EE_ORIGIN_ICMP = C.SO_EE_ORIGIN_ICMP
  67. sysSO_EE_ORIGIN_ICMP6 = C.SO_EE_ORIGIN_ICMP6
  68. sysSO_EE_ORIGIN_TXSTATUS = C.SO_EE_ORIGIN_TXSTATUS
  69. sysSO_EE_ORIGIN_TIMESTAMPING = C.SO_EE_ORIGIN_TIMESTAMPING
  70. sizeofKernelSockaddrStorage = C.sizeof_struct___kernel_sockaddr_storage
  71. sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
  72. sizeofInetPktinfo = C.sizeof_struct_in_pktinfo
  73. sizeofSockExtendedErr = C.sizeof_struct_sock_extended_err
  74. sizeofIPMreq = C.sizeof_struct_ip_mreq
  75. sizeofIPMreqn = C.sizeof_struct_ip_mreqn
  76. sizeofIPMreqSource = C.sizeof_struct_ip_mreq_source
  77. sizeofGroupReq = C.sizeof_struct_group_req
  78. sizeofGroupSourceReq = C.sizeof_struct_group_source_req
  79. sizeofICMPFilter = C.sizeof_struct_icmp_filter
  80. )
  81. type kernelSockaddrStorage C.struct___kernel_sockaddr_storage
  82. type sockaddrInet C.struct_sockaddr_in
  83. type inetPktinfo C.struct_in_pktinfo
  84. type sockExtendedErr C.struct_sock_extended_err
  85. type ipMreq C.struct_ip_mreq
  86. type ipMreqn C.struct_ip_mreqn
  87. type ipMreqSource C.struct_ip_mreq_source
  88. type groupReq C.struct_group_req
  89. type groupSourceReq C.struct_group_source_req
  90. type icmpFilter C.struct_icmp_filter