1 // Copyright 2009 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.
8 Input to cgo -godefs. See also mkerrors.sh and mkall.sh
11 // +godefs map struct_in_addr [4]byte /* in_addr */
12 // +godefs map struct_in6_addr [16]byte /* in6_addr */
18 // These defines ensure that builds done on newer versions of Solaris are
19 // backwards-compatible with older versions of Solaris and
20 // OpenSolaris-based derivatives.
21 #define __USE_SUNOS_SOCKETS__ // msghdr
22 #define __USE_LEGACY_PROTOTYPES__ // iovec
31 #include <sys/mount.h>
32 #include <sys/param.h>
33 #include <sys/resource.h>
34 #include <sys/select.h>
35 #include <sys/signal.h>
36 #include <sys/socket.h>
39 #include <sys/types.h>
44 #include <net/if_dl.h>
45 #include <net/route.h>
46 #include <netinet/in.h>
47 #include <netinet/icmp6.h>
48 #include <netinet/tcp.h>
51 sizeofPtr = sizeof(void*),
55 struct sockaddr s1; // this one gets used for fields
56 struct sockaddr_in s2; // these pad it out
57 struct sockaddr_in6 s3;
58 struct sockaddr_un s4;
59 struct sockaddr_dl s5;
64 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
70 // Machine characteristics; for internal use.
73 sizeofPtr = C.sizeofPtr
74 sizeofShort = C.sizeof_short
75 sizeofInt = C.sizeof_int
76 sizeofLong = C.sizeof_long
77 sizeofLongLong = C.sizeof_longlong
87 _C_long_long C.longlong
92 type Timespec C.struct_timespec
94 type Timeval C.struct_timeval
96 type Timeval32 C.struct_timeval32
100 type Rusage C.struct_rusage
102 type Rlimit C.struct_rlimit
110 const ( // Directory mode bits
118 S_IFSOCK = C.S_IFSOCK
129 type Stat_t C.struct_stat
131 type Flock_t C.struct_flock
133 type Dirent C.struct_dirent
137 type RawSockaddrInet4 C.struct_sockaddr_in
139 type RawSockaddrInet6 C.struct_sockaddr_in6
141 type RawSockaddrUnix C.struct_sockaddr_un
143 type RawSockaddrDatalink C.struct_sockaddr_dl
145 type RawSockaddr C.struct_sockaddr
147 type RawSockaddrAny C.struct_sockaddr_any
149 type _Socklen C.socklen_t
151 type Linger C.struct_linger
153 type Iovec C.struct_iovec
155 type IPMreq C.struct_ip_mreq
157 type IPv6Mreq C.struct_ipv6_mreq
159 type Msghdr C.struct_msghdr
161 type Cmsghdr C.struct_cmsghdr
163 type Inet6Pktinfo C.struct_in6_pktinfo
165 type IPv6MTUInfo C.struct_ip6_mtuinfo
167 type ICMPv6Filter C.struct_icmp6_filter
170 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
171 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
172 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
173 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
174 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
175 SizeofLinger = C.sizeof_struct_linger
176 SizeofIPMreq = C.sizeof_struct_ip_mreq
177 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
178 SizeofMsghdr = C.sizeof_struct_msghdr
179 SizeofCmsghdr = C.sizeof_struct_cmsghdr
180 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
181 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
182 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
189 // Routing and interface messages
192 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
193 SizeofIfData = C.sizeof_struct_if_data
194 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
195 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
196 SizeofRtMetrics = C.sizeof_struct_rt_metrics
199 type IfMsghdr C.struct_if_msghdr
201 type IfData C.struct_if_data
203 type IfaMsghdr C.struct_ifa_msghdr
205 type RtMsghdr C.struct_rt_msghdr
207 type RtMetrics C.struct_rt_metrics
209 // Berkeley packet filter
212 SizeofBpfVersion = C.sizeof_struct_bpf_version
213 SizeofBpfStat = C.sizeof_struct_bpf_stat
214 SizeofBpfProgram = C.sizeof_struct_bpf_program
215 SizeofBpfInsn = C.sizeof_struct_bpf_insn
216 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
219 type BpfVersion C.struct_bpf_version
221 type BpfStat C.struct_bpf_stat
223 type BpfProgram C.struct_bpf_program
225 type BpfInsn C.struct_bpf_insn
227 type BpfTimeval C.struct_bpf_timeval
229 type BpfHdr C.struct_bpf_hdr
234 _AT_FDCWD = C.AT_FDCWD
239 type Termios C.struct_termios