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 */
17 #define _WANT_FREEBSD11_STAT 1
18 #define _WANT_FREEBSD11_STATFS 1
19 #define _WANT_FREEBSD11_DIRENT 1
20 #define _WANT_FREEBSD11_KEVENT 1
29 #include <sys/capsicum.h>
30 #include <sys/event.h>
32 #include <sys/mount.h>
33 #include <sys/param.h>
34 #include <sys/ptrace.h>
35 #include <sys/resource.h>
36 #include <sys/select.h>
37 #include <sys/signal.h>
38 #include <sys/socket.h>
41 #include <sys/types.h>
43 #include <sys/utsname.h>
47 #include <net/if_dl.h>
48 #include <net/route.h>
49 #include <netinet/in.h>
50 #include <netinet/icmp6.h>
51 #include <netinet/tcp.h>
54 sizeofPtr = sizeof(void*),
58 struct sockaddr s1; // this one gets used for fields
59 struct sockaddr_in s2; // these pad it out
60 struct sockaddr_in6 s3;
61 struct sockaddr_un s4;
62 struct sockaddr_dl s5;
67 char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
70 // This structure is a duplicate of if_data on FreeBSD 8-STABLE.
71 // See /usr/include/net/if.h.
77 u_char ifi_link_state;
78 u_char ifi_spare_char1;
79 u_char ifi_spare_char2;
88 u_long ifi_collisions;
96 // FIXME: these are now unions, so maybe need to change definitions?
100 struct timeval ifi_lastchange;
103 // This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE.
104 // See /usr/include/net/if.h.
112 struct if_data8 ifm_data;
117 // Machine characteristics
120 SizeofPtr = C.sizeofPtr
121 SizeofShort = C.sizeof_short
122 SizeofInt = C.sizeof_int
123 SizeofLong = C.sizeof_long
124 SizeofLongLong = C.sizeof_longlong
133 _C_long_long C.longlong
138 type Timespec C.struct_timespec
140 type Timeval C.struct_timeval
144 type Rusage C.struct_rusage
146 type Rlimit C.struct_rlimit
153 _statfsVersion = C.STATFS_VERSION
154 _dirblksiz = C.DIRBLKSIZ
157 type Stat_t C.struct_stat
159 type stat_freebsd11_t C.struct_freebsd11_stat
161 type Statfs_t C.struct_statfs
163 type statfs_freebsd11_t C.struct_freebsd11_statfs
165 type Flock_t C.struct_flock
167 type Dirent C.struct_dirent
169 type dirent_freebsd11 C.struct_freebsd11_dirent
171 type Fsid C.struct_fsid
173 // File system limits
182 FADV_NORMAL = C.POSIX_FADV_NORMAL
183 FADV_RANDOM = C.POSIX_FADV_RANDOM
184 FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
185 FADV_WILLNEED = C.POSIX_FADV_WILLNEED
186 FADV_DONTNEED = C.POSIX_FADV_DONTNEED
187 FADV_NOREUSE = C.POSIX_FADV_NOREUSE
192 type RawSockaddrInet4 C.struct_sockaddr_in
194 type RawSockaddrInet6 C.struct_sockaddr_in6
196 type RawSockaddrUnix C.struct_sockaddr_un
198 type RawSockaddrDatalink C.struct_sockaddr_dl
200 type RawSockaddr C.struct_sockaddr
202 type RawSockaddrAny C.struct_sockaddr_any
204 type _Socklen C.socklen_t
206 type Linger C.struct_linger
208 type Iovec C.struct_iovec
210 type IPMreq C.struct_ip_mreq
212 type IPMreqn C.struct_ip_mreqn
214 type IPv6Mreq C.struct_ipv6_mreq
216 type Msghdr C.struct_msghdr
218 type Cmsghdr C.struct_cmsghdr
220 type Inet6Pktinfo C.struct_in6_pktinfo
222 type IPv6MTUInfo C.struct_ip6_mtuinfo
224 type ICMPv6Filter C.struct_icmp6_filter
227 SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
228 SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
229 SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
230 SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
231 SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
232 SizeofLinger = C.sizeof_struct_linger
233 SizeofIPMreq = C.sizeof_struct_ip_mreq
234 SizeofIPMreqn = C.sizeof_struct_ip_mreqn
235 SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
236 SizeofMsghdr = C.sizeof_struct_msghdr
237 SizeofCmsghdr = C.sizeof_struct_cmsghdr
238 SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
239 SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
240 SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
246 PTRACE_TRACEME = C.PT_TRACE_ME
247 PTRACE_CONT = C.PT_CONTINUE
248 PTRACE_KILL = C.PT_KILL
251 // Events (kqueue, kevent)
253 type Kevent_t C.struct_kevent_freebsd11
259 // Routing and interface messages
262 sizeofIfMsghdr = C.sizeof_struct_if_msghdr
263 SizeofIfMsghdr = C.sizeof_struct_if_msghdr8
264 sizeofIfData = C.sizeof_struct_if_data
265 SizeofIfData = C.sizeof_struct_if_data8
266 SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
267 SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
268 SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
269 SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
270 SizeofRtMetrics = C.sizeof_struct_rt_metrics
273 type ifMsghdr C.struct_if_msghdr
275 type IfMsghdr C.struct_if_msghdr8
277 type ifData C.struct_if_data
279 type IfData C.struct_if_data8
281 type IfaMsghdr C.struct_ifa_msghdr
283 type IfmaMsghdr C.struct_ifma_msghdr
285 type IfAnnounceMsghdr C.struct_if_announcemsghdr
287 type RtMsghdr C.struct_rt_msghdr
289 type RtMetrics C.struct_rt_metrics
291 // Berkeley packet filter
294 SizeofBpfVersion = C.sizeof_struct_bpf_version
295 SizeofBpfStat = C.sizeof_struct_bpf_stat
296 SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf
297 SizeofBpfProgram = C.sizeof_struct_bpf_program
298 SizeofBpfInsn = C.sizeof_struct_bpf_insn
299 SizeofBpfHdr = C.sizeof_struct_bpf_hdr
300 SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header
303 type BpfVersion C.struct_bpf_version
305 type BpfStat C.struct_bpf_stat
307 type BpfZbuf C.struct_bpf_zbuf
309 type BpfProgram C.struct_bpf_program
311 type BpfInsn C.struct_bpf_insn
313 type BpfHdr C.struct_bpf_hdr
315 type BpfZbufHeader C.struct_bpf_zbuf_header
319 type Termios C.struct_termios
321 type Winsize C.struct_winsize
323 // fchmodat-like syscalls.
326 AT_FDCWD = C.AT_FDCWD
327 AT_REMOVEDIR = C.AT_REMOVEDIR
328 AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
329 AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
334 type PollFd C.struct_pollfd
340 POLLINIGNEOF = C.POLLINIGNEOF
341 POLLNVAL = C.POLLNVAL
344 POLLRDBAND = C.POLLRDBAND
345 POLLRDNORM = C.POLLRDNORM
346 POLLWRBAND = C.POLLWRBAND
347 POLLWRNORM = C.POLLWRNORM
352 type CapRights C.struct_cap_rights
356 type Utsname C.struct_utsname