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.
 
 
 

48 lines
963 B

  1. // Copyright 2017 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 socket
  8. /*
  9. #include <sys/socket.h>
  10. #include <netinet/in.h>
  11. */
  12. import "C"
  13. const (
  14. sysAF_UNSPEC = C.AF_UNSPEC
  15. sysAF_INET = C.AF_INET
  16. sysAF_INET6 = C.AF_INET6
  17. sysSOCK_RAW = C.SOCK_RAW
  18. )
  19. type iovec C.struct_iovec
  20. type msghdr C.struct_msghdr
  21. type mmsghdr C.struct_mmsghdr
  22. type cmsghdr C.struct_cmsghdr
  23. type sockaddrInet C.struct_sockaddr_in
  24. type sockaddrInet6 C.struct_sockaddr_in6
  25. const (
  26. sizeofIovec = C.sizeof_struct_iovec
  27. sizeofMsghdr = C.sizeof_struct_msghdr
  28. sizeofMmsghdr = C.sizeof_struct_mmsghdr
  29. sizeofCmsghdr = C.sizeof_struct_cmsghdr
  30. sizeofSockaddrInet = C.sizeof_struct_sockaddr_in
  31. sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
  32. )