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 README.md
11 // +godefs map struct_in_addr [4]byte /* in_addr */
12 // +godefs map struct_in6_addr [16]byte /* in6_addr */
24 #include <sys/param.h>
25 #include <sys/types.h>
26 #include <sys/event.h>
28 #include <sys/mount.h>
29 #include <sys/ptrace.h>
30 #include <sys/resource.h>
31 #include <sys/select.h>
32 #include <sys/signal.h>
33 #include <sys/socket.h>
41 #include <net/if_dl.h>
42 #include <net/route.h>
43 #include <netinet/in.h>
44 #include <netinet/icmp6.h>
45 #include <netinet/tcp.h>
48 sizeofPtr = sizeof(void*),
52 struct sockaddr s1; // this one gets used for fields
53 struct sockaddr_in s2; // these pad it out
54 struct sockaddr_in6 s3;
55 struct sockaddr_un s4;
56 struct sockaddr_dl s5;
61 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
67 // Machine characteristics; for internal use.
70 sizeofPtr = C.sizeofPtr
71 sizeofShort = C.sizeof_short
72 sizeofInt = C.sizeof_int
73 sizeofLong = C.sizeof_long
74 sizeofLongLong = C.sizeof_longlong
83 _C_long_long C.longlong
88 type Timespec C.struct_timespec
90 type Timeval C.struct_timeval
94 type Rusage C.struct_rusage
96 type Rlimit C.struct_rlimit
102 const ( // Directory mode bits
110 S_IFSOCK = C.S_IFSOCK
119 type Stat_t C.struct_stat
121 type Statfs_t C.struct_statfs
123 type Flock_t C.struct_flock
125 type Dirent C.struct_dirent
131 type RawSockaddrInet4 C.struct_sockaddr_in
133 type RawSockaddrInet6 C.struct_sockaddr_in6
135 type RawSockaddrUnix C.struct_sockaddr_un
137 type RawSockaddrDatalink C.struct_sockaddr_dl
139 type RawSockaddr C.struct_sockaddr
141 type RawSockaddrAny C.struct_sockaddr_any
143 type _Socklen C.socklen_t
145 type Linger C.struct_linger
147 type Iovec C.struct_iovec
149 type IPMreq C.struct_ip_mreq
151 type IPv6Mreq C.struct_ipv6_mreq
153 type Msghdr C.struct_msghdr
155 type Cmsghdr C.struct_cmsghdr
157 type Inet6Pktinfo C.struct_in6_pktinfo
159 type IPv6MTUInfo C.struct_ip6_mtuinfo
161 type ICMPv6Filter C.struct_icmp6_filter
164 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
165 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
166 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
167 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
168 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
169 SizeofLinger = C.sizeof_struct_linger
170 SizeofIPMreq = C.sizeof_struct_ip_mreq
171 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
172 SizeofMsghdr = C.sizeof_struct_msghdr
173 SizeofCmsghdr = C.sizeof_struct_cmsghdr
174 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
175 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
176 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
182 PTRACE_TRACEME = C.PT_TRACE_ME
183 PTRACE_CONT = C.PT_CONTINUE
184 PTRACE_KILL = C.PT_KILL
187 // Events (kqueue, kevent)
189 type Kevent_t C.struct_kevent
195 // Routing and interface messages
198 SizeofIfMsghdr = C.sizeof_struct_if_msghdr
199 SizeofIfData = C.sizeof_struct_if_data
200 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
201 SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
202 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
203 SizeofRtMetrics = C.sizeof_struct_rt_metrics
206 type IfMsghdr C.struct_if_msghdr
208 type IfData C.struct_if_data
210 type IfaMsghdr C.struct_ifa_msghdr
212 type IfAnnounceMsghdr C.struct_if_announcemsghdr
214 type RtMsghdr C.struct_rt_msghdr
216 type RtMetrics C.struct_rt_metrics
218 type Mclpool C.struct_mclpool
220 // Berkeley packet filter
223 SizeofBpfVersion = C.sizeof_struct_bpf_version
224 SizeofBpfStat = C.sizeof_struct_bpf_stat
225 SizeofBpfProgram = C.sizeof_struct_bpf_program
226 SizeofBpfInsn = C.sizeof_struct_bpf_insn
227 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
230 type BpfVersion C.struct_bpf_version
232 type BpfStat C.struct_bpf_stat
234 type BpfProgram C.struct_bpf_program
236 type BpfInsn C.struct_bpf_insn
238 type BpfHdr C.struct_bpf_hdr
240 type BpfTimeval C.struct_bpf_timeval
244 type Termios C.struct_termios