OSDN Git Service

new repo
[bytom/vapor.git] / vendor / golang.org / x / net / internal / socket / defs_linux.go
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 <linux/in.h>
14 #include <linux/in6.h>
15
16 #define _GNU_SOURCE
17 #include <sys/socket.h>
18 */
19 import "C"
20
21 const (
22         sysAF_UNSPEC = C.AF_UNSPEC
23         sysAF_INET   = C.AF_INET
24         sysAF_INET6  = C.AF_INET6
25
26         sysSOCK_RAW = C.SOCK_RAW
27 )
28
29 type iovec C.struct_iovec
30
31 type msghdr C.struct_msghdr
32
33 type mmsghdr C.struct_mmsghdr
34
35 type cmsghdr C.struct_cmsghdr
36
37 type sockaddrInet C.struct_sockaddr_in
38
39 type sockaddrInet6 C.struct_sockaddr_in6
40
41 const (
42         sizeofIovec   = C.sizeof_struct_iovec
43         sizeofMsghdr  = C.sizeof_struct_msghdr
44         sizeofMmsghdr = C.sizeof_struct_mmsghdr
45         sizeofCmsghdr = C.sizeof_struct_cmsghdr
46
47         sizeofSockaddrInet  = C.sizeof_struct_sockaddr_in
48         sizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
49 )