David K. Bainbridge | 215e024 | 2017-09-05 23:18:24 -0700 | [diff] [blame^] | 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 | |
| 5 | // +build ignore |
| 6 | |
| 7 | // +godefs map struct_in_addr [4]byte /* in_addr */ |
| 8 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ |
| 9 | |
| 10 | package socket |
| 11 | |
| 12 | /* |
| 13 | #include <sys/socket.h> |
| 14 | |
| 15 | #include <netinet/in.h> |
| 16 | */ |
| 17 | import "C" |
| 18 | |
| 19 | const ( |
| 20 | sysAF_UNSPEC = C.AF_UNSPEC |
| 21 | sysAF_INET = C.AF_INET |
| 22 | sysAF_INET6 = C.AF_INET6 |
| 23 | |
| 24 | sysSOCK_RAW = C.SOCK_RAW |
| 25 | ) |
| 26 | |
| 27 | type iovec C.struct_iovec |
| 28 | |
| 29 | type msghdr C.struct_msghdr |
| 30 | |
| 31 | type mmsghdr C.struct_mmsghdr |
| 32 | |
| 33 | type cmsghdr C.struct_cmsghdr |
| 34 | |
| 35 | type sockaddrInet C.struct_sockaddr_in |
| 36 | |
| 37 | type sockaddrInet6 C.struct_sockaddr_in6 |
| 38 | |
| 39 | const ( |
| 40 | sizeofIovec = C.sizeof_struct_iovec |
| 41 | sizeofMsghdr = C.sizeof_struct_msghdr |
| 42 | sizeofMmsghdr = C.sizeof_struct_mmsghdr |
| 43 | sizeofCmsghdr = C.sizeof_struct_cmsghdr |
| 44 | |
| 45 | sizeofSockaddrInet = C.sizeof_struct_sockaddr_in |
| 46 | sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 |
| 47 | ) |